@carbon/charts 1.23.2 → 1.23.4
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/CHANGELOG.md +22 -0
- package/dist/{choropleth-BOOQMTNf.mjs → choropleth-EJrtnKv4.mjs} +6 -3
- package/dist/choropleth-EJrtnKv4.mjs.map +1 -0
- package/dist/components/index.mjs +1 -1
- package/dist/index.mjs +2 -2
- package/dist/umd/bundle.umd.cjs +2 -2
- package/dist/umd/bundle.umd.cjs.map +1 -1
- package/dist/umd/bundle.umd.js +2 -2
- package/package.json +2 -2
- package/dist/choropleth-BOOQMTNf.mjs.map +0 -1
package/dist/umd/bundle.umd.cjs
CHANGED
|
@@ -62,7 +62,7 @@
|
|
|
62
62
|
<svg xmlns="http://www.w3.org/2000/svg" class="arrow-right" width="32" height="32" viewBox="0 0 32 32">
|
|
63
63
|
<polygon points="18 6 16.57 7.393 24.15 15 4 15 4 17 24.15 17 16.57 24.573 18 26 28 16 18 6"/>
|
|
64
64
|
<rect width="32" height="32"/>
|
|
65
|
-
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Mk extends Ze{constructor(t,n){super(t,n),this.model=new ak(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new wk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=at.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===rt.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const _=x[1]-x[0];let C="0,"+_.toString();const D=Math.floor(l/ri.DASH_LENGTH),B=D*ri.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+ri.DASH_LENGTH;C+=","+(l-B),D%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const _=x.selection;_===null||_[0]===_[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(_))},v=(x,_)=>{const C=vf().range([0,o]).domain(p);let D=[C.invert(x),C.invert(_)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let S;const E=x=>{const _=x.selection;_!==null&&(v(_[0],_[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=$h().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();i.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=zn(s.node(),_)[0];let D=C-o*b/2;D<0&&(D=0);let B=C+o*b/2;B>o&&(B=o),v(D,B)}})}}};ri.DASH_LENGTH=4;let Su=ri;class Ck extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=at.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=$h(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=Se.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ye.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ye.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===rt.TIME){let m=this.services.zoom.getZoomBarData();if(We(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ct([],E),zoomDomain:E?ct([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Fe(m,_=>_.value));const b=this.model.get("zoomDomain");if(s===Ye.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,B=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[_])).attr("width",this.xScale(P[C])-this.xScale(P[_])).style("fill",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=b.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}i&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-5/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-1/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ye.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=Se.height[f],g=Yl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=Tn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Bi()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ye.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Ak extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new lo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===rt.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Cn(D,B,C),H=I(this);h===z.TOP||h===z.BOTTOM?(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===rt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${fe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=zn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class Dk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new lo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),_=P=>E.getRangeValue(P),[C,D]=Cn(x,_,b),B=I(this);h===z.TOP||h===z.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(C(H[w])-C(H[P]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null):B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(D(H[P])-D(H[w]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null)})}}class qm extends mu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Es(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Lk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t);return r.getFullYear()-i.getFullYear()}function Rk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Es(r,i),a=Math.abs(Lk(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Es(r,i)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const r=$t(e,n==null?void 0:n.in);if(isNaN(t))return ke(e,NaN);if(!t)return r;const i=r.getDate(),s=ke(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Xm(e,t,n){return _u(e,t*12,n)}function Ik(e,t,n){return Xm(e,-t,n)}function kk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Pk(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Nk(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t==null?void 0:t.in);return+Pk(n,t)==+Nk(n,t)}function Fk(e,t,n){const[r,i,s]=ur(n==null?void 0:n.in,e,e,t),a=Es(i,s),o=Math.abs(kk(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Es(i,s)===-a;$k(r)&&o===1&&Es(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Uk(e,t,n){return _u(e,-t,n)}function Bk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Zm(r,i),a=Math.abs(Kg(r,i));r.setDate(r.getDate()-s*a);const o=+(Zm(r,i)===-s),l=s*(a-o);return l===0?0:l}function Zm(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function jm(e,t,n){const r=$t(e,n==null?void 0:n.in);return isNaN(t)?ke(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Hk(e,t,n){return jm(e,-t,n)}function Tu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=(+r-+i)/Fg;return Tu(n==null?void 0:n.roundingMethod)(s)}function Km(e,t,n){return ke(e,+$t(e)+t)}function Qm(e,t,n){return Km(e,t*Fg)}function Vk(e,t,n){return Qm(e,-t)}function Jm(e,t){return+$t(e)-+$t(t)}function tv(e,t,n){const r=Jm(e,t)/$g;return Tu(n==null?void 0:n.roundingMethod)(r)}function Ou(e,t,n){const r=$t(e,n==null?void 0:n.in);return r.setTime(r.getTime()+t*$g),r}function ev(e,t,n){return Ou(e,-t,n)}function nv(e,t,n){const r=Jm(e,t)/1e3;return Tu(n==null?void 0:n.roundingMethod)(r)}function wu(e,t,n){return Km(e,t*1e3)}function rv(e,t,n){return wu(e,-t)}class zk extends Dn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const r=this.getAxisOptions(t).title;return r||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=y(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===rt.LINEAR||this.scaleTypes[t]===rt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=y(i,l)!==null?i[l]:i;let u;switch(n){case rt.LABELS:u=t(c)+t.step()/2;break;case rt.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===rt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return Wk(n,s)}else return Yk(n,$n.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||rt.LINEAR,o=s.scaleType||rt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===rt.LABELS||o===rt.TIME)&&a===rt.LABELS||a===rt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||rt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Vn(v,S=>S.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=$n.ratio;if(r.domain)return a===rt.LABELS?r.domain:(a===rt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===rt.LABELS)return Ji(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===rt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===rt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{..._}=x;let C=0,D=0;Object.values(eL(_,"sharedStackKey")).forEach(B=>{isNaN(B)||(B<0?D+=B:C+=B)}),b.push([D,C])}),g=[...fc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==rt.TIME&&a!==rt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=Fe(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||rt.LINEAR;this.scaleTypes[t]=i;let s;return i===rt.TIME?s=vf():i===rt.LOG?s=Kd().base(r.base||10):i===rt.LABELS||i===rt.LABELS_RATIO?s=Ii():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===rt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function Wk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return Rk(r,n)>1?[Ik(n,t),Xm(r,t)]:Fk(r,n)>1?[Uk(n,t),_u(r,t)]:Bk(r,n)>1?[Hk(n,t),jm(r,t)]:Gk(r,n)>1?[Vk(n,t),Qm(r,t)]:tv(r,n)>30?[ev(n,t*30),Ou(r,t*30)]:tv(r,n)>1?[ev(n,t),Ou(r,t)]:nv(r,n)>15?[rv(n,t*15),wu(r,t*15)]:nv(r,n)>1?[rv(n,t),wu(r,t)]:[n,r]}function Yk([e,t],n,r){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(r===rt.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class qk extends Dn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:Df,curveBasis:j_,curveBasisClosed:K_,curveBasisOpen:Q_,curveBundle:J_,curveCardinal:tT,curveCardinalClosed:eT,curveCardinalOpen:nT,curveCatmullRom:rT,curveCatmullRomClosed:iT,curveCatmullRomOpen:sT,curveMonotoneX:aT,curveMonotoneY:oT,curveNatural:lT,curveStep:cT,curveStepAfter:hT,curveStepBefore:uT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Xk extends Dn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===rt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=Se.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class ge extends Ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:zk,curves:qk,zoom:Xk}),this.model=new pr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===rt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new le(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Nm(this.model,this.services),new Su(this.model,this.services)),t.push(new Ak(this.model,this.services)),t.push(new Dk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const _=y(this.model.getOptions(),"legend","position");_===Yr.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const S={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new le(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ck(this.model,this.services)],growth:dt.PREFERRED,renderType:at.SVG},x=[];if(u||s){x.push(f);const _={id:"spacer",components:[new Ln(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(_)}return l&&x.push(b),x.push(E),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,x,{direction:Ct.COLUMN})]}}class Te extends mt{constructor(){super(...arguments),this.type="grid",this.renderType=at.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Mo(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Hu(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Mn(u).tx)-Number(Mn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Mn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Mn(o).tx;else if(o)l=+Mn(o).tx-+Mn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Mn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Mn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class iv extends mt{constructor(){super(...arguments),this.type="area",this.renderType=at.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Yl().curve(this.services.curves.getD3Curve()).defined(x=>{const _=s.getRangeIdentifier(),C=x[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,_)=>{y(r,"axes",x,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let _;if(x)_=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);_=C[D[0]]}}ys.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:ys.getStops(i,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:_}=x;return o(_)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:On.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",On.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ei extends mt{constructor(){super(...arguments),this.type="line",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?wn.opacity.unselected:wn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=Cn(s,a,r.getOrientation()),c=this.getOptions(),u=Bi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const S=this.services.cartesianScales.getDomainIdentifier(v),E=this.services.cartesianScales.getRangeIdentifier(v);return{name:y(v,0,g),data:v.map(b=>({[S]:b.data.sharedStackKey,[g]:b[g],[E]:b[1]})),hidden:!rL(v,b=>b[0]!==b[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const sv=5;function Zk(e,t){return e>t-sv&&e<t+sv}class Bn extends mt{constructor(){super(...arguments),this.type="ruler",this.renderType=at.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Zk(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),_=b[x];return _!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=zn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=uL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class cn extends mt{constructor(){super(...arguments),this.type="scatter",this.renderType=at.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Cn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Cn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Cn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var a,o;const s=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=I(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class av extends mt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===rt.LABELS||this.scaleType===rt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Hu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=y0;break;case z.TOP:h=v0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===rt.TIME||m.scaleType===rt.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(r,"data","loading"),_=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),B=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=_!==null,H=y(r,"timeScale"),N=k.appendOrSelect(g,"g.tick"),M=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(M.node(),{useBBox:!0}).height;N.remove();const $=this.scaleType||m.scaleType||rt.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=$n.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,$n.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),F.ticks(K),v)if(!d.ticks(K).length)F.tickValues([]);else{const nt=y(r,"timeScale","addSpaceOnEdges"),ht=y(r,"axes",n,"domain"),W=d.copy();nt&&!ht&&W.nice(K);const j=W.ticks(K);nt&&j.length>2&&!ht&&(j.splice(j.length-1,1),j.splice(0,1)),F.tickValues(j)}}let L;const U=y(m,"ticks","formatter"),{code:tt,number:X}=y(r,"locale");if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,r.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,r.locale);return U(nt,ht,W)}}else U===null?$===rt.LINEAR&&(L=K=>X(K,tt)):L=U;F.tickFormat(L);const[Y,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ut=C.filter(K=>{const nt=K.getTime();return nt>=new Date(Y).getTime()&&nt<=new Date(Q).getTime()});else if(b===rt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ut=C.filter(nt=>K.includes(nt))}else ut=C.filter(K=>K>=Y&&K<=Q);F.tickValues(ut)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":ln(m.title)),nt=y(m,"titleOrientation");let ht;switch(n){case z.LEFT:nt===qa.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:nt===qa.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ht=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval")),nt=H.showDayName,ht=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(F),ht.selectAll(".tick").data(F.tickValues(),d).order().select("text").attr("class",(j,J)=>am(j,J,F.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(F):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(F);if(g.call(F),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===ns.ALWAYS)K=!0;else if(nt===ns.NEVER)K=!1;else if(!nt||nt===ns.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(W=>k.getSVGElementSize(W,{useBBox:!0}).width>=d.step());else{K=!1;const ht=g.append("text").text("A"),W=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),A=parseFloat(y(Mn(this),"tx"));A!==null&&j+J.text().length*W*.8>=A&&(K=!0),j=A}),ht.remove()}K?(w||(F.ticks(this.getNumberOfFittingTicks(a,O,$n.ticks.horizontalSpaceRatio)),g.call(F),p.call(F)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Re.NONE&&b===rt.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ht=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>B?(ht.truncation[n]=!0,as(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?as(W,D,P):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Up(i,2,$n.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class jk extends av{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=k.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-$n.hover.rectanglePadding).attr("y",p).attr("width",u+$n.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===rt.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends mt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=at.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===is.DEFAULT?new av(this.model,this.services,c):new jk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class ce extends mt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Vt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Vt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Vt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Vt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ge().domain([0,1]).range(t),this.yScale=Ge().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("width",r).attr("height",i);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ui().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Gt.CENTER?p=s/2:c===Gt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
65
|
+
</svg>`}destroy(){this.parent.selectAll("path.line,.node-group").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null)}}class Mk extends Ze{constructor(t,n){super(t,n),this.model=new ak(this.services),this.model.setOptions(It(At.alluvialChart,n.options)),this.init(t,n)}getComponents(){const t=[new wk(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}const ri=class ri extends mt{constructor(){super(...arguments),this.type="grid-brush",this.renderType=at.SVG,this.selectionSelector="rect.selection",this.frontSelectionSelector="rect.frontSelection"}render(t=!0){const n=this.parent,r=this.getComponentContainer({isPresentational:!0});if(!n)throw new Error("SVG was not defined");const i=k.appendOrSelect(n,"svg.chart-grid-backdrop"),s=k.appendOrSelect(i,`g.${this.type}`),a=k.appendOrSelect(s,this.selectionSelector),{width:o,height:l}=k.getSVGElementSize(i,{useAttrs:!0}),{cartesianScales:c}=this.services,u=c.getMainXScaleType(),d=c.getMainXScale(),[h]=d.range();r.attr("transform",`translate(${h},0)`);const f=k.appendOrSelect(r,this.frontSelectionSelector);if(d&&u===rt.TIME){let p=this.model.get("zoomDomain");p===void 0&&(p=this.services.zoom.getDefaultZoomBarDomain(),p&&this.model.set({zoomDomain:p},{animate:!1}));const g=x=>{const _=x[1]-x[0];let C="0,"+_.toString();const D=Math.floor(l/ri.DASH_LENGTH),B=D*ri.DASH_LENGTH;for(let P=0;P<D;P++)C+=","+ri.DASH_LENGTH;C+=","+(l-B),D%2===1&&(C+=",0"),C+=","+_.toString(),C+=","+l.toString(),f.attr("stroke-dasharray",C)},m=x=>{const _=x.selection;_===null||_[0]===_[1]||(f.attr("x",parseFloat(a.attr("x"))+parseFloat(i.attr("x"))).attr("y",a.attr("y")).attr("width",a.attr("width")).attr("height",a.attr("height")).style("cursor","pointer").style("display",null),g(_))},v=(x,_)=>{const C=vf().range([0,o]).domain(p);let D=[C.invert(x),C.invert(_)];D[0].valueOf()===D[1].valueOf()&&(D=this.services.zoom.getDefaultZoomBarDomain()),(p[0].valueOf()!==D[0].valueOf()||p[1].valueOf()!==D[1].valueOf())&&this.services.zoom.handleDomainChange(D)};let S;const E=x=>{const _=x.selection;_!==null&&(v(_[0],_[1]),s.call(S.move,null),f.style("display","none"))};l!=0&&o!=0&&(S=$h().extent([[0,0],[o-1,l]]).on("start brush end",m).on("end.brushed",E),s.call(S));const b=this.services.zoom.getZoomRatio();i.on("click",function(x){if(x.shiftKey){const _=this.services.domUtils.getHolder(),C=zn(s.node(),_)[0];let D=C-o*b/2;D<0&&(D=0);let B=C+o*b/2;B>o&&(B=o),v(D,B)}})}}};ri.DASH_LENGTH=4;let Su=ri;class Ck extends mt{constructor(){super(...arguments),this.type="zoom-bar",this.renderType=at.SVG,this.MIN_SELECTION_DIFF=9e-10,this.brushSelector="g.zoom-bar-brush",this.clipId="zoomBarClip-"+Math.floor(Math.random()*99999999999),this.brush=$h(),this.highlightStrokeWidth=1}init(){this.services.events.addEventListener(T.ZoomBar.UPDATE,this.render.bind(this));const t=y(this.getOptions(),"zoomBar",z.TOP,"data");this.model.setZoomBarData(t)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"zoom bar"}),r=this.services.zoom.isZoomBarLoading(z.TOP),i=this.services.zoom.isZoomBarLocked(z.TOP),s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=y(this.getOptions(),"axes",z.BOTTOM,"highlights"),o=Se.height[s],{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(l===0)return;let c=0;const u=this.model.get("axesMargins");u&&u.left&&(c=u.left);const d=k.appendOrSelect(n,"svg.zoom-container").attr("width","100%").attr("height",o).attr("opacity",1);if(k.appendOrSelect(n,"rect.zoom-spacer").attr("x",0).attr("y",o).attr("width","100%").attr("height",Se.spacerHeight).attr("opacity",1).attr("fill","none"),s===Ye.GRAPH_VIEW?k.appendOrSelect(d,"rect.zoom-bg").attr("x",c).attr("y",0).attr("width",l-c).attr("height","100%").classed("zoom-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null):s===Ye.SLIDER_VIEW&&k.appendOrSelect(d,"rect.zoom-slider-bg").attr("x",c).attr("y",o/2-1).attr("width",l-c).attr("height",2).classed("zoom-slider-bg-skeleton",r).style("stroke",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null),r){this.renderSkeleton(d,c,l);return}const{cartesianScales:h}=this.services,f=h.getMainXScale(),p=h.getMainYScale(),g=h.getMainXScaleType();if(f&&g===rt.TIME){let m=this.services.zoom.getZoomBarData();if(We(m)||m.length===1)return;this.xScale=f.copy(),this.yScale=p.copy();const v=this.services.zoom.getDefaultZoomBarDomain(m);m=this.compensateDataForDefaultDomain(m,v);const S=this.model.get("initialZoomDomain"),E=y(this.getOptions(),"zoomBar",z.TOP,"initialZoomDomain");E&&E[0]&&E[1]&&(E[0]=new Date(E[0]),E[1]=new Date(E[1])),E&&!(S&&S[0].valueOf()===E[0].valueOf()&&S[1].valueOf()===E[1].valueOf())?this.model.set({initialZoomDomain:ct([],E),zoomDomain:E?ct([],E):v},{skipUpdate:!0}):E===null&&S!==null&&this.model.set({initialZoomDomain:null,zoomDomain:ct([],v)},{skipUpdate:!0}),this.xScale.range([c,l]).domain(v),this.maxSelectionRange=this.xScale.range(),this.yScale.range([0,o-6]).domain(Fe(m,_=>_.value));const b=this.model.get("zoomDomain");if(s===Ye.GRAPH_VIEW&&(this.renderZoomBarArea(d,"path.zoom-graph-area-unselected",m,null),this.updateClipPath(n,this.clipId,0,0,0,0),this.renderZoomBarArea(d,"path.zoom-graph-area",m,this.clipId),this.renderZoomBarBaseline(d,c,l),a)){const _=a.highlightStartMapsTo,C=a.highlightEndMapsTo,D=a.color,B=a.labelMapsTo;a.data.forEach((P,w)=>{k.appendOrSelect(d,`rect.highlight-${w}`).attr("height",o-2*this.highlightStrokeWidth).attr("y",this.highlightStrokeWidth).attr("x",this.xScale(P[_])).attr("width",this.xScale(P[C])-this.xScale(P[_])).style("fill",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("fill-opacity",.1).style("stroke",D&&D.scale[P[B]]?D.scale[P[B]]:null).style("stroke-dasharray","2, 2").attr("stroke-width","1px")})}this.addBrushEventListener(b,c,l);const x=k.appendOrSelect(n,this.brushSelector).call(this.brush);if(b!==void 0)if(b[0].valueOf()===b[1].valueOf())x.call(this.brush.move,this.xScale.range()),this.updateBrushHandle(this.getComponentContainer(),this.xScale.range());else{const _=b.map(C=>this.xScale(C));_[1]-_[0]<this.MIN_SELECTION_DIFF||(x.call(this.brush.move,_),this.updateBrushHandle(this.getComponentContainer(),_))}i&&(this.brush.filter(()=>!1),x.selectAll("rect").attr("cursor","auto"))}}addBrushEventListener(t,n,r){const i=o=>{const l=o.selection;l===null?this.handleBrushedEvent(o,t,this.xScale,this.xScale.range()):l[0]===l[1]||this.handleBrushedEvent(o,t,this.xScale,l)},s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s];this.brush.extent([[n,0],[r,a]]).on("start brush end",null).on("start brush end",i)}handleBrushedEvent(t,n,r,i){const s=[r.invert(i[0]),r.invert(i[1])];if(this.updateBrushHandle(this.getComponentContainer(),i),t.sourceEvent!=null&&(t.sourceEvent.type==="mousemove"||t.sourceEvent.type==="mouseup"||t.sourceEvent.type==="mousedown"||t.sourceEvent.type==="touchstart"||t.sourceEvent.type==="touchmove"||t.sourceEvent.type==="touchend")){(n===void 0||n[0]!==s[0]||n[1]!==s[1])&&this.services.zoom.handleDomainChange(s,{dispatchEvent:!1});let a;t.type==="start"?a=T.ZoomBar.SELECTION_START:t.type==="brush"?a=T.ZoomBar.SELECTION_IN_PROGRESS:t.type==="end"&&(a=T.ZoomBar.SELECTION_END,this.services.events.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:s})),this.services.events.dispatchEvent(a,{selection:i,newDomain:s})}}updateBrushHandle(t,n){const r=this,i=Se.handleWidth,s=y(this.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=-5/2,l=Se.handleBarWidth,c=s===Ye.GRAPH_VIEW?Se.handleBarHeight:6,u=-1/2,d=(a-c)/2;t.select(this.brushSelector).selectAll("rect.handle").data([{type:"w"},{type:"e"}]).attr("x",function(f){if(f.type==="w")return Math.max(n[0]+o,r.maxSelectionRange[0]);if(f.type==="e")return Math.min(n[1]+o,r.maxSelectionRange[1]-i)}).attr("y",0).attr("width",i).attr("height",a).attr("cursor","ew-resize").style("display",null);const h=t.select(this.brushSelector).selectAll("rect.handle-bar").data([{type:"w"},{type:"e"}]);h.enter().append("rect").attr("class",function(f){return"handle-bar handle-bar--"+f.type}),h.attr("x",function(f){if(f.type==="w")return Math.max(n[0]+u,r.maxSelectionRange[0]-o+u);if(f.type==="e")return Math.min(n[1]+u,r.maxSelectionRange[1]+o+u)}).attr("y",d).attr("width",l).attr("height",c).attr("cursor","ew-resize"),s===Ye.SLIDER_VIEW&&this.updateSliderSelectedArea(n),this.updateClipPath(t,this.clipId,n[0],0,n[1]-n[0],a)}updateSliderSelectedArea(t){const n=y(this.getOptions(),"zoomBar",z.TOP,"type"),r=Se.height[n],s=this.getComponentContainer().select("svg.zoom-container");k.appendOrSelect(s,"rect.zoom-slider-selected-area").attr("x",t[0]).attr("y",r/2-1).attr("width",t[1]-t[0]).attr("height",2)}renderZoomBarArea(t,n,r,i){const{cartesianScales:s}=this.services,a=s.getMainXAxisPosition(),o=s.getMainYAxisPosition(),l=s.getMainXScaleType(),c=s.getMainYScaleType(),u=(v,S,E)=>b=>s.getValueFromScale(v,S,E,b),d=u(this.xScale,l,a),h=u(this.yScale,c,o),f=y(this.getOptions(),"zoomBar",z.TOP,"type"),p=Se.height[f],g=Yl().x(v=>d(v)).y0(p).y1(v=>p-h(v)),m=k.appendOrSelect(t,n).datum(r).attr("d",g);i&&m.attr("clip-path",`url(#${i})`)}updateClipPath(t,n,r,i,s,a){const o=k.appendOrSelect(t,"clipPath").attr("id",n);k.appendOrSelect(o,"rect").attr("x",r).attr("y",i).attr("width",s).attr("height",a)}compensateDataForDefaultDomain(t,n){if(!t||t.length<2)return;const r=Tn(t),i=this.services.cartesianScales.getDomainIdentifier(),s=this.services.cartesianScales.getRangeIdentifier();if(Number(n[0])<Number(r[0][i])){const a={};a[i]=n[0],a[s]=0,r.unshift(a)}if(Number(n[1])>Number(r[r.length-1][i])){const a={};a[i]=n[1],a[s]=0,r.push(a)}return r}renderZoomBarBaseline(t,n,r,i=!1){const s=y(this.model.getOptions(),"zoomBar",z.TOP,"type"),a=Se.height[s],o=Bi()([[n,a],[r,a]]);k.appendOrSelect(t,"path.zoom-bg-baseline").attr("d",o).classed("zoom-bg-baseline-skeleton",i).style("stroke",i?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}renderSkeleton(t,n,r){this.renderZoomBarArea(t,"path.zoom-graph-area-unselected",[],null),this.renderZoomBarArea(t,"path.zoom-graph-area",[],this.clipId),this.brush.on("start brush end",null),k.appendOrSelect(this.getComponentContainer(),this.brushSelector).html(null),y(this.getOptions(),"zoomBar",z.TOP,"type")===Ye.GRAPH_VIEW&&this.renderZoomBarBaseline(t,n,r,!0)}destroy(){this.brush.on("start brush end",null),this.services.events.removeEventListener(T.ZoomBar.UPDATE,this.render.bind(this))}}class Ak extends mt{constructor(t,n){super(t,n),this.type="threshold",this.renderType=at.SVG,this.positionService=new lo}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.thresholds&&f.thresholds.length>0&&r.push({axisPosition:h,thresholds:f.thresholds,correspondingDatasets:f==null?void 0:f.correspondingDatasets,mapsTo:f==null?void 0:f.mapsTo})}});const s=this.getComponentContainer({ariaLabel:"threshold lines",withinChartClip:!0}).selectAll("g.axis-thresholds").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-thresholds ${h.axisPosition}`);const l=o.selectAll("g.threshold-group").data(h=>h.thresholds.map(f=>(f.axisPosition=h.axisPosition,f.datum=this.constructDatumObj(h,f),f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("line").attr("class","threshold-line"),c.append("rect").attr("class","threshold-hoverable-area"),c.merge(l).attr("class","threshold-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getScaleByPosition(h),p=d.services.cartesianScales.getScaleTypeByPosition(h);let g=null,m=null;h===z.LEFT||h===z.RIGHT?(m=f,g=d.services.cartesianScales.getMainXScale()):(g=f,m=d.services.cartesianScales.getMainYScale());const v=p===rt.LABELS,[S,E]=g.range(),[b,x]=m.range(),{cartesianScales:_}=d.services,C=_.getOrientation(),D=N=>_.getDomainValue(N),B=N=>_.getRangeValue(N),[P,w]=Cn(D,B,C),H=I(this);h===z.TOP||h===z.BOTTOM?(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("y1",x).attr("y2",b).attr("x1",({datum:N})=>P(N)+(v?f.step()/2:0)).attr("x2",({datum:N})=>P(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",0).attr("y",({datum:N})=>-P(N)).attr("width",Math.abs(b-x)).classed("rotate",!0)):(H.selectAll("line.threshold-line").transition().call(N=>d.services.transitions.setupTransition({transition:N,name:"threshold-line-update",animate:t})).attr("x1",S).attr("x2",E).attr("y1",({datum:N})=>w(N)+(v?f.step()/2:0)).attr("y2",({datum:N})=>w(N)+(v?f.step()/2:0)).style("stroke",({fillColor:N})=>N),H.selectAll("rect.threshold-hoverable-area").attr("x",S).attr("y",({datum:N})=>w(N)).attr("width",Math.abs(E-S)).classed("rotate",!1))}),this.services.events.addEventListener(T.Threshold.SHOW,h=>{this.setThresholdLabelPosition(h.detail),this.label.classed("hidden",!1)}),this.services.events.addEventListener(T.Threshold.HIDE,()=>{this.label.classed("hidden",!0)}),this.appendThresholdLabel(),this.addEventListeners()}getFormattedValue(t){const{value:n,axisPosition:r}=t,i=this.getOptions(),s=this.services.cartesianScales.getScaleTypeByPosition(r),{code:a,number:o}=y(i,"locale");if(s===rt.TIME){const l=[z.LEFT,z.RIGHT].includes(r),c=this.services.cartesianScales.getMainXScale(),u=this.services.cartesianScales.getMainYScale(),d=l?u:c,h=y(i,"timeScale"),f=nu(d.ticks(),y(h,"timeInterval"));return eu(n,0,d.ticks(),f,h,i.locale)}return o(n,a)}appendThresholdLabel(){const t=I(this.services.domUtils.getHolder()),n=y(this.getOptions(),"style","prefix");this.label=k.appendOrSelect(t,`div.${fe}--${n}--threshold--label`).classed("hidden",!0)}setThresholdLabelPosition({event:t,datum:n}){const r=this.services.domUtils.getHolder(),i=zn(t,r),s=n.valueFormatter?n.valueFormatter(n.value):this.getFormattedValue(n);this.label.html(ln(`${n.label||"Threshold"}: ${s}`)).style("background-color",n.fillColor);const a=this.label.node(),o=this.positionService.findBestPlacementAt({left:i[0],top:i[1]},a,[Bt.RIGHT,Bt.LEFT,Bt.TOP,Bt.BOTTOM],()=>({top:void 0,left:void 0,width:r.offsetWidth,height:r.offsetHeight})),l=this.positionService.findPositionAt({left:i[0],top:i[1]},a,o);this.positionService.setElement(a,l)}constructDatumObj(t,n){const r={};return t.correspondingDatasets&&(r.group=y(t,"correspondingDatasets",0)),r[t.mapsTo]=n.value,r}addEventListeners(){const t=this;this.getComponentContainer({withinChartClip:!0}).selectAll("rect.threshold-hoverable-area").on("mouseover mousemove",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!0),t.services.events.dispatchEvent(T.Threshold.SHOW,{event:r,hoveredElement:I(this),datum:I(this).datum()})}).on("mouseout",function(r){I(this.parentNode).select("line.threshold-line").classed("active",!1),t.services.events.dispatchEvent(T.Threshold.HIDE,{event:r,hoveredElement:I(this),datum:I(this).datum()})})}}class Dk extends mt{constructor(t,n){super(t,n),this.type="highlight",this.renderType=at.SVG,this.positionService=new lo,this.highlightStrokeWidth=1}render(t=!1){const n=y(this.getOptions(),"axes"),r=[];Object.keys(n).forEach(h=>{if(Object.values(z).includes(h)){const f=n[h];f.highlights&&f.highlights.data.length>0&&r.push({axisPosition:h,highlightStartMapsTo:f.highlights.highlightStartMapsTo,highlightEndMapsTo:f.highlights.highlightEndMapsTo,labelMapsTo:f.highlights.labelMapsTo,highlight:f.highlights.data,color:f.highlights.color})}});const s=this.getComponentContainer({ariaLabel:"highlight areas",withinChartClip:!0}).selectAll("g.axis-highlight").data(r,h=>h.axisPosition);s.exit().attr("opacity",0).remove();const o=s.enter().append("g").merge(s);o.attr("class",h=>`axis-highlight ${h.axisPosition}`);const l=o.selectAll("g.highlight-group").data(h=>h.highlight.map(f=>(f.axisPosition=h.axisPosition,f.highlightStartMapsTo=h.highlightStartMapsTo,f.labelMapsTo=h.labelMapsTo,f.color=h.color,f.highlightEndMapsTo=h.highlightEndMapsTo,f)));l.exit().attr("opacity",0).remove();const c=l.enter().append("g");c.append("rect").attr("class","highlight-bar"),c.append("line").attr("class","highlight-line"),c.merge(l).attr("class","highlight-group");const d=this;o.each(function({axisPosition:h}){const f=d.services.cartesianScales.getMainXScale(),p=d.services.cartesianScales.getMainYScale(),[g,m]=f.range(),[v,S]=p.range(),{cartesianScales:E}=d.services,b=E.getOrientation(),x=P=>E.getDomainValue(P),_=P=>E.getRangeValue(P),[C,D]=Cn(x,_,b),B=I(this);h===z.TOP||h===z.BOTTOM?B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("y",Math.max(S+d.highlightStrokeWidth,0)).attr("height",Math.max(v-2*d.highlightStrokeWidth,0)).attr("x",({highlightStartMapsTo:P,...w})=>C(w[P])).attr("width",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(C(H[w])-C(H[P]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null):B.selectAll("rect.highlight-bar").transition().call(P=>d.services.transitions.setupTransition({transition:P,name:"highlight-bar-update",animate:t})).attr("x",g).attr("width",Math.max(m-g,0)).attr("y",({highlightEndMapsTo:P,...w})=>D(w[P])).attr("height",({highlightStartMapsTo:P,highlightEndMapsTo:w,...H})=>Math.max(D(H[P])-D(H[w]),0)).style("stroke",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null).style("stroke-dasharray","2, 2").attr("stroke-width",d.highlightStrokeWidth+"px").style("fill-opacity",.1).style("fill",({color:P,labelMapsTo:w,...H})=>P&&P.scale[H[w]]?P.scale[H[w]]:null)})}}class qm extends mu{getItems(t){if(t.detail.items)return t.detail.items;const{data:n}=t.detail;if(!n||!n.length||!n[0])return[];const r=this.getOptions(),{cartesianScales:i}=this.services,s=i.getDomainIdentifier(),a=i.isDualAxes(),{groupMapsTo:o}=r.data,l=i.getDomainLabel();let c=i.getRangeLabel();const u=n[0][s];let d;if(n.length===1){const h=n[0],f=i.getRangeIdentifier(h);if(a){const g=i.getRangeAxisPosition({datum:h,groups:[h[o]]});c=i.getScaleLabel(g)}const p=h[f];d=[{label:l,value:u},...Array.isArray(p)&&p.length===2?[{label:"Start",value:p[0]},{label:"End",value:p[1]}]:[{label:c,value:h[f]}]],t.detail.additionalItems&&t.detail.additionalItems.forEach(g=>d.push({label:g.label,value:g.value})),d.push({label:yt(r,"locale.translations.group")||yt(r,"tooltip.groupLabel"),value:h[o],color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})})}else if(n.length>1&&(d=[{label:l,value:u}],d=d.concat(n.map(h=>{const f=h[i.getRangeIdentifier(h)];return{label:h[o],value:Array.isArray(f)&&f.length===2?`${f[0]} - ${f[1]}`:f,color:this.model.getFillColor(h[o]),class:this.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:h[o]})}}).sort((h,f)=>f.value-h.value)),!a&&y(r,"tooltip","showTotal")===!0)){const h=i.getRangeIdentifier();d.push({label:yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",value:n.reduce((f,p)=>f+p[h],0),bold:!0})}return d}}function Es(e,t){const n=+$t(e)-+$t(t);return n<0?-1:n>0?1:n}function Lk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t);return r.getFullYear()-i.getFullYear()}function Rk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Es(r,i),a=Math.abs(Lk(r,i));r.setFullYear(1584),i.setFullYear(1584);const o=Es(r,i)===-s,l=s*(a-+o);return l===0?0:l}function _u(e,t,n){const r=$t(e,n==null?void 0:n.in);if(isNaN(t))return ke(e,NaN);if(!t)return r;const i=r.getDate(),s=ke(e,r.getTime());s.setMonth(r.getMonth()+t+1,0);const a=s.getDate();return i>=a?s:(r.setFullYear(s.getFullYear(),s.getMonth(),i),r)}function Xm(e,t,n){return _u(e,t*12,n)}function Ik(e,t,n){return Xm(e,-t,n)}function kk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=r.getFullYear()-i.getFullYear(),a=r.getMonth()-i.getMonth();return s*12+a}function Pk(e,t){const n=$t(e,t==null?void 0:t.in);return n.setHours(23,59,59,999),n}function Nk(e,t){const n=$t(e,t==null?void 0:t.in),r=n.getMonth();return n.setFullYear(n.getFullYear(),r+1,0),n.setHours(23,59,59,999),n}function $k(e,t){const n=$t(e,t==null?void 0:t.in);return+Pk(n,t)==+Nk(n,t)}function Fk(e,t,n){const[r,i,s]=ur(n==null?void 0:n.in,e,e,t),a=Es(i,s),o=Math.abs(kk(i,s));if(o<1)return 0;i.getMonth()===1&&i.getDate()>27&&i.setDate(30),i.setMonth(i.getMonth()-a*o);let l=Es(i,s)===-a;$k(r)&&o===1&&Es(r,s)===1&&(l=!1);const c=a*(o-+l);return c===0?0:c}function Uk(e,t,n){return _u(e,-t,n)}function Bk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=Zm(r,i),a=Math.abs(Kg(r,i));r.setDate(r.getDate()-s*a);const o=+(Zm(r,i)===-s),l=s*(a-o);return l===0?0:l}function Zm(e,t){const n=e.getFullYear()-t.getFullYear()||e.getMonth()-t.getMonth()||e.getDate()-t.getDate()||e.getHours()-t.getHours()||e.getMinutes()-t.getMinutes()||e.getSeconds()-t.getSeconds()||e.getMilliseconds()-t.getMilliseconds();return n<0?-1:n>0?1:n}function jm(e,t,n){const r=$t(e,n==null?void 0:n.in);return isNaN(t)?ke(e,NaN):(t&&r.setDate(r.getDate()+t),r)}function Hk(e,t,n){return jm(e,-t,n)}function Tu(e){return t=>{const r=(e?Math[e]:Math.trunc)(t);return r===0?0:r}}function Gk(e,t,n){const[r,i]=ur(n==null?void 0:n.in,e,t),s=(+r-+i)/Fg;return Tu(n==null?void 0:n.roundingMethod)(s)}function Km(e,t,n){return ke(e,+$t(e)+t)}function Qm(e,t,n){return Km(e,t*Fg)}function Vk(e,t,n){return Qm(e,-t)}function Jm(e,t){return+$t(e)-+$t(t)}function tv(e,t,n){const r=Jm(e,t)/$g;return Tu(n==null?void 0:n.roundingMethod)(r)}function Ou(e,t,n){const r=$t(e,n==null?void 0:n.in);return r.setTime(r.getTime()+t*$g),r}function ev(e,t,n){return Ou(e,-t,n)}function nv(e,t,n){const r=Jm(e,t)/1e3;return Tu(n==null?void 0:n.roundingMethod)(r)}function wu(e,t,n){return Km(e,t*1e3)}function rv(e,t,n){return wu(e,-t)}class zk extends Dn{constructor(){super(...arguments),this.scaleTypes={top:null,right:null,bottom:null,left:null},this.scales={top:null,right:null,bottom:null,left:null}}getDomainAxisPosition({datum:t=null}={}){if(this.dualAxes&&t){const n=this.model.getOptions(),{groupMapsTo:r}=n.data,i=y(n,"axes",this.secondaryDomainAxisPosition),s=t[r];if(i!=null&&i.correspondingDatasets&&i.correspondingDatasets.includes(s))return this.secondaryDomainAxisPosition}return this.domainAxisPosition}getRangeAxisPosition({datum:t=null,groups:n=null}={}){if(this.dualAxes){const r=this.model.getOptions(),{groupMapsTo:i}=r.data,s=y(r,"axes",this.secondaryRangeAxisPosition);let a;if(t!==null?a=t[i]:n&&n.length>0&&(a=n[0]),s!=null&&s.correspondingDatasets&&s.correspondingDatasets.includes(a))return this.secondaryRangeAxisPosition}return this.rangeAxisPosition}getAxisOptions(t){return y(this.model.getOptions(),"axes",t)}getDomainAxisOptions(){const t=this.getDomainAxisPosition();return this.getAxisOptions(t)}getRangeAxisOptions(){const t=this.getRangeAxisPosition();return this.getAxisOptions(t)}getScaleLabel(t){const r=this.getAxisOptions(t).title;return r||(t===z.BOTTOM||t===z.TOP?"x-value":"y-value")}getDomainLabel(){return this.getScaleLabel(this.getDomainAxisPosition())}getRangeLabel(){return this.getScaleLabel(this.getRangeAxisPosition())}update(){this.determineAxisDuality(),this.findDomainAndRangeAxes(),this.determineOrientation(),Object.keys(z).map(n=>z[n]).forEach(n=>{this.scales[n]=this.createScale(n)})}findDomainAndRangeAxes(){const t=this.findVerticalAxesPositions(),n=this.findHorizontalAxesPositions(),r=this.findDomainAndRangeAxesPositions(t,n);this.domainAxisPosition=r.primaryDomainAxisPosition,this.rangeAxisPosition=r.primaryRangeAxisPosition,this.isDualAxes()&&(this.secondaryDomainAxisPosition=r.secondaryDomainAxisPosition,this.secondaryRangeAxisPosition=r.secondaryRangeAxisPosition)}determineOrientation(){(this.rangeAxisPosition===z.LEFT||this.rangeAxisPosition===z.RIGHT)&&(this.domainAxisPosition===z.BOTTOM||this.domainAxisPosition===z.TOP)?this.orientation=Ht.VERTICAL:this.orientation=Ht.HORIZONTAL}isDualAxes(){return this.dualAxes}determineAxisDuality(){var r,i,s,a;const t=this.model.getOptions(),n=y(t,"axes");((r=n[z.LEFT])!=null&&r.correspondingDatasets&&n[z.RIGHT]||(i=n[z.RIGHT])!=null&&i.correspondingDatasets&&n[z.LEFT]||(s=n[z.TOP])!=null&&s.correspondingDatasets&&n[z.BOTTOM]||(a=n[z.BOTTOM])!=null&&a.correspondingDatasets&&n[z.TOP])&&(this.dualAxes=!0)}getCustomDomainValuesByposition(t){const n=y(this.model.getOptions(),"axes",t,"domain");if(n&&!Array.isArray(n))throw new Error(`Domain in ${t} axis is not a valid array`);if(Array.isArray(n)&&(this.scaleTypes[t]===rt.LINEAR||this.scaleTypes[t]===rt.TIME)&&n.length!==2)throw new Error(`There can only be 2 elements in domain for scale type: ${this.scaleTypes[t]}`);return n}getOrientation(){return this.orientation}getScaleByPosition(t){return this.scales[t]}getScaleTypeByPosition(t){return this.scaleTypes[t]}getDomainAxisScaleType(){const t=this.getDomainAxisPosition();return this.getScaleTypeByPosition(t)}getRangeAxisScaleType(){const t=this.getRangeAxisPosition();return this.getScaleTypeByPosition(t)}getDomainScale(){return this.scales[this.domainAxisPosition]}getRangeScale(){return this.scales[this.rangeAxisPosition]}getMainXAxisPosition(){const t=[z.BOTTOM,z.TOP];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainYAxisPosition(){const t=[z.LEFT,z.RIGHT];return[this.domainAxisPosition,this.rangeAxisPosition].find(n=>t.indexOf(n)>-1)}getMainXScale(){return this.scales[this.getMainXAxisPosition()]}getMainYScale(){return this.scales[this.getMainYAxisPosition()]}getValueFromScale(t,n,r,i){const s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=y(i,l)!==null?i[l]:i;let u;switch(n){case rt.LABELS:u=t(c)+t.step()/2;break;case rt.TIME:u=t(new Date(c));break;default:u=t(c)}return u}getBoundedScaledValues(t){const{bounds:n}=this.model.getOptions(),r=this.getRangeAxisPosition({datum:t}),i=this.scales[r],s=this.model.getOptions(),o=y(s,"axes")[r],{mapsTo:l}=o,c=t[l]!==void 0?t[l]:t;return[i(y(t,n.upperBoundMapsTo)!==null?t[n.upperBoundMapsTo]:c),i(y(t,n.lowerBoundMapsTo)!==null?t[n.lowerBoundMapsTo]:c)]}getValueThroughAxisPosition(t,n){const r=this.scaleTypes[t],i=this.scales[t];return this.getValueFromScale(i,r,t,n)}getDomainValue(t){const n=this.getDomainAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getRangeValue(t){const n=this.getRangeAxisPosition({datum:t});return this.getValueThroughAxisPosition(n,t)}getMainXScaleType(){return this.getScaleTypeByPosition(this.getMainXAxisPosition())}getMainYScaleType(){return this.getScaleTypeByPosition(this.getMainYAxisPosition())}getDomainIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getDomainAxisPosition({datum:t}),"mapsTo")}getRangeIdentifier(t){const n=this.model.getOptions();return y(n,"axes",this.getRangeAxisPosition({datum:t}),"mapsTo")}extendsDomain(t,n){const r=this.model.getOptions(),i=y(r,"axes",t);if(i.scaleType===rt.TIME){const s=y(r,"timeScale","addSpaceOnEdges");return Wk(n,s)}else return Yk(n,$n.paddingRatio,i.scaleType)}findVerticalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.LEFT)===null&&y(n,z.RIGHT)!==null||y(n,z.RIGHT,"main")===!0||r&&y(n,z.LEFT,"correspondingDatasets")?{primary:z.RIGHT,secondary:z.LEFT}:{primary:z.LEFT,secondary:z.RIGHT}}findHorizontalAxesPositions(){const t=this.model.getOptions(),n=y(t,"axes"),r=this.isDualAxes();return y(n,z.BOTTOM)===null&&y(n,z.TOP)!==null||y(n,z.TOP,"main")===!0||r&&y(n,z.BOTTOM,"correspondingDatasets")?{primary:z.TOP,secondary:z.BOTTOM}:{primary:z.BOTTOM,secondary:z.TOP}}findDomainAndRangeAxesPositions(t,n){const r=this.model.getOptions(),i=y(r,"axes",t.primary),s=y(r,"axes",n.primary),a=i.scaleType||rt.LINEAR,o=s.scaleType||rt.LINEAR,l={primaryDomainAxisPosition:null,secondaryDomainAxisPosition:null,primaryRangeAxisPosition:null,secondaryRangeAxisPosition:null};return l.primaryDomainAxisPosition=n.primary,l.primaryRangeAxisPosition=t.primary,l.secondaryDomainAxisPosition=n.secondary,l.secondaryRangeAxisPosition=t.secondary,(!(o===rt.LABELS||o===rt.TIME)&&a===rt.LABELS||a===rt.TIME)&&(l.primaryDomainAxisPosition=t.primary,l.primaryRangeAxisPosition=n.primary,l.secondaryDomainAxisPosition=t.secondary,l.secondaryRangeAxisPosition=n.secondary),l}getScaleDomain(t){const n=this.model.getOptions(),r=y(n,"axes",t),i=y(n,"bounds"),{includeZero:s}=r,a=y(r,"scaleType")||rt.LINEAR;if(this.model.isDataEmpty())return[];if(r.binned){const{bins:v}=this.model.getBinConfigurations();return[0,Vn(v,S=>S.length)]}else if(r.limitDomainToBins){const{bins:v}=this.model.getBinConfigurations(),S=this.model.getStackKeys({bins:v});return[S[0].split(":")[0],S[S.length-1].split(":")[1]]}const o=this.model.getDisplayData(),{extendLinearDomainBy:l,mapsTo:c,percentage:u,thresholds:d}=r,{reference:h,compareTo:f}=$n.ratio;if(r.domain)return a===rt.LABELS?r.domain:(a===rt.TIME&&(r.domain=r.domain.map(v=>v.getTime===void 0?new Date(v):v)),this.extendsDomain(t,r.domain));if(u)return[0,100];if(r&&a===rt.LABELS)return Ji(o.map(v=>v[c]));let p,g;const m=this.model.getDataGroupNames();if(a===rt.LABELS_RATIO)return o.map(v=>`${v[h]}/${v[f]}`);if(a===rt.TIME)g=o.map(v=>+new Date(v[c]));else if(i&&n.axes)g=[],o.forEach(v=>{g.push(v[c]),v[i.upperBoundMapsTo]&&g.push(v[i.upperBoundMapsTo]),v[i.lowerBoundMapsTo]&&g.push(v[i.lowerBoundMapsTo])});else if(r.stacked===!0&&m&&t===this.getRangeAxisPosition()){const{groupMapsTo:v}=n.data,S=this.model.getDataValuesGroupedByKeys({groups:m}),E=o.filter(x=>!m.includes(x[v])),b=[];S.forEach(x=>{const{..._}=x;let C=0,D=0;Object.values(eL(_,"sharedStackKey")).forEach(B=>{isNaN(B)||(B<0?D+=B:C+=B)}),b.push([D,C])}),g=[...fc(b),...E.map(x=>x[c])]}else g=[],o.forEach(v=>{const S=v[c];Array.isArray(S)&&S.length===2?(g.push(S[0]),g.push(S[1])):(l&&g.push(Math.max(v[c],v[l])),g.push(S))});return a!==rt.TIME&&a!==rt.LOG&&s&&g.push(0),d&&d.length>0&&d.forEach(v=>{const S=y(v,"value");S!==null&&g.push(S)}),p=Fe(g),p=this.extendsDomain(t,p),p}createScale(t){const n=this.model.getOptions(),r=y(n,"axes",t);if(!r)return null;const i=y(r,"scaleType")||rt.LINEAR;this.scaleTypes[t]=i;let s;return i===rt.TIME?s=vf():i===rt.LOG?s=Kd().base(r.base||10):i===rt.LABELS||i===rt.LABELS_RATIO?s=Ii():s=Ge(),s.domain(this.getScaleDomain(t)),s}getDomainLowerBound(t){let n,r=0;return this.getOrientation()===Ht.VERTICAL?n=this.getMainYScale().domain():n=this.getMainXScale().domain(),y(this.model.getOptions(),"axes",t,"includeZero")===!1&&n[0]>0&&n[1]>0&&(r=n[0]),r}getHighestDomainThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getDomainAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getDomainScale(),s=r.sort((o,l)=>l.value-o.value)[0];return this.getScaleTypeByPosition(n)===rt.TIME&&(typeof s.value=="string"||s.value.getTime===void 0)&&(s.value=new Date(s.value)),{threshold:s,scaleValue:i(s.value)}}getHighestRangeThreshold(){const t=y(this.model.getOptions(),"axes"),n=this.getRangeAxisPosition(),{thresholds:r}=t[n];if(!Array.isArray(r)||Array.isArray(r)&&!r.length)return null;const i=this.getRangeScale(),s=r.sort((a,o)=>o.value-a.value)[0];return{threshold:s,scaleValue:i(s.value)}}}function Wk(e,t){const n=new Date(e[0]),r=new Date(e[1]);return Rk(r,n)>1?[Ik(n,t),Xm(r,t)]:Fk(r,n)>1?[Uk(n,t),_u(r,t)]:Bk(r,n)>1?[Hk(n,t),jm(r,t)]:Gk(r,n)>1?[Vk(n,t),Qm(r,t)]:tv(r,n)>30?[ev(n,t*30),Ou(r,t*30)]:tv(r,n)>1?[ev(n,t),Ou(r,t)]:nv(r,n)>15?[rv(n,t*15),wu(r,t*15)]:nv(r,n)>1?[rv(n,t),wu(r,t)]:[n,r]}function Yk([e,t],n,r){const s=(t-e)*n,a=t<=0&&t+s>0?0:t+s;let o=e>=0&&e-s<0?0:e-s;if(r===rt.LOG&&o<=0){if(e<=0)throw Error("Data must have values greater than 0 if log scale type is used.");o=e}return[o,a]}class qk extends Dn{constructor(){super(...arguments),this.curveTypes={curveLinear:Oa,curveLinearClosed:Df,curveBasis:j_,curveBasisClosed:K_,curveBasisOpen:Q_,curveBundle:J_,curveCardinal:tT,curveCardinalClosed:eT,curveCardinalOpen:nT,curveCatmullRom:rT,curveCatmullRomClosed:iT,curveCatmullRomOpen:sT,curveMonotoneX:aT,curveMonotoneY:oT,curveNatural:lT,curveStep:cT,curveStepAfter:hT,curveStepBefore:uT}}getD3Curve(){let t="curveLinear";const n=this.model.getOptions().curve;if(n&&(typeof n=="string"?t=n:t=n.name),this.curveTypes[t]){let r=this.curveTypes[t];return n&&Object.keys(n).forEach(i=>{r[i]&&(r=r[i](n[i]))}),r}return console.warn(`The curve type '${t}' is invalid, using 'curveLinear' instead`),this.curveTypes.curveLinear}}class Xk extends Dn{isZoomBarEnabled(){if(!this.services.cartesianScales||!y(this.model.getOptions(),"zoomBar","top","enabled"))return!1;this.services.cartesianScales.findDomainAndRangeAxes();const t=this.services.cartesianScales.getMainXAxisPosition(),n=y(this.model.getOptions(),"axes",t,"scaleType");return t===z.BOTTOM&&n===rt.TIME}getZoomBarData(){const t=this.model.getZoomBarData();return t&&t.length>1?t:this.model.getDisplayData()}getDefaultZoomBarDomain(t){if(!this.services.zoom)throw new Error("Services zoom not defined");const n=t||this.services.zoom.getZoomBarData(),{cartesianScales:r}=this.services;if(!r)throw new Error("Services cartesianScales undefined");const i=r.getMainXAxisPosition(),s=r.getDomainIdentifier(),a=y(this.model.getOptions(),"axes",i,"domain");if(Array.isArray(a)&&a.length===2)return a;if(!i)throw new Error("Not defined: mainXAxisPosition");return r.extendsDomain(i,Fe(n,o=>o[s]))}handleDomainChange(t,n={dispatchEvent:!0}){var r;this.model.set({zoomDomain:t},{animate:!1}),n.dispatchEvent&&((r=this.services.events)==null||r.dispatchEvent(T.ZoomDomain.CHANGE,{newDomain:t}))}getZoomRatio(){return y(this.model.getOptions(),"zoomBar","zoomRatio")}filterDataForRangeAxis(t,n){var a;const r=this.model.get("zoomDomain"),i=Object.assign({stacked:!1},n),s=y(this.model.getOptions(),"zoomBar","updateRangeAxis");if(this.isZoomBarEnabled()&&s&&r){const o=i.stacked?"sharedStackKey":(a=this.services.cartesianScales)==null?void 0:a.getDomainIdentifier(),l=t.filter(c=>new Date(c[o])>=r[0]&&new Date(c[o])<=r[1]);if(l.length>0)return l}return t}zoomIn(t=this.getZoomRatio()){var f;const n=this.model.get("zoomDomain"),r=Se.handleWidth,i=(f=this.services.cartesianScales)==null?void 0:f.getMainXScale().copy();i.domain(this.getDefaultZoomBarDomain());const s=i(n[0]),a=i(n[1]);if(a-s<r+1)return;const o=i.range(),l=a-s,c=Math.min((o[1]-o[0])/2*(t/2),l/2);let u=s+c,d=a-c;u>=d&&(u=s+l/2-r/2,d=a-l/2+r/2);const h=[i.invert(u),i.invert(d)];(n[0].valueOf()!==h[0].valueOf()||n[1].valueOf()!==h[1].valueOf())&&this.handleDomainChange(h)}zoomOut(t=this.getZoomRatio()){const n=this.model.get("zoomDomain");if(!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const r=this.services.cartesianScales.getMainXScale().copy();r.domain(this.getDefaultZoomBarDomain());const i=r(n[0]),s=r(n[1]),a=r.range(),o=(a[1]-a[0])/2*(t/2),l=Math.max(i-o,a[0]),c=Math.min(s+o,a[1]),u=[r.invert(l),r.invert(c)];(n[0].valueOf()!==u[0].valueOf()||n[1].valueOf()!==u[1].valueOf())&&this.handleDomainChange(u)}resetZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();(t[0].valueOf()!==n[0].valueOf()||t[1].valueOf()!==n[1].valueOf())&&this.handleDomainChange(n)}isMinZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();if(!t||!n)return!1;const r=t[1].valueOf()-t[0].valueOf(),i=n[1].valueOf()-n[0].valueOf(),s=y(this.model.getOptions(),"zoomBar","minZoomRatio");return r/i<s}isMaxZoomDomain(){const t=this.model.get("zoomDomain"),n=this.getDefaultZoomBarDomain();return!!(t&&n&&t[0].valueOf()===n[0].valueOf()&&t[1].valueOf()===n[1].valueOf())}isEmptyState(){return this.getZoomBarData().length===0}isZoomBarLoading(t){return y(this.model.getOptions(),"zoomBar",t,"loading")}isZoomBarLocked(t){return y(this.model.getOptions(),"zoomBar",t,"locked")}}class ge extends Ze{constructor(t,n){super(t,n),this.services=Object.assign(this.services,{cartesianScales:zk,curves:qk,zoom:Xk}),this.model=new pr(this.services)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"zoomBar",z.TOP,"enabled"),s=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const a=this.services.cartesianScales.getMainXAxisPosition(),o=y(r,"axes",a,"scaleType"),l=i&&a===z.BOTTOM&&o===rt.TIME,c=this.services.zoom.isZoomBarLocked(z.TOP),u=!!this.model.getOptions().title,d={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},h={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},f={id:"header",components:[new le(this.model,this.services,[d,...s?[h]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},p={id:"legend",components:[new gu(this.model,this.services)],growth:dt.PREFERRED};l&&!c&&t.push(new Nm(this.model,this.services),new Su(this.model,this.services)),t.push(new Ak(this.model,this.services)),t.push(new Dk(this.model,this.services));const g={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},m=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1;let v=Ct.COLUMN;if(m){const _=y(this.model.getOptions(),"legend","position");_===Yr.LEFT?(v=Ct.ROW,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.RIGHT?(v=Ct.ROW_REVERSE,this.model.getOptions().legend.orientation||(this.model.getOptions().legend.orientation=qr.VERTICAL)):_===Yr.BOTTOM&&(v=Ct.COLUMN_REVERSE)}const S={id:"spacer",components:[new Ln(this.model,this.services)],growth:dt.PREFERRED},E={id:"full-frame",components:[new le(this.model,this.services,[...m?[p]:[],...m?[S]:[],g],{direction:v})],growth:dt.STRETCH},b={id:"zoom-bar",components:[new Ck(this.model,this.services)],growth:dt.PREFERRED,renderType:at.SVG},x=[];if(u||s){x.push(f);const _={id:"spacer",components:[new Ln(this.model,this.services,s?{size:15}:void 0)],growth:dt.PREFERRED};x.push(_)}return l&&x.push(b),x.push(E),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,x,{direction:Ct.COLUMN})]}}class Te extends mt{constructor(){super(...arguments),this.type="grid",this.renderType=at.SVG}render(t=!0){const n=y(this.getOptions(),"grid","x","enabled"),r=y(this.getOptions(),"grid","y","enabled");this.drawBackdrop(n,r),!(!n&&!r)&&(n&&(k.appendOrSelect(this.backdrop,"g.x.grid"),this.drawXGrid(t)),r&&(k.appendOrSelect(this.backdrop,"g.y.grid"),this.drawYGrid(t)))}drawXGrid(t){const n=this.parent,r=this.backdrop.attr("height"),i=this.services.cartesianScales.getMainXScale(),s=Mo(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","x","alignWithAxisTicks")){const l=this.services.cartesianScales.getDomainAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","x","numberOfTicks");s.ticks(l)}const o=n.select(".x.grid").attr("transform",`translate(${-this.backdrop.attr("x")}, ${r})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}drawYGrid(t){const n=this.parent,r=this.backdrop.attr("width"),i=this.services.cartesianScales.getMainYScale(),s=Hu(i).tickSizeInner(-r).tickSizeOuter(0);if(y(this.getOptions(),"grid","y","alignWithAxisTicks")){const l=this.services.cartesianScales.getRangeAxisPosition(),c=y(this.getOptions(),"axes",l,"ticks","values");c&&s.tickValues(c)}else{const l=y(this.getOptions(),"grid","y","numberOfTicks");s.ticks(l)}const o=n.select(".y.grid").attr("transform",`translate(0, ${-this.backdrop.attr("y")})`);t?o.transition().call(l=>this.services.transitions.setupTransition({transition:l,name:"grid-update",animate:t})).call(s):o.call(s),this.cleanGrid(o)}getGridlineThreshold(t){const n=this.parent,r=n.selectAll(".x.grid .tick").nodes().sort((u,d)=>Number(Mn(u).tx)-Number(Mn(d).tx));let i=-1;if(!r.length)return;r.forEach(u=>{t[0]>=+Mn(u).tx&&i++});const s=i+1<r.length?i+1:r.length,a=r[i],o=r[s];let l;if(!a)l=+Mn(o).tx;else if(o)l=+Mn(o).tx-+Mn(a).tx;else{const u=n.select("rect.chart-grid-backdrop").node();l=k.getSVGElementSize(u).width-+Mn(a).tx}const{threshold:c}=this.getOptions().tooltip.gridline;return l*c}getActiveGridline(t){const n=y(this.getOptions,"tooltip","gridline","threshold"),r=n||this.getGridlineThreshold(t);return this.parent.selectAll(".x.grid .tick").filter(function(){const a=Mn(this),o={min:Number(a.tx)-r,max:Number(a.tx)+r};return o.min<=t[0]&&t[0]<=o.max})}drawBackdrop(t,n){const r=this.parent,i=this.services.cartesianScales.getMainXScale(),s=this.services.cartesianScales.getMainYScale(),[a,o]=i.range(),[l,c]=s.range();this.backdrop=k.appendOrSelect(r,"svg.chart-grid-backdrop").attr("role","presentation");const u=k.appendOrSelect(this.backdrop,t||n?"rect.chart-grid-backdrop.stroked":"rect.chart-grid-backdrop");this.backdrop.merge(u).attr("x",a).attr("y",c).attr("width",Math.abs(o-a)).attr("height",Math.abs(l-c)).lower(),u.attr("width","100%").attr("height","100%")}cleanGrid(t){t.selectAll("text").remove(),t.select(".domain").remove()}}class iv extends mt{constructor(){super(...arguments),this.type="area",this.renderType=at.SVG,this.gradient_id="gradient-id-"+Math.floor(Math.random()*99999999999),this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.area").transition("legend-hover-area").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-area"})).attr("opacity",r=>r.name!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"area graphs",withinChartClip:!0}),r=this.getOptions();let i=[0,0];const{cartesianScales:s}=this.services,a=s.getOrientation(),o=Yl().curve(this.services.curves.getD3Curve()).defined(x=>{const _=s.getRangeIdentifier(),C=x[_];return C!=null}),l=this.model.getGroupedData(this.configs.groups),c=y(r,"bounds"),u=c&&l&&l.length===1;!u&&c&&console.warn(`Bounds can only be shown when having 1 single datagroup, you've supplied ${l.length}`);let d=0;const h=(x,_)=>{y(r,"axes",x,"includeZero")===!1&&_[0]>0&&_[1]>0&&(d=_[0])},f=x=>u?s.getBoundedScaledValues(x)[0]:s.getRangeValue(d),p=x=>u?s.getBoundedScaledValues(x)[1]:s.getRangeValue(x);a===Ht.VERTICAL?(i=s.getMainYScale().domain(),h(s.getMainYAxisPosition(),i),o.x(x=>s.getDomainValue(x)).y0(x=>f(x)).y1(x=>p(x))):(i=s.getMainXScale().domain(),h(s.getMainXAxisPosition(),i),o.x0(x=>f(x)).x1(x=>p(x)).y(x=>s.getDomainValue(x)));const g=y(r,"color","gradient","enabled"),m=l&&l.length===1&&g;l.length>1&&g&&console.error("Gradients can only be enabled when having 1 single dataset");const v=n.selectAll("path.area").data(l,x=>x.name),S=I(this.services.domUtils.getMainContainer());if(v.exit().attr("opacity",0).remove(),!l.length)return;if(m){const x=S.select(`path.${this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:l[0].name})}`).node();let _;if(x)_=getComputedStyle(x,null).getPropertyValue("stroke");else{const C=y(this.model.getOptions(),"color","scale");if(C!==null){const D=Object.keys(C);_=C[D[0]]}}ys.appendOrUpdateLinearGradient({svg:this.parent,id:this.services.domUtils.generateElementIDString(`${l[0].name.replace(" ","")}_${this.gradient_id}`),x1:"0%",x2:"0%",y1:"0%",y2:"100%",stops:ys.getStops(i,_)})}else this.parent.selectAll("defs linearGradient").empty()||this.parent.selectAll("defs linearGradient").each(function(){this.parentNode.remove()});const E=this,b=v.enter().append("path");m?b.merge(v).style("fill",x=>`url(#${this.services.domUtils.generateElementIDString(`${x.name.replace(" ","")}_${this.gradient_id}`)})`).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:x.name,originalClassName:"area"})).attr("d",x=>{const{data:_}=x;return o(_)}):(b.attr("opacity",0).merge(v).attr("class","area").attr("class",x=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:x.name,originalClassName:"area"})).style("fill",x=>E.model.getFillColor(x.name,null,x.data)).transition().call(x=>this.services.transitions.setupTransition({transition:x,name:"area-update-enter",animate:t})).attr("opacity",u?1:On.opacity.selected).attr("d",x=>{const{data:_}=x;return o(_)}),u&&b.attr("fill-opacity",On.opacity.selected).style("stroke",x=>E.model.getStrokeColor(x.name,null,x.data)).style("stroke-dasharray","2, 2").attr("stroke-width",.7+"px"))}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class ei extends mt{constructor(){super(...arguments),this.type="line",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("path.line").transition("legend-hover-line").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-line"})).attr("opacity",r=>r.name!==n.datum().name?wn.opacity.unselected:wn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),{cartesianScales:r,curves:i}=this.services,s=p=>r.getDomainValue(p),a=p=>r.getRangeValue(p),[o,l]=Cn(s,a,r.getOrientation()),c=this.getOptions(),u=Bi().x(o).y(l).curve(i.getD3Curve()).defined(p=>{const g=r.getRangeIdentifier(p),m=p[g];return m!=null});let d=[];if(this.configs.stacked){const p=Object.keys(c.axes).some(v=>c.axes[v].percentage),{groupMapsTo:g}=c.data;d=this.model.getStackedData({groups:this.configs.groups,percentage:p}).map(v=>{const S=this.services.cartesianScales.getDomainIdentifier(v),E=this.services.cartesianScales.getRangeIdentifier(v);return{name:y(v,0,g),data:v.map(b=>({[S]:b.data.sharedStackKey,[g]:b[g],[E]:b[1]})),hidden:!rL(v,b=>b[0]!==b[1])}})}else d=this.model.getGroupedData(this.configs.groups);const h=n.selectAll("path.line").data(d,p=>p.name);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("line",!0).attr("opacity",0).merge(h).data(d,p=>p.name).attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:p.name,originalClassName:"line"})).style("stroke",p=>this.model.getStrokeColor(p.name,null,p.data)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","line").attr("aria-label",p=>{const{data:g}=p;return g.map(m=>{const v=this.services.cartesianScales.getRangeIdentifier(m);return m[v]}).join(",")}).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"line-update-enter",animate:t})).attr("opacity",p=>p.hidden?0:1).attr("d",p=>{const{data:g}=p;return u(g)})}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}const sv=5;function Zk(e,t){return e>t-sv&&e<t+sv}class Bn extends mt{constructor(){super(...arguments),this.type="ruler",this.renderType=at.SVG,this.isXGridEnabled=y(this.getOptions(),"grid","x","enabled"),this.isYGridEnabled=y(this.getOptions(),"grid","y","enabled"),this.isEventListenerAdded=!1}render(t=!1){const n=y(this.getOptions(),"ruler","enabled");this.drawBackdrop(),n&&!this.isEventListenerAdded?this.addBackdropEventListeners():!n&&this.isEventListenerAdded&&this.removeBackdropEventListeners()}removeBackdropEventListeners(){this.isEventListenerAdded=!1,this.backdrop.on("mousemove mouseover mouseout",null)}formatTooltipData(t){return t}showRuler(t,[n,r]){const i=this.parent,s=this.services.cartesianScales.getOrientation(),a=this.model.getDisplayData(),o=this.services.cartesianScales.getRangeScale(),[l,c]=o.range(),u=s===Ht.HORIZONTAL?r:n,d=k.appendOrSelect(i,"g.ruler").attr("aria-label","ruler"),h=k.appendOrSelect(d,"line.ruler-line"),f=i.selectAll("[role=graphics-symbol]"),p=a.map(m=>({domainValue:this.services.cartesianScales.getDomainValue(m),originalData:m})).filter(m=>Zk(m.domainValue,u));if(this.pointsWithinLine&&p.length===this.pointsWithinLine.length&&p.map(m=>m.domainValue).join()===this.pointsWithinLine.map(m=>m.domainValue).join())return this.pointsWithinLine=p,this.services.events.dispatchEvent(T.Tooltip.MOVE,{mousePosition:[n,r]});this.pointsWithinLine=p;const g=this.pointsWithinLine.reduce((m,v)=>{if(m.length===0)return m.push(v),m;const S=m[0].domainValue,E=Math.abs(u-v.domainValue),b=Math.abs(u-S);return E>b||(E<b?m=[v]:m.push(v)),m},[]);if(g.length>0){const m=g.map(b=>b.originalData).filter(b=>{const x=this.services.cartesianScales.getRangeIdentifier(b),_=b[x];return _!=null}),v=g.map(b=>b.domainValue),S=f.filter(b=>{const x=this.services.cartesianScales.getDomainValue(b);return v.includes(x)});this.elementsToHighlight&&this.elementsToHighlight.size()>0&&!Sg(this.elementsToHighlight,S)&&this.hideRuler(),S.dispatch("mouseover"),this.elementsToHighlight=S,this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:t,mousePosition:[n,r],hoveredElement:h,data:this.formatTooltipData(m)}),d.attr("opacity",1);const E=g[0];s==="horizontal"?h.attr("x1",c).attr("x2",l).attr("y1",E.domainValue).attr("y2",E.domainValue):h.attr("y1",c).attr("y2",l).attr("x1",E.domainValue).attr("x2",E.domainValue)}else this.hideRuler()}hideRuler(){const t=this.parent,n=k.appendOrSelect(t,"g.ruler");t.selectAll("[role=graphics-symbol]").dispatch("mouseout"),this.services.events.dispatchEvent(T.Tooltip.HIDE),n.attr("opacity",0)}addBackdropEventListeners(){this.isEventListenerAdded=!0;const t=this,n=this.services.domUtils.getHolder(),r=this.model.getDisplayData();let i=function(s){const a=zn(s,t.parent.node());t.showRuler(s,a)};if(r.length>100){const s=r.length%50*12.5;i=uL(function(a){const{mousePosition:o}=this;t.showRuler(a,o)},s,n)}this.backdrop.on("mousemove mouseover",i).on("mouseout",this.hideRuler.bind(this))}drawBackdrop(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-grid-backdrop")}}class cn extends mt{constructor(){super(...arguments),this.type="scatter",this.renderType=at.SVG,this.handleChartHolderOnHover=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-hover-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-hover-scatter"})}).attr("opacity",1)},this.handleChartHolderOnMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("chart-holder-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"chart-holder-mouseout-scatter"})}).attr("opacity",0)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-hover-scatter").call(i=>{var s;return(s=this.services.transitions)==null?void 0:s.setupTransition({transition:i,name:"legend-hover-scatter"})}).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle.dot").transition("legend-mouseout-scatter").call(t=>{var n;return(n=this.services.transitions)==null?void 0:n.setupTransition({transition:t,name:"legend-mouseout-scatter"})}).attr("opacity",1)}}init(){const{events:t}=this.services;if(!t)throw new Error("Services events are undefined.");t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut);const{fadeInOnChartHolderMouseover:n}=this.configs;n&&(t.addEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.addEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut))}filterBasedOnZoomDomain(t){const{cartesianScales:n}=this.services;if(!n)throw new Error("Services cartesianScales are undefined.");const r=n.getDomainIdentifier(t),i=this.model.get("zoomDomain");return i!==void 0?t.filter(s=>s[r].getTime()>=i[0].getTime()&&s[r].getTime()<=i[1].getTime()):t}getScatterData(){const t=this.getOptions(),{stacked:n}=this.configs;let r;if(n){const i=Object.keys(t.axes).some(s=>t.axes[s].percentage);r=this.model.getStackedData({groups:this.configs.groups,percentage:i})}else{const{cartesianScales:i}=this.services;if(!i)throw new Error("Services cartesianScales are undefined.");r=this.model.getDisplayData(this.configs.groups).filter(s=>{const a=i.getRangeIdentifier(s);return s[a]!==void 0&&s[a]!==null})}return this.filterBasedOnZoomDomain(r)}render(t){if(!(y(this.getOptions(),"points","enabled")||y(this.getOptions(),"bubble","enabled")))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,{cartesianScales:a}=this.services;if(!a)throw new Error("Services cartesianScales are undefined.");const o=a.getDomainIdentifier(),l=r.selectAll("circle.dot").data(this.getScatterData(),d=>`${d[s]}-${d[o]}`);l.exit().attr("opacity",0).remove();const u=l.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(l);this.styleCircles(u,t),this.addEventListeners()}isDatapointThresholdAnomaly(t){const{handleThresholds:n}=this.configs;if(!n)return!1;const{cartesianScales:r}=this.services;if(!r)throw new Error("Cartesian scales service is undefined");const i=r.getOrientation(),[s,a]=Cn(r.getHighestDomainThreshold(),r.getHighestRangeThreshold(),i),[o,l]=Cn(d=>r.getDomainValue(d),d=>r.getRangeValue(d),i),c=o(t),u=l(t);return a&&s?u<=a.scaleValue&&c>=s.scaleValue:a?u<=a.scaleValue:s?c>=s.scaleValue:!1}styleCircles(t,n){const r=this.getOptions(),{filled:i,fillOpacity:s}=r.points,{cartesianScales:a}=this.services;if(!a)throw new Error("Cartesian scales service is undefined");const{groupMapsTo:o}=r.data,l=f=>a.getDomainValue(f),c=f=>a.getRangeValue(f),[u,d]=Cn(l,c,a.getOrientation()),{fadeInOnChartHolderMouseover:h}=this.configs;t.raise().classed("dot",!0).attr("class",f=>{const p=a.getDomainIdentifier(f),m=this.model.getIsFilled(f[o],f[p],f,i)?[lt.FILL,lt.STROKE]:[lt.STROKE];return this.model.getColorClassName({classNameTypes:m,dataGroupName:f[o],originalClassName:"dot"})||""}).classed("threshold-anomaly",f=>this.isDatapointThresholdAnomaly(f)).classed("filled",f=>{const p=a.getDomainIdentifier(f);return this.model.getIsFilled(f[o],f[p],f,i)}).classed("unfilled",f=>{const p=a.getDomainIdentifier(f);return!this.model.getIsFilled(f[o],f[p],f,i)}).transition().call(f=>{var p;return(p=this.services.transitions)==null?void 0:p.setupTransition({transition:f,name:"scatter-update-enter",animate:n})}).attr("cx",u).attr("cy",d).attr("r",r.points.radius).style("fill",f=>{const p=a.getDomainIdentifier(f);if(this.model.getIsFilled(f[o],f[p],f,i))return this.model.getFillColor(f[o],f[p],f)}).style("stroke",f=>{const p=a.getDomainIdentifier(f);return this.model.getStrokeColor(f[o],f[p],f)}).attr("fill-opacity",i?s:1).attr("opacity",h?0:1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","point").attr("aria-label",f=>{const p=a.getRangeIdentifier(f);return f[p]}),this.addEventListeners()}getTooltipAdditionalItems(t){return null}addEventListeners(){const t=this,{groupMapsTo:n}=t.getOptions().data;if(!this.parent)throw new Error("Parent not defined");this.parent.selectAll("circle").on("mouseover",function(r,i){var a,o;const s=I(this);s.classed("hovered",!0).attr("class",l=>t.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:l[n],originalClassName:s.attr("class")})).style("fill",l=>{var u;const c=(u=t.services.cartesianScales)==null?void 0:u.getDomainIdentifier(l);return t.model.getFillColor(l[n],l[c],l)}).classed("unfilled",!1),(a=t.services.events)==null||a.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,data:[i],additionalItems:t.getTooltipAdditionalItems(i)}),(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOVER,{event:r,element:s,datum:i})}).on("mousemove",function(r,i){var a,o;const s=I(this);(a=t.services.events)==null||a.dispatchEvent(T.Scatter.SCATTER_MOUSEMOVE,{event:r,element:s,datum:i}),(o=t.services.events)==null||o.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){var s;(s=t.services.events)==null||s.dispatchEvent(T.Scatter.SCATTER_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){var a,o,l;const s=I(this);if(s.classed("hovered",!1),!t.configs.filled){const{filled:c}=t.getOptions().points,u=(a=t.services.cartesianScales)==null?void 0:a.getDomainIdentifier(i),d=t.model.getIsFilled(i[n],i[u],i,c);s.classed("unfilled",!d).style("fill",h=>d||c?t.model.getFillColor(h[n],h[u],h):null)}(o=t.services.events)==null||o.dispatchEvent(T.Scatter.SCATTER_MOUSEOUT,{event:r,element:s,datum:i}),(l=t.services.events)==null||l.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:s})})}destroy(){var n;(n=this.parent)==null||n.selectAll("circle").on("mousemove",null).on("mouseout",null);const{events:t}=this.services;if(!t)throw new Error("Services events undefined");t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Chart.MOUSEOVER,this.handleChartHolderOnHover),t.removeEventListener(T.Chart.MOUSEOUT,this.handleChartHolderOnMouseOut)}}class av extends mt{constructor(t,n,r){super(t,n,r),this.type="axes",this.renderType=at.SVG,this.truncation={[z.LEFT]:!1,[z.RIGHT]:!1,[z.TOP]:!1,[z.BOTTOM]:!1},r&&(this.configs=r),this.margins=this.configs.margins}render(t=!0){const{position:n}=this.configs,r=this.getOptions(),i=y(r,"axes",n,"visible"),s=this.getComponentContainer({ariaLabel:"axes"}),{width:a,height:o}=k.getSVGElementSize(s,{useAttrs:!0}),l=k.appendOrSelect(s,`g.axis.${n}`);let c,u;if(n===z.BOTTOM||n===z.TOP?(c=this.configs.axes[z.LEFT]?this.margins.left:0,u=this.configs.axes[z.RIGHT]?a-this.margins.right:a):(c=o-this.margins.bottom,u=this.margins.top),!this.services.cartesianScales)throw new Error("Services cartesianScales undefined");const d=this.services.cartesianScales.getScaleByPosition(n);this.scaleType===rt.LABELS||this.scaleType===rt.LABELS_RATIO?d.rangeRound([c,u]):d.range([c,u]);let h;switch(n){case z.LEFT:h=Hu;break;case z.BOTTOM:h=Mo;break;case z.RIGHT:h=y0;break;case z.TOP:h=v0;break}l.attr("aria-label",`${n} axis`);const f=!l.select("g.ticks").empty();let p=k.appendOrSelect(l,"g.ticks");f||(p.attr("role",`${ft.GRAPHICS_OBJECT} ${ft.GROUP}`),p.attr("aria-label",`${n} ticks`));const g=k.appendOrSelect(l,"g.ticks.invisible").style("opacity","0").style("pointer-events","none").attr("aria-hidden",!0).attr("aria-label",`invisible ${n} ticks`),m=y(r,"axes",n),v=this.scaleType===rt.TIME||m.scaleType===rt.TIME,S=n===z.LEFT||n===z.RIGHT,E=this.model.get("zoomDomain");if(E&&v&&!S&&d.domain(E),!i){p.attr("aria-hidden",!0);return}const b=y(m,"scaleType"),x=y(r,"data","loading"),_=y(m,"ticks","number"),C=y(m,"ticks","values"),D=y(m,"truncation","type"),B=y(m,"truncation","threshold"),P=y(m,"truncation","numCharacter"),w=_!==null,H=y(r,"timeScale"),N=k.appendOrSelect(g,"g.tick"),M=k.appendOrSelect(N,"text").text("0"),O=k.getSVGElementSize(M.node(),{useBBox:!0}).height;N.remove();const $=this.scaleType||m.scaleType||rt.LINEAR,F=h(d).tickSizeOuter(0);if(d.ticks){let K;if(w?K=_:(K=$n.ticks.number,S&&(K=this.getNumberOfFittingTicks(o,O,$n.ticks.verticalSpaceRatio))),d.ticks().length===1&&d.ticks()[0]===0&&(K=0),F.ticks(K),v)if(!d.ticks(K).length)F.tickValues([]);else{const nt=y(r,"timeScale","addSpaceOnEdges"),ht=y(r,"axes",n,"domain"),W=d.copy();nt&&!ht&&W.nice(K);const j=W.ticks(K);nt&&j.length>2&&!ht&&(j.splice(j.length-1,1),j.splice(0,1)),F.tickValues(j)}}let L;const U=y(m,"ticks","formatter"),{code:tt,number:X}=y(r,"locale");if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval"));U===null?L=(nt,ht)=>eu(nt,ht,F.tickValues(),K,H,r.locale):L=(nt,ht)=>{const W=eu(nt,ht,F.tickValues(),K,H,r.locale);return U(nt,ht,W)}}else U===null?$===rt.LINEAR&&(L=K=>X(K,tt)):L=U;F.tickFormat(L);const[Y,Q]=this.services.cartesianScales.getScaleByPosition(n).domain();let ut;if(C){if(v)C.forEach((K,nt)=>{K.getTime===void 0&&(C[nt]=new Date(K))}),ut=C.filter(K=>{const nt=K.getTime();return nt>=new Date(Y).getTime()&&nt<=new Date(Q).getTime()});else if(b===rt.LABELS){const K=this.services.cartesianScales.getScaleByPosition(n).domain();ut=C.filter(nt=>K.includes(nt))}else ut=C.filter(K=>K>=Y&&K<=Q);F.tickValues(ut)}switch(n){case z.LEFT:p.attr("transform",`translate(${this.margins.left}, 0)`);break;case z.BOTTOM:p.attr("transform",`translate(0, ${o-this.margins.bottom})`);break;case z.RIGHT:p.attr("transform",`translate(${a-this.margins.right}, 0)`);break;case z.TOP:p.attr("transform",`translate(0, ${this.margins.top})`);break}const et=this.model.isDataEmpty();if(m.title){const K=k.appendOrSelect(l,"text.axis-title").html(et||x?"":ln(m.title)),nt=y(m,"titleOrientation");let ht;switch(n){case z.LEFT:nt===qa.RIGHT?K.attr("transform","rotate(90)").attr("y",0).attr("x",d.range()[0]/2).attr("dy","-0.5em").style("text-anchor","middle"):K.attr("transform","rotate(-90)").attr("y",0).attr("x",-(d.range()[0]/2)).attr("dy","0.75em").style("text-anchor","middle");break;case z.BOTTOM:K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${o+4})`).style("text-anchor","middle");break;case z.RIGHT:nt===qa.LEFT?K.attr("transform","rotate(-90)").attr("y",a).attr("x",-(d.range()[0]/2)).style("text-anchor","middle"):K.attr("transform","rotate(90)").attr("y",-a).attr("x",d.range()[0]/2).attr("dy","0.75em").style("text-anchor","middle");break;case z.TOP:ht=k.getSVGElementSize(K,{useBBox:!0}).height,K.attr("transform",`translate(${this.margins.left/2+d.range()[1]/2}, ${ht/2})`).style("text-anchor","middle");break}}if(v){const K=nu(F.tickValues(),y(r,"timeScale","timeInterval")),nt=H.showDayName,ht=p;t&&(p=p.transition().call(j=>this.services.transitions.setupTransition({transition:j,name:"axis-update",animate:t}))),p=p.call(F),ht.selectAll(".tick").data(F.tickValues(),d).order().select("text").attr("class",(j,J)=>am(j,J,F.tickValues(),K,nt)?"tick-label--primary":"tick-label")}else!t||!f?p=p.call(F):p=p.transition().call(K=>this.services.transitions.setupTransition({transition:K,name:"axis-update",animate:t})).call(F);if(g.call(F),n===z.BOTTOM||n===z.TOP){let K=!1;const nt=y(m,"ticks","rotation");if(nt===ns.ALWAYS)K=!0;else if(nt===ns.NEVER)K=!1;else if(!nt||nt===ns.AUTO)if(d.step)K=g.selectAll("g.tick text").nodes().some(W=>k.getSVGElementSize(W,{useBBox:!0}).width>=d.step());else{K=!1;const ht=g.append("text").text("A"),W=k.getSVGElementSize(ht.node(),{useBBox:!0}).width;let j;g.selectAll("g.tick").each(function(){const J=I(this),A=parseFloat(y(Mn(this),"tx"));A!==null&&j+J.text().length*W*.8>=A&&(K=!0),j=A}),ht.remove()}K?(w||(F.ticks(this.getNumberOfFittingTicks(a,O,$n.ticks.horizontalSpaceRatio)),g.call(F),p.call(F)),l.selectAll("g.ticks g.tick text").attr("transform","rotate(-45)").attr("text-anchor",n===z.TOP?"start":"end")):l.selectAll("g.ticks g.tick text").attr("transform",null).attr("text-anchor",null)}if(x?l.attr("opacity",0):l.attr("opacity",1),p.selectAll("g.tick").attr("aria-label",K=>K),g.selectAll("g.tick").attr("aria-label",K=>K),D!==Re.NONE&&b===rt.LABELS&&!C){const K=this.services.cartesianScales.getScaleDomain(n);if(K.length>0){const nt=s.select(`g.axis.${n} g.ticks g.tick`).html();l.selectAll("g.ticks g.tick").html(nt);const ht=this;l.selectAll("g.tick text").data(K).text(function(W){return W.length>B?(ht.truncation[n]=!0,as(W,D,P)):W}),this.getInvisibleAxisRef().selectAll("g.tick text").data(K).text(function(W){return W.length>B?as(W,D,P):W}),l.selectAll("g.ticks").html(this.getInvisibleAxisRef().html()),l.selectAll("g.tick text").data(K)}}this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick text").on("mouseover",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,hoveredElement:I(this),content:u})}).on("mousemove",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:I(this),datum:u}),a===rt.LABELS&&u.length>o&&l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this),datum:u}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)})}getInvisibleAxisRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} g.ticks.invisible`)}getTitleRef(){const{position:t}=this.configs;return this.getComponentContainer().select(`g.axis.${t} text.axis-title`)}getNumberOfFittingTicks(t,n,r){const i=Math.floor(t/(n*r));return Up(i,2,$n.ticks.number)}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick text").on("mouseover",null).on("mousemove",null).on("mouseout",null)}}class jk extends av{constructor(t,n,r){super(t,n,r)}render(t=!0){super.render(t),super.destroy();const n=this.configs.position,r=this.getComponentContainer({ariaLabel:"axes"}),i=k.appendOrSelect(r,`g.axis.${n}`),s=this;i.selectAll("g.tick").each(function(a,o){const l=I(this);l.classed("tick-hover",!0).attr("tabindex",o===0?0:-1);const c=l.select("text"),{width:u,height:d}=k.getSVGElementSize(c,{useBBox:!0}),h=k.appendOrSelect(l,"rect.axis-holder");let f=0,p=0;switch(n){case z.LEFT:f=-u+Number(c.attr("x")),p=-(d/2);break;case z.RIGHT:f=Math.abs(Number(c.attr("x"))),p=-(d/2);break;case z.TOP:f=-(u/2),p=-d+Number(c.attr("y"))/2,s.truncation[n]&&(f=0,h.attr("transform","rotate(-45)"));break;case z.BOTTOM:f=-(u/2),p=d/2-2,s.truncation[n]&&(f=-u,h.attr("transform","rotate(-45)"));break}h.attr("x",f-$n.hover.rectanglePadding).attr("y",p).attr("width",u+$n.hover.rectanglePadding*2).attr("height",d).lower()}),this.addEventListeners()}addEventListeners(){const t=this.getComponentContainer(),{position:n}=this.configs,r=k.appendOrSelect(t,`g.axis.${n}`),i=this.getOptions(),s=y(i,"axes",n),a=y(s,"scaleType"),o=y(s,"truncation","threshold"),l=this;r.selectAll("g.tick.tick-hover").on("mouseover",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOVER,{event:c,element:u,datum:d}),a===rt.LABELS&&d.length>o&&l.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,element:u,datum:d})}).on("mousemove",function(c){const u=I(this).select("text"),d=u.datum();l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEMOVE,{event:c,element:u,datum:d}),l.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_CLICK,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()})}).on("mouseout",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_MOUSEOUT,{event:c,element:I(this).select("text"),datum:I(this).select("text").datum()}),a===rt.LABELS&&l.services.events.dispatchEvent(T.Tooltip.HIDE)}).on("focus",function(c){const u={clientX:0,clientY:0};if(c.target){c.target.focus();const d=c.target.getBoundingClientRect();u.clientX=d.x,u.clientY=d.y}l.services.events.dispatchEvent(T.Axis.LABEL_FOCUS,{event:{...c,...u},element:I(this),datum:I(this).select("text").datum()})}).on("blur",function(c){l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})}).on("keydown",function(c){c.key&&c.key==="Escape"&&(l.services.events.dispatchEvent(T.Tooltip.HIDE),l.services.events.dispatchEvent(T.Axis.LABEL_BLUR,{event:c,element:I(this),datum:I(this).select("text").datum()})),n===z.LEFT||n===z.RIGHT?c.key&&c.key==="ArrowUp"?l.goNext(this,c):c.key&&c.key==="ArrowDown"&&l.goPrevious(this,c):c.key&&c.key==="ArrowLeft"?l.goPrevious(this,c):c.key&&c.key==="ArrowRight"&&l.goNext(this,c)})}goNext(t,n){t.nextElementSibling&&t.nextElementSibling.tagName!=="path"&&t.nextElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}goPrevious(t,n){t.previousElementSibling&&t.previousElementSibling.tagName!=="path"&&t.previousElementSibling.dispatchEvent(new Event("focus")),n.preventDefault()}destroy(){const t=this.getComponentContainer(),{position:n}=this.configs;k.appendOrSelect(t,`g.axis.${n}`).selectAll("g.tick.tick-hover").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("focus",null).on("blur",null)}}class me extends mt{constructor(){super(...arguments),this.type="2D-axes",this.renderType=at.SVG,this.children={},this.thresholds=[],this.margins={top:0,right:0,bottom:0,left:0}}render(t=!1){const n={},r=Object.keys(z),i=y(this.getOptions(),"axes");r.forEach(o=>{i[z[o]]&&(n[z[o]]=!0)}),this.configs.axes=n,r.forEach(o=>{const l=z[o];if(this.configs.axes[l]&&!this.children[l]){const c={position:l,axes:this.configs.axes,margins:this.margins},u=this.model.axisFlavor===is.DEFAULT?new av(this.model,this.services,c):new jk(this.model,this.services,c);u.setModel(this.model),u.setServices(this.services),u.setParent(this.parent),this.children[l]=u}}),Object.keys(this.children).forEach(o=>{this.children[o].render(t)});const s={};Object.keys(this.children).forEach(o=>{const l=this.children[o],c=l.configs.position,u=l.getInvisibleAxisRef(),{width:d,height:h}=k.getSVGElementSize(u,{useBBox:!0});let f;switch(l.getTitleRef().empty()?f=0:(f=k.getSVGElementSize(l.getTitleRef(),{useBBox:!0}).height,(c===z.LEFT||c===z.RIGHT)&&(f+=5)),c){case z.TOP:s.top=h+f;break;case z.BOTTOM:s.bottom=h+f;break;case z.LEFT:s.left=d+f;break;case z.RIGHT:s.right=d+f;break}}),this.services.events.dispatchEvent(T.Axis.RENDER_COMPLETE),Object.keys(s).some(o=>this.margins[o]!==s[o])&&(this.margins=Object.assign(this.margins,s),this.model.set({axesMargins:this.margins},{skipUpdate:!0}),this.services.events.dispatchEvent(T.ZoomBar.UPDATE),Object.keys(this.children).forEach(o=>{const l=this.children[o];l.margins=this.margins}),this.render(!0))}}class ce extends mt{constructor(){super(...arguments),this.type="skeleton"}render(t=!0){const n=y(this.getOptions(),"data","loading");n?this.renderSkeleton(n):this.removeSkeleton()}renderSkeleton(t){if(this.configs.skeleton===Vt.GRID)this.renderGridSkeleton(t);else if(this.configs.skeleton===Vt.VERT_OR_HORIZ)this.renderVertOrHorizSkeleton(t);else if(this.configs.skeleton===Vt.PIE)this.renderPieSkeleton(t);else if(this.configs.skeleton===Vt.DONUT)this.renderDonutSkeleton(t);else throw new Error(`"${this.configs.skeleton}" is not a valid Skeleton type.`)}renderGridSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawXGrid(t),this.drawYGrid(t),t&&this.setShimmerEffect("shimmer-lines")}renderVertOrHorizSkeleton(t){const n=this.services.cartesianScales.getOrientation();this.setScales(),this.drawBackdrop(t),n===Ht.VERTICAL&&this.drawYGrid(t),n===Ht.HORIZONTAL&&this.drawXGrid(t),this.setShimmerEffect("shimmer-lines")}renderPieSkeleton(t){const n=this.computeOuterRadius();this.drawRing(n,0,t),t&&this.setShimmerEffect("shimmer-areas")}renderDonutSkeleton(t){const n=this.computeOuterRadius(),r=this.computeInnerRadius();this.drawRing(n,r,t),t&&this.setShimmerEffect("shimmer-areas")}setScales(){const t=this.services.cartesianScales.getMainXScale().range(),n=this.services.cartesianScales.getMainYScale().range();this.xScale=Ge().domain([0,1]).range(t),this.yScale=Ge().domain([0,1]).range(n)}drawBackdrop(t){const n=this.parent,{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0});this.backdrop=k.appendOrSelect(n,"svg.chart-skeleton.DAII").attr("role","presentation").attr("width",r).attr("height",i);const s=k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop");s.attr("width","100%").attr("height","100%");const[a]=this.xScale.range(),[,o]=this.yScale.range();this.backdrop.merge(s).attr("x",a).attr("y",o),s.classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawXGrid(t){const n=+this.backdrop.attr("width"),r=y(this.getOptions(),"grid","x","numberOfTicks"),i=this.xScale.ticks(r).map(o=>o*n),s=k.appendOrSelect(this.backdrop,"g.x.skeleton"),a=s.selectAll("line").data(i);a.enter().append("line").merge(a).attr("x1",o=>o).attr("x2",o=>o).attr("y1",0).attr("y2","100%"),s.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawYGrid(t){const n=+this.backdrop.attr("height"),r=this.backdrop.attr("width"),i=y(this.getOptions(),"grid","y","numberOfTicks"),s=this.xScale.ticks(i).map(l=>l*n),a=k.appendOrSelect(this.backdrop,"g.y.skeleton"),o=a.selectAll("line").data(s);o.enter().append("line").merge(o).attr("x1",0).attr("x2",r).attr("y1",l=>l).attr("y2",l=>l),a.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}drawRing(t,n,r=!0){const i=this.parent,{width:s,height:a}=k.getSVGElementSize(i,{useAttrs:!0}),o=k.appendOrSelect(i,"svg.chart-skeleton").attr("width",s).attr("height",a),l=n===0?"pie":"donut",c=y(this.getOptions(),l,"alignment");k.appendOrSelect(o,"rect.chart-skeleton-area-container").attr("width",s).attr("height",a).attr("fill","none");const u=Ui().innerRadius(n).outerRadius(t).startAngle(0).endAngle(Math.PI*2),d=t+Math.abs(Lt.radiusOffset),h=t+(Math.min(s,a)-t*2)/2,f=k.appendOrSelect(o,"path").attr("class","skeleton-area-shape").attr("transform",`translate(${d}, ${h})`).attr("d",u).classed("shimmer-effect-areas",r).classed("empty-state-areas",!r).style("fill",r?`url(#${this.services.domUtils.generateElementIDString("shimmer-areas")})`:null);let p=t+Lt.xOffset;c===Gt.CENTER?p=s/2:c===Gt.RIGHT&&(p=s-t-Lt.xOffset);const g=t+Lt.yOffset;f.attr("transform",`translate(${p}, ${g})`)}computeOuterRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0});return Math.min(t,n)/2+Lt.radiusOffset}computeInnerRadius(){return this.computeOuterRadius()*(3/4)}setShimmerEffect(t){const s="stop-bg-shimmer",a="stop-shimmer",o=this.parent.select(".chart-skeleton"),{width:l}=k.getSVGElementSize(this.parent,{useAttrs:!0}),c=0,u=l,d=k.appendOrSelect(o,"defs").lower(),h=k.appendOrSelect(d,"linearGradient").attr("id",this.services.domUtils.generateElementIDString(t)).attr("class",t).attr("x1",c-3*.2*l).attr("x2",u).attr("y1",0).attr("y2",0).attr("gradientUnits","userSpaceOnUse").attr("gradientTransform","translate(0, 0)"),f=`
|
|
66
66
|
<stop class="${s}" offset="${c}"></stop>
|
|
67
67
|
<stop class="${a}" offset="${c+.2}"></stop>
|
|
68
68
|
<stop class="${s}" offset="${c+2*.2}"></stop>
|
|
@@ -70,5 +70,5 @@
|
|
|
70
70
|
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 10 10">
|
|
71
71
|
<polygon points="5.93 3.71 4.45 3.71 4.45 2.23 3.71 2.23 3.71 3.71 2.23 3.71 2.23 4.45 3.71 4.45 3.71 5.93 4.45 5.93 4.45 4.45 5.93 4.45 5.93 3.71"/>
|
|
72
72
|
<path d="M7.2,6.67a4,4,0,0,0,1-2.59A4.08,4.08,0,1,0,4.07,8.15h0a4,4,0,0,0,2.59-1L9.48,10,10,9.48Zm-3.12.77A3.34,3.34,0,1,1,7.41,4.08,3.34,3.34,0,0,1,4.08,7.44Z"/>
|
|
73
|
-
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Zr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Zr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function y2(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class hv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=B_().value(M=>M[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(r,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>`${M[a]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return y2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(i,"locale"),v=i.pie.labels.enabled,S=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(r,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(S,M=>M.data[s]);b.exit().attr("opacity",0).remove();const x=b.enter().append("text").classed("pie-label",!0),_=[];x.merge(b).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=S.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(i,"donut")?"donut":"pie",D=y(i,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===ts.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);ND(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class E2 extends hv{constructor(){super(...arguments),this.type="donut",this.renderType=at.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");k.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=gh:s=Ee;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const dv="4,10 8,6 12,10",fv="12,6 8,10 4,6";class x2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Up(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===lr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case Ya.UP:return dv;case Ya.DOWN:return fv;default:return t>0?dv:fv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ui().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ui().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(r,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Gt.CENTER?v=m/2:g===Gt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===lr.FULL&&!s?d=l(a):r===lr.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),S=p.selectAll("text.gauge-value-number").data([i]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,x=u?"%":"",_=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(x),{width:C,height:D}=k.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let x;return b!=null?x=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():x=0,c?`${c(x)}${m}`:`${a(Number(x),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),S=y(r,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&S?[i]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=y(r,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(i))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class pv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Ji(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),S=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,S),b=this.services.cartesianScales.getRangeValue(h),x=this.services.cartesianScales.getDomainValue(h)-p/2,_=x+p;if(!this.isOutsideZoomedDomain(x,_))return ie({x0:g,x1:m,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ii().domain(t).rangeRound([0,this.getGroupWidth()])}}class b2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${kn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${kn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xr.OFF&&(t===Xr.AUTO&&Lg.minCellDividerDimension<=this.xBandwidth&&Lg.minCellDividerDimension<=this.yBandwidth||t===Xr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ss(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class S2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),ie({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class _2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?wn.weight.unselected:wn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",wn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?wn.opacity.unselected:wn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Cn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class T2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(y(i,"meter","proportional")===null)u=100;else{const E=y(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Zt.height.proportional:Zt.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Zt.height.proportional:Zt.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",E=>E.x).attr("y",0).attr("height",()=>f||(s?Zt.height.proportional:Zt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=r.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?Zt.height.proportional:Zt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function gv(e){const t=O2(mv(e),360);return Hn(t,[0,10])||Hn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Hn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Hn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Hn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Hn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Hn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Hn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function O2(e,t){return(e%t+t)%t}function Hn(e,[t,n]){return e>=t&&e<=n}function mv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function w2(e,t){return t*Math.sin(e-Math.PI/2)}class M2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=BD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:cr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",cr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=cr;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(r,i)-S)/2;if(x<=0)return;const _=Ii().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=kn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,Vn(this.fullDataNormalized.map(A=>A[d]))]).range([g,x]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=V_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Df),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=w2(_(A),x);return G+V}),M={x:Vn(H)+h,y:i/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vr(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Ft(_(G),0,M).x).attr("y1",G=>Ft(_(G),0,M).y).attr("x2",G=>Ft(_(G),0,M).x).attr("y2",G=>Ft(_(G),0,M).y).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Ft(_(G),D.range()[1]+h,M).x).attr("y",G=>Ft(_(G),D.range()[1]+h,M).y).style("text-anchor",G=>gv(_(G)).textAnchor).style("dominant-baseline",G=>gv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(_(V),D.range()[1]+h,M).x).attr("y",V=>Ft(_(V),D.range()[1]+h,M).y).end().finally(()=>{const V=y(o,"radar","alignment"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",G=>P(G.name,null,G.data)).style("fill-opacity",cr.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",xt=>w(xt.data))}),A=>(A.attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>P(G.name,null,G.data)).style("stroke",G=>P(G.name,null,G.data)),A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(V.data))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vr(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${mv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).attr("x",G=>Ft(-Math.PI/2,D(G),M).x+f).attr("y",G=>Ft(-Math.PI/2,D(G),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,D(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,D(V),M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-i.width)/2):t===Gt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",cr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class vv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class C2 extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class yv extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=Yl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",On.opacity.selected).attr("d",this.areaGenerator)}}class Ev extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const xs=6;class A2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+xs:30-xs},h=Di({name:o,children:a}),f=10,p=r/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,w].join(" ")),N=x.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-6:xs).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===Wa.DENDROGRAM?ub().size([i,r-u-v*xs-l]):Kb().nodeSize([f,p]).size([i,r-u-v*xs-l]),E=Z_().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),S(h),n.attr("viewBox",[-d.left,-0,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var D2="#000000",L2="#ffffff",R2="#fcf4d6",I2="#fddc69",k2="#f1c21b",P2="#d2a106",N2="#b28600",$2="#8e6a00",F2="#684e00",U2="#483700",B2="#302400",H2="#1c1500",G2={10:R2,20:I2,30:k2,40:P2,50:N2,60:$2,70:F2,80:U2,90:B2,100:H2},V2="#fff2e8",z2="#ffd9be",W2="#ffb784",Y2="#ff832b",q2="#eb6200",X2="#ba4e00",Z2="#8a3800",j2="#5e2900",K2="#3e1a00",Q2="#231000",J2={10:V2,20:z2,30:W2,40:Y2,50:q2,60:X2,70:Z2,80:j2,90:K2,100:Q2},tP="#fff1f1",eP="#ffd7d9",nP="#ffb3b8",rP="#ff8389",iP="#fa4d56",sP="#da1e28",aP="#a2191f",oP="#750e13",lP="#520408",cP="#2d0709",uP={10:tP,20:eP,30:nP,40:rP,50:iP,60:sP,70:aP,80:oP,90:lP,100:cP},hP="#fff0f7",dP="#ffd6e8",fP="#ffafd2",pP="#ff7eb6",gP="#ee5396",mP="#d02670",vP="#9f1853",yP="#740937",EP="#510224",xP="#2a0a18",bP={10:hP,20:dP,30:fP,40:pP,50:gP,60:mP,70:vP,80:yP,90:EP,100:xP},SP="#f6f2ff",_P="#e8daff",TP="#d4bbff",OP="#be95ff",wP="#a56eff",MP="#8a3ffc",CP="#6929c4",AP="#491d8b",DP="#31135e",LP="#1c0f30",RP={10:SP,20:_P,30:TP,40:OP,50:wP,60:MP,70:CP,80:AP,90:DP,100:LP},IP="#edf5ff",kP="#d0e2ff",PP="#a6c8ff",NP="#78a9ff",$P="#4589ff",FP="#0f62fe",UP="#0043ce",BP="#002d9c",HP="#001d6c",GP="#001141",VP={10:IP,20:kP,30:PP,40:NP,50:$P,60:FP,70:UP,80:BP,90:HP,100:GP},zP="#e5f6ff",WP="#bae6ff",YP="#82cfff",qP="#33b1ff",XP="#1192e8",ZP="#0072c3",jP="#00539a",KP="#003a6d",QP="#012749",JP="#061727",tN={10:zP,20:WP,30:YP,40:qP,50:XP,60:ZP,70:jP,80:KP,90:QP,100:JP},eN="#d9fbfb",nN="#9ef0f0",rN="#3ddbd9",iN="#08bdba",sN="#009d9a",aN="#007d79",oN="#005d5d",lN="#004144",cN="#022b30",uN="#081a1c",hN={10:eN,20:nN,30:rN,40:iN,50:sN,60:aN,70:oN,80:lN,90:cN,100:uN},dN="#defbe6",fN="#a7f0ba",pN="#6fdc8c",gN="#42be65",mN="#24a148",vN="#198038",yN="#0e6027",EN="#044317",xN="#022d0d",bN="#071908",SN={10:dN,20:fN,30:pN,40:gN,50:mN,60:vN,70:yN,80:EN,90:xN,100:bN},_N="#f2f4f8",TN="#dde1e6",ON="#c1c7cd",wN="#a2a9b0",MN="#878d96",CN="#697077",AN="#4d5358",DN="#343a3f",LN="#21272a",RN="#121619",IN={10:_N,20:TN,30:ON,40:wN,50:MN,60:CN,70:AN,80:DN,90:LN,100:RN},kN="#f4f4f4",PN="#e0e0e0",NN="#c6c6c6",$N="#a8a8a8",FN="#8d8d8d",UN="#6f6f6f",BN="#525252",HN="#393939",GN="#262626",VN="#161616",zN={10:kN,20:PN,30:NN,40:$N,50:FN,60:UN,70:BN,80:HN,90:GN,100:VN},WN="#f7f3f2",YN="#e5e0df",qN="#cac5c4",XN="#ada8a8",ZN="#8f8b8b",jN="#726e6e",KN="#565151",QN="#3c3838",JN="#272525",t$="#171414",e$={10:WN,20:YN,30:qN,40:XN,50:ZN,60:jN,70:KN,80:QN,90:JN,100:t$},bv={black:{100:D2},blue:VP,coolGray:IN,cyan:tN,gray:zN,green:SN,magenta:bP,orange:J2,purple:RP,red:uP,teal:hN,warmGray:e$,white:{0:L2},yellow:G2};const n$=e=>{if(!e)return null;for(const t of Object.keys(bv)){const n=bv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Sv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=dn(n);let i;if(r&&(i=n$(r?r.hex():null)),i==null){const s=hh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let r$=0;class i$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Di({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=nS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>r$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Sv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Sv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),dn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function s$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var o$={value:function(){}};function _v(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new fo(n)}function fo(e){this._=e}function l$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}fo.prototype=_v.prototype={constructor:fo,on:function(e,t){var n=this._,r=l$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=c$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Tv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Tv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function c$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Tv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=o$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const u$=a$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:_v},Symbol.toStringTag,{value:"Module"})));var Au,Ov;function h$(){if(Ov)return Au;Ov=1;const e=u$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;Au=function(){var b=[256,256],x=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=S;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=N.map(function(j,J){return j.text=x.call(this,j,J),j.font=_.call(this,j,J),j.style=D.call(this,j,J),j.weight=B.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(r<<5)/ut,Y.height=i/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,Q.y=K+G,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,bs=(Q.y+Q.y0)*Ut+(st>>5),Ss,mr=0;mr<Oe;mr++){Ss=0;for(var je=0;je<=xt;je++)Y[bs+je]|=Ss<<Ne|(je<xt?(Ss=V[mr*xt+je])>>>_t:0);bs+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(x=E(Y),L):x},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,x,_,C){if(!x.sprite){var D=b.context,B=b.ratio;D.clearRect(0,0,(r<<5)/B,i/B);var P=0,w=0,H=0,N=_.length;for(--C;++C<N;){x=_[C],D.save(),D.font=x.style+" "+x.weight+" "+~~((x.size+1)/B)+"px "+x.font;const J=D.measureText(x.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=x.size<<1;if(x.rotate){var M=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=r<<5&&(P=0,w+=H,H=0),w+V>=i)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,A,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,A,0)),D.restore(),x.width=G,x.height=V,x.xoff=P,x.yoff=w,x.x1=G>>1,x.y1=V>>1,x.x0=-x.x1,x.y0=-x.y1,x.hasText=!0,P+=G}for(var tt=D.getImageData(0,0,(r<<5)/B,i/B).data,X=[];--C>=0;)if(x=_[C],!!x.hasText){for(var Y=x.width,Q=Y>>5,ut=x.y1-x.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(r<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(x.y0++,ut--,ht--,w++)}x.y1=x.y0+nt,x.sprite=X.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&x[N+$])return!0;N+=_}return!1}function f(b,x){var _=b[0],C=b[1];x.x+x.x0<_.x&&(_.x=x.x+x.x0),x.y+x.y0<_.y&&(_.y=x.y+x.y0),x.x+x.x1>C.x&&(C.x=x.x+x.x1),x.y+x.y1>C.y&&(C.y=x.y+x.y1)}function p(b,x){return b.x+b.x1>x[0].x&&b.x+b.x0<x[1].x&&b.y+b.y1>x[0].y&&b.y+b.y0<x[1].y}function g(b){var x=b[0]/b[1];return function(_){return[x*(_*=.1)*Math.cos(_),_*Math.sin(_)]}}function m(b){var x=4,_=x*b[0]/b[1],C=0,D=0;return function(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-P&3){case 0:C+=_;break;case 1:D+=x;break;case 2:C-=_;break;default:D-=x;break}return[C,D]}}function v(b){for(var x=[],_=-1;++_<b;)x[_]=0;return x}function S(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Au}var d$=h$();const f$=s$(d$);class p$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=f$().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=k.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,S=>`${S[c]}-${S.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:S[c],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>n.model.getFillColor(S[c],S.text,S)).attr("text-anchor","middle").transition().call(S=>n.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:t})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Fe(i):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=za(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class g$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=f2(s,Object.values(l)),u=u2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Nx().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Bi()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case an.geoEqualEarth:t=eb();break;case an.geoAlbers:t=Xx();break;case an.geoConicEqualArea:t=Dd();break;case an.geoConicEquidistant:t=Jx();break;case an.geoEquirectangular:t=Kx();break;case an.geoMercator:t=Zx();break;case an.geoNaturalEarth1:t=nb();break;default:throw new Error("Projection is not supported.")}return t}}class m$ extends g${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.HIDE,{event:r,hoveredElement:s})})}}class wv extends Ze{constructor(t,n){super(t,n),this.model=new a2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new m$(this.model,this.services)];return this.getChartComponents(t)}}class v$ extends on{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=ct({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:zt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class y$ extends Ze{constructor(t,n){super(t,n),this.model=new v$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new v2(this.model,this.services)];return this.getChartComponents(t)}}const Mv={[be.LINE]:[ei,cn],[be.SCATTER]:[cn],[be.AREA]:[iv,ei,cn],[be.STACKED_AREA]:[yv,ei,xv,ho],[be.SIMPLE_BAR]:[vv],[be.GROUPED_BAR]:[pv,ni],[be.STACKED_BAR]:[Ev,ho]};class E$ extends ge{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Mv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${aC(i.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),i.options),i.type===be.STACKED_AREA&&(o=!0),Mv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Bn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class x$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Cv extends Ze{constructor(t,n,r=!1){super(t,n),this.model=new x$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new hv(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class b$ extends Cv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new E2(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class S$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class _$ extends Ze{constructor(t,n){super(t,n),this.model=new S$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services)];return this.getChartComponents(t)}}class T$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new pv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class O$ extends pr{constructor(t){super(t),this.axisFlavor=is.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==rt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==rt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==rt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==rt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Fe(this.getDisplayData(),r=>r.value),n=Ge().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=Tn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!We(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=lv(this.getDisplayData(),l)}}class w$ extends ge{constructor(t,n){super(t,n),this.model=new O$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new b2(this.model,this.services)];return this.getAxisChartComponents(t)}}class M$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class C$ extends ge{constructor(t,n){super(t,n),this.model=new M$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new g2(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class A$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new ei(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new C2(this.model,this.services),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new _2(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class L$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"–":a(d.value,o),...i?[i]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class R$ extends Ze{constructor(t,n){var i;super(t,n),this.model=new L$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?ct(Tn(At.proportionalMeterChart),n.options):ct(Tn(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new m2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new T2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],r=[new le(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:at.HTML})}}class I$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"–")])];return super.formatTable({headers:l,cells:c})}}class k$ extends Ze{constructor(t,n){super(t,n),this.model=new I$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new M2(this.model,this.services)];return this.getChartComponents(t)}}class P$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class N$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"–"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class $$ extends Ze{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new A2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class F$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class U$ extends Ze{constructor(t,n){super(t,n),this.model=new F$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new i$(this.model,this.services)];return this.getChartComponents(t)}}class B$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new vv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new yv(this.model,this.services),new ei(this.model,this.services,{stacked:!0}),new xv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new Ev(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class V$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class z$ extends Ze{constructor(t,n){super(t,n),this.model=new V$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new p$(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Mk,q.AreaChart=Kk,q.AreaEvent=Nc,q.ArrowDirections=Ya,q.AxisEvent=Pc,q.AxisFlavor=is,q.AxisPositions=z,q.AxisTitleOrientations=qa,q.BarEvent=Bc,q.BoxplotChart=t2,q.BoxplotEvent=Hc,q.BubbleChart=n2,q.BulletChart=s2,q.CalloutDirections=ts,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=wv,q.CirclePackChart=y$,q.ColorClassNameTypes=lt,q.ColorLegendType=rs,q.ComboChart=E$,q.DividerStatus=Xr,q.DominantBaseline=sn,q.DonutChart=b$,q.ExperimentalChoroplethChart=wv,q.GaugeChart=_$,q.GaugeEvent=Uc,q.GaugeTypes=lr,q.GroupedBarChart=T$,q.HeatmapChart=w$,q.HistogramChart=C$,q.LayoutAlignItems=or,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qr,q.LegendPositions=Yr,q.LineChart=A$,q.LineEvent=Vc,q.LollipopChart=D$,q.MeterChart=R$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Cv,q.PieEvent=Fc,q.Projection=an,q.RadarChart=k$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=rt,q.ScatterChart=P$,q.ScatterEvent=Gc,q.SimpleBarChart=B$,q.Skeletons=Vt,q.StackedAreaChart=H$,q.StackedBarChart=G$,q.Statuses=es,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=ns,q.ToolbarControlTypes=St,q.TooltipEvent=zr,q.TreeChart=$$,q.TreeEvent=Wc,q.TreeTypes=Wa,q.TreemapChart=U$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=z$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
73
|
+
</svg>`}addEventListeners(){const t=this;this.parent.selectAll("circle.node").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0);const s=t.model.getHierarchyLevel(),a=s>2&&!i.classed("focal"),o=y(t.model.getOptions(),"canvasZoom","enabled");let l=!1;if(!a){let c=[],u=[],d=null;if(r.children){r.depth>1&&o&&(l=!0,i.classed("clickable",!0)),c=r.children.map(p=>{if(p!==null)return typeof p.data.value=="number"?{label:p.data.name,value:p.data.value}:{label:p.data.name,labelIcon:o&&s<=2?t.getZoomIcon():null,value:p.value}});const f=t.model.getOptions();u=[{label:yt(f,"locale.translations.total")||yt(f,"tooltip.totalLabel")||"Total",value:r.value,bold:!0}],t.highlightChildren(r.children)}else d=r.value;const h=getComputedStyle(this,null).getPropertyValue("fill");t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:h,label:r.data.name,labelIcon:l&&o&&s<=2?t.getZoomIcon():null,value:d},...c,...u]})}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),r.children&&t.unhighlightChildren(r.children),t.services.events.dispatchEvent(T.CirclePack.CIRCLE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})}).on("click",function(n,r){const i=I(this),s=i.classed("non-focal"),a=y(t.model.getOptions(),"canvasZoom","enabled");if(a&&t.model.getHierarchyLevel()>2){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!1),t.focal=null,t.model.updateHierarchyLevel(2),t.services.canvasZoom.zoomOut(o,Zr)}else if(r.depth===2&&r.children&&!s&&a){const o=t.parent.selectAll("circle.node");I(t.services.domUtils.getMainContainer()).classed("zoomed-in",!0),t.focal=r,t.model.updateHierarchyLevel(3),t.services.canvasZoom.zoomIn(r,o,Zr),n.stopPropagation()}t.services.events.dispatchEvent(T.CirclePack.CIRCLE_CLICK,{event:n,element:i,datum:r})})}destroy(){this.parent.selectAll("circle.node").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),this.removeBackgroundListeners()}}function y2(e,t){const n=pi(this._current,e);return r=>(this._current=n(r),t(this._current))}class hv extends mt{constructor(){super(...arguments),this.type="pie",this.renderType=at.SVG,this.isRendering=!1,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.slice").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i.data[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.slice").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getInnerRadius(){return Lt.innerRadius}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"pie graph"}),i=this.getOptions(),{groupMapsTo:s}=i.data,{valueMapsTo:a}=i.pie;this.isRendering=!0;const o=this.model.getDisplayData().filter(M=>M[a]>0),l=this.computeRadius();this.arc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l),this.hoverArc=Ui().innerRadius(this.getInnerRadius()).outerRadius(l+Lt.hoverArc.outerRadiusOffset);const u=B_().value(M=>M[a]).sort(y(i,"pie","sortFunction")).padAngle(Lt.padAngle)(o),h=k.appendOrSelect(r,"g.slices").attr("role",ft.GROUP).attr("data-name","slices").selectAll("path.slice").data(u,M=>M.data[s]);h.exit().attr("opacity",0).remove(),h.enter().append("path").classed("slice",!0).attr("opacity",0).merge(h).attr("class",M=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:M.data[s],originalClassName:"slice"})).style("fill",M=>n.model.getFillColor(M.data[s],null,M.data)).attr("d",this.arc).transition().call(M=>this.services.transitions.setupTransition({transition:M,name:"pie_slice_enter_update",animate:t})).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","slice").attr("aria-label",M=>`${M[a]}, ${Zc(M.data[a],o,a)+"%"}`).attrTween("d",function(M){return y2.bind(this)(M,n.arc)}).on("end",()=>{n.isRendering=!1});const{code:g,number:m}=y(i,"locale"),v=i.pie.labels.enabled,S=v?u.filter(M=>M.data[a]>0):[],b=k.appendOrSelect(r,"g.labels").attr("role",ft.GROUP).attr("data-name","labels").selectAll("text.pie-label").data(S,M=>M.data[s]);b.exit().attr("opacity",0).remove();const x=b.enter().append("text").classed("pie-label",!0),_=[];x.merge(b).style("text-anchor","middle").text(M=>i.pie.labels.formatter?i.pie.labels.formatter({...M,percentageValue:Zc(M.data[a],o,a,!0)}):m(Zc(M.data[a],o,a),g)+"%").datum(function(M){const O=l+7,$=(M.endAngle-M.startAngle)/2+M.startAngle,F=$/Math.PI*180,L=this.getComputedTextLength();return M.textOffsetX=L/2,M.textOffsetY=F>90&&F<270?10:0,M.xPosition=(M.textOffsetX+O)*Math.sin($),M.yPosition=(M.textOffsetY+O)*-Math.cos($),M}).attr("transform",function(M,O){const $=S.length,F=(M.endAngle-M.startAngle)*(180/Math.PI);if(O>=$-2&&F<Lt.callout.minSliceDegree){let L,U;return M.index===$-1?(L=M.xPosition+Lt.callout.offsetX+Lt.callout.textMargin+M.textOffsetX,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.RIGHT,_.push(M)):(L=M.xPosition-Lt.callout.offsetX-M.textOffsetX-Lt.callout.textMargin,U=M.yPosition-Lt.callout.offsetY,M.direction=ts.LEFT,_.push(M)),`translate(${L}, ${U})`}return`translate(${M.xPosition}, ${M.yPosition})`}),this.renderCallouts(_);const C=y(i,"donut")?"donut":"pie",D=y(i,C,"alignment"),{width:B}=k.getSVGElementSize(this.getParent(),{useAttrs:!0}),P=v?Lt.xOffset:0,w=v?Lt.yOffset:0;let H=l+P;D===Gt.CENTER?H=B/2:D===Gt.RIGHT&&(H=B-l-Lt.xOffset);let N=l+w;_.length>0&&(N+=Lt.yOffsetCallout),r.attr("x",H+7).attr("y",N),this.addEventListeners()}renderCallouts(t){const n=k.appendOrSelect(this.getComponentContainer(),"g.callouts").attr("role",ft.GROUP).attr("data-name","callouts"),r=n.selectAll("g.callout").data(t);r.exit().remove();const i=r.enter().append("g").classed("callout",!0).attr("role",ft.GROUP).attr("aria-roledescription","label callout");i.merge(r).datum(function(o){const{xPosition:l,yPosition:c,direction:u}=o;return u===ts.RIGHT?(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l+Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x-Lt.callout.horizontalLineLength):(o.startPos={x:l,y:c+o.textOffsetY},o.endPos={x:l-Lt.callout.offsetX,y:c-Lt.callout.offsetY+o.textOffsetY},o.intersectPointX=o.endPos.x+Lt.callout.horizontalLineLength),o}),i.append("line").classed("vertical-line",!0).merge(n.selectAll("line.vertical-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.startPos.x).attr("y1",o=>o.startPos.y).attr("x2",o=>o.intersectPointX).attr("y2",o=>o.endPos.y),i.append("line").classed("horizontal-line",!0).merge(n.selectAll("line.horizontal-line")).datum(function(){return I(this.parentNode).datum()}).style("stroke-width","1px").attr("x1",o=>o.intersectPointX).attr("y1",o=>o.endPos.y).attr("x2",o=>o.endPos.x).attr("y2",o=>o.endPos.y)}addEventListeners(){const t=this;this.parent.selectAll("path.slice").on("mouseover",function(n,r){const i=I(this);t.isRendering||i.classed("hovered",!0).transition("pie_slice_mouseover").call(o=>t.services.transitions.setupTransition({transition:o,name:"pie_slice_mouseover"})).attr("d",t.hoverArc),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOVER,{event:n,element:I(this),datum:r});const{groupMapsTo:s}=t.getOptions().data,{valueMapsTo:a}=t.getOptions().pie;t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{label:r.data[s],value:r.data[a]}]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Pie.SLICE_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);ND(()=>{t.isRendering||i.classed("hovered",!1).transition("pie_slice_mouseout").call(s=>t.services.transitions.setupTransition({transition:s,name:"pie_slice_mouseout"})).attr("d",t.arc)},100),t.services.events.dispatchEvent(T.Pie.SLICE_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}computeRadius(){const{width:t,height:n}=k.getSVGElementSize(this.parent,{useAttrs:!0}),r=this.getOptions(),i=Math.min(t,n)/2;return r.pie.labels.enabled?i+Lt.radiusOffset:i}}class E2 extends hv{constructor(){super(...arguments),this.type="donut",this.renderType=at.SVG}render(t=!0){super.render(t);const n=this;if(this.model.isDataEmpty()){this.getComponentContainer({ariaLabel:"donut graph"}).select("g.center").remove();return}const r=k.appendOrSelect(this.getComponentContainer({ariaLabel:"donut graph"}),"g.center"),i=this.getOptions(),s=this.computeRadius(),a=y(i,"donut","center","label");k.appendOrSelect(r,"text.donut-figure").attr("text-anchor","middle").style("dominant-baseline",()=>a===null||a===""?"central":"initial").style("font-size",()=>i.donut.center.numberFontSize(s)).transition().call(o=>this.services.transitions.setupTransition({transition:o,name:"donut-figure-enter-update",animate:t})).tween("text",function(){return n.centerNumberTween(I(this))}),a!==null&&a!==""&&k.appendOrSelect(r,"text.donut-title").attr("text-anchor","middle").style("font-size",()=>i.donut.center.titleFontSize(s)).attr("y",i.donut.center.titleYPosition(s)).text(a)}getInnerRadius(){return this.computeRadius()*(3/4)}centerNumberTween(t){const n=this.getOptions();let r=y(n,"donut","center","number");r===null&&(r=this.model.getDisplayData().reduce((o,l)=>o+l[n.pie.valueMapsTo],0));const i=parseInt(t.text().replace(/[, ]+/g,""),10)||0;let s;i%1===0&&r%1===0?s=gh:s=Ee;const a=s(i,r);return o=>{const{numberFormatter:l}=n.donut.center;if(l)t.text(l(a(o)));else{const{code:c,number:u}=y(n,"locale");t.text(u(Math.floor(a(o)),c))}}}}const dv="4,10 8,6 12,10",fv="12,6 8,10 4,6";class x2 extends mt{constructor(){super(...arguments),this.type="gauge",this.renderType=at.SVG}getValue(){var r;return((r=this.model.getData().find(i=>i.group==="value"))==null?void 0:r.value)??null}getValueRatio(){return Up(this.getValue(),0,100)/100}getDelta(){var r;return((r=this.model.getData().find(i=>i.group==="delta"))==null?void 0:r.value)??null}getArcRatio(){const t=this.getOptions();return y(t,"gauge","type")===lr.FULL?1:.5}getArcSize(){return this.getArcRatio()*Math.PI*2}getStartAngle(){const t=this.getArcSize();return t===2*Math.PI?0:-t/2}getArrow(t){const n=this.getOptions();switch(y(n,"gauge","deltaArrow","direction")){case Ya.UP:return dv;case Ya.DOWN:return fv;default:return t>0?dv:fv}}render(t=!0){const n=this.getComponentContainer({ariaLabel:"gauge graph"}).attr("width","100%").attr("height","100%"),r=this.getOptions(),i=this.getValue(),s=this.getValueRatio(),a=this.getArcSize(),o=this.getStartAngle(),l=s*a,c=o+l,u=o+a,d=this.computeRadius(),h=this.getInnerRadius();this.backgroundArc=Ui().innerRadius(h).outerRadius(d).startAngle(c).endAngle(u),this.arc=Ui().innerRadius(h).outerRadius(d).startAngle(o).endAngle(c),k.appendOrSelect(n,"path.arc-background").attr("d",this.backgroundArc);const f=n.selectAll("path.arc-foreground").data([i]);f.enter().append("path").merge(f).attr("class",this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:"value",originalClassName:"arc-foreground"})).style("fill",()=>y(this.getOptions(),"color","scale","value")).attr("d",this.arc).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",S=>S),this.drawValueNumber(),this.drawDelta(),f.exit().remove();const g=y(r,"gauge","alignment"),{width:m}=k.getSVGElementSize(this.getParent(),{useAttrs:!0});let v=d;g===Gt.CENTER?v=m/2:g===Gt.RIGHT&&(v=m-d),n.attr("x",v).attr("y",d),this.addEventListeners()}drawValueNumber(){const t=this.getComponentContainer(),n=this.getOptions(),r=y(n,"gauge","type"),i=this.getValue(),s=this.getDelta(),a=this.computeRadius(),o=y(n,"gauge","valueFontSize"),l=y(n,"gauge","deltaFontSize"),c=y(n,"gauge","numberSpacing"),u=y(n,"gauge","showPercentageSymbol");let d=0;r===lr.FULL&&!s?d=l(a):r===lr.SEMI&&s&&(d=-(l(a)+c));const h=k.appendOrSelect(t,"g.gauge-numbers").attr("transform",`translate(0, ${d})`),f=o(a),p=k.appendOrSelect(h,"g.gauge-value-number"),{code:g,number:m}=y(n,"locale"),v=y(n,"gauge","numberFormatter"),S=p.selectAll("text.gauge-value-number").data([i]);S.enter().append("text").attr("class","gauge-value-number").merge(S).style("font-size",`${f}px`).attr("text-anchor","middle").text(B=>{let P;return B!=null?P=Number(B.toFixed(2))%1!==0?B.toFixed(2):B.toFixed():P=0,v?v(P):m(Number(P),g)});const{width:E}=k.getSVGElementSize(k.appendOrSelect(t,"text.gauge-value-number"),{useBBox:!0}),b=f/2,x=u?"%":"",_=k.appendOrSelect(p,"text.gauge-value-symbol").style("font-size",`${b}px`).attr("x",E/2).text(x),{width:C,height:D}=k.getSVGElementSize(_,{useBBox:!0});_.attr("y",`-${D/2}px`),p.attr("transform",`translate(-${C/2}, 0)`)}drawDelta(){const t=this,n=this.getComponentContainer(),r=this.getOptions(),i=this.getDelta(),{code:s,number:a}=y(r,"locale");if(i){const o=this.computeRadius(),l=i?y(r,"gauge","deltaFontSize"):()=>0,c=i?y(r,"gauge","numberFormatter"):()=>null,u=y(r,"gauge","deltaArrow","size"),d=y(r,"gauge","numberSpacing"),h=y(r,"gauge","showPercentageSymbol"),f=k.appendOrSelect(n,"g.gauge-numbers"),p=k.appendOrSelect(f,"g.gauge-delta").attr("transform",`translate(0, ${l(o)+d})`),g=k.appendOrSelect(p,"text.gauge-delta-number"),m=h?"%":"";g.data(i===null?[]:[i]),g.enter().append("text").classed("gauge-delta-number",!0).merge(g).attr("text-anchor","middle").style("font-size",`${l(o)}px`).text(b=>{let x;return b!=null?x=Number(b.toFixed(2))%1!==0?b.toFixed(2):b.toFixed():x=0,c?`${c(x)}${m}`:`${a(Number(x),s)}${m}`});const{width:v}=k.getSVGElementSize(k.appendOrSelect(n,".gauge-delta-number"),{useBBox:!0}),S=y(r,"gauge","deltaArrow","enabled"),E=p.selectAll("svg.gauge-delta-arrow").data(i!==null&&S?[i]:[]);E.enter().append("svg").merge(E).attr("class","gauge-delta-arrow").attr("x",-u(o)-v/2).attr("y",-u(o)/2-l(o)*.35).attr("width",u(o)).attr("height",u(o)).attr("viewBox","0 0 16 16").each(function(){const b=I(this);k.appendOrSelect(b,"rect.gauge-delta-arrow-backdrop").attr("width","16").attr("height","16").attr("fill","none");const x=y(r,"gauge","status");k.appendOrSelect(b,"polygon.gauge-delta-arrow").attr("class",x!==null?`gauge-delta-arrow status--${x}`:"").attr("points",t.getArrow(i))}),E.exit().remove(),g.exit().remove()}else{const o=n.select("g.gauge-delta");o.empty()||o.remove()}}getInnerRadius(){const t=this.computeRadius(),n=y(this.getOptions(),"gauge","arcWidth");return t-n}addEventListeners(){const t=this;this.parent.selectAll("path.arc-foreground").on("mouseover",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOVER,{event:n,element:I(this),datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEMOVE,{event:n,element:i,datum:r})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Gauge.ARC_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Gauge.ARC_MOUSEOUT,{event:n,element:i,datum:r})})}computeRadius(){const t=this.getOptions(),n=y(t,"gauge","type"),{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});return n===lr.SEMI?Math.min(r/2,i):Math.min(r/2,i/2)}}class pv extends Cu{constructor(){super(...arguments),this.type="grouped-bar",this.renderType=at.SVG,this.padding=5,this.defaultStepFactor=70,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.model.getDisplayData(this.configs.groups),r=this.getOptions(),{groupMapsTo:i}=r.data;this.setGroupScale();const s=this.getComponentContainer({ariaLabel:"grouped bar graphs",withinChartClip:!0}),a=Ji(n.map(h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return h[f]&&typeof h[f].toString=="function"?h[f].toString():h[f]})),o=s.selectAll("g.bars").data(a,h=>h);o.exit().attr("opacity",0).remove();const c=o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars").merge(o);c.transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-group-update-enter",animate:t})).attr("transform",h=>{const p=this.services.cartesianScales.getDomainValue(h)-this.getGroupWidth()/2;return this.services.cartesianScales.getOrientation()===Ht.VERTICAL?`translate(${p}, 0)`:`translate(0, ${p})`});const u=c.selectAll("path.bar").data(h=>this.getDataCorrespondingToLabel(h),h=>h[i]);u.exit().attr("opacity",0).remove(),u.enter().append("path").attr("opacity",0).merge(u).classed("bar",!0).transition().call(h=>this.services.transitions.setupTransition({transition:h,name:"bar-update-enter",animate:t})).attr("class",h=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:h[i],originalClassName:"bar"})).style("fill",h=>{const f=this.services.cartesianScales.getDomainIdentifier(h);return this.model.getFillColor(h[i],h[f],h)}).attr("d",h=>{const f=this.groupScale(h[i]),p=this.getBarWidth(),g=f,m=f+p,v=this.services.cartesianScales.getRangeAxisPosition({datum:h}),S=this.services.cartesianScales.getDomainLowerBound(v),E=this.services.cartesianScales.getValueThroughAxisPosition(v,S),b=this.services.cartesianScales.getRangeValue(h),x=this.services.cartesianScales.getDomainValue(h)-p/2,_=x+p;if(!this.isOutsideZoomedDomain(x,_))return ie({x0:g,x1:m,y0:E,y1:b},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",h=>h.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}getDataCorrespondingToLabel(t){return this.model.getDisplayData(this.configs.groups).filter(r=>{const i=this.services.cartesianScales.getDomainIdentifier(r);return r[i].toString()===t})}getGroupWidth(){const t=this.model.getGroupedData(this.configs.groups),n=this.getTotalGroupPadding();return this.getBarWidth()*t.length+n}getDomainScaleStep(){const t=this.services.cartesianScales.getDomainScale(),n=this.model.getGroupedData(this.configs.groups);let r=this.defaultStepFactor;if(typeof t.step=="function")r=t.step();else if(n.length>0){const i=n.find(s=>{var a;return((a=s.data)==null?void 0:a.length)>1});if(i){const s=this.services.cartesianScales.getDomainIdentifier(i.data[0]);r=Math.abs(t(i.data[1][s])-t(i.data[0][s]))}}return r}getTotalGroupPadding(){const t=this.model.getGroupedData(this.configs.groups);return t.length===1?0:Math.min(5,5*(this.getDomainScaleStep()/this.defaultStepFactor))*(t.length-1)}getBarWidth(){const t=this.getOptions(),n=y(t,"bars","width"),r=y(t,"bars","maxWidth");if(n!==null&&(r===null||n<=r))return n;const s=this.model.getGroupedData(this.configs.groups).length,a=this.getTotalGroupPadding();return Math.min(r,(this.getDomainScaleStep()-a)/s)}setGroupScale(){const t=this.model.getActiveDataGroupNames(this.configs.groups);this.groupScale=Ii().domain(t).rangeRound([0,this.getGroupWidth()])}}class b2 extends mt{constructor(){super(...arguments),this.type="heatmap",this.renderType=at.SVG,this.matrix={},this.xBandwidth=0,this.yBandwidth=0,this.translationUnits={x:0,y:0},this.handleAxisOnHover=t=>{const{detail:n}=t,{datum:r}=n,i=this.model.getUniqueRanges(),s=this.model.getUniqueDomain(),a=this.services.cartesianScales.getDomainLabel(),o=this.services.cartesianScales.getRangeLabel(),l=this.services.cartesianScales.getMainXScale(),c=this.services.cartesianScales.getMainYScale();let u="",d=null,h=null,f=null;this.matrix[r]!==void 0?(u=a,i.forEach(p=>{if(typeof this.matrix[r][p].value=="number"){const g=this.matrix[r][p].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})):(u=o,s.forEach(p=>{if(typeof this.matrix[p][r].value=="number"){const g=this.matrix[p][r].value;if(d===null){d=g,h=g,f=g;return}d+=g,h=g<h?g:h,f=g>f?g:f}})),l(r)!==void 0?this.parent.select("g.multi-cell.column-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${l(r)}, ${kn(c.range())})`):c(r)!==void 0&&this.parent.select("g.multi-cell.row-highlight").classed("highlighter-hidden",!1).attr("transform",`translate(${kn(l.range())},${c(r)})`),this.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n.event,hoveredElement:I(t.detail.element),items:[{label:u,value:r,bold:!0},{label:"Min",value:h!==null?h:"-"},{label:"Max",value:f!==null?f:"-"},{label:"Average",value:d!==null?d/s.length:"-"}]})},this.handleAxisMouseOut=t=>{this.parent.selectAll("g.multi-cell").classed("highlighter-hidden",!0),this.services.events.dispatchEvent(T.Tooltip.HIDE,{event:t})}}init(){const t=this.services.events;t.addEventListener(T.Axis.LABEL_MOUSEOVER,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_MOUSEOUT,this.handleAxisMouseOut),t.addEventListener(T.Axis.LABEL_FOCUS,this.handleAxisOnHover),t.addEventListener(T.Axis.LABEL_BLUR,this.handleAxisMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"heatmap",withinChartClip:!0});n.lower();const{cartesianScales:r}=this.services;if(this.matrix=this.model.getMatrix(),n.html(""),y(this.getOptions(),"data","loading"))return;const i=r.getMainXScale(),s=r.getMainYScale(),a=r.getDomainIdentifier(),o=r.getRangeIdentifier(),l=this.model.getUniqueDomain(),c=this.model.getUniqueRanges(),u=this.model.getMatrixAsArray(),d=i.range(),h=s.range();this.xBandwidth=Math.abs((d[1]-d[0])/l.length),this.yBandwidth=Math.abs((h[1]-h[0])/c.length);const f=this.services.domUtils.generateElementIDString("heatmap-pattern-stripes");n.append("defs").append("pattern").attr("id",f).attr("width",3).attr("height",3).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("rect").classed("pattern-fill",!0).attr("width",.5).attr("height",8);const p=n.selectAll().data(u).enter().append("g").attr("class",g=>`heat-${g.index}`).classed("cell",!0).attr("transform",g=>`translate(${i(g[a])}, ${s(g[o])})`).append("rect").attr("class",g=>this.model.getColorClassName({value:g.value,originalClassName:`heat-${g.index}`})).classed("heat",!0).classed("null-state",g=>g.index===-1||g.value===null).attr("width",this.xBandwidth).attr("height",this.yBandwidth).style("fill",g=>{const m=this.services.cartesianScales.getDomainIdentifier(g);return g.index===-1||g.value===null?`url(#${f})`:this.model.getFillColor(Number(g.value),g[m],g)}).attr("aria-label",g=>g.value);this.createOuterBox("g.cell-highlight",this.xBandwidth,this.yBandwidth),this.createOuterBox("g.multi-cell.column-highlight",this.xBandwidth,Math.abs(h[1]-h[0])),this.createOuterBox("g.multi-cell.row-highlight",Math.abs(d[1]-d[0]),this.yBandwidth),this.determineDividerStatus()&&(p.style("stroke-width","1px"),this.parent.select("g.cell-highlight").classed("cell-2",!0)),this.addEventListener()}createOuterBox(t,n,r){const i=k.appendOrSelect(this.parent,t).classed("shadows",!0).classed("highlighter-hidden",!0);k.appendOrSelect(i,"line.top").attr("x1",-1).attr("x2",n+1),k.appendOrSelect(i,"line.left").attr("x1",0).attr("y1",-1).attr("x2",0).attr("y2",r+1),k.appendOrSelect(i,"line.down").attr("x1",-1).attr("x2",n+1).attr("y1",r).attr("y2",r),k.appendOrSelect(i,"line.right").attr("x1",n).attr("x2",n).attr("y1",-1).attr("y2",r+1)}determineDividerStatus(){const t=y(this.getOptions(),"heatmap","divider","state");return t!==Xr.OFF&&(t===Xr.AUTO&&Lg.minCellDividerDimension<=this.xBandwidth&&Lg.minCellDividerDimension<=this.yBandwidth||t===Xr.ON)}addEventListener(){const t=this,{cartesianScales:n}=this.services,r=this.getOptions(),i=yt(r,"locale.translations.total")||yt(r,"tooltip.totalLabel")||"Total",s=n.getDomainIdentifier(),a=n.getRangeIdentifier(),o=n.getDomainLabel(),l=n.getRangeLabel();this.parent.selectAll("g.cell").on("mouseover",function(c,u){const d=I(this),h=d.select("rect.heat");if(!h.classed("null-state")){const p=ss(d.attr("transform"));t.parent.select("g.cell-highlight").attr("transform",`translate(${p.x+t.translationUnits.x}, ${p.y+t.translationUnits.y})`).classed("highlighter-hidden",!1),t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOVER,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:c,items:[{label:o,value:u[s]},{label:l,value:u[a]},{label:i,value:u.value,color:h.style("fill")}]})}}).on("mousemove",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEMOVE,{event:c,element:I(this),datum:u}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:c})}).on("click",function(c,u){t.services.events.dispatchEvent(T.Heatmap.HEATMAP_CLICK,{event:c,element:I(this),datum:u})}).on("mouseout",function(c,u){const h=I(this).select("rect.heat"),f=h.classed("null-state");t.parent.select("g.cell-highlight").classed("highlighter-hidden",!0),f||(t.services.events.dispatchEvent(T.Heatmap.HEATMAP_MOUSEOUT,{event:c,element:h,datum:u}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{event:c,hoveredElement:h}))})}destroy(){this.parent.selectAll("rect.heat").on("mouseover",null).on("mousemove",null).on("click",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleAxisOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleAxisMouseOut)}}class S2 extends mt{constructor(){super(...arguments),this.type="histogram",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-bar"})).attr("opacity",s=>s[i]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"histogram bars"}),r=this.model.getOptions(),{groupIdentifier:i}=r,{groupMapsTo:s}=r.data,a=this.model.getBinnedStackedData(),o=this.services.cartesianScales.getMainXScale(),l=n.selectAll("g.bars").data(a,u=>yt(u,`0.${s}`));l.exit().attr("opacity",0).remove(),l.enter().append("g").classed("bars",!0).attr("role",ft.GROUP);const c=n.selectAll("g.bars").selectAll("path.bar").data(u=>u);c.exit().remove(),c.enter().append("path").merge(c).classed("bar",!0).attr(i,(u,d)=>d).transition().call(u=>this.services.transitions.setupTransition({transition:u,name:"histogram-bar-update-enter",animate:t})).attr("class",u=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:u[s],originalClassName:"bar"})).style("fill",u=>this.model.getFillColor(u[s],null,u)).attr("d",u=>{const d=yt(u,"data");if(!d)return;const h=o(d.x1)-o(d.x0)-1,f=this.services.cartesianScales.getDomainValue(d.x0),p=f+h,g=this.services.cartesianScales.getRangeValue(u[0]);let m=this.services.cartesianScales.getRangeValue(u[1]);return Math.abs(m-g)>0&&Math.abs(m-g)>r.bars.dividerSize&&(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?m+=1:m-=1),ie({x0:f,x1:p,y0:g,y1:m},this.services.cartesianScales.getOrientation())}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",u=>y(u,"data",u[s])),this.addEventListeners()}addEventListeners(){const t=this.model.getOptions(),{groupMapsTo:n}=t.data,{code:r,number:i}=y(t,"locale"),s=this;this.parent.selectAll("path.bar").on("mouseover",function(a,o){const l=I(this);l.classed("hovered",!0);const c=i(parseFloat(yt(o,"data.x0")),r),u=i(parseFloat(yt(o,"data.x1")),r),d=s.services.cartesianScales.getRangeAxisPosition(),h=s.services.cartesianScales.getScaleLabel(d);s.services.events.dispatchEvent(T.Tooltip.SHOW,{event:a,hoveredElement:l,items:[{label:yt(t,"bins.rangeLabel")||"Range",value:`${c} – ${u}`},{label:t.tooltip.groupLabel||"Group",value:o[n],class:s.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:o[n]})},{label:h,value:yt(o,`data.${o[n]}`)}]})}).on("mousemove",function(a){s.services.events.dispatchEvent(T.Tooltip.MOVE,{event:a})}).on("mouseout",function(){I(this).classed("hovered",!1),s.services.events.dispatchEvent(T.Tooltip.HIDE)})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class _2 extends cn{constructor(){super(...arguments),this.type="lollipop",this.renderType=at.SVG,this.handleScatterOnHover=t=>{const n=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").attr("stroke-width",s=>s[i]!==n.datum[i]?wn.weight.unselected:wn.weight.selected)},this.handleScatterOnMouseOut=()=>{this.parent.selectAll("line.line").attr("stroke-width",wn.weight.unselected)},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("line.line").transition("legend-hover-line").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-line"})).attr("opacity",s=>s[i]!==n.datum().name?wn.opacity.unselected:wn.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("line.line").transition("legend-mouseout-line").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-line"})).attr("opacity",wn.opacity.selected)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"lines",withinChartClip:!0}),r=this.model.getOptions(),{groupMapsTo:i}=r.data,{cartesianScales:s}=this.services,a=s.getMainXScale(),o=s.getMainYScale(),l=s.getDomainIdentifier(),c=v=>s.getDomainValue(v),u=v=>s.getRangeValue(v),d=s.getOrientation(),[h,f]=Cn(c,u,d),p=n.selectAll("line.line").data(this.getScatterData(),v=>`${v[i]}-${v[l]}`);p.exit().attr("opacity",0).remove();const m=p.enter().append("line").attr("opacity",0).merge(p).classed("line",!0).attr("class",v=>this.model.getColorClassName({classNameTypes:[lt.STROKE],dataGroupName:v[i],originalClassName:"line"})).transition().call(v=>this.services.transitions.setupTransition({transition:v,name:"lollipop-line-update-enter",animate:t})).style("stroke",v=>this.model.getFillColor(v[i],v[l],v)).attr("opacity",1);d===Ht.HORIZONTAL?m.attr("y1",f).attr("y2",f).attr("x1",a.range()[0]).attr("x2",v=>h(v)-r.points.radius):m.attr("x1",h).attr("x2",h).attr("y1",o.range()[0]).attr("y2",v=>f(v)+r.points.radius),this.addScatterPointEventListeners()}addScatterPointEventListeners(){this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),this.services.events.addEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}destroy(){const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut),t.removeEventListener(T.Scatter.SCATTER_MOUSEOVER,this.handleScatterOnHover),t.removeEventListener(T.Scatter.SCATTER_MOUSEOUT,this.handleScatterOnMouseOut)}}class T2 extends mt{constructor(){super(...arguments),this.type="meter",this.renderType=at.SVG}getStackedBounds(t,n){let r=0;return t.map((s,a)=>a!==0?(r+=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:r-n(s.value)}):(r=n(s.value),{...s,width:Math.abs(n(s.value)-Zt.dividerWidth),x:0}))}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"meter lines"}),i=this.getOptions(),s=y(i,"meter","proportional"),a=this.model.getDisplayData(),o=this.model.getStatus(),{width:l}=k.getSVGElementSize(r,{useAttrs:!0}),{groupMapsTo:c}=i.data;let u;if(y(i,"meter","proportional")===null)u=100;else{const E=y(i,"meter","proportional","total");u=E||this.model.getMaximumDomain(this.model.getDisplayData())}const d=Ge().domain([0,u]).range([0,l]),h=this.getStackedBounds(a,d),f=y(i,"meter","height");k.appendOrSelect(r,"rect.container").attr("x",0).attr("y",0).attr("width",l).attr("height",f||(s?Zt.height.proportional:Zt.height.default)),k.appendOrSelect(r,"line.rangeIndicator").attr("x1",l).attr("x2",l).attr("y1",0).attr("y2",f||(s?Zt.height.proportional:Zt.height.default));const p=r.selectAll("rect.value").data(h),g=o!=null&&!n.model.isUserProvidedColorScaleValid()&&!s?`value status--${o}`:"value";p.enter().append("rect").classed("value",!0).merge(p).attr("x",E=>E.x).attr("y",0).attr("height",()=>f||(s?Zt.height.proportional:Zt.height.default)).attr("class",E=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:E[c],originalClassName:g})).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"meter-bar-update",animate:t})).attr("width",E=>E.value>u?d(u):Math.max(E.width,2)).style("fill",E=>n.model.getFillColor(E[c],null,E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","value").attr("aria-label",E=>E.value),p.exit().remove();const m=y(i,"meter","peak");let v=m;m!==null&&(m>u?v=u:m<0&&(v=0));const S=r.selectAll("line.peak").data(v==null?[]:[v]);S.enter().append("line").classed("peak",!0).merge(S).attr("y1",0).attr("y2",()=>f||(s?Zt.height.proportional:Zt.height.default)).transition().call(E=>this.services.transitions.setupTransition({transition:E,name:"peak-line-update",animate:t})).attr("x1",E=>d(E)).attr("x2",E=>d(E)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","peak").attr("aria-label",E=>E),S.exit().remove(),this.services.domUtils.setSVGMaxHeight(),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=y(t,"meter","proportional");this.parent.selectAll("rect.value").on("mouseover",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOVER,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!0),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:a[n],value:a.value}]}))}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEMOVE,{event:s,element:o,datum:a}),i&&r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.Meter.METER_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.Meter.METER_MOUSEOUT,{event:s,element:o,datum:a}),i&&(o.classed("hovered",!1),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o}))})}destroy(){this.parent.selectAll("rect.value").on("mouseover",null).on("mousemove",null).on("mouseout",null).on("click",null)}}function gv(e){const t=O2(mv(e),360);return Hn(t,[0,10])||Hn(t,[350,0])?{textAnchor:rn.START,dominantBaseline:sn.MIDDLE}:Hn(t,[10,80])?{textAnchor:rn.START,dominantBaseline:sn.HANGING}:Hn(t,[80,100])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.HANGING}:Hn(t,[100,170])?{textAnchor:rn.END,dominantBaseline:sn.HANGING}:Hn(t,[170,190])?{textAnchor:rn.END,dominantBaseline:sn.MIDDLE}:Hn(t,[190,260])?{textAnchor:rn.END,dominantBaseline:sn.BASELINE}:Hn(t,[260,280])?{textAnchor:rn.MIDDLE,dominantBaseline:sn.BASELINE}:{textAnchor:rn.START,dominantBaseline:sn.BASELINE}}function O2(e,t){return(e%t+t)%t}function Hn(e,[t,n]){return e>=t&&e<=n}function mv(e){return e*(180/Math.PI)}function Ft(e,t,n={x:0,y:0}){const r=t*Math.cos(e)+n.x,i=t*Math.sin(e)+n.y;return{x:isNaN(r)?0:r,y:isNaN(i)?0:i}}function w2(e,t){return t*Math.sin(e-Math.PI/2)}class M2 extends mt{constructor(){super(...arguments),this.type="radar",this.renderType=at.SVG,this.getLabelDimensions=t=>{const n=k.appendOrSelect(this.getComponentContainer(),"g.tmp-tick"),r=k.appendOrSelect(n,"text").text(t),{width:i,height:s}=k.getSVGElementSize(r.node(),{useBBox:!0});return n.remove(),{width:i,height:s}},this.normalizeFlatData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo"),a=BD(this.uniqueKeys.map(o=>this.uniqueGroups.map(l=>({[r]:o,[s]:l,[i]:null}))));return ct(a,t)},this.normalizeGroupedData=t=>{const n=this.getOptions(),{angle:r,value:i}=y(n,"radar","axes"),s=y(n,"data","groupMapsTo");return t.map(({name:a,data:o})=>{const l=this.uniqueKeys.map(c=>({[s]:a,[r]:c,[i]:null}));return{name:a,data:ct(l,o)}})},this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g.blobs path").transition("legend-hover-blob").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-blob"})).style("fill-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:cr.opacity.selected).style("stroke-opacity",r=>r.name!==n.datum().name?cr.opacity.unselected:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g.blobs path").transition("legend-mouseout-blob").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-blob"})).style("fill-opacity",cr.opacity.selected).style("stroke-opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"radar graph"}),{width:r,height:i}=k.getSVGElementSize(n,{useAttrs:!0}),s=this.model.getData(),a=this.model.getGroupedData(),o=this.getOptions(),l=y(o,"data","groupMapsTo"),c=y(o,"radar","axes","value"),{angle:u,value:d}=y(o,"radar","axes"),{xLabelPadding:h,yLabelPadding:f,yTicksNumber:p,minRange:g,xAxisRectHeight:m}=cr;this.uniqueKeys=Array.from(new Set(s.map(A=>A[u]))),this.uniqueGroups=Array.from(new Set(s.map(A=>A[l]))),this.fullDataNormalized=this.normalizeFlatData(s),this.groupedDataNormalized=this.normalizeGroupedData(a);const S=2*(this.getLabelDimensions(this.uniqueKeys[0]).height+f),x=(Math.min(r,i)-S)/2;if(x<=0)return;const _=Ii().domain(this.fullDataNormalized.map(A=>A[u])).range([0,2*Math.PI].map(A=>A-Math.PI/2)),C=kn(this.fullDataNormalized.map(A=>A[d])),D=Ge().domain([C>=0?0:C,Vn(this.fullDataNormalized.map(A=>A[d]))]).range([g,x]).nice(p),B=D.ticks(p),P=(A,G,V)=>this.model.getFillColor(A,G,V),w=V_().angle(A=>_(A[u])+Math.PI/2).radius(A=>D(A[d])).curve(Df),H=this.uniqueKeys.map(A=>{const G=this.getLabelDimensions(A).width,V=w2(_(A),x);return G+V}),M={x:Vn(H)+h,y:i/2},$=k.appendOrSelect(n,"g.y-axes").attr("role",ft.GROUP).selectAll("path").data(B,A=>A),F=A=>this.uniqueKeys.map(G=>({[u]:G,[d]:A}));$.join(A=>A.append("path").attr("opacity",0).attr("transform",`translate(${M.x}, ${M.y})`).attr("fill","none").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_enter",animate:t})).attr("opacity",1).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(F(V)))),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_axes_exit",animate:t})).attr("d",V=>w(F(V))).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-axes").attr("role",ft.GROUP).selectAll("line").data(this.uniqueKeys,A=>A).join(A=>A.append("line").attr("opacity",0).attr("class",G=>`x-axis-${Vr(G)}`).attr("stroke-dasharray","0").attr("x1",G=>Ft(_(G),0,M).x).attr("y1",G=>Ft(_(G),0,M).y).attr("x2",G=>Ft(_(G),0,M).x).attr("y2",G=>Ft(_(G),0,M).y).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_enter",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_update",animate:t})).attr("opacity",1).attr("x1",V=>Ft(_(V),D.range()[0],M).x).attr("y1",V=>Ft(_(V),D.range()[0],M).y).attr("x2",V=>Ft(_(V),D.range()[1],M).x).attr("y2",V=>Ft(_(V),D.range()[1],M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_axes_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.x-labels").attr("role",ft.GROUP).selectAll("text").data(this.uniqueKeys).join(A=>A.append("text").text(G=>G).attr("opacity",0).attr("x",G=>Ft(_(G),D.range()[1]+h,M).x).attr("y",G=>Ft(_(G),D.range()[1]+h,M).y).style("text-anchor",G=>gv(_(G)).textAnchor).style("dominant-baseline",G=>gv(_(G)).dominantBaseline).call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_update",animate:t})).attr("opacity",1).attr("x",V=>Ft(_(V),D.range()[1]+h,M).x).attr("y",V=>Ft(_(V),D.range()[1]+h,M).y).end().finally(()=>{const V=y(o,"radar","alignment"),xt=this.getAlignmentXOffset(V,n,this.getParent());n.attr("x",xt)})),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_x_labels_exit",animate:t})).attr("opacity",0).remove())),k.appendOrSelect(n,"g.blobs").attr("role",ft.GROUP).selectAll("path").data(this.groupedDataNormalized,A=>A.name).join(A=>A.append("path").attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G.name).attr("opacity",0).attr("transform",t?()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`:`translate(${M.x}, ${M.y})`).style("fill",G=>P(G.name,null,G.data)).style("fill-opacity",cr.opacity.selected).style("stroke",G=>P(G.name,null,G.data)).call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_enter",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",`translate(${M.x}, ${M.y})`),V.attr("opacity",1).attr("d",xt=>w(xt.data))}),A=>(A.attr("class",G=>this.model.getColorClassName({classNameTypes:[lt.FILL,lt.STROKE],dataGroupName:G.name,originalClassName:"blob"})).style("fill",G=>P(G.name,null,G.data)).style("stroke",G=>P(G.name,null,G.data)),A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_blobs_update",animate:t})).attr("opacity",1).attr("transform",`translate(${M.x}, ${M.y})`).attr("d",V=>w(V.data))),A),A=>A.call(G=>{const V=G.transition().call(xt=>this.services.transitions.setupTransition({transition:xt,name:"radar_blobs_exit",animate:t}));t&&V.delay(()=>Math.random()*30).attr("transform",()=>`translate(${M.x}, ${M.y}) scale(${1+Math.random()*.35})`),V.attr("opacity",0).remove()})),k.appendOrSelect(n,"g.dots").attr("role",ft.GROUP).selectAll("circle").data(this.fullDataNormalized.filter(A=>y(A,d)!==null)).join(A=>A.append("circle").attr("role",ft.GRAPHICS_SYMBOL).attr("aria-label",G=>G[c]),A=>A,A=>A.remove()).attr("class",A=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:A[l],originalClassName:Vr(A[u])})).attr("cx",A=>Ft(_(A[u]),D(A[d]),M).x).attr("cy",A=>Ft(_(A[u]),D(A[d]),M).y).attr("r",0).attr("opacity",0).style("fill",A=>P(A[l])),k.appendOrSelect(n,"g.x-axes-rect").attr("role",ft.GROUP).selectAll("rect").data(this.uniqueKeys).join(A=>A.append("rect"),A=>A,A=>A.remove()).attr("x",M.x).attr("y",M.y-m/2).attr("width",D.range()[1]).attr("height",m).style("fill","red").style("fill-opacity",0).attr("transform",A=>`rotate(${mv(_(A))}, ${M.x}, ${M.y})`);const{code:ht,number:W}=y(o,"locale");k.appendOrSelect(n,"g.y-labels").attr("role",ft.GROUP).selectAll("text").data(Fe(B)).join(A=>A.append("text").attr("opacity",0).text(G=>W(G,ht)).attr("x",G=>Ft(-Math.PI/2,D(G),M).x+f).attr("y",G=>Ft(-Math.PI/2,D(G),M).y).style("text-anchor","start").style("dominant-baseline","middle").call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_enter",animate:t})).attr("opacity",1)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_update",animate:t})).text(V=>V).attr("opacity",1).attr("x",V=>Ft(-Math.PI/2,D(V),M).x+f).attr("y",V=>Ft(-Math.PI/2,D(V),M).y)),A=>A.call(G=>G.transition().call(V=>this.services.transitions.setupTransition({transition:V,name:"radar_y_labels_exit",animate:t})).attr("opacity",0).remove())),this.addEventListeners()}getAlignmentXOffset(t,n,r){const i=k.getSVGElementSize(n,{useBBox:!0}),{width:s}=k.getSVGElementSize(r,{useAttrs:!0});let a=0;return t===Gt.CENTER?a=Math.floor((s-i.width)/2):t===Gt.RIGHT&&(a=s-i.width),a}destroy(){this.parent.selectAll(".x-axes-rect > rect").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}addEventListeners(){const t=this,{axes:{angle:n}}=y(this.getOptions(),"radar");this.parent.selectAll(".x-axes-rect > rect").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOVER,{event:r,element:s,datum:i});const a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`),l=t.model.getActiveDataGroupNames(),c=t.getOptions(),{groupMapsTo:u}=c.data,d=y(c,"radar","axes","value");a.classed("hovered",!0).attr("stroke-dasharray","4 4"),o.classed("hovered",!0).attr("opacity",f=>l.indexOf(f[u])!==-1?1:0).attr("r",cr.dotsRadius);const h=t.fullDataNormalized.filter(f=>f[n]===i&&l.indexOf(f[u])!==-1);t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:r,hoveredElement:s,items:h.filter(f=>typeof f[d]=="number").map(f=>({label:f[u],value:f[d],color:t.model.getFillColor(f[u],null,f),class:t.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:f[u]})}))})}).on("mousemove",function(r,i){const s=I(this);t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEMOVE,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(T.Radar.X_AXIS_CLICK,{event:r,element:I(this),datum:i})}).on("mouseout",function(r,i){const s=I(this),a=t.parent.select(`.x-axes .x-axis-${Vr(i)}`),o=t.parent.selectAll(`.dots circle.${Vr(i)}`);a.classed("hovered",!1).attr("stroke-dasharray","0"),o.classed("hovered",!1).attr("opacity",0).attr("r",0),t.services.events.dispatchEvent(T.Radar.X_AXIS_MOUSEOUT,{event:r,element:s,datum:i}),t.services.events.dispatchEvent(T.Tooltip.HIDE)})}}class vv extends Cu{constructor(){super(...arguments),this.type="simple-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-simple-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-simple-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-simple-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-simple-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getComponentContainer({ariaLabel:"bar graphs",withinChartClip:!0}),s=this.model.getDisplayData(this.configs.groups),a=this.services.cartesianScales.getOrientation(),o=i.selectAll("path.bar").data(s,c=>c[r]);o.exit().attr("opacity",0).remove(),o.enter().append("path").attr("opacity",0).merge(o).classed("bar",!0).attr("width",this.getBarWidth.bind(this)).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[r],originalClassName:"bar"})).style("fill",c=>{const u=this.services.cartesianScales.getDomainIdentifier(c);return this.model.getFillColor(c[r],c[u],c)}).attr("d",c=>{const u=this.services.cartesianScales.getRangeIdentifier(),d=this.getBarWidth(),h=c[u],f=this.services.cartesianScales.getDomainValue(c)-d/2,p=f+d;let g,m;if(Array.isArray(h)&&h.length===2)g=this.services.cartesianScales.getRangeValue(h[0]),m=this.services.cartesianScales.getRangeValue(h[1]);else{const E=this.services.cartesianScales.getRangeScale().domain()[0];g=this.services.cartesianScales.getRangeValue(Math.max(0,E)),m=this.services.cartesianScales.getRangeValue(c)}const v=Math.abs(m-g);if(v!==0&&v<2&&(h>0&&a===Ht.VERTICAL||h<0&&a===Ht.HORIZONTAL?m=g-2:m=g+2),!this.isOutsideZoomedDomain(f,p))return ie({x0:f,x1:p,y0:g,y1:m},a)}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c.value),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("path.bar").on("mouseover",function(n,r){const i=I(this);i.classed("hovered",!0),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,data:[r]})}).on("mousemove",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:n,element:I(this),datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1),t.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class C2 extends ce{constructor(){super(...arguments),this.type="skeleton-lines"}render(t=!0){const n=y(this.getOptions(),"data","loading"),r=!y(this.getOptions(),"grid","x","enabled")&&!y(this.getOptions(),"grid","y","enabled")&&!y(this.getOptions(),"axes","bottom","visible")&&!y(this.getOptions(),"axes","left","visible");n&&!r?super.renderGridSkeleton(n):n&&r?this.renderSparklineSkeleton(n):this.removeSkeleton()}renderSparklineSkeleton(t){this.setScales(),this.drawBackdrop(t),this.drawSparkline(t),this.updateBackdropStyle(),t&&this.setShimmerEffect("shimmer-lines")}drawSparkline(t){const n=this.backdrop.attr("width"),r=[100],i=k.appendOrSelect(this.backdrop,"g.y.skeleton"),s=i.selectAll("line").data(r);s.enter().append("line").merge(s).attr("x1",0).attr("x2",n).attr("y1",a=>a).attr("y2",a=>a),i.selectAll("line").classed("shimmer-effect-lines",t).classed("empty-state-lines",!t).style("stroke",t?`url(#${this.services.domUtils.generateElementIDString("shimmer-lines")})`:null)}updateBackdropStyle(){const t=this.parent;this.backdrop=k.appendOrSelect(t,"svg.chart-skeleton.DAII").attr("role","presentation"),k.appendOrSelect(this.backdrop,"rect.chart-skeleton-backdrop").classed("shimmer-effect-lines",!1).classed("shimmer-effect-sparkline",!0).style("stroke",null)}}class yv extends mt{constructor(){super(...arguments),this.type="area-stacked",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,r=this.getOptions(),{groupMapsTo:i}=r.data;this.parent.selectAll("path.area").transition("legend-hover-area").call(s=>this.services.transitions.setupTransition({transition:s,name:"legend-hover-area"})).attr("opacity",s=>y(s,0,i)!==n.datum().name?On.opacity.unselected:On.opacity.selected)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.area").transition("legend-mouseout-area").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-area"})).attr("opacity",On.opacity.selected)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"stacked area graphs",withinChartClip:!0}),r=this,i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(p=>i.axes[p].percentage),o=this.model.getStackedData({percentage:a,groups:this.configs.groups}),l=y(o,0,0),c=this.services.cartesianScales.getDomainAxisPosition({datum:l}),u=this.services.cartesianScales.getRangeAxisPosition({datum:l}),d=this.services.cartesianScales.getScaleByPosition(u),h=n.selectAll("path.area").data(o,p=>y(p,0,s));this.areaGenerator=Yl().x(p=>this.services.cartesianScales.getValueThroughAxisPosition(c,p.data.sharedStackKey)).y0(p=>d(p[0])).y1(p=>d(p[1])).curve(this.services.curves.getD3Curve()),h.exit().attr("opacity",0).remove(),h.enter().append("path").attr("opacity",0).merge(h).data(o,p=>y(p,0,s)).attr("class","area").attr("class",p=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:y(p,0,s),originalClassName:"area"})).style("fill",p=>r.model.getFillColor(y(p,0,s),null,p)).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","area").attr("aria-label",p=>y(p,0,s)).transition().call(p=>this.services.transitions.setupTransition({transition:p,name:"area-update-enter",animate:t})).attr("opacity",On.opacity.selected).attr("d",this.areaGenerator)}}class Ev extends Cu{constructor(){super(...arguments),this.type="stacked-bar",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.model.getOptions().data;this.parent.selectAll("path.bar").transition("legend-hover-bar").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-bar"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("path.bar").transition("legend-mouseout-bar").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-bar"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t){const n=this.getComponentContainer({ariaLabel:"stacked bar graphs",withinChartClip:!0}),r=this.getOptions(),{groupMapsTo:i}=r.data,s=this.model.getStackedData({groups:this.configs.groups,divergent:!0}),a=this.model.getActiveDataGroupNames(),o=n.selectAll("g.bars").data(s,c=>y(c,0,i));o.exit().attr("opacity",0).remove(),o.enter().append("g").classed("bars",!0).attr("role",ft.GROUP).attr("data-name","bars");const l=n.selectAll("g.bars").selectAll("path.bar").data(c=>c,c=>c.data.sharedStackKey);l.exit().remove(),l.enter().append("path").merge(l).classed("bar",!0).transition().call(c=>this.services.transitions.setupTransition({transition:c,name:"bar-update-enter",animate:t})).attr("class",c=>this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:c[i],originalClassName:"bar"})).style("fill",c=>this.model.getFillColor(c[i],c.data.sharedStackKey,c.data)).attr("d",c=>{const u=c.data.sharedStackKey,d=this.getBarWidth(),h=this.services.cartesianScales.getDomainValue(u)-d/2,f=h+d,p=this.services.cartesianScales.getRangeValue(c[0]);let g=this.services.cartesianScales.getRangeValue(c[1]);if(!this.isOutsideZoomedDomain(h,f)){if(Math.abs(g-p)>0&&Math.abs(g-p)>r.bars.dividerSize){const m=c[0]<0&&c[1]<=0;m&&a.length>1?this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=c[1]===0?2:1:g-=1:m||(this.services.cartesianScales.getOrientation()===Ht.VERTICAL?g+=1:g-=1)}return ie({x0:h,x1:f,y0:p,y1:g},this.services.cartesianScales.getOrientation())}}).attr("opacity",1).attr("role",ft.GRAPHICS_SYMBOL).attr("aria-roledescription","bar").attr("aria-label",c=>c[1]-c[0]),this.addEventListeners()}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this;this.parent.selectAll("path.bar").on("mouseover",function(i,s){const a=I(this);a.classed("hovered",!0),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOVER,{event:i,element:a,datum:s});let l=r.model.getDisplayData(r.configs.groups).find(c=>{const u=r.services.cartesianScales.getDomainIdentifier(c),d=r.services.cartesianScales.getRangeIdentifier(c);return c[d]===s.data[s[n]]&&c[u].toString()===s.data.sharedStackKey&&c[n]===s[n]});if(l===void 0){const c=r.services.cartesianScales.getDomainIdentifier(),u=r.services.cartesianScales.getRangeIdentifier();l={[c]:s.data.sharedStackKey,[u]:s.data[s[n]],[n]:s[n]}}r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:i,hoveredElement:a,data:[l]})}).on("mousemove",function(i,s){const a=I(this);r.services.events.dispatchEvent(T.Bar.BAR_MOUSEMOVE,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:i})}).on("click",function(i,s){r.services.events.dispatchEvent(T.Bar.BAR_CLICK,{event:i,element:I(this),datum:s})}).on("mouseout",function(i,s){const a=I(this);a.classed("hovered",!1),r.services.events.dispatchEvent(T.Bar.BAR_MOUSEOUT,{event:i,element:a,datum:s}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:a})})}getBarWidth(){const t=this.getOptions();if(y(t,"bars","width"))return t.bars.width;const n=this.services.cartesianScales.getMainXScale(),r=k.getSVGElementSize(this.parent,{useAttrs:!0}).width,i=this.model.getStackKeys().length,s=y(t,"bars","spacingFactor");return n.step?Math.min(t.bars.maxWidth,n.step()/2):Math.min(t.bars.maxWidth,r*s/i)}destroy(){this.parent.selectAll("path.bar").on("mouseover",null).on("mousemove",null).on("mouseout",null);const t=this.services.events;t.removeEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.removeEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}}class xv extends cn{constructor(){super(...arguments),this.type="scatter-stacked",this.renderType=at.SVG}render(t){if(!y(this.getOptions(),"points","enabled"))return;const r=this.getComponentContainer({ariaLabel:"scatter points",withinChartClip:!0}),i=this.getOptions(),{groupMapsTo:s}=i.data,a=Object.keys(i.axes).some(f=>i.axes[f].percentage),o=this.model.getStackedData({groups:this.configs.groups,percentage:a}),l=r.selectAll("g.dots").data(o,f=>y(f,0,s));l.exit().attr("opacity",0).remove();const u=l.enter().append("g").classed("dots",!0).attr("role",ft.GROUP).merge(l).selectAll("circle.dot").data(f=>f);u.exit().attr("opacity",0).remove();const h=u.enter().append("circle").classed("dot",!0).attr("opacity",0).merge(u).datum(f=>{const p=f[s],g=this.services.cartesianScales.getDomainIdentifier(f),m=this.services.cartesianScales.getRangeIdentifier(f);return{[s]:p,[g]:f.data.sharedStackKey,[m]:f[1]}});this.styleCircles(h,t),this.addEventListeners()}getTooltipData(t,n){const r=this.getOptions(),{groupMapsTo:i}=r.data,s=Object.keys(r.axes).some(l=>r.axes[l].percentage),a=this.model.getStackedData({groups:this.configs.groups,percentage:s}),o=[];return a.forEach((l,c)=>{l.forEach((u,d)=>{const h=u[i],f=u.data.sharedStackKey;let p=u.data[h];const g=u[1],m=this.services.cartesianScales.getDomainIdentifier(u),v=this.services.cartesianScales.getRangeIdentifier(u);p!=null&&t===this.services.cartesianScales.getDomainValue(f)&&n===this.services.cartesianScales.getRangeValue(g)&&(s&&(p=this.model.getStackedData({groups:this.configs.groups})[c][d].data[h]),p!==null&&o.push({[i]:h,[m]:f,[v]:p}))})}),this.model.getDisplayData(this.configs.groups).filter(l=>{const c=this.services.cartesianScales.getDomainIdentifier(l),u=this.services.cartesianScales.getRangeIdentifier(l);return o.find(d=>d[i]==l[i]&&d[c]==l[c]&&d[u]==l[u])!==void 0})}}const xs=6;class A2 extends mt{constructor(){super(...arguments),this.type="tree",this.renderType=at.SVG}getLongestLabel(t){let n="";return t.forEach(r=>{const i=r.children?this.getLongestLabel(r.children):"";(i.length>n.length||r.name.length>n.length)&&(n=i.length>r.name.length?i:r.name)}),n}getMockLabelWidth(t,n){const r=t.append("text").attr("dy","0.31em").attr("x",0).attr("text-anchor","end").text(n),{width:i}=k.getSVGElementSize(r.node(),{useBBox:!0});return r.remove(),i}render(t=!0){const n=this.getComponentContainer({ariaLabel:"tree diagram"});n.html("");const{width:r,height:i}=k.getSVGElementSize(this.parent,{useAttrs:!0});if(r<1||i<1)return;const s=this.model.getOptions(),a=this.model.getDisplayData(),o=y(s,"tree","rootTitle")||"Tree",l=this.getMockLabelWidth(n,o),c=this.getLongestLabel(a),u=this.getMockLabelWidth(n,c),d={left:l>0?l+xs:30-xs},h=Di({name:o,children:a}),f=10,p=r/6,g=_=>{const C=h.descendants().reverse(),D=h.links();let B=h,P=h;h.eachBefore(L=>{L.x<B.x&&(B=L),L.x>P.x&&(P=L)});const w=P.x-B.x,H=n.transition().call(L=>this.services.transitions.setupTransition({transition:L,name:"tree-update-viewbox",animate:!0})).attr("viewBox",[-d.left,B.x,r,w].join(" ")),N=x.selectAll("g").data(C,L=>L.id),M=this,O=N.enter().append("g").attr("transform",()=>`translate(${_.y0},${_.x0})`).attr("class",L=>L.depth!==0&&L.children&&L.children.length>0?"clickable":null).on("mouseover",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOVER,{event:L,element:I(this),datum:U})}).on("click",function(L,U){U.depth!==0&&(U.children=U.children?null:U._children,g(U)),M.services.events.dispatchEvent(T.Tree.NODE_CLICK,{event:L,element:I(this),datum:U})}).on("mouseout",function(L,U){M.services.events.dispatchEvent(T.Tree.NODE_MOUSEOUT,{event:L,element:I(this),datum:U})});O.append("circle").attr("r",2.5).attr("class",L=>L._children?"parent":"child").attr("stroke-width",10),O.append("text").attr("dy","0.31em").attr("x",L=>L._children?-6:xs).attr("text-anchor",L=>L._children?"end":"start").text(L=>L.data.name).clone(!0).attr("class","text-stroke").lower(),N.merge(O).transition(H).attr("transform",L=>`translate(${L.y},${L.x})`).attr("fill-opacity",1).attr("stroke-opacity",1),N.exit().transition(H).remove().attr("transform",()=>`translate(${_.y},${_.x})`).attr("fill-opacity",0).attr("stroke-opacity",0);const $=b.selectAll("path").data(D,L=>L.target.id),F=$.enter().append("path").attr("d",()=>{const L={x:_.x0,y:_.y0};return E({source:L,target:L})});$.merge(F).transition(H).attr("d",E),$.exit().transition(H).remove().attr("d",()=>{const L={x:_.x,y:_.y};return E({source:L,target:L})}),h.eachBefore(L=>{L.x0=L.x,L.y0=L.y})},m=h.descendants(),v=m[m.length-1].depth,S=y(s,"tree","type")===Wa.DENDROGRAM?ub().size([i,r-u-v*xs-l]):Kb().nodeSize([f,p]).size([i,r-u-v*xs-l]),E=Z_().x(_=>_.y).y(_=>_.x);h.x0=p/2,h.y0=0,h.descendants().forEach((_,C)=>{_.id=C,_._children=_.children}),S(h),n.attr("viewBox",[-d.left,-0,r,f]).style("user-select","none");const b=n.append("g").attr("class","links"),x=n.append("g").attr("class","nodes");g(h)}}var D2="#000000",L2="#ffffff",R2="#fcf4d6",I2="#fddc69",k2="#f1c21b",P2="#d2a106",N2="#b28600",$2="#8e6a00",F2="#684e00",U2="#483700",B2="#302400",H2="#1c1500",G2={10:R2,20:I2,30:k2,40:P2,50:N2,60:$2,70:F2,80:U2,90:B2,100:H2},V2="#fff2e8",z2="#ffd9be",W2="#ffb784",Y2="#ff832b",q2="#eb6200",X2="#ba4e00",Z2="#8a3800",j2="#5e2900",K2="#3e1a00",Q2="#231000",J2={10:V2,20:z2,30:W2,40:Y2,50:q2,60:X2,70:Z2,80:j2,90:K2,100:Q2},tP="#fff1f1",eP="#ffd7d9",nP="#ffb3b8",rP="#ff8389",iP="#fa4d56",sP="#da1e28",aP="#a2191f",oP="#750e13",lP="#520408",cP="#2d0709",uP={10:tP,20:eP,30:nP,40:rP,50:iP,60:sP,70:aP,80:oP,90:lP,100:cP},hP="#fff0f7",dP="#ffd6e8",fP="#ffafd2",pP="#ff7eb6",gP="#ee5396",mP="#d02670",vP="#9f1853",yP="#740937",EP="#510224",xP="#2a0a18",bP={10:hP,20:dP,30:fP,40:pP,50:gP,60:mP,70:vP,80:yP,90:EP,100:xP},SP="#f6f2ff",_P="#e8daff",TP="#d4bbff",OP="#be95ff",wP="#a56eff",MP="#8a3ffc",CP="#6929c4",AP="#491d8b",DP="#31135e",LP="#1c0f30",RP={10:SP,20:_P,30:TP,40:OP,50:wP,60:MP,70:CP,80:AP,90:DP,100:LP},IP="#edf5ff",kP="#d0e2ff",PP="#a6c8ff",NP="#78a9ff",$P="#4589ff",FP="#0f62fe",UP="#0043ce",BP="#002d9c",HP="#001d6c",GP="#001141",VP={10:IP,20:kP,30:PP,40:NP,50:$P,60:FP,70:UP,80:BP,90:HP,100:GP},zP="#e5f6ff",WP="#bae6ff",YP="#82cfff",qP="#33b1ff",XP="#1192e8",ZP="#0072c3",jP="#00539a",KP="#003a6d",QP="#012749",JP="#061727",tN={10:zP,20:WP,30:YP,40:qP,50:XP,60:ZP,70:jP,80:KP,90:QP,100:JP},eN="#d9fbfb",nN="#9ef0f0",rN="#3ddbd9",iN="#08bdba",sN="#009d9a",aN="#007d79",oN="#005d5d",lN="#004144",cN="#022b30",uN="#081a1c",hN={10:eN,20:nN,30:rN,40:iN,50:sN,60:aN,70:oN,80:lN,90:cN,100:uN},dN="#defbe6",fN="#a7f0ba",pN="#6fdc8c",gN="#42be65",mN="#24a148",vN="#198038",yN="#0e6027",EN="#044317",xN="#022d0d",bN="#071908",SN={10:dN,20:fN,30:pN,40:gN,50:mN,60:vN,70:yN,80:EN,90:xN,100:bN},_N="#f2f4f8",TN="#dde1e6",ON="#c1c7cd",wN="#a2a9b0",MN="#878d96",CN="#697077",AN="#4d5358",DN="#343a3f",LN="#21272a",RN="#121619",IN={10:_N,20:TN,30:ON,40:wN,50:MN,60:CN,70:AN,80:DN,90:LN,100:RN},kN="#f4f4f4",PN="#e0e0e0",NN="#c6c6c6",$N="#a8a8a8",FN="#8d8d8d",UN="#6f6f6f",BN="#525252",HN="#393939",GN="#262626",VN="#161616",zN={10:kN,20:PN,30:NN,40:$N,50:FN,60:UN,70:BN,80:HN,90:GN,100:VN},WN="#f7f3f2",YN="#e5e0df",qN="#cac5c4",XN="#ada8a8",ZN="#8f8b8b",jN="#726e6e",KN="#565151",QN="#3c3838",JN="#272525",t$="#171414",e$={10:WN,20:YN,30:qN,40:XN,50:ZN,60:jN,70:KN,80:QN,90:JN,100:t$},bv={black:{100:D2},blue:VP,coolGray:IN,cyan:tN,gray:zN,green:SN,magenta:bP,orange:J2,purple:RP,red:uP,teal:hN,warmGray:e$,white:{0:L2},yellow:G2};const n$=e=>{if(!e)return null;for(const t of Object.keys(bv)){const n=bv[t];for(const r of Object.keys(n))if(n[+r]===e)return r}return null},Sv=function(e){const t=I(this.parentNode).select("rect.leaf"),n=e.backgroundColor??getComputedStyle(t.node(),null).getPropertyValue("fill"),r=dn(n);let i;if(r&&(i=n$(r?r.hex():null)),i==null){const s=hh(r).l;i=Math.abs(s*100-100)}return i>50?"white":"black"};let r$=0;class i$ extends mt{constructor(){super(...arguments),this.type="treemap",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail;this.parent.selectAll("g[data-name='leaf']").transition("legend-hover-treemap").call(r=>this.services.transitions.setupTransition({transition:r,name:"legend-hover-treemap"})).attr("opacity",r=>r.parent.data.name===n.datum().name?1:.3)},this.handleLegendMouseOut=()=>{this.parent.selectAll("g[data-name='leaf']").transition("legend-mouseout-treemap").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-treemap"})).attr("opacity",1)}}init(){const{events:t}=this.services;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this.getComponentContainer({ariaLabel:"treemap"});this.model.getData();const r=this.model.getDisplayData(),i=this.model.getOptions(),s=y(window,"location"),{width:a,height:o}=k.getSVGElementSize(n,{useAttrs:!0}),l=Di({name:i.title||"Treemap",children:r}).sum(g=>g.value).sort((g,m)=>m.value-g.value),c=nS().size([a,o]).paddingInner(1).paddingOuter(0).round(!0)(l),u=n.selectAll("g[data-name='leaf']").data(c.leaves(),g=>g.data.name);u.exit().attr("opacity",0).remove();const h=u.enter().append("g").attr("data-name","leaf").attr("data-uid",()=>r$++).merge(u);h.attr("data-name","leaf").transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-group-update",animate:t})).attr("transform",g=>`translate(${g.x0},${g.y0})`);const f=h.selectAll("rect.leaf").data(g=>[g]);f.exit().attr("width",0).attr("height",0).remove(),f.enter().append("rect").classed("leaf",!0).merge(f).attr("width",0).attr("height",0).attr("id",function(){const g=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-leaf-${g}`}).attr("class",g=>{for(;g.depth>1;)g=g.parent;return this.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:g.data.name,originalClassName:"leaf"})}).transition().call(g=>this.services.transitions.setupTransition({transition:g,name:"treemap-leaf-update-enter",animate:t})).attr("width",g=>g.x1-g.x0).attr("height",g=>g.y1-g.y0).style("fill",g=>{for(;g.depth>1;)g=g.parent;return this.model.getFillColor(g.data.name,null,g.data)}),h.selectAll("clipPath").data(g=>g.data.showLabel!==!0?[]:[1],g=>g).join(g=>g.append("clipPath").attr("id",function(){const m=I(this.parentNode).attr("data-uid");return`${i.style.prefix}-clip-${m}`}).append("use").attr("xlink:href",function(){const m=I(this.parentNode.parentNode).attr("data-uid"),v=`${i.style.prefix}-leaf-${m}`;return new URL(`#${v}`,s)+""}),g=>null,g=>g.remove()),h.selectAll("text").data(g=>{if(g.data.showLabel!==!0)return[];let m=g;for(;m.depth>1;)m=m.parent;return[{text:g.data.name,backgroundColor:this.model.getFillColor(m.data.name)}]},g=>g).join(g=>{const m=g.append("text").text(v=>v.text).style("fill",Sv).attr("x",7).attr("y",18);return s&&m.attr("clip-path",function(){const v=I(this.parentNode).attr("data-uid"),S=`${i.style.prefix}-clip-${v}`;return`url(${new URL(`#${S}`,s)+""})`}),m},g=>g.text(m=>m.text).style("fill",Sv),g=>g.remove()),this.addEventListeners()}addEventListeners(){const t=this;this.parent.selectAll("rect.leaf").on("mouseover",function(n,r){const i=I(this);let s=getComputedStyle(this,null).getPropertyValue("fill"),a=r;for(;a.depth>1;)a=a.parent;i.transition("graph_element_mouseover_fill_update").call(o=>t.services.transitions.setupTransition({transition:o,name:"graph_element_mouseover_fill_update"})).style("fill",o=>{const l=t.model.getFillColor(o.parent.data.name,null,o.data);return l&&(s=l),dn(s).darker(.7).toString()}),t.services.events.dispatchEvent(T.Tooltip.SHOW,{event:n,hoveredElement:i,items:[{color:s,label:a.data.name,bold:!0},{label:r.data.name,value:r.data.value}]}),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOVER,{event:n,element:i,datum:r})}).on("mousemove",function(n,r){const i=I(this);t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEMOVE,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.MOVE,{event:n})}).on("click",function(n,r){t.services.events.dispatchEvent(T.Treemap.LEAF_CLICK,{event:n,element:I(this),datum:r})}).on("mouseout",function(n,r){const i=I(this);i.classed("hovered",!1);let s=r;for(;s.depth>1;)s=s.parent;i.transition().call(a=>t.services.transitions.setupTransition({transition:a,name:"graph_element_mouseout_fill_update"})).style("fill",a=>t.model.getFillColor(a.parent.data.name,null,a.data)),t.services.events.dispatchEvent(T.Treemap.LEAF_MOUSEOUT,{event:n,element:i,datum:r}),t.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:i})})}}function s$(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function a$(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var n=function r(){return this instanceof r?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)};n.prototype=t.prototype}else n={};return Object.defineProperty(n,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(n,r,i.get?i:{enumerable:!0,get:function(){return e[r]}})}),n}var o$={value:function(){}};function _v(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new fo(n)}function fo(e){this._=e}function l$(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",i=n.indexOf(".");if(i>=0&&(r=n.slice(i+1),n=n.slice(0,i)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}fo.prototype=_v.prototype={constructor:fo,on:function(e,t){var n=this._,r=l$(e+"",n),i,s=-1,a=r.length;if(arguments.length<2){for(;++s<a;)if((i=(e=r[s]).type)&&(i=c$(n[i],e.name)))return i;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++s<a;)if(i=(e=r[s]).type)n[i]=Tv(n[i],e.name,t);else if(t==null)for(i in n)n[i]=Tv(n[i],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new fo(e)},call:function(e,t){if((i=arguments.length-2)>0)for(var n=new Array(i),r=0,i,s;r<i;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(s=this._[e],r=0,i=s.length;r<i;++r)s[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],i=0,s=r.length;i<s;++i)r[i].value.apply(t,n)}};function c$(e,t){for(var n=0,r=e.length,i;n<r;++n)if((i=e[n]).name===t)return i.value}function Tv(e,t,n){for(var r=0,i=e.length;r<i;++r)if(e[r].name===t){e[r]=o$,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}const u$=a$(Object.freeze(Object.defineProperty({__proto__:null,dispatch:_v},Symbol.toStringTag,{value:"Module"})));var Au,Ov;function h$(){if(Ov)return Au;Ov=1;const e=u$.dispatch,t=Math.PI/180,n={archimedean:g,rectangular:m},r=64,i=2048;Au=function(){var b=[256,256],x=s,_=a,C=l,D=o,B=o,P=c,w=u,H=g,N=[],M=1/0,O=e("word","end"),$=null,F=Math.random,L={},U=S;L.canvas=function(Y){return arguments.length?(U=E(Y),L):U},L.start=function(){var Y=tt(U()),Q=v((b[0]>>5)*b[1]),ut=null,et=N.length,K=-1,nt=[],ht=N.map(function(j,J){return j.text=x.call(this,j,J),j.font=_.call(this,j,J),j.style=D.call(this,j,J),j.weight=B.call(this,j,J),j.rotate=P.call(this,j,J),j.size=~~C.call(this,j,J),j.padding=w.call(this,j,J),j}).sort(function(j,J){return J.size-j.size});return $&&clearInterval($),$=setInterval(W,0),W(),L;function W(){for(var j=Date.now();Date.now()-j<M&&++K<et&&$;){var J=ht[K];J.x=b[0]*(F()+.5)>>1,J.y=b[1]*(F()+.5)>>1,d(Y,J,ht,K),J.hasText&&X(Q,J,ut)&&(nt.push(J),O.call("word",L,J),ut?f(ut,J):ut=[{x:J.x+J.x0,y:J.y+J.y0},{x:J.x+J.x1,y:J.y+J.y1}],J.x-=b[0]>>1,J.y-=b[1]>>1)}K>=et&&(L.stop(),O.call("end",L,nt,ut))}},L.stop=function(){$&&(clearInterval($),$=null);for(const Y of N)delete Y.sprite;return L};function tt(Y){const Q=Y.getContext("2d",{willReadFrequently:!0});Y.width=Y.height=1;const ut=Math.sqrt(Q.getImageData(0,0,1,1).data.length>>2);return Y.width=(r<<5)/ut,Y.height=i/ut,Q.fillStyle=Q.strokeStyle="red",{context:Q,ratio:ut}}function X(Y,Q,ut){b[0],b[1];for(var et=Q.x,K=Q.y,nt=Math.sqrt(b[0]*b[0]+b[1]*b[1]),ht=H(b),W=F()<.5?1:-1,j=-W,J,A,G;(J=ht(j+=W))&&(A=~~J[0],G=~~J[1],!(Math.min(Math.abs(A),Math.abs(G))>=nt));)if(Q.x=et+A,Q.y=K+G,!(Q.x+Q.x0<0||Q.y+Q.y0<0||Q.x+Q.x1>b[0]||Q.y+Q.y1>b[1])&&(!ut||p(Q,ut))&&!h(Q,Y,b[0])){for(var V=Q.sprite,xt=Q.width>>5,Ut=b[0]>>5,st=Q.x-(xt<<4),_t=st&127,Ne=32-_t,Oe=Q.y1-Q.y0,bs=(Q.y+Q.y0)*Ut+(st>>5),Ss,mr=0;mr<Oe;mr++){Ss=0;for(var je=0;je<=xt;je++)Y[bs+je]|=Ss<<Ne|(je<xt?(Ss=V[mr*xt+je])>>>_t:0);bs+=Ut}return!0}return!1}return L.timeInterval=function(Y){return arguments.length?(M=Y??1/0,L):M},L.words=function(Y){return arguments.length?(N=Y,L):N},L.size=function(Y){return arguments.length?(b=[+Y[0],+Y[1]],L):b},L.font=function(Y){return arguments.length?(_=E(Y),L):_},L.fontStyle=function(Y){return arguments.length?(D=E(Y),L):D},L.fontWeight=function(Y){return arguments.length?(B=E(Y),L):B},L.rotate=function(Y){return arguments.length?(P=E(Y),L):P},L.text=function(Y){return arguments.length?(x=E(Y),L):x},L.spiral=function(Y){return arguments.length?(H=n[Y]||Y,L):H},L.fontSize=function(Y){return arguments.length?(C=E(Y),L):C},L.padding=function(Y){return arguments.length?(w=E(Y),L):w},L.random=function(Y){return arguments.length?(F=Y,L):F},L.on=function(){var Y=O.on.apply(O,arguments);return Y===O?L:Y},L};function s(b){return b.text}function a(){return"serif"}function o(){return"normal"}function l(b){return Math.sqrt(b.value)}function c(){return(~~(random()*6)-3)*30}function u(){return 1}function d(b,x,_,C){if(!x.sprite){var D=b.context,B=b.ratio;D.clearRect(0,0,(r<<5)/B,i/B);var P=0,w=0,H=0,N=_.length;for(--C;++C<N;){x=_[C],D.save(),D.font=x.style+" "+x.weight+" "+~~((x.size+1)/B)+"px "+x.font;const J=D.measureText(x.text),A=-Math.floor(J.width/2);let G=(J.width+1)*B,V=x.size<<1;if(x.rotate){var M=Math.sin(x.rotate*t),O=Math.cos(x.rotate*t),$=G*O,F=G*M,L=V*O,U=V*M;G=Math.max(Math.abs($+U),Math.abs($-U))+31>>5<<5,V=~~Math.max(Math.abs(F+L),Math.abs(F-L))}else G=G+31>>5<<5;if(V>H&&(H=V),P+G>=r<<5&&(P=0,w+=H,H=0),w+V>=i)break;D.translate((P+(G>>1))/B,(w+(V>>1))/B),x.rotate&&D.rotate(x.rotate*t),D.fillText(x.text,A,0),x.padding&&(D.lineWidth=2*x.padding,D.strokeText(x.text,A,0)),D.restore(),x.width=G,x.height=V,x.xoff=P,x.yoff=w,x.x1=G>>1,x.y1=V>>1,x.x0=-x.x1,x.y0=-x.y1,x.hasText=!0,P+=G}for(var tt=D.getImageData(0,0,(r<<5)/B,i/B).data,X=[];--C>=0;)if(x=_[C],!!x.hasText){for(var Y=x.width,Q=Y>>5,ut=x.y1-x.y0,et=0;et<ut*Q;et++)X[et]=0;if(P=x.xoff,P==null)return;w=x.yoff;for(var K=0,nt=-1,ht=0;ht<ut;ht++){for(var et=0;et<Y;et++){var W=Q*ht+(et>>5),j=tt[(w+ht)*(r<<5)+(P+et)<<2]?1<<31-et%32:0;X[W]|=j,K|=j}K?nt=ht:(x.y0++,ut--,ht--,w++)}x.y1=x.y0+nt,x.sprite=X.slice(0,(x.y1-x.y0)*Q)}}}function h(b,x,_){_>>=5;for(var C=b.sprite,D=b.width>>5,B=b.x-(D<<4),P=B&127,w=32-P,H=b.y1-b.y0,N=(b.y+b.y0)*_+(B>>5),M,O=0;O<H;O++){M=0;for(var $=0;$<=D;$++)if((M<<w|($<D?(M=C[O*D+$])>>>P:0))&x[N+$])return!0;N+=_}return!1}function f(b,x){var _=b[0],C=b[1];x.x+x.x0<_.x&&(_.x=x.x+x.x0),x.y+x.y0<_.y&&(_.y=x.y+x.y0),x.x+x.x1>C.x&&(C.x=x.x+x.x1),x.y+x.y1>C.y&&(C.y=x.y+x.y1)}function p(b,x){return b.x+b.x1>x[0].x&&b.x+b.x0<x[1].x&&b.y+b.y1>x[0].y&&b.y+b.y0<x[1].y}function g(b){var x=b[0]/b[1];return function(_){return[x*(_*=.1)*Math.cos(_),_*Math.sin(_)]}}function m(b){var x=4,_=x*b[0]/b[1],C=0,D=0;return function(B){var P=B<0?-1:1;switch(Math.sqrt(1+4*P*B)-P&3){case 0:C+=_;break;case 1:D+=x;break;case 2:C-=_;break;default:D-=x;break}return[C,D]}}function v(b){for(var x=[],_=-1;++_<b;)x[_]=0;return x}function S(){return document.createElement("canvas")}function E(b){return typeof b=="function"?b:function(){return b}}return Au}var d$=h$();const f$=s$(d$);class p$ extends mt{constructor(){super(...arguments),this.type="wordcloud",this.renderType=at.SVG,this.handleLegendOnHover=t=>{const{hoveredElement:n}=t.detail,{groupMapsTo:r}=this.getOptions().data;this.parent.selectAll("text.word").transition("legend-hover-wordcloud").call(i=>this.services.transitions.setupTransition({transition:i,name:"legend-hover-wordcloud"})).attr("opacity",i=>i[r]!==n.datum().name?.3:1)},this.handleLegendMouseOut=()=>{this.parent.selectAll("text.word").transition("legend-mouseout-wordcloud").call(t=>this.services.transitions.setupTransition({transition:t,name:"legend-mouseout-wordcloud"})).attr("opacity",1)}}init(){const t=this.services.events;t.addEventListener(T.Legend.ITEM_HOVER,this.handleLegendOnHover),t.addEventListener(T.Legend.ITEM_MOUSEOUT,this.handleLegendMouseOut)}render(t=!0){const n=this,r=this.getComponentContainer({ariaLabel:"word cloud"}).attr("width","100%").attr("height","100%"),i=this.model.getDisplayData(),s=this.getFontSizeScale(i),a=this.getOptions(),{fontSizeMapsTo:o,wordMapsTo:l}=a.wordCloud,{groupMapsTo:c}=a.data,{width:u,height:d}=k.getSVGElementSize(r,{useAttrs:!0});if(u===0||d===0)return;const h=f$().size([u,d]).words(i.map(function(p){const g=p[o];if(typeof p[o]!="number")throw Error("Badly formatted WordCloud data. `value` should only be an integer or float");return{[c]:p[c],text:p[l],size:g,value:g}})).padding(5).rotate(0).fontSize(p=>s(p.size)).on("end",f);h.start();function f(p){const g=k.appendOrSelect(r,"g.words");g.attr("transform",`translate(${h.size()[0]/2}, ${h.size()[1]/2})`);const m=g.selectAll("text").data(p,S=>`${S[c]}-${S.text}`);m.exit().attr("opacity",0).remove(),m.enter().append("text").attr("opacity",0).merge(m).style("font-size",S=>`${S.size}px`).text(function(S){return S.text}).attr("class",S=>n.model.getColorClassName({classNameTypes:[lt.FILL],dataGroupName:S[c],originalClassName:`word ${S.size>32?"light":""}`})).style("fill",S=>n.model.getFillColor(S[c],S.text,S)).attr("text-anchor","middle").transition().call(S=>n.services.transitions.setupTransition({transition:S,name:"wordcloud-text-update-enter",animate:t})).attr("transform",S=>`translate(${S.x}, ${S.y})`).attr("opacity",1)}this.addEventListeners()}getFontSizeScale(t){const n=this.getOptions(),{fontSizeMapsTo:r}=n.wordCloud,i=t.map(l=>l[r]).filter(l=>l),s=k.getHTMLElementSize(this.services.domUtils.getMainContainer()),a=i.length>0,o=a?Fe(i):[1,1];return Ge().domain(o).range(a?n.wordCloud.fontSizeRange(s,t):[4,4])}addEventListeners(){const t=this.getOptions(),{groupMapsTo:n}=t.data,r=this,i=za(s=>{const a=r.parent.selectAll("text.word").transition("wordcloud-word-mouse-highlight").call(o=>r.services.transitions.setupTransition({transition:o,name:"wordcloud-word-mouse-highlight"}));s===null?a.attr("opacity",1):a.attr("opacity",function(){return s===this?1:.3})},6);this.parent.selectAll("text.word").on("mouseover",function(s,a){const o=this;i(o),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOVER,{event:s,element:I(this),datum:a}),r.services.events.dispatchEvent(T.Tooltip.SHOW,{event:s,hoveredElement:o,items:[{label:t.tooltip.wordLabel,value:a.text},{label:t.tooltip.valueLabel,value:a.value},{label:yt(t,"locale.translations.group")||yt(t,"tooltip.groupLabel")||"Group",value:a[n],class:r.model.getColorClassName({classNameTypes:[lt.TOOLTIP],dataGroupName:a[n]})}]})}).on("mousemove",function(s,a){const o=I(this);r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEMOVE,{element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.MOVE,{event:s})}).on("click",function(s,a){r.services.events.dispatchEvent(T.WordCloud.WORD_CLICK,{event:s,element:I(this),datum:a})}).on("mouseout",function(s,a){const o=I(this);i(null),r.services.events.dispatchEvent(T.WordCloud.WORD_MOUSEOUT,{event:s,element:o,datum:a}),r.services.events.dispatchEvent(T.Tooltip.HIDE,{hoveredElement:o})})}}class g$ extends mt{constructor(){super(...arguments),this.type="geo",this.renderType=at.SVG}render(){const t=this.getComponentContainer({withinChartClip:!0}),{width:n,height:r}=k.getSVGElementSize(t,{useAttrs:!0});if(n<1||r<1)return;const i=this.getProjection(),s=y(this.getOptions(),"geoData"),a=this.model.getCombinedData(),o={},l={};Object.keys(a).forEach(v=>{typeof a[v].value=="number"?o[v]=a[v]:l[v]=a[v]});const c=f2(s,Object.values(l)),u=u2(s,{type:"GeometryCollection",geometries:Object.values(o)}),d=i.fitSize([n,r],u),h=Nx().projection(d);k.appendOrSelect(t,"g.geo").selectAll("path").data(u.features).join("path").attr("d",h);const p=this.services.domUtils.generateElementIDString("geo-pattern-stripes"),g=k.appendOrSelect(t,"defs");k.appendOrSelect(g,"pattern").attr("id",p).attr("width",5).attr("height",10).attr("patternUnits","userSpaceOnUse").attr("patternTransform","rotate(45)").append("path").classed("pattern-fill",!0).attr("d",Bi()([[0,0],[0,10]]));const m=k.appendOrSelect(t,"g.missing-data");k.appendOrSelect(m,"path").datum(c).attr("d",h).style("fill",`url(#${p})`)}getProjection(){let t=null;switch(y(this.getOptions(),"thematic","projection")){case an.geoEqualEarth:t=eb();break;case an.geoAlbers:t=Xx();break;case an.geoConicEqualArea:t=Dd();break;case an.geoConicEquidistant:t=Jx();break;case an.geoEquirectangular:t=Kx();break;case an.geoMercator:t=Zx();break;case an.geoNaturalEarth1:t=nb();break;default:throw new Error("Projection is not supported.")}return t}}class m$ extends g${constructor(){super(...arguments),this.type="choropleth"}render(t=!0){super.render();const n=this.model.getCombinedData(),r=this.getComponentContainer({ariaLabel:"map",withinChartClip:!0}),i=y(this.getOptions(),"color"),s=y(i,"gradient","colors");r.select("g.geo").selectAll("path").classed("border",!0).attr("class",o=>this.model.getColorClassName({value:n[o.properties.NAME].value,originalClassName:"border"})).attr("style",o=>s?`fill: ${this.model.getColorClassName({value:n[o.properties.NAME].value})}`:null),this.addCountryAreaEventListener()}addCountryAreaEventListener(){const t=this,n=this.model.getCombinedData();this.parent.selectAll("path.border").on("mouseover",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOVER,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.SHOW,{event:r,hoveredElement:s,items:[{label:i.properties.NAME,value:n[i.properties.NAME].value}]})}).on("mousemove",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEMOVE,{event:r,element:I(this),datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.MOVE,{event:r})}).on("click",function(r,i){t.services.events.dispatchEvent(Wr.CHOROPLETH_CLICK,{event:r,element:I(this),datum:n[i.properties.NAME]})}).on("mouseout",function(r,i){const s=I(this);t.services.events.dispatchEvent(Wr.CHOROPLETH_MOUSEOUT,{event:r,element:s,datum:n[i.properties.NAME]}),t.services.events.dispatchEvent(zr.HIDE,{event:r,hoveredElement:s})})}}class wv extends Ze{constructor(t,n){super(t,n),this.model=new a2(this.services),this.model.setOptions(It(At.choroplethChart,n.options)),this.init(t,n)}getChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled"),s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"choropleth"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new mu(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new m$(this.model,this.services)];return this.getChartComponents(t)}}class v$ extends on{constructor(t){super(t),this.parentNode=!1,this.set({depth:2},{skipUpdate:!0})}setData(t){super.setData(t),this.setDataGroups(),t.length===1&&(this.parentNode=!0),this.setZoom()}setOptions(t){const n=this.getOptions(),r=ct({},t,this.getZoomOptions(t));jc(n,r);const i=this.getHierarchyLevel(),s=y(n,"circlePack","depth");this.set({options:ct(n,r),depth:s&&s<4?s:i})}getZoomOptions(t){if(!this.getDisplayData())return{};const n=this.getDisplayData(),r=t||this.getOptions(),i=n.length===1&&y(n,0,"children")?y(n,0,"children"):n;let s=this.getHierarchyLevel();return i.some(a=>{if(a.children&&a.children.some(o=>o.children))return s=3,!1}),y(r,"canvasZoom","enabled")===!0&&s>2?{legend:{additionalItems:[{type:zt.ZOOM,name:"Click to zoom"}]}}:null}setZoom(t){this.setOptions(this.getZoomOptions(t))}updateHierarchyLevel(t){this.set({depth:t})}getHierarchyLevel(){return this.get("depth")}hasParentNode(){return this.parentNode}setDataGroups(){const t=this.getData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=t.map(s=>{const a=s[r];return this.setChildrenDataGroup(s,a)});this.set({data:i},{skipUpdate:!0})}setChildrenDataGroup(t,n){return t.children?{...t,dataGroupName:n,children:t.children.map(r=>this.setChildrenDataGroup(r,n))}:{...t,dataGroupName:n}}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Parent","Value"],s=[];return t.forEach(a=>{let o=a.value?a.value:0;a.children&&(o+=this.getChildrenDatums(a.children,a.name,s,0)),s.push(["–",a.name,n(o,r)])}),super.formatTable({headers:i,cells:s})}getChildrenDatums(t,n,r=[],i=0){const s=n,{number:a,code:o}=y(this.getOptions(),"locale");return t.forEach(l=>{const c=l.name;let u=0;if(l.children)l.children.length>0&&(typeof l.value=="number"&&(i+=l.value),u+=this.getChildrenDatums(l.children,c,r,u),r.push([c,s,a(u,o)]),i+=u);else{let d=0;typeof l.value=="number"&&(d=l.value,i+=l.value),r.push([l.name,s,a(d,o)])}}),i}}class y$ extends Ze{constructor(t,n){super(t,n),this.model=new v$(this.services),this.model.setOptions(It(At.circlePackChart,n.options)),this.init(t,n)}getComponents(){const t=[new v2(this.model,this.services)];return this.getChartComponents(t)}}const Mv={[be.LINE]:[ei,cn],[be.SCATTER]:[cn],[be.AREA]:[iv,ei,cn],[be.STACKED_AREA]:[yv,ei,xv,ho],[be.SIMPLE_BAR]:[vv],[be.GROUPED_BAR]:[pv,ni],[be.STACKED_BAR]:[Ev,ho]};class E$ extends ge{constructor(t,n){super(t,n);const r=It(At.comboChart,n.options);n.options.comboChartTypes||(console.error("No comboChartTypes defined for the Combo Chart!"),r.comboChartTypes=[{type:be.LINE,correspondingDatasets:[]}]),this.model.setOptions(r),this.init(t,n)}getGraphComponents(){const{comboChartTypes:t}=this.model.getOptions();let n=0;const r=t.map(i=>{const s=i.type;let a;if(typeof i.type=="string"){if(!Object.keys(Mv).includes(i.type))return console.error(`Invalid chart type "${i.type}" specified for combo chart. Please refer to the ComboChart tutorial for more guidance.`),null;let o=!1;const l=`${aC(i.type)}Chart`;return a=ct({},At[l],this.model.getOptions(),i.options),i.type===be.STACKED_AREA&&(o=!0),Mv[i.type].map(c=>new c(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a,stacked:o}))}else return a=ct({},this.model.getOptions(),i.options),new s(this.model,this.services,{groups:i.correspondingDatasets,id:n++,options:a})}).filter(i=>i!==null);return fc(r)}getComponents(){const{comboChartTypes:t}=this.model.getOptions(),n=t.some(s=>s.type===be.STACKED_BAR||s.type===be.STACKED_AREA),r=[new me(this.model,this.services),new Te(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID}),...n?[]:[new Bn(this.model,this.services)],...this.getGraphComponents()];return this.getAxisChartComponents(r)}}class x$ extends on{constructor(t){super(t)}getTabularData(t){const n=super.getTabularData(t);return t!==n&&n.forEach(r=>{r.key&&r.key!==r.group&&(r.group=r.key)}),n}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{valueMapsTo:i}=n.pie,{number:s,code:a}=y(n,"locale"),o=["Group","Value"],l=[...t.map(c=>[c[r],c[i]===null?"–":s(c[i],a)])];return super.formatTable({headers:o,cells:l})}sanitize(t){return this.getTabularData(t).sort((r,i)=>i.value-r.value)}}class Cv extends Ze{constructor(t,n,r=!1){super(t,n),this.model=new x$(this.services),!r&&(this.model.setOptions(It(At.pieChart,n.options)),this.init(t,n))}getComponents(){const t=[new hv(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}class b$ extends Cv{constructor(t,n){super(t,n,!0),this.model.setOptions(It(At.donutChart,n.options)),this.init(t,n)}getComponents(){const t=[new E2(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.DONUT})];return this.getChartComponents(t)}}class S$ extends on{constructor(t){super(t)}getDataGroups(){return super.getDataGroups().filter(t=>t.name!=="delta")}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,{number:i,code:s}=y(this.getOptions(),"locale"),a=["Group","Value"],o=[...t.map(l=>[l[r],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}}class _$ extends Ze{constructor(t,n){super(t,n),this.model=new S$(this.services),this.model.setOptions(It(At.gaugeChart,n.options)),this.init(t,n)}getComponents(){const t=[new x2(this.model,this.services)];return this.getChartComponents(t)}}class T$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.groupedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new pv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class O$ extends pr{constructor(t){super(t),this.axisFlavor=is.HOVERABLE,this._colorScale=void 0,this._domains=[],this._ranges=[],this._matrix={};const n=y(this.getOptions(),"axes");if(y(n,"left","scaleType")&&y(n,"left","scaleType")!==rt.LABELS||y(n,"right","scaleType")&&y(n,"right","scaleType")!==rt.LABELS||y(n,"top","scaleType")&&y(n,"top","scaleType")!==rt.LABELS||y(n,"bottom","scaleType")&&y(n,"bottom","scaleType")!==rt.LABELS)throw Error("Heatmap only supports label scaletypes.")}getValueDomain(){const t=Fe(this.getDisplayData(),r=>r.value),n=Ge().domain(t).nice().domain();if(n[0]>0)n[0]=0;else if(n[0]===0&&n[1]===0)return[0,1];return n[0]<0&&n[1]>0&&(Math.abs(n[0])>n[1]?n[1]=Math.abs(n[0]):n[0]=-n[1]),n}getFillColor(t){return this._colorScale(t)}getUniqueDomain(){if(We(this._domains)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getDomainIdentifier(),i=n.getMainXAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._domains=Array.from(new Set(t.map(a=>a[r])))}return this._domains}getUniqueRanges(){if(We(this._ranges)){const t=this.getDisplayData(),{cartesianScales:n}=this.services,r=n.getRangeIdentifier(),i=n.getMainYAxisPosition(),s=n.getCustomDomainValuesByposition(i);if(s)return s;this._ranges=Array.from(new Set(t.map(a=>a[r])))}return this._ranges}getMatrix(){if(We(this._matrix)){const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s={};n.forEach(a=>{s[a]={value:null,index:-1}}),t.forEach(a=>{this._matrix[a]=Tn(s)}),this.getDisplayData().forEach((a,o)=>{this._matrix[a[r]][a[i]]={value:a.value,index:o}})}return this._matrix}setData(t){const n=this.sanitize(Tn(t)),r=this.generateDataGroups(n);return this.set({data:n,dataGroups:r}),this._domains=[],this._ranges=[],this._matrix={},n}getMatrixAsArray(){We(this._matrix)&&this.getMatrix();const t=this.getUniqueDomain(),n=this.getUniqueRanges(),r=this.services.cartesianScales.getDomainIdentifier(),i=this.services.cartesianScales.getRangeIdentifier(),s=[];return t.forEach(a=>{n.forEach(o=>{const l={value:this._matrix[a][o].value,index:this._matrix[a][o].index};l[r]=a,l[i]=o,s.push(l)})}),s}getTabularDataArray(){const t=this.getDisplayData(),{primaryDomain:n,primaryRange:r}=this.assignRangeAndDomains(),{number:i,code:s}=y(this.getOptions(),"locale"),a=[n.label,r.label,"Value"],o=[...t.map(l=>[l[n.identifier]===null?"–":l[n.identifier],l[r.identifier]===null?"–":l[r.identifier],l.value===null?"–":i(l.value,s)])];return super.formatTable({headers:a,cells:o})}getColorClassName(t){return`${t.originalClassName} ${this._colorScale(t.value)}`}setColorClassNames(){const t=this.getOptions(),n=y(t,"color","gradient","colors"),r=!We(n);let i=y(t,"color","pairing","option");const s=this.getValueDomain(),a=s[0]<0&&s[1]>0?"diverge":"mono";(i<1&&i>4&&a==="mono"||i<1&&i>2&&a==="diverge")&&(i=1);const o=r?n:[];if(!r){const c=a==="diverge"?17:11;for(let u=1;u<c+1;u++)o.push(`fill-${a}-${i}-${u}`)}this._colorScale=Rl().domain(s).range(o);const l=y(this.getOptions(),"color");this._colorScale=lv(this.getDisplayData(),l)}}class w$ extends ge{constructor(t,n){super(t,n),this.model=new O$(this.services),this.model.setOptions(It(At.heatmapChart,n.options)),this.init(t,n)}getAxisChartComponents(t,n){const r=this.model.getOptions(),i=y(r,"toolbar","enabled");this.services.cartesianScales.determineAxisDuality(),this.services.cartesianScales.findDomainAndRangeAxes(),this.services.cartesianScales.determineOrientation();const s=!!this.model.getOptions().title,a={id:"title",components:[new vs(this.model,this.services)],growth:dt.STRETCH},o={id:"toolbar",components:[new Jr(this.model,this.services)],growth:dt.PREFERRED},l={id:"header",components:[new le(this.model,this.services,[a,...i?[o]:[]],{direction:Ct.ROW,alignItems:or.CENTER})],growth:dt.PREFERRED},c={id:"legend",components:[new uv(this.model,this.services,{chartType:"heatmap"})],growth:dt.PREFERRED,renderType:at.SVG},u={id:"graph-frame",components:t,growth:dt.STRETCH,renderType:at.SVG},d=y(n,"legend","enabled")!==!1&&this.model.getOptions().legend.enabled!==!1&&this.model.getData().length>0,h=Ct.COLUMN_REVERSE,f={id:"spacer",components:[new Ln(this.model,this.services,{size:15})],growth:dt.PREFERRED},p={id:"full-frame",components:[new le(this.model,this.services,[...d?[c]:[],...d?[f]:[],u],{direction:h})],growth:dt.STRETCH},g=[];if(s||i){g.push(l);const m={id:"spacer",components:[new Ln(this.model,this.services,i?{size:15}:void 0)],growth:dt.PREFERRED};g.push(m)}return g.push(p),[new qm(this.model,this.services),new oo(this.model,this.services),new le(this.model,this.services,g,{direction:Ct.COLUMN})]}getComponents(){const t=[new me(this.model,this.services),new b2(this.model,this.services)];return this.getAxisChartComponents(t)}}class M$ extends pr{getTabularDataArray(){const t=this.getOptions(),{groupMapsTo:n}=t.data,{number:r,code:i}=y(this.getOptions(),"locale"),s=this.getBinnedStackedData(),a=[yt(t,"bins.rangeLabel")||"Range",...s.map(l=>yt(l,`0.${n}`))],o=[...yt(s,0).map((l,c)=>[`${r(Number(yt(l,"data.x0")),i)} – ${r(Number(yt(l,"data.x1")),i)}`,...s.map(u=>r(yt(u[c],`data.${yt(u[c],n)}`),i))])];return super.formatTable({headers:a,cells:o})}}class C$ extends ge{constructor(t,n){super(t,n),this.model=new M$(this.services),this.model.setOptions(It(At.histogramChart,n.options)),this.init(t,n),this.update()}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new g2(this.model,this.services),new S2(this.model,this.services)];return this.getAxisChartComponents(t)}}class A$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lineChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new ei(this.model,this.services),new cn(this.model,this.services,{handleThresholds:!0}),new C2(this.model,this.services),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class D$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.lollipopChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new _2(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class L$ extends on{constructor(t){super(t)}getMaximumDomain(t){return t.reduce((r,i)=>r+i.value,0)}getFillColor(t){const n=this.getOptions(),r=y(n,"color","scale"),i=this.getStatus();return r||!i?super.getFillColor(t):null}getStatus(){const t=this.getOptions(),n=y(this.getDisplayData()),r=(n==null?void 0:n.reduce((a,o)=>a+o.value,0))??0,i=y(t,"meter","proportional")?r:r>100?100:r,s=y(t,"meter","status","ranges");if(s){const a=s.filter(o=>o.range[0]<=i&&i<=o.range[1]);if(a.length>0)return a[0].status}return null}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{groupMapsTo:r}=n.data,i=this.getStatus(),s=y(n,"meter","proportional"),{number:a,code:o}=y(this.getOptions(),"locale");let l=[],c=[],u;if(s===null){u=100;const d=t[0];l=["Group","Value",...i?["Status"]:[]],c=[[d[r],d.value===null?"–":a(d.value,o),...i?[i]:[]]]}else{const d=y(s,"total");u=d||this.getMaximumDomain(t),l=["Group","Value","Percentage of total"],c=[...t.map(h=>{let f;h.value!==null&&h.value!==void 0?f=Number(h.value):f=0;const p=Number((h.value/u*100).toFixed(2));return[h[r],h.value===null?"–":a(f,o),a(p,o)+" %"]})]}return super.formatTable({headers:l,cells:c})}}class R$ extends Ze{constructor(t,n){var i;super(t,n),this.model=new L$(this.services);const r=(i=n.options.meter)!=null&&i.proportional?ct(Tn(At.proportionalMeterChart),n.options):ct(Tn(At.meterChart),n.options);this.model.setOptions(r),this.init(t,n)}getComponents(){const n=[...y(this.model.getOptions(),"meter","showLabels")?[{id:"meter-title",components:[new m2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG},{id:"spacer",components:[new Ln(this.model,this.services,{size:8})],growth:dt.STRETCH}]:[],{id:"meter-graph",components:[new T2(this.model,this.services)],growth:dt.STRETCH,renderType:at.SVG}],r=[new le(this.model,this.services,n,{direction:Ct.COLUMN})];return this.getChartComponents(r,{graphFrameRenderType:at.HTML})}}class I$ extends pr{constructor(t){super(t)}getTabularDataArray(){const t=this.getOptions(),n=this.getGroupedData(),{angle:r,value:i}=y(t,"radar","axes"),{number:s,code:a}=y(t,"locale"),o=y(n,"0","data").map(u=>u[r]),l=["Group",...o],c=[...n.map(u=>[u.name,...o.map((d,h)=>y(u,"data",h,i)!==null?s(y(u,"data",h,i),a):"–")])];return super.formatTable({headers:l,cells:c})}}class k$ extends Ze{constructor(t,n){super(t,n),this.model=new I$(this.services),this.model.setOptions(It(At.radarChart,n.options)),this.init(t,n)}getComponents(){const t=[new M2(this.model,this.services)];return this.getChartComponents(t)}}class P$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.scatterChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new Bn(this.model,this.services),new cn(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class N$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=["Child","Parent"],r=[];return t.forEach(i=>{this.getChildrenDatums(i,r),r.push([i.name,"–"])}),super.formatTable({headers:n,cells:r})}getChildrenDatums(t,n=[]){t.children&&t.children.length>0&&t.children.forEach(r=>{this.getChildrenDatums(r,n),n.push([r.name,t.name])})}}class $$ extends Ze{constructor(t,n){super(t,n),this.model=new N$(this.services),this.model.setOptions(It(At.treeChart,n.options)),this.init(t,n)}getComponents(){const t=[new A2(this.model,this.services)];return this.getChartComponents(t,{excludeLegend:!0})}}class F$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),{number:n,code:r}=y(this.getOptions(),"locale"),i=["Child","Group","Value"],s=[];return t.forEach(a=>{Array.isArray(a.children)?a.children.forEach(o=>{s.push([o.name,a.name,o.value===null?"–":n(o.value,r)])}):y(a.name)!==null&&y(a.value)&&s.push(["–",a.name,n(a.value,r)])}),super.formatTable({headers:i,cells:s})}}class U$ extends Ze{constructor(t,n){super(t,n),this.model=new F$(this.services),this.model.setOptions(It(At.treemapChart,n.options)),this.init(t,n)}getComponents(){const t=[new i$(this.model,this.services)];return this.getChartComponents(t)}}class B$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.simpleBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new vv(this.model,this.services),new ni(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ})];return this.getAxisChartComponents(t)}}class H$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedAreaChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new yv(this.model,this.services),new ei(this.model,this.services,{stacked:!0}),new xv(this.model,this.services,{fadeInOnChartHolderMouseover:!0,handleThresholds:!0,stacked:!0}),new ce(this.model,this.services,{skeleton:Vt.GRID})];return this.getAxisChartComponents(t)}}class G$ extends ge{constructor(t,n){super(t,n),this.model.setOptions(It(At.stackedBarChart,n.options)),this.init(t,n)}getComponents(){const t=[new me(this.model,this.services),new Te(this.model,this.services),new ho(this.model,this.services),new Ev(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.VERT_OR_HORIZ}),new ni(this.model,this.services)];return this.getAxisChartComponents(t)}}class V$ extends on{constructor(t){super(t)}getTabularDataArray(){const t=this.getDisplayData(),n=this.getOptions(),{fontSizeMapsTo:r,wordMapsTo:i}=n.wordCloud,{groupMapsTo:s}=n.data,{code:a,number:o}=y(n,"locale"),l=[n.tooltip.wordLabel,"Group",n.tooltip.valueLabel],c=[...t.map(u=>[u[i],u[s],o(u[r],a)])];return super.formatTable({headers:l,cells:c})}}class z$ extends Ze{constructor(t,n){super(t,n),this.model=new V$(this.services),this.model.setOptions(It(At.wordCloudChart,n.options)),this.init(t,n)}getComponents(){const t=[new p$(this.model,this.services),new ce(this.model,this.services,{skeleton:Vt.PIE})];return this.getChartComponents(t)}}q.Alignments=Gt,q.AlluvialChart=Mk,q.AreaChart=Kk,q.AreaEvent=Nc,q.ArrowDirections=Ya,q.AxisEvent=Pc,q.AxisFlavor=is,q.AxisPositions=z,q.AxisTitleOrientations=qa,q.BarEvent=Bc,q.BoxplotChart=t2,q.BoxplotEvent=Hc,q.BubbleChart=n2,q.BulletChart=s2,q.CalloutDirections=ts,q.CanvasZoomEvent=kc,q.CartesianOrientations=Ht,q.ChartEvent=Ac,q.ChartTheme=Xc,q.ChartTypes=be,q.ChoroplethChart=wv,q.CirclePackChart=y$,q.ColorClassNameTypes=lt,q.ColorLegendType=rs,q.ComboChart=E$,q.DividerStatus=Xr,q.DominantBaseline=sn,q.DonutChart=b$,q.ExperimentalChoroplethChart=wv,q.GaugeChart=_$,q.GaugeEvent=Uc,q.GaugeTypes=lr,q.GroupedBarChart=T$,q.HeatmapChart=w$,q.HistogramChart=C$,q.LayoutAlignItems=or,q.LayoutDirection=Ct,q.LayoutGrowth=dt,q.LegendItemType=zt,q.LegendOrientations=qr,q.LegendPositions=Yr,q.LineChart=A$,q.LineEvent=Vc,q.LollipopChart=D$,q.MeterChart=R$,q.ModalEvent=Dc,q.ModelEvent=Lc,q.PieChart=Cv,q.PieEvent=Fc,q.Projection=an,q.RadarChart=k$,q.RadarEvent=zc,q.RenderTypes=at,q.ScaleTypes=rt,q.ScatterChart=P$,q.ScatterEvent=Gc,q.SimpleBarChart=B$,q.Skeletons=Vt,q.StackedAreaChart=H$,q.StackedBarChart=G$,q.Statuses=es,q.TextAnchor=rn,q.ThresholdEvent=qc,q.TickRotations=ns,q.ToolbarControlTypes=St,q.TooltipEvent=zr,q.TreeChart=$$,q.TreeEvent=Wc,q.TreeTypes=Wa,q.TreemapChart=U$,q.TreemapEvent=Yc,q.TruncationTypes=Re,q.WordCloudChart=z$,q.WordCloudEvent=$c,q.ZoomBarTypes=Ye,q.ZoomDomainEvent=Ic,q.ZoombarEvent=Rc,Object.defineProperty(q,Symbol.toStringTag,{value:"Module"})});
|
|
74
74
|
//# sourceMappingURL=bundle.umd.cjs.map
|