@undp/data-viz 2.0.1 → 2.0.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.
package/dist/BarGraph.cjs CHANGED
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),q=require("react"),ye=require("./getSliderMarks-BmADcPQt.cjs"),me=require("./parse-hMnG_lRV.cjs"),Ne=require("./index-Cno4Q0YE.cjs"),oe=require("./index-CSNtgibC.cjs"),je=require("./index-DQA8q5sC.cjs"),we=require("./Modal-JW_IExO3.cjs"),ue=require("./numberFormattingFunction-02t-wJta.cjs"),Ae=require("./Tooltip-4dJo4_AF.cjs"),_t=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),$e=require("./string2HTML-CPGr_I5E.cjs"),Te=require("./YAxesLabels-DcS85Beo.cjs"),Ee=require("./Axis-DxRV2yMi.cjs"),Oe=require("./AxisTitle-sS5bLLR7.cjs"),Se=require("./XTicksAndGridLines-B6CELS7q.cjs"),ke=require("./ReferenceLine-BH0qdf4R.cjs"),De=require("./YTicksAndGridLines-4pxTRlRK.cjs"),ze=require("./XAxesLabels-D5X8jngD.cjs"),Ce=require("./use-in-view-QcfiW0w3.cjs"),Re=require("./linear-BwPAspcq.cjs"),fe=require("./band-VYfcZeJ2.cjs"),Me=require("./index-DG2bgAva.cjs"),Zt=require("./proxy-BxvUI_9l.cjs"),Be=require("./GraphHeader.cjs"),Fe=require("./GraphFooter.cjs"),Pe=require("./ColorLegendWithMouseOver.cjs"),ce=require("./Colors.cjs"),qe=require("./EmptyState-sAEZ_5rU.cjs"),be=require("./index-DRXx7m-C.cjs"),he=require("./ensureCompleteData-I6nYmT8E.cjs"),Le=require("./uniqBy-O05lp2S5.cjs"),ve=require("./GraphContainer-d8A46BK2.cjs"),He=require("./sort-O96oMZLb.cjs"),Ge=require("./init-DU0ybBc_.cjs"),Ie=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs");function Xe(e){const t=i.compilerRuntimeExports.c(122),{data:d,leftMargin:L,rightMargin:qt,topMargin:Dt,bottomMargin:yt,barColors:et,barPadding:xt,showTicks:k,truncateBy:I,width:y,height:z,suffix:Nt,prefix:ct,showValues:Vt,showLabels:B,tooltip:it,onSeriesMouseOver:mt,refValues:dt,maxValue:Tt,minValue:j,onSeriesMouseClick:st,selectedColor:Y,rtl:H,labelOrder:Q,maxBarThickness:U,resetSelectionOnDoubleClick:F,detailsOnClick:$,barAxisTitle:W,valueColor:T,noOfTicks:a,styles:s,classNames:o,animate:u,colorDomain:x,precision:h,customLayers:m,naLabel:A}=e,Z=L===void 0?100:L,J=qt===void 0?40:qt,ut=Dt===void 0?25:Dt,Ft=yt===void 0?10:yt,Ht=q.useRef(null);let G;t[0]!==u.amount||t[1]!==u.once?(G={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=G):G=t[2];const bt=Ce.useInView(Ht,G),zt=W?ut+25:ut;let r;t[3]!==Ft||t[4]!==Z||t[5]!==J||t[6]!==zt?(r={top:zt,bottom:Ft,left:Z,right:J},t[3]=Ft,t[4]=Z,t[5]=J,t[6]=zt,t[7]=r):r=t[7];const c=r,[D,p]=q.useState(void 0),[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),pt=y-c.left-c.right,R=z-c.top-c.bottom;let g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft,gt;if(t[8]!==u||t[9]!==W||t[10]!==et||t[11]!==xt||t[12]!==o?.graphObjectValues||t[13]!==o?.xAxis?.gridLines||t[14]!==o?.xAxis?.labels||t[15]!==o?.xAxis?.title||t[16]!==o?.yAxis?.axis||t[17]!==o?.yAxis?.labels||t[18]!==x||t[19]!==m||t[20]!==d||t[21]!==$||t[22]!==R||t[23]!==pt||t[24]!==z||t[25]!==bt||t[26]!==Q||t[27]!==c.bottom||t[28]!==c.left||t[29]!==c.top||t[30]!==U||t[31]!==Tt||t[32]!==j||t[33]!==C||t[34]!==A||t[35]!==a||t[36]!==st||t[37]!==mt||t[38]!==h||t[39]!==ct||t[40]!==dt||t[41]!==F||t[42]!==H||t[43]!==Y||t[44]!==B||t[45]!==k||t[46]!==Vt||t[47]!==s?.graphObjectValues||t[48]!==s?.xAxis?.gridLines||t[49]!==s?.xAxis?.labels||t[50]!==s?.xAxis?.title||t[51]!==s?.yAxis?.axis||t[52]!==s?.yAxis?.labels||t[53]!==Nt||t[54]!==ut||t[55]!==I||t[56]!==T||t[57]!==y){let rt;t[72]!==Q?(rt=(v,O)=>({...v,id:Q?`${v.label}`:`${O}`}),t[72]=Q,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=Q||St.map(_e),E=Re.linear().domain([j,Tt]).range([0,pt]).nice(),Ut=fe.band().domain(Gt).range([0,U?Math.min(R,U*Gt.length):R]).paddingInner(xt),It=fe.band().domain(d[0].size.map(Ze)).range([0,Ut.bandwidth()]).paddingInner(.1),Kt=E.ticks(a);_=Zt.motion.svg,kt=Ht,ot=`${y}px`,Ct=`${z}px`,X=`0 0 ${y} ${z}`,lt="ltr",tt=`translate(${c.left},${c.top})`,K=k?i.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:Kt.filter(Qe),x:Kt.filter(Ke).map(v=>E(v)),y1:0-ut,y2:R+c.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:o?.xAxis?.gridLines,labels:o?.xAxis?.labels},suffix:Nt,prefix:ct,labelType:"secondary",showGridLines:!0,precision:h}):null;const Lt=pt/2,Qt=0-c.top+15,Wt=s?.xAxis?.title,Pt=o?.xAxis?.title;t[74]!==W||t[75]!==Lt||t[76]!==Qt||t[77]!==Wt||t[78]!==Pt?(M=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:Lt,y:Qt,style:Wt,className:Pt,text:W}),t[74]=W,t[75]=Lt,t[76]=Qt,t[77]=Wt,t[78]=Pt,t[79]=M):M=t[79],t[80]!==m?(ht=m.filter(Je).map(We),t[80]=m,t[81]=ht):ht=t[81],g=Me.AnimatePresence,P=St.map(v=>_t.checkIfNullOrUndefined(Ut(v.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{variants:{initial:{x:0,y:Ut(`${v.id}`)},whileInView:{x:0,y:Ut(`${v.id}`),transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[v.size.map((O,n)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",opacity:Y?et[n]===Y?1:.3:.85,onMouseEnter:f=>{p({...v,sizeIndex:n}),nt(f.clientY),Mt(f.clientX),mt?.({...v,sizeIndex:n})},onMouseMove:f=>{p({...v,sizeIndex:n}),nt(f.clientY),Mt(f.clientX)},onMouseLeave:()=>{p(void 0),Mt(void 0),nt(void 0),mt?.(void 0)},onClick:()=>{(st||$)&&(je.isEqual(C,{...v,sizeIndex:n})&&F?(S(void 0),st?.(void 0)):(S({...v,sizeIndex:n}),st&&st({...v,sizeIndex:n})))},children:[_t.checkIfNullOrUndefined(O)?null:i.jsxRuntimeExports.jsx(Zt.motion.rect,{y:It(`${n}`),variants:{initial:{width:0,x:E(0),fill:et[n]},whileInView:{width:_t.checkIfNullOrUndefined(O)?0:O>=0?E(O)-E(0):E(0)-E(O),x:O>=0?E(0):E(O),fill:et[n],transition:{duration:u.duration}}},exit:{width:0,x:E(0),transition:{duration:u.duration}},height:It.bandwidth(),initial:"initial",animate:bt?"whileInView":"initial"}),Vt?i.jsxRuntimeExports.jsx(Zt.motion.text,{y:It(`${n}`)+It.bandwidth()/2,style:{textAnchor:O&&O<0?"end":"start",...s?.graphObjectValues||{}},className:i.mo("graph-value text-sm",o?.graphObjectValues),dx:O&&O<0?-5:5,dy:"0.33em",variants:{initial:{x:E(0),opacity:0,fill:T||et[n]},whileInView:{x:E(O||0),opacity:1,fill:T||et[n],transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:ue.numberFormattingFunction(O,A,h,ct,Nt)}):null]},`${v.label}-${x[n]||n}`)),B?i.jsxRuntimeExports.jsx(Te.YAxesLabels,{value:`${v.label}`.length<I?`${v.label}`:`${`${v.label}`.substring(0,I)}...`,y:0,x:0-c.left,width:E(j<0?0:j)+c.left,height:Ut.bandwidth(),style:s?.yAxis?.labels,className:o?.yAxis?.labels,animate:u,isInView:bt}):null]},v.label));const Ot=o?.yAxis?.axis;let Yt;t[82]!==Ot?(Yt={axis:Ot},t[82]=Ot,t[83]=Yt):Yt=t[83];const Jt=s?.yAxis?.axis;let V;t[84]!==Jt?(V={axis:Jt},t[84]=Jt,t[85]=V):V=t[85],ft=i.jsxRuntimeExports.jsx(Ee.Axis,{x1:E(j<0?0:j),x2:E(j<0?0:j),y1:-2.5,y2:R+c.bottom,classNames:Yt,styles:V}),gt=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((v,O)=>i.jsxRuntimeExports.jsx(ke.RefLineX,{text:v.text,color:v.color,x:E(v.value),y1:0-c.top,y2:R+c.bottom,textSide:E(v.value)>pt*.75||H?"left":"right",classNames:v.classNames,styles:v.styles,animate:u,isInView:bt},O))}):null,t[8]=u,t[9]=W,t[10]=et,t[11]=xt,t[12]=o?.graphObjectValues,t[13]=o?.xAxis?.gridLines,t[14]=o?.xAxis?.labels,t[15]=o?.xAxis?.title,t[16]=o?.yAxis?.axis,t[17]=o?.yAxis?.labels,t[18]=x,t[19]=m,t[20]=d,t[21]=$,t[22]=R,t[23]=pt,t[24]=z,t[25]=bt,t[26]=Q,t[27]=c.bottom,t[28]=c.left,t[29]=c.top,t[30]=U,t[31]=Tt,t[32]=j,t[33]=C,t[34]=A,t[35]=a,t[36]=st,t[37]=mt,t[38]=h,t[39]=ct,t[40]=dt,t[41]=F,t[42]=H,t[43]=Y,t[44]=B,t[45]=k,t[46]=Vt,t[47]=s?.graphObjectValues,t[48]=s?.xAxis?.gridLines,t[49]=s?.xAxis?.labels,t[50]=s?.xAxis?.title,t[51]=s?.yAxis?.axis,t[52]=s?.yAxis?.labels,t[53]=Nt,t[54]=ut,t[55]=I,t[56]=T,t[57]=y,t[58]=g,t[59]=_,t[60]=tt,t[61]=K,t[62]=M,t[63]=ht,t[64]=kt,t[65]=ot,t[66]=Ct,t[67]=X,t[68]=lt,t[69]=P,t[70]=ft,t[71]=gt}else g=t[58],_=t[59],tt=t[60],K=t[61],M=t[62],ht=t[63],kt=t[64],ot=t[65],Ct=t[66],X=t[67],lt=t[68],P=t[69],ft=t[70],gt=t[71];let jt;t[86]!==g||t[87]!==P||t[88]!==ft||t[89]!==gt?(jt=i.jsxRuntimeExports.jsxs(g,{children:[P,ft,gt]}),t[86]=g,t[87]=P,t[88]=ft,t[89]=gt,t[90]=jt):jt=t[90];let wt;t[91]!==m?(wt=m.filter(Ue).map(Ye),t[91]=m,t[92]=wt):wt=t[92];let at;t[93]!==tt||t[94]!==K||t[95]!==M||t[96]!==ht||t[97]!==jt||t[98]!==wt?(at=i.jsxRuntimeExports.jsxs("g",{transform:tt,children:[K,M,ht,jt,wt]}),t[93]=tt,t[94]=K,t[95]=M,t[96]=ht,t[97]=jt,t[98]=wt,t[99]=at):at=t[99];let At;t[100]!==_||t[101]!==kt||t[102]!==ot||t[103]!==Ct||t[104]!==X||t[105]!==lt||t[106]!==at?(At=i.jsxRuntimeExports.jsx(_,{ref:kt,width:ot,height:Ct,viewBox:X,direction:lt,children:at}),t[100]=_,t[101]=kt,t[102]=ot,t[103]=Ct,t[104]=X,t[105]=lt,t[106]=at,t[107]=At):At=t[107];let $t;t[108]!==o?.tooltip||t[109]!==w||t[110]!==vt||t[111]!==D||t[112]!==s?.tooltip||t[113]!==it?($t=D&&it&&w&&vt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:D,body:it,xPos:w,yPos:vt,backgroundStyle:s?.tooltip,className:o?.tooltip}):null,t[108]=o?.tooltip,t[109]=w,t[110]=vt,t[111]=D,t[112]=s?.tooltip,t[113]=it,t[114]=$t):$t=t[114];let Et;t[115]!==$||t[116]!==C?(Et=$&&C!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:C!==void 0,onClose:()=>{S(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:$e.string2HTML($,C)}:void 0,children:typeof $=="function"?$(C):null})}):null,t[115]=$,t[116]=C,t[117]=Et):Et=t[117];let b;return t[118]!==At||t[119]!==$t||t[120]!==Et?(b=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[At,$t,Et]}),t[118]=At,t[119]=$t,t[120]=Et,t[121]=b):b=t[121],b}function Ye(e){return e.layer}function Ue(e){return e.position==="after"}function We(e){return e.layer}function Je(e){return e.position==="before"}function Ke(e){return e!==0}function Qe(e){return e!==0}function Ze(e,t){return`${t}`}function _e(e){return`${e.id}`}function ti(e){const t=i.compilerRuntimeExports.c(130),{data:d,leftMargin:L,rightMargin:qt,topMargin:Dt,bottomMargin:yt,width:et,height:xt,barColors:k,suffix:I,prefix:y,barPadding:z,showLabels:Nt,showValues:ct,showTicks:Vt,truncateBy:B,tooltip:it,onSeriesMouseOver:mt,refValues:dt,maxValue:Tt,minValue:j,onSeriesMouseClick:st,selectedColor:Y,labelOrder:H,maxBarThickness:Q,resetSelectionOnDoubleClick:U,detailsOnClick:F,barAxisTitle:$,valueColor:W,noOfTicks:T,styles:a,classNames:s,animate:o,colorDomain:u,precision:x,customLayers:h,naLabel:m}=e,A=L===void 0?20:L,Z=qt===void 0?20:qt,J=Dt===void 0?20:Dt,ut=yt===void 0?25:yt,Ft=q.useRef(null);let Ht;t[0]!==o.amount||t[1]!==o.once?(Ht={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=Ht):Ht=t[2];const G=Ce.useInView(Ft,Ht),bt=$?A+30:A;let zt;t[3]!==ut||t[4]!==Z||t[5]!==bt||t[6]!==J?(zt={top:J,bottom:ut,left:bt,right:Z},t[3]=ut,t[4]=Z,t[5]=bt,t[6]=J,t[7]=zt):zt=t[7];const r=zt,[c,D]=q.useState(void 0),[p,C]=q.useState(void 0),[S,w]=q.useState(void 0),[Mt,vt]=q.useState(void 0),nt=et-r.left-r.right,pt=xt-r.top-r.bottom;let R,g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft;if(t[8]!==o||t[9]!==$||t[10]!==k||t[11]!==z||t[12]!==s?.graphObjectValues||t[13]!==s?.xAxis?.axis||t[14]!==s?.xAxis?.labels||t[15]!==s?.yAxis?.gridLines||t[16]!==s?.yAxis?.labels||t[17]!==s?.yAxis?.title||t[18]!==u||t[19]!==h||t[20]!==d||t[21]!==F||t[22]!==pt||t[23]!==nt||t[24]!==xt||t[25]!==G||t[26]!==H||t[27]!==A||t[28]!==r.bottom||t[29]!==r.left||t[30]!==r.right||t[31]!==r.top||t[32]!==Q||t[33]!==Tt||t[34]!==j||t[35]!==p||t[36]!==m||t[37]!==T||t[38]!==st||t[39]!==mt||t[40]!==x||t[41]!==y||t[42]!==dt||t[43]!==U||t[44]!==Y||t[45]!==Nt||t[46]!==Vt||t[47]!==ct||t[48]!==a?.graphObjectValues||t[49]!==a?.xAxis?.axis||t[50]!==a?.xAxis?.labels||t[51]!==a?.yAxis?.gridLines||t[52]!==a?.yAxis?.labels||t[53]!==a?.yAxis?.title||t[54]!==I||t[55]!==B||t[56]!==W||t[57]!==et){const b=Re.linear().domain([j,Tt]).range([pt,0]).nice();let rt;t[72]!==H?(rt=(N,Rt)=>({...N,id:H?`${N.label}`:`${Rt}`}),t[72]=H,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=H||St.map(ri),E=fe.band().domain(Gt).range([0,Q?Math.min(nt,Q*Gt.length):nt]).paddingInner(z),Ut=fe.band().domain(d[0].size.map(ai)).range([0,E.bandwidth()]).paddingInner(.1),It=b.ticks(T);g=Zt.motion.svg,ht=`${et}px`,kt=`${xt}px`,ot=`0 0 ${et} ${xt}`,Ct="ltr",X=Ft,ft=`translate(${r.left},${r.top})`;const Kt=b(j<0?0:j),Lt=b(j<0?0:j),Qt=j<0?0:j;let Wt;t[74]!==m||t[75]!==x||t[76]!==y||t[77]!==I||t[78]!==Qt?(Wt=ue.numberFormattingFunction(Qt,m,x,y,I),t[74]=m,t[75]=x,t[76]=y,t[77]=I,t[78]=Qt,t[79]=Wt):Wt=t[79];const Pt=s?.xAxis?.axis,Ot=s?.yAxis?.labels;let Yt;t[80]!==Pt||t[81]!==Ot?(Yt={axis:Pt,label:Ot},t[80]=Pt,t[81]=Ot,t[82]=Yt):Yt=t[82];const Jt=a?.xAxis?.axis,V=a?.yAxis?.labels;let v;t[83]!==Jt||t[84]!==V?(v={axis:Jt,label:V},t[83]=Jt,t[84]=V,t[85]=v):v=t[85],_=i.jsxRuntimeExports.jsx(Ee.Axis,{y1:Kt,y2:Lt,x1:0-A,x2:nt+r.right,label:Wt,labelPos:{x:0-A,dx:0,dy:Tt<0?"1em":-5,y:b(j<0?0:j)},classNames:Yt,styles:v}),tt=Vt?i.jsxRuntimeExports.jsx(De.YTicksAndGridLines,{values:It.filter(li),y:It.filter(oi).map(N=>b(N)),x1:0-A,x2:nt+r.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},suffix:I,prefix:y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:x}):null;const O=0-A-15,n=pt/2,f=a?.yAxis?.title,ee=s?.yAxis?.title;t[86]!==$||t[87]!==O||t[88]!==n||t[89]!==f||t[90]!==ee?(K=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:O,y:n,style:f,className:ee,text:$,rotate90:!0}),t[86]=$,t[87]=O,t[88]=n,t[89]=f,t[90]=ee,t[91]=K):K=t[91],t[92]!==h?(M=h.filter(ni).map(si),t[92]=h,t[93]=M):M=t[93],R=Me.AnimatePresence,lt=St.map(N=>_t.checkIfNullOrUndefined(E(N.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{variants:{initial:{x:E(`${N.id}`),y:0},whileInView:{x:E(`${N.id}`),y:0,transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:[N.size.map((Rt,l)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",opacity:Y?k[l]===Y?1:.3:.85,onMouseEnter:ie=>{D({...N,sizeIndex:l}),vt(ie.clientY),w(ie.clientX),mt?.({...N,sizeIndex:l})},onMouseMove:ie=>{D({...N,sizeIndex:l}),vt(ie.clientY),w(ie.clientX)},onMouseLeave:()=>{D(void 0),w(void 0),vt(void 0),mt?.(void 0)},onClick:()=>{(st||F)&&(je.isEqual(p,{...N,sizeIndex:l})&&U?(C(void 0),st?.(void 0)):(C({...N,sizeIndex:l}),st&&st({...N,sizeIndex:l})))},children:[i.jsxRuntimeExports.jsx(Zt.motion.rect,{x:Ut(`${l}`),width:Ut.bandwidth(),variants:{initial:{height:0,y:b(0),fill:k[l]},whileInView:{height:_t.checkIfNullOrUndefined(Rt)?0:Math.abs(b(Rt)-b(0)),y:_t.checkIfNullOrUndefined(Rt)?b(0):Rt>0?b(Rt):b(0),fill:k[l],transition:{duration:o.duration}}},exit:{height:0,y:b(0),transition:{duration:o.duration}},initial:"initial",animate:G?"whileInView":"initial"}),ct?i.jsxRuntimeExports.jsx(Zt.motion.text,{x:Ut(`${l}`)+Ut.bandwidth()/2,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:i.mo("graph-value text-sm",s?.graphObjectValues),dy:Rt?Rt>=0?"-5px":"1em":"-5px",variants:{initial:{y:b(0),opacity:0,fill:W||k[l]},whileInView:{y:b(Rt||0),opacity:1,fill:W||k[l],transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:ue.numberFormattingFunction(Rt,m,x,y,I)}):null]},`${N.label}-${u[l]||l}`)),Nt?i.jsxRuntimeExports.jsx(ze.XAxesLabels,{value:`${N.label}`.length<B?`${N.label}`:`${`${N.label}`.substring(0,B)}...`,y:b(0)+5,x:0,width:E.bandwidth(),height:r.bottom,style:a?.xAxis?.labels,className:s?.xAxis?.labels,alignment:"top",animate:o,isInView:G}):null]},N.label)),P=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((N,Rt)=>i.jsxRuntimeExports.jsx(ke.RefLineY,{text:N.text,color:N.color,y:b(N.value),x1:0-A,x2:nt+r.right,classNames:N.classNames,styles:N.styles,animate:o,isInView:G},Rt))}):null,t[8]=o,t[9]=$,t[10]=k,t[11]=z,t[12]=s?.graphObjectValues,t[13]=s?.xAxis?.axis,t[14]=s?.xAxis?.labels,t[15]=s?.yAxis?.gridLines,t[16]=s?.yAxis?.labels,t[17]=s?.yAxis?.title,t[18]=u,t[19]=h,t[20]=d,t[21]=F,t[22]=pt,t[23]=nt,t[24]=xt,t[25]=G,t[26]=H,t[27]=A,t[28]=r.bottom,t[29]=r.left,t[30]=r.right,t[31]=r.top,t[32]=Q,t[33]=Tt,t[34]=j,t[35]=p,t[36]=m,t[37]=T,t[38]=st,t[39]=mt,t[40]=x,t[41]=y,t[42]=dt,t[43]=U,t[44]=Y,t[45]=Nt,t[46]=Vt,t[47]=ct,t[48]=a?.graphObjectValues,t[49]=a?.xAxis?.axis,t[50]=a?.xAxis?.labels,t[51]=a?.yAxis?.gridLines,t[52]=a?.yAxis?.labels,t[53]=a?.yAxis?.title,t[54]=I,t[55]=B,t[56]=W,t[57]=et,t[58]=R,t[59]=g,t[60]=_,t[61]=tt,t[62]=K,t[63]=M,t[64]=ht,t[65]=kt,t[66]=ot,t[67]=Ct,t[68]=X,t[69]=lt,t[70]=P,t[71]=ft}else R=t[58],g=t[59],_=t[60],tt=t[61],K=t[62],M=t[63],ht=t[64],kt=t[65],ot=t[66],Ct=t[67],X=t[68],lt=t[69],P=t[70],ft=t[71];let gt;t[94]!==R||t[95]!==lt||t[96]!==P?(gt=i.jsxRuntimeExports.jsxs(R,{children:[lt,P]}),t[94]=R,t[95]=lt,t[96]=P,t[97]=gt):gt=t[97];let jt;t[98]!==h?(jt=h.filter(ii).map(ei),t[98]=h,t[99]=jt):jt=t[99];let wt;t[100]!==_||t[101]!==tt||t[102]!==K||t[103]!==M||t[104]!==gt||t[105]!==jt||t[106]!==ft?(wt=i.jsxRuntimeExports.jsxs("g",{transform:ft,children:[_,tt,K,M,gt,jt]}),t[100]=_,t[101]=tt,t[102]=K,t[103]=M,t[104]=gt,t[105]=jt,t[106]=ft,t[107]=wt):wt=t[107];let at;t[108]!==g||t[109]!==ht||t[110]!==kt||t[111]!==ot||t[112]!==Ct||t[113]!==X||t[114]!==wt?(at=i.jsxRuntimeExports.jsx(g,{width:ht,height:kt,viewBox:ot,direction:Ct,ref:X,children:wt}),t[108]=g,t[109]=ht,t[110]=kt,t[111]=ot,t[112]=Ct,t[113]=X,t[114]=wt,t[115]=at):at=t[115];let At;t[116]!==s?.tooltip||t[117]!==S||t[118]!==Mt||t[119]!==c||t[120]!==a?.tooltip||t[121]!==it?(At=c&&it&&S&&Mt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:c,body:it,xPos:S,yPos:Mt,backgroundStyle:a?.tooltip,className:s?.tooltip}):null,t[116]=s?.tooltip,t[117]=S,t[118]=Mt,t[119]=c,t[120]=a?.tooltip,t[121]=it,t[122]=At):At=t[122];let $t;t[123]!==F||t[124]!==p?($t=F&&p!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:p!==void 0,onClose:()=>{C(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof F=="string"?{__html:$e.string2HTML(F,p)}:void 0,children:typeof F=="function"?F(p):null})}):null,t[123]=F,t[124]=p,t[125]=$t):$t=t[125];let Et;return t[126]!==at||t[127]!==At||t[128]!==$t?(Et=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[at,At,$t]}),t[126]=at,t[127]=At,t[128]=$t,t[129]=Et):Et=t[129],Et}function ei(e){return e.layer}function ii(e){return e.position==="after"}function si(e){return e.layer}function ni(e){return e.position==="before"}function oi(e){return e!==0}function li(e){return e!==0}function ai(e,t){return`${t}`}function ri(e){return`${e.id}`}function ci(e){const t=i.compilerRuntimeExports.c(43),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,suffix:Vt,prefix:B,showValues:it,showColorScale:mt,padding:dt,backgroundColor:Tt,leftMargin:j,rightMargin:st,topMargin:Y,bottomMargin:H,showLabels:Q,relativeHeight:U,tooltip:F,onSeriesMouseOver:$,refValues:W,graphID:T,maxValue:a,minValue:s,onSeriesMouseClick:o,graphDownload:u,dataDownload:x,language:h,labelOrder:m,minHeight:A,theme:Z,maxBarThickness:J,ariaLabel:ut,resetSelectionOnDoubleClick:Ft,detailsOnClick:Ht,barAxisTitle:G,noOfTicks:bt,valueColor:zt,styles:r,classNames:c,filterNA:D,animate:p,precision:C,customLayers:S,timeline:w,naLabel:Mt,sortParameter:vt,sortData:nt,orientation:pt}=e,R=qt===void 0?ce.Colors.light.categoricalColors.colors:qt,g=et===void 0?.25:et,_=xt===void 0?!0:xt,tt=k===void 0?999:k,K=Vt===void 0?"":Vt,M=B===void 0?"":B,ht=it===void 0?!0:it,kt=mt===void 0?!0:mt,ot=Tt===void 0?!1:Tt,Ct=Q===void 0?!0:Q,X=u===void 0?!1:u,lt=x===void 0?!1:x,P=h===void 0?"en":h,ft=A===void 0?0:A,gt=Z===void 0?"light":Z,jt=Ft===void 0?!0:Ft,wt=bt===void 0?5:bt,at=D===void 0?!0:D,At=p===void 0?!1:p,$t=C===void 0?2:C;let Et;t[0]!==S?(Et=S===void 0?[]:S,t[0]=S,t[1]=Et):Et=t[1];const b=Et,rt=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,St=Mt===void 0?"NA":Mt,E=(pt===void 0?"vertical":pt)==="horizontal"?Xe:ti,[Ut,It]=q.useState(0),[Kt,Lt]=q.useState(0),[Qt,Wt]=q.useState(rt.autoplay),Pt=He.sort(Le.uniqBy(d,"date",!0).map(Xt=>me.parse(`${Xt}`,rt.dateFormat||"yyyy",new Date).getTime()),Ci),[Ot,Yt]=q.useState(rt.autoplay?0:Pt.length-1),[Jt,V]=q.useState(void 0),v=q.useRef(null),O=q.useRef(null);let n,f;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{const Xt=new ResizeObserver(Bt=>{It(Bt[0].target.clientWidth||620),Lt(Bt[0].target.clientHeight||480)});return v.current&&Xt.observe(v.current),()=>Xt.disconnect()},f=[],t[2]=n,t[3]=f):(n=t[2],f=t[3]),q.useEffect(n,f),q.useEffect(()=>{const Xt=setInterval(()=>{Yt(Bt=>Bt<Pt.length-1?Bt+1:0)},(rt.speed||2)*1e3);return Qt||clearInterval(Xt),()=>clearInterval(Xt)},[Pt,Qt,rt.speed]);const ee=ye.getSliderMarks(Pt,Ot,rt.showOnlyActiveDate,rt.dateFormat||"yyyy"),N=ve.GraphContainer,Rt=c?.graphContainer,l=r?.graphContainer;let ie;t[4]!==c?.description||t[5]!==c?.title||t[6]!==d||t[7]!==lt||t[8]!==yt||t[9]!==X||t[10]!==L||t[11]!==r?.description||t[12]!==r?.title||t[13]!==y?(ie=L||yt||X||lt?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:r?.title,description:r?.description},classNames:{title:c?.title,description:c?.description},graphTitle:L,graphDescription:yt,width:y,graphDownload:X?O:void 0,dataDownload:lt?d.map(ki).filter(Oi).length>0?d.map(Ei).filter($i):d.filter(Ai):null}):null,t[4]=c?.description,t[5]=c?.title,t[6]=d,t[7]=lt,t[8]=yt,t[9]=X,t[10]=L,t[11]=r?.description,t[12]=r?.title,t[13]=y,t[14]=ie):ie=t[14];const se=rt.enabled&&Pt.length>0&&ee?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Wt(!Qt)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Qt?"Click to pause animation":"Click to play animation",children:Qt?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ye.Nr,{min:Pt[0],max:Pt[Pt.length-1],marks:ee,step:null,defaultValue:Pt[Pt.length-1],value:Pt[Ot],onChangeComplete:Xt=>{Yt(Pt.indexOf(Xt))},onChange:Xt=>{Yt(Pt.indexOf(Xt))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,xe="grow flex flex-col justify-center gap-3 w-full",pe=d.length===0?i.jsxRuntimeExports.jsx(qe.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[kt?i.jsxRuntimeExports.jsx(Pe.ColorLegendWithMouseOver,{width:y,colorDomain:Nt,colors:R,colorLegendTitle:ct,setSelectedColor:V,showNAColor:!1,className:c?.colorLegend}):null,i.jsxRuntimeExports.jsx(ve.GraphArea,{ref:v,children:Ut&&Kt?i.jsxRuntimeExports.jsx(E,{data:vt!==void 0?vt==="total"?Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,rt.dateFormat||"yyyy").filter(Xt=>rt.enabled?Xt.date===me.format(new Date(Pt[Ot]),rt.dateFormat||"yyyy"):Xt).filter(Xt=>at?!Xt.size.every(wi):Xt),vi,[nt||"asc"]):Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,rt.dateFormat||"yyyy").filter(Xt=>rt.enabled?Xt.date===me.format(new Date(Pt[Ot]),rt.dateFormat||"yyyy"):Xt).filter(Xt=>at?!Xt.size.every(bi):Xt),Xt=>_t.checkIfNullOrUndefined(Xt.size[vt])?-1/0:Xt.size[vt],[nt||"asc"]):he.ensureCompleteDataForStackedBarChart(d,rt.dateFormat||"yyyy").filter(Xt=>at?!Xt.size.every(yi):Xt),barColors:R,width:Ut,height:Kt,suffix:K,prefix:M,showValues:ht,barPadding:g,showTicks:_,leftMargin:j,rightMargin:st,topMargin:Y,bottomMargin:H,truncateBy:tt,showLabels:Ct,tooltip:F,onSeriesMouseOver:$,refValues:W,maxValue:_t.checkIfNullOrUndefined(a)?Math.max(...d.map(fi))<0?0:Math.max(...d.map(pi)):a,minValue:_t.checkIfNullOrUndefined(s)?Math.min(...d.map(mi))>=0?0:Math.min(...d.map(ui)):s,onSeriesMouseClick:o,selectedColor:Jt,labelOrder:m,rtl:P==="he"||P==="ar",maxBarThickness:J,resetSelectionOnDoubleClick:jt,detailsOnClick:Ht,barAxisTitle:G,noOfTicks:wt,valueColor:zt,styles:r,classNames:c,colorDomain:Nt,animate:At===!0?{duration:.5,once:!0,amount:.5}:At||{duration:0,once:!0,amount:0},precision:$t,customLayers:b,naLabel:St}):null})]});let re;t[15]!==pe?(re=i.jsxRuntimeExports.jsx("div",{className:xe,children:pe}),t[15]=pe,t[16]=re):re=t[16];let ne;t[17]!==c?.footnote||t[18]!==c?.source||t[19]!==z||t[20]!==Dt||t[21]!==r?.footnote||t[22]!==r?.source||t[23]!==y?(ne=Dt||z?i.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:r?.footnote,source:r?.source},classNames:{footnote:c?.footnote,source:c?.source},sources:Dt,footNote:z,width:y}):null,t[17]=c?.footnote,t[18]=c?.source,t[19]=z,t[20]=Dt,t[21]=r?.footnote,t[22]=r?.source,t[23]=y,t[24]=ne):ne=t[24];let le;return t[25]!==N||t[26]!==ut||t[27]!==ot||t[28]!==T||t[29]!==I||t[30]!==P||t[31]!==ft||t[32]!==dt||t[33]!==U||t[34]!==Rt||t[35]!==l||t[36]!==ie||t[37]!==se||t[38]!==re||t[39]!==ne||t[40]!==gt||t[41]!==y?(le=i.jsxRuntimeExports.jsxs(N,{className:Rt,style:l,id:T,ref:O,"aria-label":ut,backgroundColor:ot,theme:gt,language:P,minHeight:ft,width:y,height:I,relativeHeight:U,padding:dt,children:[ie,se,re,ne]}),t[25]=N,t[26]=ut,t[27]=ot,t[28]=T,t[29]=I,t[30]=P,t[31]=ft,t[32]=dt,t[33]=U,t[34]=Rt,t[35]=l,t[36]=ie,t[37]=se,t[38]=re,t[39]=ne,t[40]=gt,t[41]=y,t[42]=le):le=t[42],le}function ui(e){return Math.min(...e.size.filter(xi))}function xi(e){return!_t.checkIfNullOrUndefined(e)}function mi(e){return Math.min(...e.size.filter(di))}function di(e){return!_t.checkIfNullOrUndefined(e)}function pi(e){return Math.max(...e.size.filter(hi))}function hi(e){return!_t.checkIfNullOrUndefined(e)}function fi(e){return Math.max(...e.size.filter(gi))}function gi(e){return!_t.checkIfNullOrUndefined(e)}function yi(e){return e==null}function bi(e){return e==null}function vi(e){return oe.sum(e.size.filter(ji))}function ji(e){return!_t.checkIfNullOrUndefined(e)}function wi(e){return e==null}function Ai(e){return e!==void 0}function $i(e){return e!==void 0}function Ei(e){return e.data}function Oi(e){return e!==void 0}function ki(e){return e.data}function Ci(e,t){return Ge.ascending(e,t)}function Ri(e){const t=i.compilerRuntimeExports.c(125),{data:d,barColor:L,suffix:qt,prefix:Dt,barPadding:yt,showValues:et,showTicks:xt,truncateBy:k,width:I,height:y,colorDomain:z,topMargin:Nt,bottomMargin:ct,leftMargin:Vt,rightMargin:B,showLabels:it,tooltip:mt,onSeriesMouseOver:dt,refValues:Tt,selectedColor:j,highlightedDataPoints:st,maxValue:Y,minValue:H,onSeriesMouseClick:Q,labelOrder:U,rtl:F,maxBarThickness:$,minBarThickness:W,resetSelectionOnDoubleClick:T,detailsOnClick:a,barAxisTitle:s,valueColor:o,noOfTicks:u,styles:x,classNames:h,animate:m,dimmedOpacity:A,precision:Z,customLayers:J,naLabel:ut}=e,Ft=Nt===void 0?25:Nt,Ht=ct===void 0?10:ct,G=Vt===void 0?100:Vt,bt=B===void 0?40:B,zt=q.useRef(null);let r;t[0]!==m.amount||t[1]!==m.once?(r={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=r):r=t[2];const c=Ce.useInView(zt,r),[D,p]=q.useState(void 0),[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),pt=s?Ft+25:Ft;let R;t[3]!==Ht||t[4]!==G||t[5]!==bt||t[6]!==pt?(R={top:pt,bottom:Ht,left:G,right:bt},t[3]=Ht,t[4]=G,t[5]=bt,t[6]=pt,t[7]=R):R=t[7];const g=R,_=I-g.left-g.right,tt=y-g.top-g.bottom;let K,M,ht,kt,ot,Ct,X,lt,P,ft,gt,jt,wt,at;if(t[8]!==m||t[9]!==s||t[10]!==L||t[11]!==yt||t[12]!==h?.graphObjectValues||t[13]!==h?.xAxis?.gridLines||t[14]!==h?.xAxis?.labels||t[15]!==h?.xAxis?.title||t[16]!==h?.yAxis?.axis||t[17]!==h?.yAxis?.labels||t[18]!==z||t[19]!==J||t[20]!==d||t[21]!==a||t[22]!==A||t[23]!==tt||t[24]!==_||t[25]!==y||t[26]!==st||t[27]!==c||t[28]!==U||t[29]!==g.bottom||t[30]!==g.left||t[31]!==g.top||t[32]!==$||t[33]!==Y||t[34]!==W||t[35]!==H||t[36]!==C||t[37]!==ut||t[38]!==u||t[39]!==Q||t[40]!==dt||t[41]!==Z||t[42]!==Dt||t[43]!==Tt||t[44]!==T||t[45]!==F||t[46]!==j||t[47]!==it||t[48]!==xt||t[49]!==et||t[50]!==x?.graphObjectValues||t[51]!==x?.xAxis?.gridLines||t[52]!==x?.xAxis?.labels||t[53]!==x?.xAxis?.title||t[54]!==x?.yAxis?.axis||t[55]!==x?.yAxis?.labels||t[56]!==qt||t[57]!==Ft||t[58]!==k||t[59]!==o||t[60]!==I){let E;t[75]!==U?(E=(n,f)=>({...n,id:U?`${n.label}`:`${f}`}),t[75]=U,t[76]=E):E=t[76];const Ut=d.map(E),It=Re.linear().domain([H,Y]).range([0,_]).nice(),Kt=U||Ut.map(Fi),Lt=fe.band().domain(Kt).range([0,W?Math.max(tt,W*Kt.length):$?Math.min(tt,$*Kt.length):tt]).paddingInner(yt),Qt=It.ticks(u);M=Zt.motion.svg,X=zt,lt=`${I}px`,P=`${y}px`,ft=`0 0 ${I} ${y}`,gt="ltr",ht=`translate(${g.left},${g.top})`,kt=xt?i.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:Qt.filter(Bi),x:Qt.filter(zi).map(n=>It(n)),y1:0-Ft,y2:tt+g.bottom,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},suffix:qt,prefix:Dt,labelType:"secondary",showGridLines:!0,precision:Z}):null;const Wt=_/2,Pt=0-g.top+15,Ot=x?.xAxis?.title,Yt=h?.xAxis?.title;t[77]!==s||t[78]!==Wt||t[79]!==Pt||t[80]!==Ot||t[81]!==Yt?(ot=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:Wt,y:Pt,style:Ot,className:Yt,text:s}),t[77]=s,t[78]=Wt,t[79]=Pt,t[80]=Ot,t[81]=Yt,t[82]=ot):ot=t[82],t[83]!==J?(Ct=J.filter(Di).map(Si),t[83]=J,t[84]=Ct):Ct=t[84],K=Me.AnimatePresence,jt=Ut.map(n=>_t.checkIfNullOrUndefined(Lt(n.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:j?n.color&&L[z.indexOf(n.color)]===j?1:A:st.length!==0?st.indexOf(n.label)!==-1?.85:A:.85},whileInView:{opacity:j?n.color&&L[z.indexOf(n.color)]===j?1:A:st.length!==0?st.indexOf(n.label)!==-1?.85:A:.85,transition:{duration:m.duration}}},initial:"initial",animate:c?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:f=>{p(n),nt(f.clientY),Mt(f.clientX),dt?.(n)},onClick:()=>{(Q||a)&&(je.isEqual(C,n)&&T?(S(void 0),Q?.(void 0)):(S(n),Q?.(n)))},onMouseMove:f=>{p(n),nt(f.clientY),Mt(f.clientX)},onMouseLeave:()=>{p(void 0),Mt(void 0),nt(void 0),dt?.(void 0)},children:[n.size?i.jsxRuntimeExports.jsx(Zt.motion.rect,{variants:{initial:{width:0,x:It(0),y:Lt(`${n.id}`),fill:d.filter(Ti).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray},whileInView:{width:n.size>=0?It(n.size)-It(0):It(0)-It(n.size),x:n.size>=0?It(0):It(n.size),y:Lt(`${n.id}`),fill:d.filter(Ii).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:c?"whileInView":"initial",exit:{width:0,x:It(0),transition:{duration:m.duration}},height:Lt.bandwidth()}):null,it?i.jsxRuntimeExports.jsx(Te.YAxesLabels,{value:`${n.label}`.length<k?`${n.label}`:`${`${n.label}`.substring(0,k)}...`,y:Lt(n.id)||0,x:(n.size||0)<0?It(0):0-g.left,width:(n.size||0)<0?I-It(0):It(0)+g.left,height:Lt.bandwidth(),alignment:n.size&&n.size<0?"left":"right",style:x?.yAxis?.labels,className:h?.yAxis?.labels,animate:m,isInView:c}):null,et?i.jsxRuntimeExports.jsx(Zt.motion.text,{style:{textAnchor:n.size&&n.size<0?"end":"start",...x?.graphObjectValues||{}},className:i.mo("graph-value text-sm",!o&&L.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",h?.graphObjectValues),dx:n.size&&n.size<0?-5:5,dy:"0.33em",variants:{initial:{x:It(0),y:Lt(`${n.id}`)+Lt.bandwidth()/2,opacity:0,fill:o||(d.filter(Vi).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray)},whileInView:{x:n.size?It(n.size):It(0),opacity:1,y:Lt(`${n.id}`)+Lt.bandwidth()/2,fill:o||(d.filter(Ni).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray),transition:{duration:m.duration}}},initial:"initial",animate:c?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:ue.numberFormattingFunction(n.size,ut,Z,Dt,qt)}):null]},n.label));const Jt=h?.yAxis?.axis;let V;t[85]!==Jt?(V={axis:Jt},t[85]=Jt,t[86]=V):V=t[86];const v=x?.yAxis?.axis;let O;t[87]!==v?(O={axis:v},t[87]=v,t[88]=O):O=t[88],wt=i.jsxRuntimeExports.jsx(Ee.Axis,{x1:It(H<0?0:H),x2:It(H<0?0:H),y1:-2.5,y2:tt+g.bottom,classNames:V,styles:O}),at=Tt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Tt.map((n,f)=>i.jsxRuntimeExports.jsx(ke.RefLineX,{text:n.text,color:n.color,x:It(n.value),y1:0-g.top,y2:tt+g.bottom,textSide:It(n.value)>_*.75||F?"left":"right",classNames:n.classNames,styles:n.styles,animate:m,isInView:c},f))}):null,t[8]=m,t[9]=s,t[10]=L,t[11]=yt,t[12]=h?.graphObjectValues,t[13]=h?.xAxis?.gridLines,t[14]=h?.xAxis?.labels,t[15]=h?.xAxis?.title,t[16]=h?.yAxis?.axis,t[17]=h?.yAxis?.labels,t[18]=z,t[19]=J,t[20]=d,t[21]=a,t[22]=A,t[23]=tt,t[24]=_,t[25]=y,t[26]=st,t[27]=c,t[28]=U,t[29]=g.bottom,t[30]=g.left,t[31]=g.top,t[32]=$,t[33]=Y,t[34]=W,t[35]=H,t[36]=C,t[37]=ut,t[38]=u,t[39]=Q,t[40]=dt,t[41]=Z,t[42]=Dt,t[43]=Tt,t[44]=T,t[45]=F,t[46]=j,t[47]=it,t[48]=xt,t[49]=et,t[50]=x?.graphObjectValues,t[51]=x?.xAxis?.gridLines,t[52]=x?.xAxis?.labels,t[53]=x?.xAxis?.title,t[54]=x?.yAxis?.axis,t[55]=x?.yAxis?.labels,t[56]=qt,t[57]=Ft,t[58]=k,t[59]=o,t[60]=I,t[61]=K,t[62]=M,t[63]=ht,t[64]=kt,t[65]=ot,t[66]=Ct,t[67]=X,t[68]=lt,t[69]=P,t[70]=ft,t[71]=gt,t[72]=jt,t[73]=wt,t[74]=at}else K=t[61],M=t[62],ht=t[63],kt=t[64],ot=t[65],Ct=t[66],X=t[67],lt=t[68],P=t[69],ft=t[70],gt=t[71],jt=t[72],wt=t[73],at=t[74];let At;t[89]!==K||t[90]!==jt||t[91]!==wt||t[92]!==at?(At=i.jsxRuntimeExports.jsxs(K,{children:[jt,wt,at]}),t[89]=K,t[90]=jt,t[91]=wt,t[92]=at,t[93]=At):At=t[93];let $t;t[94]!==J?($t=J.filter(Li).map(Mi),t[94]=J,t[95]=$t):$t=t[95];let Et;t[96]!==ht||t[97]!==kt||t[98]!==ot||t[99]!==Ct||t[100]!==At||t[101]!==$t?(Et=i.jsxRuntimeExports.jsxs("g",{transform:ht,children:[kt,ot,Ct,At,$t]}),t[96]=ht,t[97]=kt,t[98]=ot,t[99]=Ct,t[100]=At,t[101]=$t,t[102]=Et):Et=t[102];let b;t[103]!==M||t[104]!==X||t[105]!==lt||t[106]!==P||t[107]!==ft||t[108]!==gt||t[109]!==Et?(b=i.jsxRuntimeExports.jsx(M,{ref:X,width:lt,height:P,viewBox:ft,direction:gt,children:Et}),t[103]=M,t[104]=X,t[105]=lt,t[106]=P,t[107]=ft,t[108]=gt,t[109]=Et,t[110]=b):b=t[110];let rt;t[111]!==h?.tooltip||t[112]!==w||t[113]!==vt||t[114]!==D||t[115]!==x?.tooltip||t[116]!==mt?(rt=D&&mt&&w&&vt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:D,body:mt,xPos:w,yPos:vt,backgroundStyle:x?.tooltip,className:h?.tooltip}):null,t[111]=h?.tooltip,t[112]=w,t[113]=vt,t[114]=D,t[115]=x?.tooltip,t[116]=mt,t[117]=rt):rt=t[117];let St;t[118]!==a||t[119]!==C?(St=a&&C!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:C!==void 0,onClose:()=>{S(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof a=="string"?{__html:$e.string2HTML(a,C)}:void 0,children:typeof a=="function"?a(C):null})}):null,t[118]=a,t[119]=C,t[120]=St):St=t[120];let Gt;return t[121]!==b||t[122]!==rt||t[123]!==St?(Gt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[b,rt,St]}),t[121]=b,t[122]=rt,t[123]=St,t[124]=Gt):Gt=t[124],Gt}function Mi(e){return e.layer}function Li(e){return e.position==="after"}function Ni(e){return e.color}function Vi(e){return e.color}function Ii(e){return e.color}function Ti(e){return e.color}function Si(e){return e.layer}function Di(e){return e.position==="before"}function zi(e){return e!==0}function Bi(e){return e!==0}function Fi(e){return`${e.id}`}function Pi(e){const t=i.compilerRuntimeExports.c(133),{leftMargin:d,rightMargin:L,topMargin:qt,bottomMargin:Dt,data:yt,width:et,height:xt,barColor:k,suffix:I,prefix:y,barPadding:z,showLabels:Nt,showValues:ct,showTicks:Vt,colorDomain:B,truncateBy:it,tooltip:mt,onSeriesMouseOver:dt,refValues:Tt,selectedColor:j,maxValue:st,minValue:Y,highlightedDataPoints:H,onSeriesMouseClick:Q,labelOrder:U,maxBarThickness:F,minBarThickness:$,resetSelectionOnDoubleClick:W,detailsOnClick:T,barAxisTitle:a,valueColor:s,noOfTicks:o,styles:u,classNames:x,dimmedOpacity:h,animate:m,precision:A,customLayers:Z,naLabel:J}=e,ut=d===void 0?20:d,Ft=L===void 0?20:L,Ht=qt===void 0?20:qt,G=Dt===void 0?25:Dt,bt=q.useRef(null);let zt;t[0]!==m.amount||t[1]!==m.once?(zt={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=zt):zt=t[2];const r=Ce.useInView(bt,zt),c=a?ut+30:ut;let D;t[3]!==G||t[4]!==Ft||t[5]!==c||t[6]!==Ht?(D={top:Ht,bottom:G,left:c,right:Ft},t[3]=G,t[4]=Ft,t[5]=c,t[6]=Ht,t[7]=D):D=t[7];const p=D,[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),[pt,R]=q.useState(void 0),g=et-p.left-p.right,_=xt-p.top-p.bottom;let tt,K,M,ht,kt,ot,Ct,X,lt,P,ft,gt,jt,wt;if(t[8]!==m||t[9]!==a||t[10]!==k||t[11]!==z||t[12]!==x?.graphObjectValues||t[13]!==x?.xAxis?.axis||t[14]!==x?.xAxis?.labels||t[15]!==x?.yAxis?.gridLines||t[16]!==x?.yAxis?.labels||t[17]!==x?.yAxis?.title||t[18]!==B||t[19]!==Z||t[20]!==yt||t[21]!==T||t[22]!==h||t[23]!==_||t[24]!==g||t[25]!==xt||t[26]!==H||t[27]!==r||t[28]!==U||t[29]!==ut||t[30]!==p.bottom||t[31]!==p.left||t[32]!==p.right||t[33]!==p.top||t[34]!==F||t[35]!==st||t[36]!==$||t[37]!==Y||t[38]!==w||t[39]!==J||t[40]!==o||t[41]!==Q||t[42]!==dt||t[43]!==A||t[44]!==y||t[45]!==Tt||t[46]!==W||t[47]!==j||t[48]!==Nt||t[49]!==Vt||t[50]!==ct||t[51]!==u?.graphObjectValues||t[52]!==u?.xAxis?.axis||t[53]!==u?.xAxis?.labels||t[54]!==u?.yAxis?.gridLines||t[55]!==u?.yAxis?.labels||t[56]!==u?.yAxis?.title||t[57]!==I||t[58]!==it||t[59]!==s||t[60]!==et){const Gt=Re.linear().domain([Y,st]).range([_,0]).nice();let E;t[75]!==U?(E=(l,ie)=>({...l,id:U?`${l.label}`:`${ie}`}),t[75]=U,t[76]=E):E=t[76];const Ut=yt.map(E),It=U||Ut.map(Zi),Kt=fe.band().domain(It).range([0,$?Math.max(g,$*It.length):F?Math.min(g,F*It.length):g]).paddingInner(z),Lt=Gt.ticks(o);K=Zt.motion.svg,Ct=bt,X=`${et}px`,lt=`${xt}px`,P=`0 0 ${et} ${xt}`,ft="ltr",wt=`translate(${p.left},${p.top})`;const Qt=Gt(Y<0?0:Y),Wt=Gt(Y<0?0:Y),Pt=Y<0?0:Y;let Ot;t[77]!==J||t[78]!==A||t[79]!==y||t[80]!==I||t[81]!==Pt?(Ot=ue.numberFormattingFunction(Pt,J,A,y,I),t[77]=J,t[78]=A,t[79]=y,t[80]=I,t[81]=Pt,t[82]=Ot):Ot=t[82];const Yt=x?.xAxis?.axis,Jt=x?.yAxis?.labels;let V;t[83]!==Yt||t[84]!==Jt?(V={axis:Yt,label:Jt},t[83]=Yt,t[84]=Jt,t[85]=V):V=t[85];const v=u?.xAxis?.axis,O=u?.yAxis?.labels;let n;t[86]!==v||t[87]!==O?(n={axis:v,label:O},t[86]=v,t[87]=O,t[88]=n):n=t[88],M=i.jsxRuntimeExports.jsx(Ee.Axis,{y1:Qt,y2:Wt,x1:0-ut,x2:g+p.right,label:Ot,labelPos:{x:0-ut,dx:0,dy:st<0?"1em":-5,y:Gt(Y<0?0:Y)},classNames:V,styles:n}),ht=Vt?i.jsxRuntimeExports.jsx(De.YTicksAndGridLines,{values:Lt.filter(Qi),y:Lt.filter(Ki).map(l=>Gt(l)),x1:0-ut,x2:g+p.right,styles:{gridLines:u?.yAxis?.gridLines,labels:u?.yAxis?.labels},classNames:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},suffix:I,prefix:y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:A}):null;const f=0-ut-15,ee=_/2,N=u?.yAxis?.title,Rt=x?.yAxis?.title;t[89]!==a||t[90]!==f||t[91]!==ee||t[92]!==N||t[93]!==Rt?(kt=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:f,y:ee,style:N,className:Rt,text:a,rotate90:!0}),t[89]=a,t[90]=f,t[91]=ee,t[92]=N,t[93]=Rt,t[94]=kt):kt=t[94],t[95]!==Z?(ot=Z.filter(Ji).map(Wi),t[95]=Z,t[96]=ot):ot=t[96],tt=Me.AnimatePresence,gt=Ut.map((l,ie)=>_t.checkIfNullOrUndefined(Kt(l.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",initial:"initial",animate:r?"whileInView":"initial",variants:{initial:{opacity:j?l.color&&k[B.indexOf(l.color)]===j?1:h:H.length!==0?H.indexOf(l.label)!==-1?.85:h:.85},whileInView:{opacity:j?l.color&&k[B.indexOf(l.color)]===j?1:h:H.length!==0?H.indexOf(l.label)!==-1?.85:h:.85,transition:{duration:m.duration}}},exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:se=>{S(l),R(se.clientY),nt(se.clientX),dt?.(l)},onClick:()=>{(Q||T)&&(je.isEqual(w,l)&&W?(Mt(void 0),Q?.(void 0)):(Mt(l),Q?.(l)))},onMouseMove:se=>{S(l),R(se.clientY),nt(se.clientX)},onMouseLeave:()=>{S(void 0),nt(void 0),R(void 0),dt?.(void 0)},children:[l.size?i.jsxRuntimeExports.jsx(Zt.motion.rect,{width:Kt.bandwidth(),initial:"initial",animate:r?"whileInView":"initial",variants:{initial:{height:0,x:Kt(`${l.id}`),y:Gt(0),fill:yt.filter(Ui).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray},whileInView:{height:l.size?Math.abs(Gt(l.size)-Gt(0)):0,y:l.size&&l.size>0?Gt(l.size):Gt(0),x:Kt(`${l.id}`),fill:yt.filter(Yi).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray,transition:{duration:m.duration}}},exit:{height:0,y:Gt(0),transition:{duration:m.duration}}}):null,Nt?i.jsxRuntimeExports.jsx(ze.XAxesLabels,{value:`${l.label}`.length<it?`${l.label}`:`${`${l.label}`.substring(0,it)}...`,y:(l.size||0)<0?0:Gt(0)+5,x:Kt(`${l.id}`),width:Kt.bandwidth(),height:(l.size||0)<0?Gt(0)-5:p.bottom,style:u?.xAxis?.labels,className:x?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:m,isInView:r}):null,ct?i.jsxRuntimeExports.jsx(Zt.motion.text,{style:{textAnchor:"middle",...u?.graphObjectValues||{}},className:i.mo("graph-value text-sm",!s&&k.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",x?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",variants:{initial:{x:Kt(`${l.id}`)+Kt.bandwidth()/2,y:Gt(0),opacity:0,fill:s||(yt.filter(Xi).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray)},whileInView:{x:Kt(`${l.id}`)+Kt.bandwidth()/2,y:Gt(l.size||0),fill:s||(yt.filter(Gi).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray),opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:r?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:ue.numberFormattingFunction(l.size,J,A,y,I)}):null]},l.label)),jt=Tt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Tt.map((l,ie)=>i.jsxRuntimeExports.jsx(ke.RefLineY,{text:l.text,color:l.color,y:Gt(l.value),x1:0-ut,x2:g+p.right,classNames:l.classNames,styles:l.styles,animate:m,isInView:r},ie))}):null,t[8]=m,t[9]=a,t[10]=k,t[11]=z,t[12]=x?.graphObjectValues,t[13]=x?.xAxis?.axis,t[14]=x?.xAxis?.labels,t[15]=x?.yAxis?.gridLines,t[16]=x?.yAxis?.labels,t[17]=x?.yAxis?.title,t[18]=B,t[19]=Z,t[20]=yt,t[21]=T,t[22]=h,t[23]=_,t[24]=g,t[25]=xt,t[26]=H,t[27]=r,t[28]=U,t[29]=ut,t[30]=p.bottom,t[31]=p.left,t[32]=p.right,t[33]=p.top,t[34]=F,t[35]=st,t[36]=$,t[37]=Y,t[38]=w,t[39]=J,t[40]=o,t[41]=Q,t[42]=dt,t[43]=A,t[44]=y,t[45]=Tt,t[46]=W,t[47]=j,t[48]=Nt,t[49]=Vt,t[50]=ct,t[51]=u?.graphObjectValues,t[52]=u?.xAxis?.axis,t[53]=u?.xAxis?.labels,t[54]=u?.yAxis?.gridLines,t[55]=u?.yAxis?.labels,t[56]=u?.yAxis?.title,t[57]=I,t[58]=it,t[59]=s,t[60]=et,t[61]=tt,t[62]=K,t[63]=M,t[64]=ht,t[65]=kt,t[66]=ot,t[67]=Ct,t[68]=X,t[69]=lt,t[70]=P,t[71]=ft,t[72]=gt,t[73]=jt,t[74]=wt}else tt=t[61],K=t[62],M=t[63],ht=t[64],kt=t[65],ot=t[66],Ct=t[67],X=t[68],lt=t[69],P=t[70],ft=t[71],gt=t[72],jt=t[73],wt=t[74];let at;t[97]!==tt||t[98]!==gt||t[99]!==jt?(at=i.jsxRuntimeExports.jsxs(tt,{children:[gt,jt]}),t[97]=tt,t[98]=gt,t[99]=jt,t[100]=at):at=t[100];let At;t[101]!==Z?(At=Z.filter(Hi).map(qi),t[101]=Z,t[102]=At):At=t[102];let $t;t[103]!==M||t[104]!==ht||t[105]!==kt||t[106]!==ot||t[107]!==at||t[108]!==At||t[109]!==wt?($t=i.jsxRuntimeExports.jsxs("g",{transform:wt,children:[M,ht,kt,ot,at,At]}),t[103]=M,t[104]=ht,t[105]=kt,t[106]=ot,t[107]=at,t[108]=At,t[109]=wt,t[110]=$t):$t=t[110];let Et;t[111]!==K||t[112]!==Ct||t[113]!==X||t[114]!==lt||t[115]!==P||t[116]!==ft||t[117]!==$t?(Et=i.jsxRuntimeExports.jsx(K,{ref:Ct,width:X,height:lt,viewBox:P,direction:ft,children:$t}),t[111]=K,t[112]=Ct,t[113]=X,t[114]=lt,t[115]=P,t[116]=ft,t[117]=$t,t[118]=Et):Et=t[118];let b;t[119]!==x?.tooltip||t[120]!==vt||t[121]!==pt||t[122]!==C||t[123]!==u?.tooltip||t[124]!==mt?(b=C&&mt&&vt&&pt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:C,body:mt,xPos:vt,yPos:pt,backgroundStyle:u?.tooltip,className:x?.tooltip}):null,t[119]=x?.tooltip,t[120]=vt,t[121]=pt,t[122]=C,t[123]=u?.tooltip,t[124]=mt,t[125]=b):b=t[125];let rt;t[126]!==T||t[127]!==w?(rt=T&&w!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:w!==void 0,onClose:()=>{Mt(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof T=="string"?{__html:$e.string2HTML(T,w)}:void 0,children:typeof T=="function"?T(w):null})}):null,t[126]=T,t[127]=w,t[128]=rt):rt=t[128];let St;return t[129]!==Et||t[130]!==b||t[131]!==rt?(St=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[Et,b,rt]}),t[129]=Et,t[130]=b,t[131]=rt,t[132]=St):St=t[132],St}function qi(e){return e.layer}function Hi(e){return e.position==="after"}function Gi(e){return e.color}function Xi(e){return e.color}function Yi(e){return e.color}function Ui(e){return e.color}function Wi(e){return e.layer}function Ji(e){return e.position==="before"}function Ki(e){return e!==0}function Qi(e){return e!==0}function Zi(e){return`${e.id}`}function _i(e){const t=i.compilerRuntimeExports.c(43),{data:d,graphTitle:L,colors:qt,suffix:Dt,sources:yt,prefix:et,graphDescription:xt,barPadding:k,showValues:I,showTicks:y,truncateBy:z,height:Nt,width:ct,footNote:Vt,colorDomain:B,colorLegendTitle:it,highlightedDataPoints:mt,padding:dt,backgroundColor:Tt,topMargin:j,bottomMargin:st,leftMargin:Y,rightMargin:H,showLabels:Q,relativeHeight:U,tooltip:F,onSeriesMouseOver:$,refValues:W,showColorScale:T,graphID:a,maxValue:s,minValue:o,onSeriesMouseClick:u,graphDownload:x,dataDownload:h,sortData:m,labelOrder:A,language:Z,showNAColor:J,minHeight:ut,theme:Ft,maxBarThickness:Ht,maxNumberOfBars:G,minBarThickness:bt,ariaLabel:zt,resetSelectionOnDoubleClick:r,detailsOnClick:c,barAxisTitle:D,noOfTicks:p,valueColor:C,styles:S,classNames:w,filterNA:Mt,animate:vt,dimmedOpacity:nt,precision:pt,customLayers:R,timeline:g,naLabel:_,orientation:tt}=e,K=Dt===void 0?"":Dt,M=et===void 0?"":et,ht=k===void 0?.25:k,kt=I===void 0?!0:I,ot=y===void 0?!0:y,Ct=z===void 0?999:z;let X;t[0]!==mt?(X=mt===void 0?[]:mt,t[0]=mt,t[1]=X):X=t[1];const lt=X,P=Tt===void 0?!1:Tt,ft=Q===void 0?!0:Q,gt=T===void 0?!0:T,jt=x===void 0?!1:x,wt=h===void 0?!1:h,at=Z===void 0?"en":Z,At=J===void 0?!0:J,$t=ut===void 0?0:ut,Et=Ft===void 0?"light":Ft,b=r===void 0?!0:r,rt=p===void 0?5:p,St=Mt===void 0?!0:Mt,Gt=vt===void 0?!1:vt,E=nt===void 0?.3:nt,Ut=pt===void 0?2:pt;let It;t[2]!==R?(It=R===void 0?[]:R,t[2]=R,t[3]=It):It=t[3];const Kt=It,Lt=g===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:g,Qt=_===void 0?"NA":_,Wt=tt===void 0?"vertical":tt,Pt=Wt==="horizontal"?Ri:Pi,[Ot,Yt]=q.useState(0),[Jt,V]=q.useState(0),[v,O]=q.useState(Lt.autoplay),n=He.sort(Le.uniqBy(d,"date",!0).map(te=>me.parse(`${te}`,Lt.dateFormat||"yyyy",new Date).getTime()),fs),[f,ee]=q.useState(Lt.autoplay?0:n.length-1),[N,Rt]=q.useState(void 0),l=q.useRef(null),ie=q.useRef(null);let se,xe;t[4]===Symbol.for("react.memo_cache_sentinel")?(se=()=>{const te=new ResizeObserver(de=>{Yt(de[0].target.clientWidth||620),V(de[0].target.clientHeight||480)});return l.current&&te.observe(l.current),()=>te.disconnect()},xe=[],t[4]=se,t[5]=xe):(se=t[4],xe=t[5]),q.useEffect(se,xe),q.useEffect(()=>{const te=setInterval(()=>{ee(de=>de<n.length-1?de+1:0)},(Lt.speed||2)*1e3);return v||clearInterval(te),()=>clearInterval(te)},[n,v,Lt.speed]);const pe=ye.getSliderMarks(n,f,Lt.showOnlyActiveDate,Lt.dateFormat||"yyyy"),re=ve.GraphContainer,ne=w?.graphContainer,le=S?.graphContainer;let Xt;t[6]!==w?.description||t[7]!==w?.title||t[8]!==d||t[9]!==wt||t[10]!==xt||t[11]!==jt||t[12]!==L||t[13]!==S?.description||t[14]!==S?.title||t[15]!==ct?(Xt=L||xt||jt||wt?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:S?.title,description:S?.description},classNames:{title:w?.title,description:w?.description},graphTitle:L,graphDescription:xt,width:ct,graphDownload:jt?ie:void 0,dataDownload:wt?d.map(hs).filter(ps).length>0?d.map(ds).filter(ms):d.filter(xs):null}):null,t[6]=w?.description,t[7]=w?.title,t[8]=d,t[9]=wt,t[10]=xt,t[11]=jt,t[12]=L,t[13]=S?.description,t[14]=S?.title,t[15]=ct,t[16]=Xt):Xt=t[16];const Bt=Lt.enabled&&n.length>0&&pe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center pb-4",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{O(!v)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":v?"Click to pause animation":"Click to play animation",children:v?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ye.Nr,{min:n[0],max:n[n.length-1],marks:pe,step:null,defaultValue:n[n.length-1],value:n[f],onChangeComplete:te=>{ee(n.indexOf(te))},onChange:te=>{ee(n.indexOf(te))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,ae=d.length===0?i.jsxRuntimeExports.jsx(qe.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[gt&&d.filter(us).length!==0?i.jsxRuntimeExports.jsx(Pe.ColorLegendWithMouseOver,{width:ct,colorLegendTitle:it,colors:qt||ce.Colors[Et].categoricalColors.colors,colorDomain:B||Le.uniqBy(d,"color",!0),setSelectedColor:Rt,showNAColor:At,className:w?.colorLegend}):null,i.jsxRuntimeExports.jsx(ve.GraphArea,{ref:l,children:Ot&&Jt?i.jsxRuntimeExports.jsx(Pt,{data:m?Ne.orderBy(he.ensureCompleteDataForBarChart(d,Lt.dateFormat||"yyyy").filter(te=>Lt.enabled?te.date===me.format(new Date(n[f]),Lt.dateFormat||"yyyy"):te).filter(te=>St?!_t.checkIfNullOrUndefined(te.size):te),[te=>te.size===void 0?m==="asc"?(Wt==="horizontal"?1:-1)*(1/0):(Wt==="horizontal"?-1:1)*(1/0):te.size],[m]).filter((te,de)=>G?de<G:!0):he.ensureCompleteDataForBarChart(d,Lt.dateFormat||"yyyy").filter(te=>Lt.enabled?te.date===me.format(new Date(n[f]),Lt.dateFormat||"yyyy"):te).filter(te=>St?!_t.checkIfNullOrUndefined(te.size):te).filter((te,de)=>G?de<G:!0),barColor:d.filter(cs).length===0?qt?[qt]:[ce.Colors.primaryColors["blue-600"]]:qt||ce.Colors[Et].categoricalColors.colors,colorDomain:d.filter(rs).length===0?[]:B||Le.uniqBy(d,"color",!0),selectedColor:N,width:Ot,height:Jt,suffix:K,prefix:M,barPadding:ht,showValues:kt,showTicks:ot,leftMargin:Y,rightMargin:H,topMargin:j,bottomMargin:st,truncateBy:Ct,showLabels:ft,tooltip:F,onSeriesMouseOver:$,refValues:W,maxValue:_t.checkIfNullOrUndefined(s)?Math.max(...d.filter(as).map(ls))<0?0:Math.max(...d.filter(os).map(ns)):s,minValue:_t.checkIfNullOrUndefined(o)?Math.min(...d.filter(ss).map(is))>=0?0:Math.min(...d.filter(es).map(ts)):o,highlightedDataPoints:lt,onSeriesMouseClick:u,labelOrder:A,rtl:at==="he"||at==="ar",maxBarThickness:Ht,minBarThickness:bt,resetSelectionOnDoubleClick:b,detailsOnClick:c,barAxisTitle:D,noOfTicks:rt,valueColor:C,classNames:w,styles:S,animate:Gt===!0?{duration:.5,once:!0,amount:.5}:Gt||{duration:0,once:!0,amount:0},dimmedOpacity:E,precision:Ut,customLayers:Kt,naLabel:Qt}):null})]});let ge;t[17]!==w?.footnote||t[18]!==w?.source||t[19]!==Vt||t[20]!==yt||t[21]!==S?.footnote||t[22]!==S?.source||t[23]!==ct?(ge=yt||Vt?i.jsxRuntimeExports.jsx(Fe.GraphFooter,{sources:yt,footNote:Vt,width:ct,styles:{footnote:S?.footnote,source:S?.source},classNames:{footnote:w?.footnote,source:w?.source}}):null,t[17]=w?.footnote,t[18]=w?.source,t[19]=Vt,t[20]=yt,t[21]=S?.footnote,t[22]=S?.source,t[23]=ct,t[24]=ge):ge=t[24];let Ve;return t[25]!==re||t[26]!==zt||t[27]!==P||t[28]!==a||t[29]!==Nt||t[30]!==at||t[31]!==$t||t[32]!==dt||t[33]!==U||t[34]!==ne||t[35]!==le||t[36]!==Xt||t[37]!==Bt||t[38]!==ae||t[39]!==ge||t[40]!==Et||t[41]!==ct?(Ve=i.jsxRuntimeExports.jsxs(re,{className:ne,style:le,id:a,ref:ie,"aria-label":zt,backgroundColor:P,theme:Et,language:at,minHeight:$t,width:ct,height:Nt,relativeHeight:U,padding:dt,children:[Xt,Bt,ae,ge]}),t[25]=re,t[26]=zt,t[27]=P,t[28]=a,t[29]=Nt,t[30]=at,t[31]=$t,t[32]=dt,t[33]=U,t[34]=ne,t[35]=le,t[36]=Xt,t[37]=Bt,t[38]=ae,t[39]=ge,t[40]=Et,t[41]=ct,t[42]=Ve):Ve=t[42],Ve}function ts(e){return e.size}function es(e){return!_t.checkIfNullOrUndefined(e.size)}function is(e){return e.size}function ss(e){return!_t.checkIfNullOrUndefined(e.size)}function ns(e){return e.size}function os(e){return!_t.checkIfNullOrUndefined(e.size)}function ls(e){return e.size}function as(e){return!_t.checkIfNullOrUndefined(e.size)}function rs(e){return e.color}function cs(e){return e.color}function us(e){return e.color}function xs(e){return e!==void 0}function ms(e){return e!==void 0}function ds(e){return e.data}function ps(e){return e!==void 0}function hs(e){return e.data}function fs(e,t){return Ge.ascending(e,t)}function gs(e){const t=i.compilerRuntimeExports.c(122),{data:d,barColors:L,barPadding:qt,showTicks:Dt,topMargin:yt,bottomMargin:et,leftMargin:xt,rightMargin:k,truncateBy:I,width:y,height:z,tooltip:Nt,onSeriesMouseOver:ct,showLabels:Vt,suffix:B,prefix:it,showValues:mt,refValues:dt,maxValue:Tt,onSeriesMouseClick:j,selectedColor:st,rtl:Y,labelOrder:H,maxBarThickness:Q,minBarThickness:U,resetSelectionOnDoubleClick:F,detailsOnClick:$,barAxisTitle:W,valueColor:T,noOfTicks:a,styles:s,classNames:o,animate:u,colorDomain:x,precision:h,customLayers:m,naLabel:A}=e,Z=yt===void 0?25:yt,J=et===void 0?10:et,ut=xt===void 0?100:xt,Ft=k===void 0?40:k,Ht=q.useRef(null);let G;t[0]!==u.amount||t[1]!==u.once?(G={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=G):G=t[2];const bt=Ce.useInView(Ht,G),zt=W?Z+25:Z;let r;t[3]!==J||t[4]!==ut||t[5]!==Ft||t[6]!==zt?(r={top:zt,bottom:J,left:ut,right:Ft},t[3]=J,t[4]=ut,t[5]=Ft,t[6]=zt,t[7]=r):r=t[7];const c=r,[D,p]=q.useState(void 0),[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),pt=y-c.left-c.right,R=z-c.top-c.bottom;let g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft,gt;if(t[8]!==u||t[9]!==W||t[10]!==L||t[11]!==qt||t[12]!==o?.graphObjectValues||t[13]!==o?.xAxis?.gridLines||t[14]!==o?.xAxis?.labels||t[15]!==o?.xAxis?.title||t[16]!==o?.yAxis?.axis||t[17]!==o?.yAxis?.labels||t[18]!==x||t[19]!==m||t[20]!==d||t[21]!==$||t[22]!==R||t[23]!==pt||t[24]!==z||t[25]!==bt||t[26]!==H||t[27]!==c.bottom||t[28]!==c.left||t[29]!==c.top||t[30]!==Q||t[31]!==Tt||t[32]!==U||t[33]!==C||t[34]!==A||t[35]!==a||t[36]!==j||t[37]!==ct||t[38]!==h||t[39]!==it||t[40]!==dt||t[41]!==F||t[42]!==Y||t[43]!==st||t[44]!==Vt||t[45]!==Dt||t[46]!==mt||t[47]!==s?.graphObjectValues||t[48]!==s?.xAxis?.gridLines||t[49]!==s?.xAxis?.labels||t[50]!==s?.xAxis?.title||t[51]!==s?.yAxis?.axis||t[52]!==s?.yAxis?.labels||t[53]!==B||t[54]!==Z||t[55]!==I||t[56]!==T||t[57]!==y){let rt;t[72]!==H?(rt=(V,v)=>({...V,id:H?`${V.label}`:`${v}`}),t[72]=H,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=H||St.map(Os),E=Re.linear().domain([0,Tt]).range([0,pt]).nice(),Ut=fe.band().domain(Gt).range([0,U?Math.max(R,U*Gt.length):Q?Math.min(R,Q*Gt.length):R]).paddingInner(qt),It=E.ticks(a);_=Zt.motion.svg,kt=Ht,ot=`${y}px`,Ct=`${z}px`,X=`0 0 ${y} ${z}`,lt="ltr",tt=`translate(${c.left},${c.top})`,K=Dt?i.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:It.filter(Es),x:It.filter($s).map(V=>E(V)),y1:0-Z,y2:R+c.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:o?.xAxis?.gridLines,labels:o?.xAxis?.labels},suffix:B,prefix:it,labelType:"secondary",showGridLines:!0,precision:h}):null;const Kt=pt/2,Lt=0-c.top+15,Qt=s?.xAxis?.title,Wt=o?.xAxis?.title;t[74]!==W||t[75]!==Kt||t[76]!==Lt||t[77]!==Qt||t[78]!==Wt?(M=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:Kt,y:Lt,style:Qt,className:Wt,text:W}),t[74]=W,t[75]=Kt,t[76]=Lt,t[77]=Qt,t[78]=Wt,t[79]=M):M=t[79],t[80]!==m?(ht=m.filter(As).map(ws),t[80]=m,t[81]=ht):ht=t[81],g=Me.AnimatePresence,P=St.map(V=>_t.checkIfNullOrUndefined(Ut(V.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:0,y:Ut(`${V.id}`)},whileInView:{x:0,y:Ut(`${V.id}`),transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[V.size.map((v,O)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{opacity:st?L[O]===st?1:.3:1,onMouseEnter:n=>{p({...V,sizeIndex:O}),nt(n.clientY),Mt(n.clientX),ct?.({...V,sizeIndex:O})},onMouseMove:n=>{p({...V,sizeIndex:O}),nt(n.clientY),Mt(n.clientX)},onMouseLeave:()=>{p(void 0),Mt(void 0),nt(void 0),ct?.(void 0)},onClick:()=>{(j||$)&&(je.isEqual(C,{...V,sizeIndex:O})&&F?(S(void 0),j?.(void 0)):(S({...V,sizeIndex:O}),j&&j({...V,sizeIndex:O})))},children:[v?i.jsxRuntimeExports.jsx(Zt.motion.rect,{y:0,style:{fill:L[O]},height:Ut.bandwidth(),exit:{width:0,x:E(0),transition:{duration:u.duration}},variants:{initial:{width:0,x:E(0),fill:L[O]},whileInView:{width:E(v||0),x:E(O===0?0:oe.sum(V.size.filter((n,f)=>f<O&&n))),fill:L[O],transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial"},O):null,mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{y:Ut.bandwidth()/2,style:{textAnchor:"middle",...s?.graphObjectValues||{}},dy:"0.33em",className:i.mo("graph-value text-sm",o?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:E(0),opacity:0,fill:Ie.getTextColorBasedOnBgColor(L[O])},whileInView:{x:E(O===0?0:oe.sum(V.size.filter((n,f)=>f<O&&n)))+E(v||0)/2,opacity:v&&E(v)/ue.numberFormattingFunction(v,A,h,it,B).length>12?1:0,fill:Ie.getTextColorBasedOnBgColor(L[O]),transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",children:ue.numberFormattingFunction(v,A,h,it,B)}):null]},`${V.label}-${x[O]||O}`)),Vt?i.jsxRuntimeExports.jsx(Te.YAxesLabels,{value:`${V.label}`.length<I?`${V.label}`:`${`${V.label}`.substring(0,I)}...`,y:0,x:0-c.left,width:0+c.left,height:Ut.bandwidth(),style:s?.yAxis?.labels,className:o?.yAxis?.labels,animate:u,isInView:bt}):null,mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{className:i.mo("graph-value graph-value-total text-sm",T?"":" fill-primary-gray-700 dark:fill-primary-gray-300",o?.graphObjectValues),style:{...T?{fill:T}:{},textAnchor:"start",...s?.graphObjectValues||{}},y:Ut.bandwidth()/2,dx:5,dy:"0.33em",variants:{initial:{x:E(0),opacity:0,...T?{fill:T}:{}},whileInView:{x:E(oe.sum(V.size.map(js))),opacity:1,...T?{fill:T}:{},transition:{duration:u.duration}}},exit:{opacity:0,transition:{duration:u.duration}},initial:"initial",animate:bt?"whileInView":"initial",children:ue.numberFormattingFunction(oe.sum(V.size.filter(vs)),A,h,it,B)}):null]},V.label));const Pt=o?.yAxis?.axis;let Ot;t[82]!==Pt?(Ot={axis:Pt},t[82]=Pt,t[83]=Ot):Ot=t[83];const Yt=s?.yAxis?.axis;let Jt;t[84]!==Yt?(Jt={axis:Yt},t[84]=Yt,t[85]=Jt):Jt=t[85],ft=i.jsxRuntimeExports.jsx(Ee.Axis,{x1:E(0),x2:E(0),y1:-2.5,y2:R+c.bottom,classNames:Ot,styles:Jt}),gt=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((V,v)=>i.jsxRuntimeExports.jsx(ke.RefLineX,{text:V.text,color:V.color,x:E(V.value),y1:0-c.top,y2:R+c.bottom,textSide:E(V.value)>pt*.75||Y?"left":"right",classNames:V.classNames,styles:V.styles,animate:u,isInView:bt},v))}):null,t[8]=u,t[9]=W,t[10]=L,t[11]=qt,t[12]=o?.graphObjectValues,t[13]=o?.xAxis?.gridLines,t[14]=o?.xAxis?.labels,t[15]=o?.xAxis?.title,t[16]=o?.yAxis?.axis,t[17]=o?.yAxis?.labels,t[18]=x,t[19]=m,t[20]=d,t[21]=$,t[22]=R,t[23]=pt,t[24]=z,t[25]=bt,t[26]=H,t[27]=c.bottom,t[28]=c.left,t[29]=c.top,t[30]=Q,t[31]=Tt,t[32]=U,t[33]=C,t[34]=A,t[35]=a,t[36]=j,t[37]=ct,t[38]=h,t[39]=it,t[40]=dt,t[41]=F,t[42]=Y,t[43]=st,t[44]=Vt,t[45]=Dt,t[46]=mt,t[47]=s?.graphObjectValues,t[48]=s?.xAxis?.gridLines,t[49]=s?.xAxis?.labels,t[50]=s?.xAxis?.title,t[51]=s?.yAxis?.axis,t[52]=s?.yAxis?.labels,t[53]=B,t[54]=Z,t[55]=I,t[56]=T,t[57]=y,t[58]=g,t[59]=_,t[60]=tt,t[61]=K,t[62]=M,t[63]=ht,t[64]=kt,t[65]=ot,t[66]=Ct,t[67]=X,t[68]=lt,t[69]=P,t[70]=ft,t[71]=gt}else g=t[58],_=t[59],tt=t[60],K=t[61],M=t[62],ht=t[63],kt=t[64],ot=t[65],Ct=t[66],X=t[67],lt=t[68],P=t[69],ft=t[70],gt=t[71];let jt;t[86]!==g||t[87]!==P||t[88]!==ft||t[89]!==gt?(jt=i.jsxRuntimeExports.jsxs(g,{children:[P,ft,gt]}),t[86]=g,t[87]=P,t[88]=ft,t[89]=gt,t[90]=jt):jt=t[90];let wt;t[91]!==m?(wt=m.filter(bs).map(ys),t[91]=m,t[92]=wt):wt=t[92];let at;t[93]!==tt||t[94]!==K||t[95]!==M||t[96]!==ht||t[97]!==jt||t[98]!==wt?(at=i.jsxRuntimeExports.jsxs("g",{transform:tt,children:[K,M,ht,jt,wt]}),t[93]=tt,t[94]=K,t[95]=M,t[96]=ht,t[97]=jt,t[98]=wt,t[99]=at):at=t[99];let At;t[100]!==_||t[101]!==kt||t[102]!==ot||t[103]!==Ct||t[104]!==X||t[105]!==lt||t[106]!==at?(At=i.jsxRuntimeExports.jsx(_,{ref:kt,width:ot,height:Ct,viewBox:X,direction:lt,children:at}),t[100]=_,t[101]=kt,t[102]=ot,t[103]=Ct,t[104]=X,t[105]=lt,t[106]=at,t[107]=At):At=t[107];let $t;t[108]!==o?.tooltip||t[109]!==w||t[110]!==vt||t[111]!==D||t[112]!==s?.tooltip||t[113]!==Nt?($t=D&&Nt&&w&&vt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:D,body:Nt,xPos:w,yPos:vt,backgroundStyle:s?.tooltip,className:o?.tooltip}):null,t[108]=o?.tooltip,t[109]=w,t[110]=vt,t[111]=D,t[112]=s?.tooltip,t[113]=Nt,t[114]=$t):$t=t[114];let Et;t[115]!==$||t[116]!==C?(Et=$&&C!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:C!==void 0,onClose:()=>{S(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:$e.string2HTML($,C)}:void 0,children:typeof $=="function"?$(C):null})}):null,t[115]=$,t[116]=C,t[117]=Et):Et=t[117];let b;return t[118]!==At||t[119]!==$t||t[120]!==Et?(b=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[At,$t,Et]}),t[118]=At,t[119]=$t,t[120]=Et,t[121]=b):b=t[121],b}function ys(e){return e.layer}function bs(e){return e.position==="after"}function vs(e){return e}function js(e){return e||0}function ws(e){return e.layer}function As(e){return e.position==="before"}function $s(e){return e!==0}function Es(e){return e!==0}function Os(e){return`${e.id}`}function ks(e){const t=i.compilerRuntimeExports.c(129),{data:d,leftMargin:L,rightMargin:qt,topMargin:Dt,bottomMargin:yt,width:et,height:xt,barColors:k,barPadding:I,showLabels:y,showTicks:z,truncateBy:Nt,tooltip:ct,onSeriesMouseOver:Vt,suffix:B,prefix:it,showValues:mt,refValues:dt,maxValue:Tt,onSeriesMouseClick:j,selectedColor:st,labelOrder:Y,maxBarThickness:H,minBarThickness:Q,resetSelectionOnDoubleClick:U,detailsOnClick:F,barAxisTitle:$,valueColor:W,noOfTicks:T,styles:a,classNames:s,animate:o,colorDomain:u,precision:x,customLayers:h,naLabel:m}=e,A=L===void 0?20:L,Z=qt===void 0?20:qt,J=Dt===void 0?20:Dt,ut=yt===void 0?25:yt,Ft=q.useRef(null);let Ht;t[0]!==o.amount||t[1]!==o.once?(Ht={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=Ht):Ht=t[2];const G=Ce.useInView(Ft,Ht),bt=$?A+30:A;let zt;t[3]!==ut||t[4]!==Z||t[5]!==bt||t[6]!==J?(zt={top:J,bottom:ut,left:bt,right:Z},t[3]=ut,t[4]=Z,t[5]=bt,t[6]=J,t[7]=zt):zt=t[7];const r=zt,[c,D]=q.useState(void 0),[p,C]=q.useState(void 0),[S,w]=q.useState(void 0),[Mt,vt]=q.useState(void 0),nt=et-r.left-r.right,pt=xt-r.top-r.bottom;let R,g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft;if(t[8]!==o||t[9]!==$||t[10]!==k||t[11]!==I||t[12]!==s?.graphObjectValues||t[13]!==s?.xAxis?.axis||t[14]!==s?.xAxis?.labels||t[15]!==s?.yAxis?.gridLines||t[16]!==s?.yAxis?.labels||t[17]!==s?.yAxis?.title||t[18]!==u||t[19]!==h||t[20]!==d||t[21]!==F||t[22]!==pt||t[23]!==nt||t[24]!==xt||t[25]!==G||t[26]!==Y||t[27]!==A||t[28]!==r.bottom||t[29]!==r.left||t[30]!==r.right||t[31]!==r.top||t[32]!==H||t[33]!==Tt||t[34]!==Q||t[35]!==p||t[36]!==m||t[37]!==T||t[38]!==j||t[39]!==Vt||t[40]!==x||t[41]!==it||t[42]!==dt||t[43]!==U||t[44]!==st||t[45]!==y||t[46]!==z||t[47]!==mt||t[48]!==a?.graphObjectValues||t[49]!==a?.xAxis?.axis||t[50]!==a?.xAxis?.labels||t[51]!==a?.yAxis?.gridLines||t[52]!==a?.yAxis?.labels||t[53]!==a?.yAxis?.title||t[54]!==B||t[55]!==Nt||t[56]!==W||t[57]!==et){const b=Re.linear().domain([0,Tt]).range([pt,0]).nice();let rt;t[72]!==Y?(rt=(f,ee)=>({...f,id:Y?`${f.label}`:`${ee}`}),t[72]=Y,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=Y||St.map(Ss),E=fe.band().domain(Gt).range([0,Q?Math.max(nt,Q*Gt.length):H?Math.min(nt,H*Gt.length):nt]).paddingInner(I),Ut=b.ticks(T);g=Zt.motion.svg,ht=`${et}px`,kt=`${xt}px`,ot=`0 0 ${et} ${xt}`,Ct="ltr",X=Ft,ft=`translate(${r.left},${r.top})`;const It=b(0),Kt=b(0);let Lt;t[74]!==m||t[75]!==x||t[76]!==it||t[77]!==B?(Lt=ue.numberFormattingFunction(0,m,x,it,B),t[74]=m,t[75]=x,t[76]=it,t[77]=B,t[78]=Lt):Lt=t[78];const Qt=s?.xAxis?.axis,Wt=s?.yAxis?.labels;let Pt;t[79]!==Qt||t[80]!==Wt?(Pt={axis:Qt,label:Wt},t[79]=Qt,t[80]=Wt,t[81]=Pt):Pt=t[81];const Ot=a?.xAxis?.axis,Yt=a?.yAxis?.labels;let Jt;t[82]!==Ot||t[83]!==Yt?(Jt={axis:Ot,label:Yt},t[82]=Ot,t[83]=Yt,t[84]=Jt):Jt=t[84],_=i.jsxRuntimeExports.jsx(Ee.Axis,{y1:It,y2:Kt,x1:0-A,x2:nt+r.right,label:Lt,labelPos:{x:0-A,y:b(0),dx:0,dy:-5},classNames:Pt,styles:Jt}),tt=z?i.jsxRuntimeExports.jsx(De.YTicksAndGridLines,{values:Ut.filter(Ts),y:Ut.filter(Is).map(f=>b(f)),x1:0-A,x2:nt+r.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},suffix:B,prefix:it,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:x}):null;const V=0-A-15,v=pt/2,O=a?.yAxis?.title,n=s?.yAxis?.title;t[85]!==$||t[86]!==V||t[87]!==v||t[88]!==O||t[89]!==n?(K=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:V,y:v,style:O,className:n,text:$,rotate90:!0}),t[85]=$,t[86]=V,t[87]=v,t[88]=O,t[89]=n,t[90]=K):K=t[90],t[91]!==h?(M=h.filter(Vs).map(Ns),t[91]=h,t[92]=M):M=t[92],R=Me.AnimatePresence,lt=St.map(f=>_t.checkIfNullOrUndefined(E(f.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:E(`${f.id}`),y:0},whileInView:{x:E(`${f.id}`),y:0,transition:{duration:o.duration}}},transition:{duration:o.duration},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:[f.size.map((ee,N)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{opacity:st?k[N]===st?1:.3:1,onMouseEnter:Rt=>{D({...f,sizeIndex:N}),vt(Rt.clientY),w(Rt.clientX),Vt?.({...f,sizeIndex:N})},onMouseMove:Rt=>{D({...f,sizeIndex:N}),vt(Rt.clientY),w(Rt.clientX)},onMouseLeave:()=>{D(void 0),w(void 0),vt(void 0),Vt?.(void 0)},onClick:()=>{(j||F)&&(je.isEqual(p,{...f,sizeIndex:N})&&U?(C(void 0),j?.(void 0)):(C({...f,sizeIndex:N}),j&&j({...f,sizeIndex:N})))},children:[i.jsxRuntimeExports.jsx(Zt.motion.rect,{x:0,width:E.bandwidth(),variants:{initial:{height:0,fill:k[N],y:b(0)},whileInView:{height:Math.abs(b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))-b(oe.sum(f.size.filter((Rt,l)=>l<N&&Rt)))),y:b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt))),fill:k[N],transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{height:0,y:b(0),transition:{duration:o.duration}}}),mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{x:E.bandwidth()/2,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:i.mo("graph-value text-sm",s?.graphObjectValues),dy:"0.33em",variants:{initial:{y:b(0),opacity:0,fill:Ie.getTextColorBasedOnBgColor(k[N])},whileInView:{y:b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))+Math.abs(b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))-b(oe.sum(f.size.filter((Rt,l)=>l<N&&Rt))))/2,opacity:ee&&Math.abs(b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))-b(oe.sum(f.size.filter((Rt,l)=>l<N&&Rt))))>20?1:0,fill:Ie.getTextColorBasedOnBgColor(k[N]),transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:ue.numberFormattingFunction(ee,m,x,it,B)}):null]},`${f.label}-${u[N]||N}`)),y?i.jsxRuntimeExports.jsx(ze.XAxesLabels,{value:`${f.label}`.length<Nt?`${f.label}`:`${`${f.label}`.substring(0,Nt)}...`,y:b(0)+5,x:0,width:E.bandwidth(),height:r.bottom,style:a?.xAxis?.labels,className:s?.xAxis?.labels,alignment:"top",animate:o,isInView:G}):null,mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{style:{textAnchor:"middle",...a?.graphObjectValues||{}},x:E.bandwidth()/2,dy:-10,className:i.mo("graph-value graph-value-total",W?"text-sm":"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",s?.graphObjectValues),variants:{initial:{y:b(0),opacity:0,...W&&{fill:W}},whileInView:{y:b(oe.sum(f.size.map(Ls))),opacity:1,...W&&{fill:W},transition:{duration:o.duration}}},exit:{opacity:0,transition:{duration:o.duration}},initial:"initial",animate:G?"whileInView":"initial",children:ue.numberFormattingFunction(oe.sum(f.size.filter(Ms)),m,x,it,B)}):null]},f.label)),P=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((f,ee)=>i.jsxRuntimeExports.jsx(ke.RefLineY,{text:f.text,color:f.color,y:b(f.value),x1:0-A,x2:nt+r.right,classNames:f.classNames,styles:f.styles,animate:o,isInView:G},ee))}):null,t[8]=o,t[9]=$,t[10]=k,t[11]=I,t[12]=s?.graphObjectValues,t[13]=s?.xAxis?.axis,t[14]=s?.xAxis?.labels,t[15]=s?.yAxis?.gridLines,t[16]=s?.yAxis?.labels,t[17]=s?.yAxis?.title,t[18]=u,t[19]=h,t[20]=d,t[21]=F,t[22]=pt,t[23]=nt,t[24]=xt,t[25]=G,t[26]=Y,t[27]=A,t[28]=r.bottom,t[29]=r.left,t[30]=r.right,t[31]=r.top,t[32]=H,t[33]=Tt,t[34]=Q,t[35]=p,t[36]=m,t[37]=T,t[38]=j,t[39]=Vt,t[40]=x,t[41]=it,t[42]=dt,t[43]=U,t[44]=st,t[45]=y,t[46]=z,t[47]=mt,t[48]=a?.graphObjectValues,t[49]=a?.xAxis?.axis,t[50]=a?.xAxis?.labels,t[51]=a?.yAxis?.gridLines,t[52]=a?.yAxis?.labels,t[53]=a?.yAxis?.title,t[54]=B,t[55]=Nt,t[56]=W,t[57]=et,t[58]=R,t[59]=g,t[60]=_,t[61]=tt,t[62]=K,t[63]=M,t[64]=ht,t[65]=kt,t[66]=ot,t[67]=Ct,t[68]=X,t[69]=lt,t[70]=P,t[71]=ft}else R=t[58],g=t[59],_=t[60],tt=t[61],K=t[62],M=t[63],ht=t[64],kt=t[65],ot=t[66],Ct=t[67],X=t[68],lt=t[69],P=t[70],ft=t[71];let gt;t[93]!==R||t[94]!==lt||t[95]!==P?(gt=i.jsxRuntimeExports.jsxs(R,{children:[lt,P]}),t[93]=R,t[94]=lt,t[95]=P,t[96]=gt):gt=t[96];let jt;t[97]!==h?(jt=h.filter(Rs).map(Cs),t[97]=h,t[98]=jt):jt=t[98];let wt;t[99]!==_||t[100]!==tt||t[101]!==K||t[102]!==M||t[103]!==gt||t[104]!==jt||t[105]!==ft?(wt=i.jsxRuntimeExports.jsxs("g",{transform:ft,children:[_,tt,K,M,gt,jt]}),t[99]=_,t[100]=tt,t[101]=K,t[102]=M,t[103]=gt,t[104]=jt,t[105]=ft,t[106]=wt):wt=t[106];let at;t[107]!==g||t[108]!==ht||t[109]!==kt||t[110]!==ot||t[111]!==Ct||t[112]!==X||t[113]!==wt?(at=i.jsxRuntimeExports.jsx(g,{width:ht,height:kt,viewBox:ot,direction:Ct,ref:X,children:wt}),t[107]=g,t[108]=ht,t[109]=kt,t[110]=ot,t[111]=Ct,t[112]=X,t[113]=wt,t[114]=at):at=t[114];let At;t[115]!==s?.tooltip||t[116]!==S||t[117]!==Mt||t[118]!==c||t[119]!==a?.tooltip||t[120]!==ct?(At=c&&ct&&S&&Mt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:c,body:ct,xPos:S,yPos:Mt,backgroundStyle:a?.tooltip,className:s?.tooltip}):null,t[115]=s?.tooltip,t[116]=S,t[117]=Mt,t[118]=c,t[119]=a?.tooltip,t[120]=ct,t[121]=At):At=t[121];let $t;t[122]!==F||t[123]!==p?($t=F&&p!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:p!==void 0,onClose:()=>{C(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof F=="string"?{__html:$e.string2HTML(F,p)}:void 0,children:typeof F=="function"?F(p):null})}):null,t[122]=F,t[123]=p,t[124]=$t):$t=t[124];let Et;return t[125]!==at||t[126]!==At||t[127]!==$t?(Et=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[at,At,$t]}),t[125]=at,t[126]=At,t[127]=$t,t[128]=Et):Et=t[128],Et}function Cs(e){return e.layer}function Rs(e){return e.position==="after"}function Ms(e){return e}function Ls(e){return e||0}function Ns(e){return e.layer}function Vs(e){return e.position==="before"}function Is(e){return e!==0}function Ts(e){return e!==0}function Ss(e){return`${e.id}`}function Ds(e){const t=i.compilerRuntimeExports.c(43),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,padding:Vt,backgroundColor:B,topMargin:it,bottomMargin:mt,leftMargin:dt,rightMargin:Tt,tooltip:j,onSeriesMouseOver:st,suffix:Y,prefix:H,showLabels:Q,relativeHeight:U,showValues:F,refValues:$,graphID:W,maxValue:T,onSeriesMouseClick:a,graphDownload:s,dataDownload:o,language:u,labelOrder:x,minHeight:h,theme:m,maxBarThickness:A,sortParameter:Z,maxNumberOfBars:J,minBarThickness:ut,showColorScale:Ft,ariaLabel:Ht,resetSelectionOnDoubleClick:G,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:r,valueColor:c,styles:D,classNames:p,filterNA:C,animate:S,precision:w,customLayers:Mt,timeline:vt,naLabel:nt,sortData:pt,orientation:R}=e,g=qt===void 0?ce.Colors.light.categoricalColors.colors:qt,_=et===void 0?.25:et,tt=xt===void 0?!0:xt,K=k===void 0?999:k,M=B===void 0?!1:B,ht=Y===void 0?"":Y,kt=H===void 0?"":H,ot=Q===void 0?!0:Q,Ct=F===void 0?!0:F,X=s===void 0?!1:s,lt=o===void 0?!1:o,P=u===void 0?"en":u,ft=h===void 0?0:h,gt=m===void 0?"light":m,jt=Ft===void 0?!0:Ft,wt=G===void 0?!0:G,at=r===void 0?5:r,At=C===void 0?!0:C,$t=S===void 0?!1:S,Et=w===void 0?2:w;let b;t[0]!==Mt?(b=Mt===void 0?[]:Mt,t[0]=Mt,t[1]=b):b=t[1];const rt=b,St=vt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:vt,Gt=nt===void 0?"NA":nt,Ut=(R===void 0?"vertical":R)==="horizontal"?gs:ks,[It,Kt]=q.useState(0),[Lt,Qt]=q.useState(0),[Wt,Pt]=q.useState(St.autoplay),Ot=He.sort(Le.uniqBy(d,"date",!0).map(Bt=>me.parse(`${Bt}`,St.dateFormat||"yyyy",new Date).getTime()),Ks),[Yt,Jt]=q.useState(St.autoplay?0:Ot.length-1),[V,v]=q.useState(void 0),O=q.useRef(null),n=q.useRef(null);let f,ee;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{const Bt=new ResizeObserver(ae=>{Kt(ae[0].target.clientWidth||620),Qt(ae[0].target.clientHeight||480)});return O.current&&Bt.observe(O.current),()=>Bt.disconnect()},ee=[],t[2]=f,t[3]=ee):(f=t[2],ee=t[3]),q.useEffect(f,ee),q.useEffect(()=>{const Bt=setInterval(()=>{Jt(ae=>ae<Ot.length-1?ae+1:0)},(St.speed||2)*1e3);return Wt||clearInterval(Bt),()=>clearInterval(Bt)},[Ot,Wt,St.speed]);const N=ye.getSliderMarks(Ot,Yt,St.showOnlyActiveDate,St.dateFormat||"yyyy"),Rt=ve.GraphContainer,l=p?.graphContainer,ie=D?.graphContainer;let se;t[4]!==p?.description||t[5]!==p?.title||t[6]!==d||t[7]!==lt||t[8]!==yt||t[9]!==X||t[10]!==L||t[11]!==D?.description||t[12]!==D?.title||t[13]!==y?(se=L||yt||X||lt?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:D?.title,description:D?.description},classNames:{title:p?.title,description:p?.description},graphTitle:L,graphDescription:yt,width:y,graphDownload:X?n:void 0,dataDownload:lt?d.map(Js).filter(Ws).length>0?d.map(Us).filter(Ys):d.filter(Xs):null}):null,t[4]=p?.description,t[5]=p?.title,t[6]=d,t[7]=lt,t[8]=yt,t[9]=X,t[10]=L,t[11]=D?.description,t[12]=D?.title,t[13]=y,t[14]=se):se=t[14];const xe=St.enabled&&Ot.length>0&&N?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Pt(!Wt)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Wt?"Click to pause animation":"Click to play animation",children:Wt?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ye.Nr,{min:Ot[0],max:Ot[Ot.length-1],marks:N,step:null,defaultValue:Ot[Ot.length-1],value:Ot[Yt],onChangeComplete:Bt=>{Jt(Ot.indexOf(Bt))},onChange:Bt=>{Jt(Ot.indexOf(Bt))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,pe="grow flex flex-col justify-center gap-3 w-full",re=d.length===0?i.jsxRuntimeExports.jsx(qe.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[jt?i.jsxRuntimeExports.jsx(Pe.ColorLegendWithMouseOver,{width:y,colorDomain:Nt,colors:g,colorLegendTitle:ct,setSelectedColor:v,showNAColor:!1,className:p?.colorLegend}):null,i.jsxRuntimeExports.jsx(ve.GraphArea,{ref:O,children:It&&Lt?i.jsxRuntimeExports.jsx(Ut,{data:Z!==void 0?Z==="total"?Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,St.dateFormat||"yyyy").filter(Bt=>St.enabled?Bt.date===me.format(new Date(Ot[Yt]),St.dateFormat||"yyyy"):Bt).filter(Bt=>At?!Bt.size.every(Gs):Bt),qs,[pt||"asc"]).filter((Bt,ae)=>J?ae<J:!0):Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,St.dateFormat||"yyyy").filter(Bt=>St.enabled?Bt.date===me.format(new Date(Ot[Yt]),St.dateFormat||"yyyy"):Bt).filter(Bt=>At?!Bt.size.every(Ps):Bt),Bt=>_t.checkIfNullOrUndefined(Bt.size[Z])?-1/0:Bt.size[Z],[pt||"asc"]).filter((Bt,ae)=>J?ae<J:!0):he.ensureCompleteDataForStackedBarChart(d,St.dateFormat||"yyyy").filter(Bt=>St.enabled?Bt.date===me.format(new Date(Ot[Yt]),St.dateFormat||"yyyy"):Bt).filter(Bt=>At?!Bt.size.every(Fs):Bt).filter((Bt,ae)=>J?ae<J:!0),barColors:g,width:It,height:Lt,barPadding:_,showTicks:tt,leftMargin:dt,rightMargin:Tt,topMargin:it,bottomMargin:mt,truncateBy:K,showLabels:ot,tooltip:j,onSeriesMouseOver:st,showValues:Ct,suffix:ht,prefix:kt,refValues:$,maxValue:_t.checkIfNullOrUndefined(T)?Math.max(...d.map(zs)):T,onSeriesMouseClick:a,selectedColor:V,rtl:P==="he"||P==="ar",labelOrder:x,maxBarThickness:A,minBarThickness:ut,resetSelectionOnDoubleClick:wt,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:at,valueColor:c,classNames:p,styles:D,animate:$t===!0?{duration:.5,once:!0,amount:.5}:$t||{duration:0,once:!0,amount:0},colorDomain:Nt,precision:Et,customLayers:rt,naLabel:Gt}):null})]});let ne;t[15]!==re?(ne=i.jsxRuntimeExports.jsx("div",{className:pe,children:re}),t[15]=re,t[16]=ne):ne=t[16];let le;t[17]!==p?.footnote||t[18]!==p?.source||t[19]!==z||t[20]!==Dt||t[21]!==D?.footnote||t[22]!==D?.source||t[23]!==y?(le=Dt||z?i.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:D?.footnote,source:D?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:Dt,footNote:z,width:y}):null,t[17]=p?.footnote,t[18]=p?.source,t[19]=z,t[20]=Dt,t[21]=D?.footnote,t[22]=D?.source,t[23]=y,t[24]=le):le=t[24];let Xt;return t[25]!==Rt||t[26]!==Ht||t[27]!==M||t[28]!==W||t[29]!==I||t[30]!==P||t[31]!==ft||t[32]!==Vt||t[33]!==U||t[34]!==l||t[35]!==ie||t[36]!==se||t[37]!==xe||t[38]!==ne||t[39]!==le||t[40]!==gt||t[41]!==y?(Xt=i.jsxRuntimeExports.jsxs(Rt,{className:l,style:ie,id:W,ref:n,"aria-label":Ht,backgroundColor:M,theme:gt,language:P,minHeight:ft,width:y,height:I,relativeHeight:U,padding:Vt,children:[se,xe,ne,le]}),t[25]=Rt,t[26]=Ht,t[27]=M,t[28]=W,t[29]=I,t[30]=P,t[31]=ft,t[32]=Vt,t[33]=U,t[34]=l,t[35]=ie,t[36]=se,t[37]=xe,t[38]=ne,t[39]=le,t[40]=gt,t[41]=y,t[42]=Xt):Xt=t[42],Xt}function zs(e){return oe.sum(e.size.filter(Bs))||0}function Bs(e){return!_t.checkIfNullOrUndefined(e)}function Fs(e){return e==null}function Ps(e){return e==null}function qs(e){return oe.sum(e.size.filter(Hs))}function Hs(e){return!_t.checkIfNullOrUndefined(e)}function Gs(e){return e==null}function Xs(e){return e!==void 0}function Ys(e){return e!==void 0}function Us(e){return e.data}function Ws(e){return e!==void 0}function Js(e){return e.data}function Ks(e,t){return Ge.ascending(e,t)}function Qs(e){const t=i.compilerRuntimeExports.c(61),{data:d,graphTitle:L,colors:qt,barPadding:Dt,showTicks:yt,leftMargin:et,rightMargin:xt,topMargin:k,bottomMargin:I,truncateBy:y,showLabels:z,showValues:Nt,backgroundColor:ct,suffix:Vt,prefix:B,sources:it,graphDescription:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,showColorScale:W,graphID:T,maxValue:a,minValue:s,highlightedDataPoints:o,onSeriesMouseClick:u,graphDownload:x,dataDownload:h,language:m,theme:A,sortData:Z,labelOrder:J,showNAColor:ut,minHeight:Ft,maxBarThickness:Ht,maxNumberOfBars:G,minBarThickness:bt,ariaLabel:zt,resetSelectionOnDoubleClick:r,detailsOnClick:c,barAxisTitle:D,noOfTicks:p,valueColor:C,orientation:S,styles:w,classNames:Mt,filterNA:vt,animate:nt,dimmedOpacity:pt,precision:R,customLayers:g,timeline:_,naLabel:tt}=e,K=S===void 0?"vertical":S;let M;return t[0]!==nt||t[1]!==zt||t[2]!==ct||t[3]!==D||t[4]!==Dt||t[5]!==I||t[6]!==Mt||t[7]!==st||t[8]!==Y||t[9]!==qt||t[10]!==g||t[11]!==d||t[12]!==h||t[13]!==c||t[14]!==pt||t[15]!==vt||t[16]!==j||t[17]!==mt||t[18]!==x||t[19]!==T||t[20]!==L||t[21]!==dt||t[22]!==o||t[23]!==J||t[24]!==m||t[25]!==et||t[26]!==Ht||t[27]!==G||t[28]!==a||t[29]!==bt||t[30]!==Ft||t[31]!==s||t[32]!==tt||t[33]!==p||t[34]!==u||t[35]!==F||t[36]!==K||t[37]!==H||t[38]!==R||t[39]!==B||t[40]!==$||t[41]!==Q||t[42]!==r||t[43]!==xt||t[44]!==W||t[45]!==z||t[46]!==ut||t[47]!==yt||t[48]!==Nt||t[49]!==Z||t[50]!==it||t[51]!==w||t[52]!==Vt||t[53]!==A||t[54]!==_||t[55]!==U||t[56]!==k||t[57]!==y||t[58]!==C||t[59]!==Tt?(M=i.jsxRuntimeExports.jsx(_i,{data:d,graphTitle:L,colors:qt,barPadding:Dt,showTicks:yt,leftMargin:et,rightMargin:xt,topMargin:k,bottomMargin:I,truncateBy:y,showLabels:z,showValues:Nt,backgroundColor:ct,suffix:Vt,prefix:B,sources:it,graphDescription:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,showColorScale:W,graphID:T,maxValue:a,minValue:s,highlightedDataPoints:o,onSeriesMouseClick:u,graphDownload:x,dataDownload:h,language:m,theme:A,sortData:Z,labelOrder:J,showNAColor:ut,minHeight:Ft,maxBarThickness:Ht,maxNumberOfBars:G,minBarThickness:bt,ariaLabel:zt,resetSelectionOnDoubleClick:r,styles:w,detailsOnClick:c,barAxisTitle:D,noOfTicks:p,valueColor:C,classNames:Mt,filterNA:vt,animate:nt,dimmedOpacity:pt,precision:R,customLayers:g,timeline:_,naLabel:tt,orientation:K}),t[0]=nt,t[1]=zt,t[2]=ct,t[3]=D,t[4]=Dt,t[5]=I,t[6]=Mt,t[7]=st,t[8]=Y,t[9]=qt,t[10]=g,t[11]=d,t[12]=h,t[13]=c,t[14]=pt,t[15]=vt,t[16]=j,t[17]=mt,t[18]=x,t[19]=T,t[20]=L,t[21]=dt,t[22]=o,t[23]=J,t[24]=m,t[25]=et,t[26]=Ht,t[27]=G,t[28]=a,t[29]=bt,t[30]=Ft,t[31]=s,t[32]=tt,t[33]=p,t[34]=u,t[35]=F,t[36]=K,t[37]=H,t[38]=R,t[39]=B,t[40]=$,t[41]=Q,t[42]=r,t[43]=xt,t[44]=W,t[45]=z,t[46]=ut,t[47]=yt,t[48]=Nt,t[49]=Z,t[50]=it,t[51]=w,t[52]=Vt,t[53]=A,t[54]=_,t[55]=U,t[56]=k,t[57]=y,t[58]=C,t[59]=Tt,t[60]=M):M=t[60],M}function Zs(e){const t=i.compilerRuntimeExports.c(57),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,suffix:Vt,prefix:B,showValues:it,padding:mt,backgroundColor:dt,leftMargin:Tt,rightMargin:j,topMargin:st,bottomMargin:Y,showLabels:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,graphID:W,maxValue:T,minValue:a,onSeriesMouseClick:s,graphDownload:o,dataDownload:u,language:x,labelOrder:h,minHeight:m,theme:A,sortParameter:Z,sortData:J,maxBarThickness:ut,ariaLabel:Ft,resetSelectionOnDoubleClick:Ht,detailsOnClick:G,barAxisTitle:bt,noOfTicks:zt,valueColor:r,orientation:c,styles:D,classNames:p,filterNA:C,animate:S,precision:w,customLayers:Mt,showColorScale:vt,timeline:nt,naLabel:pt}=e,R=c===void 0?"vertical":c;let g;return t[0]!==S||t[1]!==Ft||t[2]!==dt||t[3]!==bt||t[4]!==et||t[5]!==Y||t[6]!==p||t[7]!==Nt||t[8]!==ct||t[9]!==qt||t[10]!==Mt||t[11]!==d||t[12]!==u||t[13]!==G||t[14]!==C||t[15]!==z||t[16]!==yt||t[17]!==o||t[18]!==W||t[19]!==L||t[20]!==I||t[21]!==h||t[22]!==x||t[23]!==Tt||t[24]!==ut||t[25]!==T||t[26]!==m||t[27]!==a||t[28]!==pt||t[29]!==zt||t[30]!==s||t[31]!==F||t[32]!==R||t[33]!==mt||t[34]!==w||t[35]!==B||t[36]!==$||t[37]!==Q||t[38]!==Ht||t[39]!==j||t[40]!==vt||t[41]!==H||t[42]!==xt||t[43]!==it||t[44]!==J||t[45]!==Z||t[46]!==Dt||t[47]!==D||t[48]!==Vt||t[49]!==A||t[50]!==nt||t[51]!==U||t[52]!==st||t[53]!==k||t[54]!==r||t[55]!==y?(g=i.jsxRuntimeExports.jsx(ci,{orientation:R,data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,suffix:Vt,prefix:B,showValues:it,padding:mt,backgroundColor:dt,leftMargin:Tt,rightMargin:j,sortParameter:Z,sortData:J,topMargin:st,bottomMargin:Y,showLabels:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,graphID:W,maxValue:T,minValue:a,onSeriesMouseClick:s,graphDownload:o,dataDownload:u,language:x,labelOrder:h,minHeight:m,theme:A,maxBarThickness:ut,ariaLabel:Ft,resetSelectionOnDoubleClick:Ht,styles:D,detailsOnClick:G,barAxisTitle:bt,noOfTicks:zt,valueColor:r,classNames:p,filterNA:C,animate:S,precision:w,customLayers:Mt,showColorScale:vt,timeline:nt,naLabel:pt}),t[0]=S,t[1]=Ft,t[2]=dt,t[3]=bt,t[4]=et,t[5]=Y,t[6]=p,t[7]=Nt,t[8]=ct,t[9]=qt,t[10]=Mt,t[11]=d,t[12]=u,t[13]=G,t[14]=C,t[15]=z,t[16]=yt,t[17]=o,t[18]=W,t[19]=L,t[20]=I,t[21]=h,t[22]=x,t[23]=Tt,t[24]=ut,t[25]=T,t[26]=m,t[27]=a,t[28]=pt,t[29]=zt,t[30]=s,t[31]=F,t[32]=R,t[33]=mt,t[34]=w,t[35]=B,t[36]=$,t[37]=Q,t[38]=Ht,t[39]=j,t[40]=vt,t[41]=H,t[42]=xt,t[43]=it,t[44]=J,t[45]=Z,t[46]=Dt,t[47]=D,t[48]=Vt,t[49]=A,t[50]=nt,t[51]=U,t[52]=st,t[53]=k,t[54]=r,t[55]=y,t[56]=g):g=t[56],g}function _s(e){const t=i.compilerRuntimeExports.c(58),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,leftMargin:k,rightMargin:I,topMargin:y,bottomMargin:z,truncateBy:Nt,showLabels:ct,showValues:Vt,backgroundColor:B,suffix:it,prefix:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,tooltip:Q,onSeriesMouseOver:U,relativeHeight:F,refValues:$,graphID:W,maxValue:T,onSeriesMouseClick:a,graphDownload:s,dataDownload:o,language:u,theme:x,labelOrder:h,minHeight:m,maxBarThickness:A,sortParameter:Z,sortData:J,maxNumberOfBars:ut,minBarThickness:Ft,ariaLabel:Ht,resetSelectionOnDoubleClick:G,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:r,valueColor:c,orientation:D,styles:p,classNames:C,filterNA:S,animate:w,precision:Mt,customLayers:vt,showColorScale:nt,timeline:pt,naLabel:R}=e,g=D===void 0?"vertical":D;let _;return t[0]!==w||t[1]!==Ht||t[2]!==B||t[3]!==zt||t[4]!==et||t[5]!==z||t[6]!==C||t[7]!==st||t[8]!==Y||t[9]!==qt||t[10]!==vt||t[11]!==d||t[12]!==o||t[13]!==bt||t[14]!==S||t[15]!==j||t[16]!==yt||t[17]!==s||t[18]!==W||t[19]!==L||t[20]!==dt||t[21]!==h||t[22]!==u||t[23]!==k||t[24]!==A||t[25]!==ut||t[26]!==T||t[27]!==Ft||t[28]!==m||t[29]!==R||t[30]!==r||t[31]!==a||t[32]!==U||t[33]!==g||t[34]!==H||t[35]!==Mt||t[36]!==mt||t[37]!==$||t[38]!==F||t[39]!==G||t[40]!==I||t[41]!==nt||t[42]!==ct||t[43]!==xt||t[44]!==Vt||t[45]!==J||t[46]!==Z||t[47]!==Dt||t[48]!==p||t[49]!==it||t[50]!==x||t[51]!==pt||t[52]!==Q||t[53]!==y||t[54]!==Nt||t[55]!==c||t[56]!==Tt?(_=i.jsxRuntimeExports.jsx(Ds,{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,leftMargin:k,rightMargin:I,topMargin:y,bottomMargin:z,truncateBy:Nt,showLabels:ct,showValues:Vt,backgroundColor:B,suffix:it,prefix:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,tooltip:Q,onSeriesMouseOver:U,relativeHeight:F,refValues:$,graphID:W,maxValue:T,onSeriesMouseClick:a,graphDownload:s,dataDownload:o,language:u,theme:x,labelOrder:h,minHeight:m,maxBarThickness:A,sortParameter:Z,sortData:J,maxNumberOfBars:ut,minBarThickness:Ft,ariaLabel:Ht,resetSelectionOnDoubleClick:G,styles:p,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:r,valueColor:c,classNames:C,filterNA:S,animate:w,precision:Mt,customLayers:vt,showColorScale:nt,timeline:pt,naLabel:R,orientation:g}),t[0]=w,t[1]=Ht,t[2]=B,t[3]=zt,t[4]=et,t[5]=z,t[6]=C,t[7]=st,t[8]=Y,t[9]=qt,t[10]=vt,t[11]=d,t[12]=o,t[13]=bt,t[14]=S,t[15]=j,t[16]=yt,t[17]=s,t[18]=W,t[19]=L,t[20]=dt,t[21]=h,t[22]=u,t[23]=k,t[24]=A,t[25]=ut,t[26]=T,t[27]=Ft,t[28]=m,t[29]=R,t[30]=r,t[31]=a,t[32]=U,t[33]=g,t[34]=H,t[35]=Mt,t[36]=mt,t[37]=$,t[38]=F,t[39]=G,t[40]=I,t[41]=nt,t[42]=ct,t[43]=xt,t[44]=Vt,t[45]=J,t[46]=Z,t[47]=Dt,t[48]=p,t[49]=it,t[50]=x,t[51]=pt,t[52]=Q,t[53]=y,t[54]=Nt,t[55]=c,t[56]=Tt,t[57]=_):_=t[57],_}exports.GroupedBarGraph=Zs;exports.SimpleBarGraph=Qs;exports.StackedBarGraph=_s;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./index-CHPV5EwG-CTPQjnHt.cjs"),q=require("react"),ye=require("./getSliderMarks-BmADcPQt.cjs"),me=require("./parse-hMnG_lRV.cjs"),Ne=require("./index-Cno4Q0YE.cjs"),oe=require("./index-CSNtgibC.cjs"),je=require("./index-DQA8q5sC.cjs"),we=require("./Modal-JW_IExO3.cjs"),ue=require("./numberFormattingFunction-02t-wJta.cjs"),Ae=require("./Tooltip-4dJo4_AF.cjs"),_t=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),$e=require("./string2HTML-CPGr_I5E.cjs"),Te=require("./YAxesLabels-pjdsVwIM.cjs"),Ee=require("./Axis-DxRV2yMi.cjs"),Oe=require("./AxisTitle-sS5bLLR7.cjs"),Se=require("./XTicksAndGridLines-B6CELS7q.cjs"),ke=require("./ReferenceLine-BH0qdf4R.cjs"),De=require("./YTicksAndGridLines-4pxTRlRK.cjs"),ze=require("./XAxesLabels-C1XSXoWG.cjs"),Ce=require("./use-in-view-QcfiW0w3.cjs"),Re=require("./linear-BwPAspcq.cjs"),fe=require("./band-VYfcZeJ2.cjs"),Me=require("./index-DG2bgAva.cjs"),Zt=require("./proxy-BxvUI_9l.cjs"),Be=require("./GraphHeader.cjs"),Fe=require("./GraphFooter.cjs"),Pe=require("./ColorLegendWithMouseOver.cjs"),ce=require("./Colors.cjs"),qe=require("./EmptyState-sAEZ_5rU.cjs"),be=require("./index-DRXx7m-C.cjs"),he=require("./ensureCompleteData-I6nYmT8E.cjs"),Le=require("./uniqBy-O05lp2S5.cjs"),ve=require("./GraphContainer-d8A46BK2.cjs"),He=require("./sort-O96oMZLb.cjs"),Ge=require("./init-DU0ybBc_.cjs"),Ie=require("./getTextColorBasedOnBgColor-nqY-bsM_.cjs");function Xe(e){const t=i.compilerRuntimeExports.c(122),{data:d,leftMargin:L,rightMargin:qt,topMargin:Dt,bottomMargin:yt,barColors:et,barPadding:xt,showTicks:k,truncateBy:I,width:y,height:z,suffix:Nt,prefix:ct,showValues:Vt,showLabels:B,tooltip:it,onSeriesMouseOver:mt,refValues:dt,maxValue:Tt,minValue:j,onSeriesMouseClick:st,selectedColor:Y,rtl:H,labelOrder:Q,maxBarThickness:U,resetSelectionOnDoubleClick:F,detailsOnClick:$,barAxisTitle:W,valueColor:T,noOfTicks:a,styles:s,classNames:o,animate:u,colorDomain:x,precision:h,customLayers:m,naLabel:A}=e,Z=L===void 0?100:L,J=qt===void 0?40:qt,ut=Dt===void 0?25:Dt,Ft=yt===void 0?10:yt,Ht=q.useRef(null);let G;t[0]!==u.amount||t[1]!==u.once?(G={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=G):G=t[2];const bt=Ce.useInView(Ht,G),zt=W?ut+25:ut;let r;t[3]!==Ft||t[4]!==Z||t[5]!==J||t[6]!==zt?(r={top:zt,bottom:Ft,left:Z,right:J},t[3]=Ft,t[4]=Z,t[5]=J,t[6]=zt,t[7]=r):r=t[7];const c=r,[D,p]=q.useState(void 0),[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),pt=y-c.left-c.right,R=z-c.top-c.bottom;let g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft,gt;if(t[8]!==u||t[9]!==W||t[10]!==et||t[11]!==xt||t[12]!==o?.graphObjectValues||t[13]!==o?.xAxis?.gridLines||t[14]!==o?.xAxis?.labels||t[15]!==o?.xAxis?.title||t[16]!==o?.yAxis?.axis||t[17]!==o?.yAxis?.labels||t[18]!==x||t[19]!==m||t[20]!==d||t[21]!==$||t[22]!==R||t[23]!==pt||t[24]!==z||t[25]!==bt||t[26]!==Q||t[27]!==c.bottom||t[28]!==c.left||t[29]!==c.top||t[30]!==U||t[31]!==Tt||t[32]!==j||t[33]!==C||t[34]!==A||t[35]!==a||t[36]!==st||t[37]!==mt||t[38]!==h||t[39]!==ct||t[40]!==dt||t[41]!==F||t[42]!==H||t[43]!==Y||t[44]!==B||t[45]!==k||t[46]!==Vt||t[47]!==s?.graphObjectValues||t[48]!==s?.xAxis?.gridLines||t[49]!==s?.xAxis?.labels||t[50]!==s?.xAxis?.title||t[51]!==s?.yAxis?.axis||t[52]!==s?.yAxis?.labels||t[53]!==Nt||t[54]!==ut||t[55]!==I||t[56]!==T||t[57]!==y){let rt;t[72]!==Q?(rt=(v,O)=>({...v,id:Q?`${v.label}`:`${O}`}),t[72]=Q,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=Q||St.map(_e),E=Re.linear().domain([j,Tt]).range([0,pt]).nice(),Ut=fe.band().domain(Gt).range([0,U?Math.min(R,U*Gt.length):R]).paddingInner(xt),It=fe.band().domain(d[0].size.map(Ze)).range([0,Ut.bandwidth()]).paddingInner(.1),Kt=E.ticks(a);_=Zt.motion.svg,kt=Ht,ot=`${y}px`,Ct=`${z}px`,X=`0 0 ${y} ${z}`,lt="ltr",tt=`translate(${c.left},${c.top})`,K=k?i.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:Kt.filter(Qe),x:Kt.filter(Ke).map(v=>E(v)),y1:0-ut,y2:R+c.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:o?.xAxis?.gridLines,labels:o?.xAxis?.labels},suffix:Nt,prefix:ct,labelType:"secondary",showGridLines:!0,precision:h}):null;const Lt=pt/2,Qt=0-c.top+15,Wt=s?.xAxis?.title,Pt=o?.xAxis?.title;t[74]!==W||t[75]!==Lt||t[76]!==Qt||t[77]!==Wt||t[78]!==Pt?(M=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:Lt,y:Qt,style:Wt,className:Pt,text:W}),t[74]=W,t[75]=Lt,t[76]=Qt,t[77]=Wt,t[78]=Pt,t[79]=M):M=t[79],t[80]!==m?(ht=m.filter(Je).map(We),t[80]=m,t[81]=ht):ht=t[81],g=Me.AnimatePresence,P=St.map(v=>_t.checkIfNullOrUndefined(Ut(v.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{variants:{initial:{x:0,y:Ut(`${v.id}`)},whileInView:{x:0,y:Ut(`${v.id}`),transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[v.size.map((O,n)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",opacity:Y?et[n]===Y?1:.3:.85,onMouseEnter:f=>{p({...v,sizeIndex:n}),nt(f.clientY),Mt(f.clientX),mt?.({...v,sizeIndex:n})},onMouseMove:f=>{p({...v,sizeIndex:n}),nt(f.clientY),Mt(f.clientX)},onMouseLeave:()=>{p(void 0),Mt(void 0),nt(void 0),mt?.(void 0)},onClick:()=>{(st||$)&&(je.isEqual(C,{...v,sizeIndex:n})&&F?(S(void 0),st?.(void 0)):(S({...v,sizeIndex:n}),st&&st({...v,sizeIndex:n})))},children:[_t.checkIfNullOrUndefined(O)?null:i.jsxRuntimeExports.jsx(Zt.motion.rect,{y:It(`${n}`),variants:{initial:{width:0,x:E(0),fill:et[n]},whileInView:{width:_t.checkIfNullOrUndefined(O)?0:O>=0?E(O)-E(0):E(0)-E(O),x:O>=0?E(0):E(O),fill:et[n],transition:{duration:u.duration}}},exit:{width:0,x:E(0),transition:{duration:u.duration}},height:It.bandwidth(),initial:"initial",animate:bt?"whileInView":"initial"}),Vt?i.jsxRuntimeExports.jsx(Zt.motion.text,{y:It(`${n}`)+It.bandwidth()/2,style:{textAnchor:O&&O<0?"end":"start",...s?.graphObjectValues||{}},className:i.mo("graph-value text-sm",o?.graphObjectValues),dx:O&&O<0?-5:5,dy:"0.33em",variants:{initial:{x:E(0),opacity:0,fill:T||et[n]},whileInView:{x:E(O||0),opacity:1,fill:T||et[n],transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:ue.numberFormattingFunction(O,A,h,ct,Nt)}):null]},`${v.label}-${x[n]||n}`)),B?i.jsxRuntimeExports.jsx(Te.YAxesLabels,{value:`${v.label}`.length<I?`${v.label}`:`${`${v.label}`.substring(0,I)}...`,y:0,x:0-c.left,width:E(j<0?0:j)+c.left,height:Ut.bandwidth(),style:s?.yAxis?.labels,className:o?.yAxis?.labels,animate:u,isInView:bt}):null]},v.label));const Ot=o?.yAxis?.axis;let Yt;t[82]!==Ot?(Yt={axis:Ot},t[82]=Ot,t[83]=Yt):Yt=t[83];const Jt=s?.yAxis?.axis;let V;t[84]!==Jt?(V={axis:Jt},t[84]=Jt,t[85]=V):V=t[85],ft=i.jsxRuntimeExports.jsx(Ee.Axis,{x1:E(j<0?0:j),x2:E(j<0?0:j),y1:-2.5,y2:R+c.bottom,classNames:Yt,styles:V}),gt=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((v,O)=>i.jsxRuntimeExports.jsx(ke.RefLineX,{text:v.text,color:v.color,x:E(v.value),y1:0-c.top,y2:R+c.bottom,textSide:E(v.value)>pt*.75||H?"left":"right",classNames:v.classNames,styles:v.styles,animate:u,isInView:bt},O))}):null,t[8]=u,t[9]=W,t[10]=et,t[11]=xt,t[12]=o?.graphObjectValues,t[13]=o?.xAxis?.gridLines,t[14]=o?.xAxis?.labels,t[15]=o?.xAxis?.title,t[16]=o?.yAxis?.axis,t[17]=o?.yAxis?.labels,t[18]=x,t[19]=m,t[20]=d,t[21]=$,t[22]=R,t[23]=pt,t[24]=z,t[25]=bt,t[26]=Q,t[27]=c.bottom,t[28]=c.left,t[29]=c.top,t[30]=U,t[31]=Tt,t[32]=j,t[33]=C,t[34]=A,t[35]=a,t[36]=st,t[37]=mt,t[38]=h,t[39]=ct,t[40]=dt,t[41]=F,t[42]=H,t[43]=Y,t[44]=B,t[45]=k,t[46]=Vt,t[47]=s?.graphObjectValues,t[48]=s?.xAxis?.gridLines,t[49]=s?.xAxis?.labels,t[50]=s?.xAxis?.title,t[51]=s?.yAxis?.axis,t[52]=s?.yAxis?.labels,t[53]=Nt,t[54]=ut,t[55]=I,t[56]=T,t[57]=y,t[58]=g,t[59]=_,t[60]=tt,t[61]=K,t[62]=M,t[63]=ht,t[64]=kt,t[65]=ot,t[66]=Ct,t[67]=X,t[68]=lt,t[69]=P,t[70]=ft,t[71]=gt}else g=t[58],_=t[59],tt=t[60],K=t[61],M=t[62],ht=t[63],kt=t[64],ot=t[65],Ct=t[66],X=t[67],lt=t[68],P=t[69],ft=t[70],gt=t[71];let jt;t[86]!==g||t[87]!==P||t[88]!==ft||t[89]!==gt?(jt=i.jsxRuntimeExports.jsxs(g,{children:[P,ft,gt]}),t[86]=g,t[87]=P,t[88]=ft,t[89]=gt,t[90]=jt):jt=t[90];let wt;t[91]!==m?(wt=m.filter(Ue).map(Ye),t[91]=m,t[92]=wt):wt=t[92];let at;t[93]!==tt||t[94]!==K||t[95]!==M||t[96]!==ht||t[97]!==jt||t[98]!==wt?(at=i.jsxRuntimeExports.jsxs("g",{transform:tt,children:[K,M,ht,jt,wt]}),t[93]=tt,t[94]=K,t[95]=M,t[96]=ht,t[97]=jt,t[98]=wt,t[99]=at):at=t[99];let At;t[100]!==_||t[101]!==kt||t[102]!==ot||t[103]!==Ct||t[104]!==X||t[105]!==lt||t[106]!==at?(At=i.jsxRuntimeExports.jsx(_,{ref:kt,width:ot,height:Ct,viewBox:X,direction:lt,children:at}),t[100]=_,t[101]=kt,t[102]=ot,t[103]=Ct,t[104]=X,t[105]=lt,t[106]=at,t[107]=At):At=t[107];let $t;t[108]!==o?.tooltip||t[109]!==w||t[110]!==vt||t[111]!==D||t[112]!==s?.tooltip||t[113]!==it?($t=D&&it&&w&&vt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:D,body:it,xPos:w,yPos:vt,backgroundStyle:s?.tooltip,className:o?.tooltip}):null,t[108]=o?.tooltip,t[109]=w,t[110]=vt,t[111]=D,t[112]=s?.tooltip,t[113]=it,t[114]=$t):$t=t[114];let Et;t[115]!==$||t[116]!==C?(Et=$&&C!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:C!==void 0,onClose:()=>{S(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:$e.string2HTML($,C)}:void 0,children:typeof $=="function"?$(C):null})}):null,t[115]=$,t[116]=C,t[117]=Et):Et=t[117];let b;return t[118]!==At||t[119]!==$t||t[120]!==Et?(b=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[At,$t,Et]}),t[118]=At,t[119]=$t,t[120]=Et,t[121]=b):b=t[121],b}function Ye(e){return e.layer}function Ue(e){return e.position==="after"}function We(e){return e.layer}function Je(e){return e.position==="before"}function Ke(e){return e!==0}function Qe(e){return e!==0}function Ze(e,t){return`${t}`}function _e(e){return`${e.id}`}function ti(e){const t=i.compilerRuntimeExports.c(130),{data:d,leftMargin:L,rightMargin:qt,topMargin:Dt,bottomMargin:yt,width:et,height:xt,barColors:k,suffix:I,prefix:y,barPadding:z,showLabels:Nt,showValues:ct,showTicks:Vt,truncateBy:B,tooltip:it,onSeriesMouseOver:mt,refValues:dt,maxValue:Tt,minValue:j,onSeriesMouseClick:st,selectedColor:Y,labelOrder:H,maxBarThickness:Q,resetSelectionOnDoubleClick:U,detailsOnClick:F,barAxisTitle:$,valueColor:W,noOfTicks:T,styles:a,classNames:s,animate:o,colorDomain:u,precision:x,customLayers:h,naLabel:m}=e,A=L===void 0?20:L,Z=qt===void 0?20:qt,J=Dt===void 0?20:Dt,ut=yt===void 0?25:yt,Ft=q.useRef(null);let Ht;t[0]!==o.amount||t[1]!==o.once?(Ht={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=Ht):Ht=t[2];const G=Ce.useInView(Ft,Ht),bt=$?A+30:A;let zt;t[3]!==ut||t[4]!==Z||t[5]!==bt||t[6]!==J?(zt={top:J,bottom:ut,left:bt,right:Z},t[3]=ut,t[4]=Z,t[5]=bt,t[6]=J,t[7]=zt):zt=t[7];const r=zt,[c,D]=q.useState(void 0),[p,C]=q.useState(void 0),[S,w]=q.useState(void 0),[Mt,vt]=q.useState(void 0),nt=et-r.left-r.right,pt=xt-r.top-r.bottom;let R,g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft;if(t[8]!==o||t[9]!==$||t[10]!==k||t[11]!==z||t[12]!==s?.graphObjectValues||t[13]!==s?.xAxis?.axis||t[14]!==s?.xAxis?.labels||t[15]!==s?.yAxis?.gridLines||t[16]!==s?.yAxis?.labels||t[17]!==s?.yAxis?.title||t[18]!==u||t[19]!==h||t[20]!==d||t[21]!==F||t[22]!==pt||t[23]!==nt||t[24]!==xt||t[25]!==G||t[26]!==H||t[27]!==A||t[28]!==r.bottom||t[29]!==r.left||t[30]!==r.right||t[31]!==r.top||t[32]!==Q||t[33]!==Tt||t[34]!==j||t[35]!==p||t[36]!==m||t[37]!==T||t[38]!==st||t[39]!==mt||t[40]!==x||t[41]!==y||t[42]!==dt||t[43]!==U||t[44]!==Y||t[45]!==Nt||t[46]!==Vt||t[47]!==ct||t[48]!==a?.graphObjectValues||t[49]!==a?.xAxis?.axis||t[50]!==a?.xAxis?.labels||t[51]!==a?.yAxis?.gridLines||t[52]!==a?.yAxis?.labels||t[53]!==a?.yAxis?.title||t[54]!==I||t[55]!==B||t[56]!==W||t[57]!==et){const b=Re.linear().domain([j,Tt]).range([pt,0]).nice();let rt;t[72]!==H?(rt=(N,Rt)=>({...N,id:H?`${N.label}`:`${Rt}`}),t[72]=H,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=H||St.map(ri),E=fe.band().domain(Gt).range([0,Q?Math.min(nt,Q*Gt.length):nt]).paddingInner(z),Ut=fe.band().domain(d[0].size.map(ai)).range([0,E.bandwidth()]).paddingInner(.1),It=b.ticks(T);g=Zt.motion.svg,ht=`${et}px`,kt=`${xt}px`,ot=`0 0 ${et} ${xt}`,Ct="ltr",X=Ft,ft=`translate(${r.left},${r.top})`;const Kt=b(j<0?0:j),Lt=b(j<0?0:j),Qt=j<0?0:j;let Wt;t[74]!==m||t[75]!==x||t[76]!==y||t[77]!==I||t[78]!==Qt?(Wt=ue.numberFormattingFunction(Qt,m,x,y,I),t[74]=m,t[75]=x,t[76]=y,t[77]=I,t[78]=Qt,t[79]=Wt):Wt=t[79];const Pt=s?.xAxis?.axis,Ot=s?.yAxis?.labels;let Yt;t[80]!==Pt||t[81]!==Ot?(Yt={axis:Pt,label:Ot},t[80]=Pt,t[81]=Ot,t[82]=Yt):Yt=t[82];const Jt=a?.xAxis?.axis,V=a?.yAxis?.labels;let v;t[83]!==Jt||t[84]!==V?(v={axis:Jt,label:V},t[83]=Jt,t[84]=V,t[85]=v):v=t[85],_=i.jsxRuntimeExports.jsx(Ee.Axis,{y1:Kt,y2:Lt,x1:0-A,x2:nt+r.right,label:Wt,labelPos:{x:0-A,dx:0,dy:Tt<0?"1em":-5,y:b(j<0?0:j)},classNames:Yt,styles:v}),tt=Vt?i.jsxRuntimeExports.jsx(De.YTicksAndGridLines,{values:It.filter(li),y:It.filter(oi).map(N=>b(N)),x1:0-A,x2:nt+r.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},suffix:I,prefix:y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:x}):null;const O=0-A-15,n=pt/2,f=a?.yAxis?.title,ee=s?.yAxis?.title;t[86]!==$||t[87]!==O||t[88]!==n||t[89]!==f||t[90]!==ee?(K=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:O,y:n,style:f,className:ee,text:$,rotate90:!0}),t[86]=$,t[87]=O,t[88]=n,t[89]=f,t[90]=ee,t[91]=K):K=t[91],t[92]!==h?(M=h.filter(ni).map(si),t[92]=h,t[93]=M):M=t[93],R=Me.AnimatePresence,lt=St.map(N=>_t.checkIfNullOrUndefined(E(N.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{variants:{initial:{x:E(`${N.id}`),y:0},whileInView:{x:E(`${N.id}`),y:0,transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:[N.size.map((Rt,l)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",opacity:Y?k[l]===Y?1:.3:.85,onMouseEnter:ie=>{D({...N,sizeIndex:l}),vt(ie.clientY),w(ie.clientX),mt?.({...N,sizeIndex:l})},onMouseMove:ie=>{D({...N,sizeIndex:l}),vt(ie.clientY),w(ie.clientX)},onMouseLeave:()=>{D(void 0),w(void 0),vt(void 0),mt?.(void 0)},onClick:()=>{(st||F)&&(je.isEqual(p,{...N,sizeIndex:l})&&U?(C(void 0),st?.(void 0)):(C({...N,sizeIndex:l}),st&&st({...N,sizeIndex:l})))},children:[i.jsxRuntimeExports.jsx(Zt.motion.rect,{x:Ut(`${l}`),width:Ut.bandwidth(),variants:{initial:{height:0,y:b(0),fill:k[l]},whileInView:{height:_t.checkIfNullOrUndefined(Rt)?0:Math.abs(b(Rt)-b(0)),y:_t.checkIfNullOrUndefined(Rt)?b(0):Rt>0?b(Rt):b(0),fill:k[l],transition:{duration:o.duration}}},exit:{height:0,y:b(0),transition:{duration:o.duration}},initial:"initial",animate:G?"whileInView":"initial"}),ct?i.jsxRuntimeExports.jsx(Zt.motion.text,{x:Ut(`${l}`)+Ut.bandwidth()/2,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:i.mo("graph-value text-sm",s?.graphObjectValues),dy:Rt?Rt>=0?"-5px":"1em":"-5px",variants:{initial:{y:b(0),opacity:0,fill:W||k[l]},whileInView:{y:b(Rt||0),opacity:1,fill:W||k[l],transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:ue.numberFormattingFunction(Rt,m,x,y,I)}):null]},`${N.label}-${u[l]||l}`)),Nt?i.jsxRuntimeExports.jsx(ze.XAxesLabels,{value:`${N.label}`.length<B?`${N.label}`:`${`${N.label}`.substring(0,B)}...`,y:b(0)+5,x:0,width:E.bandwidth(),height:r.bottom,style:a?.xAxis?.labels,className:s?.xAxis?.labels,alignment:"top",animate:o,isInView:G}):null]},N.label)),P=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((N,Rt)=>i.jsxRuntimeExports.jsx(ke.RefLineY,{text:N.text,color:N.color,y:b(N.value),x1:0-A,x2:nt+r.right,classNames:N.classNames,styles:N.styles,animate:o,isInView:G},Rt))}):null,t[8]=o,t[9]=$,t[10]=k,t[11]=z,t[12]=s?.graphObjectValues,t[13]=s?.xAxis?.axis,t[14]=s?.xAxis?.labels,t[15]=s?.yAxis?.gridLines,t[16]=s?.yAxis?.labels,t[17]=s?.yAxis?.title,t[18]=u,t[19]=h,t[20]=d,t[21]=F,t[22]=pt,t[23]=nt,t[24]=xt,t[25]=G,t[26]=H,t[27]=A,t[28]=r.bottom,t[29]=r.left,t[30]=r.right,t[31]=r.top,t[32]=Q,t[33]=Tt,t[34]=j,t[35]=p,t[36]=m,t[37]=T,t[38]=st,t[39]=mt,t[40]=x,t[41]=y,t[42]=dt,t[43]=U,t[44]=Y,t[45]=Nt,t[46]=Vt,t[47]=ct,t[48]=a?.graphObjectValues,t[49]=a?.xAxis?.axis,t[50]=a?.xAxis?.labels,t[51]=a?.yAxis?.gridLines,t[52]=a?.yAxis?.labels,t[53]=a?.yAxis?.title,t[54]=I,t[55]=B,t[56]=W,t[57]=et,t[58]=R,t[59]=g,t[60]=_,t[61]=tt,t[62]=K,t[63]=M,t[64]=ht,t[65]=kt,t[66]=ot,t[67]=Ct,t[68]=X,t[69]=lt,t[70]=P,t[71]=ft}else R=t[58],g=t[59],_=t[60],tt=t[61],K=t[62],M=t[63],ht=t[64],kt=t[65],ot=t[66],Ct=t[67],X=t[68],lt=t[69],P=t[70],ft=t[71];let gt;t[94]!==R||t[95]!==lt||t[96]!==P?(gt=i.jsxRuntimeExports.jsxs(R,{children:[lt,P]}),t[94]=R,t[95]=lt,t[96]=P,t[97]=gt):gt=t[97];let jt;t[98]!==h?(jt=h.filter(ii).map(ei),t[98]=h,t[99]=jt):jt=t[99];let wt;t[100]!==_||t[101]!==tt||t[102]!==K||t[103]!==M||t[104]!==gt||t[105]!==jt||t[106]!==ft?(wt=i.jsxRuntimeExports.jsxs("g",{transform:ft,children:[_,tt,K,M,gt,jt]}),t[100]=_,t[101]=tt,t[102]=K,t[103]=M,t[104]=gt,t[105]=jt,t[106]=ft,t[107]=wt):wt=t[107];let at;t[108]!==g||t[109]!==ht||t[110]!==kt||t[111]!==ot||t[112]!==Ct||t[113]!==X||t[114]!==wt?(at=i.jsxRuntimeExports.jsx(g,{width:ht,height:kt,viewBox:ot,direction:Ct,ref:X,children:wt}),t[108]=g,t[109]=ht,t[110]=kt,t[111]=ot,t[112]=Ct,t[113]=X,t[114]=wt,t[115]=at):at=t[115];let At;t[116]!==s?.tooltip||t[117]!==S||t[118]!==Mt||t[119]!==c||t[120]!==a?.tooltip||t[121]!==it?(At=c&&it&&S&&Mt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:c,body:it,xPos:S,yPos:Mt,backgroundStyle:a?.tooltip,className:s?.tooltip}):null,t[116]=s?.tooltip,t[117]=S,t[118]=Mt,t[119]=c,t[120]=a?.tooltip,t[121]=it,t[122]=At):At=t[122];let $t;t[123]!==F||t[124]!==p?($t=F&&p!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:p!==void 0,onClose:()=>{C(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof F=="string"?{__html:$e.string2HTML(F,p)}:void 0,children:typeof F=="function"?F(p):null})}):null,t[123]=F,t[124]=p,t[125]=$t):$t=t[125];let Et;return t[126]!==at||t[127]!==At||t[128]!==$t?(Et=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[at,At,$t]}),t[126]=at,t[127]=At,t[128]=$t,t[129]=Et):Et=t[129],Et}function ei(e){return e.layer}function ii(e){return e.position==="after"}function si(e){return e.layer}function ni(e){return e.position==="before"}function oi(e){return e!==0}function li(e){return e!==0}function ai(e,t){return`${t}`}function ri(e){return`${e.id}`}function ci(e){const t=i.compilerRuntimeExports.c(43),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,suffix:Vt,prefix:B,showValues:it,showColorScale:mt,padding:dt,backgroundColor:Tt,leftMargin:j,rightMargin:st,topMargin:Y,bottomMargin:H,showLabels:Q,relativeHeight:U,tooltip:F,onSeriesMouseOver:$,refValues:W,graphID:T,maxValue:a,minValue:s,onSeriesMouseClick:o,graphDownload:u,dataDownload:x,language:h,labelOrder:m,minHeight:A,theme:Z,maxBarThickness:J,ariaLabel:ut,resetSelectionOnDoubleClick:Ft,detailsOnClick:Ht,barAxisTitle:G,noOfTicks:bt,valueColor:zt,styles:r,classNames:c,filterNA:D,animate:p,precision:C,customLayers:S,timeline:w,naLabel:Mt,sortParameter:vt,sortData:nt,orientation:pt}=e,R=qt===void 0?ce.Colors.light.categoricalColors.colors:qt,g=et===void 0?.25:et,_=xt===void 0?!0:xt,tt=k===void 0?999:k,K=Vt===void 0?"":Vt,M=B===void 0?"":B,ht=it===void 0?!0:it,kt=mt===void 0?!0:mt,ot=Tt===void 0?!1:Tt,Ct=Q===void 0?!0:Q,X=u===void 0?!1:u,lt=x===void 0?!1:x,P=h===void 0?"en":h,ft=A===void 0?0:A,gt=Z===void 0?"light":Z,jt=Ft===void 0?!0:Ft,wt=bt===void 0?5:bt,at=D===void 0?!0:D,At=p===void 0?!1:p,$t=C===void 0?2:C;let Et;t[0]!==S?(Et=S===void 0?[]:S,t[0]=S,t[1]=Et):Et=t[1];const b=Et,rt=w===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:w,St=Mt===void 0?"NA":Mt,E=(pt===void 0?"vertical":pt)==="horizontal"?Xe:ti,[Ut,It]=q.useState(0),[Kt,Lt]=q.useState(0),[Qt,Wt]=q.useState(rt.autoplay),Pt=He.sort(Le.uniqBy(d,"date",!0).map(Xt=>me.parse(`${Xt}`,rt.dateFormat||"yyyy",new Date).getTime()),Ci),[Ot,Yt]=q.useState(rt.autoplay?0:Pt.length-1),[Jt,V]=q.useState(void 0),v=q.useRef(null),O=q.useRef(null);let n,f;t[2]===Symbol.for("react.memo_cache_sentinel")?(n=()=>{const Xt=new ResizeObserver(Bt=>{It(Bt[0].target.clientWidth||620),Lt(Bt[0].target.clientHeight||480)});return v.current&&Xt.observe(v.current),()=>Xt.disconnect()},f=[],t[2]=n,t[3]=f):(n=t[2],f=t[3]),q.useEffect(n,f),q.useEffect(()=>{const Xt=setInterval(()=>{Yt(Bt=>Bt<Pt.length-1?Bt+1:0)},(rt.speed||2)*1e3);return Qt||clearInterval(Xt),()=>clearInterval(Xt)},[Pt,Qt,rt.speed]);const ee=ye.getSliderMarks(Pt,Ot,rt.showOnlyActiveDate,rt.dateFormat||"yyyy"),N=ve.GraphContainer,Rt=c?.graphContainer,l=r?.graphContainer;let ie;t[4]!==c?.description||t[5]!==c?.title||t[6]!==d||t[7]!==lt||t[8]!==yt||t[9]!==X||t[10]!==L||t[11]!==r?.description||t[12]!==r?.title||t[13]!==y?(ie=L||yt||X||lt?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:r?.title,description:r?.description},classNames:{title:c?.title,description:c?.description},graphTitle:L,graphDescription:yt,width:y,graphDownload:X?O:void 0,dataDownload:lt?d.map(ki).filter(Oi).length>0?d.map(Ei).filter($i):d.filter(Ai):null}):null,t[4]=c?.description,t[5]=c?.title,t[6]=d,t[7]=lt,t[8]=yt,t[9]=X,t[10]=L,t[11]=r?.description,t[12]=r?.title,t[13]=y,t[14]=ie):ie=t[14];const se=rt.enabled&&Pt.length>0&&ee?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Wt(!Qt)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Qt?"Click to pause animation":"Click to play animation",children:Qt?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ye.Nr,{min:Pt[0],max:Pt[Pt.length-1],marks:ee,step:null,defaultValue:Pt[Pt.length-1],value:Pt[Ot],onChangeComplete:Xt=>{Yt(Pt.indexOf(Xt))},onChange:Xt=>{Yt(Pt.indexOf(Xt))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,xe="grow flex flex-col justify-center gap-3 w-full",pe=d.length===0?i.jsxRuntimeExports.jsx(qe.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[kt?i.jsxRuntimeExports.jsx(Pe.ColorLegendWithMouseOver,{width:y,colorDomain:Nt,colors:R,colorLegendTitle:ct,setSelectedColor:V,showNAColor:!1,className:c?.colorLegend}):null,i.jsxRuntimeExports.jsx(ve.GraphArea,{ref:v,children:Ut&&Kt?i.jsxRuntimeExports.jsx(E,{data:vt!==void 0?vt==="total"?Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,rt.dateFormat||"yyyy").filter(Xt=>rt.enabled?Xt.date===me.format(new Date(Pt[Ot]),rt.dateFormat||"yyyy"):Xt).filter(Xt=>at?!Xt.size.every(wi):Xt),vi,[nt||"asc"]):Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,rt.dateFormat||"yyyy").filter(Xt=>rt.enabled?Xt.date===me.format(new Date(Pt[Ot]),rt.dateFormat||"yyyy"):Xt).filter(Xt=>at?!Xt.size.every(bi):Xt),Xt=>_t.checkIfNullOrUndefined(Xt.size[vt])?-1/0:Xt.size[vt],[nt||"asc"]):he.ensureCompleteDataForStackedBarChart(d,rt.dateFormat||"yyyy").filter(Xt=>at?!Xt.size.every(yi):Xt),barColors:R,width:Ut,height:Kt,suffix:K,prefix:M,showValues:ht,barPadding:g,showTicks:_,leftMargin:j,rightMargin:st,topMargin:Y,bottomMargin:H,truncateBy:tt,showLabels:Ct,tooltip:F,onSeriesMouseOver:$,refValues:W,maxValue:_t.checkIfNullOrUndefined(a)?Math.max(...d.map(fi))<0?0:Math.max(...d.map(pi)):a,minValue:_t.checkIfNullOrUndefined(s)?Math.min(...d.map(mi))>=0?0:Math.min(...d.map(ui)):s,onSeriesMouseClick:o,selectedColor:Jt,labelOrder:m,rtl:P==="he"||P==="ar",maxBarThickness:J,resetSelectionOnDoubleClick:jt,detailsOnClick:Ht,barAxisTitle:G,noOfTicks:wt,valueColor:zt,styles:r,classNames:c,colorDomain:Nt,animate:At===!0?{duration:.5,once:!0,amount:.5}:At||{duration:0,once:!0,amount:0},precision:$t,customLayers:b,naLabel:St}):null})]});let re;t[15]!==pe?(re=i.jsxRuntimeExports.jsx("div",{className:xe,children:pe}),t[15]=pe,t[16]=re):re=t[16];let ne;t[17]!==c?.footnote||t[18]!==c?.source||t[19]!==z||t[20]!==Dt||t[21]!==r?.footnote||t[22]!==r?.source||t[23]!==y?(ne=Dt||z?i.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:r?.footnote,source:r?.source},classNames:{footnote:c?.footnote,source:c?.source},sources:Dt,footNote:z,width:y}):null,t[17]=c?.footnote,t[18]=c?.source,t[19]=z,t[20]=Dt,t[21]=r?.footnote,t[22]=r?.source,t[23]=y,t[24]=ne):ne=t[24];let le;return t[25]!==N||t[26]!==ut||t[27]!==ot||t[28]!==T||t[29]!==I||t[30]!==P||t[31]!==ft||t[32]!==dt||t[33]!==U||t[34]!==Rt||t[35]!==l||t[36]!==ie||t[37]!==se||t[38]!==re||t[39]!==ne||t[40]!==gt||t[41]!==y?(le=i.jsxRuntimeExports.jsxs(N,{className:Rt,style:l,id:T,ref:O,"aria-label":ut,backgroundColor:ot,theme:gt,language:P,minHeight:ft,width:y,height:I,relativeHeight:U,padding:dt,children:[ie,se,re,ne]}),t[25]=N,t[26]=ut,t[27]=ot,t[28]=T,t[29]=I,t[30]=P,t[31]=ft,t[32]=dt,t[33]=U,t[34]=Rt,t[35]=l,t[36]=ie,t[37]=se,t[38]=re,t[39]=ne,t[40]=gt,t[41]=y,t[42]=le):le=t[42],le}function ui(e){return Math.min(...e.size.filter(xi))}function xi(e){return!_t.checkIfNullOrUndefined(e)}function mi(e){return Math.min(...e.size.filter(di))}function di(e){return!_t.checkIfNullOrUndefined(e)}function pi(e){return Math.max(...e.size.filter(hi))}function hi(e){return!_t.checkIfNullOrUndefined(e)}function fi(e){return Math.max(...e.size.filter(gi))}function gi(e){return!_t.checkIfNullOrUndefined(e)}function yi(e){return e==null}function bi(e){return e==null}function vi(e){return oe.sum(e.size.filter(ji))}function ji(e){return!_t.checkIfNullOrUndefined(e)}function wi(e){return e==null}function Ai(e){return e!==void 0}function $i(e){return e!==void 0}function Ei(e){return e.data}function Oi(e){return e!==void 0}function ki(e){return e.data}function Ci(e,t){return Ge.ascending(e,t)}function Ri(e){const t=i.compilerRuntimeExports.c(125),{data:d,barColor:L,suffix:qt,prefix:Dt,barPadding:yt,showValues:et,showTicks:xt,truncateBy:k,width:I,height:y,colorDomain:z,topMargin:Nt,bottomMargin:ct,leftMargin:Vt,rightMargin:B,showLabels:it,tooltip:mt,onSeriesMouseOver:dt,refValues:Tt,selectedColor:j,highlightedDataPoints:st,maxValue:Y,minValue:H,onSeriesMouseClick:Q,labelOrder:U,rtl:F,maxBarThickness:$,minBarThickness:W,resetSelectionOnDoubleClick:T,detailsOnClick:a,barAxisTitle:s,valueColor:o,noOfTicks:u,styles:x,classNames:h,animate:m,dimmedOpacity:A,precision:Z,customLayers:J,naLabel:ut}=e,Ft=Nt===void 0?25:Nt,Ht=ct===void 0?10:ct,G=Vt===void 0?100:Vt,bt=B===void 0?40:B,zt=q.useRef(null);let r;t[0]!==m.amount||t[1]!==m.once?(r={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=r):r=t[2];const c=Ce.useInView(zt,r),[D,p]=q.useState(void 0),[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),pt=s?Ft+25:Ft;let R;t[3]!==Ht||t[4]!==G||t[5]!==bt||t[6]!==pt?(R={top:pt,bottom:Ht,left:G,right:bt},t[3]=Ht,t[4]=G,t[5]=bt,t[6]=pt,t[7]=R):R=t[7];const g=R,_=I-g.left-g.right,tt=y-g.top-g.bottom;let K,M,ht,kt,ot,Ct,X,lt,P,ft,gt,jt,wt,at;if(t[8]!==m||t[9]!==s||t[10]!==L||t[11]!==yt||t[12]!==h?.graphObjectValues||t[13]!==h?.xAxis?.gridLines||t[14]!==h?.xAxis?.labels||t[15]!==h?.xAxis?.title||t[16]!==h?.yAxis?.axis||t[17]!==h?.yAxis?.labels||t[18]!==z||t[19]!==J||t[20]!==d||t[21]!==a||t[22]!==A||t[23]!==tt||t[24]!==_||t[25]!==y||t[26]!==st||t[27]!==c||t[28]!==U||t[29]!==g.bottom||t[30]!==g.left||t[31]!==g.top||t[32]!==$||t[33]!==Y||t[34]!==W||t[35]!==H||t[36]!==C||t[37]!==ut||t[38]!==u||t[39]!==Q||t[40]!==dt||t[41]!==Z||t[42]!==Dt||t[43]!==Tt||t[44]!==T||t[45]!==F||t[46]!==j||t[47]!==it||t[48]!==xt||t[49]!==et||t[50]!==x?.graphObjectValues||t[51]!==x?.xAxis?.gridLines||t[52]!==x?.xAxis?.labels||t[53]!==x?.xAxis?.title||t[54]!==x?.yAxis?.axis||t[55]!==x?.yAxis?.labels||t[56]!==qt||t[57]!==Ft||t[58]!==k||t[59]!==o||t[60]!==I){let E;t[75]!==U?(E=(n,f)=>({...n,id:U?`${n.label}`:`${f}`}),t[75]=U,t[76]=E):E=t[76];const Ut=d.map(E),It=Re.linear().domain([H,Y]).range([0,_]).nice(),Kt=U||Ut.map(Fi),Lt=fe.band().domain(Kt).range([0,W?Math.max(tt,W*Kt.length):$?Math.min(tt,$*Kt.length):tt]).paddingInner(yt),Qt=It.ticks(u);M=Zt.motion.svg,X=zt,lt=`${I}px`,P=`${y}px`,ft=`0 0 ${I} ${y}`,gt="ltr",ht=`translate(${g.left},${g.top})`,kt=xt?i.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:Qt.filter(Bi),x:Qt.filter(zi).map(n=>It(n)),y1:0-Ft,y2:tt+g.bottom,styles:{gridLines:x?.xAxis?.gridLines,labels:x?.xAxis?.labels},classNames:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},suffix:qt,prefix:Dt,labelType:"secondary",showGridLines:!0,precision:Z}):null;const Wt=_/2,Pt=0-g.top+15,Ot=x?.xAxis?.title,Yt=h?.xAxis?.title;t[77]!==s||t[78]!==Wt||t[79]!==Pt||t[80]!==Ot||t[81]!==Yt?(ot=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:Wt,y:Pt,style:Ot,className:Yt,text:s}),t[77]=s,t[78]=Wt,t[79]=Pt,t[80]=Ot,t[81]=Yt,t[82]=ot):ot=t[82],t[83]!==J?(Ct=J.filter(Di).map(Si),t[83]=J,t[84]=Ct):Ct=t[84],K=Me.AnimatePresence,jt=Ut.map(n=>_t.checkIfNullOrUndefined(Lt(n.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",variants:{initial:{opacity:j?n.color&&L[z.indexOf(n.color)]===j?1:A:st.length!==0?st.indexOf(n.label)!==-1?.85:A:.85},whileInView:{opacity:j?n.color&&L[z.indexOf(n.color)]===j?1:A:st.length!==0?st.indexOf(n.label)!==-1?.85:A:.85,transition:{duration:m.duration}}},initial:"initial",animate:c?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:f=>{p(n),nt(f.clientY),Mt(f.clientX),dt?.(n)},onClick:()=>{(Q||a)&&(je.isEqual(C,n)&&T?(S(void 0),Q?.(void 0)):(S(n),Q?.(n)))},onMouseMove:f=>{p(n),nt(f.clientY),Mt(f.clientX)},onMouseLeave:()=>{p(void 0),Mt(void 0),nt(void 0),dt?.(void 0)},children:[n.size?i.jsxRuntimeExports.jsx(Zt.motion.rect,{variants:{initial:{width:0,x:It(0),y:Lt(`${n.id}`),fill:d.filter(Ti).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray},whileInView:{width:n.size>=0?It(n.size)-It(0):It(0)-It(n.size),x:n.size>=0?It(0):It(n.size),y:Lt(`${n.id}`),fill:d.filter(Ii).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray,transition:{duration:m.duration}}},initial:"initial",animate:c?"whileInView":"initial",exit:{width:0,x:It(0),transition:{duration:m.duration}},height:Lt.bandwidth()}):null,it?i.jsxRuntimeExports.jsx(Te.YAxesLabels,{value:`${n.label}`.length<k?`${n.label}`:`${`${n.label}`.substring(0,k)}...`,y:Lt(n.id)||0,x:(n.size||0)<0?It(0):0-g.left,width:(n.size||0)<0?I-It(0):It(0)+g.left,height:Lt.bandwidth(),alignment:n.size&&n.size<0?"left":"right",style:x?.yAxis?.labels,className:h?.yAxis?.labels,animate:m,isInView:c}):null,et?i.jsxRuntimeExports.jsx(Zt.motion.text,{style:{textAnchor:n.size&&n.size<0?"end":"start",...x?.graphObjectValues||{}},className:i.mo("graph-value text-sm",!o&&L.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",h?.graphObjectValues),dx:n.size&&n.size<0?-5:5,dy:"0.33em",variants:{initial:{x:It(0),y:Lt(`${n.id}`)+Lt.bandwidth()/2,opacity:0,fill:o||(d.filter(Vi).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray)},whileInView:{x:n.size?It(n.size):It(0),opacity:1,y:Lt(`${n.id}`)+Lt.bandwidth()/2,fill:o||(d.filter(Ni).length===0?L[0]:n.color?L[z.indexOf(n.color)]:ce.Colors.gray),transition:{duration:m.duration}}},initial:"initial",animate:c?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:ue.numberFormattingFunction(n.size,ut,Z,Dt,qt)}):null]},n.label));const Jt=h?.yAxis?.axis;let V;t[85]!==Jt?(V={axis:Jt},t[85]=Jt,t[86]=V):V=t[86];const v=x?.yAxis?.axis;let O;t[87]!==v?(O={axis:v},t[87]=v,t[88]=O):O=t[88],wt=i.jsxRuntimeExports.jsx(Ee.Axis,{x1:It(H<0?0:H),x2:It(H<0?0:H),y1:-2.5,y2:tt+g.bottom,classNames:V,styles:O}),at=Tt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Tt.map((n,f)=>i.jsxRuntimeExports.jsx(ke.RefLineX,{text:n.text,color:n.color,x:It(n.value),y1:0-g.top,y2:tt+g.bottom,textSide:It(n.value)>_*.75||F?"left":"right",classNames:n.classNames,styles:n.styles,animate:m,isInView:c},f))}):null,t[8]=m,t[9]=s,t[10]=L,t[11]=yt,t[12]=h?.graphObjectValues,t[13]=h?.xAxis?.gridLines,t[14]=h?.xAxis?.labels,t[15]=h?.xAxis?.title,t[16]=h?.yAxis?.axis,t[17]=h?.yAxis?.labels,t[18]=z,t[19]=J,t[20]=d,t[21]=a,t[22]=A,t[23]=tt,t[24]=_,t[25]=y,t[26]=st,t[27]=c,t[28]=U,t[29]=g.bottom,t[30]=g.left,t[31]=g.top,t[32]=$,t[33]=Y,t[34]=W,t[35]=H,t[36]=C,t[37]=ut,t[38]=u,t[39]=Q,t[40]=dt,t[41]=Z,t[42]=Dt,t[43]=Tt,t[44]=T,t[45]=F,t[46]=j,t[47]=it,t[48]=xt,t[49]=et,t[50]=x?.graphObjectValues,t[51]=x?.xAxis?.gridLines,t[52]=x?.xAxis?.labels,t[53]=x?.xAxis?.title,t[54]=x?.yAxis?.axis,t[55]=x?.yAxis?.labels,t[56]=qt,t[57]=Ft,t[58]=k,t[59]=o,t[60]=I,t[61]=K,t[62]=M,t[63]=ht,t[64]=kt,t[65]=ot,t[66]=Ct,t[67]=X,t[68]=lt,t[69]=P,t[70]=ft,t[71]=gt,t[72]=jt,t[73]=wt,t[74]=at}else K=t[61],M=t[62],ht=t[63],kt=t[64],ot=t[65],Ct=t[66],X=t[67],lt=t[68],P=t[69],ft=t[70],gt=t[71],jt=t[72],wt=t[73],at=t[74];let At;t[89]!==K||t[90]!==jt||t[91]!==wt||t[92]!==at?(At=i.jsxRuntimeExports.jsxs(K,{children:[jt,wt,at]}),t[89]=K,t[90]=jt,t[91]=wt,t[92]=at,t[93]=At):At=t[93];let $t;t[94]!==J?($t=J.filter(Li).map(Mi),t[94]=J,t[95]=$t):$t=t[95];let Et;t[96]!==ht||t[97]!==kt||t[98]!==ot||t[99]!==Ct||t[100]!==At||t[101]!==$t?(Et=i.jsxRuntimeExports.jsxs("g",{transform:ht,children:[kt,ot,Ct,At,$t]}),t[96]=ht,t[97]=kt,t[98]=ot,t[99]=Ct,t[100]=At,t[101]=$t,t[102]=Et):Et=t[102];let b;t[103]!==M||t[104]!==X||t[105]!==lt||t[106]!==P||t[107]!==ft||t[108]!==gt||t[109]!==Et?(b=i.jsxRuntimeExports.jsx(M,{ref:X,width:lt,height:P,viewBox:ft,direction:gt,children:Et}),t[103]=M,t[104]=X,t[105]=lt,t[106]=P,t[107]=ft,t[108]=gt,t[109]=Et,t[110]=b):b=t[110];let rt;t[111]!==h?.tooltip||t[112]!==w||t[113]!==vt||t[114]!==D||t[115]!==x?.tooltip||t[116]!==mt?(rt=D&&mt&&w&&vt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:D,body:mt,xPos:w,yPos:vt,backgroundStyle:x?.tooltip,className:h?.tooltip}):null,t[111]=h?.tooltip,t[112]=w,t[113]=vt,t[114]=D,t[115]=x?.tooltip,t[116]=mt,t[117]=rt):rt=t[117];let St;t[118]!==a||t[119]!==C?(St=a&&C!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:C!==void 0,onClose:()=>{S(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof a=="string"?{__html:$e.string2HTML(a,C)}:void 0,children:typeof a=="function"?a(C):null})}):null,t[118]=a,t[119]=C,t[120]=St):St=t[120];let Gt;return t[121]!==b||t[122]!==rt||t[123]!==St?(Gt=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[b,rt,St]}),t[121]=b,t[122]=rt,t[123]=St,t[124]=Gt):Gt=t[124],Gt}function Mi(e){return e.layer}function Li(e){return e.position==="after"}function Ni(e){return e.color}function Vi(e){return e.color}function Ii(e){return e.color}function Ti(e){return e.color}function Si(e){return e.layer}function Di(e){return e.position==="before"}function zi(e){return e!==0}function Bi(e){return e!==0}function Fi(e){return`${e.id}`}function Pi(e){const t=i.compilerRuntimeExports.c(133),{leftMargin:d,rightMargin:L,topMargin:qt,bottomMargin:Dt,data:yt,width:et,height:xt,barColor:k,suffix:I,prefix:y,barPadding:z,showLabels:Nt,showValues:ct,showTicks:Vt,colorDomain:B,truncateBy:it,tooltip:mt,onSeriesMouseOver:dt,refValues:Tt,selectedColor:j,maxValue:st,minValue:Y,highlightedDataPoints:H,onSeriesMouseClick:Q,labelOrder:U,maxBarThickness:F,minBarThickness:$,resetSelectionOnDoubleClick:W,detailsOnClick:T,barAxisTitle:a,valueColor:s,noOfTicks:o,styles:u,classNames:x,dimmedOpacity:h,animate:m,precision:A,customLayers:Z,naLabel:J}=e,ut=d===void 0?20:d,Ft=L===void 0?20:L,Ht=qt===void 0?20:qt,G=Dt===void 0?25:Dt,bt=q.useRef(null);let zt;t[0]!==m.amount||t[1]!==m.once?(zt={once:m.once,amount:m.amount},t[0]=m.amount,t[1]=m.once,t[2]=zt):zt=t[2];const r=Ce.useInView(bt,zt),c=a?ut+30:ut;let D;t[3]!==G||t[4]!==Ft||t[5]!==c||t[6]!==Ht?(D={top:Ht,bottom:G,left:c,right:Ft},t[3]=G,t[4]=Ft,t[5]=c,t[6]=Ht,t[7]=D):D=t[7];const p=D,[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),[pt,R]=q.useState(void 0),g=et-p.left-p.right,_=xt-p.top-p.bottom;let tt,K,M,ht,kt,ot,Ct,X,lt,P,ft,gt,jt,wt;if(t[8]!==m||t[9]!==a||t[10]!==k||t[11]!==z||t[12]!==x?.graphObjectValues||t[13]!==x?.xAxis?.axis||t[14]!==x?.xAxis?.labels||t[15]!==x?.yAxis?.gridLines||t[16]!==x?.yAxis?.labels||t[17]!==x?.yAxis?.title||t[18]!==B||t[19]!==Z||t[20]!==yt||t[21]!==T||t[22]!==h||t[23]!==_||t[24]!==g||t[25]!==xt||t[26]!==H||t[27]!==r||t[28]!==U||t[29]!==ut||t[30]!==p.bottom||t[31]!==p.left||t[32]!==p.right||t[33]!==p.top||t[34]!==F||t[35]!==st||t[36]!==$||t[37]!==Y||t[38]!==w||t[39]!==J||t[40]!==o||t[41]!==Q||t[42]!==dt||t[43]!==A||t[44]!==y||t[45]!==Tt||t[46]!==W||t[47]!==j||t[48]!==Nt||t[49]!==Vt||t[50]!==ct||t[51]!==u?.graphObjectValues||t[52]!==u?.xAxis?.axis||t[53]!==u?.xAxis?.labels||t[54]!==u?.yAxis?.gridLines||t[55]!==u?.yAxis?.labels||t[56]!==u?.yAxis?.title||t[57]!==I||t[58]!==it||t[59]!==s||t[60]!==et){const Gt=Re.linear().domain([Y,st]).range([_,0]).nice();let E;t[75]!==U?(E=(l,ie)=>({...l,id:U?`${l.label}`:`${ie}`}),t[75]=U,t[76]=E):E=t[76];const Ut=yt.map(E),It=U||Ut.map(Zi),Kt=fe.band().domain(It).range([0,$?Math.max(g,$*It.length):F?Math.min(g,F*It.length):g]).paddingInner(z),Lt=Gt.ticks(o);K=Zt.motion.svg,Ct=bt,X=`${et}px`,lt=`${xt}px`,P=`0 0 ${et} ${xt}`,ft="ltr",wt=`translate(${p.left},${p.top})`;const Qt=Gt(Y<0?0:Y),Wt=Gt(Y<0?0:Y),Pt=Y<0?0:Y;let Ot;t[77]!==J||t[78]!==A||t[79]!==y||t[80]!==I||t[81]!==Pt?(Ot=ue.numberFormattingFunction(Pt,J,A,y,I),t[77]=J,t[78]=A,t[79]=y,t[80]=I,t[81]=Pt,t[82]=Ot):Ot=t[82];const Yt=x?.xAxis?.axis,Jt=x?.yAxis?.labels;let V;t[83]!==Yt||t[84]!==Jt?(V={axis:Yt,label:Jt},t[83]=Yt,t[84]=Jt,t[85]=V):V=t[85];const v=u?.xAxis?.axis,O=u?.yAxis?.labels;let n;t[86]!==v||t[87]!==O?(n={axis:v,label:O},t[86]=v,t[87]=O,t[88]=n):n=t[88],M=i.jsxRuntimeExports.jsx(Ee.Axis,{y1:Qt,y2:Wt,x1:0-ut,x2:g+p.right,label:Ot,labelPos:{x:0-ut,dx:0,dy:st<0?"1em":-5,y:Gt(Y<0?0:Y)},classNames:V,styles:n}),ht=Vt?i.jsxRuntimeExports.jsx(De.YTicksAndGridLines,{values:Lt.filter(Qi),y:Lt.filter(Ki).map(l=>Gt(l)),x1:0-ut,x2:g+p.right,styles:{gridLines:u?.yAxis?.gridLines,labels:u?.yAxis?.labels},classNames:{gridLines:x?.yAxis?.gridLines,labels:x?.yAxis?.labels},suffix:I,prefix:y,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:A}):null;const f=0-ut-15,ee=_/2,N=u?.yAxis?.title,Rt=x?.yAxis?.title;t[89]!==a||t[90]!==f||t[91]!==ee||t[92]!==N||t[93]!==Rt?(kt=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:f,y:ee,style:N,className:Rt,text:a,rotate90:!0}),t[89]=a,t[90]=f,t[91]=ee,t[92]=N,t[93]=Rt,t[94]=kt):kt=t[94],t[95]!==Z?(ot=Z.filter(Ji).map(Wi),t[95]=Z,t[96]=ot):ot=t[96],tt=Me.AnimatePresence,gt=Ut.map((l,ie)=>_t.checkIfNullOrUndefined(Kt(l.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-g-with-hover",initial:"initial",animate:r?"whileInView":"initial",variants:{initial:{opacity:j?l.color&&k[B.indexOf(l.color)]===j?1:h:H.length!==0?H.indexOf(l.label)!==-1?.85:h:.85},whileInView:{opacity:j?l.color&&k[B.indexOf(l.color)]===j?1:h:H.length!==0?H.indexOf(l.label)!==-1?.85:h:.85,transition:{duration:m.duration}}},exit:{opacity:0,transition:{duration:m.duration}},onMouseEnter:se=>{S(l),R(se.clientY),nt(se.clientX),dt?.(l)},onClick:()=>{(Q||T)&&(je.isEqual(w,l)&&W?(Mt(void 0),Q?.(void 0)):(Mt(l),Q?.(l)))},onMouseMove:se=>{S(l),R(se.clientY),nt(se.clientX)},onMouseLeave:()=>{S(void 0),nt(void 0),R(void 0),dt?.(void 0)},children:[l.size?i.jsxRuntimeExports.jsx(Zt.motion.rect,{width:Kt.bandwidth(),initial:"initial",animate:r?"whileInView":"initial",variants:{initial:{height:0,x:Kt(`${l.id}`),y:Gt(0),fill:yt.filter(Ui).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray},whileInView:{height:l.size?Math.abs(Gt(l.size)-Gt(0)):0,y:l.size&&l.size>0?Gt(l.size):Gt(0),x:Kt(`${l.id}`),fill:yt.filter(Yi).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray,transition:{duration:m.duration}}},exit:{height:0,y:Gt(0),transition:{duration:m.duration}}}):null,Nt?i.jsxRuntimeExports.jsx(ze.XAxesLabels,{value:`${l.label}`.length<it?`${l.label}`:`${`${l.label}`.substring(0,it)}...`,y:(l.size||0)<0?0:Gt(0)+5,x:Kt(`${l.id}`),width:Kt.bandwidth(),height:(l.size||0)<0?Gt(0)-5:p.bottom,style:u?.xAxis?.labels,className:x?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:m,isInView:r}):null,ct?i.jsxRuntimeExports.jsx(Zt.motion.text,{style:{textAnchor:"middle",...u?.graphObjectValues||{}},className:i.mo("graph-value text-sm",!s&&k.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",x?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",variants:{initial:{x:Kt(`${l.id}`)+Kt.bandwidth()/2,y:Gt(0),opacity:0,fill:s||(yt.filter(Xi).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray)},whileInView:{x:Kt(`${l.id}`)+Kt.bandwidth()/2,y:Gt(l.size||0),fill:s||(yt.filter(Gi).length===0?k[0]:l.color?k[B.indexOf(l.color)]:ce.Colors.gray),opacity:1,transition:{duration:m.duration}}},initial:"initial",animate:r?"whileInView":"initial",exit:{opacity:0,transition:{duration:m.duration}},children:ue.numberFormattingFunction(l.size,J,A,y,I)}):null]},l.label)),jt=Tt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:Tt.map((l,ie)=>i.jsxRuntimeExports.jsx(ke.RefLineY,{text:l.text,color:l.color,y:Gt(l.value),x1:0-ut,x2:g+p.right,classNames:l.classNames,styles:l.styles,animate:m,isInView:r},ie))}):null,t[8]=m,t[9]=a,t[10]=k,t[11]=z,t[12]=x?.graphObjectValues,t[13]=x?.xAxis?.axis,t[14]=x?.xAxis?.labels,t[15]=x?.yAxis?.gridLines,t[16]=x?.yAxis?.labels,t[17]=x?.yAxis?.title,t[18]=B,t[19]=Z,t[20]=yt,t[21]=T,t[22]=h,t[23]=_,t[24]=g,t[25]=xt,t[26]=H,t[27]=r,t[28]=U,t[29]=ut,t[30]=p.bottom,t[31]=p.left,t[32]=p.right,t[33]=p.top,t[34]=F,t[35]=st,t[36]=$,t[37]=Y,t[38]=w,t[39]=J,t[40]=o,t[41]=Q,t[42]=dt,t[43]=A,t[44]=y,t[45]=Tt,t[46]=W,t[47]=j,t[48]=Nt,t[49]=Vt,t[50]=ct,t[51]=u?.graphObjectValues,t[52]=u?.xAxis?.axis,t[53]=u?.xAxis?.labels,t[54]=u?.yAxis?.gridLines,t[55]=u?.yAxis?.labels,t[56]=u?.yAxis?.title,t[57]=I,t[58]=it,t[59]=s,t[60]=et,t[61]=tt,t[62]=K,t[63]=M,t[64]=ht,t[65]=kt,t[66]=ot,t[67]=Ct,t[68]=X,t[69]=lt,t[70]=P,t[71]=ft,t[72]=gt,t[73]=jt,t[74]=wt}else tt=t[61],K=t[62],M=t[63],ht=t[64],kt=t[65],ot=t[66],Ct=t[67],X=t[68],lt=t[69],P=t[70],ft=t[71],gt=t[72],jt=t[73],wt=t[74];let at;t[97]!==tt||t[98]!==gt||t[99]!==jt?(at=i.jsxRuntimeExports.jsxs(tt,{children:[gt,jt]}),t[97]=tt,t[98]=gt,t[99]=jt,t[100]=at):at=t[100];let At;t[101]!==Z?(At=Z.filter(Hi).map(qi),t[101]=Z,t[102]=At):At=t[102];let $t;t[103]!==M||t[104]!==ht||t[105]!==kt||t[106]!==ot||t[107]!==at||t[108]!==At||t[109]!==wt?($t=i.jsxRuntimeExports.jsxs("g",{transform:wt,children:[M,ht,kt,ot,at,At]}),t[103]=M,t[104]=ht,t[105]=kt,t[106]=ot,t[107]=at,t[108]=At,t[109]=wt,t[110]=$t):$t=t[110];let Et;t[111]!==K||t[112]!==Ct||t[113]!==X||t[114]!==lt||t[115]!==P||t[116]!==ft||t[117]!==$t?(Et=i.jsxRuntimeExports.jsx(K,{ref:Ct,width:X,height:lt,viewBox:P,direction:ft,children:$t}),t[111]=K,t[112]=Ct,t[113]=X,t[114]=lt,t[115]=P,t[116]=ft,t[117]=$t,t[118]=Et):Et=t[118];let b;t[119]!==x?.tooltip||t[120]!==vt||t[121]!==pt||t[122]!==C||t[123]!==u?.tooltip||t[124]!==mt?(b=C&&mt&&vt&&pt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:C,body:mt,xPos:vt,yPos:pt,backgroundStyle:u?.tooltip,className:x?.tooltip}):null,t[119]=x?.tooltip,t[120]=vt,t[121]=pt,t[122]=C,t[123]=u?.tooltip,t[124]=mt,t[125]=b):b=t[125];let rt;t[126]!==T||t[127]!==w?(rt=T&&w!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:w!==void 0,onClose:()=>{Mt(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof T=="string"?{__html:$e.string2HTML(T,w)}:void 0,children:typeof T=="function"?T(w):null})}):null,t[126]=T,t[127]=w,t[128]=rt):rt=t[128];let St;return t[129]!==Et||t[130]!==b||t[131]!==rt?(St=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[Et,b,rt]}),t[129]=Et,t[130]=b,t[131]=rt,t[132]=St):St=t[132],St}function qi(e){return e.layer}function Hi(e){return e.position==="after"}function Gi(e){return e.color}function Xi(e){return e.color}function Yi(e){return e.color}function Ui(e){return e.color}function Wi(e){return e.layer}function Ji(e){return e.position==="before"}function Ki(e){return e!==0}function Qi(e){return e!==0}function Zi(e){return`${e.id}`}function _i(e){const t=i.compilerRuntimeExports.c(43),{data:d,graphTitle:L,colors:qt,suffix:Dt,sources:yt,prefix:et,graphDescription:xt,barPadding:k,showValues:I,showTicks:y,truncateBy:z,height:Nt,width:ct,footNote:Vt,colorDomain:B,colorLegendTitle:it,highlightedDataPoints:mt,padding:dt,backgroundColor:Tt,topMargin:j,bottomMargin:st,leftMargin:Y,rightMargin:H,showLabels:Q,relativeHeight:U,tooltip:F,onSeriesMouseOver:$,refValues:W,showColorScale:T,graphID:a,maxValue:s,minValue:o,onSeriesMouseClick:u,graphDownload:x,dataDownload:h,sortData:m,labelOrder:A,language:Z,showNAColor:J,minHeight:ut,theme:Ft,maxBarThickness:Ht,maxNumberOfBars:G,minBarThickness:bt,ariaLabel:zt,resetSelectionOnDoubleClick:r,detailsOnClick:c,barAxisTitle:D,noOfTicks:p,valueColor:C,styles:S,classNames:w,filterNA:Mt,animate:vt,dimmedOpacity:nt,precision:pt,customLayers:R,timeline:g,naLabel:_,orientation:tt}=e,K=Dt===void 0?"":Dt,M=et===void 0?"":et,ht=k===void 0?.25:k,kt=I===void 0?!0:I,ot=y===void 0?!0:y,Ct=z===void 0?999:z;let X;t[0]!==mt?(X=mt===void 0?[]:mt,t[0]=mt,t[1]=X):X=t[1];const lt=X,P=Tt===void 0?!1:Tt,ft=Q===void 0?!0:Q,gt=T===void 0?!0:T,jt=x===void 0?!1:x,wt=h===void 0?!1:h,at=Z===void 0?"en":Z,At=J===void 0?!0:J,$t=ut===void 0?0:ut,Et=Ft===void 0?"light":Ft,b=r===void 0?!0:r,rt=p===void 0?5:p,St=Mt===void 0?!0:Mt,Gt=vt===void 0?!1:vt,E=nt===void 0?.3:nt,Ut=pt===void 0?2:pt;let It;t[2]!==R?(It=R===void 0?[]:R,t[2]=R,t[3]=It):It=t[3];const Kt=It,Lt=g===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:g,Qt=_===void 0?"NA":_,Wt=tt===void 0?"vertical":tt,Pt=Wt==="horizontal"?Ri:Pi,[Ot,Yt]=q.useState(0),[Jt,V]=q.useState(0),[v,O]=q.useState(Lt.autoplay),n=He.sort(Le.uniqBy(d,"date",!0).map(te=>me.parse(`${te}`,Lt.dateFormat||"yyyy",new Date).getTime()),fs),[f,ee]=q.useState(Lt.autoplay?0:n.length-1),[N,Rt]=q.useState(void 0),l=q.useRef(null),ie=q.useRef(null);let se,xe;t[4]===Symbol.for("react.memo_cache_sentinel")?(se=()=>{const te=new ResizeObserver(de=>{Yt(de[0].target.clientWidth||620),V(de[0].target.clientHeight||480)});return l.current&&te.observe(l.current),()=>te.disconnect()},xe=[],t[4]=se,t[5]=xe):(se=t[4],xe=t[5]),q.useEffect(se,xe),q.useEffect(()=>{const te=setInterval(()=>{ee(de=>de<n.length-1?de+1:0)},(Lt.speed||2)*1e3);return v||clearInterval(te),()=>clearInterval(te)},[n,v,Lt.speed]);const pe=ye.getSliderMarks(n,f,Lt.showOnlyActiveDate,Lt.dateFormat||"yyyy"),re=ve.GraphContainer,ne=w?.graphContainer,le=S?.graphContainer;let Xt;t[6]!==w?.description||t[7]!==w?.title||t[8]!==d||t[9]!==wt||t[10]!==xt||t[11]!==jt||t[12]!==L||t[13]!==S?.description||t[14]!==S?.title||t[15]!==ct?(Xt=L||xt||jt||wt?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:S?.title,description:S?.description},classNames:{title:w?.title,description:w?.description},graphTitle:L,graphDescription:xt,width:ct,graphDownload:jt?ie:void 0,dataDownload:wt?d.map(hs).filter(ps).length>0?d.map(ds).filter(ms):d.filter(xs):null}):null,t[6]=w?.description,t[7]=w?.title,t[8]=d,t[9]=wt,t[10]=xt,t[11]=jt,t[12]=L,t[13]=S?.description,t[14]=S?.title,t[15]=ct,t[16]=Xt):Xt=t[16];const Bt=Lt.enabled&&n.length>0&&pe?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center pb-4",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{O(!v)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":v?"Click to pause animation":"Click to play animation",children:v?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ye.Nr,{min:n[0],max:n[n.length-1],marks:pe,step:null,defaultValue:n[n.length-1],value:n[f],onChangeComplete:te=>{ee(n.indexOf(te))},onChange:te=>{ee(n.indexOf(te))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,ae=d.length===0?i.jsxRuntimeExports.jsx(qe.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[gt&&d.filter(us).length!==0?i.jsxRuntimeExports.jsx(Pe.ColorLegendWithMouseOver,{width:ct,colorLegendTitle:it,colors:qt||ce.Colors[Et].categoricalColors.colors,colorDomain:B||Le.uniqBy(d,"color",!0),setSelectedColor:Rt,showNAColor:At,className:w?.colorLegend}):null,i.jsxRuntimeExports.jsx(ve.GraphArea,{ref:l,children:Ot&&Jt?i.jsxRuntimeExports.jsx(Pt,{data:m?Ne.orderBy(he.ensureCompleteDataForBarChart(d,Lt.dateFormat||"yyyy").filter(te=>Lt.enabled?te.date===me.format(new Date(n[f]),Lt.dateFormat||"yyyy"):te).filter(te=>St?!_t.checkIfNullOrUndefined(te.size):te),[te=>te.size===void 0?m==="asc"?(Wt==="horizontal"?1:-1)*(1/0):(Wt==="horizontal"?-1:1)*(1/0):te.size],[m]).filter((te,de)=>G?de<G:!0):he.ensureCompleteDataForBarChart(d,Lt.dateFormat||"yyyy").filter(te=>Lt.enabled?te.date===me.format(new Date(n[f]),Lt.dateFormat||"yyyy"):te).filter(te=>St?!_t.checkIfNullOrUndefined(te.size):te).filter((te,de)=>G?de<G:!0),barColor:d.filter(cs).length===0?qt?[qt]:[ce.Colors.primaryColors["blue-600"]]:qt||ce.Colors[Et].categoricalColors.colors,colorDomain:d.filter(rs).length===0?[]:B||Le.uniqBy(d,"color",!0),selectedColor:N,width:Ot,height:Jt,suffix:K,prefix:M,barPadding:ht,showValues:kt,showTicks:ot,leftMargin:Y,rightMargin:H,topMargin:j,bottomMargin:st,truncateBy:Ct,showLabels:ft,tooltip:F,onSeriesMouseOver:$,refValues:W,maxValue:_t.checkIfNullOrUndefined(s)?Math.max(...d.filter(as).map(ls))<0?0:Math.max(...d.filter(os).map(ns)):s,minValue:_t.checkIfNullOrUndefined(o)?Math.min(...d.filter(ss).map(is))>=0?0:Math.min(...d.filter(es).map(ts)):o,highlightedDataPoints:lt,onSeriesMouseClick:u,labelOrder:A,rtl:at==="he"||at==="ar",maxBarThickness:Ht,minBarThickness:bt,resetSelectionOnDoubleClick:b,detailsOnClick:c,barAxisTitle:D,noOfTicks:rt,valueColor:C,classNames:w,styles:S,animate:Gt===!0?{duration:.5,once:!0,amount:.5}:Gt||{duration:0,once:!0,amount:0},dimmedOpacity:E,precision:Ut,customLayers:Kt,naLabel:Qt}):null})]});let ge;t[17]!==w?.footnote||t[18]!==w?.source||t[19]!==Vt||t[20]!==yt||t[21]!==S?.footnote||t[22]!==S?.source||t[23]!==ct?(ge=yt||Vt?i.jsxRuntimeExports.jsx(Fe.GraphFooter,{sources:yt,footNote:Vt,width:ct,styles:{footnote:S?.footnote,source:S?.source},classNames:{footnote:w?.footnote,source:w?.source}}):null,t[17]=w?.footnote,t[18]=w?.source,t[19]=Vt,t[20]=yt,t[21]=S?.footnote,t[22]=S?.source,t[23]=ct,t[24]=ge):ge=t[24];let Ve;return t[25]!==re||t[26]!==zt||t[27]!==P||t[28]!==a||t[29]!==Nt||t[30]!==at||t[31]!==$t||t[32]!==dt||t[33]!==U||t[34]!==ne||t[35]!==le||t[36]!==Xt||t[37]!==Bt||t[38]!==ae||t[39]!==ge||t[40]!==Et||t[41]!==ct?(Ve=i.jsxRuntimeExports.jsxs(re,{className:ne,style:le,id:a,ref:ie,"aria-label":zt,backgroundColor:P,theme:Et,language:at,minHeight:$t,width:ct,height:Nt,relativeHeight:U,padding:dt,children:[Xt,Bt,ae,ge]}),t[25]=re,t[26]=zt,t[27]=P,t[28]=a,t[29]=Nt,t[30]=at,t[31]=$t,t[32]=dt,t[33]=U,t[34]=ne,t[35]=le,t[36]=Xt,t[37]=Bt,t[38]=ae,t[39]=ge,t[40]=Et,t[41]=ct,t[42]=Ve):Ve=t[42],Ve}function ts(e){return e.size}function es(e){return!_t.checkIfNullOrUndefined(e.size)}function is(e){return e.size}function ss(e){return!_t.checkIfNullOrUndefined(e.size)}function ns(e){return e.size}function os(e){return!_t.checkIfNullOrUndefined(e.size)}function ls(e){return e.size}function as(e){return!_t.checkIfNullOrUndefined(e.size)}function rs(e){return e.color}function cs(e){return e.color}function us(e){return e.color}function xs(e){return e!==void 0}function ms(e){return e!==void 0}function ds(e){return e.data}function ps(e){return e!==void 0}function hs(e){return e.data}function fs(e,t){return Ge.ascending(e,t)}function gs(e){const t=i.compilerRuntimeExports.c(122),{data:d,barColors:L,barPadding:qt,showTicks:Dt,topMargin:yt,bottomMargin:et,leftMargin:xt,rightMargin:k,truncateBy:I,width:y,height:z,tooltip:Nt,onSeriesMouseOver:ct,showLabels:Vt,suffix:B,prefix:it,showValues:mt,refValues:dt,maxValue:Tt,onSeriesMouseClick:j,selectedColor:st,rtl:Y,labelOrder:H,maxBarThickness:Q,minBarThickness:U,resetSelectionOnDoubleClick:F,detailsOnClick:$,barAxisTitle:W,valueColor:T,noOfTicks:a,styles:s,classNames:o,animate:u,colorDomain:x,precision:h,customLayers:m,naLabel:A}=e,Z=yt===void 0?25:yt,J=et===void 0?10:et,ut=xt===void 0?100:xt,Ft=k===void 0?40:k,Ht=q.useRef(null);let G;t[0]!==u.amount||t[1]!==u.once?(G={once:u.once,amount:u.amount},t[0]=u.amount,t[1]=u.once,t[2]=G):G=t[2];const bt=Ce.useInView(Ht,G),zt=W?Z+25:Z;let r;t[3]!==J||t[4]!==ut||t[5]!==Ft||t[6]!==zt?(r={top:zt,bottom:J,left:ut,right:Ft},t[3]=J,t[4]=ut,t[5]=Ft,t[6]=zt,t[7]=r):r=t[7];const c=r,[D,p]=q.useState(void 0),[C,S]=q.useState(void 0),[w,Mt]=q.useState(void 0),[vt,nt]=q.useState(void 0),pt=y-c.left-c.right,R=z-c.top-c.bottom;let g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft,gt;if(t[8]!==u||t[9]!==W||t[10]!==L||t[11]!==qt||t[12]!==o?.graphObjectValues||t[13]!==o?.xAxis?.gridLines||t[14]!==o?.xAxis?.labels||t[15]!==o?.xAxis?.title||t[16]!==o?.yAxis?.axis||t[17]!==o?.yAxis?.labels||t[18]!==x||t[19]!==m||t[20]!==d||t[21]!==$||t[22]!==R||t[23]!==pt||t[24]!==z||t[25]!==bt||t[26]!==H||t[27]!==c.bottom||t[28]!==c.left||t[29]!==c.top||t[30]!==Q||t[31]!==Tt||t[32]!==U||t[33]!==C||t[34]!==A||t[35]!==a||t[36]!==j||t[37]!==ct||t[38]!==h||t[39]!==it||t[40]!==dt||t[41]!==F||t[42]!==Y||t[43]!==st||t[44]!==Vt||t[45]!==Dt||t[46]!==mt||t[47]!==s?.graphObjectValues||t[48]!==s?.xAxis?.gridLines||t[49]!==s?.xAxis?.labels||t[50]!==s?.xAxis?.title||t[51]!==s?.yAxis?.axis||t[52]!==s?.yAxis?.labels||t[53]!==B||t[54]!==Z||t[55]!==I||t[56]!==T||t[57]!==y){let rt;t[72]!==H?(rt=(V,v)=>({...V,id:H?`${V.label}`:`${v}`}),t[72]=H,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=H||St.map(Os),E=Re.linear().domain([0,Tt]).range([0,pt]).nice(),Ut=fe.band().domain(Gt).range([0,U?Math.max(R,U*Gt.length):Q?Math.min(R,Q*Gt.length):R]).paddingInner(qt),It=E.ticks(a);_=Zt.motion.svg,kt=Ht,ot=`${y}px`,Ct=`${z}px`,X=`0 0 ${y} ${z}`,lt="ltr",tt=`translate(${c.left},${c.top})`,K=Dt?i.jsxRuntimeExports.jsx(Se.XTicksAndGridLines,{values:It.filter(Es),x:It.filter($s).map(V=>E(V)),y1:0-Z,y2:R+c.bottom,styles:{gridLines:s?.xAxis?.gridLines,labels:s?.xAxis?.labels},classNames:{gridLines:o?.xAxis?.gridLines,labels:o?.xAxis?.labels},suffix:B,prefix:it,labelType:"secondary",showGridLines:!0,precision:h}):null;const Kt=pt/2,Lt=0-c.top+15,Qt=s?.xAxis?.title,Wt=o?.xAxis?.title;t[74]!==W||t[75]!==Kt||t[76]!==Lt||t[77]!==Qt||t[78]!==Wt?(M=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:Kt,y:Lt,style:Qt,className:Wt,text:W}),t[74]=W,t[75]=Kt,t[76]=Lt,t[77]=Qt,t[78]=Wt,t[79]=M):M=t[79],t[80]!==m?(ht=m.filter(As).map(ws),t[80]=m,t[81]=ht):ht=t[81],g=Me.AnimatePresence,P=St.map(V=>_t.checkIfNullOrUndefined(Ut(V.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:0,y:Ut(`${V.id}`)},whileInView:{x:0,y:Ut(`${V.id}`),transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",exit:{opacity:0,transition:{duration:u.duration}},children:[V.size.map((v,O)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{opacity:st?L[O]===st?1:.3:1,onMouseEnter:n=>{p({...V,sizeIndex:O}),nt(n.clientY),Mt(n.clientX),ct?.({...V,sizeIndex:O})},onMouseMove:n=>{p({...V,sizeIndex:O}),nt(n.clientY),Mt(n.clientX)},onMouseLeave:()=>{p(void 0),Mt(void 0),nt(void 0),ct?.(void 0)},onClick:()=>{(j||$)&&(je.isEqual(C,{...V,sizeIndex:O})&&F?(S(void 0),j?.(void 0)):(S({...V,sizeIndex:O}),j&&j({...V,sizeIndex:O})))},children:[v?i.jsxRuntimeExports.jsx(Zt.motion.rect,{y:0,style:{fill:L[O]},height:Ut.bandwidth(),exit:{width:0,x:E(0),transition:{duration:u.duration}},variants:{initial:{width:0,x:E(0),fill:L[O]},whileInView:{width:E(v||0),x:E(O===0?0:oe.sum(V.size.filter((n,f)=>f<O&&n))),fill:L[O],transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial"},O):null,mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{y:Ut.bandwidth()/2,style:{textAnchor:"middle",...s?.graphObjectValues||{}},dy:"0.33em",className:i.mo("graph-value text-sm",o?.graphObjectValues),exit:{opacity:0,transition:{duration:u.duration}},variants:{initial:{x:E(0),opacity:0,fill:Ie.getTextColorBasedOnBgColor(L[O])},whileInView:{x:E(O===0?0:oe.sum(V.size.filter((n,f)=>f<O&&n)))+E(v||0)/2,opacity:v&&E(v)/ue.numberFormattingFunction(v,A,h,it,B).length>12?1:0,fill:Ie.getTextColorBasedOnBgColor(L[O]),transition:{duration:u.duration}}},initial:"initial",animate:bt?"whileInView":"initial",children:ue.numberFormattingFunction(v,A,h,it,B)}):null]},`${V.label}-${x[O]||O}`)),Vt?i.jsxRuntimeExports.jsx(Te.YAxesLabels,{value:`${V.label}`.length<I?`${V.label}`:`${`${V.label}`.substring(0,I)}...`,y:0,x:0-c.left,width:0+c.left,height:Ut.bandwidth(),style:s?.yAxis?.labels,className:o?.yAxis?.labels,animate:u,isInView:bt}):null,mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{className:i.mo("graph-value graph-value-total text-sm",T?"":" fill-primary-gray-700 dark:fill-primary-gray-300",o?.graphObjectValues),style:{...T?{fill:T}:{},textAnchor:"start",...s?.graphObjectValues||{}},y:Ut.bandwidth()/2,dx:5,dy:"0.33em",variants:{initial:{x:E(0),opacity:0,...T?{fill:T}:{}},whileInView:{x:E(oe.sum(V.size.map(js))),opacity:1,...T?{fill:T}:{},transition:{duration:u.duration}}},exit:{opacity:0,transition:{duration:u.duration}},initial:"initial",animate:bt?"whileInView":"initial",children:ue.numberFormattingFunction(oe.sum(V.size.filter(vs)),A,h,it,B)}):null]},V.label));const Pt=o?.yAxis?.axis;let Ot;t[82]!==Pt?(Ot={axis:Pt},t[82]=Pt,t[83]=Ot):Ot=t[83];const Yt=s?.yAxis?.axis;let Jt;t[84]!==Yt?(Jt={axis:Yt},t[84]=Yt,t[85]=Jt):Jt=t[85],ft=i.jsxRuntimeExports.jsx(Ee.Axis,{x1:E(0),x2:E(0),y1:-2.5,y2:R+c.bottom,classNames:Ot,styles:Jt}),gt=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((V,v)=>i.jsxRuntimeExports.jsx(ke.RefLineX,{text:V.text,color:V.color,x:E(V.value),y1:0-c.top,y2:R+c.bottom,textSide:E(V.value)>pt*.75||Y?"left":"right",classNames:V.classNames,styles:V.styles,animate:u,isInView:bt},v))}):null,t[8]=u,t[9]=W,t[10]=L,t[11]=qt,t[12]=o?.graphObjectValues,t[13]=o?.xAxis?.gridLines,t[14]=o?.xAxis?.labels,t[15]=o?.xAxis?.title,t[16]=o?.yAxis?.axis,t[17]=o?.yAxis?.labels,t[18]=x,t[19]=m,t[20]=d,t[21]=$,t[22]=R,t[23]=pt,t[24]=z,t[25]=bt,t[26]=H,t[27]=c.bottom,t[28]=c.left,t[29]=c.top,t[30]=Q,t[31]=Tt,t[32]=U,t[33]=C,t[34]=A,t[35]=a,t[36]=j,t[37]=ct,t[38]=h,t[39]=it,t[40]=dt,t[41]=F,t[42]=Y,t[43]=st,t[44]=Vt,t[45]=Dt,t[46]=mt,t[47]=s?.graphObjectValues,t[48]=s?.xAxis?.gridLines,t[49]=s?.xAxis?.labels,t[50]=s?.xAxis?.title,t[51]=s?.yAxis?.axis,t[52]=s?.yAxis?.labels,t[53]=B,t[54]=Z,t[55]=I,t[56]=T,t[57]=y,t[58]=g,t[59]=_,t[60]=tt,t[61]=K,t[62]=M,t[63]=ht,t[64]=kt,t[65]=ot,t[66]=Ct,t[67]=X,t[68]=lt,t[69]=P,t[70]=ft,t[71]=gt}else g=t[58],_=t[59],tt=t[60],K=t[61],M=t[62],ht=t[63],kt=t[64],ot=t[65],Ct=t[66],X=t[67],lt=t[68],P=t[69],ft=t[70],gt=t[71];let jt;t[86]!==g||t[87]!==P||t[88]!==ft||t[89]!==gt?(jt=i.jsxRuntimeExports.jsxs(g,{children:[P,ft,gt]}),t[86]=g,t[87]=P,t[88]=ft,t[89]=gt,t[90]=jt):jt=t[90];let wt;t[91]!==m?(wt=m.filter(bs).map(ys),t[91]=m,t[92]=wt):wt=t[92];let at;t[93]!==tt||t[94]!==K||t[95]!==M||t[96]!==ht||t[97]!==jt||t[98]!==wt?(at=i.jsxRuntimeExports.jsxs("g",{transform:tt,children:[K,M,ht,jt,wt]}),t[93]=tt,t[94]=K,t[95]=M,t[96]=ht,t[97]=jt,t[98]=wt,t[99]=at):at=t[99];let At;t[100]!==_||t[101]!==kt||t[102]!==ot||t[103]!==Ct||t[104]!==X||t[105]!==lt||t[106]!==at?(At=i.jsxRuntimeExports.jsx(_,{ref:kt,width:ot,height:Ct,viewBox:X,direction:lt,children:at}),t[100]=_,t[101]=kt,t[102]=ot,t[103]=Ct,t[104]=X,t[105]=lt,t[106]=at,t[107]=At):At=t[107];let $t;t[108]!==o?.tooltip||t[109]!==w||t[110]!==vt||t[111]!==D||t[112]!==s?.tooltip||t[113]!==Nt?($t=D&&Nt&&w&&vt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:D,body:Nt,xPos:w,yPos:vt,backgroundStyle:s?.tooltip,className:o?.tooltip}):null,t[108]=o?.tooltip,t[109]=w,t[110]=vt,t[111]=D,t[112]=s?.tooltip,t[113]=Nt,t[114]=$t):$t=t[114];let Et;t[115]!==$||t[116]!==C?(Et=$&&C!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:C!==void 0,onClose:()=>{S(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof $=="string"?{__html:$e.string2HTML($,C)}:void 0,children:typeof $=="function"?$(C):null})}):null,t[115]=$,t[116]=C,t[117]=Et):Et=t[117];let b;return t[118]!==At||t[119]!==$t||t[120]!==Et?(b=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[At,$t,Et]}),t[118]=At,t[119]=$t,t[120]=Et,t[121]=b):b=t[121],b}function ys(e){return e.layer}function bs(e){return e.position==="after"}function vs(e){return e}function js(e){return e||0}function ws(e){return e.layer}function As(e){return e.position==="before"}function $s(e){return e!==0}function Es(e){return e!==0}function Os(e){return`${e.id}`}function ks(e){const t=i.compilerRuntimeExports.c(129),{data:d,leftMargin:L,rightMargin:qt,topMargin:Dt,bottomMargin:yt,width:et,height:xt,barColors:k,barPadding:I,showLabels:y,showTicks:z,truncateBy:Nt,tooltip:ct,onSeriesMouseOver:Vt,suffix:B,prefix:it,showValues:mt,refValues:dt,maxValue:Tt,onSeriesMouseClick:j,selectedColor:st,labelOrder:Y,maxBarThickness:H,minBarThickness:Q,resetSelectionOnDoubleClick:U,detailsOnClick:F,barAxisTitle:$,valueColor:W,noOfTicks:T,styles:a,classNames:s,animate:o,colorDomain:u,precision:x,customLayers:h,naLabel:m}=e,A=L===void 0?20:L,Z=qt===void 0?20:qt,J=Dt===void 0?20:Dt,ut=yt===void 0?25:yt,Ft=q.useRef(null);let Ht;t[0]!==o.amount||t[1]!==o.once?(Ht={once:o.once,amount:o.amount},t[0]=o.amount,t[1]=o.once,t[2]=Ht):Ht=t[2];const G=Ce.useInView(Ft,Ht),bt=$?A+30:A;let zt;t[3]!==ut||t[4]!==Z||t[5]!==bt||t[6]!==J?(zt={top:J,bottom:ut,left:bt,right:Z},t[3]=ut,t[4]=Z,t[5]=bt,t[6]=J,t[7]=zt):zt=t[7];const r=zt,[c,D]=q.useState(void 0),[p,C]=q.useState(void 0),[S,w]=q.useState(void 0),[Mt,vt]=q.useState(void 0),nt=et-r.left-r.right,pt=xt-r.top-r.bottom;let R,g,_,tt,K,M,ht,kt,ot,Ct,X,lt,P,ft;if(t[8]!==o||t[9]!==$||t[10]!==k||t[11]!==I||t[12]!==s?.graphObjectValues||t[13]!==s?.xAxis?.axis||t[14]!==s?.xAxis?.labels||t[15]!==s?.yAxis?.gridLines||t[16]!==s?.yAxis?.labels||t[17]!==s?.yAxis?.title||t[18]!==u||t[19]!==h||t[20]!==d||t[21]!==F||t[22]!==pt||t[23]!==nt||t[24]!==xt||t[25]!==G||t[26]!==Y||t[27]!==A||t[28]!==r.bottom||t[29]!==r.left||t[30]!==r.right||t[31]!==r.top||t[32]!==H||t[33]!==Tt||t[34]!==Q||t[35]!==p||t[36]!==m||t[37]!==T||t[38]!==j||t[39]!==Vt||t[40]!==x||t[41]!==it||t[42]!==dt||t[43]!==U||t[44]!==st||t[45]!==y||t[46]!==z||t[47]!==mt||t[48]!==a?.graphObjectValues||t[49]!==a?.xAxis?.axis||t[50]!==a?.xAxis?.labels||t[51]!==a?.yAxis?.gridLines||t[52]!==a?.yAxis?.labels||t[53]!==a?.yAxis?.title||t[54]!==B||t[55]!==Nt||t[56]!==W||t[57]!==et){const b=Re.linear().domain([0,Tt]).range([pt,0]).nice();let rt;t[72]!==Y?(rt=(f,ee)=>({...f,id:Y?`${f.label}`:`${ee}`}),t[72]=Y,t[73]=rt):rt=t[73];const St=d.map(rt),Gt=Y||St.map(Ss),E=fe.band().domain(Gt).range([0,Q?Math.max(nt,Q*Gt.length):H?Math.min(nt,H*Gt.length):nt]).paddingInner(I),Ut=b.ticks(T);g=Zt.motion.svg,ht=`${et}px`,kt=`${xt}px`,ot=`0 0 ${et} ${xt}`,Ct="ltr",X=Ft,ft=`translate(${r.left},${r.top})`;const It=b(0),Kt=b(0);let Lt;t[74]!==m||t[75]!==x||t[76]!==it||t[77]!==B?(Lt=ue.numberFormattingFunction(0,m,x,it,B),t[74]=m,t[75]=x,t[76]=it,t[77]=B,t[78]=Lt):Lt=t[78];const Qt=s?.xAxis?.axis,Wt=s?.yAxis?.labels;let Pt;t[79]!==Qt||t[80]!==Wt?(Pt={axis:Qt,label:Wt},t[79]=Qt,t[80]=Wt,t[81]=Pt):Pt=t[81];const Ot=a?.xAxis?.axis,Yt=a?.yAxis?.labels;let Jt;t[82]!==Ot||t[83]!==Yt?(Jt={axis:Ot,label:Yt},t[82]=Ot,t[83]=Yt,t[84]=Jt):Jt=t[84],_=i.jsxRuntimeExports.jsx(Ee.Axis,{y1:It,y2:Kt,x1:0-A,x2:nt+r.right,label:Lt,labelPos:{x:0-A,y:b(0),dx:0,dy:-5},classNames:Pt,styles:Jt}),tt=z?i.jsxRuntimeExports.jsx(De.YTicksAndGridLines,{values:Ut.filter(Ts),y:Ut.filter(Is).map(f=>b(f)),x1:0-A,x2:nt+r.right,styles:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},classNames:{gridLines:s?.yAxis?.gridLines,labels:s?.yAxis?.labels},suffix:B,prefix:it,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:x}):null;const V=0-A-15,v=pt/2,O=a?.yAxis?.title,n=s?.yAxis?.title;t[85]!==$||t[86]!==V||t[87]!==v||t[88]!==O||t[89]!==n?(K=i.jsxRuntimeExports.jsx(Oe.AxisTitle,{x:V,y:v,style:O,className:n,text:$,rotate90:!0}),t[85]=$,t[86]=V,t[87]=v,t[88]=O,t[89]=n,t[90]=K):K=t[90],t[91]!==h?(M=h.filter(Vs).map(Ns),t[91]=h,t[92]=M):M=t[92],R=Me.AnimatePresence,lt=St.map(f=>_t.checkIfNullOrUndefined(E(f.id))?null:i.jsxRuntimeExports.jsxs(Zt.motion.g,{className:"undp-viz-low-opacity undp-viz-g-with-hover",variants:{initial:{x:E(`${f.id}`),y:0},whileInView:{x:E(`${f.id}`),y:0,transition:{duration:o.duration}}},transition:{duration:o.duration},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:[f.size.map((ee,N)=>i.jsxRuntimeExports.jsxs(Zt.motion.g,{opacity:st?k[N]===st?1:.3:1,onMouseEnter:Rt=>{D({...f,sizeIndex:N}),vt(Rt.clientY),w(Rt.clientX),Vt?.({...f,sizeIndex:N})},onMouseMove:Rt=>{D({...f,sizeIndex:N}),vt(Rt.clientY),w(Rt.clientX)},onMouseLeave:()=>{D(void 0),w(void 0),vt(void 0),Vt?.(void 0)},onClick:()=>{(j||F)&&(je.isEqual(p,{...f,sizeIndex:N})&&U?(C(void 0),j?.(void 0)):(C({...f,sizeIndex:N}),j&&j({...f,sizeIndex:N})))},children:[i.jsxRuntimeExports.jsx(Zt.motion.rect,{x:0,width:E.bandwidth(),variants:{initial:{height:0,fill:k[N],y:b(0)},whileInView:{height:Math.abs(b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))-b(oe.sum(f.size.filter((Rt,l)=>l<N&&Rt)))),y:b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt))),fill:k[N],transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{height:0,y:b(0),transition:{duration:o.duration}}}),mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{x:E.bandwidth()/2,style:{textAnchor:"middle",...a?.graphObjectValues||{}},className:i.mo("graph-value text-sm",s?.graphObjectValues),dy:"0.33em",variants:{initial:{y:b(0),opacity:0,fill:Ie.getTextColorBasedOnBgColor(k[N])},whileInView:{y:b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))+Math.abs(b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))-b(oe.sum(f.size.filter((Rt,l)=>l<N&&Rt))))/2,opacity:ee&&Math.abs(b(oe.sum(f.size.filter((Rt,l)=>l<=N&&Rt)))-b(oe.sum(f.size.filter((Rt,l)=>l<N&&Rt))))>20?1:0,fill:Ie.getTextColorBasedOnBgColor(k[N]),transition:{duration:o.duration}}},initial:"initial",animate:G?"whileInView":"initial",exit:{opacity:0,transition:{duration:o.duration}},children:ue.numberFormattingFunction(ee,m,x,it,B)}):null]},`${f.label}-${u[N]||N}`)),y?i.jsxRuntimeExports.jsx(ze.XAxesLabels,{value:`${f.label}`.length<Nt?`${f.label}`:`${`${f.label}`.substring(0,Nt)}...`,y:b(0)+5,x:0,width:E.bandwidth(),height:r.bottom,style:a?.xAxis?.labels,className:s?.xAxis?.labels,alignment:"top",animate:o,isInView:G}):null,mt?i.jsxRuntimeExports.jsx(Zt.motion.text,{style:{textAnchor:"middle",...a?.graphObjectValues||{}},x:E.bandwidth()/2,dy:-10,className:i.mo("graph-value graph-value-total",W?"text-sm":"fill-primary-gray-700 dark:fill-primary-gray-300 text-sm",s?.graphObjectValues),variants:{initial:{y:b(0),opacity:0,...W&&{fill:W}},whileInView:{y:b(oe.sum(f.size.map(Ls))),opacity:1,...W&&{fill:W},transition:{duration:o.duration}}},exit:{opacity:0,transition:{duration:o.duration}},initial:"initial",animate:G?"whileInView":"initial",children:ue.numberFormattingFunction(oe.sum(f.size.filter(Ms)),m,x,it,B)}):null]},f.label)),P=dt?i.jsxRuntimeExports.jsx(i.jsxRuntimeExports.Fragment,{children:dt.map((f,ee)=>i.jsxRuntimeExports.jsx(ke.RefLineY,{text:f.text,color:f.color,y:b(f.value),x1:0-A,x2:nt+r.right,classNames:f.classNames,styles:f.styles,animate:o,isInView:G},ee))}):null,t[8]=o,t[9]=$,t[10]=k,t[11]=I,t[12]=s?.graphObjectValues,t[13]=s?.xAxis?.axis,t[14]=s?.xAxis?.labels,t[15]=s?.yAxis?.gridLines,t[16]=s?.yAxis?.labels,t[17]=s?.yAxis?.title,t[18]=u,t[19]=h,t[20]=d,t[21]=F,t[22]=pt,t[23]=nt,t[24]=xt,t[25]=G,t[26]=Y,t[27]=A,t[28]=r.bottom,t[29]=r.left,t[30]=r.right,t[31]=r.top,t[32]=H,t[33]=Tt,t[34]=Q,t[35]=p,t[36]=m,t[37]=T,t[38]=j,t[39]=Vt,t[40]=x,t[41]=it,t[42]=dt,t[43]=U,t[44]=st,t[45]=y,t[46]=z,t[47]=mt,t[48]=a?.graphObjectValues,t[49]=a?.xAxis?.axis,t[50]=a?.xAxis?.labels,t[51]=a?.yAxis?.gridLines,t[52]=a?.yAxis?.labels,t[53]=a?.yAxis?.title,t[54]=B,t[55]=Nt,t[56]=W,t[57]=et,t[58]=R,t[59]=g,t[60]=_,t[61]=tt,t[62]=K,t[63]=M,t[64]=ht,t[65]=kt,t[66]=ot,t[67]=Ct,t[68]=X,t[69]=lt,t[70]=P,t[71]=ft}else R=t[58],g=t[59],_=t[60],tt=t[61],K=t[62],M=t[63],ht=t[64],kt=t[65],ot=t[66],Ct=t[67],X=t[68],lt=t[69],P=t[70],ft=t[71];let gt;t[93]!==R||t[94]!==lt||t[95]!==P?(gt=i.jsxRuntimeExports.jsxs(R,{children:[lt,P]}),t[93]=R,t[94]=lt,t[95]=P,t[96]=gt):gt=t[96];let jt;t[97]!==h?(jt=h.filter(Rs).map(Cs),t[97]=h,t[98]=jt):jt=t[98];let wt;t[99]!==_||t[100]!==tt||t[101]!==K||t[102]!==M||t[103]!==gt||t[104]!==jt||t[105]!==ft?(wt=i.jsxRuntimeExports.jsxs("g",{transform:ft,children:[_,tt,K,M,gt,jt]}),t[99]=_,t[100]=tt,t[101]=K,t[102]=M,t[103]=gt,t[104]=jt,t[105]=ft,t[106]=wt):wt=t[106];let at;t[107]!==g||t[108]!==ht||t[109]!==kt||t[110]!==ot||t[111]!==Ct||t[112]!==X||t[113]!==wt?(at=i.jsxRuntimeExports.jsx(g,{width:ht,height:kt,viewBox:ot,direction:Ct,ref:X,children:wt}),t[107]=g,t[108]=ht,t[109]=kt,t[110]=ot,t[111]=Ct,t[112]=X,t[113]=wt,t[114]=at):at=t[114];let At;t[115]!==s?.tooltip||t[116]!==S||t[117]!==Mt||t[118]!==c||t[119]!==a?.tooltip||t[120]!==ct?(At=c&&ct&&S&&Mt?i.jsxRuntimeExports.jsx(Ae.Tooltip,{data:c,body:ct,xPos:S,yPos:Mt,backgroundStyle:a?.tooltip,className:s?.tooltip}):null,t[115]=s?.tooltip,t[116]=S,t[117]=Mt,t[118]=c,t[119]=a?.tooltip,t[120]=ct,t[121]=At):At=t[121];let $t;t[122]!==F||t[123]!==p?($t=F&&p!==void 0?i.jsxRuntimeExports.jsx(we.le,{open:p!==void 0,onClose:()=>{C(void 0)},children:i.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof F=="string"?{__html:$e.string2HTML(F,p)}:void 0,children:typeof F=="function"?F(p):null})}):null,t[122]=F,t[123]=p,t[124]=$t):$t=t[124];let Et;return t[125]!==at||t[126]!==At||t[127]!==$t?(Et=i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[at,At,$t]}),t[125]=at,t[126]=At,t[127]=$t,t[128]=Et):Et=t[128],Et}function Cs(e){return e.layer}function Rs(e){return e.position==="after"}function Ms(e){return e}function Ls(e){return e||0}function Ns(e){return e.layer}function Vs(e){return e.position==="before"}function Is(e){return e!==0}function Ts(e){return e!==0}function Ss(e){return`${e.id}`}function Ds(e){const t=i.compilerRuntimeExports.c(43),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,padding:Vt,backgroundColor:B,topMargin:it,bottomMargin:mt,leftMargin:dt,rightMargin:Tt,tooltip:j,onSeriesMouseOver:st,suffix:Y,prefix:H,showLabels:Q,relativeHeight:U,showValues:F,refValues:$,graphID:W,maxValue:T,onSeriesMouseClick:a,graphDownload:s,dataDownload:o,language:u,labelOrder:x,minHeight:h,theme:m,maxBarThickness:A,sortParameter:Z,maxNumberOfBars:J,minBarThickness:ut,showColorScale:Ft,ariaLabel:Ht,resetSelectionOnDoubleClick:G,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:r,valueColor:c,styles:D,classNames:p,filterNA:C,animate:S,precision:w,customLayers:Mt,timeline:vt,naLabel:nt,sortData:pt,orientation:R}=e,g=qt===void 0?ce.Colors.light.categoricalColors.colors:qt,_=et===void 0?.25:et,tt=xt===void 0?!0:xt,K=k===void 0?999:k,M=B===void 0?!1:B,ht=Y===void 0?"":Y,kt=H===void 0?"":H,ot=Q===void 0?!0:Q,Ct=F===void 0?!0:F,X=s===void 0?!1:s,lt=o===void 0?!1:o,P=u===void 0?"en":u,ft=h===void 0?0:h,gt=m===void 0?"light":m,jt=Ft===void 0?!0:Ft,wt=G===void 0?!0:G,at=r===void 0?5:r,At=C===void 0?!0:C,$t=S===void 0?!1:S,Et=w===void 0?2:w;let b;t[0]!==Mt?(b=Mt===void 0?[]:Mt,t[0]=Mt,t[1]=b):b=t[1];const rt=b,St=vt===void 0?{enabled:!1,autoplay:!1,showOnlyActiveDate:!0}:vt,Gt=nt===void 0?"NA":nt,Ut=(R===void 0?"vertical":R)==="horizontal"?gs:ks,[It,Kt]=q.useState(0),[Lt,Qt]=q.useState(0),[Wt,Pt]=q.useState(St.autoplay),Ot=He.sort(Le.uniqBy(d,"date",!0).map(Bt=>me.parse(`${Bt}`,St.dateFormat||"yyyy",new Date).getTime()),Ks),[Yt,Jt]=q.useState(St.autoplay?0:Ot.length-1),[V,v]=q.useState(void 0),O=q.useRef(null),n=q.useRef(null);let f,ee;t[2]===Symbol.for("react.memo_cache_sentinel")?(f=()=>{const Bt=new ResizeObserver(ae=>{Kt(ae[0].target.clientWidth||620),Qt(ae[0].target.clientHeight||480)});return O.current&&Bt.observe(O.current),()=>Bt.disconnect()},ee=[],t[2]=f,t[3]=ee):(f=t[2],ee=t[3]),q.useEffect(f,ee),q.useEffect(()=>{const Bt=setInterval(()=>{Jt(ae=>ae<Ot.length-1?ae+1:0)},(St.speed||2)*1e3);return Wt||clearInterval(Bt),()=>clearInterval(Bt)},[Ot,Wt,St.speed]);const N=ye.getSliderMarks(Ot,Yt,St.showOnlyActiveDate,St.dateFormat||"yyyy"),Rt=ve.GraphContainer,l=p?.graphContainer,ie=D?.graphContainer;let se;t[4]!==p?.description||t[5]!==p?.title||t[6]!==d||t[7]!==lt||t[8]!==yt||t[9]!==X||t[10]!==L||t[11]!==D?.description||t[12]!==D?.title||t[13]!==y?(se=L||yt||X||lt?i.jsxRuntimeExports.jsx(Be.GraphHeader,{styles:{title:D?.title,description:D?.description},classNames:{title:p?.title,description:p?.description},graphTitle:L,graphDescription:yt,width:y,graphDownload:X?n:void 0,dataDownload:lt?d.map(Js).filter(Ws).length>0?d.map(Us).filter(Ys):d.filter(Xs):null}):null,t[4]=p?.description,t[5]=p?.title,t[6]=d,t[7]=lt,t[8]=yt,t[9]=X,t[10]=L,t[11]=D?.description,t[12]=D?.title,t[13]=y,t[14]=se):se=t[14];const xe=St.enabled&&Ot.length>0&&N?i.jsxRuntimeExports.jsxs("div",{className:"flex gap-6 items-center",dir:"ltr",children:[i.jsxRuntimeExports.jsx("button",{type:"button",onClick:()=>{Pt(!Wt)},className:"p-0 border-0 cursor-pointer bg-transparent","aria-label":Wt?"Click to pause animation":"Click to play animation",children:Wt?i.jsxRuntimeExports.jsx(be.Pause,{}):i.jsxRuntimeExports.jsx(be.Play,{})}),i.jsxRuntimeExports.jsx(ye.Nr,{min:Ot[0],max:Ot[Ot.length-1],marks:N,step:null,defaultValue:Ot[Ot.length-1],value:Ot[Yt],onChangeComplete:Bt=>{Jt(Ot.indexOf(Bt))},onChange:Bt=>{Jt(Ot.indexOf(Bt))},"aria-label":"Time slider. Use arrow keys to adjust selected time period."})]}):null,pe="grow flex flex-col justify-center gap-3 w-full",re=d.length===0?i.jsxRuntimeExports.jsx(qe.EmptyState,{}):i.jsxRuntimeExports.jsxs(i.jsxRuntimeExports.Fragment,{children:[jt?i.jsxRuntimeExports.jsx(Pe.ColorLegendWithMouseOver,{width:y,colorDomain:Nt,colors:g,colorLegendTitle:ct,setSelectedColor:v,showNAColor:!1,className:p?.colorLegend}):null,i.jsxRuntimeExports.jsx(ve.GraphArea,{ref:O,children:It&&Lt?i.jsxRuntimeExports.jsx(Ut,{data:Z!==void 0?Z==="total"?Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,St.dateFormat||"yyyy").filter(Bt=>St.enabled?Bt.date===me.format(new Date(Ot[Yt]),St.dateFormat||"yyyy"):Bt).filter(Bt=>At?!Bt.size.every(Gs):Bt),qs,[pt||"asc"]).filter((Bt,ae)=>J?ae<J:!0):Ne.orderBy(he.ensureCompleteDataForStackedBarChart(d,St.dateFormat||"yyyy").filter(Bt=>St.enabled?Bt.date===me.format(new Date(Ot[Yt]),St.dateFormat||"yyyy"):Bt).filter(Bt=>At?!Bt.size.every(Ps):Bt),Bt=>_t.checkIfNullOrUndefined(Bt.size[Z])?-1/0:Bt.size[Z],[pt||"asc"]).filter((Bt,ae)=>J?ae<J:!0):he.ensureCompleteDataForStackedBarChart(d,St.dateFormat||"yyyy").filter(Bt=>St.enabled?Bt.date===me.format(new Date(Ot[Yt]),St.dateFormat||"yyyy"):Bt).filter(Bt=>At?!Bt.size.every(Fs):Bt).filter((Bt,ae)=>J?ae<J:!0),barColors:g,width:It,height:Lt,barPadding:_,showTicks:tt,leftMargin:dt,rightMargin:Tt,topMargin:it,bottomMargin:mt,truncateBy:K,showLabels:ot,tooltip:j,onSeriesMouseOver:st,showValues:Ct,suffix:ht,prefix:kt,refValues:$,maxValue:_t.checkIfNullOrUndefined(T)?Math.max(...d.map(zs)):T,onSeriesMouseClick:a,selectedColor:V,rtl:P==="he"||P==="ar",labelOrder:x,maxBarThickness:A,minBarThickness:ut,resetSelectionOnDoubleClick:wt,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:at,valueColor:c,classNames:p,styles:D,animate:$t===!0?{duration:.5,once:!0,amount:.5}:$t||{duration:0,once:!0,amount:0},colorDomain:Nt,precision:Et,customLayers:rt,naLabel:Gt}):null})]});let ne;t[15]!==re?(ne=i.jsxRuntimeExports.jsx("div",{className:pe,children:re}),t[15]=re,t[16]=ne):ne=t[16];let le;t[17]!==p?.footnote||t[18]!==p?.source||t[19]!==z||t[20]!==Dt||t[21]!==D?.footnote||t[22]!==D?.source||t[23]!==y?(le=Dt||z?i.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:D?.footnote,source:D?.source},classNames:{footnote:p?.footnote,source:p?.source},sources:Dt,footNote:z,width:y}):null,t[17]=p?.footnote,t[18]=p?.source,t[19]=z,t[20]=Dt,t[21]=D?.footnote,t[22]=D?.source,t[23]=y,t[24]=le):le=t[24];let Xt;return t[25]!==Rt||t[26]!==Ht||t[27]!==M||t[28]!==W||t[29]!==I||t[30]!==P||t[31]!==ft||t[32]!==Vt||t[33]!==U||t[34]!==l||t[35]!==ie||t[36]!==se||t[37]!==xe||t[38]!==ne||t[39]!==le||t[40]!==gt||t[41]!==y?(Xt=i.jsxRuntimeExports.jsxs(Rt,{className:l,style:ie,id:W,ref:n,"aria-label":Ht,backgroundColor:M,theme:gt,language:P,minHeight:ft,width:y,height:I,relativeHeight:U,padding:Vt,children:[se,xe,ne,le]}),t[25]=Rt,t[26]=Ht,t[27]=M,t[28]=W,t[29]=I,t[30]=P,t[31]=ft,t[32]=Vt,t[33]=U,t[34]=l,t[35]=ie,t[36]=se,t[37]=xe,t[38]=ne,t[39]=le,t[40]=gt,t[41]=y,t[42]=Xt):Xt=t[42],Xt}function zs(e){return oe.sum(e.size.filter(Bs))||0}function Bs(e){return!_t.checkIfNullOrUndefined(e)}function Fs(e){return e==null}function Ps(e){return e==null}function qs(e){return oe.sum(e.size.filter(Hs))}function Hs(e){return!_t.checkIfNullOrUndefined(e)}function Gs(e){return e==null}function Xs(e){return e!==void 0}function Ys(e){return e!==void 0}function Us(e){return e.data}function Ws(e){return e!==void 0}function Js(e){return e.data}function Ks(e,t){return Ge.ascending(e,t)}function Qs(e){const t=i.compilerRuntimeExports.c(61),{data:d,graphTitle:L,colors:qt,barPadding:Dt,showTicks:yt,leftMargin:et,rightMargin:xt,topMargin:k,bottomMargin:I,truncateBy:y,showLabels:z,showValues:Nt,backgroundColor:ct,suffix:Vt,prefix:B,sources:it,graphDescription:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,showColorScale:W,graphID:T,maxValue:a,minValue:s,highlightedDataPoints:o,onSeriesMouseClick:u,graphDownload:x,dataDownload:h,language:m,theme:A,sortData:Z,labelOrder:J,showNAColor:ut,minHeight:Ft,maxBarThickness:Ht,maxNumberOfBars:G,minBarThickness:bt,ariaLabel:zt,resetSelectionOnDoubleClick:r,detailsOnClick:c,barAxisTitle:D,noOfTicks:p,valueColor:C,orientation:S,styles:w,classNames:Mt,filterNA:vt,animate:nt,dimmedOpacity:pt,precision:R,customLayers:g,timeline:_,naLabel:tt}=e,K=S===void 0?"vertical":S;let M;return t[0]!==nt||t[1]!==zt||t[2]!==ct||t[3]!==D||t[4]!==Dt||t[5]!==I||t[6]!==Mt||t[7]!==st||t[8]!==Y||t[9]!==qt||t[10]!==g||t[11]!==d||t[12]!==h||t[13]!==c||t[14]!==pt||t[15]!==vt||t[16]!==j||t[17]!==mt||t[18]!==x||t[19]!==T||t[20]!==L||t[21]!==dt||t[22]!==o||t[23]!==J||t[24]!==m||t[25]!==et||t[26]!==Ht||t[27]!==G||t[28]!==a||t[29]!==bt||t[30]!==Ft||t[31]!==s||t[32]!==tt||t[33]!==p||t[34]!==u||t[35]!==F||t[36]!==K||t[37]!==H||t[38]!==R||t[39]!==B||t[40]!==$||t[41]!==Q||t[42]!==r||t[43]!==xt||t[44]!==W||t[45]!==z||t[46]!==ut||t[47]!==yt||t[48]!==Nt||t[49]!==Z||t[50]!==it||t[51]!==w||t[52]!==Vt||t[53]!==A||t[54]!==_||t[55]!==U||t[56]!==k||t[57]!==y||t[58]!==C||t[59]!==Tt?(M=i.jsxRuntimeExports.jsx(_i,{data:d,graphTitle:L,colors:qt,barPadding:Dt,showTicks:yt,leftMargin:et,rightMargin:xt,topMargin:k,bottomMargin:I,truncateBy:y,showLabels:z,showValues:Nt,backgroundColor:ct,suffix:Vt,prefix:B,sources:it,graphDescription:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,showColorScale:W,graphID:T,maxValue:a,minValue:s,highlightedDataPoints:o,onSeriesMouseClick:u,graphDownload:x,dataDownload:h,language:m,theme:A,sortData:Z,labelOrder:J,showNAColor:ut,minHeight:Ft,maxBarThickness:Ht,maxNumberOfBars:G,minBarThickness:bt,ariaLabel:zt,resetSelectionOnDoubleClick:r,styles:w,detailsOnClick:c,barAxisTitle:D,noOfTicks:p,valueColor:C,classNames:Mt,filterNA:vt,animate:nt,dimmedOpacity:pt,precision:R,customLayers:g,timeline:_,naLabel:tt,orientation:K}),t[0]=nt,t[1]=zt,t[2]=ct,t[3]=D,t[4]=Dt,t[5]=I,t[6]=Mt,t[7]=st,t[8]=Y,t[9]=qt,t[10]=g,t[11]=d,t[12]=h,t[13]=c,t[14]=pt,t[15]=vt,t[16]=j,t[17]=mt,t[18]=x,t[19]=T,t[20]=L,t[21]=dt,t[22]=o,t[23]=J,t[24]=m,t[25]=et,t[26]=Ht,t[27]=G,t[28]=a,t[29]=bt,t[30]=Ft,t[31]=s,t[32]=tt,t[33]=p,t[34]=u,t[35]=F,t[36]=K,t[37]=H,t[38]=R,t[39]=B,t[40]=$,t[41]=Q,t[42]=r,t[43]=xt,t[44]=W,t[45]=z,t[46]=ut,t[47]=yt,t[48]=Nt,t[49]=Z,t[50]=it,t[51]=w,t[52]=Vt,t[53]=A,t[54]=_,t[55]=U,t[56]=k,t[57]=y,t[58]=C,t[59]=Tt,t[60]=M):M=t[60],M}function Zs(e){const t=i.compilerRuntimeExports.c(57),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,suffix:Vt,prefix:B,showValues:it,padding:mt,backgroundColor:dt,leftMargin:Tt,rightMargin:j,topMargin:st,bottomMargin:Y,showLabels:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,graphID:W,maxValue:T,minValue:a,onSeriesMouseClick:s,graphDownload:o,dataDownload:u,language:x,labelOrder:h,minHeight:m,theme:A,sortParameter:Z,sortData:J,maxBarThickness:ut,ariaLabel:Ft,resetSelectionOnDoubleClick:Ht,detailsOnClick:G,barAxisTitle:bt,noOfTicks:zt,valueColor:r,orientation:c,styles:D,classNames:p,filterNA:C,animate:S,precision:w,customLayers:Mt,showColorScale:vt,timeline:nt,naLabel:pt}=e,R=c===void 0?"vertical":c;let g;return t[0]!==S||t[1]!==Ft||t[2]!==dt||t[3]!==bt||t[4]!==et||t[5]!==Y||t[6]!==p||t[7]!==Nt||t[8]!==ct||t[9]!==qt||t[10]!==Mt||t[11]!==d||t[12]!==u||t[13]!==G||t[14]!==C||t[15]!==z||t[16]!==yt||t[17]!==o||t[18]!==W||t[19]!==L||t[20]!==I||t[21]!==h||t[22]!==x||t[23]!==Tt||t[24]!==ut||t[25]!==T||t[26]!==m||t[27]!==a||t[28]!==pt||t[29]!==zt||t[30]!==s||t[31]!==F||t[32]!==R||t[33]!==mt||t[34]!==w||t[35]!==B||t[36]!==$||t[37]!==Q||t[38]!==Ht||t[39]!==j||t[40]!==vt||t[41]!==H||t[42]!==xt||t[43]!==it||t[44]!==J||t[45]!==Z||t[46]!==Dt||t[47]!==D||t[48]!==Vt||t[49]!==A||t[50]!==nt||t[51]!==U||t[52]!==st||t[53]!==k||t[54]!==r||t[55]!==y?(g=i.jsxRuntimeExports.jsx(ci,{orientation:R,data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,truncateBy:k,height:I,width:y,footNote:z,colorDomain:Nt,colorLegendTitle:ct,suffix:Vt,prefix:B,showValues:it,padding:mt,backgroundColor:dt,leftMargin:Tt,rightMargin:j,sortParameter:Z,sortData:J,topMargin:st,bottomMargin:Y,showLabels:H,relativeHeight:Q,tooltip:U,onSeriesMouseOver:F,refValues:$,graphID:W,maxValue:T,minValue:a,onSeriesMouseClick:s,graphDownload:o,dataDownload:u,language:x,labelOrder:h,minHeight:m,theme:A,maxBarThickness:ut,ariaLabel:Ft,resetSelectionOnDoubleClick:Ht,styles:D,detailsOnClick:G,barAxisTitle:bt,noOfTicks:zt,valueColor:r,classNames:p,filterNA:C,animate:S,precision:w,customLayers:Mt,showColorScale:vt,timeline:nt,naLabel:pt}),t[0]=S,t[1]=Ft,t[2]=dt,t[3]=bt,t[4]=et,t[5]=Y,t[6]=p,t[7]=Nt,t[8]=ct,t[9]=qt,t[10]=Mt,t[11]=d,t[12]=u,t[13]=G,t[14]=C,t[15]=z,t[16]=yt,t[17]=o,t[18]=W,t[19]=L,t[20]=I,t[21]=h,t[22]=x,t[23]=Tt,t[24]=ut,t[25]=T,t[26]=m,t[27]=a,t[28]=pt,t[29]=zt,t[30]=s,t[31]=F,t[32]=R,t[33]=mt,t[34]=w,t[35]=B,t[36]=$,t[37]=Q,t[38]=Ht,t[39]=j,t[40]=vt,t[41]=H,t[42]=xt,t[43]=it,t[44]=J,t[45]=Z,t[46]=Dt,t[47]=D,t[48]=Vt,t[49]=A,t[50]=nt,t[51]=U,t[52]=st,t[53]=k,t[54]=r,t[55]=y,t[56]=g):g=t[56],g}function _s(e){const t=i.compilerRuntimeExports.c(58),{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,leftMargin:k,rightMargin:I,topMargin:y,bottomMargin:z,truncateBy:Nt,showLabels:ct,showValues:Vt,backgroundColor:B,suffix:it,prefix:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,tooltip:Q,onSeriesMouseOver:U,relativeHeight:F,refValues:$,graphID:W,maxValue:T,onSeriesMouseClick:a,graphDownload:s,dataDownload:o,language:u,theme:x,labelOrder:h,minHeight:m,maxBarThickness:A,sortParameter:Z,sortData:J,maxNumberOfBars:ut,minBarThickness:Ft,ariaLabel:Ht,resetSelectionOnDoubleClick:G,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:r,valueColor:c,orientation:D,styles:p,classNames:C,filterNA:S,animate:w,precision:Mt,customLayers:vt,showColorScale:nt,timeline:pt,naLabel:R}=e,g=D===void 0?"vertical":D;let _;return t[0]!==w||t[1]!==Ht||t[2]!==B||t[3]!==zt||t[4]!==et||t[5]!==z||t[6]!==C||t[7]!==st||t[8]!==Y||t[9]!==qt||t[10]!==vt||t[11]!==d||t[12]!==o||t[13]!==bt||t[14]!==S||t[15]!==j||t[16]!==yt||t[17]!==s||t[18]!==W||t[19]!==L||t[20]!==dt||t[21]!==h||t[22]!==u||t[23]!==k||t[24]!==A||t[25]!==ut||t[26]!==T||t[27]!==Ft||t[28]!==m||t[29]!==R||t[30]!==r||t[31]!==a||t[32]!==U||t[33]!==g||t[34]!==H||t[35]!==Mt||t[36]!==mt||t[37]!==$||t[38]!==F||t[39]!==G||t[40]!==I||t[41]!==nt||t[42]!==ct||t[43]!==xt||t[44]!==Vt||t[45]!==J||t[46]!==Z||t[47]!==Dt||t[48]!==p||t[49]!==it||t[50]!==x||t[51]!==pt||t[52]!==Q||t[53]!==y||t[54]!==Nt||t[55]!==c||t[56]!==Tt?(_=i.jsxRuntimeExports.jsx(Ds,{data:d,graphTitle:L,colors:qt,sources:Dt,graphDescription:yt,barPadding:et,showTicks:xt,leftMargin:k,rightMargin:I,topMargin:y,bottomMargin:z,truncateBy:Nt,showLabels:ct,showValues:Vt,backgroundColor:B,suffix:it,prefix:mt,height:dt,width:Tt,footNote:j,colorDomain:st,colorLegendTitle:Y,padding:H,tooltip:Q,onSeriesMouseOver:U,relativeHeight:F,refValues:$,graphID:W,maxValue:T,onSeriesMouseClick:a,graphDownload:s,dataDownload:o,language:u,theme:x,labelOrder:h,minHeight:m,maxBarThickness:A,sortParameter:Z,sortData:J,maxNumberOfBars:ut,minBarThickness:Ft,ariaLabel:Ht,resetSelectionOnDoubleClick:G,styles:p,detailsOnClick:bt,barAxisTitle:zt,noOfTicks:r,valueColor:c,classNames:C,filterNA:S,animate:w,precision:Mt,customLayers:vt,showColorScale:nt,timeline:pt,naLabel:R,orientation:g}),t[0]=w,t[1]=Ht,t[2]=B,t[3]=zt,t[4]=et,t[5]=z,t[6]=C,t[7]=st,t[8]=Y,t[9]=qt,t[10]=vt,t[11]=d,t[12]=o,t[13]=bt,t[14]=S,t[15]=j,t[16]=yt,t[17]=s,t[18]=W,t[19]=L,t[20]=dt,t[21]=h,t[22]=u,t[23]=k,t[24]=A,t[25]=ut,t[26]=T,t[27]=Ft,t[28]=m,t[29]=R,t[30]=r,t[31]=a,t[32]=U,t[33]=g,t[34]=H,t[35]=Mt,t[36]=mt,t[37]=$,t[38]=F,t[39]=G,t[40]=I,t[41]=nt,t[42]=ct,t[43]=xt,t[44]=Vt,t[45]=J,t[46]=Z,t[47]=Dt,t[48]=p,t[49]=it,t[50]=x,t[51]=pt,t[52]=Q,t[53]=y,t[54]=Nt,t[55]=c,t[56]=Tt,t[57]=_):_=t[57],_}exports.GroupedBarGraph=Zs;exports.SimpleBarGraph=Qs;exports.StackedBarGraph=_s;
2
2
  //# sourceMappingURL=BarGraph.cjs.map
package/dist/BarGraph.js CHANGED
@@ -10,13 +10,13 @@ import { n as ue } from "./numberFormattingFunction-14YCbkN2.js";
10
10
  import { T as Oe } from "./Tooltip-CwWUegPB.js";
11
11
  import { c as _t } from "./checkIfNullOrUndefined-DmfiKkNw.js";
12
12
  import { s as Me } from "./string2HTML-DhG75NqA.js";
13
- import { Y as Pe } from "./YAxesLabels-Dnnng49-.js";
13
+ import { Y as Pe } from "./YAxesLabels-1XTb-D0_.js";
14
14
  import { A as ke } from "./Axis-CRyfcLjc.js";
15
15
  import { A as Ce } from "./AxisTitle-jeI7am8o.js";
16
16
  import { X as Fe } from "./XTicksAndGridLines-CObVFSm4.js";
17
17
  import { R as He, a as Xe } from "./ReferenceLine-2XCwHXQ4.js";
18
18
  import { Y as Ye } from "./YTicksAndGridLines-Blepl7XF.js";
19
- import { X as Ee } from "./XAxesLabels-DNO0KmjL.js";
19
+ import { X as Ee } from "./XAxesLabels-Dmbk50u4.js";
20
20
  import { u as Ve } from "./use-in-view-Cxa7y1TH.js";
21
21
  import { a as Le } from "./linear-BwnDd9KF.js";
22
22
  import { b as ge } from "./band-CyHaVft5.js";
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),rt=require("react"),Le=require("./index-Cno4Q0YE.cjs"),Me=require("./index-DQA8q5sC.cjs"),Ae=require("./Modal-JW_IExO3.cjs"),fe=require("./index-CSNtgibC.cjs"),we=require("./numberFormattingFunction-02t-wJta.cjs"),Re=require("./Tooltip-4dJo4_AF.cjs"),f=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Oe=require("./string2HTML-CPGr_I5E.cjs"),ke=require("./Axis-DxRV2yMi.cjs"),Ve=require("./AxisTitle-sS5bLLR7.cjs"),qe=require("./XAxesLabels-D5X8jngD.cjs"),Ne=require("./ReferenceLine-BH0qdf4R.cjs"),Te=require("./YTicksAndGridLines-4pxTRlRK.cjs"),$e=require("./XTicksAndGridLines-B6CELS7q.cjs"),Se=require("./YAxesLabels-DcS85Beo.cjs"),Ee=require("./linear-BwPAspcq.cjs"),Ie=require("./band-VYfcZeJ2.cjs"),Ce=require("./use-in-view-QcfiW0w3.cjs"),ft=require("./proxy-BxvUI_9l.cjs"),ze=require("./index-DG2bgAva.cjs"),ve=require("./Colors.cjs"),De=require("./EmptyState-sAEZ_5rU.cjs"),je=require("./GraphContainer-d8A46BK2.cjs"),Fe=require("./GraphFooter.cjs"),Ue=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs");function Pe(e){const t=s.compilerRuntimeExports.c(154),{data:n,width:pt,height:Yt,barColor:zt,suffix:gt,prefix:V,barPadding:Lt,showLabels:qt,showValues:Wt,showTicks:ie,truncateBy:Jt,leftMargin:ne,rightMargin:Tt,topMargin:Kt,bottomMargin:re,tooltip:ut,onSeriesMouseOver:ct,refValues:yt,maxValue:g,minValue:xt,highlightedDataPoints:K,onSeriesMouseClick:nt,labelOrder:D,maxBarThickness:$t,minBarThickness:bt,resetSelectionOnDoubleClick:St,detailsOnClick:N,barAxisTitle:M,valueColor:Q,noOfTicks:vt,styles:m,classNames:a,targetStyle:h,targetColor:wt,qualitativeRangeColors:Dt,measureBarWidthFactor:d,animate:r,dimmedOpacity:c,precision:st,customLayers:Z,naLabel:E}=e,_=ne===void 0?20:ne,Ft=Tt===void 0?20:Tt,se=Kt===void 0?20:Kt,ae=re===void 0?25:re,Qt=rt.useRef(null);let le;t[0]!==r.amount||t[1]!==r.once?(le={once:r.once,amount:r.amount},t[0]=r.amount,t[1]=r.once,t[2]=le):le=t[2];const I=Ce.useInView(Qt,le),F=M?_+30:_;let Ut;t[3]!==ae||t[4]!==Ft||t[5]!==F||t[6]!==se?(Ut={top:se,bottom:ae,left:F,right:Ft},t[3]=ae,t[4]=Ft,t[5]=F,t[6]=se,t[7]=Ut):Ut=t[7];const p=Ut,[A,Zt]=rt.useState(void 0),[U,_t]=rt.useState(void 0),[tt,te]=rt.useState(void 0),[Bt,ee]=rt.useState(void 0),x=pt-p.left-p.right,mt=Yt-p.top-p.bottom;let et;t[8]!==n?(et=Math.max(...n.filter(di).map(hi))<0?0:Math.max(...n.filter(mi).map(xi)),t[8]=n,t[9]=et):et=t[9];const jt=et;let Mt;t[10]!==n?(Mt=Math.max(...n.filter(ci).map(ui))<0?0:Math.max(...n.filter(ri).map(oi)),t[10]=n,t[11]=Mt):Mt=t[11];const At=Mt;let Rt;t[12]!==n?(Rt=Math.max(...n.map(ai)),t[12]=n,t[13]=Rt):Rt=t[13];const Ot=Rt;let kt;t[14]!==jt||t[15]!==g||t[16]!==Ot||t[17]!==At?(kt=f.checkIfNullOrUndefined(g)?Math.max(...[jt,At,Ot].filter(Number.isFinite))<0?0:Math.max(...[jt,At,Ot].filter(Number.isFinite)):g,t[14]=jt,t[15]=g,t[16]=Ot,t[17]=At,t[18]=kt):kt=t[18];const Vt=kt;let Pt;t[19]!==n?(Pt=Math.min(...n.filter(si).map(ni))>=0?0:Math.min(...n.filter(ii).map(ei)),t[19]=n,t[20]=Pt):Pt=t[20];const Nt=Pt;let Et;t[21]!==n?(Et=Math.min(...n.filter(ti).map(_e))>=0?0:Math.min(...n.filter(Ze).map(Qe)),t[21]=n,t[22]=Et):Et=t[22];const ht=Et;let It;t[23]!==Nt||t[24]!==xt||t[25]!==ht?(It=f.checkIfNullOrUndefined(xt)?Math.min(...[Nt,ht].filter(Number.isFinite))>=0?0:Math.min(...[Nt,ht].filter(Number.isFinite)):xt,t[23]=Nt,t[24]=xt,t[25]=ht,t[26]=It):It=t[26];const y=It;let C,z,B,P,L,H,G,b,R,O,q,T,v,w;if(t[27]!==r||t[28]!==M||t[29]!==zt||t[30]!==Lt||t[31]!==a?.graphObjectValues||t[32]!==a?.xAxis?.axis||t[33]!==a?.xAxis?.labels||t[34]!==a?.yAxis?.gridLines||t[35]!==a?.yAxis?.labels||t[36]!==a?.yAxis?.title||t[37]!==Z||t[38]!==n||t[39]!==N||t[40]!==c||t[41]!==mt||t[42]!==x||t[43]!==Yt||t[44]!==K||t[45]!==I||t[46]!==D||t[47]!==_||t[48]!==p.bottom||t[49]!==p.left||t[50]!==p.right||t[51]!==p.top||t[52]!==$t||t[53]!==d||t[54]!==bt||t[55]!==U||t[56]!==E||t[57]!==vt||t[58]!==nt||t[59]!==ct||t[60]!==st||t[61]!==V||t[62]!==Dt||t[63]!==yt||t[64]!==St||t[65]!==qt||t[66]!==ie||t[67]!==Wt||t[68]!==m?.graphObjectValues||t[69]!==m?.xAxis?.axis||t[70]!==m?.xAxis?.labels||t[71]!==m?.yAxis?.gridLines||t[72]!==m?.yAxis?.labels||t[73]!==m?.yAxis?.title||t[74]!==gt||t[75]!==wt||t[76]!==h||t[77]!==Jt||t[78]!==Q||t[79]!==pt||t[80]!==Vt||t[81]!==y){const u=Ee.linear().domain([y,Vt]).range([mt,0]).nice();let Ht;t[96]!==D?(Ht=(l,oe)=>({...l,id:D?`${l.label}`:`${oe}`}),t[96]=D,t[97]=Ht):Ht=t[97];const ue=n.map(Ht),o=D||ue.map(Ke),k=Ie.band().domain(o).range([0,bt?Math.max(x,bt*o.length):$t?Math.min(x,$t*o.length):x]).paddingInner(Lt),J=u.ticks(vt);z=ft.motion.svg,O=`${pt}px`,q=`${Yt}px`,T=`0 0 ${pt} ${Yt}`,v="ltr",w=Qt,L=`translate(${p.left},${p.top})`;const xe=u(y<0?0:y),Gt=u(y<0?0:y),dt=y<0?0:y;let lt;t[98]!==E||t[99]!==st||t[100]!==V||t[101]!==gt||t[102]!==dt?(lt=we.numberFormattingFunction(dt,E,st,V,gt),t[98]=E,t[99]=st,t[100]=V,t[101]=gt,t[102]=dt,t[103]=lt):lt=t[103];const Xt=a?.xAxis?.axis,j=a?.yAxis?.labels;let it;t[104]!==Xt||t[105]!==j?(it={axis:Xt,label:j},t[104]=Xt,t[105]=j,t[106]=it):it=t[106];const he=m?.xAxis?.axis,me=m?.yAxis?.labels;let i;t[107]!==he||t[108]!==me?(i={axis:he,label:me},t[107]=he,t[108]=me,t[109]=i):i=t[109],H=s.jsxRuntimeExports.jsx(ke.Axis,{y1:xe,y2:Gt,x1:0-_,x2:x+p.right,label:lt,labelPos:{x:0-_,dx:0,dy:Vt<0?"1em":-5,y:u(y<0?0:y)},classNames:it,styles:i}),G=ie?s.jsxRuntimeExports.jsx(Te.YTicksAndGridLines,{values:J.filter(Je),y:J.filter(We).map(l=>u(l)),x1:0-_,x2:x+p.right,styles:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},classNames:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},suffix:gt,prefix:V,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:st}):null;const ot=0-_-15,ce=mt/2,pe=m?.yAxis?.title,ge=a?.yAxis?.title;t[110]!==M||t[111]!==ot||t[112]!==ce||t[113]!==pe||t[114]!==ge?(b=s.jsxRuntimeExports.jsx(Ve.AxisTitle,{x:ot,y:ce,style:pe,className:ge,text:M,rotate90:!0}),t[110]=M,t[111]=ot,t[112]=ce,t[113]=pe,t[114]=ge,t[115]=b):b=t[115],t[116]!==Z?(R=Z.filter(Ye).map(Xe),t[116]=Z,t[117]=R):R=t[117],C=ze.AnimatePresence,B=ue.map(l=>f.checkIfNullOrUndefined(k(l.id))?null:s.jsxRuntimeExports.jsxs(ft.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:oe=>{Zt(l),ee(oe.clientY),te(oe.clientX),ct?.(l)},onClick:()=>{(nt||N)&&(Me.isEqual(U,l)&&St?(_t(void 0),nt?.(void 0)):(_t(l),nt?.(l)))},onMouseMove:oe=>{Zt(l),ee(oe.clientY),te(oe.clientX)},onMouseLeave:()=>{Zt(void 0),te(void 0),ee(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{x:k(`${l.id}`),y:0,opacity:K.length!==0?K.indexOf(l.label)!==-1?.85:c:.85},whileInView:{x:k(`${l.id}`),y:0,opacity:K.length!==0?K.indexOf(l.label)!==-1?.85:c:.85,transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",children:[l.qualitativeRange?l.qualitativeRange.map((oe,de)=>s.jsxRuntimeExports.jsx(ft.motion.rect,{x:0,exit:{height:0,y:u(0),transition:{duration:r.duration}},variants:{initial:{height:0,y:u(0),fill:Dt[de]},whileInView:{height:Math.abs(u(fe.sum(l.qualitativeRange.filter((ye,be)=>be<=de&&ye)))-u(fe.sum(l.qualitativeRange.filter((ye,be)=>be<de&&ye)))),y:u(fe.sum(l.qualitativeRange.filter((ye,be)=>be<=de&&ye))),fill:Dt[de],transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",width:k.bandwidth()},de)):null,l.target&&h==="background"?s.jsxRuntimeExports.jsx(ft.motion.rect,{x:0,width:k.bandwidth(),style:{fill:wt},exit:{height:0,y:u(0),transition:{duration:r.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(l.target)-u(0)),y:l.target>0?u(l.target):u(0),transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial"}):null,l.size?s.jsxRuntimeExports.jsx(ft.motion.rect,{x:k.bandwidth()*((1-d)/2),width:k.bandwidth()*d,style:{fill:zt},exit:{height:0,y:u(0),transition:{duration:r.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(l.size)-u(0)),y:l.size>0?u(l.size):u(0),transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial"}):null,l.target&&h==="line"?s.jsxRuntimeExports.jsx(ft.motion.rect,{x:0,width:k.bandwidth(),style:{fill:wt},exit:{y:u(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{y:u(0),opacity:0},whileInView:{y:u(l.target)-1,opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",height:2}):null,qt?s.jsxRuntimeExports.jsx(qe.XAxesLabels,{value:`${l.label}`.length<Jt?`${l.label}`:`${`${l.label}`.substring(0,Jt)}...`,y:(l.size||0)<0?0:u(0)+5,x:0,width:k.bandwidth(),height:(l.size||0)<0?u(0)-5:p.bottom,style:m?.xAxis?.labels,className:a?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:r,isInView:I}):null,Wt?s.jsxRuntimeExports.jsx(ft.motion.text,{x:k.bandwidth()/2,style:{textAnchor:"middle",...m?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!Q&&zt.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",a?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{y:u(0),opacity:0,fill:Q||zt},whileInView:{y:u(l.size||0),opacity:1,fill:Q||zt,transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",children:we.numberFormattingFunction(l.size,E,st,V,gt)}):null]},l.label)),P=yt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:yt.map((l,oe)=>s.jsxRuntimeExports.jsx(Ne.RefLineY,{text:l.text,color:l.color,y:u(l.value),x1:0-_,x2:x+p.right,classNames:l.classNames,styles:l.styles,animate:r,isInView:I},oe))}):null,t[27]=r,t[28]=M,t[29]=zt,t[30]=Lt,t[31]=a?.graphObjectValues,t[32]=a?.xAxis?.axis,t[33]=a?.xAxis?.labels,t[34]=a?.yAxis?.gridLines,t[35]=a?.yAxis?.labels,t[36]=a?.yAxis?.title,t[37]=Z,t[38]=n,t[39]=N,t[40]=c,t[41]=mt,t[42]=x,t[43]=Yt,t[44]=K,t[45]=I,t[46]=D,t[47]=_,t[48]=p.bottom,t[49]=p.left,t[50]=p.right,t[51]=p.top,t[52]=$t,t[53]=d,t[54]=bt,t[55]=U,t[56]=E,t[57]=vt,t[58]=nt,t[59]=ct,t[60]=st,t[61]=V,t[62]=Dt,t[63]=yt,t[64]=St,t[65]=qt,t[66]=ie,t[67]=Wt,t[68]=m?.graphObjectValues,t[69]=m?.xAxis?.axis,t[70]=m?.xAxis?.labels,t[71]=m?.yAxis?.gridLines,t[72]=m?.yAxis?.labels,t[73]=m?.yAxis?.title,t[74]=gt,t[75]=wt,t[76]=h,t[77]=Jt,t[78]=Q,t[79]=pt,t[80]=Vt,t[81]=y,t[82]=C,t[83]=z,t[84]=B,t[85]=P,t[86]=L,t[87]=H,t[88]=G,t[89]=b,t[90]=R,t[91]=O,t[92]=q,t[93]=T,t[94]=v,t[95]=w}else C=t[82],z=t[83],B=t[84],P=t[85],L=t[86],H=t[87],G=t[88],b=t[89],R=t[90],O=t[91],q=t[92],T=t[93],v=t[94],w=t[95];let X;t[118]!==C||t[119]!==B||t[120]!==P?(X=s.jsxRuntimeExports.jsxs(C,{children:[B,P]}),t[118]=C,t[119]=B,t[120]=P,t[121]=X):X=t[121];let Y;t[122]!==Z?(Y=Z.filter(Ge).map(He),t[122]=Z,t[123]=Y):Y=t[123];let W;t[124]!==L||t[125]!==H||t[126]!==G||t[127]!==b||t[128]!==R||t[129]!==X||t[130]!==Y?(W=s.jsxRuntimeExports.jsxs("g",{transform:L,children:[H,G,b,R,X,Y]}),t[124]=L,t[125]=H,t[126]=G,t[127]=b,t[128]=R,t[129]=X,t[130]=Y,t[131]=W):W=t[131];let $;t[132]!==z||t[133]!==O||t[134]!==q||t[135]!==T||t[136]!==v||t[137]!==w||t[138]!==W?($=s.jsxRuntimeExports.jsx(z,{width:O,height:q,viewBox:T,direction:v,ref:w,children:W}),t[132]=z,t[133]=O,t[134]=q,t[135]=T,t[136]=v,t[137]=w,t[138]=W,t[139]=$):$=t[139];let at;t[140]!==a?.tooltip||t[141]!==tt||t[142]!==Bt||t[143]!==A||t[144]!==m?.tooltip||t[145]!==ut?(at=A&&ut&&tt&&Bt?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:A,body:ut,xPos:tt,yPos:Bt,backgroundStyle:m?.tooltip,className:a?.tooltip}):null,t[140]=a?.tooltip,t[141]=tt,t[142]=Bt,t[143]=A,t[144]=m?.tooltip,t[145]=ut,t[146]=at):at=t[146];let S;t[147]!==N||t[148]!==U?(S=N&&U!==void 0?s.jsxRuntimeExports.jsx(Ae.le,{open:U!==void 0,onClose:()=>{_t(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:Oe.string2HTML(N,U)}:void 0,children:typeof N=="function"?N(U):null})}):null,t[147]=N,t[148]=U,t[149]=S):S=t[149];let Ct;return t[150]!==$||t[151]!==at||t[152]!==S?(Ct=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[$,at,S]}),t[150]=$,t[151]=at,t[152]=S,t[153]=Ct):Ct=t[153],Ct}function He(e){return e.layer}function Ge(e){return e.position==="after"}function Xe(e){return e.layer}function Ye(e){return e.position==="before"}function We(e){return e!==0}function Je(e){return e!==0}function Ke(e){return`${e.id}`}function Qe(e){return e.target}function Ze(e){return!f.checkIfNullOrUndefined(e.target)}function _e(e){return e.target}function ti(e){return!f.checkIfNullOrUndefined(e.target)}function ei(e){return e.size}function ii(e){return!f.checkIfNullOrUndefined(e.size)}function ni(e){return e.size}function si(e){return!f.checkIfNullOrUndefined(e.size)}function ai(e){return fe.sum((e.qualitativeRange||[]).filter(li))||0}function li(e){return!f.checkIfNullOrUndefined(e)}function oi(e){return e.target}function ri(e){return!f.checkIfNullOrUndefined(e.size)}function ui(e){return e.target}function ci(e){return!f.checkIfNullOrUndefined(e.target)}function xi(e){return e.size}function mi(e){return!f.checkIfNullOrUndefined(e.size)}function hi(e){return e.size}function di(e){return!f.checkIfNullOrUndefined(e.size)}function fi(e){const t=s.compilerRuntimeExports.c(146),{data:n,topMargin:pt,bottomMargin:Yt,leftMargin:zt,rightMargin:gt,barColor:V,suffix:Lt,prefix:qt,barPadding:Wt,showValues:ie,showTicks:Jt,truncateBy:ne,width:Tt,height:Kt,showLabels:re,tooltip:ut,onSeriesMouseOver:ct,refValues:yt,highlightedDataPoints:g,maxValue:xt,minValue:K,onSeriesMouseClick:nt,labelOrder:D,rtl:$t,maxBarThickness:bt,minBarThickness:St,resetSelectionOnDoubleClick:N,detailsOnClick:M,barAxisTitle:Q,valueColor:vt,noOfTicks:m,styles:a,classNames:h,targetStyle:wt,targetColor:Dt,qualitativeRangeColors:d,measureBarWidthFactor:r,animate:c,dimmedOpacity:st,precision:Z,customLayers:E,naLabel:_}=e,Ft=pt===void 0?25:pt,se=Yt===void 0?10:Yt,ae=zt===void 0?100:zt,Qt=gt===void 0?40:gt,le=rt.useRef(null);let I;t[0]!==c.amount||t[1]!==c.once?(I={once:c.once,amount:c.amount},t[0]=c.amount,t[1]=c.once,t[2]=I):I=t[2];const F=Ce.useInView(le,I),[Ut,p]=rt.useState(void 0),[A,Zt]=rt.useState(void 0),[U,_t]=rt.useState(void 0),[tt,te]=rt.useState(void 0),Bt=Q?Ft+25:Ft;let ee;t[3]!==se||t[4]!==ae||t[5]!==Qt||t[6]!==Bt?(ee={top:Bt,bottom:se,left:ae,right:Qt},t[3]=se,t[4]=ae,t[5]=Qt,t[6]=Bt,t[7]=ee):ee=t[7];const x=ee,mt=Tt-x.left-x.right,et=Kt-x.top-x.bottom;let jt;t[8]!==n?(jt=Math.max(...n.filter(Fi).map(Di))<0?0:Math.max(...n.filter(Si).map($i)),t[8]=n,t[9]=jt):jt=t[9];const Mt=jt;let At;t[10]!==n?(At=Math.max(...n.filter(Ti).map(qi))<0?0:Math.max(...n.filter(Li).map(zi)),t[10]=n,t[11]=At):At=t[11];const Rt=At;let Ot;t[12]!==n?(Ot=Math.max(...n.map(Ii)),t[12]=n,t[13]=Ot):Ot=t[13];const kt=Ot;let Vt;t[14]!==Mt||t[15]!==xt||t[16]!==kt||t[17]!==Rt?(Vt=f.checkIfNullOrUndefined(xt)?Math.max(...[Mt,Rt,kt].filter(Number.isFinite))<0?0:Math.max(...[Mt,Rt,kt].filter(Number.isFinite)):xt,t[14]=Mt,t[15]=xt,t[16]=kt,t[17]=Rt,t[18]=Vt):Vt=t[18];const Pt=Vt;let Nt;t[19]!==n?(Nt=Math.min(...n.filter(Ei).map(Ni))>=0?0:Math.min(...n.filter(Vi).map(ki)),t[19]=n,t[20]=Nt):Nt=t[20];const Et=Nt;let ht;t[21]!==n?(ht=Math.min(...n.filter(Oi).map(Ri))>=0?0:Math.min(...n.filter(Ai).map(Mi)),t[21]=n,t[22]=ht):ht=t[22];const It=ht;let y;t[23]!==Et||t[24]!==K||t[25]!==It?(y=f.checkIfNullOrUndefined(K)?Math.min(...[Et,It].filter(Number.isFinite))>=0?0:Math.min(...[Et,It].filter(Number.isFinite)):K,t[23]=Et,t[24]=K,t[25]=It,t[26]=y):y=t[26];const C=y;let z,B,P,L,H,G,b,R,O,q,T,v,w,X;if(t[27]!==c||t[28]!==Q||t[29]!==V||t[30]!==Wt||t[31]!==h?.graphObjectValues||t[32]!==h?.xAxis?.gridLines||t[33]!==h?.xAxis?.labels||t[34]!==h?.xAxis?.title||t[35]!==h?.yAxis?.axis||t[36]!==h?.yAxis?.labels||t[37]!==E||t[38]!==n||t[39]!==M||t[40]!==st||t[41]!==et||t[42]!==mt||t[43]!==Kt||t[44]!==g||t[45]!==F||t[46]!==D||t[47]!==x.bottom||t[48]!==x.left||t[49]!==x.top||t[50]!==bt||t[51]!==r||t[52]!==St||t[53]!==A||t[54]!==_||t[55]!==m||t[56]!==nt||t[57]!==ct||t[58]!==Z||t[59]!==qt||t[60]!==d||t[61]!==yt||t[62]!==N||t[63]!==$t||t[64]!==re||t[65]!==Jt||t[66]!==ie||t[67]!==a?.graphObjectValues||t[68]!==a?.xAxis?.gridLines||t[69]!==a?.xAxis?.labels||t[70]!==a?.xAxis?.title||t[71]!==a?.yAxis?.axis||t[72]!==a?.yAxis?.labels||t[73]!==Lt||t[74]!==Dt||t[75]!==wt||t[76]!==Ft||t[77]!==ne||t[78]!==vt||t[79]!==Tt||t[80]!==Pt||t[81]!==C){let Ht;t[96]!==D?(Ht=(i,ot)=>({...i,id:D?`${i.label}`:`${ot}`}),t[96]=D,t[97]=Ht):Ht=t[97];const ue=n.map(Ht),o=Ee.linear().domain([C,Pt]).range([0,mt]).nice(),k=D||ue.map(ji),J=Ie.band().domain(k).range([0,St?Math.max(et,St*k.length):bt?Math.min(et,bt*k.length):et]).paddingInner(Wt),xe=o.ticks(m);B=ft.motion.svg,q=`${Tt}px`,T=`${Kt}px`,v=`0 0 ${Tt} ${Kt}`,w="ltr",X=le,H=`translate(${x.left},${x.top})`,G=Jt?s.jsxRuntimeExports.jsx($e.XTicksAndGridLines,{values:xe.filter(wi),x:xe.filter(vi).map(i=>o(i)),y1:0-Ft,y2:et+x.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},suffix:Lt,prefix:qt,labelType:"secondary",showGridLines:!0,precision:Z}):null;const Gt=mt/2,dt=0-x.top+15,lt=a?.xAxis?.title,Xt=h?.xAxis?.title;t[98]!==Q||t[99]!==Gt||t[100]!==dt||t[101]!==lt||t[102]!==Xt?(b=s.jsxRuntimeExports.jsx(Ve.AxisTitle,{x:Gt,y:dt,style:lt,className:Xt,text:Q}),t[98]=Q,t[99]=Gt,t[100]=dt,t[101]=lt,t[102]=Xt,t[103]=b):b=t[103];const j=h?.yAxis?.axis;let it;t[104]!==j?(it={axis:j},t[104]=j,t[105]=it):it=t[105];const he=a?.yAxis?.axis;let me;t[106]!==he?(me={axis:he},t[106]=he,t[107]=me):me=t[107],R=s.jsxRuntimeExports.jsx(ke.Axis,{x1:o(C<0?0:C),x2:o(C<0?0:C),y1:-2.5,y2:et+x.bottom,classNames:it,styles:me}),t[108]!==E?(O=E.filter(bi).map(yi),t[108]=E,t[109]=O):O=t[109],z=ze.AnimatePresence,P=ue.map(i=>f.checkIfNullOrUndefined(J(i.id))?null:s.jsxRuntimeExports.jsxs(ft.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:ot=>{p(i),te(ot.clientY),_t(ot.clientX),ct?.(i)},onClick:()=>{(nt||M)&&(Me.isEqual(A,i)&&N?(Zt(void 0),nt?.(void 0)):(Zt(i),nt?.(i)))},onMouseMove:ot=>{p(i),te(ot.clientY),_t(ot.clientX)},onMouseLeave:()=>{p(void 0),_t(void 0),te(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{x:0,y:J(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:st:.85},whileInView:{x:0,y:J(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:st:.85,transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:[i.qualitativeRange?i.qualitativeRange.map((ot,ce)=>s.jsxRuntimeExports.jsx(ft.motion.rect,{exit:{width:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),width:0,fill:d[ce]},whileInView:{x:o(ce===0?0:fe.sum(i.qualitativeRange.filter((pe,ge)=>ge<ce&&pe))),width:o(ot),fill:d[ce],transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial",y:0,height:J.bandwidth()},ce)):null,i.target&&wt==="background"?s.jsxRuntimeExports.jsx(ft.motion.rect,{y:0,x:i.target>=0?o(0):o(i.target),height:J.bandwidth(),style:{fill:Dt},exit:{width:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),width:0},whileInView:{x:i.target>=0?o(0):o(i.target),width:i.target>=0?o(i.target)-o(0):o(0)-o(i.target),transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.size?s.jsxRuntimeExports.jsx(ft.motion.rect,{y:J.bandwidth()*((1-r)/2),style:{fill:V},height:J.bandwidth()*r,exit:{width:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),width:0},whileInView:{x:i.size>=0?o(0):o(i.size),width:i.size>=0?o(i.size)-o(0):o(0)-o(i.size),transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.target&&wt==="line"?s.jsxRuntimeExports.jsx(ft.motion.rect,{y:0,height:J.bandwidth(),style:{fill:Dt},width:2,exit:{opacity:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),opacity:0},whileInView:{x:o(i.target)-1,opacity:1,transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,re?s.jsxRuntimeExports.jsx(Se.YAxesLabels,{value:`${i.label}`.length<ne?`${i.label}`:`${`${i.label}`.substring(0,ne)}...`,y:0,x:(i.size||0)<0?o(0):0-x.left,width:(i.size||0)<0?Tt-o(0):o(0)+x.left,height:J.bandwidth(),alignment:i.size&&i.size<0?"left":"right",style:a?.yAxis?.labels,className:h?.yAxis?.labels,animate:c,isInView:F}):null,ie?s.jsxRuntimeExports.jsx(ft.motion.text,{y:J.bandwidth()/2,style:{textAnchor:i.size&&i.size<0?"end":"start",...a?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!vt&&V.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",h?.graphObjectValues),dx:i.size&&i.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{x:o(0),opacity:0,fill:vt||V},whileInView:{x:i.size?o(i.size):o(0),opacity:1,fill:vt||V,transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:we.numberFormattingFunction(i.size,_,Z,qt,Lt)}):null]},i.label)),L=yt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:yt.map((i,ot)=>s.jsxRuntimeExports.jsx(Ne.RefLineX,{text:i.text,color:i.color,x:o(i.value),y1:0-x.top,y2:et+x.bottom,textSide:o(i.value)>mt*.75||$t?"left":"right",classNames:i.classNames,styles:i.styles,animate:c,isInView:F},ot))}):null,t[27]=c,t[28]=Q,t[29]=V,t[30]=Wt,t[31]=h?.graphObjectValues,t[32]=h?.xAxis?.gridLines,t[33]=h?.xAxis?.labels,t[34]=h?.xAxis?.title,t[35]=h?.yAxis?.axis,t[36]=h?.yAxis?.labels,t[37]=E,t[38]=n,t[39]=M,t[40]=st,t[41]=et,t[42]=mt,t[43]=Kt,t[44]=g,t[45]=F,t[46]=D,t[47]=x.bottom,t[48]=x.left,t[49]=x.top,t[50]=bt,t[51]=r,t[52]=St,t[53]=A,t[54]=_,t[55]=m,t[56]=nt,t[57]=ct,t[58]=Z,t[59]=qt,t[60]=d,t[61]=yt,t[62]=N,t[63]=$t,t[64]=re,t[65]=Jt,t[66]=ie,t[67]=a?.graphObjectValues,t[68]=a?.xAxis?.gridLines,t[69]=a?.xAxis?.labels,t[70]=a?.xAxis?.title,t[71]=a?.yAxis?.axis,t[72]=a?.yAxis?.labels,t[73]=Lt,t[74]=Dt,t[75]=wt,t[76]=Ft,t[77]=ne,t[78]=vt,t[79]=Tt,t[80]=Pt,t[81]=C,t[82]=z,t[83]=B,t[84]=P,t[85]=L,t[86]=H,t[87]=G,t[88]=b,t[89]=R,t[90]=O,t[91]=q,t[92]=T,t[93]=v,t[94]=w,t[95]=X}else z=t[82],B=t[83],P=t[84],L=t[85],H=t[86],G=t[87],b=t[88],R=t[89],O=t[90],q=t[91],T=t[92],v=t[93],w=t[94],X=t[95];let Y;t[110]!==z||t[111]!==P||t[112]!==L?(Y=s.jsxRuntimeExports.jsxs(z,{children:[P,L]}),t[110]=z,t[111]=P,t[112]=L,t[113]=Y):Y=t[113];let W;t[114]!==E?(W=E.filter(gi).map(pi),t[114]=E,t[115]=W):W=t[115];let $;t[116]!==H||t[117]!==G||t[118]!==b||t[119]!==R||t[120]!==O||t[121]!==Y||t[122]!==W?($=s.jsxRuntimeExports.jsxs("g",{transform:H,children:[G,b,R,O,Y,W]}),t[116]=H,t[117]=G,t[118]=b,t[119]=R,t[120]=O,t[121]=Y,t[122]=W,t[123]=$):$=t[123];let at;t[124]!==B||t[125]!==q||t[126]!==T||t[127]!==v||t[128]!==w||t[129]!==X||t[130]!==$?(at=s.jsxRuntimeExports.jsx(B,{width:q,height:T,viewBox:v,direction:w,ref:X,children:$}),t[124]=B,t[125]=q,t[126]=T,t[127]=v,t[128]=w,t[129]=X,t[130]=$,t[131]=at):at=t[131];let S;t[132]!==h?.tooltip||t[133]!==U||t[134]!==tt||t[135]!==Ut||t[136]!==a?.tooltip||t[137]!==ut?(S=Ut&&ut&&U&&tt?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:Ut,body:ut,xPos:U,yPos:tt,backgroundStyle:a?.tooltip,className:h?.tooltip}):null,t[132]=h?.tooltip,t[133]=U,t[134]=tt,t[135]=Ut,t[136]=a?.tooltip,t[137]=ut,t[138]=S):S=t[138];let Ct;t[139]!==M||t[140]!==A?(Ct=M&&A!==void 0?s.jsxRuntimeExports.jsx(Ae.le,{open:A!==void 0,onClose:()=>{Zt(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof M=="string"?{__html:Oe.string2HTML(M,A)}:void 0,children:typeof M=="function"?M(A):null})}):null,t[139]=M,t[140]=A,t[141]=Ct):Ct=t[141];let u;return t[142]!==at||t[143]!==S||t[144]!==Ct?(u=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[at,S,Ct]}),t[142]=at,t[143]=S,t[144]=Ct,t[145]=u):u=t[145],u}function pi(e){return e.layer}function gi(e){return e.position==="after"}function yi(e){return e.layer}function bi(e){return e.position==="before"}function vi(e){return e!==0}function wi(e){return e!==0}function ji(e){return`${e.id}`}function Mi(e){return e.target}function Ai(e){return!f.checkIfNullOrUndefined(e.target)}function Ri(e){return e.target}function Oi(e){return!f.checkIfNullOrUndefined(e.target)}function ki(e){return e.size}function Vi(e){return!f.checkIfNullOrUndefined(e.size)}function Ni(e){return e.size}function Ei(e){return!f.checkIfNullOrUndefined(e.size)}function Ii(e){return fe.sum((e.qualitativeRange||[]).filter(Ci))||0}function Ci(e){return!f.checkIfNullOrUndefined(e)}function zi(e){return e.target}function Li(e){return!f.checkIfNullOrUndefined(e.target)}function qi(e){return e.target}function Ti(e){return!f.checkIfNullOrUndefined(e.target)}function $i(e){return e.size}function Si(e){return!f.checkIfNullOrUndefined(e.size)}function Di(e){return e.size}function Fi(e){return!f.checkIfNullOrUndefined(e.size)}function Ui(e){const t=s.compilerRuntimeExports.c(94),{data:n,graphTitle:pt,barColor:Yt,barPadding:zt,showTicks:gt,leftMargin:V,rightMargin:Lt,topMargin:qt,bottomMargin:Wt,truncateBy:ie,showLabels:Jt,showValues:ne,backgroundColor:Tt,suffix:Kt,prefix:re,sources:ut,graphDescription:ct,height:yt,width:g,footNote:xt,colorDomain:K,colorLegendTitle:nt,padding:D,relativeHeight:$t,tooltip:bt,onSeriesMouseOver:St,refValues:N,showColorScale:M,graphID:Q,maxValue:vt,minValue:m,highlightedDataPoints:a,onSeriesMouseClick:h,valueColor:wt,orientation:Dt,styles:d,classNames:r,qualitativeRangeColors:c,targetColor:st,filterNA:Z,targetStyle:E,measureBarWidthFactor:_,animate:Ft,dimmedOpacity:se,precision:ae,customLayers:Qt,naLabel:le,graphDownload:I,dataDownload:F,language:Ut,theme:p,sortData:A,labelOrder:Zt,minHeight:U,maxBarThickness:_t,maxNumberOfBars:tt,minBarThickness:te,ariaLabel:Bt,resetSelectionOnDoubleClick:ee,detailsOnClick:x,barAxisTitle:mt,noOfTicks:et}=e,jt=Yt===void 0?ve.Colors.primaryColors["blue-600"]:Yt,Mt=zt===void 0?.25:zt,At=gt===void 0?!0:gt,Rt=ie===void 0?999:ie,Ot=Jt===void 0?!0:Jt,kt=ne===void 0?!0:ne,Vt=Tt===void 0?!1:Tt,Pt=Kt===void 0?"":Kt,Nt=re===void 0?"":re,Et=M===void 0?!0:M;let ht;t[0]!==a?(ht=a===void 0?[]:a,t[0]=a,t[1]=ht):ht=t[1];const It=ht,y=Dt===void 0?"vertical":Dt,C=st===void 0?ve.Colors.light.grays["gray-700"]:st,z=Z===void 0?!0:Z,B=E===void 0?"line":E,P=_===void 0?.4:_,L=Ft===void 0?!1:Ft,H=se===void 0?.3:se,G=ae===void 0?2:ae;let b;t[2]!==Qt?(b=Qt===void 0?[]:Qt,t[2]=Qt,t[3]=b):b=t[3];const R=b,O=le===void 0?"NA":le,q=I===void 0?!1:I,T=F===void 0?!1:F,v=Ut===void 0?"en":Ut,w=p===void 0?"light":p,X=U===void 0?0:U,Y=ee===void 0?!0:ee,W=et===void 0?5:et,[$,at]=rt.useState(0),[S,Ct]=rt.useState(0),u=rt.useRef(null),Ht=rt.useRef(null),ue=y==="horizontal"?fi:Pe;let o,k;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{const j=new ResizeObserver(it=>{at(it[0].target.clientWidth||620),Ct(it[0].target.clientHeight||480)});return u.current&&j.observe(u.current),()=>j.disconnect()},k=[],t[4]=o,t[5]=k):(o=t[4],k=t[5]),rt.useEffect(o,k);const J=r?.graphContainer,xe=d?.graphContainer;let Gt;t[6]!==r?.description||t[7]!==r?.title||t[8]!==n||t[9]!==T||t[10]!==ct||t[11]!==q||t[12]!==pt||t[13]!==d?.description||t[14]!==d?.title||t[15]!==g?(Gt=pt||ct||q||T?s.jsxRuntimeExports.jsx(Ue.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:r?.title,description:r?.description},graphTitle:pt,graphDescription:ct,width:g,graphDownload:q?Ht:void 0,dataDownload:T?n.map(Yi).filter(Xi).length>0?n.map(Gi).filter(Hi):n.filter(Pi):null}):null,t[6]=r?.description,t[7]=r?.title,t[8]=n,t[9]=T,t[10]=ct,t[11]=q,t[12]=pt,t[13]=d?.description,t[14]=d?.title,t[15]=g,t[16]=Gt):Gt=t[16];let dt;t[17]!==ue||t[18]!==L||t[19]!==mt||t[20]!==jt||t[21]!==Mt||t[22]!==Wt||t[23]!==r||t[24]!==K||t[25]!==nt||t[26]!==R||t[27]!==n||t[28]!==x||t[29]!==H||t[30]!==z||t[31]!==It||t[32]!==Zt||t[33]!==v||t[34]!==V||t[35]!==_t||t[36]!==tt||t[37]!==vt||t[38]!==P||t[39]!==te||t[40]!==m||t[41]!==O||t[42]!==W||t[43]!==h||t[44]!==St||t[45]!==y||t[46]!==G||t[47]!==Nt||t[48]!==c||t[49]!==N||t[50]!==Y||t[51]!==Lt||t[52]!==Et||t[53]!==Ot||t[54]!==At||t[55]!==kt||t[56]!==A||t[57]!==d||t[58]!==Pt||t[59]!==S||t[60]!==$||t[61]!==C||t[62]!==B||t[63]!==w||t[64]!==bt||t[65]!==qt||t[66]!==Rt||t[67]!==wt||t[68]!==g?(dt=n.length===0?s.jsxRuntimeExports.jsx(De.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Et&&n.filter(Bi).length!==0&&K?s.jsxRuntimeExports.jsx(Be.ColorLegend,{width:g,colorLegendTitle:nt,colors:c||ve.Colors[w].sequentialColors.positiveColorsx10,colorDomain:K,showNAColor:!1,className:r?.colorLegend}):null,s.jsxRuntimeExports.jsx(je.GraphArea,{ref:u,children:$&&S?s.jsxRuntimeExports.jsx(ue,{data:A?Le.orderBy(n.filter(j=>z?!f.checkIfNullOrUndefined(j.size):j),[j=>j.size===void 0?A==="asc"?(y==="horizontal"?1:-1)*(1/0):(y==="horizontal"?-1:1)*(1/0):j.size],[A]).filter((j,it)=>tt?it<tt:!0):n.filter(j=>z?!f.checkIfNullOrUndefined(j.size):j).filter((j,it)=>tt?it<tt:!0),barColor:jt,targetColor:C,width:$,refValues:N,height:S,suffix:Pt,prefix:Nt,barPadding:Mt,showLabels:Ot,showValues:kt,showTicks:At,truncateBy:Rt,leftMargin:V,rightMargin:Lt,qualitativeRangeColors:c||ve.Colors[w].sequentialColors.positiveColorsx10,topMargin:qt,bottomMargin:Wt,tooltip:bt,onSeriesMouseOver:St,maxValue:vt,minValue:m,highlightedDataPoints:It,onSeriesMouseClick:h,labelOrder:Zt,maxBarThickness:_t,minBarThickness:te,resetSelectionOnDoubleClick:Y,detailsOnClick:x,barAxisTitle:mt,noOfTicks:W,valueColor:wt,styles:d,classNames:r,targetStyle:B,dimmedOpacity:H,measureBarWidthFactor:P,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},precision:G,customLayers:R,naLabel:O,rtl:v==="ar"||v==="he"}):null})]}),t[17]=ue,t[18]=L,t[19]=mt,t[20]=jt,t[21]=Mt,t[22]=Wt,t[23]=r,t[24]=K,t[25]=nt,t[26]=R,t[27]=n,t[28]=x,t[29]=H,t[30]=z,t[31]=It,t[32]=Zt,t[33]=v,t[34]=V,t[35]=_t,t[36]=tt,t[37]=vt,t[38]=P,t[39]=te,t[40]=m,t[41]=O,t[42]=W,t[43]=h,t[44]=St,t[45]=y,t[46]=G,t[47]=Nt,t[48]=c,t[49]=N,t[50]=Y,t[51]=Lt,t[52]=Et,t[53]=Ot,t[54]=At,t[55]=kt,t[56]=A,t[57]=d,t[58]=Pt,t[59]=S,t[60]=$,t[61]=C,t[62]=B,t[63]=w,t[64]=bt,t[65]=qt,t[66]=Rt,t[67]=wt,t[68]=g,t[69]=dt):dt=t[69];let lt;t[70]!==r?.footnote||t[71]!==r?.source||t[72]!==xt||t[73]!==ut||t[74]!==d?.footnote||t[75]!==d?.source||t[76]!==g?(lt=ut||xt?s.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:r?.footnote,source:r?.source},sources:ut,footNote:xt,width:g}):null,t[70]=r?.footnote,t[71]=r?.source,t[72]=xt,t[73]=ut,t[74]=d?.footnote,t[75]=d?.source,t[76]=g,t[77]=lt):lt=t[77];let Xt;return t[78]!==Bt||t[79]!==Vt||t[80]!==Q||t[81]!==yt||t[82]!==v||t[83]!==X||t[84]!==D||t[85]!==$t||t[86]!==J||t[87]!==xe||t[88]!==Gt||t[89]!==dt||t[90]!==lt||t[91]!==w||t[92]!==g?(Xt=s.jsxRuntimeExports.jsxs(je.GraphContainer,{className:J,style:xe,id:Q,ref:Ht,"aria-label":Bt,backgroundColor:Vt,theme:w,language:v,minHeight:X,width:g,height:yt,relativeHeight:$t,padding:D,children:[Gt,dt,lt]}),t[78]=Bt,t[79]=Vt,t[80]=Q,t[81]=yt,t[82]=v,t[83]=X,t[84]=D,t[85]=$t,t[86]=J,t[87]=xe,t[88]=Gt,t[89]=dt,t[90]=lt,t[91]=w,t[92]=g,t[93]=Xt):Xt=t[93],Xt}function Bi(e){return e.qualitativeRange}function Pi(e){return e!==void 0}function Hi(e){return e!==void 0}function Gi(e){return e.data}function Xi(e){return e!==void 0}function Yi(e){return e.data}exports.BulletChart=Ui;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("./index-CHPV5EwG-CTPQjnHt.cjs"),rt=require("react"),Le=require("./index-Cno4Q0YE.cjs"),Me=require("./index-DQA8q5sC.cjs"),Ae=require("./Modal-JW_IExO3.cjs"),fe=require("./index-CSNtgibC.cjs"),we=require("./numberFormattingFunction-02t-wJta.cjs"),Re=require("./Tooltip-4dJo4_AF.cjs"),f=require("./checkIfNullOrUndefined-BCW3Y1ML.cjs"),Oe=require("./string2HTML-CPGr_I5E.cjs"),ke=require("./Axis-DxRV2yMi.cjs"),Ve=require("./AxisTitle-sS5bLLR7.cjs"),qe=require("./XAxesLabels-C1XSXoWG.cjs"),Ne=require("./ReferenceLine-BH0qdf4R.cjs"),Te=require("./YTicksAndGridLines-4pxTRlRK.cjs"),$e=require("./XTicksAndGridLines-B6CELS7q.cjs"),Se=require("./YAxesLabels-pjdsVwIM.cjs"),Ee=require("./linear-BwPAspcq.cjs"),Ie=require("./band-VYfcZeJ2.cjs"),Ce=require("./use-in-view-QcfiW0w3.cjs"),ft=require("./proxy-BxvUI_9l.cjs"),ze=require("./index-DG2bgAva.cjs"),ve=require("./Colors.cjs"),De=require("./EmptyState-sAEZ_5rU.cjs"),je=require("./GraphContainer-d8A46BK2.cjs"),Fe=require("./GraphFooter.cjs"),Ue=require("./GraphHeader.cjs"),Be=require("./ColorLegend.cjs");function Pe(e){const t=s.compilerRuntimeExports.c(154),{data:n,width:pt,height:Yt,barColor:zt,suffix:gt,prefix:V,barPadding:Lt,showLabels:qt,showValues:Wt,showTicks:ie,truncateBy:Jt,leftMargin:ne,rightMargin:Tt,topMargin:Kt,bottomMargin:re,tooltip:ut,onSeriesMouseOver:ct,refValues:yt,maxValue:g,minValue:xt,highlightedDataPoints:K,onSeriesMouseClick:nt,labelOrder:D,maxBarThickness:$t,minBarThickness:bt,resetSelectionOnDoubleClick:St,detailsOnClick:N,barAxisTitle:M,valueColor:Q,noOfTicks:vt,styles:m,classNames:a,targetStyle:h,targetColor:wt,qualitativeRangeColors:Dt,measureBarWidthFactor:d,animate:r,dimmedOpacity:c,precision:st,customLayers:Z,naLabel:E}=e,_=ne===void 0?20:ne,Ft=Tt===void 0?20:Tt,se=Kt===void 0?20:Kt,ae=re===void 0?25:re,Qt=rt.useRef(null);let le;t[0]!==r.amount||t[1]!==r.once?(le={once:r.once,amount:r.amount},t[0]=r.amount,t[1]=r.once,t[2]=le):le=t[2];const I=Ce.useInView(Qt,le),F=M?_+30:_;let Ut;t[3]!==ae||t[4]!==Ft||t[5]!==F||t[6]!==se?(Ut={top:se,bottom:ae,left:F,right:Ft},t[3]=ae,t[4]=Ft,t[5]=F,t[6]=se,t[7]=Ut):Ut=t[7];const p=Ut,[A,Zt]=rt.useState(void 0),[U,_t]=rt.useState(void 0),[tt,te]=rt.useState(void 0),[Bt,ee]=rt.useState(void 0),x=pt-p.left-p.right,mt=Yt-p.top-p.bottom;let et;t[8]!==n?(et=Math.max(...n.filter(di).map(hi))<0?0:Math.max(...n.filter(mi).map(xi)),t[8]=n,t[9]=et):et=t[9];const jt=et;let Mt;t[10]!==n?(Mt=Math.max(...n.filter(ci).map(ui))<0?0:Math.max(...n.filter(ri).map(oi)),t[10]=n,t[11]=Mt):Mt=t[11];const At=Mt;let Rt;t[12]!==n?(Rt=Math.max(...n.map(ai)),t[12]=n,t[13]=Rt):Rt=t[13];const Ot=Rt;let kt;t[14]!==jt||t[15]!==g||t[16]!==Ot||t[17]!==At?(kt=f.checkIfNullOrUndefined(g)?Math.max(...[jt,At,Ot].filter(Number.isFinite))<0?0:Math.max(...[jt,At,Ot].filter(Number.isFinite)):g,t[14]=jt,t[15]=g,t[16]=Ot,t[17]=At,t[18]=kt):kt=t[18];const Vt=kt;let Pt;t[19]!==n?(Pt=Math.min(...n.filter(si).map(ni))>=0?0:Math.min(...n.filter(ii).map(ei)),t[19]=n,t[20]=Pt):Pt=t[20];const Nt=Pt;let Et;t[21]!==n?(Et=Math.min(...n.filter(ti).map(_e))>=0?0:Math.min(...n.filter(Ze).map(Qe)),t[21]=n,t[22]=Et):Et=t[22];const ht=Et;let It;t[23]!==Nt||t[24]!==xt||t[25]!==ht?(It=f.checkIfNullOrUndefined(xt)?Math.min(...[Nt,ht].filter(Number.isFinite))>=0?0:Math.min(...[Nt,ht].filter(Number.isFinite)):xt,t[23]=Nt,t[24]=xt,t[25]=ht,t[26]=It):It=t[26];const y=It;let C,z,B,P,L,H,G,b,R,O,q,T,v,w;if(t[27]!==r||t[28]!==M||t[29]!==zt||t[30]!==Lt||t[31]!==a?.graphObjectValues||t[32]!==a?.xAxis?.axis||t[33]!==a?.xAxis?.labels||t[34]!==a?.yAxis?.gridLines||t[35]!==a?.yAxis?.labels||t[36]!==a?.yAxis?.title||t[37]!==Z||t[38]!==n||t[39]!==N||t[40]!==c||t[41]!==mt||t[42]!==x||t[43]!==Yt||t[44]!==K||t[45]!==I||t[46]!==D||t[47]!==_||t[48]!==p.bottom||t[49]!==p.left||t[50]!==p.right||t[51]!==p.top||t[52]!==$t||t[53]!==d||t[54]!==bt||t[55]!==U||t[56]!==E||t[57]!==vt||t[58]!==nt||t[59]!==ct||t[60]!==st||t[61]!==V||t[62]!==Dt||t[63]!==yt||t[64]!==St||t[65]!==qt||t[66]!==ie||t[67]!==Wt||t[68]!==m?.graphObjectValues||t[69]!==m?.xAxis?.axis||t[70]!==m?.xAxis?.labels||t[71]!==m?.yAxis?.gridLines||t[72]!==m?.yAxis?.labels||t[73]!==m?.yAxis?.title||t[74]!==gt||t[75]!==wt||t[76]!==h||t[77]!==Jt||t[78]!==Q||t[79]!==pt||t[80]!==Vt||t[81]!==y){const u=Ee.linear().domain([y,Vt]).range([mt,0]).nice();let Ht;t[96]!==D?(Ht=(l,oe)=>({...l,id:D?`${l.label}`:`${oe}`}),t[96]=D,t[97]=Ht):Ht=t[97];const ue=n.map(Ht),o=D||ue.map(Ke),k=Ie.band().domain(o).range([0,bt?Math.max(x,bt*o.length):$t?Math.min(x,$t*o.length):x]).paddingInner(Lt),J=u.ticks(vt);z=ft.motion.svg,O=`${pt}px`,q=`${Yt}px`,T=`0 0 ${pt} ${Yt}`,v="ltr",w=Qt,L=`translate(${p.left},${p.top})`;const xe=u(y<0?0:y),Gt=u(y<0?0:y),dt=y<0?0:y;let lt;t[98]!==E||t[99]!==st||t[100]!==V||t[101]!==gt||t[102]!==dt?(lt=we.numberFormattingFunction(dt,E,st,V,gt),t[98]=E,t[99]=st,t[100]=V,t[101]=gt,t[102]=dt,t[103]=lt):lt=t[103];const Xt=a?.xAxis?.axis,j=a?.yAxis?.labels;let it;t[104]!==Xt||t[105]!==j?(it={axis:Xt,label:j},t[104]=Xt,t[105]=j,t[106]=it):it=t[106];const he=m?.xAxis?.axis,me=m?.yAxis?.labels;let i;t[107]!==he||t[108]!==me?(i={axis:he,label:me},t[107]=he,t[108]=me,t[109]=i):i=t[109],H=s.jsxRuntimeExports.jsx(ke.Axis,{y1:xe,y2:Gt,x1:0-_,x2:x+p.right,label:lt,labelPos:{x:0-_,dx:0,dy:Vt<0?"1em":-5,y:u(y<0?0:y)},classNames:it,styles:i}),G=ie?s.jsxRuntimeExports.jsx(Te.YTicksAndGridLines,{values:J.filter(Je),y:J.filter(We).map(l=>u(l)),x1:0-_,x2:x+p.right,styles:{gridLines:m?.yAxis?.gridLines,labels:m?.yAxis?.labels},classNames:{gridLines:a?.yAxis?.gridLines,labels:a?.yAxis?.labels},suffix:gt,prefix:V,labelType:"secondary",showGridLines:!0,labelPos:"vertical",precision:st}):null;const ot=0-_-15,ce=mt/2,pe=m?.yAxis?.title,ge=a?.yAxis?.title;t[110]!==M||t[111]!==ot||t[112]!==ce||t[113]!==pe||t[114]!==ge?(b=s.jsxRuntimeExports.jsx(Ve.AxisTitle,{x:ot,y:ce,style:pe,className:ge,text:M,rotate90:!0}),t[110]=M,t[111]=ot,t[112]=ce,t[113]=pe,t[114]=ge,t[115]=b):b=t[115],t[116]!==Z?(R=Z.filter(Ye).map(Xe),t[116]=Z,t[117]=R):R=t[117],C=ze.AnimatePresence,B=ue.map(l=>f.checkIfNullOrUndefined(k(l.id))?null:s.jsxRuntimeExports.jsxs(ft.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:oe=>{Zt(l),ee(oe.clientY),te(oe.clientX),ct?.(l)},onClick:()=>{(nt||N)&&(Me.isEqual(U,l)&&St?(_t(void 0),nt?.(void 0)):(_t(l),nt?.(l)))},onMouseMove:oe=>{Zt(l),ee(oe.clientY),te(oe.clientX)},onMouseLeave:()=>{Zt(void 0),te(void 0),ee(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{x:k(`${l.id}`),y:0,opacity:K.length!==0?K.indexOf(l.label)!==-1?.85:c:.85},whileInView:{x:k(`${l.id}`),y:0,opacity:K.length!==0?K.indexOf(l.label)!==-1?.85:c:.85,transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",children:[l.qualitativeRange?l.qualitativeRange.map((oe,de)=>s.jsxRuntimeExports.jsx(ft.motion.rect,{x:0,exit:{height:0,y:u(0),transition:{duration:r.duration}},variants:{initial:{height:0,y:u(0),fill:Dt[de]},whileInView:{height:Math.abs(u(fe.sum(l.qualitativeRange.filter((ye,be)=>be<=de&&ye)))-u(fe.sum(l.qualitativeRange.filter((ye,be)=>be<de&&ye)))),y:u(fe.sum(l.qualitativeRange.filter((ye,be)=>be<=de&&ye))),fill:Dt[de],transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",width:k.bandwidth()},de)):null,l.target&&h==="background"?s.jsxRuntimeExports.jsx(ft.motion.rect,{x:0,width:k.bandwidth(),style:{fill:wt},exit:{height:0,y:u(0),transition:{duration:r.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(l.target)-u(0)),y:l.target>0?u(l.target):u(0),transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial"}):null,l.size?s.jsxRuntimeExports.jsx(ft.motion.rect,{x:k.bandwidth()*((1-d)/2),width:k.bandwidth()*d,style:{fill:zt},exit:{height:0,y:u(0),transition:{duration:r.duration}},variants:{initial:{height:0,y:u(0)},whileInView:{height:Math.abs(u(l.size)-u(0)),y:l.size>0?u(l.size):u(0),transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial"}):null,l.target&&h==="line"?s.jsxRuntimeExports.jsx(ft.motion.rect,{x:0,width:k.bandwidth(),style:{fill:wt},exit:{y:u(0),opacity:0,transition:{duration:r.duration}},variants:{initial:{y:u(0),opacity:0},whileInView:{y:u(l.target)-1,opacity:1,transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",height:2}):null,qt?s.jsxRuntimeExports.jsx(qe.XAxesLabels,{value:`${l.label}`.length<Jt?`${l.label}`:`${`${l.label}`.substring(0,Jt)}...`,y:(l.size||0)<0?0:u(0)+5,x:0,width:k.bandwidth(),height:(l.size||0)<0?u(0)-5:p.bottom,style:m?.xAxis?.labels,className:a?.xAxis?.labels,alignment:(l.size||0)<0?"bottom":"top",animate:r,isInView:I}):null,Wt?s.jsxRuntimeExports.jsx(ft.motion.text,{x:k.bandwidth()/2,style:{textAnchor:"middle",...m?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!Q&&zt.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",a?.graphObjectValues),dy:l.size?l.size>=0?"-5px":"1em":"-5px",exit:{opacity:0,transition:{duration:r.duration}},variants:{initial:{y:u(0),opacity:0,fill:Q||zt},whileInView:{y:u(l.size||0),opacity:1,fill:Q||zt,transition:{duration:r.duration}}},initial:"initial",animate:I?"whileInView":"initial",children:we.numberFormattingFunction(l.size,E,st,V,gt)}):null]},l.label)),P=yt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:yt.map((l,oe)=>s.jsxRuntimeExports.jsx(Ne.RefLineY,{text:l.text,color:l.color,y:u(l.value),x1:0-_,x2:x+p.right,classNames:l.classNames,styles:l.styles,animate:r,isInView:I},oe))}):null,t[27]=r,t[28]=M,t[29]=zt,t[30]=Lt,t[31]=a?.graphObjectValues,t[32]=a?.xAxis?.axis,t[33]=a?.xAxis?.labels,t[34]=a?.yAxis?.gridLines,t[35]=a?.yAxis?.labels,t[36]=a?.yAxis?.title,t[37]=Z,t[38]=n,t[39]=N,t[40]=c,t[41]=mt,t[42]=x,t[43]=Yt,t[44]=K,t[45]=I,t[46]=D,t[47]=_,t[48]=p.bottom,t[49]=p.left,t[50]=p.right,t[51]=p.top,t[52]=$t,t[53]=d,t[54]=bt,t[55]=U,t[56]=E,t[57]=vt,t[58]=nt,t[59]=ct,t[60]=st,t[61]=V,t[62]=Dt,t[63]=yt,t[64]=St,t[65]=qt,t[66]=ie,t[67]=Wt,t[68]=m?.graphObjectValues,t[69]=m?.xAxis?.axis,t[70]=m?.xAxis?.labels,t[71]=m?.yAxis?.gridLines,t[72]=m?.yAxis?.labels,t[73]=m?.yAxis?.title,t[74]=gt,t[75]=wt,t[76]=h,t[77]=Jt,t[78]=Q,t[79]=pt,t[80]=Vt,t[81]=y,t[82]=C,t[83]=z,t[84]=B,t[85]=P,t[86]=L,t[87]=H,t[88]=G,t[89]=b,t[90]=R,t[91]=O,t[92]=q,t[93]=T,t[94]=v,t[95]=w}else C=t[82],z=t[83],B=t[84],P=t[85],L=t[86],H=t[87],G=t[88],b=t[89],R=t[90],O=t[91],q=t[92],T=t[93],v=t[94],w=t[95];let X;t[118]!==C||t[119]!==B||t[120]!==P?(X=s.jsxRuntimeExports.jsxs(C,{children:[B,P]}),t[118]=C,t[119]=B,t[120]=P,t[121]=X):X=t[121];let Y;t[122]!==Z?(Y=Z.filter(Ge).map(He),t[122]=Z,t[123]=Y):Y=t[123];let W;t[124]!==L||t[125]!==H||t[126]!==G||t[127]!==b||t[128]!==R||t[129]!==X||t[130]!==Y?(W=s.jsxRuntimeExports.jsxs("g",{transform:L,children:[H,G,b,R,X,Y]}),t[124]=L,t[125]=H,t[126]=G,t[127]=b,t[128]=R,t[129]=X,t[130]=Y,t[131]=W):W=t[131];let $;t[132]!==z||t[133]!==O||t[134]!==q||t[135]!==T||t[136]!==v||t[137]!==w||t[138]!==W?($=s.jsxRuntimeExports.jsx(z,{width:O,height:q,viewBox:T,direction:v,ref:w,children:W}),t[132]=z,t[133]=O,t[134]=q,t[135]=T,t[136]=v,t[137]=w,t[138]=W,t[139]=$):$=t[139];let at;t[140]!==a?.tooltip||t[141]!==tt||t[142]!==Bt||t[143]!==A||t[144]!==m?.tooltip||t[145]!==ut?(at=A&&ut&&tt&&Bt?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:A,body:ut,xPos:tt,yPos:Bt,backgroundStyle:m?.tooltip,className:a?.tooltip}):null,t[140]=a?.tooltip,t[141]=tt,t[142]=Bt,t[143]=A,t[144]=m?.tooltip,t[145]=ut,t[146]=at):at=t[146];let S;t[147]!==N||t[148]!==U?(S=N&&U!==void 0?s.jsxRuntimeExports.jsx(Ae.le,{open:U!==void 0,onClose:()=>{_t(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof N=="string"?{__html:Oe.string2HTML(N,U)}:void 0,children:typeof N=="function"?N(U):null})}):null,t[147]=N,t[148]=U,t[149]=S):S=t[149];let Ct;return t[150]!==$||t[151]!==at||t[152]!==S?(Ct=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[$,at,S]}),t[150]=$,t[151]=at,t[152]=S,t[153]=Ct):Ct=t[153],Ct}function He(e){return e.layer}function Ge(e){return e.position==="after"}function Xe(e){return e.layer}function Ye(e){return e.position==="before"}function We(e){return e!==0}function Je(e){return e!==0}function Ke(e){return`${e.id}`}function Qe(e){return e.target}function Ze(e){return!f.checkIfNullOrUndefined(e.target)}function _e(e){return e.target}function ti(e){return!f.checkIfNullOrUndefined(e.target)}function ei(e){return e.size}function ii(e){return!f.checkIfNullOrUndefined(e.size)}function ni(e){return e.size}function si(e){return!f.checkIfNullOrUndefined(e.size)}function ai(e){return fe.sum((e.qualitativeRange||[]).filter(li))||0}function li(e){return!f.checkIfNullOrUndefined(e)}function oi(e){return e.target}function ri(e){return!f.checkIfNullOrUndefined(e.size)}function ui(e){return e.target}function ci(e){return!f.checkIfNullOrUndefined(e.target)}function xi(e){return e.size}function mi(e){return!f.checkIfNullOrUndefined(e.size)}function hi(e){return e.size}function di(e){return!f.checkIfNullOrUndefined(e.size)}function fi(e){const t=s.compilerRuntimeExports.c(146),{data:n,topMargin:pt,bottomMargin:Yt,leftMargin:zt,rightMargin:gt,barColor:V,suffix:Lt,prefix:qt,barPadding:Wt,showValues:ie,showTicks:Jt,truncateBy:ne,width:Tt,height:Kt,showLabels:re,tooltip:ut,onSeriesMouseOver:ct,refValues:yt,highlightedDataPoints:g,maxValue:xt,minValue:K,onSeriesMouseClick:nt,labelOrder:D,rtl:$t,maxBarThickness:bt,minBarThickness:St,resetSelectionOnDoubleClick:N,detailsOnClick:M,barAxisTitle:Q,valueColor:vt,noOfTicks:m,styles:a,classNames:h,targetStyle:wt,targetColor:Dt,qualitativeRangeColors:d,measureBarWidthFactor:r,animate:c,dimmedOpacity:st,precision:Z,customLayers:E,naLabel:_}=e,Ft=pt===void 0?25:pt,se=Yt===void 0?10:Yt,ae=zt===void 0?100:zt,Qt=gt===void 0?40:gt,le=rt.useRef(null);let I;t[0]!==c.amount||t[1]!==c.once?(I={once:c.once,amount:c.amount},t[0]=c.amount,t[1]=c.once,t[2]=I):I=t[2];const F=Ce.useInView(le,I),[Ut,p]=rt.useState(void 0),[A,Zt]=rt.useState(void 0),[U,_t]=rt.useState(void 0),[tt,te]=rt.useState(void 0),Bt=Q?Ft+25:Ft;let ee;t[3]!==se||t[4]!==ae||t[5]!==Qt||t[6]!==Bt?(ee={top:Bt,bottom:se,left:ae,right:Qt},t[3]=se,t[4]=ae,t[5]=Qt,t[6]=Bt,t[7]=ee):ee=t[7];const x=ee,mt=Tt-x.left-x.right,et=Kt-x.top-x.bottom;let jt;t[8]!==n?(jt=Math.max(...n.filter(Fi).map(Di))<0?0:Math.max(...n.filter(Si).map($i)),t[8]=n,t[9]=jt):jt=t[9];const Mt=jt;let At;t[10]!==n?(At=Math.max(...n.filter(Ti).map(qi))<0?0:Math.max(...n.filter(Li).map(zi)),t[10]=n,t[11]=At):At=t[11];const Rt=At;let Ot;t[12]!==n?(Ot=Math.max(...n.map(Ii)),t[12]=n,t[13]=Ot):Ot=t[13];const kt=Ot;let Vt;t[14]!==Mt||t[15]!==xt||t[16]!==kt||t[17]!==Rt?(Vt=f.checkIfNullOrUndefined(xt)?Math.max(...[Mt,Rt,kt].filter(Number.isFinite))<0?0:Math.max(...[Mt,Rt,kt].filter(Number.isFinite)):xt,t[14]=Mt,t[15]=xt,t[16]=kt,t[17]=Rt,t[18]=Vt):Vt=t[18];const Pt=Vt;let Nt;t[19]!==n?(Nt=Math.min(...n.filter(Ei).map(Ni))>=0?0:Math.min(...n.filter(Vi).map(ki)),t[19]=n,t[20]=Nt):Nt=t[20];const Et=Nt;let ht;t[21]!==n?(ht=Math.min(...n.filter(Oi).map(Ri))>=0?0:Math.min(...n.filter(Ai).map(Mi)),t[21]=n,t[22]=ht):ht=t[22];const It=ht;let y;t[23]!==Et||t[24]!==K||t[25]!==It?(y=f.checkIfNullOrUndefined(K)?Math.min(...[Et,It].filter(Number.isFinite))>=0?0:Math.min(...[Et,It].filter(Number.isFinite)):K,t[23]=Et,t[24]=K,t[25]=It,t[26]=y):y=t[26];const C=y;let z,B,P,L,H,G,b,R,O,q,T,v,w,X;if(t[27]!==c||t[28]!==Q||t[29]!==V||t[30]!==Wt||t[31]!==h?.graphObjectValues||t[32]!==h?.xAxis?.gridLines||t[33]!==h?.xAxis?.labels||t[34]!==h?.xAxis?.title||t[35]!==h?.yAxis?.axis||t[36]!==h?.yAxis?.labels||t[37]!==E||t[38]!==n||t[39]!==M||t[40]!==st||t[41]!==et||t[42]!==mt||t[43]!==Kt||t[44]!==g||t[45]!==F||t[46]!==D||t[47]!==x.bottom||t[48]!==x.left||t[49]!==x.top||t[50]!==bt||t[51]!==r||t[52]!==St||t[53]!==A||t[54]!==_||t[55]!==m||t[56]!==nt||t[57]!==ct||t[58]!==Z||t[59]!==qt||t[60]!==d||t[61]!==yt||t[62]!==N||t[63]!==$t||t[64]!==re||t[65]!==Jt||t[66]!==ie||t[67]!==a?.graphObjectValues||t[68]!==a?.xAxis?.gridLines||t[69]!==a?.xAxis?.labels||t[70]!==a?.xAxis?.title||t[71]!==a?.yAxis?.axis||t[72]!==a?.yAxis?.labels||t[73]!==Lt||t[74]!==Dt||t[75]!==wt||t[76]!==Ft||t[77]!==ne||t[78]!==vt||t[79]!==Tt||t[80]!==Pt||t[81]!==C){let Ht;t[96]!==D?(Ht=(i,ot)=>({...i,id:D?`${i.label}`:`${ot}`}),t[96]=D,t[97]=Ht):Ht=t[97];const ue=n.map(Ht),o=Ee.linear().domain([C,Pt]).range([0,mt]).nice(),k=D||ue.map(ji),J=Ie.band().domain(k).range([0,St?Math.max(et,St*k.length):bt?Math.min(et,bt*k.length):et]).paddingInner(Wt),xe=o.ticks(m);B=ft.motion.svg,q=`${Tt}px`,T=`${Kt}px`,v=`0 0 ${Tt} ${Kt}`,w="ltr",X=le,H=`translate(${x.left},${x.top})`,G=Jt?s.jsxRuntimeExports.jsx($e.XTicksAndGridLines,{values:xe.filter(wi),x:xe.filter(vi).map(i=>o(i)),y1:0-Ft,y2:et+x.bottom,styles:{gridLines:a?.xAxis?.gridLines,labels:a?.xAxis?.labels},classNames:{gridLines:h?.xAxis?.gridLines,labels:h?.xAxis?.labels},suffix:Lt,prefix:qt,labelType:"secondary",showGridLines:!0,precision:Z}):null;const Gt=mt/2,dt=0-x.top+15,lt=a?.xAxis?.title,Xt=h?.xAxis?.title;t[98]!==Q||t[99]!==Gt||t[100]!==dt||t[101]!==lt||t[102]!==Xt?(b=s.jsxRuntimeExports.jsx(Ve.AxisTitle,{x:Gt,y:dt,style:lt,className:Xt,text:Q}),t[98]=Q,t[99]=Gt,t[100]=dt,t[101]=lt,t[102]=Xt,t[103]=b):b=t[103];const j=h?.yAxis?.axis;let it;t[104]!==j?(it={axis:j},t[104]=j,t[105]=it):it=t[105];const he=a?.yAxis?.axis;let me;t[106]!==he?(me={axis:he},t[106]=he,t[107]=me):me=t[107],R=s.jsxRuntimeExports.jsx(ke.Axis,{x1:o(C<0?0:C),x2:o(C<0?0:C),y1:-2.5,y2:et+x.bottom,classNames:it,styles:me}),t[108]!==E?(O=E.filter(bi).map(yi),t[108]=E,t[109]=O):O=t[109],z=ze.AnimatePresence,P=ue.map(i=>f.checkIfNullOrUndefined(J(i.id))?null:s.jsxRuntimeExports.jsxs(ft.motion.g,{className:"undp-viz-g-with-hover",onMouseEnter:ot=>{p(i),te(ot.clientY),_t(ot.clientX),ct?.(i)},onClick:()=>{(nt||M)&&(Me.isEqual(A,i)&&N?(Zt(void 0),nt?.(void 0)):(Zt(i),nt?.(i)))},onMouseMove:ot=>{p(i),te(ot.clientY),_t(ot.clientX)},onMouseLeave:()=>{p(void 0),_t(void 0),te(void 0),ct?.(void 0)},exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{x:0,y:J(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:st:.85},whileInView:{x:0,y:J(`${i.id}`),opacity:g.length!==0?g.indexOf(i.label)!==-1?.85:st:.85,transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:[i.qualitativeRange?i.qualitativeRange.map((ot,ce)=>s.jsxRuntimeExports.jsx(ft.motion.rect,{exit:{width:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),width:0,fill:d[ce]},whileInView:{x:o(ce===0?0:fe.sum(i.qualitativeRange.filter((pe,ge)=>ge<ce&&pe))),width:o(ot),fill:d[ce],transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial",y:0,height:J.bandwidth()},ce)):null,i.target&&wt==="background"?s.jsxRuntimeExports.jsx(ft.motion.rect,{y:0,x:i.target>=0?o(0):o(i.target),height:J.bandwidth(),style:{fill:Dt},exit:{width:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),width:0},whileInView:{x:i.target>=0?o(0):o(i.target),width:i.target>=0?o(i.target)-o(0):o(0)-o(i.target),transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.size?s.jsxRuntimeExports.jsx(ft.motion.rect,{y:J.bandwidth()*((1-r)/2),style:{fill:V},height:J.bandwidth()*r,exit:{width:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),width:0},whileInView:{x:i.size>=0?o(0):o(i.size),width:i.size>=0?o(i.size)-o(0):o(0)-o(i.size),transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,i.target&&wt==="line"?s.jsxRuntimeExports.jsx(ft.motion.rect,{y:0,height:J.bandwidth(),style:{fill:Dt},width:2,exit:{opacity:0,x:o(0),transition:{duration:c.duration}},variants:{initial:{x:o(0),opacity:0},whileInView:{x:o(i.target)-1,opacity:1,transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial"}):null,re?s.jsxRuntimeExports.jsx(Se.YAxesLabels,{value:`${i.label}`.length<ne?`${i.label}`:`${`${i.label}`.substring(0,ne)}...`,y:0,x:(i.size||0)<0?o(0):0-x.left,width:(i.size||0)<0?Tt-o(0):o(0)+x.left,height:J.bandwidth(),alignment:i.size&&i.size<0?"left":"right",style:a?.yAxis?.labels,className:h?.yAxis?.labels,animate:c,isInView:F}):null,ie?s.jsxRuntimeExports.jsx(ft.motion.text,{y:J.bandwidth()/2,style:{textAnchor:i.size&&i.size<0?"end":"start",...a?.graphObjectValues||{}},className:s.mo("graph-value text-sm",!vt&&V.length>1?" fill-primary-gray-600 dark:fill-primary-gray-300":"",h?.graphObjectValues),dx:i.size&&i.size<0?-5:5,dy:"0.33em",exit:{opacity:0,transition:{duration:c.duration}},variants:{initial:{x:o(0),opacity:0,fill:vt||V},whileInView:{x:i.size?o(i.size):o(0),opacity:1,fill:vt||V,transition:{duration:c.duration}}},initial:"initial",animate:F?"whileInView":"initial",children:we.numberFormattingFunction(i.size,_,Z,qt,Lt)}):null]},i.label)),L=yt?s.jsxRuntimeExports.jsx(s.jsxRuntimeExports.Fragment,{children:yt.map((i,ot)=>s.jsxRuntimeExports.jsx(Ne.RefLineX,{text:i.text,color:i.color,x:o(i.value),y1:0-x.top,y2:et+x.bottom,textSide:o(i.value)>mt*.75||$t?"left":"right",classNames:i.classNames,styles:i.styles,animate:c,isInView:F},ot))}):null,t[27]=c,t[28]=Q,t[29]=V,t[30]=Wt,t[31]=h?.graphObjectValues,t[32]=h?.xAxis?.gridLines,t[33]=h?.xAxis?.labels,t[34]=h?.xAxis?.title,t[35]=h?.yAxis?.axis,t[36]=h?.yAxis?.labels,t[37]=E,t[38]=n,t[39]=M,t[40]=st,t[41]=et,t[42]=mt,t[43]=Kt,t[44]=g,t[45]=F,t[46]=D,t[47]=x.bottom,t[48]=x.left,t[49]=x.top,t[50]=bt,t[51]=r,t[52]=St,t[53]=A,t[54]=_,t[55]=m,t[56]=nt,t[57]=ct,t[58]=Z,t[59]=qt,t[60]=d,t[61]=yt,t[62]=N,t[63]=$t,t[64]=re,t[65]=Jt,t[66]=ie,t[67]=a?.graphObjectValues,t[68]=a?.xAxis?.gridLines,t[69]=a?.xAxis?.labels,t[70]=a?.xAxis?.title,t[71]=a?.yAxis?.axis,t[72]=a?.yAxis?.labels,t[73]=Lt,t[74]=Dt,t[75]=wt,t[76]=Ft,t[77]=ne,t[78]=vt,t[79]=Tt,t[80]=Pt,t[81]=C,t[82]=z,t[83]=B,t[84]=P,t[85]=L,t[86]=H,t[87]=G,t[88]=b,t[89]=R,t[90]=O,t[91]=q,t[92]=T,t[93]=v,t[94]=w,t[95]=X}else z=t[82],B=t[83],P=t[84],L=t[85],H=t[86],G=t[87],b=t[88],R=t[89],O=t[90],q=t[91],T=t[92],v=t[93],w=t[94],X=t[95];let Y;t[110]!==z||t[111]!==P||t[112]!==L?(Y=s.jsxRuntimeExports.jsxs(z,{children:[P,L]}),t[110]=z,t[111]=P,t[112]=L,t[113]=Y):Y=t[113];let W;t[114]!==E?(W=E.filter(gi).map(pi),t[114]=E,t[115]=W):W=t[115];let $;t[116]!==H||t[117]!==G||t[118]!==b||t[119]!==R||t[120]!==O||t[121]!==Y||t[122]!==W?($=s.jsxRuntimeExports.jsxs("g",{transform:H,children:[G,b,R,O,Y,W]}),t[116]=H,t[117]=G,t[118]=b,t[119]=R,t[120]=O,t[121]=Y,t[122]=W,t[123]=$):$=t[123];let at;t[124]!==B||t[125]!==q||t[126]!==T||t[127]!==v||t[128]!==w||t[129]!==X||t[130]!==$?(at=s.jsxRuntimeExports.jsx(B,{width:q,height:T,viewBox:v,direction:w,ref:X,children:$}),t[124]=B,t[125]=q,t[126]=T,t[127]=v,t[128]=w,t[129]=X,t[130]=$,t[131]=at):at=t[131];let S;t[132]!==h?.tooltip||t[133]!==U||t[134]!==tt||t[135]!==Ut||t[136]!==a?.tooltip||t[137]!==ut?(S=Ut&&ut&&U&&tt?s.jsxRuntimeExports.jsx(Re.Tooltip,{data:Ut,body:ut,xPos:U,yPos:tt,backgroundStyle:a?.tooltip,className:h?.tooltip}):null,t[132]=h?.tooltip,t[133]=U,t[134]=tt,t[135]=Ut,t[136]=a?.tooltip,t[137]=ut,t[138]=S):S=t[138];let Ct;t[139]!==M||t[140]!==A?(Ct=M&&A!==void 0?s.jsxRuntimeExports.jsx(Ae.le,{open:A!==void 0,onClose:()=>{Zt(void 0)},children:s.jsxRuntimeExports.jsx("div",{className:"graph-modal-content m-0",dangerouslySetInnerHTML:typeof M=="string"?{__html:Oe.string2HTML(M,A)}:void 0,children:typeof M=="function"?M(A):null})}):null,t[139]=M,t[140]=A,t[141]=Ct):Ct=t[141];let u;return t[142]!==at||t[143]!==S||t[144]!==Ct?(u=s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[at,S,Ct]}),t[142]=at,t[143]=S,t[144]=Ct,t[145]=u):u=t[145],u}function pi(e){return e.layer}function gi(e){return e.position==="after"}function yi(e){return e.layer}function bi(e){return e.position==="before"}function vi(e){return e!==0}function wi(e){return e!==0}function ji(e){return`${e.id}`}function Mi(e){return e.target}function Ai(e){return!f.checkIfNullOrUndefined(e.target)}function Ri(e){return e.target}function Oi(e){return!f.checkIfNullOrUndefined(e.target)}function ki(e){return e.size}function Vi(e){return!f.checkIfNullOrUndefined(e.size)}function Ni(e){return e.size}function Ei(e){return!f.checkIfNullOrUndefined(e.size)}function Ii(e){return fe.sum((e.qualitativeRange||[]).filter(Ci))||0}function Ci(e){return!f.checkIfNullOrUndefined(e)}function zi(e){return e.target}function Li(e){return!f.checkIfNullOrUndefined(e.target)}function qi(e){return e.target}function Ti(e){return!f.checkIfNullOrUndefined(e.target)}function $i(e){return e.size}function Si(e){return!f.checkIfNullOrUndefined(e.size)}function Di(e){return e.size}function Fi(e){return!f.checkIfNullOrUndefined(e.size)}function Ui(e){const t=s.compilerRuntimeExports.c(94),{data:n,graphTitle:pt,barColor:Yt,barPadding:zt,showTicks:gt,leftMargin:V,rightMargin:Lt,topMargin:qt,bottomMargin:Wt,truncateBy:ie,showLabels:Jt,showValues:ne,backgroundColor:Tt,suffix:Kt,prefix:re,sources:ut,graphDescription:ct,height:yt,width:g,footNote:xt,colorDomain:K,colorLegendTitle:nt,padding:D,relativeHeight:$t,tooltip:bt,onSeriesMouseOver:St,refValues:N,showColorScale:M,graphID:Q,maxValue:vt,minValue:m,highlightedDataPoints:a,onSeriesMouseClick:h,valueColor:wt,orientation:Dt,styles:d,classNames:r,qualitativeRangeColors:c,targetColor:st,filterNA:Z,targetStyle:E,measureBarWidthFactor:_,animate:Ft,dimmedOpacity:se,precision:ae,customLayers:Qt,naLabel:le,graphDownload:I,dataDownload:F,language:Ut,theme:p,sortData:A,labelOrder:Zt,minHeight:U,maxBarThickness:_t,maxNumberOfBars:tt,minBarThickness:te,ariaLabel:Bt,resetSelectionOnDoubleClick:ee,detailsOnClick:x,barAxisTitle:mt,noOfTicks:et}=e,jt=Yt===void 0?ve.Colors.primaryColors["blue-600"]:Yt,Mt=zt===void 0?.25:zt,At=gt===void 0?!0:gt,Rt=ie===void 0?999:ie,Ot=Jt===void 0?!0:Jt,kt=ne===void 0?!0:ne,Vt=Tt===void 0?!1:Tt,Pt=Kt===void 0?"":Kt,Nt=re===void 0?"":re,Et=M===void 0?!0:M;let ht;t[0]!==a?(ht=a===void 0?[]:a,t[0]=a,t[1]=ht):ht=t[1];const It=ht,y=Dt===void 0?"vertical":Dt,C=st===void 0?ve.Colors.light.grays["gray-700"]:st,z=Z===void 0?!0:Z,B=E===void 0?"line":E,P=_===void 0?.4:_,L=Ft===void 0?!1:Ft,H=se===void 0?.3:se,G=ae===void 0?2:ae;let b;t[2]!==Qt?(b=Qt===void 0?[]:Qt,t[2]=Qt,t[3]=b):b=t[3];const R=b,O=le===void 0?"NA":le,q=I===void 0?!1:I,T=F===void 0?!1:F,v=Ut===void 0?"en":Ut,w=p===void 0?"light":p,X=U===void 0?0:U,Y=ee===void 0?!0:ee,W=et===void 0?5:et,[$,at]=rt.useState(0),[S,Ct]=rt.useState(0),u=rt.useRef(null),Ht=rt.useRef(null),ue=y==="horizontal"?fi:Pe;let o,k;t[4]===Symbol.for("react.memo_cache_sentinel")?(o=()=>{const j=new ResizeObserver(it=>{at(it[0].target.clientWidth||620),Ct(it[0].target.clientHeight||480)});return u.current&&j.observe(u.current),()=>j.disconnect()},k=[],t[4]=o,t[5]=k):(o=t[4],k=t[5]),rt.useEffect(o,k);const J=r?.graphContainer,xe=d?.graphContainer;let Gt;t[6]!==r?.description||t[7]!==r?.title||t[8]!==n||t[9]!==T||t[10]!==ct||t[11]!==q||t[12]!==pt||t[13]!==d?.description||t[14]!==d?.title||t[15]!==g?(Gt=pt||ct||q||T?s.jsxRuntimeExports.jsx(Ue.GraphHeader,{styles:{title:d?.title,description:d?.description},classNames:{title:r?.title,description:r?.description},graphTitle:pt,graphDescription:ct,width:g,graphDownload:q?Ht:void 0,dataDownload:T?n.map(Yi).filter(Xi).length>0?n.map(Gi).filter(Hi):n.filter(Pi):null}):null,t[6]=r?.description,t[7]=r?.title,t[8]=n,t[9]=T,t[10]=ct,t[11]=q,t[12]=pt,t[13]=d?.description,t[14]=d?.title,t[15]=g,t[16]=Gt):Gt=t[16];let dt;t[17]!==ue||t[18]!==L||t[19]!==mt||t[20]!==jt||t[21]!==Mt||t[22]!==Wt||t[23]!==r||t[24]!==K||t[25]!==nt||t[26]!==R||t[27]!==n||t[28]!==x||t[29]!==H||t[30]!==z||t[31]!==It||t[32]!==Zt||t[33]!==v||t[34]!==V||t[35]!==_t||t[36]!==tt||t[37]!==vt||t[38]!==P||t[39]!==te||t[40]!==m||t[41]!==O||t[42]!==W||t[43]!==h||t[44]!==St||t[45]!==y||t[46]!==G||t[47]!==Nt||t[48]!==c||t[49]!==N||t[50]!==Y||t[51]!==Lt||t[52]!==Et||t[53]!==Ot||t[54]!==At||t[55]!==kt||t[56]!==A||t[57]!==d||t[58]!==Pt||t[59]!==S||t[60]!==$||t[61]!==C||t[62]!==B||t[63]!==w||t[64]!==bt||t[65]!==qt||t[66]!==Rt||t[67]!==wt||t[68]!==g?(dt=n.length===0?s.jsxRuntimeExports.jsx(De.EmptyState,{}):s.jsxRuntimeExports.jsxs(s.jsxRuntimeExports.Fragment,{children:[Et&&n.filter(Bi).length!==0&&K?s.jsxRuntimeExports.jsx(Be.ColorLegend,{width:g,colorLegendTitle:nt,colors:c||ve.Colors[w].sequentialColors.positiveColorsx10,colorDomain:K,showNAColor:!1,className:r?.colorLegend}):null,s.jsxRuntimeExports.jsx(je.GraphArea,{ref:u,children:$&&S?s.jsxRuntimeExports.jsx(ue,{data:A?Le.orderBy(n.filter(j=>z?!f.checkIfNullOrUndefined(j.size):j),[j=>j.size===void 0?A==="asc"?(y==="horizontal"?1:-1)*(1/0):(y==="horizontal"?-1:1)*(1/0):j.size],[A]).filter((j,it)=>tt?it<tt:!0):n.filter(j=>z?!f.checkIfNullOrUndefined(j.size):j).filter((j,it)=>tt?it<tt:!0),barColor:jt,targetColor:C,width:$,refValues:N,height:S,suffix:Pt,prefix:Nt,barPadding:Mt,showLabels:Ot,showValues:kt,showTicks:At,truncateBy:Rt,leftMargin:V,rightMargin:Lt,qualitativeRangeColors:c||ve.Colors[w].sequentialColors.positiveColorsx10,topMargin:qt,bottomMargin:Wt,tooltip:bt,onSeriesMouseOver:St,maxValue:vt,minValue:m,highlightedDataPoints:It,onSeriesMouseClick:h,labelOrder:Zt,maxBarThickness:_t,minBarThickness:te,resetSelectionOnDoubleClick:Y,detailsOnClick:x,barAxisTitle:mt,noOfTicks:W,valueColor:wt,styles:d,classNames:r,targetStyle:B,dimmedOpacity:H,measureBarWidthFactor:P,animate:L===!0?{duration:.5,once:!0,amount:.5}:L||{duration:0,once:!0,amount:0},precision:G,customLayers:R,naLabel:O,rtl:v==="ar"||v==="he"}):null})]}),t[17]=ue,t[18]=L,t[19]=mt,t[20]=jt,t[21]=Mt,t[22]=Wt,t[23]=r,t[24]=K,t[25]=nt,t[26]=R,t[27]=n,t[28]=x,t[29]=H,t[30]=z,t[31]=It,t[32]=Zt,t[33]=v,t[34]=V,t[35]=_t,t[36]=tt,t[37]=vt,t[38]=P,t[39]=te,t[40]=m,t[41]=O,t[42]=W,t[43]=h,t[44]=St,t[45]=y,t[46]=G,t[47]=Nt,t[48]=c,t[49]=N,t[50]=Y,t[51]=Lt,t[52]=Et,t[53]=Ot,t[54]=At,t[55]=kt,t[56]=A,t[57]=d,t[58]=Pt,t[59]=S,t[60]=$,t[61]=C,t[62]=B,t[63]=w,t[64]=bt,t[65]=qt,t[66]=Rt,t[67]=wt,t[68]=g,t[69]=dt):dt=t[69];let lt;t[70]!==r?.footnote||t[71]!==r?.source||t[72]!==xt||t[73]!==ut||t[74]!==d?.footnote||t[75]!==d?.source||t[76]!==g?(lt=ut||xt?s.jsxRuntimeExports.jsx(Fe.GraphFooter,{styles:{footnote:d?.footnote,source:d?.source},classNames:{footnote:r?.footnote,source:r?.source},sources:ut,footNote:xt,width:g}):null,t[70]=r?.footnote,t[71]=r?.source,t[72]=xt,t[73]=ut,t[74]=d?.footnote,t[75]=d?.source,t[76]=g,t[77]=lt):lt=t[77];let Xt;return t[78]!==Bt||t[79]!==Vt||t[80]!==Q||t[81]!==yt||t[82]!==v||t[83]!==X||t[84]!==D||t[85]!==$t||t[86]!==J||t[87]!==xe||t[88]!==Gt||t[89]!==dt||t[90]!==lt||t[91]!==w||t[92]!==g?(Xt=s.jsxRuntimeExports.jsxs(je.GraphContainer,{className:J,style:xe,id:Q,ref:Ht,"aria-label":Bt,backgroundColor:Vt,theme:w,language:v,minHeight:X,width:g,height:yt,relativeHeight:$t,padding:D,children:[Gt,dt,lt]}),t[78]=Bt,t[79]=Vt,t[80]=Q,t[81]=yt,t[82]=v,t[83]=X,t[84]=D,t[85]=$t,t[86]=J,t[87]=xe,t[88]=Gt,t[89]=dt,t[90]=lt,t[91]=w,t[92]=g,t[93]=Xt):Xt=t[93],Xt}function Bi(e){return e.qualitativeRange}function Pi(e){return e!==void 0}function Hi(e){return e!==void 0}function Gi(e){return e.data}function Xi(e){return e!==void 0}function Yi(e){return e.data}exports.BulletChart=Ui;
2
2
  //# sourceMappingURL=BulletChart.cjs.map