arbor-dashboard
Version:
A tool to create responsive dashboards with charts
2 lines • 544 kB
JavaScript
/*! For license information please see main.js.LICENSE.txt */
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e(require("react"),require("react-dom")):"function"==typeof define&&define.amd?define(["react","react-dom"],e):"object"==typeof exports?exports.main=e(require("react"),require("react-dom")):t.main=e(t.react,t["react-dom"])}(self,((t,e)=>(()=>{var n={9882:(t,e,n)=>{"use strict";n.d(e,{_:()=>a}),n(9155);var r=n(4848);function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function o(t){return o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},o(t)}var a=function(t){var e=t.data,n=t.themeConfig;return"object"===o(e)&&(e=Object.entries(e).map((function(t){var e,r,o=(r=2,function(t){if(Array.isArray(t))return t}(e=t)||function(t,e){var n=null==t?null:"undefined"!=typeof Symbol&&t[Symbol.iterator]||t["@@iterator"];if(null!=n){var r,i,o,a,s=[],l=!0,u=!1;try{if(o=(n=n.call(t)).next,0===e){if(Object(n)!==n)return;l=!1}else for(;!(l=(r=o.call(n)).done)&&(s.push(r.value),s.length!==e);l=!0);}catch(t){u=!0,i=t}finally{try{if(!l&&null!=n.return&&(a=n.return(),Object(a)!==a))return}finally{if(u)throw i}}return s}}(e,r)||function(t,e){if(t){if("string"==typeof t)return i(t,e);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?i(t,e):void 0}}(e,r)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()),a=o[0],s=o[1];return{title:s.title||s.id,color:n[a]}}))),(0,r.jsx)("div",{className:"chart-legend",role:"graphics-legend",children:e.map((function(t,e){return(0,r.jsxs)("div",{className:"chart-legend-item",children:[(0,r.jsx)("div",{className:"chart-legend-symbol",style:{backgroundColor:n[e]}}),(0,r.jsx)("span",{children:t.title})]},e)}))})}},8941:(t,e,n)=>{"use strict";n.d(e,{BarChart:()=>ct});var r=n(4782),i=n(5650),o=n(2555),a=n(9155),s=n(6762),l=n(4848),u=n(6714),c=n(4028),d=n(806),f=n(7965),h=n(5917),p=n(8946),g=n(3414),y=n(4873);function b(t,e){return t[e]}function m(t){const e=[];return e.key=t,e}var v=n(8801),x=n(14);function w(){return w=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},w.apply(this,arguments)}function _(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}var k,S=function(t){var e=t.bars,n=t.annotations,r=(0,s.wI)({data:e,annotations:n,getPosition:function(t){return{x:t.x+t.width/2,y:t.y+t.height/2}},getDimensions:function(t){var e=t.height,n=t.width;return{width:n,height:e,size:Math.max(n,e)}}});return(0,l.jsx)(l.Fragment,{children:r.map((function(t,e){return(0,l.jsx)(s.YH,w({},t),e)}))})},C=function(t){var e=t.width,n=t.height,r=t.legends,i=t.toggleSerie;return(0,l.jsx)(l.Fragment,{children:r.map((function(t,r){var o,a=t[0],s=t[1];return(0,l.jsx)(u.$i,w({},a,{containerWidth:e,containerHeight:n,data:null!=(o=a.data)?o:s,toggleSerie:a.toggleSerie&&"keys"===a.dataFrom?i:void 0}),r)}))})},M=["data"],A=["color","label"],j={indexBy:"id",keys:["value"],groupMode:"stacked",layout:"vertical",reverse:!1,minValue:"auto",maxValue:"auto",valueScale:{type:"linear"},indexScale:{type:"band",round:!0},padding:.1,innerPadding:0,axisBottom:{},axisLeft:{},enableGridX:!1,enableGridY:!0,enableLabel:!0,label:"formattedValue",labelPosition:"middle",labelOffset:0,labelSkipWidth:0,labelSkipHeight:0,labelTextColor:{from:"theme",theme:"labels.text.fill"},colorBy:"id",colors:{scheme:"nivo"},borderRadius:0,borderWidth:0,borderColor:{from:"color"},isInteractive:!0,tooltip:function(t){var e=t.color,n=t.label,r=_(t,A);return(0,l.jsx)(d.GK,{id:n,value:r.formattedValue,enableChip:!0,color:e})},tooltipLabel:function(t){return t.id+" - "+t.indexValue},legends:[],initialHiddenIds:[],annotations:[],markers:[],enableTotals:!1,totalsOffset:10},O=w({},j,{layers:["grid","axes","bars","totals","markers","legends","annotations"],barComponent:function(t){var e,n=t.bar,r=n.data,s=_(n,M),u=t.style,c=u.borderColor,f=u.color,h=u.height,p=u.labelColor,g=u.labelOpacity,y=u.labelX,b=u.labelY,m=u.transform,v=u.width,x=u.textAnchor,k=t.borderRadius,S=t.borderWidth,C=t.label,A=t.shouldRenderLabel,j=t.isInteractive,O=t.onClick,T=t.onMouseEnter,P=t.onMouseLeave,R=t.tooltip,E=t.isFocusable,D=t.ariaLabel,z=t.ariaLabelledBy,L=t.ariaDescribedBy,F=t.ariaDisabled,I=t.ariaHidden,N=(0,i.DP)(),W=(0,d.fS)(),H=W.showTooltipFromEvent,q=W.showTooltipAt,U=W.hideTooltip,B=(0,a.useMemo)((function(){return function(){return(0,a.createElement)(R,w({},s,r))}}),[R,s,r]),V=(0,a.useCallback)((function(t){null==O||O(w({color:s.color},r),t)}),[s,r,O]),Y=(0,a.useCallback)((function(t){return H(B(),t)}),[H,B]),$=(0,a.useCallback)((function(t){null==T||T(r,t),H(B(),t)}),[r,T,H,B]),G=(0,a.useCallback)((function(t){null==P||P(r,t),U()}),[r,U,P]),K=(0,a.useCallback)((function(){q(B(),[s.absX+s.width/2,s.absY])}),[q,B,s]),X=(0,a.useCallback)((function(){U()}),[U]);return(0,l.jsxs)(o.CS.g,{transform:m,children:[(0,l.jsx)(o.CS.rect,{width:(0,o.to)(v,(function(t){return Math.max(t,0)})),height:(0,o.to)(h,(function(t){return Math.max(t,0)})),rx:k,ry:k,fill:null!=(e=r.fill)?e:f,strokeWidth:S,stroke:c,focusable:E,tabIndex:E?0:void 0,"aria-label":D?D(r):void 0,"aria-labelledby":z?z(r):void 0,"aria-describedby":L?L(r):void 0,"aria-disabled":F?F(r):void 0,"aria-hidden":I?I(r):void 0,onMouseEnter:j?$:void 0,onMouseMove:j?Y:void 0,onMouseLeave:j?G:void 0,onClick:j?V:void 0,onFocus:j&&E?K:void 0,onBlur:j&&E?X:void 0}),A&&(0,l.jsx)(o.CS.text,{x:y,y:b,textAnchor:x,dominantBaseline:"central",fillOpacity:g,style:w({},N.labels.text,{pointerEvents:"none",fill:p}),children:C})]})},defs:[],fill:[],animate:!0,motionConfig:"default",role:"img",isFocusable:!1}),T=w({},j,{layers:["grid","axes","bars","totals","legends","annotations"],pixelRatio:"undefined"!=typeof window&&null!=(k=window.devicePixelRatio)?k:1}),P=function(t,e,n,r,i,o){return(0,f.gx)(r,{all:t.map(e),min:0,max:0},i,o).padding(n)},R=function(t,e){return t.map((function(t){return w({},e.reduce((function(t,e){return t[e]=null,t}),{}),t)}))},E=function(t){return Object.keys(t).reduce((function(e,n){return t[n]&&(e[n]=t[n]),e}),{})},D=function(t){return[t,Number(t)]};function z(t,e,n,r){return void 0===t&&(t=j.layout),void 0===e&&(e=j.reverse),void 0===n&&(n=j.labelPosition),void 0===r&&(r=j.labelOffset),function(i,o){var a=r*(e?-1:1);if("horizontal"===t){var s=i/2;return"start"===n?s=e?i:0:"end"===n&&(s=e?0:i),{labelX:s+a,labelY:o/2,textAnchor:"middle"===n?"middle":e?"end":"start"}}var l=o/2;return"start"===n?l=e?0:o:"end"===n&&(l=e?o:0),{labelX:i/2,labelY:l-a,textAnchor:"middle"}}}var L=["layout","minValue","maxValue","reverse","width","height","padding","innerPadding","valueScale","indexScale","hiddenIds"],F=function(t,e){return t>e},I=function(t,e){return t<e},N=function(t,e){return Array.from(" ".repeat(e-t),(function(e,n){return t+n}))},W=function(t){return F(t,0)?0:t},H=function(t,e,n,r){var i=t.data,o=t.formatValue,a=t.getColor,s=t.getIndex,l=t.getTooltipLabel,u=t.innerPadding,c=void 0===u?0:u,d=t.keys,f=t.xScale,h=t.yScale,p=t.margin,g=n?I:F,y=i.map(E),b=[];return d.forEach((function(t,n){return N(0,f.domain().length).forEach((function(u){var d,m,v,x=D(i[u][t]),w=x[0],_=x[1],k=s(i[u]),S=(null!=(d=f(k))?d:0)+e*n+c*n,C=g(m=_,0)?null!=(v=h(m))?v:0:r,M=function(t,e){var n;return g(t,0)?r-e:(null!=(n=h(t))?n:0)-r}(_,C),A={id:t,value:null===w?w:_,formattedValue:o(_),hidden:!1,index:u,indexValue:k,data:y[u]};b.push({key:t+"."+A.indexValue,index:b.length,data:A,x:S,y:C,absX:p.left+S,absY:p.top+C,width:e,height:M,color:a(A),label:l(A)})}))})),b},q=function(t,e,n,r){var i=t.data,o=t.formatValue,a=t.getIndex,s=t.getColor,l=t.getTooltipLabel,u=t.keys,c=t.innerPadding,d=void 0===c?0:c,f=t.xScale,h=t.yScale,p=t.margin,g=n?I:F,y=i.map(E),b=[];return u.forEach((function(t,n){return N(0,h.domain().length).forEach((function(u){var c,m,v,x=D(i[u][t]),w=x[0],_=x[1],k=a(i[u]),S=g(m=_,0)?r:null!=(v=f(m))?v:0,C=(null!=(c=h(k))?c:0)+e*n+d*n,M=function(t,e){var n;return g(t,0)?(null!=(n=f(t))?n:0)-r:r-e}(_,S),A={id:t,value:null===w?w:_,formattedValue:o(_),hidden:!1,index:u,indexValue:k,data:y[u]};b.push({key:t+"."+A.indexValue,index:b.length,data:A,x:S,y:C,absX:p.left+S,absY:p.top+C,width:M,height:e,color:s(A),label:l(A)})}))})),b},U=function(t){var e,n,r=t.layout,i=t.minValue,o=t.maxValue,a=t.reverse,s=t.width,l=t.height,u=t.padding,c=void 0===u?0:u,d=t.innerPadding,h=void 0===d?0:d,p=t.valueScale,g=t.indexScale,y=t.hiddenIds,b=void 0===y?[]:y,m=_(t,L),v=m.keys.filter((function(t){return!b.includes(t)})),x=R(m.data,v),k="vertical"===r?["y","x",s]:["x","y",l],S=k[0],C=k[1],M=k[2],A=P(x,m.getIndex,c,g,M,C),j=w({max:o,min:i,reverse:a},p),O="auto"===j.min?W:function(t){return t},T=x.reduce((function(t,e){return[].concat(t,v.map((function(t){return e[t]})))}),[]).filter(Boolean),E=O(Math.min.apply(Math,T)),D=(n=Math.max.apply(Math,T),isFinite(n)?n:0),z=(0,f.gx)(j,{all:T,min:E,max:D},"x"===S?s:l,S),F="vertical"===r?[A,z]:[z,A],I=F[0],N=F[1],U=(A.bandwidth()-h*(v.length-1))/v.length,B=[w({},m,{data:x,keys:v,innerPadding:h,xScale:I,yScale:N}),U,j.reverse,null!=(e=z(0))?e:0];return{xScale:I,yScale:N,bars:U>0?"vertical"===r?H.apply(void 0,B):q.apply(void 0,B):[]}},B=["data","layout","minValue","maxValue","reverse","width","height","padding","valueScale","indexScale","hiddenIds"],V=function t(e){var n;return e.some(Array.isArray)?t((n=[]).concat.apply(n,e)):e},Y=function(t,e,n){var r=t.formatValue,i=t.getColor,o=t.getIndex,a=t.getTooltipLabel,s=t.innerPadding,l=t.stackedData,u=t.xScale,c=t.yScale,d=t.margin,f=[];return l.forEach((function(t){return u.domain().forEach((function(l,h){var p,g,y=t[h],b=null!=(p=u(o(y.data)))?p:0,m=(null!=(g=function(t){return c(t[n?0:1])}(y))?g:0)+.5*s,v=function(t,e){var r;return(null!=(r=c(t[n?1:0]))?r:0)-e}(y,m)-s,x=D(y.data[t.key]),w=x[0],_=x[1],k={id:t.key,value:null===w?w:_,formattedValue:r(_),hidden:!1,index:h,indexValue:l,data:E(y.data)};f.push({key:t.key+"."+l,index:f.length,data:k,x:b,y:m,absX:d.left+b,absY:d.top+m,width:e,height:v,color:i(k),label:a(k)})}))})),f},$=function(t,e,n){var r=t.formatValue,i=t.getColor,o=t.getIndex,a=t.getTooltipLabel,s=t.innerPadding,l=t.stackedData,u=t.xScale,c=t.yScale,d=t.margin,f=[];return l.forEach((function(t){return c.domain().forEach((function(l,h){var p,g,y=t[h],b=null!=(p=c(o(y.data)))?p:0,m=(null!=(g=function(t){return u(t[n?1:0])}(y))?g:0)+.5*s,v=function(t,e){var r;return(null!=(r=u(t[n?0:1]))?r:0)-e}(y,m)-s,x=D(y.data[t.key]),w=x[0],_=x[1],k={id:t.key,value:null===w?w:_,formattedValue:r(_),hidden:!1,index:h,indexValue:l,data:E(y.data)};f.push({key:t.key+"."+l,index:f.length,data:k,x:m,y:b,absX:d.left+m,absY:d.top+b,width:v,height:e,color:i(k),label:a(k)})}))})),f},G=function(t){var e,n=t.data,r=t.layout,i=t.minValue,o=t.maxValue,a=t.reverse,s=t.width,l=t.height,u=t.padding,c=void 0===u?0:u,d=t.valueScale,x=t.indexScale,k=t.hiddenIds,S=void 0===k?[]:k,C=_(t,B),M=C.keys.filter((function(t){return!S.includes(t)})),A=function(){var t=(0,p.A)([]),e=y.A,n=g.A,r=b;function i(i){var o,a,s=Array.from(t.apply(this,arguments),m),l=s.length,u=-1;for(const t of i)for(o=0,++u;o<l;++o)(s[o][u]=[0,+r(t,s[o].key,u,i)]).data=t;for(o=0,a=(0,h.A)(e(s));o<l;++o)s[a[o]].index=o;return n(s,a),s}return i.keys=function(e){return arguments.length?(t="function"==typeof e?e:(0,p.A)(Array.from(e)),i):t},i.value=function(t){return arguments.length?(r="function"==typeof t?t:(0,p.A)(+t),i):r},i.order=function(t){return arguments.length?(e=null==t?y.A:"function"==typeof t?t:(0,p.A)(Array.from(t)),i):e},i.offset=function(t){return arguments.length?(n=null==t?g.A:t,i):n},i}().keys(M).offset(v.A)(R(n,M)),j="vertical"===r?["y","x",s]:["x","y",l],O=j[0],T=j[1],E=j[2],D=P(n,C.getIndex,c,x,E,T),z=w({max:o,min:i,reverse:a},d),L=(e=V(A),"log"===d.type?e.filter((function(t){return 0!==t})):e),F=Math.min.apply(Math,L),I=Math.max.apply(Math,L),N=(0,f.gx)(z,{all:L,min:F,max:I},"x"===O?s:l,O),W="vertical"===r?[D,N]:[N,D],H=W[0],q=W[1],U=C.innerPadding>0?C.innerPadding:0,G=D.bandwidth(),K=[w({},C,{innerPadding:U,stackedData:A,xScale:H,yScale:q}),G,z.reverse];return{xScale:H,yScale:q,bars:G>0?"vertical"===r?Y.apply(void 0,K):$.apply(void 0,K):[]}},K=function(t){var e=t.bars,n=t.direction,r=t.from,o=t.groupMode,a=t.layout,s=t.legendLabel,l=t.reverse,u=(0,i.x)(null!=s?s:"indexes"===r?"indexValue":"id");return"indexes"===r?function(t,e,n){var r=x(t.map((function(t){var e,r;return{id:null!=(e=t.data.indexValue)?e:"",label:n(t.data),hidden:t.data.hidden,color:null!=(r=t.color)?r:"#000"}})),(function(t){return t.id}));return"horizontal"===e&&r.reverse(),r}(e,a,u):function(t,e,n,r,i,o){var a=x(t.map((function(t){var e;return{id:t.data.id,label:o(t.data),hidden:t.data.hidden,color:null!=(e=t.color)?e:"#000"}})),(function(t){return t.id}));return("vertical"===e&&"stacked"===r&&"column"===n&&!0!==i||"horizontal"===e&&"stacked"===r&&!0===i)&&a.reverse(),a}(e,a,n,o,l,u)},X=function(t,e,n){var r=t.get(e)||0;t.set(e,r+n)},Q=function(t){var e=t.indexBy,n=void 0===e?j.indexBy:e,r=t.keys,o=void 0===r?j.keys:r,s=t.label,l=void 0===s?j.label:s,u=t.tooltipLabel,d=void 0===u?j.tooltipLabel:u,f=t.valueFormat,h=t.colors,p=void 0===h?j.colors:h,g=t.colorBy,y=void 0===g?j.colorBy:g,b=t.borderColor,m=void 0===b?j.borderColor:b,v=t.labelTextColor,x=void 0===v?j.labelTextColor:v,_=t.groupMode,k=void 0===_?j.groupMode:_,S=t.layout,C=void 0===S?j.layout:S,M=t.reverse,A=void 0===M?j.reverse:M,O=t.data,T=t.minValue,P=void 0===T?j.minValue:T,R=t.maxValue,E=void 0===R?j.maxValue:R,D=t.margin,z=t.width,L=t.height,F=t.padding,I=void 0===F?j.padding:F,N=t.innerPadding,W=void 0===N?j.innerPadding:N,H=t.valueScale,q=void 0===H?j.valueScale:H,B=t.indexScale,V=void 0===B?j.indexScale:B,Y=t.initialHiddenIds,$=void 0===Y?j.initialHiddenIds:Y,Q=t.enableLabel,Z=void 0===Q?j.enableLabel:Q,J=t.labelSkipWidth,tt=void 0===J?j.labelSkipWidth:J,et=t.labelSkipHeight,nt=void 0===et?j.labelSkipHeight:et,rt=t.legends,it=void 0===rt?j.legends:rt,ot=t.legendLabel,at=t.totalsOffset,st=void 0===at?j.totalsOffset:at,lt=(0,a.useState)(null!=$?$:[]),ut=lt[0],ct=lt[1],dt=(0,a.useCallback)((function(t){ct((function(e){return e.indexOf(t)>-1?e.filter((function(e){return e!==t})):[].concat(e,[t])}))}),[]),ft=(0,i.Ob)(n),ht=(0,i.Ob)(l),pt=(0,i.Ob)(d),gt=(0,i.d_)(f),yt=(0,i.DP)(),bt=(0,c.m1)(p,y),mt=(0,c.nz)(m,yt),vt=(0,c.nz)(x,yt),xt=("grouped"===k?U:G)({layout:C,reverse:A,data:O,getIndex:ft,keys:o,minValue:P,maxValue:E,width:z,height:L,getColor:bt,padding:I,innerPadding:W,valueScale:q,indexScale:V,hiddenIds:ut,formatValue:gt,getTooltipLabel:pt,margin:D}),wt=xt.bars,_t=xt.xScale,kt=xt.yScale,St=(0,a.useMemo)((function(){return wt.filter((function(t){return null!==t.data.value})).map((function(t,e){return w({},t,{index:e})}))}),[wt]),Ct=(0,a.useCallback)((function(t){var e=t.width,n=t.height;return!(!Z||tt>0&&e<tt||nt>0&&n<nt)}),[Z,tt,nt]),Mt=(0,a.useMemo)((function(){return o.map((function(t){var e=wt.find((function(e){return e.data.id===t}));return w({},e,{data:w({id:t},null==e?void 0:e.data,{hidden:ut.includes(t)})})}))}),[ut,o,wt]),At=(0,a.useMemo)((function(){return it.map((function(t){return[t,K({bars:"keys"===t.dataFrom?Mt:wt,direction:t.direction,from:t.dataFrom,groupMode:k,layout:C,legendLabel:ot,reverse:A})]}))}),[it,Mt,wt,k,C,ot,A]),jt=(0,a.useMemo)((function(){return function(t,e,n,r,i,o,a){void 0===r&&(r=j.layout),void 0===i&&(i=j.groupMode);var s=[];if(0===t.length)return s;var l=new Map,u=t[0].width,c=t[0].height;if("stacked"===i){var d=new Map;t.forEach((function(t){var e=t.data,n=e.indexValue,r=e.value;X(l,n,Number(r)),function(t,e,n){var r=t.get(e)||0;t.set(e,r+(n>0?n:0))}(d,n,Number(r))})),d.forEach((function(t,i){var d,f,h,p=l.get(i)||0;"vertical"===r?(d=e(i),f=n(t),h=n(t/2)):(d=e(t),f=n(i),h=e(t/2)),d+="vertical"===r?u/2:o,f+="vertical"===r?-o:c/2,s.push({key:"total_"+i,x:d,y:f,value:p,formattedValue:a(p),animationOffset:h})}))}else if("grouped"===i){var f=new Map,h=new Map;t.forEach((function(t){var e=t.data,n=e.indexValue,r=e.value;X(l,n,Number(r)),function(t,e,n){var r=t.get(e)||0;t.set(e,Math.max(r,Number(n)))}(f,n,Number(r)),function(t,e){var n=t.get(e)||0;t.set(e,n+1)}(h,n)})),f.forEach((function(t,i){var d,f,p,g=l.get(i)||0,y=h.get(i);"vertical"===r?(d=e(i),f=n(t),p=n(t/2)):(d=e(t),f=n(i),p=e(t/2)),d+="vertical"===r?y*u/2:o,f+="vertical"===r?-o:y*c/2,s.push({key:"total_"+i,x:d,y:f,value:g,formattedValue:a(g),animationOffset:p})}))}return s}(wt,_t,kt,C,k,st,gt)}),[wt,_t,kt,C,k,st,gt]);return{bars:wt,barsWithValue:St,xScale:_t,yScale:kt,getIndex:ft,getLabel:ht,getTooltipLabel:pt,formatValue:gt,getColor:bt,getBorderColor:mt,getLabelColor:vt,shouldRenderBarLabel:Ct,hiddenIds:ut,toggleSerie:dt,legendsWithData:At,barTotals:jt}},Z=function(t){var e=t.data,n=t.springConfig,r=t.animate,a=t.layout,s=void 0===a?O.layout:a,u=(0,i.DP)();return(0,o.pn)(e,{keys:function(t){return t.key},from:function(t){return{x:"vertical"===s?t.x:t.animationOffset,y:"vertical"===s?t.animationOffset:t.y,labelOpacity:0}},enter:function(t){return{x:t.x,y:t.y,labelOpacity:1}},update:function(t){return{x:t.x,y:t.y,labelOpacity:1}},leave:function(t){return{x:"vertical"===s?t.x:t.animationOffset,y:"vertical"===s?t.animationOffset:t.y,labelOpacity:0}},config:n,immediate:!r,initial:r?void 0:null})((function(t,e){return(0,l.jsx)(o.CS.text,{x:t.x,y:t.y,fillOpacity:t.labelOpacity,style:w({},u.labels.text,{pointerEvents:"none"}),fontWeight:"bold",fontSize:u.labels.text.fontSize,fontFamily:u.labels.text.fontFamily,textAnchor:"vertical"===s?"middle":"start",alignmentBaseline:"vertical"===s?"alphabetic":"middle",children:e.formattedValue},e.key)}))},J=["isInteractive","animate","motionConfig","theme","renderWrapper"],tt=function(t){var e=t.data,n=t.indexBy,s=t.keys,u=t.margin,c=t.width,d=t.height,f=t.groupMode,h=t.layout,p=t.reverse,g=t.minValue,y=t.maxValue,b=t.valueScale,m=t.indexScale,v=t.padding,x=t.innerPadding,_=t.axisTop,k=t.axisRight,M=t.axisBottom,A=void 0===M?O.axisBottom:M,j=t.axisLeft,T=void 0===j?O.axisLeft:j,P=t.enableGridX,R=void 0===P?O.enableGridX:P,E=t.enableGridY,D=void 0===E?O.enableGridY:E,L=t.gridXValues,F=t.gridYValues,I=t.layers,N=void 0===I?O.layers:I,W=t.barComponent,H=void 0===W?O.barComponent:W,q=t.enableLabel,U=void 0===q?O.enableLabel:q,B=t.label,V=t.labelSkipWidth,Y=void 0===V?O.labelSkipWidth:V,$=t.labelSkipHeight,G=void 0===$?O.labelSkipHeight:$,K=t.labelTextColor,X=t.labelPosition,J=void 0===X?O.labelPosition:X,tt=t.labelOffset,et=void 0===tt?O.labelOffset:tt,nt=t.markers,rt=void 0===nt?O.markers:nt,it=t.colorBy,ot=t.colors,at=t.defs,st=void 0===at?O.defs:at,lt=t.fill,ut=void 0===lt?O.fill:lt,ct=t.borderRadius,dt=void 0===ct?O.borderRadius:ct,ft=t.borderWidth,ht=void 0===ft?O.borderWidth:ft,pt=t.borderColor,gt=t.annotations,yt=void 0===gt?O.annotations:gt,bt=t.legendLabel,mt=t.tooltipLabel,vt=t.valueFormat,xt=t.isInteractive,wt=void 0===xt?O.isInteractive:xt,_t=t.tooltip,kt=void 0===_t?O.tooltip:_t,St=t.onClick,Ct=t.onMouseEnter,Mt=t.onMouseLeave,At=t.legends,jt=t.role,Ot=void 0===jt?O.role:jt,Tt=t.ariaLabel,Pt=t.ariaLabelledBy,Rt=t.ariaDescribedBy,Et=t.isFocusable,Dt=void 0===Et?O.isFocusable:Et,zt=t.barAriaLabel,Lt=t.barAriaLabelledBy,Ft=t.barAriaDescribedBy,It=t.barAriaHidden,Nt=t.barAriaDisabled,Wt=t.initialHiddenIds,Ht=t.enableTotals,qt=void 0===Ht?O.enableTotals:Ht,Ut=t.totalsOffset,Bt=void 0===Ut?O.totalsOffset:Ut,Vt=(0,i.mk)(),Yt=Vt.animate,$t=Vt.config,Gt=(0,i.Xl)(c,d,u),Kt=Gt.outerWidth,Xt=Gt.outerHeight,Qt=Gt.margin,Zt=Gt.innerWidth,Jt=Gt.innerHeight,te=Q({indexBy:n,label:B,tooltipLabel:mt,valueFormat:vt,colors:ot,colorBy:it,borderColor:pt,labelTextColor:K,groupMode:f,layout:h,reverse:p,data:e,keys:s,minValue:g,maxValue:y,margin:Qt,width:Zt,height:Jt,padding:v,innerPadding:x,valueScale:b,indexScale:m,enableLabel:U,labelSkipWidth:Y,labelSkipHeight:G,legends:At,legendLabel:bt,initialHiddenIds:Wt,totalsOffset:Bt}),ee=te.bars,ne=te.barsWithValue,re=te.xScale,ie=te.yScale,oe=te.getLabel,ae=te.getTooltipLabel,se=te.getBorderColor,le=te.getLabelColor,ue=te.shouldRenderBarLabel,ce=te.toggleSerie,de=te.legendsWithData,fe=te.barTotals,he=te.getColor,pe=z(h,p,J,et),ge=(0,o.pn)(ne,{keys:function(t){return t.key},from:function(t){return w({borderColor:se(t),color:t.color,height:0,labelColor:le(t),labelOpacity:0},pe(t.width,t.height),{transform:"translate("+t.x+", "+(t.y+t.height)+")",width:t.width},"vertical"===h?{}:{height:t.height,transform:"translate("+t.x+", "+t.y+")",width:0})},enter:function(t){return w({borderColor:se(t),color:t.color,height:t.height,labelColor:le(t),labelOpacity:1},pe(t.width,t.height),{transform:"translate("+t.x+", "+t.y+")",width:t.width})},update:function(t){return w({borderColor:se(t),color:t.color,height:t.height,labelColor:le(t),labelOpacity:1},pe(t.width,t.height),{transform:"translate("+t.x+", "+t.y+")",width:t.width})},leave:function(t){return w({borderColor:se(t),color:t.color,height:0,labelColor:le(t),labelOpacity:0},pe(t.width,t.height),{labelY:0,transform:"translate("+t.x+", "+(t.y+t.height)+")",width:t.width},"vertical"===h?{}:w({},pe(t.width,t.height),{labelX:0,height:t.height,transform:"translate("+t.x+", "+t.y+")",width:0}))},config:$t,immediate:!Yt,initial:Yt?void 0:null}),ye=(0,a.useMemo)((function(){return{borderRadius:dt,borderWidth:ht,enableLabel:U,isInteractive:wt,labelSkipWidth:Y,labelSkipHeight:G,onClick:St,onMouseEnter:Ct,onMouseLeave:Mt,getTooltipLabel:ae,tooltip:kt,isFocusable:Dt,ariaLabel:zt,ariaLabelledBy:Lt,ariaDescribedBy:Ft,ariaHidden:It,ariaDisabled:Nt}}),[dt,ht,U,ae,wt,G,Y,St,Ct,Mt,kt,Dt,zt,Lt,Ft,It,Nt]),be=(0,i.kc)(st,ee,ut,{dataKey:"data",targetKey:"data.fill"}),me={annotations:null,axes:null,bars:null,grid:null,legends:null,markers:null,totals:null};N.includes("annotations")&&(me.annotations=(0,l.jsx)(S,{bars:ee,annotations:yt},"annotations")),N.includes("axes")&&(me.axes=(0,l.jsx)(r.Y5,{xScale:re,yScale:ie,width:Zt,height:Jt,top:_,right:k,bottom:A,left:T},"axes")),N.includes("bars")&&(me.bars=(0,l.jsx)(a.Fragment,{children:ge((function(t,e){return(0,a.createElement)(H,w({},ye,{bar:e,style:t,shouldRenderLabel:ue(e),label:oe(e.data)}))}))},"bars")),N.includes("grid")&&(me.grid=(0,l.jsx)(r.xA,{width:Zt,height:Jt,xScale:R?re:null,yScale:D?ie:null,xValues:L,yValues:F},"grid")),N.includes("legends")&&(me.legends=(0,l.jsx)(C,{width:Zt,height:Jt,legends:de,toggleSerie:ce},"legends")),N.includes("markers")&&(me.markers=(0,l.jsx)(i.U9,{markers:rt,width:Zt,height:Jt,xScale:re,yScale:ie},"markers")),N.includes("totals")&&qt&&(me.totals=(0,l.jsx)(Z,{data:fe,springConfig:$t,animate:Yt,layout:h},"totals"));var ve=(0,a.useMemo)((function(){return w({},ye,{margin:Qt,width:c,height:d,innerWidth:Zt,innerHeight:Jt,bars:ee,legendData:de,enableLabel:U,xScale:re,yScale:ie,tooltip:kt,getTooltipLabel:ae,onClick:St,onMouseEnter:Ct,onMouseLeave:Mt,getColor:he})}),[ye,Qt,c,d,Zt,Jt,ee,de,U,re,ie,kt,ae,St,Ct,Mt,he]);return(0,l.jsx)(i.Ge,{width:Kt,height:Xt,margin:Qt,defs:be,role:Ot,ariaLabel:Tt,ariaLabelledBy:Pt,ariaDescribedBy:Rt,isFocusable:Dt,children:N.map((function(t,e){var n;return"function"==typeof t?(0,l.jsx)(a.Fragment,{children:(0,a.createElement)(t,ve)},e):null!=(n=null==me?void 0:me[t])?n:null}))})},et=function(t){var e=t.isInteractive,n=void 0===e?O.isInteractive:e,r=t.animate,o=void 0===r?O.animate:r,a=t.motionConfig,s=void 0===a?O.motionConfig:a,u=t.theme,c=t.renderWrapper,d=_(t,J);return(0,l.jsx)(i.mc,{animate:o,isInteractive:n,motionConfig:s,renderWrapper:c,theme:u,children:(0,l.jsx)(tt,w({isInteractive:n},d))})},nt=["isInteractive","renderWrapper","theme"],rt=function(t,e,n,r){return t.find((function(t){return(0,i.u7)(t.x+e.left,t.y+e.top,t.width,t.height,n,r)}))},it=function(t){var e=t.data,n=t.indexBy,o=t.keys,c=t.margin,f=t.width,h=t.height,p=t.groupMode,g=t.layout,y=t.reverse,b=t.minValue,m=t.maxValue,v=t.valueScale,x=t.indexScale,_=t.padding,k=t.innerPadding,S=t.axisTop,C=t.axisRight,M=t.axisBottom,A=void 0===M?T.axisBottom:M,j=t.axisLeft,O=void 0===j?T.axisLeft:j,P=t.enableGridX,R=void 0===P?T.enableGridX:P,E=t.enableGridY,D=void 0===E?T.enableGridY:E,L=t.gridXValues,F=t.gridYValues,I=t.labelPosition,N=void 0===I?T.labelPosition:I,W=t.labelOffset,H=void 0===W?T.labelOffset:W,q=t.layers,U=void 0===q?T.layers:q,B=t.renderBar,V=void 0===B?function(t,e){var n=e.bar,r=n.color,i=n.height,o=n.width,a=n.x,s=n.y,l=e.borderColor,u=e.borderRadius,c=e.borderWidth,d=e.label,f=e.labelColor,h=e.shouldRenderLabel,p=e.labelX,g=e.labelY,y=e.textAnchor;if(t.fillStyle=r,c>0&&(t.strokeStyle=l,t.lineWidth=c),t.beginPath(),u>0){var b=Math.min(u,i);t.moveTo(a+b,s),t.lineTo(a+o-b,s),t.quadraticCurveTo(a+o,s,a+o,s+b),t.lineTo(a+o,s+i-b),t.quadraticCurveTo(a+o,s+i,a+o-b,s+i),t.lineTo(a+b,s+i),t.quadraticCurveTo(a,s+i,a,s+i-b),t.lineTo(a,s+b),t.quadraticCurveTo(a,s,a+b,s),t.closePath()}else t.rect(a,s,o,i);t.fill(),c>0&&t.stroke(),h&&(t.textBaseline="middle",t.textAlign="middle"===y?"center":y,t.fillStyle=f,t.fillText(d,a+p,s+g))}:B,Y=t.enableLabel,$=void 0===Y?T.enableLabel:Y,G=t.label,K=t.labelSkipWidth,X=void 0===K?T.labelSkipWidth:K,Z=t.labelSkipHeight,J=void 0===Z?T.labelSkipHeight:Z,tt=t.labelTextColor,et=t.colorBy,nt=t.colors,it=t.borderRadius,ot=void 0===it?T.borderRadius:it,at=t.borderWidth,st=void 0===at?T.borderWidth:at,lt=t.borderColor,ut=t.annotations,ct=void 0===ut?T.annotations:ut,dt=t.legendLabel,ft=t.tooltipLabel,ht=t.valueFormat,pt=t.isInteractive,gt=void 0===pt?T.isInteractive:pt,yt=t.tooltip,bt=void 0===yt?T.tooltip:yt,mt=t.onClick,vt=t.onMouseEnter,xt=t.onMouseLeave,wt=t.legends,_t=t.pixelRatio,kt=void 0===_t?T.pixelRatio:_t,St=t.canvasRef,Ct=t.enableTotals,Mt=void 0===Ct?T.enableTotals:Ct,At=t.totalsOffset,jt=void 0===At?T.totalsOffset:At,Ot=(0,a.useRef)(null),Tt=(0,i.DP)(),Pt=(0,i.Xl)(f,h,c),Rt=Pt.margin,Et=Pt.innerWidth,Dt=Pt.innerHeight,zt=Pt.outerWidth,Lt=Pt.outerHeight,Ft=Q({indexBy:n,label:G,tooltipLabel:ft,valueFormat:ht,colors:nt,colorBy:et,borderColor:lt,labelTextColor:tt,groupMode:p,layout:g,reverse:y,data:e,keys:o,minValue:b,maxValue:m,margin:Rt,width:Et,height:Dt,padding:_,innerPadding:k,valueScale:v,indexScale:x,enableLabel:$,labelSkipWidth:X,labelSkipHeight:J,legends:wt,legendLabel:dt,totalsOffset:jt}),It=Ft.bars,Nt=Ft.barsWithValue,Wt=Ft.xScale,Ht=Ft.yScale,qt=Ft.getLabel,Ut=Ft.getTooltipLabel,Bt=Ft.getBorderColor,Vt=Ft.getLabelColor,Yt=Ft.shouldRenderBarLabel,$t=Ft.legendsWithData,Gt=Ft.barTotals,Kt=Ft.getColor,Xt=(0,d.fS)(),Qt=Xt.showTooltipFromEvent,Zt=Xt.hideTooltip,Jt=(0,s.x$)({annotations:(0,s.wI)({data:It,annotations:ct,getPosition:function(t){return{x:t.x,y:t.y}},getDimensions:function(t){var e=t.width,n=t.height;return{width:e,height:n,size:Math.max(e,n)}}})}),te=(0,a.useMemo)((function(){return{borderRadius:ot,borderWidth:st,isInteractive:gt,isFocusable:!1,labelSkipWidth:X,labelSkipHeight:J,margin:Rt,width:f,height:h,innerWidth:Et,innerHeight:Dt,bars:It,legendData:$t,enableLabel:$,xScale:Wt,yScale:Ht,tooltip:bt,getTooltipLabel:Ut,onClick:mt,onMouseEnter:vt,onMouseLeave:xt,getColor:Kt}}),[ot,st,gt,X,J,Rt,f,h,Et,Dt,It,$t,$,Wt,Ht,bt,Ut,mt,vt,xt,Kt]),ee=(0,i.d_)(ht),ne=z(g,y,N,H);(0,a.useEffect)((function(){var t,e=null==(t=Ot.current)?void 0:t.getContext("2d");Ot.current&&e&&(Ot.current.width=zt*kt,Ot.current.height=Lt*kt,e.scale(kt,kt),e.fillStyle=Tt.background,e.fillRect(0,0,zt,Lt),e.translate(Rt.left,Rt.top),U.forEach((function(t){"grid"===t?"number"==typeof Tt.grid.line.strokeWidth&&Tt.grid.line.strokeWidth>0&&(e.lineWidth=Tt.grid.line.strokeWidth,e.strokeStyle=Tt.grid.line.stroke,R&&(0,r.xu)(e,{width:Et,height:Dt,scale:Wt,axis:"x",values:L}),D&&(0,r.xu)(e,{width:Et,height:Dt,scale:Ht,axis:"y",values:F})):"axes"===t?(0,r.ZY)(e,{xScale:Wt,yScale:Ht,width:Et,height:Dt,top:S,right:C,bottom:A,left:O,theme:Tt}):"bars"===t?Nt.forEach((function(t){V(e,w({bar:t,borderColor:Bt(t),borderRadius:ot,borderWidth:st,label:qt(t.data),labelColor:Vt(t),shouldRenderLabel:Yt(t)},ne(t.width,t.height)))})):"legends"===t?$t.forEach((function(t){var n=t[0],r=t[1];(0,u.ZG)(e,w({},n,{data:r,containerWidth:Et,containerHeight:Dt,theme:Tt}))})):"annotations"===t?(0,s.e0)(e,{annotations:Jt,theme:Tt}):"totals"===t&&Mt?function(t,e,n,r){void 0===r&&(r=T.layout),t.fillStyle=n.text.fill,t.font="bold "+n.labels.text.fontSize+"px "+n.labels.text.fontFamily,t.textBaseline="vertical"===r?"alphabetic":"middle",t.textAlign="vertical"===r?"center":"start",e.forEach((function(e){t.fillText(e.formattedValue,e.x,e.y)}))}(e,Gt,Tt,g):"function"==typeof t&&t(e,te)})),e.save())}),[A,O,C,S,Nt,ot,st,Jt,R,D,Bt,qt,Vt,L,F,p,h,Dt,Et,te,U,g,$t,Rt.left,Rt.top,Lt,zt,kt,V,Wt,Ht,y,Yt,Tt,f,Gt,Mt,ee,ne]);var re=(0,a.useCallback)((function(t){if(It&&Ot.current){var e=(0,i.H9)(Ot.current,t),n=e[0],r=e[1],o=rt(It,Rt,n,r);void 0!==o?(Qt((0,a.createElement)(bt,w({},o.data,{color:o.color,label:o.label,value:Number(o.data.value)})),t),"mouseenter"===t.type&&(null==vt||vt(o.data,t))):Zt()}}),[Zt,Rt,vt,It,Qt,bt]),ie=(0,a.useCallback)((function(t){if(It&&Ot.current){Zt();var e=(0,i.H9)(Ot.current,t),n=e[0],r=e[1],o=rt(It,Rt,n,r);o&&(null==xt||xt(o.data,t))}}),[Zt,Rt,xt,It]),oe=(0,a.useCallback)((function(t){if(It&&Ot.current){var e=(0,i.H9)(Ot.current,t),n=e[0],r=e[1],o=rt(It,Rt,n,r);void 0!==o&&(null==mt||mt(w({},o.data,{color:o.color}),t))}}),[Rt,mt,It]);return(0,l.jsx)("canvas",{ref:function(t){Ot.current=t,St&&"current"in St&&(St.current=t)},width:zt*kt,height:Lt*kt,style:{width:zt,height:Lt,cursor:gt?"auto":"normal"},onMouseEnter:gt?re:void 0,onMouseMove:gt?re:void 0,onMouseLeave:gt?ie:void 0,onClick:gt?oe:void 0})},ot=(0,a.forwardRef)((function(t,e){var n=t.isInteractive,r=t.renderWrapper,o=t.theme,a=_(t,nt);return(0,l.jsx)(i.mc,{isInteractive:n,renderWrapper:r,theme:o,animate:!1,children:(0,l.jsx)(it,w({},a,{canvasRef:e}))})})),at=function(t){return(0,l.jsx)(i.KF,{children:function(e){var n=e.width,r=e.height;return(0,l.jsx)(et,w({width:n,height:r},t))}})},st=((0,a.forwardRef)((function(t,e){return(0,l.jsx)(i.KF,{children:function(n){var r=n.width,i=n.height;return(0,l.jsx)(ot,w({width:r,height:i},t,{ref:e}))}})})),n(7382)),lt=n(8640),ut=n(9882),ct=function(t){var e=t.data,n=t.chartConfig,i=t.keys,o=t.indexes,s=t.annotation;if(!e||!1===e.success)return(0,l.jsx)("div",{children:"Error: no data provided"});var u=n.theme,c=n.xAxisLabel,h=n.yAxisLabel,p=n.grouped,g=n.lineMeasure,y=n.verticalLabels,b=e.transformedData,m=e.lineData,v=g&&m&&m.length>0,x=v?i.filter((function(t){return t!==g})):i,w=function(t){var e=t.x,n=t.y,r=t.value,i=t.textAnchor,o=r.split(" "),a=[],s="";return o.forEach((function(t){(s+t).length>12?(s&&a.push(s.trim()),s=t+" "):s+=t+" "})),s&&a.push(s.trim()),(0,l.jsx)("g",{transform:"translate(".concat(e,", ").concat(n+15,")"),children:a.map((function(t,e){return(0,l.jsx)("text",{textAnchor:i,y:14*e,style:{fontSize:"12px",fill:"#333"},children:t},e)}))})},_=(0,st.g)(u),k=_[i.findIndex((function(t){return t===g}))],S=o[0],C=v?function(t){var e=t.bars,n=t.xScale,i=t.innerWidth,o=t.innerHeight,u=(t.tooltip,e[0].width),c=(0,f._6)([{id:"only",data:m.map((function(t,e){return{x:e,y:t[g]}}))}],{type:"linear"},{type:"linear"},i,o),h=(0,lt.A)().x((function(t){return n(t[S])+u})).y((function(t){return c.yScale(t[g])})),p=(0,d.fS)();function y(t,n){var r=e[n].data.indexValue,i=m.find((function(t){return t[S]===r})),o=s.measures[e[n].data.id].title,a=e[n].data.value,u=s.measures[g].title;return p.showTooltipFromEvent((0,l.jsx)(M,{barLabel:o,barValue:a,lineLabel:u,lineValue:i?i[g]:null}),t)}return(0,l.jsxs)(a.Fragment,{children:[(0,l.jsx)(r.Y5,{yScale:c.yScale,xScale:n,width:i,height:o,right:{ticksPosition:"after"}}),(0,l.jsx)("path",{d:h(m),fill:"none",stroke:k,style:{pointerEvents:"none"}}),m.map((function(t){return(0,l.jsx)("circle",{cx:n(t[S])+u,cy:c.yScale(t[g]),r:2,fill:"white",stroke:k,style:{pointerEvents:"none"}},t[S])})),e.map((function(t,e){return(0,l.jsx)("rect",{x:t.x,y:0,height:o,width:t.width,fill:"transparent",onMouseEnter:function(t){return y(t,e)},onMouseMove:function(t){return y(t,e)},onMouseLeave:p.hideTooltip},t.key)}))]})}:null,M=function(t){var e=t.barLabel,n=t.barValue,r=t.lineLabel,i=t.lineValue;return(0,l.jsx)(d.ST,{rows:[[e,n],[r,i]]})};return(0,l.jsxs)("div",{className:"dashboard-chart-container",children:[(0,l.jsx)("div",{className:"dashboard-chart",role:"graphics-datachart",children:(0,l.jsx)(at,{"test-id":"bar-chart",data:b,keys:x,indexBy:function(t){return o.map((function(e){return String(t[e])})).join(" - ")},colors:_,theme:{tooltip:{wrapper:{zIndex:1e3}}},colorBy:"id",groupMode:p?"grouped":"stacked",margin:{top:20,right:40,bottom:70,left:60},padding:.35,valueScale:{type:"linear",max:"auto"},indexScale:{type:"band",round:!0},tooltip:function(t){var e,n=t.id,r=t.value,i=t.indexValue,o=(null===(e=s.measures[n])||void 0===e?void 0:e.title)||n;return(0,l.jsxs)("div",{style:{padding:"6px 9px",background:"white"},children:[(0,l.jsxs)("strong",{children:[o,":"]})," ",r," ",(0,l.jsx)("br",{}),(0,l.jsx)("em",{children:i})]})},borderColor:{from:"color",modifiers:[["darker",1.6]]},axisTop:null,axisRight:null,axisBottom:{tickSize:5,tickPadding:5,tickRotation:-70,legend:c,legendPosition:"middle",legendOffset:60,truncateTickAt:0,renderTick:y?void 0:function(t){return(0,l.jsx)(w,{x:t.x,y:t.y,value:t.value,textAnchor:"middle"})}},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:h,legendPosition:"middle",legendOffset:-50,truncateTickAt:0},labelSkipWidth:12,labelSkipHeight:12,labelTextColor:{from:"color",modifiers:[["darker",1.6]]},role:"application",ariaLabel:"Bar chart",onClick:function(t){return console.log(t)},layers:["grid","bars","markers","legends","axes",C]})}),(0,l.jsx)(ut._,{data:s.measures,themeConfig:_})]})}},7382:(t,e,n)=>{"use strict";n.d(e,{g:()=>r});var r=function(t,e,n){switch(t){case"sequential-green":return{type:"sequential",colors:["#FFFFFF","#009D00"],minValue:e,maxValue:n};case"sequential-red":return{type:"sequential",colors:["#FFFFFF","#f50707"],minValue:e,maxValue:n};case"sequential-blue":return{type:"sequential",colors:["#FFFFFF","#0264f7"],minValue:e,maxValue:n};case"categorical-default":return["#41F99A","#91F941","#F9E441","#F9AF41","#F97841","#F94144","#F941A3","#AC41F9","#4441F9","#41CBF9"];case"categorical-canvas":return["#AFD318","#68AA23","#CFE574","#FDEC73","#FABE78","#32AABF","#ADF3FF"]}}},8448:(t,e,n)=>{"use strict";n.d(e,{HeatMap:()=>R});var r=n(9155),i=n(5650),o=n(4782),a=n(6714),s=n(4028),l=n(6762),u=n(806),c=n(4848),d=n(9072),f=n(8849),h=n(7965),p=n(2555);function g(){return g=Object.assign?Object.assign.bind():function(t){for(var e=1;e<arguments.length;e++){var n=arguments[e];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r])}return t},g.apply(this,arguments)}var y={layers:["grid","axes","cells","legends","annotations"],forceSquare:!1,xInnerPadding:0,xOuterPadding:0,yInnerPadding:0,yOuterPadding:0,sizeVariation:!1,opacity:1,activeOpacity:1,inactiveOpacity:.15,borderWidth:0,borderColor:{from:"color",modifiers:[["darker",.8]]},enableGridX:!1,enableGridY:!1,enableLabels:!0,label:"formattedValue",labelTextColor:{from:"color",modifiers:[["darker",2]]},colors:{type:"sequential",scheme:"brown_blueGreen"},emptyColor:"#000000",legends:[],annotations:[],isInteractive:!0,hoverTarget:"rowColumn",tooltip:(0,r.memo)((function(t){var e=t.cell;return null===e.formattedValue?null:(0,c.jsx)(u.GK,{id:e.serieId+" - "+e.data.x,value:e.formattedValue,enableChip:!0,color:e.color})})),animate:!0,motionConfig:"gentle"},b=(g({},y,{axisTop:{},axisRight:null,axisBottom:null,axisLeft:{},borderRadius:0,cellComponent:"rect"}),g({},y,{axisTop:{},axisRight:null,axisBottom:null,axisLeft:{},renderCell:"rect",pixelRatio:"undefined"!=typeof window&&window.devicePixelRatio||1})),m=function(t){return{x:t.x,y:t.y}},v=function(t){return{size:Math.max(t.width,t.height),width:t.width,height:t.height}},x=function(t){var e=t.data,n=t.width,i=t.height,o=t.xInnerPadding,a=t.xOuterPadding,s=t.yInnerPadding,l=t.yOuterPadding,u=t.forceSquare;return(0,r.useMemo)((function(){return function(t){var e=t.data,n=t.width,r=t.height,i=t.xInnerPadding,o=t.xOuterPadding,a=t.yInnerPadding,s=t.yOuterPadding,l=t.forceSquare,u=new Set,c=[],f=[],p=[];e.forEach((function(t){c.push(t.id),t.data.forEach((function(e){u.add(e.x);var n=null;void 0!==e.y&&null!==e.y&&(f.push(e.y),n=e.y),p.push({id:t.id+"."+e.x,serieId:t.id,value:n,data:e})}))}));var y=Array.from(u),b=function(t){var e=t.width,n=t.height,r=t.rows,i=t.columns,o=e,a=n,s=0,l=0;if(t.forceSquare){var u=Math.max(e/i,0),c=Math.max(n/r,0),d=Math.min(u,c);s=(e-(o=d*i))/2,l=(n-(a=d*r))/2}return{offsetX:s,offsetY:l,width:o,height:a}}({width:n,height:r,columns:y.length,rows:c.length,forceSquare:l}),m=b.width,v=b.height,x=b.offsetX,w=b.offsetY,_=(0,h.nj)((0,d.A)().domain(y).range([0,m]).paddingOuter(o).paddingInner(i)),k=(0,h.nj)((0,d.A)().domain(c).range([0,v]).paddingOuter(s).paddingInner(a)),S=_.bandwidth(),C=k.bandwidth(),M=p.map((function(t){return g({},t,{x:_(t.data.x)+S/2,y:k(t.serieId)+C/2,width:S,height:C})}));return{width:m,height:v,offsetX:x,offsetY:w,xScale:_,yScale:k,minValue:Math.min.apply(Math,f),maxValue:Math.max.apply(Math,f),cells:M}}({data:e,width:n,height:i,xInnerPadding:o,xOuterPadding:a,yInnerPadding:s,yOuterPadding:l,forceSquare:u})}),[e,n,i,o,a,s,l,u])},w={cell:function(t,e){return t.id===e.id},row:function(t,e){return t.serieId===e.serieId},column:function(t,e){return t.data.x===e.data.x},rowColumn:function(t,e){return t.serieId===e.serieId||t.data.x===e.data.x}},_=function(t){var e,n,o,a=t.cells,l=t.minValue,u=t.maxValue,c=t.sizeVariation,d=t.colors,h=t.emptyColor,p=t.opacity,y=t.activeOpacity,b=t.inactiveOpacity,m=t.borderColor,v=t.label,x=t.labelTextColor,w=t.valueFormat,_=t.activeIds,k=(0,r.useMemo)((function(){return function(t,e,n){if(!t)return function(){return 1};var r=(0,f.A)().domain(t.values?t.values:[e,n]).range(t.sizes);return function(t){return null===t?1:r(t)}}(e,n,o)}),[e=c,n=l,o=u]),S=(0,r.useMemo)((function(){return"function"==typeof d?null:(0,s.pN)(d,{min:l,max:u})}),[d,l,u]),C=(0,r.useCallback)((function(t){if(null!==t.value){if("function"==typeof d)return d(t);if(null!==S)return S(t.value)}return h}),[d,S,h]),M=(0,i.DP)(),A=(0,s.nz)(m,M),j=(0,s.nz)(x,M),O=(0,i.d_)(w),T=(0,i.Ob)(v);return{cells:(0,r.useMemo)((function(){return a.map((function(t){var e=p;_.length>0&&(e=_.includes(t.id)?y:b);var n=k(t.value),r=g({},t,{width:t.width*n,height:t.height*n,formattedValue:null!==t.value?O(t.value):null,opacity:e});return r.label=T(r),r.color=C(r),r.borderColor=A(r),r.labelTextColor=j(r),r}))}),[a,k,C,A,j,O,T,_,p,y,b]),colorScale:S}},k=function(t){var e=t.data,n=t.valueFormat,i=t.width,o=t.height,a=t.xOuterPadding,s=void 0===a?y.xOuterPadding:a,l=t.xInnerPadding,u=void 0===l?y.xInnerPadding:l,c=t.yOuterPadding,d=void 0===c?y.yOuterPadding:c,f=t.yInnerPadding,h=void 0===f?y.yInnerPadding:f,p=t.forceSquare,g=void 0===p?y.forceSquare:p,b=t.sizeVariation,m=void 0===b?y.sizeVariation:b,v=t.colors,k=void 0===v?y.colors:v,S=t.emptyColor,C=void 0===S?y.emptyColor:S,M=t.opacity,A=void 0===M?y.opacity:M,j=t.activeOpacity,O=void 0===j?y.activeOpacity:j,T=t.inactiveOpacity,P=void 0===T?y.inactiveOpacity:T,R=t.borderColor,E=void 0===R?y.borderColor:R,D=t.label,z=void 0===D?y.label:D,L=t.labelTextColor,F=void 0===L?y.labelTextColor:L,I=t.hoverTarget,N=void 0===I?y.hoverTarget:I,W=(0,r.useState)(null),H=W[0],q=W[1],U=x({data:e,width:i,height:o,xOuterPadding:s,xInnerPadding:u,yOuterPadding:d,yInnerPadding:h,forceSquare:g}),B=U.width,V=U.height,Y=U.offsetX,$=U.offsetY,G=U.cells,K=U.xScale,X=U.yScale,Q=U.minValue,Z=U.maxValue,J=(0,r.useMemo)((function(){if(!H)return[];var t=w[N];return G.filter((function(e){return t(e,H)})).map((function(t){return t.id}))}),[G,H,N]),tt=_({cells:G,minValue:Q,maxValue:Z,sizeVariation:m,colors:k,emptyColor:C,opacity:A,activeOpacity:O,inactiveOpacity:P,borderColor:E,label:z,labelTextColor:F,valueFormat:n,activeIds:J});return{width:B,height:V,offsetX:Y,offsetY:$,cells:tt.cells,xScale:K,yScale:X,colorScale:tt.colorScale,activeCell:H,setActiveCell:q}},S=function(t,e){return(0,l.wI)({data:t,annotations:e,getPosition:m,getDimensions:v})},C=((0,r.memo)((function(t){var e=t.cell,n=t.borderWidth,o=t.borderRadius,a=t.animatedProps,s=t.onMouseEnter,l=t.onMouseMove,u=t.onMouseLeave,d=t.onClick,f=t.enableLabels,h=(0,i.DP)(),y=(0,r.useMemo)((function(){return{onMouseEnter:s?s(e):void 0,onMouseMove:l?l(e):void 0,onMouseLeave:u?u(e):void 0,onClick:d?d(e):void 0}}),[e,s,l,u,d]);return(0,c.jsxs)(p.CS.g,g({"data-testid":"cell."+e.id,style:{cursor:"pointer"},opacity:a.opacity},y,{transform:(0,p.to)([a.x,a.y,a.scale],(function(t,e,n){return"translate("+t+", "+e+") scale("+n+")"})),children:[(0,c.jsx)(p.CS.rect,{transform:(0,p.to)([a.width,a.height],(function(t,e){return"translate("+-.5*t+", "+-.5*e+")"})),fill:a.color,width:a.width,height:a.height,stroke:a.borderColor,strokeWidth:n,rx:o,ry:o},e.id),f&&(0,c.jsx)(p.CS.text,{textAnchor:"middle",dominantBaseline:"central",fill:a.labelTextColor,style:g({},h.labels.text,{fill:void 0,userSelect:"none"}),children:e.label})]}))})),(0,r.memo)((function(t){var e=t.cell,n=t.borderWidth,o=t.animatedProps,a=t.onMouseEnter,s=t.onMouseMove,l=t.onMouseLeave,u=t.onClick,d=t.enableLabels,f=(0,i.DP)(),h=(0,r.useMemo)((function(){return{onMouseEnter:a?a(e):void 0,onMouseMove:s?s(e):void 0,onMouseLeave:l?l(e):void 0,onClick:u?u(e):void 0}}),[e,a,s,l,u]);return(0,c.jsxs)(p.CS.g,g({"data-testid":"cell."+e.id,style:{cursor:"pointer"},opacity:o.opacity},h,{transform:(0,p.to)([o.x,o.y],(function(t,e){return"translate("+t+", "+e+")"})),children:[(0,c.jsx)(p.CS.circle,{r:(0,p.to)([o.width,o.height],(function(t,e){return Math.min(t,e)/2})),fill:o.color,fillOpacity:o.opacity,strokeWidth:n,stroke:o.borderColor}),d&&(0,c.jsx)(p.CS.text,{dominantBaseline:"central",textAnchor:"middle",fill:o.labelTextColor,style:g({},f.labels.text,{fill:void 0}),children:e.label})]}))})),function(t,e){var n=e.cell,r=n.x,i=n.y,o=n.width,a=n.height,s=n.color,l=n.borderColor,u=n.opacity,c=n.labelTextColor,d=n.label,f=e.borderWidth,h=e.enableLabels,p=e.theme;t.save(),t.globalAlpha=u,t.fillStyle=s,f>0&&(t.strokeStyle=l,t.lineWidth=f),t.fillRect(r-o/2,i-a/2,o,a),f>0&&t.strokeRect(r-o/2,i-a/2,o,a),h&&(t.fillStyle=c,t.font=(p.labels.text.fontWeight?p.labels.text.fontWeight+" ":"")+p.labels.text.fontSize+"px "+p.labels.text.fontFamily,t.textAlign="center",t.textBaseline="middle",t.fillText(d,r,i)),t.restore()}),M=function(t,e){var n=e.cell,r=n.x,i=n.y,o=n.width,a=n.height,s=n.color,l=n.borderColor,u=n.opacity,c=n.labelTextColor,d=n.label,f=e.borderWidth,h=e.enableLabels,p=e.theme;t.save(),t.globalAlpha=u;var g=Math.min(o,a)/2;t.fillStyle=s,f>0&&(t.strokeStyle=l,t.lineWidth=f),t.beginPath(),t.arc(r,i,g,0,2*Math.PI),t.fill(),f>0&&t.stroke(),h&&(t.fillStyle=c,t.font=(p.labels.text.fontWeight?p.labels.text.fontWeight+" ":"")+p.labels.text.fontSize+"px "+p.labels.text.fontFamily,t.textAlign="center",t.textBaseline="middle",t.fillText(d,r,i)),t.restore()},A=["theme","isInteractive","animate","motionConfig","renderWrapper"],j=function(t){var e,n=t.data,s=t.layers,d=void 0===s?b.layers:s,f=t.valueFormat,h=t.width,p=t.height,y=t.margin,m=t.xInnerPadding,v=void 0===m?b.xInnerPadding:m,x=t.xOuterPadding,w=void 0===x?b.xOuterPadding:x,_=t.yInnerPadding,A=void 0===_?b.yInnerPadding:_,j=t.yOuterPadding,O=void 0===j?b.yOuterPadding:j,T=t.forceSquare,P=void 0===T?b.forceSquare:T,R=t.sizeVariation,E=void 0===R?b.sizeVariation:R,D=t.renderCell,z=void 0===D?b.renderCell:D,L=t.opacity,F=void 0===L?b.opacity:L,I=t.activeOpacity,N=void 0===I?b.activeOpacity:I,W=t.inactiveOpacity,H=void 0===W?b.inactiveOpacity:W,q=t.borderWidth,U=void 0===q?b.borderWidth:q,B=t.borderColor,V=void 0===B?b.borderColor:B,Y=t.enableGridX,$=void 0===Y?b.enableGridX:Y,G=t.enableGridY,K=void 0===G?b.enableGridY:G,X=t.axisTop,Q=void 0===X?b.axisTop:X,Z=t.axisRight,J=void 0===Z?b.axisRight:Z,tt=t.axisBottom,et=void 0===tt?b.axisBottom:tt,nt=t.axisLeft,rt=void 0===nt?b.axisLeft:nt,it=t.enableLabels,ot=void 0===it?b.enableLabels:it,at=t.label,st=void 0===at?b.label:at,lt=t.labelTextColor,ut=void 0===lt?b.labelTextColor:lt,ct=t.colors,dt=void 0===ct?b.colors:ct,ft=t.emptyColor,ht=void 0===ft?b.emptyColor:ft,pt=t.legends,gt=void 0===pt?b.legends:pt,yt=t.annotations,bt=void 0===yt?b.annotations:yt,mt=t.isInteractive,vt=void 0===mt?b.isInteractive:mt,xt=t.onClick,wt=t.hoverTarget,_t=void 0===wt?b.hoverTarget:wt,kt=t.tooltip,St=void 0===kt?b.tooltip:kt,Ct=t.role,Mt=t.ariaLabel,At=t.ariaLabelledBy,jt=t.ariaDescribedBy,Ot=t.pixelRatio,Tt=void 0===Ot?b.pixelRatio:Ot,Pt=(0,r.useRef)(null),Rt=(0,i.Xl)(h,p,y),Et=Rt.margin,Dt=Rt.innerWidth,zt=Rt.innerHeight,Lt=Rt.outerWidth,Ft=Rt.outerHeight,It=k({data:n,valueFormat:f,width:Dt,height:zt,xInnerPadding:v,xOuterPadding:w,yInnerPadding:A,yOuterPadding:O,forceSquare:P,sizeVariation:E,colors:dt,emptyColor:ht,opacity:F,activeOpacity:N,inactiveOpacity:H,borderColor:V,label:st,labelTextColor:ut,hoverTarget:_t}),Nt=It.width,Wt=It.height,Ht=It.offsetX,qt=It.offsetY,Ut=It.xScale,Bt=It.yScale,Vt=It.cells,Yt=It.colorScale,$t=It.activeCell,Gt=It.setActiveCell,Kt=(0,r.useMemo)((function(){return g({},Et,{top:Et.top+qt,left:Et.left+Ht})}),[Et,Ht,qt]),Xt=S(Vt,bt),Qt=(0,l.x$)({annotations:Xt});e="function"==typeof z?z:"circle"===z?M:C;var Zt=(0,i.DP)(),Jt=(0,r.useMemo)((function(){return{cells:Vt,activeCell:$t,setActiveCell:Gt}}),[Vt,$t,Gt]);(0,r.useEffect)((function(){if(null!==Pt.current){var t=Pt.current.getContext("2d");t&&(Pt.current.width=Lt*Tt,Pt.current.height=Ft*Tt,t.scale(Tt,Tt),t.fillStyle=Zt.background,t.fillRect(0,0,Lt,Ft),t.translate(Kt.left,Kt.top),d.forEach((function(n){"grid"===n?(t.lineWidth=Zt.grid.line.strokeWidth,t.strokeStyle=Zt.grid.line.stroke,$&&(0,o.xu)(t,{width:Nt,height:Wt,scale:Ut,axis:"x"}),K&&(0,o.xu)(t,{width:Nt,height:Wt,scale:Bt,axis:"y"})):"axes"===n?(0,o.ZY)(t,{xScale:Ut,yScale:Bt,width:Nt,height:Wt,top:Q,right:J,bottom:et,left:rt,theme:Zt}):"cells"===n?(t.textAlign="center",t.textBaseline="middle",Vt.forEach((function(n){e(t,{cell:n,borderWidth:U,enableLabels:ot,theme:Zt})}))):"legends"===n&&null!==Yt?gt.forEach((function(e){(0,a.Rm)(t,g({},e,{containerWidth:Nt,containerHeight:Wt,scale:Yt,theme:Zt}))})):"annotations"===n?(0,l.e0)(t,{annotations:Qt,theme:Zt}):"function"==typeof n&&n(t,Jt)})))}}),[Pt,Tt,Lt,Ft,Nt,Wt,Kt,d,Jt,Vt,e,$,K,Q,J,et,rt,Ut,Bt,Zt,U,ot,Yt,gt,Qt]);var te=(0,u.fS)(),ee=te.showTooltipFromEvent,ne=te.hideTooltip,re=(0,r.useCallback)((function(t){if(null!==Pt.current){var e=(0,i.H9)(Pt.current,t),n=e[0],o=e[1],a=Vt.find((function(t){return(0,i.u7)(t.x+Kt.left-t.width/2,t.y+Kt.top-t.height/2,t.width,t.height,n,o)}));void 0!==a?(Gt(a),ee((0,r.createElement)(St,{cell:a}),t)):(Gt(null),ne())}}),[Pt,Vt,Kt,Gt,ee,ne,St]),ie=(0,r.useCallback)((function(){Gt(null),ne()}),[Gt,ne]),oe=(0,r.useCallback)((function(t){null!==$t&&(null==xt||xt($t,t))}),[$t,xt]);return(0,c.jsx)("canvas",{ref:Pt,width:Lt*Tt,height:Ft*Tt,style:{width:Lt,height:Ft},onMouseEnter:vt?re:void 0,onMouseMove:vt?re:void 0,onMouseLeave:vt?ie:void 0,onClick:vt?oe:void 0,role:Ct,"aria-label":Mt,"aria-labelledby":At,"aria-describedby":jt})},O=function(t){var e=t.theme,n=t.isInteractive,r=void 0===n?b.isInteractive:n,o=t.animate,a=void 0===o?b.animate:o,s=t.motionConfig,l=void 0===s?b.motionConfig:s,u=t.renderWrapper,d=function(t,e){if(null==t)return{};var n,r,i={},o=Object.keys(t);for(r=0;r<o.length;r++)n=o[r],e.indexOf(n)>=0||(i[n]=t[n]);return i}(t,A);return(0,c.jsx)(i.mc,{isInteractive:r,animate:a,motionConfig:l,theme:e,renderWrapper:u,children:(0,c.jsx)(j,g({isInteractive:r},d))})},T=function(t){return(0,c.jsx)(i.KF,{children:function(e){var n=e.width,r=e.height;return(0,c.jsx)(O,g({width:n,height:r},t))}})},P=n(7382),R=function(t){var e=t.data,n=t.chartConfig;if(!e||!1===e.success)return(0,c.jsx)("div",{children:"Error: no data provided"});var r=n.xAxisLabel,i=n.yAxisLabel,o=n.theme,a=n.minValue,s=n.maxValue;return(0,c.jsx)("div",{className:"dashboard-chart-container",children:(0,c.jsx)("div",{className:"dashboard-chart",role:"graphics-datachart",children:(0,c.jsx)(T,{"test-id":"heatmap",data:e,margin:{top:30,right:80,bottom:50,left:80},valueFormat:">-.2s",axisRight:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendPosition:"middle",legendOffset:70,truncateTickAt:0},axisLeft:{tickSize:5,tickPadding:5,tickRotation:0,legend:i,legendPosition:"middle",legendOffset:-72,truncateTickAt:0},colors:(0,P.g)(o,a,s),emptyColor:"#555555",opacity:10,legends:[{anchor:"bottom",translateX:0,translateY:30,length:400,thickness:8,direction:"row",tickPosition:"after",tickSize:3,tickSpacing:4,tickOverlap:!1,tickFormat:">-.2s",title:r+" Value →",titleAlign:"start",titleOffset:4}],onClick:function(t){return console.log(t)}},o)})})}},512:(t,e,n)=>{"use strict";n.d(e,{LineChart:()=>Ct});var r=n(9155),i=n(5650),o=n(4028),a=n(4782),s=n(6714),l=n(806),u=n(8640),c=n(5917),d=n(8946),f=n(6343),h=n(1509),p=n(9206),g=n(7965),y=n(7200),b=n(4848),m=n(2555);const v=11102230246251565e-32,x=134217729,w=(3+8*v)*v;function _(t,e,n,r,i){let o,a,s,l,u=e[0],c=r[0],d=0,f=0;c>u==c>-u?(o=u,u=e[++d]):(o=c,c=r[++f]);let h=0;if(d<t&&f<n)for(c>u==c>-u?(a=u+o,s=o-(a-u),u=e[++d]):(a=c+o,s=o-(a-c),c=r[++f]),o=a,0!==s&&(i[h++]=s);d<t&&f<n;)c>u==c>-u?(a=o+u,l=a-o,s=o-(a-l)+(u-l),u=e[++d]):(a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++f]),o=a,0!==s&&(i[h++]=s);for(;d<t;)a=o+u,l=a-o,s=o-(a-l)+(u-l),u=e[++d],o=a,0!==s&&(i[h++]=s);for(;f<n;)a=o+c,l=a-o,s=o-(a-l)+(c-l),c=r[++f],o=a,0!==s&&(i[h++]=s);return 0===o&&0!==h||(i[h++]=o),h}function k(t){return new Float64Array(t)}const S=k(4),C=k(8),M=k(12),A=k(16),j=k(4);function O(t,e,n,r,i,o){const a=(e-o)*(n-i),s=(t-i)*(r-o),l=a-s,u=Math.abs(a+s);return Math.ab