@undp/data-viz 2.3.19 → 2.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/BarGraph.cjs +1 -1
  2. package/dist/BarGraph.cjs.map +1 -1
  3. package/dist/BarGraph.js +1360 -1363
  4. package/dist/BarGraph.js.map +1 -1
  5. package/dist/BeeSwarmChart.cjs +1 -1
  6. package/dist/BeeSwarmChart.cjs.map +1 -1
  7. package/dist/BeeSwarmChart.js +302 -305
  8. package/dist/BeeSwarmChart.js.map +1 -1
  9. package/dist/BiVariateChoroplethMap.cjs +1 -1
  10. package/dist/BiVariateChoroplethMap.cjs.map +1 -1
  11. package/dist/BiVariateChoroplethMap.js +4 -4
  12. package/dist/BiVariateChoroplethMap.js.map +1 -1
  13. package/dist/BulletChart.cjs +1 -1
  14. package/dist/BulletChart.cjs.map +1 -1
  15. package/dist/BulletChart.js +591 -594
  16. package/dist/BulletChart.js.map +1 -1
  17. package/dist/ChoroplethMap.cjs +1 -1
  18. package/dist/ChoroplethMap.cjs.map +1 -1
  19. package/dist/ChoroplethMap.js +4 -4
  20. package/dist/ChoroplethMap.js.map +1 -1
  21. package/dist/CirclePackingGraph.cjs +1 -1
  22. package/dist/CirclePackingGraph.js +1 -1
  23. package/dist/DotDensityMap.cjs +1 -1
  24. package/dist/DotDensityMap.cjs.map +1 -1
  25. package/dist/DotDensityMap.js +255 -258
  26. package/dist/DotDensityMap.js.map +1 -1
  27. package/dist/DumbbellChart.cjs +1 -1
  28. package/dist/DumbbellChart.cjs.map +1 -1
  29. package/dist/DumbbellChart.js +553 -556
  30. package/dist/DumbbellChart.js.map +1 -1
  31. package/dist/{GraphEl-Dorm_qQE.js → GraphEl-B73N4RIA.js} +2 -2
  32. package/dist/{GraphEl-Dorm_qQE.js.map → GraphEl-B73N4RIA.js.map} +1 -1
  33. package/dist/{GraphEl-D8WRC8-j.cjs → GraphEl-Lt1og0C-.cjs} +2 -2
  34. package/dist/{GraphEl-D8WRC8-j.cjs.map → GraphEl-Lt1og0C-.cjs.map} +1 -1
  35. package/dist/GriddedGraphs.cjs +1 -1
  36. package/dist/GriddedGraphs.js +1 -1
  37. package/dist/Histogram.cjs +1 -1
  38. package/dist/Histogram.js +1 -1
  39. package/dist/HybridMap.cjs +1 -1
  40. package/dist/HybridMap.cjs.map +1 -1
  41. package/dist/HybridMap.js +310 -313
  42. package/dist/HybridMap.js.map +1 -1
  43. package/dist/MultiLineAltChart.cjs +1 -1
  44. package/dist/MultiLineAltChart.cjs.map +1 -1
  45. package/dist/MultiLineAltChart.js +269 -272
  46. package/dist/MultiLineAltChart.js.map +1 -1
  47. package/dist/MultiLineChart.cjs +1 -1
  48. package/dist/MultiLineChart.cjs.map +1 -1
  49. package/dist/MultiLineChart.js +319 -322
  50. package/dist/MultiLineChart.js.map +1 -1
  51. package/dist/RadarChart.cjs +1 -1
  52. package/dist/RadarChart.cjs.map +1 -1
  53. package/dist/RadarChart.js +3 -3
  54. package/dist/RadarChart.js.map +1 -1
  55. package/dist/SankeyChart.cjs +1 -1
  56. package/dist/SankeyChart.cjs.map +1 -1
  57. package/dist/SankeyChart.js +274 -280
  58. package/dist/SankeyChart.js.map +1 -1
  59. package/dist/ScatterPlot.cjs +1 -1
  60. package/dist/ScatterPlot.cjs.map +1 -1
  61. package/dist/ScatterPlot.js +341 -344
  62. package/dist/ScatterPlot.js.map +1 -1
  63. package/dist/SingleGraphDashboard.cjs +1 -1
  64. package/dist/SingleGraphDashboard.js +1 -1
  65. package/dist/SlopeChart.cjs +1 -1
  66. package/dist/SlopeChart.cjs.map +1 -1
  67. package/dist/SlopeChart.js +251 -254
  68. package/dist/SlopeChart.js.map +1 -1
  69. package/dist/StripChart.cjs +1 -1
  70. package/dist/StripChart.cjs.map +1 -1
  71. package/dist/StripChart.js +292 -295
  72. package/dist/StripChart.js.map +1 -1
  73. package/dist/ThreeDGlobe.cjs +1 -1
  74. package/dist/ThreeDGlobe.cjs.map +1 -1
  75. package/dist/ThreeDGlobe.js +3 -3
  76. package/dist/ThreeDGlobe.js.map +1 -1
  77. package/dist/TreeMapGraph.cjs +1 -1
  78. package/dist/TreeMapGraph.cjs.map +1 -1
  79. package/dist/TreeMapGraph.js +196 -199
  80. package/dist/TreeMapGraph.js.map +1 -1
  81. package/dist/WaterfallChart.cjs +1 -1
  82. package/dist/WaterfallChart.cjs.map +1 -1
  83. package/dist/WaterfallChart.js +274 -277
  84. package/dist/WaterfallChart.js.map +1 -1
  85. package/dist/index-B0Awa_de.js +377 -0
  86. package/dist/index-B0Awa_de.js.map +1 -0
  87. package/dist/index-CP8cmNzt.cjs +2 -0
  88. package/dist/index-CP8cmNzt.cjs.map +1 -0
  89. package/dist/index.cjs +1 -1
  90. package/dist/index.js +1 -1
  91. package/package.json +1 -1
  92. package/dist/index-Bdo_HXb_.cjs +0 -2
  93. package/dist/index-Bdo_HXb_.cjs.map +0 -1
  94. package/dist/index-CGrBpeUa.js +0 -380
  95. package/dist/index-CGrBpeUa.js.map +0 -1
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-D4pAp7u0.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-CH5tqj4q.cjs"),te=require("./Spinner-WHzzloYQ.cjs"),m=require("./DropdownSelect-CX1yMemd.cjs"),le=require("./GraphContainer-Cul9b74X.cjs"),oe=require("./GraphEl-D8WRC8-j.cjs"),S=require("./fetchAndParseData-QTF6tjij.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-BFdha9Dx.cjs"),W=require("./getUniqValue-NX8DgwND.cjs"),ne=require("./GraphHeader.cjs"),ie=require("./GraphFooter.cjs"),z=require("./filterData-T5DQBE9b.cjs"),se=require("./ColorLegend.cjs"),ue=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function ce(J){const{graphSettings:t,dataSettings:n,filters:T,graphType:$,dataTransform:D,graphDataConfiguration:s,noOfColumns:y,columnGridBy:E,dataFilters:q,showCommonColorScale:A,minGraphHeight:K,minGraphWidth:F,debugMode:w,dataSelectionOptions:O,advancedDataSelectionOptions:k,readableHeader:Q,noOfFiltersPerRow:f=4,uiMode:d="normal",theme:X="light"}=J,[v,Y]=i.useState(void 0),[g,Z]=i.useState(void 0),[b,_]=i.useState([]),M=i.useRef(null),[x,C]=i.useState(s),[j,L]=i.useState([]),[h,R]=i.useState({}),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),P=i.useMemo(()=>!g||j.length===0?g:g.filter(r=>j.every(a=>a.value&&G.flattenDeep([a.value]).length>0?ae.intersection(G.flattenDeep([r[a.filter]]),G.flattenDeep([a.value]).map(l=>l.value)).length>0:!0)),[j,g]);i.useEffect(()=>{Y(P)},[P]);const U=i.useEffectEvent(()=>{const e=(T||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:B.transformDefaultValue(r.defaultValue),value:B.transformDefaultValue(r.defaultValue),availableValues:W.getUniqValue(g,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));L(e)});i.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await S.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?await S.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):await S.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):await S.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await S.transformColumnsToArray(n.data,n.columnsToArray);Z(r)}catch(r){console.error("Data fetching error:",r)}})(),U()},[n,w]),i.useEffect(()=>{U()},[T,g]);const ee=i.useEffectEvent(()=>{const e=W.getUniqValue(g,E);_(e)});i.useEffect(()=>{ee()},[E,g]),i.useEffect(()=>{C(s)},[s]);const I=i.useCallback((e,r)=>{L(a=>a.map(l=>l.filter===e?{...l,value:r}:l))},[]);return o.jsxRuntimeExports.jsxs(le.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel||"This is a gridded graph",backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,children:[h?.graphTitle||h?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?o.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:h?.styles?.title||t?.styles?.title,description:h?.styles?.description||t?.styles?.description},classNames:{title:h?.classNames?.title||t?.classNames?.title,description:h?.classNames?.description||t?.classNames?.description},graphTitle:h?.graphTitle||t?.graphTitle,graphDescription:h?.graphDescription||t?.graphDescription,width:h?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&v&&v.length>0?v:null}):null,v&&b.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[j.length!==0||(O||[]).length!==0||(k||[]).length!==0?o.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[k?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.options.map(a=>({...a,value:a.label})),isClearable:!1,isSearchable:!0,variant:d,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),C(a?.dataConfiguration)}}):o.jsxRuntimeExports.jsx(u.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:d,onValueChange:a=>{const l=e.options[e.options.findIndex(p=>p.label===a)];R(l.graphSettings||{}),C(l.dataConfiguration)},children:e.options.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),O?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),u.checkIfMultiple(e.chartConfigId,x||[])?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isMulti:!0,variant:d,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]):void 0,filterOption:m.Du(N),onChange:a=>{const l={columnId:a.map(c=>c.value),chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},isRtl:t?.language==="ar"||t?.language==="he"}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]).map(a=>a.value):[],onValueChange:a=>{const l={columnId:a||[],chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:a.label,value:a.label},l))}):e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:a=>{const l={columnId:a?.value,chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);R(a?.graphSettings||{}),C(p)}}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(V=>V.label===a)],p={columnId:l.value,chartConfigId:e.chartConfigId},c=x?.map(V=>V.chartConfigId===p.chartConfigId?p:V);R(l.graphSettings||{}),C(c)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),j?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,flexWrap:"wrap"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:e.defaultValue.value,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>l.value===a))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:`${a.label}`,value:`${a.value}`},l))}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>a.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:`${a.label}`,value:`${a.value}`},l))}),e.allowSelectAll?o.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{I(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r))]}):null,A!==!1&&t?.showColorScale!==!1?o.jsxRuntimeExports.jsx(se.ColorLegend,{width:t?.width,colorLegendTitle:t?.colorLegendTitle,colors:t?.colors||t?.lineColors||re.Colors[t?.theme||"light"].categoricalColors.colors,colorDomain:t?.colorDomain||t?.labels||[],showNAColor:t?.showNAColor===void 0||t?.showNAColor===null?!0:t?.showNAColor}):null,o.jsxRuntimeExports.jsx("div",{className:`flex flex-wrap gap-4 justify-center ${t?.language==="ar"||t?.language==="he"?"flex-row-reverse":"flex-row"}`,children:b.map((e,r)=>o.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(y||Math.min(4,b.length||0))}% - ${((y||Math.min(4,b.length||0))-1)/(y||Math.min(4,b.length||0))}rem)`,minWidth:ue.checkIfNullOrUndefined(F)?"280px":`${F}px`},children:o.jsxRuntimeExports.jsx(oe.GraphEl,{graph:$,graphDataConfiguration:x,graphData:H.transformDataForGraph(D?H.transformDataForAggregation(z.filterData(v,q||[]).filter(a=>a[E]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(v,q||[]).filter(a=>a[E]===e),$,x)||[],debugMode:w,settings:{...t||{},...h,theme:t?.theme||X,width:void 0,height:void 0,relativeHeight:t?.relativeHeight||.67,minHeight:K,graphTitle:`${e}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:t?.showColorScale===!1?!1:A===!1},readableHeader:Q||[]})},r))})]}):o.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:o.jsxRuntimeExports.jsx(te.w,{})}),t?.sources||t?.footNote?o.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:t?.styles?.footnote,source:t?.styles?.source},classNames:{footnote:t?.classNames?.footnote,source:t?.classNames?.source},sources:t?.sources,footNote:t?.footNote,width:t?.width}):null]})}exports.GriddedGraphs=ce;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const o=require("./index-CHPV5EwG-D4pAp7u0.cjs"),i=require("react"),ae=require("./index-CyZ1lmi_.cjs"),G=require("./index-BS2TADPj.cjs"),u=require("./checkIfMultiple-CH5tqj4q.cjs"),te=require("./Spinner-WHzzloYQ.cjs"),m=require("./DropdownSelect-CX1yMemd.cjs"),le=require("./GraphContainer-Cul9b74X.cjs"),oe=require("./GraphEl-Lt1og0C-.cjs"),S=require("./fetchAndParseData-QTF6tjij.cjs"),re=require("./Colors.cjs"),H=require("./transformDataForAggregation-BFdha9Dx.cjs"),W=require("./getUniqValue-NX8DgwND.cjs"),ne=require("./GraphHeader.cjs"),ie=require("./GraphFooter.cjs"),z=require("./filterData-T5DQBE9b.cjs"),se=require("./ColorLegend.cjs"),ue=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),B=require("./transformDataForSelect-YmStusCI.cjs");function ce(J){const{graphSettings:t,dataSettings:n,filters:T,graphType:$,dataTransform:D,graphDataConfiguration:s,noOfColumns:y,columnGridBy:E,dataFilters:q,showCommonColorScale:A,minGraphHeight:K,minGraphWidth:F,debugMode:w,dataSelectionOptions:O,advancedDataSelectionOptions:k,readableHeader:Q,noOfFiltersPerRow:f=4,uiMode:d="normal",theme:X="light"}=J,[v,Y]=i.useState(void 0),[g,Z]=i.useState(void 0),[b,_]=i.useState([]),M=i.useRef(null),[x,C]=i.useState(s),[j,L]=i.useState([]),[h,R]=i.useState({}),N=i.useMemo(()=>({ignoreCase:!0,ignoreAccents:!0,trim:!0}),[]),P=i.useMemo(()=>!g||j.length===0?g:g.filter(r=>j.every(a=>a.value&&G.flattenDeep([a.value]).length>0?ae.intersection(G.flattenDeep([r[a.filter]]),G.flattenDeep([a.value]).map(l=>l.value)).length>0:!0)),[j,g]);i.useEffect(()=>{Y(P)},[P]);const U=i.useEffectEvent(()=>{const e=(T||[]).map(r=>({filter:r.column,label:r.label||`Filter by ${r.column}`,singleSelect:r.singleSelect,clearable:r.clearable,ui:r.ui,defaultValue:B.transformDefaultValue(r.defaultValue),value:B.transformDefaultValue(r.defaultValue),availableValues:W.getUniqValue(g,r.column).filter(a=>!r.excludeValues?.includes(`${a}`)).map(a=>({value:a,label:a})),allowSelectAll:r.allowSelectAll,width:r.width}));L(e)});i.useEffect(()=>{(async()=>{try{const r=n.dataURL?typeof n.dataURL=="string"?n.fileType==="json"?await S.fetchAndParseJSON(n.dataURL,n.columnsToArray,n.dataTransformation,w):n.fileType==="api"?await S.fetchAndTransformDataFromAPI(n.dataURL,n.apiHeaders,n.columnsToArray,n.dataTransformation,w):await S.fetchAndParseCSV(n.dataURL,n.dataTransformation,n.columnsToArray,w,n.delimiter,!0):await S.fetchAndParseMultipleDataSources(n.dataURL,n.idColumnTitle):await S.transformColumnsToArray(n.data,n.columnsToArray);Z(r)}catch(r){console.error("Data fetching error:",r)}})(),U()},[n,w]),i.useEffect(()=>{U()},[T,g]);const ee=i.useEffectEvent(()=>{const e=W.getUniqValue(g,E);_(e)});i.useEffect(()=>{ee()},[E,g]),i.useEffect(()=>{C(s)},[s]);const I=i.useCallback((e,r)=>{L(a=>a.map(l=>l.filter===e?{...l,value:r}:l))},[]);return o.jsxRuntimeExports.jsxs(le.GraphContainer,{className:t?.classNames?.graphContainer,style:t?.styles?.graphContainer,id:t?.graphID,ref:M,"aria-label":t?.ariaLabel||"This is a gridded graph",backgroundColor:t?.backgroundColor??!1,theme:t?.theme||"light",language:t?.language||"en",width:t?.width,height:t?.height,padding:t?.padding,children:[h?.graphTitle||h?.graphDescription||t?.graphTitle||t?.graphDescription||t?.graphDownload||t?.dataDownload?o.jsxRuntimeExports.jsx(ne.GraphHeader,{styles:{title:h?.styles?.title||t?.styles?.title,description:h?.styles?.description||t?.styles?.description},classNames:{title:h?.classNames?.title||t?.classNames?.title,description:h?.classNames?.description||t?.classNames?.description},graphTitle:h?.graphTitle||t?.graphTitle,graphDescription:h?.graphDescription||t?.graphDescription,width:h?.width||t?.width,graphDownload:t?.graphDownload?M:void 0,dataDownload:t?.dataDownload&&v&&v.length>0?v:null}):null,v&&b.length>0?o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[j.length!==0||(O||[]).length!==0||(k||[]).length!==0?o.jsxRuntimeExports.jsxs("div",{className:"flex flex-wrap items-start gap-x-4 gap-y-0 w-full",children:[k?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||"Graph by"}),e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.options.map(a=>({...a,value:a.label})),isClearable:!1,isSearchable:!0,variant:d,controlShouldRenderValue:!0,defaultValue:e.defaultValue?{...e.defaultValue,value:e.defaultValue?.label}:{...e.options[0],value:e.options[0].label},onChange:a=>{R(a?.graphSettings||{}),C(a?.dataConfiguration)}}):o.jsxRuntimeExports.jsx(u.ye,{defaultValue:e.defaultValue?.label||e.options[0].label,variant:d,onValueChange:a=>{const l=e.options[e.options.findIndex(p=>p.label===a)];R(l.graphSettings||{}),C(l.dataConfiguration)},children:e.options.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),O?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,minWidth:"240px"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label||`Visualize ${e.chartConfigId} by`}),u.checkIfMultiple(e.chartConfigId,x||[])?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isMulti:!0,variant:d,isSearchable:!0,controlShouldRenderValue:!0,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]):void 0,filterOption:m.Du(N),onChange:a=>{const l={columnId:a.map(c=>c.value),chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},isRtl:t?.language==="ar"||t?.language==="he"}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:s?s[s.findIndex(a=>a.chartConfigId===e.chartConfigId)].columnId.map(a=>e.allowedColumnIds[e.allowedColumnIds.findIndex(l=>l.value===a)]).map(a=>a.value):[],onValueChange:a=>{const l={columnId:a||[],chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);C(p)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:a.label,value:a.label},l))}):e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.allowedColumnIds,isClearable:!1,isSearchable:!0,variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)]:void 0,controlShouldRenderValue:!0,onChange:a=>{const l={columnId:a?.value,chartConfigId:e.chartConfigId},p=x?.map(c=>c.chartConfigId===l.chartConfigId?l:c);R(a?.graphSettings||{}),C(p)}}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:s?e.allowedColumnIds[e.allowedColumnIds.findIndex(a=>a.value===s[s.findIndex(l=>l.chartConfigId===e.chartConfigId)].columnId)].label:"",onValueChange:a=>{const l=e.allowedColumnIds[e.allowedColumnIds.findIndex(V=>V.label===a)],p={columnId:l.value,chartConfigId:e.chartConfigId},c=x?.map(V=>V.chartConfigId===p.chartConfigId?p:V);R(l.graphSettings||{}),C(c)},children:e.allowedColumnIds.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:a.label,value:a.label},l))})]},r)),j?.map((e,r)=>o.jsxRuntimeExports.jsxs("div",{style:{width:e.width||`calc(${100/f}% - ${(f-1)/f}rem)`,flexGrow:e.width?0:1,flexShrink:e.ui!=="radio"||e.width?0:1,flexWrap:"wrap"},className:"pb-4",children:[o.jsxRuntimeExports.jsx(u.b,{className:"mb-2",children:e.label}),e.singleSelect?e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.ye,{variant:d,defaultValue:e.defaultValue.value,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>l.value===a))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.he,{label:`${a.label}`,value:`${a.value}`},l))}):o.jsxRuntimeExports.jsxs(o.jsxRuntimeExports.Fragment,{children:[e.ui!=="radio"?o.jsxRuntimeExports.jsx(m.ja,{options:e.availableValues,variant:d,size:"sm",isMulti:!0,isClearable:e.clearable===void 0?!0:e.clearable,isSearchable:!0,controlShouldRenderValue:!0,filterOption:m.Du(N),onChange:a=>{I(e.filter,a)},value:e.value,defaultValue:e.defaultValue}):o.jsxRuntimeExports.jsx(u.$,{variant:d,defaultValue:e.defaultValue?e.defaultValue.map(a=>`${a.value}`):[],value:e.value?e.value.map(a=>`${a.value}`):void 0,onValueChange:a=>{I(e.filter,e.availableValues.filter(l=>a.indexOf(`${l.value}`)!==-1))},children:e.availableValues.map((a,l)=>o.jsxRuntimeExports.jsx(u.P,{label:`${a.label}`,value:`${a.value}`},l))}),e.allowSelectAll?o.jsxRuntimeExports.jsx("button",{type:"button",className:"bg-transparent border-0 p-0 mt-2 cursor-pointer text-primary-blue-600 dark:text-primary-blue-400",onClick:()=>{I(e.filter,e.availableValues)},children:"Select all options"}):null]})]},r))]}):null,A!==!1&&t?.showColorScale!==!1?o.jsxRuntimeExports.jsx(se.ColorLegend,{width:t?.width,colorLegendTitle:t?.colorLegendTitle,colors:t?.colors||t?.lineColors||re.Colors[t?.theme||"light"].categoricalColors.colors,colorDomain:t?.colorDomain||t?.labels||[],showNAColor:t?.showNAColor===void 0||t?.showNAColor===null?!0:t?.showNAColor}):null,o.jsxRuntimeExports.jsx("div",{className:`flex flex-wrap gap-4 justify-center ${t?.language==="ar"||t?.language==="he"?"flex-row-reverse":"flex-row"}`,children:b.map((e,r)=>o.jsxRuntimeExports.jsx("div",{style:{width:`calc(${100/(y||Math.min(4,b.length||0))}% - ${((y||Math.min(4,b.length||0))-1)/(y||Math.min(4,b.length||0))}rem)`,minWidth:ue.checkIfNullOrUndefined(F)?"280px":`${F}px`},children:o.jsxRuntimeExports.jsx(oe.GraphEl,{graph:$,graphDataConfiguration:x,graphData:H.transformDataForGraph(D?H.transformDataForAggregation(z.filterData(v,q||[]).filter(a=>a[E]===e),D.keyColumn,D.aggregationColumnsSetting):z.filterData(v,q||[]).filter(a=>a[E]===e),$,x)||[],debugMode:w,settings:{...t||{},...h,theme:t?.theme||X,width:void 0,height:void 0,relativeHeight:t?.relativeHeight||.67,minHeight:K,graphTitle:`${e}`,graphDescription:void 0,graphDownload:!1,dataDownload:!1,backgroundColor:void 0,padding:"0",footNote:void 0,sources:void 0,showColorScale:t?.showColorScale===!1?!1:A===!1},readableHeader:Q||[]})},r))})]}):o.jsxRuntimeExports.jsx("div",{className:"w-full flex justify-center p-4",children:o.jsxRuntimeExports.jsx(te.w,{})}),t?.sources||t?.footNote?o.jsxRuntimeExports.jsx(ie.GraphFooter,{styles:{footnote:t?.styles?.footnote,source:t?.styles?.source},classNames:{footnote:t?.classNames?.footnote,source:t?.classNames?.source},sources:t?.sources,footNote:t?.footNote,width:t?.width}):null]})}exports.GriddedGraphs=ce;
2
2
  //# sourceMappingURL=GriddedGraphs.cjs.map
@@ -6,7 +6,7 @@ import { b as $, y as A, h as F, c as ca, $ as K, P as Q } from "./checkIfMultip
6
6
  import { w as da } from "./Spinner-B2IIKg9r.js";
7
7
  import { j as V, D as O } from "./DropdownSelect-Dz7imdTB.js";
8
8
  import { G as ha } from "./GraphContainer-B8ZqOzKI.js";
9
- import { G as fa } from "./GraphEl-Dorm_qQE.js";
9
+ import { G as fa } from "./GraphEl-B73N4RIA.js";
10
10
  import { f as pa, a as ga, b as ma, c as Ca, t as va } from "./fetchAndParseData-BAXhgTDM.js";
11
11
  import { Colors as wa } from "./Colors.js";
12
12
  import { a as ba, t as xa } from "./transformDataForAggregation-wdPf8bNt.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./index-CHPV5EwG-D4pAp7u0.cjs"),ce=require("./Spinner-WHzzloYQ.cjs"),K=require("./index-Bdo_HXb_.cjs"),ue=require("./TreeMapGraph.cjs"),he=require("./DonutChart.cjs"),fe=require("./BarGraph.cjs"),J=require("./Colors.cjs"),pe=require("./init-DU0ybBc_.cjs"),Q=require("./linear-CgUCbw9F.cjs");function ge(n,e){let C=0;for(let l of n)l!=null&&(l=+l)>=l&&++C;return C}function me(n){return n}var xe=Array.prototype,de=xe.slice;function oe(n){return()=>n}function Me(n,e,C){let l;for(;;){const t=Q.tickIncrement(n,e,C);if(t===l||t===0||!isFinite(t))return[n,e];t>0?(n=Math.floor(n/t)*t,e=Math.ceil(e/t)*t):t<0&&(n=Math.ceil(n*t)/t,e=Math.floor(e*t)/t),l=t}}function ye(n){return Math.max(1,Math.ceil(Math.log(ge(n))/Math.LN2)+1)}function ve(){var n=me,e=K.extent,C=ye;function l(t){Array.isArray(t)||(t=Array.from(t));var r,H=t.length,a,P,p=new Array(H);for(r=0;r<H;++r)p[r]=n(t[r],r,t);var b=e(p),o=b[0],i=b[1],s=C(p,o,i);if(!Array.isArray(s)){const d=i,M=+s;if(e===K.extent&&([o,i]=Me(o,i,M)),s=Q.ticks(o,i,M),s[0]<=o&&(P=Q.tickIncrement(o,i,M)),s[s.length-1]>=i)if(d>=i&&e===K.extent){const c=Q.tickIncrement(o,i,M);isFinite(c)&&(c>0?i=(Math.floor(i/c)+1)*c:c<0&&(i=(Math.ceil(i*-c)+1)/-c))}else s.pop()}for(var x=s.length,u=0,h=x;s[u]<=o;)++u;for(;s[h-1]>i;)--h;(u||h<x)&&(s=s.slice(u,h),x=h-u);var m=new Array(x+1),y;for(r=0;r<=x;++r)y=m[r]=[],y.x0=r>0?s[r-1]:o,y.x1=r<x?s[r]:i;if(isFinite(P)){if(P>0)for(r=0;r<H;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[Math.min(x,Math.floor((a-o)/P))].push(t[r]);else if(P<0){for(r=0;r<H;++r)if((a=p[r])!=null&&o<=a&&a<=i){const d=Math.floor((o-a)*P);m[Math.min(x,d+(s[d]<=a))].push(t[r])}}}else for(r=0;r<H;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[pe.bisectRight(s,a,0,x)].push(t[r]);return m}return l.value=function(t){return arguments.length?(n=typeof t=="function"?t:oe(t),l):n},l.domain=function(t){return arguments.length?(e=typeof t=="function"?t:oe([t[0],t[1]]),l):e},l.thresholds=function(t){return arguments.length?(C=typeof t=="function"?t:oe(Array.isArray(t)?de.call(t):t),l):C},l}function Ce(n){const e=N.compilerRuntimeExports.c(143),{data:C,graphTitle:l,sources:t,graphDescription:r,barPadding:H,showValues:a,showTicks:P,leftMargin:p,rightMargin:b,height:o,width:i,footNote:s,colors:x,padding:u,backgroundColor:h,topMargin:m,bottomMargin:y,showLabels:d,relativeHeight:M,tooltip:c,onSeriesMouseOver:w,refValues:U,graphID:j,maxValue:X,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,numberOfBins:Y,truncateBy:Z,graphType:_,barGraphLayout:ee,donutStrokeWidth:te,sortData:O,language:q,minHeight:F,theme:se,maxBarThickness:re,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:le,locale:ae}=n,v=se===void 0?"light":se,ie=le===void 0?!1:le,$=ae===void 0?"en":ae;let V;e[0]!==C||e[1]!==Y?(V=ve().thresholds(Y||10).value(we)(C).map(be),e[0]=C,e[1]=Y,e[2]=V):V=e[2];const L=V;if(L.length===0){const g=`${i}px`,f=`${o}px`;let B;e[3]!==g||e[4]!==f?(B={width:g,height:f,margin:"auto"},e[3]=g,e[4]=f,e[5]=B):B=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=N.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:N.jsxRuntimeExports.jsx(ce.w,{})}),e[6]=I):I=e[6];let W;return e[7]!==B?(W=N.jsxRuntimeExports.jsx("div",{style:B,children:I}),e[7]=B,e[8]=W):W=e[8],W}if(_==="circlePacking"){const g=x||J.Colors.graphMainColor;let f;return e[9]!==E||e[10]!==h||e[11]!==y||e[12]!==D||e[13]!==A||e[14]!==L||e[15]!==R||e[16]!==s||e[17]!==r||e[18]!==S||e[19]!==j||e[20]!==l||e[21]!==o||e[22]!==q||e[23]!==p||e[24]!==$||e[25]!==F||e[26]!==k||e[27]!==w||e[28]!==u||e[29]!==T||e[30]!==M||e[31]!==b||e[32]!==d||e[33]!==a||e[34]!==t||e[35]!==G||e[36]!==g||e[37]!==v||e[38]!==c||e[39]!==m||e[40]!==i?(f=N.jsxRuntimeExports.jsx(K.CirclePackingGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:L,language:q,minHeight:F,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,locale:$}),e[9]=E,e[10]=h,e[11]=y,e[12]=D,e[13]=A,e[14]=L,e[15]=R,e[16]=s,e[17]=r,e[18]=S,e[19]=j,e[20]=l,e[21]=o,e[22]=q,e[23]=p,e[24]=$,e[25]=F,e[26]=k,e[27]=w,e[28]=u,e[29]=T,e[30]=M,e[31]=b,e[32]=d,e[33]=a,e[34]=t,e[35]=G,e[36]=g,e[37]=v,e[38]=c,e[39]=m,e[40]=i,e[41]=f):f=e[41],f}if(_==="treeMap"){const g=x||J.Colors.graphMainColor;let f;return e[42]!==E||e[43]!==h||e[44]!==y||e[45]!==D||e[46]!==A||e[47]!==L||e[48]!==R||e[49]!==s||e[50]!==r||e[51]!==S||e[52]!==j||e[53]!==l||e[54]!==o||e[55]!==q||e[56]!==p||e[57]!==$||e[58]!==F||e[59]!==k||e[60]!==w||e[61]!==u||e[62]!==T||e[63]!==M||e[64]!==b||e[65]!==d||e[66]!==a||e[67]!==t||e[68]!==G||e[69]!==g||e[70]!==v||e[71]!==c||e[72]!==m||e[73]!==i?(f=N.jsxRuntimeExports.jsx(ue.TreeMapGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:L,language:q,minHeight:F,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,locale:$}),e[42]=E,e[43]=h,e[44]=y,e[45]=D,e[46]=A,e[47]=L,e[48]=R,e[49]=s,e[50]=r,e[51]=S,e[52]=j,e[53]=l,e[54]=o,e[55]=q,e[56]=p,e[57]=$,e[58]=F,e[59]=k,e[60]=w,e[61]=u,e[62]=T,e[63]=M,e[64]=b,e[65]=d,e[66]=a,e[67]=t,e[68]=G,e[69]=g,e[70]=v,e[71]=c,e[72]=m,e[73]=i,e[74]=f):f=e[74],f}if(_==="donutChart"){const g=x||J.Colors[v].categoricalColors.colors,f=i&&o?i<o?i:o:i||o||void 0,B=L;let I;return e[75]!==E||e[76]!==h||e[77]!==D||e[78]!==A||e[79]!==R||e[80]!==te||e[81]!==s||e[82]!==r||e[83]!==S||e[84]!==j||e[85]!==l||e[86]!==q||e[87]!==$||e[88]!==k||e[89]!==w||e[90]!==u||e[91]!==T||e[92]!==O||e[93]!==t||e[94]!==G||e[95]!==g||e[96]!==f||e[97]!==B||e[98]!==v||e[99]!==c?(I=N.jsxRuntimeExports.jsx(he.DonutChart,{colors:g,graphTitle:l,graphDescription:r,footNote:s,radius:f,sources:t,backgroundColor:h,padding:u,tooltip:c,onSeriesMouseOver:w,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:B,strokeWidth:te,showColorScale:!0,sortData:O,language:q,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,locale:$}),e[75]=E,e[76]=h,e[77]=D,e[78]=A,e[79]=R,e[80]=te,e[81]=s,e[82]=r,e[83]=S,e[84]=j,e[85]=l,e[86]=q,e[87]=$,e[88]=k,e[89]=w,e[90]=u,e[91]=T,e[92]=O,e[93]=t,e[94]=G,e[95]=g,e[96]=f,e[97]=B,e[98]=v,e[99]=c,e[100]=I):I=e[100],I}const ne=x||J.Colors.graphMainColor;let z;return e[101]!==E||e[102]!==h||e[103]!==ee||e[104]!==H||e[105]!==y||e[106]!==D||e[107]!==A||e[108]!==L||e[109]!==R||e[110]!==s||e[111]!==r||e[112]!==S||e[113]!==j||e[114]!==l||e[115]!==o||e[116]!==ie||e[117]!==q||e[118]!==p||e[119]!==$||e[120]!==re||e[121]!==X||e[122]!==F||e[123]!==k||e[124]!==w||e[125]!==u||e[126]!==T||e[127]!==U||e[128]!==M||e[129]!==b||e[130]!==d||e[131]!==P||e[132]!==a||e[133]!==O||e[134]!==t||e[135]!==G||e[136]!==ne||e[137]!==v||e[138]!==c||e[139]!==m||e[140]!==Z||e[141]!==i?(z=N.jsxRuntimeExports.jsx(fe.SimpleBarGraph,{colors:ne,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:L,barPadding:H,refValues:U,truncateBy:Z,maxValue:X,showTicks:P,sortData:O,language:q,minHeight:F,theme:v,maxBarThickness:re,ariaLabel:E,orientation:ee,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:ie,locale:$}),e[101]=E,e[102]=h,e[103]=ee,e[104]=H,e[105]=y,e[106]=D,e[107]=A,e[108]=L,e[109]=R,e[110]=s,e[111]=r,e[112]=S,e[113]=j,e[114]=l,e[115]=o,e[116]=ie,e[117]=q,e[118]=p,e[119]=$,e[120]=re,e[121]=X,e[122]=F,e[123]=k,e[124]=w,e[125]=u,e[126]=T,e[127]=U,e[128]=M,e[129]=b,e[130]=d,e[131]=P,e[132]=a,e[133]=O,e[134]=t,e[135]=G,e[136]=ne,e[137]=v,e[138]=c,e[139]=m,e[140]=Z,e[141]=i,e[142]=z):z=e[142],z}function be(n){return{label:`${n.x0}-${n.x1}`,size:n.length,data:{options:`${n.x0}-${n.x1}`,frequency:n.length}}}function we(n){return n.value}exports.Histogram=Ce;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const N=require("./index-CHPV5EwG-D4pAp7u0.cjs"),ce=require("./Spinner-WHzzloYQ.cjs"),K=require("./index-CP8cmNzt.cjs"),ue=require("./TreeMapGraph.cjs"),he=require("./DonutChart.cjs"),fe=require("./BarGraph.cjs"),J=require("./Colors.cjs"),pe=require("./init-DU0ybBc_.cjs"),Q=require("./linear-CgUCbw9F.cjs");function ge(n,e){let C=0;for(let l of n)l!=null&&(l=+l)>=l&&++C;return C}function me(n){return n}var xe=Array.prototype,de=xe.slice;function oe(n){return()=>n}function Me(n,e,C){let l;for(;;){const t=Q.tickIncrement(n,e,C);if(t===l||t===0||!isFinite(t))return[n,e];t>0?(n=Math.floor(n/t)*t,e=Math.ceil(e/t)*t):t<0&&(n=Math.ceil(n*t)/t,e=Math.floor(e*t)/t),l=t}}function ye(n){return Math.max(1,Math.ceil(Math.log(ge(n))/Math.LN2)+1)}function ve(){var n=me,e=K.extent,C=ye;function l(t){Array.isArray(t)||(t=Array.from(t));var r,H=t.length,a,P,p=new Array(H);for(r=0;r<H;++r)p[r]=n(t[r],r,t);var b=e(p),o=b[0],i=b[1],s=C(p,o,i);if(!Array.isArray(s)){const d=i,M=+s;if(e===K.extent&&([o,i]=Me(o,i,M)),s=Q.ticks(o,i,M),s[0]<=o&&(P=Q.tickIncrement(o,i,M)),s[s.length-1]>=i)if(d>=i&&e===K.extent){const c=Q.tickIncrement(o,i,M);isFinite(c)&&(c>0?i=(Math.floor(i/c)+1)*c:c<0&&(i=(Math.ceil(i*-c)+1)/-c))}else s.pop()}for(var x=s.length,u=0,h=x;s[u]<=o;)++u;for(;s[h-1]>i;)--h;(u||h<x)&&(s=s.slice(u,h),x=h-u);var m=new Array(x+1),y;for(r=0;r<=x;++r)y=m[r]=[],y.x0=r>0?s[r-1]:o,y.x1=r<x?s[r]:i;if(isFinite(P)){if(P>0)for(r=0;r<H;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[Math.min(x,Math.floor((a-o)/P))].push(t[r]);else if(P<0){for(r=0;r<H;++r)if((a=p[r])!=null&&o<=a&&a<=i){const d=Math.floor((o-a)*P);m[Math.min(x,d+(s[d]<=a))].push(t[r])}}}else for(r=0;r<H;++r)(a=p[r])!=null&&o<=a&&a<=i&&m[pe.bisectRight(s,a,0,x)].push(t[r]);return m}return l.value=function(t){return arguments.length?(n=typeof t=="function"?t:oe(t),l):n},l.domain=function(t){return arguments.length?(e=typeof t=="function"?t:oe([t[0],t[1]]),l):e},l.thresholds=function(t){return arguments.length?(C=typeof t=="function"?t:oe(Array.isArray(t)?de.call(t):t),l):C},l}function Ce(n){const e=N.compilerRuntimeExports.c(143),{data:C,graphTitle:l,sources:t,graphDescription:r,barPadding:H,showValues:a,showTicks:P,leftMargin:p,rightMargin:b,height:o,width:i,footNote:s,colors:x,padding:u,backgroundColor:h,topMargin:m,bottomMargin:y,showLabels:d,relativeHeight:M,tooltip:c,onSeriesMouseOver:w,refValues:U,graphID:j,maxValue:X,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,numberOfBins:Y,truncateBy:Z,graphType:_,barGraphLayout:ee,donutStrokeWidth:te,sortData:O,language:q,minHeight:F,theme:se,maxBarThickness:re,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:le,locale:ae}=n,v=se===void 0?"light":se,ie=le===void 0?!1:le,$=ae===void 0?"en":ae;let V;e[0]!==C||e[1]!==Y?(V=ve().thresholds(Y||10).value(we)(C).map(be),e[0]=C,e[1]=Y,e[2]=V):V=e[2];const L=V;if(L.length===0){const g=`${i}px`,f=`${o}px`;let B;e[3]!==g||e[4]!==f?(B={width:g,height:f,margin:"auto"},e[3]=g,e[4]=f,e[5]=B):B=e[5];let I;e[6]===Symbol.for("react.memo_cache_sentinel")?(I=N.jsxRuntimeExports.jsx("div",{className:"flex m-auto items-center justify-center p-0 leading-none text-base h-40",children:N.jsxRuntimeExports.jsx(ce.w,{})}),e[6]=I):I=e[6];let W;return e[7]!==B?(W=N.jsxRuntimeExports.jsx("div",{style:B,children:I}),e[7]=B,e[8]=W):W=e[8],W}if(_==="circlePacking"){const g=x||J.Colors.graphMainColor;let f;return e[9]!==E||e[10]!==h||e[11]!==y||e[12]!==D||e[13]!==A||e[14]!==L||e[15]!==R||e[16]!==s||e[17]!==r||e[18]!==S||e[19]!==j||e[20]!==l||e[21]!==o||e[22]!==q||e[23]!==p||e[24]!==$||e[25]!==F||e[26]!==k||e[27]!==w||e[28]!==u||e[29]!==T||e[30]!==M||e[31]!==b||e[32]!==d||e[33]!==a||e[34]!==t||e[35]!==G||e[36]!==g||e[37]!==v||e[38]!==c||e[39]!==m||e[40]!==i?(f=N.jsxRuntimeExports.jsx(K.CirclePackingGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:L,language:q,minHeight:F,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,locale:$}),e[9]=E,e[10]=h,e[11]=y,e[12]=D,e[13]=A,e[14]=L,e[15]=R,e[16]=s,e[17]=r,e[18]=S,e[19]=j,e[20]=l,e[21]=o,e[22]=q,e[23]=p,e[24]=$,e[25]=F,e[26]=k,e[27]=w,e[28]=u,e[29]=T,e[30]=M,e[31]=b,e[32]=d,e[33]=a,e[34]=t,e[35]=G,e[36]=g,e[37]=v,e[38]=c,e[39]=m,e[40]=i,e[41]=f):f=e[41],f}if(_==="treeMap"){const g=x||J.Colors.graphMainColor;let f;return e[42]!==E||e[43]!==h||e[44]!==y||e[45]!==D||e[46]!==A||e[47]!==L||e[48]!==R||e[49]!==s||e[50]!==r||e[51]!==S||e[52]!==j||e[53]!==l||e[54]!==o||e[55]!==q||e[56]!==p||e[57]!==$||e[58]!==F||e[59]!==k||e[60]!==w||e[61]!==u||e[62]!==T||e[63]!==M||e[64]!==b||e[65]!==d||e[66]!==a||e[67]!==t||e[68]!==G||e[69]!==g||e[70]!==v||e[71]!==c||e[72]!==m||e[73]!==i?(f=N.jsxRuntimeExports.jsx(ue.TreeMapGraph,{colors:g,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:L,language:q,minHeight:F,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,locale:$}),e[42]=E,e[43]=h,e[44]=y,e[45]=D,e[46]=A,e[47]=L,e[48]=R,e[49]=s,e[50]=r,e[51]=S,e[52]=j,e[53]=l,e[54]=o,e[55]=q,e[56]=p,e[57]=$,e[58]=F,e[59]=k,e[60]=w,e[61]=u,e[62]=T,e[63]=M,e[64]=b,e[65]=d,e[66]=a,e[67]=t,e[68]=G,e[69]=g,e[70]=v,e[71]=c,e[72]=m,e[73]=i,e[74]=f):f=e[74],f}if(_==="donutChart"){const g=x||J.Colors[v].categoricalColors.colors,f=i&&o?i<o?i:o:i||o||void 0,B=L;let I;return e[75]!==E||e[76]!==h||e[77]!==D||e[78]!==A||e[79]!==R||e[80]!==te||e[81]!==s||e[82]!==r||e[83]!==S||e[84]!==j||e[85]!==l||e[86]!==q||e[87]!==$||e[88]!==k||e[89]!==w||e[90]!==u||e[91]!==T||e[92]!==O||e[93]!==t||e[94]!==G||e[95]!==g||e[96]!==f||e[97]!==B||e[98]!==v||e[99]!==c?(I=N.jsxRuntimeExports.jsx(he.DonutChart,{colors:g,graphTitle:l,graphDescription:r,footNote:s,radius:f,sources:t,backgroundColor:h,padding:u,tooltip:c,onSeriesMouseOver:w,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:B,strokeWidth:te,showColorScale:!0,sortData:O,language:q,theme:v,ariaLabel:E,detailsOnClick:R,styles:G,classNames:D,precision:T,locale:$}),e[75]=E,e[76]=h,e[77]=D,e[78]=A,e[79]=R,e[80]=te,e[81]=s,e[82]=r,e[83]=S,e[84]=j,e[85]=l,e[86]=q,e[87]=$,e[88]=k,e[89]=w,e[90]=u,e[91]=T,e[92]=O,e[93]=t,e[94]=G,e[95]=g,e[96]=f,e[97]=B,e[98]=v,e[99]=c,e[100]=I):I=e[100],I}const ne=x||J.Colors.graphMainColor;let z;return e[101]!==E||e[102]!==h||e[103]!==ee||e[104]!==H||e[105]!==y||e[106]!==D||e[107]!==A||e[108]!==L||e[109]!==R||e[110]!==s||e[111]!==r||e[112]!==S||e[113]!==j||e[114]!==l||e[115]!==o||e[116]!==ie||e[117]!==q||e[118]!==p||e[119]!==$||e[120]!==re||e[121]!==X||e[122]!==F||e[123]!==k||e[124]!==w||e[125]!==u||e[126]!==T||e[127]!==U||e[128]!==M||e[129]!==b||e[130]!==d||e[131]!==P||e[132]!==a||e[133]!==O||e[134]!==t||e[135]!==G||e[136]!==ne||e[137]!==v||e[138]!==c||e[139]!==m||e[140]!==Z||e[141]!==i?(z=N.jsxRuntimeExports.jsx(fe.SimpleBarGraph,{colors:ne,graphTitle:l,graphDescription:r,footNote:s,width:i,height:o,sources:t,leftMargin:p,rightMargin:b,backgroundColor:h,padding:u,topMargin:m,bottomMargin:y,relativeHeight:M,showLabels:d,tooltip:c,onSeriesMouseOver:w,showColorScale:!1,showValues:a,graphID:j,onSeriesMouseClick:k,graphDownload:S,dataDownload:A,data:L,barPadding:H,refValues:U,truncateBy:Z,maxValue:X,showTicks:P,sortData:O,language:q,minHeight:F,theme:v,maxBarThickness:re,ariaLabel:E,orientation:ee,detailsOnClick:R,styles:G,classNames:D,precision:T,hideAxisLine:ie,locale:$}),e[101]=E,e[102]=h,e[103]=ee,e[104]=H,e[105]=y,e[106]=D,e[107]=A,e[108]=L,e[109]=R,e[110]=s,e[111]=r,e[112]=S,e[113]=j,e[114]=l,e[115]=o,e[116]=ie,e[117]=q,e[118]=p,e[119]=$,e[120]=re,e[121]=X,e[122]=F,e[123]=k,e[124]=w,e[125]=u,e[126]=T,e[127]=U,e[128]=M,e[129]=b,e[130]=d,e[131]=P,e[132]=a,e[133]=O,e[134]=t,e[135]=G,e[136]=ne,e[137]=v,e[138]=c,e[139]=m,e[140]=Z,e[141]=i,e[142]=z):z=e[142],z}function be(n){return{label:`${n.x0}-${n.x1}`,size:n.length,data:{options:`${n.x0}-${n.x1}`,frequency:n.length}}}function we(n){return n.value}exports.Histogram=Ce;
2
2
  //# sourceMappingURL=Histogram.cjs.map
package/dist/Histogram.js CHANGED
@@ -1,6 +1,6 @@
1
1
  import { c as ce, j as V } from "./index-CHPV5EwG-BzibaIRc.js";
2
2
  import { w as fe } from "./Spinner-B2IIKg9r.js";
3
- import { e as oe, C as he } from "./index-CGrBpeUa.js";
3
+ import { e as oe, C as he } from "./index-B0Awa_de.js";
4
4
  import { TreeMapGraph as ue } from "./TreeMapGraph.js";
5
5
  import { DonutChart as me } from "./DonutChart.js";
6
6
  import { SimpleBarGraph as pe } from "./BarGraph.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-D4pAp7u0.cjs"),n=require("react"),$t=require("./parse-xYI9yrvL.cjs"),Ft=require("./getSliderMarks-BzrpHrHS.cjs"),oo=require("./Spinner-WHzzloYQ.cjs"),Tt=require("./index-DQA8q5sC.cjs"),z=require("./index-DLFt97gy.cjs"),Vt=require("./Typography-BqmyF1gP.cjs"),ro=require("./index-C5K--w8d.cjs"),At=require("./Source-PKuwZOn3.cjs"),ao=require("./index-w64Zl8io-DrMm5QSb.cjs"),io=require("./Tooltip-Hr46paWP.cjs"),yt=require("./index-BhI7mBJx.cjs"),no=require("./DetailsModal-jmmKRMRM.cjs"),so=require("./pow-BnyPO-NX.cjs"),lo=require("./ordinal-CrsysVE-.cjs"),co=require("./threshold-DNsSUf8Q.cjs"),Wt=require("./select-Bnfk0lJx.cjs"),ce=require("./proxy-CqH8m8IQ.cjs"),ft=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),uo=require("./numberFormattingFunction-Cn9R7CM9.cjs"),po=require("./use-in-view-dnRv_qqF.cjs"),mo=require("./index-FXfr51ZM.cjs"),xo=require("./GraphFooter.cjs"),ho=require("./GraphHeader.cjs"),Re=require("./Colors.cjs"),Ut=require("./fetchAndParseData-QTF6tjij.cjs"),Gt=require("./GraphContainer-Cul9b74X.cjs"),go=require("./getUniqValue-NX8DgwND.cjs"),fo=require("./getJenks-BzJvhy_H.cjs");function yo(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const vo=yo(n);var jo="Separator",Ht="horizontal",bo=["horizontal","vertical"],Xt=vo.forwardRef((a,e)=>{const{decorative:t,orientation:g=Ht,...v}=a,s=Eo(g)?g:Ht,j=t?{role:"none"}:{"aria-orientation":s==="vertical"?s:void 0,role:"separator"};return r.ae.jsx(ao.w.div,{"data-orientation":s,...j,...v,ref:e})});Xt.displayName=jo;function Eo(a){return bo.includes(a)}var Yt=Xt;const Jt=n.forwardRef((a,e)=>{const t=r._.c(14);let g,v,s,j;t[0]!==a?({className:g,variant:s,orientation:j,...v}=a,t[0]=a,t[1]=g,t[2]=v,t[3]=s,t[4]=j):(g=t[1],v=t[2],s=t[3],j=t[4]);const b=s===void 0?"dark":s,l=j===void 0?"horizontal":j,h=l==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",R=b==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let C;t[5]!==g||t[6]!==h||t[7]!==R?(C=r.mo(h,R,g),t[5]=g,t[6]=h,t[7]=R,t[8]=C):C=t[8];let P;return t[9]!==l||t[10]!==v||t[11]!==e||t[12]!==C?(P=r.ae.jsx(Yt,{...v,ref:e,orientation:l,className:C}),t[9]=l,t[10]=v,t[11]=e,t[12]=C,t[13]=P):P=t[13],P});Jt.displayName=Yt.displayName;function wo(a){const{data:e,colors:t,mapData:g,mapColorLegendTitle:v,colorDomain:s,radius:j,height:b,width:l,scale:h,centerPoint:R,tooltip:C,showLabels:P,mapBorderWidth:de,mapBorderColor:ue,mapNoDataColor:De,onSeriesMouseOver:G,showColorScale:Se,zoomScaleExtend:Ge,zoomTranslateExtend:He,highlightedDataPoints:Ne,onSeriesMouseClick:V,resetSelectionOnDoubleClick:Me,detailsOnClick:H,styles:D,classNames:X,mapProjection:ae,zoomInteraction:Y,animate:E,dimmedOpacity:W,customLayers:pe,maxRadiusValue:me,categorical:ie,dotColor:J,collapseColorScaleByDefault:Oe,highlightedIds:ne,mapProperty:xe,dotLegendTitle:he,dotBorderColor:qe,labelColor:Ie,projectionRotate:Z,rewindCoordinatesInMapData:K,overlayMapData:m,overlayMapBorderColor:y,overlayMapBorderWidth:Xe,locale:Ye}=a,Q=n.useMemo(()=>K?z.index_default(g,{reverse:!0}):g,[g,K]),Je=n.useMemo(()=>!K||!m?m:z.index_default(m,{reverse:!0}),[m,K]),[S,N]=n.useState(void 0),[ge,fe]=n.useState(Oe===void 0?!(l<680):!Oe),ye=n.useRef(null),[L,ee]=n.useState(void 0),[ve,B]=n.useState(void 0),[Pe,M]=n.useState(void 0),[Be,$]=n.useState(void 0),f=n.useRef(null),w=po.useInView(f,{once:E.once,amount:E.amount}),se=n.useRef(null),k=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?so.sqrt().domain([0,me]).range([.25,j]).nice():void 0,_e=ie?lo.ordinal().domain(s).range(t):co.threshold().domain(s).range(t);n.useEffect(()=>{const o=Wt.select(se.current),i=Wt.select(f.current),x=u=>{if(Y==="noZoom")return!1;if(Y==="button")return!u.type.includes("wheel");const $e=u.type==="wheel",q=u.type.startsWith("touch"),T=u.type==="mousedown"||u.type==="mousemove";return q?!0:$e?Y==="scroll"?!0:u.ctrlKey:T&&!u.button&&!u.ctrlKey},O=z.zoom().scaleExtent(Ge).translateExtent(He||[[-20,-20],[l+20,b+20]]).filter(x).on("zoom",({transform:u})=>{o.attr("transform",u)});i.call(O),ye.current=O},[b,l,Y]);const te=z.index_default$1(Q),F=ro.index_default(Q),ze=(te[2]-te[0])*1.15,Ve=(te[3]-te[1])*1.15,We=l*190/960*360/ze,Le=b*190/678*180/Ve,_=h*Math.min(We,Le),oe=ae==="mercator"?z.geoMercator().rotate(Z).center(R||F.geometry.coordinates).translate([l/2,b/2]).scale(_):ae==="equalEarth"?z.geoEqualEarth().rotate(Z).center(R||F.geometry.coordinates).translate([l/2,b/2]).scale(_):ae==="naturalEarth"?z.geoNaturalEarth1().rotate(Z).center(R||F.geometry.coordinates).translate([l/2,b/2]).scale(_):ae==="orthographic"?z.geoOrthographic().rotate(Z).center(R||F.geometry.coordinates).translate([l/2,b/2]).scale(_):z.geoAlbersUsa().rotate(Z).center(R||F.geometry.coordinates).translate([l/2,b/2]).scale(_),re=z.geoPath().projection(oe),je=o=>{if(!f.current||!ye.current)return;Wt.select(f.current).call(ye.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(ce.motion.svg,{width:`${l}px`,height:`${b}px`,viewBox:`0 0 ${l} ${b}`,ref:f,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:se,children:[pe.filter(o=>o.position==="before").map(o=>o.layer),Q.features.map((o,i)=>{if(!o.properties?.[xe])return null;const x=re(o);return x?r.jsxRuntimeExports.jsx(ce.motion.g,{opacity:S?W:ne.length!==0?ne.indexOf(o.properties[xe])!==-1?1:W:1,children:r.jsxRuntimeExports.jsx("path",{d:x,style:{stroke:ue,strokeWidth:de,fill:De,vectorEffect:"non-scaling-stroke"}})},i):null}),r.jsxRuntimeExports.jsxs(mo.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const i=Q.features.findIndex(u=>o.id===u.properties[xe]);if(i===-1)return null;const x=re(Q.features[i]);if(!x)return null;const O=ft.checkIfNullOrUndefined(o.x)?De:_e(o.x);return r.jsxRuntimeExports.jsx(ce.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:S?S===O?1:W:ne.length!==0?ne.indexOf(o.id)!==-1?1:W:1,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:u=>{B(o),$(u.clientY),M(u.clientX),G?.(o)},onMouseMove:u=>{B(o),$(u.clientY),M(u.clientX)},onMouseLeave:()=>{B(void 0),M(void 0),$(void 0),G?.(void 0)},onClick:()=>{(V||H)&&(Tt.isEqual(L,o)&&Me?(ee(void 0),V?.(void 0)):(ee(o),V?.(o)))},children:r.jsxRuntimeExports.jsx(ce.motion.path,{d:x,variants:{initial:{fill:O,opacity:0},whileInView:{fill:O,opacity:1,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},style:{stroke:ue,strokeWidth:de,vectorEffect:"non-scaling-stroke"}},`${o.id}`)},o.id)}),Je?.features.map((o,i)=>{const x=re(o);return x?r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("path",{d:x,style:{stroke:y||ue,strokeWidth:Xe||de+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},i):null}),e.filter(o=>!ft.checkIfNullOrUndefined(o.lat)&&!ft.checkIfNullOrUndefined(o.long)).map(o=>{const i=oe([o.long,o.lat])[0]>.8*l?-1:1;return r.jsxRuntimeExports.jsxs(ce.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:Ne.length!==0?Ne.indexOf(o.label||"")!==-1?1:W:1,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:x=>{B(o),$(x.clientY),M(x.clientX),G?.(o)},onMouseMove:x=>{B(o),$(x.clientY),M(x.clientX)},onMouseLeave:()=>{B(void 0),M(void 0),$(void 0),G?.(void 0)},onClick:()=>{(V||H)&&(Tt.isEqual(L,o)&&Me?(ee(void 0),V?.(void 0)):(ee(o),V?.(o)))},transform:`translate(${oe([o.long,o.lat])[0]},${oe([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(ce.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:J,stroke:qe||J},whileInView:{r:k?k(o.radius||0):j,fill:J,stroke:qe||J,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8,vectorEffect:"non-scaling-stroke"}}),P&&o.label?r.jsxRuntimeExports.jsx(ce.motion.text,{variants:{initial:{opacity:0,x:i*(k?k(o.radius||0):j)},whileInView:{opacity:1,x:i*(k?k(o.radius||0):j),transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:r.mo("text-sm",X?.graphObjectValues),style:{textAnchor:i===-1?"end":"start",fill:Ie||"#000",vectorEffect:"non-scaling-stroke",...D?.graphObjectValues||{}},dx:i*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),pe.filter(o=>o.position==="after").map(o=>o.layer)]})}),Se===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",X?.colorLegend),children:ge?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{fe(!1)},children:r.jsxRuntimeExports.jsx(yt.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:ie?void 0:"340px"},children:[he&&he!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:J}}),r.jsxRuntimeExports.jsx(Vt._,{size:"xs",marginBottom:"none",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:he})]}),r.jsxRuntimeExports.jsx(At.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Jt,{}),r.jsxRuntimeExports.jsx(At.n,{size:"xl"})]}):null,v&&v!==""?r.jsxRuntimeExports.jsx(Vt._,{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:v}):null,ie?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:s.map((o,i)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{N(t[i%t.length])},onMouseLeave:()=>{N(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[i%t.length]}}),r.jsxRuntimeExports.jsx(Vt._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[s.map((o,i)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{N(t[i])},onMouseLeave:()=>{N(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:i*320/t.length+1,y:1,width:320/t.length-2,height:8,className:S===t[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[i],...S===t[i]?{}:{stroke:t[i]}}}),r.jsxRuntimeExports.jsx("text",{x:(i+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:uo.numberFormattingFunction(o,void 0,void 0,void 0,void 0,Ye)})]},i)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{N(t[s.length])},onMouseLeave:()=>{N(void 0)},x:s.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${S===t[s.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[s.length],...S===t[s.length]?{}:{stroke:t[s.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button",onClick:()=>{fe(!0)},children:r.jsxRuntimeExports.jsx(yt.ExpandIcon,{})})}),Y==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>je("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>je("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),H&&L!==void 0?r.jsxRuntimeExports.jsx(no.DetailsModal,{body:H,data:L,setData:ee,className:X?.modal}):null,ve&&C&&Pe&&Be?r.jsxRuntimeExports.jsx(io.Tooltip,{data:ve,body:C,xPos:Pe,yPos:Be,backgroundStyle:D?.tooltip,className:X?.tooltip}):null]})}function ko(a){const e=r.compilerRuntimeExports.c(145),{data:t,mapData:g,graphTitle:v,colors:s,sources:j,graphDescription:b,height:l,width:h,footNote:R,mapColorLegendTitle:C,colorDomain:P,choroplethScaleType:de,radius:ue,scale:De,centerPoint:G,padding:Se,mapBorderWidth:Ge,mapNoDataColor:He,backgroundColor:Ne,showLabels:V,mapBorderColor:Me,tooltip:H,relativeHeight:D,onSeriesMouseOver:X,isWorldMap:ae,showColorScale:Y,zoomScaleExtend:E,zoomTranslateExtend:W,graphID:pe,highlightedDataPoints:me,onSeriesMouseClick:ie,graphDownload:J,dataDownload:Oe,showAntarctica:ne,language:xe,minHeight:he,theme:qe,ariaLabel:Ie,resetSelectionOnDoubleClick:Z,detailsOnClick:K,styles:m,classNames:y,mapProjection:Xe,zoomInteraction:Ye,animate:Q,dimmedOpacity:Je,customLayers:S,maxRadiusValue:N,timeline:ge,collapseColorScaleByDefault:fe,dotColor:ye,highlightedIds:L,mapProperty:ee,dotLegendTitle:ve,dotBorderColor:B,labelColor:Pe,projectionRotate:M,rewindCoordinatesInMapData:Be,locale:$,mapOverlay:f}=a,w=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,se=R===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":R,k=de===void 0?"threshold":de,_e=ue===void 0?5:ue,te=De===void 0?.95:De,F=Ge===void 0?.5:Ge,ze=He===void 0?Re.Colors.light.graphNoData:He,Ve=Ne===void 0?!1:Ne,We=V===void 0?!1:V,Le=Me===void 0?Re.Colors.light.grays["gray-500"]:Me,_=ae===void 0?!0:ae,oe=Y===void 0?!0:Y;let re;e[0]!==E?(re=E===void 0?[.8,6]:E,e[0]=E,e[1]=re):re=e[1];const je=re;let o;e[2]!==me?(o=me===void 0?[]:me,e[2]=me,e[3]=o):o=e[3];const i=o,x=J===void 0?!1:J,O=Oe===void 0?!1:Oe,u=ne===void 0?!1:ne,$e=xe===void 0?"en":xe,q=he===void 0?0:he,T=qe===void 0?"light":qe,vt=Z===void 0?!0:Z,jt=Xe===void 0?"naturalEarth":Xe,bt=Ye===void 0?"button":Ye,Ze=Q===void 0?!1:Q,Et=Je===void 0?.3:Je;let Ke;e[4]!==S?(Ke=S===void 0?[]:S,e[4]=S,e[5]=Ke):Ke=e[5];const wt=Ke;let Qe;e[6]!==ge?(Qe=ge===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:ge,e[6]=ge,e[7]=Qe):Qe=e[7];const c=Qe,kt=ye===void 0?Re.Colors.primaryColors["blue-600"]:ye;let et;e[8]!==L?(et=L===void 0?[]:L,e[8]=L,e[9]=et):et=e[9];const Ct=et,Rt=ee===void 0?"ISO3":ee,Dt=Pe===void 0?Re.Colors.primaryColors["blue-600"]:Pe;let tt;e[10]!==M?(tt=M===void 0?[0,0]:M,e[10]=M,e[11]=tt):tt=e[11];const St=tt,Nt=Be===void 0?!0:Be,Mt=$===void 0?"en":$,[le,Zt]=n.useState(0),[Fe,Kt]=n.useState(0),[A,Qt]=n.useState(c.autoplay);let Te;if(e[12]!==t||e[13]!==c.dateFormat){let d;e[15]!==c.dateFormat?(d=I=>$t.parse(`${I.date}`,c.dateFormat||"yyyy",new Date).getTime(),e[15]=c.dateFormat,e[16]=d):d=e[16],Te=[...new Set(t.filter(Bo).map(d))],Te.sort(Po),e[12]=t,e[13]=c.dateFormat,e[14]=Te}else Te=e[14];const p=Te,[U,Ot]=n.useState(c.autoplay?0:p.length-1),[be,eo]=n.useState(void 0),[qt,to]=n.useState(void 0),It=n.useRef(null),Lt=n.useRef(null);let ot;e[17]!==k||e[18]!==P||e[19]!==s?.length||e[20]!==t?(ot=P||(k==="categorical"?go.getUniqValue(t,"x"):fo.getJenks(t.map(Io),s?.length||4)),e[17]=k,e[18]=P,e[19]=s?.length,e[20]=t,e[21]=ot):ot=e[21];const Ae=ot;let rt,at;e[22]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{const d=new ResizeObserver(I=>{Zt(I[0].target.clientWidth||620),Kt(I[0].target.clientHeight||480)});return It.current&&d.observe(It.current),()=>d.disconnect()},at=[],e[22]=rt,e[23]=at):(rt=e[22],at=e[23]),n.useEffect(rt,at);let it;e[24]===Symbol.for("react.memo_cache_sentinel")?(it=d=>{eo(d)},e[24]=it):it=e[24];const nt=n.useEffectEvent(it);let st;e[25]===Symbol.for("react.memo_cache_sentinel")?(st=d=>{to(d)},e[25]=st):st=e[25];const Ue=n.useEffectEvent(st);let lt;e[26]!==w||e[27]!==nt?(lt=()=>{typeof w=="string"?Ut.fetchAndParseJSON(w).then(I=>{nt(I)}):nt(w)},e[26]=w,e[27]=nt,e[28]=lt):lt=e[28];let ct;e[29]!==w?(ct=[w],e[29]=w,e[30]=ct):ct=e[30],n.useEffect(lt,ct);let dt;e[31]!==f?.mapData||e[32]!==Ue?(dt=()=>{f?.mapData||Ue(void 0),typeof f?.mapData=="string"?Ut.fetchAndParseJSON(f?.mapData).then(I=>{Ue(I)}):Ue(f?.mapData)},e[31]=f?.mapData,e[32]=Ue,e[33]=dt):dt=e[33];const Pt=f?.mapData;let ut;e[34]!==Pt?(ut=[Pt],e[34]=Pt,e[35]=ut):ut=e[35],n.useEffect(dt,ut);let pt,mt;e[36]!==A||e[37]!==c.speed||e[38]!==p?(pt=()=>{const d=setInterval(()=>{Ot(I=>I<p.length-1?I+1:0)},(c.speed||2)*1e3);return A||clearInterval(d),()=>clearInterval(d)},mt=[p,A,c.speed],e[36]=A,e[37]=c.speed,e[38]=p,e[39]=pt,e[40]=mt):(pt=e[39],mt=e[40]),n.useEffect(pt,mt);const Bt=c.dateFormat||"yyyy";let xt;e[41]!==U||e[42]!==Bt||e[43]!==c.showOnlyActiveDate||e[44]!==p?(xt=Ft.getSliderMarks(p,U,c.showOnlyActiveDate,Bt),e[41]=U,e[42]=Bt,e[43]=c.showOnlyActiveDate,e[44]=p,e[45]=xt):xt=e[45];const ht=xt,_t=y?.graphContainer,zt=m?.graphContainer;let Ee;e[46]!==y?.description||e[47]!==y?.title||e[48]!==t||e[49]!==O||e[50]!==b||e[51]!==x||e[52]!==v||e[53]!==m?.description||e[54]!==m?.title||e[55]!==h?(Ee=v||b||x||O?r.jsxRuntimeExports.jsx(ho.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:y?.title,description:y?.description},graphTitle:v,graphDescription:b,width:h,graphDownload:x?Lt:void 0,dataDownload:O?t.map(qo).filter(Oo).length>0?t.map(Mo).filter(No):t.filter(So):null}):null,e[46]=y?.description,e[47]=y?.title,e[48]=t,e[49]=O,e[50]=b,e[51]=x,e[52]=v,e[53]=m?.description,e[54]=m?.title,e[55]=h,e[56]=Ee):Ee=e[56];let we;e[57]!==U||e[58]!==ht||e[59]!==A||e[60]!==c.enabled||e[61]!==p?(we=c.enabled&&p.length>0&&ht?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Qt(!A)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":A?"Click to pause animation":"Click to play animation",children:A?r.jsxRuntimeExports.jsx(yt.Pause,{}):r.jsxRuntimeExports.jsx(yt.Play,{})}),r.jsxRuntimeExports.jsx(Ft.Nr,{min:p[0],max:p[p.length-1],marks:ht,step:null,defaultValue:p[p.length-1],value:p[U],onChangeComplete:d=>{Ot(p.indexOf(d))},onChange:d=>{Ot(p.indexOf(d))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[57]=U,e[58]=ht,e[59]=A,e[60]=c.enabled,e[61]=p,e[62]=we):we=e[62];let ke;e[63]!==Ze||e[64]!==G||e[65]!==k||e[66]!==y||e[67]!==fe||e[68]!==s||e[69]!==wt||e[70]!==t||e[71]!==K||e[72]!==Et||e[73]!==Ae||e[74]!==B||e[75]!==kt||e[76]!==ve||e[77]!==l||e[78]!==i||e[79]!==Ct||e[80]!==U||e[81]!==_||e[82]!==Dt||e[83]!==Mt||e[84]!==Le||e[85]!==F||e[86]!==C||e[87]!==ze||e[88]!==f?.mapBorderColor||e[89]!==f?.mapBorderWidth||e[90]!==jt||e[91]!==Rt||e[92]!==be||e[93]!==N||e[94]!==q||e[95]!==ie||e[96]!==X||e[97]!==qt||e[98]!==St||e[99]!==_e||e[100]!==D||e[101]!==vt||e[102]!==Nt||e[103]!==te||e[104]!==u||e[105]!==oe||e[106]!==We||e[107]!==m||e[108]!==Fe||e[109]!==le||e[110]!==T||e[111]!==c.dateFormat||e[112]!==c.enabled||e[113]!==H||e[114]!==p||e[115]!==h||e[116]!==bt||e[117]!==je||e[118]!==W?(ke=r.jsxRuntimeExports.jsx(Gt.GraphArea,{ref:It,children:le&&Fe&&be?r.jsxRuntimeExports.jsx(wo,{dotColor:kt,data:t.filter(d=>c.enabled?`${d.date}`===$t.format(new Date(p[U]),c.dateFormat||"yyyy"):d),mapData:u?be:{...be,features:be.features.filter(Do)},overlayMapData:qt,overlayMapBorderColor:f?.mapBorderColor,overlayMapBorderWidth:f?.mapBorderWidth,colorDomain:Ae,width:le,height:Fe,scale:te,centerPoint:G,colors:s||(k==="categorical"?Re.Colors[T].sequentialColors[`neutralColorsx0${Ae.length}`]:Re.Colors[T].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:C,radius:_e,categorical:k==="categorical",mapBorderWidth:F,mapNoDataColor:ze,mapBorderColor:Le,tooltip:H,onSeriesMouseOver:X,showLabels:We,isWorldMap:_,showColorScale:oe,zoomScaleExtend:je,zoomTranslateExtend:W,onSeriesMouseClick:ie,highlightedDataPoints:i,resetSelectionOnDoubleClick:vt,styles:m,classNames:y,zoomInteraction:bt,detailsOnClick:K,mapProjection:jt||(_?"naturalEarth":"mercator"),animate:Ze===!0?{duration:.5,once:!0,amount:.5}:Ze||{duration:0,once:!0,amount:0},dimmedOpacity:Et,customLayers:wt,maxRadiusValue:ft.checkIfNullOrUndefined(N)?Math.max(...t.map(Ro).filter(Co)):N,collapseColorScaleByDefault:fe,highlightedIds:Ct,mapProperty:Rt,dotLegendTitle:ve,dotBorderColor:B,labelColor:Dt,projectionRotate:St,rewindCoordinatesInMapData:Nt,locale:Mt}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(q,l||(D?q?(h||le)*D>q?(h||le)*D:q:(h||le)*D:Fe))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(oo.w,{"aria-label":"Loading graph"})})}),e[63]=Ze,e[64]=G,e[65]=k,e[66]=y,e[67]=fe,e[68]=s,e[69]=wt,e[70]=t,e[71]=K,e[72]=Et,e[73]=Ae,e[74]=B,e[75]=kt,e[76]=ve,e[77]=l,e[78]=i,e[79]=Ct,e[80]=U,e[81]=_,e[82]=Dt,e[83]=Mt,e[84]=Le,e[85]=F,e[86]=C,e[87]=ze,e[88]=f?.mapBorderColor,e[89]=f?.mapBorderWidth,e[90]=jt,e[91]=Rt,e[92]=be,e[93]=N,e[94]=q,e[95]=ie,e[96]=X,e[97]=qt,e[98]=St,e[99]=_e,e[100]=D,e[101]=vt,e[102]=Nt,e[103]=te,e[104]=u,e[105]=oe,e[106]=We,e[107]=m,e[108]=Fe,e[109]=le,e[110]=T,e[111]=c.dateFormat,e[112]=c.enabled,e[113]=H,e[114]=p,e[115]=h,e[116]=bt,e[117]=je,e[118]=W,e[119]=ke):ke=e[119];let Ce;e[120]!==y?.footnote||e[121]!==y?.source||e[122]!==se||e[123]!==j||e[124]!==m?.footnote||e[125]!==m?.source||e[126]!==h?(Ce=j||se?r.jsxRuntimeExports.jsx(xo.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:y?.footnote,source:y?.source},sources:j,footNote:se,width:h}):null,e[120]=y?.footnote,e[121]=y?.source,e[122]=se,e[123]=j,e[124]=m?.footnote,e[125]=m?.source,e[126]=h,e[127]=Ce):Ce=e[127];let gt;return e[128]!==Ie||e[129]!==Ve||e[130]!==pe||e[131]!==l||e[132]!==$e||e[133]!==q||e[134]!==Se||e[135]!==D||e[136]!==_t||e[137]!==zt||e[138]!==Ee||e[139]!==we||e[140]!==ke||e[141]!==Ce||e[142]!==T||e[143]!==h?(gt=r.jsxRuntimeExports.jsxs(Gt.GraphContainer,{className:_t,style:zt,id:pe,ref:Lt,"aria-label":Ie,backgroundColor:Ve,theme:T,language:$e,minHeight:q,width:h,height:l,relativeHeight:D,padding:Se,children:[Ee,we,ke,Ce]}),e[128]=Ie,e[129]=Ve,e[130]=pe,e[131]=l,e[132]=$e,e[133]=q,e[134]=Se,e[135]=D,e[136]=_t,e[137]=zt,e[138]=Ee,e[139]=we,e[140]=ke,e[141]=Ce,e[142]=T,e[143]=h,e[144]=gt):gt=e[144],gt}function Co(a){return a!=null}function Ro(a){return a.radius}function Do(a){return a.properties?.NAME!=="Antarctica"}function So(a){return a!==void 0}function No(a){return a!==void 0}function Mo(a){return a.data}function Oo(a){return a!==void 0}function qo(a){return a.data}function Io(a){return a.x}function Po(a,e){return a-e}function Bo(a){return a.date}exports.HybridMap=ko;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./index-CHPV5EwG-D4pAp7u0.cjs"),s=require("react"),Wt=require("./parse-xYI9yrvL.cjs"),Lt=require("./getSliderMarks-BzrpHrHS.cjs"),eo=require("./Spinner-WHzzloYQ.cjs"),$t=require("./index-DQA8q5sC.cjs"),_=require("./index-DLFt97gy.cjs"),_t=require("./Typography-BqmyF1gP.cjs"),to=require("./index-C5K--w8d.cjs"),Ft=require("./Source-PKuwZOn3.cjs"),oo=require("./index-w64Zl8io-DrMm5QSb.cjs"),ro=require("./Tooltip-Hr46paWP.cjs"),yt=require("./index-BhI7mBJx.cjs"),ao=require("./DetailsModal-jmmKRMRM.cjs"),io=require("./pow-BnyPO-NX.cjs"),no=require("./ordinal-CrsysVE-.cjs"),so=require("./threshold-DNsSUf8Q.cjs"),zt=require("./select-Bnfk0lJx.cjs"),le=require("./proxy-CqH8m8IQ.cjs"),ft=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),lo=require("./numberFormattingFunction-Cn9R7CM9.cjs"),co=require("./use-in-view-dnRv_qqF.cjs"),uo=require("./index-FXfr51ZM.cjs"),po=require("./GraphFooter.cjs"),mo=require("./GraphHeader.cjs"),ke=require("./Colors.cjs"),Tt=require("./fetchAndParseData-QTF6tjij.cjs"),At=require("./GraphContainer-Cul9b74X.cjs"),xo=require("./getUniqValue-NX8DgwND.cjs"),ho=require("./getJenks-BzJvhy_H.cjs");function go(a){const e=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(a){for(const t in a)if(t!=="default"){const g=Object.getOwnPropertyDescriptor(a,t);Object.defineProperty(e,t,g.get?g:{enumerable:!0,get:()=>a[t]})}}return e.default=a,Object.freeze(e)}const fo=go(s);var yo="Separator",Ut="horizontal",vo=["horizontal","vertical"],Gt=fo.forwardRef((a,e)=>{const{decorative:t,orientation:g=Ut,...v}=a,l=jo(g)?g:Ut,j=t?{role:"none"}:{"aria-orientation":l==="vertical"?l:void 0,role:"separator"};return r.ae.jsx(oo.w.div,{"data-orientation":l,...j,...v,ref:e})});Gt.displayName=yo;function jo(a){return vo.includes(a)}var Ht=Gt;const Xt=s.forwardRef((a,e)=>{const t=r._.c(14);let g,v,l,j;t[0]!==a?({className:g,variant:l,orientation:j,...v}=a,t[0]=a,t[1]=g,t[2]=v,t[3]=l,t[4]=j):(g=t[1],v=t[2],l=t[3],j=t[4]);const b=l===void 0?"dark":l,c=j===void 0?"horizontal":j,x=c==="horizontal"?"h-[1px] w-full":"h-full w-[1px]",R=b==="dark"?"bg-primary-gray-600 dark:bg-primary-gray-200":"bg-primary-gray-400 dark:bg-primary-gray-550";let C;t[5]!==g||t[6]!==x||t[7]!==R?(C=r.mo(x,R,g),t[5]=g,t[6]=x,t[7]=R,t[8]=C):C=t[8];let q;return t[9]!==c||t[10]!==v||t[11]!==e||t[12]!==C?(q=r.ae.jsx(Ht,{...v,ref:e,orientation:c,className:C}),t[9]=c,t[10]=v,t[11]=e,t[12]=C,t[13]=q):q=t[13],q});Xt.displayName=Ht.displayName;function bo(a){const{data:e,colors:t,mapData:g,mapColorLegendTitle:v,colorDomain:l,radius:j,height:b,width:c,scale:x,centerPoint:R,tooltip:C,showLabels:q,mapBorderWidth:ce,mapBorderColor:de,mapNoDataColor:Ce,onSeriesMouseOver:U,showColorScale:Re,zoomScaleExtend:Ge,zoomTranslateExtend:He,highlightedDataPoints:De,onSeriesMouseClick:z,resetSelectionOnDoubleClick:Se,detailsOnClick:G,styles:D,classNames:H,mapProjection:re,zoomInteraction:X,animate:E,dimmedOpacity:V,customLayers:ue,maxRadiusValue:Ne,categorical:ae,dotColor:Y,collapseColorScaleByDefault:Me,highlightedIds:ie,mapProperty:pe,dotLegendTitle:me,dotBorderColor:Oe,labelColor:qe,projectionRotate:J,rewindCoordinatesInMapData:Z,overlayMapData:m,overlayMapBorderColor:y,overlayMapBorderWidth:Xe,locale:Ye}=a,K=s.useMemo(()=>Z?_.index_default(g,{reverse:!0}):g,[g,Z]),Je=s.useMemo(()=>!Z||!m?m:_.index_default(m,{reverse:!0}),[m,Z]),[S,N]=s.useState(void 0),[xe,he]=s.useState(Me===void 0?!(c<680):!Me),ge=s.useRef(null),[W,Q]=s.useState(void 0),[fe,I]=s.useState(void 0),[Ie,M]=s.useState(void 0),[Pe,L]=s.useState(void 0),f=s.useRef(null),w=co.useInView(f,{once:E.once,amount:E.amount}),ne=s.useRef(null),k=e.filter(o=>o.radius===void 0||o.radius===null).length!==e.length?io.sqrt().domain([0,Ne]).range([.25,j]).nice():void 0,Be=ae?no.ordinal().domain(l).range(t):so.threshold().domain(l).range(t);s.useEffect(()=>{const o=zt.select(ne.current),i=zt.select(f.current),h=n=>{if(X==="noZoom")return!1;if(X==="button")return!n.type.includes("wheel");const F=n.type==="wheel",Le=n.type.startsWith("touch"),$e=n.type==="mousedown"||n.type==="mousemove";return Le?!0:F?X==="scroll"?!0:n.ctrlKey:$e&&!n.button&&!n.ctrlKey},B=_.zoom().scaleExtent(Ge).translateExtent(He||[[-20,-20],[c+20,b+20]]).filter(h).on("zoom",({transform:n})=>{o.attr("transform",n)});i.call(B),ge.current=B},[b,c,X]);const ee=_.index_default$1(K),$=to.index_default(K),_e=(ee[2]-ee[0])*1.15,ze=(ee[3]-ee[1])*1.15,Ve=c*190/960*360/_e,We=b*190/678*180/ze,P=x*Math.min(Ve,We),te=re==="mercator"?_.geoMercator().rotate(J).center(R||$.geometry.coordinates).translate([c/2,b/2]).scale(P):re==="equalEarth"?_.geoEqualEarth().rotate(J).center(R||$.geometry.coordinates).translate([c/2,b/2]).scale(P):re==="naturalEarth"?_.geoNaturalEarth1().rotate(J).center(R||$.geometry.coordinates).translate([c/2,b/2]).scale(P):re==="orthographic"?_.geoOrthographic().rotate(J).center(R||$.geometry.coordinates).translate([c/2,b/2]).scale(P):_.geoAlbersUsa().rotate(J).center(R||$.geometry.coordinates).translate([c/2,b/2]).scale(P),oe=_.geoPath().projection(te),ye=o=>{if(!f.current||!ge.current)return;zt.select(f.current).call(ge.current.scaleBy,o==="in"?1.2:1/1.2)};return r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"relative",children:[r.jsxRuntimeExports.jsx(le.motion.svg,{width:`${c}px`,height:`${b}px`,viewBox:`0 0 ${c} ${b}`,ref:f,direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{ref:ne,children:[ue.filter(o=>o.position==="before").map(o=>o.layer),K.features.map((o,i)=>{if(!o.properties?.[pe])return null;const h=oe(o);return h?r.jsxRuntimeExports.jsx(le.motion.g,{opacity:S?V:ie?ie.indexOf(o.properties[pe])!==-1?1:V:1,children:r.jsxRuntimeExports.jsx("path",{d:h,style:{stroke:de,strokeWidth:ce,fill:Ce,vectorEffect:"non-scaling-stroke"}})},i):null}),r.jsxRuntimeExports.jsxs(uo.AnimatePresence,{children:[e.filter(o=>o.id).map(o=>{const i=K.features.findIndex(n=>o.id===n.properties[pe]);if(i===-1)return null;const h=oe(K.features[i]);if(!h)return null;const B=ft.checkIfNullOrUndefined(o.x)?Ce:Be(o.x);return r.jsxRuntimeExports.jsx(le.motion.g,{className:"undp-map-shapes",variants:{initial:{opacity:0},whileInView:{opacity:S?S===B?1:V:ie?ie.indexOf(o.id)!==-1?1:V:1,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:n=>{I(o),L(n.clientY),M(n.clientX),U?.(o)},onMouseMove:n=>{I(o),L(n.clientY),M(n.clientX)},onMouseLeave:()=>{I(void 0),M(void 0),L(void 0),U?.(void 0)},onClick:()=>{(z||G)&&($t.isEqual(W,o)&&Se?(Q(void 0),z?.(void 0)):(Q(o),z?.(o)))},children:r.jsxRuntimeExports.jsx(le.motion.path,{d:h,variants:{initial:{fill:B,opacity:0},whileInView:{fill:B,opacity:1,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},style:{stroke:de,strokeWidth:ce,vectorEffect:"non-scaling-stroke"}},`${o.id}`)},o.id)}),Je?.features.map((o,i)=>{const h=oe(o);return h?r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("path",{d:h,style:{stroke:y||de,strokeWidth:Xe||ce+1,fill:"none",pointerEvents:"none",vectorEffect:"non-scaling-stroke"}})},i):null}),e.filter(o=>!ft.checkIfNullOrUndefined(o.lat)&&!ft.checkIfNullOrUndefined(o.long)).map(o=>{const i=te([o.long,o.lat])[0]>.8*c?-1:1;return r.jsxRuntimeExports.jsxs(le.motion.g,{className:"undp-map-dots",variants:{initial:{opacity:0},whileInView:{opacity:De?De.indexOf(o.label||"")!==-1?1:V:1,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},onMouseEnter:h=>{I(o),L(h.clientY),M(h.clientX),U?.(o)},onMouseMove:h=>{I(o),L(h.clientY),M(h.clientX)},onMouseLeave:()=>{I(void 0),M(void 0),L(void 0),U?.(void 0)},onClick:()=>{(z||G)&&($t.isEqual(W,o)&&Se?(Q(void 0),z?.(void 0)):(Q(o),z?.(o)))},transform:`translate(${te([o.long,o.lat])[0]},${te([o.long,o.lat])[1]})`,children:[r.jsxRuntimeExports.jsx(le.motion.circle,{cx:0,cy:0,variants:{initial:{r:0,fill:Y,stroke:Oe||Y},whileInView:{r:k?k(o.radius||0):j,fill:Y,stroke:Oe||Y,transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{r:0,transition:{duration:E.duration}},style:{fillOpacity:.8,vectorEffect:"non-scaling-stroke"}}),q&&o.label?r.jsxRuntimeExports.jsx(le.motion.text,{variants:{initial:{opacity:0,x:i*(k?k(o.radius||0):j)},whileInView:{opacity:1,x:i*(k?k(o.radius||0):j),transition:{duration:E.duration}}},initial:"initial",animate:w?"whileInView":"initial",exit:{opacity:0,transition:{duration:E.duration}},y:0,className:r.mo("text-sm",H?.graphObjectValues),style:{textAnchor:i===-1?"end":"start",fill:qe||"#000",vectorEffect:"non-scaling-stroke",...D?.graphObjectValues||{}},dx:i*4,dy:5,children:o.label}):null]},o.label||`${o.lat}-${o.long}`)})]}),ue.filter(o=>o.position==="after").map(o=>o.layer)]})}),Re===!1?null:r.jsxRuntimeExports.jsx("div",{className:r.mo("absolute left-4 bottom-4 map-color-legend",H?.colorLegend),children:xe?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsx("div",{className:"color-legend-close-button bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)] border border-[var(--gray-400)] rounded-full w-6 h-6 p-[3px] cursor-pointer z-10 absolute right-[-0.75rem] top-[-0.75rem]",onClick:()=>{he(!1)},children:r.jsxRuntimeExports.jsx(yt.X,{})}),r.jsxRuntimeExports.jsxs("div",{className:"color-legend-box p-2 bg-[rgba(240,240,240,0.7)] dark:bg-[rgba(30,30,30,0.7)]",style:{width:ae?void 0:"340px"},children:[me&&me!==""?r.jsxRuntimeExports.jsxs(r.jsxRuntimeExports.Fragment,{children:[r.jsxRuntimeExports.jsxs("div",{className:"flex items-center gap-2",children:[r.jsxRuntimeExports.jsx("div",{className:"w-3 h-3 rounded-full",style:{backgroundColor:Y}}),r.jsxRuntimeExports.jsx(_t._,{size:"xs",marginBottom:"none",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:me})]}),r.jsxRuntimeExports.jsx(Ft.n,{size:"xl"}),r.jsxRuntimeExports.jsx(Xt,{}),r.jsxRuntimeExports.jsx(Ft.n,{size:"xl"})]}):null,v&&v!==""?r.jsxRuntimeExports.jsx(_t._,{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:v}):null,ae?r.jsxRuntimeExports.jsx("div",{className:"flex flex-col gap-3",children:l.map((o,i)=>r.jsxRuntimeExports.jsxs("div",{className:"flex gap-2 items-center",onMouseOver:()=>{N(t[i%t.length])},onMouseLeave:()=>{N(void 0)},children:[r.jsxRuntimeExports.jsx("div",{className:"w-2 h-2 rounded-full",style:{backgroundColor:t[i%t.length]}}),r.jsxRuntimeExports.jsx(_t._,{size:"sm",marginBottom:"none",leading:"none",children:o})]},i))}):r.jsxRuntimeExports.jsx("svg",{width:"100%",viewBox:"0 0 320 30",direction:"ltr",children:r.jsxRuntimeExports.jsxs("g",{children:[l.map((o,i)=>r.jsxRuntimeExports.jsxs("g",{onMouseOver:()=>{N(t[i])},onMouseLeave:()=>{N(void 0)},className:"cursor-pointer",children:[r.jsxRuntimeExports.jsx("rect",{x:i*320/t.length+1,y:1,width:320/t.length-2,height:8,className:S===t[i]?"stroke-primary-gray-700 dark:stroke-primary-gray-300":"",style:{fill:t[i],...S===t[i]?{}:{stroke:t[i]}}}),r.jsxRuntimeExports.jsx("text",{x:(i+1)*320/t.length,y:25,className:"fill-primary-gray-700 dark:fill-primary-gray-300 text-xs",style:{textAnchor:"middle"},children:lo.numberFormattingFunction(o,void 0,void 0,void 0,void 0,Ye)})]},i)),r.jsxRuntimeExports.jsx("g",{children:r.jsxRuntimeExports.jsx("rect",{onMouseOver:()=>{N(t[l.length])},onMouseLeave:()=>{N(void 0)},x:l.length*320/t.length+1,y:1,width:320/t.length-2,height:8,className:`cursor-pointer ${S===t[l.length]?"stroke-1 stroke-primary-gray-700 dark:stroke-primary-gray-300":""}`,style:{fill:t[l.length],...S===t[l.length]?{}:{stroke:t[l.length]}}})})]})})]})]}):r.jsxRuntimeExports.jsx("button",{type:"button",className:"p-1 border-0 rounded-[2px] text-primary-gray-700 bg-primary-gray-300 dark:bg-primary-gray-500 map-legend-button",onClick:()=>{he(!0)},children:r.jsxRuntimeExports.jsx(yt.ExpandIcon,{})})}),X==="button"&&r.jsxRuntimeExports.jsxs("div",{className:"absolute left-4 top-4 flex flex-col zoom-buttons",children:[r.jsxRuntimeExports.jsx("button",{onClick:()=>ye("in"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"+"}),r.jsxRuntimeExports.jsx("button",{onClick:()=>ye("out"),className:"leading-0 px-2 py-3.5 text-primary-gray-700 border border-t-0 border-primary-gray-400 bg-primary-gray-200 dark:border-primary-gray-550 dark:bg-primary-gray-600 dark:text-primary-gray-100",children:"–"})]})]}),G&&W!==void 0?r.jsxRuntimeExports.jsx(ao.DetailsModal,{body:G,data:W,setData:Q,className:H?.modal}):null,fe&&C&&Ie&&Pe?r.jsxRuntimeExports.jsx(ro.Tooltip,{data:fe,body:C,xPos:Ie,yPos:Pe,backgroundStyle:D?.tooltip,className:H?.tooltip}):null]})}function Eo(a){const e=r.compilerRuntimeExports.c(143),{data:t,mapData:g,graphTitle:v,colors:l,sources:j,graphDescription:b,height:c,width:x,footNote:R,mapColorLegendTitle:C,colorDomain:q,choroplethScaleType:ce,radius:de,scale:Ce,centerPoint:U,padding:Re,mapBorderWidth:Ge,mapNoDataColor:He,backgroundColor:De,showLabels:z,mapBorderColor:Se,tooltip:G,relativeHeight:D,onSeriesMouseOver:H,isWorldMap:re,showColorScale:X,zoomScaleExtend:E,zoomTranslateExtend:V,graphID:ue,highlightedDataPoints:Ne,onSeriesMouseClick:ae,graphDownload:Y,dataDownload:Me,showAntarctica:ie,language:pe,minHeight:me,theme:Oe,ariaLabel:qe,resetSelectionOnDoubleClick:J,detailsOnClick:Z,styles:m,classNames:y,mapProjection:Xe,zoomInteraction:Ye,animate:K,dimmedOpacity:Je,customLayers:S,maxRadiusValue:N,timeline:xe,collapseColorScaleByDefault:he,dotColor:ge,highlightedIds:W,mapProperty:Q,dotLegendTitle:fe,dotBorderColor:I,labelColor:Ie,projectionRotate:M,rewindCoordinatesInMapData:Pe,locale:L,mapOverlay:f}=a,w=g===void 0?"https://raw.githubusercontent.com/UNDP-Data/dv-country-geojson/refs/heads/main/worldMap-v2.json":g,ne=R===void 0?"The designations employed and the presentation of material on this map do not imply the expression of any opinion whatsoever on the part of the Secretariat of the United Nations or UNDP concerning the legal status of any country, territory, city or area or its authorities, or concerning the delimitation of its frontiers or boundaries.":R,k=ce===void 0?"threshold":ce,Be=de===void 0?5:de,ee=Ce===void 0?.95:Ce,$=Ge===void 0?.5:Ge,_e=He===void 0?ke.Colors.light.graphNoData:He,ze=De===void 0?!1:De,Ve=z===void 0?!1:z,We=Se===void 0?ke.Colors.light.grays["gray-500"]:Se,P=re===void 0?!0:re,te=X===void 0?!0:X;let oe;e[0]!==E?(oe=E===void 0?[.8,6]:E,e[0]=E,e[1]=oe):oe=e[1];const ye=oe,o=Y===void 0?!1:Y,i=Me===void 0?!1:Me,h=ie===void 0?!1:ie,B=pe===void 0?"en":pe,n=me===void 0?0:me,F=Oe===void 0?"light":Oe,Le=J===void 0?!0:J,$e=Xe===void 0?"naturalEarth":Xe,vt=Ye===void 0?"button":Ye,Ze=K===void 0?!1:K,jt=Je===void 0?.3:Je;let Ke;e[2]!==S?(Ke=S===void 0?[]:S,e[2]=S,e[3]=Ke):Ke=e[3];const bt=Ke;let Qe;e[4]!==xe?(Qe=xe===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:xe,e[4]=xe,e[5]=Qe):Qe=e[5];const d=Qe,Et=ge===void 0?ke.Colors.primaryColors["blue-600"]:ge;let et;e[6]!==W?(et=W===void 0?[]:W,e[6]=W,e[7]=et):et=e[7];const wt=et,kt=Q===void 0?"ISO3":Q,Ct=Ie===void 0?ke.Colors.primaryColors["blue-600"]:Ie;let tt;e[8]!==M?(tt=M===void 0?[0,0]:M,e[8]=M,e[9]=tt):tt=e[9];const Rt=tt,Dt=Pe===void 0?!0:Pe,St=L===void 0?"en":L,[se,Yt]=s.useState(0),[Fe,Jt]=s.useState(0),[T,Zt]=s.useState(d.autoplay);let Te;if(e[10]!==t||e[11]!==d.dateFormat){let u;e[13]!==d.dateFormat?(u=O=>Wt.parse(`${O.date}`,d.dateFormat||"yyyy",new Date).getTime(),e[13]=d.dateFormat,e[14]=u):u=e[14],Te=[...new Set(t.filter(Io).map(u))],Te.sort(qo),e[10]=t,e[11]=d.dateFormat,e[12]=Te}else Te=e[12];const p=Te,[A,Nt]=s.useState(d.autoplay?0:p.length-1),[ve,Kt]=s.useState(void 0),[Mt,Qt]=s.useState(void 0),Ot=s.useRef(null),Vt=s.useRef(null);let ot;e[15]!==k||e[16]!==q||e[17]!==l?.length||e[18]!==t?(ot=q||(k==="categorical"?xo.getUniqValue(t,"x"):ho.getJenks(t.map(Oo),l?.length||4)),e[15]=k,e[16]=q,e[17]=l?.length,e[18]=t,e[19]=ot):ot=e[19];const Ae=ot;let rt,at;e[20]===Symbol.for("react.memo_cache_sentinel")?(rt=()=>{const u=new ResizeObserver(O=>{Yt(O[0].target.clientWidth||620),Jt(O[0].target.clientHeight||480)});return Ot.current&&u.observe(Ot.current),()=>u.disconnect()},at=[],e[20]=rt,e[21]=at):(rt=e[20],at=e[21]),s.useEffect(rt,at);let it;e[22]===Symbol.for("react.memo_cache_sentinel")?(it=u=>{Kt(u)},e[22]=it):it=e[22];const nt=s.useEffectEvent(it);let st;e[23]===Symbol.for("react.memo_cache_sentinel")?(st=u=>{Qt(u)},e[23]=st):st=e[23];const Ue=s.useEffectEvent(st);let lt;e[24]!==w||e[25]!==nt?(lt=()=>{typeof w=="string"?Tt.fetchAndParseJSON(w).then(O=>{nt(O)}):nt(w)},e[24]=w,e[25]=nt,e[26]=lt):lt=e[26];let ct;e[27]!==w?(ct=[w],e[27]=w,e[28]=ct):ct=e[28],s.useEffect(lt,ct);let dt;e[29]!==f?.mapData||e[30]!==Ue?(dt=()=>{f?.mapData||Ue(void 0),typeof f?.mapData=="string"?Tt.fetchAndParseJSON(f?.mapData).then(O=>{Ue(O)}):Ue(f?.mapData)},e[29]=f?.mapData,e[30]=Ue,e[31]=dt):dt=e[31];const qt=f?.mapData;let ut;e[32]!==qt?(ut=[qt],e[32]=qt,e[33]=ut):ut=e[33],s.useEffect(dt,ut);let pt,mt;e[34]!==T||e[35]!==d.speed||e[36]!==p?(pt=()=>{const u=setInterval(()=>{Nt(O=>O<p.length-1?O+1:0)},(d.speed||2)*1e3);return T||clearInterval(u),()=>clearInterval(u)},mt=[p,T,d.speed],e[34]=T,e[35]=d.speed,e[36]=p,e[37]=pt,e[38]=mt):(pt=e[37],mt=e[38]),s.useEffect(pt,mt);const It=d.dateFormat||"yyyy";let xt;e[39]!==A||e[40]!==It||e[41]!==d.showOnlyActiveDate||e[42]!==p?(xt=Lt.getSliderMarks(p,A,d.showOnlyActiveDate,It),e[39]=A,e[40]=It,e[41]=d.showOnlyActiveDate,e[42]=p,e[43]=xt):xt=e[43];const ht=xt,Pt=y?.graphContainer,Bt=m?.graphContainer;let je;e[44]!==y?.description||e[45]!==y?.title||e[46]!==t||e[47]!==i||e[48]!==b||e[49]!==o||e[50]!==v||e[51]!==m?.description||e[52]!==m?.title||e[53]!==x?(je=v||b||o||i?r.jsxRuntimeExports.jsx(mo.GraphHeader,{styles:{title:m?.title,description:m?.description},classNames:{title:y?.title,description:y?.description},graphTitle:v,graphDescription:b,width:x,graphDownload:o?Vt:void 0,dataDownload:i?t.map(Mo).filter(No).length>0?t.map(So).filter(Do):t.filter(Ro):null}):null,e[44]=y?.description,e[45]=y?.title,e[46]=t,e[47]=i,e[48]=b,e[49]=o,e[50]=v,e[51]=m?.description,e[52]=m?.title,e[53]=x,e[54]=je):je=e[54];let be;e[55]!==A||e[56]!==ht||e[57]!==T||e[58]!==d.enabled||e[59]!==p?(be=d.enabled&&p.length>0&&ht?r.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[r.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Zt(!T)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":T?"Click to pause animation":"Click to play animation",children:T?r.jsxRuntimeExports.jsx(yt.Pause,{}):r.jsxRuntimeExports.jsx(yt.Play,{})}),r.jsxRuntimeExports.jsx(Lt.Nr,{min:p[0],max:p[p.length-1],marks:ht,step:null,defaultValue:p[p.length-1],value:p[A],onChangeComplete:u=>{Nt(p.indexOf(u))},onChange:u=>{Nt(p.indexOf(u))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,e[55]=A,e[56]=ht,e[57]=T,e[58]=d.enabled,e[59]=p,e[60]=be):be=e[60];let Ee;e[61]!==Ze||e[62]!==U||e[63]!==k||e[64]!==y||e[65]!==he||e[66]!==l||e[67]!==bt||e[68]!==t||e[69]!==Z||e[70]!==jt||e[71]!==Ae||e[72]!==I||e[73]!==Et||e[74]!==fe||e[75]!==c||e[76]!==Ne||e[77]!==wt||e[78]!==A||e[79]!==P||e[80]!==Ct||e[81]!==St||e[82]!==We||e[83]!==$||e[84]!==C||e[85]!==_e||e[86]!==f?.mapBorderColor||e[87]!==f?.mapBorderWidth||e[88]!==$e||e[89]!==kt||e[90]!==ve||e[91]!==N||e[92]!==n||e[93]!==ae||e[94]!==H||e[95]!==Mt||e[96]!==Rt||e[97]!==Be||e[98]!==D||e[99]!==Le||e[100]!==Dt||e[101]!==ee||e[102]!==h||e[103]!==te||e[104]!==Ve||e[105]!==m||e[106]!==Fe||e[107]!==se||e[108]!==F||e[109]!==d.dateFormat||e[110]!==d.enabled||e[111]!==G||e[112]!==p||e[113]!==x||e[114]!==vt||e[115]!==ye||e[116]!==V?(Ee=r.jsxRuntimeExports.jsx(At.GraphArea,{ref:Ot,children:se&&Fe&&ve?r.jsxRuntimeExports.jsx(bo,{dotColor:Et,data:t.filter(u=>d.enabled?`${u.date}`===Wt.format(new Date(p[A]),d.dateFormat||"yyyy"):u),mapData:h?ve:{...ve,features:ve.features.filter(Co)},overlayMapData:Mt,overlayMapBorderColor:f?.mapBorderColor,overlayMapBorderWidth:f?.mapBorderWidth,colorDomain:Ae,width:se,height:Fe,scale:ee,centerPoint:U,colors:l||(k==="categorical"?ke.Colors[F].sequentialColors[`neutralColorsx0${Ae.length}`]:ke.Colors[F].sequentialColors[`neutralColorsx0${Ae.length+1}`]),mapColorLegendTitle:C,radius:Be,categorical:k==="categorical",mapBorderWidth:$,mapNoDataColor:_e,mapBorderColor:We,tooltip:G,onSeriesMouseOver:H,showLabels:Ve,isWorldMap:P,showColorScale:te,zoomScaleExtend:ye,zoomTranslateExtend:V,onSeriesMouseClick:ae,highlightedDataPoints:Ne,resetSelectionOnDoubleClick:Le,styles:m,classNames:y,zoomInteraction:vt,detailsOnClick:Z,mapProjection:$e||(P?"naturalEarth":"mercator"),animate:Ze===!0?{duration:.5,once:!0,amount:.5}:Ze||{duration:0,once:!0,amount:0},dimmedOpacity:jt,customLayers:bt,maxRadiusValue:ft.checkIfNullOrUndefined(N)?Math.max(...t.map(ko).filter(wo)):N,collapseColorScaleByDefault:he,highlightedIds:wt,mapProperty:kt,dotLegendTitle:fe,dotBorderColor:I,labelColor:Ct,projectionRotate:Rt,rewindCoordinatesInMapData:Dt,locale:St}):r.jsxRuntimeExports.jsx("div",{style:{height:`${Math.max(n,c||(D?n?(x||se)*D>n?(x||se)*D:n:(x||se)*D:Fe))}px`},className:"flex items-center justify-center",children:r.jsxRuntimeExports.jsx(eo.w,{"aria-label":"Loading graph"})})}),e[61]=Ze,e[62]=U,e[63]=k,e[64]=y,e[65]=he,e[66]=l,e[67]=bt,e[68]=t,e[69]=Z,e[70]=jt,e[71]=Ae,e[72]=I,e[73]=Et,e[74]=fe,e[75]=c,e[76]=Ne,e[77]=wt,e[78]=A,e[79]=P,e[80]=Ct,e[81]=St,e[82]=We,e[83]=$,e[84]=C,e[85]=_e,e[86]=f?.mapBorderColor,e[87]=f?.mapBorderWidth,e[88]=$e,e[89]=kt,e[90]=ve,e[91]=N,e[92]=n,e[93]=ae,e[94]=H,e[95]=Mt,e[96]=Rt,e[97]=Be,e[98]=D,e[99]=Le,e[100]=Dt,e[101]=ee,e[102]=h,e[103]=te,e[104]=Ve,e[105]=m,e[106]=Fe,e[107]=se,e[108]=F,e[109]=d.dateFormat,e[110]=d.enabled,e[111]=G,e[112]=p,e[113]=x,e[114]=vt,e[115]=ye,e[116]=V,e[117]=Ee):Ee=e[117];let we;e[118]!==y?.footnote||e[119]!==y?.source||e[120]!==ne||e[121]!==j||e[122]!==m?.footnote||e[123]!==m?.source||e[124]!==x?(we=j||ne?r.jsxRuntimeExports.jsx(po.GraphFooter,{styles:{footnote:m?.footnote,source:m?.source},classNames:{footnote:y?.footnote,source:y?.source},sources:j,footNote:ne,width:x}):null,e[118]=y?.footnote,e[119]=y?.source,e[120]=ne,e[121]=j,e[122]=m?.footnote,e[123]=m?.source,e[124]=x,e[125]=we):we=e[125];let gt;return e[126]!==qe||e[127]!==ze||e[128]!==ue||e[129]!==c||e[130]!==B||e[131]!==n||e[132]!==Re||e[133]!==D||e[134]!==Pt||e[135]!==Bt||e[136]!==je||e[137]!==be||e[138]!==Ee||e[139]!==we||e[140]!==F||e[141]!==x?(gt=r.jsxRuntimeExports.jsxs(At.GraphContainer,{className:Pt,style:Bt,id:ue,ref:Vt,"aria-label":qe,backgroundColor:ze,theme:F,language:B,minHeight:n,width:x,height:c,relativeHeight:D,padding:Re,children:[je,be,Ee,we]}),e[126]=qe,e[127]=ze,e[128]=ue,e[129]=c,e[130]=B,e[131]=n,e[132]=Re,e[133]=D,e[134]=Pt,e[135]=Bt,e[136]=je,e[137]=be,e[138]=Ee,e[139]=we,e[140]=F,e[141]=x,e[142]=gt):gt=e[142],gt}function wo(a){return a!=null}function ko(a){return a.radius}function Co(a){return a.properties?.NAME!=="Antarctica"}function Ro(a){return a!==void 0}function Do(a){return a!==void 0}function So(a){return a.data}function No(a){return a!==void 0}function Mo(a){return a.data}function Oo(a){return a.x}function qo(a,e){return a-e}function Io(a){return a.date}exports.HybridMap=Eo;
2
2
  //# sourceMappingURL=HybridMap.cjs.map