=ne?{width:oe,height:ee,meta:1}:{width:ne,height:re,meta:2}},z=formatLabels((0,import_ag_charts_core58.toPlainText)(C),this.properties.label,(0,import_ag_charts_core58.toPlainText)(w),this.properties.secondaryLabel,{padding:r},W);if(z==null)return;const{width:Y,height:q,meta:$,label:U,secondaryLabel:j}=z,H=S+(L+R)/2,te=Math.sin(H)>=0,Z=Math.cos(H)>=0,X=(te?3:12)&(Z?6:9);let Q;switch($){case 0:Q=0;break;case 1:{const ie=T-(f-q)*.58,ee=Math.sqrt((T-r)**2-(Y/2)**2);Q=Math.min(ie,ee);break}case 2:if(A===0){const J=q/(2*Math.tan(E*.5))+Y*.5,ie=Math.sqrt(T**2-(q*.5)**2)-Y*.5;Q=(J+ie)*.5}else Q=(M+T)*.5;break}if(U!=null){const{fontStyle:J="normal",fontFamily:ie,fontWeight:ee="normal",color:se="black"}=this.properties.label;D.label={...U,fontStyle:J,fontFamily:ie,fontWeight:ee,color:se,labelPlacement:$,circleQuarter:X,radius:Q,theta:H}}if(j!=null){const{fontStyle:J="normal",fontFamily:ie,fontWeight:ee="normal",color:se="black"}=this.properties.secondaryLabel;D.secondaryLabel={...j,fontStyle:J,fontFamily:ie,fontWeight:ee,color:se,labelPlacement:$,circleQuarter:X,radius:Q,theta:H}}D.contentHeight=z.height});const x=(D,k,A)=>{const{depth:L,startAngle:R,endAngle:O}=D;if(L==null){k.visible=!1;return}k.visible=!0;const B=this.getItemStyle(D,A),C=B.fill,w=B.strokeWidth,M=import_ag_charts_community158._ModuleSupport.isGradientFill(C)&&C.bounds!=="item"?b:void 0;applyShapeStyle19(k,B,M),k.centerX=0,k.centerY=0,k.innerRadius=L*f,k.outerRadius=(L+1)*f,k.startAngle=R+S,k.endAngle=O+S,k.inset=m+w*.5,k.cornerRadius=n};this.datumSelection.each((D,k)=>{x(k,D,!1)}),this.highlightSelection.each((D,k)=>{x(k,D,!0)});const v=(D,k,A,L)=>{const{depth:R,contentHeight:O}=D,B=A===0,C=B?D.label:D.secondaryLabel;if(R==null||C==null){k.visible=!1;return}const{labelPlacement:w,circleQuarter:M,radius:T,theta:N}=C;let I;L&&(I=(B?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color);const P={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:D.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},F=B?this.properties.label:this.properties.secondaryLabel,E=this.ctx.highlightManager?.getActiveHighlight(),G=getLabelStyles7(this,D,P,F,L,E);switch(k.text=C.text,k.fontSize=C.fontSize,k.lineHeight=C.lineHeight,k.fontStyle=C.fontStyle,k.fontFamily=C.fontFamily,k.fontWeight=C.fontWeight,k.fill=I??C.color,k.fillOpacity=this.getHighlightStyle(L,D.datumIndex)?.opacity??1,k.setBoxing(G),w){case 0:k.textAlign="center",k.textBaseline="top",k.translationX=0,k.translationY=(B?0:O-C.height)-O*.5,k.rotation=0;break;case 1:{const K=(M&3)!==0,V=B===!K?T:T-(O-C.height);k.textAlign="center",k.textBaseline=K?"bottom":"top",k.translationX=Math.cos(N)*V,k.translationY=Math.sin(N)*V,k.rotation=K?N-Math.PI*.5:N+Math.PI*.5;break}case 2:{const K=(M&6)!==0,V=B===!K?(O-C.height)*.5:(C.height-O)*.5;k.textAlign="center",k.textBaseline="middle",k.translationX=Math.cos(N)*T+Math.cos(N+Math.PI/2)*V,k.translationY=Math.sin(N)*T+Math.sin(N+Math.PI/2)*V,k.rotation=K?N:N+Math.PI;break}}k.visible=!0},_=this.ctx.highlightManager?.getActiveHighlight();for(const D of this.labelSelection.selectByClass(TransformableText3)){const k=D.closestDatum();v(k,D,D.tag,k===_)}}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:n,sizeName:l,colorKey:c,colorName:h,tooltip:p}=i,{formatManager:u}=s,g=e.reduce((_,D)=>_?.children[D],this.rootNode);if(g==null)return;const{datum:d,depth:m}=g;if(d==null||m==null)return;const y=[],f=n==null?void 0:d[n];if(f!=null){const _=[0,this.rootNode?.sumSize??0],D=u.format(this.callWithContext.bind(this),{type:"number",value:f,datum:d,seriesId:t,legendItemName:void 0,key:n,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:_,fractionDigits:void 0});y.push({label:l,fallbackLabel:n,value:D??formatValue2(f)})}const S=c==null?void 0:d[c];if(S!=null){const{colorDomain:_}=this,D=u.format(this.callWithContext.bind(this),{type:"number",value:S,datum:d,seriesId:t,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:_,fractionDigits:void 0});y.push({label:h,fallbackLabel:c,value:D??formatValue2(S)})}const b=this.getItemStyle({...g,colorValue:S??g.colorValue},!1),v={shape:"square",fill:b.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return import_ag_charts_community158._ModuleSupport.isGradientFill(v.fill)&&(v.fill={...v.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(p,{title:a==null?void 0:d[a],symbol:{marker:v},data:y},{seriesId:t,datum:d,title:void 0,depth:m,labelKey:a,secondaryLabelKey:o,childrenKey:r,sizeKey:n,sizeName:l,colorKey:c,colorName:h,...b})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}animateEmptyUpdateReady(){fromToMotion6(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};SunburstSeries.className="SunburstSeries",SunburstSeries.type="sunburst";var import_ag_charts_community159=require("ag-charts-community"),import_ag_charts_core59=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs22,sunburstSeriesThemeableOptionsDef,without:without8}=import_ag_charts_community159._ModuleSupport,sunburstSeriesOptionsDef={...sunburstSeriesThemeableOptionsDef,...without8(commonSeriesOptionsDefs22,["highlightStyle","highlight","showInLegend"]),type:(0,import_ag_charts_core59.required)((0,import_ag_charts_core59.constant)("sunburst")),labelKey:import_ag_charts_core59.string,secondaryLabelKey:import_ag_charts_core59.string,childrenKey:import_ag_charts_core59.string,sizeKey:import_ag_charts_core59.string,colorKey:import_ag_charts_core59.string,sizeName:import_ag_charts_core59.string,colorName:import_ag_charts_core59.string},{BASE_FONT_SIZE,FONT_SIZE_RATIO:FONT_SIZE_RATIO2}=import_ag_charts_community160._ModuleSupport,SunburstModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"sunburst",moduleFactory:e=>new SunburstSeries(e),solo:!0,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",import_ag_charts_community160._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS],["pattern",import_ag_charts_community160._ModuleSupport.FILL_PATTERN_DEFAULTS],["image",import_ag_charts_community160._ModuleSupport.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...import_ag_charts_community160._ModuleSupport.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:FONT_SIZE_RATIO2.LARGE},minimumFontSize:{$rem:9/BASE_FONT_SIZE},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...import_ag_charts_community160._ModuleSupport.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:FONT_SIZE_RATIO2.SMALLEST},minimumFontSize:{$rem:7/BASE_FONT_SIZE},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0,...import_ag_charts_community160._ModuleSupport.LEGEND_CONTAINER_THEME}}},SunburstSeriesModule={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,options:sunburstSeriesOptionsDef,create:e=>new SunburstSeries(e)},import_ag_charts_community164=require("ag-charts-community"),import_ag_charts_community162=require("ag-charts-community"),import_ag_charts_core60=require("ag-charts-core"),import_ag_charts_community161=require("ag-charts-community"),{BaseProperties:BaseProperties13,HierarchySeriesProperties:HierarchySeriesProperties2,HighlightStyle:HighlightStyle2,makeSeriesTooltip:makeSeriesTooltip24,Property:Property39,Label:Label16}=import_ag_charts_community161._ModuleSupport,TreemapGroupLabel=class extends Label16{constructor(){super(...arguments),this.spacing=0}};__decorateClass([Property39],TreemapGroupLabel.prototype,"spacing",2);var TreemapSeriesGroup=class extends BaseProperties13{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new TreemapGroupLabel}};__decorateClass([Property39],TreemapSeriesGroup.prototype,"fill",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"fillOpacity",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"stroke",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"strokeWidth",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"strokeOpacity",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"cornerRadius",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"textAlign",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"gap",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"padding",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"interactive",2),__decorateClass([Property39],TreemapSeriesGroup.prototype,"label",2);var TreemapSeriesTile=class extends BaseProperties13{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel}};__decorateClass([Property39],TreemapSeriesTile.prototype,"fill",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"fillOpacity",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"stroke",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"strokeWidth",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"strokeOpacity",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"cornerRadius",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"textAlign",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"verticalAlign",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"gap",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"padding",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"label",2),__decorateClass([Property39],TreemapSeriesTile.prototype,"secondaryLabel",2);var TreemapSeriesGroupHighlightStyle=class extends BaseProperties13{constructor(){super(...arguments),this.label=new AutoSizedLabel}};__decorateClass([Property39],TreemapSeriesGroupHighlightStyle.prototype,"fill",2),__decorateClass([Property39],TreemapSeriesGroupHighlightStyle.prototype,"fillOpacity",2),__decorateClass([Property39],TreemapSeriesGroupHighlightStyle.prototype,"stroke",2),__decorateClass([Property39],TreemapSeriesGroupHighlightStyle.prototype,"strokeWidth",2),__decorateClass([Property39],TreemapSeriesGroupHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([Property39],TreemapSeriesGroupHighlightStyle.prototype,"label",2);var TreemapSeriesTileHighlightStyle=class extends BaseProperties13{constructor(){super(...arguments),this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel}};__decorateClass([Property39],TreemapSeriesTileHighlightStyle.prototype,"fill",2),__decorateClass([Property39],TreemapSeriesTileHighlightStyle.prototype,"fillOpacity",2),__decorateClass([Property39],TreemapSeriesTileHighlightStyle.prototype,"stroke",2),__decorateClass([Property39],TreemapSeriesTileHighlightStyle.prototype,"strokeWidth",2),__decorateClass([Property39],TreemapSeriesTileHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([Property39],TreemapSeriesTileHighlightStyle.prototype,"label",2),__decorateClass([Property39],TreemapSeriesTileHighlightStyle.prototype,"secondaryLabel",2);var TreemapSeriesHighlightStyle=class extends HighlightStyle2{constructor(){super(!1),this.group=new TreemapSeriesGroupHighlightStyle,this.tile=new TreemapSeriesTileHighlightStyle}getStyle(e){return e?this.tile:this.group}};__decorateClass([Property39],TreemapSeriesHighlightStyle.prototype,"group",2),__decorateClass([Property39],TreemapSeriesHighlightStyle.prototype,"tile",2);var TreemapSeriesProperties=class extends HierarchySeriesProperties2{constructor(){super(...arguments),this.highlightStyle=new TreemapSeriesHighlightStyle,this.tooltip=makeSeriesTooltip24(),this.group=new TreemapSeriesGroup,this.tile=new TreemapSeriesTile,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(e,t,i,s){const{fillOpacity:a,strokeWidth:o,strokeOpacity:r,fill:n=e?t[s%t.length]:t[Math.min(s,t.length)],stroke:l=e?i[s%t.length]:i[Math.min(s,i.length)]}=e?this.tile:this.group;return{fill:n,fillOpacity:a,stroke:l,strokeWidth:o,strokeOpacity:r,opacity:1}}};__decorateClass([Property39],TreemapSeriesProperties.prototype,"sizeName",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"labelKey",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"secondaryLabelKey",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"highlightStyle",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"tooltip",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"group",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"tile",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"undocumentedGroupFills",2),__decorateClass([Property39],TreemapSeriesProperties.prototype,"undocumentedGroupStrokes",2);var{createDatumId:createDatumId22,Rect:Rect7,Group:Group17,BBox:BBox18,Selection:Selection16,Text:Text8,Transformable:Transformable4,applyShapeStyle:applyShapeStyle20,getLabelStyles:getLabelStyles8,mergeDefaults:mergeDefaults20,formatValue:formatValue3}=import_ag_charts_community162._ModuleSupport,TreemapNode=class extends import_ag_charts_community162._ModuleSupport.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function nodeSize(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var textAlignFactors2={left:0,center:.5,right:1},verticalAlignFactors4={top:0,middle:.5,bottom:1},DistantGroup=class extends import_ag_charts_community162._ModuleSupport.Group{distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}},TreemapSeries=class extends import_ag_charts_community162._ModuleSupport.HierarchySeries{constructor(){super(...arguments),this.NodeClass=TreemapNode,this.properties=new TreemapSeriesProperties,this.rectGroup=this.contentGroup.appendChild(new Group17),this.datumSelection=Selection16.select(this.rectGroup,Rect7),this.labelSelection=Selection16.select(this.labelGroup,Group17),this.highlightSelection=Selection16.select(this.rectGroup,Rect7)}groupTitleHeight(e,t){const{labelValue:i}=e,{label:s}=this.properties.group,a=3;if(i!=null){if(s.fontSize>t.width/a||s.fontSize>t.height/a)return;{const{height:o}=(0,import_ag_charts_core60.cachedTextMeasurer)(s).measureLines(i);return Math.max(o,s.fontSize)}}}getNodePadding(e,t){if(e.parent==null)return{top:0,right:0,bottom:0,left:0};if(e.children.length===0){const{padding:r}=this.properties.tile;return{top:r,right:r,bottom:r,left:r}}const{label:{spacing:i},padding:s}=this.properties.group,a=this.groupTitleHeight(e,t),o=a==null?0:a+i;return{top:s+o,right:s,bottom:s,left:s}}sortChildren({children:e}){const t=Array.from(e,(s,a)=>a).filter(s=>nodeSize(e[s])>0).sort((s,a)=>nodeSize(e[a])-nodeSize(e[s]));return{sortedChildrenIndices:t,childAt:s=>{const a=t[s];return e[a]}}}squarify(e,t){const{datum:i,children:s}=e;if(t.width<=0||t.height<=0){e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN;return}const a=i==null?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(e,t);e.parent==null?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN):(e.bbox=t,e.padding=a,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:o,childAt:r}=this.sortChildren(e),n=o.every(v=>s[v].children.length===0),l=1,c=t.width-a.left-a.right,h=t.height-a.top-a.bottom;if(c<=0||h<=0)return;const p=o.length;let u=0,g=0,d=1/0,m=o.reduce((v,_)=>v+nodeSize(s[_]),0);const y=new BBox18(t.x+a.left,t.y+a.top,c,h),f=y.clone();let S=0;for(;S({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),o=a(e),r=a(t),n=["top","right","bottom","left"];for(const l of n)(0,import_ag_charts_core60.isNumberEqual)(o[l],r[l])||t.shrink(s,l)}createNodeData(){}getItemStyle(e,t,i){const{properties:s,colorScale:a}=this,{itemStyler:o}=s,r=e.datumIndex?.[0]??0,n=t?s.fills:s.undocumentedGroupFills,l=t?s.strokes:s.undocumentedGroupStrokes,c=t?r:e.depth??-1,h=i?s.highlightStyle.getStyle(t):void 0,p=mergeDefaults20(h,s.getStyle(t,n,l,c));!i&&t&&e.colorValue!=null&&(p.fill=a.convert(e.colorValue));let u=p;if(o!=null&&e!=null){const g=this.cachedDatumCallback(createDatumId22(this.getDatumId(e),i?"highlight":"node"),()=>{const d=this.makeItemStylerParams(e,i,u);return this.callWithContext(o,d)});g&&(u=mergeDefaults20(g,u))}return u}makeItemStylerParams(e,t,i){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),o=this.getHighlightStateString(a,t,e.datumIndex),r=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:e.datum,depth:e.depth??-1,highlighted:t,highlightState:o,...i,fill:r}}updateSelections(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e!=null&&!this.properties.group.interactive&&e.children.length!==0&&(e=void 0),this.highlightSelection.update(e==null?[]:[e],void 0,a=>this.getDatumId(a)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode),s=a=>{a.append([new Text8({tag:0}),new Text8({tag:1})])};this.datumSelection.update(i,void 0,a=>this.getDatumId(a)),this.labelSelection.update(i,s,a=>this.getDatumId(a))}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:a,labelKey:o,secondaryLabelKey:r,sizeKey:n,sizeName:l,highlightStyle:c,tile:h,group:p}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!t)return;this.rootNode?.walk(b=>{const{datum:x,depth:v,children:_}=b,D=_.length===0,k=D?h.label:p.label;let A;if(k.enabled&&x!=null&&v!=null&&o!=null){const R=x[o];A=this.getLabelText(R,x,o,"label",[],k,{depth:v,datum:x,childrenKey:i,colorKey:s,colorName:a,labelKey:o,secondaryLabelKey:r,sizeKey:n,sizeName:l,value:R})}A===""&&(A=void 0);let L;if(h.secondaryLabel.enabled&&D&&x!=null&&v!=null&&r!=null){const R=x[r];L=this.getLabelText(R,x,r,"secondaryLabel",[],h.secondaryLabel,{depth:v,datum:x,childrenKey:i,colorKey:s,colorName:a,labelKey:o,secondaryLabelKey:r,sizeKey:n,sizeName:l,value:R})}L===""&&(L=void 0),b.labelValue=(0,import_ag_charts_core60.toPlainText)(A),b.secondaryLabelValue=(0,import_ag_charts_core60.toPlainText)(L)});const{width:g,height:d}=u;this.squarify(e,new BBox18(0,0,g,d)),this.rootNode?.walk(b=>{const{bbox:x,children:v,labelValue:_,secondaryLabelValue:D}=b;if(b.label=void 0,b.secondaryLabel=void 0,x!=null)if(v.length===0){const k={width:x.width,height:x.height,meta:null},A=formatLabels(_,this.properties.tile.label,D,this.properties.tile.secondaryLabel,{padding:h.padding},()=>k);if(A==null)return;const{height:L,label:R,secondaryLabel:O}=A,{textAlign:B,verticalAlign:C,padding:w}=h,M=textAlignFactors2[B]??.5,T=x.x+w+(x.width-2*w)*M,N=verticalAlignFactors4[C]??.5,I=x.y+w+L*.5+(x.height-2*w-L)*N;if(R!=null){const{fontStyle:P="normal",fontFamily:F,fontWeight:E="normal",color:G="black"}=this.properties.tile.label;b.label={text:R.text,fontSize:R.fontSize,lineHeight:R.lineHeight,fontStyle:P,fontFamily:F,fontWeight:E,color:G,textAlign:B,verticalAlign:"middle",x:T,y:I-(L-R.height)*.5}}if(O!=null){const{fontStyle:P="normal",fontFamily:F,fontWeight:E="normal",color:G="black"}=this.properties.tile.secondaryLabel;b.secondaryLabel={text:O.text,fontSize:O.fontSize,lineHeight:O.fontSize,fontStyle:P,fontFamily:F,fontWeight:E,color:G,textAlign:B,verticalAlign:"middle",x:T,y:I+(L-O.height)*.5}}}else{if(_==null)return;{const{padding:k,textAlign:A}=p,L=this.groupTitleHeight(b,x);if(L==null)return;const R=x.width-2*k,O=(0,import_ag_charts_core60.wrapText)(_,{maxWidth:x.width-2*k,font:p.label,textWrap:"never"}),B=textAlignFactors2[A]??.5,{fontStyle:C="normal",fontFamily:w,fontWeight:M="normal",color:T="black"}=this.properties.group.label;b.label={text:O,fontSize:p.label.fontSize,lineHeight:(0,import_ag_charts_core60.calcLineHeight)(p.label.fontSize),fontStyle:C,fontFamily:w,fontWeight:M,color:T,textAlign:A,verticalAlign:"middle",x:x.x+k+R*B,y:x.y+k+L*.5}}}});const m={series:new BBox18(0,0,g,d),axis:new BBox18(0,0,g,d)},y=(b,x,v)=>{const{bbox:_}=b;if(_==null){x.visible=!1;return}const{depth:D=-1}=b,k=b.children.length===0,A=this.getItemStyle(b,k,v);x.crisp=!0,applyShapeStyle20(x,A,m),x.cornerRadius=k?h.cornerRadius:p.cornerRadius,x.zIndex=[0,D,v?1:0];const L=b.parent?.children.every(B=>B.children.length===0),R=b.parent==null?void 0:b.parent.bbox,O=b.parent==null?void 0:b.parent.padding;L===!0&&R!=null&&O!=null?(x.clipBBox=_,x.x=R.x+O.left,x.y=R.y+O.top,x.width=R.width-(O.left+O.right),x.height=R.height-(O.top+O.bottom)):(x.clipBBox=void 0,x.x=_.x,x.y=_.y,x.width=_.width,x.height=_.height),x.visible=!0};this.datumSelection.each((b,x)=>y(x,b,!1)),this.highlightSelection.each((b,x)=>{y(x,b,!0)});const f=(b,x,v,_)=>{const D=b.children.length===0,k=v===0?b.label:b.secondaryLabel;if(k==null){x.visible=!1;return}const A=v===0?h.label:h.secondaryLabel;let L;if(_){const{tile:C,group:w}=c;L=C.secondaryLabel.color,D?v===0&&(L=C.label.color):L=w.label.color}const R={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:b.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},O=this.ctx.highlightManager?.getActiveHighlight(),B=getLabelStyles8(this,b,R,A,_,O);x.text=k.text,x.fontSize=k.fontSize,x.lineHeight=k.lineHeight,x.fontStyle=k.fontStyle,x.fontFamily=k.fontFamily,x.fontWeight=k.fontWeight,x.fill=L??k.color,x.fillOpacity=this.getHighlightStyle(_,b.datumIndex)?.opacity??1,x.textAlign=k.textAlign,x.textBaseline=k.verticalAlign,x.x=k.x,x.y=k.y,x.setBoxing(B),x.visible=!0,x.zIndex=1},S=this.ctx.highlightManager?.getActiveHighlight();for(const b of this.labelSelection.selectByClass(Text8)){const x=b.closestDatum();f(x,b,b.tag,x===S)}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>s.datumIndex.length-i.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return t.length!==0?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{formatManager:a}=s,{labelKey:o,secondaryLabelKey:r,childrenKey:n,sizeKey:l,sizeName:c,colorKey:h,colorName:p,tooltip:u}=i,g=e.reduce((A,L)=>A?.children[L],this.rootNode);if(g==null)return;const{datum:d,depth:m,children:y}=g;if(d==null||m==null)return;const f=y.length===0,S=[],b=l==null?void 0:d[l];if(b!=null){const A=[0,this.rootNode?.sumSize??0],L=a.format(this.callWithContext.bind(this),{type:"number",value:b,datum:d,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:A,fractionDigits:void 0});S.push({label:c,fallbackLabel:l,value:L??formatValue3(b)})}const x=h==null?void 0:d[h];if(x!=null){const{colorDomain:A}=this,L=a.format(this.callWithContext.bind(this),{type:"number",value:x,datum:d,seriesId:t,legendItemName:void 0,key:h,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:A,fractionDigits:void 0});S.push({label:p,fallbackLabel:h,value:L??formatValue3(x)})}const v=this.getItemStyle({...g,colorValue:x??g.colorValue},f,!1),D={shape:"square",fill:v.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};import_ag_charts_community162._ModuleSupport.isGradientFill(D.fill)&&(D.fill={...D.fill,gradient:"linear",rotation:0,reverse:!1});const k=f?{marker:D}:void 0;return this.formatTooltipWithContext(u,{title:o==null?void 0:d[o],symbol:k,data:S},{seriesId:t,datum:d,title:void 0,depth:m,labelKey:o,secondaryLabelKey:r,childrenKey:n,sizeKey:l,sizeName:c,colorKey:h,colorName:p,...v})}computeFocusBounds(e){return Transformable4.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};TreemapSeries.className="TreemapSeries",TreemapSeries.type="treemap";var import_ag_charts_community163=require("ag-charts-community"),import_ag_charts_core61=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs23,treemapSeriesThemeableOptionsDef,without:without9}=import_ag_charts_community163._ModuleSupport,treemapSeriesOptionsDef={...treemapSeriesThemeableOptionsDef,...without9(commonSeriesOptionsDefs23,["highlightStyle","highlight","showInLegend"]),type:(0,import_ag_charts_core61.required)((0,import_ag_charts_core61.constant)("treemap")),labelKey:import_ag_charts_core61.string,secondaryLabelKey:import_ag_charts_core61.string,childrenKey:import_ag_charts_core61.string,sizeKey:import_ag_charts_core61.string,colorKey:import_ag_charts_core61.string,sizeName:import_ag_charts_core61.string,colorName:import_ag_charts_core61.string};treemapSeriesOptionsDef.undocumentedGroupFills=(0,import_ag_charts_core61.undocumented)((0,import_ag_charts_core61.arrayOf)(import_ag_charts_core61.color)),treemapSeriesOptionsDef.undocumentedGroupStrokes=(0,import_ag_charts_core61.undocumented)((0,import_ag_charts_core61.arrayOf)(import_ag_charts_core61.color));var{FONT_SIZE_RATIO:FONT_SIZE_RATIO3}=import_ag_charts_community164._ModuleSupport,TreemapModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"treemap",moduleFactory:e=>new TreemapSeries(e),solo:!0,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",import_ag_charts_community164._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],["pattern",import_ag_charts_community164._ModuleSupport.FILL_PATTERN_DEFAULTS],["image",import_ag_charts_community164._ModuleSupport.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...import_ag_charts_community164._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{...import_ag_charts_community164._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:FONT_SIZE_RATIO3.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...import_ag_charts_community164._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:FONT_SIZE_RATIO3.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0,...import_ag_charts_community164._ModuleSupport.LEGEND_CONTAINER_THEME}}},TreemapSeriesModule={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,options:treemapSeriesOptionsDef,create:e=>new TreemapSeries(e)},ModuleRegistry=import_ag_charts_community165._ModuleSupport.ModuleRegistry,AllCartesianEnterpriseModules=[OrdinalTimeAxisModule,BoxPlotSeriesModule,CandlestickSeriesModule,ConeFunnelSeriesModule,FunnelSeriesModule,HeatmapSeriesModule,OhlcSeriesModule,RangeAreaSeriesModule,RangeBarSeriesModule,WaterfallSeriesModule],AllPolarEnterpriseModules=[AngleNumberAxisModule,AngleCategoryAxisModule,RadiusNumberAxisModule,RadiusCategoryAxisModule,NightingaleSeriesModule,RadarAreaSeriesModule,RadarLineSeriesModule,RadialBarSeriesModule,RadialColumnSeriesModule],AllStandaloneEnterpriseModules=[StandaloneChartModule,PyramidSeriesModule,LinearGaugeSeriesModule,RadialGaugeSeriesModule,SunburstSeriesModule,TreemapSeriesModule,ChordSeriesModule,SankeySeriesModule],AllTopologyEnterpriseModules=[TopologyChartModule,MapLineSeriesModule,MapLineBackgroundSeriesModule,MapMarkerSeriesModule,MapShapeSeriesModule,MapShapeBackgroundSeriesModule],AllEnterpriseModules=[...AllCartesianEnterpriseModules,...AllPolarEnterpriseModules,...AllStandaloneEnterpriseModules,...AllTopologyEnterpriseModules,AnnotationsModule,NavigatorModule,InitialStateModule];
diff --git a/yuthon_report/static/src/lib/ag-chart/dist/package/main-modules.esm.min.mjs b/yuthon_report/static/src/lib/ag-chart/dist/package/main-modules.esm.min.mjs
new file mode 100644
index 000000000..93d871109
--- /dev/null
+++ b/yuthon_report/static/src/lib/ag-chart/dist/package/main-modules.esm.min.mjs
@@ -0,0 +1,5 @@
+var Au=Object.defineProperty,Mu=Object.getOwnPropertyDescriptor,h=(e,t,i,s)=>{for(var o=s>1?void 0:s?Mu(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(o=(s?n(t,i,o):n(o))||o);return s&&o&&Au(t,i,o),o};import{_ModuleSupport as Nu}from"ag-charts-community";import{_ModuleSupport as Lu}from"ag-charts-community";import{_ModuleSupport as Tu}from"ag-charts-community";import{isNumberEqual as Kr}from"ag-charts-core";function Ta(e,t,i){const s=(a,n,r,l)=>{let c=e[0];for(let p=a;r>0?p<=n:p>n;p+=r){const d=e[p];if(l(c,d))return!0;c=d}return!1},o=Math.floor(e.length/2);return s(t,o,t,i)?!0:s(e.length-t,o,-t,i)}import{_ModuleSupport as Ru}from"ag-charts-community";var{AxisInterval:Pu,Property:Cu}=Ru,Ra=class extends Pu{};h([Cu],Ra.prototype,"minSpacing",2);import{_ModuleSupport as qs}from"ag-charts-community";import{countFractionDigits as Ou,isNumberEqual as Ei,wrapTextOrSegments as _u}from"ag-charts-core";import{_ModuleSupport as Wr}from"ag-charts-community";import{isNumberEqual as zr}from"ag-charts-core";import{_ModuleSupport as wu}from"ag-charts-community";import{createId as Eu}from"ag-charts-core";var{BaseProperties:$r,ChartAxisDirection:Fu,Property:ke,Group:Pa,FONT_SIZE:Bu}=wu,vt=class extends $r{constructor(){super(...arguments),this.fontSize=Bu.LARGE,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};h([ke],vt.prototype,"enabled",2),h([ke],vt.prototype,"text",2),h([ke],vt.prototype,"fontStyle",2),h([ke],vt.prototype,"fontWeight",2),h([ke],vt.prototype,"fontSize",2),h([ke],vt.prototype,"fontFamily",2),h([ke],vt.prototype,"padding",2),h([ke],vt.prototype,"color",2),h([ke],vt.prototype,"parallel",2);var et=class extends $r{constructor(){super(...arguments),this.id=Eu(this),this.defaultColorRange=[],this.shape="polygon",this.label=new vt,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=Fu.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Pa({name:this.id}),this.rangeGroup=new Pa({name:this.id}),this.labelGroup=new Pa({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,s,o){const{label:a}=this;e.x=t,e.y=i,e.text=a.text,e.textAlign="center",e.textBaseline=s,e.rotation=o,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=a.color,e.fontFamily=a.fontFamily,e.fontSize=a.fontSize,e.fontStyle=a.fontStyle,e.visible=!0}};h([ke],et.prototype,"enabled",2),h([ke],et.prototype,"type",2),h([ke],et.prototype,"range",2),h([ke],et.prototype,"value",2),h([ke],et.prototype,"defaultColorRange",2),h([ke],et.prototype,"fill",2),h([ke],et.prototype,"fillOpacity",2),h([ke],et.prototype,"stroke",2),h([ke],et.prototype,"strokeWidth",2),h([ke],et.prototype,"strokeOpacity",2),h([ke],et.prototype,"lineDash",2),h([ke],et.prototype,"shape",2),h([ke],et.prototype,"label",2);var{ChartAxisDirection:Gu,getCrossLineValue:Vu,validateCrossLineValue:Ku,normalizeAngle360:Ca,Group:Wu,Path:Hr,Sector:zu,RotatableText:$u,ContinuousScale:Hu}=Wr,Oa=class extends et{constructor(){super(),this.direction=Gu.Angle,this.polygonNode=new Hr,this.sectorNode=new zu,this.lineNode=new Hr,this.crossLineRange=new Wu,this.labelNode=new $u,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!Hu.is(this.scale))return!0;const[e,t]=this.scale.domain,i=Vu(this);if(this.type==="range"){const[s,o]=i;return s>=e&&s<=t&&o>=s&&o<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!Ku(this,t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:s,lineNode:o}=this;if(!e||i!=="line"||!t){o.visible=!1;return}const a=t.convert(s);if(Number.isNaN(a)){o.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this;o.visible=!0,o.stroke=this.stroke,o.strokeOpacity=this.strokeOpacity??1,o.strokeWidth=this.strokeWidth??1,o.fill=void 0,o.lineDash=this.lineDash;const l=r*Math.cos(a),c=r*Math.sin(a),p=n*Math.cos(a),d=n*Math.sin(a);o.path.clear(!0),o.path.moveTo(p,d),o.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:s,shape:o,type:a,ticks:n}=this;if(!e||a!=="range"||o!=="polygon"||!s||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=n.indexOf(i[0]),p=n.indexOf(i[1]),u=(c<=p?n.slice(c,p+1):n.slice(c).concat(n.slice(0,p+1))).map(g=>s.convert(g));t.visible=!0,this.setSectorNodeProps(t);const{path:m}=t;m.clear(!0);for(const[g,y]of u.entries()){const f=l*Math.cos(y),S=l*Math.sin(y);g===0?m.moveTo(f,S):m.lineTo(f,S)}if(r===0)m.lineTo(0,0);else{const g=u.slice().reverse();for(const y of g){const f=r*Math.cos(y),S=r*Math.sin(y);m.lineTo(f,S)}}t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:s,shape:o,type:a}=this;if(!e||a!=="range"||o!=="circle"||!s||!i){t.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this,l=i.map(d=>s.convert(d)),c=s.step??0,p=s instanceof Wr.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=n,t.outerRadius=r,t.startAngle=l[0]-p,t.endAngle=l[1]+p,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:s,scale:o,type:a,ticks:n}=this;if(!e||t.enabled===!1||!t.text||!o||a==="range"&&!s){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,p,d,u;if(a==="line"){const m=Ca(o.convert(this.value)),g=1.5*Math.PI,y=zr(m,g)||m>g||mCa(o.convert(x)));let y=(m+g)/2;m>g&&(y-=Math.PI),y=Ca(y);const f=(zr(y,0)||y>0)&&yl.value),r=n.reduce((l,c)=>Math.max(typeof c=="number"?Ou(c):0,l),0);return{niceDomain:o,tickDomain:o,ticks:n,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=qt(-Math.PI/2+ys(this.startAngle)),t=this.endAngle==null?2*Math.PI:Yu(ys(this.endAngle)-ys(this.startAngle)),i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),s=Math.floor(e.y);t.translationX=i,t.translationY=s}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:s}=this.getAxisLinePoints();for(const{x:o,y:a,moveTo:n,arc:r,radius:l=0,startAngle:c=0,endAngle:p=0}of i)r?t.arc(o,a,l,c,p):n?t.moveTo(o,a):t.lineTo(o,a);s&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[s,o]=this.range,a=Ei(o-s,2*Math.PI),n=[];if(t==="circle")a?n.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):n.push({x:i*Math.cos(s),y:i*Math.sin(s),moveTo:!0},{x:0,y:0,radius:i,startAngle:qt(s),endAngle:qt(o),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));if(r&&r.length>2)for(const[l,c]of r.entries()){const p=i*Math.cos(c),d=i*Math.sin(c),u=l===0;n.push({x:p,y:d,moveTo:u})}}return{points:n,closePath:a}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:s},innerRadiusRatio:o}=this;if(!(i&&t>0))return;const a=t*o,n=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:p}=l,{stroke:d,lineDash:u}=i[c%n],m=e.convert(p);r.x1=a*Math.cos(m),r.y1=a*Math.sin(m),r.x2=t*Math.cos(m),r.y2=t*Math.sin(m),r.stroke=d,r.strokeWidth=s,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,s,o)=>{const a=this.labelData[o];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(e),i.fill=e.color,i.x=a.x,i.y=a.y,i.setAlign(a),i.setBoxing(e),i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:s}=this;s.each((o,a)=>{const{value:n}=a,r=e.convert(n),l=Math.cos(r),c=Math.sin(r);o.x1=t*l,o.y1=t*c,o.x2=(t+i.size)*l,o.y2=(t+i.size)*c,o.stroke=i.stroke,o.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:s,gridLength:o,scale:a,tick:n}=this;if(!s.enabled)return[];const r=new qu,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:p}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,p),u=e.map((m,g)=>{const{value:y}=m,f=o+s.spacing+n.size,S=a.convert(y),x=Math.cos(S),v=Math.sin(S),b=f*x,k=f*v,{textAlign:A,textBaseline:I}=this.getLabelAlign(S),D=g===e.length-1&&y!==e[0]&&Ei(qt(S),qt(a.convert(e[0]))),N=this.getLabelRotation(S);let R=d(y,g);r.text=R,r.x=b,r.y=k,r.setFont(s),r.textAlign=A,r.textBaseline=I,r.rotation=N,N&&(r.rotationCenterX=b,r.rotationCenterY=k);let C=N?ju.toCanvas(r):r.getBBox();if(C&&t.hideWhenNecessary&&!N){const w=l-C.x,G=C.x+C.width-c,_=1;if(w>_||G>_){const L={maxWidth:C.width-Math.max(w,G),font:s,textWrap:"never"};R=_u(R,L),r.text=R,C=r.getBBox()}}return{text:R,x:b,y:k,textAlign:A,textBaseline:I,hidden:R===""||(m.hidden??D),rotation:N,box:C}});return s.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:s})=>s).filter(s=>s!=null);return!this.label.enabled||i.length===0?null:Ju.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof wa?e.orientation:"fixed"}getLabelRotation(e){let t=ys(this.label.rotation??0);e=qt(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let s,o;const a=this.getLabelOrientation(),n=Ei(t,0),r=Ei(i,0),l=Ei(t,1),c=Ei(i,-1),p=t>0&&!n,d=i>0&&!r;return a==="parallel"?(s="center",o=l&&r||d?"top":"bottom"):a==="perpendicular"?(s=c||p?"left":"right",o="middle"):(s="right",n?s="center":p&&(s="left"),o="bottom",r?o="middle":d&&(o="top")),{textAlign:s,textBaseline:o}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;for(const s of this.crossLines)s instanceof Oa&&(s.ticks=this.tickData.map(o=>o.value),s.shape=e,s.axisOuterRadius=t,s.axisInnerRadius=t*i);super.updateCrossLines()}};fs.CrossLineConstructor=Oa,h([_a],fs.prototype,"startAngle",2),h([_a],fs.prototype,"endAngle",2);var{Property:Ea,CategoryScale:Zu}=Tu,di=class extends fs{constructor(e){super(e,new Zu),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new Ra}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:s,minSpacing:o}=this.interval,a={nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=s??t.ticks(a,e)?.ticks??[];if(n.length<2||o==null)return n.map(d=>({value:d,visible:!0}));const r=n[0],l=t.convert(r),c=i*Math.cos(l),p=i*Math.sin(l);for(let d=1;dMath.PI)break;const g=i*Math.cos(m),y=i*Math.sin(m);if(Math.hypot(g-c,y-p)>o){const S=new Set([r]);return Ta(n,d,(x,v)=>{S.add(v)}),n.map(x=>{const v=S.has(x);return{value:x,visible:v}})}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const p=l.box.clone().grow(t/2),d=c.box.clone().grow(t/2);return p.collidesBBox(d)},s=e[0],o=e.at(-1),a=new Set([s]),n=Kr(s.x,o.x)&&Kr(s.y,o.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=n?e.slice(0,-1):e;if(!Ta(c,l,i)){Ta(c,l,(d,u)=>{a.add(u)});break}}for(const l of e)a.has(l)||(l.hidden=!0,l.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}}};di.className="AngleCategoryAxis",di.type="angle-category",h([Ea],di.prototype,"groupPaddingInner",2),h([Ea],di.prototype,"paddingInner",2),h([Ea],di.prototype,"interval",2);import{_ModuleSupport as Qu}from"ag-charts-community";import{isNumberEqual as Ur}from"ag-charts-core";import{_ModuleSupport as eg}from"ag-charts-community";import{isNumberEqual as tg}from"ag-charts-core";var{range:qr,isDenseInterval:ig,LinearScale:Fa}=eg,jr=class Vr extends Fa{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[s,o]=i;let a=Fa.getTickStep(s,o,t);const n=Number.isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(o-s)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>n&&(l/=2,a*=2),{count:l,step:a}}ticks(t,i=this.domain){const{arcLength:s}=this;if(!i||i.length<2||i.some(c=>!Number.isFinite(c))||s<=0)return{ticks:[],count:0};const{nice:o,interval:a}=t,[n,r]=i;if(a){const c=Math.abs(a),p=this.getPixelRange();if(!ig((r-n)/c,p))return qr(n,r,c)}let l;if(o&&this.hasNiceRange()){const c=super.niceDomain(t,i);l=Vr.getNiceStepAndTickCount(t,c).step}else l=Fa.getTickStep(n,r,t);return qr(n,r,l)}hasNiceRange(){const t=this.range.slice().sort((s,o)=>s-o);return[Math.PI,2*Math.PI].some(s=>tg(s,t[1]-t[0]))}niceDomain(t,i=this.domain){const s=super.niceDomain(t,i);if(!this.hasNiceRange())return s;const o=s[0]>s[1],a=o?s[1]:s[0],{step:n,count:r}=Vr.getNiceStepAndTickCount(t,s),l=1/n,c=n>=1?Math.ceil(a/n+r)*n:Math.ceil((a+r*n)*l)/l;return o?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{Property:Ba,angleBetween:sg,normalisedExtentWithMetadata:og,findMinMax:ag}=Qu,Fi=class extends fs{constructor(e){super(e,new jr),this.shape="circle",this.interval=new Ra}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&ed>=c&&d<=p).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(a,n)=>{if(a.hidden||n.hidden)return!1;if(t==null)return a.box.collidesBBox(n.box);const r=a.box.clone().grow(t/2),l=n.box.clone().grow(t/2);return r.collidesBBox(l)},s=e[0],o=e.at(-1);s!==o&&Ur(s.x,o.x)&&Ur(s.y,o.y)&&(o.hidden=!0);for(let a=1;a0&&(l.hidden=!0,l.box=void 0);return}}for(const[a,n]of e.entries())a>0&&(n.hidden=!0,n.box=void 0)}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:p}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:p,fractionDigits:i}}};Fi.className="AngleNumberAxis",Fi.type="angle-number",h([Ba],Fi.prototype,"min",2),h([Ba],Fi.prototype,"max",2),h([Ba],Fi.prototype,"interval",2);import{_ModuleSupport as Jr}from"ag-charts-community";var{OrdinalTimeScale:ng,Property:rg,TimeAxisParentLevel:lg,lowestGranularityUnitForTicks:cg,lowestGranularityUnitForValue:hg,minimumTimeAxisDatumGranularity:pg,dateTruncationForDomain:dg,intervalUnit:Zr,intervalStep:Qr,intervalEpoch:el,intervalMilliseconds:tl}=Jr,js=class extends Jr.DiscreteTimeAxis{constructor(e){super(e,new ng),this.parentLevel=new lg}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=pg(e,t,void 0,void 0)}tickFormatParams(e,t,i,s){s??(s=cg(t));const o=dg(e),a=Zr(s),n=Qr(s),r=el(s);return{type:"date",unit:a,step:n,epoch:r,truncateDate:o}}datumFormatParams(e,t,i,s,o){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minimumTimeGranularity:f}=this,S=hg(e);f!=null&&tl(f)=this.axisInnerRadius&&s<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:s,axisOuterRadius:o}=this;if(!t)return{innerRadius:0,outerRadius:0};const a=l=>o+s-l;let n,r;if(i==="line")n=a(t.convert(this.value)),r=n;else{const l=Math.abs(t?.bandwidth??0),c=e.map(p=>t.convert(p));n=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=n,this.innerRadius=r}drawPolygon(e,t,i){for(const[s,o]of t.entries()){const a=e*Math.cos(o),n=e*Math.sin(o);s===0?i.path.moveTo(a,n):i.path.lineTo(a,n)}i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:s,shape:o,type:a,innerRadius:n,outerRadius:r}=this;if(!e||o!=="polygon"||!s||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),p=a==="line"?r-l:n+l;this.drawPolygon(p,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:s,sectorNode:o,shape:a,innerRadius:n,outerRadius:r}=this;if(!e||a!=="circle"||!s){o.visible=!1;return}o.visible=!0,o.startAngle=0,o.endAngle=2*Math.PI;const l=this.getPadding(),c=sl(t,n+l,i),p=sl(t,r-l,i);o.innerRadius=Math.min(c,p),o.outerRadius=Math.max(c,p),this.setSectorNodeProps(o)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:s,scale:o,shape:a,type:n}=this;if(!e||i.enabled===!1||!i.text||!o){s.visible=!1;return}const r=xg((i.positionAngle??0)-90),l=(mg(r,0)||r>0)&&rthis.tickFormatter(...x),domain:e,range:n,reverse:r,niceMode:t,visibleRange:s,defaultTickMinSpacing:l,labelOffset:a,sideFlag:o,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:p}=c,{ticks:d,rawTicks:u,rawTickCount:m,tickDomain:g,fractionDigits:y,niceDomain:f=e}=p,S=d.map(x=>this.getTickLabelProps(x,c));return this.generatedTicks={ticks:d,labels:S},{ticks:u,tickDomain:g,niceDomain:f,rawTickCount:m,fractionDigits:y,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=Js.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:s}=this;if(!e||!s)return;const o=e.length,a=(u,m)=>{const{stroke:g,lineDash:y}=e[m%o];u.stroke=g,u.strokeWidth=t,u.lineDash=y,u.fill=void 0},[n,r]=this.gridRange??[0,2*Math.PI],l=gg(r-n,2*Math.PI),d=i==="circle"?(u,m)=>{const{path:g}=u;g.clear(!0);const y=this.getTickRadius(m);l?(g.moveTo(y,0),g.arc(0,0,y,0,2*Math.PI)):(g.moveTo(y*Math.cos(n),y*Math.sin(n)),g.arc(0,0,y,al(n),al(r))),l&&g.closePath()}:(u,m)=>{const{path:g}=u,y=this.gridAngles;if(g.clear(!0),!y||y.length<3)return;const f=this.getTickRadius(m);for(const[S,x]of y.entries()){const v=f*Math.cos(x),b=f*Math.sin(x);S===0?g.moveTo(v,b):g.lineTo(v,b);for(const[k,A]of y.entries()){const I=f*Math.cos(A),D=f*Math.sin(A);k===0?g.moveTo(I,D):g.lineTo(I,D)}g.closePath()}g.closePath()};this.gridPathSelection.each((u,m,g)=>{a(u,g),d(u,m)})}updateTitle(){const e=n=>n.defaultValue,{title:t,range:i}=this,{formatter:s=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let o=!1;const a=t.caption.node;t.enabled&&(o=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-Ng.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(s,this.getTitleFormatterParams(this.scale.domain))),a.visible=o}updateCrossLines(){for(const e of this.crossLines)if(e instanceof Ga){const{shape:t,gridAngles:i,range:s,innerRadiusRatio:o}=this,a=s[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=a,e.axisInnerRadius=a*o}super.updateCrossLines()}createLabel(){return new Ka}getTickLabelProps(e,t){const{label:i}=this,{rotation:s,textBaseline:o,textAlign:a}=t,n=this.scale.range,r=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),p=r!==""&&r!=null,d=s;return{...this.getLabelStyles({value:e.tick,formattedValue:e.tickLabel}),tickId:e.tickId,rotation:d,text:r,textAlign:a,textBaseline:o,visible:p,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:n}}};Zs.CrossLineConstructor=Ga,h([Va],Zs.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:cl,Property:Wa,CategoryScale:hl}=ug,ui=class extends Zs{constructor(e){super(e,new hl),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,s=t.range[0],o=s*i;if(hl.is(t)){const a=t.domain,n=a.length-1-a.indexOf(e.tick);return n===0?o:t.inset+t.step*(n-.5)+t.bandwidth/2}else{const a=(s-o)/t.domain.length;return s-e.translation+o-a/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:s,legendItemName:o,key:a,source:n,property:r,domain:l,boundSeries:c}}};ui.className="RadiusCategoryAxis",ui.type="radius-category",h([Wa],ui.prototype,"groupPaddingInner",2),h([cl("scale","paddingInner"),Wa],ui.prototype,"paddingInner",2),h([cl("scale","paddingOuter"),Wa],ui.prototype,"paddingOuter",2);import{_ModuleSupport as Cg}from"ag-charts-community";var{Property:pl,normalisedExtentWithMetadata:Og,LinearScale:_g}=Cg,Ss=class extends Zs{constructor(e){super(e,new _g),this.shape="polygon"}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&es!==i).sort((s,o)=>o.tick-s.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],s=i*this.innerRadiusRatio;return i-e.translation+s}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:o}=Og(e,t,i);return{domain:s,clipped:o}}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:p}=t;return{type:"number",value:e,datum:s,seriesId:o,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:p,fractionDigits:i}}};Ss.className="RadiusNumberAxis",Ss.type="radius-number",h([pl],Ss.prototype,"min",2),h([pl],Ss.prototype,"max",2);var{ordinalTimeAxisOptionsDefs:wg,angleNumberAxisOptionsDefs:Eg,angleCategoryAxisOptionsDefs:Fg,radiusNumberAxisOptionsDefs:Bg,radiusCategoryAxisOptionsDefs:Gg}=Lu,dl={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:wg,create:e=>new js(e)},ul={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:Eg,create:e=>new Fi(e)},gl={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:Fg,create:e=>new di(e)},ml={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:Bg,create:e=>new Ss(e)},yl={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:Gg,create:e=>new ui(e)};import{_ModuleSupport as Vg}from"ag-charts-community";import{_ModuleSupport as Kg}from"ag-charts-community";var{Chart:Wg}=Kg,za=class extends Wg{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e,o=s.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=o,this.animationRect=o;for(const a of[t,i])a.translationX=Math.floor(o.x),a.translationY=Math.floor(o.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:o,paddedRect:s}})}getAriaLabel(){const e=this.series[0]?.type;if(e==null)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const i=[];t.length!==0&&i.push(t);for(const s of this.series)i.push(s.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};za.className="StandaloneChart",za.type="standalone";var{isAgStandaloneChartOptions:zg,standaloneChartOptionsDefs:$g}=Vg,fl={type:"chart",name:"standalone",enterprise:!0,options:$g,detect:zg,create(e,t){return new za(e,t)}};import{_ModuleSupport as Hg}from"ag-charts-community";import{_ModuleSupport as Xg}from"ag-charts-community";var{Chart:Yg,MercatorScale:Sl,ChartAxisDirection:Qs,Property:Ug}=Xg;function xl(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var eo=class extends Yg{constructor(e,t){super(e,t),this.ctx.zoomManager.updateAxes([Qs.X,Qs.Y])}getChartType(){return"topology"}async updateData(){await super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;for(const i of this.series)xl(i)&&i.setChartTopology(t)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:s}=e,o=s.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=o,this.animationRect=o;const a=this.series.filter(xl),n=a.reduce((c,p)=>{if(!p.visible)return c;const d=p.topologyBounds;return d==null?c:c==null?d:c.merge(d)},void 0);let r;if(n!=null){const{lon0:c,lat0:p,lon1:d,lat1:u}=n,m=[[c,p],[d,u]],g=Sl.bounds(m),{width:y,height:f}=o,S=Math.min(y/g.width,f/g.height),x=g.width*S,v=g.height*S,b=(y-x)/2,k=(f-v)/2,A=b,I=k,D=b+x,N=k+v,R=this.ctx.zoomManager.getAxisZoom(Qs.X),C=this.ctx.zoomManager.getAxisZoom(Qs.Y),w=(D-A)/(R.max-R.min),G=A-w*R.min,_=(N-I)/(1-C.min-(1-C.max)),E=I-_*(1-C.max);r=new Sl(m,[[G,E],[G+w,E+_]])}for(const c of a)c.scale=r;const l=this.series.some(c=>c.visible);t.visible=l;for(const c of[t,i])c.translationX=Math.floor(o.x),c.translationY=Math.floor(o.y),c.setClipRect(o.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:o,paddedRect:s}})}};eo.className="TopologyChart",eo.type="topology",h([Ug],eo.prototype,"topology",2);var{isAgTopologyChartOptions:qg,topologyChartOptionsDefs:jg}=Hg,bl={type:"chart",name:"topology",enterprise:!0,options:jg,detect:qg,create(e,t){return new eo(e,t)}};import{_ModuleSupport as Jg}from"ag-charts-community";import{_ModuleSupport as Zg}from"ag-charts-community";import{and as to,arrayOf as Qg,arrayOfDefs as vl,boolean as gi,constant as kl,greaterThan as Dl,lessThan as Il,number as Ct,numberRange as em,optionsDefs as Al,or as mi,ratio as io,required as tm,string as kt,typeUnion as im,union as sm}from"ag-charts-core";var{annotationCalloutStylesDefs:om,annotationNoteStylesDefs:am,annotationTextStylesDef:nm,annotationCommentStylesDefs:rm,annotationMeasurerStylesDefs:so,annotationQuickMeasurerStylesDefs:lm,annotationShapeStylesDefs:Ml,annotationChannelTextDefs:cm,annotationCrossLineStyleDefs:Nl,annotationFibonacciStylesDefs:Ll,annotationLineStyleDefs:Tl,annotationLineTextDefs:hm,annotationDisjointChannelStyleDefs:pm,annotationParallelChannelStyleDefs:dm}=Zg,xs=Al({__type:tm(kl("date")),value:mi(kt,Ct)},"a serializable date object"),Rl=mi(kt,Ct,xs),$a=mi(Rl,Al({value:Rl,groupPercentage:em(-1,2)})),Pl={...cm,label:kt},Ot={...hm,label:kt},ge={x:$a,y:Ct},um=im({line:{...Tl,start:ge,end:ge,text:Ot},"horizontal-line":{...Nl,value:$a,text:Ot},"vertical-line":{...Nl,value:$a,text:Ot},"disjoint-channel":{...pm,startHeight:Ct,endHeight:Ct,start:ge,end:ge,text:Pl},"parallel-channel":{...dm,height:Ct,start:ge,end:ge,text:Pl},"fibonacci-retracement":{...Ll,start:ge,end:ge,text:Ot,reverse:gi},"fibonacci-retracement-trend-based":{...Ll,start:ge,end:ge,endRetracement:ge,text:Ot,reverse:gi},callout:{...om,start:ge,end:ge,text:kt},comment:{...rm,...ge,text:kt},note:{...am,...ge,text:kt},text:{...nm,...ge,text:kt},arrow:{...Tl,text:Ot,start:ge,end:ge},"arrow-up":{...Ml,...ge},"arrow-down":{...Ml,...ge},"date-range":{...so,extendAbove:gi,extendBelow:gi,text:Ot,start:ge,end:ge},"price-range":{...so,extendLeft:gi,extendRight:gi,text:Ot,start:ge,end:ge},"date-price-range":{...so,text:Ot,start:ge,end:ge},"quick-date-price-range":{...so,...lm,text:Ot,start:ge,end:ge}},"an annotation initial state object"),gm={chartType:sm("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:vl(um),legend:vl({visible:gi,seriesId:kt,itemId:kt,legendItemName:kt},"legend state array"),zoom:{rangeX:{start:mi(Ct,xs),end:mi(Ct,xs)},rangeY:{start:mi(Ct,xs),end:mi(Ct,xs)},ratioX:{start:to(io,Il("end")),end:to(io,Dl("start"))},ratioY:{start:to(io,Il("end")),end:to(io,Dl("start"))},autoScaledAxes:Qg(kl("y"))}};import{_ModuleSupport as mm}from"ag-charts-community";import{array as ym,arrayOfDefs as fm,boolean as bs,callbackOf as Sm,color as oo,fontOptionsDef as xm,number as Cl,positiveNumber as gt,ratio as bm,typeUnion as vm}from"ag-charts-core";import{_ModuleSupport as Ol}from"ag-charts-community";import{_ModuleSupport as ao}from"ag-charts-community";function km(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function Dm(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as Im}from"ag-charts-community";var{Path:Am,Scalable:Mm,ExtendedPath2D:Nm,SceneChangeDetection:He,SceneArrayChangeDetection:Lm,BBox:yi,clippedRoundRect:_l}=Im,Ee=class extends Mm(Am){constructor(){super(...arguments),this.wickPath=new Nm,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:e,center:t,thickness:i,min:s,max:o}=this;return e?new yi(Math.min(s,o),t-i/2,Math.abs(o-s),i):new yi(t-i/2,Math.min(s,o),i,Math.abs(o-s))}computeDefaultGradientFillBBox(){const{horizontal:e,center:t,thickness:i,q1:s,q3:o}=this;return e?new yi(Math.min(s,o),t-i/2,Math.abs(o-s),i):new yi(t-i/2,Math.min(s,o),i,Math.abs(o-s))}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:e,crisp:t}=this;let{center:i,min:s,q1:o,median:a,q3:n,max:r}=this,l=i-e/2,c=i+e/2;if(t&&e>1){s=this.align(s),o=this.align(o),a=this.align(a),n=this.align(n),r=s+this.align(s,r-s);const p=this.align(e/2);i=this.align(i),l=i-p,c=i+p}return{center:i,x0:l,x1:c,min:s,max:r,q1:o,median:a,q3:n}}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,wickStroke:n,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:p,strokeAlignment:d,cornerRadius:u,capLengthRatio:m,horizontal:g}=this,{center:y,x0:f,x1:S,min:x,max:v,q1:b,median:k,q3:A}=this.alignedCoordinates(),I=this.layerManager?.canvas.pixelRatio??1,D=this.wickStrokeAlignment>0?I/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const R=n!=null&&n!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==o||p!=null&&p!==a?this.wickPath:e;if(Math.abs(S-f)<=3){Bi(R,g,y,x),Gi(R,g,y,v);return}const C=Math.min(x,v),w=Math.max(x,v),G=Math.min(b,A),_=Math.max(b,A),E=y-Math.abs((S-f)*m)/2,L=y+Math.abs((S-f)*m)/2;Bi(R,g,E,C-D),Gi(R,g,L,C-D),Bi(R,g,y-D,C-D),Gi(R,g,y-D,G+i/2),Bi(R,g,y-D,w+D),Gi(R,g,y-D,_-i/2),Bi(R,g,E,w+D),Gi(R,g,L,w+D);const P=i/2+d,T=i/2-d,M=_-G-2*T;if(M>0){const O=f+P,B=G+T,F=S-f-2*P,V={topLeft:u,topRight:u,bottomRight:u,bottomLeft:u};wl(e,g,O,B,F,M,V,new yi(O,B,F,k-B)),wl(e,g,O,B,F,M,V,new yi(O,k,F,B+M-k))}else{const O=(G+_)/2;Bi(e,g,f,O),Gi(e,g,S,O)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=o,wickLineDash:p=a,wickLineDashOffset:d=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,p!=null&&e.setLineDash([...p]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};h([He()],Ee.prototype,"horizontal",2),h([He()],Ee.prototype,"center",2),h([He()],Ee.prototype,"thickness",2),h([He()],Ee.prototype,"min",2),h([He()],Ee.prototype,"q1",2),h([He()],Ee.prototype,"median",2),h([He()],Ee.prototype,"q3",2),h([He()],Ee.prototype,"max",2),h([He()],Ee.prototype,"cornerRadius",2),h([He()],Ee.prototype,"crisp",2),h([He()],Ee.prototype,"strokeAlignment",2),h([He()],Ee.prototype,"wickStroke",2),h([He()],Ee.prototype,"wickStrokeWidth",2),h([He()],Ee.prototype,"wickStrokeOpacity",2),h([Lm()],Ee.prototype,"wickLineDash",2),h([He()],Ee.prototype,"wickLineDashOffset",2),h([He()],Ee.prototype,"capLengthRatio",2),h([He()],Ee.prototype,"wickStrokeAlignment",2);function Bi(e,t,i,s){t?e.moveTo(s,i):e.moveTo(i,s)}function Gi(e,t,i,s){t?e.lineTo(s,i):e.lineTo(i,s)}function wl(e,t,i,s,o,a,n,r){t?_l(e,s,i,a,o,n,r==null?void 0:new yi(r.y,r.x,r.height,r.width)):_l(e,i,s,o,a,n,r)}import{_ModuleSupport as Tm}from"ag-charts-community";var{BaseProperties:El,AbstractBarSeriesProperties:Rm,makeSeriesTooltip:Pm,Property:he,mergeDefaults:Cm}=Tm,Fl=class extends El{constructor(){super(...arguments),this.lengthRatio=.5}};h([he],Fl.prototype,"lengthRatio",2);var Vi=class extends El{};h([he],Vi.prototype,"stroke",2),h([he],Vi.prototype,"strokeWidth",2),h([he],Vi.prototype,"strokeOpacity",2),h([he],Vi.prototype,"lineDash",2),h([he],Vi.prototype,"lineDashOffset",2);var me=class extends Rm{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new Fl,this.whisker=new Vi,this.tooltip=Pm()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}=this,a=super.toJson();return a.whisker=Cm(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:o}),a}};h([he],me.prototype,"xKey",2),h([he],me.prototype,"minKey",2),h([he],me.prototype,"q1Key",2),h([he],me.prototype,"medianKey",2),h([he],me.prototype,"q3Key",2),h([he],me.prototype,"maxKey",2),h([he],me.prototype,"xName",2),h([he],me.prototype,"yName",2),h([he],me.prototype,"minName",2),h([he],me.prototype,"q1Name",2),h([he],me.prototype,"medianName",2),h([he],me.prototype,"q3Name",2),h([he],me.prototype,"maxName",2),h([he],me.prototype,"fill",2),h([he],me.prototype,"fillOpacity",2),h([he],me.prototype,"stroke",2),h([he],me.prototype,"strokeWidth",2),h([he],me.prototype,"strokeOpacity",2),h([he],me.prototype,"lineDash",2),h([he],me.prototype,"lineDashOffset",2),h([he],me.prototype,"cornerRadius",2),h([he],me.prototype,"styler",2),h([he],me.prototype,"itemStyler",2),h([he],me.prototype,"cap",2),h([he],me.prototype,"whisker",2),h([he],me.prototype,"tooltip",2);var{fixNumericExtent:Om,keyProperty:_m,mergeDefaults:Ha,SeriesNodePickMode:Bl,SMALLEST_KEY_INTERVAL:wm,valueProperty:vs,diff:Em,animationValidation:Fm,computeBarFocusBounds:Bm,createDatumId:Gm,HighlightState:Xa,ContinuousScale:Vm,ChartAxisDirection:Km,motion:Gl,getItemStyles:Wm,applyShapeFillBBox:zm,calculateSegments:$m,toHighlightString:Hm}=ao,Xm=class extends ao.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.minKey=s.properties.minKey,this.q1Key=s.properties.q1Key,this.medianKey=s.properties.medianKey,this.q3Key=s.properties.q3Key,this.maxKey=s.properties.maxKey}},no=class extends ao.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Bl.NEAREST_NODE,Bl.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new me,this.NodeEvent=Xm}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:s,medianKey:o,q3Key:a,maxKey:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:p,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),m=[];r&&this.processedData&&m.push(Em(this.id,this.processedData)),r&&m.push(Fm());const{processedData:g}=await this.requestDataModel(e,this.data,{props:[_m(t,d,{id:"xValue"}),vs(i,u,{id:"minValue"}),vs(s,u,{id:"q1Value"}),vs(o,u,{id:"medianValue"}),vs(a,u,{id:"q3Value"}),vs(n,u,{id:"maxValue"}),...p?[wm]:[],...m]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:o,def:a}=i.resolveProcessedDataDefById(this,"xValue"),n=t.domain.keys[o];return a.type==="key"&&a.valueType==="category"?n:this.padBandExtent(n)}const s=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return Om(s)}getSeriesRange(e,t){return this.domainForVisibleRange(Km.Y,["maxValue","minValue"],"xValue",t)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&i&&s&&o))return;const{xKey:a}=this.properties,n=[],r=t.resolveKeysById(this,"xValue",i),l=t.resolveColumnById(this,"minValue",i),c=t.resolveColumnById(this,"q1Value",i),p=t.resolveColumnById(this,"medianValue",i),d=t.resolveColumnById(this,"q3Value",i),u=t.resolveColumnById(this,"maxValue",i),{barWidth:m,groupIndex:g}=this.updateGroupScale(s),y=Vm.is(s.scale)?m*-.5:0,{groupScale:f}=this,S=this.isVertical(),x=$m(this.properties.segmentation,s,o,this.chart.seriesRect,this.ctx.scene),v={itemId:a,nodeData:n,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:Wm(this.getItemStyle.bind(this)),segments:x};if(!e)return v;const b=i.dataSources.get(this.id)?.data??[];for(const[k,A]of b.entries()){const I=r[k];if(I==null)continue;const D=l[k],N=c[k],R=p[k],C=d[k],w=u[k];if([D,N,R,C,w].some(O=>typeof O!="number")||D>N||N>R||R>C||C>w)continue;const G={xValue:s.scale.convert(I),minValue:o.scale.convert(D),q1Value:o.scale.convert(N),medianValue:o.scale.convert(R),q3Value:o.scale.convert(C),maxValue:o.scale.convert(w)},_=m;G.xValue+=f.convert(String(g))+y+_/2;const E=Math.abs(G.q3Value-G.q1Value),L=G.xValue,P=Math.min(G.q3Value,G.q1Value)+E/2,T={x:S?L:P,y:S?P:L};let M;S?M={x:T.x-_/2,y:G.minValue,width:_,height:G.maxValue-G.minValue}:M={x:G.minValue,y:T.y-_/2,width:G.maxValue-G.minValue,height:_},n.push({series:this,itemId:I,datum:A,datumIndex:k,xKey:a,bandwidth:_,scaledValues:G,midPoint:T,focusRect:M})}return v}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this.getStyle(!1,!1,Xa.None);return{marker:{fill:ao.deepClone(e),fillOpacity:s,stroke:t,strokeOpacity:o,strokeWidth:i,lineDash:a,lineDashOffset:n}}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:o,yName:a,showInLegend:n,legendItemName:r}=this.properties;return!o||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:r??a??t},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!n}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:p,q1Name:d,q3Key:u,q3Name:m,minKey:g,minName:y,maxKey:f,maxName:S,legendItemName:x,tooltip:v}=o,b=this.getCategoryAxis(),k=this.getValueAxis();if(!i||!s||!b||!k)return;const A=s.dataSources.get(this.id)?.data[e],I=i.resolveKeysById(this,"xValue",s)[e],D=i.resolveColumnById(this,"minValue",s)[e],N=i.resolveColumnById(this,"q1Value",s)[e],R=i.resolveColumnById(this,"medianValue",s)[e],C=i.resolveColumnById(this,"q3Value",s)[e],w=i.resolveColumnById(this,"maxValue",s)[e];if(I==null)return;const G=this.getItemStyle(e,!1),_=[{label:y,fallbackLabel:g,value:this.getAxisValueText(k,"tooltip",D,A,g,x)},{label:d,fallbackLabel:p,value:this.getAxisValueText(k,"tooltip",N,A,p,x)},{label:c,fallbackLabel:l,value:this.getAxisValueText(k,"tooltip",R,A,l,x)},{label:m,fallbackLabel:u,value:this.getAxisValueText(k,"tooltip",C,A,u,x)},{label:S,fallbackLabel:f,value:this.getAxisValueText(k,"tooltip",w,A,f,x)}];return this.formatTooltipWithContext(v,{heading:this.getAxisValueText(b,"tooltip",I,A,a,x),title:x??r,symbol:this.legendItemSymbol(),data:_},{seriesId:t,datum:A,title:r,xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:p,q1Name:d,q3Key:u,q3Name:m,minKey:g,minName:y,maxKey:f,maxName:S,...G})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:s}=km(t);Gl.resetMotion([e],Dm(t)),Gl.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,s,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}makeStylerParams(e,t){const{id:i}=this,{cornerRadius:s,cap:{lengthRatio:o},fill:a,fillOpacity:n,lineDash:r,lineDashOffset:l,stroke:c,strokeOpacity:p,strokeWidth:d,maxKey:u,maxName:m,medianKey:g,medianName:y,minKey:f,minName:S,q1Key:x,q1Name:v,q3Key:b,q3Name:k,whisker:{lineDash:A,lineDashOffset:I,stroke:D,strokeOpacity:N,strokeWidth:R},xKey:C,xName:w,yName:G}=this.properties,_=Hm(t??Xa.None);return{cap:{lengthRatio:o},cornerRadius:s,fill:a,fillOpacity:n,highlightState:_,highlighted:e,lineDash:r,lineDashOffset:l,maxKey:u,maxName:m??u,medianKey:g,medianName:y??g,minKey:f,minName:S??f,q1Key:x,q1Name:v??x,q3Key:b,q3Name:k??b,seriesId:i,stroke:c,strokeOpacity:p,strokeWidth:d,whisker:{lineDash:A??r,lineDashOffset:I??l,stroke:D??c,strokeOpacity:N??p,strokeWidth:R??d},xKey:C,xName:w??C,yName:G}}getStyle(e,t,i){const{cap:s,cornerRadius:o,fill:a,fillOpacity:n,lineDash:r,lineDashOffset:l,stroke:c,strokeOpacity:p,strokeWidth:d,styler:u,whisker:m}=this.properties;let g={};if(!e&&u){const y=this.makeStylerParams(t,i);g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,y)??{},{pick:!1})??{}}return{cornerRadius:g.cornerRadius??o,fill:g.fill??a,fillOpacity:g.fillOpacity??n,lineDash:g.lineDash??r,lineDashOffset:g.lineDashOffset??l,opacity:1,stroke:g.stroke??c,strokeOpacity:g.strokeOpacity??p,strokeWidth:g.strokeWidth??d,cap:{lengthRatio:g.cap?.lengthRatio??s.lengthRatio},whisker:{lineDash:g.whisker?.lineDash??m.lineDash,lineDashOffset:g.whisker?.lineDashOffset??m.lineDashOffset,stroke:g.whisker?.stroke??m.stroke,strokeOpacity:g.whisker?.strokeOpacity??m.strokeOpacity,strokeWidth:g.whisker?.strokeWidth??m.strokeWidth}}}getItemStyle(e,t,i){const{properties:s}=this,{itemStyler:o}=s,a=this.getHighlightStyle(t,e,i);let n=Ha(a,this.getStyle(e===void 0,t,i));if(o!=null&&e!=null){const u=this.cachedDatumCallback(Gm(e,t?"highlight":"node"),()=>{const m=this.makeItemStylerParams(e,t,n);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(o,m))});u&&(n=Ha(u,n))}const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:p,lineDashOffset:d}=n;return n.whisker=Ha(n.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:p,lineDashOffset:d}),n}makeItemStylerParams(e,t,i){const{id:s}=this,{xKey:o,minKey:a,q1Key:n,medianKey:r,q3Key:l,maxKey:c}=this.properties,p=this.processedData?.dataSources.get(s)?.data[e],d=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(d,t,e),m=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:p,xKey:o,minKey:a,q1Key:n,medianKey:r,q3Key:l,maxKey:c,highlighted:t,highlightState:u,...i,fill:m}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,o)=>{const a=this.getHighlightState(i,t,o.datumIndex);o.style=this.getItemStyle(o.datumIndex,t,a)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const o=this.isVertical(),a=this.ctx.highlightManager.getActiveHighlight(),n=this.getShapeFillBBox(),r=this.getStyle(!1,!1,Xa.None).strokeWidth/2,l=s.whisker.strokeWidth??s.strokeWidth;e.each((c,p)=>{const d=p.style??i.styles[this.getHighlightState(a,t,p.datumIndex)];zm(c,d.fill,n),c.fill=d.fill,c.fillOpacity=d.fillOpacity,c.stroke=d.stroke,c.strokeWidth=d.strokeWidth,c.strokeOpacity=d.strokeOpacity,c.lineDash=d.lineDash,c.lineDashOffset=d.lineDashOffset,c.wickStroke=d.whisker.stroke,c.wickStrokeWidth=d.whisker.strokeWidth,c.wickStrokeOpacity=d.whisker.strokeOpacity,c.wickLineDash=d.whisker.lineDash,c.wickLineDashOffset=d.whisker.lineDashOffset,c.cornerRadius=d.cornerRadius,c.crisp=!0,c.horizontal=!o,c.center=p.scaledValues.xValue,c.thickness=p.bandwidth,c.min=p.scaledValues.minValue,c.q1=p.scaledValues.q1Value,c.median=p.scaledValues.medianValue,c.q3=p.scaledValues.q3Value,c.max=p.scaledValues.maxValue,c.capLengthRatio=d.cap.lengthRatio,c.strokeAlignment=r,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new Ee}computeFocusBounds({datumIndex:e}){return Bm(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};no.className="BoxPlotSeries",no.type="box-plot";import{_ModuleSupport as Ym}from"ag-charts-community";import{boolean as Um,constant as qm,required as fi,shapeSegmentation as jm,string as nt}from"ag-charts-core";var{boxPlotSeriesThemeableOptionsDef:Jm,commonSeriesOptionsDefs:Zm}=Ym,Qm={...Zm,...Jm,type:fi(qm("box-plot")),xKey:fi(nt),minKey:fi(nt),q1Key:fi(nt),medianKey:fi(nt),q3Key:fi(nt),maxKey:fi(nt),xName:nt,yName:nt,minName:nt,q1Name:nt,medianName:nt,q3Name:nt,maxName:nt,grouped:Um,legendItemName:nt,segmentation:jm};import{_ModuleSupport as ey}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:Vl},multiSeriesHighlightStyle:ty,FILL_GRADIENT_LINEAR_DEFAULTS:iy,FILL_IMAGE_DEFAULTS:sy,FILL_PATTERN_DEFAULTS:oy,SAFE_FILL_OPERATION:ay,SEGMENTATION_DEFAULTS:ny}=ey,ry={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[ay,{$ref:"chartBackgroundColor"},.7]}]},["gradient",iy],["image",sy],["pattern",oy]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:ty(),segmentation:ny},axes:{[Vl.NUMBER]:{crosshair:{snap:!1}},[Vl.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},XT={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:e=>new no(e),predictAxis:Ol.predictCartesianTimeAxis,defaultAxes:Ol.DIRECTION_SWAP_AXES,themeTemplate:ry,groupable:!0},Ya={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:Qm,create:e=>new no(e)};import{_ModuleSupport as ly}from"ag-charts-community";import{_ModuleSupport as cy}from"ag-charts-community";import{_ModuleSupport as Ua}from"ag-charts-community";import{Logger as Kl}from"ag-charts-core";import{_ModuleSupport as hy}from"ag-charts-community";var{AGGREGATION_SPAN:Wl,AGGREGATION_INDEX_X_MAX:py,AGGREGATION_INDEX_X_MIN:dy,AGGREGATION_INDEX_Y_MAX:uy,AGGREGATION_INDEX_Y_MIN:gy,aggregationDomain:my,aggregationRangeFittingPoints:yy,compactAggregationIndices:fy,createAggregationIndices:Sy}=hy,xy=1e3,zl=dy,by=uy,vy=gy,$l=py;function ky(e,t,i,s,o,a){if(t.length64;)({indexData:c,valueData:p,maxRange:l}=fy(c,p,l)),d.push({maxRange:l,indexData:c});return d.reverse(),d}var{fixNumericExtent:Dy,keyProperty:Iy,createDatumId:Hl,SeriesNodePickMode:Xl,ChartAxisDirection:Yl,SMALLEST_KEY_INTERVAL:Ay,valueProperty:ro,diff:My,animationValidation:Ny,computeBarFocusBounds:Ly,visibleRangeIndices:Ul,BandScale:Ty,processedDataIsAnimatable:Ry,mergeDefaults:ql,simpleMemorize2:Py,getItemStylesPerItemId:Cy}=Ua,Oy=Py(ky),_y=class extends Ua.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.openKey=s.properties.openKey,this.closeKey=s.properties.closeKey,this.highKey=s.properties.highKey,this.lowKey=s.properties.lowKey}},jl=class extends Ua.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Xl.AXIS_ALIGNED,Xl.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=_y,this.dataAggregationFilters=void 0}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:s,highKey:o,lowKey:a}=this.properties,n=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:p,yScaleType:d}=this.getScaleInformation({xScale:r,yScale:l}),u=[];n&&(this.processedData&&u.push(My(this.id,this.processedData)),u.push(Ny())),i&&u.push(ro(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:m,processedData:g}=await this.requestDataModel(e,this.data,{props:[Iy(t,p,{id:"xValue"}),ro(s,d,{id:"closeValue"}),ro(o,d,{id:"highValue"}),ro(a,d,{id:"lowValue"}),...c?[Ay]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(m,g),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||Ry(t))return;const i=this.axes[Yl.X];if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),o=e.resolveColumnById(this,"highValue",t),a=e.resolveColumnById(this,"lowValue",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n];return Oy(i.scale.type,s,o,a,r,t.reduced?.smallestKeyInterval)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:o,def:a}=i.resolveProcessedDataDefById(this,"xValue"),n=t.domain.keys[o];return a.type==="key"&&a.valueType==="category"?n:this.padBandExtent(n)}const s=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return Dy(s)}getSeriesRange(e,t){return this.domainForVisibleRange(Yl.Y,["highValue","lowValue"],"xValue",t)}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!(t&&i&&s&&o))return;const a=[],{xKey:n,highKey:r,lowKey:l}=this.properties,c=i.dataSources.get(this.id)?.data??[],p=t.resolveKeysById(this,"xValue",i),d=t.resolveColumnById(this,"openValue",i),u=t.resolveColumnById(this,"closeValue",i),m=t.resolveColumnById(this,"highValue",i),g=t.resolveColumnById(this,"lowValue",i),{groupScale:y}=this,{barWidth:f,groupIndex:S}=this.updateGroupScale(s),x=y.convert(String(S)),v=f>=1?f:y.rawBandwidth,b=Ty.is(s.scale),k={itemId:n,nodeData:a,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:Cy(this.getItemStyle.bind(this),"up","down")};if(!e)return k;const A=(_,E,L,P,T,M,O,B)=>{const F=c[_],V=b?O/2:0,W=s.scale.convert(E)+x+V,K=o.scale.convert(L),z=o.scale.convert(P),$=o.scale.convert(T),Z=o.scale.convert(M),q=P>L,Y=q?"up":"down",Q=Math.min($,Z),ie=Math.max($,Z)-Q,U={x:W,y:Q+ie/2};a.push({series:this,itemId:Y,datum:F,datumIndex:_,xKey:n,xValue:E,openValue:L,closeValue:P,highValue:T,lowValue:M,midPoint:U,aggregatedValue:P,isRising:q,centerX:W,width:O,y:Q,height:ie,yOpen:K,yClose:z,crisp:B})},{dataAggregationFilters:I}=this,D=s.scale,[N,R]=D.range,C=Math.abs(R-N),w=_=>D.convert(p[_])+x,G=I?.find(_=>_.maxRange>C);if(G==null){const _=i.invalidData?.get(this.id);let[E,L]=Ul(1,c.length,s.range,P=>{const T=b?0:-v/2,M=w(P)+T;return[M,M+v]});i.input.count<1e3&&(E=0,L=i.input.count);for(let P=E;P=M&&B>=O;if(!V){Kl.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!W){Kl.warnOnce(`invalid high value for key [${r}] in data element, high value cannot be lower than datum open or close values.`);continue}A(P,T,M,O,B,F,v,!0)}}else{const{maxRange:_,indexData:E}=G,[L,P]=Ul(1,_,s.range,T=>{const M=T*Wl,O=E[M+zl],B=E[M+$l];if(O===-1)return;const F=b?0:-v/2;return[w(O)+F,w(B)+F+v]});for(let T=L;T{const m=this.makeItemStylerParams(s,e,t,p);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",s],this.callWithContext(r,m))});u&&(p=ql(u,p))}return p}makeItemStylerParams(e,t,i,s){const{id:o,properties:a,processedData:n}=this,{xKey:r,openKey:l,closeKey:c,highKey:p,lowKey:d}=a,u=n.dataSources.get(o)?.data[t],m=this.ctx.highlightManager?.getActiveHighlight(),g=this.getHighlightStateString(m,i,t),y={seriesId:o,datum:u,itemId:e,xKey:r,openKey:l,closeKey:c,highKey:p,lowKey:d,highlighted:i,highlightState:g,...s};return"fill"in y&&"fill"in s&&(y.fill=this.filterItemStylerFillParams(s.fill)??s.fill),y}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yName:r,openKey:l,openName:c,highKey:p,highName:d,lowKey:u,lowName:m,closeKey:g,closeName:y,legendItemName:f,tooltip:S}=o,x=this.getCategoryAxis(),v=this.getValueAxis();if(!i||!s||!x||!v)return;const b=s.dataSources.get(this.id)?.data[e],k=i.resolveKeysById(this,"xValue",s)[e],A=i.resolveColumnById(this,"openValue",s)[e],I=i.resolveColumnById(this,"highValue",s)[e],D=i.resolveColumnById(this,"lowValue",s)[e],N=i.resolveColumnById(this,"closeValue",s)[e];if(k==null)return;const R=N>=A?"up":"down",C=this.properties.item[R],w=this.getItemStyle(e,!1),G={fill:C.fill??C.stroke,fillOpacity:C.fillOpacity??C.strokeOpacity??1,stroke:C.stroke,strokeWidth:C.strokeWidth??1,strokeOpacity:C.strokeOpacity??1,lineDash:C.lineDash??[0],lineDashOffset:C.lineDashOffset??0};return this.formatTooltipWithContext(S,{heading:this.getAxisValueText(x,"tooltip",k,b,a,f),title:f,symbol:{marker:G},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(v,"tooltip",A,b,l,f)},{label:d,fallbackLabel:p,value:this.getAxisValueText(v,"tooltip",I,b,p,f)},{label:m,fallbackLabel:u,value:this.getAxisValueText(v,"tooltip",D,b,u,f)},{label:y,fallbackLabel:g,value:this.getAxisValueText(v,"tooltip",N,b,g,f)}]},{seriesId:t,datum:b,title:r,itemId:R,xKey:a,xName:n,yName:r,openKey:l,openName:c,highKey:p,highName:d,lowKey:u,lowName:m,closeKey:g,closeName:y,...w})}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:s,width:o,height:a}=t,n={x:i-o/2,y:s,width:o,height:a};return Ly(this,n)}};import{_ModuleSupport as wy}from"ag-charts-community";import{_ModuleSupport as Ey}from"ag-charts-community";var{Path:Fy,SceneChangeDetection:jt,BBox:By}=Ey,Wt=class extends Fy{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}computeBBox(){const{centerX:e,y:t,width:i,height:s}=this;return new By(e-i/2,t,i,s)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:e,width:t,height:i,crisp:s}=this;let{centerX:o,yOpen:a,yClose:n}=this,r=o-t/2,l=o+t/2,c=e,p=e+i;if(s&&t>1){if(o=this.align(o),a<=n){const u=this.align(a,n-a);a=this.align(a),n=a+u}else{const u=this.align(n,a-n);n=this.align(n),a=n+u}const d=this.align(t/2);r=o-d,l=o+d,c=this.align(e),p=c+this.align(c,i)}return{centerX:o,x0:r,x1:l,y0:c,y1:p,yOpen:a,yClose:n}}executeStroke(e,t){const{width:i,strokeWidth:s}=this;i0?l/this.strokeAlignment/2%1:0;e.clear(),e.moveTo(t-c,o),e.lineTo(t-c,a),Math.abs(s-i)>1&&(e.moveTo(i,n-c),e.lineTo(t-c,n-c),e.moveTo(t-c,r-c),e.lineTo(s,r-c))}};h([jt()],Jl.prototype,"strokeAlignment",2);var{SceneArrayChangeDetection:Gy,SceneChangeDetection:ks,ExtendedPath2D:Vy,BBox:Ky}=wy,Si=class extends Wt{constructor(){super(...arguments),this.wickPath=new Vy,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}computeDefaultGradientFillBBox(){const{width:e,centerX:t,yOpen:i,yClose:s}=this,o=Math.min(i,s),n=Math.max(i,s)-o,r=t-e/2,l=t+e/2;return new Ky(r,o,l-r,n)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,wickStroke:n,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:p}=this,{centerX:d,x0:u,x1:m,y0:g,y1:y,yOpen:f,yClose:S}=this.alignedCoordinates(),x=this.layerManager?.canvas.pixelRatio??1,v=this.wickStrokeAlignment>0?x/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const k=n!=null&&n!==t||r!=null&&r!==i||l!=null&&l!==s||c!=null&&c!==o||p!=null&&p!==a?this.wickPath:e;if(Math.abs(m-u)<=3){k.moveTo(d-v,g),k.lineTo(d-v,y);return}const A=Math.min(f,S),I=Math.max(f,S),D=i/2;k.moveTo(d-v,g),k.lineTo(d-v,A+D),k.moveTo(d-v,y),k.lineTo(d-v,I-D);const N=I-A-2*D;if(N>0)e.rect(u+D,A+D,m-u-2*D,N);else{const R=(A+I)/2;e.moveTo(u,R),e.lineTo(m,R)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,wickStroke:r=i,wickStrokeWidth:l=s,wickStrokeOpacity:c=o,wickLineDash:p=a,wickLineDashOffset:d=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,p!=null&&e.setLineDash([...p]),e.lineDashOffset=d,e.stroke(t.getPath2D()))}};h([ks()],Si.prototype,"wickStroke",2),h([ks()],Si.prototype,"wickStrokeWidth",2),h([ks()],Si.prototype,"wickStrokeOpacity",2),h([Gy()],Si.prototype,"wickLineDash",2),h([ks()],Si.prototype,"wickLineDashOffset",2),h([ks()],Si.prototype,"wickStrokeAlignment",2);import{_ModuleSupport as Wy}from"ag-charts-community";import{_ModuleSupport as zy}from"ag-charts-community";var{BaseProperties:Zl,Property:Me,AbstractBarSeriesProperties:$y,makeSeriesTooltip:Hy}=zy,xi=class extends Zl{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};h([Me],xi.prototype,"stroke",2),h([Me],xi.prototype,"strokeWidth",2),h([Me],xi.prototype,"strokeOpacity",2),h([Me],xi.prototype,"lineDash",2),h([Me],xi.prototype,"lineDashOffset",2);var qa=class extends Zl{constructor(){super(...arguments),this.up=new xi,this.down=new xi}};h([Me],qa.prototype,"up",2),h([Me],qa.prototype,"down",2);var lt=class extends $y{};h([Me],lt.prototype,"xKey",2),h([Me],lt.prototype,"openKey",2),h([Me],lt.prototype,"closeKey",2),h([Me],lt.prototype,"highKey",2),h([Me],lt.prototype,"lowKey",2),h([Me],lt.prototype,"xName",2),h([Me],lt.prototype,"yName",2),h([Me],lt.prototype,"openName",2),h([Me],lt.prototype,"closeName",2),h([Me],lt.prototype,"highName",2),h([Me],lt.prototype,"lowName",2);var lo=class extends lt{constructor(){super(...arguments),this.tooltip=Hy(),this.item=new qa}getStyle(e){const{strokeWidth:t,strokeOpacity:i,stroke:s,lineDash:o,lineDashOffset:a}=this.item[e];return{stroke:s,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:a,opacity:1}}};h([Me],lo.prototype,"tooltip",2),h([Me],lo.prototype,"item",2),h([Me],lo.prototype,"itemStyler",2);var{BaseProperties:ja,makeSeriesTooltip:Xy,Property:Fe}=Wy,Ki=class extends ja{};h([Fe],Ki.prototype,"stroke",2),h([Fe],Ki.prototype,"strokeWidth",2),h([Fe],Ki.prototype,"strokeOpacity",2),h([Fe],Ki.prototype,"lineDash",2),h([Fe],Ki.prototype,"lineDashOffset",2);var Dt=class extends ja{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Ki}};h([Fe],Dt.prototype,"fill",2),h([Fe],Dt.prototype,"fillOpacity",2),h([Fe],Dt.prototype,"stroke",2),h([Fe],Dt.prototype,"strokeWidth",2),h([Fe],Dt.prototype,"strokeOpacity",2),h([Fe],Dt.prototype,"lineDash",2),h([Fe],Dt.prototype,"lineDashOffset",2),h([Fe],Dt.prototype,"cornerRadius",2),h([Fe],Dt.prototype,"wick",2);var Ja=class extends ja{constructor(){super(...arguments),this.up=new Dt,this.down=new Dt}};h([Fe],Ja.prototype,"up",2),h([Fe],Ja.prototype,"down",2);var co=class extends lt{constructor(){super(),this.item=new Ja,this.tooltip=Xy(),this.highlightStyle.deprecated=!1}getStyle(e){const{fill:t,fillOpacity:i,strokeWidth:s,strokeOpacity:o,stroke:a,lineDash:n,lineDashOffset:r,cornerRadius:l,wick:c}=this.item[e];return{fill:t,fillOpacity:i,stroke:a,strokeWidth:s,strokeOpacity:o,lineDash:n,lineDashOffset:r,cornerRadius:l,opacity:1,wick:c}}};h([Fe],co.prototype,"item",2),h([Fe],co.prototype,"tooltip",2),h([Fe],co.prototype,"itemStyler",2);var{isGradientFill:Ql,isPatternFill:Za,isImageFill:Qa,applyShapeStyle:Yy}=cy,ho=class extends jl{constructor(){super(...arguments),this.properties=new co}nodeFactory(){const e=new Si;return e.lineCap="butt",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemId)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:n}=s.item;e.each((r,l)=>{const{centerX:c,width:p,y:d,height:u,yOpen:m,yClose:g,crisp:y}=l,f=l.isRising?a:n,S=l.style??i.styles[l.itemId][this.getHighlightState(o,t,l.datumIndex)];r.centerX=c,r.width=p,r.y=d,r.height=u,r.yOpen=m,r.yClose=g,r.crisp=y,Yy(r,S,this.getShapeFillBBox());const x=S?.wick;r.wickStroke=x?.stroke,r.wickStrokeWidth=x?.strokeWidth,r.wickStrokeOpacity=x?.strokeOpacity,r.wickLineDash=x?.lineDash,r.wickLineDashOffset=x?.lineDashOffset,r.wickStrokeAlignment=f.wick.strokeWidth??f.strokeWidth})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=Ql(e.fill)?e.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:Za(e.fill)||Qa(e.fill)?e.stroke:e.fill,stop:0},{color:Za(e.fill)||Qa(e.fill)?e.stroke:e.fill,stop:.5}],s=Ql(t.fill)?t.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:Za(t.fill)||Qa(t.fill)?t.stroke:t.fill,stop:.5}],o={type:"gradient",gradient:"linear",rotation:90,colorStops:[...i,...s],reverse:!1},a={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:o,fillOpacity:e.fillOpacity,stroke:a,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:s,ctx:{legendManager:o}}=this,{xKey:a,yName:n,showInLegend:r,legendItemName:l}=this.properties;return!i?.data.length||!a||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&o.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??n??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}hasItemStylers(){return this.properties.itemStyler!=null}};ho.className="CandleStickSeries",ho.type="candlestick";import{_ModuleSupport as Uy}from"ag-charts-community";import{boolean as qy,constant as jy,number as Jy,required as Wi,string as It,undocumented as ec}from"ag-charts-core";var{commonSeriesOptionsDefs:Zy,candlestickSeriesThemeableOptionsDef:Qy}=Uy,en={...Zy,...Qy,type:Wi(jy("candlestick")),xKey:Wi(It),openKey:Wi(It),highKey:Wi(It),lowKey:Wi(It),closeKey:Wi(It),xName:It,yName:It,openName:It,highName:It,lowName:It,closeName:It};en.pickOutsideVisibleMinorAxis=ec(qy),en.focusPriority=ec(Jy);import{_ModuleSupport as ef}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:tc},multiSeriesHighlightStyle:tf,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:sf,FILL_IMAGE_DEFAULTS:of,FILL_PATTERN_KEYED_DEFAULTS:af}=ef;function ic(e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},e==="up"?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},["gradient",sf(e)],["image",of],["pattern",af(e)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]}}}var nf={series:{item:{up:ic("up"),down:ic("down")},highlightStyle:{item:{strokeWidth:3}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:tf()},animation:{enabled:!1},axes:{[tc.NUMBER]:{crosshair:{snap:!1}},[tc.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:sc,CARTESIAN_POSITION:oc}=ly.ThemeConstants,aR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:e=>new ho(e),defaultAxes:[{type:sc.NUMBER,position:oc.LEFT},{type:sc.ORDINAL_TIME,position:oc.BOTTOM}],themeTemplate:nf,groupable:!1},tn={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:en,create:e=>new ho(e)};import{_ModuleSupport as rf}from"ag-charts-community";import{_ModuleSupport as po}from"ag-charts-community";import{Logger as lf,toPlainText as cf}from"ag-charts-core";import{Logger as hf,cachedTextMeasurer as uo,findMaxValue as ac,wrapLines as nc}from"ag-charts-core";function pf(e,t){const{fontSize:i,minimumFontSize:s=i}=e,{fontSize:o,minimumFontSize:a=o}=t,n=i-s,r=o-a;let l=e.fontSize,c=t.fontSize;const p=[{labelFontSize:i,secondaryLabelFontSize:o}];for(;l>s||c>a;){const d=n>0?(l-s)/n:-1,u=r>0?(c-a)/r:-1;d>u?l--:c--,p.push({labelFontSize:l,secondaryLabelFontSize:c})}return p.reverse(),p}function rc(e,t,i,s,{padding:o},a){const{spacing:n=0}=t,r=2*o,l=2*o+n,c=(t.minimumFontSize??t.fontSize)+(s.minimumFontSize??s.fontSize);if(c>a(c+l,!1).height-l)return;const p=pf(t,s),d={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},u={fontFamily:s.fontFamily,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let m,g;return ac(0,p.length-1,y=>{const{labelFontSize:f,secondaryLabelFontSize:S}=p[y],x=y===0,v={...d,fontSize:f},b={...u,fontSize:S},k=uo(v).lineHeight(),A=uo(b).lineHeight(),I=a(k+A+l,x),D=I.width-r,N=I.height-l;if(k+A>N||((m==null||m.fontSize!==f)&&(m=cc(t,e,D,N,v,t.wrapping,x?t.overflowStrategy:"hide")),m==null||m.width>D||m.height>N)||((g==null||g.fontSize!==S)&&(g=cc(s,i,D,N,b,s.wrapping,x?s.overflowStrategy:"hide")),g==null))return;const R=m.height+g.height;if(!(g.width>D||R>N))return{width:Math.max(m.width,g.width),height:R+n,meta:I.meta,label:m,secondaryLabel:g}})}function Ds(e,t,{padding:i},s){const o=2*i,a=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),n={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return ac(a,t.fontSize,r=>{const l={...n,fontSize:r},c=uo(l),p=r===a,d=t.lineHeight??c.lineHeight(),u=s(d+o,p),m=u.width-o,g=u.height-o;if(d>g||m<0)return;const y=nc(e,{maxWidth:m,maxHeight:g,font:l,textWrap:t.wrapping,overflow:(p?t.overflowStrategy:null)??"hide"});if(!y.length)return;const{width:f,height:S}=c.measureLines(y),x=y.join(`
+`);return[{width:f,height:S,text:x,fontSize:r,lineHeight:d},u.meta]})}function lc(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function sn(e,t,i,s,o,a){const n=t.enabled?e:void 0,r=s.enabled?i:void 0;(lc(t)||lc(s))&&hf.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;n!=null&&r!=null&&(l=rc(n,t,r,s,o,a));let c;if(l==null&&n!=null&&(c=Ds(n,t,o,a)),c!=null){const[d,u]=c;l={width:d.width,height:d.height,meta:u,label:d,secondaryLabel:void 0}}let p;if(l==null&&n==null&&r!=null&&(p=Ds(r,s,o,a)),p!=null){const[d,u]=p;l={width:d.width,height:d.height,meta:u,label:void 0,secondaryLabel:d}}return l}function cc(e,t,i,s,o,a,n){const r=nc(t,{maxWidth:i,maxHeight:s,font:o,textWrap:a,overflow:n});if(!r.length)return;const l=uo(o),c=e.lineHeight??l.lineHeight(),{width:p}=l.measureLines(r);return{width:p,lineHeight:c,text:r.join(`
+`),height:r.length*c,fontSize:o.fontSize}}import{_ModuleSupport as df}from"ag-charts-community";import{_ModuleSupport as hc}from"ag-charts-community";var{Property:Is}=hc,zi=class extends hc.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};h([Is],zi.prototype,"wrapping",2),h([Is],zi.prototype,"overflowStrategy",2),h([Is],zi.prototype,"lineHeight",2),h([Is],zi.prototype,"minimumFontSize",2);var _t=class extends zi{constructor(){super(...arguments),this.spacing=0}};h([Is],_t.prototype,"spacing",2);var As=class extends zi{},{CartesianSeriesProperties:uf,makeSeriesTooltip:gf,Property:Xe}=df,Ve=class extends uf{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new _t,this.tooltip=gf()}};h([Xe],Ve.prototype,"title",2),h([Xe],Ve.prototype,"xKey",2),h([Xe],Ve.prototype,"yKey",2),h([Xe],Ve.prototype,"colorKey",2),h([Xe],Ve.prototype,"xName",2),h([Xe],Ve.prototype,"yName",2),h([Xe],Ve.prototype,"colorName",2),h([Xe],Ve.prototype,"colorRange",2),h([Xe],Ve.prototype,"stroke",2),h([Xe],Ve.prototype,"strokeOpacity",2),h([Xe],Ve.prototype,"strokeWidth",2),h([Xe],Ve.prototype,"textAlign",2),h([Xe],Ve.prototype,"verticalAlign",2),h([Xe],Ve.prototype,"itemPadding",2),h([Xe],Ve.prototype,"itemStyler",2),h([Xe],Ve.prototype,"label",2),h([Xe],Ve.prototype,"tooltip",2);var{SeriesNodePickMode:pc,computeBarFocusBounds:mf,getMissCount:yf,valueProperty:on,ChartAxisDirection:mt,DEFAULT_CARTESIAN_DIRECTION_KEYS:ff,DEFAULT_CARTESIAN_DIRECTION_NAMES:Sf,createDatumId:xf,ColorScale:bf,Rect:vf,PointerEvents:kf,applyShapeStyle:Df,mergeDefaults:dc,formatValue:If,addHitTestersToQuadtree:Af,findQuadtreeMatch:uc,updateLabelNode:Mf}=po,Nf=class extends po.CartesianSeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.colorKey=s.properties.colorKey}},Lf={left:-.5,center:0,right:-.5},Tf={top:-.5,middle:0,bottom:-.5},go=class extends po.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...ff,color:["colorKey"]},propertyNames:{...Sf,color:["colorName"]},categoryKey:void 0,pickModes:[pc.NEAREST_NODE,pc.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new Ve,this.NodeEvent=Nf,this.colorScale=new bf}async processData(e){const t=this.axes[mt.X],i=this.axes[mt.Y];if(!t||!i||!this.data?.data.length)return;const{xKey:s,yKey:o,colorRange:a,colorKey:n}=this.properties,r=this.axes[mt.X]?.scale,l=this.axes[mt.Y]?.scale,{xScaleType:c,yScaleType:p}=this.getScaleInformation({xScale:r,yScale:l}),d=this.colorScale.type,{dataModel:u,processedData:m}=await this.requestDataModel(e,this.data,{props:[on(s,c,{id:"xValue"}),on(o,p,{id:"yValue"}),...n?[on(n,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const g=u.resolveProcessedDataIndexById(this,"colorValue"),y=m.domain.values[g].filter(S=>S!=null),f=po.extent(y);if(this.colorScale.domain=f??[],f?.length&&f[0]===f[1]){const S=Math.floor(a.length/2);this.colorScale.range=[a[S],a[S]]}else this.colorScale.range=a;this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=yf(this,i.defs.values[s].missing),n=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[n].filter(c=>c!=null).length;return!(o===0||o===a||r===0)}xCoordinateRange(e,t){const i=this.axes[mt.X].scale,s=t*(i.bandwidth??0)/2,o=i.convert(e)+s,a=t*(i.bandwidth??10);return[o,o+a]}yCoordinateRange(e,t){const i=this.axes[mt.Y].scale,s=t*(i.bandwidth??0)/2,o=i.convert(e[0])+s,a=t*(i.bandwidth??10);return[o,o+a]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:e===mt.X?t.getDomain(this,"xValue","value",i):t.getDomain(this,"yValue","value",i)}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{data:e,visible:t,axes:i,dataModel:s,processedData:o}=this,a=i[mt.X],n=i[mt.Y];if(!(e&&s&&o&&t&&a&&n))return;if(a.type!=="category"||n.type!=="category"){lf.warnOnce(`Heatmap series expected axes to have "category" type, but received "${a.type}" and "${n.type}" instead.`);return}const{xKey:r,xName:l,yKey:c,yName:p,colorKey:d,colorName:u,textAlign:m,verticalAlign:g,itemPadding:y,label:f}=this.properties,S=s.resolveColumnById(this,"xValue",o),x=s.resolveColumnById(this,"yValue",o),v=d?s.resolveColumnById(this,"colorValue",o):void 0,b=d?s.getDomain(this,"colorValue","value",o):[],k=a.scale,A=n.scale,I=(k.bandwidth??0)/2,D=(A.bandwidth??0)/2,N=[],R=[],C=k.bandwidth??10,w=A.bandwidth??10,G=(C-2*y)*Lf[m],_=(w-2*y)*Tf[g],E=()=>({width:C,height:w,meta:null}),L=o.dataSources.get(this.id)?.data??[];for(const[P,T]of L.entries()){const M=S[P],O=x[P],B=k.convert(M)+I,F=A.convert(O)+D,V=v?.[P],W=f.enabled&&V!=null?this.getLabelText(V,T,d,"color",b,f,{value:V,datum:T,colorKey:d,colorName:u,xKey:r,yKey:c,xName:l,yName:p}):void 0,K=sn(cf(W),this.properties.label,void 0,this.properties.label,{padding:y},E),z={x:B,y:F,size:0},$=this.getItemStyle({datumIndex:P,datum:T,colorValue:V},!1);if(N.push({series:this,itemId:c,datumIndex:P,yKey:c,xKey:r,xValue:M,yValue:O,colorValue:V,datum:T,point:z,width:C,height:w,midPoint:{x:B,y:F},missing:v!=null&&V==null,style:$}),K?.label!=null){const{text:Z,fontSize:q,lineHeight:Y,height:Q}=K.label,{fontStyle:ie,fontFamily:U,fontWeight:ce,color:ae}=this.properties.label,j=z.x+G*(C-2*y),re=z.y+_*(w-2*y)-(K.height-Q)*.5;R.push({series:this,itemId:c,datum:T,datumIndex:P,text:Z,fontSize:q,lineHeight:Y,fontStyle:ie,fontFamily:U,fontWeight:ce,color:ae,textAlign:m,textBaseline:g,x:j,y:re,style:$})}}return{itemId:this.properties.yKey??this.id,nodeData:N,labelData:R,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new vf}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{properties:o}=this,{itemStyler:a,stroke:n,strokeWidth:r,strokeOpacity:l}=o,c=this.getHighlightStyle(s,e),p=dc(c,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:n,strokeWidth:r,strokeOpacity:l,opacity:1});let d;return a!=null&&e!=null&&(d=this.cachedDatumCallback(xf(e,s?"highlight":"node"),()=>{const u=this.makeItemStylerParams(t,e,s,p);return this.callWithContext(a,u)})),d?dc(d,p):p}makeItemStylerParams(e,t,i,s){const{id:o,properties:a}=this,{xKey:n,yKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),p=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,xKey:n,yKey:r,highlighted:i,highlightState:c,...s,fill:p}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e}){const t=this.axes[mt.X],[i,s]=t?.visibleRange??[],a=!(i!==0||s!==1);e.each((n,r)=>{const{point:l,width:c,height:p,style:d}=r;Df(n,d),n.crisp=a,n.x=Math.floor(l.x-c/2),n.y=Math.floor(l.y-p/2),n.width=Math.ceil(c),n.height=Math.ceil(p)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:s}=this.properties.label,o=s?t:[];return i.update(o)}updateLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((i,s)=>{i.pointerEvents=kf.None,i.text=s.text,i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex)?.opacity??1,Mf(this,i,this.properties,this.properties.label,s,!1,t)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a,colorScale:n,ctx:r}=this,{formatManager:l}=r,{xKey:c,xName:p,yKey:d,yName:u,colorKey:m,colorName:g,colorRange:y,title:f,legendItemName:S,tooltip:x}=a,v=o[mt.X],b=o[mt.Y];if(!i||!s||!v||!b)return;const k=s.dataSources.get(this.id)?.data[e],A=i.resolveColumnById(this,"xValue",s)[e],I=i.resolveColumnById(this,"yValue",s)[e],D=m!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",s)[e]:void 0;if(A==null)return;const N=[];let R;if(D==null)R=y[0];else{R=n.convert(D);const G=i.getDomain(this,"colorValue","value",s),_=l.format(this.callWithContext.bind(this),{type:"number",value:D,datum:k,seriesId:t,legendItemName:S,key:m,source:"tooltip",property:"color",domain:G,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0});N.push({label:g,fallbackLabel:m,value:_??If(D)})}N.push({label:p,fallbackLabel:c,value:this.getAxisValueText(v,"tooltip",A,k,c,S)},{label:u,fallbackLabel:d,value:this.getAxisValueText(b,"tooltip",I,k,d,S)});const C=this.getItemStyle({datumIndex:e,datum:k,colorValue:D},!1);C.fill!=null&&(R=C.fill);const w=R==null?void 0:{marker:{shape:"square",fill:R,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(x,{title:f??S,symbol:w,data:N},{seriesId:t,datum:k,title:f,xKey:c,xName:p,yKey:d,yName:u,colorKey:m,colorName:g,...C})}getLegendData(e){return e!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(t===void 0)return;const{width:i,height:s,midPoint:o}=t,a={x:o.x-i/2,y:o.y-s/2,width:i,height:s};return mf(this,a)}initQuadTree(e){Af(e,this.datumNodesIter())}pickNodesExactShape(e){const t=uc(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return uc(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};go.className="HeatmapSeries",go.type="heatmap";import{_ModuleSupport as Rf}from"ag-charts-community";import{arrayOf as Pf,color as Cf,constant as Of,required as an,string as $i}from"ag-charts-core";var{commonSeriesOptionsDefs:_f,heatmapSeriesThemeableOptionsDef:wf,without:gc}=Rf,Ef={...gc(wf,["showInLegend"]),...gc(_f,["showInLegend"]),type:an(Of("heatmap")),xKey:an($i),yKey:an($i),colorKey:$i,xName:$i,yName:$i,colorName:$i,colorRange:Pf(Cf)};import{_ModuleSupport as mo}from"ag-charts-community";var Ff={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},mo.SAFE_RANGE2_OPERATION]},label:{...mo.LABEL_BOXING_DEFAULTS,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:mo.singleSeriesHighlightStyle()},gradientLegend:{enabled:!0,...mo.LEGEND_CONTAINER_THEME}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:mc,CARTESIAN_POSITION:yc}}=rf,mR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:e=>new go(e),defaultAxes:[{type:mc.CATEGORY,position:yc.LEFT},{type:mc.CATEGORY,position:yc.BOTTOM}],themeTemplate:Ff},nn={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:Ef,create:e=>new go(e)};import{_ModuleSupport as Bf}from"ag-charts-community";import{_ModuleSupport as Gf}from"ag-charts-community";var{applyShapeStyle:Vf}=Gf,yo=class extends jl{constructor(){super(...arguments),this.properties=new lo}nodeFactory(){const e=new Jl;return e.lineCap="square",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s.datumIndex,t,void 0,s.itemId)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:s}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:n}=s.item;e.each((r,l)=>{const{centerX:c,width:p,y:d,height:u,yOpen:m,yClose:g,crisp:y}=l,f=l.isRising?a:n;r.centerX=c,r.width=p,r.y=d,r.height=u,r.yOpen=m,r.yClose=g,r.crisp=y;const S=l.style??i.styles[l.itemId][this.getHighlightState(o,t,l.datumIndex)];Vf(r,S),r.strokeAlignment=f.strokeWidth})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:s},visible:o}=this,{xKey:a,yName:n,item:{up:r,down:l},showInLegend:c,legendItemName:p}=this.properties;if(!i?.data.length||!a||e!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:o&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:p??n??t},symbol:{marker:{fill:d,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:p,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};yo.className="ohlc",yo.type="ohlc";import{_ModuleSupport as Kf}from"ag-charts-community";import{boolean as Wf,constant as zf,number as $f,required as Hi,string as At,undocumented as fc}from"ag-charts-core";var{commonSeriesOptionsDefs:Hf,ohlcSeriesThemeableOptionsDef:Xf}=Kf,rn={...Hf,...Xf,type:Hi(zf("ohlc")),xKey:Hi(At),openKey:Hi(At),highKey:Hi(At),lowKey:Hi(At),closeKey:Hi(At),xName:At,yName:At,openName:At,highName:At,lowName:At,closeName:At};rn.pickOutsideVisibleMinorAxis=fc(Wf),rn.focusPriority=fc($f);var{ThemeConstants:{CARTESIAN_AXIS_TYPE:fo,CARTESIAN_POSITION:Sc},multiSeriesHighlightStyle:Yf}=Bf,bR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:e=>new yo(e),defaultAxes:[{type:fo.NUMBER,position:Sc.LEFT},{type:fo.ORDINAL_TIME,position:Sc.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Yf(!1)},axes:{[fo.NUMBER]:{crosshair:{snap:!1}},[fo.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},ln={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:rn,create:e=>new yo(e)};import{_ModuleSupport as xc}from"ag-charts-community";import{_ModuleSupport as So}from"ag-charts-community";import{_ModuleSupport as Uf}from"ag-charts-community";var{AGGREGATION_INDEX_Y_MAX:qf,AGGREGATION_INDEX_Y_MIN:jf,aggregationDomain:Jf,aggregationIndexForXRatio:bc,aggregationRangeFittingPoints:Zf,aggregationXRatioForXValue:vc,compactAggregationIndices:Qf,createAggregationIndices:eS}=Uf,tS=1e3;function kc(e,t,i,s,o,a,n){const r=e[a];if(r==null)return!1;const l=vc(r,t,i,n),c=bc(l,o);return a===s[c+qf]}function Dc(e,t,i,s,o,a,n){const r=e[a];if(r==null)return!1;const l=vc(r,t,i,n),c=bc(l,o);return a===s[c+jf]}function iS(e,t,i,s,o,a,n){if(t.length64;)({maxRange:c}=Qf(p,d,c,{inPlace:!0})),u=u.filter(y=>kc(t,r,l,p,c,y,a)),m=m.filter(y=>Dc(t,r,l,p,c,y,a)),g.push({maxRange:c,topIndices:u,bottomIndices:m});return g.reverse(),g}import{_ModuleSupport as sS}from"ag-charts-community";function Ic({span:e},t){switch(e.type){case"linear":case"step":case"multi-line":{const i=(t-e.x0)/(e.x1-e.x0);return e.y0+i*(e.y1-e.y0)}case"cubic":{const{cp0x:i,cp0y:s,cp1x:o,cp1y:a,cp2x:n,cp2y:r,cp3x:l,cp3y:c}=e;let p=.5;const d=1e-6;for(let m=0;m<10;m++){const g=1-p,f=g*g*g*i+3*g*g*p*o+3*g*p*p*n+p*p*p*l-t;if(Math.abs(f)=a.x&&t<=n.x)return{span:o,index:s};if(tl;return{intersection:s===c?null:{x:i,y:r},spanIndex:a.index,isInverted:c}}function aS(e,t,i,s,o=!1){if(e.length===0||t.length===0)return[];const a=[];let n=o,r=0;for(let l=i;l<=s;l+=.5){const c=oS(e,t,l,n,r);c.intersection&&a.push(c.intersection.x),r=c.spanIndex,n=c.isInverted}return a}function nS(e,t,i,s,o={}){const a=Math.max(t.x,i.width-(t.x+t.width)),n=Math.max(t.y,i.height-(t.y+t.height)),r=[],l=(p,d)=>({x0:p,y0:-n,x1:d,y1:t.height+n});s&&r.push({clipRect:l(-a,e[0]??t.width+a),...o});const c=s?1:0;for(let p=c;p{Xi(l,c,t.removed),Xi(l,c,i.removed)},a=(l,c)=>{Xi(l,c,t.moved),Xi(l,c,i.moved)},n=(l,c)=>{Xi(l,c,t.added),Xi(l,c,i.added)},r=yS(e,s);return{status:e,path:{addPhaseFn:n,updatePhaseFn:a,removePhaseFn:o},pathProperties:r}}function SS(e,t,i){const s=e.scales.x?.type==="category",o=t.scales.x?.type==="category";if(s!==o||!Mc(e.scales.x)||!Mc(t.scales.x))return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const n=vo({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},bo.Split);if(n==null)return;const r=vo({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},bo.Split);if(r==null)return;const l=vo({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},bo.Split);if(l==null)return;const c=vo({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},bo.Split);if(c==null)return;const p="fade",d=mS(a,n,r,p),u=fS(a,l,c,p),m=(i?.changed??!0)||!Nc(e.scales.x,t.scales.x)||!Nc(e.scales.y,t.scales.y)||a!=="updated";return{status:a,fill:d,stroke:u,hasMotion:m}}var{valueProperty:Lc,keyProperty:xS,ChartAxisDirection:Ke,mergeDefaults:bS,updateLabelNode:vS,fixNumericExtent:Tc,buildResetPathFn:kS,resetLabelFn:DS,resetMarkerFn:IS,resetMarkerPositionFn:Rc,pathSwipeInAnimation:AS,resetMotion:MS,markerSwipeScaleInAnimation:NS,seriesLabelFadeInAnimation:dn,animationValidation:LS,diff:TS,updateClipPath:un,computeMarkerFocusBounds:Pc,plotAreaPathFill:RS,plotLinePathStroke:Cc,interpolatePoints:Oc,pathFadeInAnimation:gn,markerFadeInAnimation:_c,fromToMotion:mn,pathMotion:yn,extent:PS,applyShapeFillBBox:CS,PointerEvents:ko,Marker:OS,BBox:_S,findMinMax:wS,applyShapeStyle:ES,processedDataIsAnimatable:FS,simpleMemorize2:BS,markerEnabled:GS,getMarkerStyles:VS,calculateSegments:KS,toHighlightString:WS,HighlightState:zS}=So,$S=BS(iS),HS=class extends So.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},XS=So.CartesianSeries,Do=class extends XS{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[So.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[Ke.X]:["xKey"],[Ke.Y]:["yLowKey","yHighKey"]},propertyNames:{[Ke.X]:["xName"],[Ke.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:kS({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:DS,datum:(t,i)=>({...IS(t),...Rc(t,i)})},clipFocusBox:!1}),this.properties=new Se,this.NodeEvent=HS,this.dataAggregationFilters=void 0}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,o=this.axes[Ke.X]?.scale,a=this.axes[Ke.Y]?.scale,{xScaleType:n,yScaleType:r}=this.getScaleInformation({xScale:o,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(TS(this.id,this.processedData)),c&&l.push(LS());const{dataModel:p,processedData:d}=await this.requestDataModel(e,this.data,{props:[xS(t,n,{id:"xValue"}),Lc(i,r,{id:"yLowValue"}),Lc(s,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(p,d),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||FS(t))return;const i=this.axes[Ke.X];if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),o=e.resolveColumnById(this,"yHighValue",t),a=e.resolveColumnById(this,"yLowValue",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n],l=e.resolveColumnNeedsValueOf(this,"xValue",t),c=e.resolveColumnNeedsValueOf(this,"yHighValue",t);return $S(i.scale.type,s,o,a,r,l,c)}xCoordinateRange(e){const t=this.axes[Ke.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[Ke.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];const{domain:{keys:[s]}}=t;if(e===Ke.X){const o=i.resolveProcessedDataDefById(this,"xValue");return o?.def.type==="key"&&o.def.valueType==="category"?s:Tc(PS(s))}else{const o=this.domainForClippedRange(Ke.Y,["yHighValue","yLowValue"],"xValue"),a=wS(o);return Tc(a)}}getSeriesRange(e,t){return this.domainForVisibleRange(Ke.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeData(){const{data:e,dataModel:t,processedData:i,axes:s}=this,o=s[Ke.X],a=s[Ke.Y];if(!(e&&o&&a&&t&&i&&this.chart?.seriesRect))return;const n=o.scale,r=a.scale,{xKey:l,yLowKey:c,yHighKey:p,connectMissingData:d,interpolation:u,fill:m,fillOpacity:g,item:y}=this.properties,f=i.dataSources.get(this.id)?.data??[],S=(n.bandwidth??0)/2,x=t.resolveKeysById(this,"xValue",i),v=t.resolveColumnById(this,"yHighValue",i),b=t.resolveColumnById(this,"yLowValue",i),k=K=>n.convert(x[K])+S,A=[],I=[],D=[],N=(K,z,$)=>{const Z=f[K],q=x[K];if(q==null)return;const Y=D.at(-1);if(Number.isFinite(z)&&Number.isFinite($)){const Q=(re,se,ue)=>{const{size:le}=y[re].marker;I.push({index:K,series:this,itemId:re,datum:Z,datumIndex:K,midPoint:{x:U,y:ue},yHighValue:z,yLowValue:$,xValue:q,xKey:l,yLowKey:c,yHighKey:p,point:{x:U,y:ue,size:le},enabled:!0});const ye=this.createLabelData({datumIndex:K,point:{x:U,y:ue},value:se,yLowValue:$,yHighValue:z,itemId:re,inverted:ie,datum:Z,series:this});A.push(ye)},ie=$>z,U=k(K),ce=r.convert(z),ae=r.convert($);Q("high",z,ce),Q("low",$,ae);const j={high:{point:{x:U,y:ce},xDatum:q,yDatum:z},low:{point:{x:U,y:ae},xDatum:q,yDatum:$}};Array.isArray(Y)?Y.push(j):Y==null?D.push([j]):(Y.skip+=1,D.push([j]))}else d||(Array.isArray(Y)||Y==null?D.push({skip:0}):Y.skip+=1)},{dataAggregationFilters:R}=this,[C,w]=n.range,G=Math.abs(w-C),_=R?.find(K=>K.maxRange>G),E=_?.topIndices,L=_?.bottomIndices;let[P,T]=this.visibleRangeIndices("xValue",o.range,E);P=Math.max(P-1,0),T=Math.min(T+1,E?.length??x.length),i.input.count<1e3&&(P=0,T=i.input.count);for(let K=P;K{if(!Array.isArray(K))return[];const z=K.map($=>$.high);return Oc(z,u)}),O=D.flatMap(K=>{if(!Array.isArray(K))return[];const z=K.map($=>$.low);return Oc(z,u)}),B=KS(this.properties.segmentation,o,a,this.chart.seriesRect,this.ctx.scene,!1);let F;if(this.properties.invertedStyle.enabled){const K=v[0]{const z=y[K],{stroke:$,strokeWidth:Z,strokeOpacity:q}=z,Y={fill:m,fillOpacity:g,stroke:$,strokeWidth:Z,strokeOpacity:q};return VS(this,z,z.marker,Y)};return{itemId:`${c}-${p}`,labelData:A,nodeData:I,fillData:{itemId:"high",spans:M,phantomSpans:O},highStrokeData:{itemId:"high",spans:M},lowStrokeData:{itemId:"low",spans:O},scales:this.calculateScaling(),visible:this.visible,styles:{low:V("low"),high:V("high")},segments:B,intersectionSegments:F}}createLabelData({datumIndex:e,point:t,value:i,itemId:s,inverted:o,datum:a,series:n}){const{xKey:r,yLowKey:l,yHighKey:c,xName:p,yName:d,yLowName:u,yHighName:m,legendItemName:g,label:y}=this.properties,{placement:f}=y,S=y.spacing+(typeof y.padding=="number"?y.padding:0);let x=s;o&&(x=s==="low"?"high":"low");const v=f==="outside"&&x==="high"||f==="inside"&&x==="low"?-1:1,b=this.getSeriesDomain(Ke.Y);return{x:t.x,y:t.y+S*v,series:n,itemId:s,datum:a,datumIndex:e,text:this.getLabelText(i,a,s==="high"?c:l,"y",b,y,{value:i,datum:a,itemId:s,xKey:r,yLowKey:l,yHighKey:c,xName:p,yLowName:u,yHighName:m,yName:d,legendItemName:g}),textAlign:"center",textBaseline:v===-1?"bottom":"top"}}isPathOrSelectionDirty(){const{low:e,high:t}=this.properties.item;return e.marker.isDirty()||t.marker.isDirty()}strokewidthChange(){const e=t=>{const i=this.properties.item[t].strokeWidth??0,s=this.properties.highlight.highlightedSeries.item?.[t]?.strokeWidth??i,o=this.properties.highlight.highlightedItem.item?.[t]?.strokeWidth??i;return i>o||s>o};return e("low")||e("high")}updatePathNodes(e){const{visible:t}=e,[i,s,o]=e.paths,a=this.contextNodeData?.segments,n=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightState(n,!1),l=this.getHighlightStyle(),{item:c,fill:p,fillOpacity:d,opacity:u}=bS(l,this.getStyle(!1,r));s.setProperties({datum:a,segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:ko.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:u,visible:t}),o.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:ko.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:u,visible:t});const m=this.getShapeFillBBox();CS(i,p,m),ES(i,{stroke:void 0,fill:p,fillOpacity:d,opacity:u},m);const g=this.contextNodeData?.intersectionSegments??a;i.setProperties({segments:g,pointerEvents:ko.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:u,visible:t}),i.datum=g,un(this,i),un(this,s),un(this,o)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),RS(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i,s]=e;i.path.clear(),s.path.clear(),Cc(i,t.lowStrokeData.spans),Cc(s,t.highStrokeData.spans),i.markDirty("RangeArea"),s.markDirty("RangeArea")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{processedData:s,axes:o,properties:a}=this,n=a.styler?this.getStylerMarkerOptions().item:a.item,{low:r,high:l}=n,c=GS(s.input.count,o[Ke.X].scale,{enabled:r.marker.enabled||l.marker.enabled});(a.item.low.marker.isDirty()||a.item.high.marker.isDirty())&&(i.clear(),i.cleanup());let p;if(c)if(r.marker.enabled&&l.marker.enabled)p=t;else{p=[];for(const d of t)n[d.itemId].marker.enabled&&p.push(d)}else p=[];return i.update(p)}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,o)=>{const a=this.getHighlightState(i,t,o.datumIndex),n=this.getStyle(t,a),{fill:r,fillOpacity:l,item:c}=n,{stroke:p,strokeWidth:d,strokeOpacity:u}=c[o.itemId],{marker:m}=this.properties.item[o.itemId],g=this.makeItemStylerParams(o.itemId);o.style=this.getMarkerStyle(m,o,g,{isHighlight:t,highlightState:a,resolveMarkerSubPath:["item",o.itemId,"marker"]},n.item[o.itemId].marker,{fill:r,fillOpacity:l,stroke:p,strokeWidth:d,strokeOpacity:u})})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:s}=e,o=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight();i.each((n,r)=>{const{itemId:l}=r,c=r.style??t.styles[l][this.getHighlightState(a,s,r.datumIndex)];this.applyMarkerStyle(c,n,r.point,o)}),s||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=ko.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,o)=>{s.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1,vS(this,s,t,this.properties.label,o,!1,i)})}getHighlightData(e,t){const i=e.filter(s=>s.datum===t.datum);return i.length>0?i:void 0}getStyle(e,t){return this.getStylerCouple(e,t)[0]}getStylerMarkerOptions(){return this.getStylerCouple(!1)[1]}getStylerCouple(e,t){const{fill:i,fillOpacity:s,item:o,styler:a}=this.properties;let n={};if(a){const p=this.makeStylerParams(e,t);n=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(a,p)??{},{pick:!1})??{}}const r={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},l=p=>{const d=n.item?.[p],{lineDash:u,lineDashOffset:m,marker:g,stroke:y,strokeOpacity:f,strokeWidth:S}=o[p];return r.item[p].marker.enabled=d?.marker?.enabled??g.enabled,{marker:{fill:d?.marker?.fill??g.fill??i,fillOpacity:d?.marker?.fillOpacity??g.fillOpacity,shape:d?.marker?.shape??g.shape,size:d?.marker?.size??g.size,lineDash:d?.marker?.lineDash??g.lineDash,lineDashOffset:d?.marker?.lineDashOffset??g.lineDashOffset,stroke:d?.marker?.stroke??g.stroke??y,strokeOpacity:d?.marker?.strokeOpacity??g.strokeOpacity,strokeWidth:d?.marker?.strokeWidth??g.strokeWidth},lineDash:d?.lineDash??u,lineDashOffset:d?.lineDashOffset??m,stroke:d?.stroke??y,strokeOpacity:d?.strokeOpacity??f,strokeWidth:d?.strokeWidth??S}};return[{fill:n.fill??i,fillOpacity:n.fillOpacity??s,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:l("low"),high:l("high")}},r]}makeStylerParams(e,t){const{id:i}=this,{fill:s,fillOpacity:o,item:a,xKey:n,yHighKey:r,yLowKey:l}=this.properties,c=WS(t??zS.None),p=d=>{const{lineDash:u,lineDashOffset:m,marker:g,stroke:y,strokeOpacity:f,strokeWidth:S}=a[d];return{marker:{fill:g.fill??s,fillOpacity:g.fillOpacity,size:g.size,shape:g.shape,stroke:g.stroke??y,strokeOpacity:g.strokeOpacity,strokeWidth:g.strokeWidth,lineDash:g.lineDash,lineDashOffset:g.lineDashOffset},lineDash:u,lineDashOffset:m,stroke:y,strokeOpacity:f,strokeWidth:S}};return{item:{low:p("low"),high:p("high")},fill:s,fillOpacity:o,highlightState:c,highlighted:e,seriesId:i,xKey:n,yLowKey:l,yHighKey:r}}makeItemStylerParams(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties;return{xKey:t,yLowKey:i,yHighKey:s,itemId:e}}getTooltipContent(e,t){const i=t?.itemId??"high",{id:s,dataModel:o,processedData:a,axes:n,properties:r}=this,{xName:l,yName:c,yLowKey:p,yLowName:d,xKey:u,yHighKey:m,yHighName:g,tooltip:y,legendItemName:f}=r,S=n[Ke.X],x=n[Ke.Y];if(!o||!a||!S||!x)return;const v=a.dataSources.get(this.id)?.data[e],b=o.resolveKeysById(this,"xValue",a)[e],k=o.resolveColumnById(this,"yHighValue",a)[e],A=o.resolveColumnById(this,"yLowValue",a)[e];if(b==null)return;const I=this.getStyle(!1),D=this.makeItemStylerParams(i),N=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:e,datum:v},D,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},I.item[i].marker),R=`${this.getAxisValueText(x,"tooltip",A,v,p,f)} - ${this.getAxisValueText(x,"tooltip",k,v,m,f)}`;return this.formatTooltipWithContext(y,{heading:this.getAxisValueText(S,"tooltip",b,v,u,f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${d??p} - ${g??m}`,value:R}]},{seriesId:s,datum:v,title:c,itemId:i,xName:l,yName:c,yLowKey:p,yLowName:d,xKey:u,yHighKey:m,yHighName:g,legendItemName:f,...N})}legendItemSymbol(){const{fill:e,topLevel:t}=this.getStyle(!1),{stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,marker:n}=t;return{marker:{shape:n.shape,fill:n.fill??e,stroke:n.stroke??i,fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},line:{stroke:i,strokeOpacity:o,strokeWidth:s,lineDash:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yLowKey:s,yHighKey:o,yName:a,yLowName:n,yHighName:r,legendItemName:l,showInLegend:c}=this.properties,p=l??a??`${n??s} - ${r??o}`,d=`${s}-${o}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${p}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new OS}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,paths:o}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(o,s),AS(this,a,...o),MS([t],Rc),NS(this,a,t),dn(this,"labels",a,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:s,contextData:o,paths:a,previousContextData:n}=e,[r,l,c]=a;if(r==null&&l==null&&c==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const p=()=>{this.resetPathAnimation(e),this.updateAreaPaths(a,o)},d=()=>{t.skipCurrentBatch(),p()};if(o==null||n==null){p(),_c(this,t,"added",i),gn(this,"fill_path_properties",t,"add",r),gn(this,"low_stroke_path_properties",t,"add",l),gn(this,"high_stroke_path_properties",t,"add",c),dn(this,"labels",t,s);return}const u=SS(o,n,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){d();return}else if(u.status==="no-op")return;mn(this.id,"fill_path_properties",t,[r],u.fill.pathProperties),mn(this.id,"low_stroke_path_properties",t,[l],u.stroke.pathProperties),mn(this.id,"high_stroke_path_properties",t,[c],u.stroke.pathProperties),u.status==="added"?this.updateAreaPaths(a,o):u.status==="removed"?this.updateAreaPaths(a,n):(yn(this.id,"fill_path_update",t,[r],u.fill.path),yn(this.id,"low_stroke_path_update",t,[l],u.stroke.path),yn(this.id,"high_stroke_path_update",t,[c],u.stroke.path)),u.hasMotion&&(_c(this,t,void 0,i),dn(this,"labels",t,s)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,o)})}getFormattedMarkerStyle(e){const t=this.getStyle(!1),i=this.makeItemStylerParams(e.itemId);return this.getMarkerStyle(this.properties.item[e.itemId].marker,e,i,{isHighlight:!0,resolveMarkerSubPath:["item",e.itemId,"marker"]},void 0,t)}getMarkerStyle(e,t,i,s,o,a){return e.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(e,t,i,s,o,a)}computeFocusBounds(e){const t=Pc(this,e),i=Pc(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return _S.merge([t,i])}isDatumEnabled(e,t){return t%2===0&&super.isDatumEnabled(e,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Do.className="RangeAreaSeries",Do.type="range-area";import{_ModuleSupport as YS}from"ag-charts-community";import{boolean as wc,constant as US,fillOptionsDef as qS,number as jS,required as Io,shapeSegmentation as JS,string as Zt,undocumented as Ec}from"ag-charts-core";var{commonSeriesOptionsDefs:ZS,rangeAreaSeriesThemeableOptionsDef:QS}=YS,fn={...ZS,...QS,type:Io(US("range-area")),xKey:Io(Zt),yLowKey:Io(Zt),yHighKey:Io(Zt),xName:Zt,yName:Zt,yLowName:Zt,yHighName:Zt,legendItemName:Zt,segmentation:JS,invertedStyle:{enabled:wc,...qS}};fn.pickOutsideVisibleMinorAxis=Ec(wc),fn.focusPriority=Ec(jS);import{_ModuleSupport as We}from"ag-charts-community";var Fc={lineDash:{$path:"/series/$index/lineDash"},lineDashOffset:{$path:"/series/$index/lineDashOffset"},stroke:{$path:["/series/$index/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/strokeOpacity"},strokeWidth:{$path:["/series/$index/strokeWidth",1]},marker:{enabled:{$path:"/series/$index/marker/enabled"},fill:{$isUserOption:["/series/$index/marker/fill",{$if:[{$or:[{$isGradient:{$path:"/series/$index/marker/fill"}},{$isImage:{$path:"/series/$index/marker/fill"}},{$isPattern:{$path:"/series/$index/marker/fill"}}]},{$merge:[{$path:"/series/$index/marker/fill"},{$applySwitch:[{$path:"type"},void 0,["gradient",We.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",We.FILL_IMAGE_DEFAULTS],["pattern",We.FILL_PATTERN_DEFAULTS]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",We.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",We.FILL_IMAGE_DEFAULTS],["pattern",We.FILL_PATTERN_DEFAULTS]]}]},fillOpacity:{$path:"/series/$index/marker/fillOpacity"},lineDash:{$path:"/series/$index/marker/lineDash"},lineDashOffset:{$path:"/series/$index/marker/lineDashOffset"},shape:{$path:"/series/$index/marker/shape"},size:{$path:["/series/$index/marker/size",6]},stroke:{$path:["/series/$index/marker/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/marker/strokeOpacity"},strokeWidth:{$path:["/series/$index/marker/strokeWidth",2]}}},ex={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",We.FILL_GRADIENT_LINEAR_DEFAULTS],["pattern",We.FILL_PATTERN_DEFAULTS]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",We.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",We.FILL_IMAGE_DEFAULTS],["pattern",We.FILL_PATTERN_DEFAULTS]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2},nodeClickRange:"nearest",item:{low:Fc,high:Fc},label:{...We.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"outside",padding:{$isUserOption:["./spacing",0,10]},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:We.multiSeriesHighlightStyle(),segmentation:We.SEGMENTATION_DEFAULTS,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",We.FILL_GRADIENT_LINEAR_DEFAULTS],["image",We.FILL_IMAGE_DEFAULTS],["pattern",We.FILL_PATTERN_DEFAULTS]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{[We.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:Bc,CARTESIAN_POSITION:Gc}}=xc,RR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:e=>new Do(e),predictAxis:xc.predictCartesianTimeAxis,defaultAxes:[{type:Bc.NUMBER,position:Gc.LEFT},{type:Bc.CATEGORY,position:Gc.BOTTOM}],themeTemplate:ex},Sn={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:fn,create:e=>new Do(e)};import{_ModuleSupport as Vc}from"ag-charts-community";import{_ModuleSupport as Ao}from"ag-charts-community";import{_ModuleSupport as tx}from"ag-charts-community";var{aggregationDomain:ix,aggregationRangeFittingPoints:sx,compactAggregationIndices:ox,createAggregationIndices:ax}=tx,nx=1e3;function rx(e,t,i,s,o,a){if(t.length64;)({indexData:c,valueData:p,maxRange:l}=ox(c,p,l)),d.push({maxRange:l,indexData:c});return d.reverse(),d}import{_ModuleSupport as lx}from"ag-charts-community";var{AbstractBarSeriesProperties:cx,makeSeriesTooltip:hx,Property:De,DropShadow:px,Label:dx}=lx,xn=class extends dx{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};h([De],xn.prototype,"placement",2),h([De],xn.prototype,"spacing",2);var Ne=class extends cx{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new px().set({enabled:!1}),this.label=new xn,this.tooltip=hx()}};h([De],Ne.prototype,"xKey",2),h([De],Ne.prototype,"yLowKey",2),h([De],Ne.prototype,"yHighKey",2),h([De],Ne.prototype,"xName",2),h([De],Ne.prototype,"yName",2),h([De],Ne.prototype,"yLowName",2),h([De],Ne.prototype,"yHighName",2),h([De],Ne.prototype,"fill",2),h([De],Ne.prototype,"fillOpacity",2),h([De],Ne.prototype,"stroke",2),h([De],Ne.prototype,"strokeWidth",2),h([De],Ne.prototype,"strokeOpacity",2),h([De],Ne.prototype,"lineDash",2),h([De],Ne.prototype,"lineDashOffset",2),h([De],Ne.prototype,"cornerRadius",2),h([De],Ne.prototype,"styler",2),h([De],Ne.prototype,"itemStyler",2),h([De],Ne.prototype,"shadow",2),h([De],Ne.prototype,"label",2),h([De],Ne.prototype,"tooltip",2);var{SeriesNodePickMode:Kc,valueProperty:Wc,keyProperty:ux,ChartAxisDirection:Ms,checkCrisp:gx,updateLabelNode:mx,SMALLEST_KEY_INTERVAL:yx,LARGEST_KEY_INTERVAL:fx,diff:Sx,prepareBarAnimationFunctions:zc,midpointStartingBarPosition:$c,resetBarSelectionsFn:xx,fixNumericExtent:bx,seriesLabelFadeInAnimation:Hc,resetLabelFn:vx,animationValidation:kx,computeBarFocusBounds:Dx,visibleRangeIndices:Ix,createDatumId:Ax,ContinuousScale:Mx,Rect:Nx,PointerEvents:Lx,motion:Xc,applyShapeStyle:Tx,findMinMax:Rx,areScalingEqual:Px,processedDataIsAnimatable:Cx,AGGREGATION_SPAN:Yc,AGGREGATION_INDEX_X_MAX:Uc,AGGREGATION_INDEX_X_MIN:qc,AGGREGATION_INDEX_Y_MAX:Ox,AGGREGATION_INDEX_Y_MIN:_x,mergeDefaults:jc,simpleMemorize2:wx,getItemStyles:Ex,calculateSegments:Fx,toHighlightString:Bx,HighlightState:Jc}=Ao,Gx=wx(rx),Vx=class extends Ao.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yLowKey=s.properties.yLowKey,this.yHighKey=s.properties.yHighKey}},Mo=class extends Ao.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Kc.AXIS_ALIGNED,Kc.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:xx,label:vx}}),this.properties=new Ne,this.dataAggregationFilters=void 0,this.NodeEvent=Vx}async processData(e){const{xKey:t,yLowKey:i,yHighKey:s}=this.properties,o=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:n,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:o,yScale:a}),c=[];this.ctx.animationManager.isSkipped()||(this.processedData&&c.push(Sx(this.id,this.processedData)),c.push(kx()));const p=this.visible?{}:{forceValue:0},{dataModel:d,processedData:u}=await this.requestDataModel(e,this.data,{props:[ux(t,r,{id:"xValue"}),Wc(i,l,{id:"yLowValue",invalidValue:null,...p}),Wc(s,l,{id:"yHighValue",invalidValue:null,...p}),...n?[yx,fx]:[],...c],groupByKeys:!1});this.smallestDataInterval=u.reduced?.smallestKeyInterval,this.largestDataInterval=u.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(d,u),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||Cx(t))return;const i=this.axes[Ms.X];if(i==null)return;const s=e.resolveKeysById(this,"xValue",t),o=e.resolveColumnById(this,"yHighValue",t),a=e.resolveColumnById(this,"yLowValue",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n];return Gx(i.scale.type,s,o,a,r,t.reduced?.smallestKeyInterval)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[s]}=t.domain;if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue");return o?.def.type==="key"&&o?.def.valueType==="category"?s:this.padBandExtent(s)}else{const o=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),a=Rx(o);return bx(a)}}getSeriesRange(e,t){return this.domainForVisibleRange(Ms.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeData(){const{data:e,dataModel:t,groupScale:i,processedData:s,visible:o}=this,a=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&a&&n&&t&&s?.dataSources&&this.chart?.seriesRect))return;const r=a.scale,l=n.scale,c=this.getBarDirection()===Ms.X,{xKey:p,yLowKey:d,yHighKey:u,strokeWidth:m}=this.properties,g=`${d}-${u}`,y=Fx(this.properties.segmentation,a,n,this.chart.seriesRect,this.ctx.scene),f={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:Ex(this.getItemStyle.bind(this)),segments:y};if(!o)return f;const S=s.dataSources.get(this.id)?.data??[],x=t.resolveKeysById(this,"xValue",s),v=t.resolveColumnById(this,"yLowValue",s),b=t.resolveColumnById(this,"yHighValue",s),{barWidth:k,groupIndex:A}=this.updateGroupScale(a),I=Mx.is(r)?k*-.5:0,D=i.convert(String(A)),N=gx(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval),R=P=>Math.round(r.convert(x[P]))+D+I,C=(P,T,M,O,B,F,V)=>{const W=S[P],K=x[P];if(K==null)return;const z=v[P],$=b[P];if(!Number.isFinite(z?.valueOf())||!Number.isFinite($?.valueOf()))return;const[Z,q]=z<$?[z,$]:[$,z],Y=Math.round(l.convert(F)),Q=Math.round(l.convert(B)),ie=Math.max(m,Math.abs(Q-Y)),U={x:c?Math.min(Y,Q):M,y:c?M:Math.min(Y,Q),width:c?ie:O,height:c?O:ie},ce={x:U.x+U.width/2,y:U.y+U.height/2},ae=this.createLabelData({datumIndex:P,rect:U,barAlongX:c,yLowValue:Z,yHighValue:q,datum:W,series:this}),j={index:T,series:this,itemId:g,datum:W,datumIndex:P,xValue:K,yLowValue:z,yHighValue:$,yLowKey:d,yHighKey:u,xKey:p,x:U.x,y:U.y,width:U.width,height:U.height,midPoint:ce,crisp:V,labels:ae};f.nodeData.push(j),f.labelData.push(...ae)},{dataAggregationFilters:w}=this,[G,_]=r.range,E=Math.abs(_-G),L=w?.find(P=>P.maxRange>E);if(L!=null){const{maxRange:P,indexData:T}=L,[M,O]=Ix(1,P,a.range,B=>{const F=B*Yc,V=T[F+qc],W=T[F+Uc];if(V===-1)return;const K=Math.trunc((V+W)/2);return[R(K),R(W)+k]});for(let B=M;Bthis.getDatumId(o))}getItemStyle(e,t,i){const{properties:s,dataModel:o,processedData:a}=this,{itemStyler:n}=s,r=this.getHighlightStyle(t,e,i);let l=jc(r,this.getStyle(e===void 0,t,i));if(n&&o!=null&&a!=null&&e!=null){const c=o.resolveKeysById(this,"xValue",a)[e],p=this.cachedDatumCallback(Ax(this.getDatumId({xValue:c}),t?"highlight":"node"),()=>{const d=this.makeItemStylerParams(e,t,l);return this.callWithContext(n,d)});p&&(l=jc(p,l))}return l}makeItemStylerParams(e,t,i){const{id:s,properties:o,processedData:a}=this,{xKey:n,yHighKey:r,yLowKey:l}=o,c=a.dataSources.get(s)?.data[e],p=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(p,t,e),u=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:c,xKey:n,yHighKey:r,yLowKey:l,highlighted:t,highlightState:d,...i,fill:u}}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight();e.datumSelection.each((i,s)=>{if(!e.datumSelection.isGarbage(i)){const o=this.getHighlightState(t,e.isHighlight,s.datumIndex);s.style=this.getItemStyle(s.datumIndex,e.isHighlight,o)}})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),o=this.getCategoryDirection()===Ms.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=r.style??i.styles[this.getHighlightState(s,t,r.datumIndex)];Tx(n,l,a),n.cornerRadius=l.cornerRadius??0,n.visible=o?r.width>0:r.height>0,n.crisp=r.crisp})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=Lx.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,o)=>{s.fillOpacity=this.getHighlightStyle(!1,o?.datumIndex).opacity??1,mx(this,s,t,this.properties.label,o,!1,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yName:r,yLowKey:l,yHighKey:c,yLowName:p,yHighName:d,tooltip:u,legendItemName:m}=o,g=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!s||!g||!y)return;const f=s.dataSources.get(this.id)?.data[e],S=i.resolveKeysById(this,"xValue",s)[e],x=i.resolveColumnById(this,"yHighValue",s)[e],v=i.resolveColumnById(this,"yLowValue",s)[e];if(S==null)return;const b=this.getItemStyle(e,!1),k=`${this.getAxisValueText(y,"tooltip",v,f,l,m)} - ${this.getAxisValueText(y,"tooltip",x,f,c,m)}`;return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(g,"tooltip",S,f,a,m),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${p??l} - ${d??c}`,value:k}]},{seriesId:t,datum:f,title:r,xKey:a,xName:n,yName:r,yLowKey:l,yHighKey:c,yLowName:p,yHighName:d,legendItemName:m,...b})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this.getStyle(!1,!1,Jc.None);return{marker:{fill:e,stroke:t,fillOpacity:s,strokeOpacity:o,strokeWidth:i,lineDash:a,lineDashOffset:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yName:s,yLowName:o,yHighName:a,yLowKey:n,yHighKey:r,legendItemName:l,showInLegend:c}=this.properties,p=l??s??`${o??n} - ${a??r}`,d=`${n}-${r}`;return[{legendType:"category",id:t,itemId:d,seriesId:t,enabled:i,label:{text:`${p}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=zc($c(this.isVertical(),"normal"),"unknown");Xc.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),Hc(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s,previousContextData:o}=e,a=Ao.calculateDataDiff(this.id,t,this.getDatumId.bind(this),s,o,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const n=o==null?"fade":"normal",r=zc($c(this.isVertical(),n),"added");Xc.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(l,c)=>this.getDatumId(c),a),(a?.changed||!Px(s.groupScale,o?.groupScale))&&Hc(this,"labels",this.ctx.animationManager,i)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return Dx(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Mo.className="RangeBarSeries",Mo.type="range-bar";import{_ModuleSupport as Kx}from"ag-charts-community";import{boolean as Wx,constant as zx,number as $x,required as No,shapeSegmentation as Hx,string as Qt,undocumented as Zc}from"ag-charts-core";var{commonSeriesOptionsDefs:Xx,rangeBarSeriesThemeableOptionsDef:Yx}=Kx,bn={...Xx,...Yx,type:No(zx("range-bar")),xKey:No(Qt),yLowKey:No(Qt),yHighKey:No(Qt),xName:Qt,yName:Qt,yLowName:Qt,yHighName:Qt,legendItemName:Qt,segmentation:Hx};bn.pickOutsideVisibleMinorAxis=Zc(Wx),bn.focusPriority=Zc($x);import{_ModuleSupport as bi}from"ag-charts-community";var Ux={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",bi.FILL_GRADIENT_LINEAR_DEFAULTS],["image",bi.FILL_IMAGE_DEFAULTS],["pattern",bi.FILL_PATTERN_DEFAULTS]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...bi.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:bi.multiSeriesHighlightStyle(),segmentation:bi.SEGMENTATION_DEFAULTS},axes:{[bi.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},BR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:e=>new Mo(e),predictAxis:Vc.predictCartesianTimeAxis,defaultAxes:Vc.DIRECTION_SWAP_AXES,themeTemplate:Ux,groupable:!0},vn={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:bn,create:e=>new Mo(e)};import{_ModuleSupport as qx}from"ag-charts-community";import{_ModuleSupport as vi}from"ag-charts-community";import{_ModuleSupport as jx}from"ag-charts-community";var{AbstractBarSeriesProperties:Jx,BaseProperties:Ns,PropertiesArray:Zx,makeSeriesTooltip:Qx,Property:ne,DropShadow:eb,Label:tb}=jx,Lo=class extends Ns{};h([ne],Lo.prototype,"totalType",2),h([ne],Lo.prototype,"index",2),h([ne],Lo.prototype,"axisLabel",2);var Qc=class extends Ns{};h([ne],Qc.prototype,"renderer",2);var kn=class extends tb{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};h([ne],kn.prototype,"placement",2),h([ne],kn.prototype,"spacing",2);var je=class extends Ns{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new eb().set({enabled:!1}),this.label=new kn,this.tooltip=new Qc}};h([ne],je.prototype,"name",2),h([ne],je.prototype,"fill",2),h([ne],je.prototype,"stroke",2),h([ne],je.prototype,"fillOpacity",2),h([ne],je.prototype,"strokeOpacity",2),h([ne],je.prototype,"lineDash",2),h([ne],je.prototype,"lineDashOffset",2),h([ne],je.prototype,"strokeWidth",2),h([ne],je.prototype,"cornerRadius",2),h([ne],je.prototype,"itemStyler",2),h([ne],je.prototype,"shadow",2),h([ne],je.prototype,"label",2),h([ne],je.prototype,"tooltip",2);var ki=class extends Ns{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};h([ne],ki.prototype,"enabled",2),h([ne],ki.prototype,"stroke",2),h([ne],ki.prototype,"strokeOpacity",2),h([ne],ki.prototype,"lineDash",2),h([ne],ki.prototype,"lineDashOffset",2),h([ne],ki.prototype,"strokeWidth",2);var To=class extends Ns{constructor(){super(...arguments),this.positive=new je,this.negative=new je,this.total=new je}};h([ne],To.prototype,"positive",2),h([ne],To.prototype,"negative",2),h([ne],To.prototype,"total",2);var zt=class extends Jx{constructor(){super(...arguments),this.item=new To,this.totals=new Zx(Lo),this.line=new ki,this.tooltip=Qx()}getStyle(e){const{fillOpacity:t,strokeWidth:i,strokeOpacity:s,fill:o,stroke:a,lineDash:n,lineDashOffset:r,cornerRadius:l}=this.item[e==="subtotal"?"total":e];return{fill:o,fillOpacity:t,stroke:a,strokeWidth:i,strokeOpacity:s,lineDash:n,lineDashOffset:r,cornerRadius:l,opacity:1}}};h([ne],zt.prototype,"xKey",2),h([ne],zt.prototype,"yKey",2),h([ne],zt.prototype,"xName",2),h([ne],zt.prototype,"yName",2),h([ne],zt.prototype,"item",2),h([ne],zt.prototype,"totals",2),h([ne],zt.prototype,"line",2),h([ne],zt.prototype,"tooltip",2);var{adjustLabelPlacement:ib,SeriesNodePickMode:eh,fixNumericExtent:sb,valueProperty:th,keyProperty:ob,accumulativeValueProperty:Ro,trailingAccumulatedValueProperty:ab,ChartAxisDirection:Po,createDatumId:nb,checkCrisp:rb,updateLabelNode:lb,prepareBarAnimationFunctions:cb,collapsedStartingBarPosition:hb,resetBarSelectionsFn:pb,seriesLabelFadeInAnimation:db,resetLabelFn:ub,animationValidation:gb,DEFAULT_CARTESIAN_DIRECTION_KEYS:mb,DEFAULT_CARTESIAN_DIRECTION_NAMES:yb,computeBarFocusBounds:fb,isContinuous:ih,Rect:Sb,motion:xb,applyShapeStyle:bb,mergeDefaults:sh,getItemStylesPerItemId:vb,DataSet:kb}=vi,Co=class extends vi.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:mb,propertyNames:yb,categoryKey:void 0,pickModes:[eh.NEAREST_NODE,eh.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:pb,label:ub}}),this.properties=new zt,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:s}=this.properties,{data:o}=this;if(!this.visible)return;const a=x=>ih(x)&&Number(x)>=0,n=x=>ih(x)&&Number(x)>=0,r=x=>x==="total"||x==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],p=s.reduce((x,v)=>{const b=x.get(v.index);return b?b.push(v):x.set(v.index,[v]),x},new Map);for(const[x,v]of o?.data.entries()??[]){c.push(v);const b=p.get(x);if(b)for(const k of b)c.push({...k.toJson(),[t]:k.axisLabel})}const d=[];this.ctx.animationManager.isSkipped()||d.push(gb());const u=this.getCategoryAxis()?.scale,m=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:y,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:m}),{processedData:S}=await this.requestDataModel(e,kb.wrap(c),{props:[ob(t,y,{id:"xValue"}),Ro(i,f,{...l,id:"yCurrent"}),Ro(i,f,{...l,missingValue:0,id:"yCurrentTotal"}),Ro(i,f,{...l,id:"yCurrentPositive",validation:a}),Ro(i,f,{...l,id:"yCurrentNegative",validation:n}),ab(i,f,{...l,id:"yPrevious"}),th(i,f,{id:"yRaw"}),th("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...g?[vi.SMALLEST_KEY_INTERVAL,vi.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=S.reduced?.smallestKeyInterval,this.largestDataInterval=S.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[s],values:o}=t.domain;if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category")return s;const n=e===Po.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(s,r!==n)}else{const a=i.resolveProcessedDataIndexById(this,"yCurrent"),n=o[a],r=[Math.min(0,n[0]),Math.max(0,n[1])];return sb(r)}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{data:e,dataModel:t,processedData:i}=this,s=this.getCategoryAxis(),o=this.getValueAxis();if(!e||!s||!o||!t||!i)return;const{line:a}=this.properties,n=s.scale,r=o.scale,l=this.getBarDirection()===Po.X,c=this.getBandwidth(s)??10,p=s.isReversed(),d=o.isReversed();if(i.type!=="ungrouped")return;const u={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:vb(this.getItemStyle.bind(this),"total","subtotal","positive","negative")};if(!this.visible)return u;const m=[],g=t.resolveKeysById(this,"xValue",i),y=t.resolveColumnById(this,"yRaw",i),f=t.resolveColumnById(this,"totalTypeValue",i),S=t.resolveColumnById(this,"yCurrent",i),x=t.resolveColumnById(this,"yPrevious",i),v=t.resolveColumnById(this,"yCurrentTotal",i),b=this.getSeriesDomain(Po.Y),k=rb(s?.scale,s?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function A(E,L,P){return E||L?{cumulativeValue:v[P],trailingValue:L?D:0}:{cumulativeValue:S[P],trailingValue:x[P]}}function I(E,L,P,T,M){return E?T:L?(T??0)-(M??0):P}let D=0;const{xKey:N,yKey:R,xName:C,yName:w}=this.properties,G=i.dataSources.get(this.id)?.data??[];for(const[E,L]of G.entries()){const P=f[E],T=this.isSubtotal(P),M=this.isTotal(P),O=M||T,B=g[E];if(B==null)continue;const F=Math.round(n.convert(B)),V=y[E],{cumulativeValue:W,trailingValue:K}=A(M,T,E);O&&(D=W??0);const z=Math.round(r.convert(W)),$=Math.round(r.convert(K)),Z=I(M,T,V,W,K),q=(Z??0)>=0,Y=this.getSeriesItemType(q,P),{strokeWidth:Q,label:ie}=this.getItemConfig(Y),U=q?z:$,ce=q?$:z,ae=Math.max(Q,Math.abs(ce-U)),j={x:l?Math.min(U,ce):F,y:l?F:Math.min(U,ce),width:l?ae:c,height:l?c:ae},re={x:j.x+j.width/2,y:j.y+j.height/2},se=O?z:$,ue=Math.floor(a.strokeWidth)%2/2,le=p?z:se,ye=p?se:z;let we,rt;l?(we={x:le+ue,y:j.y},rt={x:ye+ue,y:j.y+j.height}):(we={x:j.x,y:le+ue},rt={x:j.x+j.width,y:ye+ue});const pi={x:p?rt.x:we.x,y:p?rt.y:we.y,x2:p?we.x:rt.x,y2:p?we.y:rt.y,size:0};m.push(pi);const bt=Y==="subtotal"?"total":Y,Pt=this.getLabelText(Z,L,R,"y",b,ie,{itemId:bt,value:Z,datum:L,xKey:N,yKey:R,xName:C,yName:w}),gs=ie.spacing+(typeof ie.padding=="number"?ie.padding:0),ms={index:E,series:this,itemId:Y,datum:L,datumIndex:E,cumulativeValue:W??0,xValue:B,yValue:Z,yKey:R,xKey:N,x:j.x,y:j.y,width:j.width,height:j.height,midPoint:re,crisp:k,label:{text:Pt,...ib({isUpward:(Z??-1)>=0!==d,isVertical:!l,placement:ie.placement,spacing:gs,rect:j})}};u.nodeData.push(ms),u.labelData.push(ms)}const _=this.properties.line.enabled;return S!=null&&_&&(u.pointData=m),u}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const s=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),o=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=e.resolveProcessedDataIndexById(this,"totalTypeValue"),n=i.domain.values[s]??[],r=i.domain.values[o]??[];n.length>0&&t.add("positive"),r.length>0&&t.add("negative");const l=i?.domain.values[a];if(l)for(const c of l)(c==="total"||c==="subtotal")&&t.add("total")}isSubtotal(e){return e==="subtotal"}isTotal(e){return e==="total"}nodeFactory(){return new Sb}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s)}getItemStyle(e,t,i,s="total"){const{properties:o}=this,{datumIndex:a=0,datum:n}=e??{},r=s==="subtotal"?"total":s,l=o.item[r],c=this.getHighlightStyle(t,a,i),p=sh(c,o.getStyle(s)),{itemStyler:d}=l;let u=p;if(d!=null&&e!=null){const m=this.cachedDatumCallback(nb(a,t?"highlight":"node"),()=>{const g=this.makeItemStylerParams(s,a,n,t,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",r],this.callWithContext(d,g))});m&&(u=sh(m,u))}return u}makeItemStylerParams(e,t,i,s,o){const{id:a,properties:n}=this,{xKey:r,yKey:l}=n,c=this.ctx.highlightManager?.getActiveHighlight(),p=this.getHighlightStateString(c,s,t),d=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:a,itemId:e,datum:i,xKey:r,yKey:l,highlighted:s,highlightState:p,...o,fill:d}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t,void 0,s.itemId)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),o=this.getCategoryDirection()===Po.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=r.style??i.styles[r.itemId][this.getHighlightState(s,t,r.datumIndex)];bb(n,l,a),n.cornerRadius=l.cornerRadius??0,n.visible=o?r.width>0:r.height>0,n.crisp=r.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(t.length===0)return i.update([]);const s=t.filter(o=>{const{label:a}=this.getItemConfig(o.itemId);return a.enabled});return i.update(s)}updateLabelNodes(e){const t={itemId:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,o)=>{t.itemId=o.itemId,s.fillOpacity=this.getHighlightStyle(!1,o.datumIndex)?.opacity??1;const a=this.getItemConfig(o.itemId).label;lb(this,s,t,a,o.label,!1,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{xKey:a,xName:n,yKey:r,yName:l,tooltip:c,legendItemName:p}=o,d=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!s||!d||!u)return;const m=s.dataSources.get(this.id)?.data[e],g=i.resolveKeysById(this,"xValue",s)[e],y=i.resolveColumnById(this,"yRaw",s)[e],f=i.resolveColumnById(this,"yCurrentTotal",s),S=i.resolveColumnById(this,"totalTypeValue",s);if(g==null)return;const x=S[e],v=(y??0)>=0,b=this.getSeriesItemType(v,x);let k;if(this.isTotal(x))k=f[e];else if(this.isSubtotal(x)){k=f[e];for(let D=e-1;D>=0;D-=1)if(this.isSubtotal(S[D])){k=k-f[D];break}}else k=y;const A=this.contextNodeData?.nodeData?.[e],I=this.getItemStyle(A,!1,void 0,A?.itemId);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(d,"tooltip",g,m,a,p),symbol:this.legendItemSymbol(b),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(u,"tooltip",k,m,r,p)}]},{seriesId:t,datum:m,title:l,itemId:b,xKey:a,xName:n,yKey:r,yName:l,...I})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:s,strokeOpacity:o,strokeWidth:a,lineDash:n,lineDashOffset:r}=this.getItemConfig(e);return{marker:{fill:t,stroke:i,fillOpacity:s,strokeOpacity:o,strokeWidth:a,lineDash:n,lineDashOffset:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,seriesItemTypes:i}=this,s=[],o=n=>n.charAt(0).toUpperCase()+n.substring(1),{showInLegend:a}=this.properties;for(const n of i){const{name:r}=this.getItemConfig(n);s.push({legendType:"category",id:t,itemId:n,seriesId:t,enabled:!0,label:{text:r??o(n)},symbol:this.legendItemSymbol(n),hideInLegend:!a,isFixed:!0})}return s}toggleSeriesItem(){}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:s}=e,o=cb(hb(this.isVertical(),this.axes,"normal"),"unknown");xb.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o),db(this,"labels",this.ctx.animationManager,i);const{pointData:a}=s;a&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const o=this.getValueAxis(),a=o?.isReversed(),n=a?(p,d)=>pp>d,r=o?.scale.convert(0),l=t.reduce((p,d)=>(n(d.x,p)&&(p=d.x),p),a?1/0:0),c=(p,d,u,m,g)=>(p-d)/(u-d)*(g-m)+m;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:vi.Motion.easeOut,collapsable:!1,onUpdate(p){s.clear(!0);for(const[d,u]of t.entries()){const m=c(p,r,l,r,u.x),g=c(p,r,l,r,u.x2);d!==0&&s.lineTo(m,u.y),s.moveTo(g,u.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:s}=i;this.updateLineNode(i);const o=this.getValueAxis(),a=o?.isReversed(),n=a?(p,d)=>p>d:(p,d)=>p(n(d.y,p)&&(p=d.y),p),a?0:1/0),c=(p,d,u,m,g)=>(p-d)/(u-d)*(g-m)+m;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:vi.Motion.easeOut,collapsable:!1,onUpdate(p){s.clear(!0);for(const[d,u]of t.entries()){const m=c(p,r,l,r,u.y),g=c(p,r,l,r,u.y2);d!==0&&s.lineTo(u.x,m),s.moveTo(u.x2,g)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(t.length===0)return;const[i]=t;this.updateLineNode(i);const{path:s}=i;s.clear(!0);const{pointData:o}=e;if(o){for(const[a,n]of o.entries())a!==0&&s.lineTo(n.x,n.y),s.moveTo(n.x2,n.y2);i.checkPathDirty()}}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,lineJoin:"round",pointerEvents:vi.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return fb(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){const{positive:e,negative:t,total:i}=this.properties.item;return e.itemStyler!=null||e.label.itemStyler!=null||t.itemStyler!=null||t.label.itemStyler!=null||i.itemStyler!=null||i.label.itemStyler!=null}};Co.className="WaterfallSeries",Co.type="waterfall";import{_ModuleSupport as Db}from"ag-charts-community";import{arrayOfDefs as Ib,constant as Ab,positiveNumber as Mb,required as Yi,string as Ls,union as Nb}from"ag-charts-core";var{commonSeriesOptionsDefs:Lb,waterfallSeriesThemeableOptionsDef:Tb}=Db,Rb={...Tb,...Lb,type:Yi(Ab("waterfall")),xKey:Yi(Ls),yKey:Yi(Ls),xName:Ls,yName:Ls,totals:Ib({totalType:Yi(Nb("total","subtotal")),index:Yi(Mb),axisLabel:Yi(Ls)},"a total definition options array")};import{_ModuleSupport as Dn}from"ag-charts-community";var{FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:Pb,FILL_IMAGE_DEFAULTS:Cb,FILL_PATTERN_KEYED_DEFAULTS:Ob}=Dn;function In(e,t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},["gradient",Pb(e)],["image",Cb],["pattern",Ob(e)]]},stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...Dn.LABEL_BOXING_DEFAULTS,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}var _b={series:{item:{positive:In("altUp",0),negative:In("altDown",1),total:In("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:Dn.singleSeriesHighlightStyle()},legend:{enabled:!0,toggleSeries:!1}},HR={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:e=>new Co(e),defaultAxes:qx.DIRECTION_SWAP_AXES,themeTemplate:_b},An={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:Rb,create:e=>new Co(e)},{NewAreaSeriesModule:wb,NewBarSeriesModule:Eb,NewBubbleSeriesModule:Fb,NewHistogramSeriesModule:Bb,NewLineSeriesModule:Gb,NewScatterSeriesModule:Vb,numberFormatValidator:Kb,textOrSegments:Wb,without:ct}=mm,oh={width:gt,height:gt,grip:bs,fill:oo,stroke:oo,strokeWidth:gt,cornerRadius:gt},ht=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],zb=[...ht,"errorBar","label","legendItemName","direction"],$b=[...ht,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],Hb=[...ht,"title","label","labelKey","labelName","sizeName"],Xb=[...ht,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],Yb=[...ht,"label"],Ub=[...ht,"errorBar","title","label"],qb=[...ht,"label","yLowName","yHighName"],jb=[...ht,"direction","label","yLowName","yHighName"],Jb=[...ht,"errorBar","title","label","labelKey","labelName"],Zb=[...ht,"direction"],Qb={enabled:bs,height:gt,spacing:gt,cornerRadius:Cl,mask:{fill:oo,fillOpacity:bm,stroke:oo,strokeWidth:gt},minHandle:oh,maxHandle:oh,miniChart:{enabled:bs,padding:{top:gt,bottom:gt},label:{enabled:bs,avoidCollisions:bs,spacing:gt,format:Kb,formatter:Sm(Wb),interval:{minSpacing:gt,maxSpacing:gt,values:ym,step:Cl},...xm},series:fm(vm({area:ct(wb.options,[...ht,"type"]),bar:ct(Eb.options,[...zb,"type"]),"box-plot":ct(Ya.options,[...$b,"type"]),bubble:ct(Fb.options,[...Hb,"type"]),candlestick:ct(tn.options,[...ht,"type"]),heatmap:ct(nn.options,[...Xb,"type"]),histogram:ct(Bb.options,[...Yb,"type"]),line:ct(Gb.options,[...Ub,"type"]),ohlc:ct(ln.options,[...ht,"type"]),"range-area":ct(Sn.options,[...qb,"type"]),"range-bar":ct(vn.options,[...jb,"type"]),scatter:ct(Vb.options,[...Jb,"type"]),waterfall:ct(An.options,[...Zb,"type"])},"miniChart series options"))}},{annotationOptionsDef:ev}=Jg,tv={type:"plugin",name:"annotations",chartType:"cartesian",options:ev,create(){return null}},iv={type:"plugin",name:"navigator",chartType:"cartesian",options:Qb,create(){return null}},sv={type:"plugin",name:"initialState",options:gm,create(){return null}};import{_ModuleSupport as Ts}from"ag-charts-community";import{_ModuleSupport as ov}from"ag-charts-community";import{Logger as av,cachedTextMeasurer as nv,calcLineHeight as rv,toPlainText as lv,wrapText as cv}from"ag-charts-core";import{_ModuleSupport as Oo}from"ag-charts-community";import{Logger as hv}from"ag-charts-core";function ah(e,t,i){i||(t=pv(t));const s=new Map;for(const a of e)s.set(a.id,{datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let o=0;for(const[a,n]of s.entries())o=Math.max(o,Mn(s,t,n,a,-1,[])+Mn(s,t,n,a,1,[])+1);return{links:t,nodeGraph:s,maxPathLength:o}}function nh(e,t,i,s){const o=s.indexOf(t);if(o!==-1){for(let n=o;n!t.has(i))}function Mn(e,t,i,s,o,a){if(a.includes(s))return 1/0;let n=o===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(n===-1){n=0;const r=o===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:p}=l,d=o===-1?p.id:c.id,u=o===-1?c.id:p.id,m=s===d?e.get(u):void 0;m!=null&&(r.push({node:m,link:l}),a?.push(s),n=Math.max(n,Mn(e,t,m,u,o,a)+1),a?.pop())}o===-1?i.maxPathLengthBefore=n:i.maxPathLengthAfter=n}return n}var{Series:dv,DataController:uv,keyProperty:gv,valueProperty:_o,Selection:Di,Group:Ui,TransformableText:mv}=Oo,yv=class extends Oo.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s);const{datumIndex:o}=i,a=s.contextNodeData?.nodeData.find(n=>n.datumIndex.type===o.type&&n.datumIndex.index===o.index);this.size=a?.size,this.label=a?.type===1?a?.label:void 0}},rh=class extends dv{constructor(){super(...arguments),this.NodeEvent=yv,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Ui({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Ui({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new Ui({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new Ui({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new Ui({name:"linkGroup"})),this.highlightNodeGroup=this.highlightGroup.appendChild(new Ui({name:"nodeGroup"})),this.labelSelection=Di.select(this.labelGroup,mv),this.linkSelection=Di.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Di.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Di.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Di.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Di.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Di.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(e){const{data:t,nodes:i}=this;if(t==null)return;const{fromKey:s,toKey:o,sizeKey:a,idKey:n,labelKey:r}=this.properties,l=new uv("standalone",e.suppressFieldDotNotation),c=i==null?null:l.request(this.id,Oo.DataSet.wrap(i)??Oo.DataSet.empty(),{props:[gv(n,void 0,{id:"idValue",includeProperty:!1}),...r==null?[]:[_o(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),p=e.request(this.id,t,{props:[_o(s,void 0,{id:"fromValue",includeProperty:!1}),_o(o,void 0,{id:"toValue",includeProperty:!1}),...a==null?[]:[_o(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[d,u]=await Promise.all([c??Promise.resolve(null),p]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const m=new Map;if(d==null){const g=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),y=u.dataModel.resolveColumnById(this,"toValue",u.processedData),f=x=>{const v=m.size,b=x;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:v},type:1,index:v,linksBefore:[],linksAfter:[],id:x,size:0,label:b,style:this.getNodeStyle({datumIndex:{type:1,index:v},datum:{},size:0,label:b},v,!1)}},S=u.processedData.dataSources.get(this.id)?.data;if(S)for(const[x]of S.entries()){const v=g[x],b=y[x];v==null||b==null||(m.has(v)||m.set(v,f(v)),m.has(b)||m.set(b,f(b)))}}else{const g=d.dataModel.resolveColumnById(this,"idValue",d.processedData),y=r==null?void 0:d.dataModel.resolveColumnById(this,"labelValue",d.processedData),f=d.processedData.dataSources.get(this.id)?.data;if(f)for(const[S,x]of f.entries()){const v=g[S],b=y?.[S],k={type:1,index:S};m.set(v,{series:this,itemId:void 0,datum:x,datumIndex:k,type:1,index:S,linksBefore:[],linksAfter:[],id:v,size:0,label:b,style:this.getNodeStyle({datumIndex:k,datum:x,size:0,label:b},S,!1)})}}this.processedNodes=m}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:s,linksProcessedData:o}=this;if(s==null||o==null){const{links:y,nodeGraph:f,maxPathLength:S}=ah(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:y,maxPathLength:S}}const{sizeKey:a}=this.properties,n=s.resolveColumnById(this,"fromValue",o),r=s.resolveColumnById(this,"toValue",o),l=a==null?void 0:s.resolveColumnById(this,"sizeValue",o),c=new Map;for(const y of this.processedNodes.values()){const f=e(y);c.set(y.id,f)}const p=[],d=o.dataSources.get(this.id)?.data;if(d)for(const[y,f]of d.entries()){const S=n[y],x=r[y],v=l==null?1:l[y],b=c.get(S),k=c.get(x);if(v<=0||b==null||k==null)continue;const A={type:0,index:y},I=t({series:this,itemId:void 0,datum:f,datumIndex:A,type:0,index:y,fromNode:b,toNode:k,size:v,style:this.getLinkStyle({datum:f,datumIndex:A},b.datumIndex,!1)});p.push(I)}const{links:u,nodeGraph:m,maxPathLength:g}=ah(c.values(),p,i);for(const y of m.values())y.datum.linksBefore=y.linksBefore.map(f=>f.link),y.datum.linksAfter=y.linksAfter.map(f=>f.link);return this.nodeCount=m.size,this.linkCount=u.length,{nodeGraph:m,links:u,maxPathLength:g}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const s=this.contextNodeData?.nodeData??[],o=this.contextNodeData?.labelData??[];let a=this.ctx.highlightManager?.getActiveHighlight();if(a?.series===this&&a.type==null){const{itemId:p}=a;a=p==null?void 0:s.find(d=>d.type===1&&d.id===p)}else a?.series!==this&&(a=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=a==null?1:this.properties.highlight.unhighlightedItem.opacity??1,this.labelSelection=this.updateLabelSelection({labelData:o,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:s.filter(p=>p.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:s.filter(p=>p.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let n,r,l,c;a?.type===1?(n=s.filter(p=>p.type===0&&(p.toNode===a||p.fromNode===a)),r=n.map(p=>p.fromNode===a?p.toNode:p.fromNode),r.push(a),l=[],c=[a]):a?.type===0?(n=[a],r=[a.fromNode,a.toNode],l=[a],c=[]):(n=[],r=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:n,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:r,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(e){}dataCount(){return Number.NaN}getSeriesDomain(e){return[]}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}legendItemSymbol(e,t,i={}){const{fills:s,strokes:o}=this.properties,{fill:a=s[t%s.length],fillOpacity:n=1,stroke:r=o[t%o.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:p=[0],lineDashOffset:d=0}=i;return{marker:{fill:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:p,lineDashOffset:d}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:s},o)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:s??i},symbol:this.legendItemSymbol(1,o),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.linkSelection.each((o,a)=>{const n=o.distanceSquared(e,t);n{const n=o.distanceSquared(e,t);np.datum),c=r.indexOf(s)+t;c>=0&&c0?o=r.at(-1):o=Array.from(this.nodeSelection,d=>d.datum).at(-1)}else if(s?.type===1){const r=Array.from(this.nodeSelection,p=>p.datum),c=r.indexOf(s)+t;c>=0&&cd.datum)[0]}if(o==null)return;const a=o.type===1?Array.from(this.nodeSelection).find(r=>r.datum===o):Array.from(this.linkSelection).find(r=>r.datum===o);if(a==null)return;const n=this.computeFocusBounds(a.node);if(n!=null)return{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:n,clipFocusBox:!0}}getCategoryValue(e){}datumIndexForCategoryValue(e){}};import{_ModuleSupport as fv}from"ag-charts-community";var{Path:Sv,SceneChangeDetection:ei}=fv;function lh({radius:e,startAngle:t,endAngle:i,tension:s}){const o=e*Math.cos(t),a=e*Math.sin(t),n=e*Math.cos(i),r=e*Math.sin(i),l=o*s,c=a*s,p=n*s,d=r*s;return{x:[o,l,p,n],y:[a,c,d,r]}}var $t=class extends Sv{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,s,o,a,n,r){const{path:l,tension:c}=this,p=1-c;l.cubicCurveTo((i-e)*p+e,(s-t)*p+t,(o-n)*p+n,(a-r)*p+r,n,r)}updatePath(){const{path:e,centerX:t,centerY:i,radius:s}=this;let{startAngle1:o,endAngle1:a,startAngle2:n,endAngle2:r}=this;o>n&&([o,n]=[n,o],[a,r]=[r,a]),e.clear();const l=t+s*Math.cos(o),c=i+s*Math.sin(o);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+s*Math.cos(r),i+s*Math.sin(r)),e.arc(t,i,s,r,n,!0),this.tensionedCurveTo(t+s*Math.cos(n),i+s*Math.sin(n),t,i,t,i,t+s*Math.cos(a),i+s*Math.sin(a)),e.arc(t,i,s,a,o,!0),e.closePath()}};h([ei()],$t.prototype,"centerX",2),h([ei()],$t.prototype,"centerY",2),h([ei()],$t.prototype,"radius",2),h([ei()],$t.prototype,"startAngle1",2),h([ei()],$t.prototype,"endAngle1",2),h([ei()],$t.prototype,"startAngle2",2),h([ei()],$t.prototype,"endAngle2",2),h([ei()],$t.prototype,"tension",2);import{_ModuleSupport as xv}from"ag-charts-community";var{FillGradientDefaults:bv,FillPatternDefaults:vv,FillImageDefaults:kv,BaseProperties:ch,makeSeriesTooltip:Dv,SeriesProperties:Iv,Property:oe,Label:Av}=xv,Nn=class extends Av{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};h([oe],Nn.prototype,"spacing",2),h([oe],Nn.prototype,"maxWidth",2);var wt=class extends ch{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,tension:l}=this,c=this.fill??e[i%e.length],p=this.stroke??t[i%e.length];return{fill:c,fillOpacity:s,stroke:p,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,tension:l}}};h([oe],wt.prototype,"fill",2),h([oe],wt.prototype,"fillOpacity",2),h([oe],wt.prototype,"stroke",2),h([oe],wt.prototype,"strokeOpacity",2),h([oe],wt.prototype,"strokeWidth",2),h([oe],wt.prototype,"lineDash",2),h([oe],wt.prototype,"lineDashOffset",2),h([oe],wt.prototype,"tension",2),h([oe],wt.prototype,"itemStyler",2);var Mt=class extends ch{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this,l=this.fill??e[i%e.length],c=this.stroke??t[i%e.length];return{fill:l,fillOpacity:s,stroke:c,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}}};h([oe],Mt.prototype,"spacing",2),h([oe],Mt.prototype,"width",2),h([oe],Mt.prototype,"fill",2),h([oe],Mt.prototype,"fillOpacity",2),h([oe],Mt.prototype,"stroke",2),h([oe],Mt.prototype,"strokeOpacity",2),h([oe],Mt.prototype,"strokeWidth",2),h([oe],Mt.prototype,"lineDash",2),h([oe],Mt.prototype,"lineDashOffset",2),h([oe],Mt.prototype,"itemStyler",2);var Be=class extends Iv{constructor(){super(),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new bv,this.fillPatternDefaults=new vv,this.fillImageDefaults=new kv,this.fills=[],this.strokes=[],this.label=new Nn,this.link=new wt,this.node=new Mt,this.tooltip=Dv(),this.highlightStyle.deprecated=!1}};h([oe],Be.prototype,"fromKey",2),h([oe],Be.prototype,"toKey",2),h([oe],Be.prototype,"idKey",2),h([oe],Be.prototype,"idName",2),h([oe],Be.prototype,"labelKey",2),h([oe],Be.prototype,"labelName",2),h([oe],Be.prototype,"sizeKey",2),h([oe],Be.prototype,"sizeName",2),h([oe],Be.prototype,"nodes",2),h([oe],Be.prototype,"fillGradientDefaults",2),h([oe],Be.prototype,"fillPatternDefaults",2),h([oe],Be.prototype,"fillImageDefaults",2),h([oe],Be.prototype,"fills",2),h([oe],Be.prototype,"strokes",2),h([oe],Be.prototype,"label",2),h([oe],Be.prototype,"link",2),h([oe],Be.prototype,"node",2),h([oe],Be.prototype,"tooltip",2);var{SeriesNodePickMode:hh,createDatumId:wo,angleBetween:Eo,normalizeAngle360:Mv,isBetweenAngles:ph,Sector:Nv,evaluateBezier:Fo,applyShapeStyle:dh,getShapeStyle:Bo,getLabelStyles:Lv,BBox:Tv,mergeDefaults:Go}=ov,Vo=e=>e.startAngle+Eo(e.startAngle,e.endAngle)/2,Ko=class extends rh{constructor(e){super({moduleCtx:e,pickModes:[hh.NEAREST_NODE,hh.EXACT_SHAPE_MATCH]}),this.properties=new Be}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new $t}nodeFactory(){return new Nv}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:s}=this,{fromKey:o,toKey:a,sizeKey:n,labelKey:r,label:{spacing:l,maxWidth:c,fontSize:p},node:{width:d,spacing:u}}=s,m=t/2,g=i/2;let y=[];const{nodeGraph:f,links:S}=this.getNodeGraph(E=>({...E,centerX:m,centerY:g,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),E=>({...E,centerX:m,centerY:g,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let x=0;for(const[E,{datum:L,linksBefore:P,linksAfter:T}]of f.entries()){const M=P.reduce((O,{link:B})=>O+B.size,0)+T.reduce((O,{link:B})=>O+B.size,0);if(M===0)f.delete(E);else{const{label:O}=s;L.size=M,x+=L.size;const B=O.enabled?this.getLabelText(L.label,L.datum,r,"label",[],O,{datum:L.datum,value:L.label,fromKey:o,toKey:a,sizeKey:n,size:L.size}):void 0;L.label=lv(B)}}let v=0;if(this.isLabelEnabled()){const E=nv(this.properties.label);let L=0;for(const{datum:P}of f.values()){const{id:T,label:M}=P;if(M==null)continue;const O=cv(M,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:B}=E.measureLines(O);L=Math.max(B,L),y.push({id:T,text:O,centerX:m,centerY:g,angle:Number.NaN,radius:Number.NaN,size:P.size})}v=L+l}const b=f.size;let k=Math.min(t,i)/2-d-v,A=u/k;if(v!==0&&(b*A>=1.5*Math.PI||k<=0)&&(y=[],k=Math.min(t,i)/2-d,A=u/k),b*A>=2*Math.PI||k<=0){av.warnOnce("There was insufficient space to display the Chord Series.");return}const I=k,D=k+d,N=Math.max((2*Math.PI-b*A)/x,0);let R=0;for(const{datum:E}of f.values()){E.innerRadius=I,E.outerRadius=D,E.startAngle=R,E.endAngle=R+E.size*N,R=E.endAngle+A;const L=(E.innerRadius+E.outerRadius)/2,P=Vo(E);E.midPoint={x:E.centerX+L*Math.cos(P),y:E.centerY+L*Math.sin(P)}}const C=[];for(const{datum:E,linksBefore:L,linksAfter:P}of f.values()){const T=Vo(E),M=[...L.map(B=>({link:B.link,distance:Eo(Vo(B.node.datum),T),after:!1})),...P.map(B=>({link:B.link,distance:Eo(Vo(B.node.datum),T),after:!0}))];let O=E.startAngle;for(const{link:B,after:F}of M.toSorted((V,W)=>V.distance-W.distance)){const V=B.size*N;F?(B.startAngle1=O,B.endAngle1=O+V):(B.startAngle2=O,B.endAngle2=O+V),O+=B.size*N}C.push(E)}const{tension:w}=this.properties.link;for(const E of S){E.radius=k;const L=lh({radius:k,startAngle:E.startAngle1,endAngle:E.endAngle2,tension:w}),P=lh({radius:k,startAngle:E.startAngle2,endAngle:E.endAngle1,tension:w}),T=Fo(...L.x,.5),M=Fo(...L.y,.5),O=Fo(...P.x,.5),B=Fo(...P.y,.5);E.midPoint={x:E.centerX+(T+O)/2,y:E.centerY+(M+B)/2},C.push(E)}for(const E of y){const L=f.get(E.id)?.datum;L!=null&&(E.radius=D+l,E.angle=Mv(L.startAngle+Eo(L.startAngle,L.endAngle)/2))}y.sort((E,L)=>E.angle-L.angle);let G=1/0,_=-1/0;return y=y.filter(E=>{const L=rv(p),P=Math.atan2(L/2,E.radius),T=E.angle-P,M=E.angle+P;return ph(G,T,M)||ph(_,T,M)?!1:(G=Math.min(T,G),_=Math.max(M,_),!0)}),{itemId:e,nodeData:C,labelData:y}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,{size:o,text:a,centerX:n,centerY:r,radius:l,angle:c})=>{t.size=o;const p=Lv(this,void 0,t,this.properties.label,!1,i),{fontStyle:d,fontWeight:u,fontSize:m,fontFamily:g,color:y}=p;s.visible=!0,s.translationX=n+l*Math.cos(c),s.translationY=r+l*Math.sin(c),s.text=a,s.fill=y,s.fontStyle=d,s.fontWeight=u,s.fontSize=m,s.fontFamily=g,s.textBaseline="middle",Math.cos(c)>=0?(s.textAlign="left",s.rotation=c):(s.textAlign="right",s.rotation=c-Math.PI),s.setBoxing(p)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>wo(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:o,strokes:a,fillGradientDefaults:n,fillPatternDefaults:r,fillImageDefaults:l}=s,{itemStyler:c}=s.node,p=this.getHighlightStyle(i,e.datumIndex),d=Go(p,s.node.getStyle(o,a,t));let u=Bo(d,n,r,l);if(c!=null&&e.datumIndex!=null){const m=this.cachedDatumCallback(wo(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const g=this.makeItemStylerParams(e,i,u);return this.callWithContext(c,g)});m&&(u=Bo(Go(m,u),n,r,l))}return u.opacity=1,u}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},o,a){const{id:n}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,o,t),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:n,datum:e,highlighted:o,highlightState:l,...a,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const{datumIndex:n}=a,r=this.getNodeStyle(a,n.index,i);dh(o,r,s),o.centerX=a.centerX,o.centerY=a.centerY,o.innerRadius=a.innerRadius,o.outerRadius=a.outerRadius,o.startAngle=a.startAngle,o.endAngle=a.endAngle,o.inset=o.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>wo(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:o,properties:a}=this,{fills:n,strokes:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:p}=a,{itemStyler:d}=a.link,u=this.getHighlightStyle(s,e),m=Go(u,a.link.getStyle(n,r,i.index));let g=Bo(m,l,c,p);if(d!=null&&e!=null){const y=this.ctx.highlightManager?.getActiveHighlight(),f=this.cachedDatumCallback(wo(e.index,"link",s?"highlight":"node"),()=>{const S=this.getHighlightStateString(y,s,i);return this.callWithContext(d,{seriesId:o,datum:t,highlighted:s,highlightState:S,...g})});f&&(g=Bo(Go(f,g),l,c,p))}return g.opacity=1,g}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const n=a.fromNode.datumIndex,r=this.getLinkStyle(a,n,i);o.centerX=a.centerX,o.centerY=a.centerY,o.radius=a.radius,o.startAngle1=a.startAngle1,o.endAngle1=a.endAngle1,o.startAngle2=a.startAngle2,o.endAngle2=a.endAngle2,o.tension=r.tension,dh(o,r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),s=(e-i)/2,o=(t-i)/2,a=new Tv(s,o,e,t);return{series:a,axis:a}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:o,ctx:{formatManager:a}}=this,{fromKey:n,toKey:r,sizeKey:l,sizeName:c,tooltip:p}=o,d=this.contextNodeData?.nodeData.find(x=>x.datumIndex.type===e.type&&x.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,m=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,g=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let f;if(d.type===0){const x=d.fromNode.datumIndex;f=this.getLinkStyle({datumIndex:e,datum:g},x,!1)}else{const x=d.label;f=this.getNodeStyle({datumIndex:e,datum:g,size:y,label:x},e.index,!1)}const S=[];if(l!=null){const x=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:g,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});S.push({label:c,fallbackLabel:l,value:x??String(y)})}return this.formatTooltipWithContext(p,{title:m,symbol:this.legendItemSymbol(d.type,u,f),data:S},{seriesId:t,datum:g,title:m,fromKey:n,toKey:r,sizeKey:l,sizeName:c,size:y,...f})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};Ko.className="ChordSeries",Ko.type="chord";import{_ModuleSupport as Rv}from"ag-charts-community";import{constant as Pv,fillGradientDefaults as Cv,fillImageDefaults as Ov,fillPatternDefaults as _v,required as Ln,string as Wo,undocumented as Tn}from"ag-charts-core";var{commonSeriesOptionsDefs:wv,chordSeriesThemeableOptionsDef:Ev}=Rv,zo={...Ev,...wv,type:Ln(Pv("chord")),fromKey:Ln(Wo),toKey:Ln(Wo),sizeKey:Wo,sizeName:Wo};zo.fillGradientDefaults=Tn(Cv),zo.fillPatternDefaults=Tn(_v),zo.fillImageDefaults=Tn(Ov);var tP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],solo:!0,identifier:"chord",moduleFactory:e=>new Ko(e),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:Ts.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:Ts.FILL_PATTERN_DEFAULTS,fillImageDefaults:Ts.FILL_IMAGE_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},highlight:Ts.singleSeriesHighlightStyle(),label:{...Ts.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},uh={type:"series",name:"chord",chartType:"standalone",enterprise:!0,options:zo,create:e=>new Ko(e)};import{_ModuleSupport as qi}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:ji,CARTESIAN_POSITION:Ji},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:Fv}}=qi,Zi={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},gh={autoRotate:{$path:"/series/0/stageLabel/autoRotate"},autoRotateAngle:{$path:"/series/0/stageLabel/autoRotateAngle"},avoidCollisions:{$path:["/series/0/stageLabel/avoidCollisions",!0]},border:{$path:["/series/0/stageLabel/border"]},color:{$path:["/series/0/stageLabel/color",{$ref:"textColor"}]},cornerRadius:{$path:["/series/0/stageLabel/cornerRadius"]},enabled:{$if:[{$eq:[{$path:"/series/0/stageLabel/enabled"},void 0]},!0,{$path:"/series/0/stageLabel/enabled"}]},fill:{$path:["/series/0/stageLabel/fill"]},fillOpacity:{$path:["/series/0/stageLabel/fillOpacity"]},fontSize:{$path:["/series/0/stageLabel/fontSize",{$ref:"fontSize"}]},fontStyle:{$path:["/series/0/stageLabel/fontStyle",{$ref:"fontStyle"}]},fontWeight:{$path:["/series/0/stageLabel/fontWeight",{$ref:"fontWeight"}]},format:{$path:"/series/0/stageLabel/format"},formatter:{$path:"/series/0/stageLabel/formatter"},itemStyler:{$path:"/series/0/stageLabel/itemStyler"},minSpacing:{$path:"/series/0/stageLabel/minSpacing"},padding:{$path:["/series/0/stageLabel/padding"]},rotation:{$path:["/series/0/stageLabel/rotation",0]}},sP=[{type:{$if:[Zi,ji.NUMBER,ji.CATEGORY]},position:{$if:[Zi,Ji.LEFT,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},Ji.RIGHT,Ji.LEFT]}]},label:{$if:[Zi,void 0,gh]}},{type:{$if:[Zi,ji.CATEGORY,ji.NUMBER]},position:{$if:[Zi,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},Ji.TOP,Ji.BOTTOM]},Ji.BOTTOM]},label:{$if:[Zi,gh,void 0]}}],oP={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"fills"}]}],{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",qi.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],["pattern",qi.FILL_PATTERN_SINGLE_DEFAULTS],["image",qi.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...qi.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:Fv,xOffset:3,yOffset:3,blur:5},highlight:qi.singleSeriesHighlightStyle()},axes:{[ji.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[ji.CATEGORY]:{line:{enabled:!1}}}};import{_ModuleSupport as Bv}from"ag-charts-community";import{_ModuleSupport as Rn}from"ag-charts-community";import{_ModuleSupport as Gv}from"ag-charts-community";var{lineDistanceSquared:$o,BBox:Vv,Path:Kv,SceneChangeDetection:ti}=Gv,mh=1e-6;function yh([e,t],[i,s]){return Math.abs(e-i)<=mh&&Math.abs(t-s)<=mh}var Et=class extends Kv{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:a,x3:n,y3:r}=this;return{x:(e+i+o+n)/4,y:(t+s+a+r)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:s,x1:o,y1:a,x2:n,y2:r,x3:l,y3:c}=this;return Math.min($o(e,t,i,s,o,a,1/0),$o(e,t,o,a,n,r,1/0),$o(e,t,n,r,l,c,1/0),$o(e,t,l,c,i,s,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:s,x2:o,y2:a,x3:n,y3:r}=this,l=Math.min(e,i,o,n),c=Math.max(e,i,o,n)-l,p=Math.min(t,s,a,r),d=Math.max(t,s,a,r)-p;return new Vv(l,p,c,d)}updatePath(){const{path:e,x0:t,y0:i,x1:s,y1:o,x2:a,y2:n,x3:r,y3:l}=this,c=[[t,i],[s,o],[a,n],[r,l]];e.clear();let p,d;for(const u of c){if(p!=null&&yh(p,u)||d!=null&&yh(d,u))continue;const[m,g]=u;p==null?e.moveTo(m,g):e.lineTo(m,g),p??(p=u),d=u}e.closePath()}};h([ti()],Et.prototype,"x0",2),h([ti()],Et.prototype,"y0",2),h([ti()],Et.prototype,"x1",2),h([ti()],Et.prototype,"y1",2),h([ti()],Et.prototype,"x2",2),h([ti()],Et.prototype,"y2",2),h([ti()],Et.prototype,"x3",2),h([ti()],Et.prototype,"y3",2);import{_ModuleSupport as Wv}from"ag-charts-community";var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:zv}=Wv;function fh(e,t,i,s){const{x0:o,y0:a,x1:n,y1:r,x2:l,y2:c,x3:p,y3:d,opacity:u}=e;return i?{x0:(o+p)/2,y0:(a+d)/2,x1:(n+l)/2,y1:(r+c)/2,x2:(n+l)/2,y2:(r+c)/2,x3:(o+p)/2,y3:(a+d)/2,opacity:u}:{x0:(o+n)/2,y0:(a+r)/2,x1:(o+n)/2,y1:(a+r)/2,x2:(l+p)/2,y2:(c+d)/2,x3:(l+p)/2,y3:(c+d)/2,opacity:u}}function $v(e,t){const i=a=>a==null;return{fromFn:(a,n,r)=>{r==="updated"&&i(n)?r="removed":r==="updated"&&i(a.previousDatum)&&(r="added");let l;r==="added"&&a.previousDatum==null&&t==="fade"?l={...Rs(a,n),opacity:0}:r==="unknown"||r==="added"?l=fh(n,a.previousDatum,e,t):l={x0:a.x0,y0:a.y0,x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,x3:a.x3,y3:a.y3,opacity:a.opacity};const c=zv[r];return{...l,phase:c}},toFn:(a,n,r)=>{let l;return r==="removed"&&a.datum==null&&t==="fade"?l={...Rs(a,n),opacity:0}:r==="removed"||i(n)?l=fh(n,a.previousDatum,e,t):l=Rs(a,n),l}}}function Rs(e,t){const{x0:i,y0:s,x1:o,y1:a,x2:n,y2:r,x3:l,y3:c,opacity:p}=t;return{x0:i,y0:s,x1:o,y1:a,x2:n,y2:r,x3:l,y3:c,opacity:p}}var{SeriesNodePickMode:Sh,SeriesZIndexMap:xh,valueProperty:Hv,keyProperty:Xv,ChartAxisDirection:Yv,updateLabelNode:Uv,SMALLEST_KEY_INTERVAL:qv,LARGEST_KEY_INTERVAL:jv,diff:Jv,fixNumericExtent:Zv,seriesLabelFadeInAnimation:bh,resetMotion:Qv,resetLabelFn:ek,animationValidation:tk,computeBarFocusBounds:ik,ContinuousScale:sk,Group:ok,Selection:ak,PointerEvents:vh,motion:nk,checkCrisp:rk,createDatumId:lk,applyShapeStyle:ck}=Rn,hk=class extends Rn.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.stageKey,this.yKey=s.properties.valueKey}},kh=class extends Rn.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[Sh.AXIS_ALIGNED,Sh.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:ek}}),this.NodeEvent=hk,this.connectorNodeGroup=this.contentGroup.appendChild(new ok({name:`${this.id}-series-connectorNodes`,zIndex:xh.BACKGROUND})),this.connectorSelection=ak.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=vh.None}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[xh.BACKGROUND,e],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new Et}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:s,id:o}=this,a=(g,y,f)=>s&&this.ctx.legendManager.getItemEnabled({seriesId:o,itemId:f}),n=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:p}=this.getScaleInformation({xScale:n,yScale:r}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(Jv(this.id,this.processedData)),d.push(tk()));const u=this.visible?{}:{forceValue:0},{processedData:m}=await this.requestDataModel(e,this.data,{props:[Xv(t,c,{id:"xValue"}),Hv(i,p,{id:"yValue",...u,validation:a,invalidValue:0}),...l?[qv,jv]:[],...d],groupByKeys:!1});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:s,ctx:{legendManager:o}}=this;if(!t||!i)return[];const{keys:[a]}=t.domain;if(e===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n?.def.valueType==="category"?this.hasData?a.filter((r,l)=>o.getItemEnabled({seriesId:s,itemId:l})):[]:this.padBandExtent(a)}else{const n=this.domainForClippedRange(e,["yValue"],"xValue"),r=Math.max(...n),l=[-r,r];return Zv(l)}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,groupScale:s,processedData:o,id:a,ctx:{legendManager:n}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&r&&l&&i&&o?.type==="ungrouped"))return;const c=r.scale,p=l.scale,d=this.getBarDirection()===Yv.X,{stageKey:u,valueKey:m}=this.properties,g=`${m}`,y={itemId:g,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible},f=this.visible;if(!f)return y;const S=i.resolveKeysById(this,"xValue",o),x=i.resolveColumnById(this,"yValue",o),{barWidth:v,groupIndex:b}=this.updateGroupScale(r),k=sk.is(c)?v*-.5:0,A=rk(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let I;const D=o.dataSources.get(this.id)?.data??[];for(const[N,R]of D.entries()){const C=f&&n.getItemEnabled({seriesId:a,itemId:N}),w=S[N];if(w==null)continue;const G=Math.round(c.convert(w))+s.convert(String(b))+k,_=x[N],E=Math.round(p.convert(-_)),L=Math.round(p.convert(_)),P=this.getItemStyle({datum:R,datumIndex:N},!1),T=Math.max(P.strokeWidth??0,Math.abs(L-E)),M={x:d?Math.min(L,E):G,y:d?G:Math.min(L,E),width:d?T:v,height:d?v:T},O={x:M.x+M.width/2,y:M.y+M.height/2},B=this.createLabelData({datumIndex:N,rect:M,barAlongX:d,yDatum:_,datum:R,visible:C}),F={index:N,series:this,itemId:g,datum:R,datumIndex:N,xValue:w,yValue:_,xKey:u,yKey:m,x:M.x,y:M.y,width:M.width,height:M.height,midPoint:O,crisp:A,label:B,visible:C};if(y.nodeData.push(F),B!=null&&y.labelData.push(B),I!=null){const V=I.rect,W=I.nodeDatum,K=I.datumIndex;d?y.connectorData.push({datum:W,datumIndex:K,x0:V.x,y0:V.y+V.height,x1:V.x+V.width,y1:V.y+V.height,x2:M.x+M.width,y2:M.y,x3:M.x,y3:M.y,opacity:1}):y.connectorData.push({datum:W,datumIndex:K,x0:V.x+V.width,y0:V.y,x1:M.x,y1:M.y,x2:M.x,y2:M.y+M.height,x3:V.x+V.width,y3:V.y+V.height,opacity:1})}C&&(I={itemId:g,rect:M,nodeDatum:F,datumIndex:N})}return y}updateNodes(e,t){super.updateNodes(e,t);const{connectorSelection:i}=this,s=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:s}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,s=t??[];return i.update(s,void 0,o=>this.getDatumId(o))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,s=>this.getDatumId(s.datum))}updateConnectorNodes(e){const t=this.getShapeFillBBox();e.connectorSelection.each((i,s)=>{const{fill:o,fillOpacity:a,stroke:n,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:p}=this.connectorStyle(s.datumIndex);i.setProperties(Rs(i,s)),ck(i,{fill:o,stroke:n,fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:p},t)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=vh.None})}updateLabelNodes(e){const t={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,o)=>{s.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1,Uv(this,s,t,this.properties.label,o,!1,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{stageKey:a,valueKey:n,tooltip:r,legendItemName:l}=o,c=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!c||!p)return;const d=s.dataSources.get(this.id)?.data[e],u=i.resolveKeysById(this,"xValue",s)[e],m=i.resolveColumnById(this,"yValue",s)[e];if(u!=null)return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(c,"tooltip",u,d,a,l),value:this.getAxisValueText(p,"tooltip",m,d,n,l)}]},{seriesId:t,datum:d,title:a,stageKey:a,valueKey:n,...this.tooltipStyle(d,e)})}resetAllAnimation(e){super.resetAllAnimation(e),Qv([this.connectorSelection],Rs)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),o=$v(i,"normal");nk.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],o),bh(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),bh(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return lk(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return ik(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:s,lineDash:o,lineDashOffset:a,fill:n,stroke:r}=this.properties.getStyle(e);return{marker:{fill:n,fillOpacity:i,stroke:r,strokeWidth:t,strokeOpacity:s,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{id:t,processedData:i,dataModel:s,ctx:{legendManager:o},visible:a}=this;if(!s||!i||e!=="category")return[];const{showInLegend:n}=this.properties,r=s.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map((l,c)=>{const p=r[c];if(p!=null)return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:a&&o.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(p)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!n}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};import{_ModuleSupport as pk}from"ag-charts-community";var{Label:dk,AbstractBarSeriesProperties:uk,makeSeriesTooltip:gk,AxisLabel:mk,Property:tt}=pk,Pn=class extends dk{constructor(){super(...arguments),this.spacing=0}};h([tt],Pn.prototype,"placement",2),h([tt],Pn.prototype,"spacing",2);var Dh=class extends mk{};h([tt],Dh.prototype,"placement",2);var pt=class extends uk{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new Pn,this.stageLabel=new Dh,this.tooltip=gk()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};h([tt],pt.prototype,"stageKey",2),h([tt],pt.prototype,"valueKey",2),h([tt],pt.prototype,"fills",2),h([tt],pt.prototype,"fillOpacity",2),h([tt],pt.prototype,"strokes",2),h([tt],pt.prototype,"strokeWidth",2),h([tt],pt.prototype,"strokeOpacity",2),h([tt],pt.prototype,"lineDash",2),h([tt],pt.prototype,"lineDashOffset",2),h([tt],pt.prototype,"label",2),h([tt],pt.prototype,"stageLabel",2),h([tt],pt.prototype,"tooltip",2);function Ih(e,{x:t,y:i,width:s,height:o,opacity:a}){return{x1:t,y1:i,x2:t+s,y2:i+o,opacity:a??1}}var{Line:yk,ChartAxisDirection:fk}=Bv,Cn=class extends kh{constructor(e){super({moduleCtx:e,animationResetFns:{datum:Ih}}),this.properties=new pt}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.data.reduce((s,o,a)=>s+(t.getItemEnabled({seriesId:e,itemId:a})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:e},t){return this.properties.getStyle(e)}connectorStyle(e){return this.properties.getStyle(e)}nodeFactory(){return new yk}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:s,datum:o,visible:a}){const{stageKey:n,valueKey:r,label:l}=this.properties,{spacing:c,placement:p}=l;if(!l.enabled)return;let d,u,m,g;if(i)switch(d=t.x+t.width/2,m="center",p){case"before":u=t.y-c,g="bottom";break;case"after":u=t.y+t.height+c,g="top";break;default:u=t.y+t.height/2,g="middle"}else switch(u=t.y+t.height/2,g="middle",p){case"before":d=t.x-c,m="right";break;case"after":d=t.x+t.width+c,m="left";break;default:d=t.x+t.width/2,m="center"}const y=this.getSeriesDomain(fk.Y),f=this.getLabelText(s,o,r,"y",y,l,{itemId:r,value:s,datum:o,stageKey:n,valueKey:r});return{x:d,y:u,textAlign:m,textBaseline:g,text:f,itemId:r,datum:o,datumIndex:e,series:this,visible:a}}updateDatumNodes(e){const t=this.getHighlightStyle(e.isHighlight);e.datumSelection.each((i,s)=>{i.setProperties(Ih(i,s)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0,i.opacity=t?.opacity??1})}tooltipStyle(e,t){const{fill:i,stroke:s,fillOpacity:o,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}=this.properties.getStyle(t);return{fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}}hasItemStylers(){return this.properties.label.itemStyler!=null}};Cn.className="ConeFunnelSeries",Cn.type="cone-funnel";import{_ModuleSupport as Sk}from"ag-charts-community";import{constant as xk,required as On,string as Ah}from"ag-charts-core";var{commonSeriesOptionsDefs:bk,coneFunnelSeriesThemeableOptionsDef:vk,without:kk}=Sk,Dk={...kk(bk,["showInLegend"]),...vk,type:On(xk("cone-funnel")),stageKey:On(Ah),valueKey:On(Ah)};import{_ModuleSupport as ii}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:Mh}}=ii,uP={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},ii.SAFE_RANGE2_OPERATION]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",ii.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],["pattern",ii.FILL_PATTERN_SINGLE_DEFAULTS],["image",ii.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},ii.SAFE_RANGE2_OPERATION]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...ii.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:ii.singleSeriesHighlightStyle(!1)},seriesArea:{padding:{top:20,bottom:20}},axes:{[Mh.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[Mh.CATEGORY]:{line:{enabled:!1}}}},Nh={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:Dk,create:e=>new Cn(e)};import{_ModuleSupport as Ik}from"ag-charts-community";import{_ModuleSupport as Ak}from"ag-charts-community";var{Label:Mk,DropShadow:Nk,AbstractBarSeriesProperties:Lk,BaseProperties:Tk,makeSeriesTooltip:Rk,AxisLabel:Pk,Property:fe}=Ak,Ck=class extends Mk{},Lh=class extends Pk{};h([fe],Lh.prototype,"placement",2);var Ht=class extends Tk{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:e,stroke:t,fillOpacity:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this;return{fill:e,fillOpacity:i,stroke:t,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,opacity:1}}};h([fe],Ht.prototype,"enabled",2),h([fe],Ht.prototype,"fill",2),h([fe],Ht.prototype,"fillOpacity",2),h([fe],Ht.prototype,"stroke",2),h([fe],Ht.prototype,"strokeWidth",2),h([fe],Ht.prototype,"strokeOpacity",2),h([fe],Ht.prototype,"lineDash",2),h([fe],Ht.prototype,"lineDashOffset",2);var Ye=class extends Lk{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new Ht,this.shadow=new Nk().set({enabled:!1}),this.label=new Ck,this.stageLabel=new Lh,this.tooltip=Rk()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:s,stroke:i[e],strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};h([fe],Ye.prototype,"stageKey",2),h([fe],Ye.prototype,"valueKey",2),h([fe],Ye.prototype,"fills",2),h([fe],Ye.prototype,"fillOpacity",2),h([fe],Ye.prototype,"strokes",2),h([fe],Ye.prototype,"strokeWidth",2),h([fe],Ye.prototype,"strokeOpacity",2),h([fe],Ye.prototype,"lineDash",2),h([fe],Ye.prototype,"lineDashOffset",2),h([fe],Ye.prototype,"spacingRatio",2),h([fe],Ye.prototype,"itemStyler",2),h([fe],Ye.prototype,"dropOff",2),h([fe],Ye.prototype,"shadow",2),h([fe],Ye.prototype,"label",2),h([fe],Ye.prototype,"stageLabel",2),h([fe],Ye.prototype,"tooltip",2);var{ChartAxisDirection:Th,resetBarSelectionsFn:Ok,prepareBarAnimationFunctions:Rh,midpointStartingBarPosition:Ph,createDatumId:_k,Rect:wk,motion:Ch,applyShapeStyle:Ek,mergeDefaults:_n}=Ik,wn=class extends kh{constructor(e){super({moduleCtx:e,animationResetFns:{datum:Ok}}),this.properties=new Ye}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(e){return _n(this.properties.dropOff.getStyle(),this.properties.getStyle(e))}nodeFactory(){return new wk}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:s,visible:o}){const{valueKey:a,stageKey:n,label:r}=this.properties;if(!r.enabled)return;const l=this.getSeriesDomain(Th.Y),c=this.getLabelText(i,s,a,"y",l,r,{itemId:a,value:i,datum:s,stageKey:n,valueKey:a});return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:n,datum:s,datumIndex:e,series:this,visible:o}}getItemStyle({datum:e,datumIndex:t},i){const{id:s,properties:o}=this,{stageKey:a,valueKey:n,itemStyler:r}=o,l=this.getHighlightStyle(i,t);let p=_n(l,o.getStyle(t));if(r!=null){const d=this.ctx.highlightManager?.getActiveHighlight(),u=this.cachedDatumCallback(_k(t,i?"highlight":"node"),()=>{const m=this.getHighlightStateString(d,i,t);return this.callWithContext(r,{seriesId:s,datum:e,highlighted:i,highlightState:m,stageKey:a,valueKey:n,...p})});u&&(p=_n(u,p))}return p}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const{shadow:s}=this.properties,o=this.getCategoryDirection()===Th.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=this.getItemStyle(r,t);Ek(n,l,a),n.visible=o?r.width>0:r.height>0,n.crisp=r.crisp,n.fillShadow=s})}tooltipStyle(e,t){return this.getItemStyle({datum:e,datumIndex:t},!1)}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),o=Rh(Ph(i,"normal"),"unknown");Ch.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,s=i?.reduced?.diff?.[this.id],o=Rh(Ph(this.isVertical(),"fade"),"added");Ch.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],o,(a,n)=>n.xValue,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};wn.className="FunnelSeries",wn.type="funnel";import{_ModuleSupport as Fk}from"ag-charts-community";import{constant as Bk,required as En,string as Oh}from"ag-charts-core";var{commonSeriesOptionsDefs:Gk,funnelSeriesThemeableOptionsDef:Vk,without:Kk}=Fk,Wk={...Vk,...Kk(Gk,["showInLegend"]),type:En(Bk("funnel")),stageKey:En(Oh),valueKey:En(Oh)},_h={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:Wk,create:e=>new wn(e)};import{_ModuleSupport as Ps}from"ag-charts-community";import{_ModuleSupport as Qi}from"ag-charts-community";import{cachedTextMeasurer as wh,isArray as zk,measureTextSegments as $k}from"ag-charts-core";import{_ModuleSupport as Hk}from"ag-charts-community";function Fn(e,t,i){return Hk.callWithContext(e.chartService,t,i)}var Eh=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,s){const o=e.nodes();if(o.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const a=o[0],n=o.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??o.at(-1);this.node.datum=this.datum=a.datum,s(this.node,a,n)}}};import{isArray as Xk}from"ag-charts-core";var Fh={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function Bh(e,t){if(e==null)return"";const{min:i,max:s}=t,o=i===0?0:Math.ceil(Math.log10(Math.abs(i))),a=s===0?0:Math.ceil(Math.log10(Math.abs(s))),n=Math.max(2-Math.max(o,a),0);return e.toFixed(n)}function Cs(e,t,i,s){if(i.text!=null)return i.text;const o=s??i.value;let a;return i?.formatter!=null&&(a=Fn(t,i.formatter,{seriesId:e,datum:void 0,value:o})),a==null||Xk(a)?a:String(a)}function Gh({path:e,x:t,y:i,size:s}){e.moveTo(t,i-s/2),e.lineTo(t,i+s/2)}import{clamp as Vh,iterate as Yk}from"ag-charts-core";function Kh(e,t){const i=Yk(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function Wh(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(l=>l.data&&l.data.length>0),s=Vh(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:o,selection:a}=i[s];if(o==null||o.length===0)return;const n=Vh(0,t.datumIndex,o.length-1),r=o[n];for(const l of a)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:n,otherIndex:s}}import{_ModuleSupport as Bn}from"ag-charts-community";import{_ModuleSupport as Uk}from"ag-charts-community";import{Logger as qk}from"ag-charts-core";var{BaseProperties:zh,Property:es}=Uk,Ho=class extends zh{getSegments(e,t){const{values:i,step:s,count:o}=this,a=Math.min(...e.domain),n=Math.max(...e.domain);let r;if(i!=null){const l=i.filter(c=>c>a&&cc-p);r=[a,...l,n]}else if(s!=null){const l=[];for(let c=a;cc>a&&cp/l*(n-a)+a)}return r!=null&&r.length>t&&(qk.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[a,n]),r}};h([es],Ho.prototype,"values",2),h([es],Ho.prototype,"step",2),h([es],Ho.prototype,"count",2);var Os=class extends zh{constructor(){super(...arguments),this.enabled=!1,this.interval=new Ho,this.spacing=0}};h([es],Os.prototype,"enabled",2),h([es],Os.prototype,"interval",2),h([es],Os.prototype,"spacing",2);var{BaseProperties:Xo,makeSeriesTooltip:jk,SeriesProperties:Jk,PropertiesArray:Gn,Property:X,Label:Zk,AxisLabel:Qk,getColorStops:eD}=Bn,$h=class extends Zk{};h([X],$h.prototype,"spacing",2);var Ue=class extends Xo{constructor(){super(...arguments),this.value=0,this.label=new $h}getStyle(e){const{fill:t=e.fill??"black",fillOpacity:i=e.fillOpacity??1,stroke:s=e.stroke??"black",strokeWidth:o=e.strokeWidth??0,strokeOpacity:a=e.strokeOpacity??1,lineDash:n=e.lineDash??[0],lineDashOffset:r=e.lineDashOffset??0}=this;return{fill:t,fillOpacity:i,stroke:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}}};h([X],Ue.prototype,"text",2),h([X],Ue.prototype,"value",2),h([X],Ue.prototype,"shape",2),h([X],Ue.prototype,"placement",2),h([X],Ue.prototype,"spacing",2),h([X],Ue.prototype,"size",2),h([X],Ue.prototype,"rotation",2),h([X],Ue.prototype,"fill",2),h([X],Ue.prototype,"fillOpacity",2),h([X],Ue.prototype,"stroke",2),h([X],Ue.prototype,"strokeWidth",2),h([X],Ue.prototype,"strokeOpacity",2),h([X],Ue.prototype,"lineDash",2),h([X],Ue.prototype,"lineDashOffset",2),h([X],Ue.prototype,"label",2);var dt=class extends Xo{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new Gn(Bn.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fill:s,fills:o,fillMode:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:p,lineDashOffset:d}=this;return{fill:s??Xh(o,a,e,i,t),fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:p,lineDashOffset:d}}};h([X],dt.prototype,"enabled",2),h([X],dt.prototype,"thickness",2),h([X],dt.prototype,"thicknessRatio",2),h([X],dt.prototype,"fills",2),h([X],dt.prototype,"fillMode",2),h([X],dt.prototype,"fill",2),h([X],dt.prototype,"fillOpacity",2),h([X],dt.prototype,"stroke",2),h([X],dt.prototype,"strokeWidth",2),h([X],dt.prototype,"strokeOpacity",2),h([X],dt.prototype,"lineDash",2),h([X],dt.prototype,"lineDashOffset",2);var _s=class extends Xo{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};h([X],_s.prototype,"values",2),h([X],_s.prototype,"step",2),h([X],_s.prototype,"minSpacing",2),h([X],_s.prototype,"maxSpacing",2);var Hh=class extends Qk{constructor(){super(...arguments),this.placement=void 0}};h([X],Hh.prototype,"placement",2);var Je=class extends Xo{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Gn(Bn.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new _s,this.label=new Hh}getStyle(e,t,i,s){const{fill:o,fills:a,defaultFill:n,fillMode:r,fillOpacity:l,stroke:c,strokeWidth:p,strokeOpacity:d,lineDash:u,lineDashOffset:m}=this;return{fill:o??(e&&a.length===0?n:void 0)??Xh(a,r,t,s,i),fillOpacity:l,stroke:c,strokeWidth:p,strokeOpacity:d,lineDash:u,lineDashOffset:m}}};h([X],Je.prototype,"min",2),h([X],Je.prototype,"max",2),h([X],Je.prototype,"fills",2),h([X],Je.prototype,"fillMode",2),h([X],Je.prototype,"fill",2),h([X],Je.prototype,"fillOpacity",2),h([X],Je.prototype,"stroke",2),h([X],Je.prototype,"strokeWidth",2),h([X],Je.prototype,"strokeOpacity",2),h([X],Je.prototype,"lineDash",2),h([X],Je.prototype,"lineDashOffset",2),h([X],Je.prototype,"defaultFill",2),h([X],Je.prototype,"interval",2),h([X],Je.prototype,"label",2);var Yo=class extends _t{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};h([X],Yo.prototype,"text",2),h([X],Yo.prototype,"placement",2),h([X],Yo.prototype,"avoidCollisions",2);var Ze=class extends Jk{constructor(){super(...arguments),this.value=0,this.segmentation=new Os,this.defaultColorRange=[],this.targets=new Gn(Ue),this.defaultTarget=new Ue,this.defaultScale=new Je,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new Je,this.bar=new dt,this.label=new Yo,this.tooltip=jk()}};h([X],Ze.prototype,"value",2),h([X],Ze.prototype,"segmentation",2),h([X],Ze.prototype,"defaultColorRange",2),h([X],Ze.prototype,"targets",2),h([X],Ze.prototype,"defaultTarget",2),h([X],Ze.prototype,"defaultScale",2),h([X],Ze.prototype,"direction",2),h([X],Ze.prototype,"thickness",2),h([X],Ze.prototype,"cornerRadius",2),h([X],Ze.prototype,"cornerMode",2),h([X],Ze.prototype,"margin",2),h([X],Ze.prototype,"scale",2),h([X],Ze.prototype,"bar",2),h([X],Ze.prototype,"label",2),h([X],Ze.prototype,"tooltip",2);function Xh(e,t,i,s,o){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:eD(e,i,s.domain,t),rotation:o?90:0,bounds:"series"}}import{_ModuleSupport as tD}from"ag-charts-community";import{cachedTextMeasurer as iD,isArray as sD,measureTextSegments as oD,toPlainText as aD}from"ag-charts-core";var{BBox:nD}=tD;function Vn(e){const{x0:t,y0:i,x1:s,y1:o,horizontalInset:a,verticalInset:n}=e,r=Math.min(t,s)+a,l=Math.min(i,o)+n,c=Math.max(Math.abs(s-t)-2*a,0),p=Math.max(Math.abs(o-i)-2*n,0);return{x:r,y:l,width:c,height:p}}function rD(e,t){if(t==null)return!0;const i=Vn(e),s=1e-6,o=i.x+s,a=i.y+s,n=i.x+i.width-s,r=i.y+i.height-s,l=t.x,c=t.x+t.width,p=t.y,d=t.y+t.height;return Math.max(o,l)<=Math.min(n,c)&&Math.max(a,p)<=Math.min(r,d)}function Kn(e){const{clipX0:t,clipX1:i,clipY0:s,clipY1:o}=e;return t!=null&&i!=null||s!=null&&o!=null}function lD(e){if(!Kn(e))return;const{x0:t,y0:i,x1:s,y1:o}=e,{x:a,y:n,width:r,height:l}=Vn(e);let{clipX0:c,clipX1:p,clipY0:d,clipY1:u}=e;(c==null||p==null)&&(c=t,p=s),(d==null||u==null)&&(d=i,u=o);const m=Math.min(c,p),g=Math.min(d,u),y=Math.abs(p-c),f=Math.abs(u-d);return c=Math.max(a,m),d=Math.max(n,g),p=Math.min(a+r,m+y),u=Math.min(n+l,g+f),new nD(Math.min(c,p),Math.min(d,u),Math.abs(p-c),Math.abs(u-d))}function Yh(e,t){const i=e?"initial":"update";return{node:{fromFn(o,a){const n=o.previousDatum;let{x0:r,y0:l,x1:c,y1:p,clipX0:d,clipY0:u,clipX1:m,clipY1:g}=n??a;const{horizontalInset:y,verticalInset:f}=a,S=n!=null&&Kn(n),x=Kn(a);return S&&x||(!S&&x?({x0:r,y0:l,x1:c,y1:p,clipX0:d,clipY0:u,clipX1:m,clipY1:g}=a,e&&(t?m=a.clipX0:g=a.clipY0)):S&&!x?({x0:r,y0:l,x1:c,y1:p}=a,d=void 0,u=void 0,m=void 0,g=void 0):e&&(t?c=r:p=l)),{x0:r,y0:l,x1:c,y1:p,clipX0:d,clipY0:u,clipX1:m,clipY1:g,horizontalInset:y,verticalInset:f,phase:i}},toFn(o,a){const{x0:n,y0:r,x1:l,y1:c,clipX0:p,clipY0:d,clipX1:u,clipY1:m,horizontalInset:g,verticalInset:y}=a;return{x0:n,y0:r,x1:l,y1:c,clipX0:p,clipY0:d,clipX1:u,clipY1:m,horizontalInset:g,verticalInset:y}},applyFn(o,a){o.setProperties(ws(o,a))}}}}function ws(e,t){const{x:i,y:s,width:o,height:a}=Vn(t),n=lD(t),r=rD(t,n);return{x:i,y:s,width:o,height:a,clipBBox:n,visible:r}}var cD={Before:"right",Center:"center",After:"left"},hD={Before:"top",Center:"middle",After:"bottom"},pD={Before:-1,Center:-.5,After:0},dD={Before:0,Center:-.5,After:-1};function uD(e,t,i,s,o,a){const{seriesRect:n,gaugeRect:r,barRect:l}=o,{padding:c,horizontal:p}=s;i.each((d,u)=>{const m=Cs(e.id,t,u,a?.label);let g,y;u.placement==="outside-start"?p?(g=r.x,y=n.height):(g=n.width,y=n.height-(r.y+r.height)):u.placement==="outside-end"?p?(g=n.width-(r.x+r.width),y=n.height):(g=n.width,y=r.y):u.avoidCollisions&&(g=r.width,y=r.height);let f;if(m==null)return;if(g!=null&&y!=null){const E=()=>({width:g,height:y,meta:null});f=Ds(aD(m),u,{padding:c},E)?.[0]}else{const E=iD(u),{width:L,height:P}=sD(m)?oD(m,u):E.measureLines(m);f={text:m,fontSize:u.fontSize,lineHeight:u.lineHeight??E.lineHeight(),width:L,height:P}}if(f==null){d.visible=!1;return}const S=p?r.x:r.y+r.height,x=p?r.x+r.width:r.y,v=p?l.x:l.y+l.height,b=p?l.x+l.width:l.y,k=u.spacing*(p?1:-1);let A,I,D,N;switch(u.placement){case"outside-start":A=-1/0,I=1/0,D=S-k,N="Before";break;case"outside-end":A=-1/0,I=1/0,D=x+k,N="After";break;case"inside-start":A=S,I=b,D=S+k,N="After";break;case"inside-end":A=b,I=x,D=x-k,N="Before";break;case"inside-center":A=S,I=x,D=(S+x)/2,N="Center";break;case"bar-inside":A=v,I=b,D=(v+b)/2,N="Center";break;case"bar-inside-end":A=v,I=b,D=b-k,N="Before";break;case"bar-outside-end":A=b,I=x,D=b+k,N="After";break;case"bar-end":A=-1/0,I=1/0,D=b,N="Center";break}const R=p?D:r.x+r.width/2,C=p?r.y+r.height/2:D;let w,G;p?(w=R+pD[N]*f.width,G=w+f.width):(w=C+dD[N]*f.height,G=w+f.height);const _=Math.min(w,G)>=Math.min(A,I)&&Math.max(w,G)<=Math.max(A,I);if(u.avoidCollisions&&!_){d.visible=!1;return}d.visible=!0,d.text=f.text,d.fontSize=f.fontSize,d.lineHeight=f.lineHeight,d.textAlign=p?cD[N]:"center",d.textBaseline=p?"middle":hD[N],d.x=R,d.y=C})}var{fromToMotion:Wn,resetMotion:gD,SeriesNodePickMode:Uh,StateMachine:mD,createDatumId:qh,toRadians:jh,BBox:Ft,Group:Ii,PointerEvents:Jh,Selection:Ai,Rect:yD,Text:Zh,TransformableText:fD,Marker:SD,LinearScale:xD,generateTicks:bD,NiceMode:vD,easing:kD,findRangeExtent:DD,tickFormat:ID,mergeDefaults:AD,applyShapeStyle:zn}=Qi,MD={before:180,middle:0,after:0},ND={before:90,middle:0,after:-90},Uo=class extends Qi.Series{constructor(e){super({moduleCtx:e,pickModes:[Uh.EXACT_SHAPE_MATCH,Uh.NEAREST_NODE]}),this.properties=new Ze,this.seriesRect=Ft.NaN,this.gaugeRect=Ft.NaN,this.scale=new xD,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Ii({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Ii({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Ii({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Ii({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Ii({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Ii({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Ii({name:"tickGroup"})),this.scaleSelection=Ai.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Ai.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Ai.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Ai.select(this.itemTargetLabelGroup,Zh),this.labelSelection=Ai.select(this.itemLabelGroup,Zh),this.highlightTargetSelection=Ai.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Ai.select(this.tickGroup,fD),this.datumUnion=new Eh,this.animationState=new mD("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=Jh.None,this.tickGroup.pointerEvents=Jh.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const e=new yD;return e.crisp=!0,e}markerFactory(){return new SD}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return Bh(e,this.properties.scale)}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:s,scale:o}=this,{thickness:a}=e,n=DD(o.range),r=new Ft(t,i,s?n:a,s?a:n);return{axis:r,series:r}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:s=t.text,value:o=t.value??0,shape:a=t.shape??"triangle",rotation:n=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:p=t.label.enabled,color:d=t.label.color??"black",fontStyle:u=t.label.fontStyle??"normal",fontWeight:m=t.label.fontWeight??"normal",fontSize:g=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:f=t.label.spacing??0}=i.label;return{text:s,value:o,shape:a,placement:r,spacing:l,size:c,rotation:n,label:{enabled:p,color:d,fontStyle:u,fontWeight:m,fontSize:g,fontFamily:y,spacing:f},style:i.getStyle(t)}})}getTargetPoint(e){const{properties:t,originX:i,originY:s,horizontal:o,scale:a,gaugeRect:n}=this,{thickness:r}=t,{value:l,placement:c,spacing:p,size:d}=e,u=a.convert(l);let m;switch(c){case"before":m=-(p+d/2);break;case"after":m=r+p+d/2;break;default:m=r/2;break}return{x:i+n.x+(o?u:m),y:s+n.y+(o?m:u)}}getTargetLabel(e){const{size:t,placement:i,label:s}=e,{spacing:o,color:a,fontStyle:n,fontWeight:r,fontSize:l,fontFamily:c}=s,p=void 0,d=t/2+o;let u,m,g=0,y=0;return this.horizontal?(u="center",i==="after"?(m="top",y=d):(m="bottom",y=-d)):(m="middle",i==="before"?(u="right",g=-d):(u="left",g=d)),{offsetX:g,offsetY:y,fill:a,textAlign:u,textBaseline:m,fontStyle:n,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:p}}labelDatum(e,t){const{placement:i,avoidCollisions:s,spacing:o,text:a,color:n,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:p,fontFamily:d,lineHeight:u,wrapping:m,overflowStrategy:g,formatter:y=f=>this.formatLabel(f.value)}=e;return{placement:i,avoidCollisions:s,spacing:o,text:a,value:t,fill:n,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:p,fontFamily:d,lineHeight:u,wrapping:m,overflowStrategy:g,formatter:y}}verticalLabelInset(){const{label:e}=this.properties,t=wh(e),i=e.text?.split(`
+`),s=(e.lineHeight??t.lineHeight())*(i?.length??1);return e.spacing+s}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:s}=t,o=s.text?.split(`
+`),a=wh(s),n=i.interval.values??e.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(o??n?.map(c=>Cs(this.id,this.ctx,this.labelDatum(s,c))??"")).reduce((c,p)=>{const{width:d}=zk(p)?$k(p,s):a.measureLines(p);return Math.max(c,d)},0);return s.spacing+l}tickFormatter(e,t){const{format:i,formatter:s}=this.properties.scale.label;let o;return i!=null&&(o=ID(t,typeof i=="string"?i:void 0)),(a,n)=>{let r;return s&&(r??(r=Fn(this.ctx,s,{value:a,index:n,domain:e,boundSeries:void 0}))),r??(r=o?.(a)),r??this.formatLabel(a)}}createNodeData(){const{id:e,properties:t,horizontal:i,scale:s,seriesRect:o}=this,{value:a,segmentation:n,thickness:r,cornerRadius:l,cornerMode:c,bar:p,scale:d,label:u,defaultColorRange:m}=t;s.domain=[d.min,d.max],s.range=i?[0,o.width]:[o.height,0];let g,y;i?(y=1,g=Math.PI/2):d.label.placement==="before"?(y=1,g=0):(y=-1,g=0);let f,S,x,v;i?(f=0,S=o.width,x=(o.height-r)/2,v=x+r,u.placement==="outside-start"?f+=this.horizontalLabelInset():u.placement==="outside-end"&&(S-=this.horizontalLabelInset())):(f=(o.width-r)/2,S=f+r,v=0,x=o.height,u.placement==="outside-start"?x-=this.verticalLabelInset():u.placement==="outside-end"&&(v+=this.verticalLabelInset())),this.gaugeRect=new Ft(Math.min(f,S),Math.min(x,v),Math.abs(S-f),Math.abs(v-x));const b=0,k=0;s.domain=[d.min,d.max],s.range=i?[f,S]:[x,v];const{tickData:{ticks:A}}=bD({scale:s,label:this.properties.scale.label,interval:this.properties.scale.interval,tickFormatter:(Q,ie)=>this.tickFormatter(Q,ie),domain:s.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:vD.Off,labelOffset:0,axisRotation:g,sideFlag:y}),I=!1,D=this.getTargets(),N=[],R=[],C=[],w=[],[G,_]=s.range,E=Math.abs(_-G),L=i?s.convert(a):S,P=i?v:s.convert(a),T=n.enabled?n.spacing/2:0,M=i?T:0,O=i?0:T,B=Math.min(p.thickness??Math.round(p.thicknessRatio*r),r),F=-(r-B)/2,V=i?0:F,W=i?F:0,K=c==="item",z=Math.ceil(E);let $=n.enabled?n.interval.getSegments(s,z):void 0;const Z=p.getStyle(m,i,s),q=d.getStyle(p.enabled,m,i,s);if($==null&&K){const Q=Math.min(...s.domain),ie=Math.max(...s.domain),U={value:a,segmentStart:Q,segmentEnd:ie};if(p.enabled){const ue=Math.min(l,B/2,E/2)*(I?-1:1),le=i?ue:0,ye=i?0:ue;N.push({series:this,itemId:"value",datum:U,datumIndex:{type:0},type:0,x0:b+f-le-V,y0:k+x-ye-W,x1:b+L+le+V,y1:k+P+ye+W,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:M,verticalInset:O,style:Z})}const ae=Math.min(l,r/2,E/2)*(I?-1:1),j=i?ae:0,re=i?0:ae;w.push({series:this,itemId:"scale",datum:U,datumIndex:{type:0},type:0,x0:b+f-j,y0:k+x-re,x1:b+S+j,y1:k+v+re,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:M,verticalInset:O,style:q})}else{$??($=s.domain);const Q=b+f-V,ie=k+x-W,U=b+L+V,ce=k+P+W;for(let ae=0;ae<$.length-1;ae+=1){const j=$[ae+0],re=$[ae+1],se={value:a,segmentStart:j,segmentEnd:re},ue=ae===0,le=ae===$.length-2,ye=s.convert(j),we=s.convert(re),rt=K||ue?l:0,pi=K||le?l:0,bt=i?rt:pi,Pt=pi,gs=i?pi:rt,ms=rt;p.enabled&&N.push({series:this,itemId:`value-${ae}`,datum:se,datumIndex:{type:0},type:0,x0:b+(i?ye:f),y0:k+(i?x:ye),x1:b+(i?we:S),y1:k+(i?v:we),clipX0:Q,clipY0:ie,clipX1:U,clipY1:ce,topLeftCornerRadius:bt,topRightCornerRadius:Pt,bottomRightCornerRadius:gs,bottomLeftCornerRadius:ms,horizontalInset:M,verticalInset:O,style:Z}),w.push({series:this,itemId:`scale-${ae}`,datum:se,datumIndex:{type:0},type:0,x0:b+(i?ye:f),y0:k+(i?x:ye),x1:b+(i?we:S),y1:k+(i?v:we),clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:bt,topRightCornerRadius:Pt,bottomRightCornerRadius:gs,bottomLeftCornerRadius:ms,horizontalInset:M,verticalInset:O,style:q})}}u.enabled&&C.push(this.labelDatum(u,a));const Y=i?MD:ND;for(let Q=0;Qqh(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i}=this,s=i.animationManager.isSkipped(),o=this.getShapeFillBBox();t.each((n,r)=>{const{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:p,bottomLeftCornerRadius:d}=r;zn(n,r.style,o),n.topLeftCornerRadius=l,n.topRightCornerRadius=c,n.bottomRightCornerRadius=p,n.bottomLeftCornerRadius=d,n.pointerEvents=this.properties.bar.enabled?Qi.PointerEvents.All:Qi.PointerEvents.None,(s||n.previousDatum==null)&&n.setProperties(ws(n,r))});const{horizontal:a}=this;this.datumUnion.update(t,this.itemGroup,Qi.Rect,(n,r,l)=>{const c=Math.min(r.x,l.x),p=Math.max(r.x+r.width,l.x+l.width),d=Math.min(r.y,l.y),u=Math.max(r.y+r.height,l.y+l.height),m=p-c,g=u-d;n.pointerEvents=Qi.PointerEvents.None,n.x=c,n.y=d,n.width=m,n.height=g,n.topLeftCornerRadius=a?r.topLeftCornerRadius:l.topLeftCornerRadius,n.topRightCornerRadius=l.topRightCornerRadius,n.bottomRightCornerRadius=a?l.bottomRightCornerRadius:r.bottomRightCornerRadius,n.bottomLeftCornerRadius=r.bottomLeftCornerRadius;const y=r.clipBBox,f=l.clipBBox??y;y&&f?n.clipBBox=Ft.merge([y,f]).intersection(a?new Ft(c,-1/0,m,1/0):new Ft(-1/0,d,1/0,g)):n.clipBBox=void 0})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>qh(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,i=this.getShapeFillBBox();t.each((s,o)=>{const{topLeftCornerRadius:a,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:l}=o;zn(s,o.style,i),s.setProperties(ws(s,o)),s.topLeftCornerRadius=a,s.topRightCornerRadius=n,s.bottomRightCornerRadius=r,s.bottomLeftCornerRadius=l,s.setProperties(ws(s,o))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each((s,o)=>{const{x:a,y:n,shape:r,size:l,rotation:c}=o,p=this.getTargetStyle(i,o);zn(s,p),s.size=l,s.shape=r==="line"?Gh:r,s.translationX=a,s.translationY=n,s.rotation=c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return AD(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{x:o,y:a,text:n}=s,{offsetX:r,offsetY:l,fill:c,fontStyle:p,fontWeight:d,fontSize:u,fontFamily:m,textAlign:g,textBaseline:y}=s.label;i.visible=!0,i.x=o+r,i.y=a+l,i.text=n,i.fill=c,i.fontStyle=p,i.fontWeight=d,i.fontSize=u,i.fontFamily=m,i.textAlign=g,i.textBaseline=y})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,s=i.defaultScale,{enabled:o,color:a,fontFamily:n=s.label.fontFamily,fontSize:r=s.label.fontSize,fontStyle:l,fontWeight:c=s.label.fontWeight,spacing:p}=i.scale.label;let{placement:d}=i.scale.label;const u=jh(i.scale.label.rotation??0);let m,g,y,f;this.horizontal?(d??(d="after"),m="center",g=d==="before"?"bottom":"top",f=this.originY+t.y+(d==="before"?-p:t.height+p)):(d??(d="before"),m=d==="before"?"end":"start",g="middle",y=this.originX+t.x+(d==="before"?-p:t.width+p)),e.tickSelection.each((S,x)=>{if(!o){S.visible=!1;return}const v=y??x.translation,b=f??x.translation;S.visible=!0,S.text=x.tickLabel,S.fill=a,S.fontFamily=n,S.fontSize=r,S.fontStyle=l,S.fontWeight=c,S.textBaseline=g,S.textAlign=m,S.x=v,S.y=b,S.rotationCenterX=v,S.rotationCenterY=b,S.rotation=u})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,o)=>{s.fill=o.fill,s.fontStyle=o.fontStyle,s.fontWeight=o.fontWeight,s.fontFamily=o.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:s,seriesRect:o,gaugeRect:a}=this,{x:n,y:r,width:l,height:c}=a,p=e?.label??this.properties.value;let d;if(i){const g=s.convert(p);d=new Ft(n,r,g-n,c)}else{const g=s.convert(p);d=new Ft(n,g,l,c-g)}const u={seriesRect:o,gaugeRect:a,barRect:d},{margin:m}=this.properties;uD(this,this.ctx,t,{padding:m,horizontal:i},u,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),gD([this.datumSelection],ws),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,s=0;if(this.labelSelection.each((o,a)=>{o.opacity=1,i=o.previousDatum?.value??e.from??a.value,s=a.value}),!this.labelsHaveExplicitText())if(i===s)this.formatLabelText({label:s});else{const o=`${this.id}_labels`;t.animate({id:o,groupId:"label",from:{label:i},to:{label:s},phase:e.phase??"update",ease:kD.easeOut,onUpdate:a=>this.formatLabelText(a),onStop:()=>this.formatLabelText({label:s})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Yh(!0,this.horizontal);Wn(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),Wn(this.id,"label",e,[this.labelSelection],Fh,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Yh(!1,this.horizontal);Wn(this.id,"node",e,[this.datumSelection],t,(i,s)=>s.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}dataCount(){return Number.NaN}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;if(e==null)return;let o,a,n;if(e.type===0?(o=i.value,a=i.label.text,n=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:o,text:a}=i.targets[e.index],n=this.ctx.localeManager.t("ariaLabelGaugeTarget")),o!=null)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:n,value:this.formatLabel(o)}]},{seriesId:t,title:void 0,datum:void 0,value:o})}pickNodeClosestDatum(e){return Kh(this,e)}pickFocus(e){return Wh(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};Uo.className="LinearGaugeSeries",Uo.type="linear-gauge";var TP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"linear-gauge",moduleFactory:e=>new Uo(e),themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},Ps.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",Ps.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{...Ps.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:Ps.FONT_SIZE.SMALL,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}}},Qh={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,options:Ps.linearGaugeSeriesOptionsDef,create:e=>new Uo(e)};import{_ModuleSupport as qo}from"ag-charts-community";import{_ModuleSupport as $n}from"ag-charts-community";var Es={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1,...$n.LEGEND_CONTAINER_THEME}};function Bt(e){const t=$n.deepClone(e);return $n.jsonWalk(t,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),t}import{_ModuleSupport as ep}from"ag-charts-community";import{Logger as tp,cachedTextMeasurer as LD}from"ag-charts-core";import{_ModuleSupport as TD}from"ag-charts-community";var RD=1e-9;function ip(e,t,i,s){const[o,a]=e,[n,r]=t,l=n-o,c=r-a,p=l*l+c*c;let d,u;if(Math.abs(p)t){const p=(t-o)/l,d=[i+(n-i)*p,s+(r-s)*p],u=Math.atan2(r-s,n-i);return{point:d,angle:u}}o=c,i=n,s=r}}import{_ModuleSupport as PD}from"ag-charts-community";var{LonLatBBox:CD}=PD;function Mi(e,t){for(const i of e){const[s,o]=i;t=CD.extend(t,s,o,s,o)}return t}function OD(e){if(e.length===0)return;let t=0,i=0,s=0,[o,a]=e.at(-1);for(const[n,r]of e){const l=o*r-n*a;s+=l,t+=(o+n)*l,i+=(a+r)*l,o=n,a=r}return s*=3,[t/s,i/s]}function Jo(e,t,i){let s=!1,o=1/0;for(const a of e){let n=a.at(-1),[r,l]=n;for(const c of a){const[p,d]=c;d>i!=l>i&&t<(r-p)*(i-d)/(l-d)+p&&(s=!s),o=Math.min(o,ip(n,c,t,i)),n=c,r=p,l=d}}return(s?-1:1)*Math.sqrt(o)}var{Path:_D,ExtendedPath2D:wD,BBox:ED,SceneChangeDetection:FD,SceneObjectChangeDetection:BD,objectsEqual:GD}=TD,ts=class extends _D{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new wD}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=e==null?void 0:this.drawGeometry(e,void 0)}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(e,t)?!1:this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(i==null)return 1/0;const s=this.geometryDistance(i,e,t);return s>0?s*s:0}geometryDistance(e,t,i){const{renderMode:s,strokeWidth:o}=this,a=(s&1)!==0,n=(s&2)!==0,r=Math.max(o/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,t,i)),1/0);case"MultiPolygon":return a?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(Jo(c,t,i),0)),1/0):1/0;case"Polygon":return a?Math.max(Jo(e.coordinates,t,i),0):1/0;case"MultiLineString":return n?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(sp(c,t,i)-r,0)),1/0):1/0;case"LineString":return n?Math.max(sp(e.coordinates,t,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(e,t){const{renderMode:i,path:s,strokePath:o}=this,a=(i&1)!==0,n=(i&2)!==0;switch(e.type){case"GeometryCollection":for(const r of e.geometries)t=this.drawGeometry(r,t);break;case"MultiPolygon":if(a)for(const r of e.coordinates)t=this.drawPolygon(s,r,t);break;case"Polygon":a&&(t=this.drawPolygon(s,e.coordinates,t));break;case"LineString":n&&(t=this.drawLineString(o,e.coordinates,t,!1));break;case"MultiLineString":if(n)for(const r of e.coordinates)t=this.drawLineString(o,r,t,!1);break;case"Point":case"MultiPoint":break}return t}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let s=1;s0&&(t=Mi(i[0],t));break;case"Polygon":e.coordinates.length>0&&(t=Mi(e.coordinates[0],t));break;case"MultiLineString":for(const i of e.coordinates)t=Mi(i,t);break;case"LineString":t=Mi(e.coordinates,t);break;case"MultiPoint":for(const i of e.coordinates){const[s,o]=i;t=Xn.extend(t,s,o,s,o)}break;case"Point":{const[i,s]=e.coordinates;t=Xn.extend(t,i,s,i,s);break}}return t}function Zo(e){switch(e.type){case"GeometryCollection":{let t,i;for(const s of e.geometries){const o=Zo(s);if(o==null)continue;const a=Mi(o[0],void 0);if(a==null)continue;const n=Math.abs(a.lat1-a.lat0)*Math.abs(a.lon1-a.lon0);(t==null||n>t)&&(t=n,i=o)}return i}case"MultiPolygon":{let t,i;for(const s of e.coordinates){const o=Mi(s[0],void 0);if(o==null)continue;const a=Math.abs(o.lat1-o.lat0)*Math.abs(o.lon1-o.lon0);(t==null||a>t)&&(t=a,i=s)}return i}case"Polygon":return e.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function Qo(e){switch(e.type){case"GeometryCollection":{let t,i;for(const s of e.geometries){const o=Qo(s);if(o==null)continue;const a=Hn(o);a!=null&&(t==null||a>t)&&(t=a,i=o)}return i}case"MultiLineString":{let t=0,i;for(const s of e.coordinates){const o=Hn(s);o>t&&(t=o,i=s)}return i}case"LineString":return e.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function Yn(e,t){if(e==null)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(i=>Yn(i,t));case"MultiPolygon":case"Polygon":return(t&1)!==0;case"MultiLineString":case"LineString":return(t&2)!==0;case"MultiPoint":case"Point":return(t&4)!==0}}function si(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(i=>si(i,t))};case"Polygon":return{type:"Polygon",coordinates:Un(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:KD(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:Un(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:qn(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:qn(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function KD(e,t){return e.map(i=>Un(i,t))}function Un(e,t){return e.map(i=>qn(i,t))}function qn(e,t){return e.map(i=>t.convert(i))}function WD(){return{fromFn:(i,s,o)=>o==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,s,o)=>o==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function op(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(i!==void 0){for(const s of e.datumSelection.nodes())if(s.datum===i)return s}}import{_ModuleSupport as ap}from"ag-charts-community";var BP=class extends ap.SeriesProperties{},Fs=class extends ap.DataModelSeries{addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>{this.onLegendItemClick(e)}),this.ctx.eventsHub.on("legend:item-double-click",e=>{this.onLegendItemDoubleClick(e)}))}getSeriesDomain(){return[Number.NaN,Number.NaN]}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}};import{_ModuleSupport as zD}from"ag-charts-community";var{Property:be,SeriesProperties:$D,makeSeriesTooltip:HD,Label:XD}=zD,xe=class extends $D{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new XD,this.tooltip=HD()}getStyle(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}=this;return{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:s,lineDashOffset:o}}};h([be],xe.prototype,"topology",2),h([be],xe.prototype,"title",2),h([be],xe.prototype,"legendItemName",2),h([be],xe.prototype,"idKey",2),h([be],xe.prototype,"topologyIdKey",2),h([be],xe.prototype,"idName",2),h([be],xe.prototype,"labelKey",2),h([be],xe.prototype,"labelName",2),h([be],xe.prototype,"sizeKey",2),h([be],xe.prototype,"sizeName",2),h([be],xe.prototype,"colorKey",2),h([be],xe.prototype,"colorName",2),h([be],xe.prototype,"sizeDomain",2),h([be],xe.prototype,"colorRange",2),h([be],xe.prototype,"maxStrokeWidth",2),h([be],xe.prototype,"stroke",2),h([be],xe.prototype,"strokeOpacity",2),h([be],xe.prototype,"strokeWidth",2),h([be],xe.prototype,"lineDash",2),h([be],xe.prototype,"lineDashOffset",2),h([be],xe.prototype,"itemStyler",2),h([be],xe.prototype,"label",2),h([be],xe.prototype,"tooltip",2);var{getMissCount:YD,getLabelStyles:UD,createDatumId:np,SeriesNodePickMode:rp,valueProperty:Bs,ColorScale:qD,LinearScale:jD,Selection:jn,Text:JD,Transformable:ZD,mergeDefaults:lp}=ep,ea=class extends Fs{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[rp.EXACT_SHAPE_MATCH,rp.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new xe,this._chartTopology=void 0,this.colorScale=new qD,this.sizeScale=new jD,this.datumSelection=jn.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=jn.select(this.labelGroup,JD),this.highlightDatumSelection=jn.select(this.highlightGroup,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new ts;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:s,colorScale:o}=this,{topologyIdKey:a,idKey:n,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:p,colorRange:d}=this.properties,u=new Map;for(const v of i?.features.values()??[]){const b=v.properties?.[a];b==null||!Yn(v.geometry,2)||u.set(b,v)}const m=this.sizeScale.type,g=this.colorScale.type,y=this.scale?.type,{dataModel:f,processedData:S}=await this.requestDataModel(e,t,{props:[Bs(n,y,{id:"idValue",includeProperty:!1}),Bs(n,y,{id:"featureValue",includeProperty:!1,processor:()=>v=>u.get(v)}),...c==null?[]:[Bs(c,"category",{id:"labelValue"})],...r==null?[]:[Bs(r,m,{id:"sizeValue"})],...l==null?[]:[Bs(l,g,{id:"colorValue"})]]}),x=f.resolveColumnById(this,"featureValue",S);if(this.topologyBounds=x.reduce((v,b)=>{const k=b?.geometry;return k==null?v:is(k,v)},void 0),r!=null){const v=f.resolveProcessedDataIndexById(this,"sizeValue"),b=S.domain.values[v]??[];s.domain=p??b}if(d!=null&&this.isColorScaleValid()){const v=f.resolveProcessedDataIndexById(this,"colorValue");o.domain=S.domain.values[v],o.range=d,o.update()}i==null&&tp.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=YD(this,i.defs.values[s].missing);return!(o===0||o===a)}getLabelDatum(e,t,i,s){if(t==null||i==null)return;const o=Qo(i);if(o==null)return;const{idKey:a,idName:n,sizeKey:r,sizeName:l,colorKey:c,colorName:p,labelKey:d,labelName:u,label:m}=this.properties;if(d==null||!m.enabled)return;const g=this.getLabelText(t,e,d,"label",[],m,{value:t,datum:e,idKey:a,idName:n,sizeKey:r,sizeName:l,colorKey:c,colorName:p,labelKey:d,labelName:u});if(g==null)return;const y=s.measureLines(String(g)),f=jo(o);if(f==null)return;const[S,x]=f.point,{width:v,height:b}=y;return{point:{x:S,y:x,size:0},label:{width:v,height:b,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:o,scale:a}=this,{idKey:n,sizeKey:r,colorKey:l,labelKey:c,label:p,legendItemName:d}=o;if(t==null||i==null)return;const u=t.resolveColumnById(this,"idValue",i),m=t.resolveColumnById(this,"featureValue",i),g=c==null?void 0:t.resolveColumnById(this,"labelValue",i),y=r==null?void 0:t.resolveColumnById(this,"sizeValue",i),f=l==null?void 0:t.resolveColumnById(this,"colorValue",i),S=o.maxStrokeWidth??o.strokeWidth;s.range=[Math.min(o.strokeWidth,S),S];const x=LD(p),v=new Map;for(const[N]of i.dataSources.get(this.id)?.data.entries()??[]){const R=u[N],C=m[N]?.geometry??void 0,w=C!=null&&a!=null?si(C,a):void 0;R!=null&&w!=null&&v.set(R,w)}const b=[],k=[],A=[],I=i.dataSources.get(this.id)?.data??[];for(const[N,R]of I.entries()){const C=u[N],w=f?.[N],G=y?.[N],_=g?.[N],E=v.get(C);E==null&&A.push(C);const L=this.getLabelDatum(R,_,E,x);L!=null&&k.push(L),b.push({series:this,itemId:n,datum:R,datumIndex:N,idValue:C,labelValue:_,colorValue:w,sizeValue:G,projectedGeometry:E,legendItemName:d,style:this.getItemStyle({datumIndex:N,datum:R,colorValue:w,sizeValue:G},!1)})}const D=10;if(A.length>D){const N=A.length-D;A.length=D,A.push(`(+${N} more)`)}return A.length>0&&tp.warnOnce("some data items do not have matches in the provided topology",A),{itemId:e,nodeData:b,labelData:k}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let i=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:s}=this.properties,o=s!=null&&i?.datum==null&&s===i?.legendItemName;i!=null&&(i.series!==this&&!o||i.datum==null)&&(i=void 0);const a=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:i==null?[]:[i],datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!0}),this.updateDatumNodes({datumSelection:t,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>np(t.idValue))}getItemStyle({datumIndex:e=0,datum:t,colorValue:i,sizeValue:s},o){const{properties:a,colorScale:n,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,p=this.getHighlightStyle(o,e),d=lp(p,a.getStyle());!o&&i!=null&&(d.stroke=this.isColorScaleValid()?n.convert(i):l?.[0]??a.stroke),s!=null&&(d.strokeWidth=r.convert(s,{clamp:!0}));let u;return c!=null&&(u=this.cachedDatumCallback(np(e,o?"highlight":"node"),()=>{const m=this.makeItemStylerParams(t,e,o,d);return this.callWithContext(c,m)})),u?lp(d,u):d}makeItemStylerParams(e,t,i,s){const{id:o}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t);return{seriesId:o,datum:e,highlighted:i,highlightState:n,...s}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e}){e.each((t,i)=>{const{projectedGeometry:s,style:o}=i;if(s==null){t.visible=!1,t.projectedGeometry=void 0;return}t.visible=!0,t.projectedGeometry=s,t.setProperties(o)})}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=ep.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{properties:t}=this,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,{x:o,y:a,width:n,height:r,text:l},c)=>{const p=UD(this,void 0,t,t.label,!1,i),{color:d,fontStyle:u,fontWeight:m,fontSize:g,fontFamily:y}=p;s.visible=!0,s.x=o+n/2,s.y=a+r/2,s.text=l,s.fill=d,s.fontStyle=u,s.fontWeight=m,s.fontSize=g,s.fontFamily=y,s.textAlign="center",s.textBaseline="middle",s.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,s.setBoxing(p)})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((o,a)=>{const n=o.distanceSquared(e,t);nnew ea(e),themeTemplate:{...Es,series:{stroke:Bt(qo.SAFE_STROKE_FILL_OPERATION),colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Bt(qo.SAFE_RANGE2_OPERATION)]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{...qo.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Bt(qo.multiSeriesHighlightStyle(!1))},tooltip:{range:"exact"}}},pp={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:hp,create:e=>new ea(e)};import{_ModuleSupport as h0}from"ag-charts-community";import{Logger as p0}from"ag-charts-core";import{_ModuleSupport as d0}from"ag-charts-community";var{Property:Ni,SeriesProperties:u0,makeSeriesTooltip:g0}=d0,oi=class extends u0{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=g0()}};h([Ni],oi.prototype,"topology",2),h([Ni],oi.prototype,"stroke",2),h([Ni],oi.prototype,"strokeOpacity",2),h([Ni],oi.prototype,"strokeWidth",2),h([Ni],oi.prototype,"lineDash",2),h([Ni],oi.prototype,"lineDashOffset",2),h([Ni],oi.prototype,"tooltip",2);var{createDatumId:m0,Group:y0,Selection:f0,PointerEvents:dp}=h0,ta=class extends Fs{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new oi,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new y0({name:"itemGroup"})),this.datumSelection=f0.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=dp.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new ts;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=dp.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:is(s,t)},void 0),e==null&&p0.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{stroke:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,strokeWidth:l}=s,c=[],p=[];for(const[d,u]of t.features.entries()){const{geometry:m}=u,g=m!=null&&i!=null?si(m,i):void 0;g!=null&&c.push({series:this,itemId:d,datum:u,datumIndex:0,index:d,projectedGeometry:g,style:{stroke:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,strokeWidth:l}})}return{itemId:e,nodeData:c,labelData:p}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>m0(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:o}=s;if(o==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=o,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}hasItemStylers(){return!1}};ta.className="MapLineBackgroundSeries",ta.type="map-line-background";import{_ModuleSupport as S0}from"ag-charts-community";import{constant as x0,geoJson as b0,required as v0}from"ag-charts-core";var{mapLineBackgroundSeriesThemeableOptionsDef:k0}=S0,D0={...k0,type:v0(x0("map-line-background")),topology:b0},UP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:e=>new ta(e),themeTemplate:{...Es,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},up={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:D0,create:e=>new ta(e)};import{_ModuleSupport as ss}from"ag-charts-community";import{ValidationError as I0,validate as A0}from"ag-charts-core";import{_ModuleSupport as gp}from"ag-charts-community";import{Logger as M0,cachedTextMeasurer as N0}from"ag-charts-core";var L0=void 0,T0=void 0;T0=L0;var R0=void 0,P0=void 0;P0=R0;var C0=void 0,O0=void 0;O0=C0;var _0=void 0,w0=void 0;w0=_0;import{insertListItemsSorted as E0}from"ag-charts-core";function mp(e,t,i){const s=Mi(e[0],void 0);if(s==null)return;const o=(s.lon0+s.lon1)/2,a=(s.lat0+s.lat1)/2,n=Math.abs(s.lon1-s.lon0),r=Math.abs(s.lat1-s.lat0),l=OD(e[0]),[c,p]=l,d=-Jo(e,c,p);let u;const m=(k,A)=>{const D=Math.max(A-d,0);return k-.5*D},g=(k,A,I)=>{const{distance:D,maxDistance:N}=i(e,k,A,I),R=Math.hypot(c-k,p-A),C=Math.min(Math.max(c,k-I/2),k+I/2),w=Math.min(Math.max(p,A-I/2),A+I/2),G=Math.hypot(c-C,p-w),_=m(D,R),E=m(N,G);return{distance:D,maxDistance:N,value:_,maxValue:E,x:k,y:A,stride:I}},y=(k,A,I,D)=>{const N=g(A,I,D);N.maxDistance>=0&&k.push(N)},f=Math.min(n,r)/2;let S={value:g(o,a,f),next:null};for(;S!=null;){const k=S.value,{distance:A,value:I,maxValue:D,x:N,y:R,stride:C}=k;if(S=S.next,A>0&&(u==null||I>u.value)&&(u=k),u!=null&&D-u.value<=t)continue;const w=C/2,G=[];y(G,N-w,R-w,w),y(G,N+w,R-w,w),y(G,N-w,R+w,w),y(G,N+w,R+w,w),G.sort(yp),S=E0(S,G,yp)}if(u==null)return;const{distance:x,x:v,y:b}=u;return{x:v,y:b,distance:x}}var yp=(e,t)=>t.maxValue-e.maxValue;function Jn(e,t){const i=mp(e,t,(a,n,r,l)=>{const c=-Jo(a,n,r),p=c+l*Math.SQRT2;return{distance:c,maxDistance:p}});if(i==null)return;const{x:s,y:o}=i;return[s,o]}function fp(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(s=>fp(s,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const s=Zo(e);i=s==null?void 0:Jn(s,t);break}case"Polygon":{const s=e.coordinates;i=s==null?void 0:Jn(s,t);break}case"MultiLineString":{const s=Qo(e);i=s==null?void 0:jo(s)?.point;break}case"LineString":{const s=e.coordinates;i=jo(s)?.point;break}}return i==null?[]:[i]}import{_ModuleSupport as F0}from"ag-charts-community";var{BBox:B0}=F0;function Sp(e){if(!e)return;const{range:t}=e,i=t[0][0],s=t[0][1],o=t[1][0]-i,a=t[1][1]-s,n=new B0(i,s,o,a);return{series:n,axis:n}}import{_ModuleSupport as G0}from"ag-charts-community";var{Property:pe,SeriesProperties:V0,makeSeriesTooltip:K0,Label:W0}=G0,xp=class extends W0{constructor(){super(...arguments),this.placement="bottom"}};h([pe],xp.prototype,"placement",2);var de=class extends V0{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new xp,this.tooltip=K0()}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:o,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,opacity:1,stroke:o,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}}};h([pe],de.prototype,"topology",2),h([pe],de.prototype,"title",2),h([pe],de.prototype,"legendItemName",2),h([pe],de.prototype,"idKey",2),h([pe],de.prototype,"topologyIdKey",2),h([pe],de.prototype,"idName",2),h([pe],de.prototype,"latitudeKey",2),h([pe],de.prototype,"latitudeName",2),h([pe],de.prototype,"longitudeKey",2),h([pe],de.prototype,"longitudeName",2),h([pe],de.prototype,"labelKey",2),h([pe],de.prototype,"labelName",2),h([pe],de.prototype,"sizeKey",2),h([pe],de.prototype,"sizeName",2),h([pe],de.prototype,"colorKey",2),h([pe],de.prototype,"colorName",2),h([pe],de.prototype,"colorRange",2),h([pe],de.prototype,"shape",2),h([pe],de.prototype,"size",2),h([pe],de.prototype,"maxSize",2),h([pe],de.prototype,"sizeDomain",2),h([pe],de.prototype,"fill",2),h([pe],de.prototype,"fillOpacity",2),h([pe],de.prototype,"stroke",2),h([pe],de.prototype,"strokeWidth",2),h([pe],de.prototype,"strokeOpacity",2),h([pe],de.prototype,"lineDash",2),h([pe],de.prototype,"lineDashOffset",2),h([pe],de.prototype,"itemStyler",2),h([pe],de.prototype,"label",2),h([pe],de.prototype,"tooltip",2);var{fromToMotion:z0,StateMachine:$0,getMissCount:H0,createDatumId:bp,SeriesNodePickMode:vp,valueProperty:Li,computeMarkerFocusBounds:X0,ColorScale:Y0,LinearScale:U0,Group:q0,Selection:Zn,Text:j0,Marker:Qn,applyShapeStyle:J0,getLabelStyles:Z0,LonLatBBox:Q0,mergeDefaults:kp}=gp,ia=class extends Fs{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[vp.EXACT_SHAPE_MATCH,vp.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new de,this._chartTopology=void 0,this.colorScale=new Y0,this.sizeScale=new U0,this.markerGroup=this.contentGroup.appendChild(new q0({name:"markerGroup"})),this.labelSelection=Zn.select(this.labelGroup,j0,!1),this.markerSelection=Zn.select(this.markerGroup,Qn,!1),this.highlightMarkerSelection=Zn.select(this.highlightGroup,Qn),this.animationState=new $0("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[3,e],this.highlightGroup.zIndex=[4,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:s,colorScale:o}=this,{topologyIdKey:a,idKey:n,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:p,labelKey:d,sizeDomain:u,colorRange:m}=this.properties,g=new Map;for(const D of i?.features.values()??[]){const N=D.properties?.[a];N!=null&&g.set(N,D)}const y=this.sizeScale.type,f=this.colorScale.type,S=this.scale?.type,x=r!=null&&l!=null,{dataModel:v,processedData:b}=await this.requestDataModel(e,t,{props:[...n==null?[]:[Li(n,S,{id:"idValue",includeProperty:!1}),Li(n,S,{id:"featureValue",includeProperty:!1,processor:()=>D=>g.get(D)})],...x?[Li(r,S,{id:"latValue"}),Li(l,S,{id:"lonValue"})]:[],...d?[Li(d,"category",{id:"labelValue"})]:[],...c?[Li(c,y,{id:"sizeValue"})]:[],...p?[Li(p,f,{id:"colorValue"})]:[]]}),k=n==null?void 0:v.resolveColumnById(this,"featureValue",b),A=x?v.resolveColumnById(this,"latValue",b):void 0,I=x?v.resolveColumnById(this,"lonValue",b):void 0;if(this.topologyBounds=b.dataSources.get(this.id)?.data.reduce((D,N,R)=>{const w=k?.[R]?.geometry;if(w!=null&&(D=is(w,D)),A!=null&&I!=null){const G=I[R],_=A[R];D=Q0.extend(D,G,_,G,_)}return D},void 0),c!=null){const D=v.resolveProcessedDataIndexById(this,"sizeValue"),N=b.domain.values[D]??[];s.domain=u??N}if(m!=null&&this.isColorScaleValid()){const D=v.resolveProcessedDataIndexById(this,"colorValue");o.domain=b.domain.values[D],o.range=m,o.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=H0(this,i.defs.values[s].missing);return!(o===0||o===a)}getLabelDatum(e,t,i,s,o,a){if(t==null)return;const{idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:p,longitudeName:d,sizeKey:u,sizeName:m,colorKey:g,colorName:y,labelKey:f,labelName:S,label:x,shape:v}=this.properties;if(f==null||!x.enabled)return;const{placement:b}=x,k=this.getLabelText(t,e,f,"label",[],x,{value:t,datum:e,idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:p,longitudeName:d,sizeKey:u,sizeName:m,colorKey:g,colorName:y,labelKey:f,labelName:S});if(k==null)return;const{width:A,height:I}=a.measureLines(String(k)),D=Qn.anchor(v);return{point:{x:i,y:s,size:o},label:{width:A,height:I,text:k},anchor:D,placement:b}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:s,properties:o,scale:a}=this,{idKey:n,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:p,labelKey:d,label:u,legendItemName:m}=o;if(t==null||i==null||a==null)return;const g=r!=null&&l!=null,y=n==null?void 0:t.resolveColumnById(this,"idValue",i),f=n==null?void 0:t.resolveColumnById(this,"featureValue",i),S=g?t.resolveColumnById(this,"latValue",i):void 0,x=g?t.resolveColumnById(this,"lonValue",i):void 0,v=d==null?void 0:t.resolveColumnById(this,"labelValue",i),b=c==null?void 0:t.resolveColumnById(this,"sizeValue",i),k=p==null?void 0:t.resolveColumnById(this,"colorValue",i),A=o.maxSize??o.size;s.range=[Math.min(o.size,A),A];const I=N0(u);let D;if(y!=null&&f!=null){D=new Map;for(const[_]of i.dataSources.get(this.id)?.data.entries()??[]){const E=y[_],L=f[_]?.geometry??void 0,P=L!=null&&a!=null?si(L,a):void 0;E!=null&&P!=null&&D.set(E,P)}}const N=[],R=[],C=[],w=i.dataSources.get(this.id)?.data??[];for(const[_,E]of w.entries()){const L=y?.[_],P=x?.[_],T=S?.[_],M=k?.[_],O=b?.[_],B=v?.[_],F=O==null?o.size:s.convert(O,{clamp:!0}),V=L==null?void 0:D?.get(L);if(L!=null&&si==null&&C.push(L),P!=null&&T!=null){const[W,K]=a.convert([P,T]),z=this.getLabelDatum(E,B,W,K,F,I);z&&R.push(z),N.push({series:this,itemId:r,datum:E,datumIndex:_,index:-1,idValue:L,lonValue:P,latValue:T,labelValue:B,sizeValue:O,colorValue:M,point:{x:W,y:K,size:F},midPoint:{x:W,y:K},legendItemName:m,style:this.getMarkerItemStyle({datumIndex:_,datum:E,colorValue:M,sizeValue:O},!1)})}else if(V!=null)for(const[W,[K,z]]of fp(V,1).entries()){const $=this.getLabelDatum(E,B,K,z,F,I);$&&R.push($),N.push({series:this,itemId:r,datum:E,datumIndex:_,index:W,idValue:L,lonValue:P,latValue:T,labelValue:B,sizeValue:O,colorValue:M,point:{x:K,y:z,size:F},midPoint:{x:K,y:z},legendItemName:m,style:this.getMarkerItemStyle({datumIndex:_,datum:E,colorValue:M,sizeValue:O},!1)})}}const G=10;if(C.length>G){const _=C.length-G;C.length=G,C.push(`(+${_} more)`)}return C.length>0&&M0.warnOnce("some data items do not have matches in the provided topology",C),{itemId:e,nodeData:N,labelData:R}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:s,highlightMarkerSelection:o}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let a=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:n}=this.properties,r=n!=null&&a?.datum==null&&n===a?.legendItemName;a!=null&&(a.series!==this&&!r||a.datum==null)&&(a=void 0);const l=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:l,markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!1,highlightedDatum:a}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:a==null?[]:[a],markerSelection:o}),this.updateMarkerNodes({markerSelection:o,isHighlight:!0,highlightedDatum:a}),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=gp.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{properties:t}=this,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,{x:o,y:a,width:n,height:r,text:l},c)=>{const p=Z0(this,void 0,t,t.label,!1,i),{color:d,fontStyle:u,fontWeight:m,fontSize:g,fontFamily:y}=p;s.visible=!0,s.x=o+n/2,s.y=a+r/2,s.text=l,s.fill=d,s.fontStyle=u,s.fontWeight=m,s.fontSize=g,s.fontFamily=y,s.textAlign="center",s.textBaseline="middle",s.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,s.setBoxing(p)})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,s=>bp(s.index,s.idValue,s.lonValue,s.latValue))}getMarkerItemStyle({datumIndex:e,datum:t,colorValue:i,sizeValue:s},o){const{properties:a,colorScale:n,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,p=this.getHighlightStyle(o,e),d=kp(p,a.getStyle());!o&&i!=null&&(d.fill=this.isColorScaleValid()?n.convert(i):l?.[0]??d.fill),s!=null&&(d.size=r.convert(s,{clamp:!0}));let u=d;if(c!=null&&e!=null){const m=this.cachedDatumCallback(bp(e,o?"highlight":"node"),()=>{const g=this.makeItemStylerParams(t,e,o,u);return this.callWithContext(c,g)});m&&(u=kp(m,d))}return u}makeItemStylerParams(e,t,i,s){const{id:o}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,highlighted:i,highlightState:n,...s,fill:r}}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:s}=e,o=Sp(this.scale);t.each((a,n)=>{const{datum:r,point:l}=n,c=this.getMarkerItemStyle(n,i);a.shape=c.shape,a.size=c.size,J0(a,c,o),a.x=l.x,a.y=l.y,a.scalingCenterX=l.x,a.scalingCenterY=l.y,a.zIndex=!i&&s!=null&&r===s.datum?1:0})}isProcessedDataAnimatable(){return!0}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:e}=this.ctx,t=WD();z0(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],t)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let s=1/0,o;for(const a of this.contextNodeData?.nodeData??[]){const{x:n,y:r,size:l}=a.point,c=Math.max(Math.abs(n-t)-l,0),p=Math.max(Math.abs(r-i)-l,0),d=c*c+p*p;d=0?"N":"S"}, ${Math.abs(w).toFixed(4)}\xB0 ${w>=0?"W":"E"}`}const R=this.getMarkerItemStyle({datumIndex:e,datum:k,colorValue:I,sizeValue:A},!1);return this.formatTooltipWithContext(b,{heading:N,title:x??v,symbol:this.legendItemSymbol(e),data:D},{seriesId:t,datum:k,title:x,idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:p,longitudeName:d,colorKey:u,colorName:m,sizeKey:g,sizeName:y,labelKey:f,labelName:S,...R})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return X0(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};ia.className="MapMarkerSeries",ia.type="map-marker";import{_ModuleSupport as eI}from"ag-charts-community";import{constant as tI,geoJson as iI,required as sI,string as it}from"ag-charts-core";var{commonSeriesOptionsDefs:oI,mapMarkerSeriesThemeableOptionsDef:aI,without:nI}=eI,rI={...nI(oI,["highlightStyle","highlight"]),...aI,type:sI(tI("map-marker")),idKey:it,latitudeKey:it,longitudeKey:it,sizeKey:it,colorKey:it,labelKey:it,idName:it,latitudeName:it,longitudeName:it,sizeName:it,colorName:it,labelName:it,topology:iI,topologyIdKey:it,legendItemName:it,title:it},oC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:e=>new ia(e),themeTemplate:{...Es,series:{shape:"circle",maxSize:30,fill:Bt({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",ss.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",ss.FILL_IMAGE_DEFAULTS],["pattern",ss.FILL_PATTERN_DEFAULTS]]}),stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Bt(ss.SAFE_RANGE2_OPERATION)]},fillOpacity:.5,label:{...ss.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Bt(ss.multiSeriesHighlightStyle())},tooltip:{range:"exact"}}},Dp={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:rI,create:e=>new ia(e),validate(e,t,i){const s=A0(e,t,i),{cleared:o,invalid:a}=s;if(o?.idKey==null&&(o?.latitudeKey==null||o?.longitudeKey==null)){const n=l=>i?`${i}.${l}`:l,r=`Either \`${n("idKey")}\` or both \`${n("latitudeKey")}\` and \`${n("longitudeKey")}\` are required.`;a.push(new I0("required",r,null,i))}return s}};import{_ModuleSupport as os}from"ag-charts-community";import{_ModuleSupport as Ip}from"ag-charts-community";import{Logger as Ap,cachedTextMeasurer as lI,isArray as cI,measureTextSegments as hI,toPlainText as pI}from"ag-charts-core";function dI(e,{aspectRatio:t,precision:i}){const s=mp(e,i,(l,c,p,d)=>{const u=gI(l,c,p,t),m=u+2*d*t,g=u*Math.SQRT2,y=m*Math.SQRT2;return{distance:g,maxDistance:y}});if(s==null)return;const{x:o,y:a,distance:n}=s,r=n/Math.SQRT2;return{x:o,y:a,maxWidth:r}}function uI(e,t,i,s,o){const[a,n]=e,[r,l]=t,c=1/o,p=r-a,d=l-n,[u,m]=n<=l?e:t,[g,y]=a<=r?e:t,[f,S]=n<=l?t:e,[x,v]=a<=r?t:e;let b=1/0;if(p===0)for(let R=0;R<=1;R+=1){const w=(R===0?c:-c)*(a-i)+s;if(w>=m&&w<=S){const _=Math.abs(s-w)*2*o;b=Math.min(b,_)}}else{const R=d/p;for(let C=0;C<=1;C+=1){const w=C===0?c:-c,G=(R*a-n-w*i+s)/(R-w);if(G>=g&&G<=x){const _=Math.abs(i-G)*2;b=Math.min(b,_)}}}const k=o,A=Math.abs((u-i)/(m-s)),I=Math.abs((f-i)/(S-s));if(Ss&&Ai&&Di!=c>i&&t<(l-d)*(i-u)/(c-u)+d&&(o=!o);const m=uI(r,p,t,i,s);a=Math.min(a,m),r=p,l=d,c=u}}return(o?1:-1)*a}function sa(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function mI(e,t,i,s,o,a){const n=o-a/2,r=o+a/2,[l,c]=t,[p,d]=i,u=p-l,m=d-c,[g,y]=l<=p?t:i,[f,S]=l<=p?i:t;if(u!==0){const x=m/u;for(let v=0;v<=1;v+=1){const k=((v===0?n:r)-c)/x+l;k>=g&&k<=f&&sa(e,s,k)}}else Math.max(n,Math.min(c,d))<=Math.min(r,Math.max(c,d))&&sa(e,s,l);return f=n&&S<=r?sa(e,s,f):g>s&&y>=n&&y<=r&&sa(e,s,g),e}function yI(e,t,i,s){const o={minX:-1/0,maxX:1/0};for(const r of e){let l=r.at(-1);for(const c of r)mI(o,l,c,t,i,s),l=c}const{minX:a,maxX:n}=o;return Number.isFinite(a)&&Number.isFinite(n)?{x:t+(a+n)/2,width:n-a}:{x:t,width:0}}import{_ModuleSupport as fI}from"ag-charts-community";var{Property:Ie,SeriesProperties:SI,makeSeriesTooltip:xI}=fI,ve=class extends SI{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new As,this.tooltip=xI()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,opacity:1}}};h([Ie],ve.prototype,"topology",2),h([Ie],ve.prototype,"title",2),h([Ie],ve.prototype,"legendItemName",2),h([Ie],ve.prototype,"idKey",2),h([Ie],ve.prototype,"idName",2),h([Ie],ve.prototype,"topologyIdKey",2),h([Ie],ve.prototype,"labelKey",2),h([Ie],ve.prototype,"labelName",2),h([Ie],ve.prototype,"colorKey",2),h([Ie],ve.prototype,"colorName",2),h([Ie],ve.prototype,"colorRange",2),h([Ie],ve.prototype,"fill",2),h([Ie],ve.prototype,"fillOpacity",2),h([Ie],ve.prototype,"stroke",2),h([Ie],ve.prototype,"strokeOpacity",2),h([Ie],ve.prototype,"strokeWidth",2),h([Ie],ve.prototype,"lineDash",2),h([Ie],ve.prototype,"lineDashOffset",2),h([Ie],ve.prototype,"padding",2),h([Ie],ve.prototype,"itemStyler",2),h([Ie],ve.prototype,"label",2),h([Ie],ve.prototype,"tooltip",2);var{getMissCount:bI,createDatumId:Mp,SeriesNodePickMode:Np,valueProperty:oa,ColorScale:vI,Group:Lp,Selection:er,Text:kI,PointerEvents:DI,applyShapeStyle:II,getLabelStyles:AI,mergeDefaults:Tp}=Ip,Rp=Ip.MercatorScale.fixedScale(),aa=class extends Fs{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[Np.EXACT_SHAPE_MATCH,Np.NEAREST_NODE]}),this.properties=new ve,this._chartTopology=void 0,this.colorScale=new vI,this.itemGroup=this.contentGroup.appendChild(new Lp({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Lp({name:"itemLabelGroup"})),this.datumSelection=er.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=er.select(this.itemLabelGroup,kI),this.highlightDatumSelection=er.select(this.highlightGroup,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=DI.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new ts;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,colorScale:s}=this,{topologyIdKey:o,idKey:a,colorKey:n,labelKey:r,colorRange:l}=this.properties,c=new Map;for(const y of i?.features.values()??[]){const f=y.properties?.[o];f==null||!Yn(y.geometry,1)||c.set(f,y)}const p=this.colorScale.type,d=this.scale?.type,{dataModel:u,processedData:m}=await this.requestDataModel(e,t,{props:[oa(a,d,{id:"idValue",includeProperty:!1}),oa(a,d,{id:"featureValue",includeProperty:!1,processor:()=>y=>c.get(y)}),...r?[oa(r,"category",{id:"labelValue"})]:[],...n?[oa(n,p,{id:"colorValue"})]:[]]}),g=u.resolveColumnById(this,"featureValue",m);if(this.topologyBounds=g.reduce((y,f)=>{const S=f?.geometry;return S==null?y:is(S,y)},void 0),l!=null&&this.isColorScaleValid()){const y=u.resolveProcessedDataIndexById(this,"colorValue");s.domain=m.domain.values[y],s.range=l,s.update()}i==null&&Ap.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const s=t.resolveProcessedDataIndexById(this,"colorValue"),o=i.input.count,a=bI(this,i.defs.values[s].missing);return!(o===0||o===a)}getLabelLayout(e,t,i,s,o){if(t==null||s==null)return;const{idKey:a,idName:n,colorKey:r,colorName:l,labelKey:c,labelName:p,padding:d,label:u}=this.properties;if(c==null||!u.enabled)return;const m=this.getLabelText(t,e,c,"label",[],u,{value:t,datum:e,idKey:a,idName:n,colorKey:r,colorName:l,labelKey:c,labelName:p});if(m==null)return;const g=cI(m)?hI(m,u):i.measureLines(String(m)),y=(g.width+2*d)/(g.height+2*d);if(o?.geometry===s&&o?.labelText===m&&o?.aspectRatio===y)return o;const f=si(s,Rp),S=Zo(f);if(S==null)return;const x=dI(S,{aspectRatio:y,precision:.001});if(x==null)return;const{x:v,y:b,maxWidth:k}=x;return{geometry:s,labelText:m,aspectRatio:y,x:v,y:b,maxWidth:k,fixedPolygon:S}}getLabelDatum(e,t){const{scale:i}=this;if(i==null)return;const{padding:s,label:o}=this.properties,{labelText:a,aspectRatio:n,x:r,y:l,maxWidth:c,fixedPolygon:p}=e,d={width:Math.ceil(c*t),height:Math.ceil(c*t/n),meta:r},u=Ds(pI(a),o,{padding:s},(b,k)=>{if(!k)return d;const A=yI(p,r,l,b/t);return{width:A.width*t,height:b,meta:A.x}});if(u==null)return;const[{text:m,fontSize:g,lineHeight:y,width:f},S]=u,x=fA){const I=b.length-A;b.length=A,b.push(`(+${I} more)`)}return b.length>0&&Ap.warnOnce("some data items do not have matches in the provided topology",b),{itemId:e,nodeData:x,labelData:v}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,labelSelection:t,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let s=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:o}=this.properties,a=o!=null&&s?.datum==null&&o===s?.legendItemName;s!=null&&(s.series!==this&&!a||s.datum==null)&&(s=void 0);const n=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:t}),this.updateLabelNodes({labelSelection:t}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s==null?[]:[s],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Mp(t.idValue))}getItemStyle({datumIndex:e,datum:t,colorValue:i},s){const{properties:o,colorScale:a}=this,{colorRange:n,itemStyler:r}=o,l=this.getHighlightStyle(s,e),c=Tp(l,o.getStyle());!s&&i!=null&&(c.fill=this.isColorScaleValid()?a.convert(i):n?.[0]??c.fill);let p=c;if(r!=null&&e!=null){const d=this.cachedDatumCallback(Mp(e,s?"highlight":"node"),()=>{const u=this.makeItemStylerParams(t,e,s,p);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,u))});d&&(p=Tp(d,p))}return p}makeItemStylerParams(e,t,i,s){const{id:o}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t),r=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,highlighted:i,highlightState:n,...s,fill:r}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e}){const t=Sp(this.scale);e.each((i,s)=>{const{projectedGeometry:o}=s;if(o==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=o,II(i,s.style,t)})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const{properties:t}=this,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,{x:o,y:a,text:n,fontSize:r,lineHeight:l},c)=>{const p=AI(this,void 0,t,t.label,!1,i),{color:d,fontStyle:u,fontWeight:m,fontFamily:g}=p;s.visible=!0,s.x=o,s.y=a,s.text=n,s.fill=d,s.fontStyle=u,s.fontWeight=m,s.fontSize=r,s.lineHeight=l,s.fontFamily=g,s.textAlign="center",s.textBaseline="middle",s.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,s.setBoxing(p)})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((o,a)=>{const n=o.distanceSquared(e,t);nnew aa(e),themeTemplate:{...Es,series:{fill:Bt({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",os.FILL_GRADIENT_LINEAR_DEFAULTS],["image",os.FILL_IMAGE_DEFAULTS],["pattern",os.FILL_PATTERN_DEFAULTS]]}),stroke:{$ref:"chartBackgroundColor"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Bt(os.SAFE_RANGE2_OPERATION)]},fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{...os.LABEL_BOXING_DEFAULTS,color:{$ref:"chartBackgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"},highlight:Bt(os.multiSeriesHighlightStyle(!0))},tooltip:{range:"exact"}}},Cp={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:CI,create:e=>new aa(e)};import{_ModuleSupport as tr}from"ag-charts-community";import{_ModuleSupport as OI}from"ag-charts-community";import{Logger as _I}from"ag-charts-core";import{_ModuleSupport as wI}from"ag-charts-community";var{Property:Yt,SeriesProperties:EI,makeSeriesTooltip:FI}=wI,Gt=class extends EI{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=FI()}};h([Yt],Gt.prototype,"topology",2),h([Yt],Gt.prototype,"fill",2),h([Yt],Gt.prototype,"fillOpacity",2),h([Yt],Gt.prototype,"stroke",2),h([Yt],Gt.prototype,"strokeOpacity",2),h([Yt],Gt.prototype,"strokeWidth",2),h([Yt],Gt.prototype,"lineDash",2),h([Yt],Gt.prototype,"lineDashOffset",2),h([Yt],Gt.prototype,"tooltip",2);var{createDatumId:BI,Selection:GI,Group:VI,PointerEvents:Op}=OI,na=class extends Fs{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new Gt,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new VI({name:"itemGroup"})),this.datumSelection=GI.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=Op.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new ts;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=Op.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const s=i.geometry;return s==null?t:is(s,t)},void 0),e==null&&_I.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:s}=this;if(t==null)return;const{fill:o,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:p}=s,d=[],u=[];for(const[m,g]of t.features.entries()){const{geometry:y}=g,f=y!=null&&i!=null?si(y,i):void 0;f!=null&&d.push({series:this,itemId:m,datum:g,datumIndex:0,index:m,projectedGeometry:f,style:{fill:o,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:p}})}return{itemId:e,nodeData:d,labelData:u}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>BI(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,s)=>{const{projectedGeometry:o}=s;if(o==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=o,i.setProperties(s.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}pickFocus(){}computeFocusBounds(e){}hasItemStylers(){return!1}};na.className="MapShapeBackgroundSeries",na.type="map-shape-background";import{_ModuleSupport as KI}from"ag-charts-community";import{constant as WI,geoJson as zI,required as $I}from"ag-charts-core";var{commonSeriesOptionsDefs:HI,mapShapeBackgroundSeriesThemeableOptionsDef:XI}=KI,YI={...XI,...HI,type:$I(WI("map-shape-background")),topology:zI},SC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:e=>new na(e),themeTemplate:{...Es,series:{fill:Bt({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",tr.FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS],["image",tr.FILL_IMAGE_DEFAULTS],["pattern",tr.FILL_PATTERN_HIERARCHY_DEFAULTS]]}),stroke:{$ref:"chartBackgroundColor"},strokeWidth:1}}},_p={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:YI,create:e=>new na(e)};import{_ModuleSupport as UI}from"ag-charts-community";import{_ModuleSupport as qI}from"ag-charts-community";import{_ModuleSupport as Gs}from"ag-charts-community";import{isDefined as jI}from"ag-charts-core";import{_ModuleSupport as wp}from"ag-charts-community";var{createDatumId:JI,mergeDefaults:Ep,toHighlightString:ZI}=wp;function QI(e,t,i){const{id:s}=e,{angleKey:o,cornerRadius:a,fill:n,fillOpacity:r,lineDash:l,lineDashOffset:c,radiusKey:p,stackGroup:d,stroke:u,strokeOpacity:m,strokeWidth:g}=e.properties,y=ZI(i??wp.HighlightState.None);return{angleKey:o,cornerRadius:a,fill:n,fillOpacity:r,highlightState:y,highlighted:t,lineDash:l,lineDashOffset:c,radiusKey:p,seriesId:s,stackGroup:d,stroke:u,strokeOpacity:m,strokeWidth:g}}function ir(e,t,i,s){const{styler:o}=e.properties;let a={};if(!t&&o){const n=QI(e,i,s);a=e.ctx.optionsGraphService.resolvePartial(["series",`${e.declarationOrder}`],e.cachedCallWithContext(o,n)??{},{pick:!1})??{}}return{cornerRadius:a.cornerRadius??e.properties.cornerRadius,fill:a.fill??e.properties.fill,fillOpacity:a.fillOpacity??e.properties.fillOpacity,lineDash:a.lineDash??e.properties.lineDash,lineDashOffset:a.lineDashOffset??e.properties.lineDashOffset,stroke:a.stroke??e.properties.stroke,strokeOpacity:a.strokeOpacity??e.properties.strokeOpacity,strokeWidth:a.strokeWidth??e.properties.strokeWidth,opacity:1}}function eA(e,t,i,s){const{id:o,properties:a}=e,{angleKey:n,radiusKey:r}=a,l=e.ctx.highlightManager?.getActiveHighlight(),c=e.getHighlightStateString(l,i,t.datumIndex),p=e.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:t.datum,highlighted:i,highlightState:c,angleKey:n,radiusKey:r,...s,fill:p}}function as(e,t,i,s){const{properties:o}=e,{itemStyler:a}=o,n=e.getHighlightStyle(i,t?.datumIndex,s);let l=Ep(n,ir(e,t===void 0,i,s));if(a!=null&&t!=null){const c=e.cachedDatumCallback(JI(e.getDatumId(t),i?"highlight":"node"),()=>{const p=eA(e,t,i,l);return e.callWithContext(a,p)});c&&(l=Ep(c,l))}return l}var{DEFAULT_POLAR_DIRECTION_KEYS:tA,DEFAULT_POLAR_DIRECTION_NAMES:iA,ChartAxisDirection:Vt,PolarAxis:sA,diff:oA,fixNumericExtent:aA,groupAccumulativeValueProperty:Fp,keyProperty:nA,normaliseGroupTo:rA,resetLabelFn:lA,seriesLabelFadeInAnimation:cA,seriesLabelFadeOutAnimation:hA,valueProperty:pA,animationValidation:dA,createDatumId:uA,SeriesNodePickMode:Bp,normalizeAngle360:Gp,CategoryScale:gA,motion:Vp,applyShapeStyle:mA,isGradientFill:yA,updateLabelNode:fA,getItemStyles:SA}=Gs,xA=class extends Gs.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},Kp=class extends Gs.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:tA,propertyNames:iA,canHaveAxes:!0,pickModes:[Bp.NEAREST_NODE,Bp.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:lA}}),this.NodeEvent=xA,this.groupScale=new gA,this.circleCache={r:0,cx:0,cy:0}}get hasData(){return this.getHasData("radiusValue-raw")}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===Vt.Angle)return t.getDomain(this,"angleValue","key",i);{const s=t.getDomain(this,"radiusValue-end","value",i),o=Number.isFinite(s[1]-s[0])?[Math.min(s[0],0),Math.max(s[1],0)]:[];return aA(o)}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,o=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),n=`${a}-trailing`,r=[];jI(s)&&r.push(rA([a,n],Math.abs(s))),o&&this.processedData&&r.push(oA(this.id,this.processedData)),o&&r.push(dA());const l=this.visible?{}:{forceValue:0},c=this.axes[Vt.Radius]?.scale.type,p=this.axes[Vt.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[nA(t,p,{id:"angleValue"}),pA(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...Fp(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...Fp(i,"trailing",{id:"radiusValue-start",invalidValue:null,groupId:n,separateNegative:!0,...l},c),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e!==s.r||t!==s.cx||i!==s.cy?(this.circleCache={r:e,cx:t,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[Vt.Radius]?.isReversed()}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes[Vt.Radius];return e instanceof sA?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||!e||e.type!=="grouped")return;const s=this.axes[Vt.Angle],o=this.axes[Vt.Radius],a=s?.scale,n=o?.scale;if(!a||!n)return;const r=t.resolveKeysById(this,"angleValue",e),l=t.resolveColumnById(this,"radiusValue-start",e),c=t.resolveColumnById(this,"radiusValue-end",e),p=t.resolveColumnById(this,"radiusValue-raw",e),d=t.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,m=0;s instanceof di&&(u=s.groupPaddingInner,m=s.paddingInner);const y=(a.bandwidth??0)*(1-m),{index:f,visibleGroupCount:S}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:S}).map((M,O)=>String(O)),i.range=[-y/2,y/2],i.paddingInner=S>1?u:0;const x=this.isRadiusAxisReversed(),v=x?this.radius:this.getAxisInnerRadius(),b=x?this.getAxisInnerRadius():this.radius,k=b+v,{angleKey:A,radiusKey:I,angleName:D,radiusName:N,legendItemName:R,label:C}=this.properties,w=this.getSeriesDomain(Vt.Radius),G=(M,O,B,F)=>{const V=this.getLabelText(O,M,I,"radius",w,C,{value:O,datum:M,angleKey:A,radiusKey:I,angleName:D,radiusName:N,legendItemName:R});if(V)return{x:B,y:F,text:V,textAlign:"center",textBaseline:"middle"}},_=[],E=SA((M,O,B)=>as(this,M,O,B)),L={itemId:I,nodeData:_,labelData:_,styles:E};if(!this.visible)return L;const{dataSources:P}=e,T=P.get(this.id)?.data??[];for(const{datumIndex:M,group:O}of t.forEachGroupDatum(this,e)){const B=T[M],F=r[M];if(F==null)return;const V=p[M],W=V>=0&&!Object.is(V,-0),K=l[M],z=c[M],$=O.aggregation[d][W?1:0]??0,Z=W===x;if(K===void 0||z===void 0)return;let q,Y;if(T.length===1)q=-.5*Math.PI,Y=1.5*Math.PI;else{const ye=a.convert(F);q=Gp(ye+i.convert(String(f))),Y=Gp(q+i.bandwidth)}const Q=q+i.bandwidth/2,ie=k-n.convert(K),U=k-n.convert(z),ce=(ie+U)/2,ae=k-n.convert(0),j=k-n.convert($),re=Math.cos(Q)*ce,se=Math.sin(Q)*ce,ue=this.properties.label.enabled?G(B,V,re,se):void 0,le=this.getColumnWidth(q,Y);_.push({series:this,datum:B,datumIndex:M,point:{x:re,y:se,size:0},midPoint:{x:re,y:se},label:ue,angleValue:F,radiusValue:V,negative:Z,innerRadius:ie,outerRadius:U,stackInnerRadius:ae,stackOuterRadius:j,startAngle:q,endAngle:Y,midAngle:Q,axisInnerRadius:v,axisOuterRadius:b,columnWidth:le,index:M})}return{itemId:I,nodeData:_,labelData:_,styles:E}}getColumnWidth(e,t){return Number.NaN}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){const{contextNodeData:i}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight();let o=[];const a=this.ctx.highlightManager?.getActiveHighlight();t?a?.datum&&a.series===this&&o.push(a):o=this.nodeData;const n=this.isRadiusAxisReversed(),r=n?this.radius:this.getAxisInnerRadius(),l=n?this.getAxisInnerRadius():this.radius,c=this.getShapeFillBBox(),p=this.hasItemStylers();e.update(o,void 0,d=>this.getDatumId(d)).each((d,u)=>{const{midPoint:m}=u;if(p){const x=this.getHighlightState(a,t,u.datumIndex);u.style=as(this,u,t,x)}const g=u.style??i.styles[this.getHighlightState(s,t,u.datumIndex)],y=g.fill,S=yA(y)&&y.bounds==="item"?{centerX:m?.x??0,centerY:m?.y??0}:{centerX:0,centerY:0,innerRadius:r,outerRadius:l};this.updateItemPath(d,u,t),mA(d,g,c,S),d.cornerRadius=g.cornerRadius??0,d.lineJoin="round"})}updateLabels(){const e=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.update(this.nodeData).each((t,i)=>{fA(this,t,this.properties,this.properties.label,i.label,!1,e),t.fillOpacity=this.getHighlightStyle(!1,i.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();Vp.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),cA(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();Vp.fromToMotion(this.id,"datums",t,[e],i),hA(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:p,tooltip:d}=a,u=o[Vt.Angle],m=o[Vt.Radius],g=this.nodeData?.[e];if(!i||!s||!u||!m||!g)return;const y=s.dataSources.get(this.id)?.data[e],f=i.resolveKeysById(this,"angleValue",s)[e],S=i.resolveColumnById(this,"radiusValue-raw",s)[e];if(f==null)return;const x=as(this,g,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(u,"tooltip",f,y,n,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(m,"tooltip",S,y,l,void 0)}]},{seriesId:t,datum:y,title:r,angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:p,...x})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n}=ir(this,!1,!1,Gs.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n};return Gs.isGradientFill(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{radiusKey:s,radiusName:o,legendItemName:a,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:a??o??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!n}]}getDatumId(e){return uA(e.angleValue)}computeLabelsBBox(){return null}};import{_ModuleSupport as bA}from"ag-charts-community";var{SeriesProperties:vA,makeSeriesTooltip:kA,Property:Ce,Label:DA}=bA,Ae=class extends vA{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new DA,this.tooltip=kA()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r,opacity:1}}};h([Ce],Ae.prototype,"angleKey",2),h([Ce],Ae.prototype,"angleName",2),h([Ce],Ae.prototype,"radiusKey",2),h([Ce],Ae.prototype,"radiusName",2),h([Ce],Ae.prototype,"legendItemName",2),h([Ce],Ae.prototype,"fill",2),h([Ce],Ae.prototype,"fillOpacity",2),h([Ce],Ae.prototype,"stroke",2),h([Ce],Ae.prototype,"strokeWidth",2),h([Ce],Ae.prototype,"strokeOpacity",2),h([Ce],Ae.prototype,"lineDash",2),h([Ce],Ae.prototype,"lineDashOffset",2),h([Ce],Ae.prototype,"cornerRadius",2),h([Ce],Ae.prototype,"styler",2),h([Ce],Ae.prototype,"itemStyler",2),h([Ce],Ae.prototype,"rotation",2),h([Ce],Ae.prototype,"stackGroup",2),h([Ce],Ae.prototype,"normalizedTo",2),h([Ce],Ae.prototype,"label",2),h([Ce],Ae.prototype,"tooltip",2);import{_ModuleSupport as IA}from"ag-charts-community";import{_ModuleSupport as AA}from"ag-charts-community";var{motion:MA}=AA;function Wp(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(n,r,l)=>{for(const c of t){const p=e[c];let d=(l==="removed"||l==="updated"?n:r)[c],u=(l==="removed"?n:r)[c];Number.isNaN(u)&&(u=n.previousDatum?.[c]??Number.NaN);const m=d-u;Math.abs(m)>Math.PI&&(d-=Math.sign(m)*2*Math.PI),p.set(r,{from:d,to:u})}},s=(n,r)=>({startAngle:e.startAngle.get(n)[r],endAngle:e.endAngle.get(n)[r]});return{calculate:i,from:n=>s(n,"from"),to:n=>s(n,"to")}}function zp(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.startAngle)||Number.isNaN(e.previousDatum.endAngle))return"added";if(Number.isNaN(t.startAngle)||Number.isNaN(t.endAngle))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function NA(e){const t=Wp();return{toFn:(o,a,n)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,p,d,u,m;return n==="removed"?(c=o.innerRadius,p=o.innerRadius,d=o.columnWidth,u=o.axisInnerRadius,m=o.axisOuterRadius):(c=Number.isNaN(a.innerRadius)?e:a.innerRadius,p=Number.isNaN(a.outerRadius)?e:a.outerRadius,d=Number.isNaN(a.columnWidth)?o.columnWidth:a.columnWidth,u=a.axisInnerRadius,m=a.axisOuterRadius),{innerRadius:c,outerRadius:p,columnWidth:d,axisInnerRadius:u,axisOuterRadius:m,startAngle:r,endAngle:l}},fromFn:(o,a,n)=>{n=zp(o,a,n),t.calculate(o,a,n);const{startAngle:r,endAngle:l}=t.from(a);let c,p,d,u,m;n==="removed"||n==="updated"?(c=o.innerRadius,p=o.outerRadius,d=o.columnWidth,u=o.axisInnerRadius,m=o.axisOuterRadius):(c=e,p=e,d=a.columnWidth,u=a.axisInnerRadius,m=a.axisOuterRadius);const g=MA.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{innerRadius:c,outerRadius:p,columnWidth:d,axisInnerRadius:u,axisOuterRadius:m,startAngle:r,endAngle:l,phase:g}}}}function LA(e,{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:o,axisOuterRadius:a,startAngle:n,endAngle:r}){return{innerRadius:t,outerRadius:i,columnWidth:s,axisInnerRadius:o,axisOuterRadius:a,startAngle:n,endAngle:r}}var{SectorBox:ra,motion:TA}=IA;function sr(e){const{negative:t,innerRadius:i,outerRadius:s,stackInnerRadius:o,stackOuterRadius:a}=e;return{innerRadius:t?a:o,outerRadius:t?o:a,clipInnerRadius:t?s:i,clipOuterRadius:t?i:s}}function RA(e){const t=Wp();return{toFn:(o,a,n)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,p,d;if(n==="removed")c=e,p=e,d=new ra(r,l,c,p);else{let u,m;({innerRadius:c,outerRadius:p,clipInnerRadius:u,clipOuterRadius:m}=sr(a)),Number.isNaN(c)&&(c=e),Number.isNaN(p)&&(p=e),Number.isNaN(u)&&(u=e),Number.isNaN(m)&&(m=e),d=new ra(r,l,u,m)}return{innerRadius:c,outerRadius:p,startAngle:r,endAngle:l,clipSector:d}},fromFn:(o,a,n)=>{n=zp(o,a,n),t.calculate(o,a,n);const{startAngle:r,endAngle:l}=t.from(a);let c,p,d;n==="removed"||n==="updated"?(c=o.innerRadius,p=o.outerRadius,d=o.clipSector):(c=e,p=e),d??(d=new ra(r,l,c,p));const u=TA.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{innerRadius:c,outerRadius:p,startAngle:r,endAngle:l,clipSector:d,phase:u}}}}function PA(e,t){const{startAngle:i,endAngle:s}=t,{innerRadius:o,outerRadius:a,clipInnerRadius:n,clipOuterRadius:r}=sr(t),l=new ra(i,s,n,r);return{innerRadius:o,outerRadius:a,startAngle:i,endAngle:s,clipSector:l}}var{Sector:CA,SectorBox:OA,PolarZIndexMap:or}=qI,la=class extends Kp{constructor(e){super(e,{animationResetFns:{item:PA}}),this.properties=new Ae}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,or.FOREGROUND,e],this.highlightGroup.zIndex=[0,or.HIGHLIGHT,e],this.labelGroup.zIndex=[0,or.LABEL,e],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new CA}updateItemPath(e,t,i){const{negative:s}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=s?0:this.properties.cornerRadius,e.endOuterCornerRadius=s?0:this.properties.cornerRadius,e.startInnerCornerRadius=s?this.properties.cornerRadius:0,e.endInnerCornerRadius=s?this.properties.cornerRadius:0,i){const{startAngle:o,endAngle:a}=t,{innerRadius:n,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=sr(t);e.innerRadius=n,e.outerRadius=r,e.startAngle=o,e.endAngle=a,e.clipSector=new OA(o,a,l,c)}}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return RA(e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};la.className="NightingaleSeries",la.type="nightingale";import{_ModuleSupport as _A}from"ag-charts-community";import{boolean as $p,constant as wA,number as EA,required as ar,string as ns}from"ag-charts-core";var{commonSeriesOptionsDefs:FA,nightingaleSeriesThemeableOptionsDef:BA}=_A,GA={...FA,...BA,type:ar(wA("nightingale")),angleKey:ar(ns),radiusKey:ar(ns),angleName:ns,radiusName:ns,legendItemName:ns,grouped:$p,stacked:$p,stackGroup:ns,normalizedTo:EA};import{_ModuleSupport as nr}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:Hp,POLAR_AXIS_SHAPE:Xp},FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:VA,FILL_IMAGE_DEFAULTS:KA,FILL_PATTERN_DEFAULTS:WA}=nr,zA={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",VA],["image",KA],["pattern",WA]]},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},strokeWidth:1,label:{...nr.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:nr.multiSeriesHighlightStyle()},axes:{[Hp.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:Xp.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[Hp.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:Xp.CIRCLE}}}},{ThemeConstants:{POLAR_AXIS_TYPE:Yp}}=UI,RC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:e=>new la(e),defaultAxes:[{type:Yp.ANGLE_CATEGORY},{type:Yp.RADIUS_NUMBER}],themeTemplate:zA,stackable:!0,groupable:!0,stackedByDefault:!0},Up={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:GA,create:e=>new la(e)};import{_ModuleSupport as qp}from"ag-charts-community";import{cachedTextMeasurer as $A,isArray as HA,measureTextSegments as XA,toPlainText as jp}from"ag-charts-core";import{_ModuleSupport as YA}from"ag-charts-community";var{SeriesProperties:UA,makeSeriesTooltip:qA,Property:Oe,Label:Jp,DropShadow:jA}=YA,JA=class extends Jp{},rr=class extends Jp{constructor(){super(...arguments),this.spacing=0}};h([Oe],rr.prototype,"spacing",2),h([Oe],rr.prototype,"placement",2);var Ge=class extends UA{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new jA().set({enabled:!1}),this.label=new JA,this.stageLabel=new rr,this.tooltip=qA()}getStyle(e=0){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};h([Oe],Ge.prototype,"stageKey",2),h([Oe],Ge.prototype,"valueKey",2),h([Oe],Ge.prototype,"fills",2),h([Oe],Ge.prototype,"fillOpacity",2),h([Oe],Ge.prototype,"strokes",2),h([Oe],Ge.prototype,"strokeWidth",2),h([Oe],Ge.prototype,"strokeOpacity",2),h([Oe],Ge.prototype,"lineDash",2),h([Oe],Ge.prototype,"lineDashOffset",2),h([Oe],Ge.prototype,"direction",2),h([Oe],Ge.prototype,"reverse",2),h([Oe],Ge.prototype,"spacing",2),h([Oe],Ge.prototype,"aspectRatio",2),h([Oe],Ge.prototype,"itemStyler",2),h([Oe],Ge.prototype,"shadow",2),h([Oe],Ge.prototype,"label",2),h([Oe],Ge.prototype,"stageLabel",2),h([Oe],Ge.prototype,"tooltip",2);function Zp(e,{x:t,y:i,top:s,right:o,bottom:a,left:n}){e.x0=t-s/2,e.x1=t+s/2,e.x2=t+a/2,e.x3=t-a/2,e.y0=i-n/2,e.y1=i-o/2,e.y2=i+o/2,e.y3=i+n/2}function ZA(e){return{fromFn:(o,a)=>{const{x:n,y:r}=a;let{top:l,right:c,bottom:p,left:d}=a;return e==="vertical"?(l=0,p=0):(d=0,c=0),{x:n,y:r,top:l,right:c,bottom:p,left:d}},toFn:(o,a)=>{const{x:n,y:r,top:l,right:c,bottom:p,left:d}=a;return{x:n,y:r,top:l,right:c,bottom:p,left:d}},applyFn:Zp}}var{StateMachine:QA,valueProperty:Qp,SeriesNodePickMode:ed,createDatumId:eM,BBox:lr,Group:cr,Selection:ca,Text:td,PointerEvents:id,applyShapeStyle:tM,mergeDefaults:sd,fromToMotion:iM,seriesLabelFadeInAnimation:sM,getLabelStyles:oM}=qp,hr=class extends qp.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[ed.EXACT_SHAPE_MATCH,ed.NEAREST_NODE]}),this.properties=new Ge,this.itemGroup=this.contentGroup.appendChild(new cr({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new cr({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new cr({name:"stageLabelGroup"})),this.datumSelection=ca.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=ca.select(this.itemLabelGroup,td),this.stageLabelSelection=ca.select(this.stageLabelGroup,td),this.highlightDatumSelection=ca.select(this.highlightGroup,()=>this.nodeFactory()),this.animationState=new QA("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=id.None,this.stageLabelGroup.pointerEvents=id.None}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)))}nodeFactory(){return new Et}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}async processData(e){if(this.data==null)return;const{id:t,visible:i,ctx:{legendManager:s}}=this,{stageKey:o,valueKey:a}=this.properties,n="category",r="number",l=(p,d,u)=>i&&s.getItemEnabled({seriesId:t,itemId:u}),c=this.visible?{}:{forceValue:0};await this.requestDataModel(e,this.data,{props:[Qp(o,n,{id:"xValue"}),Qp(a,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:s,visible:o,ctx:{legendManager:a}}=this,{stageKey:n,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:p,aspectRatio:d,label:u,stageLabel:m}=s;if(t==null||i==null)return;const g=l==="horizontal",y=t.resolveColumnById(this,"xValue",i),f=t.resolveColumnById(this,"yValue",i),S=t.getDomain(this,"xValue","value",i),x=t.getDomain(this,"yValue","value",i),v=$A(m);let b,k;g?(b="center",k=m.placement==="before"?"bottom":"top"):(b=m.placement==="after"?"left":"right",k="middle");const A=m.enabled?[]:void 0;let I=0,D=0,N=0;const R=i.dataSources.get(this.id)?.data??[];for(const[F,V]of R.entries()){const W=y[F],K=f[F],z=o&&a.getItemEnabled({seriesId:e,itemId:F});if(N+=K,A==null)continue;const $=this.getLabelText(W,V,n,"x",S,this.properties.stageLabel,{datum:V,value:K,stageKey:n,valueKey:r}),{width:Z,height:q}=HA($)?XA($,u):v.measureLines($);I=Math.max(I,Z),D=Math.max(D,q),A.push({x:Number.NaN,y:Number.NaN,text:$,textAlign:b,textBaseline:k,visible:z})}const C=this._nodeDataDependencies?.seriesRectWidth??0,w=this._nodeDataDependencies?.seriesRectHeight??0,G=p*(i.input.count-1);let _;if(g){const F=D+m.spacing;_=new lr(0,m.placement==="before"?F:0,C,w-F)}else{const F=I+m.spacing;_=new lr(m.placement==="after"?0:F,0,C-F,w)}if(d!=null&&d!==0){const F=l==="horizontal"?1/d:d,V=Math.min(_.width,_.height*F),W=V/F;_=new lr(_.x+(_.width-V)/2,_.y+(_.height-W)/2,V,W)}let E,L;g?L=m.placement==="before"?_.y-m.spacing:_.y+_.height+m.spacing:E=m.placement==="after"?_.x+_.width+m.spacing:_.x-m.spacing;const P=_.width-(g?G:0),T=_.height-(g?0:G);if(P<0||T<0)return;const M=[],O=[];let B=0;for(const[F,V]of R.entries()){const W=y[F],K=f[F],z=o&&a.getItemEnabled({seriesId:e,itemId:F}),$=B+K,Z=(B+$)/(2*N),q=($-B)/N,Y=g?P*Z+p*F:P*.5,Q=g?T*.5:T*Z+p*F,ie=_.x+Y,U=_.y+Q;if(A!=null){const le=A[F];le.x=E??ie,le.y=L??U}let ce,ae,j,re;if(g){const le=P*q;ce=le,j=le;const ye=(Y+le/2)*(T/_.width),we=(Y-le/2)*(T/_.width);ae=c?_.height-ye:ye,re=c?_.height-we:we}else{const le=T*q;ae=le,re=le;const ye=(Q-le/2)*(P/_.height),we=(Q+le/2)*(P/_.height);ce=c?_.width-ye:ye,j=c?_.width-we:we}const se=this.getLabelText(K,V,r,"y",x,u,{datum:V,value:K,stageKey:n,valueKey:r}),ue={x:ie,y:U,text:se,textAlign:"center",textBaseline:"middle",visible:z};O.push(ue),M.push({series:this,itemId:r,datum:V,datumIndex:F,index:F,xValue:W,yValue:K,x:ie,y:U,top:ce,right:ae,bottom:j,left:re,label:ue,enabled:z,midPoint:{x:ie,y:U},style:this.getItemStyle({datumIndex:F,datum:V},!1)}),B=$}return{itemId:e,nodeData:M,labelData:O,stageLabelData:A,bounds:_}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:s,highlightDatumSelection:o}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let a=this.ctx.highlightManager?.getActiveHighlight();a!=null&&(a.series!==this||a.datum==null)&&(a=void 0);const n=this.contextNodeData?.nodeData??[],r=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:n,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:r,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:s}),this.updateLabelNodes({labelSelection:s,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:a==null?[]:[a],datumSelection:o}),this.updateDatumStyles({datumSelection:o,isHighlight:!0}),this.updateDatumNodes({datumSelection:o,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemStyle({datumIndex:e,datum:t},i){const{properties:s}=this,{itemStyler:o}=s,a=this.getHighlightStyle(i,e);let r=sd(a,s.getStyle(e));if(o!=null&&e!=null){const l=this.cachedDatumCallback(eM(e,i?"highlight":"node"),()=>{const c=this.makeItemStylerParams(t,e,i,r);return this.callWithContext(o,c)});l&&(r=sd(l,r))}return r}makeItemStylerParams(e,t,i,s){const{id:o,properties:a}=this,{stageKey:n,valueKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),p=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:o,datum:e,stageKey:n,valueKey:r,highlighted:i,highlightState:c,...s,fill:p}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getItemStyle(s,t)})}updateDatumNodes({datumSelection:e}){const{properties:t}=this,{shadow:i}=t,s=this.contextNodeData?.bounds,o=s?{series:s,axis:s}:void 0;e.each((a,n)=>{tM(a,n.style,o),Zp(a,n),a.fillShadow=i})}updateLabelSelection(e){return e.labelSelection.update(this.properties.label.enabled?e.labelData:[])}updateStageLabelSelection(e){return e.stageLabelSelection.update(e.stageLabelData)}updateLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((i,s,o)=>{const{visible:a,x:n,y:r,text:l,textAlign:c,textBaseline:p}=s,d=oM(this,void 0,this.properties,e.labelProperties,!1,t),{color:u,fontSize:m,fontStyle:g,fontWeight:y,fontFamily:f}=d;i.visible=a,i.x=n,i.y=r,i.text=l,i.fill=u,i.fillOpacity=this.getHighlightStyle(!1,o).opacity??1,i.fontStyle=g,i.fontWeight=y,i.fontSize=m,i.fontFamily=f,i.textAlign=c,i.textBaseline=p,i.setBoxing(d)})}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0){for(const i of this.datumSelection)if(i.datum===t)return i.node}}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:o}=this,{stageKey:a,valueKey:n,tooltip:r}=o;if(!i||!s)return;const l=s.dataSources.get(this.id)?.data[e],c=i.resolveColumnById(this,"xValue",s)[e],p=i.resolveColumnById(this,"yValue",s)[e];if(c==null)return;const d=this.getLabelText(c,l,a,"x",i.getDomain(this,"xValue","value",s),this.properties.stageLabel,{datum:l,value:c,stageKey:a,valueKey:n}),u=this.getLabelText(p,l,n,"y",i.getDomain(this,"yValue","value",s),this.properties.stageLabel,{datum:l,value:p,stageKey:a,valueKey:n}),m=this.getItemStyle({datumIndex:e,datum:l},!1);return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:jp(d),value:jp(u)}]},{seriesId:t,datum:l,title:void 0,stageKey:a,valueKey:n,...m})}getSeriesDomain(){return[Number.NaN,Number.NaN]}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,s;return this.datumSelection.each((o,a)=>{const n=o.distanceSquared(e,t);nnew hr(e)};import{_ModuleSupport as pM}from"ag-charts-community";import{_ModuleSupport as ft}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:dM}}=ft,nd={series:{stroke:{$palette:"stroke"},label:{...ft.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",ft.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",ft.FILL_IMAGE_DEFAULTS],["pattern",ft.FILL_PATTERN_DEFAULTS]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:ft.multiSeriesHighlightStyle(),tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{[dM.ANGLE_CATEGORY]:{label:{spacing:10}}}},uM=ft.mergeDefaults({series:{stroke:ft.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},nd),gM=ft.mergeDefaults({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",ft.FILL_GRADIENT_LINEAR_DEFAULTS],["image",ft.FILL_IMAGE_DEFAULTS],["pattern",ft.FILL_PATTERN_DEFAULTS]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},nd);import{_ModuleSupport as rd}from"ag-charts-community";import{_ModuleSupport as dr}from"ag-charts-community";import{isFiniteNumber as ld,isNumberEqual as cd}from"ag-charts-core";import{_ModuleSupport as mM}from"ag-charts-community";var{Label:yM,SeriesMarker:fM,SeriesProperties:SM,makeSeriesTooltip:xM,Property:Qe}=mM,ze=class extends SM{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new fM,this.label=new yM,this.tooltip=xM(),this.connectMissingData=!1}};h([Qe],ze.prototype,"angleKey",2),h([Qe],ze.prototype,"radiusKey",2),h([Qe],ze.prototype,"angleName",2),h([Qe],ze.prototype,"radiusName",2),h([Qe],ze.prototype,"legendItemName",2),h([Qe],ze.prototype,"stroke",2),h([Qe],ze.prototype,"strokeWidth",2),h([Qe],ze.prototype,"strokeOpacity",2),h([Qe],ze.prototype,"lineDash",2),h([Qe],ze.prototype,"lineDashOffset",2),h([Qe],ze.prototype,"rotation",2),h([Qe],ze.prototype,"styler",2),h([Qe],ze.prototype,"marker",2),h([Qe],ze.prototype,"label",2),h([Qe],ze.prototype,"tooltip",2),h([Qe],ze.prototype,"connectMissingData",2);var{DEFAULT_POLAR_DIRECTION_KEYS:bM,DEFAULT_POLAR_DIRECTION_NAMES:vM,ChartAxisDirection:St,PolarAxis:kM,SeriesNodePickMode:hd,valueProperty:pd,fixNumericExtent:DM,seriesLabelFadeInAnimation:IM,markerFadeInAnimation:AM,resetMarkerFn:MM,animationValidation:NM,computeMarkerFocusBounds:LM,extent:TM,BBox:RM,Group:PM,Path:CM,Selection:ur,Text:OM,Marker:_M,updateLabelNode:wM,getMarkerStyles:EM,mergeDefaults:FM}=dr,BM=class extends dr.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},gr=class extends dr.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:bM,propertyNames:vM,pickModes:[hd.NEAREST_NODE,hd.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:MM},clipFocusBox:!1}),this.NodeEvent=BM,this.lineGroup=this.contentGroup.appendChild(new PM({name:"radar-line"})),this.lineSelection=ur.select(this.lineGroup,CM),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}get hasData(){return this.getHasData("angleValue")}nodeFactory(){return new _M}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===St.Angle)return t.getDomain(this,"angleValue","value",i);{const s=t.getDomain(this,"radiusValue","value",i),o=TM(s.length===0?s:[0].concat(s));return DM(o)}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,s=[];this.ctx.animationManager.isSkipped()||s.push(NM());const o=this.axes[St.Radius]?.scale.type,a=this.axes[St.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[pd(t,a,{id:"angleValue"}),pd(i,o,{id:"radiusValue",invalidValue:void 0}),...s]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes[St.Radius];return e instanceof kM?this.radius*e.innerRadiusRatio:0}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}createNodeData(){const{processedData:e,dataModel:t}=this;if(!e||!t)return;const{angleKey:i,radiusKey:s,angleName:o,radiusName:a,legendItemName:n,marker:r,label:l}=this.properties,c=this.axes[St.Angle]?.scale,p=this.axes[St.Radius]?.scale;if(!c||!p)return;const d=t.resolveColumnById(this,"angleValue",e),u=t.resolveColumnById(this,"radiusValue",e),m=this.getAxisInnerRadius(),g=this.getSeriesDomain(St.Radius),f=(e.dataSources.get(this.id)?.data??[]).map((S,x)=>{const v=d[x],b=u[x],k=c.convert(v),A=this.radius+m-p.convert(b),I=Math.cos(k),D=Math.sin(k),N=I*A,R=D*A;let C;if(l.enabled){const w=this.getLabelText(b,S,s,"radius",g,l,{value:b,datum:S,angleKey:i,radiusKey:s,angleName:o,radiusName:a,legendItemName:n});if(w){let G="right";cd(I,0)?G="center":I>0&&(G="left");let _="bottom";cd(D,0)?_="middle":D>0&&(_="top"),C={x:N+I*r.size,y:R+D*r.size,text:w,textAlign:G,textBaseline:_}}}return{series:this,datum:S,datumIndex:x,index:x,point:{x:N,y:R,size:r.size},midPoint:{x:N,y:R},label:C,angleValue:v,radiusValue:b,missing:!ld(k)||!ld(A)}});return{itemId:s,nodeData:f,labelData:f,styles:EM(this,this.properties,r)}}update({seriesRect:e}){const t=this.checkResize(e),i=!this.ctx.animationManager.isSkipped(),{series:s}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&s===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateHighlightSelection(),this.updatePathNodes(),this.hasItemStylers()&&(this.updateDatumStyles(this.itemSelection,!1),this.updateDatumStyles(this.highlightSelection,!0)),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const e=this.visible?[!0]:[];this.lineSelection.update(e)}updateMarkerSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=ur.select(this.itemGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle(!1).marker.enabled,s=this.visible&&e.shape&&i?this.nodeData:[];this.itemSelection.update(s)}updateHighlightSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=ur.select(this.highlightGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle(!1).marker.enabled,s=this.ctx.highlightManager?.getActiveHighlight(),o=this.visible&&e.shape&&i&&s?.datum?[{...s}]:[];this.highlightSelection.update(o)}getMarkerFill(e){return e?.fill??this.getStyle(!1).marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:s,radiusKey:o}=i;return{seriesId:t,datum:e,angleKey:s,radiusKey:o}}updateDatumStyles(e,t){const i=this.ctx.highlightManager.getActiveHighlight();e.each((s,o)=>{const a=this.getHighlightState(i,t,o.datumIndex),n=this.getStyle(t,a),{stroke:r,strokeWidth:l,strokeOpacity:c}=n;o.style=this.getMarkerStyle(this.properties.marker,o,this.getDatumStylerProperties(o.datum),{isHighlight:t,highlightState:a},n.marker,{stroke:r,strokeWidth:l,strokeOpacity:c})})}updateMarkers(e,t){const i=this.getShapeFillBBox(),{contextNodeData:s}=this;if(!s)return;const o=this.ctx.highlightManager.getActiveHighlight();e.each((a,n)=>{const r=n.style??s.styles[this.getHighlightState(o,t,n.datumIndex)];this.applyMarkerStyle(r,a,n.point,i)})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.update(this.nodeData).each((i,s)=>{s.label&&(i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,wM(this,i,e,e.label,s.label,!1,t))})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:p,tooltip:d,marker:u}=a,m=o[St.Angle],g=o[St.Radius];if(!i||!s||!m||!g)return;const y=s.dataSources.get(this.id)?.data[e],f=i.resolveColumnById(this,"angleValue",s)[e],S=i.resolveColumnById(this,"radiusValue",s)[e];if(f==null)return;const x=this.getMarkerStyle(u,{datum:y,datumIndex:e},this.getDatumStylerProperties(y),{isHighlight:!1});return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(m,"tooltip",f,y,n,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",S,y,l,void 0)}]},{seriesId:t,datum:y,title:r,angleKey:n,radiusKey:l,angleName:r,radiusName:c,legendItemName:p,...x})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:s,marker:o}=this.getStyle(!1);return{marker:{shape:o.shape,enabled:o.enabled||t<=0,fill:this.getMarkerFill()??o.stroke??e??"rgba(0, 0, 0, 0)",stroke:o.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:o.fillOpacity,strokeOpacity:o.strokeOpacity,strokeWidth:o.strokeWidth,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},line:{stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:s}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{radiusKey:o,radiusName:a,legendItemName:n,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:o,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:o}),label:{text:n??a??o},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!r}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:s}=this,{x:o,y:a}=e,n=this.radius;if(Math.hypot(o-i,a-s)>n+this.properties.marker.size)return;let l=1/0,c;for(const p of t){const{point:{x:d=Number.NaN,y:u=Number.NaN}={}}=p;if(Number.isNaN(d)||Number.isNaN(u))continue;const m=Math.hypot(e.x-d-i,e.y-u-s);mthis.animatePaths(s),onStop:()=>this.animatePaths(1)}),AM(this,i,"added",e),IM(this,"labels",i,t)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e),this.resetPaths()}animateReadyResize(e){super.animateReadyResize(e),this.resetPaths()}resetPaths(){const e=this.getLineNode();if(e){const{path:t}=e,i=this.getLinePoints(),s=this.getStyle(!1);e.fill=void 0,e.stroke=s.stroke,e.strokeWidth=s.strokeWidth,e.strokeOpacity=s.strokeOpacity,e.lineDash=s.lineDash,e.lineDashOffset=s.lineDashOffset,t.clear(!0);for(const{x:o,y:a,moveTo:n}of i)n?t.moveTo(o,a):t.lineTo(o,a);return e.checkPathDirty(),s}}getStylerResult(e,t,i){const{styler:s}=this.properties;if(s){const o=this.makeStylerParams(t,i),a=this.cachedCallWithContext(s,o)??{},n=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],a,{pick:!1});n&&(e=n)}return e}getFormattedMarkerStyle(e){const{angleKey:t,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,e,{angleKey:t,radiusKey:i},{isHighlight:!0})}computeFocusBounds(e){return LM(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};gr.className="RadarSeries";import{_ModuleSupport as GM}from"ag-charts-community";var{Property:dd}=GM,mr=class extends ze{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};h([dd],mr.prototype,"fill",2),h([dd],mr.prototype,"fillOpacity",2);var{ChartAxisDirection:ud,Group:VM,HighlightState:KM,Path:WM,PointerEvents:gd,Selection:zM,applyShapeStyle:md,toHighlightString:$M}=rd,ha=class extends gr{constructor(e){super(e),this.properties=new mr,this.areaGroup=this.contentGroup.appendChild(new VM({name:"radar-area"})),this.areaSelection=zM.select(this.areaGroup,WM),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const e=this.visible?[!0]:[];this.areaSelection.update(e),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(e){if(e?.fill!=null)return e.fill;const t=this.getStyle(!1);return t.marker.fill??t.fill}updatePathNodes(){const e=this.getPathNodesStyle(),{fill:t,fillOpacity:i,strokeWidth:s,stroke:o,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:l}=e,c=this.getLineNode();c&&c.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:gd.None,opacity:l,stroke:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r});const p=this.getAreaNode();p&&(md(p,{fill:t,fillOpacity:i,stroke:void 0},this.getShapeFillBBox()),p.setProperties({lineJoin:"round",pointerEvents:gd.None,opacity:l}))}animatePaths(e){super.animatePaths(e);const t=this.getAreaNode();t&&this.animateSinglePath(t,this.getAreaPoints(),e)}getAreaPoints(){const e=this.getLinePoints(),t=n=>{const r=this.axes[n];return r instanceof rd.PolarAxis?r:void 0},i=t(ud.Radius),s=t(ud.Angle);if(!i?.isReversed())return e;const a=s?.getAxisLinePoints()?.points??[];return e.concat(...a)}resetPaths(){const e=super.resetPaths(),t=this.getAreaNode();if(t){const{path:i}=t,s=this.getAreaPoints(),o=e??this.getStyle(!1),a=this.getShapeFillBBox();md(t,{fill:o.fill,stroke:void 0,fillOpacity:o.fillOpacity,lineDash:o.lineDash,lineDashOffset:o.lineDashOffset},a),t.lineJoin=t.lineCap="round",i.clear(!0);for(const{x:n,y:r,moveTo:l,arc:c,radius:p=0,startAngle:d=0,endAngle:u=0}of s)c?i.arc(n,r,p,d,u):l?i.moveTo(n,r):i.lineTo(n,r);return i.closePath(),t.checkPathDirty(),o}}makeStylerParams(e,t){const{properties:i}=this,s=$M(t??KM.None);return{marker:{fill:i.marker.fill,fillOpacity:i.marker.fillOpacity,size:i.marker.size,shape:i.marker.shape,stroke:i.marker.stroke,strokeOpacity:i.marker.strokeOpacity,strokeWidth:i.marker.strokeWidth,lineDash:i.marker.lineDash,lineDashOffset:i.marker.lineDashOffset},highlightState:s,highlighted:e,fill:i.fill,fillOpacity:i.fillOpacity,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset,seriesId:this.id,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,angleKey:i.angleKey,radiusKey:i.radiusKey}}getStyle(e,t){const{marker:i,fill:s,fillOpacity:o,lineDash:a,lineDashOffset:n,stroke:r,strokeOpacity:l,strokeWidth:c}=this.properties,{size:p,shape:d,fill:u="transparent",fillOpacity:m}=i,g=this.getStylerResult({},e,t);return g.marker??(g.marker={}),{fill:g.fill??s,fillOpacity:g.fillOpacity??o,lineDash:g.lineDash??a,lineDashOffset:g.lineDashOffset??n,stroke:g.stroke??r,strokeOpacity:g.strokeOpacity??l,strokeWidth:g.strokeWidth??c,marker:{enabled:g.marker.enabled??i.enabled,fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??m,shape:g.marker.shape??d,size:g.marker.size??p,lineDash:g.marker.lineDash??i.lineDash??a,lineDashOffset:g.marker.lineDashOffset??i.lineDashOffset??n,stroke:g.marker.stroke??i.stroke??r,strokeOpacity:g.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:g.marker.strokeWidth??i.strokeWidth??c}}}};ha.className="RadarAreaSeries",ha.type="radar-area";import{_ModuleSupport as HM}from"ag-charts-community";import{constant as XM,required as yr,string as Vs}from"ag-charts-core";var{commonSeriesOptionsDefs:YM,radarAreaSeriesThemeableOptionsDef:UM}=HM,qM={...YM,...UM,type:yr(XM("radar-area")),angleKey:yr(Vs),radiusKey:yr(Vs),angleName:Vs,radiusName:Vs,legendItemName:Vs},{ThemeConstants:{POLAR_AXIS_TYPE:yd}}=pM,YC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:e=>new ha(e),defaultAxes:[{type:yd.ANGLE_CATEGORY},{type:yd.RADIUS_NUMBER}],themeTemplate:gM},fd={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:qM,create:e=>new ha(e)};import{_ModuleSupport as jM}from"ag-charts-community";import{_ModuleSupport as JM}from"ag-charts-community";var{HighlightState:ZM,PointerEvents:QM,toHighlightString:eN}=JM,pa=class extends gr{constructor(){super(...arguments),this.properties=new ze}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const e=this.getLineNode();if(!e)return;const t=this.getPathNodesStyle(),{strokeWidth:i,stroke:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,opacity:r}=t;e.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:QM.None,opacity:r,stroke:s,strokeWidth:i,strokeOpacity:o,lineDash:a,lineDashOffset:n})}makeStylerParams(e,t){const{properties:i}=this,s=eN(t??ZM.None);return{marker:{fill:i.marker.fill,fillOpacity:i.marker.fillOpacity,size:i.marker.size,shape:i.marker.shape,stroke:i.marker.stroke,strokeOpacity:i.marker.strokeOpacity,strokeWidth:i.marker.strokeWidth,lineDash:i.marker.lineDash,lineDashOffset:i.marker.lineDashOffset},highlightState:s,highlighted:e,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset,seriesId:this.id,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,angleKey:i.angleKey,radiusKey:i.radiusKey}}getStyle(e,t){const{marker:i,lineDash:s,lineDashOffset:o,stroke:a,strokeOpacity:n,strokeWidth:r}=this.properties,{size:l,shape:c,fill:p="transparent",fillOpacity:d}=i,u=this.getStylerResult({},e,t);return u.marker??(u.marker={}),{lineDash:u.lineDash??s,lineDashOffset:u.lineDashOffset??o,stroke:u.stroke??a,strokeOpacity:u.strokeOpacity??n,strokeWidth:u.strokeWidth??r,marker:{enabled:u.marker.enabled??i.enabled,fill:u.marker.fill??p,fillOpacity:u.marker.fillOpacity??d,shape:u.marker.shape??c,size:u.marker.size??l,lineDash:u.marker.lineDash??i.lineDash??s,lineDashOffset:u.marker.lineDashOffset??i.lineDashOffset??o,stroke:u.marker.stroke??i.stroke??a,strokeOpacity:u.marker.strokeOpacity??i.strokeOpacity??n,strokeWidth:u.marker.strokeWidth??i.strokeWidth??r}}}};pa.className="RadarLineSeries",pa.type="radar-line";import{_ModuleSupport as tN}from"ag-charts-community";import{constant as iN,required as fr,string as Ks}from"ag-charts-core";var{commonSeriesOptionsDefs:sN,radarLineSeriesThemeableOptionsDef:oN}=tN,aN={...sN,...oN,type:fr(iN("radar-line")),angleKey:fr(Ks),radiusKey:fr(Ks),angleName:Ks,radiusName:Ks,legendItemName:Ks},{POLAR_AXIS_TYPE:Sd}=jM.ThemeConstants,ZC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:e=>new pa(e),defaultAxes:[{type:Sd.ANGLE_CATEGORY},{type:Sd.RADIUS_NUMBER}],themeTemplate:uM},xd={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:aN,create:e=>new pa(e)};import{_ModuleSupport as nN}from"ag-charts-community";import{_ModuleSupport as Ws}from"ag-charts-community";import{isDefined as rN}from"ag-charts-core";function lN(e){return typeof e?.datum=="object"?e.datum:null}import{_ModuleSupport as cN}from"ag-charts-community";var{SeriesProperties:hN,makeSeriesTooltip:pN,Property:_e,Label:dN}=cN,Le=class extends hN{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new dN,this.tooltip=pN()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n,cornerRadius:r,opacity:1}}};h([_e],Le.prototype,"angleKey",2),h([_e],Le.prototype,"radiusKey",2),h([_e],Le.prototype,"angleName",2),h([_e],Le.prototype,"radiusName",2),h([_e],Le.prototype,"legendItemName",2),h([_e],Le.prototype,"fill",2),h([_e],Le.prototype,"fillOpacity",2),h([_e],Le.prototype,"stroke",2),h([_e],Le.prototype,"strokeWidth",2),h([_e],Le.prototype,"strokeOpacity",2),h([_e],Le.prototype,"lineDash",2),h([_e],Le.prototype,"lineDashOffset",2),h([_e],Le.prototype,"cornerRadius",2),h([_e],Le.prototype,"styler",2),h([_e],Le.prototype,"itemStyler",2),h([_e],Le.prototype,"rotation",2),h([_e],Le.prototype,"stackGroup",2),h([_e],Le.prototype,"normalizedTo",2),h([_e],Le.prototype,"label",2),h([_e],Le.prototype,"tooltip",2);import{_ModuleSupport as uN}from"ag-charts-community";var{SectorBox:bd,motion:gN}=uN;function mN(e,t,i){if(i==="updated"){if(e.previousDatum==null||Number.isNaN(e.previousDatum.innerRadius)||Number.isNaN(e.previousDatum.outerRadius))return"added";if(Number.isNaN(t.innerRadius)||Number.isNaN(t.outerRadius))return"removed"}return i==="added"&&e.previousDatum!=null?"updated":i}function vd(e){return{toFn:(s,o,a)=>{let n,r,l,c,p;return a==="removed"?(n=e,r=e,l=o.innerRadius,c=o.outerRadius,p=new bd(n,r,l,c)):(n=o.startAngle,r=o.endAngle,l=Number.isNaN(o.innerRadius)?s.innerRadius:o.innerRadius,c=Number.isNaN(o.outerRadius)?s.outerRadius:o.outerRadius,p=o.clipSector),{startAngle:n,endAngle:r,innerRadius:l,outerRadius:c,clipSector:p}},fromFn:(s,o,a)=>{a=mN(s,o,a);let n,r,l,c,p;a==="removed"||a==="updated"?(n=s.startAngle,r=s.endAngle,l=s.innerRadius,c=s.outerRadius,p=s.clipSector):(n=e,r=e,l=o.innerRadius,c=o.outerRadius),p??(p=new bd(n,r,l,c));const d=gN.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{startAngle:n,endAngle:r,innerRadius:l,outerRadius:c,clipSector:p,phase:d}}}}function yN(e,t){return{centerX:0,centerY:0,innerRadius:t.innerRadius,outerRadius:t.outerRadius,startAngle:t.startAngle,endAngle:t.endAngle,clipSector:t.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:fN,DEFAULT_POLAR_DIRECTION_NAMES:SN,ChartAxisDirection:Kt,PolarAxis:xN,diff:bN,groupAccumulativeValueProperty:kd,keyProperty:vN,normaliseGroupTo:kN,valueProperty:DN,fixNumericExtent:IN,resetLabelFn:AN,seriesLabelFadeInAnimation:MN,seriesLabelFadeOutAnimation:NN,animationValidation:LN,angleBetween:TN,createDatumId:RN,CategoryScale:PN,Sector:CN,SectorBox:ON,motion:Dd,isGradientFill:_N,applyShapeStyle:wN,updateLabelNode:EN,getItemStyles:FN}=Ws,BN=class extends Ws.SeriesNodeEvent{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey}},da=class extends Ws.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",propertyKeys:fN,propertyNames:SN,canHaveAxes:!0,animationResetFns:{item:yN,label:AN}}),this.properties=new Le,this.NodeEvent=BN,this.groupScale=new PN,this.circleCache={r:0,cx:0,cy:0}}get hasData(){return this.getHasData("angleValue-raw")}nodeFactory(){return new CN}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];if(e===Kt.Angle){const s=t.getDomain(this,"angleValue-end","value",i),o=[Math.min(s[0],0),Math.max(s[1],0)];return IN(o)}else return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:s}=this.properties,o=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),n=`${a}-trailing`,r=[];rN(s)&&r.push(kN([a,n],Math.abs(s))),o&&(this.processedData&&r.push(bN(this.id,this.processedData)),r.push(LN()));const l=this.visible?{}:{forceValue:0},c=this.axes[Kt.Radius]?.scale.type,p=this.axes[Kt.Angle]?.scale.type;await this.requestDataModel(e,this.data,{props:[vN(i,c,{id:"radiusValue"}),DN(t,p,{id:"angleValue-raw",invalidValue:null,...l}),...kd(t,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},p),...kd(t,"trailing",{id:"angleValue-start",invalidValue:null,groupId:n,separateNegative:!0,...l},p),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,s=this.circleCache;return e===s.r&&t===s.cx&&i===s.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes[Kt.Radius];return e instanceof xN?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||!e||e.type!=="grouped")return;const i=this.axes[Kt.Angle],s=this.axes[Kt.Radius],o=i?.scale,a=s?.scale;if(!o||!a)return;const n=t.resolveKeysById(this,"radiusValue",e),r=t.resolveColumnById(this,"angleValue-start",e),l=t.resolveColumnById(this,"angleValue-end",e),c=t.resolveColumnById(this,"angleValue-raw",e),p=t.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;s instanceof ui&&(d=s.groupPaddingInner);const{groupScale:u}=this,{index:m,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:g}).map((T,M)=>String(M)),u.range=[0,Math.abs(a.bandwidth??0)],u.paddingInner=g>1?d:0;const y=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,f=i.isReversed(),S=s.isReversed(),x=S?this.radius:this.getAxisInnerRadius(),b=(S?this.getAxisInnerRadius():this.radius)+x,k=this.getSeriesDomain(Kt.Angle),{angleKey:A,radiusKey:I,angleName:D,radiusName:N,legendItemName:R,label:C}=this.properties,w=(T,M,O,B)=>{const F=this.getLabelText(M,T,A,"angle",k,C,{value:M,datum:T,angleKey:A,radiusKey:I,angleName:D,radiusName:N,legendItemName:R});if(F)return{x:O,y:B,text:F,textAlign:"center",textBaseline:"middle"}},G=[],_=FN((T,M,O)=>as(this,T,M,O)),E={itemId:I,nodeData:G,labelData:G,styles:_};if(!this.visible)return E;const{dataSources:L}=e,P=L.get(this.id)?.data??[];for(const{datumIndex:T,group:M}of t.forEachGroupDatum(this,e)){const O=P[T],B=n[T];if(B==null)return;const F=c[T],V=r[T],W=l[T],K=F>=0&&!Object.is(F,-0),z=M.aggregation[p][K?1:0],$=K===f;let Z=o.convert(V,{clamp:!0}),q=o.convert(W,{clamp:!0}),Y=o.convert(0,{clamp:!0}),Q=o.convert(z,{clamp:!0});$&&([Y,Q]=[Q,Y],[Z,q]=[q,Z]);const U=b-a.convert(B)+u.convert(String(m)),ce=U+y,ae=(U+ce)/2,j=Z+TN(Z,q)/2,re=Math.cos(j)*ae,se=Math.sin(j)*ae,ue=this.properties.label.enabled?w(O,F,re,se):void 0,le=new ON(Z,q,U,ce);G.push({series:this,datum:O,datumIndex:T,point:{x:re,y:se,size:0},midPoint:{x:re,y:se},label:ue,angleValue:F,radiusValue:B,innerRadius:U,outerRadius:ce,startAngle:Y,endAngle:Q,clipSector:le,reversed:$,index:T})}return E}update({seriesRect:e}){const t=this.checkResize(e);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),t&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(e,t){let i=[];const s=this.ctx.highlightManager?.getActiveHighlight();t?s?.datum&&s.series===this&&i.push(s):i=this.nodeData;const{contextNodeData:o}=this;if(!o)return;const a=this.ctx.highlightManager.getActiveHighlight(),n=this.getShapeFillBBox(),r=this.hasItemStylers();e.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const p=lN(c);if(p==null)return;if(r){const y=this.getHighlightState(s,t,c.datumIndex);c.style=as(this,c,t,y)}const d=c.style??o.styles[this.getHighlightState(a,t,c.datumIndex)],u=d.cornerRadius,m=d.fill,g=Ws.isGradientFill(m)&&m.bounds!=="item"?{centerX:0,centerY:0}:void 0;wN(l,d,n,g),l.lineJoin="round",l.inset=l.stroke==null?0:l.strokeWidth/2,l.startInnerCornerRadius=p.reversed?u:0,l.startOuterCornerRadius=p.reversed?u:0,l.endInnerCornerRadius=p.reversed?0:u,l.endOuterCornerRadius=p.reversed?0:u,t&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.clipSector=c.clipSector,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius)})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.update(this.nodeData).each((i,s)=>{EN(this,i,e,e.label,s.label,!1,t),i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1})}getBarTransitionFunctions(){const e=this.axes[Kt.Angle]?.scale;let t=0;if(!e)return vd(t);const i=Math.min(e.domain[0],e.domain[1]),s=Math.max(e.domain[0],e.domain[1]);return i<=0&&s>=0&&(t=e.convert(0)),vd(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();Dd.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),MN(this,"labels",this.ctx.animationManager,e)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();Dd.fromToMotion(this.id,"datums",t,[e],i),NN(this,"labels",t,this.labelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:o,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:p,tooltip:d}=a,u=o[Kt.Angle],m=o[Kt.Radius],g=this.nodeData?.[e];if(!i||!s||!u||!m||!g)return;const y=s.dataSources.get(this.id)?.data[e],f=i.resolveKeysById(this,"radiusValue",s)[e],S=i.resolveColumnById(this,"angleValue-raw",s)[e];if(f==null)return;const x=as(this,g,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(m,"tooltip",f,y,l,void 0),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:n,value:this.getAxisValueText(u,"tooltip",S,y,n,void 0)}]},{seriesId:t,datum:y,title:r,angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:p,...x})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n}=ir(this,!1,!1,Ws.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:s,strokeWidth:o,lineDash:a,lineDashOffset:n};return _N(r.fill)&&(r.fill={...r.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:r}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{angleKey:s,angleName:o,legendItemName:a,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i,label:{text:a??o??s},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!n}]}getDatumId(e){return RN(e.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};da.className="RadialBarSeries",da.type="radial-bar";import{_ModuleSupport as GN}from"ag-charts-community";import{boolean as Id,constant as VN,number as KN,required as Sr,string as rs}from"ag-charts-core";var{commonSeriesOptionsDefs:WN,radialBarSeriesThemeableOptionsDef:zN}=GN,$N={...WN,...zN,type:Sr(VN("radial-bar")),angleKey:Sr(rs),radiusKey:Sr(rs),angleName:rs,radiusName:rs,legendItemName:rs,grouped:Id,stacked:Id,stackGroup:rs,normalizedTo:KN};import{_ModuleSupport as xr}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:HN},FILL_GRADIENT_CONIC_SERIES_DEFAULTS:XN,FILL_IMAGE_DEFAULTS:YN,FILL_PATTERN_DEFAULTS:UN}=xr,qN={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",XN],["image",YN],["pattern",UN]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...xr.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},highlight:xr.multiSeriesHighlightStyle()},axes:{[HN.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:Ad}=nN.ThemeConstants,rO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:e=>new da(e),defaultAxes:[{type:Ad.ANGLE_NUMBER},{type:Ad.RADIUS_CATEGORY}],themeTemplate:qN,stackable:!0,groupable:!0},Md={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:$N,create:e=>new da(e)};import{_ModuleSupport as jN}from"ag-charts-community";import{_ModuleSupport as JN}from"ag-charts-community";import{_ModuleSupport as ZN}from"ag-charts-community";var{Property:Nd}=ZN,br=class extends Ae{};h([Nd],br.prototype,"columnWidthRatio",2),h([Nd],br.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:QN,PolarAxis:e2,RadialColumnShape:t2,getRadialColumnWidth:i2}=JN,ua=class extends Kp{constructor(e){super(e,{animationResetFns:{item:LA}}),this.properties=new br}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new t2}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return NA(e)}isRadiusAxisCircle(){const e=this.axes[QN.Radius];return e instanceof e2?e.shape==="circle":!1}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),e.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(e.innerRadius=t.innerRadius,e.outerRadius=t.outerRadius,e.startAngle=t.startAngle,e.endAngle=t.endAngle,e.columnWidth=t.columnWidth,e.axisInnerRadius=t.axisInnerRadius,e.axisOuterRadius=t.axisOuterRadius)}getColumnWidth(e,t){const{columnWidthRatio:i=.5,maxColumnWidthRatio:s=.5}=this.properties;return i2(e,t,this.radius,i,s)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};ua.className="RadialColumnSeries",ua.type="radial-column";import{_ModuleSupport as s2}from"ag-charts-community";import{boolean as Ld,constant as o2,number as a2,required as vr,string as ls}from"ag-charts-core";var{commonSeriesOptionsDefs:n2,radialColumnSeriesThemeableOptionsDef:r2}=s2,l2={...n2,...r2,type:vr(o2("radial-column")),angleKey:vr(ls),radiusKey:vr(ls),angleName:ls,radiusName:ls,legendItemName:ls,grouped:Ld,stacked:Ld,stackGroup:ls,normalizedTo:a2};import{_ModuleSupport as kr}from"ag-charts-community";var{ThemeConstants:{POLAR_AXIS_TYPE:Td,POLAR_AXIS_SHAPE:Rd},FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:c2,FILL_IMAGE_DEFAULTS:h2,FILL_PATTERN_DEFAULTS:p2}=kr,d2={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",c2],["image",h2],["pattern",p2]]},stroke:{$palette:"stroke"},columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...kr.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:kr.multiSeriesHighlightStyle()},axes:{[Td.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:Rd.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[Td.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:Rd.CIRCLE},innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:Pd}=jN.ThemeConstants,gO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:e=>new ua(e),defaultAxes:[{type:Pd.ANGLE_CATEGORY},{type:Pd.RADIUS_NUMBER}],themeTemplate:d2,stackable:!0,groupable:!0},Cd={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:l2,create:e=>new ua(e)};import{_ModuleSupport as cs}from"ag-charts-community";import{_ModuleSupport as Ri}from"ag-charts-community";import{cachedTextMeasurer as u2,isArray as g2,measureTextSegments as m2,toPlainText as y2}from"ag-charts-core";import{_ModuleSupport as f2}from"ag-charts-community";var{SvgPath:S2,Rotatable:x2,Translatable:b2,Scalable:v2}=f2,Dr=class extends x2(v2(b2(S2))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};Dr.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";import{_ModuleSupport as ga}from"ag-charts-community";var{getColorStops:k2,normalizeAngle360:D2,normalizeAngle360Inclusive:I2,toDegrees:A2}=ga,{BaseProperties:zs,makeSeriesTooltip:M2,SeriesProperties:N2,PropertiesArray:Ir,AxisLabel:L2,Property:H,Label:T2}=ga,Od=class extends T2{};h([H],Od.prototype,"spacing",2);var qe=class extends zs{constructor(){super(...arguments),this.label=new Od}getStyle(){const{fill:e="black",fillOpacity:t=1,stroke:i="black",strokeWidth:s=0,strokeOpacity:o=1,lineDash:a=[0],lineDashOffset:n=0}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:o,lineDash:a,lineDashOffset:n}}};h([H],qe.prototype,"text",2),h([H],qe.prototype,"value",2),h([H],qe.prototype,"shape",2),h([H],qe.prototype,"placement",2),h([H],qe.prototype,"spacing",2),h([H],qe.prototype,"size",2),h([H],qe.prototype,"rotation",2),h([H],qe.prototype,"fill",2),h([H],qe.prototype,"fillOpacity",2),h([H],qe.prototype,"stroke",2),h([H],qe.prototype,"strokeWidth",2),h([H],qe.prototype,"strokeOpacity",2),h([H],qe.prototype,"lineDash",2),h([H],qe.prototype,"lineDashOffset",2),h([H],qe.prototype,"label",2);var Lt=class extends zs{constructor(){super(...arguments),this.enabled=!0,this.fills=new Ir(ga.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t){const{enabled:i,fill:s,fills:o,fillMode:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:p,lineDashOffset:d}=this;return{fill:i?s??Ed(o,a,e,t):"none",fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:p,lineDashOffset:d}}};h([H],Lt.prototype,"enabled",2),h([H],Lt.prototype,"fills",2),h([H],Lt.prototype,"fillMode",2),h([H],Lt.prototype,"fill",2),h([H],Lt.prototype,"fillOpacity",2),h([H],Lt.prototype,"stroke",2),h([H],Lt.prototype,"strokeWidth",2),h([H],Lt.prototype,"strokeOpacity",2),h([H],Lt.prototype,"lineDash",2),h([H],Lt.prototype,"lineDashOffset",2);var $s=class extends zs{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};h([H],$s.prototype,"values",2),h([H],$s.prototype,"step",2),h([H],$s.prototype,"minSpacing",2),h([H],$s.prototype,"maxSpacing",2);var R2=class extends L2{},st=class extends zs{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Ir(ga.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new $s,this.label=new R2}getStyle(e,t,i){const{fill:s,fills:o,defaultFill:a,fillMode:n,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:p,lineDash:d,lineDashOffset:u}=this;return{fill:s??(e&&o.length===0?a:void 0)??Ed(o,n,t,i),fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:p,lineDash:d,lineDashOffset:u}}};h([H],st.prototype,"min",2),h([H],st.prototype,"max",2),h([H],st.prototype,"fills",2),h([H],st.prototype,"fillMode",2),h([H],st.prototype,"fill",2),h([H],st.prototype,"fillOpacity",2),h([H],st.prototype,"stroke",2),h([H],st.prototype,"strokeWidth",2),h([H],st.prototype,"strokeOpacity",2),h([H],st.prototype,"lineDash",2),h([H],st.prototype,"lineDashOffset",2),h([H],st.prototype,"defaultFill",2),h([H],st.prototype,"interval",2),h([H],st.prototype,"label",2);var Tt=class extends zs{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};h([H],Tt.prototype,"enabled",2),h([H],Tt.prototype,"radiusRatio",2),h([H],Tt.prototype,"spacing",2),h([H],Tt.prototype,"fill",2),h([H],Tt.prototype,"fillOpacity",2),h([H],Tt.prototype,"stroke",2),h([H],Tt.prototype,"strokeWidth",2),h([H],Tt.prototype,"strokeOpacity",2),h([H],Tt.prototype,"lineDash",2),h([H],Tt.prototype,"lineDashOffset",2);var _d=class extends _t{};h([H],_d.prototype,"text",2);var wd=class extends As{};h([H],wd.prototype,"text",2);var Te=class extends N2{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new Os,this.defaultColorRange=[],this.targets=new Ir(qe),this.defaultTarget=new qe,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new st,this.bar=new Lt,this.needle=new Tt,this.label=new _d,this.secondaryLabel=new wd,this.tooltip=M2()}};h([H],Te.prototype,"value",2),h([H],Te.prototype,"startAngle",2),h([H],Te.prototype,"endAngle",2),h([H],Te.prototype,"segmentation",2),h([H],Te.prototype,"defaultColorRange",2),h([H],Te.prototype,"targets",2),h([H],Te.prototype,"defaultTarget",2),h([H],Te.prototype,"outerRadiusRatio",2),h([H],Te.prototype,"innerRadiusRatio",2),h([H],Te.prototype,"outerRadius",2),h([H],Te.prototype,"innerRadius",2),h([H],Te.prototype,"cornerRadius",2),h([H],Te.prototype,"cornerMode",2),h([H],Te.prototype,"spacing",2),h([H],Te.prototype,"scale",2),h([H],Te.prototype,"bar",2),h([H],Te.prototype,"needle",2),h([H],Te.prototype,"label",2),h([H],Te.prototype,"secondaryLabel",2),h([H],Te.prototype,"tooltip",2);function Ed(e,t,i,s){const{domain:o,range:a}=s,[n,r]=a,l=D2((n+r)/2+Math.PI),c=I2(r-n);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:k2(e,i,o,t).map(({color:d,stop:u})=>(u=Math.min(Math.max(u,0),1),u=(n+c*u-l)/(2*Math.PI),u=(u%1+1)%1,{stop:u,color:d})),bounds:"series",rotation:A2(l)+90}}import{_ModuleSupport as P2}from"ag-charts-community";import{toPlainText as Ar}from"ag-charts-core";var{SectorBox:Mr}=P2;function C2(e){const{startAngle:t,endAngle:i,clipStartAngle:s,clipEndAngle:o,innerRadius:a,outerRadius:n}=e;if(!(s==null||o==null))return new Mr(Math.max(s,t),Math.min(o,i),a,n)}function Fd(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function Nr(e){return e.clipStartAngle!=null&&e.clipEndAngle!=null}function Lr(e,t){const{clipStartAngle:i,clipEndAngle:s,innerRadius:o,outerRadius:a}=e;return new Mr(i,t?i:s,o,a)}function Bd(e,t){const i=e?"initial":"update";return{node:{fromFn(a,n){const r=a.previousDatum;let{startAngle:l,endAngle:c}=r??n;const p=r!=null&&Nr(r)?Lr(r,e):void 0,d=Nr(n)?Lr(n,e):void 0;let u;return p!=null&&d!=null?u=p:p==null&&d!=null?(u=d,l=n.startAngle,c=n.endAngle):p!=null&&d==null?(u=void 0,l=n.startAngle,c=n.endAngle):e&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(a,n){const{startAngle:r,endAngle:l}=n;let c;return Nr(n)&&(c=Lr(n,!1)),{startAngle:r,endAngle:l,clipSector:c}},applyFn(a,n){const{startAngle:r,endAngle:l}=n;let{clipSector:c}=n;c!=null&&(c=new Mr(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const p=c==null||Fd(r,l,c);a.startAngle=r,a.endAngle=l,a.clipSector=c,a.visible=p}},needle:{fromFn(a){let{angle:n}=a.previousDatum??a.datum;return e&&(n=t),{rotation:n,phase:i}},toFn(a,n){const{angle:r}=n;return{rotation:r}}}}}function Tr(e,t){const{startAngle:i,endAngle:s}=t,o=C2(t),a=o==null||Fd(i,s,o);return{startAngle:i,endAngle:s,clipSector:o,visible:a}}function Gd(e,t){const{angle:i}=t;return{rotation:i}}var O2={top:0,middle:.5,bottom:1};function _2(e,t,i,s,o,a){const{padding:n,textAlign:r,verticalAlign:l}=s;let c,p;if(i.each((k,A)=>{A.label==="primary"?c=A:A.label==="secondary"&&(p=A)}),c==null)return;const d=Cs(e.id,t,c,a?.label);if(d==null)return;const u=p==null?void 0:Cs(e.id,t,p,a?.secondaryLabel),m={padding:n},g=r==="center"?2:1,y=l==="middle"?2:1,f=k=>({width:Math.sqrt(Math.max(o**2-(k/y)**2,0))*g,height:Math.min(k,y*o),meta:null});let S,x,v;if(p!=null&&u!=null){const k=rc(Ar(d),c,Ar(u),p,m,f);S=k?.label,x=k?.secondaryLabel,v=k?.height??0}else{const k=Ds(Ar(d),c,m,f);S=k?.[0],x=void 0,v=k?.[0].height??0}const b=v*O2[l];i.each((k,A)=>{let I;if(A.label==="primary"?I=S:A.label==="secondary"&&(I=x),I==null){k.visible=!1;return}k.visible=!0,k.text=I.text,k.fontSize=I.fontSize,k.lineHeight=I.lineHeight,k.textAlign=r,k.textBaseline="middle";const D=A.label==="primary"?I.height/2:v-I.height/2;k.y=A.centerY+D-b,k.x=A.centerX})}var{fromToMotion:Hs,resetMotion:Vd,SeriesNodePickMode:Kd,StateMachine:w2,createDatumId:Rr,normalizeAngle360:E2,normalizeAngle360Inclusive:Wd,isBetweenAngles:ma,sectorBox:F2,toRadians:ya,BBox:B2,Group:ai,PointerEvents:fa,Selection:ni,Sector:G2,SectorBox:V2,Text:zd,Marker:K2,tickFormat:W2,applyShapeStyle:Sa,mergeDefaults:z2}=Ri,$2={inside:90,middle:0,outside:-90},H2=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],X2=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],xa=class extends Ri.Series{constructor(e){super({moduleCtx:e,pickModes:[Kd.EXACT_SHAPE_MATCH,Kd.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new Te,this.scale=new jr,this.scaleGroup=this.contentGroup.appendChild(new ai({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new ai({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new ai({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new ai({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new ai({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new ai({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new ai({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new ai({name:"tickGroup"})),this.scaleSelection=ni.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=ni.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=ni.select(this.itemNeedleGroup,Dr),this.targetSelection=ni.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=ni.select(this.itemTargetLabelGroup,zd),this.labelSelection=ni.select(this.itemLabelGroup,zd),this.highlightTargetSelection=ni.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=ni.select(this.tickGroup,Ri.TransformableText),this.datumUnion=new Eh,this.animationState=new w2("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=fa.None,this.tickGroup.pointerEvents=fa.None,this.itemNeedleGroup.pointerEvents=fa.None,this.itemLabelGroup.pointerEvents=fa.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new G2}markerFactory(){const e=new K2;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return Bh(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:s}=this.nodeDataDependencies,{scale:o,outerRadius:a}=this.properties,{min:n,max:r,label:l,interval:c}=o,p=ya(t.startAngle-90),d=ya(t.endAngle-90),m=Wd(d-p)>Math.PI,g=m||ma(1.5*Math.PI,p,d),y=m||ma(0*Math.PI,p,d),f=m||ma(.5*Math.PI,p,d),S=m||ma(1*Math.PI,p,d);let x;S&&!y?x="right":!S&&y?x="left":x="center";let v;g&&!f?v="bottom":!g&&f?v="top":v="middle";const b=F2({startAngle:p,endAngle:d,innerRadius:0,outerRadius:.5}),k=-(b.x+b.width/2)*2,A=-(b.y+b.height/2)*2,I=Math.min(i/b.width,s/b.height);e.domain=[n,r],e.range=[p,d],e.arcLength=I/2;const{maxSpacing:D,minSpacing:N}=c,{arcLength:R}=e,C=D?Math.floor(R/D):1,w=N?Math.floor(R/N):1/0,G=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),_=Math.max(C,Math.min(w,G)),E=c.values??e.ticks({nice:!1,interval:c.step,minTickCount:C,maxTickCount:w,tickCount:_})?.ticks??[],L=W2(E,typeof l.format=="string"?l.format:void 0),P=u2(l),T=E.map((W,K)=>{let z;if(l.formatter&&(z=Fn(this.ctx,l.formatter,{value:W,index:K,domain:e.domain,boundSeries:void 0})),z??(z=L?.(W)),z==null)return;const{width:$,height:Z}=g2(z)?m2(z,l):P.measureLines(z);return{index:K,value:W,text:z,width:$,height:Z}}).filter(W=>W!=null),M=T.reduce((W,K)=>Math.max(W,K.width),0),O=T.reduce((W,K)=>Math.max(W,K.height),0),B=l.enabled?Math.max(M,O)+l.spacing:0,F=Math.max(.5*I-B,0),V=a??F;return this.centerX=i/2+k*V,this.centerY=s/2+A*V,this.radius=V,this.textAlign=x,this.verticalAlign=v,T}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this,s=new B2(e-i,t-i,2*i,2*i);return{series:s,axis:s}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:s=t.text,value:o=t.value??0,shape:a=t.shape??"triangle",rotation:n=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:p=t.label.enabled,color:d=t.label.color??"black",fontStyle:u=t.label.fontStyle??"normal",fontWeight:m=t.label.fontWeight??"normal",fontSize:g=t.label.fontSize,fontFamily:y=t.label.fontFamily,spacing:f=t.label.spacing??0}=i.label;return{text:s,value:o,shape:a,placement:r,spacing:l,size:c,rotation:n,label:{enabled:p,color:d,fontStyle:u,fontWeight:m,fontSize:g,fontFamily:y,spacing:f},style:i.getStyle()}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:s,outerRadiusRatio:o}=i,{placement:a,spacing:n,size:r}=e,l=t*o,c=t*s;switch(a){case"inside":return Math.max(c-n-r/2,0);case"outside":return l+n+r/2;default:return(c+l)/2}}getTargetLabel(e){const{scale:t}=this,{value:i,size:s,placement:o,label:a}=e,{spacing:n,color:r,fontStyle:l,fontWeight:c,fontSize:p,fontFamily:d}=a,u=void 0,m=t.convert(i),g=Math.trunc(E2(m)/(Math.PI/2)),y=s/2+n;let f,S,x,v;switch(o){case"outside":({textAlign:f,textBaseline:S}=H2[g]),x=y*Math.cos(m),v=y*Math.sin(m);break;case"inside":({textAlign:f,textBaseline:S}=X2[g]),x=-y*Math.cos(m),v=-y*Math.sin(m);break;default:f="center",S="bottom",x=0,v=-y;break}return{offsetX:x,offsetY:v,fill:r,textAlign:f,textBaseline:S,fontStyle:l,fontWeight:c,fontSize:p,fontFamily:d,lineHeight:u}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:s,radius:o,centerX:a,centerY:n}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:p,cornerRadius:d,cornerMode:u,needle:m,bar:g,scale:y,label:f,secondaryLabel:S}=s,{outerRadius:x=o*c,innerRadius:v=o*l,defaultColorRange:b}=s,k=this.getTargets(),A=[],I=[],D=[],N=[],R=[],C=u==="item",w=i.convert(i.domain[0]),G=i.convert(r),_=Math.ceil(Wd(G-w)*o);let E=p.enabled?p.interval.getSegments(i,_):void 0;const L=g.getStyle(b,i),P=y.getStyle(g.enabled,b,i);if(E==null&&C){const T=Math.min(...i.domain),M=Math.max(...i.domain),O={value:r,segmentStart:T,segmentEnd:M},F=Math.min(d,(x-v)/2)/((v+x)/2);A.push({series:this,itemId:"value",datum:O,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:x,innerRadius:v,startAngle:w-F,endAngle:G+F,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:L}),R.push({series:this,itemId:"scale",datum:O,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:x,innerRadius:v,startAngle:i.range[0]-F,endAngle:i.range[1]+F,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:P})}else{E??(E=i.domain);for(let T=0;Tthis.formatLabel($.value)}=f;N.push({label:"primary",centerX:a,centerY:n,text:T,value:r,fill:M,fontSize:O,minimumFontSize:B,fontStyle:F,fontWeight:V,fontFamily:W,lineHeight:K,formatter:z})}if(!m.enabled&&S.enabled){const{text:T,color:M,fontSize:O,minimumFontSize:B,fontStyle:F,fontWeight:V,fontFamily:W,lineHeight:K,formatter:z}=S;N.push({label:"secondary",centerX:a,centerY:n,text:T,value:r,fill:M,fontSize:O,minimumFontSize:B,fontStyle:F,fontWeight:V,fontFamily:W,lineHeight:K,formatter:z})}if(m.enabled){let T=m.radiusRatio==null?v:o*m.radiusRatio;T=Math.max(T-m.spacing,0);const M=i.convert(r);D.push({centerX:a,centerY:n,radius:T,angle:M,series:this})}for(let T=0;TMath.max(...i.domain))continue;const K=this.getTargetRadius(M),z=i.convert(O),$=ya(M.rotation+$2[M.placement]);I.push({series:this,itemId:`target-${T}`,midPoint:{x:K*Math.cos(z)+a,y:K*Math.sin(z)+n},datum:{value:O},datumIndex:{type:1,index:T},type:1,value:O,text:B,centerX:a,centerY:n,shape:V,radius:K,angle:z,rotation:$,size:F,label:this.getTargetLabel(M),style:W})}return{itemId:t,nodeData:A,needleData:D,targetData:I,labelData:N,scaleData:R,tickData:e}}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e!=null&&e.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:s,targetSelection:o,targetLabelSelection:a,scaleSelection:n,highlightTargetSelection:r,tickSelection:l}=this,c=this.checkResize(e);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const p=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],m=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],y=this.contextNodeData?.tickData??[],f=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:n}),this.updateScaleNodes({scaleSelection:n}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:s}),this.updateNeedleNodes({needleSelection:s}),this.targetSelection=this.updateTargetSelection({targetData:m,targetSelection:o}),this.updateTargetStyles({targetSelection:o,isHighlight:!1}),this.updateTargetNodes({targetSelection:o}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:m,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:p,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:f==null?[]:[f],targetSelection:r}),this.updateTargetStyles({targetSelection:r,isHighlight:!0}),this.updateTargetNodes({targetSelection:r}),this.tickSelection=this.updateTickSelection({tickData:y,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Rr(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:s}=this,{segmentation:o}=s,a=o.spacing??0,n=i.animationManager.isSkipped(),r=this.getShapeFillBBox();t.each((l,c)=>{const{centerX:p,centerY:d,innerRadius:u,outerRadius:m,startCornerRadius:g,endCornerRadius:y}=c;l.centerX=p,l.centerY=d,l.innerRadius=u,l.outerRadius=m,l.pointerEvents=this.properties.bar.enabled?Ri.PointerEvents.All:Ri.PointerEvents.None,Sa(l,c.style,r),l.startOuterCornerRadius=g,l.startInnerCornerRadius=g,l.endOuterCornerRadius=y,l.endInnerCornerRadius=y,l.radialEdgeInset=(a+l.strokeWidth)/2,l.concentricEdgeInset=l.strokeWidth/2,(n||l.previousDatum==null)&&l.setProperties(Tr(l,c))}),this.datumUnion.update(t,this.itemGroup,Ri.Sector,(l,c,p)=>{l.clipSector??(l.clipSector=new V2(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),l.centerX=c.centerX,l.centerY=c.centerY,l.outerRadius=l.clipSector.outerRadius=c.outerRadius,l.innerRadius=l.clipSector.innerRadius=c.innerRadius,l.startAngle=l.clipSector.startAngle=c.startAngle,l.startInnerCornerRadius=c.startInnerCornerRadius,l.startOuterCornerRadius=c.startOuterCornerRadius,l.endAngle=p.endAngle,l.clipSector.endAngle=p.clipSector?.endAngle??p.endAngle,l.endInnerCornerRadius=p.endInnerCornerRadius,l.endOuterCornerRadius=p.endOuterCornerRadius,l.pointerEvents=Ri.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>Rr(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{segmentation:i}=this.properties,s=i.spacing??0,o=this.getShapeFillBBox();t.each((a,n)=>{const{centerX:r,centerY:l,innerRadius:c,outerRadius:p,startCornerRadius:d,endCornerRadius:u}=n;a.centerX=r,a.centerY=l,a.innerRadius=c,a.outerRadius=p,Sa(a,n.style,o),a.startOuterCornerRadius=d,a.startInnerCornerRadius=d,a.endOuterCornerRadius=u,a.endInnerCornerRadius=u,a.radialEdgeInset=(s+a.strokeWidth)/2,a.concentricEdgeInset=a.strokeWidth/2,a.setProperties(Tr(a,n))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>Rr(0))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:s,stroke:o,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((p,d)=>{const{centerX:u,centerY:m,radius:g}=d,y=g*2;p.d=Dr.defaultPathData,Sa(p,{fill:i,fillOpacity:s,stroke:o,strokeOpacity:a,strokeWidth:n/y,lineDash:r.map(f=>f/y),lineDashOffset:l/y}),p.translationX=u,p.translationY=m,p.scalingX=y,p.scalingY=y,c&&p.setProperties(Gd(p,d))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetStyles({targetSelection:e,isHighlight:t}){e.each((i,s)=>{s.style=this.getTargetStyle(t,s)})}updateTargetNodes({targetSelection:e}){e.each((t,i)=>{const{centerX:s,centerY:o,angle:a,radius:n,shape:r,size:l,rotation:c}=i;Sa(t,i.style),t.size=l,t.shape=r==="line"?Gh:r,t.translationX=s+n*Math.cos(a),t.translationY=o+n*Math.sin(a),t.rotation=a+c})}getTargetStyle(e,{datumIndex:t,style:i}){const s=this.getHighlightStyle(e,t);return z2(s,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,s)=>{const{centerX:o,centerY:a,radius:n,angle:r,text:l}=s,{offsetX:c,offsetY:p,fill:d,fontStyle:u,fontWeight:m,fontSize:g,fontFamily:y,textAlign:f,textBaseline:S}=s.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=o+n*Math.cos(r)+c,i.y=a+n*Math.sin(r)+p,i.text=l,i.fill=d,i.fontStyle=u,i.fontWeight=m,i.fontSize=g,i.fontFamily=y,i.textAlign=f,i.textBaseline=S})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>t.label)}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((s,o)=>{s.fill=o.fill,s.fontStyle=o.fontStyle,s.fontWeight=o.fontWeight,s.fontFamily=o.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.index)}updateTickNodes(e){const{scale:t,radius:i,centerX:s,centerY:o,properties:a}=this,{enabled:n,color:r,fontFamily:l,fontSize:c,fontStyle:p,fontWeight:d,spacing:u}=a.scale.label,m=ya(a.scale.label.rotation??0);e.tickSelection.each((g,y)=>{if(!n){g.visible=!1;return}g.visible=!0,g.text=y.text,g.fill=r,g.fontFamily=l,g.fontSize=c,g.fontStyle=p,g.fontWeight=d,g.textAlign="center",g.textBaseline="middle";const f=t.convert(y.value),{width:S,height:x}=y,v=Math.abs(i*Math.cos(f)),b=Math.abs(i*Math.sin(f)),k=Math.min(Math.max(Math.abs(i/Math.tan(f)),v-S/2),v+S/2),A=Math.min(Math.max(Math.abs(i*Math.tan(f)),b-x/2),b+x/2),I=Math.hypot(k,A),D=s+(I+u)*Math.cos(f),N=o+(I+u)*Math.sin(f);g.x=D,g.y=N,g.rotationCenterX=D,g.rotationCenterY=N,g.rotation=m})}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,radius:i,textAlign:s,verticalAlign:o}=this,{spacing:a,innerRadiusRatio:n}=this.properties;_2(this,this.ctx,t,{padding:a,textAlign:s,verticalAlign:o},i*n,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),Vd([this.datumSelection],Tr),Vd([this.needleSelection],Gd),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i,s,o,a;if(this.labelSelection.each((n,r)=>{n.opacity=1,r.label==="primary"?(i=n.previousDatum?.value??e.from??r.value,s=r.value):r.label==="secondary"&&(o=n.previousDatum?.value??e.from??r.value,a=r.value)}),!this.labelsHaveExplicitText())if(s==null||a==null)this.formatLabelText();else if(i===s&&o===a)this.formatLabelText({label:s,secondaryLabel:a});else{const n=`${this.id}_labels`;t.animate({id:n,groupId:"label",from:{label:i,secondaryLabel:o},to:{label:s,secondaryLabel:a},phase:e.phase??"update",onUpdate:r=>this.formatLabelText(r),onStop:()=>this.formatLabelText({label:s,secondaryLabel:a})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=Bd(!0,this.scale.range[0]);Hs(this.id,"node",e,[this.datumSelection],t,(s,o)=>o.itemId),Hs(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),Hs(this.id,"label",e,[this.labelSelection],Fh,(s,o)=>o.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=Bd(!1,this.scale.range[0]);Hs(this.id,"node",e,[this.datumSelection],t,(s,o)=>o.itemId),Hs(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return[Number.NaN,Number.NaN]}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:s}=i;let o,a,n;if(e.type===0?(o=i.value,a=i.label.text,n=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:o,text:a}=i.targets[e.index],n=this.ctx.localeManager.t("ariaLabelGaugeTarget")),o!=null)return this.formatTooltipWithContext(s,{data:[{label:a,fallbackLabel:n,value:this.formatLabel(o)}]},{seriesId:t,title:void 0,datum:void 0,value:o})}pickNodeClosestDatum(e){return Kh(this,e)}pickFocus(e){return Wh(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((i,s)=>{const o=Cs(this.id,this.ctx,s);o!=null&&t.push(y2(o))}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};xa.className="RadialGaugeSeries",xa.type="radial-gauge";var{FONT_SIZE_RATIO:Y2}=cs,kO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"radial-gauge",moduleFactory:e=>new xa(e),themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},cs.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",cs.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{...cs.LABEL_BOXING_DEFAULTS,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...cs.LABEL_BOXING_DEFAULTS,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Y2.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}}}}},$d={type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,options:cs.radialGaugeSeriesOptionsDef,create:e=>new xa(e)};import{_ModuleSupport as hs}from"ag-charts-community";import{_ModuleSupport as U2}from"ag-charts-community";import{Logger as q2,cachedTextMeasurer as j2,calcLineHeight as J2,toPlainText as Z2,wrapText as Pr}from"ag-charts-core";import{_ModuleSupport as Q2}from"ag-charts-community";import{clamp as eL}from"ag-charts-core";var{BBox:tL,Path:iL,Vec2:$e,SceneChangeDetection:ps}=Q2,Pi=class extends iL{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0,this.elbows=[]}computeBBox(){const e=Math.min(this.x1,this.x2),t=Math.max(this.x1,this.x2)-e,i=Math.min(this.y1,this.y2),s=Math.max(this.y1,this.y2)-i+this.height;return new tL(e,i,t,s)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.height-2*this.inset,s=i/2;let o=this.x1+t,a=this.y1+t;e.moveTo(o,a);for(const l of this.elbows)this.updatePathSection(o,a,l.x,l.y,i,-s),o=l.x,a=l.y;const n=this.x2-t,r=this.y2+t;this.updatePathSection(o,a,n,r,i,-s),e.lineTo(n,r+i),o=n,a=r;for(const l of this.elbows.toReversed())this.updatePathSection(o,a,l.x,l.y,i,s),o=l.x,a=l.y;this.updatePathSection(o,a,this.x1+t,this.y1+t,i,s),e.closePath()}updatePathSection(e,t,i,s,o,a){const{path:n}=this,r=$e.from(e,t+a+o/2),l=$e.from(i,s+a+o/2);if(Math.abs(l.y-r.y)<2){n.lineTo(l.x,l.y);return}let c=$e.angle($e.sub(l,r));c<0&&(c=2*Math.PI+c);const p=0,d=Math.PI/2,u=Math.PI,m=Math.PI*1.5,g=Hd(r,l,0),y=Hd(r,l,o);if(g.radius=m?(n.arc(r.x,t-g.radius,g.radius,d,d+y.angle,!0),n.arc(l.x,s+y.radius,y.radius,m+y.angle,m),n.lineTo(l.x,l.y)):c>p&&c<=d?(n.arc(r.x,t+y.radius,y.radius,m,m+y.angle),n.arc(l.x,s-g.radius,g.radius,d+g.angle,d,!0),n.lineTo(l.x,l.y)):c>d&&c<=u?(n.arc(r.x,t+y.radius,y.radius-o,m,m+y.angle,!0),n.arc(l.x,s-g.radius,g.radius+o,d+g.angle,d),n.lineTo(l.x,l.y)):(n.arc(r.x,t-g.radius,g.radius+o,d,d+g.angle),n.arc(l.x,s+y.radius,y.radius-o,m+y.angle,m,!0),n.lineTo(l.x,l.y))}};h([ps()],Pi.prototype,"x1",2),h([ps()],Pi.prototype,"x2",2),h([ps()],Pi.prototype,"y1",2),h([ps()],Pi.prototype,"y2",2),h([ps()],Pi.prototype,"height",2),h([ps()],Pi.prototype,"inset",2);function Hd(e,t,i){const s=$e.angle($e.sub(t,e)),o=$e.distance(e,t),a=$e.add(e,$e.rotate($e.from(o/2,0),s)),n=-1/$e.gradient(e,t),r=$e.intercept(a,n),l=sL(.1,.5,Math.PI/2-Math.abs($e.gradient(e,t))),c=$e.intersectAtX(n,r,e.x),p=Math.max(i,$e.distance(e,c)*l);return{angle:$e.angle($e.sub(c,e),$e.sub(c,a))/-(1.1-l),radius:p}}function sL(e,t,i){return eL(e,(t-e)*i+e,t)}import{_ModuleSupport as oL}from"ag-charts-community";var{BaseProperties:Xd,FillGradientDefaults:aL,FillPatternDefaults:nL,FillImageDefaults:rL,makeSeriesTooltip:lL,SeriesProperties:cL,Property:te,Label:hL}=oL,ba=class extends hL{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};h([te],ba.prototype,"spacing",2),h([te],ba.prototype,"placement",2),h([te],ba.prototype,"edgePlacement",2);var Ut=class extends Xd{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};h([te],Ut.prototype,"fill",2),h([te],Ut.prototype,"fillOpacity",2),h([te],Ut.prototype,"stroke",2),h([te],Ut.prototype,"strokeOpacity",2),h([te],Ut.prototype,"strokeWidth",2),h([te],Ut.prototype,"lineDash",2),h([te],Ut.prototype,"lineDashOffset",2),h([te],Ut.prototype,"itemStyler",2);var ot=class extends Xd{constructor(){super(...arguments),this.spacing=1,this.minSpacing=0,this.width=1,this.alignment="justify",this.verticalAlignment="center",this.sort="auto",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};h([te],ot.prototype,"spacing",2),h([te],ot.prototype,"minSpacing",2),h([te],ot.prototype,"width",2),h([te],ot.prototype,"alignment",2),h([te],ot.prototype,"verticalAlignment",2),h([te],ot.prototype,"sort",2),h([te],ot.prototype,"fill",2),h([te],ot.prototype,"fillOpacity",2),h([te],ot.prototype,"stroke",2),h([te],ot.prototype,"strokeOpacity",2),h([te],ot.prototype,"strokeWidth",2),h([te],ot.prototype,"lineDash",2),h([te],ot.prototype,"lineDashOffset",2),h([te],ot.prototype,"itemStyler",2);var Re=class extends cL{constructor(){super(),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new aL,this.fillPatternDefaults=new nL,this.fillImageDefaults=new rL,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new ba,this.link=new Ut,this.node=new ot,this.tooltip=lL(),this.highlightStyle.deprecated=!1}getStyle(e,t,i,s){const{fillOpacity:o,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l,fill:c=t[s%t.length],stroke:p=i[s%t.length]}=e?this.link:this.node;return{fill:c,fillOpacity:o,stroke:p,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}}};h([te],Re.prototype,"nodes",2),h([te],Re.prototype,"fromKey",2),h([te],Re.prototype,"toKey",2),h([te],Re.prototype,"idKey",2),h([te],Re.prototype,"idName",2),h([te],Re.prototype,"labelKey",2),h([te],Re.prototype,"labelName",2),h([te],Re.prototype,"sizeKey",2),h([te],Re.prototype,"sizeName",2),h([te],Re.prototype,"fillGradientDefaults",2),h([te],Re.prototype,"fillPatternDefaults",2),h([te],Re.prototype,"fillImageDefaults",2),h([te],Re.prototype,"defaultColorRange",2),h([te],Re.prototype,"defaultPatternFills",2),h([te],Re.prototype,"fills",2),h([te],Re.prototype,"strokes",2),h([te],Re.prototype,"label",2),h([te],Re.prototype,"link",2),h([te],Re.prototype,"node",2),h([te],Re.prototype,"tooltip",2);var{Transformable:pL,applyShapeStyle:Yd,SeriesNodePickMode:Ud,createDatumId:va,getShapeStyle:qd,getLabelStyles:dL,Rect:jd,BBox:Jd,mergeDefaults:ka}=U2,Da=class extends rh{constructor(e){super({moduleCtx:e,pickModes:[Ud.NEAREST_NODE,Ud.EXACT_SHAPE_MATCH]}),this.properties=new Re}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Pi}nodeFactory(){return new jd}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:s,toKey:o,sizeKey:a,labelKey:n,label:{spacing:r,placement:l,edgePlacement:c},node:{width:p,alignment:d}}=this.properties,u=L=>({...L,x:Number.NaN,y:Number.NaN,width:p,height:Number.NaN}),m=L=>({...L,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}),{nodeGraph:g,links:y,maxPathLength:f}=this.getNodeGraph(u,m,{includeCircularReferences:!1}),S=g;if(S.size===0)return;const x=[];for(let L=0;Lz+$.size,0),M.reduce((z,{link:$})=>z+$.size,0));if(T.length===0&&M.length===0||F===0){L.columnIndex=-1;continue}let V;switch(d){case"left":V=x[O];break;case"right":V=x[f-1-B];break;case"center":{if(T.length!==0)V=x[O];else if(M.length===0)V=x[0];else{const z=M.reduce(($,Z)=>Math.min($,Z.node.maxPathLengthBefore),f)-1;V=x[z]}break}case"justify":{V=M.length===0?x[f-1]:x[O];break}}P.size=F;const{label:W}=this.properties,K=W.enabled?this.getLabelText(P.label,P.datum,n,"label",[],this.properties.label,{datum:P.datum,value:P.label,fromKey:s,toKey:o,sizeKey:a,size:F}):void 0;P.label=Z2(K),V.nodes.push(L),V.size+=F,L.columnIndex=V.index}const v=j2(this.properties.label);let b=0,k=0;if(this.isLabelEnabled()){if(l==null&&c==null)b=(t-p)*(1-f/(f+1)),k=b;else if(c==="outside"||c==null){const L=(P,T)=>{const M=T;if(M.datum.label==null||M.datum.label==="")return P;let O=(t-p)/(f-1)-r;l==="center"&&c==null&&(O/=2);const B=Pr(M.datum.label,{maxWidth:O,maxHeight:M.datum.height,font:this.properties.label,textWrap:"never"});let{width:F}=v.measureLines(B);return l==="center"&&c==null&&(F/=2),Math.max(P,F)};(l!=="right"||c==="outside")&&(b=p+x[0].nodes.reduce(L,0)),(l!=="left"||c==="outside")&&(k=p+x.at(-1).nodes.reduce(L,0))}}const A=(t-p-b-k)/(f-1);for(let L=0;LL.columnIndex;O--){const B=T.link.size,F={ghost:!0,datum:{...L.datum,size:B,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:O-1,datum:{size:B}}}],linksAfter:[{node:{columnIndex:O+1,datum:{size:B}}}],link:T.link,columnIndex:L.columnIndex,size:L.datum.size,closestColumnDiff:P,fromNode:{y:M.datum.y},toNode:{y:0}};x[O].size+=B,x[O].nodes.push(F)}}}const I=x.toSorted((L,P)=>{const T=L.nodes.reduce((O,B)=>Math.max(O,B.datum.size),0);return P.nodes.reduce((O,B)=>Math.max(O,B.datum.size),0)-T}),D={};for(let L=0;L{if(M.node.columnIndex!==L.index-1)return T;const O=M.node.datum.size/x[M.node.columnIndex].size*D[M.node.columnIndex];return Math.max(T,O)},0),P.weight+=P.linksAfter.reduce((T,M)=>{if(M.node.columnIndex!==L.index+1)return T;const O=M.node.datum.size/x[M.node.columnIndex].size*D[M.node.columnIndex];return Math.max(T,O)},0)}L.nodes.sort((P,T)=>this.sortNodes(P,T))}const N=1,R=L=>x.reduce((P,{size:T,nodes:M})=>{const O=i-M.length*N,F=(1-(M.length-1)*L/O)/T;return Math.min(P,F)},1/0);let C=this.properties.node.spacing,w=R(C);for(;w<0&&C>this.properties.node.minSpacing;)C-=1,w=R(C);if(w<0){q2.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");return}for(const L of x){let P=0;for(const O of L.nodes){const B=i*O.datum.size*w;O.datum.height=Math.max(N,B),P+=B}const T=C*(L.nodes.length-1);let M=0;this.properties.node.verticalAlignment==="bottom"?M=i-P-T:this.properties.node.verticalAlignment==="center"&&(M=(i-P-T)/2);for(const O of L.nodes)O.datum.y=M,M+=i*O.datum.size*w+C,"ghost"in O&&O.ghost&&O.link.elbows.push({x:L.x,y:O.datum.y})}for(const{datum:L,linksBefore:P,linksAfter:T}of S.values()){let M=L.y;P.sort((B,F)=>this.sortNodes(B.node,F.node));for(const{link:B}of P)B.y2=M,M+=B.size*i*w;let O=L.y;T.sort((B,F)=>this.sortNodes(B.node,F.node,{invertColumnSort:!0}));for(const{link:B}of T)B.y1=O,O+=B.size*i*w}const G=[],_=[],{fontSize:E}=this.properties.label;for(const[L,P]of x.entries()){const T=L===0,M=L===x.length-1;let O=-1/0;P.nodes.sort((B,F)=>B.datum.y-F.datum.y);for(const B of P.nodes){if("ghost"in B&&B.ghost)continue;const{datum:F}=B;if(F.midPoint={x:F.x+F.width/2,y:F.y+F.height/2},G.push(F),F.label==null)continue;const V=F.y+F.height/2;let W;if(!T&&!M){const Q=J2(E),ie=V-Q,U=V+Q;let ce=t;for(const{datum:j}of S.values())j.x>F.x&&Math.max(j.y,ie)<=Math.min(j.y+j.height,U)&&(ce=Math.min(ce,j.x-r));const ae=ce-F.x-2*r;W=Pr(F.label,{maxWidth:ae,maxHeight:F.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(W==null||W===""){const Q=c==null&&(T||M)?r:r*2;W=Pr(F.label,{maxWidth:A-Q,maxHeight:F.height,font:this.properties.label,textWrap:"never"})}if(W==="")continue;const{height:K}=v.measureLines(W),z=V-K/2,$=V+K/2;let Z=F.x+F.width+r,q="left",Y=l;T&&c==null&&l==null&&(Y="left"),c==="outside"?(T&&(Y="left"),M&&(Y="right")):c==="inside"&&(T&&(Y="right"),M&&(Y="left")),Y==="left"?(Z=F.x-r,q="right"):Y==="center"&&(Z=F.x+F.width/2,q="center"),z>=O&&(_.push({x:Z,y:V,textAlign:q,text:W,size:F.size}),O=$)}}for(const L of y){const{fromNode:P,toNode:T,size:M}=L;L.height=Math.max(N,i*M*w),L.x1=P.x+p,L.x2=T.x,L.midPoint={x:(L.x1+L.x2)/2,y:(L.y1+L.y2)/2+L.height/2},G.push(L)}return{itemId:e,nodeData:G,labelData:_}}sortNodes(e,t,i){const{properties:s}=this;return s.node.sort==="ascending"?(e.datum.label??"").localeCompare(t.datum.label??""):s.node.sort==="descending"?(t.datum.label??"").localeCompare(e.datum.label??""):s.node.sort==="data"?0:e.columnIndext.columnIndex?i?.invertColumnSort?-1:1:e.weight===t.weight?e.datum.size-t.datum.size:e.closestColumnDifft.closestColumnDiff?-1:e.weight-t.weight}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((i,s)=>{const{x:o,y:a,textAlign:n,text:r}=s,c=dL(this,void 0,s,this.properties.label,!1,t),{color:p,fontStyle:d,fontWeight:u,fontSize:m,fontFamily:g}=c;i.visible=!0,i.x=o,i.y=a,i.text=r,i.fill=p,i.fontStyle=d,i.fontWeight=u,i.fontSize=m,i.fontFamily=g,i.textAlign=n,i.textBaseline="middle",i.setBoxing(c)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>va(t.type,t.id))}getNodeStyle(e,t,i){const{properties:s}=this,{fills:o,strokes:a,defaultColorRange:n,defaultPatternFills:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:p}=s,{itemStyler:d}=s.node,u=n[t%n.length].map(x=>({color:x})),m=r[t%r.length],g=this.getHighlightStyle(i,e.datumIndex),y=ka(g,s.getStyle(!1,o,a,t)),f=s.node.fill!=null;let S=qd(y,f?l:{...l.toJson(),colorStops:u},f?c:{...c.toJson(),fill:m,stroke:m},p);if(d!=null&&e.datumIndex!=null){const x=this.cachedDatumCallback(va(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const v=this.makeItemStylerParams(e,i,S);return this.callWithContext(d,v)});x&&(S=ka(x,S,{...l.toJson(),colorStops:u},{...c.toJson(),fill:m,stroke:m},p))}return S.opacity=1,S}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:s},o,a){const{id:n}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,o,t),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:n,datum:e,highlighted:o,highlightState:l,...a,size:i,label:s,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const{datumIndex:n}=a,r=this.getNodeStyle(a,n.index,i);o.x=a.x,o.y=a.y,o.width=Math.max(a.width,0),o.height=Math.max(a.height,0),Yd(o,r,s)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new Jd(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>va(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,s){const{id:o,properties:a}=this,{fills:n,strokes:r,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:p,fillPatternDefaults:d,fillImageDefaults:u}=a,{itemStyler:m}=a.link,g=l[i.index%l.length].map(b=>({color:b})),y=c[i.index%c.length],f=this.getHighlightStyle(s,e),S=ka(f,a.getStyle(!0,n,r,i.index)),x=a.link.fill!=null;let v=qd(S,x?p:{...p.toJson(),colorStops:g},x?d:{...d.toJson(),fill:y,stroke:y},u);if(m!=null&&e!=null){const b=this.cachedDatumCallback(va(e.index,"link",s?"highlight":"node"),()=>{const k=this.ctx.highlightManager?.getActiveHighlight(),A=this.getHighlightStateString(k,s,e);return this.callWithContext(m,{seriesId:o,datum:t,highlighted:s,highlightState:A,...v})});b&&(v=ka(b,v,{...p.toJson(),colorStops:g},{...d.toJson(),fill:y,stroke:y},u))}return v.opacity=1,v}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,s=this.getShapeFillBBox();t.each((o,a)=>{const n=a.fromNode.datumIndex,r=this.getLinkStyle(a,n,i);o.x1=a.x1,o.y1=a.y1,o.x2=a.x2,o.y2=a.y2,o.height=a.height,o.elbows=a.elbows,Yd(o,r,s),o.inset=o.strokeWidth/2})}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:s,properties:o,ctx:{formatManager:a}}=this,{fromKey:n,toKey:r,sizeKey:l,sizeName:c,tooltip:p}=o,d=this.contextNodeData?.nodeData.find(x=>x.datumIndex.type===e.type&&x.datumIndex.index===e.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,m=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,g=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:s?.dataSources.get(this.id)?.data[e.index],y=d.size;let f;if(d.type===0){const x=d.fromNode.datumIndex;f=this.getLinkStyle({datumIndex:e,datum:g},x,!1)}else f=this.getNodeStyle({datumIndex:e,datum:g},e.index,!1);const S=[];if(l!=null){const x=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:g,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});S.push({label:c,fallbackLabel:l,value:x??String(y)})}return this.formatTooltipWithContext(p,{title:m,symbol:this.legendItemSymbol(d.type,u,f),data:S},{seriesId:t,datum:g,title:m,fromKey:n,toKey:r,sizeKey:l,sizeName:c,size:y,...f})}computeFocusBounds(e){if(e instanceof jd){const{x:t,y:i,width:s,height:o}=e,a=new Jd(t,i,s,o);return pL.toCanvas(this.contentGroup,a)}return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};Da.className="SankeySeries",Da.type="sankey";import{_ModuleSupport as uL}from"ag-charts-community";import{arrayOf as Cr,color as Zd,constant as gL,fillGradientDefaults as mL,fillImageDefaults as yL,fillPatternDefaults as fL,required as Or,string as Ia,undocumented as Xs}from"ag-charts-core";var{commonSeriesOptionsDefs:SL,sankeySeriesThemeableOptionsDef:xL}=uL,ds={...xL,...SL,type:Or(gL("sankey")),fromKey:Or(Ia),toKey:Or(Ia),sizeKey:Ia,sizeName:Ia};ds.fillGradientDefaults=Xs(mL),ds.fillPatternDefaults=Xs(fL),ds.fillImageDefaults=Xs(yL),ds.defaultColorRange=Xs(Cr(Cr(Zd))),ds.defaultPatternFills=Xs(Cr(Zd));var PO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],solo:!0,identifier:"sankey",moduleFactory:e=>new Da(e),themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:hs.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:hs.FILL_PATTERN_DEFAULTS,fillImageDefaults:hs.FILL_IMAGE_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:hs.SAFE_FILLS_OPERATION,highlightStyle:{series:{dimOpacity:.2}},highlight:{...hs.singleSeriesHighlightStyle()},label:{...hs.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:{$if:[{$greaterThan:[{$path:"./minSpacing"},20]},{$path:"./minSpacing"},20]},minSpacing:0,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]}}},legend:{enabled:!1,toggleSeries:!1}}},Qd={type:"series",name:"sankey",chartType:"standalone",enterprise:!0,options:ds,create:e=>new Da(e)};import{_ModuleSupport as Ci}from"ag-charts-community";import{_ModuleSupport as Ys}from"ag-charts-community";import{toPlainText as eu}from"ag-charts-core";import{_ModuleSupport as bL}from"ag-charts-community";var{HierarchySeriesProperties:vL,HighlightStyle:kL,makeSeriesTooltip:DL,Property:Pe}=bL,ri=class extends kL{constructor(){super(!1),this.label=new _t,this.secondaryLabel=new _t}};h([Pe],ri.prototype,"fill",2),h([Pe],ri.prototype,"fillOpacity",2),h([Pe],ri.prototype,"stroke",2),h([Pe],ri.prototype,"strokeWidth",2),h([Pe],ri.prototype,"strokeOpacity",2),h([Pe],ri.prototype,"label",2),h([Pe],ri.prototype,"secondaryLabel",2);var at=class extends vL{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new ri,this.label=new _t,this.secondaryLabel=new As,this.tooltip=DL()}getStyle(e){const{fills:t,strokes:i,fillOpacity:s,strokeWidth:o,strokeOpacity:a}=this;return{fill:t[e%t.length],fillOpacity:s,stroke:i[e%i.length],strokeWidth:o,strokeOpacity:a,opacity:1}}};h([Pe],at.prototype,"sizeName",2),h([Pe],at.prototype,"labelKey",2),h([Pe],at.prototype,"secondaryLabelKey",2),h([Pe],at.prototype,"fillOpacity",2),h([Pe],at.prototype,"strokeWidth",2),h([Pe],at.prototype,"strokeOpacity",2),h([Pe],at.prototype,"cornerRadius",2),h([Pe],at.prototype,"sectorSpacing",2),h([Pe],at.prototype,"padding",2),h([Pe],at.prototype,"itemStyler",2),h([Pe],at.prototype,"highlightStyle",2),h([Pe],at.prototype,"label",2),h([Pe],at.prototype,"secondaryLabel",2),h([Pe],at.prototype,"tooltip",2);var{fromToMotion:IL,normalizeAngle360:AL,createDatumId:ML,PointerEvents:NL,Sector:tu,Group:Aa,ScalableGroup:LL,Selection:_r,TransformableText:wr,BBox:iu,applyShapeStyle:TL,mergeDefaults:su,formatValue:ou,getLabelStyles:RL}=Ys,PL=class extends Ys.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function au(e,t=0,i=2*Math.PI/e.sumSize){for(const s of e.children){const o=t+s.sumSize*i;s.startAngle=t,s.endAngle=o,au(s,t,i),t=o}}var Ma=class extends Ys.HierarchySeries{constructor(e){super(e),this.NodeClass=PL,this.properties=new at,this.scalingGroup=this.contentGroup.appendChild(new LL),this.sectorGroup=this.scalingGroup.appendChild(new Aa),this.sectorLabelGroup=this.scalingGroup.appendChild(new Aa),this.highlightSectorGroup=this.scalingGroup.appendChild(new Aa),this.datumSelection=_r.select(this.sectorGroup,tu),this.labelSelection=_r.select(this.sectorLabelGroup,Aa),this.highlightSelection=_r.select(this.highlightSectorGroup,tu),this.sectorLabelGroup.pointerEvents=NL.None}processData(){super.processData(),au(this.rootNode)}updateSelections(){const e=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(e==null?[]:[e],void 0,a=>this.getDatumId(a)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:t}=this;if(t==null||t.seriesRect==null)return;const s=Array.from(this.rootNode),o=a=>{a.append([new wr({tag:0}),new wr({tag:1})])};this.datumSelection.update(s,void 0,a=>this.getDatumId(a)),this.labelSelection.update(s,o,a=>this.getDatumId(a))}getItemStyle(e,t){const{properties:i,colorScale:s}=this,{itemStyler:o}=i,a=e.datumIndex?.[0]??0,n=t?i.highlightStyle:void 0,r=su(n,i.getStyle(a));!t&&e.colorValue!=null&&(r.fill=s.convert(e.colorValue));let l=r;if(o!=null&&e!=null){const c=this.cachedDatumCallback(ML(this.getDatumId(e),t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(e,t,l);return this.callWithContext(o,p)});c&&(l=su(c,l))}return l}makeItemStylerParams(e,t,i){const{id:s}=this,o=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(o,t,e.datumIndex),n=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:e.datum,depth:e.depth??0,highlighted:t,highlightState:a,...i,fill:n}}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(e==null||t==null)return;const{width:s,height:o}=e.seriesRect,{sectorSpacing:a=0,padding:n=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:p,labelKey:d,secondaryLabelKey:u,sizeKey:m,sizeName:g}=this.properties;this.contentGroup.translationX=s/2,this.contentGroup.translationY=o/2;const y=a*.5,f=Math.min(s,o)/2,S=f/(i+1),x=-Math.PI/2,v={series:new iu(-f,-f,2*f,2*f),axis:new iu(-f,-f,2*f,2*f)};this.rootNode?.walk(I=>{const{startAngle:D,endAngle:N}=I;if(I.depth!=null){const R=(D+N)/2+x,C=(I.depth+.5)*S;I.midPoint.x=Math.cos(R)*C,I.midPoint.y=Math.sin(R)*C}}),this.rootNode?.walk(I=>{const{datum:D,depth:N,startAngle:R,endAngle:C,parent:w,sumSize:G}=I;I.label=void 0,I.secondaryLabel=void 0,I.contentHeight=0;let _;if(D!=null&&N!=null&&d!=null){const se=D[d];_=this.getLabelText(se,D,d,"label",[],this.properties.label,{depth:N,datum:D,childrenKey:l,colorKey:c,colorName:p,labelKey:d,secondaryLabelKey:u,sizeKey:m,sizeName:g,value:se})}_===""&&(_=void 0);let E;if(D!=null&&N!=null&&u!=null){const se=D[u];E=this.getLabelText(se,D,u,"secondaryLabel",[],this.properties.secondaryLabel,{depth:N,datum:D,childrenKey:l,colorKey:c,colorName:p,labelKey:d,secondaryLabelKey:u,sizeKey:m,sizeName:g,value:se})}if(E===""&&(E=void 0),N==null)return;const L=N*S+y,P=(N+1)*S-y,T=L>y?y/L:y,M=P>y?y/P:y,O=R+T,F=C+T-O,V=R+M,K=C+M-V,z=se=>{if(N===0&&w?.sumSize===G)return{width:2*Math.sqrt(P**2-(se*.5)**2),height:se,meta:0};const le=se,ye=2*Math.sqrt(P**2-(L+le)**2),we=F=Pt?{width:rt,height:le,meta:1}:{width:Pt,height:bt,meta:2}},$=sn(eu(_),this.properties.label,eu(E),this.properties.secondaryLabel,{padding:n},z);if($==null)return;const{width:Z,height:q,meta:Y,label:Q,secondaryLabel:ie}=$,U=x+(R+C)/2,ce=Math.sin(U)>=0,ae=Math.cos(U)>=0,j=(ce?3:12)&(ae?6:9);let re;switch(Y){case 0:re=0;break;case 1:{const ue=P-(S-q)*.58,le=Math.sqrt((P-n)**2-(Z/2)**2);re=Math.min(ue,le);break}case 2:if(N===0){const se=q/(2*Math.tan(F*.5))+Z*.5,ue=Math.sqrt(P**2-(q*.5)**2)-Z*.5;re=(se+ue)*.5}else re=(L+P)*.5;break}if(Q!=null){const{fontStyle:se="normal",fontFamily:ue,fontWeight:le="normal",color:ye="black"}=this.properties.label;I.label={...Q,fontStyle:se,fontFamily:ue,fontWeight:le,color:ye,labelPlacement:Y,circleQuarter:j,radius:re,theta:U}}if(ie!=null){const{fontStyle:se="normal",fontFamily:ue,fontWeight:le="normal",color:ye="black"}=this.properties.secondaryLabel;I.secondaryLabel={...ie,fontStyle:se,fontFamily:ue,fontWeight:le,color:ye,labelPlacement:Y,circleQuarter:j,radius:re,theta:U}}I.contentHeight=$.height});const b=(I,D,N)=>{const{depth:R,startAngle:C,endAngle:w}=I;if(R==null){D.visible=!1;return}D.visible=!0;const G=this.getItemStyle(I,N),_=G.fill,E=G.strokeWidth,L=Ys.isGradientFill(_)&&_.bounds!=="item"?v:void 0;TL(D,G,L),D.centerX=0,D.centerY=0,D.innerRadius=R*S,D.outerRadius=(R+1)*S,D.startAngle=C+x,D.endAngle=w+x,D.inset=y+E*.5,D.cornerRadius=r};this.datumSelection.each((I,D)=>{b(D,I,!1)}),this.highlightSelection.each((I,D)=>{b(D,I,!0)});const k=(I,D,N,R)=>{const{depth:C,contentHeight:w}=I,G=N===0,_=G?I.label:I.secondaryLabel;if(C==null||_==null){D.visible=!1;return}const{labelPlacement:E,circleQuarter:L,radius:P,theta:T}=_;let M;R&&(M=(G?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color);const O={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:I.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},B=G?this.properties.label:this.properties.secondaryLabel,F=this.ctx.highlightManager?.getActiveHighlight(),V=RL(this,I,O,B,R,F);switch(D.text=_.text,D.fontSize=_.fontSize,D.lineHeight=_.lineHeight,D.fontStyle=_.fontStyle,D.fontFamily=_.fontFamily,D.fontWeight=_.fontWeight,D.fill=M??_.color,D.fillOpacity=this.getHighlightStyle(R,I.datumIndex)?.opacity??1,D.setBoxing(V),E){case 0:D.textAlign="center",D.textBaseline="top",D.translationX=0,D.translationY=(G?0:w-_.height)-w*.5,D.rotation=0;break;case 1:{const W=(L&3)!==0,K=G===!W?P:P-(w-_.height);D.textAlign="center",D.textBaseline=W?"bottom":"top",D.translationX=Math.cos(T)*K,D.translationY=Math.sin(T)*K,D.rotation=W?T-Math.PI*.5:T+Math.PI*.5;break}case 2:{const W=(L&6)!==0,K=G===!W?(w-_.height)*.5:(_.height-w)*.5;D.textAlign="center",D.textBaseline="middle",D.translationX=Math.cos(T)*P+Math.cos(T+Math.PI/2)*K,D.translationY=Math.sin(T)*P+Math.sin(T+Math.PI/2)*K,D.rotation=W?T:T+Math.PI;break}}D.visible=!0},A=this.ctx.highlightManager?.getActiveHighlight();for(const I of this.labelSelection.selectByClass(wr)){const D=I.closestDatum();k(D,I,I.tag,D===A)}}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{labelKey:o,secondaryLabelKey:a,childrenKey:n,sizeKey:r,sizeName:l,colorKey:c,colorName:p,tooltip:d}=i,{formatManager:u}=s,m=e.reduce((A,I)=>A?.children[I],this.rootNode);if(m==null)return;const{datum:g,depth:y}=m;if(g==null||y==null)return;const f=[],S=r==null?void 0:g[r];if(S!=null){const A=[0,this.rootNode?.sumSize??0],I=u.format(this.callWithContext.bind(this),{type:"number",value:S,datum:g,seriesId:t,legendItemName:void 0,key:r,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:A,fractionDigits:void 0});f.push({label:l,fallbackLabel:r,value:I??ou(S)})}const x=c==null?void 0:g[c];if(x!=null){const{colorDomain:A}=this,I=u.format(this.callWithContext.bind(this),{type:"number",value:x,datum:g,seriesId:t,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:A,fractionDigits:void 0});f.push({label:p,fallbackLabel:c,value:I??ou(x)})}const v=this.getItemStyle({...m,colorValue:x??m.colorValue},!1),k={shape:"square",fill:v.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return Ys.isGradientFill(k.fill)&&(k.fill={...k.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:o==null?void 0:g[o],symbol:{marker:k},data:f},{seriesId:t,datum:g,title:void 0,depth:y,labelKey:o,secondaryLabelKey:a,childrenKey:n,sizeKey:r,sizeName:l,colorKey:c,colorName:p,...v})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}animateEmptyUpdateReady(){IL(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Ma.className="SunburstSeries",Ma.type="sunburst";import{_ModuleSupport as CL}from"ag-charts-community";import{constant as OL,required as _L,string as Oi}from"ag-charts-core";var{commonSeriesOptionsDefs:wL,sunburstSeriesThemeableOptionsDef:EL,without:FL}=CL,BL={...EL,...FL(wL,["highlightStyle","highlight","showInLegend"]),type:_L(OL("sunburst")),labelKey:Oi,secondaryLabelKey:Oi,childrenKey:Oi,sizeKey:Oi,colorKey:Oi,sizeName:Oi,colorName:Oi},{BASE_FONT_SIZE:nu,FONT_SIZE_RATIO:ru}=Ci,BO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"sunburst",moduleFactory:e=>new Ma(e),solo:!0,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Ci.FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS],["pattern",Ci.FILL_PATTERN_DEFAULTS],["image",Ci.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...Ci.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:ru.LARGE},minimumFontSize:{$rem:9/nu},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...Ci.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:ru.SMALLEST},minimumFontSize:{$rem:7/nu},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0,...Ci.LEGEND_CONTAINER_THEME}}},lu={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,options:BL,create:e=>new Ma(e)};import{_ModuleSupport as li}from"ag-charts-community";import{_ModuleSupport as Us}from"ag-charts-community";import{cachedTextMeasurer as GL,calcLineHeight as VL,isNumberEqual as KL,toPlainText as cu,wrapText as WL}from"ag-charts-core";import{_ModuleSupport as zL}from"ag-charts-community";var{BaseProperties:Na,HierarchySeriesProperties:$L,HighlightStyle:HL,makeSeriesTooltip:XL,Property:J,Label:YL}=zL,hu=class extends YL{constructor(){super(...arguments),this.spacing=0}};h([J],hu.prototype,"spacing",2);var xt=class extends Na{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new hu}};h([J],xt.prototype,"fill",2),h([J],xt.prototype,"fillOpacity",2),h([J],xt.prototype,"stroke",2),h([J],xt.prototype,"strokeWidth",2),h([J],xt.prototype,"strokeOpacity",2),h([J],xt.prototype,"cornerRadius",2),h([J],xt.prototype,"textAlign",2),h([J],xt.prototype,"gap",2),h([J],xt.prototype,"padding",2),h([J],xt.prototype,"interactive",2),h([J],xt.prototype,"label",2);var ut=class extends Na{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new _t,this.secondaryLabel=new As}};h([J],ut.prototype,"fill",2),h([J],ut.prototype,"fillOpacity",2),h([J],ut.prototype,"stroke",2),h([J],ut.prototype,"strokeWidth",2),h([J],ut.prototype,"strokeOpacity",2),h([J],ut.prototype,"cornerRadius",2),h([J],ut.prototype,"textAlign",2),h([J],ut.prototype,"verticalAlign",2),h([J],ut.prototype,"gap",2),h([J],ut.prototype,"padding",2),h([J],ut.prototype,"label",2),h([J],ut.prototype,"secondaryLabel",2);var _i=class extends Na{constructor(){super(...arguments),this.label=new _t}};h([J],_i.prototype,"fill",2),h([J],_i.prototype,"fillOpacity",2),h([J],_i.prototype,"stroke",2),h([J],_i.prototype,"strokeWidth",2),h([J],_i.prototype,"strokeOpacity",2),h([J],_i.prototype,"label",2);var ci=class extends Na{constructor(){super(...arguments),this.label=new _t,this.secondaryLabel=new As}};h([J],ci.prototype,"fill",2),h([J],ci.prototype,"fillOpacity",2),h([J],ci.prototype,"stroke",2),h([J],ci.prototype,"strokeWidth",2),h([J],ci.prototype,"strokeOpacity",2),h([J],ci.prototype,"label",2),h([J],ci.prototype,"secondaryLabel",2);var Er=class extends HL{constructor(){super(!1),this.group=new _i,this.tile=new ci}getStyle(e){return e?this.tile:this.group}};h([J],Er.prototype,"group",2),h([J],Er.prototype,"tile",2);var Rt=class extends $L{constructor(){super(...arguments),this.highlightStyle=new Er,this.tooltip=XL(),this.group=new xt,this.tile=new ut,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(e,t,i,s){const{fillOpacity:o,strokeWidth:a,strokeOpacity:n,fill:r=e?t[s%t.length]:t[Math.min(s,t.length)],stroke:l=e?i[s%t.length]:i[Math.min(s,i.length)]}=e?this.tile:this.group;return{fill:r,fillOpacity:o,stroke:l,strokeWidth:a,strokeOpacity:n,opacity:1}}};h([J],Rt.prototype,"sizeName",2),h([J],Rt.prototype,"labelKey",2),h([J],Rt.prototype,"secondaryLabelKey",2),h([J],Rt.prototype,"itemStyler",2),h([J],Rt.prototype,"highlightStyle",2),h([J],Rt.prototype,"tooltip",2),h([J],Rt.prototype,"group",2),h([J],Rt.prototype,"tile",2),h([J],Rt.prototype,"undocumentedGroupFills",2),h([J],Rt.prototype,"undocumentedGroupStrokes",2);var{createDatumId:UL,Rect:pu,Group:du,BBox:us,Selection:Fr,Text:Br,Transformable:qL,applyShapeStyle:jL,getLabelStyles:JL,mergeDefaults:uu,formatValue:gu}=Us,ZL=class extends Us.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function hi(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var mu={left:0,center:.5,right:1},QL={top:0,middle:.5,bottom:1},zO=class extends Us.Group{distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}},La=class extends Us.HierarchySeries{constructor(){super(...arguments),this.NodeClass=ZL,this.properties=new Rt,this.rectGroup=this.contentGroup.appendChild(new du),this.datumSelection=Fr.select(this.rectGroup,pu),this.labelSelection=Fr.select(this.labelGroup,du),this.highlightSelection=Fr.select(this.rectGroup,pu)}groupTitleHeight(e,t){const{labelValue:i}=e,{label:s}=this.properties.group,o=3;if(i!=null){if(s.fontSize>t.width/o||s.fontSize>t.height/o)return;{const{height:a}=GL(s).measureLines(i);return Math.max(a,s.fontSize)}}}getNodePadding(e,t){if(e.parent==null)return{top:0,right:0,bottom:0,left:0};if(e.children.length===0){const{padding:n}=this.properties.tile;return{top:n,right:n,bottom:n,left:n}}const{label:{spacing:i},padding:s}=this.properties.group,o=this.groupTitleHeight(e,t),a=o==null?0:o+i;return{top:s+a,right:s,bottom:s,left:s}}sortChildren({children:e}){const t=Array.from(e,(s,o)=>o).filter(s=>hi(e[s])>0).sort((s,o)=>hi(e[o])-hi(e[s]));return{sortedChildrenIndices:t,childAt:s=>{const o=t[s];return e[o]}}}squarify(e,t){const{datum:i,children:s}=e;if(t.width<=0||t.height<=0){e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN;return}const o=i==null?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(e,t);e.parent==null?(e.bbox=void 0,e.padding=void 0,e.midPoint.x=Number.NaN,e.midPoint.y=Number.NaN):(e.bbox=t,e.padding=o,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:a,childAt:n}=this.sortChildren(e),r=a.every(k=>s[k].children.length===0),l=1,c=t.width-o.left-o.right,p=t.height-o.top-o.bottom;if(c<=0||p<=0)return;const d=a.length;let u=0,m=0,g=1/0,y=a.reduce((k,A)=>k+hi(s[A]),0);const f=new us(t.x+o.left,t.y+o.top,c,p),S=f.clone();let x=0;for(;x({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),a=o(e),n=o(t),r=["top","right","bottom","left"];for(const l of r)KL(a[l],n[l])||t.shrink(s,l)}createNodeData(){}getItemStyle(e,t,i){const{properties:s,colorScale:o}=this,{itemStyler:a}=s,n=e.datumIndex?.[0]??0,r=t?s.fills:s.undocumentedGroupFills,l=t?s.strokes:s.undocumentedGroupStrokes,c=t?n:e.depth??-1,p=i?s.highlightStyle.getStyle(t):void 0,d=uu(p,s.getStyle(t,r,l,c));!i&&t&&e.colorValue!=null&&(d.fill=o.convert(e.colorValue));let u=d;if(a!=null&&e!=null){const m=this.cachedDatumCallback(UL(this.getDatumId(e),i?"highlight":"node"),()=>{const g=this.makeItemStylerParams(e,i,u);return this.callWithContext(a,g)});m&&(u=uu(m,u))}return u}makeItemStylerParams(e,t,i){const{id:s}=this,o=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(o,t,e.datumIndex),n=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:s,datum:e.datum,depth:e.depth??-1,highlighted:t,highlightState:a,...i,fill:n}}updateSelections(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e!=null&&!this.properties.group.interactive&&e.children.length!==0&&(e=void 0),this.highlightSelection.update(e==null?[]:[e],void 0,o=>this.getDatumId(o)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode),s=o=>{o.append([new Br({tag:0}),new Br({tag:1})])};this.datumSelection.update(i,void 0,o=>this.getDatumId(o)),this.labelSelection.update(i,s,o=>this.getDatumId(o))}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:s,colorName:o,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,highlightStyle:c,tile:p,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!t)return;this.rootNode?.walk(v=>{const{datum:b,depth:k,children:A}=v,I=A.length===0,D=I?p.label:d.label;let N;if(D.enabled&&b!=null&&k!=null&&a!=null){const C=b[a];N=this.getLabelText(C,b,a,"label",[],D,{depth:k,datum:b,childrenKey:i,colorKey:s,colorName:o,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,value:C})}N===""&&(N=void 0);let R;if(p.secondaryLabel.enabled&&I&&b!=null&&k!=null&&n!=null){const C=b[n];R=this.getLabelText(C,b,n,"secondaryLabel",[],p.secondaryLabel,{depth:k,datum:b,childrenKey:i,colorKey:s,colorName:o,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,value:C})}R===""&&(R=void 0),v.labelValue=cu(N),v.secondaryLabelValue=cu(R)});const{width:m,height:g}=u;this.squarify(e,new us(0,0,m,g)),this.rootNode?.walk(v=>{const{bbox:b,children:k,labelValue:A,secondaryLabelValue:I}=v;if(v.label=void 0,v.secondaryLabel=void 0,b!=null)if(k.length===0){const D={width:b.width,height:b.height,meta:null},N=sn(A,this.properties.tile.label,I,this.properties.tile.secondaryLabel,{padding:p.padding},()=>D);if(N==null)return;const{height:R,label:C,secondaryLabel:w}=N,{textAlign:G,verticalAlign:_,padding:E}=p,L=mu[G]??.5,P=b.x+E+(b.width-2*E)*L,T=QL[_]??.5,M=b.y+E+R*.5+(b.height-2*E-R)*T;if(C!=null){const{fontStyle:O="normal",fontFamily:B,fontWeight:F="normal",color:V="black"}=this.properties.tile.label;v.label={text:C.text,fontSize:C.fontSize,lineHeight:C.lineHeight,fontStyle:O,fontFamily:B,fontWeight:F,color:V,textAlign:G,verticalAlign:"middle",x:P,y:M-(R-C.height)*.5}}if(w!=null){const{fontStyle:O="normal",fontFamily:B,fontWeight:F="normal",color:V="black"}=this.properties.tile.secondaryLabel;v.secondaryLabel={text:w.text,fontSize:w.fontSize,lineHeight:w.fontSize,fontStyle:O,fontFamily:B,fontWeight:F,color:V,textAlign:G,verticalAlign:"middle",x:P,y:M+(R-w.height)*.5}}}else{if(A==null)return;{const{padding:D,textAlign:N}=d,R=this.groupTitleHeight(v,b);if(R==null)return;const C=b.width-2*D,w=WL(A,{maxWidth:b.width-2*D,font:d.label,textWrap:"never"}),G=mu[N]??.5,{fontStyle:_="normal",fontFamily:E,fontWeight:L="normal",color:P="black"}=this.properties.group.label;v.label={text:w,fontSize:d.label.fontSize,lineHeight:VL(d.label.fontSize),fontStyle:_,fontFamily:E,fontWeight:L,color:P,textAlign:N,verticalAlign:"middle",x:b.x+D+C*G,y:b.y+D+R*.5}}}});const y={series:new us(0,0,m,g),axis:new us(0,0,m,g)},f=(v,b,k)=>{const{bbox:A}=v;if(A==null){b.visible=!1;return}const{depth:I=-1}=v,D=v.children.length===0,N=this.getItemStyle(v,D,k);b.crisp=!0,jL(b,N,y),b.cornerRadius=D?p.cornerRadius:d.cornerRadius,b.zIndex=[0,I,k?1:0];const R=v.parent?.children.every(G=>G.children.length===0),C=v.parent==null?void 0:v.parent.bbox,w=v.parent==null?void 0:v.parent.padding;R===!0&&C!=null&&w!=null?(b.clipBBox=A,b.x=C.x+w.left,b.y=C.y+w.top,b.width=C.width-(w.left+w.right),b.height=C.height-(w.top+w.bottom)):(b.clipBBox=void 0,b.x=A.x,b.y=A.y,b.width=A.width,b.height=A.height),b.visible=!0};this.datumSelection.each((v,b)=>f(b,v,!1)),this.highlightSelection.each((v,b)=>{f(b,v,!0)});const S=(v,b,k,A)=>{const I=v.children.length===0,D=k===0?v.label:v.secondaryLabel;if(D==null){b.visible=!1;return}const N=k===0?p.label:p.secondaryLabel;let R;if(A){const{tile:_,group:E}=c;R=_.secondaryLabel.color,I?k===0&&(R=_.label.color):R=E.label.color}const C={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:v.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},w=this.ctx.highlightManager?.getActiveHighlight(),G=JL(this,v,C,N,A,w);b.text=D.text,b.fontSize=D.fontSize,b.lineHeight=D.lineHeight,b.fontStyle=D.fontStyle,b.fontFamily=D.fontFamily,b.fontWeight=D.fontWeight,b.fill=R??D.color,b.fillOpacity=this.getHighlightStyle(A,v.datumIndex)?.opacity??1,b.textAlign=D.textAlign,b.textBaseline=D.verticalAlign,b.x=D.x,b.y=D.y,b.setBoxing(G),b.visible=!0,b.zIndex=1},x=this.ctx.highlightManager?.getActiveHighlight();for(const v of this.labelSelection.selectByClass(Br)){const b=v.closestDatum();S(b,v,v.tag,b===x)}}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);return t.sort((i,s)=>s.datumIndex.length-i.datumIndex.length),t}pickNodeClosestDatum(e){const t=this.pickNodesExactShape(e);return t.length!==0?{datum:t[0],distance:0}:this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}getTooltipContent(e){const{id:t,properties:i,ctx:s}=this,{formatManager:o}=s,{labelKey:a,secondaryLabelKey:n,childrenKey:r,sizeKey:l,sizeName:c,colorKey:p,colorName:d,tooltip:u}=i,m=e.reduce((N,R)=>N?.children[R],this.rootNode);if(m==null)return;const{datum:g,depth:y,children:f}=m;if(g==null||y==null)return;const S=f.length===0,x=[],v=l==null?void 0:g[l];if(v!=null){const N=[0,this.rootNode?.sumSize??0],R=o.format(this.callWithContext.bind(this),{type:"number",value:v,datum:g,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:N,fractionDigits:void 0});x.push({label:c,fallbackLabel:l,value:R??gu(v)})}const b=p==null?void 0:g[p];if(b!=null){const{colorDomain:N}=this,R=o.format(this.callWithContext.bind(this),{type:"number",value:b,datum:g,seriesId:t,legendItemName:void 0,key:p,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:N,fractionDigits:void 0});x.push({label:d,fallbackLabel:p,value:R??gu(b)})}const k=this.getItemStyle({...m,colorValue:b??m.colorValue},S,!1),I={shape:"square",fill:k.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};Us.isGradientFill(I.fill)&&(I.fill={...I.fill,gradient:"linear",rotation:0,reverse:!1});const D=S?{marker:I}:void 0;return this.formatTooltipWithContext(u,{title:a==null?void 0:g[a],symbol:D,data:x},{seriesId:t,datum:g,title:void 0,depth:y,labelKey:a,secondaryLabelKey:n,childrenKey:r,sizeKey:l,sizeName:c,colorKey:p,colorName:d,...k})}computeFocusBounds(e){return qL.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};La.className="TreemapSeries",La.type="treemap";import{_ModuleSupport as eT}from"ag-charts-community";import{arrayOf as yu,color as fu,constant as tT,required as iT,string as wi,undocumented as Su}from"ag-charts-core";var{commonSeriesOptionsDefs:sT,treemapSeriesThemeableOptionsDef:oT,without:aT}=eT,Gr={...oT,...aT(sT,["highlightStyle","highlight","showInLegend"]),type:iT(tT("treemap")),labelKey:wi,secondaryLabelKey:wi,childrenKey:wi,sizeKey:wi,colorKey:wi,sizeName:wi,colorName:wi};Gr.undocumentedGroupFills=Su(yu(fu)),Gr.undocumentedGroupStrokes=Su(yu(fu));var{FONT_SIZE_RATIO:xu}=li,XO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"treemap",moduleFactory:e=>new La(e),solo:!0,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",li.FILL_GRADIENT_LINEAR_DEFAULTS],["pattern",li.FILL_PATTERN_DEFAULTS],["image",li.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...li.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{...li.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:xu.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...li.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:xu.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0,...li.LEGEND_CONTAINER_THEME}}},bu={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,options:Gr,create:e=>new La(e)},nT=Nu.ModuleRegistry,vu=[dl,Ya,tn,Nh,_h,nn,ln,Sn,vn,An],ku=[ul,gl,ml,yl,Up,fd,xd,Md,Cd],Du=[fl,ad,Qh,$d,lu,bu,uh,Qd],Iu=[bl,pp,up,Dp,Cp,_p],rT=[...vu,...ku,...Du,...Iu,tv,iv,sv];export{vu as AllCartesianEnterpriseModules,rT as AllEnterpriseModules,ku as AllPolarEnterpriseModules,Du as AllStandaloneEnterpriseModules,Iu as AllTopologyEnterpriseModules,gl as AngleCategoryAxisModule,ul as AngleNumberAxisModule,Ya as BoxPlotSeriesModule,tn as CandlestickSeriesModule,uh as ChordSeriesModule,Nh as ConeFunnelSeriesModule,_h as FunnelSeriesModule,nn as HeatmapSeriesModule,Qh as LinearGaugeSeriesModule,up as MapLineBackgroundSeriesModule,pp as MapLineSeriesModule,Dp as MapMarkerSeriesModule,_p as MapShapeBackgroundSeriesModule,Cp as MapShapeSeriesModule,nT as ModuleRegistry,Up as NightingaleSeriesModule,ln as OhlcSeriesModule,dl as OrdinalTimeAxisModule,ad as PyramidSeriesModule,fd as RadarAreaSeriesModule,xd as RadarLineSeriesModule,Md as RadialBarSeriesModule,Cd as RadialColumnSeriesModule,$d as RadialGaugeSeriesModule,yl as RadiusCategoryAxisModule,ml as RadiusNumberAxisModule,Sn as RangeAreaSeriesModule,vn as RangeBarSeriesModule,Qd as SankeySeriesModule,fl as StandaloneChartModule,lu as SunburstSeriesModule,bl as TopologyChartModule,bu as TreemapSeriesModule,An as WaterfallSeriesModule};
diff --git a/yuthon_report/static/src/lib/ag-chart/dist/package/main-modules.esm.mjs b/yuthon_report/static/src/lib/ag-chart/dist/package/main-modules.esm.mjs
new file mode 100644
index 000000000..1ecb1b23f
--- /dev/null
+++ b/yuthon_report/static/src/lib/ag-chart/dist/package/main-modules.esm.mjs
@@ -0,0 +1,26493 @@
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __decorateClass = (decorators, target, key, kind) => {
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
+ if (decorator = decorators[i])
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
+ if (kind && result)
+ __defProp(target, key, result);
+ return result;
+};
+
+// packages/ag-charts-enterprise/src/main-modules.ts
+import { _ModuleSupport as _ModuleSupport165 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/axes/axisModules.ts
+import { _ModuleSupport as _ModuleSupport13 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/axes/angle-category/angleCategoryAxis.ts
+import { _ModuleSupport as _ModuleSupport5 } from "ag-charts-community";
+import { isNumberEqual as isNumberEqual3 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/utils/polar.ts
+function loopSymmetrically(items, step, iterator) {
+ const loop = (start, end, loopStep, loopIterator) => {
+ let prev = items[0];
+ for (let i = start; loopStep > 0 ? i <= end : i > end; i += loopStep) {
+ const curr = items[i];
+ if (loopIterator(prev, curr))
+ return true;
+ prev = curr;
+ }
+ return false;
+ };
+ const midIndex = Math.floor(items.length / 2);
+ if (loop(step, midIndex, step, iterator))
+ return true;
+ return loop(items.length - step, midIndex, -step, iterator);
+}
+
+// packages/ag-charts-enterprise/src/axes/angle-number/angleAxisInterval.ts
+import { _ModuleSupport } from "ag-charts-community";
+var { AxisInterval, Property } = _ModuleSupport;
+var AngleAxisInterval = class extends AxisInterval {
+};
+__decorateClass([
+ Property
+], AngleAxisInterval.prototype, "minSpacing", 2);
+
+// packages/ag-charts-enterprise/src/axes/angle/angleAxis.ts
+import { _ModuleSupport as _ModuleSupport4 } from "ag-charts-community";
+import { countFractionDigits, isNumberEqual as isNumberEqual2, wrapTextOrSegments } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/angleCrossLine.ts
+import { _ModuleSupport as _ModuleSupport3 } from "ag-charts-community";
+import { isNumberEqual } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/polarCrossLine.ts
+import { _ModuleSupport as _ModuleSupport2 } from "ag-charts-community";
+import { createId } from "ag-charts-core";
+var { BaseProperties, ChartAxisDirection, Property: Property2, Group, FONT_SIZE } = _ModuleSupport2;
+var PolarCrossLineLabel = class extends BaseProperties {
+ constructor() {
+ super(...arguments);
+ this.fontSize = FONT_SIZE.LARGE;
+ this.fontFamily = "Verdana, sans-serif";
+ this.padding = 5;
+ this.color = "rgba(87, 87, 87, 1)";
+ }
+};
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "enabled", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "text", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontStyle", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontWeight", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontSize", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontFamily", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "padding", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "color", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "parallel", 2);
+var PolarCrossLine = class extends BaseProperties {
+ constructor() {
+ super(...arguments);
+ this.id = createId(this);
+ this.defaultColorRange = [];
+ this.shape = "polygon";
+ this.label = new PolarCrossLineLabel();
+ this.scale = void 0;
+ this.clippedRange = [-Infinity, Infinity];
+ this.gridLength = 0;
+ this.sideFlag = -1;
+ this.parallelFlipRotation = 0;
+ this.regularFlipRotation = 0;
+ this.direction = ChartAxisDirection.Angle;
+ this.axisInnerRadius = 0;
+ this.axisOuterRadius = 0;
+ this.lineGroup = new Group({ name: this.id });
+ this.rangeGroup = new Group({ name: this.id });
+ this.labelGroup = new Group({ name: this.id });
+ this._isRange = void 0;
+ }
+ assignCrossLineGroup(isRange, crossLineRange) {
+ if (isRange !== this._isRange) {
+ if (isRange) {
+ this.rangeGroup.appendChild(crossLineRange);
+ } else {
+ this.lineGroup.appendChild(crossLineRange);
+ }
+ }
+ this._isRange = isRange;
+ }
+ setSectorNodeProps(node) {
+ node.fill = this.fill;
+ node.fillOpacity = this.fillOpacity ?? 1;
+ node.stroke = this.stroke;
+ node.strokeOpacity = this.strokeOpacity ?? 1;
+ node.strokeWidth = this.strokeWidth ?? 1;
+ node.lineDash = this.lineDash;
+ }
+ setLabelNodeProps(node, x, y, baseline, rotation) {
+ const { label } = this;
+ node.x = x;
+ node.y = y;
+ node.text = label.text;
+ node.textAlign = "center";
+ node.textBaseline = baseline;
+ node.rotation = rotation;
+ node.rotationCenterX = x;
+ node.rotationCenterY = y;
+ node.fill = label.color;
+ node.fontFamily = label.fontFamily;
+ node.fontSize = label.fontSize;
+ node.fontStyle = label.fontStyle;
+ node.visible = true;
+ }
+};
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "enabled", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "type", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "range", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "value", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "fill", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "stroke", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "lineDash", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "shape", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "label", 2);
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/angleCrossLine.ts
+var {
+ ChartAxisDirection: ChartAxisDirection2,
+ getCrossLineValue,
+ validateCrossLineValue,
+ normalizeAngle360,
+ Group: Group2,
+ Path,
+ Sector,
+ RotatableText,
+ ContinuousScale
+} = _ModuleSupport3;
+var AngleCrossLine = class extends PolarCrossLine {
+ constructor() {
+ super();
+ this.direction = ChartAxisDirection2.Angle;
+ this.polygonNode = new Path();
+ this.sectorNode = new Sector();
+ this.lineNode = new Path();
+ this.crossLineRange = new Group2();
+ this.labelNode = new RotatableText();
+ this.ticks = [];
+ this.crossLineRange.append(this.polygonNode);
+ this.crossLineRange.append(this.sectorNode);
+ this.crossLineRange.append(this.lineNode);
+ this.labelGroup.append(this.labelNode);
+ }
+ visibilityCheck() {
+ if (!ContinuousScale.is(this.scale)) {
+ return true;
+ }
+ const [d0, d1] = this.scale.domain;
+ const value = getCrossLineValue(this);
+ if (this.type === "range") {
+ const [start, end] = value;
+ return start >= d0 && start <= d1 && end >= start && end <= d1;
+ } else {
+ return value >= d0 && value <= d1;
+ }
+ }
+ update(visible) {
+ const { scale } = this;
+ if (!scale || !validateCrossLineValue(this, scale) || !this.visibilityCheck()) {
+ this.rangeGroup.visible = false;
+ this.lineGroup.visible = false;
+ this.labelGroup.visible = false;
+ return;
+ }
+ this.rangeGroup.visible = visible;
+ this.lineGroup.visible = visible;
+ this.labelGroup.visible = visible;
+ this.updateLineNode(visible);
+ this.updatePolygonNode(visible);
+ this.updateSectorNode(visible);
+ this.updateLabelNode(visible);
+ }
+ updateLineNode(visible) {
+ const { scale, type, value, lineNode: line } = this;
+ if (!visible || type !== "line" || !scale) {
+ line.visible = false;
+ return;
+ }
+ const angle = scale.convert(value);
+ if (Number.isNaN(angle)) {
+ line.visible = false;
+ return;
+ }
+ const { axisInnerRadius, axisOuterRadius } = this;
+ line.visible = true;
+ line.stroke = this.stroke;
+ line.strokeOpacity = this.strokeOpacity ?? 1;
+ line.strokeWidth = this.strokeWidth ?? 1;
+ line.fill = void 0;
+ line.lineDash = this.lineDash;
+ const x = axisOuterRadius * Math.cos(angle);
+ const y = axisOuterRadius * Math.sin(angle);
+ const x0 = axisInnerRadius * Math.cos(angle);
+ const y0 = axisInnerRadius * Math.sin(angle);
+ line.path.clear(true);
+ line.path.moveTo(x0, y0);
+ line.path.lineTo(x, y);
+ this.assignCrossLineGroup(false, this.crossLineRange);
+ }
+ updatePolygonNode(visible) {
+ const { polygonNode: polygon, range: range2, scale, shape, type, ticks } = this;
+ if (!visible || type !== "range" || shape !== "polygon" || !scale || !range2) {
+ polygon.visible = false;
+ return;
+ }
+ const { axisInnerRadius, axisOuterRadius } = this;
+ const startIndex = ticks.indexOf(range2[0]);
+ const endIndex = ticks.indexOf(range2[1]);
+ const stops = startIndex <= endIndex ? ticks.slice(startIndex, endIndex + 1) : ticks.slice(startIndex).concat(ticks.slice(0, endIndex + 1));
+ const angles = stops.map((value) => scale.convert(value));
+ polygon.visible = true;
+ this.setSectorNodeProps(polygon);
+ const { path } = polygon;
+ path.clear(true);
+ for (const [index, angle] of angles.entries()) {
+ const x = axisOuterRadius * Math.cos(angle);
+ const y = axisOuterRadius * Math.sin(angle);
+ if (index === 0) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ }
+ if (axisInnerRadius === 0) {
+ path.lineTo(0, 0);
+ } else {
+ const reversedAngles = angles.slice().reverse();
+ for (const angle of reversedAngles) {
+ const x = axisInnerRadius * Math.cos(angle);
+ const y = axisInnerRadius * Math.sin(angle);
+ path.lineTo(x, y);
+ }
+ }
+ polygon.path.closePath();
+ this.assignCrossLineGroup(true, this.crossLineRange);
+ }
+ updateSectorNode(visible) {
+ const { sectorNode: sector, range: range2, scale, shape, type } = this;
+ if (!visible || type !== "range" || shape !== "circle" || !scale || !range2) {
+ sector.visible = false;
+ return;
+ }
+ const { axisInnerRadius, axisOuterRadius } = this;
+ const angles = range2.map((value) => scale.convert(value));
+ const step = scale.step ?? 0;
+ const padding = scale instanceof _ModuleSupport3.BandScale ? step / 2 : 0;
+ sector.visible = true;
+ this.setSectorNodeProps(sector);
+ sector.centerX = 0;
+ sector.centerY = 0;
+ sector.innerRadius = axisInnerRadius;
+ sector.outerRadius = axisOuterRadius;
+ sector.startAngle = angles[0] - padding;
+ sector.endAngle = angles[1] + padding;
+ this.assignCrossLineGroup(true, this.crossLineRange);
+ }
+ updateLabelNode(visible) {
+ const { label, labelNode: node, range: range2, scale, type, ticks } = this;
+ if (!visible || label.enabled === false || !label.text || !scale || type === "range" && !range2) {
+ node.visible = false;
+ return;
+ }
+ node.visible = true;
+ const { axisInnerRadius, axisOuterRadius } = this;
+ let labelX;
+ let labelY;
+ let rotation;
+ let textBaseline;
+ if (type === "line") {
+ const angle = normalizeAngle360(scale.convert(this.value));
+ const angle270 = 1.5 * Math.PI;
+ const isRightSide = isNumberEqual(angle, angle270) || angle > angle270 || angle < Math.PI / 2;
+ const midX = (axisInnerRadius + axisOuterRadius) / 2 * Math.cos(angle);
+ const midY = (axisInnerRadius + axisOuterRadius) / 2 * Math.sin(angle);
+ labelX = midX + label.padding * Math.cos(angle + Math.PI / 2);
+ labelY = midY + label.padding * Math.sin(angle + Math.PI / 2);
+ textBaseline = isRightSide ? "top" : "bottom";
+ rotation = isRightSide ? angle : angle - Math.PI;
+ } else {
+ const [startAngle, endAngle] = range2.map((value) => normalizeAngle360(scale.convert(value)));
+ let angle = (startAngle + endAngle) / 2;
+ if (startAngle > endAngle) {
+ angle -= Math.PI;
+ }
+ angle = normalizeAngle360(angle);
+ const isBottomSide = (isNumberEqual(angle, 0) || angle > 0) && angle < Math.PI;
+ let distance;
+ if (this.shape === "circle" || ticks.length < 3) {
+ distance = axisOuterRadius - label.padding;
+ } else {
+ distance = axisOuterRadius * Math.cos(Math.PI / ticks.length) - label.padding;
+ }
+ labelX = distance * Math.cos(angle);
+ labelY = distance * Math.sin(angle);
+ textBaseline = isBottomSide ? "bottom" : "top";
+ rotation = isBottomSide ? angle - Math.PI / 2 : angle + Math.PI / 2;
+ }
+ this.setLabelNodeProps(node, labelX, labelY, textBaseline, rotation);
+ }
+};
+AngleCrossLine.className = "AngleCrossLine";
+
+// packages/ag-charts-enterprise/src/axes/angle/angleAxis.ts
+var {
+ ChartAxisDirection: ChartAxisDirection3,
+ Property: Property3,
+ toRadians,
+ normalizeAngle360: normalizeAngle3602,
+ normalizeAngle360Inclusive,
+ Path: Path2,
+ RotatableText: RotatableText2,
+ Transformable,
+ BBox,
+ Selection,
+ Line
+} = _ModuleSupport4;
+var AngleAxisLabel = class extends _ModuleSupport4.AxisLabel {
+ constructor() {
+ super(...arguments);
+ this.orientation = "fixed";
+ }
+};
+__decorateClass([
+ Property3
+], AngleAxisLabel.prototype, "orientation", 2);
+var AngleAxis = class extends _ModuleSupport4.PolarAxis {
+ constructor(moduleCtx, scale) {
+ super(moduleCtx, scale);
+ this.startAngle = 0;
+ this.endAngle = void 0;
+ this.tickLineGroupSelection = Selection.select(
+ this.tickLineGroup,
+ Line,
+ false
+ );
+ this.gridLineGroupSelection = Selection.select(
+ this.gridLineGroup,
+ Line,
+ false
+ );
+ this.labelData = [];
+ this.tickData = [];
+ this.radiusLineGroup = this.axisGroup.appendChild(new _ModuleSupport4.TransformableGroup());
+ this.radiusLine = this.radiusLineGroup.appendChild(new Path2());
+ this.includeInvisibleDomains = true;
+ }
+ get direction() {
+ return ChartAxisDirection3.Angle;
+ }
+ createLabel() {
+ return new AngleAxisLabel();
+ }
+ calculateRotations() {
+ const rotation = toRadians(this.startAngle);
+ const parallelFlipRotation = normalizeAngle3602(rotation);
+ const regularFlipRotation = normalizeAngle3602(rotation - Math.PI / 2);
+ return { rotation, parallelFlipRotation, regularFlipRotation };
+ }
+ calculateTickLayout(domain) {
+ const { nice, scale } = this;
+ const ticksParams = {
+ nice,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ };
+ const niceDomain = nice ? scale.niceDomain(ticksParams, domain) : domain;
+ const tickData = this.generateAngleTicks(niceDomain);
+ this.tickData = tickData;
+ const ticks = tickData.map((t) => t.value);
+ const fractionDigits = ticks.reduce(
+ (f, t) => Math.max(typeof t === "number" ? countFractionDigits(t) : 0, f),
+ 0
+ );
+ return {
+ niceDomain,
+ tickDomain: niceDomain,
+ ticks,
+ rawTickCount: void 0,
+ fractionDigits,
+ timeInterval: void 0,
+ bbox: this.getBBox()
+ };
+ }
+ update() {
+ super.update();
+ this.updateRadiusLine();
+ this.updateGridLines();
+ this.updateTickLines();
+ }
+ normalizedAngles() {
+ const startAngle = normalizeAngle3602(-Math.PI / 2 + toRadians(this.startAngle));
+ const sweep = this.endAngle == null ? 2 * Math.PI : normalizeAngle360Inclusive(toRadians(this.endAngle) - toRadians(this.startAngle));
+ const endAngle = startAngle + sweep;
+ return [startAngle, endAngle];
+ }
+ computeRange() {
+ this.range = this.normalizedAngles();
+ }
+ updateSelections() {
+ const data = this.tickData;
+ this.gridLineGroupSelection.update(this.gridLength && this.gridLine.enabled ? data : []);
+ this.tickLineGroupSelection.update(this.tick.enabled ? data : []);
+ this.tickLabelGroupSelection.update(this.label.enabled ? data : []);
+ this.gridLineGroupSelection.cleanup();
+ this.tickLineGroupSelection.cleanup();
+ this.tickLabelGroupSelection.cleanup();
+ }
+ updatePosition() {
+ super.updatePosition();
+ const { translation, radiusLineGroup } = this;
+ const translationX = Math.floor(translation.x);
+ const translationY = Math.floor(translation.y);
+ radiusLineGroup.translationX = translationX;
+ radiusLineGroup.translationY = translationY;
+ }
+ updateRadiusLine() {
+ const node = this.radiusLine;
+ const { path } = node;
+ path.clear(true);
+ const { points, closePath } = this.getAxisLinePoints();
+ for (const { x, y, moveTo: moveTo2, arc, radius = 0, startAngle = 0, endAngle = 0 } of points) {
+ if (arc) {
+ path.arc(x, y, radius, startAngle, endAngle);
+ } else if (moveTo2) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ }
+ if (closePath) {
+ path.closePath();
+ }
+ node.visible = this.line.enabled;
+ node.stroke = this.line.stroke;
+ node.strokeWidth = this.line.width;
+ node.fill = void 0;
+ }
+ getAxisLinePoints() {
+ const { scale, shape, gridLength: radius } = this;
+ const [startAngle, endAngle] = this.range;
+ const isFullCircle = isNumberEqual2(endAngle - startAngle, 2 * Math.PI);
+ const points = [];
+ if (shape === "circle") {
+ if (isFullCircle) {
+ points.push(
+ { x: radius, y: 0, moveTo: true },
+ {
+ x: 0,
+ y: 0,
+ radius,
+ startAngle: 0,
+ endAngle: 2 * Math.PI,
+ arc: true,
+ moveTo: false
+ }
+ );
+ } else {
+ points.push(
+ {
+ x: radius * Math.cos(startAngle),
+ y: radius * Math.sin(startAngle),
+ moveTo: true
+ },
+ {
+ x: 0,
+ y: 0,
+ radius,
+ startAngle: normalizeAngle3602(startAngle),
+ endAngle: normalizeAngle3602(endAngle),
+ arc: true,
+ moveTo: false
+ }
+ );
+ }
+ } else if (shape === "polygon") {
+ const angles = scale.ticks({
+ nice: this.nice,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ })?.ticks?.map((value) => scale.convert(value));
+ if (angles && angles.length > 2) {
+ for (const [i, angle] of angles.entries()) {
+ const x = radius * Math.cos(angle);
+ const y = radius * Math.sin(angle);
+ const moveTo2 = i === 0;
+ points.push({ x, y, moveTo: moveTo2 });
+ }
+ }
+ }
+ return { points, closePath: isFullCircle };
+ }
+ updateGridLines() {
+ const {
+ scale,
+ gridLength: radius,
+ gridLine: { style, width },
+ innerRadiusRatio
+ } = this;
+ if (!(style && radius > 0)) {
+ return;
+ }
+ const innerRadius = radius * innerRadiusRatio;
+ const styleCount = style.length;
+ this.gridLineGroupSelection.each((line, datum, index) => {
+ const { value } = datum;
+ const { stroke, lineDash } = style[index % styleCount];
+ const angle = scale.convert(value);
+ line.x1 = innerRadius * Math.cos(angle);
+ line.y1 = innerRadius * Math.sin(angle);
+ line.x2 = radius * Math.cos(angle);
+ line.y2 = radius * Math.sin(angle);
+ line.stroke = stroke;
+ line.strokeWidth = width;
+ line.lineDash = lineDash;
+ line.fill = void 0;
+ });
+ this.gridLineGroupSelection.cleanup();
+ }
+ updateLabels() {
+ const { label, tickLabelGroupSelection } = this;
+ tickLabelGroupSelection.each((node, _, index) => {
+ const labelDatum = this.labelData[index];
+ if (!labelDatum || labelDatum.hidden) {
+ node.visible = false;
+ return;
+ }
+ node.text = labelDatum.text;
+ node.setFont(label);
+ node.fill = label.color;
+ node.x = labelDatum.x;
+ node.y = labelDatum.y;
+ node.setAlign(labelDatum);
+ node.setBoxing(label);
+ node.visible = true;
+ if (labelDatum.rotation) {
+ node.rotation = labelDatum.rotation;
+ node.rotationCenterX = labelDatum.x;
+ node.rotationCenterY = labelDatum.y;
+ } else {
+ node.rotation = 0;
+ }
+ });
+ }
+ updateTickLines() {
+ const { scale, gridLength: radius, tick, tickLineGroupSelection } = this;
+ tickLineGroupSelection.each((line, datum) => {
+ const { value } = datum;
+ const angle = scale.convert(value);
+ const cos = Math.cos(angle);
+ const sin = Math.sin(angle);
+ line.x1 = radius * cos;
+ line.y1 = radius * sin;
+ line.x2 = (radius + tick.size) * cos;
+ line.y2 = (radius + tick.size) * sin;
+ line.stroke = tick.stroke;
+ line.strokeWidth = tick.width;
+ });
+ }
+ createLabelNodeData(ticks, options, seriesRect) {
+ const { label, gridLength: radius, scale, tick } = this;
+ if (!label.enabled) {
+ return [];
+ }
+ const tempText = new RotatableText2();
+ const seriesLeft = seriesRect.x - this.translation.x;
+ const seriesRight = seriesRect.x + seriesRect.width - this.translation.x;
+ const { fractionDigits } = this.layout.label;
+ const axisTickFormatter = this.tickFormatter(this.scale.domain, this.tickData, false, fractionDigits);
+ const labelData = ticks.map((datum, index) => {
+ const { value } = datum;
+ const distance = radius + label.spacing + tick.size;
+ const angle = scale.convert(value);
+ const cos = Math.cos(angle);
+ const sin = Math.sin(angle);
+ const x = distance * cos;
+ const y = distance * sin;
+ const { textAlign, textBaseline } = this.getLabelAlign(angle);
+ const isLastTickOverFirst = index === ticks.length - 1 && value !== ticks[0] && isNumberEqual2(normalizeAngle3602(angle), normalizeAngle3602(scale.convert(ticks[0])));
+ const rotation = this.getLabelRotation(angle);
+ let text = axisTickFormatter(value, index);
+ tempText.text = text;
+ tempText.x = x;
+ tempText.y = y;
+ tempText.setFont(label);
+ tempText.textAlign = textAlign;
+ tempText.textBaseline = textBaseline;
+ tempText.rotation = rotation;
+ if (rotation) {
+ tempText.rotationCenterX = x;
+ tempText.rotationCenterY = y;
+ }
+ let box = rotation ? Transformable.toCanvas(tempText) : tempText.getBBox();
+ if (box && options.hideWhenNecessary && !rotation) {
+ const overflowLeft = seriesLeft - box.x;
+ const overflowRight = box.x + box.width - seriesRight;
+ const pixelError = 1;
+ if (overflowLeft > pixelError || overflowRight > pixelError) {
+ const availWidth = box.width - Math.max(overflowLeft, overflowRight);
+ const wrapOptions = { maxWidth: availWidth, font: label, textWrap: "never" };
+ text = wrapTextOrSegments(text, wrapOptions);
+ tempText.text = text;
+ box = tempText.getBBox();
+ }
+ }
+ return {
+ text,
+ x,
+ y,
+ textAlign,
+ textBaseline,
+ hidden: text === "" || (datum.hidden ?? isLastTickOverFirst),
+ rotation,
+ box
+ };
+ });
+ if (label.avoidCollisions) {
+ this.avoidLabelCollisions(labelData);
+ }
+ return labelData;
+ }
+ computeLabelsBBox(options, seriesRect) {
+ this.labelData = this.createLabelNodeData(this.tickData, options, seriesRect);
+ const textBoxes = this.labelData.map(({ box }) => box).filter((box) => box != null);
+ if (!this.label.enabled || textBoxes.length === 0) {
+ return null;
+ }
+ return BBox.merge(textBoxes);
+ }
+ getLabelOrientation() {
+ const { label } = this;
+ return label instanceof AngleAxisLabel ? label.orientation : "fixed";
+ }
+ getLabelRotation(tickAngle) {
+ let rotation = toRadians(this.label.rotation ?? 0);
+ tickAngle = normalizeAngle3602(tickAngle);
+ const orientation = this.getLabelOrientation();
+ if (orientation === "parallel") {
+ rotation += tickAngle;
+ if (tickAngle >= 0 && tickAngle < Math.PI) {
+ rotation -= Math.PI / 2;
+ } else {
+ rotation += Math.PI / 2;
+ }
+ } else if (orientation === "perpendicular") {
+ rotation += tickAngle;
+ if (tickAngle >= Math.PI / 2 && tickAngle < 1.5 * Math.PI) {
+ rotation += Math.PI;
+ }
+ }
+ return rotation;
+ }
+ getLabelAlign(tickAngle) {
+ const cos = Math.cos(tickAngle);
+ const sin = Math.sin(tickAngle);
+ let textAlign;
+ let textBaseline;
+ const orientation = this.getLabelOrientation();
+ const isCos0 = isNumberEqual2(cos, 0);
+ const isSin0 = isNumberEqual2(sin, 0);
+ const isCos1 = isNumberEqual2(cos, 1);
+ const isSinMinus1 = isNumberEqual2(sin, -1);
+ const isCosPositive = cos > 0 && !isCos0;
+ const isSinPositive = sin > 0 && !isSin0;
+ if (orientation === "parallel") {
+ textAlign = "center";
+ textBaseline = isCos1 && isSin0 || isSinPositive ? "top" : "bottom";
+ } else if (orientation === "perpendicular") {
+ textAlign = isSinMinus1 || isCosPositive ? "left" : "right";
+ textBaseline = "middle";
+ } else {
+ textAlign = "right";
+ if (isCos0) {
+ textAlign = "center";
+ } else if (isCosPositive) {
+ textAlign = "left";
+ }
+ textBaseline = "bottom";
+ if (isSin0) {
+ textBaseline = "middle";
+ } else if (isSinPositive) {
+ textBaseline = "top";
+ }
+ }
+ return { textAlign, textBaseline };
+ }
+ updateCrossLines() {
+ const { shape, gridLength: radius, innerRadiusRatio } = this;
+ for (const crossLine of this.crossLines) {
+ if (crossLine instanceof AngleCrossLine) {
+ crossLine.ticks = this.tickData.map((t) => t.value);
+ crossLine.shape = shape;
+ crossLine.axisOuterRadius = radius;
+ crossLine.axisInnerRadius = radius * innerRadiusRatio;
+ }
+ }
+ super.updateCrossLines();
+ }
+};
+AngleAxis.CrossLineConstructor = AngleCrossLine;
+__decorateClass([
+ Property3
+], AngleAxis.prototype, "startAngle", 2);
+__decorateClass([
+ Property3
+], AngleAxis.prototype, "endAngle", 2);
+
+// packages/ag-charts-enterprise/src/axes/angle-category/angleCategoryAxis.ts
+var { Property: Property4, CategoryScale } = _ModuleSupport5;
+var AngleCategoryAxis = class extends AngleAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new CategoryScale());
+ this.groupPaddingInner = 0;
+ this.paddingInner = 0;
+ this.interval = new AngleAxisInterval();
+ }
+ hasDefinedDomain() {
+ return false;
+ }
+ generateAngleTicks(domain) {
+ const { scale, gridLength: radius } = this;
+ const { values, minSpacing } = this.interval;
+ const tickParams = {
+ nice: this.nice,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ };
+ const ticks = values ?? scale.ticks(tickParams, domain)?.ticks ?? [];
+ if (ticks.length < 2 || minSpacing == null) {
+ return ticks.map((value) => {
+ return { value, visible: true };
+ });
+ }
+ const startTick = ticks[0];
+ const startAngle = scale.convert(startTick);
+ const startX = radius * Math.cos(startAngle);
+ const startY = radius * Math.sin(startAngle);
+ for (let step = 1; step < ticks.length - 1; step++) {
+ const nextTick = ticks[step];
+ const nextAngle = scale.convert(nextTick);
+ if (nextAngle - startAngle > Math.PI) {
+ break;
+ }
+ const nextX = radius * Math.cos(nextAngle);
+ const nextY = radius * Math.sin(nextAngle);
+ const spacing = Math.hypot(nextX - startX, nextY - startY);
+ if (spacing > minSpacing) {
+ const visibleTicks = /* @__PURE__ */ new Set([startTick]);
+ loopSymmetrically(ticks, step, (_, next) => {
+ visibleTicks.add(next);
+ });
+ return ticks.map((value) => {
+ const visible = visibleTicks.has(value);
+ return { value, visible };
+ });
+ }
+ }
+ return [{ value: startTick, visible: true }];
+ }
+ avoidLabelCollisions(labelData) {
+ const { minSpacing } = this.label;
+ if (labelData.length < 3)
+ return;
+ const labelsCollide = (prev, next) => {
+ if (prev.hidden || next.hidden) {
+ return false;
+ } else if (minSpacing == null) {
+ return prev.box.collidesBBox(next.box);
+ }
+ const prevBox = prev.box.clone().grow(minSpacing / 2);
+ const nextBox = next.box.clone().grow(minSpacing / 2);
+ return prevBox.collidesBBox(nextBox);
+ };
+ const firstLabel = labelData[0];
+ const lastLabel = labelData.at(-1);
+ const visibleLabels = /* @__PURE__ */ new Set([firstLabel]);
+ const lastLabelIsOverFirst = isNumberEqual3(firstLabel.x, lastLabel.x) && isNumberEqual3(firstLabel.y, lastLabel.y);
+ const maxStep = Math.floor(labelData.length / 2);
+ for (let step = 1; step <= maxStep; step++) {
+ const labels = lastLabelIsOverFirst ? labelData.slice(0, -1) : labelData;
+ const collisionDetected = loopSymmetrically(labels, step, labelsCollide);
+ if (!collisionDetected) {
+ loopSymmetrically(labels, step, (_, next) => {
+ visibleLabels.add(next);
+ });
+ break;
+ }
+ }
+ for (const datum of labelData) {
+ if (!visibleLabels.has(datum)) {
+ datum.hidden = true;
+ datum.box = void 0;
+ }
+ }
+ }
+ tickFormatParams() {
+ return { type: "category" };
+ }
+ datumFormatParams(value, params) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return { type: "category", value, datum, seriesId, legendItemName, key, source, property, domain, boundSeries };
+ }
+};
+AngleCategoryAxis.className = "AngleCategoryAxis";
+AngleCategoryAxis.type = "angle-category";
+__decorateClass([
+ Property4
+], AngleCategoryAxis.prototype, "groupPaddingInner", 2);
+__decorateClass([
+ Property4
+], AngleCategoryAxis.prototype, "paddingInner", 2);
+__decorateClass([
+ Property4
+], AngleCategoryAxis.prototype, "interval", 2);
+
+// packages/ag-charts-enterprise/src/axes/angle-number/angleNumberAxis.ts
+import { _ModuleSupport as _ModuleSupport7 } from "ag-charts-community";
+import { isNumberEqual as isNumberEqual5 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/axes/angle-number/linearAngleScale.ts
+import { _ModuleSupport as _ModuleSupport6 } from "ag-charts-community";
+import { isNumberEqual as isNumberEqual4 } from "ag-charts-core";
+var { range, isDenseInterval, LinearScale } = _ModuleSupport6;
+var LinearAngleScale = class _LinearAngleScale extends LinearScale {
+ constructor() {
+ super(...arguments);
+ this.arcLength = 0;
+ }
+ static getNiceStepAndTickCount(ticks, domain) {
+ const [start, stop] = domain;
+ let step = LinearScale.getTickStep(start, stop, ticks);
+ const maxTickCount = Number.isNaN(ticks.maxTickCount) ? Infinity : ticks.maxTickCount;
+ const expectedTickCount = Math.abs(stop - start) / step;
+ let niceTickCount = Math.pow(2, Math.ceil(Math.log(expectedTickCount) / Math.log(2)));
+ if (niceTickCount > maxTickCount) {
+ niceTickCount /= 2;
+ step *= 2;
+ }
+ return { count: niceTickCount, step };
+ }
+ ticks(ticks, domain = this.domain) {
+ const { arcLength } = this;
+ if (!domain || domain.length < 2 || domain.some((d) => !Number.isFinite(d)) || arcLength <= 0) {
+ return { ticks: [], count: 0 };
+ }
+ const { nice, interval } = ticks;
+ const [d0, d1] = domain;
+ if (interval) {
+ const step2 = Math.abs(interval);
+ const availableRange = this.getPixelRange();
+ if (!isDenseInterval((d1 - d0) / step2, availableRange)) {
+ return range(d0, d1, step2);
+ }
+ }
+ let step;
+ if (nice && this.hasNiceRange()) {
+ const linearNiceDomain = super.niceDomain(ticks, domain);
+ step = _LinearAngleScale.getNiceStepAndTickCount(ticks, linearNiceDomain).step;
+ } else {
+ step = LinearScale.getTickStep(d0, d1, ticks);
+ }
+ return range(d0, d1, step);
+ }
+ hasNiceRange() {
+ const sortedRange = this.range.slice().sort((a, b) => a - b);
+ const niceRanges = [Math.PI, 2 * Math.PI];
+ return niceRanges.some((r) => isNumberEqual4(r, sortedRange[1] - sortedRange[0]));
+ }
+ niceDomain(ticks, domain = this.domain) {
+ const linearNiceDomain = super.niceDomain(ticks, domain);
+ if (!this.hasNiceRange())
+ return linearNiceDomain;
+ const reversed = linearNiceDomain[0] > linearNiceDomain[1];
+ const start = reversed ? linearNiceDomain[1] : linearNiceDomain[0];
+ const { step, count } = _LinearAngleScale.getNiceStepAndTickCount(ticks, linearNiceDomain);
+ const s = 1 / step;
+ const stop = step >= 1 ? Math.ceil(start / step + count) * step : Math.ceil((start + count * step) * s) / s;
+ return reversed ? [stop, start] : [start, stop];
+ }
+ getPixelRange() {
+ return this.arcLength;
+ }
+};
+
+// packages/ag-charts-enterprise/src/axes/angle-number/angleNumberAxis.ts
+var { Property: Property5, angleBetween, normalisedExtentWithMetadata, findMinMax } = _ModuleSupport7;
+var AngleNumberAxis = class extends AngleAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new LinearAngleScale());
+ this.shape = "circle";
+ this.interval = new AngleAxisInterval();
+ }
+ hasDefinedDomain() {
+ const { min, max } = this;
+ return min != null && max != null && min < max;
+ }
+ normaliseDataDomain(d) {
+ const { min, max } = this;
+ const { extent: extent3, clipped } = normalisedExtentWithMetadata(d, min, max);
+ return { domain: extent3, clipped };
+ }
+ updateScale() {
+ super.updateScale();
+ this.scale.arcLength = this.getRangeArcLength();
+ }
+ getRangeArcLength() {
+ const { range: requestedRange } = this;
+ const min = Math.min(...requestedRange);
+ const max = Math.max(...requestedRange);
+ const rotation = angleBetween(min, max) || 2 * Math.PI;
+ const radius = this.gridLength;
+ return rotation * radius;
+ }
+ generateAngleTicks(domain) {
+ const { scale, range: requestedRange, nice } = this;
+ const { values, step, minSpacing, maxSpacing } = this.interval;
+ let rawTicks;
+ if (values == null) {
+ const { arcLength } = scale;
+ const minTickCount = maxSpacing ? Math.floor(arcLength / maxSpacing) : 1;
+ const maxTickCount = minSpacing ? Math.floor(arcLength / minSpacing) : Infinity;
+ const preferredTickCount = Math.floor(4 / Math.PI * Math.abs(requestedRange[0] - requestedRange[1]));
+ const tickCount = Math.max(minTickCount, Math.min(maxTickCount, preferredTickCount));
+ const tickParams = {
+ nice,
+ interval: step,
+ tickCount,
+ minTickCount,
+ maxTickCount
+ };
+ rawTicks = scale.ticks(tickParams, domain)?.ticks ?? [];
+ } else {
+ const [d0, d1] = findMinMax(domain.map(Number));
+ rawTicks = values.filter((value) => value >= d0 && value <= d1).sort((a, b) => a - b);
+ }
+ return rawTicks.map((value) => ({ value, visible: true }));
+ }
+ avoidLabelCollisions(labelData) {
+ const { minSpacing } = this.label;
+ const labelsCollide = (prev, next) => {
+ if (prev.hidden || next.hidden) {
+ return false;
+ } else if (minSpacing == null) {
+ return prev.box.collidesBBox(next.box);
+ }
+ const prevBox = prev.box.clone().grow(minSpacing / 2);
+ const nextBox = next.box.clone().grow(minSpacing / 2);
+ return prevBox.collidesBBox(nextBox);
+ };
+ const firstLabel = labelData[0];
+ const lastLabel = labelData.at(-1);
+ if (firstLabel !== lastLabel && isNumberEqual5(firstLabel.x, lastLabel.x) && isNumberEqual5(firstLabel.y, lastLabel.y)) {
+ lastLabel.hidden = true;
+ }
+ for (let step = 1; step < labelData.length; step *= 2) {
+ let collisionDetected = false;
+ for (let i = step; i < labelData.length; i += step) {
+ const next = labelData[i];
+ const prev = labelData[i - step];
+ if (labelsCollide(prev, next)) {
+ collisionDetected = true;
+ break;
+ }
+ }
+ if (!collisionDetected) {
+ for (const [i, datum] of labelData.entries()) {
+ if (i % step > 0) {
+ datum.hidden = true;
+ datum.box = void 0;
+ }
+ }
+ return;
+ }
+ }
+ for (const [i, datum] of labelData.entries()) {
+ if (i > 0) {
+ datum.hidden = true;
+ datum.box = void 0;
+ }
+ }
+ }
+ tickFormatParams(_domain, _ticks, fractionDigits) {
+ return { type: "number", fractionDigits };
+ }
+ datumFormatParams(value, params, fractionDigits) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return {
+ type: "number",
+ value,
+ datum,
+ seriesId,
+ legendItemName,
+ key,
+ source,
+ property,
+ domain,
+ boundSeries,
+ fractionDigits
+ };
+ }
+};
+AngleNumberAxis.className = "AngleNumberAxis";
+AngleNumberAxis.type = "angle-number";
+__decorateClass([
+ Property5
+], AngleNumberAxis.prototype, "min", 2);
+__decorateClass([
+ Property5
+], AngleNumberAxis.prototype, "max", 2);
+__decorateClass([
+ Property5
+], AngleNumberAxis.prototype, "interval", 2);
+
+// packages/ag-charts-enterprise/src/axes/ordinal/ordinalTimeAxis.ts
+import {
+ _ModuleSupport as _ModuleSupport8
+} from "ag-charts-community";
+var {
+ OrdinalTimeScale,
+ Property: Property6,
+ TimeAxisParentLevel,
+ lowestGranularityUnitForTicks,
+ lowestGranularityUnitForValue,
+ minimumTimeAxisDatumGranularity,
+ dateTruncationForDomain,
+ intervalUnit,
+ intervalStep,
+ intervalEpoch,
+ intervalMilliseconds
+} = _ModuleSupport8;
+var OrdinalTimeAxis = class extends _ModuleSupport8.DiscreteTimeAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new OrdinalTimeScale());
+ this.parentLevel = new TimeAxisParentLevel();
+ }
+ get primaryLabel() {
+ return this.parentLevel.enabled ? this.parentLevel.label : void 0;
+ }
+ get primaryTick() {
+ return this.parentLevel.enabled ? this.parentLevel.tick : void 0;
+ }
+ processData() {
+ super.processData();
+ const { boundSeries, direction } = this;
+ this.minimumTimeGranularity = minimumTimeAxisDatumGranularity(boundSeries, direction, void 0, void 0);
+ }
+ tickFormatParams(domain, ticks, _fractionDigits, timeInterval) {
+ timeInterval ?? (timeInterval = lowestGranularityUnitForTicks(ticks));
+ const truncateDate = dateTruncationForDomain(domain);
+ const unit = intervalUnit(timeInterval);
+ const step = intervalStep(timeInterval);
+ const epoch = intervalEpoch(timeInterval);
+ return { type: "date", unit, step, epoch, truncateDate };
+ }
+ datumFormatParams(value, params, _fractionDigits, timeInterval, style) {
+ if (typeof value === "number")
+ value = new Date(value);
+ if (timeInterval == null) {
+ const { minimumTimeGranularity } = this;
+ const datumGranularity = lowestGranularityUnitForValue(value);
+ if (minimumTimeGranularity != null && intervalMilliseconds(minimumTimeGranularity) < intervalMilliseconds(datumGranularity)) {
+ timeInterval = minimumTimeGranularity;
+ } else {
+ timeInterval = datumGranularity;
+ }
+ }
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ const unit = intervalUnit(timeInterval);
+ const step = intervalStep(timeInterval);
+ const epoch = intervalEpoch(timeInterval);
+ return {
+ type: "date",
+ value,
+ datum,
+ seriesId,
+ legendItemName,
+ key,
+ source,
+ property,
+ domain,
+ boundSeries,
+ unit,
+ step,
+ epoch,
+ style
+ };
+ }
+};
+OrdinalTimeAxis.className = "OrdinalTimeAxis";
+OrdinalTimeAxis.type = "ordinal-time";
+__decorateClass([
+ Property6
+], OrdinalTimeAxis.prototype, "parentLevel", 2);
+
+// packages/ag-charts-enterprise/src/axes/radius-category/radiusCategoryAxis.ts
+import { _ModuleSupport as _ModuleSupport11 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/axes/radius/radiusAxis.ts
+import { _ModuleSupport as _ModuleSupport10 } from "ag-charts-community";
+import { isNumberEqual as isNumberEqual7 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/radiusCrossLine.ts
+import { _ModuleSupport as _ModuleSupport9 } from "ag-charts-community";
+import { clamp, isNumberEqual as isNumberEqual6 } from "ag-charts-core";
+var {
+ ChartAxisDirection: ChartAxisDirection4,
+ Property: Property7,
+ validateCrossLineValue: validateCrossLineValue2,
+ normalizeAngle360FromDegrees,
+ Group: Group3,
+ Path: Path3,
+ Sector: Sector2,
+ RotatableText: RotatableText3
+} = _ModuleSupport9;
+var RadiusCrossLineLabel = class extends PolarCrossLineLabel {
+ constructor() {
+ super(...arguments);
+ this.positionAngle = void 0;
+ }
+};
+__decorateClass([
+ Property7
+], RadiusCrossLineLabel.prototype, "positionAngle", 2);
+var RadiusCrossLine = class extends PolarCrossLine {
+ constructor() {
+ super();
+ this.direction = ChartAxisDirection4.Radius;
+ this.label = new RadiusCrossLineLabel();
+ this.polygonNode = new Path3();
+ this.sectorNode = new Sector2();
+ this.crossLineRange = new Group3();
+ this.labelNode = new RotatableText3();
+ this.outerRadius = 0;
+ this.innerRadius = 0;
+ this.crossLineRange.append(this.polygonNode);
+ this.crossLineRange.append(this.sectorNode);
+ this.labelGroup.append(this.labelNode);
+ }
+ update(visible) {
+ const { scale } = this;
+ if (!scale || !validateCrossLineValue2(this, scale)) {
+ this.rangeGroup.visible = false;
+ this.lineGroup.visible = false;
+ this.labelGroup.visible = false;
+ return;
+ }
+ this.updateRadii();
+ const { innerRadius, outerRadius } = this;
+ visible && (visible = innerRadius >= this.axisInnerRadius && outerRadius <= this.axisOuterRadius);
+ this.rangeGroup.visible = visible;
+ this.lineGroup.visible = visible;
+ this.labelGroup.visible = visible;
+ this.updatePolygonNode(visible);
+ this.updateSectorNode(visible);
+ this.updateLabelNode(visible);
+ this.assignCrossLineGroup(this.type === "range", this.crossLineRange);
+ }
+ updateRadii() {
+ const { range: range2, scale, type, axisInnerRadius, axisOuterRadius } = this;
+ if (!scale)
+ return { innerRadius: 0, outerRadius: 0 };
+ const getRadius = (value) => axisOuterRadius + axisInnerRadius - value;
+ let outerRadius, innerRadius;
+ if (type === "line") {
+ outerRadius = getRadius(scale.convert(this.value));
+ innerRadius = outerRadius;
+ } else {
+ const bandwidth = Math.abs(scale?.bandwidth ?? 0);
+ const convertedRange = range2.map((r) => scale.convert(r));
+ outerRadius = getRadius(Math.max(...convertedRange));
+ innerRadius = getRadius(Math.min(...convertedRange)) + bandwidth;
+ }
+ this.outerRadius = outerRadius;
+ this.innerRadius = innerRadius;
+ }
+ drawPolygon(radius, angles, polygon) {
+ for (const [index, angle] of angles.entries()) {
+ const x = radius * Math.cos(angle);
+ const y = radius * Math.sin(angle);
+ if (index === 0) {
+ polygon.path.moveTo(x, y);
+ } else {
+ polygon.path.lineTo(x, y);
+ }
+ }
+ polygon.path.closePath();
+ }
+ updatePolygonNode(visible) {
+ const { gridAngles, polygonNode: polygon, scale, shape, type, innerRadius, outerRadius } = this;
+ if (!visible || shape !== "polygon" || !scale || !gridAngles) {
+ polygon.visible = false;
+ return;
+ }
+ polygon.visible = true;
+ const padding = this.getPadding();
+ polygon.path.clear(true);
+ this.drawPolygon(outerRadius - padding, gridAngles, polygon);
+ const reversedAngles = gridAngles.slice().reverse();
+ const innerPolygonRadius = type === "line" ? outerRadius - padding : innerRadius + padding;
+ this.drawPolygon(innerPolygonRadius, reversedAngles, polygon);
+ this.setSectorNodeProps(polygon);
+ }
+ updateSectorNode(visible) {
+ const { axisInnerRadius, axisOuterRadius, scale, sectorNode: sector, shape, innerRadius, outerRadius } = this;
+ if (!visible || shape !== "circle" || !scale) {
+ sector.visible = false;
+ return;
+ }
+ sector.visible = true;
+ sector.startAngle = 0;
+ sector.endAngle = 2 * Math.PI;
+ const padding = this.getPadding();
+ const r0 = clamp(axisInnerRadius, innerRadius + padding, axisOuterRadius);
+ const r1 = clamp(axisInnerRadius, outerRadius - padding, axisOuterRadius);
+ sector.innerRadius = Math.min(r0, r1);
+ sector.outerRadius = Math.max(r0, r1);
+ this.setSectorNodeProps(sector);
+ }
+ updateLabelNode(visible) {
+ const { innerRadius, label, labelNode: node, scale, shape, type } = this;
+ if (!visible || label.enabled === false || !label.text || !scale) {
+ node.visible = false;
+ return;
+ }
+ const angle = normalizeAngle360FromDegrees((label.positionAngle ?? 0) - 90);
+ const isBottomSide = (isNumberEqual6(angle, 0) || angle > 0) && angle < Math.PI;
+ const rotation = isBottomSide ? angle - Math.PI / 2 : angle + Math.PI / 2;
+ let distance;
+ const angles = this.gridAngles ?? [];
+ if (type === "line") {
+ distance = innerRadius + label.padding;
+ } else if (shape === "circle" || angles.length < 3) {
+ distance = innerRadius - label.padding;
+ } else {
+ distance = innerRadius * Math.cos(Math.PI / angles.length) - label.padding;
+ }
+ const labelX = distance * Math.cos(angle);
+ const labelY = distance * Math.sin(angle);
+ let textBaseline;
+ if (type === "line") {
+ textBaseline = isBottomSide ? "top" : "bottom";
+ } else {
+ textBaseline = isBottomSide ? "bottom" : "top";
+ }
+ this.setLabelNodeProps(node, labelX, labelY, textBaseline, rotation);
+ }
+ getPadding() {
+ const { scale } = this;
+ if (!scale)
+ return 0;
+ const bandwidth = Math.abs(scale.bandwidth ?? 0);
+ const step = Math.abs(scale.step ?? 0);
+ return scale instanceof _ModuleSupport9.BandScale ? (step - bandwidth) / 2 : 0;
+ }
+};
+RadiusCrossLine.className = "RadiusCrossLine";
+
+// packages/ag-charts-enterprise/src/axes/radius/radiusAxis.ts
+var {
+ ChartAxisDirection: ChartAxisDirection5,
+ ZIndexMap,
+ Property: Property8,
+ normalizeAngle360: normalizeAngle3603,
+ toRadians: toRadians2,
+ Caption,
+ Group: Group4,
+ TransformableGroup,
+ Path: Path4,
+ Line: Line2,
+ Selection: Selection2,
+ generateTicks,
+ AxisGroupZIndexMap
+} = _ModuleSupport10;
+var RadiusAxisLabel = class extends _ModuleSupport10.AxisLabel {
+ constructor() {
+ super(...arguments);
+ this.autoRotateAngle = 335;
+ }
+};
+__decorateClass([
+ Property8
+], RadiusAxisLabel.prototype, "autoRotate", 2);
+__decorateClass([
+ Property8
+], RadiusAxisLabel.prototype, "autoRotateAngle", 2);
+var RadiusAxis = class extends _ModuleSupport10.PolarAxis {
+ constructor(moduleCtx, scale) {
+ super(moduleCtx, scale);
+ this.positionAngle = 0;
+ this.gridLineGroupSelection = Selection2.select(
+ this.gridLineGroup,
+ Line2,
+ false
+ );
+ this.generatedTicks = void 0;
+ this.headingLabelGroup = this.axisGroup.appendChild(
+ new TransformableGroup({ name: `${this.id}-Axis-heading` })
+ );
+ this.lineNodeGroup = this.axisGroup.appendChild(
+ new TransformableGroup({ name: `${this.id}-Axis-line` })
+ );
+ this.lineNode = this.lineNodeGroup.appendChild(
+ new Line2({
+ name: `${this.id}-Axis-line`,
+ zIndex: AxisGroupZIndexMap.AxisLine
+ })
+ );
+ this.gridPathGroup = this.gridGroup.appendChild(
+ new Group4({
+ name: `${this.id}-gridPaths`,
+ zIndex: ZIndexMap.AXIS_GRID
+ })
+ );
+ this.gridPathSelection = Selection2.select(this.gridPathGroup, Path4);
+ this.headingLabelGroup.appendChild(this.title.caption.node);
+ this.cleanup.register(this.title.caption.registerInteraction(this.moduleCtx, "afterend"));
+ }
+ get direction() {
+ return ChartAxisDirection5.Radius;
+ }
+ getAxisTransform() {
+ const maxRadius = this.scale.range[0];
+ const { translation, positionAngle, innerRadiusRatio } = this;
+ const innerRadius = maxRadius * innerRadiusRatio;
+ const rotation = toRadians2(positionAngle);
+ return {
+ translationX: translation.x,
+ translationY: translation.y - maxRadius - innerRadius,
+ rotation,
+ rotationCenterX: 0,
+ rotationCenterY: maxRadius + innerRadius
+ };
+ }
+ update() {
+ super.update();
+ this.updateTitle();
+ this.updateGridLines();
+ const { enabled, stroke, width } = this.line;
+ this.lineNode.setProperties({
+ stroke,
+ strokeWidth: enabled ? width : 0,
+ x1: 0,
+ y1: this.range[0],
+ x2: 0,
+ y2: this.range[1]
+ });
+ }
+ updatePosition() {
+ super.updatePosition();
+ const axisTransform = this.getAxisTransform();
+ this.tickLineGroup.setProperties(axisTransform);
+ this.tickLabelGroup.setProperties(axisTransform);
+ this.lineNodeGroup.setProperties(axisTransform);
+ this.headingLabelGroup.setProperties(axisTransform);
+ }
+ calculateRotations() {
+ const rotation = 0;
+ const parallelFlipRotation = 0;
+ const regularFlipRotation = -Math.PI / 2;
+ return { rotation, parallelFlipRotation, regularFlipRotation };
+ }
+ calculateTickLayout(domain, niceMode, _visibleRange) {
+ const visibleRange = [0, 1];
+ const sideFlag = this.label.getSideFlag();
+ const labelX = sideFlag * (this.getTickSize() + this.label.spacing + this.seriesAreaPadding);
+ const { range: range2, reverse, defaultTickMinSpacing } = this;
+ const tickGenerationResult = generateTicks({
+ scale: this.scale,
+ label: this.label,
+ interval: this.interval,
+ tickFormatter: (...args) => this.tickFormatter(...args),
+ domain,
+ range: range2,
+ reverse,
+ niceMode,
+ visibleRange,
+ defaultTickMinSpacing,
+ labelOffset: labelX,
+ sideFlag,
+ axisRotation: 0,
+ sizeLimit: void 0,
+ primaryTickCount: void 0
+ });
+ const { tickData } = tickGenerationResult;
+ const { ticks, rawTicks, rawTickCount, tickDomain, fractionDigits, niceDomain = domain } = tickData;
+ const labels = ticks.map((d) => this.getTickLabelProps(d, tickGenerationResult));
+ this.generatedTicks = { ticks, labels };
+ return { ticks: rawTicks, tickDomain, niceDomain, rawTickCount, fractionDigits, timeInterval: void 0 };
+ }
+ updateSelections() {
+ const { generatedTicks } = this;
+ if (!generatedTicks)
+ return;
+ const { ticks, labels } = generatedTicks;
+ this.gridLineGroupSelection.update(this.gridLength ? ticks : []);
+ this.tickLabelGroupSelection.update(labels);
+ this.gridPathSelection.update(this.gridLine.enabled ? this.prepareGridPathTickData(ticks) : []);
+ this.gridLineGroupSelection.cleanup();
+ this.tickLabelGroupSelection.cleanup();
+ this.gridPathSelection.cleanup();
+ }
+ // TODO - abstract out
+ updateLabels() {
+ if (!this.label.enabled)
+ return;
+ const axisLabelPositionFn = _ModuleSupport10.resetAxisLabelSelectionFn();
+ this.tickLabelGroupSelection.each((node, datum) => {
+ node.fill = datum.color;
+ node.text = datum.text;
+ node.textBaseline = datum.textBaseline;
+ node.textAlign = datum.textAlign ?? "center";
+ node.setFont(datum);
+ node.setBoxing(datum);
+ node.setProperties(axisLabelPositionFn(node, datum));
+ });
+ }
+ updateGridLines() {
+ const {
+ gridLine: { style, width },
+ shape,
+ generatedTicks
+ } = this;
+ if (!style || !generatedTicks) {
+ return;
+ }
+ const styleCount = style.length;
+ const setStyle = (node, index) => {
+ const { stroke, lineDash } = style[index % styleCount];
+ node.stroke = stroke;
+ node.strokeWidth = width;
+ node.lineDash = lineDash;
+ node.fill = void 0;
+ };
+ const [startAngle, endAngle] = this.gridRange ?? [0, 2 * Math.PI];
+ const isFullCircle = isNumberEqual7(endAngle - startAngle, 2 * Math.PI);
+ const drawCircleShape = (node, value) => {
+ const { path } = node;
+ path.clear(true);
+ const radius = this.getTickRadius(value);
+ if (isFullCircle) {
+ path.moveTo(radius, 0);
+ path.arc(0, 0, radius, 0, 2 * Math.PI);
+ } else {
+ path.moveTo(radius * Math.cos(startAngle), radius * Math.sin(startAngle));
+ path.arc(0, 0, radius, normalizeAngle3603(startAngle), normalizeAngle3603(endAngle));
+ }
+ if (isFullCircle) {
+ path.closePath();
+ }
+ };
+ const drawPolygonShape = (node, value) => {
+ const { path } = node;
+ const angles = this.gridAngles;
+ path.clear(true);
+ if (!angles || angles.length < 3) {
+ return;
+ }
+ const radius = this.getTickRadius(value);
+ for (const [idx, angle] of angles.entries()) {
+ const x = radius * Math.cos(angle);
+ const y = radius * Math.sin(angle);
+ if (idx === 0) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ for (const [innerIdx, innerAngle] of angles.entries()) {
+ const x2 = radius * Math.cos(innerAngle);
+ const y2 = radius * Math.sin(innerAngle);
+ if (innerIdx === 0) {
+ path.moveTo(x2, y2);
+ } else {
+ path.lineTo(x2, y2);
+ }
+ }
+ path.closePath();
+ }
+ path.closePath();
+ };
+ const drawFn = shape === "circle" ? drawCircleShape : drawPolygonShape;
+ this.gridPathSelection.each((node, value, index) => {
+ setStyle(node, index);
+ drawFn(node, value);
+ });
+ }
+ updateTitle() {
+ const identityFormatter = (params) => params.defaultValue;
+ const { title, range: requestedRange } = this;
+ const { formatter = identityFormatter } = this.title;
+ title.caption.enabled = title.enabled;
+ title.caption.fontFamily = title.fontFamily;
+ title.caption.fontSize = title.fontSize;
+ title.caption.fontStyle = title.fontStyle;
+ title.caption.fontWeight = title.fontWeight;
+ title.caption.color = title.color;
+ title.caption.wrapping = title.wrapping;
+ let titleVisible = false;
+ const titleNode = title.caption.node;
+ if (title.enabled) {
+ titleVisible = true;
+ titleNode.rotation = Math.PI / 2;
+ titleNode.x = Math.floor((requestedRange[0] + requestedRange[1]) / 2);
+ titleNode.y = -Caption.SMALL_PADDING;
+ titleNode.textAlign = "center";
+ titleNode.textBaseline = "bottom";
+ titleNode.text = this.cachedCallWithContext(formatter, this.getTitleFormatterParams(this.scale.domain));
+ }
+ titleNode.visible = titleVisible;
+ }
+ updateCrossLines() {
+ for (const crossLine of this.crossLines) {
+ if (crossLine instanceof RadiusCrossLine) {
+ const { shape, gridAngles, range: range2, innerRadiusRatio } = this;
+ const radius = range2[0];
+ crossLine.shape = shape;
+ crossLine.gridAngles = gridAngles;
+ crossLine.axisOuterRadius = radius;
+ crossLine.axisInnerRadius = radius * innerRadiusRatio;
+ }
+ }
+ super.updateCrossLines();
+ }
+ createLabel() {
+ return new RadiusAxisLabel();
+ }
+ // TODO - abstract out (shared with cartesian axis)
+ getTickLabelProps(datum, tickGenerationResult) {
+ const { label } = this;
+ const { rotation, textBaseline, textAlign } = tickGenerationResult;
+ const range2 = this.scale.range;
+ const text = datum.tickLabel ?? "";
+ const sideFlag = label.getSideFlag();
+ const labelX = sideFlag * (this.getTickSize() + label.spacing + this.seriesAreaPadding);
+ const visible = text !== "" && text != null;
+ const combinedRotation = rotation;
+ return {
+ ...this.getLabelStyles({ value: datum.tick, formattedValue: datum.tickLabel }),
+ tickId: datum.tickId,
+ rotation: combinedRotation,
+ text,
+ textAlign,
+ textBaseline,
+ visible,
+ x: labelX,
+ y: datum.translation,
+ rotationCenterX: labelX,
+ rotationCenterY: datum.translation,
+ range: range2
+ };
+ }
+};
+RadiusAxis.CrossLineConstructor = RadiusCrossLine;
+__decorateClass([
+ Property8
+], RadiusAxis.prototype, "positionAngle", 2);
+
+// packages/ag-charts-enterprise/src/axes/radius-category/radiusCategoryAxis.ts
+var { ProxyPropertyOnWrite, Property: Property9, CategoryScale: CategoryScale2 } = _ModuleSupport11;
+var RadiusCategoryAxis = class extends RadiusAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new CategoryScale2());
+ this.shape = "circle";
+ this.groupPaddingInner = 0;
+ this.paddingInner = 0;
+ this.paddingOuter = 0;
+ }
+ hasDefinedDomain() {
+ return false;
+ }
+ normaliseDataDomain(domain) {
+ return { domain, clipped: false };
+ }
+ prepareGridPathTickData(data) {
+ return data.slice().reverse();
+ }
+ getTickRadius(tickDatum) {
+ const { scale, innerRadiusRatio } = this;
+ const maxRadius = scale.range[0];
+ const minRadius = maxRadius * innerRadiusRatio;
+ if (CategoryScale2.is(scale)) {
+ const ticks = scale.domain;
+ const index = ticks.length - 1 - ticks.indexOf(tickDatum.tick);
+ return index === 0 ? minRadius : scale.inset + scale.step * (index - 0.5) + scale.bandwidth / 2;
+ } else {
+ const tickRange = (maxRadius - minRadius) / scale.domain.length;
+ return maxRadius - tickDatum.translation + minRadius - tickRange / 2;
+ }
+ }
+ tickFormatParams() {
+ return { type: "category" };
+ }
+ datumFormatParams(value, params) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return { type: "category", value, datum, seriesId, legendItemName, key, source, property, domain, boundSeries };
+ }
+};
+RadiusCategoryAxis.className = "RadiusCategoryAxis";
+RadiusCategoryAxis.type = "radius-category";
+__decorateClass([
+ Property9
+], RadiusCategoryAxis.prototype, "groupPaddingInner", 2);
+__decorateClass([
+ ProxyPropertyOnWrite("scale", "paddingInner"),
+ Property9
+], RadiusCategoryAxis.prototype, "paddingInner", 2);
+__decorateClass([
+ ProxyPropertyOnWrite("scale", "paddingOuter"),
+ Property9
+], RadiusCategoryAxis.prototype, "paddingOuter", 2);
+
+// packages/ag-charts-enterprise/src/axes/radius-number/radiusNumberAxis.ts
+import { _ModuleSupport as _ModuleSupport12 } from "ag-charts-community";
+var { Property: Property10, normalisedExtentWithMetadata: normalisedExtentWithMetadata2, LinearScale: LinearScale2 } = _ModuleSupport12;
+var RadiusNumberAxis = class extends RadiusAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new LinearScale2());
+ this.shape = "polygon";
+ }
+ hasDefinedDomain() {
+ const { min, max } = this;
+ return min != null && max != null && min < max;
+ }
+ prepareGridPathTickData(data) {
+ const { scale } = this;
+ const domainTop = scale.domain[1];
+ return data.filter(({ tick }) => tick !== domainTop).sort((a, b) => b.tick - a.tick);
+ }
+ getTickRadius(tickDatum) {
+ const { scale } = this;
+ const maxRadius = scale.range[0];
+ const minRadius = maxRadius * this.innerRadiusRatio;
+ return maxRadius - tickDatum.translation + minRadius;
+ }
+ normaliseDataDomain(d) {
+ const { min, max } = this;
+ const { extent: extent3, clipped } = normalisedExtentWithMetadata2(d, min, max);
+ return { domain: extent3, clipped };
+ }
+ tickFormatParams(_domain, _ticks, fractionDigits) {
+ return { type: "number", fractionDigits };
+ }
+ datumFormatParams(value, params, fractionDigits) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return {
+ type: "number",
+ value,
+ datum,
+ seriesId,
+ legendItemName,
+ key,
+ source,
+ property,
+ domain,
+ boundSeries,
+ fractionDigits
+ };
+ }
+};
+RadiusNumberAxis.className = "RadiusNumberAxis";
+RadiusNumberAxis.type = "radius-number";
+__decorateClass([
+ Property10
+], RadiusNumberAxis.prototype, "min", 2);
+__decorateClass([
+ Property10
+], RadiusNumberAxis.prototype, "max", 2);
+
+// packages/ag-charts-enterprise/src/axes/axisModules.ts
+var {
+ ordinalTimeAxisOptionsDefs,
+ angleNumberAxisOptionsDefs,
+ angleCategoryAxisOptionsDefs,
+ radiusNumberAxisOptionsDefs,
+ radiusCategoryAxisOptionsDefs
+} = _ModuleSupport13;
+var OrdinalTimeAxisModule = {
+ type: "axis",
+ name: "ordinal-time",
+ chartType: "cartesian",
+ enterprise: true,
+ options: ordinalTimeAxisOptionsDefs,
+ create: (ctx) => new OrdinalTimeAxis(ctx)
+};
+var AngleNumberAxisModule = {
+ type: "axis",
+ name: "angle-number",
+ chartType: "polar",
+ enterprise: true,
+ options: angleNumberAxisOptionsDefs,
+ create: (ctx) => new AngleNumberAxis(ctx)
+};
+var AngleCategoryAxisModule = {
+ type: "axis",
+ name: "angle-category",
+ chartType: "polar",
+ enterprise: true,
+ options: angleCategoryAxisOptionsDefs,
+ create: (ctx) => new AngleCategoryAxis(ctx)
+};
+var RadiusNumberAxisModule = {
+ type: "axis",
+ name: "radius-number",
+ chartType: "polar",
+ enterprise: true,
+ options: radiusNumberAxisOptionsDefs,
+ create: (ctx) => new RadiusNumberAxis(ctx)
+};
+var RadiusCategoryAxisModule = {
+ type: "axis",
+ name: "radius-category",
+ chartType: "polar",
+ enterprise: true,
+ options: radiusCategoryAxisOptionsDefs,
+ create: (ctx) => new RadiusCategoryAxis(ctx)
+};
+
+// packages/ag-charts-enterprise/src/charts/standaloneChartModule.ts
+import { _ModuleSupport as _ModuleSupport15 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/charts/standaloneChart.ts
+import { _ModuleSupport as _ModuleSupport14 } from "ag-charts-community";
+var { Chart } = _ModuleSupport14;
+var StandaloneChart = class extends Chart {
+ getChartType() {
+ return "standalone";
+ }
+ performLayout(ctx) {
+ const { seriesRoot, annotationRoot } = this;
+ const { layoutBox } = ctx;
+ const seriesRect = layoutBox.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());
+ this.seriesRect = seriesRect;
+ this.animationRect = seriesRect;
+ for (const group of [seriesRoot, annotationRoot]) {
+ group.translationX = Math.floor(seriesRect.x);
+ group.translationY = Math.floor(seriesRect.y);
+ }
+ seriesRoot.visible = this.series[0].visible;
+ this.ctx.layoutManager.emitLayoutComplete(ctx, {
+ series: { visible: true, rect: seriesRect, paddedRect: layoutBox }
+ });
+ }
+ getAriaLabel() {
+ const seriesType = this.series[0]?.type;
+ if (seriesType == null)
+ return "";
+ const caption = this.getCaptionText();
+ switch (seriesType) {
+ case "radial-gauge":
+ case "linear-gauge": {
+ const captions = [];
+ if (caption.length !== 0) {
+ captions.push(caption);
+ }
+ for (const series of this.series) {
+ captions.push(series.getCaptionText());
+ }
+ return this.ctx.localeManager.t("ariaAnnounceGaugeChart", { caption: captions.join(". ") });
+ }
+ case "treemap":
+ case "sunburst":
+ return this.ctx.localeManager.t("ariaAnnounceHierarchyChart", { caption });
+ default: {
+ return this.ctx.localeManager.t("ariaAnnounceStandaloneChart", { caption });
+ }
+ }
+ }
+};
+StandaloneChart.className = "StandaloneChart";
+StandaloneChart.type = "standalone";
+
+// packages/ag-charts-enterprise/src/charts/standaloneChartModule.ts
+var { isAgStandaloneChartOptions, standaloneChartOptionsDefs } = _ModuleSupport15;
+var StandaloneChartModule = {
+ type: "chart",
+ name: "standalone",
+ enterprise: true,
+ options: standaloneChartOptionsDefs,
+ detect: isAgStandaloneChartOptions,
+ create(options, resources) {
+ return new StandaloneChart(options, resources);
+ }
+};
+
+// packages/ag-charts-enterprise/src/charts/topologyChartModule.ts
+import { _ModuleSupport as _ModuleSupport17 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/charts/topologyChart.ts
+import { _ModuleSupport as _ModuleSupport16 } from "ag-charts-community";
+var { Chart: Chart2, MercatorScale, ChartAxisDirection: ChartAxisDirection6, Property: Property11 } = _ModuleSupport16;
+function isTopologySeries(series) {
+ return series.type === "map-shape" || series.type === "map-line" || series.type === "map-marker" || series.type === "map-shape-background" || series.type === "map-line-background";
+}
+var TopologyChart = class extends Chart2 {
+ constructor(options, resources) {
+ super(options, resources);
+ this.ctx.zoomManager.updateAxes([ChartAxisDirection6.X, ChartAxisDirection6.Y]);
+ }
+ getChartType() {
+ return "topology";
+ }
+ async updateData() {
+ await super.updateData();
+ const options = this.getOptions();
+ if (this.topology !== options.topology) {
+ this.topology = options.topology;
+ }
+ const { topology } = this;
+ for (const series of this.series) {
+ if (isTopologySeries(series)) {
+ series.setChartTopology(topology);
+ }
+ }
+ }
+ performLayout(ctx) {
+ const { seriesRoot, annotationRoot } = this;
+ const { layoutBox } = ctx;
+ const seriesRect = layoutBox.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());
+ this.seriesRect = seriesRect;
+ this.animationRect = seriesRect;
+ const mapSeries = this.series.filter(isTopologySeries);
+ const combinedBbox = mapSeries.reduce((combined, series) => {
+ if (!series.visible)
+ return combined;
+ const bbox = series.topologyBounds;
+ if (bbox == null)
+ return combined;
+ if (combined == null)
+ return bbox;
+ return combined.merge(bbox);
+ }, void 0);
+ let scale;
+ if (combinedBbox != null) {
+ const { lon0, lat0, lon1, lat1 } = combinedBbox;
+ const domain = [
+ [lon0, lat0],
+ [lon1, lat1]
+ ];
+ const bounds = MercatorScale.bounds(domain);
+ const { width, height } = seriesRect;
+ const viewBoxScale = Math.min(width / bounds.width, height / bounds.height);
+ const viewBoxWidth = bounds.width * viewBoxScale;
+ const viewBoxHeight = bounds.height * viewBoxScale;
+ const viewBoxOriginX = (width - viewBoxWidth) / 2;
+ const viewBoxOriginY = (height - viewBoxHeight) / 2;
+ const x0 = viewBoxOriginX;
+ const y0 = viewBoxOriginY;
+ const x1 = viewBoxOriginX + viewBoxWidth;
+ const y1 = viewBoxOriginY + viewBoxHeight;
+ const xZoom = this.ctx.zoomManager.getAxisZoom(ChartAxisDirection6.X);
+ const yZoom = this.ctx.zoomManager.getAxisZoom(ChartAxisDirection6.Y);
+ const xSpan = (x1 - x0) / (xZoom.max - xZoom.min);
+ const xStart = x0 - xSpan * xZoom.min;
+ const ySpan = (y1 - y0) / (1 - yZoom.min - (1 - yZoom.max));
+ const yStart = y0 - ySpan * (1 - yZoom.max);
+ scale = new MercatorScale(domain, [
+ [xStart, yStart],
+ [xStart + xSpan, yStart + ySpan]
+ ]);
+ }
+ for (const series of mapSeries) {
+ series.scale = scale;
+ }
+ const seriesVisible = this.series.some((s) => s.visible);
+ seriesRoot.visible = seriesVisible;
+ for (const group of [seriesRoot, annotationRoot]) {
+ group.translationX = Math.floor(seriesRect.x);
+ group.translationY = Math.floor(seriesRect.y);
+ group.setClipRect(seriesRect.clone());
+ }
+ this.ctx.layoutManager.emitLayoutComplete(ctx, {
+ series: { visible: seriesVisible, rect: seriesRect, paddedRect: layoutBox }
+ });
+ }
+};
+TopologyChart.className = "TopologyChart";
+TopologyChart.type = "topology";
+__decorateClass([
+ Property11
+], TopologyChart.prototype, "topology", 2);
+
+// packages/ag-charts-enterprise/src/charts/topologyChartModule.ts
+var { isAgTopologyChartOptions, topologyChartOptionsDefs } = _ModuleSupport17;
+var TopologyChartModule = {
+ type: "chart",
+ name: "topology",
+ enterprise: true,
+ options: topologyChartOptionsDefs,
+ detect: isAgTopologyChartOptions,
+ create(options, resources) {
+ return new TopologyChart(options, resources);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/sync/pluginModules.ts
+import { _ModuleSupport as _ModuleSupport64 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationOptionsDef.ts
+import {
+ _ModuleSupport as _ModuleSupport18
+} from "ag-charts-community";
+import {
+ and,
+ arrayOf,
+ arrayOfDefs,
+ boolean,
+ constant,
+ greaterThan,
+ lessThan,
+ number,
+ numberRange,
+ optionsDefs,
+ or,
+ ratio,
+ required,
+ string,
+ typeUnion,
+ union
+} from "ag-charts-core";
+var {
+ annotationCalloutStylesDefs,
+ annotationNoteStylesDefs,
+ annotationTextStylesDef,
+ annotationCommentStylesDefs,
+ annotationMeasurerStylesDefs,
+ annotationQuickMeasurerStylesDefs,
+ annotationShapeStylesDefs,
+ annotationChannelTextDefs,
+ annotationCrossLineStyleDefs,
+ annotationFibonacciStylesDefs,
+ annotationLineStyleDefs,
+ annotationLineTextDefs,
+ annotationDisjointChannelStyleDefs,
+ annotationParallelChannelStyleDefs
+} = _ModuleSupport18;
+var serializableDate = optionsDefs(
+ {
+ __type: required(constant("date")),
+ value: or(string, number)
+ },
+ "a serializable date object"
+);
+var xValue = or(string, number, serializableDate);
+var annotationValue = or(
+ xValue,
+ optionsDefs({
+ value: xValue,
+ groupPercentage: numberRange(-1, 2)
+ })
+);
+var channelAnnotationTextOptionsDef = {
+ ...annotationChannelTextDefs,
+ label: string
+};
+var lineAnnotationTextOptionsDef = {
+ ...annotationLineTextDefs,
+ label: string
+};
+var annotationPointOptionsDef = {
+ x: annotationValue,
+ y: number
+};
+var annotationInitialStateOptionsDef = typeUnion(
+ {
+ line: {
+ ...annotationLineStyleDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: lineAnnotationTextOptionsDef
+ },
+ "horizontal-line": {
+ ...annotationCrossLineStyleDefs,
+ value: annotationValue,
+ text: lineAnnotationTextOptionsDef
+ },
+ "vertical-line": {
+ ...annotationCrossLineStyleDefs,
+ value: annotationValue,
+ text: lineAnnotationTextOptionsDef
+ },
+ "disjoint-channel": {
+ ...annotationDisjointChannelStyleDefs,
+ startHeight: number,
+ endHeight: number,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: channelAnnotationTextOptionsDef
+ },
+ "parallel-channel": {
+ ...annotationParallelChannelStyleDefs,
+ height: number,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: channelAnnotationTextOptionsDef
+ },
+ "fibonacci-retracement": {
+ ...annotationFibonacciStylesDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: lineAnnotationTextOptionsDef,
+ reverse: boolean
+ },
+ "fibonacci-retracement-trend-based": {
+ ...annotationFibonacciStylesDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ endRetracement: annotationPointOptionsDef,
+ text: lineAnnotationTextOptionsDef,
+ reverse: boolean
+ },
+ callout: {
+ ...annotationCalloutStylesDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: string
+ },
+ comment: {
+ ...annotationCommentStylesDefs,
+ ...annotationPointOptionsDef,
+ text: string
+ },
+ note: {
+ ...annotationNoteStylesDefs,
+ ...annotationPointOptionsDef,
+ text: string
+ },
+ text: {
+ ...annotationTextStylesDef,
+ ...annotationPointOptionsDef,
+ text: string
+ },
+ arrow: {
+ ...annotationLineStyleDefs,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "arrow-up": {
+ ...annotationShapeStylesDefs,
+ ...annotationPointOptionsDef
+ },
+ "arrow-down": {
+ ...annotationShapeStylesDefs,
+ ...annotationPointOptionsDef
+ },
+ "date-range": {
+ ...annotationMeasurerStylesDefs,
+ extendAbove: boolean,
+ extendBelow: boolean,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "price-range": {
+ ...annotationMeasurerStylesDefs,
+ extendLeft: boolean,
+ extendRight: boolean,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "date-price-range": {
+ ...annotationMeasurerStylesDefs,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "quick-date-price-range": {
+ ...annotationMeasurerStylesDefs,
+ ...annotationQuickMeasurerStylesDefs,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ }
+ },
+ "an annotation initial state object"
+);
+var initialStateOptionsDef = {
+ chartType: union("candlestick", "hollow-candlestick", "ohlc", "line", "step-line", "hlc", "high-low"),
+ annotations: arrayOfDefs(annotationInitialStateOptionsDef),
+ legend: arrayOfDefs(
+ {
+ visible: boolean,
+ seriesId: string,
+ itemId: string,
+ legendItemName: string
+ },
+ "legend state array"
+ ),
+ zoom: {
+ rangeX: {
+ start: or(number, serializableDate),
+ end: or(number, serializableDate)
+ },
+ rangeY: {
+ start: or(number, serializableDate),
+ end: or(number, serializableDate)
+ },
+ ratioX: {
+ start: and(ratio, lessThan("end")),
+ end: and(ratio, greaterThan("start"))
+ },
+ ratioY: {
+ start: and(ratio, lessThan("end")),
+ end: and(ratio, greaterThan("start"))
+ },
+ autoScaledAxes: arrayOf(constant("y"))
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorOptionsDefs.ts
+import { _ModuleSupport as _ModuleSupport63 } from "ag-charts-community";
+import {
+ array,
+ arrayOfDefs as arrayOfDefs3,
+ boolean as boolean7,
+ callbackOf,
+ color as color2,
+ fontOptionsDef,
+ number as number6,
+ positiveNumber as positiveNumber2,
+ ratio as ratio2,
+ typeUnion as typeUnion2
+} from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotModule.ts
+import { _ModuleSupport as _ModuleSupport24 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport21
+} from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/box-plot/blotPlotUtil.ts
+function prepareBoxPlotFromTo(isVertical) {
+ const from = isVertical ? { scalingX: 1, scalingY: 0 } : { scalingX: 0, scalingY: 1 };
+ const to = { scalingX: 1, scalingY: 1 };
+ return { from, to };
+}
+function resetBoxPlotSelectionsScalingCenterFn(isVertical) {
+ return (_node, datum) => {
+ if (isVertical) {
+ return { scalingCenterY: datum.scaledValues.medianValue };
+ }
+ return { scalingCenterX: datum.scaledValues.medianValue };
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotNode.ts
+import { _ModuleSupport as _ModuleSupport19 } from "ag-charts-community";
+var {
+ Path: Path5,
+ Scalable,
+ ExtendedPath2D,
+ SceneChangeDetection,
+ SceneArrayChangeDetection,
+ BBox: BBox2,
+ clippedRoundRect: baseClippedRoundRect
+} = _ModuleSupport19;
+var BoxPlotNode = class extends Scalable(Path5) {
+ constructor() {
+ super(...arguments);
+ this.wickPath = new ExtendedPath2D();
+ this.horizontal = false;
+ this.center = 0;
+ this.thickness = 0;
+ this.min = 0;
+ this.q1 = 0;
+ this.median = 0;
+ this.q3 = 0;
+ this.max = 0;
+ this.cornerRadius = 0;
+ this.crisp = false;
+ this.strokeAlignment = 0;
+ this.wickStroke = void 0;
+ this.wickStrokeWidth = void 0;
+ this.wickStrokeOpacity = void 0;
+ this.capLengthRatio = 1;
+ this.wickStrokeAlignment = 0;
+ }
+ computeBBox() {
+ const { horizontal, center, thickness, min, max } = this;
+ return horizontal ? new BBox2(Math.min(min, max), center - thickness / 2, Math.abs(max - min), thickness) : new BBox2(center - thickness / 2, Math.min(min, max), thickness, Math.abs(max - min));
+ }
+ computeDefaultGradientFillBBox() {
+ const { horizontal, center, thickness, q1, q3 } = this;
+ return horizontal ? new BBox2(Math.min(q1, q3), center - thickness / 2, Math.abs(q3 - q1), thickness) : new BBox2(center - thickness / 2, Math.min(q1, q3), thickness, Math.abs(q3 - q1));
+ }
+ isPointInPath(x, y) {
+ return this.getBBox().containsPoint(x, y);
+ }
+ distanceSquared(x, y) {
+ return this.getBBox().distanceSquared(x, y);
+ }
+ get midPoint() {
+ return this.horizontal ? { x: (this.min + this.max) / 2, y: this.center } : { x: this.center, y: (this.min + this.max) / 2 };
+ }
+ alignedCoordinates() {
+ const { thickness, crisp } = this;
+ let { center, min, q1, median, q3, max } = this;
+ let x0 = center - thickness / 2;
+ let x1 = center + thickness / 2;
+ if (crisp && thickness > 1) {
+ min = this.align(min);
+ q1 = this.align(q1);
+ median = this.align(median);
+ q3 = this.align(q3);
+ max = min + this.align(min, max - min);
+ const halfWidth = this.align(thickness / 2);
+ center = this.align(center);
+ x0 = center - halfWidth;
+ x1 = center + halfWidth;
+ }
+ return { center, x0, x1, min, max, q1, median, q3 };
+ }
+ updatePath() {
+ const {
+ path,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke,
+ wickStrokeWidth,
+ wickStrokeOpacity,
+ wickLineDash,
+ wickLineDashOffset,
+ strokeAlignment,
+ cornerRadius,
+ capLengthRatio,
+ horizontal
+ } = this;
+ const { center, x0, x1, min, max, q1, median, q3 } = this.alignedCoordinates();
+ const pixelRatio = this.layerManager?.canvas.pixelRatio ?? 1;
+ const wickStrokeAlignment = this.wickStrokeAlignment > 0 ? pixelRatio / this.wickStrokeAlignment / 2 % 1 : 0;
+ this.path.clear();
+ this.wickPath.clear();
+ const needsWickPath = wickStroke != null && wickStroke !== stroke || wickStrokeWidth != null && wickStrokeWidth !== strokeWidth || wickStrokeOpacity != null && wickStrokeOpacity !== strokeOpacity || wickLineDash != null && wickLineDash !== lineDash || wickLineDashOffset != null && wickLineDashOffset !== lineDashOffset;
+ const wickPath = needsWickPath ? this.wickPath : path;
+ if (Math.abs(x1 - x0) <= 3) {
+ moveTo(wickPath, horizontal, center, min);
+ lineTo(wickPath, horizontal, center, max);
+ return;
+ }
+ const wickTop = Math.min(min, max);
+ const wickBottom = Math.max(min, max);
+ const boxTop = Math.min(q1, q3);
+ const boxBottom = Math.max(q1, q3);
+ const capX0 = center - Math.abs((x1 - x0) * capLengthRatio) / 2;
+ const capX1 = center + Math.abs((x1 - x0) * capLengthRatio) / 2;
+ moveTo(wickPath, horizontal, capX0, wickTop - wickStrokeAlignment);
+ lineTo(wickPath, horizontal, capX1, wickTop - wickStrokeAlignment);
+ moveTo(wickPath, horizontal, center - wickStrokeAlignment, wickTop - wickStrokeAlignment);
+ lineTo(wickPath, horizontal, center - wickStrokeAlignment, boxTop + strokeWidth / 2);
+ moveTo(wickPath, horizontal, center - wickStrokeAlignment, wickBottom + wickStrokeAlignment);
+ lineTo(wickPath, horizontal, center - wickStrokeAlignment, boxBottom - strokeWidth / 2);
+ moveTo(wickPath, horizontal, capX0, wickBottom + wickStrokeAlignment);
+ lineTo(wickPath, horizontal, capX1, wickBottom + wickStrokeAlignment);
+ const horizontalBoxStrokeAdjustment = strokeWidth / 2 + strokeAlignment;
+ const verticalBoxStrokeAdjustment = strokeWidth / 2 - strokeAlignment;
+ const rectHeight = boxBottom - boxTop - 2 * verticalBoxStrokeAdjustment;
+ if (rectHeight > 0) {
+ const rectX = x0 + horizontalBoxStrokeAdjustment;
+ const rectY = boxTop + verticalBoxStrokeAdjustment;
+ const rectWidth = x1 - x0 - 2 * horizontalBoxStrokeAdjustment;
+ const cornerRadii = {
+ topLeft: cornerRadius,
+ topRight: cornerRadius,
+ bottomRight: cornerRadius,
+ bottomLeft: cornerRadius
+ };
+ clippedRoundRect(
+ path,
+ horizontal,
+ rectX,
+ rectY,
+ rectWidth,
+ rectHeight,
+ cornerRadii,
+ new BBox2(rectX, rectY, rectWidth, median - rectY)
+ );
+ clippedRoundRect(
+ path,
+ horizontal,
+ rectX,
+ rectY,
+ rectWidth,
+ rectHeight,
+ cornerRadii,
+ new BBox2(rectX, median, rectWidth, rectY + rectHeight - median)
+ );
+ } else {
+ const boxMid = (boxTop + boxBottom) / 2;
+ moveTo(path, horizontal, x0, boxMid);
+ lineTo(path, horizontal, x1, boxMid);
+ }
+ }
+ drawPath(ctx) {
+ super.drawPath(ctx);
+ const { wickPath } = this;
+ if (wickPath.isEmpty())
+ return;
+ const {
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke = stroke,
+ wickStrokeWidth = strokeWidth,
+ wickStrokeOpacity = strokeOpacity,
+ wickLineDash = lineDash,
+ wickLineDashOffset = lineDashOffset
+ } = this;
+ if (wickStrokeWidth === 0)
+ return;
+ ctx.globalAlpha *= wickStrokeOpacity;
+ if (typeof wickStroke === "string") {
+ ctx.strokeStyle = wickStroke;
+ }
+ ctx.lineWidth = wickStrokeWidth;
+ if (wickLineDash != null) {
+ ctx.setLineDash([...wickLineDash]);
+ }
+ ctx.lineDashOffset = wickLineDashOffset;
+ ctx.stroke(wickPath.getPath2D());
+ }
+};
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "horizontal", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "center", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "thickness", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "min", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "q1", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "median", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "q3", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "max", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "cornerRadius", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "crisp", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "strokeAlignment", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "wickStroke", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "wickStrokeWidth", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "wickStrokeOpacity", 2);
+__decorateClass([
+ SceneArrayChangeDetection()
+], BoxPlotNode.prototype, "wickLineDash", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "wickLineDashOffset", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "capLengthRatio", 2);
+__decorateClass([
+ SceneChangeDetection()
+], BoxPlotNode.prototype, "wickStrokeAlignment", 2);
+function moveTo(path, horizontal, x, y) {
+ if (horizontal) {
+ path.moveTo(y, x);
+ } else {
+ path.moveTo(x, y);
+ }
+}
+function lineTo(path, horizontal, x, y) {
+ if (horizontal) {
+ path.lineTo(y, x);
+ } else {
+ path.lineTo(x, y);
+ }
+}
+function clippedRoundRect(path, horizontal, x, y, width, height, cornerRadii, clipBBox) {
+ if (horizontal) {
+ baseClippedRoundRect(
+ // eslint-disable-next-line sonarjs/arguments-order
+ path,
+ y,
+ x,
+ height,
+ width,
+ cornerRadii,
+ clipBBox == null ? void 0 : new BBox2(clipBBox.y, clipBBox.x, clipBBox.height, clipBBox.width)
+ );
+ } else {
+ baseClippedRoundRect(path, x, y, width, height, cornerRadii, clipBBox);
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport20 } from "ag-charts-community";
+var { BaseProperties: BaseProperties2, AbstractBarSeriesProperties, makeSeriesTooltip, Property: Property12, mergeDefaults } = _ModuleSupport20;
+var BoxPlotSeriesCap = class extends BaseProperties2 {
+ constructor() {
+ super(...arguments);
+ this.lengthRatio = 0.5;
+ }
+};
+__decorateClass([
+ Property12
+], BoxPlotSeriesCap.prototype, "lengthRatio", 2);
+var BoxPlotSeriesWhisker = class extends BaseProperties2 {
+};
+__decorateClass([
+ Property12
+], BoxPlotSeriesWhisker.prototype, "stroke", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesWhisker.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesWhisker.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesWhisker.prototype, "lineDash", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesWhisker.prototype, "lineDashOffset", 2);
+var BoxPlotSeriesProperties = class extends AbstractBarSeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.fill = "#c16068";
+ this.fillOpacity = 1;
+ this.stroke = "#333";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.cap = new BoxPlotSeriesCap();
+ this.whisker = new BoxPlotSeriesWhisker();
+ this.tooltip = makeSeriesTooltip();
+ }
+ toJson() {
+ const { stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ const properties = super.toJson();
+ properties.whisker = mergeDefaults(properties.whisker, {
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ return properties;
+ }
+};
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "minKey", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "q1Key", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "medianKey", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "q3Key", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "maxKey", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "xName", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "yName", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "minName", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "q1Name", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "medianName", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "q3Name", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "maxName", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "styler", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "cap", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "whisker", 2);
+__decorateClass([
+ Property12
+], BoxPlotSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeries.ts
+var {
+ fixNumericExtent,
+ keyProperty,
+ mergeDefaults: mergeDefaults2,
+ SeriesNodePickMode,
+ SMALLEST_KEY_INTERVAL,
+ valueProperty,
+ diff,
+ animationValidation,
+ computeBarFocusBounds,
+ createDatumId,
+ HighlightState,
+ ContinuousScale: ContinuousScale2,
+ ChartAxisDirection: ChartAxisDirection7,
+ motion,
+ getItemStyles,
+ applyShapeFillBBox,
+ calculateSegments,
+ toHighlightString
+} = _ModuleSupport21;
+var BoxPlotSeriesNodeEvent = class extends _ModuleSupport21.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.minKey = series.properties.minKey;
+ this.q1Key = series.properties.q1Key;
+ this.medianKey = series.properties.medianKey;
+ this.q3Key = series.properties.q3Key;
+ this.maxKey = series.properties.maxKey;
+ }
+};
+var BoxPlotSeries = class extends _ModuleSupport21.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode.NEAREST_NODE, SeriesNodePickMode.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["xKey"],
+ y: ["medianKey", "q1Key", "q3Key", "minKey", "maxKey"]
+ },
+ propertyNames: {
+ x: ["xName"],
+ y: ["medianName", "q1Name", "q3Name", "minName", "maxName"]
+ },
+ categoryKey: "xValue",
+ pathsPerSeries: []
+ });
+ this.properties = new BoxPlotSeriesProperties();
+ this.NodeEvent = BoxPlotSeriesNodeEvent;
+ }
+ async processData(dataController) {
+ if (!this.visible)
+ return;
+ const { xKey, minKey, q1Key, medianKey, q3Key, maxKey } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (animationEnabled && this.processedData) {
+ extraProps.push(diff(this.id, this.processedData));
+ }
+ if (animationEnabled) {
+ extraProps.push(animationValidation());
+ }
+ const { processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty(xKey, xScaleType, { id: `xValue` }),
+ valueProperty(minKey, yScaleType, { id: `minValue` }),
+ valueProperty(q1Key, yScaleType, { id: `q1Value` }),
+ valueProperty(medianKey, yScaleType, { id: `medianValue` }),
+ valueProperty(q3Key, yScaleType, { id: `q3Value` }),
+ valueProperty(maxKey, yScaleType, { id: `maxValue` }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL] : [],
+ ...extraProps
+ ]
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.animationState.transition("updateData");
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!(processedData && dataModel))
+ return [];
+ if (direction !== this.getBarDirection()) {
+ const { index, def } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const keys = processedData.domain.keys[index];
+ if (def.type === "key" && def.valueType === "category") {
+ return keys;
+ }
+ return this.padBandExtent(keys);
+ }
+ const yExtent = this.domainForClippedRange(direction, ["minValue", "maxValue"], "xValue");
+ return fixNumericExtent(yExtent);
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection7.Y, ["maxValue", "minValue"], "xValue", visibleRange);
+ }
+ createNodeData() {
+ const { visible, dataModel, processedData } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(dataModel && processedData && xAxis && yAxis))
+ return;
+ const { xKey } = this.properties;
+ const nodeData = [];
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const minValues = dataModel.resolveColumnById(this, "minValue", processedData);
+ const q1Values = dataModel.resolveColumnById(this, "q1Value", processedData);
+ const medianValues = dataModel.resolveColumnById(this, "medianValue", processedData);
+ const q3Values = dataModel.resolveColumnById(this, "q3Value", processedData);
+ const maxValues = dataModel.resolveColumnById(this, "maxValue", processedData);
+ const { barWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const barOffset = ContinuousScale2.is(xAxis.scale) ? barWidth * -0.5 : 0;
+ const { groupScale } = this;
+ const isVertical = this.isVertical();
+ const segments = calculateSegments(
+ this.properties.segmentation,
+ xAxis,
+ yAxis,
+ this.chart.seriesRect,
+ this.ctx.scene
+ );
+ const context = {
+ itemId: xKey,
+ nodeData,
+ labelData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStyles(this.getItemStyle.bind(this)),
+ segments
+ };
+ if (!visible)
+ return context;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ continue;
+ const minValue = minValues[datumIndex];
+ const q1Value = q1Values[datumIndex];
+ const medianValue = medianValues[datumIndex];
+ const q3Value = q3Values[datumIndex];
+ const maxValue = maxValues[datumIndex];
+ if ([minValue, q1Value, medianValue, q3Value, maxValue].some((value) => typeof value !== "number") || minValue > q1Value || q1Value > medianValue || medianValue > q3Value || q3Value > maxValue) {
+ continue;
+ }
+ const scaledValues = {
+ xValue: xAxis.scale.convert(xValue2),
+ minValue: yAxis.scale.convert(minValue),
+ q1Value: yAxis.scale.convert(q1Value),
+ medianValue: yAxis.scale.convert(medianValue),
+ q3Value: yAxis.scale.convert(q3Value),
+ maxValue: yAxis.scale.convert(maxValue)
+ };
+ const bandwidth = barWidth;
+ scaledValues.xValue += groupScale.convert(String(groupIndex)) + barOffset + bandwidth / 2;
+ const height = Math.abs(scaledValues.q3Value - scaledValues.q1Value);
+ const midX = scaledValues.xValue;
+ const midY = Math.min(scaledValues.q3Value, scaledValues.q1Value) + height / 2;
+ const midPoint = {
+ x: isVertical ? midX : midY,
+ y: isVertical ? midY : midX
+ };
+ let focusRect;
+ if (isVertical) {
+ focusRect = {
+ x: midPoint.x - bandwidth / 2,
+ y: scaledValues.minValue,
+ width: bandwidth,
+ height: scaledValues.maxValue - scaledValues.minValue
+ };
+ } else {
+ focusRect = {
+ x: scaledValues.minValue,
+ y: midPoint.y - bandwidth / 2,
+ width: scaledValues.maxValue - scaledValues.minValue,
+ height: bandwidth
+ };
+ }
+ nodeData.push({
+ series: this,
+ itemId: xValue2,
+ datum,
+ datumIndex,
+ xKey,
+ bandwidth,
+ scaledValues,
+ midPoint,
+ focusRect
+ });
+ }
+ return context;
+ }
+ legendItemSymbol() {
+ const { fill, stroke, strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset } = this.getStyle(
+ false,
+ false,
+ HighlightState.None
+ );
+ return {
+ marker: {
+ fill: _ModuleSupport21.deepClone(fill),
+ fillOpacity,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ id: seriesId,
+ ctx: { legendManager },
+ visible
+ } = this;
+ const { xKey, yName, showInLegend, legendItemName } = this.properties;
+ if (!xKey || legendType !== "category") {
+ return [];
+ }
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: seriesId }),
+ label: {
+ text: legendItemName ?? yName ?? seriesId
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const {
+ xKey,
+ xName,
+ yName,
+ medianKey,
+ medianName,
+ q1Key,
+ q1Name,
+ q3Key,
+ q3Name,
+ minKey,
+ minName,
+ maxKey,
+ maxName,
+ legendItemName,
+ tooltip
+ } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const minValue = dataModel.resolveColumnById(this, `minValue`, processedData)[datumIndex];
+ const q1Value = dataModel.resolveColumnById(this, `q1Value`, processedData)[datumIndex];
+ const medianValue = dataModel.resolveColumnById(this, `medianValue`, processedData)[datumIndex];
+ const q3Value = dataModel.resolveColumnById(this, `q3Value`, processedData)[datumIndex];
+ const maxValue = dataModel.resolveColumnById(this, `maxValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const format = this.getItemStyle(datumIndex, false);
+ const data = [
+ {
+ label: minName,
+ fallbackLabel: minKey,
+ value: this.getAxisValueText(yAxis, "tooltip", minValue, datum, minKey, legendItemName)
+ },
+ {
+ label: q1Name,
+ fallbackLabel: q1Key,
+ value: this.getAxisValueText(yAxis, "tooltip", q1Value, datum, q1Key, legendItemName)
+ },
+ {
+ label: medianName,
+ fallbackLabel: medianKey,
+ value: this.getAxisValueText(yAxis, "tooltip", medianValue, datum, medianKey, legendItemName)
+ },
+ {
+ label: q3Name,
+ fallbackLabel: q3Key,
+ value: this.getAxisValueText(yAxis, "tooltip", q3Value, datum, q3Key, legendItemName)
+ },
+ {
+ label: maxName,
+ fallbackLabel: maxKey,
+ value: this.getAxisValueText(yAxis, "tooltip", maxValue, datum, maxKey, legendItemName)
+ }
+ ];
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ title: legendItemName ?? yName,
+ symbol: this.legendItemSymbol(),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ xKey,
+ xName,
+ yName,
+ medianKey,
+ medianName,
+ q1Key,
+ q1Name,
+ q3Key,
+ q3Name,
+ minKey,
+ minName,
+ maxKey,
+ maxName,
+ ...format
+ }
+ );
+ }
+ animateEmptyUpdateReady({
+ datumSelection
+ }) {
+ const isVertical = this.isVertical();
+ const { from, to } = prepareBoxPlotFromTo(isVertical);
+ motion.resetMotion([datumSelection], resetBoxPlotSelectionsScalingCenterFn(isVertical));
+ motion.staticFromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], from, to, {
+ phase: "initial"
+ });
+ }
+ isLabelEnabled() {
+ return false;
+ }
+ updateDatumSelection(opts) {
+ const data = opts.nodeData ?? [];
+ return opts.datumSelection.update(data);
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { id: seriesId } = this;
+ const {
+ cornerRadius,
+ cap: { lengthRatio },
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ maxKey,
+ maxName,
+ medianKey,
+ medianName,
+ minKey,
+ minName,
+ q1Key,
+ q1Name,
+ q3Key,
+ q3Name,
+ whisker: {
+ lineDash: whiskerLineDash,
+ lineDashOffset: whiskerLineDashOffset,
+ stroke: whiskerStroke,
+ strokeOpacity: whiskerStrokeOpacity,
+ strokeWidth: whiskerStrokeWidth
+ },
+ xKey,
+ xName,
+ yName
+ } = this.properties;
+ const highlightState = toHighlightString(highlightStateEnum ?? HighlightState.None);
+ return {
+ cap: { lengthRatio },
+ cornerRadius,
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ lineDash,
+ lineDashOffset,
+ maxKey,
+ maxName: maxName ?? maxKey,
+ medianKey,
+ medianName: medianName ?? medianKey,
+ minKey,
+ minName: minName ?? minKey,
+ q1Key,
+ q1Name: q1Name ?? q1Key,
+ q3Key,
+ q3Name: q3Name ?? q3Key,
+ seriesId,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ whisker: {
+ lineDash: whiskerLineDash ?? lineDash,
+ lineDashOffset: whiskerLineDashOffset ?? lineDashOffset,
+ stroke: whiskerStroke ?? stroke,
+ strokeOpacity: whiskerStrokeOpacity ?? strokeOpacity,
+ strokeWidth: whiskerStrokeWidth ?? strokeWidth
+ },
+ xKey,
+ xName: xName ?? xKey,
+ yName
+ };
+ }
+ getStyle(ignoreStylerCallback, highlighted, highlightState) {
+ const {
+ cap,
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ styler,
+ whisker
+ } = this.properties;
+ let stylerResult = {};
+ if (!ignoreStylerCallback && styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ stylerResult = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ return {
+ cornerRadius: stylerResult.cornerRadius ?? cornerRadius,
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ opacity: 1,
+ stroke: stylerResult.stroke ?? stroke,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth,
+ cap: { lengthRatio: stylerResult.cap?.lengthRatio ?? cap.lengthRatio },
+ whisker: {
+ lineDash: stylerResult.whisker?.lineDash ?? whisker.lineDash,
+ lineDashOffset: stylerResult.whisker?.lineDashOffset ?? whisker.lineDashOffset,
+ stroke: stylerResult.whisker?.stroke ?? whisker.stroke,
+ strokeOpacity: stylerResult.whisker?.strokeOpacity ?? whisker.strokeOpacity,
+ strokeWidth: stylerResult.whisker?.strokeWidth ?? whisker.strokeWidth
+ }
+ };
+ }
+ getItemStyle(datumIndex, isHighlight, highlightState) {
+ const { properties } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ let style = mergeDefaults2(highlightStyle, this.getStyle(datumIndex === void 0, isHighlight, highlightState));
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datumIndex, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults2(overrides, style);
+ }
+ }
+ const { stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = style;
+ style.whisker = mergeDefaults2(style.whisker, {
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ return style;
+ }
+ makeItemStylerParams(datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const { xKey, minKey, q1Key, medianKey, q3Key, maxKey } = this.properties;
+ const datum = this.processedData?.dataSources.get(seriesId)?.data[datumIndex];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ xKey,
+ minKey,
+ q1Key,
+ medianKey,
+ q3Key,
+ maxKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ datumSelection.each((_, nodeDatum) => {
+ const highlightState = this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex);
+ nodeDatum.style = this.getItemStyle(nodeDatum.datumIndex, isHighlight, highlightState);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData, properties } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const isVertical = this.isVertical();
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const fillBBox = this.getShapeFillBBox();
+ const strokeAlignment = this.getStyle(false, false, HighlightState.None).strokeWidth / 2;
+ const wickStrokeAlignment = properties.whisker.strokeWidth ?? properties.strokeWidth;
+ datumSelection.each((boxPlotNode, nodeDatum) => {
+ const style = nodeDatum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex)];
+ applyShapeFillBBox(boxPlotNode, style.fill, fillBBox);
+ boxPlotNode.fill = style.fill;
+ boxPlotNode.fillOpacity = style.fillOpacity;
+ boxPlotNode.stroke = style.stroke;
+ boxPlotNode.strokeWidth = style.strokeWidth;
+ boxPlotNode.strokeOpacity = style.strokeOpacity;
+ boxPlotNode.lineDash = style.lineDash;
+ boxPlotNode.lineDashOffset = style.lineDashOffset;
+ boxPlotNode.wickStroke = style.whisker.stroke;
+ boxPlotNode.wickStrokeWidth = style.whisker.strokeWidth;
+ boxPlotNode.wickStrokeOpacity = style.whisker.strokeOpacity;
+ boxPlotNode.wickLineDash = style.whisker.lineDash;
+ boxPlotNode.wickLineDashOffset = style.whisker.lineDashOffset;
+ boxPlotNode.cornerRadius = style.cornerRadius;
+ boxPlotNode.crisp = true;
+ boxPlotNode.horizontal = !isVertical;
+ boxPlotNode.center = nodeDatum.scaledValues.xValue;
+ boxPlotNode.thickness = nodeDatum.bandwidth;
+ boxPlotNode.min = nodeDatum.scaledValues.minValue;
+ boxPlotNode.q1 = nodeDatum.scaledValues.q1Value;
+ boxPlotNode.median = nodeDatum.scaledValues.medianValue;
+ boxPlotNode.q3 = nodeDatum.scaledValues.q3Value;
+ boxPlotNode.max = nodeDatum.scaledValues.maxValue;
+ boxPlotNode.capLengthRatio = style.cap.lengthRatio;
+ boxPlotNode.strokeAlignment = strokeAlignment;
+ boxPlotNode.wickStrokeAlignment = wickStrokeAlignment;
+ });
+ }
+ updateLabelNodes() {
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ return labelSelection.update(labelData);
+ }
+ nodeFactory() {
+ return new BoxPlotNode();
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds(this, this.contextNodeData?.nodeData[datumIndex].focusRect);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null;
+ }
+};
+BoxPlotSeries.className = "BoxPlotSeries";
+BoxPlotSeries.type = "box-plot";
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport22 } from "ag-charts-community";
+import { boolean as boolean2, constant as constant2, required as required2, shapeSegmentation, string as string2 } from "ag-charts-core";
+var { boxPlotSeriesThemeableOptionsDef, commonSeriesOptionsDefs } = _ModuleSupport22;
+var boxPlotSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs,
+ ...boxPlotSeriesThemeableOptionsDef,
+ type: required2(constant2("box-plot")),
+ xKey: required2(string2),
+ minKey: required2(string2),
+ q1Key: required2(string2),
+ medianKey: required2(string2),
+ q3Key: required2(string2),
+ maxKey: required2(string2),
+ xName: string2,
+ yName: string2,
+ minName: string2,
+ q1Name: string2,
+ medianName: string2,
+ q3Name: string2,
+ maxName: string2,
+ grouped: boolean2,
+ legendItemName: string2,
+ segmentation: shapeSegmentation
+};
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotThemes.ts
+import { _ModuleSupport as _ModuleSupport23 } from "ag-charts-community";
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE },
+ multiSeriesHighlightStyle,
+ FILL_GRADIENT_LINEAR_DEFAULTS,
+ FILL_IMAGE_DEFAULTS,
+ FILL_PATTERN_DEFAULTS,
+ SAFE_FILL_OPERATION,
+ SEGMENTATION_DEFAULTS
+} = _ModuleSupport23;
+var BOX_PLOT_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ {
+ $if: [
+ {
+ $or: [
+ { $isGradient: { $palette: "fill" } },
+ { $isPattern: { $palette: "fill" } },
+ { $isImage: { $palette: "fill" } }
+ ]
+ },
+ { $palette: "fill" },
+ { $mix: [SAFE_FILL_OPERATION, { $ref: "chartBackgroundColor" }, 0.7] }
+ ]
+ },
+ ["gradient", FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", FILL_IMAGE_DEFAULTS],
+ ["pattern", FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ strokeWidth: 2,
+ fillOpacity: 1,
+ strokeOpacity: 1,
+ lineDash: void 0,
+ lineDashOffset: 0,
+ highlight: multiSeriesHighlightStyle(),
+ segmentation: SEGMENTATION_DEFAULTS
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE.NUMBER]: {
+ crosshair: {
+ snap: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE.CATEGORY]: {
+ groupPaddingInner: 0.2,
+ crosshair: {
+ enabled: false,
+ snap: false
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotModule.ts
+var BoxPlotModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "box-plot",
+ moduleFactory: (ctx) => new BoxPlotSeries(ctx),
+ predictAxis: _ModuleSupport24.predictCartesianTimeAxis,
+ defaultAxes: _ModuleSupport24.DIRECTION_SWAP_AXES,
+ themeTemplate: BOX_PLOT_SERIES_THEME,
+ groupable: true
+};
+var BoxPlotSeriesModule = {
+ type: "series",
+ name: "box-plot",
+ chartType: "cartesian",
+ enterprise: true,
+ options: boxPlotSeriesOptionsDef,
+ create: (ctx) => new BoxPlotSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickModule.ts
+import { _ModuleSupport as _ModuleSupport34 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeries.ts
+import { _ModuleSupport as _ModuleSupport31 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesBase.ts
+import {
+ _ModuleSupport as _ModuleSupport26
+} from "ag-charts-community";
+import { Logger } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcAggregation.ts
+import { _ModuleSupport as _ModuleSupport25 } from "ag-charts-community";
+var {
+ AGGREGATION_SPAN,
+ AGGREGATION_INDEX_X_MAX,
+ AGGREGATION_INDEX_X_MIN,
+ AGGREGATION_INDEX_Y_MAX,
+ AGGREGATION_INDEX_Y_MIN,
+ aggregationDomain,
+ aggregationRangeFittingPoints,
+ compactAggregationIndices,
+ createAggregationIndices
+} = _ModuleSupport25;
+var AGGREGATION_THRESHOLD = 1e3;
+var OPEN = AGGREGATION_INDEX_X_MIN;
+var HIGH = AGGREGATION_INDEX_Y_MAX;
+var LOW = AGGREGATION_INDEX_Y_MIN;
+var CLOSE = AGGREGATION_INDEX_X_MAX;
+function aggregateOhlcData(scale, xValues, highValues, lowValues, domain, smallestKeyInterval) {
+ if (xValues.length < AGGREGATION_THRESHOLD)
+ return;
+ const [d0, d1] = aggregationDomain(scale, domain);
+ let maxRange = aggregationRangeFittingPoints(xValues, d0, d1, { smallestKeyInterval });
+ let { indexData, valueData } = createAggregationIndices(xValues, highValues, lowValues, d0, d1, maxRange);
+ const filters = [{ maxRange, indexData }];
+ while (maxRange > 64) {
+ ({ indexData, valueData, maxRange } = compactAggregationIndices(indexData, valueData, maxRange));
+ filters.push({ maxRange, indexData });
+ }
+ filters.reverse();
+ return filters;
+}
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesBase.ts
+var {
+ fixNumericExtent: fixNumericExtent2,
+ keyProperty: keyProperty2,
+ createDatumId: createDatumId2,
+ SeriesNodePickMode: SeriesNodePickMode2,
+ ChartAxisDirection: ChartAxisDirection8,
+ SMALLEST_KEY_INTERVAL: SMALLEST_KEY_INTERVAL2,
+ valueProperty: valueProperty2,
+ diff: diff2,
+ animationValidation: animationValidation2,
+ computeBarFocusBounds: computeBarFocusBounds2,
+ visibleRangeIndices,
+ BandScale,
+ processedDataIsAnimatable,
+ mergeDefaults: mergeDefaults3,
+ simpleMemorize2,
+ getItemStylesPerItemId
+} = _ModuleSupport26;
+var memoizedAggregateOhlcData = simpleMemorize2(aggregateOhlcData);
+var OhlcSeriesNodeEvent = class extends _ModuleSupport26.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.openKey = series.properties.openKey;
+ this.closeKey = series.properties.closeKey;
+ this.highKey = series.properties.highKey;
+ this.lowKey = series.properties.lowKey;
+ }
+};
+var OhlcSeriesBase = class extends _ModuleSupport26.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode2.AXIS_ALIGNED, SeriesNodePickMode2.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["xKey"],
+ y: ["lowKey", "highKey", "openKey", "closeKey"]
+ },
+ propertyNames: {
+ x: ["xName"],
+ y: ["lowName", "highName", "openName", "closeName"]
+ },
+ categoryKey: "xValue",
+ pathsPerSeries: []
+ });
+ this.NodeEvent = OhlcSeriesNodeEvent;
+ this.dataAggregationFilters = void 0;
+ }
+ async processData(dataController) {
+ if (!this.visible)
+ return;
+ const { xKey, openKey, closeKey, highKey, lowKey } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (animationEnabled) {
+ if (this.processedData) {
+ extraProps.push(diff2(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation2());
+ }
+ if (openKey) {
+ extraProps.push(
+ valueProperty2(openKey, yScaleType, {
+ id: `openValue`,
+ invalidValue: void 0,
+ missingValue: void 0
+ })
+ );
+ }
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty2(xKey, xScaleType, { id: `xValue` }),
+ valueProperty2(closeKey, yScaleType, { id: `closeValue` }),
+ valueProperty2(highKey, yScaleType, { id: `highValue` }),
+ valueProperty2(lowKey, yScaleType, { id: `lowValue` }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL2] : [],
+ ...extraProps
+ ]
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.dataAggregationFilters = this.aggregateData(
+ dataModel,
+ processedData
+ );
+ this.animationState.transition("updateData");
+ }
+ aggregateData(dataModel, processedData) {
+ if (processedData.type !== "ungrouped")
+ return;
+ if (processedDataIsAnimatable(processedData))
+ return;
+ const xAxis = this.axes[ChartAxisDirection8.X];
+ if (xAxis == null)
+ return;
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const highValues = dataModel.resolveColumnById(this, `highValue`, processedData);
+ const lowValues = dataModel.resolveColumnById(this, `lowValue`, processedData);
+ const { index } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const domain = processedData.domain.keys[index];
+ return memoizedAggregateOhlcData(
+ xAxis.scale.type,
+ xValues,
+ highValues,
+ lowValues,
+ domain,
+ processedData.reduced?.smallestKeyInterval
+ );
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!(processedData && dataModel))
+ return [];
+ if (direction !== this.getBarDirection()) {
+ const { index, def } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const keys = processedData.domain.keys[index];
+ if (def.type === "key" && def.valueType === "category") {
+ return keys;
+ }
+ return this.padBandExtent(keys);
+ }
+ const yExtent = this.domainForClippedRange(direction, ["highValue", "lowValue"], "xValue");
+ return fixNumericExtent2(yExtent);
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection8.Y, ["highValue", "lowValue"], "xValue", visibleRange);
+ }
+ getZoomRangeFittingItems(xVisibleRange, yVisibleRange, minVisibleItems) {
+ return this.zoomFittingVisibleItems(
+ "xValue",
+ ["highValue", "lowValue"],
+ xVisibleRange,
+ yVisibleRange,
+ minVisibleItems
+ );
+ }
+ getVisibleItems(xVisibleRange, yVisibleRange, minVisibleItems) {
+ return this.countVisibleItems(
+ "xValue",
+ ["highValue", "lowValue"],
+ xVisibleRange,
+ yVisibleRange,
+ minVisibleItems
+ );
+ }
+ createNodeData() {
+ const { visible, dataModel, processedData } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(dataModel && processedData && xAxis && yAxis))
+ return;
+ const nodeData = [];
+ const { xKey, highKey, lowKey } = this.properties;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const openValues = dataModel.resolveColumnById(this, "openValue", processedData);
+ const closeValues = dataModel.resolveColumnById(this, "closeValue", processedData);
+ const highValues = dataModel.resolveColumnById(this, "highValue", processedData);
+ const lowValues = dataModel.resolveColumnById(this, "lowValue", processedData);
+ const { groupScale } = this;
+ const { barWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const groupOffset = groupScale.convert(String(groupIndex));
+ const effectiveBarWidth = barWidth >= 1 ? barWidth : groupScale.rawBandwidth;
+ const applyWidthOffset = BandScale.is(xAxis.scale);
+ const context = {
+ itemId: xKey,
+ nodeData,
+ labelData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStylesPerItemId(this.getItemStyle.bind(this), "up", "down")
+ };
+ if (!visible)
+ return context;
+ const handleDatum = (datumIndex, xValue2, openValue, closeValue, highValue, lowValue, width, crisp) => {
+ const datum = rawData[datumIndex];
+ const xOffset = applyWidthOffset ? width / 2 : 0;
+ const centerX = xAxis.scale.convert(xValue2) + groupOffset + xOffset;
+ const yOpen = yAxis.scale.convert(openValue);
+ const yClose = yAxis.scale.convert(closeValue);
+ const yHigh = yAxis.scale.convert(highValue);
+ const yLow = yAxis.scale.convert(lowValue);
+ const isRising = closeValue > openValue;
+ const itemId = isRising ? "up" : "down";
+ const y = Math.min(yHigh, yLow);
+ const height = Math.max(yHigh, yLow) - y;
+ const midPoint = {
+ x: centerX,
+ y: y + height / 2
+ };
+ nodeData.push({
+ series: this,
+ itemId,
+ datum,
+ datumIndex,
+ xKey,
+ xValue: xValue2,
+ openValue,
+ closeValue,
+ highValue,
+ lowValue,
+ midPoint,
+ aggregatedValue: closeValue,
+ isRising,
+ centerX,
+ width,
+ y,
+ height,
+ yOpen,
+ yClose,
+ crisp
+ });
+ };
+ const { dataAggregationFilters } = this;
+ const xScale = xAxis.scale;
+ const [r0, r1] = xScale.range;
+ const range2 = Math.abs(r1 - r0);
+ const xPosition = (index) => xScale.convert(xValues[index]) + groupOffset;
+ const dataAggregationFilter = dataAggregationFilters?.find((f) => f.maxRange > range2);
+ if (dataAggregationFilter == null) {
+ const invalidData = processedData.invalidData?.get(this.id);
+ let [start, end] = visibleRangeIndices(1, rawData.length, xAxis.range, (index) => {
+ const xOffset = applyWidthOffset ? 0 : -effectiveBarWidth / 2;
+ const x = xPosition(index) + xOffset;
+ return [x, x + effectiveBarWidth];
+ });
+ if (processedData.input.count < 1e3) {
+ start = 0;
+ end = processedData.input.count;
+ }
+ for (let datumIndex = start; datumIndex < end; datumIndex += 1) {
+ if (invalidData?.[datumIndex] === true)
+ continue;
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ continue;
+ const openValue = openValues[datumIndex];
+ const closeValue = closeValues[datumIndex];
+ const highValue = highValues[datumIndex];
+ const lowValue = lowValues[datumIndex];
+ const validLowValue = lowValue != null && lowValue <= openValue && lowValue <= closeValue;
+ const validHighValue = highValue != null && highValue >= openValue && highValue >= closeValue;
+ if (!validLowValue) {
+ Logger.warnOnce(
+ `invalid low value for key [${lowKey}] in data element, low value cannot be higher than datum open or close values`
+ );
+ continue;
+ }
+ if (!validHighValue) {
+ Logger.warnOnce(
+ `invalid high value for key [${highKey}] in data element, high value cannot be lower than datum open or close values.`
+ );
+ continue;
+ }
+ handleDatum(datumIndex, xValue2, openValue, closeValue, highValue, lowValue, effectiveBarWidth, true);
+ }
+ } else {
+ const { maxRange, indexData } = dataAggregationFilter;
+ const [start, end] = visibleRangeIndices(1, maxRange, xAxis.range, (index) => {
+ const aggIndex = index * AGGREGATION_SPAN;
+ const openIndex = indexData[aggIndex + OPEN];
+ const closeIndex = indexData[aggIndex + CLOSE];
+ if (openIndex === -1)
+ return;
+ const xOffset = applyWidthOffset ? 0 : -effectiveBarWidth / 2;
+ return [xPosition(openIndex) + xOffset, xPosition(closeIndex) + xOffset + effectiveBarWidth];
+ });
+ for (let i = start; i < end; i += 1) {
+ const aggIndex = i * AGGREGATION_SPAN;
+ const openIndex = indexData[aggIndex + OPEN];
+ const closeIndex = indexData[aggIndex + CLOSE];
+ const highIndex = indexData[aggIndex + HIGH];
+ const lowIndex = indexData[aggIndex + LOW];
+ if (openIndex === -1)
+ continue;
+ const midDatumIndex = Math.trunc((openIndex + closeIndex) / 2);
+ const xValue2 = xValues[midDatumIndex];
+ if (xValue2 == null)
+ continue;
+ const openValue = openValues[openIndex];
+ const closeValue = closeValues[closeIndex];
+ const highValue = highValues[highIndex];
+ const lowValue = lowValues[lowIndex];
+ const width = Math.abs(xPosition(closeIndex) - xPosition(openIndex)) + effectiveBarWidth;
+ handleDatum(midDatumIndex, xValue2, openValue, closeValue, highValue, lowValue, width, false);
+ }
+ }
+ return context;
+ }
+ isVertical() {
+ return true;
+ }
+ isLabelEnabled() {
+ return false;
+ }
+ updateDatumSelection(opts) {
+ const data = opts.nodeData ?? [];
+ return opts.datumSelection.update(data);
+ }
+ updateLabelNodes(_opts) {
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ return labelSelection.update(labelData);
+ }
+ getItemStyle(datumIndex, isHighlight, highlightState, itemId = "up") {
+ const { properties, dataModel, processedData } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ const baseStyle = mergeDefaults3(highlightStyle, properties.getStyle(itemId));
+ let style = baseStyle;
+ if (itemStyler && dataModel != null && processedData != null && datumIndex != null) {
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const overrides = this.cachedDatumCallback(
+ createDatumId2(createDatumId2(xValue2), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(itemId, datumIndex, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`, "item", itemId],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults3(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(itemId, datumIndex, isHighlight, style) {
+ const { id: seriesId, properties, processedData } = this;
+ const { xKey, openKey, closeKey, highKey, lowKey } = properties;
+ const datum = processedData.dataSources.get(seriesId)?.data[datumIndex];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const params = {
+ seriesId,
+ datum,
+ itemId,
+ xKey,
+ openKey,
+ closeKey,
+ highKey,
+ lowKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style
+ };
+ if ("fill" in params && "fill" in style) {
+ params.fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ }
+ return params;
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const {
+ xKey,
+ xName,
+ yName,
+ openKey,
+ openName,
+ highKey,
+ highName,
+ lowKey,
+ lowName,
+ closeKey,
+ closeName,
+ legendItemName,
+ tooltip
+ } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const openValue = dataModel.resolveColumnById(this, `openValue`, processedData)[datumIndex];
+ const highValue = dataModel.resolveColumnById(this, `highValue`, processedData)[datumIndex];
+ const lowValue = dataModel.resolveColumnById(this, `lowValue`, processedData)[datumIndex];
+ const closeValue = dataModel.resolveColumnById(this, `closeValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const itemId = closeValue >= openValue ? "up" : "down";
+ const item = this.properties.item[itemId];
+ const format = this.getItemStyle(datumIndex, false);
+ const marker = {
+ fill: item.fill ?? item.stroke,
+ fillOpacity: item.fillOpacity ?? item.strokeOpacity ?? 1,
+ stroke: item.stroke,
+ strokeWidth: item.strokeWidth ?? 1,
+ strokeOpacity: item.strokeOpacity ?? 1,
+ lineDash: item.lineDash ?? [0],
+ lineDashOffset: item.lineDashOffset ?? 0
+ };
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ title: legendItemName,
+ symbol: {
+ marker
+ },
+ data: [
+ {
+ label: openName,
+ fallbackLabel: openKey,
+ value: this.getAxisValueText(yAxis, "tooltip", openValue, datum, openKey, legendItemName)
+ },
+ {
+ label: highName,
+ fallbackLabel: highKey,
+ value: this.getAxisValueText(yAxis, "tooltip", highValue, datum, highKey, legendItemName)
+ },
+ {
+ label: lowName,
+ fallbackLabel: lowKey,
+ value: this.getAxisValueText(yAxis, "tooltip", lowValue, datum, lowKey, legendItemName)
+ },
+ {
+ label: closeName,
+ fallbackLabel: closeKey,
+ value: this.getAxisValueText(yAxis, "tooltip", closeValue, datum, closeKey, legendItemName)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ itemId,
+ xKey,
+ xName,
+ yName,
+ openKey,
+ openName,
+ highKey,
+ highName,
+ lowKey,
+ lowName,
+ closeKey,
+ closeName,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(opts) {
+ const nodeDatum = this.getNodeData()?.at(opts.datumIndex);
+ if (nodeDatum == null)
+ return;
+ const { centerX, y, width, height } = nodeDatum;
+ const datum = {
+ x: centerX - width / 2,
+ y,
+ width,
+ height
+ };
+ return computeBarFocusBounds2(this, datum);
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickNode.ts
+import { _ModuleSupport as _ModuleSupport28 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcNode.ts
+import { _ModuleSupport as _ModuleSupport27 } from "ag-charts-community";
+var { Path: Path6, SceneChangeDetection: SceneChangeDetection2, BBox: BBox3 } = _ModuleSupport27;
+var OhlcBaseNode = class extends Path6 {
+ constructor() {
+ super(...arguments);
+ this.centerX = 0;
+ this.y = 0;
+ this.width = 0;
+ this.height = 0;
+ this.yOpen = 0;
+ this.yClose = 0;
+ this.crisp = false;
+ }
+ computeBBox() {
+ const { centerX, y, width, height } = this;
+ return new BBox3(centerX - width / 2, y, width, height);
+ }
+ isPointInPath(x, y) {
+ return this.getBBox().containsPoint(x, y);
+ }
+ distanceSquared(x, y) {
+ return this.getBBox().distanceSquared(x, y);
+ }
+ get midPoint() {
+ return { x: this.centerX, y: this.y + this.height / 2 };
+ }
+ alignedCoordinates() {
+ const { y, width, height, crisp } = this;
+ let { centerX, yOpen, yClose } = this;
+ let x0 = centerX - width / 2;
+ let x1 = centerX + width / 2;
+ let y0 = y;
+ let y1 = y + height;
+ if (crisp && width > 1) {
+ centerX = this.align(centerX);
+ if (yOpen <= yClose) {
+ const h = this.align(yOpen, yClose - yOpen);
+ yOpen = this.align(yOpen);
+ yClose = yOpen + h;
+ } else {
+ const h = this.align(yClose, yOpen - yClose);
+ yClose = this.align(yClose);
+ yOpen = yClose + h;
+ }
+ const halfWidth = this.align(width / 2);
+ x0 = centerX - halfWidth;
+ x1 = centerX + halfWidth;
+ y0 = this.align(y);
+ y1 = y0 + this.align(y0, height);
+ }
+ return { centerX, x0, x1, y0, y1, yOpen, yClose };
+ }
+ executeStroke(ctx, path) {
+ const { width, strokeWidth } = this;
+ if (width < strokeWidth) {
+ ctx.lineWidth = width;
+ }
+ super.executeStroke(ctx, path);
+ }
+};
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcBaseNode.prototype, "centerX", 2);
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcBaseNode.prototype, "y", 2);
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcBaseNode.prototype, "width", 2);
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcBaseNode.prototype, "height", 2);
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcBaseNode.prototype, "yOpen", 2);
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcBaseNode.prototype, "yClose", 2);
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcBaseNode.prototype, "crisp", 2);
+var OhlcNode = class extends OhlcBaseNode {
+ constructor() {
+ super(...arguments);
+ this.strokeAlignment = 0;
+ }
+ updatePath() {
+ const { path } = this;
+ const { centerX, x0, x1, y0, y1, yOpen, yClose } = this.alignedCoordinates();
+ const pixelRatio = this.layerManager?.canvas.pixelRatio ?? 1;
+ const strokeAlignment = this.strokeAlignment > 0 ? pixelRatio / this.strokeAlignment / 2 % 1 : 0;
+ path.clear();
+ path.moveTo(centerX - strokeAlignment, y0);
+ path.lineTo(centerX - strokeAlignment, y1);
+ if (Math.abs(x1 - x0) > 1) {
+ path.moveTo(x0, yOpen - strokeAlignment);
+ path.lineTo(centerX - strokeAlignment, yOpen - strokeAlignment);
+ path.moveTo(centerX - strokeAlignment, yClose - strokeAlignment);
+ path.lineTo(x1, yClose - strokeAlignment);
+ }
+ }
+};
+__decorateClass([
+ SceneChangeDetection2()
+], OhlcNode.prototype, "strokeAlignment", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickNode.ts
+var { SceneArrayChangeDetection: SceneArrayChangeDetection2, SceneChangeDetection: SceneChangeDetection3, ExtendedPath2D: ExtendedPath2D2, BBox: BBox4 } = _ModuleSupport28;
+var CandlestickNode = class extends OhlcBaseNode {
+ constructor() {
+ super(...arguments);
+ this.wickPath = new ExtendedPath2D2();
+ this.wickStroke = void 0;
+ this.wickStrokeWidth = void 0;
+ this.wickStrokeOpacity = void 0;
+ this.wickStrokeAlignment = 0;
+ }
+ computeDefaultGradientFillBBox() {
+ const { width, centerX, yOpen, yClose } = this;
+ const boxTop = Math.min(yOpen, yClose);
+ const boxBottom = Math.max(yOpen, yClose);
+ const rectHeight = boxBottom - boxTop;
+ const x0 = centerX - width / 2;
+ const x1 = centerX + width / 2;
+ return new BBox4(x0, boxTop, x1 - x0, rectHeight);
+ }
+ updatePath() {
+ const {
+ path,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke,
+ wickStrokeWidth,
+ wickStrokeOpacity,
+ wickLineDash,
+ wickLineDashOffset
+ } = this;
+ const { centerX, x0, x1, y0, y1, yOpen, yClose } = this.alignedCoordinates();
+ const pixelRatio = this.layerManager?.canvas.pixelRatio ?? 1;
+ const wickStrokeAlignment = this.wickStrokeAlignment > 0 ? pixelRatio / this.wickStrokeAlignment / 2 % 1 : 0;
+ this.path.clear();
+ this.wickPath.clear();
+ const needsWickPath = wickStroke != null && wickStroke !== stroke || wickStrokeWidth != null && wickStrokeWidth !== strokeWidth || wickStrokeOpacity != null && wickStrokeOpacity !== strokeOpacity || wickLineDash != null && wickLineDash !== lineDash || wickLineDashOffset != null && wickLineDashOffset !== lineDashOffset;
+ const wickPath = needsWickPath ? this.wickPath : path;
+ if (Math.abs(x1 - x0) <= 3) {
+ wickPath.moveTo(centerX - wickStrokeAlignment, y0);
+ wickPath.lineTo(centerX - wickStrokeAlignment, y1);
+ return;
+ }
+ const boxTop = Math.min(yOpen, yClose);
+ const boxBottom = Math.max(yOpen, yClose);
+ const boxStrokeAdjustment = strokeWidth / 2;
+ wickPath.moveTo(centerX - wickStrokeAlignment, y0);
+ wickPath.lineTo(centerX - wickStrokeAlignment, boxTop + boxStrokeAdjustment);
+ wickPath.moveTo(centerX - wickStrokeAlignment, y1);
+ wickPath.lineTo(centerX - wickStrokeAlignment, boxBottom - boxStrokeAdjustment);
+ const rectHeight = boxBottom - boxTop - 2 * boxStrokeAdjustment;
+ if (rectHeight > 0) {
+ path.rect(
+ x0 + boxStrokeAdjustment,
+ boxTop + boxStrokeAdjustment,
+ x1 - x0 - 2 * boxStrokeAdjustment,
+ rectHeight
+ );
+ } else {
+ const boxMid = (boxTop + boxBottom) / 2;
+ path.moveTo(x0, boxMid);
+ path.lineTo(x1, boxMid);
+ }
+ }
+ drawPath(ctx) {
+ super.drawPath(ctx);
+ const { wickPath } = this;
+ if (wickPath.isEmpty())
+ return;
+ const {
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke = stroke,
+ wickStrokeWidth = strokeWidth,
+ wickStrokeOpacity = strokeOpacity,
+ wickLineDash = lineDash,
+ wickLineDashOffset = lineDashOffset
+ } = this;
+ if (wickStrokeWidth === 0)
+ return;
+ ctx.globalAlpha *= wickStrokeOpacity;
+ if (typeof wickStroke === "string") {
+ ctx.strokeStyle = wickStroke;
+ }
+ ctx.lineWidth = wickStrokeWidth;
+ if (wickLineDash != null) {
+ ctx.setLineDash([...wickLineDash]);
+ }
+ ctx.lineDashOffset = wickLineDashOffset;
+ ctx.stroke(wickPath.getPath2D());
+ }
+};
+__decorateClass([
+ SceneChangeDetection3()
+], CandlestickNode.prototype, "wickStroke", 2);
+__decorateClass([
+ SceneChangeDetection3()
+], CandlestickNode.prototype, "wickStrokeWidth", 2);
+__decorateClass([
+ SceneChangeDetection3()
+], CandlestickNode.prototype, "wickStrokeOpacity", 2);
+__decorateClass([
+ SceneArrayChangeDetection2()
+], CandlestickNode.prototype, "wickLineDash", 2);
+__decorateClass([
+ SceneChangeDetection3()
+], CandlestickNode.prototype, "wickLineDashOffset", 2);
+__decorateClass([
+ SceneChangeDetection3()
+], CandlestickNode.prototype, "wickStrokeAlignment", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport30 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport29 } from "ag-charts-community";
+var { BaseProperties: BaseProperties3, Property: Property13, AbstractBarSeriesProperties: AbstractBarSeriesProperties2, makeSeriesTooltip: makeSeriesTooltip2 } = _ModuleSupport29;
+var OhlcSeriesItem = class extends BaseProperties3 {
+ constructor() {
+ super(...arguments);
+ this.stroke = "#333";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property13
+], OhlcSeriesItem.prototype, "stroke", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesItem.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesItem.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesItem.prototype, "lineDash", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesItem.prototype, "lineDashOffset", 2);
+var OhlcSeriesItems = class extends BaseProperties3 {
+ constructor() {
+ super(...arguments);
+ this.up = new OhlcSeriesItem();
+ this.down = new OhlcSeriesItem();
+ }
+};
+__decorateClass([
+ Property13
+], OhlcSeriesItems.prototype, "up", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesItems.prototype, "down", 2);
+var OhlcSeriesBaseProperties = class extends AbstractBarSeriesProperties2 {
+};
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "openKey", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "closeKey", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "highKey", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "lowKey", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "xName", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "yName", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "openName", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "closeName", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "highName", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesBaseProperties.prototype, "lowName", 2);
+var OhlcSeriesProperties = class extends OhlcSeriesBaseProperties {
+ constructor() {
+ super(...arguments);
+ this.tooltip = makeSeriesTooltip2();
+ this.item = new OhlcSeriesItems();
+ }
+ getStyle(itemId) {
+ const { strokeWidth, strokeOpacity, stroke, lineDash, lineDashOffset } = this.item[itemId];
+ return {
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property13
+], OhlcSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesProperties.prototype, "item", 2);
+__decorateClass([
+ Property13
+], OhlcSeriesProperties.prototype, "itemStyler", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeriesProperties.ts
+var { BaseProperties: BaseProperties4, makeSeriesTooltip: makeSeriesTooltip3, Property: Property14 } = _ModuleSupport30;
+var CandlestickSeriesWick = class extends BaseProperties4 {
+};
+__decorateClass([
+ Property14
+], CandlestickSeriesWick.prototype, "stroke", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesWick.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesWick.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesWick.prototype, "lineDash", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesWick.prototype, "lineDashOffset", 2);
+var CandlestickSeriesItem = class extends BaseProperties4 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#c16068";
+ this.fillOpacity = 1;
+ this.stroke = "#333";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.wick = new CandlestickSeriesWick();
+ }
+};
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "fill", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "stroke", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "lineDash", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItem.prototype, "wick", 2);
+var CandlestickSeriesItems = class extends BaseProperties4 {
+ constructor() {
+ super(...arguments);
+ this.up = new CandlestickSeriesItem();
+ this.down = new CandlestickSeriesItem();
+ }
+};
+__decorateClass([
+ Property14
+], CandlestickSeriesItems.prototype, "up", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesItems.prototype, "down", 2);
+var CandlestickSeriesProperties = class extends OhlcSeriesBaseProperties {
+ constructor() {
+ super();
+ this.item = new CandlestickSeriesItems();
+ this.tooltip = makeSeriesTooltip3();
+ this.highlightStyle.deprecated = false;
+ }
+ getStyle(itemId) {
+ const { fill, fillOpacity, strokeWidth, strokeOpacity, stroke, lineDash, lineDashOffset, cornerRadius, wick } = this.item[itemId];
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1,
+ wick
+ };
+ }
+};
+__decorateClass([
+ Property14
+], CandlestickSeriesProperties.prototype, "item", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property14
+], CandlestickSeriesProperties.prototype, "itemStyler", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeries.ts
+var { isGradientFill, isPatternFill, isImageFill, applyShapeStyle } = _ModuleSupport31;
+var CandlestickSeries = class extends OhlcSeriesBase {
+ constructor() {
+ super(...arguments);
+ this.properties = new CandlestickSeriesProperties();
+ }
+ nodeFactory() {
+ const node = new CandlestickNode();
+ node.lineCap = "butt";
+ return node;
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, datum) => {
+ datum.style = this.getItemStyle(datum.datumIndex, isHighlight, void 0, datum.itemId);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData, properties } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const { up, down } = properties.item;
+ datumSelection.each((node, datum) => {
+ const { centerX, width, y, height, yOpen, yClose, crisp } = datum;
+ const baseStyle = datum.isRising ? up : down;
+ const style = datum.style ?? contextNodeData.styles[datum.itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ node.centerX = centerX;
+ node.width = width;
+ node.y = y;
+ node.height = height;
+ node.yOpen = yOpen;
+ node.yClose = yClose;
+ node.crisp = crisp;
+ applyShapeStyle(node, style, this.getShapeFillBBox());
+ const styleWick = style?.wick;
+ node.wickStroke = styleWick?.stroke;
+ node.wickStrokeWidth = styleWick?.strokeWidth;
+ node.wickStrokeOpacity = styleWick?.strokeOpacity;
+ node.wickLineDash = styleWick?.lineDash;
+ node.wickLineDashOffset = styleWick?.lineDashOffset;
+ node.wickStrokeAlignment = baseStyle.wick.strokeWidth ?? baseStyle.strokeWidth;
+ });
+ }
+ legendItemSymbol() {
+ const { up, down } = this.properties.item;
+ const upColorStops = isGradientFill(up.fill) ? up.fill.colorStops.map(
+ (c) => typeof c === "string" ? c : { color: c.color, stop: c.stop == null ? void 0 : c.stop * 0.5 }
+ ) : [
+ { color: isPatternFill(up.fill) || isImageFill(up.fill) ? up.stroke : up.fill, stop: 0 },
+ { color: isPatternFill(up.fill) || isImageFill(up.fill) ? up.stroke : up.fill, stop: 0.5 }
+ ];
+ const downColorStops = isGradientFill(down.fill) ? down.fill.colorStops.map(
+ (c) => typeof c === "string" ? c : { color: c.color, stop: c.stop == null ? void 0 : c.stop * 0.5 }
+ ) : [{ color: isPatternFill(down.fill) || isImageFill(down.fill) ? down.stroke : down.fill, stop: 0.5 }];
+ const fill = {
+ type: "gradient",
+ gradient: "linear",
+ rotation: 90,
+ colorStops: [...upColorStops, ...downColorStops],
+ reverse: false
+ };
+ const stroke = {
+ type: "gradient",
+ gradient: "linear",
+ rotation: 90,
+ colorStops: [
+ { color: up.stroke, stop: 0 },
+ { color: up.stroke, stop: 0.5 },
+ { color: down.stroke, stop: 0.5 }
+ ],
+ reverse: false
+ };
+ return {
+ marker: {
+ fill,
+ fillOpacity: up.fillOpacity,
+ stroke,
+ strokeWidth: up.strokeWidth ?? 1,
+ strokeOpacity: up.strokeOpacity ?? 1,
+ lineDash: up.lineDash,
+ lineDashOffset: up.lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ id,
+ data,
+ visible,
+ ctx: { legendManager }
+ } = this;
+ const { xKey, yName, showInLegend, legendItemName } = this.properties;
+ if (!data?.data.length || !xKey || legendType !== "category") {
+ return [];
+ }
+ return [
+ {
+ legendType: "category",
+ id,
+ itemId: id,
+ seriesId: id,
+ enabled: visible && legendManager.getItemEnabled({ seriesId: id, itemId: id }),
+ label: {
+ text: legendItemName ?? yName ?? id
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null;
+ }
+};
+CandlestickSeries.className = "CandleStickSeries";
+CandlestickSeries.type = "candlestick";
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport32 } from "ag-charts-community";
+import { boolean as boolean3, constant as constant3, number as number2, required as required3, string as string3, undocumented } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs2, candlestickSeriesThemeableOptionsDef } = _ModuleSupport32;
+var candlestickSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs2,
+ ...candlestickSeriesThemeableOptionsDef,
+ type: required3(constant3("candlestick")),
+ xKey: required3(string3),
+ openKey: required3(string3),
+ highKey: required3(string3),
+ lowKey: required3(string3),
+ closeKey: required3(string3),
+ xName: string3,
+ yName: string3,
+ openName: string3,
+ highName: string3,
+ lowName: string3,
+ closeName: string3
+};
+candlestickSeriesOptionsDef.pickOutsideVisibleMinorAxis = undocumented(boolean3);
+candlestickSeriesOptionsDef.focusPriority = undocumented(number2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickThemes.ts
+import { _ModuleSupport as _ModuleSupport33 } from "ag-charts-community";
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE2 },
+ multiSeriesHighlightStyle: multiSeriesHighlightStyle2,
+ FILL_GRADIENT_LINEAR_KEYED_DEFAULTS,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS2,
+ FILL_PATTERN_KEYED_DEFAULTS
+} = _ModuleSupport33;
+function itemTheme(key) {
+ return {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ key === "up" ? "transparent" : { $palette: "fill" },
+ { $palette: `${key}.fill` }
+ ]
+ },
+ ["gradient", FILL_GRADIENT_LINEAR_KEYED_DEFAULTS(key)],
+ ["image", FILL_IMAGE_DEFAULTS2],
+ ["pattern", FILL_PATTERN_KEYED_DEFAULTS(key)]
+ ]
+ },
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $palette: "stroke" },
+ { $palette: `${key}.stroke` }
+ ]
+ }
+ };
+}
+var CANDLESTICK_SERIES_THEME = {
+ series: {
+ item: {
+ up: itemTheme("up"),
+ down: itemTheme("down")
+ },
+ highlightStyle: {
+ item: { strokeWidth: 3 }
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: multiSeriesHighlightStyle2()
+ },
+ animation: { enabled: false },
+ axes: {
+ [CARTESIAN_AXIS_TYPE2.NUMBER]: {
+ crosshair: {
+ snap: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE2.ORDINAL_TIME]: {
+ groupPaddingInner: 0,
+ crosshair: {
+ enabled: true
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickModule.ts
+var { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE3, CARTESIAN_POSITION } = _ModuleSupport34.ThemeConstants;
+var CandlestickModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "candlestick",
+ moduleFactory: (ctx) => new CandlestickSeries(ctx),
+ defaultAxes: [
+ {
+ type: CARTESIAN_AXIS_TYPE3.NUMBER,
+ position: CARTESIAN_POSITION.LEFT
+ },
+ {
+ type: CARTESIAN_AXIS_TYPE3.ORDINAL_TIME,
+ position: CARTESIAN_POSITION.BOTTOM
+ }
+ ],
+ themeTemplate: CANDLESTICK_SERIES_THEME,
+ groupable: false
+};
+var CandlestickSeriesModule = {
+ type: "series",
+ name: "candlestick",
+ chartType: "cartesian",
+ enterprise: true,
+ options: candlestickSeriesOptionsDef,
+ create: (ctx) => new CandlestickSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapModule.ts
+import { _ModuleSupport as _ModuleSupport40 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeries.ts
+import { _ModuleSupport as _ModuleSupport37 } from "ag-charts-community";
+import { Logger as Logger3, toPlainText } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/util/labelFormatter.ts
+import { Logger as Logger2, cachedTextMeasurer, findMaxValue, wrapLines } from "ag-charts-core";
+function generateLabelSecondaryLabelFontSizeCandidates(label, secondaryLabel) {
+ const { fontSize: labelFontSize, minimumFontSize: labelMinimumFontSize = labelFontSize } = label;
+ const {
+ fontSize: secondaryLabelFontSize,
+ minimumFontSize: secondaryLabelMinimumFontSize = secondaryLabelFontSize
+ } = secondaryLabel;
+ const labelTracks = labelFontSize - labelMinimumFontSize;
+ const secondaryLabelTracks = secondaryLabelFontSize - secondaryLabelMinimumFontSize;
+ let currentLabelFontSize = label.fontSize;
+ let currentSecondaryLabelFontSize = secondaryLabel.fontSize;
+ const out = [{ labelFontSize, secondaryLabelFontSize }];
+ while (currentLabelFontSize > labelMinimumFontSize || currentSecondaryLabelFontSize > secondaryLabelMinimumFontSize) {
+ const labelProgress = labelTracks > 0 ? (currentLabelFontSize - labelMinimumFontSize) / labelTracks : -1;
+ const secondaryLabelProgress = secondaryLabelTracks > 0 ? (currentSecondaryLabelFontSize - secondaryLabelMinimumFontSize) / secondaryLabelTracks : -1;
+ if (labelProgress > secondaryLabelProgress) {
+ currentLabelFontSize--;
+ } else {
+ currentSecondaryLabelFontSize--;
+ }
+ out.push({
+ labelFontSize: currentLabelFontSize,
+ secondaryLabelFontSize: currentSecondaryLabelFontSize
+ });
+ }
+ out.reverse();
+ return out;
+}
+function formatStackedLabels(labelValue, labelProps, secondaryLabelValue, secondaryLabelProps, { padding }, sizeFittingHeight) {
+ const { spacing = 0 } = labelProps;
+ const widthAdjust = 2 * padding;
+ const heightAdjust = 2 * padding + spacing;
+ const minimumHeight = (labelProps.minimumFontSize ?? labelProps.fontSize) + (secondaryLabelProps.minimumFontSize ?? secondaryLabelProps.fontSize);
+ if (minimumHeight > sizeFittingHeight(minimumHeight + heightAdjust, false).height - heightAdjust)
+ return;
+ const fontSizeCandidates = generateLabelSecondaryLabelFontSizeCandidates(labelProps, secondaryLabelProps);
+ const labelTextSizeProps = {
+ fontFamily: labelProps.fontFamily,
+ fontStyle: labelProps.fontStyle,
+ fontWeight: labelProps.fontWeight
+ };
+ const secondaryLabelTextSizeProps = {
+ fontFamily: secondaryLabelProps.fontFamily,
+ fontStyle: secondaryLabelProps.fontStyle,
+ fontWeight: secondaryLabelProps.fontWeight
+ };
+ let label;
+ let secondaryLabel;
+ return findMaxValue(0, fontSizeCandidates.length - 1, (index) => {
+ const { labelFontSize, secondaryLabelFontSize } = fontSizeCandidates[index];
+ const allowTruncation = index === 0;
+ const labelFont = { ...labelTextSizeProps, fontSize: labelFontSize };
+ const secondaryLabelFont = { ...secondaryLabelTextSizeProps, fontSize: secondaryLabelFontSize };
+ const labelLineHeight = cachedTextMeasurer(labelFont).lineHeight();
+ const secondaryLabelLineHeight = cachedTextMeasurer(secondaryLabelFont).lineHeight();
+ const sizeFitting = sizeFittingHeight(
+ labelLineHeight + secondaryLabelLineHeight + heightAdjust,
+ allowTruncation
+ );
+ const availableWidth = sizeFitting.width - widthAdjust;
+ const availableHeight = sizeFitting.height - heightAdjust;
+ if (labelLineHeight + secondaryLabelLineHeight > availableHeight)
+ return;
+ if (label == null || label.fontSize !== labelFontSize) {
+ label = wrapLabel(
+ labelProps,
+ labelValue,
+ availableWidth,
+ availableHeight,
+ labelFont,
+ labelProps.wrapping,
+ allowTruncation ? labelProps.overflowStrategy : "hide"
+ );
+ }
+ if (label == null || label.width > availableWidth || label.height > availableHeight)
+ return;
+ if (secondaryLabel == null || secondaryLabel.fontSize !== secondaryLabelFontSize) {
+ secondaryLabel = wrapLabel(
+ secondaryLabelProps,
+ secondaryLabelValue,
+ availableWidth,
+ availableHeight,
+ secondaryLabelFont,
+ secondaryLabelProps.wrapping,
+ allowTruncation ? secondaryLabelProps.overflowStrategy : "hide"
+ );
+ }
+ if (secondaryLabel == null)
+ return;
+ const totalLabelHeight = label.height + secondaryLabel.height;
+ if (secondaryLabel.width > availableWidth || totalLabelHeight > availableHeight)
+ return;
+ return {
+ width: Math.max(label.width, secondaryLabel.width),
+ height: totalLabelHeight + spacing,
+ meta: sizeFitting.meta,
+ label,
+ secondaryLabel
+ };
+ });
+}
+function formatSingleLabel(value, props, { padding }, sizeFittingHeight) {
+ const sizeAdjust = 2 * padding;
+ const minimumFontSize = Math.min(props.minimumFontSize ?? props.fontSize, props.fontSize);
+ const textSizeProps = {
+ fontFamily: props.fontFamily,
+ fontStyle: props.fontStyle,
+ fontWeight: props.fontWeight
+ };
+ return findMaxValue(minimumFontSize, props.fontSize, (fontSize) => {
+ const currentFont = { ...textSizeProps, fontSize };
+ const measurer = cachedTextMeasurer(currentFont);
+ const allowTruncation = fontSize === minimumFontSize;
+ const lineHeight = props.lineHeight ?? measurer.lineHeight();
+ const sizeFitting = sizeFittingHeight(lineHeight + sizeAdjust, allowTruncation);
+ const availableWidth = sizeFitting.width - sizeAdjust;
+ const availableHeight = sizeFitting.height - sizeAdjust;
+ if (lineHeight > availableHeight || availableWidth < 0)
+ return;
+ const lines = wrapLines(value, {
+ maxWidth: availableWidth,
+ maxHeight: availableHeight,
+ font: currentFont,
+ textWrap: props.wrapping,
+ overflow: (allowTruncation ? props.overflowStrategy : null) ?? "hide"
+ });
+ if (!lines.length)
+ return;
+ const { width, height } = measurer.measureLines(lines);
+ const text = lines.join("\n");
+ return [{ width, height, text, fontSize, lineHeight }, sizeFitting.meta];
+ });
+}
+function hasInvalidFontSize(label) {
+ return label?.minimumFontSize != null && label?.fontSize != null && label?.minimumFontSize > label?.fontSize;
+}
+function formatLabels(baseLabelValue, labelProps, baseSecondaryLabelValue, secondaryLabelProps, layoutParams, sizeFittingHeight) {
+ const labelValue = labelProps.enabled ? baseLabelValue : void 0;
+ const secondaryLabelValue = secondaryLabelProps.enabled ? baseSecondaryLabelValue : void 0;
+ if (hasInvalidFontSize(labelProps) || hasInvalidFontSize(secondaryLabelProps)) {
+ Logger2.warnOnce(`minimumFontSize should be set to a value less than or equal to the font size`);
+ }
+ let value;
+ if (labelValue != null && secondaryLabelValue != null) {
+ value = formatStackedLabels(
+ labelValue,
+ labelProps,
+ secondaryLabelValue,
+ secondaryLabelProps,
+ layoutParams,
+ sizeFittingHeight
+ );
+ }
+ let labelMeta;
+ if (value == null && labelValue != null) {
+ labelMeta = formatSingleLabel(labelValue, labelProps, layoutParams, sizeFittingHeight);
+ }
+ if (labelMeta != null) {
+ const [label, meta] = labelMeta;
+ value = {
+ width: label.width,
+ height: label.height,
+ meta,
+ label,
+ secondaryLabel: void 0
+ };
+ }
+ let secondaryLabelMeta;
+ if (value == null && labelValue == null && secondaryLabelValue != null) {
+ secondaryLabelMeta = formatSingleLabel(
+ secondaryLabelValue,
+ secondaryLabelProps,
+ layoutParams,
+ sizeFittingHeight
+ );
+ }
+ if (secondaryLabelMeta != null) {
+ const [secondaryLabel, meta] = secondaryLabelMeta;
+ value = {
+ width: secondaryLabel.width,
+ height: secondaryLabel.height,
+ meta,
+ label: void 0,
+ secondaryLabel
+ };
+ }
+ return value;
+}
+function wrapLabel(props, text, maxWidth, maxHeight, font, textWrap, overflow) {
+ const lines = wrapLines(text, { maxWidth, maxHeight, font, textWrap, overflow });
+ if (!lines.length)
+ return;
+ const measurer = cachedTextMeasurer(font);
+ const lineHeight = props.lineHeight ?? measurer.lineHeight();
+ const { width } = measurer.measureLines(lines);
+ return {
+ width,
+ lineHeight,
+ text: lines.join("\n"),
+ height: lines.length * lineHeight,
+ fontSize: font.fontSize
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport36 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/util/autoSizedLabel.ts
+import { _ModuleSupport as _ModuleSupport35 } from "ag-charts-community";
+var { Property: Property15 } = _ModuleSupport35;
+var BaseAutoSizedLabel = class extends _ModuleSupport35.Label {
+ constructor() {
+ super(...arguments);
+ this.wrapping = "on-space";
+ this.overflowStrategy = "ellipsis";
+ }
+};
+__decorateClass([
+ Property15
+], BaseAutoSizedLabel.prototype, "wrapping", 2);
+__decorateClass([
+ Property15
+], BaseAutoSizedLabel.prototype, "overflowStrategy", 2);
+__decorateClass([
+ Property15
+], BaseAutoSizedLabel.prototype, "lineHeight", 2);
+__decorateClass([
+ Property15
+], BaseAutoSizedLabel.prototype, "minimumFontSize", 2);
+var AutoSizedLabel = class extends BaseAutoSizedLabel {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property15
+], AutoSizedLabel.prototype, "spacing", 2);
+var AutoSizedSecondaryLabel = class extends BaseAutoSizedLabel {
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeriesProperties.ts
+var { CartesianSeriesProperties, makeSeriesTooltip: makeSeriesTooltip4, Property: Property16 } = _ModuleSupport36;
+var HeatmapSeriesProperties = class extends CartesianSeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.colorRange = ["black", "black"];
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.textAlign = "center";
+ this.verticalAlign = "middle";
+ this.itemPadding = 0;
+ this.label = new AutoSizedLabel();
+ this.tooltip = makeSeriesTooltip4();
+ }
+};
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "yKey", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "xName", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "yName", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "textAlign", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "verticalAlign", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "itemPadding", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property16
+], HeatmapSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode3,
+ computeBarFocusBounds: computeBarFocusBounds3,
+ getMissCount,
+ valueProperty: valueProperty3,
+ ChartAxisDirection: ChartAxisDirection9,
+ DEFAULT_CARTESIAN_DIRECTION_KEYS,
+ DEFAULT_CARTESIAN_DIRECTION_NAMES,
+ createDatumId: createDatumId3,
+ ColorScale,
+ Rect,
+ PointerEvents,
+ applyShapeStyle: applyShapeStyle2,
+ mergeDefaults: mergeDefaults4,
+ formatValue,
+ addHitTestersToQuadtree,
+ findQuadtreeMatch,
+ updateLabelNode
+} = _ModuleSupport37;
+var HeatmapSeriesNodeEvent = class extends _ModuleSupport37.CartesianSeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.colorKey = series.properties.colorKey;
+ }
+};
+var textAlignFactors = {
+ left: -0.5,
+ center: 0,
+ right: -0.5
+};
+var verticalAlignFactors = {
+ top: -0.5,
+ middle: 0,
+ bottom: -0.5
+};
+var HeatmapSeries = class extends _ModuleSupport37.CartesianSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ propertyKeys: {
+ ...DEFAULT_CARTESIAN_DIRECTION_KEYS,
+ color: ["colorKey"]
+ },
+ propertyNames: {
+ ...DEFAULT_CARTESIAN_DIRECTION_NAMES,
+ color: ["colorName"]
+ },
+ categoryKey: void 0,
+ pickModes: [SeriesNodePickMode3.NEAREST_NODE, SeriesNodePickMode3.EXACT_SHAPE_MATCH],
+ pathsPerSeries: []
+ });
+ this.properties = new HeatmapSeriesProperties();
+ this.NodeEvent = HeatmapSeriesNodeEvent;
+ this.colorScale = new ColorScale();
+ }
+ async processData(dataController) {
+ const xAxis = this.axes[ChartAxisDirection9.X];
+ const yAxis = this.axes[ChartAxisDirection9.Y];
+ if (!xAxis || !yAxis || !this.data?.data.length) {
+ return;
+ }
+ const { xKey, yKey, colorRange, colorKey } = this.properties;
+ const xScale = this.axes[ChartAxisDirection9.X]?.scale;
+ const yScale = this.axes[ChartAxisDirection9.Y]?.scale;
+ const { xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const colorScaleType = this.colorScale.type;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ valueProperty3(xKey, xScaleType, { id: "xValue" }),
+ valueProperty3(yKey, yScaleType, { id: "yValue" }),
+ ...colorKey ? [valueProperty3(colorKey, colorScaleType, { id: "colorValue", invalidValue: void 0 })] : []
+ ]
+ });
+ if (this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const rawDomain = processedData.domain.values[colorKeyIdx].filter((v) => v != null);
+ const domain = _ModuleSupport37.extent(rawDomain);
+ this.colorScale.domain = domain ?? [];
+ if (domain?.length && domain[0] === domain[1]) {
+ const midIndex = Math.floor(colorRange.length / 2);
+ this.colorScale.range = [colorRange[midIndex], colorRange[midIndex]];
+ } else {
+ this.colorScale.range = colorRange;
+ }
+ this.colorScale.update();
+ }
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorDataIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount(this, processedData.defs.values[colorDataIdx].missing);
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const actualCount = processedData.domain.values[colorKeyIdx].filter((v) => v != null).length;
+ const colorDataMissing = dataCount === 0 || dataCount === missCount || actualCount === 0;
+ return !colorDataMissing;
+ }
+ xCoordinateRange(xValue2, pixelSize) {
+ const xScale = this.axes[ChartAxisDirection9.X].scale;
+ const xOffset = pixelSize * (xScale.bandwidth ?? 0) / 2;
+ const x = xScale.convert(xValue2) + xOffset;
+ const width = pixelSize * (xScale.bandwidth ?? 10);
+ return [x, x + width];
+ }
+ yCoordinateRange(yValues, pixelSize) {
+ const yScale = this.axes[ChartAxisDirection9.Y].scale;
+ const yOffset = pixelSize * (yScale.bandwidth ?? 0) / 2;
+ const y = yScale.convert(yValues[0]) + yOffset;
+ const height = pixelSize * (yScale.bandwidth ?? 10);
+ return [y, y + height];
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData)
+ return [];
+ if (direction === ChartAxisDirection9.X) {
+ return dataModel.getDomain(this, `xValue`, "value", processedData);
+ } else {
+ return dataModel.getDomain(this, `yValue`, "value", processedData);
+ }
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ createNodeData() {
+ const { data, visible, axes, dataModel, processedData } = this;
+ const xAxis = axes[ChartAxisDirection9.X];
+ const yAxis = axes[ChartAxisDirection9.Y];
+ if (!(data && dataModel && processedData && visible && xAxis && yAxis))
+ return;
+ if (xAxis.type !== "category" || yAxis.type !== "category") {
+ Logger3.warnOnce(
+ `Heatmap series expected axes to have "category" type, but received "${xAxis.type}" and "${yAxis.type}" instead.`
+ );
+ return;
+ }
+ const { xKey, xName, yKey, yName, colorKey, colorName, textAlign, verticalAlign, itemPadding, label } = this.properties;
+ const xValues = dataModel.resolveColumnById(this, `xValue`, processedData);
+ const yValues = dataModel.resolveColumnById(this, `yValue`, processedData);
+ const colorValues = colorKey ? dataModel.resolveColumnById(this, `colorValue`, processedData) : void 0;
+ const colorDomain = colorKey ? dataModel.getDomain(this, "colorValue", "value", processedData) : [];
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const xOffset = (xScale.bandwidth ?? 0) / 2;
+ const yOffset = (yScale.bandwidth ?? 0) / 2;
+ const nodeData = [];
+ const labelData = [];
+ const width = xScale.bandwidth ?? 10;
+ const height = yScale.bandwidth ?? 10;
+ const textAlignFactor = (width - 2 * itemPadding) * textAlignFactors[textAlign];
+ const verticalAlignFactor = (height - 2 * itemPadding) * verticalAlignFactors[verticalAlign];
+ const sizeFittingHeight = () => ({ width, height, meta: null });
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xDatum = xValues[datumIndex];
+ const yDatum = yValues[datumIndex];
+ const x = xScale.convert(xDatum) + xOffset;
+ const y = yScale.convert(yDatum) + yOffset;
+ const colorValue = colorValues?.[datumIndex];
+ const labelText = label.enabled && colorValue != null ? this.getLabelText(
+ colorValue,
+ datum,
+ colorKey,
+ "color",
+ colorDomain,
+ label,
+ { value: colorValue, datum, colorKey, colorName, xKey, yKey, xName, yName }
+ ) : void 0;
+ const labels = formatLabels(
+ toPlainText(labelText),
+ this.properties.label,
+ void 0,
+ this.properties.label,
+ { padding: itemPadding },
+ sizeFittingHeight
+ );
+ const point = { x, y, size: 0 };
+ const style = this.getItemStyle({ datumIndex, datum, colorValue }, false);
+ nodeData.push({
+ series: this,
+ itemId: yKey,
+ datumIndex,
+ yKey,
+ xKey,
+ xValue: xDatum,
+ yValue: yDatum,
+ colorValue,
+ datum,
+ point,
+ width,
+ height,
+ midPoint: { x, y },
+ missing: colorValues != null && colorValue == null,
+ style
+ });
+ if (labels?.label != null) {
+ const { text, fontSize, lineHeight, height: labelHeight } = labels.label;
+ const { fontStyle, fontFamily, fontWeight, color: color6 } = this.properties.label;
+ const lx = point.x + textAlignFactor * (width - 2 * itemPadding);
+ const ly = point.y + verticalAlignFactor * (height - 2 * itemPadding) - (labels.height - labelHeight) * 0.5;
+ labelData.push({
+ series: this,
+ itemId: yKey,
+ datum,
+ datumIndex,
+ text,
+ fontSize,
+ lineHeight,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ textBaseline: verticalAlign,
+ x: lx,
+ y: ly,
+ style
+ });
+ }
+ }
+ return {
+ itemId: this.properties.yKey ?? this.id,
+ nodeData,
+ labelData,
+ scales: this.calculateScaling(),
+ visible: this.visible
+ };
+ }
+ nodeFactory() {
+ return new Rect();
+ }
+ update(params) {
+ this.ctx.animationManager.skipCurrentBatch();
+ return super.update(params);
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data);
+ }
+ getItemStyle({ datumIndex, datum, colorValue }, isHighlight) {
+ const { properties } = this;
+ const { itemStyler, stroke, strokeWidth, strokeOpacity } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const style = mergeDefaults4(highlightStyle, {
+ fill: this.isColorScaleValid() && colorValue != null ? this.colorScale.convert(colorValue) : "transparent",
+ fillOpacity: 1,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ opacity: 1
+ });
+ let overrides;
+ if (itemStyler != null && datumIndex != null) {
+ overrides = this.cachedDatumCallback(createDatumId3(datumIndex, isHighlight ? "highlight" : "node"), () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ });
+ }
+ return overrides ? mergeDefaults4(overrides, style) : style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId, properties } = this;
+ const { xKey, yKey } = properties;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ xKey,
+ yKey,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ const xAxis = this.axes[ChartAxisDirection9.X];
+ const [visibleMin, visibleMax] = xAxis?.visibleRange ?? [];
+ const isZoomed = visibleMin !== 0 || visibleMax !== 1;
+ const crisp = !isZoomed;
+ datumSelection.each((rect, nodeDatum) => {
+ const { point, width, height, style } = nodeDatum;
+ applyShapeStyle2(rect, style);
+ rect.crisp = crisp;
+ rect.x = Math.floor(point.x - width / 2);
+ rect.y = Math.floor(point.y - height / 2);
+ rect.width = Math.ceil(width);
+ rect.height = Math.ceil(height);
+ });
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ const { enabled } = this.properties.label;
+ const data = enabled ? labelData : [];
+ return labelSelection.update(data);
+ }
+ updateLabelNodes(opts) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((text, datum) => {
+ text.pointerEvents = PointerEvents.None;
+ text.text = datum.text;
+ text.fillOpacity = this.getHighlightStyle(false, datum.datumIndex)?.opacity ?? 1;
+ updateLabelNode(this, text, this.properties, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties, colorScale, ctx } = this;
+ const { formatManager } = ctx;
+ const { xKey, xName, yKey, yName, colorKey, colorName, colorRange, title, legendItemName, tooltip } = properties;
+ const xAxis = axes[ChartAxisDirection9.X];
+ const yAxis = axes[ChartAxisDirection9.Y];
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveColumnById(this, `xValue`, processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yValue`, processedData)[datumIndex];
+ const colorValue = colorKey != null && this.isColorScaleValid() ? dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex] : void 0;
+ if (xValue2 == null)
+ return;
+ const data = [];
+ let fill;
+ if (colorValue == null) {
+ fill = colorRange[0];
+ } else {
+ fill = colorScale.convert(colorValue);
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? formatValue(colorValue) });
+ }
+ data.push(
+ {
+ label: xName,
+ fallbackLabel: xKey,
+ value: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName)
+ },
+ {
+ label: yName,
+ fallbackLabel: yKey,
+ value: this.getAxisValueText(yAxis, "tooltip", yValue, datum, yKey, legendItemName)
+ }
+ );
+ const format = this.getItemStyle({ datumIndex, datum, colorValue }, false);
+ if (format.fill != null) {
+ fill = format.fill;
+ }
+ const symbol = fill == null ? void 0 : {
+ marker: {
+ shape: "square",
+ fill,
+ fillOpacity: 1,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ }
+ };
+ return this.formatTooltipWithContext(
+ tooltip,
+ { title: title ?? legendItemName, symbol, data },
+ {
+ seriesId,
+ datum,
+ title,
+ xKey,
+ xName,
+ yKey,
+ yName,
+ colorKey,
+ colorName,
+ ...format
+ }
+ );
+ }
+ getLegendData(legendType) {
+ if (legendType !== "gradient" || !this.isColorScaleValid() || !this.dataModel) {
+ return [];
+ }
+ return [
+ {
+ legendType: "gradient",
+ enabled: this.visible,
+ seriesId: this.id,
+ series: this.getFormatterContext("color"),
+ colorDomain: this.colorScale.domain,
+ colorRange: this.colorScale.range
+ }
+ ];
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled && Boolean(this.properties.colorKey);
+ }
+ getBandScalePadding() {
+ return { inner: 0, outer: 0 };
+ }
+ computeFocusBounds({ datumIndex }) {
+ const datum = this.contextNodeData?.nodeData[datumIndex];
+ if (datum === void 0)
+ return void 0;
+ const { width, height, midPoint } = datum;
+ const focusRect = { x: midPoint.x - width / 2, y: midPoint.y - height / 2, width, height };
+ return computeBarFocusBounds3(this, focusRect);
+ }
+ initQuadTree(quadtree) {
+ addHitTestersToQuadtree(quadtree, this.datumNodesIter());
+ }
+ pickNodesExactShape(point) {
+ const item = findQuadtreeMatch(this, point);
+ return item != null && item.distance <= 0 ? [item.datum] : [];
+ }
+ pickNodeClosestDatum(point) {
+ return findQuadtreeMatch(this, point);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+HeatmapSeries.className = "HeatmapSeries";
+HeatmapSeries.type = "heatmap";
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport38 } from "ag-charts-community";
+import { arrayOf as arrayOf2, color, constant as constant4, required as required4, string as string4 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs3, heatmapSeriesThemeableOptionsDef, without } = _ModuleSupport38;
+var heatmapSeriesOptionsDef = {
+ ...without(heatmapSeriesThemeableOptionsDef, ["showInLegend"]),
+ ...without(commonSeriesOptionsDefs3, ["showInLegend"]),
+ type: required4(constant4("heatmap")),
+ xKey: required4(string4),
+ yKey: required4(string4),
+ colorKey: string4,
+ xName: string4,
+ yName: string4,
+ colorName: string4,
+ colorRange: arrayOf2(color)
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapThemes.ts
+import { _ModuleSupport as _ModuleSupport39 } from "ag-charts-community";
+var HEATMAP_SERIES_THEME = {
+ series: {
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $ref: "chartBackgroundColor" },
+ { $path: ["/0", { $palette: "stroke" }, { $palette: "strokes" }] }
+ ]
+ },
+ strokeWidth: { $isUserOption: ["./stroke", 2, void 0] },
+ // @ts-expect-error undocumented option
+ colorRange: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $palette: "divergingColors" },
+ _ModuleSupport39.SAFE_RANGE2_OPERATION
+ ]
+ },
+ label: {
+ ..._ModuleSupport39.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ color: { $ref: "textColor" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ wrapping: "on-space",
+ overflowStrategy: "ellipsis"
+ },
+ itemPadding: 3,
+ highlight: _ModuleSupport39.singleSeriesHighlightStyle()
+ },
+ gradientLegend: {
+ enabled: true,
+ ..._ModuleSupport39.LEGEND_CONTAINER_THEME
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapModule.ts
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE4, CARTESIAN_POSITION: CARTESIAN_POSITION2 }
+} = _ModuleSupport40;
+var HeatmapModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "heatmap",
+ moduleFactory: (ctx) => new HeatmapSeries(ctx),
+ defaultAxes: [
+ { type: CARTESIAN_AXIS_TYPE4.CATEGORY, position: CARTESIAN_POSITION2.LEFT },
+ { type: CARTESIAN_AXIS_TYPE4.CATEGORY, position: CARTESIAN_POSITION2.BOTTOM }
+ ],
+ themeTemplate: HEATMAP_SERIES_THEME
+};
+var HeatmapSeriesModule = {
+ type: "series",
+ name: "heatmap",
+ chartType: "cartesian",
+ enterprise: true,
+ options: heatmapSeriesOptionsDef,
+ create: (ctx) => new HeatmapSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcModule.ts
+import { _ModuleSupport as _ModuleSupport43 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeries.ts
+import { _ModuleSupport as _ModuleSupport41 } from "ag-charts-community";
+var { applyShapeStyle: applyShapeStyle3 } = _ModuleSupport41;
+var OhlcSeries = class extends OhlcSeriesBase {
+ constructor() {
+ super(...arguments);
+ this.properties = new OhlcSeriesProperties();
+ }
+ nodeFactory() {
+ const node = new OhlcNode();
+ node.lineCap = "square";
+ return node;
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, datum) => {
+ datum.style = this.getItemStyle(datum.datumIndex, isHighlight, void 0, datum.itemId);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData, properties } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const { up, down } = properties.item;
+ datumSelection.each((node, datum) => {
+ const { centerX, width, y, height, yOpen, yClose, crisp } = datum;
+ const baseStyle = datum.isRising ? up : down;
+ node.centerX = centerX;
+ node.width = width;
+ node.y = y;
+ node.height = height;
+ node.yOpen = yOpen;
+ node.yClose = yClose;
+ node.crisp = crisp;
+ const style = datum.style ?? contextNodeData.styles[datum.itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ applyShapeStyle3(node, style);
+ node.strokeAlignment = baseStyle.strokeWidth;
+ });
+ }
+ getLegendData(legendType) {
+ const {
+ id,
+ data,
+ ctx: { legendManager },
+ visible
+ } = this;
+ const {
+ xKey,
+ yName,
+ item: { up, down },
+ showInLegend,
+ legendItemName
+ } = this.properties;
+ if (!data?.data.length || !xKey || legendType !== "category") {
+ return [];
+ }
+ const fill = {
+ type: "gradient",
+ gradient: "linear",
+ colorSpace: "rgb",
+ colorStops: [
+ { color: up.stroke, stop: 0 },
+ { color: up.stroke, stop: 0.5 },
+ { color: down.stroke, stop: 0.5 }
+ ],
+ rotation: 90
+ };
+ return [
+ {
+ legendType: "category",
+ id,
+ itemId: id,
+ seriesId: id,
+ enabled: visible && legendManager.getItemEnabled({ seriesId: id, itemId: id }),
+ label: {
+ text: legendItemName ?? yName ?? id
+ },
+ symbol: {
+ marker: {
+ fill,
+ fillOpacity: up.strokeOpacity,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ }
+ },
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null;
+ }
+};
+OhlcSeries.className = "ohlc";
+OhlcSeries.type = "ohlc";
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport42 } from "ag-charts-community";
+import { boolean as boolean4, constant as constant5, number as number3, required as required5, string as string5, undocumented as undocumented2 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs4, ohlcSeriesThemeableOptionsDef } = _ModuleSupport42;
+var ohlcSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs4,
+ ...ohlcSeriesThemeableOptionsDef,
+ type: required5(constant5("ohlc")),
+ xKey: required5(string5),
+ openKey: required5(string5),
+ highKey: required5(string5),
+ lowKey: required5(string5),
+ closeKey: required5(string5),
+ xName: string5,
+ yName: string5,
+ openName: string5,
+ highName: string5,
+ lowName: string5,
+ closeName: string5
+};
+ohlcSeriesOptionsDef.pickOutsideVisibleMinorAxis = undocumented2(boolean4);
+ohlcSeriesOptionsDef.focusPriority = undocumented2(number3);
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcModule.ts
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE5, CARTESIAN_POSITION: CARTESIAN_POSITION3 },
+ multiSeriesHighlightStyle: multiSeriesHighlightStyle3
+} = _ModuleSupport43;
+var OhlcModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "ohlc",
+ moduleFactory: (ctx) => new OhlcSeries(ctx),
+ defaultAxes: [
+ { type: CARTESIAN_AXIS_TYPE5.NUMBER, position: CARTESIAN_POSITION3.LEFT },
+ { type: CARTESIAN_AXIS_TYPE5.ORDINAL_TIME, position: CARTESIAN_POSITION3.BOTTOM }
+ ],
+ themeTemplate: {
+ animation: { enabled: false },
+ series: {
+ item: {
+ up: {
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $palette: "stroke" },
+ { $palette: "up.stroke" }
+ ]
+ }
+ },
+ down: {
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $palette: "stroke" },
+ { $palette: "down.stroke" }
+ ]
+ }
+ }
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: multiSeriesHighlightStyle3(false)
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE5.NUMBER]: {
+ crosshair: {
+ snap: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE5.ORDINAL_TIME]: {
+ groupPaddingInner: 0,
+ crosshair: {
+ enabled: true
+ }
+ }
+ }
+ },
+ groupable: false
+};
+var OhlcSeriesModule = {
+ type: "series",
+ name: "ohlc",
+ chartType: "cartesian",
+ enterprise: true,
+ options: ohlcSeriesOptionsDef,
+ create: (ctx) => new OhlcSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaModule.ts
+import { _ModuleSupport as _ModuleSupport51 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeArea.ts
+import {
+ _ModuleSupport as _ModuleSupport48
+} from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaAggregation.ts
+import { _ModuleSupport as _ModuleSupport44 } from "ag-charts-community";
+var {
+ AGGREGATION_INDEX_Y_MAX: AGGREGATION_INDEX_Y_MAX2,
+ AGGREGATION_INDEX_Y_MIN: AGGREGATION_INDEX_Y_MIN2,
+ aggregationDomain: aggregationDomain2,
+ aggregationIndexForXRatio,
+ aggregationRangeFittingPoints: aggregationRangeFittingPoints2,
+ aggregationXRatioForXValue,
+ compactAggregationIndices: compactAggregationIndices2,
+ createAggregationIndices: createAggregationIndices2
+} = _ModuleSupport44;
+var AGGREGATION_THRESHOLD2 = 1e3;
+function aggregationContainsTopIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf) {
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ return false;
+ const xRatio = aggregationXRatioForXValue(xValue2, d0, d1, xNeedsValueOf);
+ const aggIndex = aggregationIndexForXRatio(xRatio, maxRange);
+ return datumIndex === indexData[aggIndex + AGGREGATION_INDEX_Y_MAX2];
+}
+function aggregationContainsBottomIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf) {
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ return false;
+ const xRatio = aggregationXRatioForXValue(xValue2, d0, d1, xNeedsValueOf);
+ const aggIndex = aggregationIndexForXRatio(xRatio, maxRange);
+ return datumIndex === indexData[aggIndex + AGGREGATION_INDEX_Y_MIN2];
+}
+function aggregateRangeAreaData(scale, xValues, highValues, lowValues, domain, xNeedsValueOf, yNeedsValueOf) {
+ if (xValues.length < AGGREGATION_THRESHOLD2)
+ return;
+ const [d0, d1] = aggregationDomain2(scale, domain);
+ let maxRange = aggregationRangeFittingPoints2(xValues, d0, d1, { xNeedsValueOf });
+ const { indexData, valueData } = createAggregationIndices2(xValues, highValues, lowValues, d0, d1, maxRange, {
+ xNeedsValueOf,
+ yNeedsValueOf
+ });
+ let topIndices = [];
+ let bottomIndices = [];
+ for (let datumIndex = 0; datumIndex < xValues.length; datumIndex += 1) {
+ if (aggregationContainsTopIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)) {
+ topIndices.push(datumIndex);
+ }
+ if (aggregationContainsBottomIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)) {
+ bottomIndices.push(datumIndex);
+ }
+ }
+ const filters = [{ maxRange, topIndices, bottomIndices }];
+ while (maxRange > 64) {
+ ({ maxRange } = compactAggregationIndices2(indexData, valueData, maxRange, { inPlace: true }));
+ topIndices = topIndices.filter(
+ (datumIndex) => aggregationContainsTopIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)
+ );
+ bottomIndices = bottomIndices.filter(
+ (datumIndex) => aggregationContainsBottomIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)
+ );
+ filters.push({ maxRange, topIndices, bottomIndices });
+ }
+ filters.reverse();
+ return filters;
+}
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaIntersection.ts
+import { _ModuleSupport as _ModuleSupport45 } from "ag-charts-community";
+function getYValueAtX({ span }, x) {
+ switch (span.type) {
+ case "linear":
+ case "step":
+ case "multi-line": {
+ const t = (x - span.x0) / (span.x1 - span.x0);
+ return span.y0 + t * (span.y1 - span.y0);
+ }
+ case "cubic": {
+ const { cp0x, cp0y, cp1x, cp1y, cp2x, cp2y, cp3x, cp3y } = span;
+ let t = 0.5;
+ const tolerance = 1e-6;
+ for (let i = 0; i < 10; i++) {
+ const mt2 = 1 - t;
+ const xt = mt2 * mt2 * mt2 * cp0x + 3 * mt2 * mt2 * t * cp1x + 3 * mt2 * t * t * cp2x + t * t * t * cp3x;
+ const fx = xt - x;
+ if (Math.abs(fx) < tolerance)
+ break;
+ const dxdt = 3 * mt2 * mt2 * (cp1x - cp0x) + 6 * mt2 * t * (cp2x - cp1x) + 3 * t * t * (cp3x - cp2x);
+ if (Math.abs(dxdt) < 1e-12)
+ break;
+ t = t - fx / dxdt;
+ t = Math.max(0, Math.min(1, t));
+ }
+ const mt = 1 - t;
+ return mt * mt * mt * cp0y + 3 * mt * mt * t * cp1y + 3 * mt * t * t * cp2y + t * t * t * cp3y;
+ }
+ }
+}
+function findSpanForX(spans, x, startIndex = 0) {
+ for (let i = startIndex; i < spans.length; i++) {
+ const span = spans[i];
+ const [start, end] = _ModuleSupport45.spanRange(span.span);
+ if (x >= start.x && x <= end.x) {
+ return { span, index: i };
+ }
+ if (x < start.x) {
+ break;
+ }
+ }
+ return { span: null, index: startIndex };
+}
+function checkForIntersection(highSpans, lowSpans, x, wasInverted, spanIndex) {
+ const high = findSpanForX(highSpans, x, spanIndex);
+ const low = findSpanForX(lowSpans, x, spanIndex);
+ if (!high.span || !low.span) {
+ return { intersection: null, spanIndex: high.index, isInverted: wasInverted };
+ }
+ const highY = getYValueAtX(high.span, x);
+ const lowY = getYValueAtX(low.span, x);
+ const isInverted = highY > lowY;
+ const intersection = wasInverted === isInverted ? null : { x, y: highY };
+ return { intersection, spanIndex: high.index, isInverted };
+}
+function findRangeAreaIntersections(highSpans, lowSpans, minX, maxX, initiallyInverted = false) {
+ if (highSpans.length === 0 || lowSpans.length === 0)
+ return [];
+ const intersections = [];
+ let wasInverted = initiallyInverted;
+ let spanIndex = 0;
+ for (let x = minX; x <= maxX; x += 0.5) {
+ const result = checkForIntersection(highSpans, lowSpans, x, wasInverted, spanIndex);
+ if (result.intersection) {
+ intersections.push(result.intersection.x);
+ }
+ spanIndex = result.spanIndex;
+ wasInverted = result.isInverted;
+ }
+ return intersections;
+}
+function calculateIntersectionSegments(intersections, seriesRect, chartSize, startsInverted, style = {}) {
+ const horizontalMargin = Math.max(seriesRect.x, chartSize.width - (seriesRect.x + seriesRect.width));
+ const verticalMargin = Math.max(seriesRect.y, chartSize.height - (seriesRect.y + seriesRect.height));
+ const result = [];
+ const createClipRect = (x0, x1) => ({
+ x0,
+ y0: -verticalMargin,
+ x1,
+ y1: seriesRect.height + verticalMargin
+ });
+ if (startsInverted) {
+ result.push({
+ clipRect: createClipRect(-horizontalMargin, intersections[0] ?? seriesRect.width + horizontalMargin),
+ ...style
+ });
+ }
+ const startIndex = startsInverted ? 1 : 0;
+ for (let i = startIndex; i < intersections.length; i += 2) {
+ result.push({
+ clipRect: createClipRect(intersections[i], intersections[i + 1] ?? seriesRect.width + horizontalMargin),
+ ...style
+ });
+ }
+ return result;
+}
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaProperties.ts
+import { _ModuleSupport as _ModuleSupport46 } from "ag-charts-community";
+var {
+ BaseProperties: BaseProperties5,
+ CartesianSeriesProperties: CartesianSeriesProperties2,
+ InterpolationProperties,
+ SeriesMarker,
+ makeSeriesTooltip: makeSeriesTooltip5,
+ Property: Property17,
+ DropShadow,
+ Label
+} = _ModuleSupport46;
+var RangeAreaSeriesLabel = class extends Label {
+ constructor() {
+ super(...arguments);
+ this.placement = "outside";
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property17
+], RangeAreaSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property17
+], RangeAreaSeriesLabel.prototype, "spacing", 2);
+var RangeAreaInvertedStyle = class {
+ constructor() {
+ this.enabled = false;
+ this.fillOpacity = 1;
+ }
+};
+__decorateClass([
+ Property17
+], RangeAreaInvertedStyle.prototype, "enabled", 2);
+__decorateClass([
+ Property17
+], RangeAreaInvertedStyle.prototype, "fill", 2);
+__decorateClass([
+ Property17
+], RangeAreaInvertedStyle.prototype, "fillOpacity", 2);
+var RangeAreaLineStyle = class extends BaseProperties5 {
+ constructor() {
+ super(...arguments);
+ this.stroke = "#99CCFF";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.marker = new SeriesMarker();
+ }
+};
+__decorateClass([
+ Property17
+], RangeAreaLineStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property17
+], RangeAreaLineStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property17
+], RangeAreaLineStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property17
+], RangeAreaLineStyle.prototype, "lineDash", 2);
+__decorateClass([
+ Property17
+], RangeAreaLineStyle.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property17
+], RangeAreaLineStyle.prototype, "marker", 2);
+var RangeAreaItemProperties = class extends BaseProperties5 {
+ constructor() {
+ super(...arguments);
+ this.low = new RangeAreaLineStyle();
+ this.high = new RangeAreaLineStyle();
+ }
+};
+__decorateClass([
+ Property17
+], RangeAreaItemProperties.prototype, "low", 2);
+__decorateClass([
+ Property17
+], RangeAreaItemProperties.prototype, "high", 2);
+var SharedRangeAreaMarker = class extends BaseProperties5 {
+};
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "enabled", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "shape", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "size", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "fill", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "stroke", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "lineDash", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property17
+], SharedRangeAreaMarker.prototype, "itemStyler", 2);
+var RangeAreaProperties = class extends CartesianSeriesProperties2 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#99CCFF";
+ this.fillOpacity = 1;
+ this.stroke = "#99CCFF";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.interpolation = new InterpolationProperties();
+ this.item = new RangeAreaItemProperties();
+ this.invertedStyle = new RangeAreaInvertedStyle();
+ this.shadow = new DropShadow().set({ enabled: false });
+ this.marker = new SharedRangeAreaMarker();
+ this.label = new RangeAreaSeriesLabel();
+ this.tooltip = makeSeriesTooltip5();
+ this.connectMissingData = false;
+ }
+};
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "yLowKey", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "yHighKey", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "xName", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "yName", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "yLowName", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "yHighName", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "fill", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "interpolation", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "styler", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "item", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "invertedStyle", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "marker", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "label", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property17
+], RangeAreaProperties.prototype, "connectMissingData", 2);
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaUtil.ts
+import {
+ _ModuleSupport as _ModuleSupport47
+} from "ag-charts-community";
+var {
+ CollapseMode,
+ isScaleValid,
+ pairUpSpans,
+ prepareAreaFillAnimationFns,
+ plotInterpolatedLinePathStroke,
+ prepareLinePathPropertyAnimation,
+ areScalingEqual
+} = _ModuleSupport47;
+function prepareRangeAreaPathStrokeAnimationFns(status, highSpans, lowSpans, visibleToggleMode) {
+ const removePhaseFn = (ratio3, path) => {
+ plotInterpolatedLinePathStroke(ratio3, path, highSpans.removed);
+ plotInterpolatedLinePathStroke(ratio3, path, lowSpans.removed);
+ };
+ const updatePhaseFn = (ratio3, path) => {
+ plotInterpolatedLinePathStroke(ratio3, path, highSpans.moved);
+ plotInterpolatedLinePathStroke(ratio3, path, lowSpans.moved);
+ };
+ const addPhaseFn = (ratio3, path) => {
+ plotInterpolatedLinePathStroke(ratio3, path, highSpans.added);
+ plotInterpolatedLinePathStroke(ratio3, path, lowSpans.added);
+ };
+ const pathProperties = prepareLinePathPropertyAnimation(status, visibleToggleMode);
+ return { status, path: { addPhaseFn, updatePhaseFn, removePhaseFn }, pathProperties };
+}
+function prepareRangeAreaPathAnimation(newData, oldData, diff8) {
+ const isCategoryBased = newData.scales.x?.type === "category";
+ const wasCategoryBased = oldData.scales.x?.type === "category";
+ if (isCategoryBased !== wasCategoryBased || !isScaleValid(newData.scales.x) || !isScaleValid(oldData.scales.x)) {
+ return;
+ }
+ let status = "updated";
+ if (oldData.visible && !newData.visible) {
+ status = "removed";
+ } else if (!oldData.visible && newData.visible) {
+ status = "added";
+ }
+ const fillSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.fillData.spans },
+ { scales: oldData.scales, data: oldData.fillData.spans },
+ CollapseMode.Split
+ );
+ if (fillSpans == null)
+ return;
+ const fillPhantomSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.fillData.phantomSpans },
+ { scales: oldData.scales, data: oldData.fillData.phantomSpans },
+ CollapseMode.Split
+ );
+ if (fillPhantomSpans == null)
+ return;
+ const highStrokeSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.highStrokeData.spans },
+ { scales: oldData.scales, data: oldData.highStrokeData.spans },
+ CollapseMode.Split
+ );
+ if (highStrokeSpans == null)
+ return;
+ const lowStrokeSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.lowStrokeData.spans },
+ { scales: oldData.scales, data: oldData.lowStrokeData.spans },
+ CollapseMode.Split
+ );
+ if (lowStrokeSpans == null)
+ return;
+ const fadeMode = "fade";
+ const fill = prepareAreaFillAnimationFns(status, fillSpans, fillPhantomSpans, fadeMode);
+ const stroke = prepareRangeAreaPathStrokeAnimationFns(status, highStrokeSpans, lowStrokeSpans, fadeMode);
+ const hasMotion = (diff8?.changed ?? true) || !areScalingEqual(newData.scales.x, oldData.scales.x) || !areScalingEqual(newData.scales.y, oldData.scales.y) || status !== "updated";
+ return { status, fill, stroke, hasMotion };
+}
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeArea.ts
+var {
+ valueProperty: valueProperty4,
+ keyProperty: keyProperty3,
+ ChartAxisDirection: ChartAxisDirection10,
+ mergeDefaults: mergeDefaults5,
+ updateLabelNode: updateLabelNode2,
+ fixNumericExtent: fixNumericExtent3,
+ buildResetPathFn,
+ resetLabelFn,
+ resetMarkerFn,
+ resetMarkerPositionFn,
+ pathSwipeInAnimation,
+ resetMotion,
+ markerSwipeScaleInAnimation,
+ seriesLabelFadeInAnimation,
+ animationValidation: animationValidation3,
+ diff: diff3,
+ updateClipPath,
+ computeMarkerFocusBounds,
+ plotAreaPathFill,
+ plotLinePathStroke,
+ interpolatePoints,
+ pathFadeInAnimation,
+ markerFadeInAnimation,
+ fromToMotion,
+ pathMotion,
+ extent,
+ applyShapeFillBBox: applyShapeFillBBox2,
+ PointerEvents: PointerEvents2,
+ Marker,
+ BBox: BBox5,
+ findMinMax: findMinMax2,
+ applyShapeStyle: applyShapeStyle4,
+ processedDataIsAnimatable: processedDataIsAnimatable2,
+ simpleMemorize2: simpleMemorize22,
+ markerEnabled,
+ getMarkerStyles,
+ calculateSegments: calculateSegments2,
+ toHighlightString: toHighlightString2,
+ HighlightState: HighlightState2
+} = _ModuleSupport48;
+var memoizedAggregateRangeAreaData = simpleMemorize22(aggregateRangeAreaData);
+var RangeAreaSeriesNodeEvent = class extends _ModuleSupport48.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.yLowKey = series.properties.yLowKey;
+ this.yHighKey = series.properties.yHighKey;
+ }
+};
+var BaseSeries = _ModuleSupport48.CartesianSeries;
+var RangeAreaSeries = class extends BaseSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pathsPerSeries: ["fill", "lowStroke", "highStroke"],
+ pickModes: [_ModuleSupport48.SeriesNodePickMode.AXIS_ALIGNED],
+ propertyKeys: {
+ [ChartAxisDirection10.X]: ["xKey"],
+ [ChartAxisDirection10.Y]: ["yLowKey", "yHighKey"]
+ },
+ propertyNames: {
+ [ChartAxisDirection10.X]: ["xName"],
+ [ChartAxisDirection10.Y]: ["yLowName", "yHighName", "yName"]
+ },
+ categoryKey: "xValue",
+ animationResetFns: {
+ path: buildResetPathFn({ getVisible: () => this.visible, getOpacity: () => this.getOpacity() }),
+ label: resetLabelFn,
+ datum: (node, datum) => ({ ...resetMarkerFn(node), ...resetMarkerPositionFn(node, datum) })
+ },
+ clipFocusBox: false
+ });
+ this.properties = new RangeAreaProperties();
+ this.NodeEvent = RangeAreaSeriesNodeEvent;
+ this.dataAggregationFilters = void 0;
+ }
+ async processData(dataController) {
+ const { xKey, yLowKey, yHighKey } = this.properties;
+ const xScale = this.axes[ChartAxisDirection10.X]?.scale;
+ const yScale = this.axes[ChartAxisDirection10.Y]?.scale;
+ const { xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ if (!this.ctx.animationManager.isSkipped() && this.processedData) {
+ extraProps.push(diff3(this.id, this.processedData));
+ }
+ if (animationEnabled) {
+ extraProps.push(animationValidation3());
+ }
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty3(xKey, xScaleType, { id: `xValue` }),
+ valueProperty4(yLowKey, yScaleType, { id: `yLowValue` }),
+ valueProperty4(yHighKey, yScaleType, { id: `yHighValue` }),
+ ...extraProps
+ ]
+ });
+ this.dataAggregationFilters = this.aggregateData(dataModel, processedData);
+ this.animationState.transition("updateData");
+ }
+ aggregateData(dataModel, processedData) {
+ if (processedData.type !== "ungrouped")
+ return;
+ if (processedDataIsAnimatable2(processedData))
+ return;
+ const xAxis = this.axes[ChartAxisDirection10.X];
+ if (xAxis == null)
+ return;
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yHighValues = dataModel.resolveColumnById(this, `yHighValue`, processedData);
+ const yLowValues = dataModel.resolveColumnById(this, `yLowValue`, processedData);
+ const { index } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const domain = processedData.domain.keys[index];
+ const xNeedsValueOf = dataModel.resolveColumnNeedsValueOf(this, `xValue`, processedData);
+ const yNeedsValueOf = dataModel.resolveColumnNeedsValueOf(this, `yHighValue`, processedData);
+ return memoizedAggregateRangeAreaData(
+ xAxis.scale.type,
+ xValues,
+ yHighValues,
+ yLowValues,
+ domain,
+ xNeedsValueOf,
+ yNeedsValueOf
+ );
+ }
+ xCoordinateRange(xValue2) {
+ const x = this.axes[ChartAxisDirection10.X].scale.convert(xValue2);
+ return [x, x];
+ }
+ yCoordinateRange(yValues) {
+ const y = this.axes[ChartAxisDirection10.Y].scale.convert(yValues[0]);
+ return [y, y];
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!(processedData && dataModel))
+ return [];
+ const {
+ domain: {
+ keys: [keys]
+ }
+ } = processedData;
+ if (direction === ChartAxisDirection10.X) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef.def.valueType === "category") {
+ return keys;
+ }
+ return fixNumericExtent3(extent(keys));
+ } else {
+ const yExtent = this.domainForClippedRange(ChartAxisDirection10.Y, ["yHighValue", "yLowValue"], "xValue");
+ const fixedYExtent = findMinMax2(yExtent);
+ return fixNumericExtent3(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection10.Y, ["yHighValue", "yLowValue"], "xValue", visibleRange);
+ }
+ createNodeData() {
+ const { data, dataModel, processedData, axes } = this;
+ const xAxis = axes[ChartAxisDirection10.X];
+ const yAxis = axes[ChartAxisDirection10.Y];
+ if (!(data && xAxis && yAxis && dataModel && processedData && this.chart?.seriesRect))
+ return;
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const { xKey, yLowKey, yHighKey, connectMissingData, interpolation, fill, fillOpacity, item } = this.properties;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const xOffset = (xScale.bandwidth ?? 0) / 2;
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const yHighValues = dataModel.resolveColumnById(this, "yHighValue", processedData);
+ const yLowValues = dataModel.resolveColumnById(this, "yLowValue", processedData);
+ const xPosition = (index) => xScale.convert(xValues[index]) + xOffset;
+ const labelData = [];
+ const markerData = [];
+ const spanPoints = [];
+ const handleDatumPoint = (datumIndex, yHighValue, yLowValue) => {
+ const datum = rawData[datumIndex];
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ return;
+ const currentSpanPoints = spanPoints.at(-1);
+ if (Number.isFinite(yHighValue) && Number.isFinite(yLowValue)) {
+ const appendMarker = (id, yValue, y) => {
+ const { size } = item[id].marker;
+ markerData.push({
+ index: datumIndex,
+ series: this,
+ itemId: id,
+ datum,
+ datumIndex,
+ midPoint: { x, y },
+ yHighValue,
+ yLowValue,
+ xValue: xValue2,
+ xKey,
+ yLowKey,
+ yHighKey,
+ point: { x, y, size },
+ enabled: true
+ });
+ const highLabelDatum = this.createLabelData({
+ datumIndex,
+ point: { x, y },
+ value: yValue,
+ yLowValue,
+ yHighValue,
+ itemId: id,
+ inverted,
+ datum,
+ series: this
+ });
+ labelData.push(highLabelDatum);
+ };
+ const inverted = yLowValue > yHighValue;
+ const x = xPosition(datumIndex);
+ const yHighCoordinate = yScale.convert(yHighValue);
+ const yLowCoordinate = yScale.convert(yLowValue);
+ appendMarker("high", yHighValue, yHighCoordinate);
+ appendMarker("low", yLowValue, yLowCoordinate);
+ const spanPoint = {
+ high: {
+ point: { x, y: yHighCoordinate },
+ xDatum: xValue2,
+ yDatum: yHighValue
+ },
+ low: {
+ point: { x, y: yLowCoordinate },
+ xDatum: xValue2,
+ yDatum: yLowValue
+ }
+ };
+ if (Array.isArray(currentSpanPoints)) {
+ currentSpanPoints.push(spanPoint);
+ } else if (currentSpanPoints == null) {
+ spanPoints.push([spanPoint]);
+ } else {
+ currentSpanPoints.skip += 1;
+ spanPoints.push([spanPoint]);
+ }
+ } else if (!connectMissingData) {
+ if (Array.isArray(currentSpanPoints) || currentSpanPoints == null) {
+ spanPoints.push({ skip: 0 });
+ } else {
+ currentSpanPoints.skip += 1;
+ }
+ }
+ };
+ const { dataAggregationFilters } = this;
+ const [r0, r1] = xScale.range;
+ const range2 = Math.abs(r1 - r0);
+ const dataAggregationFilter = dataAggregationFilters?.find((f) => f.maxRange > range2);
+ const topIndices = dataAggregationFilter?.topIndices;
+ const bottomIndices = dataAggregationFilter?.bottomIndices;
+ let [start, end] = this.visibleRangeIndices("xValue", xAxis.range, topIndices);
+ start = Math.max(start - 1, 0);
+ end = Math.min(end + 1, topIndices?.length ?? xValues.length);
+ if (processedData.input.count < 1e3) {
+ start = 0;
+ end = processedData.input.count;
+ }
+ for (let i = start; i < end; i += 1) {
+ const topDatumIndex = topIndices?.[i] ?? i;
+ const bottomDatumIndex = bottomIndices?.[i] ?? i;
+ handleDatumPoint(topDatumIndex, yHighValues[topDatumIndex], yLowValues[bottomDatumIndex]);
+ }
+ const highSpans = spanPoints.flatMap((p) => {
+ if (!Array.isArray(p))
+ return [];
+ const highPoints = p.map((d) => d.high);
+ return interpolatePoints(highPoints, interpolation);
+ });
+ const lowSpans = spanPoints.flatMap((p) => {
+ if (!Array.isArray(p))
+ return [];
+ const lowPoints = p.map((d) => d.low);
+ return interpolatePoints(lowPoints, interpolation);
+ });
+ const segments = calculateSegments2(
+ this.properties.segmentation,
+ xAxis,
+ yAxis,
+ this.chart.seriesRect,
+ this.ctx.scene,
+ false
+ );
+ let intersectionSegments = void 0;
+ if (this.properties.invertedStyle.enabled) {
+ const startsInverted = yHighValues[0] < yLowValues[0];
+ const intersectionXValues = findRangeAreaIntersections(
+ highSpans,
+ lowSpans,
+ xScale.range[0],
+ xScale.range[1],
+ startsInverted
+ );
+ intersectionSegments = calculateIntersectionSegments(
+ intersectionXValues,
+ this.chart.seriesRect,
+ this.ctx.scene,
+ startsInverted,
+ this.properties.invertedStyle
+ );
+ }
+ const getLowOrHighMarkerStyles = (lowOrHigh) => {
+ const line = item[lowOrHigh];
+ const { stroke, strokeWidth, strokeOpacity } = line;
+ const inheritedStyles = { fill, fillOpacity, stroke, strokeWidth, strokeOpacity };
+ return getMarkerStyles(this, line, line.marker, inheritedStyles);
+ };
+ const context = {
+ itemId: `${yLowKey}-${yHighKey}`,
+ labelData,
+ nodeData: markerData,
+ fillData: { itemId: "high", spans: highSpans, phantomSpans: lowSpans },
+ highStrokeData: { itemId: "high", spans: highSpans },
+ lowStrokeData: { itemId: "low", spans: lowSpans },
+ scales: this.calculateScaling(),
+ visible: this.visible,
+ styles: {
+ low: getLowOrHighMarkerStyles("low"),
+ high: getLowOrHighMarkerStyles("high")
+ },
+ segments,
+ intersectionSegments
+ };
+ return context;
+ }
+ createLabelData({
+ datumIndex,
+ point,
+ value,
+ itemId,
+ inverted,
+ datum,
+ series
+ }) {
+ const { xKey, yLowKey, yHighKey, xName, yName, yLowName, yHighName, legendItemName, label } = this.properties;
+ const { placement } = label;
+ const spacing = label.spacing + (typeof label.padding === "number" ? label.padding : 0);
+ let actualItemId = itemId;
+ if (inverted) {
+ actualItemId = itemId === "low" ? "high" : "low";
+ }
+ const direction = placement === "outside" && actualItemId === "high" || placement === "inside" && actualItemId === "low" ? -1 : 1;
+ const yDomain = this.getSeriesDomain(ChartAxisDirection10.Y);
+ return {
+ x: point.x,
+ y: point.y + spacing * direction,
+ series,
+ itemId,
+ datum,
+ datumIndex,
+ text: this.getLabelText(
+ value,
+ datum,
+ itemId === "high" ? yHighKey : yLowKey,
+ "y",
+ yDomain,
+ label,
+ { value, datum, itemId, xKey, yLowKey, yHighKey, xName, yLowName, yHighName, yName, legendItemName }
+ ),
+ textAlign: "center",
+ textBaseline: direction === -1 ? "bottom" : "top"
+ };
+ }
+ isPathOrSelectionDirty() {
+ const { low, high } = this.properties.item;
+ return low.marker.isDirty() || high.marker.isDirty();
+ }
+ strokewidthChange() {
+ const itemStrokeWidthChange = (lowOrHigh) => {
+ const unhighlightedStrokeWidth = this.properties.item[lowOrHigh].strokeWidth ?? 0;
+ const highlightedSeriesStrokeWidth = this.properties.highlight.highlightedSeries.item?.[lowOrHigh]?.strokeWidth ?? unhighlightedStrokeWidth;
+ const highlightedItemStrokeWidth = this.properties.highlight.highlightedItem.item?.[lowOrHigh]?.strokeWidth ?? unhighlightedStrokeWidth;
+ return unhighlightedStrokeWidth > highlightedItemStrokeWidth || highlightedSeriesStrokeWidth > highlightedItemStrokeWidth;
+ };
+ return itemStrokeWidthChange("low") || itemStrokeWidthChange("high");
+ }
+ updatePathNodes(opts) {
+ const { visible } = opts;
+ const [fillPath, lowStrokePath, highStrokePath] = opts.paths;
+ const segments = this.contextNodeData?.segments;
+ const highlightDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightState(highlightDatum, false);
+ const highlightStyle = this.getHighlightStyle();
+ const { item, fill, fillOpacity, opacity } = mergeDefaults5(
+ highlightStyle,
+ this.getStyle(false, highlightState)
+ );
+ lowStrokePath.setProperties({
+ datum: segments,
+ segments,
+ fill: void 0,
+ lineCap: "round",
+ lineJoin: "round",
+ pointerEvents: PointerEvents2.None,
+ stroke: item.low.stroke,
+ strokeWidth: item.low.strokeWidth,
+ strokeOpacity: item.low.strokeOpacity,
+ lineDash: item.low.lineDash,
+ lineDashOffset: item.low.lineDashOffset,
+ opacity,
+ visible
+ });
+ highStrokePath.setProperties({
+ segments,
+ fill: void 0,
+ lineCap: "round",
+ lineJoin: "round",
+ pointerEvents: PointerEvents2.None,
+ stroke: item.high.stroke,
+ strokeWidth: item.high.strokeWidth,
+ strokeOpacity: item.high.strokeOpacity,
+ lineDash: item.high.lineDash,
+ lineDashOffset: item.high.lineDashOffset,
+ opacity,
+ visible
+ });
+ const fillBBox = this.getShapeFillBBox();
+ applyShapeFillBBox2(fillPath, fill, fillBBox);
+ applyShapeStyle4(fillPath, { stroke: void 0, fill, fillOpacity, opacity }, fillBBox);
+ const fillSegments = this.contextNodeData?.intersectionSegments ?? segments;
+ fillPath.setProperties({
+ segments: fillSegments,
+ pointerEvents: PointerEvents2.None,
+ lineJoin: "round",
+ fillShadow: this.properties.shadow,
+ opacity,
+ visible
+ });
+ fillPath.datum = fillSegments;
+ updateClipPath(this, fillPath);
+ updateClipPath(this, lowStrokePath);
+ updateClipPath(this, highStrokePath);
+ }
+ updatePaths(opts) {
+ this.updateAreaPaths(opts.paths, opts.contextData);
+ }
+ updateAreaPaths(paths, contextData) {
+ for (const path of paths) {
+ path.visible = contextData.visible;
+ }
+ if (contextData.visible) {
+ this.updateFillPath(paths, contextData);
+ this.updateStrokePath(paths, contextData);
+ } else {
+ for (const path of paths) {
+ path.path.clear();
+ path.markDirty("RangeArea");
+ }
+ }
+ }
+ updateFillPath(paths, contextData) {
+ const [fill] = paths;
+ fill.path.clear();
+ plotAreaPathFill(fill, contextData.fillData);
+ fill.markDirty("RangeArea");
+ }
+ updateStrokePath(paths, contextData) {
+ const [, lowStroke, highStroke] = paths;
+ lowStroke.path.clear();
+ highStroke.path.clear();
+ plotLinePathStroke(lowStroke, contextData.lowStrokeData.spans);
+ plotLinePathStroke(highStroke, contextData.highStrokeData.spans);
+ lowStroke.markDirty("RangeArea");
+ highStroke.markDirty("RangeArea");
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const { processedData, axes, properties } = this;
+ const rules = properties.styler ? this.getStylerMarkerOptions().item : properties.item;
+ const { low, high } = rules;
+ const markersEnabled = markerEnabled(processedData.input.count, axes[ChartAxisDirection10.X].scale, {
+ enabled: low.marker.enabled || high.marker.enabled
+ });
+ if (properties.item.low.marker.isDirty() || properties.item.high.marker.isDirty()) {
+ datumSelection.clear();
+ datumSelection.cleanup();
+ }
+ let resolvedNodeData;
+ if (markersEnabled) {
+ if (low.marker.enabled && high.marker.enabled) {
+ resolvedNodeData = nodeData;
+ } else {
+ resolvedNodeData = [];
+ for (const datum of nodeData) {
+ if (rules[datum.itemId].marker.enabled) {
+ resolvedNodeData.push(datum);
+ }
+ }
+ }
+ } else {
+ resolvedNodeData = [];
+ }
+ return datumSelection.update(resolvedNodeData);
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ datumSelection.each((_, datum) => {
+ const highlightState = this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex);
+ const stylerStyle = this.getStyle(isHighlight, highlightState);
+ const { fill, fillOpacity, item } = stylerStyle;
+ const { stroke, strokeWidth, strokeOpacity } = item[datum.itemId];
+ const { marker } = this.properties.item[datum.itemId];
+ const params = this.makeItemStylerParams(datum.itemId);
+ datum.style = this.getMarkerStyle(
+ marker,
+ datum,
+ params,
+ { isHighlight, highlightState, resolveMarkerSubPath: ["item", datum.itemId, "marker"] },
+ stylerStyle.item[datum.itemId].marker,
+ {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity
+ }
+ );
+ });
+ }
+ updateDatumNodes(opts) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ datumSelection.each((node, datum) => {
+ const { itemId } = datum;
+ const style = datum.style ?? contextNodeData.styles[itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ this.applyMarkerStyle(style, node, datum.point, fillBBox);
+ });
+ if (!isHighlight) {
+ this.properties.item.low.marker.markClean();
+ this.properties.item.high.marker.markClean();
+ }
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ return labelSelection.update(labelData, (text) => {
+ text.pointerEvents = PointerEvents2.None;
+ });
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ xKey: this.properties.xKey,
+ xName: this.properties.xName ?? this.properties.xKey,
+ yName: this.properties.yName,
+ yLowKey: this.properties.yLowKey,
+ yLowName: this.properties.yLowName ?? this.properties.yLowKey,
+ yHighKey: this.properties.yHighKey,
+ yHighName: this.properties.yHighName ?? this.properties.yHighKey,
+ legendItemName: this.properties.legendItemName
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ textNode.fillOpacity = this.getHighlightStyle(false, datum.datumIndex).opacity ?? 1;
+ updateLabelNode2(this, textNode, params, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getHighlightData(nodeData, highlightedItem) {
+ const highlightItems = nodeData.filter((nodeDatum) => nodeDatum.datum === highlightedItem.datum);
+ return highlightItems.length > 0 ? highlightItems : void 0;
+ }
+ getStyle(highlighted, highlightState) {
+ return this.getStylerCouple(highlighted, highlightState)[0];
+ }
+ getStylerMarkerOptions() {
+ return this.getStylerCouple(false)[1];
+ }
+ getStylerCouple(highlighted, highlightState) {
+ const { fill, fillOpacity, item, styler } = this.properties;
+ let stylerResult = {};
+ if (styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ stylerResult = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ const markerOpts = {
+ item: { low: { marker: { enabled: false } }, high: { marker: { enabled: false } } }
+ };
+ const makeItemResult = (lowOrHigh) => {
+ const stylerItem = stylerResult.item?.[lowOrHigh];
+ const { lineDash, lineDashOffset, marker, stroke, strokeOpacity, strokeWidth } = item[lowOrHigh];
+ markerOpts.item[lowOrHigh].marker.enabled = stylerItem?.marker?.enabled ?? marker.enabled;
+ return {
+ marker: {
+ fill: stylerItem?.marker?.fill ?? marker.fill ?? fill,
+ fillOpacity: stylerItem?.marker?.fillOpacity ?? marker.fillOpacity,
+ shape: stylerItem?.marker?.shape ?? marker.shape,
+ size: stylerItem?.marker?.size ?? marker.size,
+ lineDash: stylerItem?.marker?.lineDash ?? marker.lineDash,
+ lineDashOffset: stylerItem?.marker?.lineDashOffset ?? marker.lineDashOffset,
+ stroke: stylerItem?.marker?.stroke ?? marker.stroke ?? stroke,
+ strokeOpacity: stylerItem?.marker?.strokeOpacity ?? marker.strokeOpacity,
+ strokeWidth: stylerItem?.marker?.strokeWidth ?? marker.strokeWidth
+ },
+ lineDash: stylerItem?.lineDash ?? lineDash,
+ lineDashOffset: stylerItem?.lineDashOffset ?? lineDashOffset,
+ stroke: stylerItem?.stroke ?? stroke,
+ strokeOpacity: stylerItem?.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerItem?.strokeWidth ?? strokeWidth
+ };
+ };
+ const style = {
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ opacity: 1,
+ topLevel: {
+ lineDash: this.properties.lineDash,
+ lineDashOffset: this.properties.lineDashOffset,
+ marker: this.properties.marker,
+ stroke: this.properties.stroke,
+ strokeOpacity: this.properties.strokeOpacity,
+ strokeWidth: this.properties.strokeWidth
+ },
+ item: {
+ low: makeItemResult("low"),
+ high: makeItemResult("high")
+ }
+ };
+ return [style, markerOpts];
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { id: seriesId } = this;
+ const { fill, fillOpacity, item, xKey, yHighKey, yLowKey } = this.properties;
+ const highlightState = toHighlightString2(highlightStateEnum ?? HighlightState2.None);
+ const makeItemParam = (lowOrHigh) => {
+ const { lineDash, lineDashOffset, marker, stroke, strokeOpacity, strokeWidth } = item[lowOrHigh];
+ return {
+ marker: {
+ fill: marker.fill ?? fill,
+ fillOpacity: marker.fillOpacity,
+ size: marker.size,
+ shape: marker.shape,
+ stroke: marker.stroke ?? stroke,
+ strokeOpacity: marker.strokeOpacity,
+ strokeWidth: marker.strokeWidth,
+ lineDash: marker.lineDash,
+ lineDashOffset: marker.lineDashOffset
+ },
+ lineDash,
+ lineDashOffset,
+ stroke,
+ strokeOpacity,
+ strokeWidth
+ };
+ };
+ return {
+ item: {
+ low: makeItemParam("low"),
+ high: makeItemParam("high")
+ },
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ seriesId,
+ xKey,
+ yLowKey,
+ yHighKey
+ };
+ }
+ makeItemStylerParams(itemId) {
+ const { xKey, yLowKey, yHighKey } = this.properties;
+ return { xKey, yLowKey, yHighKey, itemId };
+ }
+ getTooltipContent(datumIndex, removeThisDatum) {
+ const itemId = removeThisDatum?.itemId ?? "high";
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { xName, yName, yLowKey, yLowName, xKey, yHighKey, yHighName, tooltip, legendItemName } = properties;
+ const xAxis = axes[ChartAxisDirection10.X];
+ const yAxis = axes[ChartAxisDirection10.Y];
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const yHighValue = dataModel.resolveColumnById(this, `yHighValue`, processedData)[datumIndex];
+ const yLowValue = dataModel.resolveColumnById(this, `yLowValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const stylerStyle = this.getStyle(false);
+ const params = this.makeItemStylerParams(itemId);
+ const format = this.getMarkerStyle(
+ this.properties.item[itemId].marker,
+ { datumIndex, datum },
+ params,
+ { isHighlight: false, resolveMarkerSubPath: ["item", itemId, "marker"] },
+ stylerStyle.item[itemId].marker
+ );
+ const value = `${this.getAxisValueText(yAxis, "tooltip", yLowValue, datum, yLowKey, legendItemName)} - ${this.getAxisValueText(yAxis, "tooltip", yHighValue, datum, yHighKey, legendItemName)}`;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ symbol: this.legendItemSymbol(),
+ data: [{ label: yName, fallbackLabel: `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`, value }]
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ itemId,
+ xName,
+ yName,
+ yLowKey,
+ yLowName,
+ xKey,
+ yHighKey,
+ yHighName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ legendItemSymbol() {
+ const { fill, topLevel } = this.getStyle(false);
+ const { stroke, strokeWidth, strokeOpacity, lineDash, marker } = topLevel;
+ const markerStyle = {
+ shape: marker.shape,
+ fill: marker.fill ?? fill,
+ stroke: marker.stroke ?? stroke,
+ fillOpacity: marker.fillOpacity,
+ strokeOpacity: marker.strokeOpacity,
+ strokeWidth: marker.strokeWidth,
+ lineDash: marker.lineDash,
+ lineDashOffset: marker.lineDashOffset
+ };
+ return {
+ marker: markerStyle,
+ line: {
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ lineDash
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { yLowKey, yHighKey, yName, yLowName, yHighName, legendItemName, showInLegend } = this.properties;
+ const legendItemText = legendItemName ?? yName ?? `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`;
+ const itemId = `${yLowKey}-${yHighKey}`;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId,
+ seriesId,
+ enabled: visible,
+ label: { text: `${legendItemText}` },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled;
+ }
+ onDataChange() {
+ }
+ nodeFactory() {
+ return new Marker();
+ }
+ animateEmptyUpdateReady(animationData) {
+ const { datumSelection, labelSelection, contextData, paths } = animationData;
+ const { animationManager } = this.ctx;
+ this.updateAreaPaths(paths, contextData);
+ pathSwipeInAnimation(this, animationManager, ...paths);
+ resetMotion([datumSelection], resetMarkerPositionFn);
+ markerSwipeScaleInAnimation(this, animationManager, datumSelection);
+ seriesLabelFadeInAnimation(this, "labels", animationManager, labelSelection);
+ }
+ animateReadyResize(animationData) {
+ const { contextData, paths } = animationData;
+ this.updateAreaPaths(paths, contextData);
+ super.animateReadyResize(animationData);
+ }
+ animateWaitingUpdateReady(animationData) {
+ const { animationManager } = this.ctx;
+ const { datumSelection, labelSelection, contextData, paths, previousContextData } = animationData;
+ const [fill, lowStroke, highStroke] = paths;
+ if (fill == null && lowStroke == null && highStroke == null)
+ return;
+ this.resetDatumAnimation(animationData);
+ this.resetLabelAnimation(animationData);
+ const update = () => {
+ this.resetPathAnimation(animationData);
+ this.updateAreaPaths(paths, contextData);
+ };
+ const skip = () => {
+ animationManager.skipCurrentBatch();
+ update();
+ };
+ if (contextData == null || previousContextData == null) {
+ update();
+ markerFadeInAnimation(this, animationManager, "added", datumSelection);
+ pathFadeInAnimation(this, "fill_path_properties", animationManager, "add", fill);
+ pathFadeInAnimation(this, "low_stroke_path_properties", animationManager, "add", lowStroke);
+ pathFadeInAnimation(this, "high_stroke_path_properties", animationManager, "add", highStroke);
+ seriesLabelFadeInAnimation(this, "labels", animationManager, labelSelection);
+ return;
+ }
+ const fns = prepareRangeAreaPathAnimation(
+ contextData,
+ previousContextData,
+ this.processedData?.reduced?.diff?.[this.id]
+ );
+ if (fns === void 0) {
+ skip();
+ return;
+ } else if (fns.status === "no-op") {
+ return;
+ }
+ fromToMotion(this.id, "fill_path_properties", animationManager, [fill], fns.fill.pathProperties);
+ fromToMotion(this.id, "low_stroke_path_properties", animationManager, [lowStroke], fns.stroke.pathProperties);
+ fromToMotion(this.id, "high_stroke_path_properties", animationManager, [highStroke], fns.stroke.pathProperties);
+ if (fns.status === "added") {
+ this.updateAreaPaths(paths, contextData);
+ } else if (fns.status === "removed") {
+ this.updateAreaPaths(paths, previousContextData);
+ } else {
+ pathMotion(this.id, "fill_path_update", animationManager, [fill], fns.fill.path);
+ pathMotion(this.id, "low_stroke_path_update", animationManager, [lowStroke], fns.stroke.path);
+ pathMotion(this.id, "high_stroke_path_update", animationManager, [highStroke], fns.stroke.path);
+ }
+ if (fns.hasMotion) {
+ markerFadeInAnimation(this, animationManager, void 0, datumSelection);
+ seriesLabelFadeInAnimation(this, "labels", animationManager, labelSelection);
+ }
+ this.ctx.animationManager.animate({
+ id: this.id,
+ groupId: "reset_after_animation",
+ phase: "trailing",
+ from: {},
+ to: {},
+ onComplete: () => this.updateAreaPaths(paths, contextData)
+ });
+ }
+ getFormattedMarkerStyle(datum) {
+ const stylerStyle = this.getStyle(false);
+ const params = this.makeItemStylerParams(datum.itemId);
+ return this.getMarkerStyle(
+ this.properties.item[datum.itemId].marker,
+ datum,
+ params,
+ { isHighlight: true, resolveMarkerSubPath: ["item", datum.itemId, "marker"] },
+ void 0,
+ stylerStyle
+ );
+ }
+ getMarkerStyle(marker, datum, params, opts, defaultOverrideStyle, inheritedStyle) {
+ true;
+ marker.itemStyler = this.properties.marker.itemStyler;
+ return super.getMarkerStyle(marker, datum, params, opts, defaultOverrideStyle, inheritedStyle);
+ }
+ computeFocusBounds(opts) {
+ const hiBox = computeMarkerFocusBounds(this, opts);
+ const loBox = computeMarkerFocusBounds(this, { ...opts, datumIndex: opts.datumIndex + 1 });
+ if (hiBox && loBox) {
+ return BBox5.merge([hiBox, loBox]);
+ }
+ return void 0;
+ }
+ isDatumEnabled(nodeData, datumIndex) {
+ return datumIndex % 2 === 0 && super.isDatumEnabled(nodeData, datumIndex);
+ }
+ hasItemStylers() {
+ return this.properties.styler != null || this.properties.marker.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+RangeAreaSeries.className = "RangeAreaSeries";
+RangeAreaSeries.type = "range-area";
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport49 } from "ag-charts-community";
+import {
+ boolean as boolean5,
+ constant as constant6,
+ fillOptionsDef,
+ number as number4,
+ required as required6,
+ shapeSegmentation as shapeSegmentation2,
+ string as string6,
+ undocumented as undocumented3
+} from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs5, rangeAreaSeriesThemeableOptionsDef } = _ModuleSupport49;
+var rangeAreaSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs5,
+ ...rangeAreaSeriesThemeableOptionsDef,
+ type: required6(constant6("range-area")),
+ xKey: required6(string6),
+ yLowKey: required6(string6),
+ yHighKey: required6(string6),
+ xName: string6,
+ yName: string6,
+ yLowName: string6,
+ yHighName: string6,
+ legendItemName: string6,
+ segmentation: shapeSegmentation2,
+ invertedStyle: {
+ enabled: boolean5,
+ ...fillOptionsDef
+ }
+};
+rangeAreaSeriesOptionsDef.pickOutsideVisibleMinorAxis = undocumented3(boolean5);
+rangeAreaSeriesOptionsDef.focusPriority = undocumented3(number4);
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaThemes.ts
+import { _ModuleSupport as _ModuleSupport50 } from "ag-charts-community";
+var RANGE_AREA_ITEM = {
+ lineDash: {
+ $path: "/series/$index/lineDash"
+ },
+ lineDashOffset: {
+ $path: "/series/$index/lineDashOffset"
+ },
+ stroke: {
+ $path: ["/series/$index/stroke", { $palette: "stroke" }]
+ },
+ strokeOpacity: {
+ $path: "/series/$index/strokeOpacity"
+ },
+ strokeWidth: {
+ $path: ["/series/$index/strokeWidth", 1]
+ },
+ marker: {
+ enabled: {
+ $path: "/series/$index/marker/enabled"
+ },
+ fill: {
+ $isUserOption: [
+ "/series/$index/marker/fill",
+ {
+ $if: [
+ {
+ $or: [
+ { $isGradient: { $path: "/series/$index/marker/fill" } },
+ { $isImage: { $path: "/series/$index/marker/fill" } },
+ { $isPattern: { $path: "/series/$index/marker/fill" } }
+ ]
+ },
+ {
+ $merge: [
+ { $path: "/series/$index/marker/fill" },
+ {
+ $applySwitch: [
+ { $path: "type" },
+ void 0,
+ // default case shouldn't be hit because of $if
+ ["gradient", _ModuleSupport50.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", _ModuleSupport50.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport50.FILL_PATTERN_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ {
+ $isUserOption: [
+ "/series/$index/marker/fill",
+ { $path: "/series/$index/marker/fill" },
+ { $palette: "fill" }
+ ]
+ }
+ ]
+ },
+ {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", _ModuleSupport50.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", _ModuleSupport50.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport50.FILL_PATTERN_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ fillOpacity: {
+ $path: "/series/$index/marker/fillOpacity"
+ },
+ lineDash: {
+ $path: "/series/$index/marker/lineDash"
+ },
+ lineDashOffset: {
+ $path: "/series/$index/marker/lineDashOffset"
+ },
+ shape: {
+ $path: "/series/$index/marker/shape"
+ },
+ size: {
+ $path: ["/series/$index/marker/size", 6]
+ },
+ stroke: {
+ $path: ["/series/$index/marker/stroke", { $palette: "stroke" }]
+ },
+ strokeOpacity: {
+ $path: "/series/$index/marker/strokeOpacity"
+ },
+ strokeWidth: {
+ $path: ["/series/$index/marker/strokeWidth", 2]
+ }
+ }
+};
+var RANGE_AREA_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", _ModuleSupport50.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["pattern", _ModuleSupport50.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ fillOpacity: 0.7,
+ stroke: { $palette: "stroke" },
+ strokeWidth: 1,
+ marker: {
+ enabled: false,
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", _ModuleSupport50.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", _ModuleSupport50.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport50.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ shape: "circle",
+ stroke: { $palette: "stroke" },
+ size: 6,
+ strokeWidth: 2
+ },
+ nodeClickRange: "nearest",
+ item: {
+ low: RANGE_AREA_ITEM,
+ high: RANGE_AREA_ITEM
+ },
+ label: {
+ ..._ModuleSupport50.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ placement: "outside",
+ padding: { $isUserOption: ["./spacing", 0, 10] },
+ // compatibility with old `padding` property (now named `spacing`).
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ interpolation: {
+ type: "linear"
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: _ModuleSupport50.multiSeriesHighlightStyle(),
+ segmentation: _ModuleSupport50.SEGMENTATION_DEFAULTS,
+ invertedStyle: {
+ enabled: false,
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ // @todo(AG-14792) should be { $path: '../fill' } to inherit from series.fill
+ ["gradient", _ModuleSupport50.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", _ModuleSupport50.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport50.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ fillOpacity: { $path: "../fillOpacity" }
+ }
+ },
+ axes: {
+ [_ModuleSupport50.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]: {
+ crosshair: { enabled: true }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaModule.ts
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE6, CARTESIAN_POSITION: CARTESIAN_POSITION4 }
+} = _ModuleSupport51;
+var RangeAreaModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "range-area",
+ moduleFactory: (ctx) => new RangeAreaSeries(ctx),
+ predictAxis: _ModuleSupport51.predictCartesianTimeAxis,
+ defaultAxes: [
+ { type: CARTESIAN_AXIS_TYPE6.NUMBER, position: CARTESIAN_POSITION4.LEFT },
+ { type: CARTESIAN_AXIS_TYPE6.CATEGORY, position: CARTESIAN_POSITION4.BOTTOM }
+ ],
+ themeTemplate: RANGE_AREA_SERIES_THEME
+};
+var RangeAreaSeriesModule = {
+ type: "series",
+ name: "range-area",
+ chartType: "cartesian",
+ enterprise: true,
+ options: rangeAreaSeriesOptionsDef,
+ create: (ctx) => new RangeAreaSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarModule.ts
+import { _ModuleSupport as _ModuleSupport57 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport54
+} from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarAggregation.ts
+import { _ModuleSupport as _ModuleSupport52 } from "ag-charts-community";
+var { aggregationDomain: aggregationDomain3, aggregationRangeFittingPoints: aggregationRangeFittingPoints3, compactAggregationIndices: compactAggregationIndices3, createAggregationIndices: createAggregationIndices3 } = _ModuleSupport52;
+var AGGREGATION_THRESHOLD3 = 1e3;
+function aggregateRangeBarData(scale, xValues, highValues, lowValues, domain, smallestKeyInterval) {
+ if (xValues.length < AGGREGATION_THRESHOLD3)
+ return;
+ const [d0, d1] = aggregationDomain3(scale, domain);
+ let maxRange = aggregationRangeFittingPoints3(xValues, d0, d1, { smallestKeyInterval });
+ let { indexData, valueData } = createAggregationIndices3(xValues, highValues, lowValues, d0, d1, maxRange);
+ const filters = [{ maxRange, indexData }];
+ while (maxRange > 64) {
+ ({ indexData, valueData, maxRange } = compactAggregationIndices3(indexData, valueData, maxRange));
+ filters.push({ maxRange, indexData });
+ }
+ filters.reverse();
+ return filters;
+}
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarProperties.ts
+import { _ModuleSupport as _ModuleSupport53 } from "ag-charts-community";
+var { AbstractBarSeriesProperties: AbstractBarSeriesProperties3, makeSeriesTooltip: makeSeriesTooltip6, Property: Property18, DropShadow: DropShadow2, Label: Label2 } = _ModuleSupport53;
+var RangeBarSeriesLabel = class extends Label2 {
+ constructor() {
+ super(...arguments);
+ this.placement = "inside";
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property18
+], RangeBarSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property18
+], RangeBarSeriesLabel.prototype, "spacing", 2);
+var RangeBarProperties = class extends AbstractBarSeriesProperties3 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#99CCFF";
+ this.fillOpacity = 1;
+ this.stroke = "#99CCFF";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.shadow = new DropShadow2().set({ enabled: false });
+ this.label = new RangeBarSeriesLabel();
+ this.tooltip = makeSeriesTooltip6();
+ }
+};
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "yLowKey", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "yHighKey", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "xName", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "yName", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "yLowName", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "yHighName", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "fill", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "styler", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "label", 2);
+__decorateClass([
+ Property18
+], RangeBarProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode4,
+ valueProperty: valueProperty5,
+ keyProperty: keyProperty4,
+ ChartAxisDirection: ChartAxisDirection11,
+ checkCrisp,
+ updateLabelNode: updateLabelNode3,
+ SMALLEST_KEY_INTERVAL: SMALLEST_KEY_INTERVAL3,
+ LARGEST_KEY_INTERVAL,
+ diff: diff4,
+ prepareBarAnimationFunctions,
+ midpointStartingBarPosition,
+ resetBarSelectionsFn,
+ fixNumericExtent: fixNumericExtent4,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation2,
+ resetLabelFn: resetLabelFn2,
+ animationValidation: animationValidation4,
+ computeBarFocusBounds: computeBarFocusBounds4,
+ visibleRangeIndices: visibleRangeIndices2,
+ createDatumId: createDatumId4,
+ ContinuousScale: ContinuousScale3,
+ Rect: Rect2,
+ PointerEvents: PointerEvents3,
+ motion: motion2,
+ applyShapeStyle: applyShapeStyle5,
+ findMinMax: findMinMax3,
+ areScalingEqual: areScalingEqual2,
+ processedDataIsAnimatable: processedDataIsAnimatable3,
+ AGGREGATION_SPAN: AGGREGATION_SPAN2,
+ AGGREGATION_INDEX_X_MAX: AGGREGATION_INDEX_X_MAX2,
+ AGGREGATION_INDEX_X_MIN: AGGREGATION_INDEX_X_MIN2,
+ AGGREGATION_INDEX_Y_MAX: AGGREGATION_INDEX_Y_MAX3,
+ AGGREGATION_INDEX_Y_MIN: AGGREGATION_INDEX_Y_MIN3,
+ mergeDefaults: mergeDefaults6,
+ simpleMemorize2: simpleMemorize23,
+ getItemStyles: getItemStyles2,
+ calculateSegments: calculateSegments3,
+ toHighlightString: toHighlightString3,
+ HighlightState: HighlightState3
+} = _ModuleSupport54;
+var memoizedAggregateRangeBarData = simpleMemorize23(aggregateRangeBarData);
+var RangeBarSeriesNodeEvent = class extends _ModuleSupport54.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.yLowKey = series.properties.yLowKey;
+ this.yHighKey = series.properties.yHighKey;
+ }
+};
+var RangeBarSeries = class extends _ModuleSupport54.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode4.AXIS_ALIGNED, SeriesNodePickMode4.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["xKey"],
+ y: ["yLowKey", "yHighKey"]
+ },
+ propertyNames: {
+ x: ["xName"],
+ y: ["yLowName", "yHighName", "yName"]
+ },
+ categoryKey: "xValue",
+ datumSelectionGarbageCollection: false,
+ animationResetFns: {
+ datum: resetBarSelectionsFn,
+ label: resetLabelFn2
+ }
+ });
+ this.properties = new RangeBarProperties();
+ this.dataAggregationFilters = void 0;
+ this.NodeEvent = RangeBarSeriesNodeEvent;
+ }
+ async processData(dataController) {
+ const { xKey, yLowKey, yHighKey } = this.properties;
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ if (this.processedData) {
+ extraProps.push(diff4(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation4());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty4(xKey, xScaleType, { id: "xValue" }),
+ valueProperty5(yLowKey, yScaleType, { id: `yLowValue`, invalidValue: null, ...visibleProps }),
+ valueProperty5(yHighKey, yScaleType, { id: `yHighValue`, invalidValue: null, ...visibleProps }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL3, LARGEST_KEY_INTERVAL] : [],
+ ...extraProps
+ ],
+ groupByKeys: false
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.largestDataInterval = processedData.reduced?.largestKeyInterval;
+ this.dataAggregationFilters = this.aggregateData(dataModel, processedData);
+ this.animationState.transition("updateData");
+ }
+ aggregateData(dataModel, processedData) {
+ if (processedData.type !== "ungrouped")
+ return;
+ if (processedDataIsAnimatable3(processedData))
+ return;
+ const xAxis = this.axes[ChartAxisDirection11.X];
+ if (xAxis == null)
+ return;
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yHighValues = dataModel.resolveColumnById(this, `yHighValue`, processedData);
+ const yLowValues = dataModel.resolveColumnById(this, `yLowValue`, processedData);
+ const { index } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const domain = processedData.domain.keys[index];
+ return memoizedAggregateRangeBarData(
+ xAxis.scale.type,
+ xValues,
+ yHighValues,
+ yLowValues,
+ domain,
+ processedData.reduced?.smallestKeyInterval
+ );
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!processedData || !dataModel)
+ return [];
+ const {
+ keys: [keys]
+ } = processedData.domain;
+ if (direction === this.getCategoryDirection()) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef?.def.valueType === "category") {
+ return keys;
+ }
+ return this.padBandExtent(keys);
+ } else {
+ const yExtent = this.domainForClippedRange(direction, ["yHighValue", "yLowValue"], "xValue");
+ const fixedYExtent = findMinMax3(yExtent);
+ return fixNumericExtent4(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection11.Y, ["yHighValue", "yLowValue"], "xValue", visibleRange);
+ }
+ createNodeData() {
+ const { data, dataModel, groupScale, processedData, visible } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(data && xAxis && yAxis && dataModel && processedData?.dataSources && this.chart?.seriesRect))
+ return;
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const barAlongX = this.getBarDirection() === ChartAxisDirection11.X;
+ const { xKey, yLowKey, yHighKey, strokeWidth } = this.properties;
+ const itemId = `${yLowKey}-${yHighKey}`;
+ const segments = calculateSegments3(
+ this.properties.segmentation,
+ xAxis,
+ yAxis,
+ this.chart.seriesRect,
+ this.ctx.scene
+ );
+ const context = {
+ itemId,
+ nodeData: [],
+ labelData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStyles2(this.getItemStyle.bind(this)),
+ segments
+ };
+ if (!visible)
+ return context;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yLowValues = dataModel.resolveColumnById(this, `yLowValue`, processedData);
+ const yHighValues = dataModel.resolveColumnById(this, `yHighValue`, processedData);
+ const { barWidth: effectiveBarWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const barOffset = ContinuousScale3.is(xScale) ? effectiveBarWidth * -0.5 : 0;
+ const groupOffset = groupScale.convert(String(groupIndex));
+ const defaultCrisp = checkCrisp(
+ xAxis?.scale,
+ xAxis?.visibleRange,
+ this.smallestDataInterval,
+ this.largestDataInterval
+ );
+ const xPosition = (datumIndex) => Math.round(xScale.convert(xValues[datumIndex])) + groupOffset + barOffset;
+ const handleDatum = (datumIndex, groupedDataIndex, x, width, yLow, yHigh, crisp) => {
+ const datum = rawData[datumIndex];
+ const xDatum = xValues[datumIndex];
+ if (xDatum == null)
+ return;
+ const rawLowValue = yLowValues[datumIndex];
+ const rawHighValue = yHighValues[datumIndex];
+ if (!Number.isFinite(rawLowValue?.valueOf()) || !Number.isFinite(rawHighValue?.valueOf()))
+ return;
+ const [yLowValue, yHighValue] = rawLowValue < rawHighValue ? [rawLowValue, rawHighValue] : [rawHighValue, rawLowValue];
+ const y = Math.round(yScale.convert(yHigh));
+ const bottomY = Math.round(yScale.convert(yLow));
+ const height = Math.max(strokeWidth, Math.abs(bottomY - y));
+ const rect = {
+ x: barAlongX ? Math.min(y, bottomY) : x,
+ y: barAlongX ? x : Math.min(y, bottomY),
+ width: barAlongX ? height : width,
+ height: barAlongX ? width : height
+ };
+ const nodeMidPoint = {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2
+ };
+ const labelData = this.createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yLowValue,
+ yHighValue,
+ datum,
+ series: this
+ });
+ const nodeDatum = {
+ index: groupedDataIndex,
+ series: this,
+ itemId,
+ datum,
+ datumIndex,
+ xValue: xDatum,
+ yLowValue: rawLowValue,
+ yHighValue: rawHighValue,
+ yLowKey,
+ yHighKey,
+ xKey,
+ x: rect.x,
+ y: rect.y,
+ width: rect.width,
+ height: rect.height,
+ midPoint: nodeMidPoint,
+ crisp,
+ labels: labelData
+ };
+ context.nodeData.push(nodeDatum);
+ context.labelData.push(...labelData);
+ };
+ const { dataAggregationFilters } = this;
+ const [r0, r1] = xScale.range;
+ const range2 = Math.abs(r1 - r0);
+ const dataAggregationFilter = dataAggregationFilters?.find((f) => f.maxRange > range2);
+ if (dataAggregationFilter != null) {
+ const { maxRange, indexData } = dataAggregationFilter;
+ const [start, end] = visibleRangeIndices2(1, maxRange, xAxis.range, (index) => {
+ const aggIndex = index * AGGREGATION_SPAN2;
+ const xMinIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MIN2];
+ const xMaxIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MAX2];
+ if (xMinIndex === -1)
+ return;
+ const midDatumIndex = Math.trunc((xMinIndex + xMaxIndex) / 2);
+ return [xPosition(midDatumIndex), xPosition(xMaxIndex) + effectiveBarWidth];
+ });
+ for (let i = start; i < end; i += 1) {
+ const aggIndex = i * AGGREGATION_SPAN2;
+ const xMinIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MIN2];
+ const xMaxIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MAX2];
+ const yMinIndex = indexData[aggIndex + AGGREGATION_INDEX_Y_MIN3];
+ const yMaxIndex = indexData[aggIndex + AGGREGATION_INDEX_Y_MAX3];
+ if (xMinIndex === -1)
+ continue;
+ const midDatumIndex = Math.trunc((xMinIndex + xMaxIndex) / 2);
+ const xValue2 = xValues[midDatumIndex];
+ if (xValue2 == null)
+ continue;
+ const x = xPosition(midDatumIndex);
+ const width = Math.abs(xPosition(xMinIndex) - xPosition(xMaxIndex)) + effectiveBarWidth;
+ const yLow = yLowValues[yMinIndex];
+ const yHigh = yHighValues[yMaxIndex];
+ handleDatum(midDatumIndex, 0, x, width, yLow, yHigh, false);
+ }
+ } else if (processedData.type === "ungrouped") {
+ const invalidData = processedData.invalidData?.get(this.id);
+ let [start, end] = this.visibleRangeIndices("xValue", xAxis.range);
+ if (processedData.input.count < 1e3) {
+ start = 0;
+ end = processedData.input.count;
+ }
+ for (let datumIndex = start; datumIndex < end; datumIndex += 1) {
+ if (invalidData?.[datumIndex] === true)
+ continue;
+ const x = xPosition(datumIndex);
+ const width = effectiveBarWidth;
+ const yLow = yLowValues[datumIndex];
+ const yHigh = yHighValues[datumIndex];
+ handleDatum(datumIndex, 0, x, width, yLow, yHigh, defaultCrisp);
+ }
+ } else {
+ for (const { datumIndex, groupIndex: groupDataIndex } of dataModel.forEachGroupDatum(this, processedData)) {
+ const x = xPosition(datumIndex);
+ const width = effectiveBarWidth;
+ const yLow = yLowValues[datumIndex];
+ const yHigh = yHighValues[datumIndex];
+ handleDatum(datumIndex, groupDataIndex, x, width, yLow, yHigh, defaultCrisp);
+ }
+ }
+ return context;
+ }
+ createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yLowValue,
+ yHighValue,
+ datum,
+ series
+ }) {
+ const { xKey, yLowKey, yHighKey, xName, yLowName, yHighName, yName, legendItemName, label } = this.properties;
+ const labelParams = { datum, xKey, yLowKey, yHighKey, xName, yLowName, yHighName, yName, legendItemName };
+ const { placement } = label;
+ const spacing = label.spacing + (typeof label.padding === "number" ? label.padding : 0);
+ const paddingDirection = placement === "outside" ? 1 : -1;
+ const labelPadding = spacing * paddingDirection;
+ const yDomain = this.getSeriesDomain(ChartAxisDirection11.Y);
+ const yLowLabel = {
+ datumIndex,
+ x: rect.x + (barAlongX ? -labelPadding : rect.width / 2),
+ y: rect.y + (barAlongX ? rect.height / 2 : rect.height + labelPadding),
+ textAlign: barAlongX ? "left" : "center",
+ textBaseline: barAlongX ? "middle" : "bottom",
+ text: this.getLabelText(
+ yLowValue,
+ datum,
+ yLowKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: "low", value: yLowValue, ...labelParams }
+ ),
+ itemId: "low",
+ datum,
+ series
+ };
+ const yHighLabel = {
+ datumIndex,
+ x: rect.x + (barAlongX ? rect.width + labelPadding : rect.width / 2),
+ y: rect.y + (barAlongX ? rect.height / 2 : -labelPadding),
+ textAlign: barAlongX ? "right" : "center",
+ textBaseline: barAlongX ? "middle" : "top",
+ text: this.getLabelText(
+ yHighValue,
+ datum,
+ yHighKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: "high", value: yHighValue, ...labelParams }
+ ),
+ itemId: "high",
+ datum,
+ series
+ };
+ if (placement === "outside") {
+ yLowLabel.textAlign = barAlongX ? "right" : "center";
+ yLowLabel.textBaseline = barAlongX ? "middle" : "top";
+ yHighLabel.textAlign = barAlongX ? "left" : "center";
+ yHighLabel.textBaseline = barAlongX ? "middle" : "bottom";
+ }
+ return [yLowLabel, yHighLabel];
+ }
+ nodeFactory() {
+ return new Rect2();
+ }
+ getStyle(ignoreStylerCallback, highlighted, highlightState) {
+ const {
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ styler
+ } = this.properties;
+ let stylerResult = {};
+ if (!ignoreStylerCallback && styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ stylerResult = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ return {
+ cornerRadius: stylerResult.cornerRadius ?? cornerRadius,
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ opacity: 1,
+ stroke: stylerResult.stroke ?? stroke,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth
+ };
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { id: seriesId } = this;
+ const {
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ xKey,
+ yLowKey,
+ yHighKey
+ } = this.properties;
+ const highlightState = toHighlightString3(highlightStateEnum ?? HighlightState3.None);
+ return {
+ cornerRadius,
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ lineDash,
+ lineDashOffset,
+ seriesId,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ xKey,
+ yLowKey,
+ yHighKey
+ };
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data, void 0, (datum) => this.getDatumId(datum));
+ }
+ getItemStyle(datumIndex, isHighlight, highlightState) {
+ const { properties, dataModel, processedData } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ let style = mergeDefaults6(highlightStyle, this.getStyle(datumIndex === void 0, isHighlight, highlightState));
+ if (itemStyler && dataModel != null && processedData != null && datumIndex != null) {
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const overrides = this.cachedDatumCallback(
+ createDatumId4(this.getDatumId({ xValue: xValue2 }), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults6(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datumIndex, isHighlight, style) {
+ const { id: seriesId, properties, processedData } = this;
+ const { xKey, yHighKey, yLowKey } = properties;
+ const datum = processedData.dataSources.get(seriesId)?.data[datumIndex];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ xKey,
+ yHighKey,
+ yLowKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles(opts) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ opts.datumSelection.each((node, datum) => {
+ if (!opts.datumSelection.isGarbage(node)) {
+ const highlightState = this.getHighlightState(highlightedDatum, opts.isHighlight, datum.datumIndex);
+ datum.style = this.getItemStyle(datum.datumIndex, opts.isHighlight, highlightState);
+ }
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const categoryAlongX = this.getCategoryDirection() === ChartAxisDirection11.X;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const style = datum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ applyShapeStyle5(rect, style, fillBBox);
+ rect.cornerRadius = style.cornerRadius ?? 0;
+ rect.visible = categoryAlongX ? datum.width > 0 : datum.height > 0;
+ rect.crisp = datum.crisp;
+ });
+ }
+ updateLabelSelection(opts) {
+ const labelData = this.properties.label.enabled ? opts.labelData : [];
+ return opts.labelSelection.update(labelData, (text) => {
+ text.pointerEvents = PointerEvents3.None;
+ });
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ xKey: this.properties.xKey,
+ xName: this.properties.xName ?? this.properties.xKey,
+ yName: this.properties.yName,
+ yLowKey: this.properties.yLowKey,
+ yLowName: this.properties.yLowName ?? this.properties.yLowKey,
+ yHighKey: this.properties.yHighKey,
+ yHighName: this.properties.yHighName ?? this.properties.yHighKey,
+ legendItemName: this.properties.legendItemName
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ textNode.fillOpacity = this.getHighlightStyle(false, datum?.datumIndex).opacity ?? 1;
+ updateLabelNode3(this, textNode, params, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { xKey, xName, yName, yLowKey, yHighKey, yLowName, yHighName, tooltip, legendItemName } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const yHighValue = dataModel.resolveColumnById(this, `yHighValue`, processedData)[datumIndex];
+ const yLowValue = dataModel.resolveColumnById(this, `yLowValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const format = this.getItemStyle(datumIndex, false);
+ const value = `${this.getAxisValueText(yAxis, "tooltip", yLowValue, datum, yLowKey, legendItemName)} - ${this.getAxisValueText(yAxis, "tooltip", yHighValue, datum, yHighKey, legendItemName)}`;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ symbol: this.legendItemSymbol(),
+ data: [{ label: yName, fallbackLabel: `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`, value }]
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ xKey,
+ xName,
+ yName,
+ yLowKey,
+ yHighKey,
+ yLowName,
+ yHighName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ legendItemSymbol() {
+ const { fill, stroke, strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset } = this.getStyle(
+ false,
+ false,
+ HighlightState3.None
+ );
+ return {
+ marker: {
+ fill,
+ stroke,
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { yName, yLowName, yHighName, yLowKey, yHighKey, legendItemName, showInLegend } = this.properties;
+ const legendItemText = legendItemName ?? yName ?? `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`;
+ const itemId = `${yLowKey}-${yHighKey}`;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId,
+ seriesId,
+ enabled: visible,
+ label: { text: `${legendItemText}` },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ animateEmptyUpdateReady({ datumSelection, labelSelection }) {
+ const fns = prepareBarAnimationFunctions(midpointStartingBarPosition(this.isVertical(), "normal"), "unknown");
+ motion2.fromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], fns);
+ seriesLabelFadeInAnimation2(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateWaitingUpdateReady(data) {
+ const { datumSelection: datumSelections, labelSelection, contextData, previousContextData } = data;
+ const dataDiff = _ModuleSupport54.calculateDataDiff(
+ this.id,
+ datumSelections,
+ this.getDatumId.bind(this),
+ contextData,
+ previousContextData,
+ this.processedData,
+ this.processedDataUpdated
+ );
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ const mode = previousContextData == null ? "fade" : "normal";
+ const fns = prepareBarAnimationFunctions(midpointStartingBarPosition(this.isVertical(), mode), "added");
+ motion2.fromToMotion(
+ this.id,
+ "datums",
+ this.ctx.animationManager,
+ [datumSelections],
+ fns,
+ (_, datum) => this.getDatumId(datum),
+ dataDiff
+ );
+ if (dataDiff?.changed || !areScalingEqual2(contextData.groupScale, previousContextData?.groupScale)) {
+ seriesLabelFadeInAnimation2(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ }
+ getDatumId(datum) {
+ return `${datum.xValue}`;
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled;
+ }
+ onDataChange() {
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds4(this, this.contextNodeData?.nodeData[datumIndex]);
+ }
+ hasItemStylers() {
+ return this.properties.styler != null || this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+RangeBarSeries.className = "RangeBarSeries";
+RangeBarSeries.type = "range-bar";
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport55 } from "ag-charts-community";
+import {
+ boolean as boolean6,
+ constant as constant7,
+ number as number5,
+ required as required7,
+ shapeSegmentation as shapeSegmentation3,
+ string as string7,
+ undocumented as undocumented4
+} from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs6, rangeBarSeriesThemeableOptionsDef } = _ModuleSupport55;
+var rangeBarSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs6,
+ ...rangeBarSeriesThemeableOptionsDef,
+ type: required7(constant7("range-bar")),
+ xKey: required7(string7),
+ yLowKey: required7(string7),
+ yHighKey: required7(string7),
+ xName: string7,
+ yName: string7,
+ yLowName: string7,
+ yHighName: string7,
+ legendItemName: string7,
+ segmentation: shapeSegmentation3
+};
+rangeBarSeriesOptionsDef.pickOutsideVisibleMinorAxis = undocumented4(boolean6);
+rangeBarSeriesOptionsDef.focusPriority = undocumented4(number5);
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarThemes.ts
+import { _ModuleSupport as _ModuleSupport56 } from "ag-charts-community";
+var RANGE_BAR_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", _ModuleSupport56.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", _ModuleSupport56.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport56.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ ..._ModuleSupport56.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" },
+ placement: "inside",
+ padding: { $isUserOption: ["./spacing", 0, 6] }
+ // compatibility with old `padding` property (now named `spacing`).
+ },
+ highlight: _ModuleSupport56.multiSeriesHighlightStyle(),
+ segmentation: _ModuleSupport56.SEGMENTATION_DEFAULTS
+ },
+ axes: {
+ [_ModuleSupport56.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]: {
+ crosshair: { enabled: true }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarModule.ts
+var RangeBarModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "range-bar",
+ moduleFactory: (ctx) => new RangeBarSeries(ctx),
+ predictAxis: _ModuleSupport57.predictCartesianTimeAxis,
+ defaultAxes: _ModuleSupport57.DIRECTION_SWAP_AXES,
+ themeTemplate: RANGE_BAR_SERIES_THEME,
+ groupable: true
+};
+var RangeBarSeriesModule = {
+ type: "series",
+ name: "range-bar",
+ chartType: "cartesian",
+ enterprise: true,
+ options: rangeBarSeriesOptionsDef,
+ create: (ctx) => new RangeBarSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallModule.ts
+import { _ModuleSupport as _ModuleSupport62 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeries.ts
+import { _ModuleSupport as _ModuleSupport59 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport58 } from "ag-charts-community";
+var { AbstractBarSeriesProperties: AbstractBarSeriesProperties4, BaseProperties: BaseProperties6, PropertiesArray, makeSeriesTooltip: makeSeriesTooltip7, Property: Property19, DropShadow: DropShadow3, Label: Label3 } = _ModuleSupport58;
+var WaterfallSeriesTotal = class extends BaseProperties6 {
+};
+__decorateClass([
+ Property19
+], WaterfallSeriesTotal.prototype, "totalType", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesTotal.prototype, "index", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesTotal.prototype, "axisLabel", 2);
+var WaterfallSeriesItemTooltip = class extends BaseProperties6 {
+};
+__decorateClass([
+ Property19
+], WaterfallSeriesItemTooltip.prototype, "renderer", 2);
+var WaterfallSeriesLabel = class extends Label3 {
+ constructor() {
+ super(...arguments);
+ this.placement = "outside-end";
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property19
+], WaterfallSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesLabel.prototype, "spacing", 2);
+var WaterfallSeriesItem = class extends BaseProperties6 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#c16068";
+ this.stroke = "#c16068";
+ this.fillOpacity = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.strokeWidth = 1;
+ this.cornerRadius = 0;
+ this.shadow = new DropShadow3().set({ enabled: false });
+ this.label = new WaterfallSeriesLabel();
+ this.tooltip = new WaterfallSeriesItemTooltip();
+ }
+};
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "name", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "fill", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "stroke", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "lineDash", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "itemStyler", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "shadow", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "label", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItem.prototype, "tooltip", 2);
+var WaterfallSeriesConnectorLine = class extends BaseProperties6 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.strokeWidth = 2;
+ }
+};
+__decorateClass([
+ Property19
+], WaterfallSeriesConnectorLine.prototype, "enabled", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesConnectorLine.prototype, "stroke", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesConnectorLine.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesConnectorLine.prototype, "lineDash", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesConnectorLine.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesConnectorLine.prototype, "strokeWidth", 2);
+var WaterfallSeriesItems = class extends BaseProperties6 {
+ constructor() {
+ super(...arguments);
+ this.positive = new WaterfallSeriesItem();
+ this.negative = new WaterfallSeriesItem();
+ this.total = new WaterfallSeriesItem();
+ }
+};
+__decorateClass([
+ Property19
+], WaterfallSeriesItems.prototype, "positive", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItems.prototype, "negative", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesItems.prototype, "total", 2);
+var WaterfallSeriesProperties = class extends AbstractBarSeriesProperties4 {
+ constructor() {
+ super(...arguments);
+ this.item = new WaterfallSeriesItems();
+ this.totals = new PropertiesArray(WaterfallSeriesTotal);
+ this.line = new WaterfallSeriesConnectorLine();
+ this.tooltip = makeSeriesTooltip7();
+ }
+ getStyle(itemId) {
+ const { fillOpacity, strokeWidth, strokeOpacity, fill, stroke, lineDash, lineDashOffset, cornerRadius } = this.item[itemId === "subtotal" ? "total" : itemId];
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "yKey", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "xName", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "yName", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "item", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "totals", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "line", 2);
+__decorateClass([
+ Property19
+], WaterfallSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeries.ts
+var {
+ adjustLabelPlacement,
+ SeriesNodePickMode: SeriesNodePickMode5,
+ fixNumericExtent: fixNumericExtent5,
+ valueProperty: valueProperty6,
+ keyProperty: keyProperty5,
+ accumulativeValueProperty,
+ trailingAccumulatedValueProperty,
+ ChartAxisDirection: ChartAxisDirection12,
+ createDatumId: createDatumId5,
+ checkCrisp: checkCrisp2,
+ updateLabelNode: updateLabelNode4,
+ prepareBarAnimationFunctions: prepareBarAnimationFunctions2,
+ collapsedStartingBarPosition,
+ resetBarSelectionsFn: resetBarSelectionsFn2,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation3,
+ resetLabelFn: resetLabelFn3,
+ animationValidation: animationValidation5,
+ DEFAULT_CARTESIAN_DIRECTION_KEYS: DEFAULT_CARTESIAN_DIRECTION_KEYS2,
+ DEFAULT_CARTESIAN_DIRECTION_NAMES: DEFAULT_CARTESIAN_DIRECTION_NAMES2,
+ computeBarFocusBounds: computeBarFocusBounds5,
+ isContinuous,
+ Rect: Rect3,
+ motion: motion3,
+ applyShapeStyle: applyShapeStyle6,
+ mergeDefaults: mergeDefaults7,
+ getItemStylesPerItemId: getItemStylesPerItemId2,
+ DataSet
+} = _ModuleSupport59;
+var WaterfallSeries = class extends _ModuleSupport59.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ propertyKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS2,
+ propertyNames: DEFAULT_CARTESIAN_DIRECTION_NAMES2,
+ categoryKey: void 0,
+ pickModes: [SeriesNodePickMode5.NEAREST_NODE, SeriesNodePickMode5.EXACT_SHAPE_MATCH],
+ pathsPerSeries: ["connector"],
+ pathsZIndexSubOrderOffset: [-1, -1],
+ animationResetFns: {
+ datum: resetBarSelectionsFn2,
+ label: resetLabelFn3
+ }
+ });
+ this.properties = new WaterfallSeriesProperties();
+ this.seriesItemTypes = /* @__PURE__ */ new Set(["positive", "negative", "total"]);
+ }
+ async processData(dataController) {
+ const { xKey, yKey, totals } = this.properties;
+ const { data } = this;
+ if (!this.visible)
+ return;
+ const positiveNumber3 = (v) => isContinuous(v) && Number(v) >= 0;
+ const negativeNumber = (v) => isContinuous(v) && Number(v) >= 0;
+ const totalTypeValue = (v) => v === "total" || v === "subtotal";
+ const propertyDefinition = { missingValue: void 0, invalidValue: void 0 };
+ const dataWithTotals = [];
+ const totalsMap = totals.reduce((result, total) => {
+ const totalsAtIndex = result.get(total.index);
+ if (totalsAtIndex) {
+ totalsAtIndex.push(total);
+ } else {
+ result.set(total.index, [total]);
+ }
+ return result;
+ }, /* @__PURE__ */ new Map());
+ for (const [i, datum] of data?.data.entries() ?? []) {
+ dataWithTotals.push(datum);
+ const totalsAtIndex = totalsMap.get(i);
+ if (totalsAtIndex) {
+ for (const total of totalsAtIndex) {
+ dataWithTotals.push({ ...total.toJson(), [xKey]: total.axisLabel });
+ }
+ }
+ }
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ extraProps.push(animationValidation5());
+ }
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const { processedData } = await this.requestDataModel(
+ dataController,
+ DataSet.wrap(dataWithTotals),
+ {
+ props: [
+ keyProperty5(xKey, xScaleType, { id: `xValue` }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yCurrent`
+ }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ missingValue: 0,
+ id: `yCurrentTotal`
+ }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yCurrentPositive`,
+ validation: positiveNumber3
+ }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yCurrentNegative`,
+ validation: negativeNumber
+ }),
+ trailingAccumulatedValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yPrevious`
+ }),
+ valueProperty6(yKey, yScaleType, { id: `yRaw` }),
+ // Raw value pass-through.
+ valueProperty6("totalType", "category", {
+ id: `totalTypeValue`,
+ missingValue: void 0,
+ validation: totalTypeValue
+ }),
+ ...isContinuousX ? [_ModuleSupport59.SMALLEST_KEY_INTERVAL, _ModuleSupport59.LARGEST_KEY_INTERVAL] : [],
+ ...extraProps
+ ]
+ }
+ );
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.largestDataInterval = processedData.reduced?.largestKeyInterval;
+ this.updateSeriesItemTypes();
+ this.animationState.transition("updateData");
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!processedData || !dataModel)
+ return [];
+ const {
+ keys: [keys],
+ values
+ } = processedData.domain;
+ if (direction === this.getCategoryDirection()) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef?.def.valueType === "category") {
+ return keys;
+ }
+ const isDirectionY = direction === ChartAxisDirection12.Y;
+ const isReversed = this.getCategoryAxis().isReversed();
+ return this.padBandExtent(keys, isReversed !== isDirectionY);
+ } else {
+ const yCurrIndex = dataModel.resolveProcessedDataIndexById(this, "yCurrent");
+ const yExtent = values[yCurrIndex];
+ const fixedYExtent = [Math.min(0, yExtent[0]), Math.max(0, yExtent[1])];
+ return fixNumericExtent5(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ createNodeData() {
+ const { data, dataModel, processedData } = this;
+ const categoryAxis = this.getCategoryAxis();
+ const valueAxis = this.getValueAxis();
+ if (!data || !categoryAxis || !valueAxis || !dataModel || !processedData) {
+ return;
+ }
+ const { line } = this.properties;
+ const xScale = categoryAxis.scale;
+ const yScale = valueAxis.scale;
+ const barAlongX = this.getBarDirection() === ChartAxisDirection12.X;
+ const barWidth = this.getBandwidth(categoryAxis) ?? 10;
+ const categoryAxisReversed = categoryAxis.isReversed();
+ const valueAxisReversed = valueAxis.isReversed();
+ if (processedData.type !== "ungrouped")
+ return;
+ const context = {
+ itemId: this.properties.yKey,
+ nodeData: [],
+ labelData: [],
+ pointData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStylesPerItemId2(this.getItemStyle.bind(this), "total", "subtotal", "positive", "negative")
+ };
+ if (!this.visible)
+ return context;
+ const pointData = [];
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yRawValues = dataModel.resolveColumnById(this, `yRaw`, processedData);
+ const totalTypeValues = dataModel.resolveColumnById(
+ this,
+ `totalTypeValue`,
+ processedData
+ );
+ const yCurrValues = dataModel.resolveColumnById(this, "yCurrent", processedData);
+ const yPrevValues = dataModel.resolveColumnById(this, "yPrevious", processedData);
+ const yCurrTotalValues = dataModel.resolveColumnById(this, "yCurrentTotal", processedData);
+ const yDomain = this.getSeriesDomain(ChartAxisDirection12.Y);
+ const crisp = checkCrisp2(
+ categoryAxis?.scale,
+ categoryAxis?.visibleRange,
+ this.smallestDataInterval,
+ this.largestDataInterval
+ );
+ function getValues(isTotal, isSubtotal, datumIndex) {
+ if (isTotal || isSubtotal) {
+ return {
+ cumulativeValue: yCurrTotalValues[datumIndex],
+ trailingValue: isSubtotal ? trailingSubtotal : 0
+ };
+ }
+ return {
+ cumulativeValue: yCurrValues[datumIndex],
+ trailingValue: yPrevValues[datumIndex]
+ };
+ }
+ function getValue(isTotal, isSubtotal, rawValue, cumulativeValue, trailingValue) {
+ if (isTotal) {
+ return cumulativeValue;
+ }
+ if (isSubtotal) {
+ return (cumulativeValue ?? 0) - (trailingValue ?? 0);
+ }
+ return rawValue;
+ }
+ let trailingSubtotal = 0;
+ const { xKey, yKey, xName, yName } = this.properties;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const datumType = totalTypeValues[datumIndex];
+ const isSubtotal = this.isSubtotal(datumType);
+ const isTotal = this.isTotal(datumType);
+ const isTotalOrSubtotal = isTotal || isSubtotal;
+ const xDatum = xValues[datumIndex];
+ if (xDatum == null)
+ continue;
+ const x = Math.round(xScale.convert(xDatum));
+ const rawValue = yRawValues[datumIndex];
+ const { cumulativeValue, trailingValue } = getValues(isTotal, isSubtotal, datumIndex);
+ if (isTotalOrSubtotal) {
+ trailingSubtotal = cumulativeValue ?? 0;
+ }
+ const currY = Math.round(yScale.convert(cumulativeValue));
+ const trailY = Math.round(yScale.convert(trailingValue));
+ const value = getValue(isTotal, isSubtotal, rawValue, cumulativeValue, trailingValue);
+ const isPositive = (value ?? 0) >= 0;
+ const seriesItemType = this.getSeriesItemType(isPositive, datumType);
+ const { strokeWidth, label } = this.getItemConfig(seriesItemType);
+ const y = isPositive ? currY : trailY;
+ const bottomY = isPositive ? trailY : currY;
+ const barHeight = Math.max(strokeWidth, Math.abs(bottomY - y));
+ const rect = {
+ x: barAlongX ? Math.min(y, bottomY) : x,
+ y: barAlongX ? x : Math.min(y, bottomY),
+ width: barAlongX ? barHeight : barWidth,
+ height: barAlongX ? barWidth : barHeight
+ };
+ const nodeMidPoint = {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2
+ };
+ const pointY = isTotalOrSubtotal ? currY : trailY;
+ const pixelAlignmentOffset = Math.floor(line.strokeWidth) % 2 / 2;
+ const startY = categoryAxisReversed ? currY : pointY;
+ const stopY = categoryAxisReversed ? pointY : currY;
+ let startCoordinates;
+ let stopCoordinates;
+ if (barAlongX) {
+ startCoordinates = {
+ x: startY + pixelAlignmentOffset,
+ y: rect.y
+ };
+ stopCoordinates = {
+ x: stopY + pixelAlignmentOffset,
+ y: rect.y + rect.height
+ };
+ } else {
+ startCoordinates = {
+ x: rect.x,
+ y: startY + pixelAlignmentOffset
+ };
+ stopCoordinates = {
+ x: rect.x + rect.width,
+ y: stopY + pixelAlignmentOffset
+ };
+ }
+ const pathPoint = {
+ // lineTo
+ x: categoryAxisReversed ? stopCoordinates.x : startCoordinates.x,
+ y: categoryAxisReversed ? stopCoordinates.y : startCoordinates.y,
+ // moveTo
+ x2: categoryAxisReversed ? startCoordinates.x : stopCoordinates.x,
+ y2: categoryAxisReversed ? startCoordinates.y : stopCoordinates.y,
+ size: 0
+ };
+ pointData.push(pathPoint);
+ const itemId = seriesItemType === "subtotal" ? "total" : seriesItemType;
+ const labelText = this.getLabelText(
+ value,
+ datum,
+ yKey,
+ "y",
+ yDomain,
+ label,
+ {
+ itemId,
+ value,
+ datum,
+ xKey,
+ yKey,
+ xName,
+ yName
+ }
+ );
+ const spacing = label.spacing + (typeof label.padding === "number" ? label.padding : 0);
+ const nodeDatum = {
+ index: datumIndex,
+ series: this,
+ itemId: seriesItemType,
+ datum,
+ datumIndex,
+ cumulativeValue: cumulativeValue ?? 0,
+ xValue: xDatum,
+ yValue: value,
+ yKey,
+ xKey,
+ x: rect.x,
+ y: rect.y,
+ width: rect.width,
+ height: rect.height,
+ midPoint: nodeMidPoint,
+ crisp,
+ label: {
+ text: labelText,
+ ...adjustLabelPlacement({
+ isUpward: (value ?? -1) >= 0 !== valueAxisReversed,
+ isVertical: !barAlongX,
+ placement: label.placement,
+ spacing,
+ rect
+ })
+ }
+ };
+ context.nodeData.push(nodeDatum);
+ context.labelData.push(nodeDatum);
+ }
+ const connectorLinesEnabled = this.properties.line.enabled;
+ if (yCurrValues != null && connectorLinesEnabled) {
+ context.pointData = pointData;
+ }
+ return context;
+ }
+ updateSeriesItemTypes() {
+ const { dataModel, seriesItemTypes, processedData } = this;
+ if (!dataModel || !processedData) {
+ return;
+ }
+ seriesItemTypes.clear();
+ const yPositiveIndex = dataModel.resolveProcessedDataIndexById(this, "yCurrentPositive");
+ const yNegativeIndex = dataModel.resolveProcessedDataIndexById(this, "yCurrentNegative");
+ const totalTypeIndex = dataModel.resolveProcessedDataIndexById(this, `totalTypeValue`);
+ const positiveDomain = processedData.domain.values[yPositiveIndex] ?? [];
+ const negativeDomain = processedData.domain.values[yNegativeIndex] ?? [];
+ if (positiveDomain.length > 0) {
+ seriesItemTypes.add("positive");
+ }
+ if (negativeDomain.length > 0) {
+ seriesItemTypes.add("negative");
+ }
+ const itemTypes = processedData?.domain.values[totalTypeIndex];
+ if (!itemTypes) {
+ return;
+ }
+ for (const type of itemTypes) {
+ if (type === "total" || type === "subtotal") {
+ seriesItemTypes.add("total");
+ }
+ }
+ }
+ isSubtotal(datumType) {
+ return datumType === "subtotal";
+ }
+ isTotal(datumType) {
+ return datumType === "total";
+ }
+ nodeFactory() {
+ return new Rect3();
+ }
+ getSeriesItemType(isPositive, datumType) {
+ return datumType ?? (isPositive ? "positive" : "negative");
+ }
+ getItemConfig(seriesItemType) {
+ switch (seriesItemType) {
+ case "positive": {
+ return this.properties.item.positive;
+ }
+ case "negative": {
+ return this.properties.item.negative;
+ }
+ case "subtotal":
+ case "total": {
+ return this.properties.item.total;
+ }
+ }
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data);
+ }
+ getItemStyle(nodeDatum, isHighlight, highlightState, itemId = "total") {
+ const { properties } = this;
+ const { datumIndex = 0, datum } = nodeDatum ?? {};
+ const propertyItemId = itemId === "subtotal" ? "total" : itemId;
+ const item = properties.item[propertyItemId];
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ const baseStyle = mergeDefaults7(highlightStyle, properties.getStyle(itemId));
+ const { itemStyler } = item;
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId5(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(itemId, datumIndex, datum, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`, "item", propertyItemId],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults7(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(itemId, datumIndex, datum, isHighlight, style) {
+ const { id: seriesId, properties } = this;
+ const { xKey, yKey } = properties;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ itemId,
+ datum,
+ xKey,
+ yKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, datum) => {
+ datum.style = this.getItemStyle(datum, isHighlight, void 0, datum.itemId);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const categoryAlongX = this.getCategoryDirection() === ChartAxisDirection12.X;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const style = datum.style ?? contextNodeData.styles[datum.itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ applyShapeStyle6(rect, style, fillBBox);
+ rect.cornerRadius = style.cornerRadius ?? 0;
+ rect.visible = categoryAlongX ? datum.width > 0 : datum.height > 0;
+ rect.crisp = datum.crisp;
+ });
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ if (labelData.length === 0) {
+ return labelSelection.update([]);
+ }
+ const data = labelData.filter((labelDatum) => {
+ const { label } = this.getItemConfig(labelDatum.itemId);
+ return label.enabled;
+ });
+ return labelSelection.update(data);
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ itemId: "positive",
+ xKey: this.properties.xKey,
+ xName: this.properties.xName ?? this.properties.xName,
+ yKey: this.properties.yKey,
+ yName: this.properties.yName ?? this.properties.yName
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ params.itemId = datum.itemId;
+ textNode.fillOpacity = this.getHighlightStyle(false, datum.datumIndex)?.opacity ?? 1;
+ const label = this.getItemConfig(datum.itemId).label;
+ updateLabelNode4(this, textNode, params, label, datum.label, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { xKey, xName, yKey, yName, tooltip, legendItemName } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yRaw`, processedData)[datumIndex];
+ const yCurrTotalValues = dataModel.resolveColumnById(this, "yCurrentTotal", processedData);
+ const totalTypeValues = dataModel.resolveColumnById(
+ this,
+ `totalTypeValue`,
+ processedData
+ );
+ if (xValue2 == null)
+ return;
+ const datumType = totalTypeValues[datumIndex];
+ const isPositive = (yValue ?? 0) >= 0;
+ const seriesItemType = this.getSeriesItemType(isPositive, datumType);
+ let total;
+ if (this.isTotal(datumType)) {
+ total = yCurrTotalValues[datumIndex];
+ } else if (this.isSubtotal(datumType)) {
+ total = yCurrTotalValues[datumIndex];
+ for (let previousIndex = datumIndex - 1; previousIndex >= 0; previousIndex -= 1) {
+ if (this.isSubtotal(totalTypeValues[previousIndex])) {
+ total = total - yCurrTotalValues[previousIndex];
+ break;
+ }
+ }
+ } else {
+ total = yValue;
+ }
+ const nodeDatum = this.contextNodeData?.nodeData?.[datumIndex];
+ const format = this.getItemStyle(nodeDatum, false, void 0, nodeDatum?.itemId);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ symbol: this.legendItemSymbol(seriesItemType),
+ data: [
+ {
+ label: yName,
+ fallbackLabel: yKey,
+ value: this.getAxisValueText(yAxis, "tooltip", total, datum, yKey, legendItemName)
+ }
+ ]
+ },
+ { seriesId, datum, title: yName, itemId: seriesItemType, xKey, xName, yKey, yName, ...format }
+ );
+ }
+ legendItemSymbol(item) {
+ const { fill, stroke, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.getItemConfig(item);
+ return {
+ marker: {
+ fill,
+ stroke,
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id, seriesItemTypes } = this;
+ const legendData = [];
+ const capitalise = (text) => text.charAt(0).toUpperCase() + text.substring(1);
+ const { showInLegend } = this.properties;
+ for (const item of seriesItemTypes) {
+ const { name } = this.getItemConfig(item);
+ legendData.push({
+ legendType: "category",
+ id,
+ itemId: item,
+ seriesId: id,
+ enabled: true,
+ label: { text: name ?? capitalise(item) },
+ symbol: this.legendItemSymbol(item),
+ hideInLegend: !showInLegend,
+ isFixed: true
+ });
+ }
+ return legendData;
+ }
+ toggleSeriesItem() {
+ }
+ animateEmptyUpdateReady(opts) {
+ const { datumSelection, labelSelection, contextData } = opts;
+ const fns = prepareBarAnimationFunctions2(
+ collapsedStartingBarPosition(this.isVertical(), this.axes, "normal"),
+ "unknown"
+ );
+ motion3.fromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], fns);
+ seriesLabelFadeInAnimation3(this, "labels", this.ctx.animationManager, labelSelection);
+ const { pointData } = contextData;
+ if (!pointData)
+ return;
+ if (this.isVertical()) {
+ this.animateConnectorLinesVertical(opts);
+ } else {
+ this.animateConnectorLinesHorizontal(opts);
+ }
+ }
+ animateConnectorLinesHorizontal(opts) {
+ const { pointData = [] } = opts.contextData;
+ const [lineNode] = opts.paths;
+ const { path: linePath } = lineNode;
+ this.updateLineNode(lineNode);
+ const valueAxis = this.getValueAxis();
+ const valueAxisReversed = valueAxis?.isReversed();
+ const compare = valueAxisReversed ? (v, v2) => v < v2 : (v, v2) => v > v2;
+ const startX = valueAxis?.scale.convert(0);
+ const endX = pointData.reduce(
+ (end, point) => {
+ if (compare(point.x, end)) {
+ end = point.x;
+ }
+ return end;
+ },
+ valueAxisReversed ? Infinity : 0
+ );
+ const scale = (value, start1, end1, start2, end2) => {
+ return (value - start1) / (end1 - start1) * (end2 - start2) + start2;
+ };
+ this.ctx.animationManager.animate({
+ id: `${this.id}_connectors`,
+ groupId: this.id,
+ phase: "initial",
+ from: startX,
+ to: endX,
+ ease: _ModuleSupport59.Motion.easeOut,
+ collapsable: false,
+ onUpdate(pointX) {
+ linePath.clear(true);
+ for (const [index, point] of pointData.entries()) {
+ const x = scale(pointX, startX, endX, startX, point.x);
+ const x2 = scale(pointX, startX, endX, startX, point.x2);
+ if (index !== 0) {
+ linePath.lineTo(x, point.y);
+ }
+ linePath.moveTo(x2, point.y2);
+ }
+ lineNode.checkPathDirty();
+ },
+ onStop: () => this.resetConnectorLinesPath(opts)
+ });
+ }
+ animateConnectorLinesVertical(opts) {
+ const { pointData = [] } = opts.contextData;
+ const [lineNode] = opts.paths;
+ const { path: linePath } = lineNode;
+ this.updateLineNode(lineNode);
+ const valueAxis = this.getValueAxis();
+ const valueAxisReversed = valueAxis?.isReversed();
+ const compare = valueAxisReversed ? (v, v2) => v > v2 : (v, v2) => v < v2;
+ const startY = valueAxis?.scale.convert(0);
+ const endY = pointData.reduce(
+ (end, point) => {
+ if (compare(point.y, end)) {
+ end = point.y;
+ }
+ return end;
+ },
+ valueAxisReversed ? 0 : Infinity
+ );
+ const scale = (value, start1, end1, start2, end2) => {
+ return (value - start1) / (end1 - start1) * (end2 - start2) + start2;
+ };
+ this.ctx.animationManager.animate({
+ id: `${this.id}_connectors`,
+ groupId: this.id,
+ phase: "initial",
+ from: startY,
+ to: endY,
+ ease: _ModuleSupport59.Motion.easeOut,
+ collapsable: false,
+ onUpdate(pointY) {
+ linePath.clear(true);
+ for (const [index, point] of pointData.entries()) {
+ const y = scale(pointY, startY, endY, startY, point.y);
+ const y2 = scale(pointY, startY, endY, startY, point.y2);
+ if (index !== 0) {
+ linePath.lineTo(point.x, y);
+ }
+ linePath.moveTo(point.x2, y2);
+ }
+ lineNode.checkPathDirty();
+ },
+ onStop: () => this.resetConnectorLinesPath(opts)
+ });
+ }
+ animateReadyResize(data) {
+ super.animateReadyResize(data);
+ this.resetConnectorLinesPath(data);
+ }
+ updatePaths(opts) {
+ this.resetConnectorLinesPath({ contextData: opts.contextData, paths: opts.paths });
+ }
+ resetConnectorLinesPath({
+ contextData,
+ paths
+ }) {
+ if (paths.length === 0) {
+ return;
+ }
+ const [lineNode] = paths;
+ this.updateLineNode(lineNode);
+ const { path: linePath } = lineNode;
+ linePath.clear(true);
+ const { pointData } = contextData;
+ if (!pointData) {
+ return;
+ }
+ for (const [index, point] of pointData.entries()) {
+ if (index !== 0) {
+ linePath.lineTo(point.x, point.y);
+ }
+ linePath.moveTo(point.x2, point.y2);
+ }
+ lineNode.checkPathDirty();
+ }
+ updateLineNode(lineNode) {
+ const { stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this.properties.line;
+ lineNode.setProperties({
+ fill: void 0,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ lineJoin: "round",
+ pointerEvents: _ModuleSupport59.PointerEvents.None
+ });
+ }
+ isLabelEnabled() {
+ const { positive, negative, total } = this.properties.item;
+ return positive.label.enabled || negative.label.enabled || total.label.enabled;
+ }
+ onDataChange() {
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds5(this, this.contextNodeData?.nodeData[datumIndex]);
+ }
+ hasItemStylers() {
+ const { positive, negative, total } = this.properties.item;
+ return positive.itemStyler != null || positive.label.itemStyler != null || negative.itemStyler != null || negative.label.itemStyler != null || total.itemStyler != null || total.label.itemStyler != null;
+ }
+};
+WaterfallSeries.className = "WaterfallSeries";
+WaterfallSeries.type = "waterfall";
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport60 } from "ag-charts-community";
+import { arrayOfDefs as arrayOfDefs2, constant as constant8, positiveNumber, required as required8, string as string8, union as union2 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs7, waterfallSeriesThemeableOptionsDef } = _ModuleSupport60;
+var waterfallSeriesOptionsDef = {
+ ...waterfallSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs7,
+ type: required8(constant8("waterfall")),
+ xKey: required8(string8),
+ yKey: required8(string8),
+ xName: string8,
+ yName: string8,
+ totals: arrayOfDefs2(
+ {
+ totalType: required8(union2("total", "subtotal")),
+ index: required8(positiveNumber),
+ axisLabel: required8(string8)
+ },
+ "a total definition options array"
+ )
+};
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallThemes.ts
+import { _ModuleSupport as _ModuleSupport61 } from "ag-charts-community";
+var { FILL_GRADIENT_LINEAR_KEYED_DEFAULTS: FILL_GRADIENT_LINEAR_KEYED_DEFAULTS2, FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS3, FILL_PATTERN_KEYED_DEFAULTS: FILL_PATTERN_KEYED_DEFAULTS2 } = _ModuleSupport61;
+function itemTheme2(key, index) {
+ return {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $path: [`/${index}`, { $palette: "fill" }, { $palette: "fills" }] },
+ { $palette: `${key}.fill` }
+ ]
+ },
+ ["gradient", FILL_GRADIENT_LINEAR_KEYED_DEFAULTS2(key)],
+ ["image", FILL_IMAGE_DEFAULTS3],
+ ["pattern", FILL_PATTERN_KEYED_DEFAULTS2(key)]
+ ]
+ },
+ stroke: { $palette: `${key}.stroke` },
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ ..._ModuleSupport61.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontStyle: void 0,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ formatter: void 0,
+ placement: "outside-end",
+ padding: { $isUserOption: ["./spacing", 0, 6] }
+ // compatibility with old `padding` property (now named `spacing`).
+ }
+ };
+}
+var WATERFALL_SERIES_THEME = {
+ series: {
+ item: {
+ positive: itemTheme2("altUp", 0),
+ negative: itemTheme2("altDown", 1),
+ total: itemTheme2("neutral", 2)
+ },
+ line: {
+ stroke: { $palette: "neutral.stroke" },
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0,
+ strokeWidth: 2
+ },
+ highlight: _ModuleSupport61.singleSeriesHighlightStyle()
+ },
+ legend: {
+ enabled: true,
+ toggleSeries: false
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallModule.ts
+var WaterfallModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "waterfall",
+ solo: true,
+ moduleFactory: (ctx) => new WaterfallSeries(ctx),
+ defaultAxes: _ModuleSupport62.DIRECTION_SWAP_AXES,
+ themeTemplate: WATERFALL_SERIES_THEME
+};
+var WaterfallSeriesModule = {
+ type: "series",
+ name: "waterfall",
+ chartType: "cartesian",
+ enterprise: true,
+ options: waterfallSeriesOptionsDef,
+ create: (ctx) => new WaterfallSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorOptionsDefs.ts
+var {
+ NewAreaSeriesModule,
+ NewBarSeriesModule,
+ NewBubbleSeriesModule,
+ NewHistogramSeriesModule,
+ NewLineSeriesModule,
+ NewScatterSeriesModule,
+ numberFormatValidator,
+ textOrSegments,
+ without: without2
+} = _ModuleSupport63;
+var navigatorHandleOptionsDef = {
+ width: positiveNumber2,
+ height: positiveNumber2,
+ grip: boolean7,
+ fill: color2,
+ stroke: color2,
+ strokeWidth: positiveNumber2,
+ cornerRadius: positiveNumber2
+};
+var commonIgnoredMiniChartProperties = [
+ "cursor",
+ "highlightStyle",
+ "listeners",
+ "nodeClickRange",
+ "showInLegend",
+ "showInMiniChart",
+ "tooltip",
+ "visible",
+ "xName",
+ "yName"
+];
+var barIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "errorBar",
+ "label",
+ "legendItemName",
+ "direction"
+];
+var boxPlotIngnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "direction",
+ "legendItemName",
+ "minName",
+ "q1Name",
+ "medianName",
+ "q3Name",
+ "maxName"
+];
+var bubbleIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "title",
+ "label",
+ "labelKey",
+ "labelName",
+ "sizeName"
+];
+var heatmapIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "title",
+ "label",
+ "colorName",
+ "textAlign",
+ "verticalAlign",
+ "itemPadding",
+ "colorRange"
+];
+var histogramIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "label"
+];
+var lineIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "errorBar",
+ "title",
+ "label"
+];
+var rangeAreaIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "label",
+ "yLowName",
+ "yHighName"
+];
+var rangeBarIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "direction",
+ "label",
+ "yLowName",
+ "yHighName"
+];
+var scatterIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "errorBar",
+ "title",
+ "label",
+ "labelKey",
+ "labelName"
+];
+var waterfallIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "direction"
+];
+var navigatorOptionsDef = {
+ enabled: boolean7,
+ height: positiveNumber2,
+ spacing: positiveNumber2,
+ cornerRadius: number6,
+ mask: {
+ fill: color2,
+ fillOpacity: ratio2,
+ stroke: color2,
+ strokeWidth: positiveNumber2
+ },
+ minHandle: navigatorHandleOptionsDef,
+ maxHandle: navigatorHandleOptionsDef,
+ miniChart: {
+ enabled: boolean7,
+ padding: {
+ top: positiveNumber2,
+ bottom: positiveNumber2
+ },
+ label: {
+ enabled: boolean7,
+ avoidCollisions: boolean7,
+ spacing: positiveNumber2,
+ format: numberFormatValidator,
+ formatter: callbackOf(textOrSegments),
+ interval: {
+ minSpacing: positiveNumber2,
+ maxSpacing: positiveNumber2,
+ values: array,
+ step: number6
+ },
+ ...fontOptionsDef
+ },
+ series: arrayOfDefs3(
+ typeUnion2(
+ {
+ area: without2(NewAreaSeriesModule.options, [...commonIgnoredMiniChartProperties, "type"]),
+ bar: without2(NewBarSeriesModule.options, [...barIgnoredMiniChartProperties, "type"]),
+ "box-plot": without2(BoxPlotSeriesModule.options, [...boxPlotIngnoredMiniChartProperties, "type"]),
+ bubble: without2(NewBubbleSeriesModule.options, [...bubbleIgnoredMiniChartProperties, "type"]),
+ candlestick: without2(CandlestickSeriesModule.options, [
+ ...commonIgnoredMiniChartProperties,
+ "type"
+ ]),
+ heatmap: without2(HeatmapSeriesModule.options, [...heatmapIgnoredMiniChartProperties, "type"]),
+ histogram: without2(NewHistogramSeriesModule.options, [
+ ...histogramIgnoredMiniChartProperties,
+ "type"
+ ]),
+ line: without2(NewLineSeriesModule.options, [...lineIgnoredMiniChartProperties, "type"]),
+ ohlc: without2(OhlcSeriesModule.options, [...commonIgnoredMiniChartProperties, "type"]),
+ "range-area": without2(RangeAreaSeriesModule.options, [
+ ...rangeAreaIgnoredMiniChartProperties,
+ "type"
+ ]),
+ "range-bar": without2(RangeBarSeriesModule.options, [...rangeBarIgnoredMiniChartProperties, "type"]),
+ scatter: without2(NewScatterSeriesModule.options, [...scatterIgnoredMiniChartProperties, "type"]),
+ waterfall: without2(WaterfallSeriesModule.options, [...waterfallIgnoredMiniChartProperties, "type"])
+ },
+ "miniChart series options"
+ )
+ )
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/sync/pluginModules.ts
+var { annotationOptionsDef } = _ModuleSupport64;
+var AnnotationsModule = {
+ type: "plugin",
+ name: "annotations",
+ chartType: "cartesian",
+ options: annotationOptionsDef,
+ create() {
+ return null;
+ }
+};
+var NavigatorModule = {
+ type: "plugin",
+ name: "navigator",
+ chartType: "cartesian",
+ options: navigatorOptionsDef,
+ create() {
+ return null;
+ }
+};
+var InitialStateModule = {
+ type: "plugin",
+ name: "initialState",
+ options: initialStateOptionsDef,
+ create() {
+ return null;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/chord/chordModule.ts
+import { _ModuleSupport as _ModuleSupport70 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeries.ts
+import { _ModuleSupport as _ModuleSupport68 } from "ag-charts-community";
+import {
+ Logger as Logger5,
+ cachedTextMeasurer as cachedTextMeasurer2,
+ calcLineHeight,
+ toPlainText as toPlainText2,
+ wrapText
+} from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/flow-proportion/flowProportionSeries.ts
+import { _ModuleSupport as _ModuleSupport65 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/flow-proportion/flowProportionUtil.ts
+import { Logger as Logger4 } from "ag-charts-core";
+function computeNodeGraph(nodes, links, includeCircularReferences) {
+ if (!includeCircularReferences) {
+ links = removeCircularLinks(links);
+ }
+ const nodeGraph = /* @__PURE__ */ new Map();
+ for (const datum of nodes) {
+ nodeGraph.set(datum.id, {
+ datum,
+ linksBefore: [],
+ linksAfter: [],
+ maxPathLengthBefore: -1,
+ maxPathLengthAfter: -1
+ });
+ }
+ let maxPathLength = 0;
+ for (const [id, node] of nodeGraph.entries()) {
+ maxPathLength = Math.max(
+ maxPathLength,
+ computePathLength(nodeGraph, links, node, id, -1, []) + computePathLength(nodeGraph, links, node, id, 1, []) + 1
+ );
+ }
+ return { links, nodeGraph, maxPathLength };
+}
+function findCircularLinks(links, link, into, stack) {
+ const stackIndex = stack.indexOf(link);
+ if (stackIndex !== -1) {
+ for (let i = stackIndex; i < stack.length; i += 1) {
+ into.add(stack[i]);
+ }
+ return;
+ }
+ stack.push(link);
+ const { toNode } = link;
+ for (const next of links) {
+ if (next.fromNode === toNode) {
+ findCircularLinks(links, next, into, stack);
+ }
+ }
+ stack.pop();
+}
+function removeCircularLinks(links) {
+ const circularLinks = /* @__PURE__ */ new Set();
+ for (const link of links) {
+ findCircularLinks(links, link, circularLinks, []);
+ }
+ if (circularLinks.size !== 0) {
+ Logger4.warnOnce("Some links formed circular references. These will be removed from the output.");
+ }
+ return circularLinks.size === 0 ? links : links.filter((link) => !circularLinks.has(link));
+}
+function computePathLength(nodeGraph, links, node, id, direction, stack) {
+ if (stack.includes(id)) {
+ return Infinity;
+ }
+ let maxPathLength = direction === -1 ? node.maxPathLengthBefore : node.maxPathLengthAfter;
+ if (maxPathLength === -1) {
+ maxPathLength = 0;
+ const connectedLinks = direction === -1 ? node.linksBefore : node.linksAfter;
+ for (const link of links) {
+ const { fromNode, toNode } = link;
+ const linkId = direction === -1 ? toNode.id : fromNode.id;
+ const nextNodeId = direction === -1 ? fromNode.id : toNode.id;
+ const nextNode = id === linkId ? nodeGraph.get(nextNodeId) : void 0;
+ if (nextNode == null)
+ continue;
+ connectedLinks.push({ node: nextNode, link });
+ stack?.push(id);
+ maxPathLength = Math.max(
+ maxPathLength,
+ computePathLength(nodeGraph, links, nextNode, nextNodeId, direction, stack) + 1
+ );
+ stack?.pop();
+ }
+ if (direction === -1) {
+ node.maxPathLengthBefore = maxPathLength;
+ } else {
+ node.maxPathLengthAfter = maxPathLength;
+ }
+ }
+ return maxPathLength;
+}
+
+// packages/ag-charts-enterprise/src/series/flow-proportion/flowProportionSeries.ts
+var { Series, DataController, keyProperty: keyProperty6, valueProperty: valueProperty7, Selection: Selection3, Group: Group5, TransformableText } = _ModuleSupport65;
+var FlowProportionSeriesNodeEvent = class extends _ModuleSupport65.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ const { datumIndex } = datum;
+ const nodeDatum = series.contextNodeData?.nodeData.find(
+ (d) => d.datumIndex.type === datumIndex.type && d.datumIndex.index === datumIndex.index
+ );
+ this.size = nodeDatum?.size;
+ this.label = nodeDatum?.type === 1 /* Node */ ? nodeDatum?.label : void 0;
+ }
+};
+var FlowProportionSeries = class extends Series {
+ constructor() {
+ super(...arguments);
+ this.NodeEvent = FlowProportionSeriesNodeEvent;
+ this.nodeCount = 0;
+ this.linkCount = 0;
+ this.linksDataModel = void 0;
+ this.linksProcessedData = void 0;
+ this.nodesDataModel = void 0;
+ this.nodesProcessedData = void 0;
+ this.processedNodes = /* @__PURE__ */ new Map();
+ this.linkGroup = this.contentGroup.appendChild(new Group5({ name: "linkGroup" }));
+ this.nodeGroup = this.contentGroup.appendChild(new Group5({ name: "nodeGroup" }));
+ this.focusLinkGroup = this.highlightGroup.appendChild(new Group5({ name: "linkGroup" }));
+ this.focusNodeGroup = this.highlightGroup.appendChild(new Group5({ name: "nodeGroup" }));
+ this.highlightLinkGroup = this.highlightGroup.appendChild(new Group5({ name: "linkGroup" }));
+ this.highlightNodeGroup = this.highlightGroup.appendChild(new Group5({ name: "nodeGroup" }));
+ this.labelSelection = Selection3.select(
+ this.labelGroup,
+ TransformableText
+ );
+ this.linkSelection = Selection3.select(
+ this.linkGroup,
+ () => this.linkFactory()
+ );
+ this.nodeSelection = Selection3.select(
+ this.nodeGroup,
+ () => this.nodeFactory()
+ );
+ this.focusLinkSelection = Selection3.select(
+ this.focusLinkGroup,
+ () => this.linkFactory()
+ );
+ this.focusNodeSelection = Selection3.select(
+ this.focusNodeGroup,
+ () => this.nodeFactory()
+ );
+ this.highlightLinkSelection = Selection3.select(
+ this.highlightLinkGroup,
+ () => this.linkFactory()
+ );
+ this.highlightNodeSelection = Selection3.select(
+ this.highlightNodeGroup,
+ () => this.nodeFactory()
+ );
+ }
+ get nodes() {
+ return this.properties.nodes;
+ }
+ async processData(dataController) {
+ const { data, nodes } = this;
+ if (data == null)
+ return;
+ const { fromKey, toKey, sizeKey, idKey, labelKey } = this.properties;
+ const nodesDataController = new DataController("standalone", dataController.suppressFieldDotNotation);
+ const nodesDataModelPromise = nodes == null ? null : nodesDataController.request(
+ this.id,
+ _ModuleSupport65.DataSet.wrap(nodes) ?? _ModuleSupport65.DataSet.empty(),
+ {
+ props: [
+ keyProperty6(idKey, void 0, { id: "idValue", includeProperty: false }),
+ ...labelKey == null ? [] : [valueProperty7(labelKey, void 0, { id: "labelValue", includeProperty: false })]
+ ],
+ groupByKeys: true
+ }
+ );
+ const linksDataModelPromise = dataController.request(this.id, data, {
+ props: [
+ valueProperty7(fromKey, void 0, { id: "fromValue", includeProperty: false }),
+ valueProperty7(toKey, void 0, { id: "toValue", includeProperty: false }),
+ ...sizeKey == null ? [] : [
+ valueProperty7(sizeKey, void 0, {
+ id: "sizeValue",
+ includeProperty: false,
+ missingValue: 0
+ })
+ ]
+ ],
+ groupByKeys: false
+ });
+ if (nodes != null) {
+ nodesDataController.execute();
+ }
+ const [nodesDataModel, linksDataModel] = await Promise.all([
+ nodesDataModelPromise ?? Promise.resolve(null),
+ linksDataModelPromise
+ ]);
+ this.nodesDataModel = nodesDataModel?.dataModel;
+ this.nodesProcessedData = nodesDataModel?.processedData;
+ this.linksDataModel = linksDataModel?.dataModel;
+ this.linksProcessedData = linksDataModel?.processedData;
+ const processedNodes = /* @__PURE__ */ new Map();
+ if (nodesDataModel == null) {
+ const fromIdValues = linksDataModel.dataModel.resolveColumnById(
+ this,
+ "fromValue",
+ linksDataModel.processedData
+ );
+ const toIdValues = linksDataModel.dataModel.resolveColumnById(
+ this,
+ "toValue",
+ linksDataModel.processedData
+ );
+ const createImplicitNode = (id) => {
+ const datumIndex = processedNodes.size;
+ const label = id;
+ return {
+ series: this,
+ itemId: void 0,
+ datum: {},
+ // Must be a referential object for tooltips
+ datumIndex: { type: 1 /* Node */, index: datumIndex },
+ type: 1 /* Node */,
+ index: datumIndex,
+ linksBefore: [],
+ linksAfter: [],
+ id,
+ size: 0,
+ label,
+ style: this.getNodeStyle(
+ {
+ datumIndex: { type: 1 /* Node */, index: datumIndex },
+ datum: {},
+ size: 0,
+ label
+ },
+ datumIndex,
+ false
+ )
+ };
+ };
+ const linkData = linksDataModel.processedData.dataSources.get(this.id)?.data;
+ if (linkData) {
+ for (const [datumIndex] of linkData.entries()) {
+ const fromId = fromIdValues[datumIndex];
+ const toId = toIdValues[datumIndex];
+ if (fromId == null || toId == null)
+ continue;
+ if (!processedNodes.has(fromId)) {
+ processedNodes.set(fromId, createImplicitNode(fromId));
+ }
+ if (!processedNodes.has(toId)) {
+ processedNodes.set(toId, createImplicitNode(toId));
+ }
+ }
+ }
+ } else {
+ const nodeIdValues = nodesDataModel.dataModel.resolveColumnById(
+ this,
+ "idValue",
+ nodesDataModel.processedData
+ );
+ const labelValues = labelKey == null ? void 0 : nodesDataModel.dataModel.resolveColumnById(
+ this,
+ "labelValue",
+ nodesDataModel.processedData
+ );
+ const nodeData = nodesDataModel.processedData.dataSources.get(this.id)?.data;
+ if (nodeData) {
+ for (const [datumIndex, datum] of nodeData.entries()) {
+ const id = nodeIdValues[datumIndex];
+ const label = labelValues?.[datumIndex];
+ const nodeDatumIndex = { type: 1 /* Node */, index: datumIndex };
+ processedNodes.set(id, {
+ series: this,
+ itemId: void 0,
+ datum,
+ datumIndex: nodeDatumIndex,
+ type: 1 /* Node */,
+ index: datumIndex,
+ linksBefore: [],
+ linksAfter: [],
+ id,
+ size: 0,
+ label,
+ style: this.getNodeStyle(
+ { datumIndex: nodeDatumIndex, datum, size: 0, label },
+ datumIndex,
+ false
+ )
+ });
+ }
+ }
+ }
+ this.processedNodes = processedNodes;
+ }
+ getNodeGraph(createNode, createLink, { includeCircularReferences }) {
+ const { linksDataModel, linksProcessedData } = this;
+ if (linksDataModel == null || linksProcessedData == null) {
+ const { links: links2, nodeGraph: nodeGraph2, maxPathLength: maxPathLength2 } = computeNodeGraph(
+ (/* @__PURE__ */ new Map()).values(),
+ [],
+ includeCircularReferences
+ );
+ this.nodeCount = 0;
+ this.linkCount = 0;
+ return { nodeGraph: nodeGraph2, links: links2, maxPathLength: maxPathLength2 };
+ }
+ const { sizeKey } = this.properties;
+ const fromIdValues = linksDataModel.resolveColumnById(this, "fromValue", linksProcessedData);
+ const toIdValues = linksDataModel.resolveColumnById(this, "toValue", linksProcessedData);
+ const sizeValues = sizeKey == null ? void 0 : linksDataModel.resolveColumnById(this, "sizeValue", linksProcessedData);
+ const nodesById = /* @__PURE__ */ new Map();
+ for (const datum of this.processedNodes.values()) {
+ const node = createNode(datum);
+ nodesById.set(datum.id, node);
+ }
+ const baseLinks = [];
+ const linkData = linksProcessedData.dataSources.get(this.id)?.data;
+ if (linkData) {
+ for (const [datumIndex, datum] of linkData.entries()) {
+ const fromId = fromIdValues[datumIndex];
+ const toId = toIdValues[datumIndex];
+ const size = sizeValues == null ? 1 : sizeValues[datumIndex];
+ const fromNode = nodesById.get(fromId);
+ const toNode = nodesById.get(toId);
+ if (size <= 0 || fromNode == null || toNode == null)
+ continue;
+ const linkNodeDatumIndex = { type: 0 /* Link */, index: datumIndex };
+ const link = createLink({
+ series: this,
+ itemId: void 0,
+ datum,
+ datumIndex: linkNodeDatumIndex,
+ type: 0 /* Link */,
+ index: datumIndex,
+ fromNode,
+ toNode,
+ size,
+ style: this.getLinkStyle(
+ { datum, datumIndex: linkNodeDatumIndex },
+ fromNode.datumIndex,
+ false
+ )
+ });
+ baseLinks.push(link);
+ }
+ }
+ const { links, nodeGraph, maxPathLength } = computeNodeGraph(
+ nodesById.values(),
+ baseLinks,
+ includeCircularReferences
+ );
+ for (const node of nodeGraph.values()) {
+ node.datum.linksBefore = node.linksBefore.map((linkedNode) => linkedNode.link);
+ node.datum.linksAfter = node.linksAfter.map((linkedNode) => linkedNode.link);
+ }
+ this.nodeCount = nodeGraph.size;
+ this.linkCount = links.length;
+ return { nodeGraph, links, maxPathLength };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update(opts) {
+ const { seriesRect } = opts;
+ const newNodeDataDependencies = {
+ seriesRectWidth: seriesRect?.width ?? 0,
+ seriesRectHeight: seriesRect?.height ?? 0
+ };
+ if (this._nodeDataDependencies == null || this._nodeDataDependencies.seriesRectWidth !== newNodeDataDependencies.seriesRectWidth || this._nodeDataDependencies.seriesRectHeight !== newNodeDataDependencies.seriesRectHeight) {
+ this._nodeDataDependencies = newNodeDataDependencies;
+ }
+ this.updateSelections();
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ if (highlightedDatum?.series === this && highlightedDatum.type == null) {
+ const { itemId } = highlightedDatum;
+ highlightedDatum = itemId == null ? void 0 : nodeData.find((node) => node.type === 1 /* Node */ && node.id === itemId);
+ } else if (highlightedDatum?.series !== this) {
+ highlightedDatum = void 0;
+ }
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = highlightedDatum == null ? 1 : this.properties.highlight.unhighlightedItem.opacity ?? 1;
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection: this.labelSelection });
+ this.updateLabelNodes({ labelSelection: this.labelSelection });
+ this.linkSelection = this.updateLinkSelection({
+ nodeData: nodeData.filter((d) => d.type === 0 /* Link */),
+ datumSelection: this.linkSelection
+ });
+ this.updateLinkNodes({ datumSelection: this.linkSelection, isHighlight: false });
+ this.nodeSelection = this.updateNodeSelection({
+ nodeData: nodeData.filter((d) => d.type === 1 /* Node */),
+ datumSelection: this.nodeSelection
+ });
+ this.updateNodeNodes({ datumSelection: this.nodeSelection, isHighlight: false });
+ let focusLinkSelection;
+ let focusNodeSelection;
+ let highlightLinkSelection;
+ let highlightNodeSelection;
+ if (highlightedDatum?.type === 1 /* Node */) {
+ focusLinkSelection = nodeData.filter((node) => {
+ return node.type === 0 /* Link */ && (node.toNode === highlightedDatum || node.fromNode === highlightedDatum);
+ });
+ focusNodeSelection = focusLinkSelection.map((link) => {
+ return link.fromNode === highlightedDatum ? link.toNode : link.fromNode;
+ });
+ focusNodeSelection.push(highlightedDatum);
+ highlightLinkSelection = [];
+ highlightNodeSelection = [highlightedDatum];
+ } else if (highlightedDatum?.type === 0 /* Link */) {
+ focusLinkSelection = [highlightedDatum];
+ focusNodeSelection = [highlightedDatum.fromNode, highlightedDatum.toNode];
+ highlightLinkSelection = [highlightedDatum];
+ highlightNodeSelection = [];
+ } else {
+ focusLinkSelection = [];
+ focusNodeSelection = [];
+ highlightLinkSelection = [];
+ highlightNodeSelection = [];
+ }
+ this.focusLinkSelection = this.updateLinkSelection({
+ nodeData: focusLinkSelection,
+ datumSelection: this.focusLinkSelection
+ });
+ this.updateLinkNodes({ datumSelection: this.focusLinkSelection, isHighlight: false });
+ this.focusNodeSelection = this.updateNodeSelection({
+ nodeData: focusNodeSelection,
+ datumSelection: this.focusNodeSelection
+ });
+ this.updateNodeNodes({ datumSelection: this.focusNodeSelection, isHighlight: false });
+ this.highlightLinkSelection = this.updateLinkSelection({
+ nodeData: highlightLinkSelection,
+ datumSelection: this.highlightLinkSelection
+ });
+ this.updateLinkNodes({ datumSelection: this.highlightLinkSelection, isHighlight: true });
+ this.highlightNodeSelection = this.updateNodeSelection({
+ nodeData: highlightNodeSelection,
+ datumSelection: this.highlightNodeSelection
+ });
+ this.updateNodeNodes({ datumSelection: this.highlightNodeSelection, isHighlight: true });
+ }
+ resetAnimation(_chartAnimationPhase) {
+ }
+ dataCount() {
+ return Number.NaN;
+ }
+ getSeriesDomain(_direction) {
+ return [];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ legendItemSymbol(_type, nodeIndex, format = {}) {
+ const { fills, strokes } = this.properties;
+ const {
+ fill = fills[nodeIndex % fills.length],
+ fillOpacity = 1,
+ stroke = strokes[nodeIndex % strokes.length],
+ strokeWidth = 0,
+ strokeOpacity = 1,
+ lineDash = [0],
+ lineDashOffset = 0
+ } = format;
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category")
+ return [];
+ const { showInLegend } = this.properties;
+ return Array.from(
+ this.processedNodes.values(),
+ ({ id, label }, nodeIndex) => ({
+ legendType: "category",
+ id: this.id,
+ itemId: id,
+ seriesId: this.id,
+ enabled: true,
+ label: { text: label ?? id },
+ symbol: this.legendItemSymbol(1 /* Node */, nodeIndex),
+ hideInLegend: !showInLegend,
+ isFixed: true
+ })
+ );
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.linkSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ this.nodeSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ getDatumAriaText(datum, description) {
+ if (datum.type === 0 /* Link */) {
+ return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink", {
+ index: datum.index + 1,
+ count: this.linkCount,
+ from: datum.fromNode.id,
+ to: datum.toNode.id,
+ size: datum.size,
+ sizeName: this.properties.sizeName ?? this.properties.sizeKey
+ });
+ } else if (datum.type === 1 /* Node */) {
+ return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode", {
+ index: datum.index + 1,
+ count: this.nodeCount,
+ description
+ });
+ }
+ }
+ pickFocus(opts) {
+ const { datumIndexDelta: childDelta, otherIndexDelta: depthDelta } = opts;
+ const currentNodeDatum = this.contextNodeData?.nodeData[opts.datumIndex - opts.datumIndexDelta];
+ let nextNodeDatum = currentNodeDatum;
+ if (depthDelta !== 0 || childDelta === 0)
+ return;
+ if (currentNodeDatum?.type === 0 /* Link */) {
+ const allLinks = Array.from(this.linkSelection, (link) => link.datum);
+ const selfIndex = allLinks.indexOf(currentNodeDatum);
+ const nextIndex = selfIndex + childDelta;
+ if (nextIndex >= 0 && nextIndex < allLinks.length) {
+ nextNodeDatum = allLinks[nextIndex];
+ } else if (nextIndex > 0) {
+ nextNodeDatum = allLinks.at(-1);
+ } else {
+ const allNodes = Array.from(this.nodeSelection, (node) => node.datum);
+ nextNodeDatum = allNodes.at(-1);
+ }
+ } else if (currentNodeDatum?.type === 1 /* Node */) {
+ const allNodes = Array.from(this.nodeSelection, (node) => node.datum);
+ const selfIndex = allNodes.indexOf(currentNodeDatum);
+ const nextIndex = selfIndex + childDelta;
+ if (nextIndex >= 0 && nextIndex < allNodes.length) {
+ nextNodeDatum = allNodes[nextIndex];
+ } else if (nextIndex < 0) {
+ nextNodeDatum = allNodes[0];
+ } else {
+ const allLinks = Array.from(this.linkSelection, (link) => link.datum);
+ nextNodeDatum = allLinks[0];
+ }
+ }
+ if (nextNodeDatum == null)
+ return;
+ const nodeDatum = nextNodeDatum.type === 1 /* Node */ ? Array.from(this.nodeSelection).find((n) => n.datum === nextNodeDatum) : Array.from(this.linkSelection).find((n) => n.datum === nextNodeDatum);
+ if (nodeDatum == null)
+ return;
+ const bounds = this.computeFocusBounds(nodeDatum.node);
+ if (bounds == null)
+ return;
+ return {
+ datum: nodeDatum.datum,
+ datumIndex: this.contextNodeData?.nodeData.indexOf(nodeDatum.datum) ?? 0,
+ otherIndex: 0,
+ bounds,
+ clipFocusBox: true
+ };
+ }
+ getCategoryValue(_datumIndex) {
+ return;
+ }
+ datumIndexForCategoryValue(_categoryValue) {
+ return;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/chord/chordLink.ts
+import { _ModuleSupport as _ModuleSupport66 } from "ag-charts-community";
+var { Path: Path7, SceneChangeDetection: SceneChangeDetection4 } = _ModuleSupport66;
+function bezierControlPoints({
+ radius,
+ startAngle,
+ endAngle,
+ tension
+}) {
+ const cp0x = radius * Math.cos(startAngle);
+ const cp0y = radius * Math.sin(startAngle);
+ const cp3x = radius * Math.cos(endAngle);
+ const cp3y = radius * Math.sin(endAngle);
+ const cp1x = cp0x * tension;
+ const cp1y = cp0y * tension;
+ const cp2x = cp3x * tension;
+ const cp2y = cp3y * tension;
+ return {
+ x: [cp0x, cp1x, cp2x, cp3x],
+ y: [cp0y, cp1y, cp2y, cp3y]
+ };
+}
+var ChordLink = class extends Path7 {
+ constructor() {
+ super(...arguments);
+ this.centerX = 0;
+ this.centerY = 0;
+ this.radius = 0;
+ this.startAngle1 = 0;
+ this.endAngle1 = 0;
+ this.startAngle2 = 0;
+ this.endAngle2 = 0;
+ this.tension = 1;
+ }
+ tensionedCurveTo(cp0x, cp0y, cp1x, cp1y, cp2x, cp2y, cp3x, cp3y) {
+ const { path, tension } = this;
+ const scale = 1 - tension;
+ path.cubicCurveTo(
+ (cp1x - cp0x) * scale + cp0x,
+ (cp1y - cp0y) * scale + cp0y,
+ (cp2x - cp3x) * scale + cp3x,
+ (cp2y - cp3y) * scale + cp3y,
+ cp3x,
+ cp3y
+ );
+ }
+ updatePath() {
+ const { path, centerX, centerY, radius } = this;
+ let { startAngle1, endAngle1, startAngle2, endAngle2 } = this;
+ if (startAngle1 > startAngle2) {
+ [startAngle1, startAngle2] = [startAngle2, startAngle1];
+ [endAngle1, endAngle2] = [endAngle2, endAngle1];
+ }
+ path.clear();
+ const startX = centerX + radius * Math.cos(startAngle1);
+ const startY = centerY + radius * Math.sin(startAngle1);
+ path.moveTo(startX, startY);
+ this.tensionedCurveTo(
+ startX,
+ startY,
+ centerX,
+ centerY,
+ centerX,
+ centerY,
+ centerX + radius * Math.cos(endAngle2),
+ centerY + radius * Math.sin(endAngle2)
+ );
+ path.arc(centerX, centerY, radius, endAngle2, startAngle2, true);
+ this.tensionedCurveTo(
+ centerX + radius * Math.cos(startAngle2),
+ centerY + radius * Math.sin(startAngle2),
+ centerX,
+ centerY,
+ centerX,
+ centerY,
+ centerX + radius * Math.cos(endAngle1),
+ centerY + radius * Math.sin(endAngle1)
+ );
+ path.arc(centerX, centerY, radius, endAngle1, startAngle1, true);
+ path.closePath();
+ }
+};
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "centerX", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "centerY", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "radius", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "startAngle1", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "endAngle1", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "startAngle2", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "endAngle2", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], ChordLink.prototype, "tension", 2);
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeriesProperties.ts
+import {
+ _ModuleSupport as _ModuleSupport67
+} from "ag-charts-community";
+var {
+ FillGradientDefaults,
+ FillPatternDefaults,
+ FillImageDefaults,
+ BaseProperties: BaseProperties7,
+ makeSeriesTooltip: makeSeriesTooltip8,
+ SeriesProperties,
+ Property: Property20,
+ Label: Label4
+} = _ModuleSupport67;
+var ChordSeriesLabelProperties = class extends Label4 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.maxWidth = 1;
+ }
+};
+__decorateClass([
+ Property20
+], ChordSeriesLabelProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLabelProperties.prototype, "maxWidth", 2);
+var ChordSeriesLinkProperties = class extends BaseProperties7 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.tension = 0;
+ }
+ getStyle(fills, strokes, index) {
+ const { fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset, tension } = this;
+ const fill = this.fill ?? fills[index % fills.length];
+ const stroke = this.stroke ?? strokes[index % fills.length];
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ tension
+ };
+ }
+};
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "fill", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "tension", 2);
+__decorateClass([
+ Property20
+], ChordSeriesLinkProperties.prototype, "itemStyler", 2);
+var ChordSeriesNodeProperties = class extends BaseProperties7 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.width = 1;
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle(fills, strokes, index) {
+ const { fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ const fill = this.fill ?? fills[index % fills.length];
+ const stroke = this.stroke ?? strokes[index % fills.length];
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "width", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "fill", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property20
+], ChordSeriesNodeProperties.prototype, "itemStyler", 2);
+var ChordSeriesProperties = class extends SeriesProperties {
+ constructor() {
+ super();
+ this.idKey = "";
+ this.idName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.sizeKey = void 0;
+ this.sizeName = void 0;
+ this.nodes = void 0;
+ this.fillGradientDefaults = new FillGradientDefaults();
+ this.fillPatternDefaults = new FillPatternDefaults();
+ this.fillImageDefaults = new FillImageDefaults();
+ this.fills = [];
+ this.strokes = [];
+ this.label = new ChordSeriesLabelProperties();
+ this.link = new ChordSeriesLinkProperties();
+ this.node = new ChordSeriesNodeProperties();
+ this.tooltip = makeSeriesTooltip8();
+ this.highlightStyle.deprecated = false;
+ }
+};
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "fromKey", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "toKey", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "nodes", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "fillGradientDefaults", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "fillPatternDefaults", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "fillImageDefaults", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "fills", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "link", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "node", 2);
+__decorateClass([
+ Property20
+], ChordSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode6,
+ createDatumId: createDatumId6,
+ angleBetween: angleBetween2,
+ normalizeAngle360: normalizeAngle3604,
+ isBetweenAngles,
+ Sector: Sector3,
+ evaluateBezier,
+ applyShapeStyle: applyShapeStyle7,
+ getShapeStyle,
+ getLabelStyles,
+ BBox: BBox6,
+ mergeDefaults: mergeDefaults8
+} = _ModuleSupport68;
+var nodeMidAngle = (node) => node.startAngle + angleBetween2(node.startAngle, node.endAngle) / 2;
+var ChordSeries = class extends FlowProportionSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode6.NEAREST_NODE, SeriesNodePickMode6.EXACT_SHAPE_MATCH]
+ });
+ this.properties = new ChordSeriesProperties();
+ }
+ isLabelEnabled() {
+ return (this.properties.labelKey != null || this.nodes == null) && this.properties.label.enabled;
+ }
+ linkFactory() {
+ return new ChordLink();
+ }
+ nodeFactory() {
+ return new Sector3();
+ }
+ createNodeData() {
+ const {
+ id: seriesId,
+ _nodeDataDependencies: { seriesRectWidth, seriesRectHeight } = { seriesRectWidth: 0, seriesRectHeight: 0 },
+ properties
+ } = this;
+ const {
+ fromKey,
+ toKey,
+ sizeKey,
+ labelKey,
+ label: { spacing: labelSpacing, maxWidth: labelMaxWidth, fontSize },
+ node: { width: nodeWidth, spacing: nodeSpacing }
+ } = properties;
+ const centerX = seriesRectWidth / 2;
+ const centerY = seriesRectHeight / 2;
+ let labelData = [];
+ const { nodeGraph, links } = this.getNodeGraph(
+ (node) => ({
+ ...node,
+ centerX,
+ centerY,
+ innerRadius: Number.NaN,
+ outerRadius: Number.NaN,
+ startAngle: Number.NaN,
+ endAngle: Number.NaN
+ }),
+ (link) => ({
+ ...link,
+ centerX,
+ centerY,
+ radius: Number.NaN,
+ startAngle1: Number.NaN,
+ endAngle1: Number.NaN,
+ startAngle2: Number.NaN,
+ endAngle2: Number.NaN
+ }),
+ { includeCircularReferences: true }
+ );
+ let totalSize = 0;
+ for (const [id, { datum: node, linksBefore, linksAfter }] of nodeGraph.entries()) {
+ const size = linksBefore.reduce((acc, { link }) => acc + link.size, 0) + linksAfter.reduce((acc, { link }) => acc + link.size, 0);
+ if (size === 0) {
+ nodeGraph.delete(id);
+ } else {
+ const { label } = properties;
+ node.size = size;
+ totalSize += node.size;
+ const labelText = label.enabled ? this.getLabelText(
+ node.label,
+ node.datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ { datum: node.datum, value: node.label, fromKey, toKey, sizeKey, size: node.size }
+ ) : void 0;
+ node.label = toPlainText2(labelText);
+ }
+ }
+ let labelInset = 0;
+ if (this.isLabelEnabled()) {
+ const measurer = cachedTextMeasurer2(this.properties.label);
+ let maxMeasuredLabelWidth = 0;
+ for (const { datum: node } of nodeGraph.values()) {
+ const { id, label } = node;
+ if (label == null)
+ continue;
+ const text = wrapText(label, {
+ maxWidth: labelMaxWidth,
+ font: this.properties.label,
+ textWrap: "never"
+ });
+ const { width } = measurer.measureLines(text);
+ maxMeasuredLabelWidth = Math.max(width, maxMeasuredLabelWidth);
+ labelData.push({
+ id,
+ text,
+ centerX,
+ centerY,
+ angle: Number.NaN,
+ radius: Number.NaN,
+ size: node.size
+ });
+ }
+ labelInset = maxMeasuredLabelWidth + labelSpacing;
+ }
+ const nodeCount = nodeGraph.size;
+ let radius = Math.min(seriesRectWidth, seriesRectHeight) / 2 - nodeWidth - labelInset;
+ let spacingSweep = nodeSpacing / radius;
+ if (labelInset !== 0 && (nodeCount * spacingSweep >= 1.5 * Math.PI || radius <= 0)) {
+ labelData = [];
+ radius = Math.min(seriesRectWidth, seriesRectHeight) / 2 - nodeWidth;
+ spacingSweep = nodeSpacing / radius;
+ }
+ if (nodeCount * spacingSweep >= 2 * Math.PI || radius <= 0) {
+ Logger5.warnOnce("There was insufficient space to display the Chord Series.");
+ return;
+ }
+ const innerRadius = radius;
+ const outerRadius = radius + nodeWidth;
+ const sizeScale = Math.max((2 * Math.PI - nodeCount * spacingSweep) / totalSize, 0);
+ let nodeAngle = 0;
+ for (const { datum: node } of nodeGraph.values()) {
+ node.innerRadius = innerRadius;
+ node.outerRadius = outerRadius;
+ node.startAngle = nodeAngle;
+ node.endAngle = nodeAngle + node.size * sizeScale;
+ nodeAngle = node.endAngle + spacingSweep;
+ const midR = (node.innerRadius + node.outerRadius) / 2;
+ const midAngle = nodeMidAngle(node);
+ node.midPoint = {
+ x: node.centerX + midR * Math.cos(midAngle),
+ y: node.centerY + midR * Math.sin(midAngle)
+ };
+ }
+ const nodeData = [];
+ for (const { datum: node, linksBefore, linksAfter } of nodeGraph.values()) {
+ const midAngle = nodeMidAngle(node);
+ const combinedLinks = [
+ ...linksBefore.map((l) => ({
+ link: l.link,
+ distance: angleBetween2(nodeMidAngle(l.node.datum), midAngle),
+ after: false
+ })),
+ ...linksAfter.map((l) => ({
+ link: l.link,
+ distance: angleBetween2(nodeMidAngle(l.node.datum), midAngle),
+ after: true
+ }))
+ ];
+ let linkAngle = node.startAngle;
+ for (const { link, after } of combinedLinks.toSorted((a, b) => a.distance - b.distance)) {
+ const linkSweep = link.size * sizeScale;
+ if (after) {
+ link.startAngle1 = linkAngle;
+ link.endAngle1 = linkAngle + linkSweep;
+ } else {
+ link.startAngle2 = linkAngle;
+ link.endAngle2 = linkAngle + linkSweep;
+ }
+ linkAngle += link.size * sizeScale;
+ }
+ nodeData.push(node);
+ }
+ const { tension } = this.properties.link;
+ for (const link of links) {
+ link.radius = radius;
+ const outer = bezierControlPoints({
+ radius,
+ startAngle: link.startAngle1,
+ endAngle: link.endAngle2,
+ tension
+ });
+ const inner = bezierControlPoints({
+ radius,
+ startAngle: link.startAngle2,
+ endAngle: link.endAngle1,
+ tension
+ });
+ const outerX = evaluateBezier(...outer.x, 0.5);
+ const outerY = evaluateBezier(...outer.y, 0.5);
+ const innerX = evaluateBezier(...inner.x, 0.5);
+ const innerY = evaluateBezier(...inner.y, 0.5);
+ link.midPoint = {
+ x: link.centerX + (outerX + innerX) / 2,
+ y: link.centerY + (outerY + innerY) / 2
+ };
+ nodeData.push(link);
+ }
+ for (const label of labelData) {
+ const node = nodeGraph.get(label.id)?.datum;
+ if (node == null)
+ continue;
+ label.radius = outerRadius + labelSpacing;
+ label.angle = normalizeAngle3604(node.startAngle + angleBetween2(node.startAngle, node.endAngle) / 2);
+ }
+ labelData.sort((a, b) => a.angle - b.angle);
+ let minAngle = Infinity;
+ let maxAngle = -Infinity;
+ labelData = labelData.filter((label) => {
+ const labelHeight = calcLineHeight(fontSize);
+ const da = Math.atan2(labelHeight / 2, label.radius);
+ const a0 = label.angle - da;
+ const a1 = label.angle + da;
+ if (isBetweenAngles(minAngle, a0, a1))
+ return false;
+ if (isBetweenAngles(maxAngle, a0, a1))
+ return false;
+ minAngle = Math.min(a0, minAngle);
+ maxAngle = Math.max(a1, maxAngle);
+ return true;
+ });
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateLabelSelection(opts) {
+ const labels = this.isLabelEnabled() ? opts.labelData : [];
+ return opts.labelSelection.update(labels);
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ toKey: this.properties.toKey,
+ fromKey: this.properties.fromKey,
+ sizeKey: this.properties.sizeKey,
+ size: Number.NaN
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { size, text, centerX, centerY, radius, angle }) => {
+ params.size = size;
+ const style = getLabelStyles(this, void 0, params, this.properties.label, false, activeHighlight);
+ const { fontStyle, fontWeight, fontSize, fontFamily, color: fill } = style;
+ label.visible = true;
+ label.translationX = centerX + radius * Math.cos(angle);
+ label.translationY = centerY + radius * Math.sin(angle);
+ label.text = text;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textBaseline = "middle";
+ if (Math.cos(angle) >= 0) {
+ label.textAlign = "left";
+ label.rotation = angle;
+ } else {
+ label.textAlign = "right";
+ label.rotation = angle - Math.PI;
+ }
+ label.setBoxing(style);
+ });
+ }
+ updateNodeSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId6(datum.type, datum.id));
+ }
+ getNodeStyle(nodeDatum, fromNodeDatumIndex, isHighlight) {
+ const { properties } = this;
+ const { fills, strokes, fillGradientDefaults: fillGradientDefaults3, fillPatternDefaults: fillPatternDefaults3, fillImageDefaults: fillImageDefaults3 } = properties;
+ const { itemStyler } = properties.node;
+ const highlightStyle = this.getHighlightStyle(isHighlight, nodeDatum.datumIndex);
+ const baseStyle = mergeDefaults8(highlightStyle, properties.node.getStyle(fills, strokes, fromNodeDatumIndex));
+ let style = getShapeStyle(baseStyle, fillGradientDefaults3, fillPatternDefaults3, fillImageDefaults3);
+ if (itemStyler != null && nodeDatum.datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId6(nodeDatum.datumIndex.index, "node", isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = getShapeStyle(
+ mergeDefaults8(overrides, style),
+ fillGradientDefaults3,
+ fillPatternDefaults3,
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ makeItemStylerParams({ datum, datumIndex, size = 0, label }, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ size,
+ label,
+ fill
+ };
+ }
+ updateNodeNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((sector, datum) => {
+ const { datumIndex } = datum;
+ const style = this.getNodeStyle(datum, datumIndex.index, isHighlight);
+ applyShapeStyle7(sector, style, fillBBox);
+ sector.centerX = datum.centerX;
+ sector.centerY = datum.centerY;
+ sector.innerRadius = datum.innerRadius;
+ sector.outerRadius = datum.outerRadius;
+ sector.startAngle = datum.startAngle;
+ sector.endAngle = datum.endAngle;
+ sector.inset = sector.strokeWidth / 2;
+ });
+ }
+ updateLinkSelection(opts) {
+ return opts.datumSelection.update(
+ opts.nodeData,
+ void 0,
+ (datum) => createDatumId6(datum.type, datum.index, datum.fromNode.id, datum.toNode.id)
+ );
+ }
+ getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, isHighlight) {
+ const { id: seriesId, properties } = this;
+ const { fills, strokes, fillGradientDefaults: fillGradientDefaults3, fillPatternDefaults: fillPatternDefaults3, fillImageDefaults: fillImageDefaults3 } = properties;
+ const { itemStyler } = properties.link;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults8(
+ highlightStyle,
+ properties.link.getStyle(fills, strokes, fromNodeDatumIndex.index)
+ );
+ let style = getShapeStyle(baseStyle, fillGradientDefaults3, fillPatternDefaults3, fillImageDefaults3);
+ if (itemStyler != null && datumIndex != null) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const overrides = this.cachedDatumCallback(
+ createDatumId6(datumIndex.index, "link", isHighlight ? "highlight" : "node"),
+ () => {
+ const highlightState = this.getHighlightStateString(
+ activeHighlight,
+ isHighlight,
+ fromNodeDatumIndex
+ );
+ return this.callWithContext(itemStyler, {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style
+ });
+ }
+ );
+ if (overrides) {
+ style = getShapeStyle(
+ mergeDefaults8(overrides, style),
+ fillGradientDefaults3,
+ fillPatternDefaults3,
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ updateLinkNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((link, datum) => {
+ const fromNodeDatumIndex = datum.fromNode.datumIndex;
+ const style = this.getLinkStyle(datum, fromNodeDatumIndex, isHighlight);
+ link.centerX = datum.centerX;
+ link.centerY = datum.centerY;
+ link.radius = datum.radius;
+ link.startAngle1 = datum.startAngle1;
+ link.endAngle1 = datum.endAngle1;
+ link.startAngle2 = datum.startAngle2;
+ link.endAngle2 = datum.endAngle2;
+ link.tension = style.tension;
+ applyShapeStyle7(link, style, fillBBox);
+ });
+ }
+ getShapeFillBBox() {
+ const width = this._nodeDataDependencies?.seriesRectWidth ?? 0;
+ const height = this._nodeDataDependencies?.seriesRectHeight ?? 0;
+ const size = Math.min(width, height);
+ const x = (width - size) / 2;
+ const y = (height - size) / 2;
+ const bbox = new BBox6(x, y, width, height);
+ return { series: bbox, axis: bbox };
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ linksProcessedData,
+ nodesProcessedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const { fromKey, toKey, sizeKey, sizeName, tooltip } = properties;
+ const seriesDatum = this.contextNodeData?.nodeData.find(
+ (d) => d.datumIndex.type === datumIndex.type && d.datumIndex.index === datumIndex.index
+ );
+ if (seriesDatum == null)
+ return;
+ const nodeIndex = seriesDatum.type === 0 /* Link */ ? seriesDatum.fromNode.index : seriesDatum.index;
+ const title = seriesDatum.type === 0 /* Link */ ? `${seriesDatum.fromNode.label} - ${seriesDatum.toNode.label}` : seriesDatum.label;
+ const datum = datumIndex.type === 0 /* Link */ ? linksProcessedData?.dataSources.get(this.id)?.data[datumIndex.index] : nodesProcessedData?.dataSources.get(this.id)?.data[datumIndex.index];
+ const size = seriesDatum.size;
+ let format;
+ if (seriesDatum.type === 0 /* Link */) {
+ const fromNodeDatumIndex = seriesDatum.fromNode.datumIndex;
+ format = this.getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, false);
+ } else {
+ const label = seriesDatum.label;
+ format = this.getNodeStyle({ datumIndex, datum, size, label }, datumIndex.index, false);
+ }
+ const data = [];
+ if (sizeKey != null) {
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: size,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain: [],
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(size) });
+ }
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title,
+ symbol: this.legendItemSymbol(seriesDatum.type, nodeIndex, format),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ fromKey,
+ toKey,
+ sizeKey,
+ sizeName,
+ size,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(node) {
+ return node;
+ }
+ hasItemStylers() {
+ return this.properties.node.itemStyler != null || this.properties.link.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+ChordSeries.className = "ChordSeries";
+ChordSeries.type = "chord";
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport69 } from "ag-charts-community";
+import {
+ constant as constant9,
+ fillGradientDefaults,
+ fillImageDefaults,
+ fillPatternDefaults,
+ required as required9,
+ string as string9,
+ undocumented as undocumented5
+} from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs8, chordSeriesThemeableOptionsDef } = _ModuleSupport69;
+var chordSeriesOptionsDef = {
+ ...chordSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs8,
+ type: required9(constant9("chord")),
+ fromKey: required9(string9),
+ toKey: required9(string9),
+ sizeKey: string9,
+ sizeName: string9
+};
+chordSeriesOptionsDef.fillGradientDefaults = undocumented5(fillGradientDefaults);
+chordSeriesOptionsDef.fillPatternDefaults = undocumented5(fillPatternDefaults);
+chordSeriesOptionsDef.fillImageDefaults = undocumented5(fillImageDefaults);
+
+// packages/ag-charts-enterprise/src/series/chord/chordModule.ts
+var ChordModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ solo: true,
+ identifier: "chord",
+ moduleFactory: (ctx) => new ChordSeries(ctx),
+ themeTemplate: {
+ series: {
+ fills: { $palette: "fills" },
+ strokes: { $palette: "strokes" },
+ // @ts-expect-error undocumented option
+ fillGradientDefaults: _ModuleSupport70.FILL_GRADIENT_LINEAR_DEFAULTS,
+ fillPatternDefaults: _ModuleSupport70.FILL_PATTERN_DEFAULTS,
+ fillImageDefaults: _ModuleSupport70.FILL_IMAGE_DEFAULTS,
+ highlightStyle: {
+ series: {
+ dimOpacity: 0.2
+ }
+ },
+ highlight: _ModuleSupport70.singleSeriesHighlightStyle(),
+ label: {
+ ..._ModuleSupport70.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ spacing: 5,
+ maxWidth: 100
+ },
+ node: {
+ spacing: 8,
+ width: 10,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ link: {
+ fillOpacity: 0.5,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ tension: 0.4
+ }
+ },
+ legend: {
+ enabled: false,
+ toggleSeries: false
+ }
+ }
+};
+var ChordSeriesModule = {
+ type: "series",
+ name: "chord",
+ chartType: "standalone",
+ enterprise: true,
+ options: chordSeriesOptionsDef,
+ create: (ctx) => new ChordSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelThemes.ts
+import { _ModuleSupport as _ModuleSupport71 } from "ag-charts-community";
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE7, CARTESIAN_POSITION: CARTESIAN_POSITION5 },
+ ThemeSymbols: { DEFAULT_SHADOW_COLOUR }
+} = _ModuleSupport71;
+var isHorizontal = { $eq: [{ $path: ["/series/0/direction", void 0] }, "horizontal"] };
+var labelOptions = {
+ autoRotate: { $path: "/series/0/stageLabel/autoRotate" },
+ autoRotateAngle: { $path: "/series/0/stageLabel/autoRotateAngle" },
+ avoidCollisions: { $path: ["/series/0/stageLabel/avoidCollisions", true] },
+ border: { $path: ["/series/0/stageLabel/border"] },
+ color: { $path: ["/series/0/stageLabel/color", { $ref: "textColor" }] },
+ cornerRadius: { $path: ["/series/0/stageLabel/cornerRadius"] },
+ enabled: {
+ $if: [
+ { $eq: [{ $path: "/series/0/stageLabel/enabled" }, void 0] },
+ true,
+ { $path: "/series/0/stageLabel/enabled" }
+ ]
+ },
+ fill: { $path: ["/series/0/stageLabel/fill"] },
+ fillOpacity: { $path: ["/series/0/stageLabel/fillOpacity"] },
+ fontSize: { $path: ["/series/0/stageLabel/fontSize", { $ref: "fontSize" }] },
+ fontStyle: { $path: ["/series/0/stageLabel/fontStyle", { $ref: "fontStyle" }] },
+ fontWeight: { $path: ["/series/0/stageLabel/fontWeight", { $ref: "fontWeight" }] },
+ format: { $path: "/series/0/stageLabel/format" },
+ formatter: { $path: "/series/0/stageLabel/formatter" },
+ itemStyler: { $path: "/series/0/stageLabel/itemStyler" },
+ minSpacing: { $path: "/series/0/stageLabel/minSpacing" },
+ padding: { $path: ["/series/0/stageLabel/padding"] },
+ rotation: { $path: ["/series/0/stageLabel/rotation", 0] }
+};
+var FUNNEL_SERIES_AXES = [
+ {
+ type: {
+ $if: [isHorizontal, CARTESIAN_AXIS_TYPE7.NUMBER, CARTESIAN_AXIS_TYPE7.CATEGORY]
+ },
+ position: {
+ $if: [
+ isHorizontal,
+ CARTESIAN_POSITION5.LEFT,
+ {
+ $if: [
+ { $eq: [{ $path: ["/series/0/stageLabel/placement", void 0] }, "after"] },
+ CARTESIAN_POSITION5.RIGHT,
+ CARTESIAN_POSITION5.LEFT
+ ]
+ }
+ ]
+ },
+ label: {
+ $if: [isHorizontal, void 0, labelOptions]
+ }
+ },
+ {
+ type: {
+ $if: [isHorizontal, CARTESIAN_AXIS_TYPE7.CATEGORY, CARTESIAN_AXIS_TYPE7.NUMBER]
+ },
+ position: {
+ $if: [
+ isHorizontal,
+ {
+ $if: [
+ { $eq: [{ $path: ["/series/0/stageLabel/placement", void 0] }, "before"] },
+ CARTESIAN_POSITION5.TOP,
+ CARTESIAN_POSITION5.BOTTOM
+ ]
+ },
+ CARTESIAN_POSITION5.BOTTOM
+ ]
+ },
+ label: {
+ $if: [isHorizontal, labelOptions, void 0]
+ }
+ }
+];
+var FUNNEL_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ spacingRatio: 0.25,
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ [{ $path: ["/0", void 0, { $palette: "fills" }] }],
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", _ModuleSupport71.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],
+ ["pattern", _ModuleSupport71.FILL_PATTERN_SINGLE_DEFAULTS],
+ ["image", _ModuleSupport71.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ [{ $path: ["/0", void 0, { $palette: "strokes" }] }]
+ ]
+ },
+ label: {
+ ..._ModuleSupport71.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" }
+ },
+ dropOff: {
+ enabled: true,
+ fillOpacity: 0.2,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ shadow: {
+ enabled: false,
+ color: DEFAULT_SHADOW_COLOUR,
+ xOffset: 3,
+ yOffset: 3,
+ blur: 5
+ },
+ highlight: _ModuleSupport71.singleSeriesHighlightStyle()
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE7.NUMBER]: {
+ nice: false,
+ gridLine: {
+ enabled: false
+ },
+ crosshair: {
+ enabled: false
+ },
+ label: {
+ enabled: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE7.CATEGORY]: {
+ line: {
+ enabled: false
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport76
+} from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/funnel/baseFunnelSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport74
+} from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelConnector.ts
+import { _ModuleSupport as _ModuleSupport72 } from "ag-charts-community";
+var { lineDistanceSquared, BBox: BBox7, Path: Path8, SceneChangeDetection: SceneChangeDetection5 } = _ModuleSupport72;
+var delta = 1e-6;
+function pointsEq([ax, ay], [bx, by]) {
+ return Math.abs(ax - bx) <= delta && Math.abs(ay - by) <= delta;
+}
+var FunnelConnector = class extends Path8 {
+ constructor() {
+ super(...arguments);
+ this.x0 = 0;
+ this.y0 = 0;
+ this.x1 = 0;
+ this.y1 = 0;
+ this.x2 = 0;
+ this.y2 = 0;
+ this.x3 = 0;
+ this.y3 = 0;
+ }
+ get midPoint() {
+ const { x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ return {
+ x: (x0 + x1 + x2 + x3) / 4,
+ y: (y0 + y1 + y2 + y3) / 4
+ };
+ }
+ distanceSquared(x, y) {
+ if (this.containsPoint(x, y))
+ return 0;
+ const { x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ return Math.min(
+ lineDistanceSquared(x, y, x0, y0, x1, y1, Infinity),
+ lineDistanceSquared(x, y, x1, y1, x2, y2, Infinity),
+ lineDistanceSquared(x, y, x2, y2, x3, y3, Infinity),
+ lineDistanceSquared(x, y, x3, y3, x0, y0, Infinity)
+ );
+ }
+ computeBBox() {
+ const { x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ const x = Math.min(x0, x1, x2, x3);
+ const width = Math.max(x0, x1, x2, x3) - x;
+ const y = Math.min(y0, y1, y2, y3);
+ const height = Math.max(y0, y1, y2, y3) - y;
+ return new BBox7(x, y, width, height);
+ }
+ updatePath() {
+ const { path, x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ const points = [
+ [x0, y0],
+ [x1, y1],
+ [x2, y2],
+ [x3, y3]
+ ];
+ path.clear();
+ let start;
+ let current;
+ for (const p of points) {
+ if (start != null && pointsEq(start, p) || current != null && pointsEq(current, p)) {
+ continue;
+ }
+ const [x, y] = p;
+ if (start == null) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ start ?? (start = p);
+ current = p;
+ }
+ path.closePath();
+ }
+};
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "x0", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "y0", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "x1", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "y1", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "x2", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "y2", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "x3", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], FunnelConnector.prototype, "y3", 2);
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelUtil.ts
+import { _ModuleSupport as _ModuleSupport73 } from "ag-charts-community";
+var { NODE_UPDATE_STATE_TO_PHASE_MAPPING } = _ModuleSupport73;
+function connectorStartingPosition(datum, _prevDatum, isVertical, _mode) {
+ const { x0, y0, x1, y1, x2, y2, x3, y3, opacity } = datum;
+ if (isVertical) {
+ return {
+ x0: (x0 + x3) / 2,
+ y0: (y0 + y3) / 2,
+ x1: (x1 + x2) / 2,
+ y1: (y1 + y2) / 2,
+ x2: (x1 + x2) / 2,
+ y2: (y1 + y2) / 2,
+ x3: (x0 + x3) / 2,
+ y3: (y0 + y3) / 2,
+ opacity
+ };
+ } else {
+ return {
+ x0: (x0 + x1) / 2,
+ y0: (y0 + y1) / 2,
+ x1: (x0 + x1) / 2,
+ y1: (y0 + y1) / 2,
+ x2: (x2 + x3) / 2,
+ y2: (y2 + y3) / 2,
+ x3: (x2 + x3) / 2,
+ y3: (y2 + y3) / 2,
+ opacity
+ };
+ }
+}
+function prepareConnectorAnimationFunctions(isVertical, mode) {
+ const isRemoved = (datum) => datum == null;
+ const fromFn = (connector, datum, status) => {
+ if (status === "updated" && isRemoved(datum)) {
+ status = "removed";
+ } else if (status === "updated" && isRemoved(connector.previousDatum)) {
+ status = "added";
+ }
+ let source;
+ if (status === "added" && connector.previousDatum == null && mode === "fade") {
+ source = { ...resetConnectorSelectionsFn(connector, datum), opacity: 0 };
+ } else if (status === "unknown" || status === "added") {
+ source = connectorStartingPosition(datum, connector.previousDatum, isVertical, mode);
+ } else {
+ source = {
+ x0: connector.x0,
+ y0: connector.y0,
+ x1: connector.x1,
+ y1: connector.y1,
+ x2: connector.x2,
+ y2: connector.y2,
+ x3: connector.x3,
+ y3: connector.y3,
+ opacity: connector.opacity
+ };
+ }
+ const phase = NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return { ...source, phase };
+ };
+ const toFn = (connector, datum, status) => {
+ let source;
+ if (status === "removed" && connector.datum == null && mode === "fade") {
+ source = { ...resetConnectorSelectionsFn(connector, datum), opacity: 0 };
+ } else if (status === "removed" || isRemoved(datum)) {
+ source = connectorStartingPosition(datum, connector.previousDatum, isVertical, mode);
+ } else {
+ source = resetConnectorSelectionsFn(connector, datum);
+ }
+ return source;
+ };
+ return { fromFn, toFn };
+}
+function resetConnectorSelectionsFn(_node, datum) {
+ const { x0, y0, x1, y1, x2, y2, x3, y3, opacity } = datum;
+ return { x0, y0, x1, y1, x2, y2, x3, y3, opacity };
+}
+
+// packages/ag-charts-enterprise/src/series/funnel/baseFunnelSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode7,
+ SeriesZIndexMap,
+ valueProperty: valueProperty8,
+ keyProperty: keyProperty7,
+ ChartAxisDirection: ChartAxisDirection13,
+ updateLabelNode: updateLabelNode5,
+ SMALLEST_KEY_INTERVAL: SMALLEST_KEY_INTERVAL4,
+ LARGEST_KEY_INTERVAL: LARGEST_KEY_INTERVAL2,
+ diff: diff5,
+ fixNumericExtent: fixNumericExtent6,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation4,
+ resetMotion: resetMotion2,
+ resetLabelFn: resetLabelFn4,
+ animationValidation: animationValidation6,
+ computeBarFocusBounds: computeBarFocusBounds6,
+ ContinuousScale: ContinuousScale4,
+ Group: Group6,
+ Selection: Selection4,
+ PointerEvents: PointerEvents4,
+ motion: motion4,
+ checkCrisp: checkCrisp3,
+ createDatumId: createDatumId7,
+ applyShapeStyle: applyShapeStyle8
+} = _ModuleSupport74;
+var FunnelSeriesNodeEvent = class extends _ModuleSupport74.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.stageKey;
+ this.yKey = series.properties.valueKey;
+ }
+};
+var BaseFunnelSeries = class extends _ModuleSupport74.AbstractBarSeries {
+ constructor({
+ moduleCtx,
+ animationResetFns
+ }) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode7.AXIS_ALIGNED, SeriesNodePickMode7.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["stageKey"],
+ y: ["valueKey"]
+ },
+ propertyNames: {
+ x: [],
+ y: []
+ },
+ categoryKey: "xValue",
+ datumSelectionGarbageCollection: false,
+ animationResetFns: {
+ datum: animationResetFns.datum,
+ label: resetLabelFn4
+ }
+ });
+ // @ts-expect-error xKey/yKey renamed
+ this.NodeEvent = FunnelSeriesNodeEvent;
+ this.connectorNodeGroup = this.contentGroup.appendChild(
+ new Group6({
+ name: `${this.id}-series-connectorNodes`,
+ zIndex: SeriesZIndexMap.BACKGROUND
+ })
+ );
+ this.connectorSelection = Selection4.select(
+ this.connectorNodeGroup,
+ () => this.connectionFactory()
+ );
+ this.connectorNodeGroup.pointerEvents = PointerEvents4.None;
+ }
+ get pickModeAxis() {
+ return "main-category";
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.connectorNodeGroup.zIndex = [SeriesZIndexMap.BACKGROUND, zIndex];
+ return true;
+ }
+ isVertical() {
+ return !super.isVertical();
+ }
+ connectionFactory() {
+ return new FunnelConnector();
+ }
+ async processData(dataController) {
+ const { stageKey, valueKey } = this.properties;
+ const { visible, id: seriesId } = this;
+ const validation = (_value, _datum, index) => visible && this.ctx.legendManager.getItemEnabled({ seriesId, itemId: index });
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ if (this.processedData) {
+ extraProps.push(diff5(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation6());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const { processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty7(stageKey, xScaleType, { id: "xValue" }),
+ valueProperty8(valueKey, yScaleType, { id: `yValue`, ...visibleProps, validation, invalidValue: 0 }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL4, LARGEST_KEY_INTERVAL2] : [],
+ ...extraProps
+ ],
+ groupByKeys: false
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.largestDataInterval = processedData.reduced?.largestKeyInterval;
+ this.animationState.transition("updateData");
+ }
+ getSeriesDomain(direction) {
+ const {
+ processedData,
+ dataModel,
+ id: seriesId,
+ ctx: { legendManager }
+ } = this;
+ if (!processedData || !dataModel)
+ return [];
+ const {
+ keys: [keys]
+ } = processedData.domain;
+ if (direction === this.getCategoryDirection()) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef?.def.valueType === "category") {
+ if (!this.hasData)
+ return [];
+ return keys.filter((_key, index) => legendManager.getItemEnabled({ seriesId, itemId: index }));
+ }
+ return this.padBandExtent(keys);
+ } else {
+ const yExtent = this.domainForClippedRange(direction, ["yValue"], "xValue");
+ const maxExtent = Math.max(...yExtent);
+ const fixedYExtent = [-maxExtent, maxExtent];
+ return fixNumericExtent6(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ createNodeData() {
+ const {
+ hasData,
+ data,
+ dataModel,
+ groupScale,
+ processedData,
+ id: seriesId,
+ ctx: { legendManager }
+ } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(hasData && data && xAxis && yAxis && dataModel && processedData?.type === "ungrouped")) {
+ return;
+ }
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const barAlongX = this.getBarDirection() === ChartAxisDirection13.X;
+ const { stageKey, valueKey } = this.properties;
+ const itemId = `${valueKey}`;
+ const context = {
+ itemId,
+ nodeData: [],
+ labelData: [],
+ connectorData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible
+ };
+ const isVisible = this.visible;
+ if (!isVisible)
+ return context;
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const yValues = dataModel.resolveColumnById(this, `yValue`, processedData);
+ const { barWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const barOffset = ContinuousScale4.is(xScale) ? barWidth * -0.5 : 0;
+ const crisp = checkCrisp3(
+ xAxis?.scale,
+ xAxis?.visibleRange,
+ this.smallestDataInterval,
+ this.largestDataInterval
+ );
+ let previousConnection;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const visible = isVisible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex });
+ const xDatum = xValues[datumIndex];
+ if (xDatum == null)
+ continue;
+ const x = Math.round(xScale.convert(xDatum)) + groupScale.convert(String(groupIndex)) + barOffset;
+ const yDatum = yValues[datumIndex];
+ const yNegative = Math.round(yScale.convert(-yDatum));
+ const yPositive = Math.round(yScale.convert(yDatum));
+ const style = this.getItemStyle({ datum, datumIndex }, false);
+ const barHeight = Math.max(style.strokeWidth ?? 0, Math.abs(yPositive - yNegative));
+ const rect = {
+ x: barAlongX ? Math.min(yPositive, yNegative) : x,
+ y: barAlongX ? x : Math.min(yPositive, yNegative),
+ width: barAlongX ? barHeight : barWidth,
+ height: barAlongX ? barWidth : barHeight
+ };
+ const nodeMidPoint = {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2
+ };
+ const labelData = this.createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yDatum,
+ datum,
+ visible
+ });
+ const nodeDatum = {
+ index: datumIndex,
+ series: this,
+ itemId,
+ datum,
+ datumIndex,
+ xValue: xDatum,
+ yValue: yDatum,
+ xKey: stageKey,
+ yKey: valueKey,
+ x: rect.x,
+ y: rect.y,
+ width: rect.width,
+ height: rect.height,
+ midPoint: nodeMidPoint,
+ crisp,
+ label: labelData,
+ visible
+ };
+ context.nodeData.push(nodeDatum);
+ if (labelData != null) {
+ context.labelData.push(labelData);
+ }
+ if (previousConnection != null) {
+ const prevRect = previousConnection.rect;
+ const startNodeDatum = previousConnection.nodeDatum;
+ const startDatumIndex = previousConnection.datumIndex;
+ if (barAlongX) {
+ context.connectorData.push({
+ datum: startNodeDatum,
+ datumIndex: startDatumIndex,
+ x0: prevRect.x,
+ y0: prevRect.y + prevRect.height,
+ x1: prevRect.x + prevRect.width,
+ y1: prevRect.y + prevRect.height,
+ x2: rect.x + rect.width,
+ y2: rect.y,
+ x3: rect.x,
+ y3: rect.y,
+ opacity: 1
+ });
+ } else {
+ context.connectorData.push({
+ datum: startNodeDatum,
+ datumIndex: startDatumIndex,
+ x0: prevRect.x + prevRect.width,
+ y0: prevRect.y,
+ x1: rect.x,
+ y1: rect.y,
+ x2: rect.x,
+ y2: rect.y + rect.height,
+ x3: prevRect.x + prevRect.width,
+ y3: prevRect.y + prevRect.height,
+ opacity: 1
+ });
+ }
+ }
+ if (visible) {
+ previousConnection = {
+ itemId,
+ rect,
+ nodeDatum,
+ datumIndex
+ };
+ }
+ }
+ return context;
+ }
+ updateNodes(seriesHighlighted, nodeRefresh) {
+ super.updateNodes(seriesHighlighted, nodeRefresh);
+ const { connectorSelection } = this;
+ const connectorData = this.contextNodeData?.connectorData ?? [];
+ this.connectorSelection = this.updateConnectorSelection({ connectorSelection, connectorData });
+ this.updateConnectorNodes({ connectorSelection });
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data, void 0, (datum) => this.getDatumId(datum));
+ }
+ updateConnectorSelection(opts) {
+ const { connectorData, connectorSelection } = opts;
+ return connectorSelection.update(
+ this.connectorEnabled() ? connectorData : [],
+ void 0,
+ (connector) => this.getDatumId(connector.datum)
+ );
+ }
+ updateConnectorNodes(opts) {
+ const fillBBox = this.getShapeFillBBox();
+ opts.connectorSelection.each((connector, datum) => {
+ const { fill, fillOpacity, stroke, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.connectorStyle(datum.datumIndex);
+ connector.setProperties(resetConnectorSelectionsFn(connector, datum));
+ applyShapeStyle8(
+ connector,
+ {
+ fill,
+ stroke,
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ },
+ fillBBox
+ );
+ });
+ }
+ updateLabelSelection(opts) {
+ const labelData = this.properties.label.enabled ? opts.labelData : [];
+ return opts.labelSelection.update(labelData, (text) => {
+ text.pointerEvents = PointerEvents4.None;
+ });
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ stageKey: this.properties.stageKey,
+ valueKey: this.properties.valueKey
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ textNode.fillOpacity = this.getHighlightStyle(false, datum.datumIndex).opacity ?? 1;
+ updateLabelNode5(this, textNode, params, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { stageKey, valueKey, tooltip, legendItemName } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, "xValue", processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ symbol: this.legendItemSymbol(datumIndex),
+ data: [
+ {
+ label: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, stageKey, legendItemName),
+ value: this.getAxisValueText(yAxis, "tooltip", yValue, datum, valueKey, legendItemName)
+ }
+ ]
+ },
+ { seriesId, datum, title: stageKey, stageKey, valueKey, ...this.tooltipStyle(datum, datumIndex) }
+ );
+ }
+ resetAllAnimation(data) {
+ super.resetAllAnimation(data);
+ resetMotion2([this.connectorSelection], resetConnectorSelectionsFn);
+ }
+ animateEmptyUpdateReady({ labelSelection }) {
+ const { connectorSelection } = this;
+ const isVertical = this.isVertical();
+ const mode = "normal";
+ const connectorFns = prepareConnectorAnimationFunctions(isVertical, mode);
+ motion4.fromToMotion(this.id, "connectors", this.ctx.animationManager, [connectorSelection], connectorFns);
+ seriesLabelFadeInAnimation4(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateWaitingUpdateReady(data) {
+ const { labelSelection: labelSelections } = data;
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ seriesLabelFadeInAnimation4(this, "labels", this.ctx.animationManager, labelSelections);
+ }
+ getDatumId(datum) {
+ return createDatumId7(datum.xValue);
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled;
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds6(this, this.contextNodeData?.nodeData[datumIndex]);
+ }
+ legendItemSymbol(datumIndex) {
+ const { strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset, fill, stroke } = this.properties.getStyle(datumIndex);
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ id: seriesId,
+ processedData,
+ dataModel,
+ ctx: { legendManager },
+ visible
+ } = this;
+ if (!dataModel || !processedData || legendType !== "category") {
+ return [];
+ }
+ const { showInLegend } = this.properties;
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ return (processedData.dataSources.get(this.id)?.data ?? []).map((datum, datumIndex) => {
+ const stageValue = xValues[datumIndex];
+ if (stageValue == null)
+ return;
+ return {
+ legendType: "category",
+ id: seriesId,
+ datum,
+ itemId: datumIndex,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex }),
+ label: { text: String(stageValue) },
+ symbol: this.legendItemSymbol(datumIndex),
+ skipAnimations: true,
+ hideInLegend: !showInLegend
+ };
+ }).filter((datum) => datum != null);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelProperties.ts
+import { _ModuleSupport as _ModuleSupport75 } from "ag-charts-community";
+var { Label: Label5, AbstractBarSeriesProperties: AbstractBarSeriesProperties5, makeSeriesTooltip: makeSeriesTooltip9, AxisLabel, Property: Property21 } = _ModuleSupport75;
+var ConeFunnelSeriesLabel = class extends Label5 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property21
+], ConeFunnelSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property21
+], ConeFunnelSeriesLabel.prototype, "spacing", 2);
+var ConeFunnelSeriesStageLabel = class extends AxisLabel {
+};
+__decorateClass([
+ Property21
+], ConeFunnelSeriesStageLabel.prototype, "placement", 2);
+var ConeFunnelProperties = class extends AbstractBarSeriesProperties5 {
+ constructor() {
+ super(...arguments);
+ this.fills = [];
+ this.fillOpacity = 1;
+ this.strokes = [];
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.label = new ConeFunnelSeriesLabel();
+ this.stageLabel = new ConeFunnelSeriesStageLabel();
+ this.tooltip = makeSeriesTooltip9();
+ }
+ getStyle(index) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill: fills[index],
+ fillOpacity,
+ stroke: strokes[index],
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "stageKey", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "valueKey", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "fills", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "label", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "stageLabel", 2);
+__decorateClass([
+ Property21
+], ConeFunnelProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelUtil.ts
+function resetLineSelectionsFn(_node, { x, y, width, height, opacity }) {
+ return { x1: x, y1: y, x2: x + width, y2: y + height, opacity: opacity ?? 1 };
+}
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelSeries.ts
+var { Line: Line3, ChartAxisDirection: ChartAxisDirection14 } = _ModuleSupport76;
+var ConeFunnelSeries = class extends BaseFunnelSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ animationResetFns: {
+ datum: resetLineSelectionsFn
+ }
+ });
+ this.properties = new ConeFunnelProperties();
+ }
+ get hasData() {
+ const {
+ id: seriesId,
+ ctx: { legendManager }
+ } = this;
+ const visibleItems = this.data?.data.reduce(
+ (accum, _, datumIndex) => accum + (legendManager.getItemEnabled({ seriesId, itemId: datumIndex }) ? 1 : 0),
+ 0
+ );
+ return visibleItems != null && visibleItems > 1;
+ }
+ getBandScalePadding() {
+ return { inner: 1, outer: 0 };
+ }
+ connectorEnabled() {
+ return true;
+ }
+ getItemStyle({ datumIndex }, _isHighlight) {
+ return this.properties.getStyle(datumIndex);
+ }
+ connectorStyle(index) {
+ return this.properties.getStyle(index);
+ }
+ nodeFactory() {
+ return new Line3();
+ }
+ createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yDatum,
+ datum,
+ visible
+ }) {
+ const { stageKey, valueKey, label } = this.properties;
+ const { spacing, placement } = label;
+ if (!label.enabled)
+ return;
+ let x;
+ let y;
+ let textAlign;
+ let textBaseline;
+ if (barAlongX) {
+ x = rect.x + rect.width / 2;
+ textAlign = "center";
+ switch (placement) {
+ case "before":
+ y = rect.y - spacing;
+ textBaseline = "bottom";
+ break;
+ case "after":
+ y = rect.y + rect.height + spacing;
+ textBaseline = "top";
+ break;
+ default:
+ y = rect.y + rect.height / 2;
+ textBaseline = "middle";
+ }
+ } else {
+ y = rect.y + rect.height / 2;
+ textBaseline = "middle";
+ switch (placement) {
+ case "before":
+ x = rect.x - spacing;
+ textAlign = "right";
+ break;
+ case "after":
+ x = rect.x + rect.width + spacing;
+ textAlign = "left";
+ break;
+ default:
+ x = rect.x + rect.width / 2;
+ textAlign = "center";
+ }
+ }
+ const yDomain = this.getSeriesDomain(ChartAxisDirection14.Y);
+ const text = this.getLabelText(
+ yDatum,
+ datum,
+ valueKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: valueKey, value: yDatum, datum, stageKey, valueKey }
+ );
+ return {
+ x,
+ y,
+ textAlign,
+ textBaseline,
+ text,
+ itemId: valueKey,
+ datum,
+ datumIndex,
+ series: this,
+ visible
+ };
+ }
+ updateDatumNodes(opts) {
+ const highlightStyle = this.getHighlightStyle(opts.isHighlight);
+ opts.datumSelection.each((line, datum) => {
+ line.setProperties(resetLineSelectionsFn(line, datum));
+ line.stroke = highlightStyle?.stroke;
+ line.strokeWidth = highlightStyle?.strokeWidth ?? 0;
+ line.strokeOpacity = highlightStyle?.strokeOpacity ?? 1;
+ line.lineDash = highlightStyle?.lineDash;
+ line.lineDashOffset = highlightStyle?.lineDashOffset ?? 0;
+ line.opacity = highlightStyle?.opacity ?? 1;
+ });
+ }
+ tooltipStyle(_datum, datumIndex) {
+ const { fill, stroke, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.properties.getStyle(datumIndex);
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ }
+ hasItemStylers() {
+ return this.properties.label.itemStyler != null;
+ }
+};
+ConeFunnelSeries.className = "ConeFunnelSeries";
+ConeFunnelSeries.type = "cone-funnel";
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport77 } from "ag-charts-community";
+import { constant as constant10, required as required10, string as string10 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs9, coneFunnelSeriesThemeableOptionsDef, without: without3 } = _ModuleSupport77;
+var coneFunnelSeriesOptionsDef = {
+ ...without3(commonSeriesOptionsDefs9, ["showInLegend"]),
+ ...coneFunnelSeriesThemeableOptionsDef,
+ type: required10(constant10("cone-funnel")),
+ stageKey: required10(string10),
+ valueKey: required10(string10)
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelThemes.ts
+import { _ModuleSupport as _ModuleSupport78 } from "ag-charts-community";
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE8 }
+} = _ModuleSupport78;
+var CONE_FUNNEL_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $palette: "secondSequentialColors" },
+ _ModuleSupport78.SAFE_RANGE2_OPERATION
+ ]
+ },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", _ModuleSupport78.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],
+ ["pattern", _ModuleSupport78.FILL_PATTERN_SINGLE_DEFAULTS],
+ ["image", _ModuleSupport78.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $palette: "secondSequentialColors" },
+ _ModuleSupport78.SAFE_RANGE2_OPERATION
+ ]
+ }
+ ]
+ },
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ label: {
+ ..._ModuleSupport78.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ placement: "before",
+ spacing: 4
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: _ModuleSupport78.singleSeriesHighlightStyle(false)
+ },
+ seriesArea: {
+ padding: {
+ top: 20,
+ bottom: 20
+ }
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE8.NUMBER]: {
+ nice: false,
+ gridLine: {
+ enabled: false
+ },
+ crosshair: {
+ enabled: false
+ },
+ label: {
+ enabled: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE8.CATEGORY]: {
+ line: {
+ enabled: false
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelModule.ts
+var ConeFunnelSeriesModule = {
+ type: "series",
+ name: "cone-funnel",
+ chartType: "cartesian",
+ enterprise: true,
+ options: coneFunnelSeriesOptionsDef,
+ create: (ctx) => new ConeFunnelSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport80
+} from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelProperties.ts
+import { _ModuleSupport as _ModuleSupport79 } from "ag-charts-community";
+var { Label: Label6, DropShadow: DropShadow4, AbstractBarSeriesProperties: AbstractBarSeriesProperties6, BaseProperties: BaseProperties8, makeSeriesTooltip: makeSeriesTooltip10, AxisLabel: AxisLabel2, Property: Property22 } = _ModuleSupport79;
+var FunnelSeriesLabel = class extends Label6 {
+};
+var FunnelSeriesStageLabel = class extends AxisLabel2 {
+};
+__decorateClass([
+ Property22
+], FunnelSeriesStageLabel.prototype, "placement", 2);
+var FunnelDropOff = class extends BaseProperties8 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle() {
+ const { fill, stroke, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "enabled", 2);
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "fill", 2);
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "stroke", 2);
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "lineDash", 2);
+__decorateClass([
+ Property22
+], FunnelDropOff.prototype, "lineDashOffset", 2);
+var FunnelProperties = class extends AbstractBarSeriesProperties6 {
+ constructor() {
+ super(...arguments);
+ this.fills = [];
+ this.fillOpacity = 1;
+ this.strokes = [];
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.spacingRatio = 0;
+ this.dropOff = new FunnelDropOff();
+ this.shadow = new DropShadow4().set({ enabled: false });
+ this.label = new FunnelSeriesLabel();
+ this.stageLabel = new FunnelSeriesStageLabel();
+ this.tooltip = makeSeriesTooltip10();
+ }
+ getStyle(index) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill: fills[index],
+ fillOpacity,
+ stroke: strokes[index],
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "stageKey", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "valueKey", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "fills", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "spacingRatio", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "dropOff", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "label", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "stageLabel", 2);
+__decorateClass([
+ Property22
+], FunnelProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelSeries.ts
+var {
+ ChartAxisDirection: ChartAxisDirection15,
+ resetBarSelectionsFn: resetBarSelectionsFn3,
+ prepareBarAnimationFunctions: prepareBarAnimationFunctions3,
+ midpointStartingBarPosition: midpointStartingBarPosition2,
+ createDatumId: createDatumId8,
+ Rect: Rect4,
+ motion: motion5,
+ applyShapeStyle: applyShapeStyle9,
+ mergeDefaults: mergeDefaults9
+} = _ModuleSupport80;
+var FunnelSeries = class extends BaseFunnelSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ animationResetFns: {
+ datum: resetBarSelectionsFn3
+ }
+ });
+ this.properties = new FunnelProperties();
+ }
+ getBandScalePadding() {
+ return { inner: this.properties.spacingRatio, outer: 0 };
+ }
+ connectorEnabled() {
+ return this.properties.dropOff.enabled;
+ }
+ connectorStyle(index) {
+ return mergeDefaults9(this.properties.dropOff.getStyle(), this.properties.getStyle(index));
+ }
+ nodeFactory() {
+ return new Rect4();
+ }
+ createLabelData({
+ datumIndex,
+ rect,
+ yDatum,
+ datum,
+ visible
+ }) {
+ const { valueKey, stageKey, label } = this.properties;
+ if (!label.enabled)
+ return;
+ const yDomain = this.getSeriesDomain(ChartAxisDirection15.Y);
+ const text = this.getLabelText(
+ yDatum,
+ datum,
+ valueKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: valueKey, value: yDatum, datum, stageKey, valueKey }
+ );
+ return {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2,
+ textAlign: "center",
+ textBaseline: "middle",
+ text,
+ itemId: stageKey,
+ datum,
+ datumIndex,
+ series: this,
+ visible
+ };
+ }
+ getItemStyle({ datum, datumIndex }, isHighlight) {
+ const { id: seriesId, properties } = this;
+ const { stageKey, valueKey, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults9(highlightStyle, properties.getStyle(datumIndex));
+ let style = baseStyle;
+ if (itemStyler != null) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const overrides = this.cachedDatumCallback(
+ createDatumId8(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ return this.callWithContext(itemStyler, {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ stageKey,
+ valueKey,
+ ...style
+ });
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults9(overrides, style);
+ }
+ }
+ return style;
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const { shadow } = this.properties;
+ const categoryAlongX = this.getCategoryDirection() === ChartAxisDirection15.X;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const style = this.getItemStyle(datum, isHighlight);
+ applyShapeStyle9(rect, style, fillBBox);
+ rect.visible = categoryAlongX ? datum.width > 0 : datum.height > 0;
+ rect.crisp = datum.crisp;
+ rect.fillShadow = shadow;
+ });
+ }
+ tooltipStyle(datum, datumIndex) {
+ return this.getItemStyle({ datum, datumIndex }, false);
+ }
+ animateEmptyUpdateReady(params) {
+ super.animateEmptyUpdateReady(params);
+ const { datumSelection } = params;
+ const isVertical = this.isVertical();
+ const mode = "normal";
+ const barFns = prepareBarAnimationFunctions3(midpointStartingBarPosition2(isVertical, mode), "unknown");
+ motion5.fromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], barFns);
+ }
+ animateWaitingUpdateReady(data) {
+ super.animateWaitingUpdateReady(data);
+ const { datumSelection: datumSelections } = data;
+ const { processedData } = this;
+ const dataDiff = processedData?.reduced?.diff?.[this.id];
+ const fns = prepareBarAnimationFunctions3(midpointStartingBarPosition2(this.isVertical(), "fade"), "added");
+ motion5.fromToMotion(
+ this.id,
+ "datums",
+ this.ctx.animationManager,
+ [datumSelections],
+ fns,
+ (_, datum) => datum.xValue,
+ dataDiff
+ );
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+FunnelSeries.className = "FunnelSeries";
+FunnelSeries.type = "funnel";
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport81 } from "ag-charts-community";
+import { constant as constant11, required as required11, string as string11 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs10, funnelSeriesThemeableOptionsDef, without: without4 } = _ModuleSupport81;
+var funnelSeriesOptionsDef = {
+ ...funnelSeriesThemeableOptionsDef,
+ ...without4(commonSeriesOptionsDefs10, ["showInLegend"]),
+ type: required11(constant11("funnel")),
+ stageKey: required11(string11),
+ valueKey: required11(string11)
+};
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelModule.ts
+var FunnelSeriesModule = {
+ type: "series",
+ name: "funnel",
+ chartType: "cartesian",
+ enterprise: true,
+ options: funnelSeriesOptionsDef,
+ create: (ctx) => new FunnelSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeModule.ts
+import { _ModuleSupport as _ModuleSupport87 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport86
+} from "ag-charts-community";
+import { cachedTextMeasurer as cachedTextMeasurer4, isArray as isArray3, measureTextSegments as measureTextSegments2 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/utils/formatter.ts
+import { _ModuleSupport as _ModuleSupport82 } from "ag-charts-community";
+function formatWithContext(ctx, formatter, params) {
+ return _ModuleSupport82.callWithContext(ctx.chartService, formatter, params);
+}
+
+// packages/ag-charts-enterprise/src/series/gauge-util/datumUnion.ts
+var DatumUnion = class {
+ *[Symbol.iterator]() {
+ const { node, datum } = this;
+ if (node && datum)
+ yield { node, datum };
+ }
+ nodes() {
+ return this.node ? [this.node] : [];
+ }
+ update(datumSelection, group, ctor, nodeUpdater) {
+ const nodes = datumSelection.nodes();
+ if (nodes.length === 0) {
+ this.node?.remove();
+ this.node = void 0;
+ } else {
+ if (this.node === void 0) {
+ this.node = new ctor();
+ this.node.fillOpacity = 0;
+ this.node.strokeOpacity = 0;
+ group.appendChild(this.node);
+ }
+ const first = nodes[0];
+ const last = nodes.toReversed().find((n) => n.datum.datum.value > n.datum.datum.segmentStart) ?? nodes.at(-1);
+ this.node.datum = this.datum = first.datum;
+ nodeUpdater(this.node, first, last);
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/gauge-util/label.ts
+import { isArray } from "ag-charts-core";
+var fadeInFns = {
+ fromFn: () => ({ opacity: 0, phase: "initial" }),
+ toFn: () => ({ opacity: 1 })
+};
+function formatLabel(value, scale) {
+ if (value == null)
+ return "";
+ const { min, max } = scale;
+ const minLog10 = min === 0 ? 0 : Math.ceil(Math.log10(Math.abs(min)));
+ const maxLog10 = max === 0 ? 0 : Math.ceil(Math.log10(Math.abs(max)));
+ const dp = Math.max(2 - Math.max(minLog10, maxLog10), 0);
+ return value.toFixed(dp);
+}
+function getLabelText(seriesId, ctx, datum, valueOverride) {
+ if (datum.text != null)
+ return datum.text;
+ const value = valueOverride ?? datum.value;
+ let labelFormat;
+ if (datum?.formatter != null) {
+ labelFormat = formatWithContext(ctx, datum.formatter, { seriesId, datum: void 0, value });
+ }
+ return labelFormat == null || isArray(labelFormat) ? labelFormat : String(labelFormat);
+}
+
+// packages/ag-charts-enterprise/src/series/gauge-util/lineMarker.ts
+function lineMarker({ path, x, y, size }) {
+ path.moveTo(x, y - size / 2);
+ path.lineTo(x, y + size / 2);
+}
+
+// packages/ag-charts-enterprise/src/series/gauge-util/pick.ts
+import { clamp as clamp2, iterate } from "ag-charts-core";
+function pickGaugeNearestDatum(self, point) {
+ const it = iterate(self.datumUnion.nodes(), self.targetSelection.nodes());
+ return self.pickNodeNearestDistantObject(point, it);
+}
+function pickGaugeFocus(self, opts) {
+ const others = [
+ { data: self.contextNodeData?.nodeData, selection: self.datumUnion },
+ { data: self.contextNodeData?.targetData, selection: self.targetSelection }
+ ].filter((v) => v.data && v.data.length > 0);
+ const otherIndex = clamp2(0, opts.otherIndex + opts.otherIndexDelta, others.length - 1);
+ if (others.length === 0)
+ return;
+ const { data, selection } = others[otherIndex];
+ if (data == null || data.length === 0)
+ return;
+ const datumIndex = clamp2(0, opts.datumIndex, data.length - 1);
+ const datum = data[datumIndex];
+ for (const node of selection) {
+ if (node.datum === datum) {
+ const bounds = node.node;
+ return { bounds, clipFocusBox: true, datum, datumIndex, otherIndex };
+ }
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport84 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/gauge-util/segmentation.ts
+import { _ModuleSupport as _ModuleSupport83 } from "ag-charts-community";
+import { Logger as Logger6 } from "ag-charts-core";
+var { BaseProperties: BaseProperties9, Property: Property23 } = _ModuleSupport83;
+var GaugeSegmentationIntervalProperties = class extends BaseProperties9 {
+ getSegments(scale, maxTicks) {
+ const { values, step, count } = this;
+ const d0 = Math.min(...scale.domain);
+ const d1 = Math.max(...scale.domain);
+ let ticks;
+ if (values != null) {
+ const segments = values.filter((v) => v > d0 && v < d1).sort((a, b) => a - b);
+ ticks = [d0, ...segments, d1];
+ } else if (step != null) {
+ const segments = [];
+ for (let i = d0; i < d1; i += step) {
+ segments.push(i);
+ }
+ segments.push(d1);
+ ticks = segments;
+ } else if (count == null) {
+ const segments = scale.ticks({
+ nice: true,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ })?.ticks?.filter((v) => v > d0 && v < d1);
+ ticks = segments == null ? void 0 : [d0, ...segments, d1];
+ } else {
+ const segments = count + 1;
+ ticks = Array.from({ length: segments + 1 }, (_, i) => i / segments * (d1 - d0) + d0);
+ }
+ if (ticks != null && ticks.length > maxTicks) {
+ Logger6.warnOnce(
+ `the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration`
+ );
+ ticks = void 0;
+ }
+ ticks ?? (ticks = [d0, d1]);
+ return ticks;
+ }
+};
+__decorateClass([
+ Property23
+], GaugeSegmentationIntervalProperties.prototype, "values", 2);
+__decorateClass([
+ Property23
+], GaugeSegmentationIntervalProperties.prototype, "step", 2);
+__decorateClass([
+ Property23
+], GaugeSegmentationIntervalProperties.prototype, "count", 2);
+var GaugeSegmentationProperties = class extends BaseProperties9 {
+ constructor() {
+ super(...arguments);
+ this.enabled = false;
+ this.interval = new GaugeSegmentationIntervalProperties();
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property23
+], GaugeSegmentationProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property23
+], GaugeSegmentationProperties.prototype, "interval", 2);
+__decorateClass([
+ Property23
+], GaugeSegmentationProperties.prototype, "spacing", 2);
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeriesProperties.ts
+var {
+ BaseProperties: BaseProperties10,
+ makeSeriesTooltip: makeSeriesTooltip11,
+ SeriesProperties: SeriesProperties2,
+ PropertiesArray: PropertiesArray2,
+ Property: Property24,
+ Label: Label7,
+ AxisLabel: AxisLabel3,
+ getColorStops
+} = _ModuleSupport84;
+var LinearGaugeDefaultTargetLabelProperties = class extends Label7 {
+};
+__decorateClass([
+ Property24
+], LinearGaugeDefaultTargetLabelProperties.prototype, "spacing", 2);
+var LinearGaugeTargetProperties = class extends BaseProperties10 {
+ constructor() {
+ super(...arguments);
+ this.value = 0;
+ this.label = new LinearGaugeDefaultTargetLabelProperties();
+ }
+ getStyle(defaultTarget) {
+ const {
+ fill = defaultTarget.fill ?? "black",
+ fillOpacity = defaultTarget.fillOpacity ?? 1,
+ stroke = defaultTarget.stroke ?? "black",
+ strokeWidth = defaultTarget.strokeWidth ?? 0,
+ strokeOpacity = defaultTarget.strokeOpacity ?? 1,
+ lineDash = defaultTarget.lineDash ?? [0],
+ lineDashOffset = defaultTarget.lineDashOffset ?? 0
+ } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "text", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "value", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "shape", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "placement", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "size", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "fill", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property24
+], LinearGaugeTargetProperties.prototype, "label", 2);
+var LinearGaugeBarProperties = class extends BaseProperties10 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.thicknessRatio = 1;
+ this.fills = new PropertiesArray2(_ModuleSupport84.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle(defaultColorRange, horizontal, scale) {
+ const { fill, fills, fillMode, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ const barFill = fill ?? createLinearGradient(fills, fillMode, defaultColorRange, scale, horizontal);
+ return {
+ fill: barFill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "thickness", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "thicknessRatio", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "fills", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "fill", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property24
+], LinearGaugeBarProperties.prototype, "lineDashOffset", 2);
+var LinearGaugeScaleIntervalProperties = class extends BaseProperties10 {
+ constructor() {
+ super(...arguments);
+ this.values = void 0;
+ this.step = void 0;
+ this.minSpacing = 0;
+ this.maxSpacing = 1e3;
+ }
+};
+__decorateClass([
+ Property24
+], LinearGaugeScaleIntervalProperties.prototype, "values", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleIntervalProperties.prototype, "step", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleIntervalProperties.prototype, "minSpacing", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleIntervalProperties.prototype, "maxSpacing", 2);
+var LinearGaugeScaleLabelProperties = class extends AxisLabel3 {
+ constructor() {
+ super(...arguments);
+ this.placement = void 0;
+ }
+};
+__decorateClass([
+ Property24
+], LinearGaugeScaleLabelProperties.prototype, "placement", 2);
+var LinearGaugeScaleProperties = class extends BaseProperties10 {
+ constructor() {
+ super(...arguments);
+ this.min = 0;
+ this.max = 1;
+ this.fills = new PropertiesArray2(_ModuleSupport84.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.defaultFill = "black";
+ this.interval = new LinearGaugeScaleIntervalProperties();
+ this.label = new LinearGaugeScaleLabelProperties();
+ }
+ getStyle(barEnabled, defaultColorRange, horizontal, scale) {
+ const {
+ fill,
+ fills,
+ defaultFill,
+ fillMode,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ } = this;
+ const scaleFill = fill ?? (barEnabled && fills.length === 0 ? defaultFill : void 0) ?? createLinearGradient(fills, fillMode, defaultColorRange, scale, horizontal);
+ return {
+ fill: scaleFill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "min", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "max", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "fills", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "fill", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "defaultFill", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "interval", 2);
+__decorateClass([
+ Property24
+], LinearGaugeScaleProperties.prototype, "label", 2);
+var LinearGaugeLabelProperties = class extends AutoSizedLabel {
+ constructor() {
+ super(...arguments);
+ this.placement = "inside-center";
+ this.avoidCollisions = true;
+ }
+};
+__decorateClass([
+ Property24
+], LinearGaugeLabelProperties.prototype, "text", 2);
+__decorateClass([
+ Property24
+], LinearGaugeLabelProperties.prototype, "placement", 2);
+__decorateClass([
+ Property24
+], LinearGaugeLabelProperties.prototype, "avoidCollisions", 2);
+var LinearGaugeSeriesProperties = class extends SeriesProperties2 {
+ constructor() {
+ super(...arguments);
+ this.value = 0;
+ this.segmentation = new GaugeSegmentationProperties();
+ this.defaultColorRange = [];
+ this.targets = new PropertiesArray2(LinearGaugeTargetProperties);
+ this.defaultTarget = new LinearGaugeTargetProperties();
+ this.defaultScale = new LinearGaugeScaleProperties();
+ this.direction = "vertical";
+ this.thickness = 1;
+ this.cornerRadius = 0;
+ this.cornerMode = "container";
+ this.margin = 0;
+ this.scale = new LinearGaugeScaleProperties();
+ this.bar = new LinearGaugeBarProperties();
+ this.label = new LinearGaugeLabelProperties();
+ this.tooltip = makeSeriesTooltip11();
+ }
+};
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "value", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "segmentation", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "targets", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "defaultTarget", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "defaultScale", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "direction", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "thickness", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "cornerMode", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "margin", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "scale", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "bar", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property24
+], LinearGaugeSeriesProperties.prototype, "tooltip", 2);
+function createLinearGradient(fills, fillMode, defaultColorRange, scale, horizontal) {
+ const colorStops = getColorStops(fills, defaultColorRange, scale.domain, fillMode);
+ return {
+ type: "gradient",
+ gradient: "linear",
+ colorSpace: "oklch",
+ colorStops,
+ rotation: horizontal ? 90 : 0,
+ bounds: "series"
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeUtil.ts
+import { _ModuleSupport as _ModuleSupport85 } from "ag-charts-community";
+import { cachedTextMeasurer as cachedTextMeasurer3, isArray as isArray2, measureTextSegments, toPlainText as toPlainText3 } from "ag-charts-core";
+var { BBox: BBox8 } = _ModuleSupport85;
+function datumRect(datum) {
+ const { x0, y0, x1, y1, horizontalInset, verticalInset } = datum;
+ const x = Math.min(x0, x1) + horizontalInset;
+ const y = Math.min(y0, y1) + verticalInset;
+ const width = Math.max(Math.abs(x1 - x0) - 2 * horizontalInset, 0);
+ const height = Math.max(Math.abs(y1 - y0) - 2 * verticalInset, 0);
+ return { x, y, width, height };
+}
+function clipBBoxVisibility(datum, clipBBox) {
+ if (clipBBox == null)
+ return true;
+ const rect = datumRect(datum);
+ const delta3 = 1e-6;
+ const x0 = rect.x + delta3;
+ const y0 = rect.y + delta3;
+ const x1 = rect.x + rect.width - delta3;
+ const y1 = rect.y + rect.height - delta3;
+ const clipX0 = clipBBox.x;
+ const clipX1 = clipBBox.x + clipBBox.width;
+ const clipY0 = clipBBox.y;
+ const clipY1 = clipBBox.y + clipBBox.height;
+ return Math.max(x0, clipX0) <= Math.min(x1, clipX1) && Math.max(y0, clipY0) <= Math.min(y1, clipY1);
+}
+function hasClipBBox(datum) {
+ const { clipX0, clipX1, clipY0, clipY1 } = datum;
+ return clipX0 != null && clipX1 != null || clipY0 != null && clipY1 != null;
+}
+function computeClipBBox(datum) {
+ if (!hasClipBBox(datum))
+ return;
+ const { x0, y0, x1, y1 } = datum;
+ const { x, y, width, height } = datumRect(datum);
+ let { clipX0, clipX1, clipY0, clipY1 } = datum;
+ if (clipX0 == null || clipX1 == null) {
+ clipX0 = x0;
+ clipX1 = x1;
+ }
+ if (clipY0 == null || clipY1 == null) {
+ clipY0 = y0;
+ clipY1 = y1;
+ }
+ const clipX = Math.min(clipX0, clipX1);
+ const clipY = Math.min(clipY0, clipY1);
+ const clipWidth = Math.abs(clipX1 - clipX0);
+ const clipHeight = Math.abs(clipY1 - clipY0);
+ clipX0 = Math.max(x, clipX);
+ clipY0 = Math.max(y, clipY);
+ clipX1 = Math.min(x + width, clipX + clipWidth);
+ clipY1 = Math.min(y + height, clipY + clipHeight);
+ return new BBox8(
+ Math.min(clipX0, clipX1),
+ Math.min(clipY0, clipY1),
+ Math.abs(clipX1 - clipX0),
+ Math.abs(clipY1 - clipY0)
+ );
+}
+function prepareLinearGaugeSeriesAnimationFunctions(initialLoad, horizontal) {
+ const phase = initialLoad ? "initial" : "update";
+ const node = {
+ fromFn(sect, datum) {
+ const previousDatum = sect.previousDatum;
+ let { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1 } = previousDatum ?? datum;
+ const { horizontalInset, verticalInset } = datum;
+ const previousHadClipBBox = previousDatum != null && hasClipBBox(previousDatum);
+ const nextHasClipBBox = hasClipBBox(datum);
+ if (previousHadClipBBox && nextHasClipBBox) {
+ } else if (!previousHadClipBBox && nextHasClipBBox) {
+ ({ x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1 } = datum);
+ if (initialLoad) {
+ if (horizontal) {
+ clipX1 = datum.clipX0;
+ } else {
+ clipY1 = datum.clipY0;
+ }
+ }
+ } else if (previousHadClipBBox && !nextHasClipBBox) {
+ ({ x0, y0, x1, y1 } = datum);
+ clipX0 = void 0;
+ clipY0 = void 0;
+ clipX1 = void 0;
+ clipY1 = void 0;
+ } else if (initialLoad) {
+ if (horizontal) {
+ x1 = x0;
+ } else {
+ y1 = y0;
+ }
+ }
+ return { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1, horizontalInset, verticalInset, phase };
+ },
+ toFn(_sect, datum) {
+ const { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1, horizontalInset, verticalInset } = datum;
+ return { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1, horizontalInset, verticalInset };
+ },
+ applyFn(rect, params) {
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, params));
+ }
+ };
+ return { node };
+}
+function resetLinearGaugeSeriesResetRectFunction(_node, datum) {
+ const { x, y, width, height } = datumRect(datum);
+ const clipBBox = computeClipBBox(datum);
+ const visible = clipBBoxVisibility(datum, clipBBox);
+ return { x, y, width, height, clipBBox, visible };
+}
+var horizontalTextAligns = {
+ ["Before" /* Before */]: "right",
+ ["Center" /* Center */]: "center",
+ ["After" /* After */]: "left"
+};
+var verticalTextBaselines = {
+ ["Before" /* Before */]: "top",
+ ["Center" /* Center */]: "middle",
+ ["After" /* After */]: "bottom"
+};
+var horizontalAlignFactors = {
+ ["Before" /* Before */]: -1,
+ ["Center" /* Center */]: -0.5,
+ ["After" /* After */]: 0
+};
+var verticalAlignFactors2 = {
+ ["Before" /* Before */]: 0,
+ ["Center" /* Center */]: -0.5,
+ ["After" /* After */]: -1
+};
+function formatLinearGaugeLabels(series, ctx, selection, opts, bboxes, datumOverrides) {
+ const { seriesRect, gaugeRect, barRect } = bboxes;
+ const { padding, horizontal } = opts;
+ selection.each((label, labelDatum) => {
+ const labelText = getLabelText(series.id, ctx, labelDatum, datumOverrides?.label);
+ let boundingWidth;
+ let boundingHeight;
+ if (labelDatum.placement === "outside-start") {
+ if (horizontal) {
+ boundingWidth = gaugeRect.x;
+ boundingHeight = seriesRect.height;
+ } else {
+ boundingWidth = seriesRect.width;
+ boundingHeight = seriesRect.height - (gaugeRect.y + gaugeRect.height);
+ }
+ } else if (labelDatum.placement === "outside-end") {
+ if (horizontal) {
+ boundingWidth = seriesRect.width - (gaugeRect.x + gaugeRect.width);
+ boundingHeight = seriesRect.height;
+ } else {
+ boundingWidth = seriesRect.width;
+ boundingHeight = gaugeRect.y;
+ }
+ } else if (labelDatum.avoidCollisions) {
+ boundingWidth = gaugeRect.width;
+ boundingHeight = gaugeRect.height;
+ }
+ let layout;
+ if (labelText == null) {
+ return;
+ } else if (boundingWidth != null && boundingHeight != null) {
+ const sizeFittingHeight = () => ({
+ width: boundingWidth,
+ height: boundingHeight,
+ meta: null
+ });
+ const labelMeta = formatSingleLabel(toPlainText3(labelText), labelDatum, { padding }, sizeFittingHeight);
+ layout = labelMeta?.[0];
+ } else {
+ const measurer = cachedTextMeasurer3(labelDatum);
+ const { width, height } = isArray2(labelText) ? measureTextSegments(labelText, labelDatum) : measurer.measureLines(labelText);
+ layout = {
+ text: labelText,
+ fontSize: labelDatum.fontSize,
+ lineHeight: labelDatum.lineHeight ?? measurer.lineHeight(),
+ width,
+ height
+ };
+ }
+ if (layout == null) {
+ label.visible = false;
+ return;
+ }
+ const scale0 = horizontal ? gaugeRect.x : gaugeRect.y + gaugeRect.height;
+ const scale1 = horizontal ? gaugeRect.x + gaugeRect.width : gaugeRect.y;
+ const bar0 = horizontal ? barRect.x : barRect.y + barRect.height;
+ const bar1 = horizontal ? barRect.x + barRect.width : barRect.y;
+ const offset = labelDatum.spacing * (horizontal ? 1 : -1);
+ let bounds0;
+ let bounds1;
+ let s;
+ let align;
+ switch (labelDatum.placement) {
+ case "outside-start":
+ bounds0 = -Infinity;
+ bounds1 = Infinity;
+ s = scale0 - offset;
+ align = "Before" /* Before */;
+ break;
+ case "outside-end":
+ bounds0 = -Infinity;
+ bounds1 = Infinity;
+ s = scale1 + offset;
+ align = "After" /* After */;
+ break;
+ case "inside-start":
+ bounds0 = scale0;
+ bounds1 = bar1;
+ s = scale0 + offset;
+ align = "After" /* After */;
+ break;
+ case "inside-end":
+ bounds0 = bar1;
+ bounds1 = scale1;
+ s = scale1 - offset;
+ align = "Before" /* Before */;
+ break;
+ case "inside-center":
+ bounds0 = scale0;
+ bounds1 = scale1;
+ s = (scale0 + scale1) / 2;
+ align = "Center" /* Center */;
+ break;
+ case "bar-inside":
+ bounds0 = bar0;
+ bounds1 = bar1;
+ s = (bar0 + bar1) / 2;
+ align = "Center" /* Center */;
+ break;
+ case "bar-inside-end":
+ bounds0 = bar0;
+ bounds1 = bar1;
+ s = bar1 - offset;
+ align = "Before" /* Before */;
+ break;
+ case "bar-outside-end":
+ bounds0 = bar1;
+ bounds1 = scale1;
+ s = bar1 + offset;
+ align = "After" /* After */;
+ break;
+ case "bar-end":
+ bounds0 = -Infinity;
+ bounds1 = Infinity;
+ s = bar1;
+ align = "Center" /* Center */;
+ break;
+ }
+ const x = horizontal ? s : gaugeRect.x + gaugeRect.width / 2;
+ const y = horizontal ? gaugeRect.y + gaugeRect.height / 2 : s;
+ let s0;
+ let s1;
+ if (horizontal) {
+ s0 = x + horizontalAlignFactors[align] * layout.width;
+ s1 = s0 + layout.width;
+ } else {
+ s0 = y + verticalAlignFactors2[align] * layout.height;
+ s1 = s0 + layout.height;
+ }
+ const inside = Math.min(s0, s1) >= Math.min(bounds0, bounds1) && Math.max(s0, s1) <= Math.max(bounds0, bounds1);
+ if (labelDatum.avoidCollisions && !inside) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.text = layout.text;
+ label.fontSize = layout.fontSize;
+ label.lineHeight = layout.lineHeight;
+ label.textAlign = horizontal ? horizontalTextAligns[align] : "center";
+ label.textBaseline = horizontal ? "middle" : verticalTextBaselines[align];
+ label.x = x;
+ label.y = y;
+ });
+}
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeries.ts
+var {
+ fromToMotion: fromToMotion2,
+ resetMotion: resetMotion3,
+ SeriesNodePickMode: SeriesNodePickMode8,
+ StateMachine,
+ createDatumId: createDatumId9,
+ toRadians: toRadians3,
+ BBox: BBox9,
+ Group: Group7,
+ PointerEvents: PointerEvents5,
+ Selection: Selection5,
+ Rect: Rect5,
+ Text,
+ TransformableText: TransformableText2,
+ Marker: Marker2,
+ LinearScale: LinearScale3,
+ generateTicks: generateTicks2,
+ NiceMode,
+ easing,
+ findRangeExtent,
+ tickFormat,
+ mergeDefaults: mergeDefaults10,
+ applyShapeStyle: applyShapeStyle10
+} = _ModuleSupport86;
+var horizontalTargetPlacementRotation = {
+ before: 180,
+ middle: 0,
+ after: 0
+};
+var verticalTargetPlacementRotation = {
+ before: 90,
+ middle: 0,
+ after: -90
+};
+var LinearGaugeSeries = class extends _ModuleSupport86.Series {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode8.EXACT_SHAPE_MATCH, SeriesNodePickMode8.NEAREST_NODE]
+ });
+ this.properties = new LinearGaugeSeriesProperties();
+ this.seriesRect = BBox9.NaN;
+ this.gaugeRect = BBox9.NaN;
+ this.scale = new LinearScale3();
+ this.originX = 0;
+ this.originY = 0;
+ this.scaleGroup = this.contentGroup.appendChild(new Group7({ name: "scaleGroup" }));
+ this.itemGroup = this.contentGroup.appendChild(new Group7({ name: "itemGroup" }));
+ this.itemTargetGroup = this.contentGroup.appendChild(new Group7({ name: "itemTargetGroup" }));
+ this.itemTargetLabelGroup = this.contentGroup.appendChild(new Group7({ name: "itemTargetLabelGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group7({ name: "itemLabelGroup" }));
+ this.highlightTargetGroup = this.highlightGroup.appendChild(
+ new Group7({ name: "itemTargetLabelGroup" })
+ );
+ this.tickGroup = this.contentGroup.appendChild(new Group7({ name: "tickGroup" }));
+ this.scaleSelection = Selection5.select(
+ this.scaleGroup,
+ () => this.nodeFactory()
+ );
+ this.datumSelection = Selection5.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.targetSelection = Selection5.select(
+ this.itemTargetGroup,
+ () => this.markerFactory()
+ );
+ this.targetLabelSelection = Selection5.select(this.itemTargetLabelGroup, Text);
+ this.labelSelection = Selection5.select(
+ this.itemLabelGroup,
+ Text
+ );
+ this.highlightTargetSelection = Selection5.select(this.highlightTargetGroup, () => this.markerFactory());
+ this.tickSelection = Selection5.select(this.tickGroup, TransformableText2);
+ this.datumUnion = new DatumUnion();
+ this.animationState = new StateMachine("empty", {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateEmptyUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ updateData: "waiting",
+ clear: "clearing",
+ resize: () => this.animateReadyResize(),
+ reset: "empty",
+ skip: "ready"
+ },
+ waiting: {
+ update: {
+ target: "ready",
+ action: () => this.animateWaitingUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ clearing: {
+ update: {
+ target: "empty"
+ },
+ reset: "empty",
+ skip: "ready"
+ }
+ });
+ this.scaleGroup.pointerEvents = PointerEvents5.None;
+ this.tickGroup.pointerEvents = PointerEvents5.None;
+ }
+ get range() {
+ return this.horizontal ? [0, this.gaugeRect.width] : [0, this.gaugeRect.height];
+ }
+ get horizontal() {
+ return this.properties.direction === "horizontal";
+ }
+ get hasData() {
+ return true;
+ }
+ nodeFactory() {
+ const rect = new Rect5();
+ rect.crisp = true;
+ return rect;
+ }
+ markerFactory() {
+ return new Marker2();
+ }
+ processData() {
+ this.nodeDataRefresh = true;
+ this.animationState.transition("updateData");
+ }
+ formatLabel(value) {
+ return formatLabel(value, this.properties.scale);
+ }
+ getShapeFillBBox() {
+ const { properties, originX, originY, horizontal, scale } = this;
+ const { thickness } = properties;
+ const length = findRangeExtent(scale.range);
+ const bbox = new BBox9(originX, originY, horizontal ? length : thickness, horizontal ? thickness : length);
+ return {
+ axis: bbox,
+ series: bbox
+ };
+ }
+ getTargets() {
+ const { properties } = this;
+ const defaultTarget = properties.defaultTarget;
+ return Array.from(properties.targets).map((target) => {
+ const {
+ text = defaultTarget.text,
+ value = defaultTarget.value ?? 0,
+ shape = defaultTarget.shape ?? "triangle",
+ rotation = defaultTarget.rotation ?? 0,
+ placement = defaultTarget.placement ?? "middle",
+ spacing = defaultTarget.spacing ?? 0,
+ size = defaultTarget.size ?? 0
+ } = target;
+ const {
+ enabled: labelEnabled = defaultTarget.label.enabled,
+ color: labelColor = defaultTarget.label.color ?? "black",
+ fontStyle: labelFontStyle = defaultTarget.label.fontStyle ?? "normal",
+ fontWeight: labelFontWeight = defaultTarget.label.fontWeight ?? "normal",
+ fontSize: labelFontSize = defaultTarget.label.fontSize,
+ fontFamily: labelFontFamily = defaultTarget.label.fontFamily,
+ spacing: labelSpacing = defaultTarget.label.spacing ?? 0
+ } = target.label;
+ return {
+ text,
+ value,
+ shape,
+ placement,
+ spacing,
+ size,
+ rotation,
+ label: {
+ enabled: labelEnabled,
+ color: labelColor,
+ fontStyle: labelFontStyle,
+ fontWeight: labelFontWeight,
+ fontSize: labelFontSize,
+ fontFamily: labelFontFamily,
+ spacing: labelSpacing
+ },
+ style: target.getStyle(defaultTarget)
+ };
+ });
+ }
+ getTargetPoint(target) {
+ const { properties, originX, originY, horizontal, scale, gaugeRect } = this;
+ const { thickness } = properties;
+ const { value, placement, spacing, size } = target;
+ const mainOffset = scale.convert(value);
+ let crossOffset;
+ switch (placement) {
+ case "before":
+ crossOffset = -(spacing + size / 2);
+ break;
+ case "after":
+ crossOffset = thickness + spacing + size / 2;
+ break;
+ default:
+ crossOffset = thickness / 2;
+ break;
+ }
+ return {
+ x: originX + gaugeRect.x + (horizontal ? mainOffset : crossOffset),
+ y: originY + gaugeRect.y + (horizontal ? crossOffset : mainOffset)
+ };
+ }
+ getTargetLabel(target) {
+ const { size, placement, label } = target;
+ const { spacing, color: fill, fontStyle, fontWeight, fontSize, fontFamily } = label;
+ const lineHeight = void 0;
+ const offset = size / 2 + spacing;
+ let textAlign;
+ let textBaseline;
+ let offsetX = 0;
+ let offsetY = 0;
+ if (this.horizontal) {
+ textAlign = "center";
+ if (placement === "after") {
+ textBaseline = "top";
+ offsetY = offset;
+ } else {
+ textBaseline = "bottom";
+ offsetY = -offset;
+ }
+ } else {
+ textBaseline = "middle";
+ if (placement === "before") {
+ textAlign = "right";
+ offsetX = -offset;
+ } else {
+ textAlign = "left";
+ offsetX = offset;
+ }
+ }
+ return {
+ offsetX,
+ offsetY,
+ fill,
+ textAlign,
+ textBaseline,
+ fontStyle,
+ fontWeight,
+ fontSize,
+ fontFamily,
+ lineHeight
+ };
+ }
+ labelDatum(label, value) {
+ const {
+ placement,
+ avoidCollisions,
+ spacing,
+ text,
+ color: fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ wrapping,
+ overflowStrategy,
+ formatter = (params) => this.formatLabel(params.value)
+ } = label;
+ return {
+ placement,
+ avoidCollisions,
+ spacing,
+ text,
+ value,
+ fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ wrapping,
+ overflowStrategy,
+ formatter
+ };
+ }
+ verticalLabelInset() {
+ const { label } = this.properties;
+ const measurer = cachedTextMeasurer4(label);
+ const lines = label.text?.split("\n");
+ const labelSize = (label.lineHeight ?? measurer.lineHeight()) * (lines?.length ?? 1);
+ return label.spacing + labelSize;
+ }
+ horizontalLabelInset() {
+ const { scale, properties } = this;
+ const { scale: scaleProps, label } = properties;
+ const lines = label.text?.split("\n");
+ const measurer = cachedTextMeasurer4(label);
+ const ticks = scaleProps.interval.values ?? scale.ticks({
+ nice: false,
+ interval: scaleProps.interval.step,
+ minTickCount: 0,
+ maxTickCount: 6,
+ tickCount: 5
+ })?.ticks ?? [];
+ const linesOrTicks = lines ?? ticks?.map((tick) => getLabelText(this.id, this.ctx, this.labelDatum(label, tick)) ?? "");
+ const labelSize = linesOrTicks.reduce((accum, text) => {
+ const { width } = isArray3(text) ? measureTextSegments2(text, label) : measurer.measureLines(text);
+ return Math.max(accum, width);
+ }, 0);
+ return label.spacing + labelSize;
+ }
+ tickFormatter(domain, ticks) {
+ const { format, formatter } = this.properties.scale.label;
+ let tickFormatter;
+ if (format != null) {
+ tickFormatter = tickFormat(ticks, typeof format === "string" ? format : void 0);
+ }
+ return (value, index) => {
+ let r = void 0;
+ if (formatter) {
+ r ?? (r = formatWithContext(this.ctx, formatter, { value, index, domain, boundSeries: void 0 }));
+ }
+ r ?? (r = tickFormatter?.(value));
+ return r ?? this.formatLabel(value);
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, properties, horizontal, scale, seriesRect } = this;
+ const {
+ value,
+ segmentation,
+ thickness,
+ cornerRadius,
+ cornerMode,
+ bar,
+ scale: scaleProps,
+ label,
+ defaultColorRange
+ } = properties;
+ scale.domain = [scaleProps.min, scaleProps.max];
+ scale.range = horizontal ? [0, seriesRect.width] : [seriesRect.height, 0];
+ let axisRotation;
+ let sideFlag;
+ if (horizontal) {
+ sideFlag = 1;
+ axisRotation = Math.PI / 2;
+ } else if (scaleProps.label.placement === "before") {
+ sideFlag = 1;
+ axisRotation = 0;
+ } else {
+ sideFlag = -1;
+ axisRotation = 0;
+ }
+ let x0;
+ let x1;
+ let y0;
+ let y1;
+ if (horizontal) {
+ x0 = 0;
+ x1 = seriesRect.width;
+ y0 = (seriesRect.height - thickness) / 2;
+ y1 = y0 + thickness;
+ if (label.placement === "outside-start") {
+ x0 += this.horizontalLabelInset();
+ } else if (label.placement === "outside-end") {
+ x1 -= this.horizontalLabelInset();
+ }
+ } else {
+ x0 = (seriesRect.width - thickness) / 2;
+ x1 = x0 + thickness;
+ y1 = 0;
+ y0 = seriesRect.height;
+ if (label.placement === "outside-start") {
+ y0 -= this.verticalLabelInset();
+ } else if (label.placement === "outside-end") {
+ y1 += this.verticalLabelInset();
+ }
+ }
+ this.gaugeRect = new BBox9(Math.min(x0, x1), Math.min(y0, y1), Math.abs(x1 - x0), Math.abs(y1 - y0));
+ const originX = 0;
+ const originY = 0;
+ scale.domain = [scaleProps.min, scaleProps.max];
+ scale.range = horizontal ? [x0, x1] : [y0, y1];
+ const {
+ tickData: { ticks: tickData }
+ } = generateTicks2({
+ scale,
+ label: this.properties.scale.label,
+ interval: this.properties.scale.interval,
+ tickFormatter: (domain, ticks) => this.tickFormatter(domain, ticks),
+ domain: scale.domain,
+ range: this.range,
+ reverse: false,
+ primaryTickCount: void 0,
+ defaultTickMinSpacing: 0,
+ visibleRange: [0, 1],
+ niceMode: NiceMode.Off,
+ labelOffset: 0,
+ axisRotation,
+ sideFlag
+ });
+ const isReversed = false;
+ const targets = this.getTargets();
+ const nodeData = [];
+ const targetData = [];
+ const labelData = [];
+ const scaleData = [];
+ const [m0, m1] = scale.range;
+ const mainAxisSize = Math.abs(m1 - m0);
+ const containerX = horizontal ? scale.convert(value) : x1;
+ const containerY = horizontal ? y1 : scale.convert(value);
+ const inset = segmentation.enabled ? segmentation.spacing / 2 : 0;
+ const horizontalInset = horizontal ? inset : 0;
+ const verticalInset = horizontal ? 0 : inset;
+ const barThickness = Math.min(bar.thickness ?? Math.round(bar.thicknessRatio * thickness), thickness);
+ const barInset = -(thickness - barThickness) / 2;
+ const barXInset = horizontal ? 0 : barInset;
+ const barYInset = horizontal ? barInset : 0;
+ const cornersOnAllItems = cornerMode === "item";
+ const maxTicks = Math.ceil(mainAxisSize);
+ let segments = segmentation.enabled ? segmentation.interval.getSegments(scale, maxTicks) : void 0;
+ const barStyle = bar.getStyle(defaultColorRange, horizontal, scale);
+ const scaleStyle = scaleProps.getStyle(bar.enabled, defaultColorRange, horizontal, scale);
+ if (segments == null && cornersOnAllItems) {
+ const segmentStart = Math.min(...scale.domain);
+ const segmentEnd = Math.max(...scale.domain);
+ const datum = { value, segmentStart, segmentEnd };
+ if (bar.enabled) {
+ const barAppliedCornerRadius = Math.min(cornerRadius, barThickness / 2, mainAxisSize / 2);
+ const barCornerInset = barAppliedCornerRadius * (isReversed ? -1 : 1);
+ const barCornerXInset = horizontal ? barCornerInset : 0;
+ const barCornerYInset = horizontal ? 0 : barCornerInset;
+ nodeData.push({
+ series: this,
+ itemId: `value`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + x0 - barCornerXInset - barXInset,
+ y0: originY + y0 - barCornerYInset - barYInset,
+ x1: originX + containerX + barCornerXInset + barXInset,
+ y1: originY + containerY + barCornerYInset + barYInset,
+ clipX0: void 0,
+ clipY0: void 0,
+ clipX1: void 0,
+ clipY1: void 0,
+ topLeftCornerRadius: cornerRadius,
+ topRightCornerRadius: cornerRadius,
+ bottomRightCornerRadius: cornerRadius,
+ bottomLeftCornerRadius: cornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: barStyle
+ });
+ }
+ const scaleAppliedCornerRadius = Math.min(cornerRadius, thickness / 2, mainAxisSize / 2);
+ const scaleCornerInset = scaleAppliedCornerRadius * (isReversed ? -1 : 1);
+ const scaleCornerXInset = horizontal ? scaleCornerInset : 0;
+ const scaleCornerYInset = horizontal ? 0 : scaleCornerInset;
+ scaleData.push({
+ series: this,
+ itemId: `scale`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + x0 - scaleCornerXInset,
+ y0: originY + y0 - scaleCornerYInset,
+ x1: originX + x1 + scaleCornerXInset,
+ y1: originY + y1 + scaleCornerYInset,
+ clipX0: void 0,
+ clipY0: void 0,
+ clipX1: void 0,
+ clipY1: void 0,
+ topLeftCornerRadius: cornerRadius,
+ topRightCornerRadius: cornerRadius,
+ bottomRightCornerRadius: cornerRadius,
+ bottomLeftCornerRadius: cornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: scaleStyle
+ });
+ } else {
+ segments ?? (segments = scale.domain);
+ const clipX0 = originX + x0 - barXInset;
+ const clipY0 = originY + y0 - barYInset;
+ const clipX1 = originX + containerX + barXInset;
+ const clipY1 = originY + containerY + barYInset;
+ for (let i = 0; i < segments.length - 1; i += 1) {
+ const segmentStart = segments[i + 0];
+ const segmentEnd = segments[i + 1];
+ const datum = { value, segmentStart, segmentEnd };
+ const isStart = i === 0;
+ const isEnd = i === segments.length - 2;
+ const itemStart = scale.convert(segmentStart);
+ const itemEnd = scale.convert(segmentEnd);
+ const startCornerRadius = cornersOnAllItems || isStart ? cornerRadius : 0;
+ const endCornerRadius = cornersOnAllItems || isEnd ? cornerRadius : 0;
+ const topLeftCornerRadius = horizontal ? startCornerRadius : endCornerRadius;
+ const topRightCornerRadius = endCornerRadius;
+ const bottomRightCornerRadius = horizontal ? endCornerRadius : startCornerRadius;
+ const bottomLeftCornerRadius = startCornerRadius;
+ if (bar.enabled) {
+ nodeData.push({
+ series: this,
+ itemId: `value-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + (horizontal ? itemStart : x0),
+ y0: originY + (horizontal ? y0 : itemStart),
+ x1: originX + (horizontal ? itemEnd : x1),
+ y1: originY + (horizontal ? y1 : itemEnd),
+ clipX0,
+ clipY0,
+ clipX1,
+ clipY1,
+ topLeftCornerRadius,
+ topRightCornerRadius,
+ bottomRightCornerRadius,
+ bottomLeftCornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: barStyle
+ });
+ }
+ scaleData.push({
+ series: this,
+ itemId: `scale-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + (horizontal ? itemStart : x0),
+ y0: originY + (horizontal ? y0 : itemStart),
+ x1: originX + (horizontal ? itemEnd : x1),
+ y1: originY + (horizontal ? y1 : itemEnd),
+ clipX0: void 0,
+ clipY0: void 0,
+ clipX1: void 0,
+ clipY1: void 0,
+ topLeftCornerRadius,
+ topRightCornerRadius,
+ bottomRightCornerRadius,
+ bottomLeftCornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: scaleStyle
+ });
+ }
+ }
+ if (label.enabled) {
+ labelData.push(this.labelDatum(label, value));
+ }
+ const targetPlacementRotation2 = horizontal ? horizontalTargetPlacementRotation : verticalTargetPlacementRotation;
+ for (let i = 0; i < targets.length; i += 1) {
+ const target = targets[i];
+ const { value: targetValue, text, shape, size, style } = target;
+ const targetPoint = this.getTargetPoint(target);
+ const targetRotation = toRadians3(target.rotation + targetPlacementRotation2[target.placement]);
+ targetData.push({
+ series: this,
+ itemId: `target-${i}`,
+ midPoint: targetPoint,
+ datum: { value: targetValue },
+ datumIndex: { type: 1 /* Target */, index: i },
+ type: 1 /* Target */,
+ value: targetValue,
+ text,
+ x: targetPoint.x,
+ y: targetPoint.y,
+ shape,
+ size,
+ rotation: targetRotation,
+ label: this.getTargetLabel(target),
+ style
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ tickData,
+ targetData,
+ labelData,
+ scaleData
+ };
+ }
+ updateSelections(resize) {
+ if (this.nodeDataRefresh || resize) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ highlightDatum(node) {
+ if (node != null && node.series === this && node.type === 1 /* Target */) {
+ return node;
+ }
+ }
+ update({ seriesRect }) {
+ const {
+ datumSelection,
+ labelSelection,
+ targetSelection,
+ targetLabelSelection,
+ scaleSelection,
+ highlightTargetSelection,
+ tickSelection
+ } = this;
+ this.seriesRect = seriesRect ?? BBox9.NaN;
+ const resize = this.checkResize(seriesRect);
+ this.updateSelections(resize);
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = this.getOpacity();
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ const targetData = this.contextNodeData?.targetData ?? [];
+ const scaleData = this.contextNodeData?.scaleData ?? [];
+ const tickData = this.contextNodeData?.tickData ?? [];
+ const highlightTargetDatum = this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());
+ this.scaleSelection = this.updateScaleSelection({ scaleData, scaleSelection });
+ this.updateScaleNodes({ scaleSelection });
+ this.targetSelection = this.updateTargetSelection({ targetData, targetSelection });
+ this.updateTargetNodes({ targetSelection, isHighlight: false });
+ this.targetLabelSelection = this.updateTargetLabelSelection({ targetData, targetLabelSelection });
+ this.updateTargetLabelNodes({ targetLabelSelection });
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection });
+ this.highlightTargetSelection = this.updateTargetSelection({
+ targetData: highlightTargetDatum == null ? [] : [highlightTargetDatum],
+ targetSelection: highlightTargetSelection
+ });
+ this.updateTargetNodes({ targetSelection: highlightTargetSelection, isHighlight: true });
+ this.tickSelection = this.updateTickSelection({ tickData, tickSelection });
+ this.updateTickNodes({ tickSelection });
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => {
+ return createDatumId9(opts.nodeData.length, datum.itemId);
+ });
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ const { ctx } = this;
+ const animationDisabled = ctx.animationManager.isSkipped();
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const { topLeftCornerRadius, topRightCornerRadius, bottomRightCornerRadius, bottomLeftCornerRadius } = datum;
+ applyShapeStyle10(rect, datum.style, fillBBox);
+ rect.topLeftCornerRadius = topLeftCornerRadius;
+ rect.topRightCornerRadius = topRightCornerRadius;
+ rect.bottomRightCornerRadius = bottomRightCornerRadius;
+ rect.bottomLeftCornerRadius = bottomLeftCornerRadius;
+ rect.pointerEvents = this.properties.bar.enabled ? _ModuleSupport86.PointerEvents.All : _ModuleSupport86.PointerEvents.None;
+ if (animationDisabled || rect.previousDatum == null) {
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, datum));
+ }
+ });
+ const { horizontal } = this;
+ this.datumUnion.update(datumSelection, this.itemGroup, _ModuleSupport86.Rect, (node, first, last) => {
+ const left = Math.min(first.x, last.x);
+ const right = Math.max(first.x + first.width, last.x + last.width);
+ const top = Math.min(first.y, last.y);
+ const bottom = Math.max(first.y + first.height, last.y + last.height);
+ const width = right - left;
+ const height = bottom - top;
+ node.pointerEvents = _ModuleSupport86.PointerEvents.None;
+ node.x = left;
+ node.y = top;
+ node.width = width;
+ node.height = height;
+ node.topLeftCornerRadius = horizontal ? first.topLeftCornerRadius : last.topLeftCornerRadius;
+ node.topRightCornerRadius = last.topRightCornerRadius;
+ node.bottomRightCornerRadius = horizontal ? last.bottomRightCornerRadius : first.bottomRightCornerRadius;
+ node.bottomLeftCornerRadius = first.bottomLeftCornerRadius;
+ const firstClipBBox = first.clipBBox;
+ const lastClipBBox = last.clipBBox ?? firstClipBBox;
+ if (firstClipBBox && lastClipBBox) {
+ node.clipBBox = BBox9.merge([firstClipBBox, lastClipBBox]).intersection(
+ horizontal ? new BBox9(left, -Infinity, width, Infinity) : new BBox9(-Infinity, top, Infinity, height)
+ );
+ } else {
+ node.clipBBox = void 0;
+ }
+ });
+ }
+ updateScaleSelection(opts) {
+ return opts.scaleSelection.update(opts.scaleData, void 0, (datum) => {
+ return createDatumId9(opts.scaleData.length, datum.itemId);
+ });
+ }
+ updateScaleNodes(opts) {
+ const { scaleSelection } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ scaleSelection.each((rect, datum) => {
+ const { topLeftCornerRadius, topRightCornerRadius, bottomRightCornerRadius, bottomLeftCornerRadius } = datum;
+ applyShapeStyle10(rect, datum.style, fillBBox);
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, datum));
+ rect.topLeftCornerRadius = topLeftCornerRadius;
+ rect.topRightCornerRadius = topRightCornerRadius;
+ rect.bottomRightCornerRadius = bottomRightCornerRadius;
+ rect.bottomLeftCornerRadius = bottomLeftCornerRadius;
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, datum));
+ });
+ }
+ updateTargetSelection(opts) {
+ return opts.targetSelection.update(opts.targetData, void 0, (target) => target.itemId);
+ }
+ updateTargetNodes(opts) {
+ const { targetSelection, isHighlight } = opts;
+ targetSelection.each((target, datum) => {
+ const { x, y, shape, size, rotation } = datum;
+ const style = this.getTargetStyle(isHighlight, datum);
+ applyShapeStyle10(target, style);
+ target.size = size;
+ target.shape = shape === "line" ? lineMarker : shape;
+ target.translationX = x;
+ target.translationY = y;
+ target.rotation = rotation;
+ });
+ }
+ getTargetStyle(isHighlight, { datumIndex, style }) {
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ return mergeDefaults10(highlightStyle, {
+ ...style,
+ opacity: 1
+ });
+ }
+ updateTargetLabelSelection(opts) {
+ return opts.targetLabelSelection.update(opts.targetData);
+ }
+ updateTargetLabelNodes(opts) {
+ const { targetLabelSelection } = opts;
+ targetLabelSelection.each((label, target) => {
+ const { x, y, text } = target;
+ const { offsetX, offsetY, fill, fontStyle, fontWeight, fontSize, fontFamily, textAlign, textBaseline } = target.label;
+ label.visible = true;
+ label.x = x + offsetX;
+ label.y = y + offsetY;
+ label.text = text;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = textBaseline;
+ });
+ }
+ updateTickSelection(opts) {
+ return opts.tickSelection.update(opts.tickData, void 0, (datum) => datum.tickId);
+ }
+ updateTickNodes(opts) {
+ const { gaugeRect, properties } = this;
+ const defaultScale = properties.defaultScale;
+ const {
+ enabled,
+ color: color6,
+ fontFamily = defaultScale.label.fontFamily,
+ fontSize = defaultScale.label.fontSize,
+ fontStyle,
+ fontWeight = defaultScale.label.fontWeight,
+ spacing
+ } = properties.scale.label;
+ let { placement } = properties.scale.label;
+ const rotation = toRadians3(properties.scale.label.rotation ?? 0);
+ let textAlign;
+ let textBaseline;
+ let textX;
+ let textY;
+ if (this.horizontal) {
+ placement ?? (placement = "after");
+ textAlign = "center";
+ textBaseline = placement === "before" ? "bottom" : "top";
+ textY = this.originY + gaugeRect.y + (placement === "before" ? -spacing : gaugeRect.height + spacing);
+ } else {
+ placement ?? (placement = "before");
+ textAlign = placement === "before" ? "end" : "start";
+ textBaseline = "middle";
+ textX = this.originX + gaugeRect.x + (placement === "before" ? -spacing : gaugeRect.width + spacing);
+ }
+ opts.tickSelection.each((label, datum) => {
+ if (!enabled) {
+ label.visible = false;
+ return;
+ }
+ const x = textX ?? datum.translation;
+ const y = textY ?? datum.translation;
+ label.visible = true;
+ label.text = datum.tickLabel;
+ label.fill = color6;
+ label.fontFamily = fontFamily;
+ label.fontSize = fontSize;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.textBaseline = textBaseline;
+ label.textAlign = textAlign;
+ label.x = x;
+ label.y = y;
+ label.rotationCenterX = x;
+ label.rotationCenterY = y;
+ label.rotation = rotation;
+ });
+ }
+ updateLabelSelection(opts) {
+ return opts.labelSelection.update(opts.labelData, void 0, (_datum) => "primary");
+ }
+ updateLabelNodes(opts) {
+ const { labelSelection } = opts;
+ const animationDisabled = this.ctx.animationManager.isSkipped();
+ labelSelection.each((label, datum) => {
+ label.fill = datum.fill;
+ label.fontStyle = datum.fontStyle;
+ label.fontWeight = datum.fontWeight;
+ label.fontFamily = datum.fontFamily;
+ });
+ if (animationDisabled || this.labelsHaveExplicitText()) {
+ this.formatLabelText();
+ }
+ }
+ labelsHaveExplicitText() {
+ for (const { datum } of this.labelSelection) {
+ if (datum.text == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+ formatLabelText(datum) {
+ const { labelSelection, horizontal, scale, seriesRect, gaugeRect } = this;
+ const { x, y, width, height } = gaugeRect;
+ const value = datum?.label ?? this.properties.value;
+ let barRect;
+ if (horizontal) {
+ const xValue2 = scale.convert(value);
+ barRect = new BBox9(x, y, xValue2 - x, height);
+ } else {
+ const yValue = scale.convert(value);
+ barRect = new BBox9(x, yValue, width, height - yValue);
+ }
+ const bboxes = { seriesRect, gaugeRect, barRect };
+ const { margin: padding } = this.properties;
+ formatLinearGaugeLabels(this, this.ctx, labelSelection, { padding, horizontal }, bboxes, datum);
+ }
+ resetAllAnimation() {
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ resetMotion3([this.datumSelection], resetLinearGaugeSeriesResetRectFunction);
+ this.formatLabelText();
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ animateLabelText(params = {}) {
+ const { animationManager } = this.ctx;
+ let labelFrom = 0;
+ let labelTo = 0;
+ this.labelSelection.each((label, datum) => {
+ label.opacity = 1;
+ labelFrom = label.previousDatum?.value ?? params.from ?? datum.value;
+ labelTo = datum.value;
+ });
+ if (this.labelsHaveExplicitText()) {
+ } else if (labelFrom === labelTo) {
+ this.formatLabelText({ label: labelTo });
+ } else {
+ const animationId = `${this.id}_labels`;
+ animationManager.animate({
+ id: animationId,
+ groupId: "label",
+ from: { label: labelFrom },
+ to: { label: labelTo },
+ phase: params.phase ?? "update",
+ ease: easing.easeOut,
+ onUpdate: (datum) => this.formatLabelText(datum),
+ onStop: () => this.formatLabelText({ label: labelTo })
+ });
+ }
+ }
+ animateEmptyUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node } = prepareLinearGaugeSeriesAnimationFunctions(true, this.horizontal);
+ fromToMotion2(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ fromToMotion2(this.id, "label", animationManager, [this.labelSelection], fadeInFns, () => "primary");
+ this.animateLabelText({ from: 0, phase: "initial" });
+ }
+ animateWaitingUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node } = prepareLinearGaugeSeriesAnimationFunctions(false, this.horizontal);
+ fromToMotion2(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ this.animateLabelText();
+ }
+ animateReadyResize() {
+ this.resetAllAnimation();
+ }
+ getSeriesDomain() {
+ return [0, 1];
+ }
+ dataCount() {
+ return Number.NaN;
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties } = this;
+ const { tooltip } = properties;
+ if (datumIndex == null)
+ return;
+ let value;
+ let text;
+ let fallbackLabel;
+ if (datumIndex.type === 0 /* Node */) {
+ value = properties.value;
+ text = properties.label.text;
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeValue");
+ } else {
+ ({ value, text } = properties.targets[datumIndex.index]);
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeTarget");
+ }
+ if (value == null)
+ return;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ data: [{ label: text, fallbackLabel, value: this.formatLabel(value) }]
+ },
+ { seriesId, title: void 0, datum: void 0, value }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return pickGaugeNearestDatum(this, point);
+ }
+ pickFocus(opts) {
+ return pickGaugeFocus(this, opts);
+ }
+ getCaptionText() {
+ return this.formatLabel(this.properties.value);
+ }
+ getCategoryValue(_datumIndex) {
+ return;
+ }
+ datumIndexForCategoryValue(_categoryValue) {
+ return;
+ }
+ hasItemStylers() {
+ return this.properties.label.itemStyler != null;
+ }
+};
+LinearGaugeSeries.className = "LinearGaugeSeries";
+LinearGaugeSeries.type = "linear-gauge";
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeModule.ts
+var LinearGaugeModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "linear-gauge",
+ moduleFactory: (ctx) => new LinearGaugeSeries(ctx),
+ themeTemplate: {
+ minWidth: 200,
+ minHeight: 200,
+ tooltip: {
+ enabled: false
+ },
+ series: {
+ thickness: 50,
+ defaultColorRange: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $interpolate: [{ $palette: "secondDivergingColors" }, 5] },
+ _ModuleSupport87.SAFE_RANGE2_OPERATION
+ ]
+ },
+ scale: {
+ // @ts-expect-error undocumented option
+ defaultFill: { $path: ["/1", { $palette: "fill" }, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ stroke: { $path: ["/2", _ModuleSupport87.SAFE_STROKE_FILL_OPERATION, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ spacing: 11
+ }
+ },
+ bar: {
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ segmentation: {
+ enabled: false,
+ interval: {},
+ spacing: 1
+ },
+ defaultTarget: {
+ fill: { $ref: "foregroundColor" },
+ stroke: { $ref: "foregroundColor" },
+ size: 10,
+ shape: "triangle",
+ placement: "after",
+ spacing: 5,
+ label: {
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ spacing: 5
+ }
+ },
+ defaultScale: {
+ label: {
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" }
+ }
+ },
+ label: {
+ ..._ModuleSupport87.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ placement: "inside-start",
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $rem: 2 },
+ minimumFontSize: _ModuleSupport87.FONT_SIZE.SMALL,
+ spacing: 18,
+ color: { $ref: "chartBackgroundColor" }
+ },
+ margin: 4,
+ tooltip: {
+ range: { $path: ["/tooltip/range", 10] }
+ }
+ }
+ }
+};
+var LinearGaugeSeriesModule = {
+ type: "series",
+ name: "linear-gauge",
+ chartType: "standalone",
+ enterprise: true,
+ options: _ModuleSupport87.linearGaugeSeriesOptionsDef,
+ create: (ctx) => new LinearGaugeSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineModule.ts
+import { _ModuleSupport as _ModuleSupport96 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/map-util/mapThemeDefaults.ts
+import { _ModuleSupport as _ModuleSupport88 } from "ag-charts-community";
+var MAP_THEME_DEFAULTS = {
+ zoom: {
+ axes: "xy",
+ anchorPointX: "pointer",
+ anchorPointY: "pointer",
+ buttons: {
+ // @ts-expect-error undocumented options
+ anchorPointX: "middle",
+ anchorPointY: "middle"
+ }
+ },
+ legend: {
+ enabled: false
+ },
+ gradientLegend: {
+ enabled: false,
+ ..._ModuleSupport88.LEGEND_CONTAINER_THEME
+ }
+};
+function applyMapPalette(object) {
+ const clone = _ModuleSupport88.deepClone(object);
+ _ModuleSupport88.jsonWalk(clone, (value) => {
+ if (typeof value === "object" && "$palette" in value) {
+ value["$mapPalette"] = value["$palette"];
+ delete value["$palette"];
+ }
+ });
+ return clone;
+}
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeries.ts
+import { _ModuleSupport as _ModuleSupport94 } from "ag-charts-community";
+import { Logger as Logger7, cachedTextMeasurer as cachedTextMeasurer5 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/map-util/geoGeometry.ts
+import { _ModuleSupport as _ModuleSupport90 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/map-util/lineStringUtil.ts
+var delta2 = 1e-9;
+function lineSegmentDistanceToPointSquared(a, b, x, y) {
+ const [ax, ay] = a;
+ const [bx, by] = b;
+ const abx = bx - ax;
+ const aby = by - ay;
+ const l = abx * abx + aby * aby;
+ let x0;
+ let y0;
+ if (Math.abs(l) < delta2) {
+ x0 = ax;
+ y0 = ay;
+ } else {
+ let t = ((x - ax) * abx + (y - ay) * aby) / l;
+ t = Math.max(0, Math.min(1, t));
+ x0 = ax + t * (bx - ax);
+ y0 = ay + t * (by - ay);
+ }
+ const dx = x - x0;
+ const dy = y - y0;
+ return dx * dx + dy * dy;
+}
+function lineStringDistance(lineString, x, y) {
+ let minDistanceSquared = Infinity;
+ let p0 = lineString.at(-1);
+ for (const p1 of lineString) {
+ minDistanceSquared = Math.min(minDistanceSquared, lineSegmentDistanceToPointSquared(p0, p1, x, y));
+ p0 = p1;
+ }
+ return Math.sqrt(minDistanceSquared);
+}
+function lineStringLength(lineSegment) {
+ let [x0, y0] = lineSegment[0];
+ let totalDistance = 0;
+ for (let i = 1; i < lineSegment.length; i += 1) {
+ const [x1, y1] = lineSegment[i];
+ const distance = Math.hypot(x1 - x0, y1 - y0);
+ totalDistance += distance;
+ x0 = x1;
+ y0 = y1;
+ }
+ return totalDistance;
+}
+function lineStringCenter(lineSegment) {
+ if (lineSegment.length === 0)
+ return;
+ const targetDistance = lineStringLength(lineSegment) / 2;
+ let [x0, y0] = lineSegment[0];
+ let totalDistance = 0;
+ for (let i = 1; i < lineSegment.length; i += 1) {
+ const [x1, y1] = lineSegment[i];
+ const segmentDistance = Math.hypot(x1 - x0, y1 - y0);
+ const nextDistance = totalDistance + segmentDistance;
+ if (nextDistance > targetDistance) {
+ const ratio3 = (targetDistance - totalDistance) / segmentDistance;
+ const point = [x0 + (x1 - x0) * ratio3, y0 + (y1 - y0) * ratio3];
+ const angle = Math.atan2(y1 - y0, x1 - x0);
+ return { point, angle };
+ }
+ totalDistance = nextDistance;
+ x0 = x1;
+ y0 = y1;
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/polygonUtil.ts
+import { _ModuleSupport as _ModuleSupport89 } from "ag-charts-community";
+var { LonLatBBox } = _ModuleSupport89;
+function polygonBbox(polygon, into) {
+ for (const coordinates of polygon) {
+ const [lon, lat] = coordinates;
+ into = LonLatBBox.extend(into, lon, lat, lon, lat);
+ }
+ return into;
+}
+function polygonCentroid(polygon) {
+ if (polygon.length === 0)
+ return;
+ let x = 0;
+ let y = 0;
+ let k = 0;
+ let [x0, y0] = polygon.at(-1);
+ for (const [x1, y1] of polygon) {
+ const c = x0 * y1 - x1 * y0;
+ k += c;
+ x += (x0 + x1) * c;
+ y += (y0 + y1) * c;
+ x0 = x1;
+ y0 = y1;
+ }
+ k *= 3;
+ return [x / k, y / k];
+}
+function polygonDistance(polygons, x, y) {
+ let inside = false;
+ let minDistanceSquared = Infinity;
+ for (const polygon of polygons) {
+ let p0 = polygon.at(-1);
+ let [x0, y0] = p0;
+ for (const p1 of polygon) {
+ const [x1, y1] = p1;
+ if (y1 > y !== y0 > y && x < (x0 - x1) * (y - y1) / (y0 - y1) + x1) {
+ inside = !inside;
+ }
+ minDistanceSquared = Math.min(minDistanceSquared, lineSegmentDistanceToPointSquared(p0, p1, x, y));
+ p0 = p1;
+ x0 = x1;
+ y0 = y1;
+ }
+ }
+ return (inside ? -1 : 1) * Math.sqrt(minDistanceSquared);
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/geoGeometry.ts
+var { Path: Path9, ExtendedPath2D: ExtendedPath2D3, BBox: BBox10, SceneChangeDetection: SceneChangeDetection6, SceneObjectChangeDetection, objectsEqual } = _ModuleSupport90;
+var GeoGeometry = class extends Path9 {
+ constructor() {
+ super(...arguments);
+ this.projectedGeometry = void 0;
+ this.renderMode = 3 /* All */;
+ // Keep non-filled shapes separate so we don't fill them
+ this.strokePath = new ExtendedPath2D3();
+ }
+ computeBBox() {
+ if (this.dirtyPath || this.isDirtyPath()) {
+ this.updatePath();
+ this.dirtyPath = false;
+ }
+ return this.bbox?.clone();
+ }
+ updatePath() {
+ const { projectedGeometry } = this;
+ this.strokePath.clear();
+ this.path.clear();
+ this.bbox = projectedGeometry == null ? void 0 : this.drawGeometry(projectedGeometry, void 0);
+ }
+ drawPath(ctx) {
+ super.drawPath(ctx);
+ this.renderStroke(ctx, this.strokePath.getPath2D());
+ }
+ containsPoint(x, y) {
+ const { projectedGeometry } = this;
+ if (projectedGeometry == null)
+ return false;
+ if (!this.getBBox().containsPoint(x, y))
+ return false;
+ return this.geometryDistance(projectedGeometry, x, y) <= 0;
+ }
+ distanceSquared(x, y) {
+ const { projectedGeometry } = this;
+ if (projectedGeometry == null)
+ return Infinity;
+ const distance = this.geometryDistance(projectedGeometry, x, y);
+ return distance > 0 ? distance * distance : 0;
+ }
+ geometryDistance(geometry, x, y) {
+ const { renderMode, strokeWidth } = this;
+ const drawPolygons = (renderMode & 1 /* Polygons */) !== 0;
+ const drawLines = (renderMode & 2 /* Lines */) !== 0;
+ const minStrokeDistance = Math.max(strokeWidth / 2, 1) + 1;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return geometry.geometries.reduce(
+ (minDistance, g) => Math.min(minDistance, this.geometryDistance(g, x, y)),
+ Infinity
+ );
+ case "MultiPolygon":
+ return drawPolygons ? geometry.coordinates.reduce(
+ (minDistance, polygon) => Math.min(minDistance, Math.max(polygonDistance(polygon, x, y), 0)),
+ Infinity
+ ) : Infinity;
+ case "Polygon":
+ return drawPolygons ? Math.max(polygonDistance(geometry.coordinates, x, y), 0) : Infinity;
+ case "MultiLineString":
+ return drawLines ? geometry.coordinates.reduce((minDistance, lineString) => {
+ return Math.min(
+ minDistance,
+ Math.max(lineStringDistance(lineString, x, y) - minStrokeDistance, 0)
+ );
+ }, Infinity) : Infinity;
+ case "LineString":
+ return drawLines ? Math.max(lineStringDistance(geometry.coordinates, x, y) - minStrokeDistance, 0) : Infinity;
+ case "MultiPoint":
+ case "Point":
+ default:
+ return Infinity;
+ }
+ }
+ drawGeometry(geometry, bbox) {
+ const { renderMode, path, strokePath } = this;
+ const drawPolygons = (renderMode & 1 /* Polygons */) !== 0;
+ const drawLines = (renderMode & 2 /* Lines */) !== 0;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ for (const g of geometry.geometries) {
+ bbox = this.drawGeometry(g, bbox);
+ }
+ break;
+ case "MultiPolygon":
+ if (drawPolygons) {
+ for (const coordinates of geometry.coordinates) {
+ bbox = this.drawPolygon(path, coordinates, bbox);
+ }
+ }
+ break;
+ case "Polygon":
+ if (drawPolygons) {
+ bbox = this.drawPolygon(path, geometry.coordinates, bbox);
+ }
+ break;
+ case "LineString":
+ if (drawLines) {
+ bbox = this.drawLineString(strokePath, geometry.coordinates, bbox, false);
+ }
+ break;
+ case "MultiLineString":
+ if (drawLines) {
+ for (const coordinates of geometry.coordinates) {
+ bbox = this.drawLineString(strokePath, coordinates, bbox, false);
+ }
+ }
+ break;
+ case "Point":
+ case "MultiPoint":
+ break;
+ }
+ return bbox;
+ }
+ drawPolygon(path, polygons, bbox) {
+ if (polygons.length < 1)
+ return bbox;
+ bbox = this.drawLineString(path, polygons[0], bbox, true);
+ for (let i = 1; i < polygons.length; i += 1) {
+ const enclave = polygons[i];
+ this.drawLineString(path, enclave, void 0, true);
+ }
+ return bbox;
+ }
+ drawLineString(path, coordinates, bbox, isClosed) {
+ if (coordinates.length < 2)
+ return bbox;
+ const end = isClosed ? coordinates.length - 1 : coordinates.length;
+ for (let i = 0; i < end; i += 1) {
+ const [x, y] = coordinates[i];
+ if (i === 0) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ if (bbox == null) {
+ bbox = new BBox10(x, y, 0, 0);
+ } else {
+ const { x: x0, y: y0 } = bbox;
+ const x1 = x0 + bbox.width;
+ const y1 = y0 + bbox.height;
+ bbox.x = Math.min(x0, x);
+ bbox.y = Math.min(y0, y);
+ bbox.width = Math.max(x1, x) - bbox.x;
+ bbox.height = Math.max(y1, y) - bbox.y;
+ }
+ }
+ if (isClosed) {
+ path.closePath();
+ }
+ return bbox;
+ }
+};
+__decorateClass([
+ SceneObjectChangeDetection({ equals: objectsEqual })
+], GeoGeometry.prototype, "projectedGeometry", 2);
+__decorateClass([
+ SceneChangeDetection6()
+], GeoGeometry.prototype, "renderMode", 2);
+
+// packages/ag-charts-enterprise/src/series/map-util/geometryUtil.ts
+import { _ModuleSupport as _ModuleSupport91 } from "ag-charts-community";
+var { LonLatBBox: LonLatBBox2 } = _ModuleSupport91;
+function geometryBbox(geometry, into) {
+ if (geometry.bbox != null) {
+ const [lon0, lat0, lon1, lat1] = geometry.bbox;
+ into = LonLatBBox2.extend(into, lon0, lat0, lon1, lat1);
+ return into;
+ }
+ switch (geometry.type) {
+ case "GeometryCollection":
+ for (const g of geometry.geometries) {
+ into = geometryBbox(g, into);
+ }
+ break;
+ case "MultiPolygon":
+ for (const c of geometry.coordinates) {
+ if (c.length > 0) {
+ into = polygonBbox(c[0], into);
+ }
+ }
+ break;
+ case "Polygon":
+ if (geometry.coordinates.length > 0) {
+ into = polygonBbox(geometry.coordinates[0], into);
+ }
+ break;
+ case "MultiLineString":
+ for (const c of geometry.coordinates) {
+ into = polygonBbox(c, into);
+ }
+ break;
+ case "LineString":
+ into = polygonBbox(geometry.coordinates, into);
+ break;
+ case "MultiPoint":
+ for (const p of geometry.coordinates) {
+ const [lon, lat] = p;
+ into = LonLatBBox2.extend(into, lon, lat, lon, lat);
+ }
+ break;
+ case "Point": {
+ const [lon, lat] = geometry.coordinates;
+ into = LonLatBBox2.extend(into, lon, lat, lon, lat);
+ break;
+ }
+ }
+ return into;
+}
+function largestPolygon(geometry) {
+ switch (geometry.type) {
+ case "GeometryCollection": {
+ let maxArea;
+ let maxPolygon;
+ for (const g of geometry.geometries) {
+ const polygon = largestPolygon(g);
+ if (polygon == null)
+ continue;
+ const bbox = polygonBbox(polygon[0], void 0);
+ if (bbox == null)
+ continue;
+ const area = Math.abs(bbox.lat1 - bbox.lat0) * Math.abs(bbox.lon1 - bbox.lon0);
+ if (maxArea == null || area > maxArea) {
+ maxArea = area;
+ maxPolygon = polygon;
+ }
+ }
+ return maxPolygon;
+ }
+ case "MultiPolygon": {
+ let maxArea;
+ let maxPolygon;
+ for (const polygon of geometry.coordinates) {
+ const bbox = polygonBbox(polygon[0], void 0);
+ if (bbox == null)
+ continue;
+ const area = Math.abs(bbox.lat1 - bbox.lat0) * Math.abs(bbox.lon1 - bbox.lon0);
+ if (maxArea == null || area > maxArea) {
+ maxArea = area;
+ maxPolygon = polygon;
+ }
+ }
+ return maxPolygon;
+ }
+ case "Polygon":
+ return geometry.coordinates;
+ case "MultiLineString":
+ case "LineString":
+ case "MultiPoint":
+ case "Point":
+ return;
+ }
+}
+function largestLineString(geometry) {
+ switch (geometry.type) {
+ case "GeometryCollection": {
+ let maxLength;
+ let maxLineString;
+ for (const g of geometry.geometries) {
+ const lineString = largestLineString(g);
+ if (lineString == null)
+ continue;
+ const length = lineStringLength(lineString);
+ if (length == null)
+ continue;
+ if (maxLength == null || length > maxLength) {
+ maxLength = length;
+ maxLineString = lineString;
+ }
+ }
+ return maxLineString;
+ }
+ case "MultiLineString": {
+ let maxLength = 0;
+ let maxLineString;
+ for (const lineString of geometry.coordinates) {
+ const length = lineStringLength(lineString);
+ if (length > maxLength) {
+ maxLength = length;
+ maxLineString = lineString;
+ }
+ }
+ return maxLineString;
+ }
+ case "LineString":
+ return geometry.coordinates;
+ case "MultiPolygon":
+ case "Polygon":
+ case "MultiPoint":
+ case "Point":
+ return;
+ }
+}
+function containsType(geometry, type) {
+ if (geometry == null)
+ return false;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return geometry.geometries.some((g) => containsType(g, type));
+ case "MultiPolygon":
+ case "Polygon":
+ return (type & 1 /* Polygon */) !== 0;
+ case "MultiLineString":
+ case "LineString":
+ return (type & 2 /* LineString */) !== 0;
+ case "MultiPoint":
+ case "Point":
+ return (type & 4 /* Point */) !== 0;
+ }
+}
+function projectGeometry(geometry, scale) {
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return {
+ type: "GeometryCollection",
+ geometries: geometry.geometries.map((g) => projectGeometry(g, scale))
+ };
+ case "Polygon":
+ return {
+ type: "Polygon",
+ coordinates: projectPolygon(geometry.coordinates, scale)
+ };
+ case "MultiPolygon":
+ return {
+ type: "MultiPolygon",
+ coordinates: projectMultiPolygon(geometry.coordinates, scale)
+ };
+ case "MultiLineString":
+ return {
+ type: "MultiLineString",
+ coordinates: projectPolygon(geometry.coordinates, scale)
+ };
+ case "LineString":
+ return {
+ type: "LineString",
+ coordinates: projectLineString(geometry.coordinates, scale)
+ };
+ case "MultiPoint":
+ return {
+ type: "MultiPoint",
+ coordinates: projectLineString(geometry.coordinates, scale)
+ };
+ case "Point":
+ return {
+ type: "Point",
+ coordinates: scale.convert(geometry.coordinates)
+ };
+ }
+}
+function projectMultiPolygon(multiPolygon, scale) {
+ return multiPolygon.map((polygon) => projectPolygon(polygon, scale));
+}
+function projectPolygon(polygon, scale) {
+ return polygon.map((lineString) => projectLineString(lineString, scale));
+}
+function projectLineString(lineString, scale) {
+ return lineString.map((lonLat) => scale.convert(lonLat));
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/mapUtil.ts
+function prepareMapMarkerAnimationFunctions() {
+ const fromFn = (marker, _datum, status) => {
+ if (status === "removed") {
+ return { scalingX: 1, scalingY: 1 };
+ } else if (marker.previousDatum == null) {
+ return { scalingX: 0, scalingY: 0 };
+ }
+ return { scalingX: marker.scalingX, scalingY: marker.scalingY };
+ };
+ const toFn = (_marker, _datum, status) => {
+ if (status === "removed") {
+ return { scalingX: 0, scalingY: 0 };
+ }
+ return { scalingX: 1, scalingY: 1 };
+ };
+ return { fromFn, toFn };
+}
+function findFocusedGeoGeometry(series, opts) {
+ const datum = series.contextNodeData?.nodeData[opts.datumIndex];
+ if (datum === void 0)
+ return void 0;
+ for (const node of series.datumSelection.nodes()) {
+ if (node.datum === datum) {
+ return node;
+ }
+ }
+ return void 0;
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/topologySeries.ts
+import { _ModuleSupport as _ModuleSupport92 } from "ag-charts-community";
+var TopologySeriesProperties = class extends _ModuleSupport92.SeriesProperties {
+};
+var TopologySeries = class extends _ModuleSupport92.DataModelSeries {
+ addChartEventListeners() {
+ this.cleanup.register(
+ this.ctx.eventsHub.on("legend:item-click", (event) => {
+ this.onLegendItemClick(event);
+ }),
+ this.ctx.eventsHub.on("legend:item-double-click", (event) => {
+ this.onLegendItemDoubleClick(event);
+ })
+ );
+ }
+ getSeriesDomain() {
+ return [Number.NaN, Number.NaN];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport93 } from "ag-charts-community";
+var { Property: Property25, SeriesProperties: SeriesProperties3, makeSeriesTooltip: makeSeriesTooltip12, Label: Label8 } = _ModuleSupport93;
+var MapLineSeriesProperties = class extends SeriesProperties3 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.idKey = "";
+ this.topologyIdKey = "name";
+ this.idName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.colorRange = void 0;
+ this.maxStrokeWidth = void 0;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.label = new Label8();
+ this.tooltip = makeSeriesTooltip12();
+ }
+ getStyle() {
+ const { stroke, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this;
+ return {
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "topologyIdKey", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "sizeDomain", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "maxStrokeWidth", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property25
+], MapLineSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeries.ts
+var {
+ getMissCount: getMissCount2,
+ getLabelStyles: getLabelStyles2,
+ createDatumId: createDatumId10,
+ SeriesNodePickMode: SeriesNodePickMode9,
+ valueProperty: valueProperty9,
+ ColorScale: ColorScale2,
+ LinearScale: LinearScale4,
+ Selection: Selection6,
+ Text: Text2,
+ Transformable: Transformable2,
+ mergeDefaults: mergeDefaults11
+} = _ModuleSupport94;
+var MapLineSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ propertyKeys: {
+ size: ["colorKey"],
+ color: ["colorKey"],
+ label: ["labelKey"]
+ },
+ propertyNames: {
+ size: ["sizeName"],
+ color: ["colorName"],
+ label: ["labelName"]
+ },
+ pickModes: [SeriesNodePickMode9.EXACT_SHAPE_MATCH, SeriesNodePickMode9.NEAREST_NODE],
+ usesPlacedLabels: true
+ });
+ this.properties = new MapLineSeriesProperties();
+ this._chartTopology = void 0;
+ this.colorScale = new ColorScale2();
+ this.sizeScale = new LinearScale4();
+ this.datumSelection = Selection6.select(
+ this.contentGroup,
+ () => this.nodeFactory()
+ );
+ this.labelSelection = Selection6.select(this.labelGroup, Text2);
+ this.highlightDatumSelection = Selection6.select(
+ this.highlightGroup,
+ () => this.nodeFactory()
+ );
+ this._previousDatumMidPoint = void 0;
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get hasData() {
+ return super.hasData && this.topology != null;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [1 /* ShapeLine */, zIndex];
+ this.highlightGroup.zIndex = [2 /* ShapeLineHighlight */, zIndex];
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ isLabelEnabled() {
+ return this.properties.labelKey != null && this.properties.label.enabled;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 2 /* Lines */;
+ geoGeometry.lineJoin = "round";
+ geoGeometry.lineCap = "round";
+ return geoGeometry;
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const { data, topology, sizeScale, colorScale } = this;
+ const { topologyIdKey, idKey, sizeKey, colorKey, labelKey, sizeDomain, colorRange } = this.properties;
+ const featureById = /* @__PURE__ */ new Map();
+ for (const feature of topology?.features.values() ?? []) {
+ const property = feature.properties?.[topologyIdKey];
+ if (property == null || !containsType(feature.geometry, 2 /* LineString */))
+ continue;
+ featureById.set(property, feature);
+ }
+ const sizeScaleType = this.sizeScale.type;
+ const colorScaleType = this.colorScale.type;
+ const mercatorScaleType = this.scale?.type;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, data, {
+ props: [
+ valueProperty9(idKey, mercatorScaleType, { id: "idValue", includeProperty: false }),
+ valueProperty9(idKey, mercatorScaleType, {
+ id: "featureValue",
+ includeProperty: false,
+ processor: () => (datum) => featureById.get(datum)
+ }),
+ ...labelKey == null ? [] : [valueProperty9(labelKey, "category", { id: "labelValue" })],
+ ...sizeKey == null ? [] : [valueProperty9(sizeKey, sizeScaleType, { id: "sizeValue" })],
+ ...colorKey == null ? [] : [valueProperty9(colorKey, colorScaleType, { id: "colorValue" })]
+ ]
+ });
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ this.topologyBounds = featureValues.reduce((current, feature) => {
+ const geometry = feature?.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (sizeKey != null) {
+ const sizeIdx = dataModel.resolveProcessedDataIndexById(this, `sizeValue`);
+ const processedSize = processedData.domain.values[sizeIdx] ?? [];
+ sizeScale.domain = sizeDomain ?? processedSize;
+ }
+ if (colorRange != null && this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ colorScale.domain = processedData.domain.values[colorKeyIdx];
+ colorScale.range = colorRange;
+ colorScale.update();
+ }
+ if (topology == null) {
+ Logger7.warnOnce(`no topology was provided for [MapLineSeries]; nothing will be rendered.`);
+ }
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount2(this, processedData.defs.values[colorIdx].missing);
+ const colorDataMissing = dataCount === 0 || dataCount === missCount;
+ return !colorDataMissing;
+ }
+ getLabelDatum(datum, labelValue, projectedGeometry, measurer) {
+ if (labelValue == null || projectedGeometry == null)
+ return;
+ const lineString = largestLineString(projectedGeometry);
+ if (lineString == null)
+ return;
+ const { idKey, idName, sizeKey, sizeName, colorKey, colorName, labelKey, labelName, label } = this.properties;
+ if (labelKey == null || !label.enabled)
+ return;
+ const labelText = this.getLabelText(
+ labelValue,
+ datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ {
+ value: labelValue,
+ datum,
+ idKey,
+ idName,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName
+ }
+ );
+ if (labelText == null)
+ return;
+ const labelSize = measurer.measureLines(String(labelText));
+ const labelCenter = lineStringCenter(lineString);
+ if (labelCenter == null)
+ return;
+ const [x, y] = labelCenter.point;
+ const { width, height } = labelSize;
+ return {
+ point: { x, y, size: 0 },
+ label: { width, height, text: labelText },
+ anchor: void 0,
+ placement: void 0
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, dataModel, processedData, sizeScale, properties, scale } = this;
+ const { idKey, sizeKey, colorKey, labelKey, label, legendItemName } = properties;
+ if (dataModel == null || processedData == null)
+ return;
+ const idValues = dataModel.resolveColumnById(this, `idValue`, processedData);
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ const labelValues = labelKey == null ? void 0 : dataModel.resolveColumnById(this, `labelValue`, processedData);
+ const sizeValues = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData);
+ const colorValues = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData);
+ const maxStrokeWidth = properties.maxStrokeWidth ?? properties.strokeWidth;
+ sizeScale.range = [Math.min(properties.strokeWidth, maxStrokeWidth), maxStrokeWidth];
+ const measurer = cachedTextMeasurer5(label);
+ const projectedGeometries = /* @__PURE__ */ new Map();
+ for (const [datumIndex] of processedData.dataSources.get(this.id)?.data.entries() ?? []) {
+ const id = idValues[datumIndex];
+ const geometry = featureValues[datumIndex]?.geometry ?? void 0;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (id != null && projectedGeometry != null) {
+ projectedGeometries.set(id, projectedGeometry);
+ }
+ }
+ const nodeData = [];
+ const labelData = [];
+ const missingGeometries = [];
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const idValue = idValues[datumIndex];
+ const colorValue = colorValues?.[datumIndex];
+ const sizeValue = sizeValues?.[datumIndex];
+ const labelValue = labelValues?.[datumIndex];
+ const projectedGeometry = projectedGeometries.get(idValue);
+ if (projectedGeometry == null) {
+ missingGeometries.push(idValue);
+ }
+ const labelDatum = this.getLabelDatum(datum, labelValue, projectedGeometry, measurer);
+ if (labelDatum != null) {
+ labelData.push(labelDatum);
+ }
+ nodeData.push({
+ series: this,
+ itemId: idKey,
+ datum,
+ datumIndex,
+ idValue,
+ labelValue,
+ colorValue,
+ sizeValue,
+ projectedGeometry,
+ legendItemName,
+ style: this.getItemStyle({ datumIndex, datum, colorValue, sizeValue }, false)
+ });
+ }
+ const missingGeometriesCap = 10;
+ if (missingGeometries.length > missingGeometriesCap) {
+ const excessItems = missingGeometries.length - missingGeometriesCap;
+ missingGeometries.length = missingGeometriesCap;
+ missingGeometries.push(`(+${excessItems} more)`);
+ }
+ if (missingGeometries.length > 0) {
+ Logger7.warnOnce(`some data items do not have matches in the provided topology`, missingGeometries);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection, highlightDatumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const { legendItemName } = this.properties;
+ const matchingLegendItemName = legendItemName != null && highlightedDatum?.datum == null && legendItemName === highlightedDatum?.legendItemName;
+ if (highlightedDatum != null && (highlightedDatum.series !== this && !matchingLegendItemName || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumStyles({ datumSelection, isHighlight: false });
+ this.updateDatumNodes({ datumSelection, isHighlight: false });
+ this.highlightDatumSelection = this.updateDatumSelection({
+ nodeData: highlightedDatum == null ? [] : [highlightedDatum],
+ datumSelection: highlightDatumSelection
+ });
+ this.updateDatumStyles({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.updateDatumNodes({ datumSelection: highlightDatumSelection, isHighlight: true });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId10(datum.idValue));
+ }
+ getItemStyle({ datumIndex = 0, datum, colorValue, sizeValue }, isHighlight) {
+ const { properties, colorScale, sizeScale } = this;
+ const { colorRange, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const style = mergeDefaults11(highlightStyle, properties.getStyle());
+ if (!isHighlight && colorValue != null) {
+ style.stroke = this.isColorScaleValid() ? colorScale.convert(colorValue) : colorRange?.[0] ?? properties.stroke;
+ }
+ if (sizeValue != null) {
+ style.strokeWidth = sizeScale.convert(sizeValue, { clamp: true });
+ }
+ let overrides;
+ if (itemStyler != null) {
+ overrides = this.cachedDatumCallback(createDatumId10(datumIndex, isHighlight ? "highlight" : "node"), () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ });
+ }
+ return overrides ? mergeDefaults11(style, overrides) : style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ datumSelection.each((geoGeometry, nodeDatum) => {
+ const { projectedGeometry, style } = nodeDatum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ geoGeometry.setProperties(style);
+ });
+ }
+ updatePlacedLabelData(labelData) {
+ this.labelSelection = this.labelSelection.update(labelData, (text) => {
+ text.pointerEvents = _ModuleSupport94.PointerEvents.None;
+ });
+ this.updateLabelNodes({ labelSelection: this.labelSelection });
+ }
+ updateLabelNodes(opts) {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { x, y, width, height, text }, datumIndex) => {
+ const style = getLabelStyles2(this, void 0, properties, properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontSize, fontFamily } = style;
+ label.visible = true;
+ label.x = x + width / 2;
+ label.y = y + height / 2;
+ label.text = text;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.setBoxing(style);
+ });
+ }
+ resetAnimation() {
+ }
+ getLabelData() {
+ if (!this.isLabelEnabled())
+ return [];
+ return this.contextNodeData?.labelData ?? [];
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.datumSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ datumMidPoint(datum) {
+ const { _previousDatumMidPoint } = this;
+ if (_previousDatumMidPoint?.datum === datum) {
+ return _previousDatumMidPoint.point;
+ }
+ const projectedGeometry = datum.projectedGeometry;
+ const lineString = projectedGeometry == null ? void 0 : largestLineString(projectedGeometry);
+ const center = lineString == null ? void 0 : lineStringCenter(lineString)?.point;
+ const point = center == null ? void 0 : { x: center[0], y: center[1] };
+ this._previousDatumMidPoint = { datum, point };
+ return point;
+ }
+ legendItemSymbol(datumIndex) {
+ const { dataModel, processedData, properties } = this;
+ const { strokeWidth, strokeOpacity, lineDash } = properties;
+ let { stroke } = properties;
+ if (datumIndex != null && this.isColorScaleValid()) {
+ const colorValues = dataModel.resolveColumnById(this, "colorValue", processedData);
+ const colorValue = colorValues[datumIndex];
+ stroke = this.colorScale.convert(colorValue);
+ }
+ return {
+ marker: {
+ fill: void 0,
+ fillOpacity: 0,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 0,
+ lineDash: [0],
+ lineDashOffset: 0,
+ enabled: false
+ },
+ line: {
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const { processedData, dataModel } = this;
+ if (processedData == null || dataModel == null)
+ return [];
+ const { id: seriesId, visible } = this;
+ const { title, legendItemName, idKey, idName, colorKey, colorRange, showInLegend } = this.properties;
+ if (legendType === "gradient" && colorKey != null && colorRange != null) {
+ const colorDomain = processedData.domain.values[dataModel.resolveProcessedDataIndexById(this, "colorValue")];
+ const legendDatum = {
+ legendType: "gradient",
+ enabled: visible,
+ seriesId,
+ series: this.getFormatterContext("color"),
+ colorRange,
+ colorDomain
+ };
+ return [legendDatum];
+ } else if (legendType === "category") {
+ const legendDatum = {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible,
+ label: { text: legendItemName ?? title ?? idName ?? idKey },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ };
+ return [legendDatum];
+ } else {
+ return [];
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const {
+ idKey,
+ idName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ title,
+ legendItemName,
+ tooltip
+ } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const idValues = dataModel.resolveColumnById(this, `idValue`, processedData);
+ const sizeValue = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData)[datumIndex];
+ const colorValue = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex];
+ const data = [];
+ if (this.isLabelEnabled() && labelKey != null && labelKey !== idKey) {
+ const labelValue = dataModel.resolveColumnById(this, `labelValue`, processedData)[datumIndex];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "category",
+ value: labelValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: labelKey,
+ source: "tooltip",
+ property: "label",
+ domain: [],
+ boundSeries: this.getFormatterContext("label")
+ });
+ data.push({ label: labelName, fallbackLabel: labelKey, value: content ?? labelValue });
+ }
+ if (sizeValue != null && sizeKey != null) {
+ const domain = dataModel.getDomain(this, `sizeValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: sizeValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain,
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(sizeValue) });
+ }
+ if (colorValue != null && colorKey != null) {
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? String(colorValue) });
+ }
+ const format = this.getItemStyle({ datumIndex, datum, colorValue, sizeValue }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: idValues[datumIndex],
+ title: title ?? legendItemName,
+ symbol: this.legendItemSymbol(datumIndex),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ idKey,
+ idName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(opts) {
+ const geometry = findFocusedGeoGeometry(this, opts);
+ return geometry ? Transformable2.toCanvas(this.contentGroup, geometry.getBBox()) : void 0;
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+MapLineSeries.className = "MapLineSeries";
+MapLineSeries.type = "map-line";
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport95 } from "ag-charts-community";
+import {
+ and as and2,
+ arrayLength,
+ arrayOf as arrayOf3,
+ color as color3,
+ constant as constant12,
+ geoJson,
+ required as required12,
+ string as string12,
+ undocumented as undocumented6
+} from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs11, mapLineSeriesThemeableOptionsDef, without: without5 } = _ModuleSupport95;
+var mapLineSeriesOptionsDef = {
+ ...without5(commonSeriesOptionsDefs11, ["highlightStyle", "highlight"]),
+ ...mapLineSeriesThemeableOptionsDef,
+ type: required12(constant12("map-line")),
+ idKey: required12(string12),
+ sizeKey: string12,
+ colorKey: string12,
+ labelKey: string12,
+ idName: string12,
+ sizeName: string12,
+ colorName: string12,
+ labelName: string12,
+ topology: geoJson,
+ topologyIdKey: string12,
+ legendItemName: string12,
+ title: string12
+};
+mapLineSeriesOptionsDef.colorRange = undocumented6(and2(arrayOf3(color3), arrayLength(1)));
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineModule.ts
+var MapLineModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-line",
+ moduleFactory: (ctx) => new MapLineSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ stroke: applyMapPalette(_ModuleSupport96.SAFE_STROKE_FILL_OPERATION),
+ // @ts-expect-error undocumented option
+ colorRange: {
+ $if: [
+ { $eq: [{ $mapPalette: "type" }, "inbuilt"] },
+ { $mapPalette: "divergingColors" },
+ applyMapPalette(_ModuleSupport96.SAFE_RANGE2_OPERATION)
+ ]
+ },
+ strokeWidth: 1,
+ maxStrokeWidth: 3,
+ lineDash: [0],
+ lineDashOffset: 0,
+ label: {
+ ..._ModuleSupport96.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: applyMapPalette(_ModuleSupport96.multiSeriesHighlightStyle(false))
+ },
+ tooltip: {
+ range: "exact"
+ }
+ }
+};
+var MapLineSeriesModule = {
+ type: "series",
+ name: "map-line",
+ chartType: "topology",
+ enterprise: true,
+ options: mapLineSeriesOptionsDef,
+ create: (ctx) => new MapLineSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeries.ts
+import { _ModuleSupport as _ModuleSupport98 } from "ag-charts-community";
+import { Logger as Logger8 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport97 } from "ag-charts-community";
+var { Property: Property26, SeriesProperties: SeriesProperties4, makeSeriesTooltip: makeSeriesTooltip13 } = _ModuleSupport97;
+var MapLineBackgroundSeriesProperties = class extends SeriesProperties4 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.tooltip = makeSeriesTooltip13();
+ }
+};
+__decorateClass([
+ Property26
+], MapLineBackgroundSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property26
+], MapLineBackgroundSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property26
+], MapLineBackgroundSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property26
+], MapLineBackgroundSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property26
+], MapLineBackgroundSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property26
+], MapLineBackgroundSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property26
+], MapLineBackgroundSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeries.ts
+var { createDatumId: createDatumId11, Group: Group8, Selection: Selection7, PointerEvents: PointerEvents6 } = _ModuleSupport98;
+var MapLineBackgroundSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ pickModes: []
+ });
+ this.properties = new MapLineBackgroundSeriesProperties();
+ this._chartTopology = void 0;
+ this.itemGroup = this.contentGroup.appendChild(new Group8({ name: "itemGroup" }));
+ this.datumSelection = Selection7.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.itemGroup.pointerEvents = PointerEvents6.None;
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get focusable() {
+ return false;
+ }
+ setOptionsData() {
+ }
+ setChartData() {
+ }
+ get hasData() {
+ return false;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 0];
+ this.highlightGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 1];
+ return true;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 2 /* Lines */;
+ geoGeometry.lineJoin = "round";
+ geoGeometry.lineCap = "round";
+ geoGeometry.pointerEvents = PointerEvents6.None;
+ return geoGeometry;
+ }
+ processData() {
+ const { topology } = this;
+ this.topologyBounds = topology?.features.reduce((current, feature) => {
+ const geometry = feature.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (topology == null) {
+ Logger8.warnOnce(`no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.`);
+ }
+ }
+ createNodeData() {
+ const { id: seriesId, topology, scale, properties } = this;
+ if (topology == null)
+ return;
+ const { stroke, strokeOpacity, lineDash, lineDashOffset, strokeWidth } = properties;
+ const nodeData = [];
+ const labelData = [];
+ for (const [index, feature] of topology.features.entries()) {
+ const { geometry } = feature;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (projectedGeometry == null)
+ continue;
+ nodeData.push({
+ series: this,
+ itemId: index,
+ datum: feature,
+ datumIndex: 0,
+ index,
+ projectedGeometry,
+ style: { stroke, strokeOpacity, lineDash, lineDashOffset, strokeWidth }
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ const { nodeData = [] } = this.contextNodeData ?? {};
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId11(datum.index));
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ datumSelection.each((geoGeometry, datum) => {
+ const { projectedGeometry } = datum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ geoGeometry.setProperties(datum.style);
+ });
+ }
+ resetAnimation() {
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(_seriesDatum) {
+ return;
+ }
+ computeFocusBounds(_opts) {
+ return void 0;
+ }
+ hasItemStylers() {
+ return false;
+ }
+};
+MapLineBackgroundSeries.className = "MapLineBackgroundSeries";
+MapLineBackgroundSeries.type = "map-line-background";
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport99 } from "ag-charts-community";
+import { constant as constant13, geoJson as geoJson2, required as required13 } from "ag-charts-core";
+var { mapLineBackgroundSeriesThemeableOptionsDef } = _ModuleSupport99;
+var mapLineBackgroundSeriesOptionsDef = {
+ ...mapLineBackgroundSeriesThemeableOptionsDef,
+ type: required13(constant13("map-line-background")),
+ topology: geoJson2
+};
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundModule.ts
+var MapLineBackgroundModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-line-background",
+ moduleFactory: (ctx) => new MapLineBackgroundSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ stroke: { $path: ["/1", { $mapPalette: "stroke" }, { $mapPalette: "secondHierarchyColors" }] },
+ strokeWidth: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ }
+ }
+};
+var MapLineBackgroundSeriesModule = {
+ type: "series",
+ name: "map-line-background",
+ chartType: "topology",
+ enterprise: true,
+ options: mapLineBackgroundSeriesOptionsDef,
+ create: (ctx) => new MapLineBackgroundSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerModule.ts
+import { _ModuleSupport as _ModuleSupport104 } from "ag-charts-community";
+import { ValidationError, validate } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeries.ts
+import { _ModuleSupport as _ModuleSupport102 } from "ag-charts-community";
+import { Logger as Logger9, cachedTextMeasurer as cachedTextMeasurer6 } from "ag-charts-core";
+
+// packages/ag-charts-types/src/chart/navigatorOptions.ts
+var __MINI_CHART_SERIES_OPTIONS = void 0;
+var __VERIFY_MINI_CHART_SERIES_OPTIONS = void 0;
+__VERIFY_MINI_CHART_SERIES_OPTIONS = __MINI_CHART_SERIES_OPTIONS;
+
+// packages/ag-charts-types/src/chart/themeOptions.ts
+var __THEME_OVERRIDES = void 0;
+var __VERIFY_THEME_OVERRIDES = void 0;
+__VERIFY_THEME_OVERRIDES = __THEME_OVERRIDES;
+
+// packages/ag-charts-types/src/presets/gauge/commonOptions.ts
+var __THEMEABLE_OPTIONS = void 0;
+var __VERIFY_THEMEABLE_OPTIONS = void 0;
+__VERIFY_THEMEABLE_OPTIONS = __THEMEABLE_OPTIONS;
+var __AXIS_LABEL_OPTIONS = void 0;
+var __VERIFY_AXIS_LABEL_OPTIONS = void 0;
+__VERIFY_AXIS_LABEL_OPTIONS = __AXIS_LABEL_OPTIONS;
+
+// packages/ag-charts-enterprise/src/series/map-util/polygonPointSearch.ts
+import { insertListItemsSorted } from "ag-charts-core";
+function polygonPointSearch(polygons, precision, valueFn) {
+ const bbox = polygonBbox(polygons[0], void 0);
+ if (bbox == null)
+ return;
+ const boundingXCenter = (bbox.lon0 + bbox.lon1) / 2;
+ const boundingYCenter = (bbox.lat0 + bbox.lat1) / 2;
+ const boundingWidth = Math.abs(bbox.lon1 - bbox.lon0);
+ const boundingHeight = Math.abs(bbox.lat1 - bbox.lat0);
+ const centroid = polygonCentroid(polygons[0]);
+ const [cx, cy] = centroid;
+ const centroidDistanceToPolygon = -polygonDistance(polygons, cx, cy);
+ let bestResult;
+ const cellValue = (distanceToPolygon, distanceToCentroid) => {
+ const centroidDriftFactor = 0.5;
+ const centroidDrift = Math.max(distanceToCentroid - centroidDistanceToPolygon, 0);
+ return distanceToPolygon - centroidDriftFactor * centroidDrift;
+ };
+ const createLabelPlacement = (x2, y2, stride) => {
+ const { distance: distance2, maxDistance } = valueFn(polygons, x2, y2, stride);
+ const distanceToCentroid = Math.hypot(cx - x2, cy - y2);
+ const maxXTowardsCentroid = Math.min(Math.max(cx, x2 - stride / 2), x2 + stride / 2);
+ const maxYTowardsCentroid = Math.min(Math.max(cy, y2 - stride / 2), y2 + stride / 2);
+ const minDistanceToCentroid = Math.hypot(cx - maxXTowardsCentroid, cy - maxYTowardsCentroid);
+ const value = cellValue(distance2, distanceToCentroid);
+ const maxValue = cellValue(maxDistance, minDistanceToCentroid);
+ return { distance: distance2, maxDistance, value, maxValue, x: x2, y: y2, stride };
+ };
+ const appendLabelPlacement = (into, x2, y2, stride) => {
+ const labelPlacement = createLabelPlacement(x2, y2, stride);
+ if (labelPlacement.maxDistance >= 0) {
+ into.push(labelPlacement);
+ }
+ };
+ const initialStride = Math.min(boundingWidth, boundingHeight) / 2;
+ let queue = {
+ value: createLabelPlacement(boundingXCenter, boundingYCenter, initialStride),
+ next: null
+ };
+ while (queue != null) {
+ const item = queue.value;
+ const { distance: distance2, value, maxValue, x: x2, y: y2, stride } = item;
+ queue = queue.next;
+ if (distance2 > 0 && (bestResult == null || value > bestResult.value)) {
+ bestResult = item;
+ }
+ if (bestResult != null && maxValue - bestResult.value <= precision) {
+ continue;
+ }
+ const nextStride = stride / 2;
+ const newLabelPlacements = [];
+ appendLabelPlacement(newLabelPlacements, x2 - nextStride, y2 - nextStride, nextStride);
+ appendLabelPlacement(newLabelPlacements, x2 + nextStride, y2 - nextStride, nextStride);
+ appendLabelPlacement(newLabelPlacements, x2 - nextStride, y2 + nextStride, nextStride);
+ appendLabelPlacement(newLabelPlacements, x2 + nextStride, y2 + nextStride, nextStride);
+ newLabelPlacements.sort(labelPlacementCmp);
+ queue = insertListItemsSorted(queue, newLabelPlacements, labelPlacementCmp);
+ }
+ if (bestResult == null)
+ return;
+ const { distance, x, y } = bestResult;
+ return { x, y, distance };
+}
+var labelPlacementCmp = (a, b) => b.maxValue - a.maxValue;
+
+// packages/ag-charts-enterprise/src/series/map-util/markerUtil.ts
+function polygonMarkerCenter(polygons, precision) {
+ const result = polygonPointSearch(polygons, precision, (p, x2, y2, stride) => {
+ const distance = -polygonDistance(p, x2, y2);
+ const maxDistance = distance + stride * Math.SQRT2;
+ return { distance, maxDistance };
+ });
+ if (result == null)
+ return;
+ const { x, y } = result;
+ return [x, y];
+}
+function markerPositions(geometry, precision) {
+ let center;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return geometry.geometries.flatMap((g) => markerPositions(g, precision));
+ case "MultiPoint":
+ return geometry.coordinates;
+ case "Point":
+ return [geometry.coordinates];
+ case "MultiPolygon": {
+ const polygon = largestPolygon(geometry);
+ center = polygon == null ? void 0 : polygonMarkerCenter(polygon, precision);
+ break;
+ }
+ case "Polygon": {
+ const polygon = geometry.coordinates;
+ center = polygon == null ? void 0 : polygonMarkerCenter(polygon, precision);
+ break;
+ }
+ case "MultiLineString": {
+ const lineString = largestLineString(geometry);
+ center = lineString == null ? void 0 : lineStringCenter(lineString)?.point;
+ break;
+ }
+ case "LineString": {
+ const lineString = geometry.coordinates;
+ center = lineStringCenter(lineString)?.point;
+ break;
+ }
+ }
+ return center == null ? [] : [center];
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/shapeFillBBox.ts
+import { _ModuleSupport as _ModuleSupport100 } from "ag-charts-community";
+var { BBox: BBox11 } = _ModuleSupport100;
+function getTopologyShapeFillBBox(scale) {
+ if (!scale)
+ return;
+ const { range: range2 } = scale;
+ const x = range2[0][0];
+ const y = range2[0][1];
+ const width = range2[1][0] - x;
+ const height = range2[1][1] - y;
+ const bbox = new BBox11(x, y, width, height);
+ return {
+ series: bbox,
+ axis: bbox
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport101 } from "ag-charts-community";
+var { Property: Property27, SeriesProperties: SeriesProperties5, makeSeriesTooltip: makeSeriesTooltip14, Label: Label9 } = _ModuleSupport101;
+var MapMarkerSeriesLabel = class extends Label9 {
+ constructor() {
+ super(...arguments);
+ this.placement = "bottom";
+ }
+};
+__decorateClass([
+ Property27
+], MapMarkerSeriesLabel.prototype, "placement", 2);
+var MapMarkerSeriesProperties = class extends SeriesProperties5 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.idKey = void 0;
+ this.topologyIdKey = "name";
+ this.idName = void 0;
+ this.latitudeKey = void 0;
+ this.latitudeName = void 0;
+ this.longitudeKey = void 0;
+ this.longitudeName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.colorRange = void 0;
+ this.shape = "circle";
+ this.size = 6;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.label = new MapMarkerSeriesLabel();
+ this.tooltip = makeSeriesTooltip14();
+ }
+ getStyle() {
+ const { size, shape, fill, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ size,
+ shape,
+ fill,
+ fillOpacity,
+ opacity: 1,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "topologyIdKey", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "latitudeKey", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "latitudeName", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "longitudeKey", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "longitudeName", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "shape", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "size", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "maxSize", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "sizeDomain", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property27
+], MapMarkerSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeries.ts
+var {
+ fromToMotion: fromToMotion3,
+ StateMachine: StateMachine2,
+ getMissCount: getMissCount3,
+ createDatumId: createDatumId12,
+ SeriesNodePickMode: SeriesNodePickMode10,
+ valueProperty: valueProperty10,
+ computeMarkerFocusBounds: computeMarkerFocusBounds2,
+ ColorScale: ColorScale3,
+ LinearScale: LinearScale5,
+ Group: Group9,
+ Selection: Selection8,
+ Text: Text3,
+ Marker: Marker3,
+ applyShapeStyle: applyShapeStyle11,
+ getLabelStyles: getLabelStyles3,
+ LonLatBBox: LonLatBBox3,
+ mergeDefaults: mergeDefaults12
+} = _ModuleSupport102;
+var MapMarkerSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ propertyKeys: {
+ size: ["colorKey"],
+ color: ["colorKey"],
+ label: ["labelKey"]
+ },
+ propertyNames: {
+ size: ["sizeName"],
+ color: ["colorName"],
+ label: ["labelName"]
+ },
+ pickModes: [SeriesNodePickMode10.EXACT_SHAPE_MATCH, SeriesNodePickMode10.NEAREST_NODE],
+ usesPlacedLabels: true
+ });
+ this.properties = new MapMarkerSeriesProperties();
+ this._chartTopology = void 0;
+ this.colorScale = new ColorScale3();
+ this.sizeScale = new LinearScale5();
+ this.markerGroup = this.contentGroup.appendChild(new Group9({ name: "markerGroup" }));
+ this.labelSelection = Selection8.select(this.labelGroup, Text3, false);
+ this.markerSelection = Selection8.select(
+ this.markerGroup,
+ Marker3,
+ false
+ );
+ this.highlightMarkerSelection = Selection8.select(this.highlightGroup, Marker3);
+ this.animationState = new StateMachine2(
+ "empty",
+ {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateMarkers()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ updateData: "waiting",
+ clear: "clearing",
+ resize: () => this.resetAllAnimation(),
+ reset: "empty",
+ skip: "ready"
+ },
+ waiting: {
+ update: {
+ target: "ready",
+ action: () => this.animateMarkers()
+ },
+ // chart.ts transitions to updateData on zoom change
+ resize: {
+ target: "ready",
+ action: () => this.resetAllAnimation()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ clearing: {
+ update: {
+ target: "empty",
+ action: () => this.resetAllAnimation()
+ },
+ reset: "empty",
+ skip: "ready"
+ }
+ },
+ () => this.checkProcessedDataAnimatable()
+ );
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get hasData() {
+ const hasLatLon = this.properties.latitudeKey != null && this.properties.longitudeKey != null;
+ return super.hasData && (this.topology != null || hasLatLon);
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [3 /* Marker */, zIndex];
+ this.highlightGroup.zIndex = [4 /* MarkerHighlight */, zIndex];
+ return true;
+ }
+ isLabelEnabled() {
+ return this.properties.labelKey != null && this.properties.label.enabled;
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const { data, topology, sizeScale, colorScale } = this;
+ const { topologyIdKey, idKey, latitudeKey, longitudeKey, sizeKey, colorKey, labelKey, sizeDomain, colorRange } = this.properties;
+ const featureById = /* @__PURE__ */ new Map();
+ for (const feature of topology?.features.values() ?? []) {
+ const property = feature.properties?.[topologyIdKey];
+ if (property == null)
+ continue;
+ featureById.set(property, feature);
+ }
+ const sizeScaleType = this.sizeScale.type;
+ const colorScaleType = this.colorScale.type;
+ const mercatorScaleType = this.scale?.type;
+ const hasLatLon = latitudeKey != null && longitudeKey != null;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, data, {
+ props: [
+ ...idKey == null ? [] : [
+ valueProperty10(idKey, mercatorScaleType, { id: "idValue", includeProperty: false }),
+ valueProperty10(idKey, mercatorScaleType, {
+ id: "featureValue",
+ includeProperty: false,
+ processor: () => (datum) => featureById.get(datum)
+ })
+ ],
+ ...hasLatLon ? [
+ valueProperty10(latitudeKey, mercatorScaleType, { id: "latValue" }),
+ valueProperty10(longitudeKey, mercatorScaleType, { id: "lonValue" })
+ ] : [],
+ ...labelKey ? [valueProperty10(labelKey, "category", { id: "labelValue" })] : [],
+ ...sizeKey ? [valueProperty10(sizeKey, sizeScaleType, { id: "sizeValue" })] : [],
+ ...colorKey ? [valueProperty10(colorKey, colorScaleType, { id: "colorValue" })] : []
+ ]
+ });
+ const featureValues = idKey == null ? void 0 : dataModel.resolveColumnById(this, `featureValue`, processedData);
+ const latValues = hasLatLon ? dataModel.resolveColumnById(this, `latValue`, processedData) : void 0;
+ const lonValues = hasLatLon ? dataModel.resolveColumnById(this, `lonValue`, processedData) : void 0;
+ this.topologyBounds = processedData.dataSources.get(this.id)?.data.reduce((current, _datum, datumIndex) => {
+ const feature = featureValues?.[datumIndex];
+ const geometry = feature?.geometry;
+ if (geometry != null) {
+ current = geometryBbox(geometry, current);
+ }
+ if (latValues != null && lonValues != null) {
+ const lon = lonValues[datumIndex];
+ const lat = latValues[datumIndex];
+ current = LonLatBBox3.extend(current, lon, lat, lon, lat);
+ }
+ return current;
+ }, void 0);
+ if (sizeKey != null) {
+ const sizeIdx = dataModel.resolveProcessedDataIndexById(this, `sizeValue`);
+ const processedSize = processedData.domain.values[sizeIdx] ?? [];
+ sizeScale.domain = sizeDomain ?? processedSize;
+ }
+ if (colorRange != null && this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ colorScale.domain = processedData.domain.values[colorKeyIdx];
+ colorScale.range = colorRange;
+ colorScale.update();
+ }
+ this.animationState.transition("updateData");
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount3(this, processedData.defs.values[colorIdx].missing);
+ const colorDataMissing = dataCount === 0 || dataCount === missCount;
+ return !colorDataMissing;
+ }
+ getLabelDatum(datum, labelValue, x, y, size, measurer) {
+ if (labelValue == null)
+ return;
+ const {
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName,
+ label,
+ shape
+ } = this.properties;
+ if (labelKey == null || !label.enabled)
+ return;
+ const { placement } = label;
+ const labelText = this.getLabelText(
+ labelValue,
+ datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ {
+ value: labelValue,
+ datum,
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName
+ }
+ );
+ if (labelText == null)
+ return;
+ const { width, height } = measurer.measureLines(String(labelText));
+ const anchor = Marker3.anchor(shape);
+ return {
+ point: { x, y, size },
+ label: { width, height, text: labelText },
+ anchor,
+ placement
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, dataModel, processedData, sizeScale, properties, scale } = this;
+ const { idKey, latitudeKey, longitudeKey, sizeKey, colorKey, labelKey, label, legendItemName } = properties;
+ if (dataModel == null || processedData == null || scale == null)
+ return;
+ const hasLatLon = latitudeKey != null && longitudeKey != null;
+ const idValues = idKey == null ? void 0 : dataModel.resolveColumnById(this, `idValue`, processedData);
+ const featureValues = idKey == null ? void 0 : dataModel.resolveColumnById(this, `featureValue`, processedData);
+ const latValues = hasLatLon ? dataModel.resolveColumnById(this, `latValue`, processedData) : void 0;
+ const lonValues = hasLatLon ? dataModel.resolveColumnById(this, `lonValue`, processedData) : void 0;
+ const labelValues = labelKey == null ? void 0 : dataModel.resolveColumnById(this, `labelValue`, processedData);
+ const sizeValues = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData);
+ const colorValues = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData);
+ const markerMaxSize = properties.maxSize ?? properties.size;
+ sizeScale.range = [Math.min(properties.size, markerMaxSize), markerMaxSize];
+ const measurer = cachedTextMeasurer6(label);
+ let projectedGeometries;
+ if (idValues != null && featureValues != null) {
+ projectedGeometries = /* @__PURE__ */ new Map();
+ for (const [datumIndex] of processedData.dataSources.get(this.id)?.data.entries() ?? []) {
+ const id = idValues[datumIndex];
+ const geometry = featureValues[datumIndex]?.geometry ?? void 0;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (id != null && projectedGeometry != null) {
+ projectedGeometries.set(id, projectedGeometry);
+ }
+ }
+ }
+ const nodeData = [];
+ const labelData = [];
+ const missingGeometries = [];
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const idValue = idValues?.[datumIndex];
+ const lonValue = lonValues?.[datumIndex];
+ const latValue = latValues?.[datumIndex];
+ const colorValue = colorValues?.[datumIndex];
+ const sizeValue = sizeValues?.[datumIndex];
+ const labelValue = labelValues?.[datumIndex];
+ const size = sizeValue == null ? properties.size : sizeScale.convert(sizeValue, { clamp: true });
+ const projectedGeometry = idValue == null ? void 0 : projectedGeometries?.get(idValue);
+ if (idValue != null && projectGeometry == null) {
+ missingGeometries.push(idValue);
+ }
+ if (lonValue != null && latValue != null) {
+ const [x, y] = scale.convert([lonValue, latValue]);
+ const labelDatum = this.getLabelDatum(datum, labelValue, x, y, size, measurer);
+ if (labelDatum) {
+ labelData.push(labelDatum);
+ }
+ nodeData.push({
+ series: this,
+ itemId: latitudeKey,
+ datum,
+ datumIndex,
+ index: -1,
+ idValue,
+ lonValue,
+ latValue,
+ labelValue,
+ sizeValue,
+ colorValue,
+ point: { x, y, size },
+ midPoint: { x, y },
+ legendItemName,
+ style: this.getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, false)
+ });
+ } else if (projectedGeometry != null) {
+ for (const [index, [x, y]] of markerPositions(projectedGeometry, 1).entries()) {
+ const labelDatum = this.getLabelDatum(datum, labelValue, x, y, size, measurer);
+ if (labelDatum) {
+ labelData.push(labelDatum);
+ }
+ nodeData.push({
+ series: this,
+ itemId: latitudeKey,
+ datum,
+ datumIndex,
+ index,
+ idValue,
+ lonValue,
+ latValue,
+ labelValue,
+ sizeValue,
+ colorValue,
+ point: { x, y, size },
+ midPoint: { x, y },
+ legendItemName,
+ style: this.getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, false)
+ });
+ }
+ }
+ }
+ const missingGeometriesCap = 10;
+ if (missingGeometries.length > missingGeometriesCap) {
+ const excessItems = missingGeometries.length - missingGeometriesCap;
+ missingGeometries.length = missingGeometriesCap;
+ missingGeometries.push(`(+${excessItems} more)`);
+ }
+ if (missingGeometries.length > 0) {
+ Logger9.warnOnce(`some data items do not have matches in the provided topology`, missingGeometries);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ checkScaleChange() {
+ if (this.previousScale === this.scale)
+ return false;
+ this.previousScale = this.scale;
+ return true;
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ const scaleChange = this.checkScaleChange();
+ const { markerSelection, highlightMarkerSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const { legendItemName } = this.properties;
+ const matchingLegendItemName = legendItemName != null && highlightedDatum?.datum == null && legendItemName === highlightedDatum?.legendItemName;
+ if (highlightedDatum != null && (highlightedDatum.series !== this && !matchingLegendItemName || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ this.markerSelection = this.updateMarkerSelection({ markerData: nodeData, markerSelection });
+ this.updateMarkerNodes({ markerSelection, isHighlight: false, highlightedDatum });
+ this.highlightMarkerSelection = this.updateMarkerSelection({
+ markerData: highlightedDatum == null ? [] : [highlightedDatum],
+ markerSelection: highlightMarkerSelection
+ });
+ this.updateMarkerNodes({
+ markerSelection: highlightMarkerSelection,
+ isHighlight: true,
+ highlightedDatum
+ });
+ if (scaleChange || resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updatePlacedLabelData(labelData) {
+ this.labelSelection = this.labelSelection.update(labelData, (text) => {
+ text.pointerEvents = _ModuleSupport102.PointerEvents.None;
+ });
+ this.updateLabelNodes({ labelSelection: this.labelSelection });
+ }
+ updateLabelNodes(opts) {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { x, y, width, height, text }, datumIndex) => {
+ const style = getLabelStyles3(this, void 0, properties, properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontSize, fontFamily } = style;
+ label.visible = true;
+ label.x = x + width / 2;
+ label.y = y + height / 2;
+ label.text = text;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.setBoxing(style);
+ });
+ }
+ updateMarkerSelection(opts) {
+ const { markerData, markerSelection } = opts;
+ return markerSelection.update(
+ markerData,
+ void 0,
+ (datum) => createDatumId12(datum.index, datum.idValue, datum.lonValue, datum.latValue)
+ );
+ }
+ getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, isHighlight) {
+ const { properties, colorScale, sizeScale } = this;
+ const { colorRange, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults12(highlightStyle, properties.getStyle());
+ if (!isHighlight && colorValue != null) {
+ baseStyle.fill = this.isColorScaleValid() ? colorScale.convert(colorValue) : colorRange?.[0] ?? baseStyle.fill;
+ }
+ if (sizeValue != null) {
+ baseStyle.size = sizeScale.convert(sizeValue, { clamp: true });
+ }
+ let style = baseStyle;
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId12(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults12(overrides, baseStyle);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateMarkerNodes(opts) {
+ const { markerSelection, isHighlight, highlightedDatum } = opts;
+ const fillBBox = getTopologyShapeFillBBox(this.scale);
+ markerSelection.each((marker, markerDatum) => {
+ const { datum, point } = markerDatum;
+ const style = this.getMarkerItemStyle(markerDatum, isHighlight);
+ marker.shape = style.shape;
+ marker.size = style.size;
+ applyShapeStyle11(marker, style, fillBBox);
+ marker.x = point.x;
+ marker.y = point.y;
+ marker.scalingCenterX = point.x;
+ marker.scalingCenterY = point.y;
+ marker.zIndex = !isHighlight && highlightedDatum != null && datum === highlightedDatum.datum ? 1 : 0;
+ });
+ }
+ isProcessedDataAnimatable() {
+ return true;
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ resetAllAnimation() {
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ this.ctx.animationManager.skipCurrentBatch();
+ this.labelSelection.cleanup();
+ this.markerSelection.cleanup();
+ this.highlightMarkerSelection.cleanup();
+ }
+ animateMarkers() {
+ const { animationManager } = this.ctx;
+ const fns = prepareMapMarkerAnimationFunctions();
+ fromToMotion3(this.id, "markers", animationManager, [this.markerSelection, this.highlightMarkerSelection], fns);
+ }
+ getLabelData() {
+ if (!this.isLabelEnabled())
+ return [];
+ return this.contextNodeData?.labelData ?? [];
+ }
+ pickNodeClosestDatum(p) {
+ const { x: x0, y: y0 } = p;
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ for (const datum of this.contextNodeData?.nodeData ?? []) {
+ const { x, y, size } = datum.point;
+ const dx = Math.max(Math.abs(x - x0) - size, 0);
+ const dy = Math.max(Math.abs(y - y0) - size, 0);
+ const distanceSquared = dx * dx + dy * dy;
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ }
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ legendItemSymbol(datumIndex) {
+ const { dataModel, processedData, properties } = this;
+ const { shape, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = properties;
+ let { fill } = properties;
+ if (datumIndex != null && this.isColorScaleValid()) {
+ const colorValues = dataModel.resolveColumnById(this, "colorValue", processedData);
+ const colorValue = colorValues[datumIndex];
+ fill = this.colorScale.convert(colorValue);
+ }
+ return {
+ marker: {
+ shape,
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const { processedData, dataModel } = this;
+ if (processedData == null || dataModel == null)
+ return [];
+ const { id: seriesId, visible } = this;
+ const { title, legendItemName, idName, idKey, colorKey, colorRange, showInLegend } = this.properties;
+ if (legendType === "gradient" && colorKey != null && colorRange != null) {
+ const colorDomain = processedData.domain.values[dataModel.resolveProcessedDataIndexById(this, "colorValue")];
+ const legendDatum = {
+ legendType: "gradient",
+ enabled: visible,
+ seriesId,
+ series: this.getFormatterContext("color"),
+ colorRange,
+ colorDomain
+ };
+ return [legendDatum];
+ } else if (legendType === "category") {
+ const legendDatum = {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible,
+ label: { text: legendItemName ?? title ?? idName ?? idKey ?? seriesId },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ };
+ return [legendDatum];
+ } else {
+ return [];
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const {
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ title,
+ legendItemName,
+ tooltip
+ } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const sizeValue = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData)[datumIndex];
+ const colorValue = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex];
+ const data = [];
+ if (this.isLabelEnabled() && labelKey != null && labelKey !== idKey) {
+ const labelValue = dataModel.resolveColumnById(this, `labelValue`, processedData)[datumIndex];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "category",
+ value: labelValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: labelKey,
+ source: "tooltip",
+ property: "label",
+ domain: [],
+ boundSeries: this.getFormatterContext("label")
+ });
+ data.push({ label: labelName, fallbackLabel: labelKey, value: content ?? labelValue });
+ }
+ if (sizeKey != null && sizeValue != null) {
+ const domain = dataModel.getDomain(this, `sizeValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: sizeValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain,
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(sizeValue) });
+ }
+ if (colorKey != null && colorValue != null) {
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? String(colorValue) });
+ }
+ let heading;
+ if (idKey != null) {
+ heading = dataModel.resolveColumnById(this, `idValue`, processedData)[datumIndex];
+ } else if (latitudeKey != null && longitudeKey != null) {
+ const latValue = dataModel.resolveColumnById(this, `latValue`, processedData)[datumIndex];
+ const lonValue = dataModel.resolveColumnById(this, `lonValue`, processedData)[datumIndex];
+ heading = `${Math.abs(latValue).toFixed(4)}\xB0 ${latValue >= 0 ? "N" : "S"}, ${Math.abs(lonValue).toFixed(4)}\xB0 ${lonValue >= 0 ? "W" : "E"}`;
+ }
+ const format = this.getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading,
+ title: title ?? legendItemName,
+ symbol: this.legendItemSymbol(datumIndex),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ ...format
+ }
+ );
+ }
+ getFormattedMarkerStyle(markerDatum) {
+ const format = this.getMarkerItemStyle(markerDatum, false);
+ return { size: format.size, shape: format.shape };
+ }
+ computeFocusBounds(opts) {
+ return computeMarkerFocusBounds2(this, opts);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+MapMarkerSeries.className = "MapMarkerSeries";
+MapMarkerSeries.type = "map-marker";
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport103 } from "ag-charts-community";
+import { constant as constant14, geoJson as geoJson3, required as required14, string as string13 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs12, mapMarkerSeriesThemeableOptionsDef, without: without6 } = _ModuleSupport103;
+var mapMarkerSeriesOptionsDef = {
+ ...without6(commonSeriesOptionsDefs12, ["highlightStyle", "highlight"]),
+ ...mapMarkerSeriesThemeableOptionsDef,
+ type: required14(constant14("map-marker")),
+ idKey: string13,
+ latitudeKey: string13,
+ longitudeKey: string13,
+ sizeKey: string13,
+ colorKey: string13,
+ labelKey: string13,
+ idName: string13,
+ latitudeName: string13,
+ longitudeName: string13,
+ sizeName: string13,
+ colorName: string13,
+ labelName: string13,
+ topology: geoJson3,
+ topologyIdKey: string13,
+ legendItemName: string13,
+ title: string13
+};
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerModule.ts
+var MapMarkerModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-marker",
+ moduleFactory: (ctx) => new MapMarkerSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ shape: "circle",
+ maxSize: 30,
+ fill: applyMapPalette({
+ $applySwitch: [
+ { $path: "type" },
+ { $mapPalette: "fill" },
+ ["gradient", _ModuleSupport104.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", _ModuleSupport104.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport104.FILL_PATTERN_DEFAULTS]
+ ]
+ }),
+ stroke: { $mapPalette: "stroke" },
+ colorRange: {
+ $if: [
+ { $eq: [{ $mapPalette: "type" }, "inbuilt"] },
+ { $mapPalette: "divergingColors" },
+ applyMapPalette(_ModuleSupport104.SAFE_RANGE2_OPERATION)
+ ]
+ },
+ fillOpacity: 0.5,
+ label: {
+ ..._ModuleSupport104.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: applyMapPalette(_ModuleSupport104.multiSeriesHighlightStyle())
+ },
+ tooltip: {
+ range: "exact"
+ }
+ }
+};
+var MapMarkerSeriesModule = {
+ type: "series",
+ name: "map-marker",
+ chartType: "topology",
+ enterprise: true,
+ options: mapMarkerSeriesOptionsDef,
+ create: (ctx) => new MapMarkerSeries(ctx),
+ validate(options, optionsDefs2, path) {
+ const result = validate(options, optionsDefs2, path);
+ const { cleared, invalid } = result;
+ if (cleared?.idKey == null && (cleared?.latitudeKey == null || cleared?.longitudeKey == null)) {
+ const extendPath = (key) => path ? `${path}.${key}` : key;
+ const message = `Either \`${extendPath("idKey")}\` or both \`${extendPath("latitudeKey")}\` and \`${extendPath("longitudeKey")}\` are required.`;
+ invalid.push(new ValidationError("required", message, null, path));
+ }
+ return result;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeModule.ts
+import { _ModuleSupport as _ModuleSupport108 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeries.ts
+import { _ModuleSupport as _ModuleSupport106 } from "ag-charts-community";
+import {
+ Logger as Logger10,
+ cachedTextMeasurer as cachedTextMeasurer7,
+ isArray as isArray4,
+ measureTextSegments as measureTextSegments3,
+ toPlainText as toPlainText4
+} from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/map-util/polygonLabelUtil.ts
+function preferredLabelCenter(polygons, { aspectRatio, precision }) {
+ const result = polygonPointSearch(polygons, precision, (p, cx, cy, stride) => {
+ const width = maxWidthOfRectConstrainedByCenterAndAspectRatioToPolygon(p, cx, cy, aspectRatio);
+ const maxWidth2 = width + 2 * stride * aspectRatio;
+ const distance2 = width * Math.SQRT2;
+ const maxDistance = maxWidth2 * Math.SQRT2;
+ return { distance: distance2, maxDistance };
+ });
+ if (result == null)
+ return;
+ const { x, y, distance } = result;
+ const maxWidth = distance / Math.SQRT2;
+ return { x, y, maxWidth };
+}
+function maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(a, b, cx, cy, aspectRatio) {
+ const [ax, ay] = a;
+ const [bx, by] = b;
+ const positiveM = 1 / aspectRatio;
+ const abx = bx - ax;
+ const aby = by - ay;
+ const [topPointX, topPointY] = ay <= by ? a : b;
+ const [leftPointX, leftPointY] = ax <= bx ? a : b;
+ const [bottomPointX, bottomPointY] = ay <= by ? b : a;
+ const [rightPointX, rightPointY] = ax <= bx ? b : a;
+ let maxWidth = Infinity;
+ if (abx === 0) {
+ for (let i = 0; i <= 1; i += 1) {
+ const m = i === 0 ? positiveM : -positiveM;
+ const y = m * (ax - cx) + cy;
+ if (y >= topPointY && y <= bottomPointY) {
+ const height = Math.abs(cy - y) * 2;
+ const width = height * aspectRatio;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ }
+ } else {
+ const abm = aby / abx;
+ for (let i = 0; i <= 1; i += 1) {
+ const m = i === 0 ? positiveM : -positiveM;
+ const x = (abm * ax - ay - m * cx + cy) / (abm - m);
+ if (x >= leftPointX && x <= rightPointX) {
+ const width = Math.abs(cx - x) * 2;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ }
+ }
+ const positiveMRecip = aspectRatio;
+ const centerToTopMRecip = Math.abs((topPointX - cx) / (topPointY - cy));
+ const centerToBottomMRecip = Math.abs((bottomPointX - cx) / (bottomPointY - cy));
+ if (bottomPointY < cy && centerToBottomMRecip < positiveMRecip) {
+ const height = Math.abs(cy - bottomPointY) * 2;
+ const width = height * aspectRatio;
+ maxWidth = Math.min(maxWidth, width);
+ } else if (topPointY > cy && centerToTopMRecip < positiveMRecip) {
+ const height = Math.abs(cy - topPointY) * 2;
+ const width = height * aspectRatio;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ const centerToLeftM = Math.abs((leftPointY - cy) / (leftPointX - cx));
+ const centerToRightM = Math.abs((rightPointY - cy) / (rightPointX - cx));
+ if (rightPointX < cx && centerToRightM < positiveM) {
+ const width = Math.abs(cx - rightPointX) * 2;
+ maxWidth = Math.min(maxWidth, width);
+ } else if (leftPointX > cx && centerToLeftM < positiveM) {
+ const width = Math.abs(cx - leftPointX) * 2;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ return maxWidth;
+}
+function maxWidthOfRectConstrainedByCenterAndAspectRatioToPolygon(polygons, cx, cy, aspectRatio) {
+ let inside = false;
+ let minWidth = Infinity;
+ for (const polygon of polygons) {
+ let p0 = polygon.at(-1);
+ let [x0, y0] = p0;
+ for (const p1 of polygon) {
+ const [x1, y1] = p1;
+ if (y1 > cy !== y0 > cy && cx < (x0 - x1) * (cy - y1) / (y0 - y1) + x1) {
+ inside = !inside;
+ }
+ const width = maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(p0, p1, cx, cy, aspectRatio);
+ minWidth = Math.min(minWidth, width);
+ p0 = p1;
+ x0 = x1;
+ y0 = y1;
+ }
+ }
+ return (inside ? 1 : -1) * minWidth;
+}
+function applyX(into, cx, x) {
+ if (x >= cx) {
+ into.maxX = Math.min(into.maxX, x - cx);
+ }
+ if (x <= cx) {
+ into.minX = Math.max(into.minX, x - cx);
+ }
+}
+function xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(into, a, b, cx, cy, height) {
+ const ry0 = cy - height / 2;
+ const ry1 = cy + height / 2;
+ const [ax, ay] = a;
+ const [bx, by] = b;
+ const abx = bx - ax;
+ const aby = by - ay;
+ const [leftPointX, leftPointY] = ax <= bx ? a : b;
+ const [rightPointX, rightPointY] = ax <= bx ? b : a;
+ if (abx !== 0) {
+ const abm = aby / abx;
+ for (let i = 0; i <= 1; i += 1) {
+ const y = i === 0 ? ry0 : ry1;
+ const x = (y - ay) / abm + ax;
+ if (x >= leftPointX && x <= rightPointX) {
+ applyX(into, cx, x);
+ }
+ }
+ } else if (Math.max(ry0, Math.min(ay, by)) <= Math.min(ry1, Math.max(ay, by))) {
+ applyX(into, cx, ax);
+ }
+ if (rightPointX < cx && rightPointY >= ry0 && rightPointY <= ry1) {
+ applyX(into, cx, rightPointX);
+ } else if (leftPointX > cx && leftPointY >= ry0 && leftPointY <= ry1) {
+ applyX(into, cx, leftPointX);
+ }
+ return into;
+}
+function maxWidthInPolygonForRectOfHeight(polygons, cx, cy, height) {
+ const result = {
+ minX: -Infinity,
+ maxX: Infinity
+ };
+ for (const polygon of polygons) {
+ let p0 = polygon.at(-1);
+ for (const p1 of polygon) {
+ xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(result, p0, p1, cx, cy, height);
+ p0 = p1;
+ }
+ }
+ const { minX, maxX } = result;
+ if (Number.isFinite(minX) && Number.isFinite(maxX)) {
+ return { x: cx + (minX + maxX) / 2, width: maxX - minX };
+ } else {
+ return { x: cx, width: 0 };
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport105 } from "ag-charts-community";
+var { Property: Property28, SeriesProperties: SeriesProperties6, makeSeriesTooltip: makeSeriesTooltip15 } = _ModuleSupport105;
+var MapShapeSeriesProperties = class extends SeriesProperties6 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.idKey = "";
+ this.idName = void 0;
+ this.topologyIdKey = "name";
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.colorRange = void 0;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.padding = 0;
+ this.label = new AutoSizedSecondaryLabel();
+ this.tooltip = makeSeriesTooltip15();
+ }
+ getStyle() {
+ const { fill, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "topologyIdKey", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "padding", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property28
+], MapShapeSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeries.ts
+var {
+ getMissCount: getMissCount4,
+ createDatumId: createDatumId13,
+ SeriesNodePickMode: SeriesNodePickMode11,
+ valueProperty: valueProperty11,
+ ColorScale: ColorScale4,
+ Group: Group10,
+ Selection: Selection9,
+ Text: Text4,
+ PointerEvents: PointerEvents7,
+ applyShapeStyle: applyShapeStyle12,
+ getLabelStyles: getLabelStyles4,
+ mergeDefaults: mergeDefaults13
+} = _ModuleSupport106;
+var fixedScale = _ModuleSupport106.MercatorScale.fixedScale();
+var MapShapeSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ propertyKeys: {
+ color: ["colorKey"],
+ label: ["labelKey"]
+ },
+ propertyNames: {
+ color: ["colorName"],
+ label: ["labelName"]
+ },
+ pickModes: [SeriesNodePickMode11.EXACT_SHAPE_MATCH, SeriesNodePickMode11.NEAREST_NODE]
+ });
+ this.properties = new MapShapeSeriesProperties();
+ this._chartTopology = void 0;
+ this.colorScale = new ColorScale4();
+ this.itemGroup = this.contentGroup.appendChild(new Group10({ name: "itemGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group10({ name: "itemLabelGroup" }));
+ this.datumSelection = Selection9.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.labelSelection = Selection9.select(
+ this.itemLabelGroup,
+ Text4
+ );
+ this.highlightDatumSelection = Selection9.select(
+ this.highlightGroup,
+ () => this.nodeFactory()
+ );
+ this.previousLabelLayouts = void 0;
+ this._previousDatumMidPoint = void 0;
+ this.itemLabelGroup.pointerEvents = PointerEvents7.None;
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get hasData() {
+ return super.hasData && this.topology != null;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [1 /* ShapeLine */, zIndex];
+ this.highlightGroup.zIndex = [2 /* ShapeLineHighlight */, zIndex];
+ return true;
+ }
+ isLabelEnabled() {
+ return this.properties.labelKey != null && this.properties.label.enabled;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 1 /* Polygons */;
+ geoGeometry.lineJoin = "round";
+ return geoGeometry;
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const { data, topology, colorScale } = this;
+ const { topologyIdKey, idKey, colorKey, labelKey, colorRange } = this.properties;
+ const featureById = /* @__PURE__ */ new Map();
+ for (const feature of topology?.features.values() ?? []) {
+ const property = feature.properties?.[topologyIdKey];
+ if (property == null || !containsType(feature.geometry, 1 /* Polygon */))
+ continue;
+ featureById.set(property, feature);
+ }
+ const colorScaleType = this.colorScale.type;
+ const mercatorScaleType = this.scale?.type;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, data, {
+ props: [
+ valueProperty11(idKey, mercatorScaleType, { id: "idValue", includeProperty: false }),
+ valueProperty11(idKey, mercatorScaleType, {
+ id: "featureValue",
+ includeProperty: false,
+ processor: () => (datum) => featureById.get(datum)
+ }),
+ ...labelKey ? [valueProperty11(labelKey, "category", { id: "labelValue" })] : [],
+ ...colorKey ? [valueProperty11(colorKey, colorScaleType, { id: "colorValue" })] : []
+ ]
+ });
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ this.topologyBounds = featureValues.reduce((current, feature) => {
+ const geometry = feature?.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (colorRange != null && this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ colorScale.domain = processedData.domain.values[colorKeyIdx];
+ colorScale.range = colorRange;
+ colorScale.update();
+ }
+ if (topology == null) {
+ Logger10.warnOnce(`no topology was provided for [MapShapeSeries]; nothing will be rendered.`);
+ }
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount4(this, processedData.defs.values[colorIdx].missing);
+ const colorDataMissing = dataCount === 0 || dataCount === missCount;
+ return !colorDataMissing;
+ }
+ getLabelLayout(datum, labelValue, measurer, geometry, previousLabelLayout) {
+ if (labelValue == null || geometry == null)
+ return;
+ const { idKey, idName, colorKey, colorName, labelKey, labelName, padding, label } = this.properties;
+ if (labelKey == null || !label.enabled)
+ return;
+ const labelText = this.getLabelText(
+ labelValue,
+ datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ {
+ value: labelValue,
+ datum,
+ idKey,
+ idName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName
+ }
+ );
+ if (labelText == null)
+ return;
+ const baseSize = isArray4(labelText) ? measureTextSegments3(labelText, label) : measurer.measureLines(String(labelText));
+ const aspectRatio = (baseSize.width + 2 * padding) / (baseSize.height + 2 * padding);
+ if (previousLabelLayout?.geometry === geometry && previousLabelLayout?.labelText === labelText && previousLabelLayout?.aspectRatio === aspectRatio) {
+ return previousLabelLayout;
+ }
+ const fixedGeometry = projectGeometry(geometry, fixedScale);
+ const fixedPolygon = largestPolygon(fixedGeometry);
+ if (fixedPolygon == null)
+ return;
+ const labelPlacement = preferredLabelCenter(fixedPolygon, {
+ aspectRatio,
+ precision: 1e-3
+ });
+ if (labelPlacement == null)
+ return;
+ const { x, y, maxWidth } = labelPlacement;
+ return { geometry, labelText, aspectRatio, x, y, maxWidth, fixedPolygon };
+ }
+ getLabelDatum(labelLayout, scaling) {
+ const { scale } = this;
+ if (scale == null)
+ return;
+ const { padding, label } = this.properties;
+ const { labelText, aspectRatio, x: untruncatedX, y, maxWidth, fixedPolygon } = labelLayout;
+ const maxSizeWithoutTruncation = {
+ width: Math.ceil(maxWidth * scaling),
+ height: Math.ceil(maxWidth * scaling / aspectRatio),
+ meta: untruncatedX
+ };
+ const labelFormatting = formatSingleLabel(
+ toPlainText4(labelText),
+ label,
+ { padding },
+ (height, allowTruncation) => {
+ if (!allowTruncation) {
+ return maxSizeWithoutTruncation;
+ }
+ const result = maxWidthInPolygonForRectOfHeight(fixedPolygon, untruncatedX, y, height / scaling);
+ return {
+ width: result.width * scaling,
+ height,
+ meta: result.x
+ };
+ }
+ );
+ if (labelFormatting == null)
+ return;
+ const [{ text, fontSize, lineHeight, width }, formattingX] = labelFormatting;
+ const x = width < maxSizeWithoutTruncation.width ? untruncatedX : formattingX;
+ const position = this.scale.convert(fixedScale.invert([x, y]));
+ return {
+ x: position[0],
+ y: position[1],
+ text,
+ fontSize,
+ lineHeight
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, dataModel, processedData, properties, scale, previousLabelLayouts } = this;
+ const { idKey, colorKey, labelKey, label, legendItemName } = properties;
+ if (dataModel == null || processedData == null)
+ return;
+ const scaling = scale == null ? Number.NaN : (scale.range[1][0] - scale.range[0][0]) / scale.bounds.width;
+ const idValues = dataModel.resolveColumnById(this, `idValue`, processedData);
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ const labelValues = labelKey == null ? void 0 : dataModel.resolveColumnById(this, `labelValue`, processedData);
+ const colorValues = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData);
+ const measurer = cachedTextMeasurer7(label);
+ const labelLayouts = /* @__PURE__ */ new Map();
+ this.previousLabelLayouts = labelLayouts;
+ const nodeData = [];
+ const labelData = [];
+ const missingGeometries = [];
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const idValue = idValues[datumIndex];
+ const colorValue = colorValues?.[datumIndex];
+ const labelValue = labelValues?.[datumIndex];
+ const geometry = featureValues[datumIndex]?.geometry ?? void 0;
+ if (geometry == null) {
+ missingGeometries.push(idValue);
+ }
+ const labelLayout = this.getLabelLayout(
+ datum,
+ labelValue,
+ measurer,
+ geometry,
+ previousLabelLayouts?.get(idValue)
+ );
+ if (labelLayout != null) {
+ labelLayouts.set(idValue, labelLayout);
+ }
+ const labelDatum = labelLayout != null && scale != null ? this.getLabelDatum(labelLayout, scaling) : void 0;
+ if (labelDatum != null) {
+ labelData.push(labelDatum);
+ }
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ nodeData.push({
+ series: this,
+ itemId: idKey,
+ datum,
+ datumIndex,
+ idValue,
+ colorValue,
+ labelValue,
+ projectedGeometry,
+ legendItemName,
+ style: this.getItemStyle({ datum, datumIndex, colorValue }, false)
+ });
+ }
+ const missingGeometriesCap = 10;
+ if (missingGeometries.length > missingGeometriesCap) {
+ const excessItems = missingGeometries.length - missingGeometriesCap;
+ missingGeometries.length = missingGeometriesCap;
+ missingGeometries.push(`(+${excessItems} more)`);
+ }
+ if (missingGeometries.length > 0) {
+ Logger10.warnOnce(`some data items do not have matches in the provided topology`, missingGeometries);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection, labelSelection, highlightDatumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const { legendItemName } = this.properties;
+ const matchingLegendItemName = legendItemName != null && highlightedDatum?.datum == null && legendItemName === highlightedDatum?.legendItemName;
+ if (highlightedDatum != null && (highlightedDatum.series !== this && !matchingLegendItemName || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumStyles({ datumSelection, isHighlight: false });
+ this.updateDatumNodes({ datumSelection });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection });
+ this.highlightDatumSelection = this.updateDatumSelection({
+ nodeData: highlightedDatum == null ? [] : [highlightedDatum],
+ datumSelection: highlightDatumSelection
+ });
+ this.updateDatumStyles({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.updateDatumNodes({ datumSelection: highlightDatumSelection });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId13(datum.idValue));
+ }
+ getItemStyle({ datumIndex, datum, colorValue }, isHighlight) {
+ const { properties, colorScale } = this;
+ const { colorRange, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults13(highlightStyle, properties.getStyle());
+ if (!isHighlight && colorValue != null) {
+ baseStyle.fill = this.isColorScaleValid() ? colorScale.convert(colorValue) : colorRange?.[0] ?? baseStyle.fill;
+ }
+ let style = baseStyle;
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId13(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults13(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ const fillBBox = getTopologyShapeFillBBox(this.scale);
+ datumSelection.each((geoGeometry, nodeDatum) => {
+ const { projectedGeometry } = nodeDatum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ applyShapeStyle12(geoGeometry, nodeDatum.style, fillBBox);
+ });
+ }
+ updateLabelSelection(opts) {
+ const labels = this.isLabelEnabled() ? opts.labelData : [];
+ return opts.labelSelection.update(labels);
+ }
+ updateLabelNodes(opts) {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { x, y, text, fontSize, lineHeight }, datumIndex) => {
+ const style = getLabelStyles4(this, void 0, properties, properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontFamily } = style;
+ label.visible = true;
+ label.x = x;
+ label.y = y;
+ label.text = text;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.lineHeight = lineHeight;
+ label.fontFamily = fontFamily;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.setBoxing(style);
+ });
+ }
+ resetAnimation() {
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.datumSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ datumMidPoint(datum) {
+ const { _previousDatumMidPoint } = this;
+ if (_previousDatumMidPoint?.datum === datum) {
+ return _previousDatumMidPoint.point;
+ }
+ const projectedGeometry = datum.projectedGeometry;
+ const polygon = projectedGeometry == null ? void 0 : largestPolygon(projectedGeometry);
+ const center = polygon == null ? void 0 : polygonMarkerCenter(polygon, 2);
+ const point = center == null ? void 0 : { x: center[0], y: center[1] };
+ this._previousDatumMidPoint = { datum, point };
+ return point;
+ }
+ legendItemSymbol(datumIndex) {
+ const { dataModel, processedData, properties } = this;
+ const { fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = properties;
+ let { fill } = properties;
+ if (datumIndex != null && this.isColorScaleValid()) {
+ const colorValues = dataModel.resolveColumnById(this, "colorValue", processedData);
+ const colorValue = colorValues[datumIndex];
+ fill = this.colorScale.convert(colorValue);
+ }
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const { processedData, dataModel } = this;
+ if (processedData == null || dataModel == null)
+ return [];
+ const { id: seriesId, visible } = this;
+ const { title, legendItemName, idKey, idName, colorKey, colorRange, showInLegend } = this.properties;
+ if (legendType === "gradient" && colorKey != null && colorRange != null) {
+ const colorDomain = processedData.domain.values[dataModel.resolveProcessedDataIndexById(this, "colorValue")];
+ const legendDatum = {
+ legendType: "gradient",
+ enabled: visible,
+ seriesId,
+ series: this.getFormatterContext("color"),
+ colorRange,
+ colorDomain
+ };
+ return [legendDatum];
+ } else if (legendType === "category") {
+ const legendDatum = {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible,
+ label: { text: legendItemName ?? title ?? idName ?? idKey },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ };
+ return [legendDatum];
+ } else {
+ return [];
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const { idKey, idName, colorKey, colorName, labelKey, labelName, legendItemName, title, tooltip } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const idValue = dataModel.resolveColumnById(this, `idValue`, processedData)[datumIndex];
+ const colorValue = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex];
+ const data = [];
+ if (this.isLabelEnabled() && labelKey != null && labelKey !== idKey) {
+ const labelValue = dataModel.resolveColumnById(this, `labelValue`, processedData)[datumIndex];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "category",
+ value: labelValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: labelKey,
+ source: "tooltip",
+ property: "label",
+ domain: [],
+ boundSeries: this.getFormatterContext("label")
+ });
+ data.push({ label: labelName, fallbackLabel: labelKey, value: content ?? labelValue });
+ }
+ if (colorValue != null) {
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? String(colorValue) });
+ }
+ const format = this.getItemStyle({ datum, datumIndex, colorValue }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: idValue,
+ title: title ?? legendItemName,
+ symbol: this.legendItemSymbol(datumIndex),
+ data
+ },
+ { seriesId, datum, title, idKey, idName, colorKey, colorName, labelKey, labelName, ...format }
+ );
+ }
+ computeFocusBounds(opts) {
+ return findFocusedGeoGeometry(this, opts);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+MapShapeSeries.className = "MapShapeSeries";
+MapShapeSeries.type = "map-shape";
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport107 } from "ag-charts-community";
+import { constant as constant15, geoJson as geoJson4, required as required15, string as string14 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs13, mapShapeSeriesThemeableOptionsDef, without: without7 } = _ModuleSupport107;
+var mapShapeSeriesOptionsDef = {
+ ...without7(commonSeriesOptionsDefs13, ["highlightStyle", "highlight"]),
+ ...mapShapeSeriesThemeableOptionsDef,
+ type: required15(constant15("map-shape")),
+ idKey: required15(string14),
+ colorKey: string14,
+ labelKey: string14,
+ idName: string14,
+ colorName: string14,
+ labelName: string14,
+ topology: geoJson4,
+ topologyIdKey: string14,
+ legendItemName: string14,
+ title: string14
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeModule.ts
+var MapShapeModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-shape",
+ moduleFactory: (ctx) => new MapShapeSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ fill: applyMapPalette({
+ $applySwitch: [
+ { $path: "type" },
+ { $mapPalette: "fill" },
+ ["gradient", _ModuleSupport108.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", _ModuleSupport108.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport108.FILL_PATTERN_DEFAULTS]
+ ]
+ }),
+ stroke: { $ref: "chartBackgroundColor" },
+ colorRange: {
+ $if: [
+ { $eq: [{ $mapPalette: "type" }, "inbuilt"] },
+ { $mapPalette: "divergingColors" },
+ applyMapPalette(_ModuleSupport108.SAFE_RANGE2_OPERATION)
+ ]
+ },
+ fillOpacity: 1,
+ strokeWidth: 1,
+ lineDash: [0],
+ lineDashOffset: 0,
+ padding: 2,
+ label: {
+ ..._ModuleSupport108.LABEL_BOXING_DEFAULTS,
+ color: { $ref: "chartBackgroundColor" },
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: "bold",
+ overflowStrategy: "hide"
+ },
+ highlight: applyMapPalette(_ModuleSupport108.multiSeriesHighlightStyle(true))
+ },
+ tooltip: {
+ range: "exact"
+ }
+ }
+};
+var MapShapeSeriesModule = {
+ type: "series",
+ name: "map-shape",
+ chartType: "topology",
+ enterprise: true,
+ options: mapShapeSeriesOptionsDef,
+ create: (ctx) => new MapShapeSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundModule.ts
+import { _ModuleSupport as _ModuleSupport112 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeries.ts
+import { _ModuleSupport as _ModuleSupport110 } from "ag-charts-community";
+import { Logger as Logger11 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport109 } from "ag-charts-community";
+var { Property: Property29, SeriesProperties: SeriesProperties7, makeSeriesTooltip: makeSeriesTooltip16 } = _ModuleSupport109;
+var MapShapeBackgroundSeriesProperties = class extends SeriesProperties7 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.tooltip = makeSeriesTooltip16();
+ }
+};
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property29
+], MapShapeBackgroundSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeries.ts
+var { createDatumId: createDatumId14, Selection: Selection10, Group: Group11, PointerEvents: PointerEvents8 } = _ModuleSupport110;
+var MapShapeBackgroundSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ pickModes: []
+ });
+ this.properties = new MapShapeBackgroundSeriesProperties();
+ this._chartTopology = void 0;
+ this.itemGroup = this.contentGroup.appendChild(new Group11({ name: "itemGroup" }));
+ this.datumSelection = Selection10.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.itemGroup.pointerEvents = PointerEvents8.None;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get focusable() {
+ return false;
+ }
+ setOptionsData() {
+ }
+ setChartData() {
+ }
+ getNodeData() {
+ return;
+ }
+ get hasData() {
+ return false;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 0];
+ this.highlightGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 1];
+ return true;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 1 /* Polygons */;
+ geoGeometry.lineJoin = "round";
+ geoGeometry.pointerEvents = PointerEvents8.None;
+ return geoGeometry;
+ }
+ processData() {
+ const { topology } = this;
+ this.topologyBounds = topology?.features.reduce((current, feature) => {
+ const geometry = feature.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (topology == null) {
+ Logger11.warnOnce(`no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.`);
+ }
+ }
+ createNodeData() {
+ const { id: seriesId, topology, scale, properties } = this;
+ if (topology == null)
+ return;
+ const { fill, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = properties;
+ const nodeData = [];
+ const labelData = [];
+ for (const [index, feature] of topology.features.entries()) {
+ const { geometry } = feature;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (projectedGeometry == null)
+ continue;
+ nodeData.push({
+ series: this,
+ itemId: index,
+ datum: feature,
+ datumIndex: 0,
+ index,
+ projectedGeometry,
+ style: { fill, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset }
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ const { nodeData = [] } = this.contextNodeData ?? {};
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId14(datum.index));
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ datumSelection.each((geoGeometry, datum) => {
+ const { projectedGeometry } = datum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ geoGeometry.setProperties(datum.style);
+ });
+ }
+ resetAnimation() {
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(_seriesDatum) {
+ return;
+ }
+ pickFocus() {
+ return void 0;
+ }
+ computeFocusBounds(_opts) {
+ return void 0;
+ }
+ hasItemStylers() {
+ return false;
+ }
+};
+MapShapeBackgroundSeries.className = "MapShapeBackgroundSeries";
+MapShapeBackgroundSeries.type = "map-shape-background";
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport111 } from "ag-charts-community";
+import { constant as constant16, geoJson as geoJson5, required as required16 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs14, mapShapeBackgroundSeriesThemeableOptionsDef } = _ModuleSupport111;
+var mapShapeBackgroundSeriesOptionsDef = {
+ ...mapShapeBackgroundSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs14,
+ type: required16(constant16("map-shape-background")),
+ topology: geoJson5
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundModule.ts
+var MapShapeBackgroundModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-shape-background",
+ moduleFactory: (ctx) => new MapShapeBackgroundSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ fill: applyMapPalette({
+ $applySwitch: [
+ { $path: "type" },
+ { $path: ["/1", { $mapPalette: "fill" }, { $mapPalette: "hierarchyColors" }] },
+ ["gradient", _ModuleSupport112.FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS],
+ ["image", _ModuleSupport112.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport112.FILL_PATTERN_HIERARCHY_DEFAULTS]
+ ]
+ }),
+ stroke: { $ref: "chartBackgroundColor" },
+ strokeWidth: 1
+ }
+ }
+};
+var MapShapeBackgroundSeriesModule = {
+ type: "series",
+ name: "map-shape-background",
+ chartType: "topology",
+ enterprise: true,
+ options: mapShapeBackgroundSeriesOptionsDef,
+ create: (ctx) => new MapShapeBackgroundSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleModule.ts
+import { _ModuleSupport as _ModuleSupport121 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleSeries.ts
+import { _ModuleSupport as _ModuleSupport118 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesBase.ts
+import { _ModuleSupport as _ModuleSupport114 } from "ag-charts-community";
+import { isDefined } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/util/radialUtil.ts
+import { _ModuleSupport as _ModuleSupport113 } from "ag-charts-community";
+var { createDatumId: createDatumId15, mergeDefaults: mergeDefaults14, toHighlightString: toHighlightString4 } = _ModuleSupport113;
+function makeStylerParams(series, highlighted, highlightStateEnum) {
+ const { id: seriesId } = series;
+ const {
+ angleKey,
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ radiusKey,
+ stackGroup,
+ stroke,
+ strokeOpacity,
+ strokeWidth
+ } = series.properties;
+ const highlightState = toHighlightString4(highlightStateEnum ?? _ModuleSupport113.HighlightState.None);
+ return {
+ angleKey,
+ cornerRadius,
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ lineDash,
+ lineDashOffset,
+ radiusKey,
+ seriesId,
+ stackGroup,
+ stroke,
+ strokeOpacity,
+ strokeWidth
+ };
+}
+function getStyle(series, ignoreStylerCallback, highlighted, highlightState) {
+ const { styler } = series.properties;
+ let stylerResult = {};
+ if (!ignoreStylerCallback && styler) {
+ const stylerParams = makeStylerParams(series, highlighted, highlightState);
+ stylerResult = series.ctx.optionsGraphService.resolvePartial(
+ ["series", `${series.declarationOrder}`],
+ series.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ return {
+ cornerRadius: stylerResult.cornerRadius ?? series.properties.cornerRadius,
+ fill: stylerResult.fill ?? series.properties.fill,
+ fillOpacity: stylerResult.fillOpacity ?? series.properties.fillOpacity,
+ lineDash: stylerResult.lineDash ?? series.properties.lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? series.properties.lineDashOffset,
+ stroke: stylerResult.stroke ?? series.properties.stroke,
+ strokeOpacity: stylerResult.strokeOpacity ?? series.properties.strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? series.properties.strokeWidth,
+ opacity: 1
+ };
+}
+function makeItemStylerParams(series, nodeDatum, isHighlight, style) {
+ const { id: seriesId, properties } = series;
+ const { angleKey, radiusKey } = properties;
+ const activeHighlight = series.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = series.getHighlightStateString(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ const fill = series.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum: nodeDatum.datum,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ angleKey,
+ radiusKey,
+ ...style,
+ fill
+ };
+}
+function getItemStyle(series, nodeDatum, isHighlight, highlightState) {
+ const { properties } = series;
+ const { itemStyler } = properties;
+ const highlightStyle = series.getHighlightStyle(isHighlight, nodeDatum?.datumIndex, highlightState);
+ const baseStyle = mergeDefaults14(
+ highlightStyle,
+ getStyle(series, nodeDatum === void 0, isHighlight, highlightState)
+ );
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = series.cachedDatumCallback(
+ createDatumId15(series.getDatumId(nodeDatum), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = makeItemStylerParams(series, nodeDatum, isHighlight, style);
+ return series.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults14(overrides, style);
+ }
+ }
+ return style;
+}
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesBase.ts
+var {
+ DEFAULT_POLAR_DIRECTION_KEYS,
+ DEFAULT_POLAR_DIRECTION_NAMES,
+ ChartAxisDirection: ChartAxisDirection16,
+ PolarAxis,
+ diff: diff6,
+ fixNumericExtent: fixNumericExtent7,
+ groupAccumulativeValueProperty,
+ keyProperty: keyProperty8,
+ normaliseGroupTo,
+ resetLabelFn: resetLabelFn5,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation5,
+ seriesLabelFadeOutAnimation,
+ valueProperty: valueProperty12,
+ animationValidation: animationValidation7,
+ createDatumId: createDatumId16,
+ SeriesNodePickMode: SeriesNodePickMode12,
+ normalizeAngle360: normalizeAngle3605,
+ CategoryScale: CategoryScale3,
+ motion: motion6,
+ applyShapeStyle: applyShapeStyle13,
+ isGradientFill: isGradientFill2,
+ updateLabelNode: updateLabelNode6,
+ getItemStyles: getItemStyles3
+} = _ModuleSupport114;
+var RadialColumnSeriesNodeEvent = class extends _ModuleSupport114.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.angleKey = series.properties.angleKey;
+ this.radiusKey = series.properties.radiusKey;
+ }
+};
+var RadialColumnSeriesBase = class extends _ModuleSupport114.PolarSeries {
+ constructor(moduleCtx, {
+ animationResetFns
+ }) {
+ super({
+ moduleCtx,
+ categoryKey: "angleValue",
+ propertyKeys: DEFAULT_POLAR_DIRECTION_KEYS,
+ propertyNames: DEFAULT_POLAR_DIRECTION_NAMES,
+ canHaveAxes: true,
+ pickModes: [SeriesNodePickMode12.NEAREST_NODE, SeriesNodePickMode12.EXACT_SHAPE_MATCH],
+ animationResetFns: {
+ ...animationResetFns,
+ label: resetLabelFn5
+ }
+ });
+ this.NodeEvent = RadialColumnSeriesNodeEvent;
+ this.groupScale = new CategoryScale3();
+ this.circleCache = { r: 0, cx: 0, cy: 0 };
+ }
+ get hasData() {
+ return this.getHasData("radiusValue-raw");
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!processedData || !dataModel)
+ return [];
+ if (direction === ChartAxisDirection16.Angle) {
+ return dataModel.getDomain(this, "angleValue", "key", processedData);
+ } else {
+ const yExtent = dataModel.getDomain(this, "radiusValue-end", "value", processedData);
+ const fixedYExtent = Number.isFinite(yExtent[1] - yExtent[0]) ? [Math.min(yExtent[0], 0), Math.max(yExtent[1], 0)] : [];
+ return fixNumericExtent7(fixedYExtent);
+ }
+ }
+ async processData(dataController) {
+ const { angleKey, radiusKey, normalizedTo } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const stackGroupId = this.getStackId();
+ const stackGroupTrailingId = `${stackGroupId}-trailing`;
+ const extraProps = [];
+ if (isDefined(normalizedTo)) {
+ extraProps.push(normaliseGroupTo([stackGroupId, stackGroupTrailingId], Math.abs(normalizedTo)));
+ }
+ if (animationEnabled && this.processedData) {
+ extraProps.push(diff6(this.id, this.processedData));
+ }
+ if (animationEnabled) {
+ extraProps.push(animationValidation7());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const radiusScaleType = this.axes[ChartAxisDirection16.Radius]?.scale.type;
+ const angleScaleType = this.axes[ChartAxisDirection16.Angle]?.scale.type;
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty8(angleKey, angleScaleType, { id: "angleValue" }),
+ valueProperty12(radiusKey, radiusScaleType, {
+ id: "radiusValue-raw",
+ invalidValue: null,
+ ...visibleProps
+ }),
+ ...groupAccumulativeValueProperty(
+ radiusKey,
+ "normal",
+ {
+ id: `radiusValue-end`,
+ rangeId: `radiusValue-range`,
+ invalidValue: null,
+ groupId: stackGroupId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ radiusScaleType
+ ),
+ ...groupAccumulativeValueProperty(
+ radiusKey,
+ "trailing",
+ {
+ id: `radiusValue-start`,
+ invalidValue: null,
+ groupId: stackGroupTrailingId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ radiusScaleType
+ ),
+ ...extraProps
+ ],
+ groupByKeys: true,
+ groupByData: false
+ });
+ this.animationState.transition("updateData");
+ }
+ didCircleChange() {
+ const r = this.radius;
+ const cx = this.centerX;
+ const cy = this.centerY;
+ const cache = this.circleCache;
+ if (r !== cache.r || cx !== cache.cx || cy !== cache.cy) {
+ this.circleCache = { r, cx, cy };
+ return true;
+ }
+ return false;
+ }
+ isRadiusAxisReversed() {
+ return this.axes[ChartAxisDirection16.Radius]?.isReversed();
+ }
+ maybeRefreshNodeData() {
+ const circleChanged = this.didCircleChange();
+ if (!circleChanged && !this.nodeDataRefresh)
+ return;
+ this.contextNodeData = this.createNodeData();
+ this.nodeData = this.contextNodeData?.nodeData ?? [];
+ this.nodeDataRefresh = false;
+ }
+ getAxisInnerRadius() {
+ const radiusAxis = this.axes[ChartAxisDirection16.Radius];
+ return radiusAxis instanceof PolarAxis ? this.radius * radiusAxis.innerRadiusRatio : 0;
+ }
+ createNodeData() {
+ const { processedData, dataModel, groupScale } = this;
+ if (!dataModel || !processedData || processedData.type !== "grouped")
+ return;
+ const angleAxis = this.axes[ChartAxisDirection16.Angle];
+ const radiusAxis = this.axes[ChartAxisDirection16.Radius];
+ const angleScale = angleAxis?.scale;
+ const radiusScale = radiusAxis?.scale;
+ if (!angleScale || !radiusScale) {
+ return;
+ }
+ const angleValues = dataModel.resolveKeysById(this, `angleValue`, processedData);
+ const radiusStartValues = dataModel.resolveColumnById(this, `radiusValue-start`, processedData);
+ const radiusEndValues = dataModel.resolveColumnById(this, `radiusValue-end`, processedData);
+ const radiusRawValues = dataModel.resolveColumnById(this, `radiusValue-raw`, processedData);
+ const radiusRangeIndex = dataModel.resolveProcessedDataIndexById(this, `radiusValue-range`);
+ let groupPaddingInner = 0;
+ let groupPaddingOuter = 0;
+ if (angleAxis instanceof AngleCategoryAxis) {
+ groupPaddingInner = angleAxis.groupPaddingInner;
+ groupPaddingOuter = angleAxis.paddingInner;
+ }
+ const groupAngleStep = angleScale.bandwidth ?? 0;
+ const paddedGroupAngleStep = groupAngleStep * (1 - groupPaddingOuter);
+ const { index: groupIndex, visibleGroupCount } = this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);
+ groupScale.domain = Array.from({ length: visibleGroupCount }).map((_, i) => String(i));
+ groupScale.range = [-paddedGroupAngleStep / 2, paddedGroupAngleStep / 2];
+ groupScale.paddingInner = visibleGroupCount > 1 ? groupPaddingInner : 0;
+ const radiusAxisReversed = this.isRadiusAxisReversed();
+ const axisInnerRadius = radiusAxisReversed ? this.radius : this.getAxisInnerRadius();
+ const axisOuterRadius = radiusAxisReversed ? this.getAxisInnerRadius() : this.radius;
+ const axisTotalRadius = axisOuterRadius + axisInnerRadius;
+ const { angleKey, radiusKey, angleName, radiusName, legendItemName, label } = this.properties;
+ const radiusDomain = this.getSeriesDomain(ChartAxisDirection16.Radius);
+ const getLabelNodeDatum = (datum, radiusDatum, x, y) => {
+ const labelText = this.getLabelText(
+ radiusDatum,
+ datum,
+ radiusKey,
+ "radius",
+ radiusDomain,
+ label,
+ { value: radiusDatum, datum, angleKey, radiusKey, angleName, radiusName, legendItemName }
+ );
+ if (labelText) {
+ return { x, y, text: labelText, textAlign: "center", textBaseline: "middle" };
+ }
+ };
+ const nodeData = [];
+ const styles = getItemStyles3(
+ (nodeDatum, isHighlight, highlightState) => getItemStyle(this, nodeDatum, isHighlight, highlightState)
+ );
+ const context = {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles
+ };
+ if (!this.visible)
+ return context;
+ const { dataSources } = processedData;
+ const rawData = dataSources.get(this.id)?.data ?? [];
+ for (const { datumIndex, group } of dataModel.forEachGroupDatum(this, processedData)) {
+ const datum = rawData[datumIndex];
+ const angleDatum = angleValues[datumIndex];
+ if (angleDatum == null)
+ return;
+ const radiusDatum = radiusRawValues[datumIndex];
+ const isPositive = radiusDatum >= 0 && !Object.is(radiusDatum, -0);
+ const innerRadiusDatum = radiusStartValues[datumIndex];
+ const outerRadiusDatum = radiusEndValues[datumIndex];
+ const radiusRange = group.aggregation[radiusRangeIndex][isPositive ? 1 : 0] ?? 0;
+ const negative = isPositive === radiusAxisReversed;
+ if (innerRadiusDatum === void 0 || outerRadiusDatum === void 0)
+ return;
+ let startAngle;
+ let endAngle;
+ if (rawData.length === 1) {
+ startAngle = -0.5 * Math.PI;
+ endAngle = 1.5 * Math.PI;
+ } else {
+ const groupAngle = angleScale.convert(angleDatum);
+ startAngle = normalizeAngle3605(groupAngle + groupScale.convert(String(groupIndex)));
+ endAngle = normalizeAngle3605(startAngle + groupScale.bandwidth);
+ }
+ const angle = startAngle + groupScale.bandwidth / 2;
+ const innerRadius = axisTotalRadius - radiusScale.convert(innerRadiusDatum);
+ const outerRadius = axisTotalRadius - radiusScale.convert(outerRadiusDatum);
+ const midRadius = (innerRadius + outerRadius) / 2;
+ const stackInnerRadius = axisTotalRadius - radiusScale.convert(0);
+ const stackOuterRadius = axisTotalRadius - radiusScale.convert(radiusRange);
+ const x = Math.cos(angle) * midRadius;
+ const y = Math.sin(angle) * midRadius;
+ const labelNodeDatum = this.properties.label.enabled ? getLabelNodeDatum(datum, radiusDatum, x, y) : void 0;
+ const columnWidth = this.getColumnWidth(startAngle, endAngle);
+ nodeData.push({
+ series: this,
+ datum,
+ datumIndex,
+ point: { x, y, size: 0 },
+ midPoint: { x, y },
+ label: labelNodeDatum,
+ angleValue: angleDatum,
+ radiusValue: radiusDatum,
+ negative,
+ innerRadius,
+ outerRadius,
+ stackInnerRadius,
+ stackOuterRadius,
+ startAngle,
+ endAngle,
+ midAngle: angle,
+ axisInnerRadius,
+ axisOuterRadius,
+ columnWidth,
+ index: datumIndex
+ });
+ }
+ return {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles
+ };
+ }
+ getColumnWidth(_startAngle, _endAngle) {
+ return Number.NaN;
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ this.maybeRefreshNodeData();
+ this.contentGroup.translationX = this.centerX;
+ this.contentGroup.translationY = this.centerY;
+ this.highlightGroup.translationX = this.centerX;
+ this.highlightGroup.translationY = this.centerY;
+ if (this.labelGroup) {
+ this.labelGroup.translationX = this.centerX;
+ this.labelGroup.translationY = this.centerY;
+ }
+ this.updateSectorSelection(this.itemSelection, false);
+ this.updateSectorSelection(this.highlightSelection, true);
+ this.updateLabels();
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateSectorSelection(selection, isHighlight) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ let selectionData = [];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ if (isHighlight) {
+ if (activeHighlight?.datum && activeHighlight.series === this) {
+ selectionData.push(activeHighlight);
+ }
+ } else {
+ selectionData = this.nodeData;
+ }
+ const radiusAxisReversed = this.isRadiusAxisReversed();
+ const axisInnerRadius = radiusAxisReversed ? this.radius : this.getAxisInnerRadius();
+ const axisOuterRadius = radiusAxisReversed ? this.getAxisInnerRadius() : this.radius;
+ const fillBBox = this.getShapeFillBBox();
+ const hasItemStylers = this.hasItemStylers();
+ selection.update(selectionData, void 0, (datum) => this.getDatumId(datum)).each((node, nodeDatum) => {
+ const { midPoint } = nodeDatum;
+ if (hasItemStylers) {
+ const highlightState = this.getHighlightState(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ nodeDatum.style = getItemStyle(this, nodeDatum, isHighlight, highlightState);
+ }
+ const style = nodeDatum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex)];
+ const fill = style.fill;
+ const itemBounds = isGradientFill2(fill) && fill.bounds === "item";
+ const fillParams = itemBounds ? { centerX: midPoint?.x ?? 0, centerY: midPoint?.y ?? 0 } : { centerX: 0, centerY: 0, innerRadius: axisInnerRadius, outerRadius: axisOuterRadius };
+ this.updateItemPath(node, nodeDatum, isHighlight);
+ applyShapeStyle13(node, style, fillBBox, fillParams);
+ node.cornerRadius = style.cornerRadius ?? 0;
+ node.lineJoin = "round";
+ });
+ }
+ updateLabels() {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ this.labelSelection.update(this.nodeData).each((node, datum) => {
+ updateLabelNode6(this, node, this.properties, this.properties.label, datum.label, false, activeHighlight);
+ node.fillOpacity = this.getHighlightStyle(false, datum.datumIndex).opacity ?? 1;
+ });
+ }
+ animateEmptyUpdateReady() {
+ const { labelSelection } = this;
+ const fns = this.getColumnTransitionFunctions();
+ motion6.fromToMotion(this.id, "datums", this.ctx.animationManager, [this.itemSelection], fns);
+ seriesLabelFadeInAnimation5(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateClearingUpdateEmpty() {
+ const { itemSelection } = this;
+ const { animationManager } = this.ctx;
+ const fns = this.getColumnTransitionFunctions();
+ motion6.fromToMotion(this.id, "datums", animationManager, [itemSelection], fns);
+ seriesLabelFadeOutAnimation(this, "labels", animationManager, this.labelSelection);
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { angleKey, angleName, radiusKey, radiusName, legendItemName, tooltip } = properties;
+ const angleAxis = axes[ChartAxisDirection16.Angle];
+ const radiusAxis = axes[ChartAxisDirection16.Radius];
+ const nodeDatum = this.nodeData?.[datumIndex];
+ if (!dataModel || !processedData || !angleAxis || !radiusAxis || !nodeDatum)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const angleValue = dataModel.resolveKeysById(this, `angleValue`, processedData)[datumIndex];
+ const radiusValue = dataModel.resolveColumnById(this, `radiusValue-raw`, processedData)[datumIndex];
+ if (angleValue == null)
+ return;
+ const format = getItemStyle(this, nodeDatum, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(angleAxis, "tooltip", angleValue, datum, angleKey, void 0),
+ symbol: this.legendItemSymbol(),
+ data: [
+ {
+ label: radiusName,
+ fallbackLabel: radiusKey,
+ value: this.getAxisValueText(radiusAxis, "tooltip", radiusValue, datum, radiusKey, void 0)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: angleName,
+ angleKey,
+ angleName,
+ radiusKey,
+ radiusName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return this.pickNodeNearestDistantObject(point, this.itemSelection.nodes());
+ }
+ legendItemSymbol() {
+ const { fill, stroke, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = getStyle(
+ this,
+ false,
+ false,
+ _ModuleSupport114.HighlightState.None
+ );
+ const markerStyle = {
+ fill: fill ?? "rgba(0, 0, 0, 0)",
+ stroke: stroke ?? "rgba(0, 0, 0, 0)",
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ if (_ModuleSupport114.isGradientFill(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ return {
+ marker: markerStyle
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { radiusKey, radiusName, legendItemName, showInLegend } = this.properties;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: radiusKey,
+ seriesId,
+ enabled: visible,
+ label: {
+ text: legendItemName ?? radiusName ?? radiusKey
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ getDatumId(datum) {
+ return createDatumId16(datum.angleValue);
+ }
+ computeLabelsBBox() {
+ return null;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesBaseProperties.ts
+import { _ModuleSupport as _ModuleSupport115 } from "ag-charts-community";
+var { SeriesProperties: SeriesProperties8, makeSeriesTooltip: makeSeriesTooltip17, Property: Property30, Label: Label10 } = _ModuleSupport115;
+var RadialColumnSeriesBaseProperties = class extends SeriesProperties8 {
+ constructor() {
+ super(...arguments);
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.rotation = 0;
+ this.label = new Label10();
+ this.tooltip = makeSeriesTooltip17();
+ }
+ getStyle() {
+ const { fill, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset, cornerRadius } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "angleKey", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "angleName", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "radiusKey", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "radiusName", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "fill", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "styler", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "stackGroup", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "normalizedTo", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "label", 2);
+__decorateClass([
+ Property30
+], RadialColumnSeriesBaseProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleUtil.ts
+import { _ModuleSupport as _ModuleSupport117 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnUtil.ts
+import { _ModuleSupport as _ModuleSupport116 } from "ag-charts-community";
+var { motion: motion7 } = _ModuleSupport116;
+function createAngleMotionCalculator() {
+ const angles = {
+ startAngle: /* @__PURE__ */ new Map(),
+ endAngle: /* @__PURE__ */ new Map()
+ };
+ const angleKeys = ["startAngle", "endAngle"];
+ const calculate = (node, datum, status) => {
+ for (const key of angleKeys) {
+ const map = angles[key];
+ let from2 = (status === "removed" || status === "updated" ? node : datum)[key];
+ let to2 = (status === "removed" ? node : datum)[key];
+ if (Number.isNaN(to2)) {
+ to2 = node.previousDatum?.[key] ?? Number.NaN;
+ }
+ const diff8 = from2 - to2;
+ if (Math.abs(diff8) > Math.PI) {
+ from2 -= Math.sign(diff8) * 2 * Math.PI;
+ }
+ map.set(datum, { from: from2, to: to2 });
+ }
+ };
+ const getAngles = (datum, fromToKey) => {
+ return {
+ startAngle: angles.startAngle.get(datum)[fromToKey],
+ endAngle: angles.endAngle.get(datum)[fromToKey]
+ };
+ };
+ const from = (datum) => getAngles(datum, "from");
+ const to = (datum) => getAngles(datum, "to");
+ return { calculate, from, to };
+}
+function fixRadialColumnAnimationStatus(node, datum, status) {
+ if (status === "updated") {
+ if (node.previousDatum == null || Number.isNaN(node.previousDatum.startAngle) || Number.isNaN(node.previousDatum.endAngle)) {
+ return "added";
+ }
+ if (Number.isNaN(datum.startAngle) || Number.isNaN(datum.endAngle)) {
+ return "removed";
+ }
+ }
+ if (status === "added" && node.previousDatum != null) {
+ return "updated";
+ }
+ return status;
+}
+function prepareRadialColumnAnimationFunctions(axisZeroRadius) {
+ const angles = createAngleMotionCalculator();
+ const fromFn = (node, datum, status) => {
+ status = fixRadialColumnAnimationStatus(node, datum, status);
+ angles.calculate(node, datum, status);
+ const { startAngle, endAngle } = angles.from(datum);
+ let innerRadius;
+ let outerRadius;
+ let columnWidth;
+ let axisInnerRadius;
+ let axisOuterRadius;
+ if (status === "removed" || status === "updated") {
+ innerRadius = node.innerRadius;
+ outerRadius = node.outerRadius;
+ columnWidth = node.columnWidth;
+ axisInnerRadius = node.axisInnerRadius;
+ axisOuterRadius = node.axisOuterRadius;
+ } else {
+ innerRadius = axisZeroRadius;
+ outerRadius = axisZeroRadius;
+ columnWidth = datum.columnWidth;
+ axisInnerRadius = datum.axisInnerRadius;
+ axisOuterRadius = datum.axisOuterRadius;
+ }
+ const phase = motion7.NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return {
+ innerRadius,
+ outerRadius,
+ columnWidth,
+ axisInnerRadius,
+ axisOuterRadius,
+ startAngle,
+ endAngle,
+ phase
+ };
+ };
+ const toFn = (node, datum, status) => {
+ const { startAngle, endAngle } = angles.to(datum);
+ let innerRadius;
+ let outerRadius;
+ let columnWidth;
+ let axisInnerRadius;
+ let axisOuterRadius;
+ if (status === "removed") {
+ innerRadius = node.innerRadius;
+ outerRadius = node.innerRadius;
+ columnWidth = node.columnWidth;
+ axisInnerRadius = node.axisInnerRadius;
+ axisOuterRadius = node.axisOuterRadius;
+ } else {
+ innerRadius = Number.isNaN(datum.innerRadius) ? axisZeroRadius : datum.innerRadius;
+ outerRadius = Number.isNaN(datum.outerRadius) ? axisZeroRadius : datum.outerRadius;
+ columnWidth = Number.isNaN(datum.columnWidth) ? node.columnWidth : datum.columnWidth;
+ axisInnerRadius = datum.axisInnerRadius;
+ axisOuterRadius = datum.axisOuterRadius;
+ }
+ return { innerRadius, outerRadius, columnWidth, axisInnerRadius, axisOuterRadius, startAngle, endAngle };
+ };
+ return { toFn, fromFn };
+}
+function resetRadialColumnSelectionFn(_node, {
+ innerRadius,
+ outerRadius,
+ columnWidth,
+ axisInnerRadius,
+ axisOuterRadius,
+ startAngle,
+ endAngle
+}) {
+ return { innerRadius, outerRadius, columnWidth, axisInnerRadius, axisOuterRadius, startAngle, endAngle };
+}
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleUtil.ts
+var { SectorBox, motion: motion8 } = _ModuleSupport117;
+function getRadii(datum) {
+ const { negative, innerRadius, outerRadius, stackInnerRadius, stackOuterRadius } = datum;
+ return {
+ innerRadius: negative ? stackOuterRadius : stackInnerRadius,
+ outerRadius: negative ? stackInnerRadius : stackOuterRadius,
+ clipInnerRadius: negative ? outerRadius : innerRadius,
+ clipOuterRadius: negative ? innerRadius : outerRadius
+ };
+}
+function prepareNightingaleAnimationFunctions(axisZeroRadius) {
+ const angles = createAngleMotionCalculator();
+ const fromFn = (sect, datum, status) => {
+ status = fixRadialColumnAnimationStatus(sect, datum, status);
+ angles.calculate(sect, datum, status);
+ const { startAngle, endAngle } = angles.from(datum);
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed" || status === "updated") {
+ innerRadius = sect.innerRadius;
+ outerRadius = sect.outerRadius;
+ clipSector = sect.clipSector;
+ } else {
+ innerRadius = axisZeroRadius;
+ outerRadius = axisZeroRadius;
+ }
+ clipSector ?? (clipSector = new SectorBox(startAngle, endAngle, innerRadius, outerRadius));
+ const phase = motion8.NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return { innerRadius, outerRadius, startAngle, endAngle, clipSector, phase };
+ };
+ const toFn = (_sect, datum, status) => {
+ const { startAngle, endAngle } = angles.to(datum);
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed") {
+ innerRadius = axisZeroRadius;
+ outerRadius = axisZeroRadius;
+ clipSector = new SectorBox(startAngle, endAngle, innerRadius, outerRadius);
+ } else {
+ let clipInnerRadius, clipOuterRadius;
+ ({ innerRadius, outerRadius, clipInnerRadius, clipOuterRadius } = getRadii(datum));
+ if (Number.isNaN(innerRadius))
+ innerRadius = axisZeroRadius;
+ if (Number.isNaN(outerRadius))
+ outerRadius = axisZeroRadius;
+ if (Number.isNaN(clipInnerRadius))
+ clipInnerRadius = axisZeroRadius;
+ if (Number.isNaN(clipOuterRadius))
+ clipOuterRadius = axisZeroRadius;
+ clipSector = new SectorBox(startAngle, endAngle, clipInnerRadius, clipOuterRadius);
+ }
+ return { innerRadius, outerRadius, startAngle, endAngle, clipSector };
+ };
+ return { toFn, fromFn };
+}
+function resetNightingaleSelectionFn(_sect, datum) {
+ const { startAngle, endAngle } = datum;
+ const { innerRadius, outerRadius, clipInnerRadius, clipOuterRadius } = getRadii(datum);
+ const clipSector = new SectorBox(startAngle, endAngle, clipInnerRadius, clipOuterRadius);
+ return { innerRadius, outerRadius, startAngle, endAngle, clipSector };
+}
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleSeries.ts
+var { Sector: Sector4, SectorBox: SectorBox2, PolarZIndexMap } = _ModuleSupport118;
+var NightingaleSeries = class extends RadialColumnSeriesBase {
+ // TODO: Enable once the options contract has been revisited
+ // @TempValidate
+ // sectorSpacing = 1;
+ constructor(moduleCtx) {
+ super(moduleCtx, { animationResetFns: { item: resetNightingaleSelectionFn } });
+ this.properties = new RadialColumnSeriesBaseProperties();
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [0, PolarZIndexMap.FOREGROUND, zIndex];
+ this.highlightGroup.zIndex = [0, PolarZIndexMap.HIGHLIGHT, zIndex];
+ this.labelGroup.zIndex = [0, PolarZIndexMap.LABEL, zIndex];
+ return true;
+ }
+ getStackId() {
+ const groupIndex = this.seriesGrouping?.groupIndex ?? this.id;
+ return `nightingale-stack-${groupIndex}-yValues`;
+ }
+ nodeFactory() {
+ return new Sector4();
+ }
+ updateItemPath(node, datum, highlight) {
+ const { negative } = datum;
+ node.centerX = 0;
+ node.centerY = 0;
+ node.startOuterCornerRadius = negative ? 0 : this.properties.cornerRadius;
+ node.endOuterCornerRadius = negative ? 0 : this.properties.cornerRadius;
+ node.startInnerCornerRadius = negative ? this.properties.cornerRadius : 0;
+ node.endInnerCornerRadius = negative ? this.properties.cornerRadius : 0;
+ if (highlight) {
+ const { startAngle, endAngle } = datum;
+ const { innerRadius, outerRadius, clipInnerRadius, clipOuterRadius } = getRadii(datum);
+ node.innerRadius = innerRadius;
+ node.outerRadius = outerRadius;
+ node.startAngle = startAngle;
+ node.endAngle = endAngle;
+ node.clipSector = new SectorBox2(startAngle, endAngle, clipInnerRadius, clipOuterRadius);
+ }
+ }
+ getColumnTransitionFunctions() {
+ const axisZeroRadius = this.isRadiusAxisReversed() ? this.radius : this.getAxisInnerRadius();
+ return prepareNightingaleAnimationFunctions(axisZeroRadius);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null || this.properties.label.itemStyler != null;
+ }
+};
+NightingaleSeries.className = "NightingaleSeries";
+NightingaleSeries.type = "nightingale";
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport119 } from "ag-charts-community";
+import { boolean as boolean8, constant as constant17, number as number7, required as required17, string as string15 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs15, nightingaleSeriesThemeableOptionsDef } = _ModuleSupport119;
+var nightingaleSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs15,
+ ...nightingaleSeriesThemeableOptionsDef,
+ type: required17(constant17("nightingale")),
+ angleKey: required17(string15),
+ radiusKey: required17(string15),
+ angleName: string15,
+ radiusName: string15,
+ legendItemName: string15,
+ grouped: boolean8,
+ stacked: boolean8,
+ stackGroup: string15,
+ normalizedTo: number7
+};
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleThemes.ts
+import { _ModuleSupport as _ModuleSupport120 } from "ag-charts-community";
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE, POLAR_AXIS_SHAPE },
+ FILL_GRADIENT_RADIAL_SERIES_DEFAULTS,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS4,
+ FILL_PATTERN_DEFAULTS: FILL_PATTERN_DEFAULTS2
+} = _ModuleSupport120;
+var NIGHTINGALE_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", FILL_GRADIENT_RADIAL_SERIES_DEFAULTS],
+ ["image", FILL_IMAGE_DEFAULTS4],
+ ["pattern", FILL_PATTERN_DEFAULTS2]
+ ]
+ },
+ stroke: {
+ $if: [{ $eq: [{ $palette: "type" }, "inbuilt"] }, { $ref: "chartBackgroundColor" }, { $palette: "stroke" }]
+ },
+ strokeWidth: 1,
+ label: {
+ ..._ModuleSupport120.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: _ModuleSupport120.multiSeriesHighlightStyle()
+ },
+ axes: {
+ [POLAR_AXIS_TYPE.ANGLE_CATEGORY]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE.CIRCLE },
+ groupPaddingInner: 0,
+ paddingInner: 0,
+ label: {
+ spacing: 10
+ }
+ },
+ [POLAR_AXIS_TYPE.RADIUS_NUMBER]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE.CIRCLE }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleModule.ts
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE2 }
+} = _ModuleSupport121;
+var NightingaleModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "nightingale",
+ moduleFactory: (ctx) => new NightingaleSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE2.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE2.RADIUS_NUMBER }],
+ themeTemplate: NIGHTINGALE_SERIES_THEME,
+ stackable: true,
+ groupable: true,
+ stackedByDefault: true
+};
+var NightingaleSeriesModule = {
+ type: "series",
+ name: "nightingale",
+ chartType: "polar",
+ enterprise: true,
+ options: nightingaleSeriesOptionsDef,
+ create: (ctx) => new NightingaleSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport123
+} from "ag-charts-community";
+import {
+ cachedTextMeasurer as cachedTextMeasurer8,
+ isArray as isArray5,
+ measureTextSegments as measureTextSegments4,
+ toPlainText as toPlainText5
+} from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidProperties.ts
+import { _ModuleSupport as _ModuleSupport122 } from "ag-charts-community";
+var { SeriesProperties: SeriesProperties9, makeSeriesTooltip: makeSeriesTooltip18, Property: Property31, Label: Label11, DropShadow: DropShadow5 } = _ModuleSupport122;
+var PyramidSeriesLabel = class extends Label11 {
+};
+var PyramidSeriesStageLabel = class extends Label11 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property31
+], PyramidSeriesStageLabel.prototype, "spacing", 2);
+__decorateClass([
+ Property31
+], PyramidSeriesStageLabel.prototype, "placement", 2);
+var PyramidProperties = class extends SeriesProperties9 {
+ constructor() {
+ super(...arguments);
+ this.fills = [];
+ this.fillOpacity = 1;
+ this.strokes = [];
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.direction = "vertical";
+ this.reverse = void 0;
+ this.spacing = 0;
+ this.aspectRatio = void 0;
+ this.shadow = new DropShadow5().set({ enabled: false });
+ this.label = new PyramidSeriesLabel();
+ this.stageLabel = new PyramidSeriesStageLabel();
+ this.tooltip = makeSeriesTooltip18();
+ }
+ getStyle(index = 0) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill: fills[index % fills.length],
+ fillOpacity,
+ stroke: strokes[index % strokes.length],
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "stageKey", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "valueKey", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "fills", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "direction", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "reverse", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "aspectRatio", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "label", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "stageLabel", 2);
+__decorateClass([
+ Property31
+], PyramidProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidUtil.ts
+function applyPyramidDatum(connector, { x, y, top, right, bottom, left }) {
+ connector.x0 = x - top / 2;
+ connector.x1 = x + top / 2;
+ connector.x2 = x + bottom / 2;
+ connector.x3 = x - bottom / 2;
+ connector.y0 = y - left / 2;
+ connector.y1 = y - right / 2;
+ connector.y2 = y + right / 2;
+ connector.y3 = y + left / 2;
+}
+function preparePyramidAnimationFunctions(direction) {
+ const fromFn = (_connector, datum) => {
+ const { x, y } = datum;
+ let { top, right, bottom, left } = datum;
+ if (direction === "vertical") {
+ top = 0;
+ bottom = 0;
+ } else {
+ left = 0;
+ right = 0;
+ }
+ return { x, y, top, right, bottom, left };
+ };
+ const toFn = (_connector, datum) => {
+ const { x, y, top, right, bottom, left } = datum;
+ return { x, y, top, right, bottom, left };
+ };
+ const applyFn = applyPyramidDatum;
+ return { fromFn, toFn, applyFn };
+}
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidSeries.ts
+var {
+ StateMachine: StateMachine3,
+ valueProperty: valueProperty13,
+ SeriesNodePickMode: SeriesNodePickMode13,
+ createDatumId: createDatumId17,
+ BBox: BBox12,
+ Group: Group12,
+ Selection: Selection11,
+ Text: Text5,
+ PointerEvents: PointerEvents9,
+ applyShapeStyle: applyShapeStyle14,
+ mergeDefaults: mergeDefaults15,
+ fromToMotion: fromToMotion4,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation6,
+ getLabelStyles: getLabelStyles5
+} = _ModuleSupport123;
+var PyramidSeries = class extends _ModuleSupport123.DataModelSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ pickModes: [SeriesNodePickMode13.EXACT_SHAPE_MATCH, SeriesNodePickMode13.NEAREST_NODE]
+ });
+ this.properties = new PyramidProperties();
+ this.itemGroup = this.contentGroup.appendChild(new Group12({ name: "itemGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group12({ name: "itemLabelGroup" }));
+ this.stageLabelGroup = this.contentGroup.appendChild(new Group12({ name: "stageLabelGroup" }));
+ this.datumSelection = Selection11.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.labelSelection = Selection11.select(
+ this.itemLabelGroup,
+ Text5
+ );
+ this.stageLabelSelection = Selection11.select(this.stageLabelGroup, Text5);
+ this.highlightDatumSelection = Selection11.select(
+ this.highlightGroup,
+ () => this.nodeFactory()
+ );
+ this.animationState = new StateMachine3(
+ "empty",
+ {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateEmptyUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ clear: "empty",
+ reset: "empty",
+ skip: "ready"
+ }
+ },
+ () => this.checkProcessedDataAnimatable()
+ );
+ this.itemLabelGroup.pointerEvents = PointerEvents9.None;
+ this.stageLabelGroup.pointerEvents = PointerEvents9.None;
+ }
+ addChartEventListeners() {
+ this.cleanup.register(this.ctx.eventsHub.on("legend:item-click", (event) => this.onLegendItemClick(event)));
+ }
+ nodeFactory() {
+ return new FunnelConnector();
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const {
+ id: seriesId,
+ visible,
+ ctx: { legendManager }
+ } = this;
+ const { stageKey, valueKey } = this.properties;
+ const xScaleType = "category";
+ const yScaleType = "number";
+ const validation = (_value, _datum, index) => visible && legendManager.getItemEnabled({ seriesId, itemId: index });
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ valueProperty13(stageKey, xScaleType, { id: "xValue" }),
+ valueProperty13(valueKey, yScaleType, { id: `yValue`, ...visibleProps, validation, invalidValue: 0 })
+ ]
+ });
+ }
+ createNodeData() {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ visible,
+ ctx: { legendManager }
+ } = this;
+ const {
+ stageKey,
+ valueKey,
+ direction,
+ reverse = direction === "horizontal",
+ spacing,
+ aspectRatio,
+ label,
+ stageLabel
+ } = properties;
+ if (dataModel == null || processedData == null)
+ return;
+ const horizontal = direction === "horizontal";
+ const xValues = dataModel.resolveColumnById(this, `xValue`, processedData);
+ const yValues = dataModel.resolveColumnById(this, `yValue`, processedData);
+ const xDomain = dataModel.getDomain(this, "xValue", "value", processedData);
+ const yDomain = dataModel.getDomain(this, "yValue", "value", processedData);
+ const textMeasurer = cachedTextMeasurer8(stageLabel);
+ let textAlign;
+ let textBaseline;
+ if (horizontal) {
+ textAlign = "center";
+ textBaseline = stageLabel.placement === "before" ? "bottom" : "top";
+ } else {
+ textAlign = stageLabel.placement === "after" ? "left" : "right";
+ textBaseline = "middle";
+ }
+ const stageLabelData = stageLabel.enabled ? [] : void 0;
+ let maxLabelWidth = 0;
+ let maxLabelHeight = 0;
+ let yTotal = 0;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xValue2 = xValues[datumIndex];
+ const yValue = yValues[datumIndex];
+ const enabled = visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex });
+ yTotal += yValue;
+ if (stageLabelData == null)
+ continue;
+ const text = this.getLabelText(
+ xValue2,
+ datum,
+ stageKey,
+ "x",
+ xDomain,
+ this.properties.stageLabel,
+ { datum, value: yValue, stageKey, valueKey }
+ );
+ const { width, height } = isArray5(text) ? measureTextSegments4(text, label) : textMeasurer.measureLines(text);
+ maxLabelWidth = Math.max(maxLabelWidth, width);
+ maxLabelHeight = Math.max(maxLabelHeight, height);
+ stageLabelData.push({
+ x: Number.NaN,
+ y: Number.NaN,
+ text,
+ textAlign,
+ textBaseline,
+ visible: enabled
+ });
+ }
+ const seriesRectWidth = this._nodeDataDependencies?.seriesRectWidth ?? 0;
+ const seriesRectHeight = this._nodeDataDependencies?.seriesRectHeight ?? 0;
+ const totalSpacing = spacing * (processedData.input.count - 1);
+ let bounds;
+ if (horizontal) {
+ const verticalInset = maxLabelHeight + stageLabel.spacing;
+ bounds = new BBox12(
+ 0,
+ stageLabel.placement === "before" ? verticalInset : 0,
+ seriesRectWidth,
+ seriesRectHeight - verticalInset
+ );
+ } else {
+ const horizontalInset = maxLabelWidth + stageLabel.spacing;
+ bounds = new BBox12(
+ stageLabel.placement === "after" ? 0 : horizontalInset,
+ 0,
+ seriesRectWidth - horizontalInset,
+ seriesRectHeight
+ );
+ }
+ if (aspectRatio != null && aspectRatio !== 0) {
+ const directionalAspectRatio = direction === "horizontal" ? 1 / aspectRatio : aspectRatio;
+ const constrainedWidth = Math.min(bounds.width, bounds.height * directionalAspectRatio);
+ const constrainedHeight = constrainedWidth / directionalAspectRatio;
+ bounds = new BBox12(
+ bounds.x + (bounds.width - constrainedWidth) / 2,
+ bounds.y + (bounds.height - constrainedHeight) / 2,
+ constrainedWidth,
+ constrainedHeight
+ );
+ }
+ let labelX;
+ let labelY;
+ if (horizontal) {
+ labelY = stageLabel.placement === "before" ? bounds.y - stageLabel.spacing : bounds.y + bounds.height + stageLabel.spacing;
+ } else {
+ labelX = stageLabel.placement === "after" ? bounds.x + bounds.width + stageLabel.spacing : bounds.x - stageLabel.spacing;
+ }
+ const availableWidth = bounds.width - (horizontal ? totalSpacing : 0);
+ const availableHeight = bounds.height - (horizontal ? 0 : totalSpacing);
+ if (availableWidth < 0 || availableHeight < 0)
+ return;
+ const nodeData = [];
+ const labelData = [];
+ let yStart = 0;
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xValue2 = xValues[datumIndex];
+ const yValue = yValues[datumIndex];
+ const enabled = visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex });
+ const yEnd = yStart + yValue;
+ const yMidRatio = (yStart + yEnd) / (2 * yTotal);
+ const yRangeRatio = (yEnd - yStart) / yTotal;
+ const xOffset = horizontal ? availableWidth * yMidRatio + spacing * datumIndex : availableWidth * 0.5;
+ const yOffset = horizontal ? availableHeight * 0.5 : availableHeight * yMidRatio + spacing * datumIndex;
+ const x = bounds.x + xOffset;
+ const y = bounds.y + yOffset;
+ if (stageLabelData != null) {
+ const stageLabelDatum = stageLabelData[datumIndex];
+ stageLabelDatum.x = labelX ?? x;
+ stageLabelDatum.y = labelY ?? y;
+ }
+ let top;
+ let right;
+ let bottom;
+ let left;
+ if (horizontal) {
+ const barWidth = availableWidth * yRangeRatio;
+ top = barWidth;
+ bottom = barWidth;
+ const y0 = (xOffset + barWidth / 2) * (availableHeight / bounds.width);
+ const y1 = (xOffset - barWidth / 2) * (availableHeight / bounds.width);
+ right = reverse ? bounds.height - y0 : y0;
+ left = reverse ? bounds.height - y1 : y1;
+ } else {
+ const barHeight = availableHeight * yRangeRatio;
+ right = barHeight;
+ left = barHeight;
+ const x0 = (yOffset - barHeight / 2) * (availableWidth / bounds.height);
+ const x1 = (yOffset + barHeight / 2) * (availableWidth / bounds.height);
+ top = reverse ? bounds.width - x0 : x0;
+ bottom = reverse ? bounds.width - x1 : x1;
+ }
+ const text = this.getLabelText(
+ yValue,
+ datum,
+ valueKey,
+ "y",
+ yDomain,
+ label,
+ {
+ datum,
+ value: yValue,
+ stageKey,
+ valueKey
+ }
+ );
+ const labelDatum = {
+ x,
+ y,
+ text,
+ textAlign: "center",
+ textBaseline: "middle",
+ visible: enabled
+ };
+ labelData.push(labelDatum);
+ nodeData.push({
+ series: this,
+ itemId: valueKey,
+ datum,
+ datumIndex,
+ index: datumIndex,
+ xValue: xValue2,
+ yValue,
+ x,
+ y,
+ top,
+ right,
+ bottom,
+ left,
+ label: labelDatum,
+ enabled,
+ midPoint: {
+ x,
+ y
+ },
+ style: this.getItemStyle({ datumIndex, datum }, false)
+ });
+ yStart = yEnd;
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData,
+ stageLabelData,
+ bounds
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update({ seriesRect }) {
+ this.checkResize(seriesRect);
+ const { datumSelection, labelSelection, stageLabelSelection, highlightDatumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = this.getOpacity();
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ if (highlightedDatum != null && (highlightedDatum.series !== this || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ const stageLabelData = this.contextNodeData?.stageLabelData ?? [];
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumStyles({ datumSelection, isHighlight: false });
+ this.updateDatumNodes({ datumSelection, isHighlight: false });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection, labelProperties: this.properties.label });
+ this.stageLabelSelection = this.updateStageLabelSelection({ stageLabelData, stageLabelSelection });
+ this.updateLabelNodes({
+ labelSelection: stageLabelSelection,
+ labelProperties: this.properties.stageLabel
+ });
+ this.highlightDatumSelection = this.updateDatumSelection({
+ nodeData: highlightedDatum == null ? [] : [highlightedDatum],
+ datumSelection: highlightDatumSelection
+ });
+ this.updateDatumStyles({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.updateDatumNodes({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.animationState.transition("update");
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData);
+ }
+ getItemStyle({ datumIndex, datum }, isHighlight) {
+ const { properties } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults15(highlightStyle, properties.getStyle(datumIndex));
+ let style = baseStyle;
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId17(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults15(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId, properties } = this;
+ const { stageKey, valueKey } = properties;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ stageKey,
+ valueKey,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ const { properties } = this;
+ const { shadow } = properties;
+ const bounds = this.contextNodeData?.bounds;
+ const fillBBox = bounds ? { series: bounds, axis: bounds } : void 0;
+ datumSelection.each((connector, nodeDatum) => {
+ applyShapeStyle14(connector, nodeDatum.style, fillBBox);
+ applyPyramidDatum(connector, nodeDatum);
+ connector.fillShadow = shadow;
+ });
+ }
+ updateLabelSelection(opts) {
+ return opts.labelSelection.update(this.properties.label.enabled ? opts.labelData : []);
+ }
+ updateStageLabelSelection(opts) {
+ return opts.stageLabelSelection.update(opts.stageLabelData);
+ }
+ updateLabelNodes(opts) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, nodeDatum, datumIndex) => {
+ const { visible, x, y, text, textAlign, textBaseline } = nodeDatum;
+ const style = getLabelStyles5(
+ this,
+ void 0,
+ this.properties,
+ opts.labelProperties,
+ false,
+ activeHighlight
+ );
+ const { color: fill, fontSize, fontStyle, fontWeight, fontFamily } = style;
+ label.visible = visible;
+ label.x = x;
+ label.y = y;
+ label.text = text;
+ label.fill = fill;
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = textBaseline;
+ label.setBoxing(style);
+ });
+ }
+ computeFocusBounds(opts) {
+ const datum = this.getNodeData()?.[opts.datumIndex];
+ if (datum === void 0)
+ return;
+ for (const node of this.datumSelection) {
+ if (node.datum === datum) {
+ return node.node;
+ }
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { stageKey, valueKey, tooltip } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveColumnById(this, "xValue", processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const label = this.getLabelText(
+ xValue2,
+ datum,
+ stageKey,
+ "x",
+ dataModel.getDomain(this, "xValue", "value", processedData),
+ this.properties.stageLabel,
+ { datum, value: xValue2, stageKey, valueKey }
+ );
+ const value = this.getLabelText(
+ yValue,
+ datum,
+ valueKey,
+ "y",
+ dataModel.getDomain(this, "yValue", "value", processedData),
+ this.properties.stageLabel,
+ { datum, value: yValue, stageKey, valueKey }
+ );
+ const format = this.getItemStyle({ datumIndex, datum }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ symbol: this.legendItemSymbol(datumIndex),
+ data: [{ label: toPlainText5(label), value: toPlainText5(value) }]
+ },
+ {
+ seriesId,
+ datum,
+ title: void 0,
+ stageKey,
+ valueKey,
+ ...format
+ }
+ );
+ }
+ getSeriesDomain() {
+ return [Number.NaN, Number.NaN];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.datumSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ legendItemSymbol(datumIndex) {
+ const { fills, strokes, strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset } = this.properties;
+ const fill = fills[datumIndex] ?? "black";
+ const stroke = strokes[datumIndex] ?? "black";
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ processedData,
+ dataModel,
+ id: seriesId,
+ ctx: { legendManager },
+ visible
+ } = this;
+ if (!dataModel || !processedData || legendType !== "category") {
+ return [];
+ }
+ const { showInLegend } = this.properties;
+ const legendData = [];
+ const stageValues = dataModel.resolveColumnById(this, `xValue`, processedData);
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex] of rawData.entries()) {
+ const stageValue = stageValues[datumIndex];
+ legendData.push({
+ legendType: "category",
+ id: seriesId,
+ itemId: datumIndex,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex }),
+ label: { text: stageValue },
+ symbol: this.legendItemSymbol(datumIndex),
+ hideInLegend: !showInLegend
+ });
+ }
+ return legendData;
+ }
+ animateReset() {
+ this.ctx.animationManager.skipCurrentBatch();
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ }
+ animateEmptyUpdateReady() {
+ const { datumSelection, labelSelection, properties } = this;
+ const fns = preparePyramidAnimationFunctions(properties.direction);
+ fromToMotion4(this.id, "nodes", this.ctx.animationManager, [datumSelection], fns);
+ seriesLabelFadeInAnimation6(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+PyramidSeries.className = "PyramidSeries";
+PyramidSeries.type = "pyramid";
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport124 } from "ag-charts-community";
+import { constant as constant18, required as required18, string as string16 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs16, pyramidSeriesThemeableOptionsDef } = _ModuleSupport124;
+var pyramidSeriesOptionsDef = {
+ ...pyramidSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs16,
+ type: required18(constant18("pyramid")),
+ stageKey: required18(string16),
+ valueKey: required18(string16)
+};
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidThemes.ts
+import { _ModuleSupport as _ModuleSupport125 } from "ag-charts-community";
+var {
+ ThemeSymbols: { DEFAULT_SHADOW_COLOUR: DEFAULT_SHADOW_COLOUR2 }
+} = _ModuleSupport125;
+var PYRAMID_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ spacing: 2,
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ { $palette: "fills" },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", _ModuleSupport125.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["pattern", _ModuleSupport125.FILL_PATTERN_DEFAULTS],
+ ["image", _ModuleSupport125.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [{ $size: { $path: ["./data", { $path: "/data" }] } }, { $palette: "strokes" }]
+ },
+ label: {
+ ..._ModuleSupport125.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" }
+ },
+ stageLabel: {
+ ..._ModuleSupport125.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ spacing: 12
+ },
+ shadow: {
+ enabled: false,
+ color: DEFAULT_SHADOW_COLOUR2,
+ xOffset: 3,
+ yOffset: 3,
+ blur: 5
+ },
+ // @ts-expect-error undocumented option
+ highlight: _ModuleSupport125.singleSeriesHighlightStyle()
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidModule.ts
+var PyramidSeriesModule = {
+ type: "series",
+ name: "pyramid",
+ chartType: "standalone",
+ enterprise: true,
+ options: pyramidSeriesOptionsDef,
+ create: (ctx) => new PyramidSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaModule.ts
+import { _ModuleSupport as _ModuleSupport132 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radar/radarThemes.ts
+import { _ModuleSupport as _ModuleSupport126 } from "ag-charts-community";
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE3 }
+} = _ModuleSupport126;
+var BASE_RADAR_SERIES_THEME = {
+ series: {
+ stroke: { $palette: "stroke" },
+ label: {
+ ..._ModuleSupport126.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ marker: {
+ enabled: true,
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", _ModuleSupport126.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", _ModuleSupport126.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport126.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ fillOpacity: 1,
+ shape: "circle",
+ size: 6,
+ strokeOpacity: 1,
+ strokeWidth: { $isUserOption: ["./stroke", 1, 0] }
+ },
+ highlight: _ModuleSupport126.multiSeriesHighlightStyle(),
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ }
+ },
+ axes: {
+ [POLAR_AXIS_TYPE3.ANGLE_CATEGORY]: {
+ label: {
+ spacing: 10
+ }
+ }
+ }
+};
+var RADAR_LINE_SERIES_THEME = _ModuleSupport126.mergeDefaults(
+ {
+ series: {
+ stroke: _ModuleSupport126.SAFE_STROKE_FILL_OPERATION,
+ strokeWidth: 2
+ }
+ },
+ BASE_RADAR_SERIES_THEME
+);
+var RADAR_AREA_SERIES_THEME = _ModuleSupport126.mergeDefaults(
+ {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", _ModuleSupport126.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", _ModuleSupport126.FILL_IMAGE_DEFAULTS],
+ ["pattern", _ModuleSupport126.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ fillOpacity: 0.8,
+ strokeWidth: 2,
+ marker: {
+ enabled: false
+ }
+ }
+ },
+ BASE_RADAR_SERIES_THEME
+);
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport130
+} from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radar/radarSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport128
+} from "ag-charts-community";
+import { isFiniteNumber, isNumberEqual as isNumberEqual8 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/radar/radarSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport127 } from "ag-charts-community";
+var { Label: Label12, SeriesMarker: SeriesMarker2, SeriesProperties: SeriesProperties10, makeSeriesTooltip: makeSeriesTooltip19, Property: Property32 } = _ModuleSupport127;
+var RadarSeriesProperties = class extends SeriesProperties10 {
+ constructor() {
+ super(...arguments);
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.rotation = 0;
+ this.marker = new SeriesMarker2();
+ this.label = new Label12();
+ this.tooltip = makeSeriesTooltip19();
+ this.connectMissingData = false;
+ }
+};
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "angleKey", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "radiusKey", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "angleName", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "radiusName", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "styler", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "marker", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property32
+], RadarSeriesProperties.prototype, "connectMissingData", 2);
+
+// packages/ag-charts-enterprise/src/series/radar/radarSeries.ts
+var {
+ DEFAULT_POLAR_DIRECTION_KEYS: DEFAULT_POLAR_DIRECTION_KEYS2,
+ DEFAULT_POLAR_DIRECTION_NAMES: DEFAULT_POLAR_DIRECTION_NAMES2,
+ ChartAxisDirection: ChartAxisDirection17,
+ PolarAxis: PolarAxis2,
+ SeriesNodePickMode: SeriesNodePickMode14,
+ valueProperty: valueProperty14,
+ fixNumericExtent: fixNumericExtent8,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation7,
+ markerFadeInAnimation: markerFadeInAnimation2,
+ resetMarkerFn: resetMarkerFn2,
+ animationValidation: animationValidation8,
+ computeMarkerFocusBounds: computeMarkerFocusBounds3,
+ extent: extent2,
+ BBox: BBox13,
+ Group: Group13,
+ Path: Path10,
+ Selection: Selection12,
+ Text: Text6,
+ Marker: Marker4,
+ updateLabelNode: updateLabelNode7,
+ getMarkerStyles: getMarkerStyles2,
+ mergeDefaults: mergeDefaults16
+} = _ModuleSupport128;
+var RadarSeriesNodeEvent = class extends _ModuleSupport128.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.angleKey = series.properties.angleKey;
+ this.radiusKey = series.properties.radiusKey;
+ }
+};
+var RadarSeries = class extends _ModuleSupport128.PolarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: "angleValue",
+ propertyKeys: DEFAULT_POLAR_DIRECTION_KEYS2,
+ propertyNames: DEFAULT_POLAR_DIRECTION_NAMES2,
+ pickModes: [SeriesNodePickMode14.NEAREST_NODE, SeriesNodePickMode14.EXACT_SHAPE_MATCH],
+ canHaveAxes: true,
+ animationResetFns: {
+ item: resetMarkerFn2
+ },
+ clipFocusBox: false
+ });
+ this.NodeEvent = RadarSeriesNodeEvent;
+ this.lineGroup = this.contentGroup.appendChild(new Group13({ name: "radar-line" }));
+ this.lineSelection = Selection12.select(
+ this.lineGroup,
+ Path10
+ );
+ this.resetInvalidToZero = false;
+ this.circleCache = { r: 0, cx: 0, cy: 0 };
+ this.lineGroup.zIndex = 0;
+ this.itemGroup.zIndex = 1;
+ }
+ get hasData() {
+ return this.getHasData("angleValue");
+ }
+ nodeFactory() {
+ return new Marker4();
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!processedData || !dataModel)
+ return [];
+ if (direction === ChartAxisDirection17.Angle) {
+ return dataModel.getDomain(this, `angleValue`, "value", processedData);
+ } else {
+ const domain = dataModel.getDomain(this, `radiusValue`, "value", processedData);
+ const ext = extent2(domain.length === 0 ? domain : [0].concat(domain));
+ return fixNumericExtent8(ext);
+ }
+ }
+ async processData(dataController) {
+ const { angleKey, radiusKey } = this.properties;
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ extraProps.push(animationValidation8());
+ }
+ const radiusScaleType = this.axes[ChartAxisDirection17.Radius]?.scale.type;
+ const angleScaleType = this.axes[ChartAxisDirection17.Angle]?.scale.type;
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ valueProperty14(angleKey, angleScaleType, { id: "angleValue" }),
+ valueProperty14(radiusKey, radiusScaleType, { id: "radiusValue", invalidValue: void 0 }),
+ ...extraProps
+ ]
+ });
+ this.animationState.transition("updateData");
+ }
+ didCircleChange() {
+ const r = this.radius;
+ const cx = this.centerX;
+ const cy = this.centerY;
+ const cache = this.circleCache;
+ if (!(r === cache.r && cx === cache.cx && cy === cache.cy)) {
+ this.circleCache = { r, cx, cy };
+ return true;
+ }
+ return false;
+ }
+ getAxisInnerRadius() {
+ const radiusAxis = this.axes[ChartAxisDirection17.Radius];
+ return radiusAxis instanceof PolarAxis2 ? this.radius * radiusAxis.innerRadiusRatio : 0;
+ }
+ maybeRefreshNodeData() {
+ const didCircleChange = this.didCircleChange();
+ if (!didCircleChange && !this.nodeDataRefresh)
+ return;
+ this.contextNodeData = this.createNodeData();
+ this.nodeData = this.contextNodeData?.nodeData ?? [];
+ this.nodeDataRefresh = false;
+ }
+ createNodeData() {
+ const { processedData, dataModel } = this;
+ if (!processedData || !dataModel)
+ return;
+ const { angleKey, radiusKey, angleName, radiusName, legendItemName, marker, label } = this.properties;
+ const angleScale = this.axes[ChartAxisDirection17.Angle]?.scale;
+ const radiusScale = this.axes[ChartAxisDirection17.Radius]?.scale;
+ if (!angleScale || !radiusScale) {
+ return;
+ }
+ const angleValues = dataModel.resolveColumnById(this, `angleValue`, processedData);
+ const radiusValues = dataModel.resolveColumnById(this, `radiusValue`, processedData);
+ const axisInnerRadius = this.getAxisInnerRadius();
+ const radiusDomain = this.getSeriesDomain(ChartAxisDirection17.Radius);
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const nodeData = rawData.map((datum, datumIndex) => {
+ const angleDatum = angleValues[datumIndex];
+ const radiusDatum = radiusValues[datumIndex];
+ const angle = angleScale.convert(angleDatum);
+ const radius = this.radius + axisInnerRadius - radiusScale.convert(radiusDatum);
+ const cos = Math.cos(angle);
+ const sin = Math.sin(angle);
+ const x = cos * radius;
+ const y = sin * radius;
+ let labelNodeDatum;
+ if (label.enabled) {
+ const labelText = this.getLabelText(
+ radiusDatum,
+ datum,
+ radiusKey,
+ "radius",
+ radiusDomain,
+ label,
+ { value: radiusDatum, datum, angleKey, radiusKey, angleName, radiusName, legendItemName }
+ );
+ if (labelText) {
+ let textAlign = "right";
+ if (isNumberEqual8(cos, 0)) {
+ textAlign = "center";
+ } else if (cos > 0) {
+ textAlign = "left";
+ }
+ let textBaseline = "bottom";
+ if (isNumberEqual8(sin, 0)) {
+ textBaseline = "middle";
+ } else if (sin > 0) {
+ textBaseline = "top";
+ }
+ labelNodeDatum = {
+ x: x + cos * marker.size,
+ y: y + sin * marker.size,
+ text: labelText,
+ textAlign,
+ textBaseline
+ };
+ }
+ }
+ return {
+ series: this,
+ datum,
+ datumIndex,
+ index: datumIndex,
+ point: { x, y, size: marker.size },
+ midPoint: { x, y },
+ label: labelNodeDatum,
+ angleValue: angleDatum,
+ radiusValue: radiusDatum,
+ missing: !isFiniteNumber(angle) || !isFiniteNumber(radius)
+ };
+ });
+ return {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles: getMarkerStyles2(this, this.properties, marker)
+ };
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const { series } = this.ctx.highlightManager?.getActiveHighlight() ?? {};
+ this.highlightGroup.visible = (animationEnabled || this.visible) && series === this;
+ this.maybeRefreshNodeData();
+ this.contentGroup.translationX = this.centerX;
+ this.contentGroup.translationY = this.centerY;
+ this.highlightGroup.translationX = this.centerX;
+ this.highlightGroup.translationY = this.centerY;
+ if (this.labelGroup) {
+ this.labelGroup.translationX = this.centerX;
+ this.labelGroup.translationY = this.centerY;
+ }
+ this.updatePathSelections();
+ this.updateMarkerSelection();
+ this.updateHighlightSelection();
+ this.updatePathNodes();
+ if (this.hasItemStylers()) {
+ this.updateDatumStyles(this.itemSelection, false);
+ this.updateDatumStyles(this.highlightSelection, true);
+ }
+ this.updateMarkers(this.itemSelection, false);
+ this.updateMarkers(this.highlightSelection, true);
+ this.updateLabels();
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updatePathSelections() {
+ const pathData = this.visible ? [true] : [];
+ this.lineSelection.update(pathData);
+ }
+ updateMarkerSelection() {
+ const { marker, styler } = this.properties;
+ if (marker.isDirty()) {
+ this.itemSelection.clear();
+ this.itemSelection.cleanup();
+ this.itemSelection = Selection12.select(this.itemGroup, () => this.nodeFactory(), false);
+ }
+ const markersEnabled = styler == null ? marker.enabled : this.getStyle(false).marker.enabled;
+ const data = this.visible && marker.shape && markersEnabled ? this.nodeData : [];
+ this.itemSelection.update(data);
+ }
+ updateHighlightSelection() {
+ const { marker, styler } = this.properties;
+ if (marker.isDirty()) {
+ this.highlightSelection.clear();
+ this.highlightSelection.cleanup();
+ this.highlightSelection = Selection12.select(this.highlightGroup, () => this.nodeFactory(), false);
+ }
+ const markersEnabled = styler == null ? marker.enabled : this.getStyle(false).marker.enabled;
+ const highlighted = this.ctx.highlightManager?.getActiveHighlight();
+ const data = this.visible && marker.shape && markersEnabled && highlighted?.datum ? [{ ...highlighted }] : [];
+ this.highlightSelection.update(data);
+ }
+ getMarkerFill(highlightedStyle) {
+ return highlightedStyle?.fill ?? this.getStyle(false).marker.fill;
+ }
+ getDatumStylerProperties(datum) {
+ const { id: seriesId, properties } = this;
+ const { angleKey, radiusKey } = properties;
+ return {
+ seriesId,
+ datum,
+ angleKey,
+ radiusKey
+ };
+ }
+ updateDatumStyles(selection, isHighlight) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ selection.each((_, datum) => {
+ const highlightState = this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex);
+ const stylerStyle = this.getStyle(isHighlight, highlightState);
+ const { stroke, strokeWidth, strokeOpacity } = stylerStyle;
+ datum.style = this.getMarkerStyle(
+ this.properties.marker,
+ datum,
+ this.getDatumStylerProperties(datum.datum),
+ { isHighlight, highlightState },
+ stylerStyle.marker,
+ {
+ stroke,
+ strokeWidth,
+ strokeOpacity
+ }
+ );
+ });
+ }
+ updateMarkers(selection, isHighlight) {
+ const fillBBox = this.getShapeFillBBox();
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ selection.each((node, datum) => {
+ const style = datum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ this.applyMarkerStyle(style, node, datum.point, fillBBox);
+ });
+ }
+ updateLabels() {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ this.labelSelection.update(this.nodeData).each((node, datum) => {
+ if (datum.label) {
+ const isHighlight = false;
+ node.fillOpacity = this.getHighlightStyle(isHighlight, datum.datumIndex).opacity ?? 1;
+ updateLabelNode7(this, node, properties, properties.label, datum.label, isHighlight, activeHighlight);
+ }
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { angleKey, angleName, radiusKey, radiusName, legendItemName, tooltip, marker } = properties;
+ const angleAxis = axes[ChartAxisDirection17.Angle];
+ const radiusAxis = axes[ChartAxisDirection17.Radius];
+ if (!dataModel || !processedData || !angleAxis || !radiusAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const angleValue = dataModel.resolveColumnById(this, `angleValue`, processedData)[datumIndex];
+ const radiusValue = dataModel.resolveColumnById(this, `radiusValue`, processedData)[datumIndex];
+ if (angleValue == null)
+ return;
+ const activeStyle = this.getMarkerStyle(marker, { datum, datumIndex }, this.getDatumStylerProperties(datum), {
+ isHighlight: false
+ });
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(angleAxis, "tooltip", angleValue, datum, angleKey, void 0),
+ symbol: this.legendItemSymbol(),
+ data: [
+ {
+ label: radiusName,
+ fallbackLabel: radiusKey,
+ value: this.getAxisValueText(radiusAxis, "tooltip", radiusValue, datum, radiusKey, void 0)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: angleName,
+ angleKey,
+ radiusKey,
+ angleName,
+ radiusName,
+ legendItemName,
+ ...activeStyle
+ }
+ );
+ }
+ legendItemSymbol() {
+ const { stroke, strokeWidth, strokeOpacity, lineDash, marker } = this.getStyle(false);
+ const markerStyle = {
+ shape: marker.shape,
+ enabled: marker.enabled || strokeWidth <= 0,
+ fill: this.getMarkerFill() ?? marker.stroke ?? stroke ?? "rgba(0, 0, 0, 0)",
+ stroke: marker.stroke ?? stroke ?? "rgba(0, 0, 0, 0)",
+ fillOpacity: marker.fillOpacity,
+ strokeOpacity: marker.strokeOpacity,
+ strokeWidth: marker.strokeWidth,
+ lineDash: marker.lineDash,
+ lineDashOffset: marker.lineDashOffset
+ };
+ return {
+ marker: markerStyle,
+ line: {
+ stroke,
+ strokeOpacity,
+ strokeWidth,
+ lineDash
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const {
+ id: seriesId,
+ ctx: { legendManager },
+ visible
+ } = this;
+ const { radiusKey, radiusName, legendItemName, showInLegend } = this.properties;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: radiusKey,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: radiusKey }),
+ label: {
+ text: legendItemName ?? radiusName ?? radiusKey
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ pickNodeClosestDatum(hitPoint) {
+ const { nodeData, centerX: cx, centerY: cy } = this;
+ const { x, y } = hitPoint;
+ const radius = this.radius;
+ const distanceFromCenter = Math.hypot(x - cx, y - cy);
+ if (distanceFromCenter > radius + this.properties.marker.size) {
+ return;
+ }
+ let minDistance = Infinity;
+ let closestDatum;
+ for (const datum of nodeData) {
+ const { point: { x: datumX = Number.NaN, y: datumY = Number.NaN } = {} } = datum;
+ if (Number.isNaN(datumX) || Number.isNaN(datumY)) {
+ continue;
+ }
+ const distance = Math.hypot(hitPoint.x - datumX - cx, hitPoint.y - datumY - cy);
+ if (distance < minDistance) {
+ minDistance = distance;
+ closestDatum = datum;
+ }
+ }
+ if (closestDatum) {
+ const distance = Math.max(minDistance - (closestDatum.point?.size ?? 0), 0);
+ return { datum: closestDatum, distance };
+ }
+ }
+ computeLabelsBBox() {
+ const { label } = this.properties;
+ this.maybeRefreshNodeData();
+ const textBoxes = [];
+ const tempText = new Text6();
+ for (const nodeDatum of this.nodeData) {
+ if (!label.enabled || !nodeDatum.label) {
+ continue;
+ }
+ tempText.text = nodeDatum.label.text;
+ tempText.x = nodeDatum.label.x;
+ tempText.y = nodeDatum.label.y;
+ tempText.setFont(label);
+ tempText.setAlign(nodeDatum.label);
+ const box = tempText.getBBox();
+ textBoxes.push(box);
+ }
+ if (textBoxes.length === 0) {
+ return null;
+ }
+ return BBox13.merge(textBoxes);
+ }
+ getLineNode() {
+ return this.lineSelection?.at(0);
+ }
+ beforePathAnimation() {
+ this.updatePathNodes();
+ }
+ getPathNodesStyle() {
+ const highlightDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightState(highlightDatum);
+ const highlightStyle = this.getHighlightStyle(void 0, void 0, highlightState);
+ const stylerStyle = this.getStyle(false, highlightState);
+ return mergeDefaults16(highlightStyle, stylerStyle);
+ }
+ getLinePoints() {
+ const { nodeData, resetInvalidToZero } = this;
+ const { connectMissingData } = this.properties;
+ if (nodeData.length === 0) {
+ return [];
+ }
+ const radiusAxis = this.axes[ChartAxisDirection17.Radius];
+ const angleAxis = this.axes[ChartAxisDirection17.Angle];
+ const reversedAngleAxis = angleAxis?.isReversed();
+ const reversedRadiusAxis = radiusAxis?.isReversed();
+ const data = reversedRadiusAxis && !reversedAngleAxis ? [...nodeData].reverse() : nodeData;
+ const points = [];
+ let prevPointInvalid = false;
+ let firstValid;
+ for (const [index, datum] of data.entries()) {
+ let { x, y } = datum.point;
+ const isPointInvalid = Number.isNaN(x) || Number.isNaN(y);
+ if (!isPointInvalid) {
+ firstValid ?? (firstValid = datum);
+ }
+ if (isPointInvalid && !connectMissingData) {
+ x = 0;
+ y = 0;
+ }
+ const moveTo2 = index === 0 || !resetInvalidToZero && !connectMissingData && (isPointInvalid || prevPointInvalid);
+ points.push({ x, y, moveTo: moveTo2 });
+ prevPointInvalid = isPointInvalid;
+ }
+ if (firstValid !== void 0) {
+ points.push({ x: firstValid.point.x, y: firstValid.point.y, moveTo: false });
+ }
+ return points;
+ }
+ animateSinglePath(pathNode, points, ratio3) {
+ const { path } = pathNode;
+ path.clear(true);
+ const axisInnerRadius = this.getAxisInnerRadius();
+ const radiusAxis = this.axes[ChartAxisDirection17.Radius];
+ const reversedRadiusAxis = radiusAxis?.isReversed();
+ const radiusZero = reversedRadiusAxis ? this.radius + axisInnerRadius - radiusAxis?.scale.convert(0) : axisInnerRadius;
+ for (const point of points) {
+ const { x: x1, y: y1, arc, radius = 0, startAngle = 0, endAngle = 0, moveTo: moveTo2 } = point;
+ const angle = Math.atan2(y1, x1);
+ const x0 = radiusZero * Math.cos(angle);
+ const y0 = radiusZero * Math.sin(angle);
+ const t = ratio3;
+ const x = x0 * (1 - t) + x1 * t;
+ const y = y0 * (1 - t) + y1 * t;
+ if (arc) {
+ path.arc(x1, y1, radius, startAngle, endAngle);
+ } else if (moveTo2) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ }
+ pathNode.checkPathDirty();
+ }
+ animatePaths(ratio3) {
+ const linePoints = this.getLinePoints();
+ const lineNode = this.getLineNode();
+ if (!lineNode)
+ return;
+ this.animateSinglePath(lineNode, linePoints, ratio3);
+ }
+ animateEmptyUpdateReady() {
+ const { itemSelection, labelSelection } = this;
+ const { animationManager } = this.ctx;
+ this.beforePathAnimation();
+ animationManager.animate({
+ id: `${this.id}_'path`,
+ groupId: this.id,
+ from: 0,
+ to: 1,
+ phase: "initial",
+ collapsable: false,
+ onUpdate: (ratio3) => this.animatePaths(ratio3),
+ onStop: () => this.animatePaths(1)
+ });
+ markerFadeInAnimation2(this, animationManager, "added", itemSelection);
+ seriesLabelFadeInAnimation7(this, "labels", animationManager, labelSelection);
+ }
+ animateWaitingUpdateReady(data) {
+ super.animateWaitingUpdateReady(data);
+ this.resetPaths();
+ }
+ animateReadyResize(data) {
+ super.animateReadyResize(data);
+ this.resetPaths();
+ }
+ resetPaths() {
+ const lineNode = this.getLineNode();
+ if (lineNode) {
+ const { path: linePath } = lineNode;
+ const linePoints = this.getLinePoints();
+ const stylerStyle = this.getStyle(false);
+ lineNode.fill = void 0;
+ lineNode.stroke = stylerStyle.stroke;
+ lineNode.strokeWidth = stylerStyle.strokeWidth;
+ lineNode.strokeOpacity = stylerStyle.strokeOpacity;
+ lineNode.lineDash = stylerStyle.lineDash;
+ lineNode.lineDashOffset = stylerStyle.lineDashOffset;
+ linePath.clear(true);
+ for (const { x, y, moveTo: moveTo2 } of linePoints) {
+ if (moveTo2) {
+ linePath.moveTo(x, y);
+ } else {
+ linePath.lineTo(x, y);
+ }
+ }
+ lineNode.checkPathDirty();
+ return stylerStyle;
+ }
+ }
+ getStylerResult(stylerResult, highlighted, highlightState) {
+ const { styler } = this.properties;
+ if (styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ const cbResult = this.cachedCallWithContext(styler, stylerParams) ?? {};
+ const resolved = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ cbResult,
+ { pick: false }
+ );
+ if (resolved) {
+ stylerResult = resolved;
+ }
+ }
+ return stylerResult;
+ }
+ getFormattedMarkerStyle(datum) {
+ const { angleKey, radiusKey } = this.properties;
+ return this.getMarkerStyle(this.properties.marker, datum, { angleKey, radiusKey }, { isHighlight: true });
+ }
+ computeFocusBounds(opts) {
+ return computeMarkerFocusBounds3(this, opts);
+ }
+ hasItemStylers() {
+ return this.properties.styler != null || this.properties.marker.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+RadarSeries.className = "RadarSeries";
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeriesProperties.ts
+import {
+ _ModuleSupport as _ModuleSupport129
+} from "ag-charts-community";
+var { Property: Property33 } = _ModuleSupport129;
+var RadarAreaSeriesProperties = class extends RadarSeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.fill = "black";
+ this.fillOpacity = 1;
+ }
+};
+__decorateClass([
+ Property33
+], RadarAreaSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property33
+], RadarAreaSeriesProperties.prototype, "fillOpacity", 2);
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeries.ts
+var {
+ ChartAxisDirection: ChartAxisDirection18,
+ Group: Group14,
+ HighlightState: HighlightState4,
+ Path: Path11,
+ PointerEvents: PointerEvents10,
+ Selection: Selection13,
+ applyShapeStyle: applyShapeStyle15,
+ toHighlightString: toHighlightString5
+} = _ModuleSupport130;
+var RadarAreaSeries = class extends RadarSeries {
+ constructor(moduleCtx) {
+ super(moduleCtx);
+ this.properties = new RadarAreaSeriesProperties();
+ this.areaGroup = this.contentGroup.appendChild(new Group14({ name: "radar-area" }));
+ this.areaSelection = Selection13.select(
+ this.areaGroup,
+ Path11
+ );
+ this.resetInvalidToZero = true;
+ this.areaGroup.zIndex = -1;
+ }
+ updatePathSelections() {
+ const pathData = this.visible ? [true] : [];
+ this.areaSelection.update(pathData);
+ super.updatePathSelections();
+ }
+ getAreaNode() {
+ return this.areaSelection.at(0);
+ }
+ getMarkerFill(highlightedStyle) {
+ if (highlightedStyle?.fill != null)
+ return highlightedStyle.fill;
+ const stylerStyle = this.getStyle(false);
+ return stylerStyle.marker.fill ?? stylerStyle.fill;
+ }
+ updatePathNodes() {
+ const styles = this.getPathNodesStyle();
+ const { fill, fillOpacity, strokeWidth, stroke, strokeOpacity, lineDash, lineDashOffset, opacity } = styles;
+ const lineNode = this.getLineNode();
+ if (lineNode) {
+ lineNode.setProperties({
+ fill: void 0,
+ lineJoin: "round",
+ lineCap: "round",
+ pointerEvents: PointerEvents10.None,
+ opacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ }
+ const areaNode = this.getAreaNode();
+ if (areaNode) {
+ applyShapeStyle15(areaNode, { fill, fillOpacity, stroke: void 0 }, this.getShapeFillBBox());
+ areaNode.setProperties({
+ lineJoin: "round",
+ pointerEvents: PointerEvents10.None,
+ opacity
+ });
+ }
+ }
+ animatePaths(ratio3) {
+ super.animatePaths(ratio3);
+ const areaNode = this.getAreaNode();
+ if (areaNode) {
+ this.animateSinglePath(areaNode, this.getAreaPoints(), ratio3);
+ }
+ }
+ getAreaPoints() {
+ const points = this.getLinePoints();
+ const getPolarAxis = (direction) => {
+ const axis = this.axes[direction];
+ return axis instanceof _ModuleSupport130.PolarAxis ? axis : void 0;
+ };
+ const radiusAxis = getPolarAxis(ChartAxisDirection18.Radius);
+ const angleAxis = getPolarAxis(ChartAxisDirection18.Angle);
+ const reversedRadiusAxis = radiusAxis?.isReversed();
+ if (!reversedRadiusAxis) {
+ return points;
+ }
+ const zeroLinePoints = angleAxis?.getAxisLinePoints()?.points ?? [];
+ return points.concat(...zeroLinePoints);
+ }
+ resetPaths() {
+ const superStyle = super.resetPaths();
+ const areaNode = this.getAreaNode();
+ if (areaNode) {
+ const { path: areaPath } = areaNode;
+ const areaPoints = this.getAreaPoints();
+ const stylerStyle = superStyle ?? this.getStyle(false);
+ const fillBBox = this.getShapeFillBBox();
+ applyShapeStyle15(
+ areaNode,
+ {
+ fill: stylerStyle.fill,
+ stroke: void 0,
+ fillOpacity: stylerStyle.fillOpacity,
+ lineDash: stylerStyle.lineDash,
+ lineDashOffset: stylerStyle.lineDashOffset
+ },
+ fillBBox
+ );
+ areaNode.lineJoin = areaNode.lineCap = "round";
+ areaPath.clear(true);
+ for (const { x, y, moveTo: moveTo2, arc, radius = 0, startAngle = 0, endAngle = 0 } of areaPoints) {
+ if (arc) {
+ areaPath.arc(x, y, radius, startAngle, endAngle);
+ } else if (moveTo2) {
+ areaPath.moveTo(x, y);
+ } else {
+ areaPath.lineTo(x, y);
+ }
+ }
+ areaPath.closePath();
+ areaNode.checkPathDirty();
+ return stylerStyle;
+ }
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { properties } = this;
+ const highlightState = toHighlightString5(highlightStateEnum ?? HighlightState4.None);
+ return {
+ marker: {
+ fill: properties.marker.fill,
+ fillOpacity: properties.marker.fillOpacity,
+ size: properties.marker.size,
+ shape: properties.marker.shape,
+ stroke: properties.marker.stroke,
+ strokeOpacity: properties.marker.strokeOpacity,
+ strokeWidth: properties.marker.strokeWidth,
+ lineDash: properties.marker.lineDash,
+ lineDashOffset: properties.marker.lineDashOffset
+ },
+ highlightState,
+ highlighted,
+ fill: properties.fill,
+ fillOpacity: properties.fillOpacity,
+ lineDash: properties.lineDash,
+ lineDashOffset: properties.lineDashOffset,
+ seriesId: this.id,
+ stroke: properties.stroke,
+ strokeOpacity: properties.strokeOpacity,
+ strokeWidth: properties.strokeWidth,
+ angleKey: properties.angleKey,
+ radiusKey: properties.radiusKey
+ };
+ }
+ getStyle(highlighted, highlightState) {
+ const { marker, fill, fillOpacity, lineDash, lineDashOffset, stroke, strokeOpacity, strokeWidth } = this.properties;
+ const { size, shape, fill: markerFill = "transparent", fillOpacity: markerFillOpacity } = marker;
+ const stylerResult = this.getStylerResult({}, highlighted, highlightState);
+ stylerResult.marker ?? (stylerResult.marker = {});
+ return {
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.stroke ?? stroke,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth,
+ marker: {
+ enabled: stylerResult.marker.enabled ?? marker.enabled,
+ fill: stylerResult.marker.fill ?? markerFill,
+ fillOpacity: stylerResult.marker.fillOpacity ?? markerFillOpacity,
+ shape: stylerResult.marker.shape ?? shape,
+ size: stylerResult.marker.size ?? size,
+ lineDash: stylerResult.marker.lineDash ?? marker.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.marker.lineDashOffset ?? marker.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.marker.stroke ?? marker.stroke ?? stroke,
+ strokeOpacity: stylerResult.marker.strokeOpacity ?? marker.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.marker.strokeWidth ?? marker.strokeWidth ?? strokeWidth
+ }
+ };
+ }
+};
+RadarAreaSeries.className = "RadarAreaSeries";
+RadarAreaSeries.type = "radar-area";
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport131 } from "ag-charts-community";
+import { constant as constant19, required as required19, string as string17 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs17, radarAreaSeriesThemeableOptionsDef } = _ModuleSupport131;
+var radarAreaSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs17,
+ ...radarAreaSeriesThemeableOptionsDef,
+ type: required19(constant19("radar-area")),
+ angleKey: required19(string17),
+ radiusKey: required19(string17),
+ angleName: string17,
+ radiusName: string17,
+ legendItemName: string17
+};
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaModule.ts
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE4 }
+} = _ModuleSupport132;
+var RadarAreaModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radar-area",
+ moduleFactory: (ctx) => new RadarAreaSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE4.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE4.RADIUS_NUMBER }],
+ themeTemplate: RADAR_AREA_SERIES_THEME
+};
+var RadarAreaSeriesModule = {
+ type: "series",
+ name: "radar-area",
+ chartType: "polar",
+ enterprise: true,
+ options: radarAreaSeriesOptionsDef,
+ create: (ctx) => new RadarAreaSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineModule.ts
+import { _ModuleSupport as _ModuleSupport135 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport133
+} from "ag-charts-community";
+var { HighlightState: HighlightState5, PointerEvents: PointerEvents11, toHighlightString: toHighlightString6 } = _ModuleSupport133;
+var RadarLineSeries = class extends RadarSeries {
+ constructor() {
+ super(...arguments);
+ this.properties = new RadarSeriesProperties();
+ }
+ updatePathSelections() {
+ this.lineSelection.update(this.visible ? [true] : []);
+ }
+ updatePathNodes() {
+ const lineNode = this.getLineNode();
+ if (!lineNode)
+ return;
+ const style = this.getPathNodesStyle();
+ const { strokeWidth, stroke, strokeOpacity, lineDash, lineDashOffset, opacity } = style;
+ lineNode.setProperties({
+ fill: void 0,
+ lineJoin: "round",
+ lineCap: "round",
+ pointerEvents: PointerEvents11.None,
+ opacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { properties } = this;
+ const highlightState = toHighlightString6(highlightStateEnum ?? HighlightState5.None);
+ return {
+ marker: {
+ fill: properties.marker.fill,
+ fillOpacity: properties.marker.fillOpacity,
+ size: properties.marker.size,
+ shape: properties.marker.shape,
+ stroke: properties.marker.stroke,
+ strokeOpacity: properties.marker.strokeOpacity,
+ strokeWidth: properties.marker.strokeWidth,
+ lineDash: properties.marker.lineDash,
+ lineDashOffset: properties.marker.lineDashOffset
+ },
+ highlightState,
+ highlighted,
+ lineDash: properties.lineDash,
+ lineDashOffset: properties.lineDashOffset,
+ seriesId: this.id,
+ stroke: properties.stroke,
+ strokeOpacity: properties.strokeOpacity,
+ strokeWidth: properties.strokeWidth,
+ angleKey: properties.angleKey,
+ radiusKey: properties.radiusKey
+ };
+ }
+ getStyle(highlighted, highlightState) {
+ const { marker, lineDash, lineDashOffset, stroke, strokeOpacity, strokeWidth } = this.properties;
+ const { size, shape, fill = "transparent", fillOpacity } = marker;
+ const stylerResult = this.getStylerResult({}, highlighted, highlightState);
+ stylerResult.marker ?? (stylerResult.marker = {});
+ return {
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.stroke ?? stroke,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth,
+ marker: {
+ enabled: stylerResult.marker.enabled ?? marker.enabled,
+ fill: stylerResult.marker.fill ?? fill,
+ fillOpacity: stylerResult.marker.fillOpacity ?? fillOpacity,
+ shape: stylerResult.marker.shape ?? shape,
+ size: stylerResult.marker.size ?? size,
+ lineDash: stylerResult.marker.lineDash ?? marker.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.marker.lineDashOffset ?? marker.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.marker.stroke ?? marker.stroke ?? stroke,
+ strokeOpacity: stylerResult.marker.strokeOpacity ?? marker.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.marker.strokeWidth ?? marker.strokeWidth ?? strokeWidth
+ }
+ };
+ }
+};
+RadarLineSeries.className = "RadarLineSeries";
+RadarLineSeries.type = "radar-line";
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport134 } from "ag-charts-community";
+import { constant as constant20, required as required20, string as string18 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs18, radarLineSeriesThemeableOptionsDef } = _ModuleSupport134;
+var radarLineSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs18,
+ ...radarLineSeriesThemeableOptionsDef,
+ type: required20(constant20("radar-line")),
+ angleKey: required20(string18),
+ radiusKey: required20(string18),
+ angleName: string18,
+ radiusName: string18,
+ legendItemName: string18
+};
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineModule.ts
+var { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE5 } = _ModuleSupport135.ThemeConstants;
+var RadarLineModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radar-line",
+ moduleFactory: (ctx) => new RadarLineSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE5.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE5.RADIUS_NUMBER }],
+ themeTemplate: RADAR_LINE_SERIES_THEME
+};
+var RadarLineSeriesModule = {
+ type: "series",
+ name: "radar-line",
+ chartType: "polar",
+ enterprise: true,
+ options: radarLineSeriesOptionsDef,
+ create: (ctx) => new RadarLineSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarModule.ts
+import { _ModuleSupport as _ModuleSupport141 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport138
+} from "ag-charts-community";
+import { isDefined as isDefined2 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/utils/datum.ts
+function readDatum(nodeDatum) {
+ if (typeof nodeDatum?.datum === "object") {
+ return nodeDatum.datum;
+ }
+ return null;
+}
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport136 } from "ag-charts-community";
+var { SeriesProperties: SeriesProperties11, makeSeriesTooltip: makeSeriesTooltip20, Property: Property34, Label: Label13 } = _ModuleSupport136;
+var RadialBarSeriesProperties = class extends SeriesProperties11 {
+ constructor() {
+ super(...arguments);
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.rotation = 0;
+ this.label = new Label13();
+ this.tooltip = makeSeriesTooltip20();
+ }
+ getStyle() {
+ const { fill, fillOpacity, stroke, strokeWidth, strokeOpacity, lineDash, lineDashOffset, cornerRadius } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "angleKey", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "radiusKey", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "angleName", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "radiusName", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "styler", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "stackGroup", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "normalizedTo", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property34
+], RadialBarSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarUtil.ts
+import { _ModuleSupport as _ModuleSupport137 } from "ag-charts-community";
+var { SectorBox: SectorBox3, motion: motion9 } = _ModuleSupport137;
+function fixRadialBarAnimationStatus(node, datum, status) {
+ if (status === "updated") {
+ if (node.previousDatum == null || Number.isNaN(node.previousDatum.innerRadius) || Number.isNaN(node.previousDatum.outerRadius)) {
+ return "added";
+ }
+ if (Number.isNaN(datum.innerRadius) || Number.isNaN(datum.outerRadius)) {
+ return "removed";
+ }
+ }
+ if (status === "added" && node.previousDatum != null) {
+ return "updated";
+ }
+ return status;
+}
+function prepareRadialBarSeriesAnimationFunctions(axisZeroAngle) {
+ const fromFn = (sect, datum, status) => {
+ status = fixRadialBarAnimationStatus(sect, datum, status);
+ let startAngle;
+ let endAngle;
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed" || status === "updated") {
+ startAngle = sect.startAngle;
+ endAngle = sect.endAngle;
+ innerRadius = sect.innerRadius;
+ outerRadius = sect.outerRadius;
+ clipSector = sect.clipSector;
+ } else {
+ startAngle = axisZeroAngle;
+ endAngle = axisZeroAngle;
+ innerRadius = datum.innerRadius;
+ outerRadius = datum.outerRadius;
+ }
+ clipSector ?? (clipSector = new SectorBox3(startAngle, endAngle, innerRadius, outerRadius));
+ const phase = motion9.NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return { startAngle, endAngle, innerRadius, outerRadius, clipSector, phase };
+ };
+ const toFn = (sect, datum, status) => {
+ let startAngle;
+ let endAngle;
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed") {
+ startAngle = axisZeroAngle;
+ endAngle = axisZeroAngle;
+ innerRadius = datum.innerRadius;
+ outerRadius = datum.outerRadius;
+ clipSector = new SectorBox3(startAngle, endAngle, innerRadius, outerRadius);
+ } else {
+ startAngle = datum.startAngle;
+ endAngle = datum.endAngle;
+ innerRadius = Number.isNaN(datum.innerRadius) ? sect.innerRadius : datum.innerRadius;
+ outerRadius = Number.isNaN(datum.outerRadius) ? sect.outerRadius : datum.outerRadius;
+ clipSector = datum.clipSector;
+ }
+ return { startAngle, endAngle, innerRadius, outerRadius, clipSector };
+ };
+ return { toFn, fromFn };
+}
+function resetRadialBarSelectionsFn(_node, datum) {
+ return {
+ centerX: 0,
+ centerY: 0,
+ innerRadius: datum.innerRadius,
+ outerRadius: datum.outerRadius,
+ startAngle: datum.startAngle,
+ endAngle: datum.endAngle,
+ clipSector: datum.clipSector
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeries.ts
+var {
+ DEFAULT_POLAR_DIRECTION_KEYS: DEFAULT_POLAR_DIRECTION_KEYS3,
+ DEFAULT_POLAR_DIRECTION_NAMES: DEFAULT_POLAR_DIRECTION_NAMES3,
+ ChartAxisDirection: ChartAxisDirection19,
+ PolarAxis: PolarAxis3,
+ diff: diff7,
+ groupAccumulativeValueProperty: groupAccumulativeValueProperty2,
+ keyProperty: keyProperty9,
+ normaliseGroupTo: normaliseGroupTo2,
+ valueProperty: valueProperty15,
+ fixNumericExtent: fixNumericExtent9,
+ resetLabelFn: resetLabelFn6,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation8,
+ seriesLabelFadeOutAnimation: seriesLabelFadeOutAnimation2,
+ animationValidation: animationValidation9,
+ angleBetween: angleBetween3,
+ createDatumId: createDatumId18,
+ CategoryScale: CategoryScale4,
+ Sector: Sector5,
+ SectorBox: SectorBox4,
+ motion: motion10,
+ isGradientFill: isGradientFill3,
+ applyShapeStyle: applyShapeStyle16,
+ updateLabelNode: updateLabelNode8,
+ getItemStyles: getItemStyles4
+} = _ModuleSupport138;
+var RadialBarSeriesNodeEvent = class extends _ModuleSupport138.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.angleKey = series.properties.angleKey;
+ this.radiusKey = series.properties.radiusKey;
+ }
+};
+var RadialBarSeries = class extends _ModuleSupport138.PolarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: "radiusValue",
+ propertyKeys: DEFAULT_POLAR_DIRECTION_KEYS3,
+ propertyNames: DEFAULT_POLAR_DIRECTION_NAMES3,
+ canHaveAxes: true,
+ animationResetFns: {
+ item: resetRadialBarSelectionsFn,
+ label: resetLabelFn6
+ }
+ });
+ this.properties = new RadialBarSeriesProperties();
+ this.NodeEvent = RadialBarSeriesNodeEvent;
+ this.groupScale = new CategoryScale4();
+ this.circleCache = { r: 0, cx: 0, cy: 0 };
+ }
+ get hasData() {
+ return this.getHasData("angleValue-raw");
+ }
+ nodeFactory() {
+ return new Sector5();
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!processedData || !dataModel)
+ return [];
+ if (direction === ChartAxisDirection19.Angle) {
+ const xExtent = dataModel.getDomain(this, "angleValue-end", "value", processedData);
+ const fixedXExtent = [Math.min(xExtent[0], 0), Math.max(xExtent[1], 0)];
+ return fixNumericExtent9(fixedXExtent);
+ } else {
+ return dataModel.getDomain(this, "radiusValue", "key", processedData);
+ }
+ }
+ async processData(dataController) {
+ const { angleKey, radiusKey, normalizedTo } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const stackGroupId = this.getStackId();
+ const stackGroupTrailingId = `${stackGroupId}-trailing`;
+ const extraProps = [];
+ if (isDefined2(normalizedTo)) {
+ extraProps.push(normaliseGroupTo2([stackGroupId, stackGroupTrailingId], Math.abs(normalizedTo)));
+ }
+ if (animationEnabled) {
+ if (this.processedData) {
+ extraProps.push(diff7(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation9());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const radiusScaleType = this.axes[ChartAxisDirection19.Radius]?.scale.type;
+ const angleScaleType = this.axes[ChartAxisDirection19.Angle]?.scale.type;
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty9(radiusKey, radiusScaleType, { id: "radiusValue" }),
+ valueProperty15(angleKey, angleScaleType, {
+ id: "angleValue-raw",
+ invalidValue: null,
+ ...visibleProps
+ }),
+ ...groupAccumulativeValueProperty2(
+ angleKey,
+ "normal",
+ {
+ id: `angleValue-end`,
+ rangeId: `angleValue-range`,
+ invalidValue: null,
+ groupId: stackGroupId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ angleScaleType
+ ),
+ ...groupAccumulativeValueProperty2(
+ angleKey,
+ "trailing",
+ {
+ id: `angleValue-start`,
+ invalidValue: null,
+ groupId: stackGroupTrailingId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ angleScaleType
+ ),
+ ...extraProps
+ ],
+ groupByKeys: true,
+ groupByData: false
+ });
+ this.animationState.transition("updateData");
+ }
+ didCircleChange() {
+ const r = this.radius;
+ const cx = this.centerX;
+ const cy = this.centerY;
+ const cache = this.circleCache;
+ if (!(r === cache.r && cx === cache.cx && cy === cache.cy)) {
+ this.circleCache = { r, cx, cy };
+ return true;
+ }
+ return false;
+ }
+ maybeRefreshNodeData() {
+ const circleChanged = this.didCircleChange();
+ if (!circleChanged && !this.nodeDataRefresh)
+ return;
+ this.contextNodeData = this.createNodeData();
+ this.nodeData = this.contextNodeData?.nodeData ?? [];
+ this.nodeDataRefresh = false;
+ }
+ getAxisInnerRadius() {
+ const radiusAxis = this.axes[ChartAxisDirection19.Radius];
+ return radiusAxis instanceof PolarAxis3 ? this.radius * radiusAxis.innerRadiusRatio : 0;
+ }
+ createNodeData() {
+ const { processedData, dataModel } = this;
+ if (!dataModel || !processedData || processedData.type !== "grouped")
+ return;
+ const angleAxis = this.axes[ChartAxisDirection19.Angle];
+ const radiusAxis = this.axes[ChartAxisDirection19.Radius];
+ const angleScale = angleAxis?.scale;
+ const radiusScale = radiusAxis?.scale;
+ if (!angleScale || !radiusScale) {
+ return;
+ }
+ const radiusValues = dataModel.resolveKeysById(this, "radiusValue", processedData);
+ const angleStartValues = dataModel.resolveColumnById(this, `angleValue-start`, processedData);
+ const angleEndValues = dataModel.resolveColumnById(this, `angleValue-end`, processedData);
+ const angleRawValues = dataModel.resolveColumnById(this, `angleValue-raw`, processedData);
+ const angleRangeIndex = dataModel.resolveProcessedDataIndexById(this, `angleValue-range`);
+ let groupPaddingInner = 0;
+ if (radiusAxis instanceof RadiusCategoryAxis) {
+ groupPaddingInner = radiusAxis.groupPaddingInner;
+ }
+ const { groupScale } = this;
+ const { index: groupIndex, visibleGroupCount } = this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);
+ groupScale.domain = Array.from({ length: visibleGroupCount }).map((_, i) => String(i));
+ groupScale.range = [0, Math.abs(radiusScale.bandwidth ?? 0)];
+ groupScale.paddingInner = visibleGroupCount > 1 ? groupPaddingInner : 0;
+ const barWidth = groupScale.bandwidth >= 1 ? groupScale.bandwidth : groupScale.rawBandwidth;
+ const angleAxisReversed = angleAxis.isReversed();
+ const radiusAxisReversed = radiusAxis.isReversed();
+ const axisInnerRadius = radiusAxisReversed ? this.radius : this.getAxisInnerRadius();
+ const axisOuterRadius = radiusAxisReversed ? this.getAxisInnerRadius() : this.radius;
+ const axisTotalRadius = axisOuterRadius + axisInnerRadius;
+ const angleDomain = this.getSeriesDomain(ChartAxisDirection19.Angle);
+ const { angleKey, radiusKey, angleName, radiusName, legendItemName, label } = this.properties;
+ const getLabelNodeDatum = (datum, angleDatum, x, y) => {
+ const labelText = this.getLabelText(
+ angleDatum,
+ datum,
+ angleKey,
+ "angle",
+ angleDomain,
+ label,
+ { value: angleDatum, datum, angleKey, radiusKey, angleName, radiusName, legendItemName }
+ );
+ if (labelText) {
+ return { x, y, text: labelText, textAlign: "center", textBaseline: "middle" };
+ }
+ };
+ const nodeData = [];
+ const styles = getItemStyles4(
+ (nodeDatum, isHighlight, highlightState) => getItemStyle(this, nodeDatum, isHighlight, highlightState)
+ );
+ const context = {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles
+ };
+ if (!this.visible)
+ return context;
+ const { dataSources } = processedData;
+ const rawData = dataSources.get(this.id)?.data ?? [];
+ for (const { datumIndex, group } of dataModel.forEachGroupDatum(this, processedData)) {
+ const datum = rawData[datumIndex];
+ const radiusDatum = radiusValues[datumIndex];
+ if (radiusDatum == null)
+ return;
+ const angleDatum = angleRawValues[datumIndex];
+ const angleStartDatum = angleStartValues[datumIndex];
+ const angleEndDatum = angleEndValues[datumIndex];
+ const isPositive = angleDatum >= 0 && !Object.is(angleDatum, -0);
+ const angleRange = group.aggregation[angleRangeIndex][isPositive ? 1 : 0];
+ const reversed = isPositive === angleAxisReversed;
+ let startAngle = angleScale.convert(angleStartDatum, { clamp: true });
+ let endAngle = angleScale.convert(angleEndDatum, { clamp: true });
+ let rangeStartAngle = angleScale.convert(0, { clamp: true });
+ let rangeEndAngle = angleScale.convert(angleRange, { clamp: true });
+ if (reversed) {
+ [rangeStartAngle, rangeEndAngle] = [rangeEndAngle, rangeStartAngle];
+ [startAngle, endAngle] = [endAngle, startAngle];
+ }
+ const dataRadius = axisTotalRadius - radiusScale.convert(radiusDatum);
+ const innerRadius = dataRadius + groupScale.convert(String(groupIndex));
+ const outerRadius = innerRadius + barWidth;
+ const midRadius = (innerRadius + outerRadius) / 2;
+ const midAngle = startAngle + angleBetween3(startAngle, endAngle) / 2;
+ const x = Math.cos(midAngle) * midRadius;
+ const y = Math.sin(midAngle) * midRadius;
+ const labelNodeDatum = this.properties.label.enabled ? getLabelNodeDatum(datum, angleDatum, x, y) : void 0;
+ const clipSector = new SectorBox4(startAngle, endAngle, innerRadius, outerRadius);
+ nodeData.push({
+ series: this,
+ datum,
+ datumIndex,
+ point: { x, y, size: 0 },
+ midPoint: { x, y },
+ label: labelNodeDatum,
+ angleValue: angleDatum,
+ radiusValue: radiusDatum,
+ innerRadius,
+ outerRadius,
+ startAngle: rangeStartAngle,
+ endAngle: rangeEndAngle,
+ clipSector,
+ reversed,
+ index: datumIndex
+ });
+ }
+ return context;
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ this.maybeRefreshNodeData();
+ this.contentGroup.translationX = this.centerX;
+ this.contentGroup.translationY = this.centerY;
+ this.highlightGroup.translationX = this.centerX;
+ this.highlightGroup.translationY = this.centerY;
+ if (this.labelGroup) {
+ this.labelGroup.translationX = this.centerX;
+ this.labelGroup.translationY = this.centerY;
+ }
+ this.updateSectorSelection(this.itemSelection, false);
+ this.updateSectorSelection(this.highlightSelection, true);
+ this.updateLabels();
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateSectorSelection(selection, isHighlight) {
+ let selectionData = [];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ if (isHighlight) {
+ if (activeHighlight?.datum && activeHighlight.series === this) {
+ selectionData.push(activeHighlight);
+ }
+ } else {
+ selectionData = this.nodeData;
+ }
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const fillBBox = this.getShapeFillBBox();
+ const hasItemStylers = this.hasItemStylers();
+ selection.update(selectionData, void 0, (datum) => this.getDatumId(datum)).each((node, nodeDatum) => {
+ const datum = readDatum(nodeDatum);
+ if (datum == null)
+ return;
+ if (hasItemStylers) {
+ const highlightState = this.getHighlightState(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ nodeDatum.style = getItemStyle(this, nodeDatum, isHighlight, highlightState);
+ }
+ const style = nodeDatum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex)];
+ const cornerRadius = style.cornerRadius;
+ const fill = style.fill;
+ const fillParams = _ModuleSupport138.isGradientFill(fill) && fill.bounds !== "item" ? { centerX: 0, centerY: 0 } : void 0;
+ applyShapeStyle16(node, style, fillBBox, fillParams);
+ node.lineJoin = "round";
+ node.inset = node.stroke == null ? 0 : node.strokeWidth / 2;
+ node.startInnerCornerRadius = datum.reversed ? cornerRadius : 0;
+ node.startOuterCornerRadius = datum.reversed ? cornerRadius : 0;
+ node.endInnerCornerRadius = datum.reversed ? 0 : cornerRadius;
+ node.endOuterCornerRadius = datum.reversed ? 0 : cornerRadius;
+ if (isHighlight) {
+ node.startAngle = nodeDatum.startAngle;
+ node.endAngle = nodeDatum.endAngle;
+ node.clipSector = nodeDatum.clipSector;
+ node.innerRadius = nodeDatum.innerRadius;
+ node.outerRadius = nodeDatum.outerRadius;
+ }
+ });
+ }
+ updateLabels() {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ this.labelSelection.update(this.nodeData).each((node, datum) => {
+ const isHighlight = false;
+ updateLabelNode8(this, node, properties, properties.label, datum.label, isHighlight, activeHighlight);
+ node.fillOpacity = this.getHighlightStyle(isHighlight, datum.datumIndex).opacity ?? 1;
+ });
+ }
+ getBarTransitionFunctions() {
+ const angleScale = this.axes[ChartAxisDirection19.Angle]?.scale;
+ let axisZeroAngle = 0;
+ if (!angleScale) {
+ return prepareRadialBarSeriesAnimationFunctions(axisZeroAngle);
+ }
+ const d0 = Math.min(angleScale.domain[0], angleScale.domain[1]);
+ const d1 = Math.max(angleScale.domain[0], angleScale.domain[1]);
+ if (d0 <= 0 && d1 >= 0) {
+ axisZeroAngle = angleScale.convert(0);
+ }
+ return prepareRadialBarSeriesAnimationFunctions(axisZeroAngle);
+ }
+ animateEmptyUpdateReady() {
+ const { labelSelection } = this;
+ const fns = this.getBarTransitionFunctions();
+ motion10.fromToMotion(this.id, "datums", this.ctx.animationManager, [this.itemSelection], fns);
+ seriesLabelFadeInAnimation8(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateClearingUpdateEmpty() {
+ const { itemSelection } = this;
+ const { animationManager } = this.ctx;
+ const fns = this.getBarTransitionFunctions();
+ motion10.fromToMotion(this.id, "datums", animationManager, [itemSelection], fns);
+ seriesLabelFadeOutAnimation2(this, "labels", animationManager, this.labelSelection);
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { angleKey, angleName, radiusKey, radiusName, legendItemName, tooltip } = properties;
+ const angleAxis = axes[ChartAxisDirection19.Angle];
+ const radiusAxis = axes[ChartAxisDirection19.Radius];
+ const nodeDatum = this.nodeData?.[datumIndex];
+ if (!dataModel || !processedData || !angleAxis || !radiusAxis || !nodeDatum)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const radiusValue = dataModel.resolveKeysById(this, `radiusValue`, processedData)[datumIndex];
+ const angleValue = dataModel.resolveColumnById(this, `angleValue-raw`, processedData)[datumIndex];
+ if (radiusValue == null)
+ return;
+ const format = getItemStyle(this, nodeDatum, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(radiusAxis, "tooltip", radiusValue, datum, radiusKey, void 0),
+ symbol: this.legendItemSymbol(),
+ data: [
+ {
+ label: angleName,
+ fallbackLabel: angleKey,
+ value: this.getAxisValueText(angleAxis, "tooltip", angleValue, datum, angleKey, void 0)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: angleName,
+ angleKey,
+ angleName,
+ radiusKey,
+ radiusName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return this.pickNodeNearestDistantObject(point, this.itemSelection.nodes());
+ }
+ legendItemSymbol() {
+ const { fill, stroke, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = getStyle(
+ this,
+ false,
+ false,
+ _ModuleSupport138.HighlightState.None
+ );
+ const markerStyle = {
+ fill: fill ?? "rgba(0, 0, 0, 0)",
+ stroke: stroke ?? "rgba(0, 0, 0, 0)",
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ if (isGradientFill3(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ return {
+ marker: markerStyle
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { angleKey, angleName, legendItemName, showInLegend } = this.properties;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: angleKey,
+ seriesId,
+ enabled: visible,
+ label: {
+ text: legendItemName ?? angleName ?? angleKey
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ getDatumId(datum) {
+ return createDatumId18(datum.radiusValue);
+ }
+ computeLabelsBBox() {
+ return null;
+ }
+ getStackId() {
+ const groupIndex = this.seriesGrouping?.groupIndex ?? this.id;
+ return `radialBar-stack-${groupIndex}-xValues`;
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null || this.properties.label.itemStyler != null;
+ }
+};
+RadialBarSeries.className = "RadialBarSeries";
+RadialBarSeries.type = "radial-bar";
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport139 } from "ag-charts-community";
+import { boolean as boolean9, constant as constant21, number as number8, required as required21, string as string19 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs19, radialBarSeriesThemeableOptionsDef } = _ModuleSupport139;
+var radialBarSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs19,
+ ...radialBarSeriesThemeableOptionsDef,
+ type: required21(constant21("radial-bar")),
+ angleKey: required21(string19),
+ radiusKey: required21(string19),
+ angleName: string19,
+ radiusName: string19,
+ legendItemName: string19,
+ grouped: boolean9,
+ stacked: boolean9,
+ stackGroup: string19,
+ normalizedTo: number8
+};
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarThemes.ts
+import { _ModuleSupport as _ModuleSupport140 } from "ag-charts-community";
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE6 },
+ FILL_GRADIENT_CONIC_SERIES_DEFAULTS,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS5,
+ FILL_PATTERN_DEFAULTS: FILL_PATTERN_DEFAULTS3
+} = _ModuleSupport140;
+var RADIAL_BAR_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", FILL_GRADIENT_CONIC_SERIES_DEFAULTS],
+ ["image", FILL_IMAGE_DEFAULTS5],
+ ["pattern", FILL_PATTERN_DEFAULTS3]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ strokeWidth: { $isUserOption: ["./stroke", 1, 0] },
+ label: {
+ ..._ModuleSupport140.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" }
+ },
+ highlight: _ModuleSupport140.multiSeriesHighlightStyle()
+ },
+ axes: {
+ [POLAR_AXIS_TYPE6.RADIUS_CATEGORY]: {
+ innerRadiusRatio: 0.2,
+ groupPaddingInner: 0.2,
+ paddingInner: 0.2,
+ paddingOuter: 0.1
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarModule.ts
+var { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE7 } = _ModuleSupport141.ThemeConstants;
+var RadialBarModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radial-bar",
+ moduleFactory: (ctx) => new RadialBarSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE7.ANGLE_NUMBER }, { type: POLAR_AXIS_TYPE7.RADIUS_CATEGORY }],
+ themeTemplate: RADIAL_BAR_SERIES_THEME,
+ stackable: true,
+ groupable: true
+};
+var RadialBarSeriesModule = {
+ type: "series",
+ name: "radial-bar",
+ chartType: "polar",
+ enterprise: true,
+ options: radialBarSeriesOptionsDef,
+ create: (ctx) => new RadialBarSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnModule.ts
+import { _ModuleSupport as _ModuleSupport146 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeries.ts
+import { _ModuleSupport as _ModuleSupport143 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport142 } from "ag-charts-community";
+var { Property: Property35 } = _ModuleSupport142;
+var RadialColumnSeriesProperties = class extends RadialColumnSeriesBaseProperties {
+};
+__decorateClass([
+ Property35
+], RadialColumnSeriesProperties.prototype, "columnWidthRatio", 2);
+__decorateClass([
+ Property35
+], RadialColumnSeriesProperties.prototype, "maxColumnWidthRatio", 2);
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeries.ts
+var { ChartAxisDirection: ChartAxisDirection20, PolarAxis: PolarAxis4, RadialColumnShape, getRadialColumnWidth } = _ModuleSupport143;
+var RadialColumnSeries = class extends RadialColumnSeriesBase {
+ constructor(moduleCtx) {
+ super(moduleCtx, {
+ animationResetFns: {
+ item: resetRadialColumnSelectionFn
+ }
+ });
+ this.properties = new RadialColumnSeriesProperties();
+ }
+ getStackId() {
+ const groupIndex = this.seriesGrouping?.groupIndex ?? this.id;
+ return `radarColumn-stack-${groupIndex}-yValues`;
+ }
+ nodeFactory() {
+ return new RadialColumnShape();
+ }
+ getColumnTransitionFunctions() {
+ const axisZeroRadius = this.isRadiusAxisReversed() ? this.radius : this.getAxisInnerRadius();
+ return prepareRadialColumnAnimationFunctions(axisZeroRadius);
+ }
+ isRadiusAxisCircle() {
+ const radiusAxis = this.axes[ChartAxisDirection20.Radius];
+ return radiusAxis instanceof PolarAxis4 ? radiusAxis.shape === "circle" : false;
+ }
+ updateItemPath(node, datum, highlight) {
+ node.isBeveled = this.isRadiusAxisCircle();
+ node.isRadiusAxisReversed = this.isRadiusAxisReversed();
+ if (highlight) {
+ node.innerRadius = datum.innerRadius;
+ node.outerRadius = datum.outerRadius;
+ node.startAngle = datum.startAngle;
+ node.endAngle = datum.endAngle;
+ node.columnWidth = datum.columnWidth;
+ node.axisInnerRadius = datum.axisInnerRadius;
+ node.axisOuterRadius = datum.axisOuterRadius;
+ }
+ }
+ getColumnWidth(startAngle, endAngle) {
+ const { columnWidthRatio = 0.5, maxColumnWidthRatio = 0.5 } = this.properties;
+ return getRadialColumnWidth(startAngle, endAngle, this.radius, columnWidthRatio, maxColumnWidthRatio);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null || this.properties.label.itemStyler != null;
+ }
+};
+RadialColumnSeries.className = "RadialColumnSeries";
+RadialColumnSeries.type = "radial-column";
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport144 } from "ag-charts-community";
+import { boolean as boolean10, constant as constant22, number as number9, required as required22, string as string20 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs20, radialColumnSeriesThemeableOptionsDef } = _ModuleSupport144;
+var radialColumnSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs20,
+ ...radialColumnSeriesThemeableOptionsDef,
+ type: required22(constant22("radial-column")),
+ angleKey: required22(string20),
+ radiusKey: required22(string20),
+ angleName: string20,
+ radiusName: string20,
+ legendItemName: string20,
+ grouped: boolean10,
+ stacked: boolean10,
+ stackGroup: string20,
+ normalizedTo: number9
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnThemes.ts
+import { _ModuleSupport as _ModuleSupport145 } from "ag-charts-community";
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE8, POLAR_AXIS_SHAPE: POLAR_AXIS_SHAPE2 },
+ FILL_GRADIENT_RADIAL_SERIES_DEFAULTS: FILL_GRADIENT_RADIAL_SERIES_DEFAULTS2,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS6,
+ FILL_PATTERN_DEFAULTS: FILL_PATTERN_DEFAULTS4
+} = _ModuleSupport145;
+var RADIAL_COLUMN_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", FILL_GRADIENT_RADIAL_SERIES_DEFAULTS2],
+ ["image", FILL_IMAGE_DEFAULTS6],
+ ["pattern", FILL_PATTERN_DEFAULTS4]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ columnWidthRatio: 0.5,
+ maxColumnWidthRatio: 0.5,
+ strokeWidth: { $isUserOption: ["./stroke", 1, 0] },
+ label: {
+ ..._ModuleSupport145.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: _ModuleSupport145.multiSeriesHighlightStyle()
+ },
+ axes: {
+ [POLAR_AXIS_TYPE8.ANGLE_CATEGORY]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE2.CIRCLE },
+ groupPaddingInner: 0,
+ paddingInner: 0,
+ label: {
+ spacing: 10
+ }
+ },
+ [POLAR_AXIS_TYPE8.RADIUS_NUMBER]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE2.CIRCLE },
+ innerRadiusRatio: 0.5
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnModule.ts
+var { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE9 } = _ModuleSupport146.ThemeConstants;
+var RadialColumnModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radial-column",
+ moduleFactory: (ctx) => new RadialColumnSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE9.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE9.RADIUS_NUMBER }],
+ themeTemplate: RADIAL_COLUMN_SERIES_THEME,
+ stackable: true,
+ groupable: true
+};
+var RadialColumnSeriesModule = {
+ type: "series",
+ name: "radial-column",
+ chartType: "polar",
+ enterprise: true,
+ options: radialColumnSeriesOptionsDef,
+ create: (ctx) => new RadialColumnSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeModule.ts
+import { _ModuleSupport as _ModuleSupport151 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport150
+} from "ag-charts-community";
+import { cachedTextMeasurer as cachedTextMeasurer9, isArray as isArray6, measureTextSegments as measureTextSegments5, toPlainText as toPlainText7 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeNeedle.ts
+import { _ModuleSupport as _ModuleSupport147 } from "ag-charts-community";
+var { SvgPath, Rotatable, Translatable, Scalable: Scalable2 } = _ModuleSupport147;
+var RadialGaugeNeedle = class extends Rotatable(Scalable2(Translatable(SvgPath))) {
+ constructor() {
+ super(...arguments);
+ this.scalingCenterX = 0.5;
+ this.scalingCenterY = 0.5;
+ this.rotationCenterX = 0.5;
+ this.rotationCenterY = 0.5;
+ }
+};
+RadialGaugeNeedle.defaultPathData = "M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport148 } from "ag-charts-community";
+var { getColorStops: getColorStops2, normalizeAngle360: normalizeAngle3606, normalizeAngle360Inclusive: normalizeAngle360Inclusive2, toDegrees } = _ModuleSupport148;
+var { BaseProperties: BaseProperties11, makeSeriesTooltip: makeSeriesTooltip21, SeriesProperties: SeriesProperties12, PropertiesArray: PropertiesArray3, AxisLabel: AxisLabel4, Property: Property36, Label: Label14 } = _ModuleSupport148;
+var RadialGaugeDefaultTargetLabelProperties = class extends Label14 {
+};
+__decorateClass([
+ Property36
+], RadialGaugeDefaultTargetLabelProperties.prototype, "spacing", 2);
+var RadialGaugeTargetProperties = class extends BaseProperties11 {
+ constructor() {
+ super(...arguments);
+ this.label = new RadialGaugeDefaultTargetLabelProperties();
+ }
+ getStyle() {
+ const {
+ fill = "black",
+ fillOpacity = 1,
+ stroke = "black",
+ strokeWidth = 0,
+ strokeOpacity = 1,
+ lineDash = [0],
+ lineDashOffset = 0
+ } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "text", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "value", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "shape", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "placement", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "size", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "fill", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property36
+], RadialGaugeTargetProperties.prototype, "label", 2);
+var RadialGaugeBarProperties = class extends BaseProperties11 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.fills = new PropertiesArray3(_ModuleSupport148.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle(defaultColorRange, scale) {
+ const {
+ enabled,
+ fill,
+ fills,
+ fillMode,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ } = this;
+ const barFill = enabled ? fill ?? createConicGradient(fills, fillMode, defaultColorRange, scale) : "none";
+ return {
+ fill: barFill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "fills", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "fill", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property36
+], RadialGaugeBarProperties.prototype, "lineDashOffset", 2);
+var RadialGaugeScaleIntervalProperties = class extends BaseProperties11 {
+ constructor() {
+ super(...arguments);
+ this.values = void 0;
+ this.step = void 0;
+ this.minSpacing = 0;
+ this.maxSpacing = 1e3;
+ }
+};
+__decorateClass([
+ Property36
+], RadialGaugeScaleIntervalProperties.prototype, "values", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleIntervalProperties.prototype, "step", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleIntervalProperties.prototype, "minSpacing", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleIntervalProperties.prototype, "maxSpacing", 2);
+var RadialGaugeScaleLabelProperties = class extends AxisLabel4 {
+};
+var RadialGaugeScaleProperties = class extends BaseProperties11 {
+ constructor() {
+ super(...arguments);
+ this.min = 0;
+ this.max = 1;
+ this.fills = new PropertiesArray3(_ModuleSupport148.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.defaultFill = "black";
+ this.interval = new RadialGaugeScaleIntervalProperties();
+ this.label = new RadialGaugeScaleLabelProperties();
+ }
+ getStyle(barEnabled, defaultColorRange, scale) {
+ const {
+ fill,
+ fills,
+ defaultFill,
+ fillMode,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ } = this;
+ const scaleFill = fill ?? (barEnabled && fills.length === 0 ? defaultFill : void 0) ?? createConicGradient(fills, fillMode, defaultColorRange, scale);
+ return {
+ fill: scaleFill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "min", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "max", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "fills", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "fill", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "defaultFill", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "interval", 2);
+__decorateClass([
+ Property36
+], RadialGaugeScaleProperties.prototype, "label", 2);
+var RadialGaugeNeedleProperties = class extends BaseProperties11 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.spacing = 0;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "radiusRatio", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "fill", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property36
+], RadialGaugeNeedleProperties.prototype, "lineDashOffset", 2);
+var RadialGaugeLabelProperties = class extends AutoSizedLabel {
+};
+__decorateClass([
+ Property36
+], RadialGaugeLabelProperties.prototype, "text", 2);
+var RadialGaugeSecondaryLabelProperties = class extends AutoSizedSecondaryLabel {
+};
+__decorateClass([
+ Property36
+], RadialGaugeSecondaryLabelProperties.prototype, "text", 2);
+var RadialGaugeSeriesProperties = class extends SeriesProperties12 {
+ constructor() {
+ super(...arguments);
+ this.startAngle = 0;
+ this.endAngle = 0;
+ this.segmentation = new GaugeSegmentationProperties();
+ this.defaultColorRange = [];
+ this.targets = new PropertiesArray3(RadialGaugeTargetProperties);
+ this.defaultTarget = new RadialGaugeTargetProperties();
+ this.outerRadiusRatio = 1;
+ this.innerRadiusRatio = 1;
+ this.cornerRadius = 0;
+ this.cornerMode = "container";
+ this.spacing = 0;
+ this.scale = new RadialGaugeScaleProperties();
+ this.bar = new RadialGaugeBarProperties();
+ this.needle = new RadialGaugeNeedleProperties();
+ this.label = new RadialGaugeLabelProperties();
+ this.secondaryLabel = new RadialGaugeSecondaryLabelProperties();
+ this.tooltip = makeSeriesTooltip21();
+ }
+};
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "value", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "startAngle", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "endAngle", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "segmentation", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "targets", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "defaultTarget", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "outerRadiusRatio", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "innerRadiusRatio", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "outerRadius", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "innerRadius", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "cornerMode", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "scale", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "bar", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "needle", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "secondaryLabel", 2);
+__decorateClass([
+ Property36
+], RadialGaugeSeriesProperties.prototype, "tooltip", 2);
+function createConicGradient(fills, fillMode, defaultColorRange, scale) {
+ const { domain, range: range2 } = scale;
+ const [startAngle, endAngle] = range2;
+ const conicAngle = normalizeAngle3606((startAngle + endAngle) / 2 + Math.PI);
+ const sweepAngle = normalizeAngle360Inclusive2(endAngle - startAngle);
+ const colorStops = getColorStops2(fills, defaultColorRange, domain, fillMode).map(
+ ({ color: color6, stop }) => {
+ stop = Math.min(Math.max(stop, 0), 1);
+ const angle = startAngle + sweepAngle * stop;
+ stop = (angle - conicAngle) / (2 * Math.PI);
+ stop = (stop % 1 + 1) % 1;
+ return { stop, color: color6 };
+ }
+ );
+ return {
+ type: "gradient",
+ gradient: "conic",
+ colorSpace: "oklch",
+ colorStops,
+ bounds: "series",
+ rotation: toDegrees(conicAngle) + 90
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeUtil.ts
+import { _ModuleSupport as _ModuleSupport149 } from "ag-charts-community";
+import { toPlainText as toPlainText6 } from "ag-charts-core";
+var { SectorBox: SectorBox5 } = _ModuleSupport149;
+function computeClipSector(datum) {
+ const { startAngle, endAngle, clipStartAngle, clipEndAngle, innerRadius, outerRadius } = datum;
+ if (clipStartAngle == null || clipEndAngle == null)
+ return;
+ return new SectorBox5(
+ Math.max(clipStartAngle, startAngle),
+ Math.min(clipEndAngle, endAngle),
+ innerRadius,
+ outerRadius
+ );
+}
+function clipSectorVisibility(startAngle, endAngle, clipSector) {
+ return Math.max(startAngle, clipSector.startAngle) <= Math.min(endAngle, clipSector.endAngle);
+}
+function hasClipSector(datum) {
+ return datum.clipStartAngle != null && datum.clipEndAngle != null;
+}
+function datumClipSector(datum, zero) {
+ const { clipStartAngle, clipEndAngle, innerRadius, outerRadius } = datum;
+ return new SectorBox5(clipStartAngle, zero ? clipStartAngle : clipEndAngle, innerRadius, outerRadius);
+}
+function prepareRadialGaugeSeriesAnimationFunctions(initialLoad, initialStartAngle) {
+ const phase = initialLoad ? "initial" : "update";
+ const node = {
+ fromFn(sect, datum) {
+ const previousDatum = sect.previousDatum;
+ let { startAngle, endAngle } = previousDatum ?? datum;
+ const previousClipSector = previousDatum != null && hasClipSector(previousDatum) ? datumClipSector(previousDatum, initialLoad) : void 0;
+ const nextClipSector = hasClipSector(datum) ? datumClipSector(datum, initialLoad) : void 0;
+ let clipSector;
+ if (previousClipSector != null && nextClipSector != null) {
+ clipSector = previousClipSector;
+ } else if (previousClipSector == null && nextClipSector != null) {
+ clipSector = nextClipSector;
+ startAngle = datum.startAngle;
+ endAngle = datum.endAngle;
+ } else if (previousClipSector != null && nextClipSector == null) {
+ clipSector = void 0;
+ startAngle = datum.startAngle;
+ endAngle = datum.endAngle;
+ } else if (initialLoad) {
+ endAngle = startAngle;
+ }
+ return { startAngle, endAngle, clipSector, phase };
+ },
+ toFn(_sect, datum) {
+ const { startAngle, endAngle } = datum;
+ let clipSector;
+ if (hasClipSector(datum)) {
+ clipSector = datumClipSector(datum, false);
+ }
+ return { startAngle, endAngle, clipSector };
+ },
+ applyFn(sect, params) {
+ const { startAngle, endAngle } = params;
+ let { clipSector } = params;
+ if (clipSector != null) {
+ clipSector = new SectorBox5(
+ Math.max(startAngle, clipSector.startAngle),
+ Math.min(endAngle, clipSector.endAngle),
+ clipSector.innerRadius,
+ clipSector.outerRadius
+ );
+ }
+ const visible = clipSector == null || clipSectorVisibility(startAngle, endAngle, clipSector);
+ sect.startAngle = startAngle;
+ sect.endAngle = endAngle;
+ sect.clipSector = clipSector;
+ sect.visible = visible;
+ }
+ };
+ const needle = {
+ fromFn(needleNode) {
+ let { angle: rotation } = needleNode.previousDatum ?? needleNode.datum;
+ if (initialLoad) {
+ rotation = initialStartAngle;
+ }
+ return { rotation, phase };
+ },
+ toFn(_needleNode, datum) {
+ const { angle: rotation } = datum;
+ return { rotation };
+ }
+ };
+ return { node, needle };
+}
+function resetRadialGaugeSeriesResetSectorFunction(_node, datum) {
+ const { startAngle, endAngle } = datum;
+ const clipSector = computeClipSector(datum);
+ const visible = clipSector == null || clipSectorVisibility(startAngle, endAngle, clipSector);
+ return { startAngle, endAngle, clipSector, visible };
+}
+function resetRadialGaugeSeriesResetNeedleFunction(_node, datum) {
+ const { angle } = datum;
+ return { rotation: angle };
+}
+var verticalAlignFactors3 = {
+ top: 0,
+ middle: 0.5,
+ bottom: 1
+};
+function formatRadialGaugeLabels(series, ctx, selection, opts, innerRadius, datumOverrides) {
+ const { padding, textAlign, verticalAlign } = opts;
+ let labelDatum;
+ let secondaryLabelDatum;
+ selection.each((_node, datum) => {
+ if (datum.label === "primary" /* Primary */) {
+ labelDatum = datum;
+ } else if (datum.label === "secondary" /* Secondary */) {
+ secondaryLabelDatum = datum;
+ }
+ });
+ if (labelDatum == null)
+ return;
+ const labelText = getLabelText(series.id, ctx, labelDatum, datumOverrides?.label);
+ if (labelText == null)
+ return;
+ const secondaryLabelText = secondaryLabelDatum == null ? void 0 : getLabelText(series.id, ctx, secondaryLabelDatum, datumOverrides?.secondaryLabel);
+ const params = { padding };
+ const horizontalFactor = textAlign === "center" ? 2 : 1;
+ const verticalFactor = verticalAlign === "middle" ? 2 : 1;
+ const sizeFittingHeight = (height2) => ({
+ width: Math.sqrt(Math.max(innerRadius ** 2 - (height2 / verticalFactor) ** 2, 0)) * horizontalFactor,
+ height: Math.min(height2, verticalFactor * innerRadius),
+ meta: null
+ });
+ let labelLayout;
+ let secondaryLabelLayout;
+ let height;
+ if (secondaryLabelDatum != null && secondaryLabelText != null) {
+ const layout = formatStackedLabels(
+ toPlainText6(labelText),
+ labelDatum,
+ toPlainText6(secondaryLabelText),
+ secondaryLabelDatum,
+ params,
+ sizeFittingHeight
+ );
+ labelLayout = layout?.label;
+ secondaryLabelLayout = layout?.secondaryLabel;
+ height = layout?.height ?? 0;
+ } else {
+ const layout = formatSingleLabel(toPlainText6(labelText), labelDatum, params, sizeFittingHeight);
+ labelLayout = layout?.[0];
+ secondaryLabelLayout = void 0;
+ height = layout?.[0].height ?? 0;
+ }
+ const rectYOffset = height * verticalAlignFactors3[verticalAlign];
+ selection.each((label, datum) => {
+ let layout;
+ if (datum.label === "primary" /* Primary */) {
+ layout = labelLayout;
+ } else if (datum.label === "secondary" /* Secondary */) {
+ layout = secondaryLabelLayout;
+ }
+ if (layout == null) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.text = layout.text;
+ label.fontSize = layout.fontSize;
+ label.lineHeight = layout.lineHeight;
+ label.textAlign = textAlign;
+ label.textBaseline = "middle";
+ const rectOriginInLabelRect = datum.label === "primary" /* Primary */ ? layout.height / 2 : height - layout.height / 2;
+ label.y = datum.centerY + rectOriginInLabelRect - rectYOffset;
+ label.x = datum.centerX;
+ });
+}
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeSeries.ts
+var {
+ fromToMotion: fromToMotion5,
+ resetMotion: resetMotion4,
+ SeriesNodePickMode: SeriesNodePickMode15,
+ StateMachine: StateMachine4,
+ createDatumId: createDatumId19,
+ normalizeAngle360: normalizeAngle3607,
+ normalizeAngle360Inclusive: normalizeAngle360Inclusive3,
+ isBetweenAngles: isBetweenAngles2,
+ sectorBox,
+ toRadians: toRadians4,
+ BBox: BBox14,
+ Group: Group15,
+ PointerEvents: PointerEvents12,
+ Selection: Selection14,
+ Sector: Sector6,
+ SectorBox: SectorBox6,
+ Text: Text7,
+ Marker: Marker5,
+ tickFormat: tickFormat2,
+ applyShapeStyle: applyShapeStyle17,
+ mergeDefaults: mergeDefaults17
+} = _ModuleSupport150;
+var targetPlacementRotation = {
+ inside: 90,
+ middle: 0,
+ outside: -90
+};
+var outsideLabelPlacements = [
+ { textAlign: "left", textBaseline: "top" },
+ { textAlign: "right", textBaseline: "top" },
+ { textAlign: "right", textBaseline: "bottom" },
+ { textAlign: "left", textBaseline: "bottom" }
+];
+var insideLabelPlacements = [
+ { textAlign: "right", textBaseline: "bottom" },
+ { textAlign: "left", textBaseline: "bottom" },
+ { textAlign: "left", textBaseline: "top" },
+ { textAlign: "right", textBaseline: "top" }
+];
+var RadialGaugeSeries = class extends _ModuleSupport150.Series {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode15.EXACT_SHAPE_MATCH, SeriesNodePickMode15.NEAREST_NODE]
+ });
+ this.centerX = 0;
+ this.centerY = 0;
+ this.radius = 0;
+ this.textAlign = "center";
+ this.verticalAlign = "middle";
+ this.properties = new RadialGaugeSeriesProperties();
+ this.scale = new LinearAngleScale();
+ this.scaleGroup = this.contentGroup.appendChild(new Group15({ name: "scaleGroup" }));
+ this.itemGroup = this.contentGroup.appendChild(new Group15({ name: "itemGroup" }));
+ this.itemNeedleGroup = this.contentGroup.appendChild(new Group15({ name: "itemNeedleGroup" }));
+ this.itemTargetGroup = this.contentGroup.appendChild(new Group15({ name: "itemTargetGroup" }));
+ this.itemTargetLabelGroup = this.contentGroup.appendChild(new Group15({ name: "itemTargetLabelGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group15({ name: "itemLabelGroup" }));
+ this.highlightTargetGroup = this.highlightGroup.appendChild(
+ new Group15({ name: "itemTargetLabelGroup" })
+ );
+ this.tickGroup = this.contentGroup.appendChild(new Group15({ name: "tickGroup" }));
+ this.scaleSelection = Selection14.select(
+ this.scaleGroup,
+ () => this.nodeFactory()
+ );
+ this.datumSelection = Selection14.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.needleSelection = Selection14.select(
+ this.itemNeedleGroup,
+ RadialGaugeNeedle
+ );
+ this.targetSelection = Selection14.select(
+ this.itemTargetGroup,
+ () => this.markerFactory()
+ );
+ this.targetLabelSelection = Selection14.select(this.itemTargetLabelGroup, Text7);
+ this.labelSelection = Selection14.select(
+ this.itemLabelGroup,
+ Text7
+ );
+ this.highlightTargetSelection = Selection14.select(this.highlightTargetGroup, () => this.markerFactory());
+ this.tickSelection = Selection14.select(this.tickGroup, _ModuleSupport150.TransformableText);
+ this.datumUnion = new DatumUnion();
+ this.animationState = new StateMachine4("empty", {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateEmptyUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ updateData: "waiting",
+ clear: "clearing",
+ resize: () => this.animateReadyResize(),
+ reset: "empty",
+ skip: "ready"
+ },
+ waiting: {
+ update: {
+ target: "ready",
+ action: () => this.animateWaitingUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ clearing: {
+ update: {
+ target: "empty"
+ },
+ reset: "empty",
+ skip: "ready"
+ }
+ });
+ this.scaleGroup.pointerEvents = PointerEvents12.None;
+ this.tickGroup.pointerEvents = PointerEvents12.None;
+ this.itemNeedleGroup.pointerEvents = PointerEvents12.None;
+ this.itemLabelGroup.pointerEvents = PointerEvents12.None;
+ }
+ get hasData() {
+ return this.properties.value != null;
+ }
+ nodeFactory() {
+ return new Sector6();
+ }
+ markerFactory() {
+ const marker = new Marker5();
+ marker.size = 1;
+ return marker;
+ }
+ processData() {
+ this.nodeDataRefresh = true;
+ this.animationState.transition("updateData");
+ }
+ formatLabel(value) {
+ const { min, max } = this.properties.scale;
+ return formatLabel(value, { min, max });
+ }
+ layoutScale() {
+ const { scale, properties } = this;
+ const { seriesRectWidth, seriesRectHeight } = this.nodeDataDependencies;
+ const { scale: scaleProps, outerRadius } = this.properties;
+ const { min, max, label, interval } = scaleProps;
+ const startAngle = toRadians4(properties.startAngle - 90);
+ const endAngle = toRadians4(properties.endAngle - 90);
+ const sweepAngle = normalizeAngle360Inclusive3(endAngle - startAngle);
+ const largerThanHalf = sweepAngle > Math.PI;
+ const containsTop = largerThanHalf || isBetweenAngles2(1.5 * Math.PI, startAngle, endAngle);
+ const containsRight = largerThanHalf || isBetweenAngles2(0 * Math.PI, startAngle, endAngle);
+ const containsBottom = largerThanHalf || isBetweenAngles2(0.5 * Math.PI, startAngle, endAngle);
+ const containsLeft = largerThanHalf || isBetweenAngles2(1 * Math.PI, startAngle, endAngle);
+ let textAlign;
+ if (containsLeft && !containsRight) {
+ textAlign = "right";
+ } else if (!containsLeft && containsRight) {
+ textAlign = "left";
+ } else {
+ textAlign = "center";
+ }
+ let verticalAlign;
+ if (containsTop && !containsBottom) {
+ verticalAlign = "bottom";
+ } else if (!containsTop && containsBottom) {
+ verticalAlign = "top";
+ } else {
+ verticalAlign = "middle";
+ }
+ const unitBox = sectorBox({
+ startAngle,
+ endAngle,
+ innerRadius: 0,
+ outerRadius: 0.5
+ });
+ const centerXOffset = -(unitBox.x + unitBox.width / 2) * 2;
+ const centerYOffset = -(unitBox.y + unitBox.height / 2) * 2;
+ const unitBoxSize = Math.min(seriesRectWidth / unitBox.width, seriesRectHeight / unitBox.height);
+ scale.domain = [min, max];
+ scale.range = [startAngle, endAngle];
+ scale.arcLength = unitBoxSize / 2;
+ const { maxSpacing, minSpacing } = interval;
+ const { arcLength } = scale;
+ const minTickCount = maxSpacing ? Math.floor(arcLength / maxSpacing) : 1;
+ const maxTickCount = minSpacing ? Math.floor(arcLength / minSpacing) : Infinity;
+ const preferredTickCount = Math.floor(4 / Math.PI * Math.abs(scale.range[0] - scale.range[1]));
+ const tickCount = Math.max(minTickCount, Math.min(maxTickCount, preferredTickCount));
+ const ticks = interval.values ?? scale.ticks({
+ nice: false,
+ interval: interval.step,
+ minTickCount,
+ maxTickCount,
+ tickCount
+ })?.ticks ?? [];
+ const tickFormatter = tickFormat2(ticks, typeof label.format === "string" ? label.format : void 0);
+ const measurer = cachedTextMeasurer9(label);
+ const tickData = ticks.map((value, index) => {
+ let text;
+ if (label.formatter) {
+ text = formatWithContext(this.ctx, label.formatter, {
+ value,
+ index,
+ domain: scale.domain,
+ boundSeries: void 0
+ });
+ }
+ text ?? (text = tickFormatter?.(value));
+ if (text == null)
+ return;
+ const { width, height } = isArray6(text) ? measureTextSegments5(text, label) : measurer.measureLines(text);
+ return { index, value, text, width, height };
+ }).filter((value) => value != null);
+ const maxWidth = tickData.reduce((m, t) => Math.max(m, t.width), 0);
+ const maxHeight = tickData.reduce((m, t) => Math.max(m, t.height), 0);
+ const labelInset = label.enabled ? Math.max(maxWidth, maxHeight) + label.spacing : 0;
+ const radiusBounds = Math.max(
+ 0.5 * unitBoxSize - labelInset,
+ // seriesRect may have negative size
+ 0
+ );
+ const radius = outerRadius ?? radiusBounds;
+ this.centerX = seriesRectWidth / 2 + centerXOffset * radius;
+ this.centerY = seriesRectHeight / 2 + centerYOffset * radius;
+ this.radius = radius;
+ this.textAlign = textAlign;
+ this.verticalAlign = verticalAlign;
+ return tickData;
+ }
+ getShapeFillBBox() {
+ const { centerX, centerY, radius } = this;
+ const bbox = new BBox14(centerX - radius, centerY - radius, 2 * radius, 2 * radius);
+ return {
+ series: bbox,
+ axis: bbox
+ };
+ }
+ getTargets() {
+ const { properties } = this;
+ const defaultTarget = properties.defaultTarget;
+ return Array.from(properties.targets).map((target) => {
+ const {
+ text = defaultTarget.text,
+ value = defaultTarget.value ?? 0,
+ shape = defaultTarget.shape ?? "triangle",
+ rotation = defaultTarget.rotation ?? 0,
+ placement = defaultTarget.placement ?? "middle",
+ spacing = defaultTarget.spacing ?? 0,
+ size = defaultTarget.size ?? 0
+ } = target;
+ const {
+ enabled: labelEnabled = defaultTarget.label.enabled,
+ color: labelColor = defaultTarget.label.color ?? "black",
+ fontStyle: labelFontStyle = defaultTarget.label.fontStyle ?? "normal",
+ fontWeight: labelFontWeight = defaultTarget.label.fontWeight ?? "normal",
+ fontSize: labelFontSize = defaultTarget.label.fontSize,
+ fontFamily: labelFontFamily = defaultTarget.label.fontFamily,
+ spacing: labelSpacing = defaultTarget.label.spacing ?? 0
+ } = target.label;
+ return {
+ text,
+ value,
+ shape,
+ placement,
+ spacing,
+ size,
+ rotation,
+ label: {
+ enabled: labelEnabled,
+ color: labelColor,
+ fontStyle: labelFontStyle,
+ fontWeight: labelFontWeight,
+ fontSize: labelFontSize,
+ fontFamily: labelFontFamily,
+ spacing: labelSpacing
+ },
+ style: target.getStyle()
+ };
+ });
+ }
+ getTargetRadius(target) {
+ const { radius, properties } = this;
+ const { innerRadiusRatio, outerRadiusRatio } = properties;
+ const { placement, spacing, size } = target;
+ const outerRadius = radius * outerRadiusRatio;
+ const innerRadius = radius * innerRadiusRatio;
+ switch (placement) {
+ case "inside":
+ return Math.max(innerRadius - spacing - size / 2, 0);
+ case "outside":
+ return outerRadius + spacing + size / 2;
+ default:
+ return (innerRadius + outerRadius) / 2;
+ }
+ }
+ getTargetLabel(target) {
+ const { scale } = this;
+ const { value, size, placement, label } = target;
+ const { spacing, color: fill, fontStyle, fontWeight, fontSize, fontFamily } = label;
+ const lineHeight = void 0;
+ const angle = scale.convert(value);
+ const quadrant = Math.trunc(normalizeAngle3607(angle) / (Math.PI / 2));
+ const offset = size / 2 + spacing;
+ let textAlign;
+ let textBaseline;
+ let offsetX;
+ let offsetY;
+ switch (placement) {
+ case "outside":
+ ({ textAlign, textBaseline } = outsideLabelPlacements[quadrant]);
+ offsetX = offset * Math.cos(angle);
+ offsetY = offset * Math.sin(angle);
+ break;
+ case "inside":
+ ({ textAlign, textBaseline } = insideLabelPlacements[quadrant]);
+ offsetX = -offset * Math.cos(angle);
+ offsetY = -offset * Math.sin(angle);
+ break;
+ default:
+ textAlign = "center";
+ textBaseline = "bottom";
+ offsetX = 0;
+ offsetY = -offset;
+ break;
+ }
+ return {
+ offsetX,
+ offsetY,
+ fill,
+ textAlign,
+ textBaseline,
+ fontStyle,
+ fontWeight,
+ fontSize,
+ fontFamily,
+ lineHeight
+ };
+ }
+ createNodeData() {
+ const tickData = this.layoutScale();
+ const { id: seriesId, scale, properties, radius, centerX, centerY } = this;
+ const {
+ value,
+ innerRadiusRatio,
+ outerRadiusRatio,
+ segmentation,
+ cornerRadius,
+ cornerMode,
+ needle,
+ bar,
+ scale: scaleProps,
+ label,
+ secondaryLabel
+ } = properties;
+ const {
+ outerRadius = radius * outerRadiusRatio,
+ innerRadius = radius * innerRadiusRatio,
+ defaultColorRange
+ } = properties;
+ const targets = this.getTargets();
+ const nodeData = [];
+ const targetData = [];
+ const needleData = [];
+ const labelData = [];
+ const scaleData = [];
+ const cornersOnAllItems = cornerMode === "item";
+ const containerStartAngle = scale.convert(scale.domain[0]);
+ const containerEndAngle = scale.convert(value);
+ const maxTicks = Math.ceil(normalizeAngle360Inclusive3(containerEndAngle - containerStartAngle) * radius);
+ let segments = segmentation.enabled ? segmentation.interval.getSegments(scale, maxTicks) : void 0;
+ const barStyle = bar.getStyle(defaultColorRange, scale);
+ const scaleStyle = scaleProps.getStyle(bar.enabled, defaultColorRange, scale);
+ if (segments == null && cornersOnAllItems) {
+ const segmentStart = Math.min(...scale.domain);
+ const segmentEnd = Math.max(...scale.domain);
+ const datum = { value, segmentStart, segmentEnd };
+ const appliedCornerRadius = Math.min(cornerRadius, (outerRadius - innerRadius) / 2);
+ const angleInset = appliedCornerRadius / ((innerRadius + outerRadius) / 2);
+ nodeData.push({
+ series: this,
+ itemId: `value`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: containerStartAngle - angleInset,
+ endAngle: containerEndAngle + angleInset,
+ clipStartAngle: void 0,
+ clipEndAngle: void 0,
+ startCornerRadius: cornerRadius,
+ endCornerRadius: cornerRadius,
+ style: barStyle
+ });
+ scaleData.push({
+ series: this,
+ itemId: `scale`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: scale.range[0] - angleInset,
+ endAngle: scale.range[1] + angleInset,
+ clipStartAngle: void 0,
+ clipEndAngle: void 0,
+ startCornerRadius: cornerRadius,
+ endCornerRadius: cornerRadius,
+ style: scaleStyle
+ });
+ } else {
+ segments ?? (segments = scale.domain);
+ for (let i = 0; i < segments.length - 1; i++) {
+ const segmentStart = segments[i];
+ const segmentEnd = segments[i + 1];
+ const datum = { value, segmentStart, segmentEnd };
+ const isStart = i === 0;
+ const isEnd = i === segments.length - 2;
+ const itemStartAngle = scale.convert(segmentStart);
+ const itemEndAngle = scale.convert(segmentEnd);
+ nodeData.push({
+ series: this,
+ itemId: `value-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: itemStartAngle,
+ endAngle: itemEndAngle,
+ clipStartAngle: containerStartAngle,
+ clipEndAngle: containerEndAngle,
+ startCornerRadius: cornersOnAllItems || isStart ? cornerRadius : 0,
+ endCornerRadius: cornersOnAllItems || isEnd ? cornerRadius : 0,
+ style: barStyle
+ });
+ scaleData.push({
+ series: this,
+ itemId: `scale-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: itemStartAngle,
+ endAngle: itemEndAngle,
+ clipStartAngle: void 0,
+ clipEndAngle: void 0,
+ startCornerRadius: cornersOnAllItems || isStart ? cornerRadius : 0,
+ endCornerRadius: cornersOnAllItems || isEnd ? cornerRadius : 0,
+ style: scaleStyle
+ });
+ }
+ }
+ if (!needle.enabled && label.enabled) {
+ const {
+ text,
+ color: fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter = (params) => this.formatLabel(params.value)
+ } = label;
+ labelData.push({
+ label: "primary" /* Primary */,
+ centerX,
+ centerY,
+ text,
+ value,
+ fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter
+ });
+ }
+ if (!needle.enabled && secondaryLabel.enabled) {
+ const {
+ text,
+ color: fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter
+ } = secondaryLabel;
+ labelData.push({
+ label: "secondary" /* Secondary */,
+ centerX,
+ centerY,
+ text,
+ value,
+ fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter
+ });
+ }
+ if (needle.enabled) {
+ let needleRadius = needle.radiusRatio == null ? innerRadius : radius * needle.radiusRatio;
+ needleRadius = Math.max(needleRadius - needle.spacing, 0);
+ const needleAngle = scale.convert(value);
+ needleData.push({
+ centerX,
+ centerY,
+ radius: needleRadius,
+ angle: needleAngle,
+ series: this
+ });
+ }
+ for (let i = 0; i < targets.length; i += 1) {
+ const target = targets[i];
+ const { value: targetValue, text, size, shape, style } = target;
+ if (targetValue < Math.min(...scale.domain) || targetValue > Math.max(...scale.domain)) {
+ continue;
+ }
+ const targetRadius = this.getTargetRadius(target);
+ const targetAngle = scale.convert(targetValue);
+ const targetRotation = toRadians4(target.rotation + targetPlacementRotation[target.placement]);
+ targetData.push({
+ series: this,
+ itemId: `target-${i}`,
+ midPoint: {
+ x: targetRadius * Math.cos(targetAngle) + centerX,
+ y: targetRadius * Math.sin(targetAngle) + centerY
+ },
+ datum: { value: targetValue },
+ datumIndex: { type: 1 /* Target */, index: i },
+ type: 1 /* Target */,
+ value: targetValue,
+ text,
+ centerX,
+ centerY,
+ shape,
+ radius: targetRadius,
+ angle: targetAngle,
+ rotation: targetRotation,
+ size,
+ label: this.getTargetLabel(target),
+ style
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ needleData,
+ targetData,
+ labelData,
+ scaleData,
+ tickData
+ };
+ }
+ updateSelections(resize) {
+ if (this.nodeDataRefresh || resize) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ highlightDatum(node) {
+ if (node != null && node.series === this && node.type === 1 /* Target */) {
+ return node;
+ }
+ }
+ update({ seriesRect }) {
+ const {
+ datumSelection,
+ labelSelection,
+ needleSelection,
+ targetSelection,
+ targetLabelSelection,
+ scaleSelection,
+ highlightTargetSelection,
+ tickSelection
+ } = this;
+ const resize = this.checkResize(seriesRect);
+ this.updateSelections(resize);
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = this.getOpacity();
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ const needleData = this.contextNodeData?.needleData ?? [];
+ const targetData = this.contextNodeData?.targetData ?? [];
+ const scaleData = this.contextNodeData?.scaleData ?? [];
+ const tickData = this.contextNodeData?.tickData ?? [];
+ const highlightTargetDatum = this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());
+ this.scaleSelection = this.updateScaleSelection({ scaleData, scaleSelection });
+ this.updateScaleNodes({ scaleSelection });
+ this.needleSelection = this.updateNeedleSelection({ needleData, needleSelection });
+ this.updateNeedleNodes({ needleSelection });
+ this.targetSelection = this.updateTargetSelection({ targetData, targetSelection });
+ this.updateTargetStyles({ targetSelection, isHighlight: false });
+ this.updateTargetNodes({ targetSelection });
+ this.targetLabelSelection = this.updateTargetLabelSelection({ targetData, targetLabelSelection });
+ this.updateTargetLabelNodes({ targetLabelSelection });
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection });
+ this.highlightTargetSelection = this.updateTargetSelection({
+ targetData: highlightTargetDatum == null ? [] : [highlightTargetDatum],
+ targetSelection: highlightTargetSelection
+ });
+ this.updateTargetStyles({ targetSelection: highlightTargetSelection, isHighlight: true });
+ this.updateTargetNodes({ targetSelection: highlightTargetSelection });
+ this.tickSelection = this.updateTickSelection({ tickData, tickSelection });
+ this.updateTickNodes({ tickSelection });
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => {
+ return createDatumId19(opts.nodeData.length, datum.itemId);
+ });
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ const { ctx, properties } = this;
+ const { segmentation } = properties;
+ const sectorSpacing = segmentation.spacing ?? 0;
+ const animationDisabled = ctx.animationManager.isSkipped();
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((sector, datum) => {
+ const { centerX, centerY, innerRadius, outerRadius, startCornerRadius, endCornerRadius } = datum;
+ sector.centerX = centerX;
+ sector.centerY = centerY;
+ sector.innerRadius = innerRadius;
+ sector.outerRadius = outerRadius;
+ sector.pointerEvents = this.properties.bar.enabled ? _ModuleSupport150.PointerEvents.All : _ModuleSupport150.PointerEvents.None;
+ applyShapeStyle17(sector, datum.style, fillBBox);
+ sector.startOuterCornerRadius = startCornerRadius;
+ sector.startInnerCornerRadius = startCornerRadius;
+ sector.endOuterCornerRadius = endCornerRadius;
+ sector.endInnerCornerRadius = endCornerRadius;
+ sector.radialEdgeInset = (sectorSpacing + sector.strokeWidth) / 2;
+ sector.concentricEdgeInset = sector.strokeWidth / 2;
+ if (animationDisabled || sector.previousDatum == null) {
+ sector.setProperties(resetRadialGaugeSeriesResetSectorFunction(sector, datum));
+ }
+ });
+ this.datumUnion.update(datumSelection, this.itemGroup, _ModuleSupport150.Sector, (node, first, last) => {
+ node.clipSector ?? (node.clipSector = new SectorBox6(Number.NaN, Number.NaN, Number.NaN, Number.NaN));
+ node.centerX = first.centerX;
+ node.centerY = first.centerY;
+ node.outerRadius = node.clipSector.outerRadius = first.outerRadius;
+ node.innerRadius = node.clipSector.innerRadius = first.innerRadius;
+ node.startAngle = node.clipSector.startAngle = first.startAngle;
+ node.startInnerCornerRadius = first.startInnerCornerRadius;
+ node.startOuterCornerRadius = first.startOuterCornerRadius;
+ node.endAngle = last.endAngle;
+ node.clipSector.endAngle = last.clipSector?.endAngle ?? last.endAngle;
+ node.endInnerCornerRadius = last.endInnerCornerRadius;
+ node.endOuterCornerRadius = last.endOuterCornerRadius;
+ node.pointerEvents = _ModuleSupport150.PointerEvents.None;
+ });
+ }
+ updateScaleSelection(opts) {
+ return opts.scaleSelection.update(opts.scaleData, void 0, (datum) => {
+ return createDatumId19(opts.scaleData.length, datum.itemId);
+ });
+ }
+ updateScaleNodes(opts) {
+ const { scaleSelection } = opts;
+ const { segmentation } = this.properties;
+ const sectorSpacing = segmentation.spacing ?? 0;
+ const fillBBox = this.getShapeFillBBox();
+ scaleSelection.each((sector, datum) => {
+ const { centerX, centerY, innerRadius, outerRadius, startCornerRadius, endCornerRadius } = datum;
+ sector.centerX = centerX;
+ sector.centerY = centerY;
+ sector.innerRadius = innerRadius;
+ sector.outerRadius = outerRadius;
+ applyShapeStyle17(sector, datum.style, fillBBox);
+ sector.startOuterCornerRadius = startCornerRadius;
+ sector.startInnerCornerRadius = startCornerRadius;
+ sector.endOuterCornerRadius = endCornerRadius;
+ sector.endInnerCornerRadius = endCornerRadius;
+ sector.radialEdgeInset = (sectorSpacing + sector.strokeWidth) / 2;
+ sector.concentricEdgeInset = sector.strokeWidth / 2;
+ sector.setProperties(resetRadialGaugeSeriesResetSectorFunction(sector, datum));
+ });
+ }
+ updateNeedleSelection(opts) {
+ return opts.needleSelection.update(opts.needleData, void 0, () => createDatumId19(0));
+ }
+ updateNeedleNodes(opts) {
+ const { needleSelection } = opts;
+ const { fill, fillOpacity, stroke, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.properties.needle;
+ const animationDisabled = this.ctx.animationManager.isSkipped();
+ needleSelection.each((needle, datum) => {
+ const { centerX, centerY, radius } = datum;
+ const scale = radius * 2;
+ needle.d = RadialGaugeNeedle.defaultPathData;
+ applyShapeStyle17(needle, {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeOpacity,
+ strokeWidth: strokeWidth / scale,
+ lineDash: lineDash.map((d) => d / scale),
+ lineDashOffset: lineDashOffset / scale
+ });
+ needle.translationX = centerX;
+ needle.translationY = centerY;
+ needle.scalingX = scale;
+ needle.scalingY = scale;
+ if (animationDisabled) {
+ needle.setProperties(resetRadialGaugeSeriesResetNeedleFunction(needle, datum));
+ }
+ });
+ }
+ updateTargetSelection(opts) {
+ return opts.targetSelection.update(opts.targetData, void 0, (target) => target.itemId);
+ }
+ updateTargetStyles({
+ targetSelection,
+ isHighlight
+ }) {
+ targetSelection.each((_, datum) => {
+ datum.style = this.getTargetStyle(isHighlight, datum);
+ });
+ }
+ updateTargetNodes({
+ targetSelection
+ }) {
+ targetSelection.each((target, datum) => {
+ const { centerX, centerY, angle, radius, shape, size, rotation } = datum;
+ applyShapeStyle17(target, datum.style);
+ target.size = size;
+ target.shape = shape === "line" ? lineMarker : shape;
+ target.translationX = centerX + radius * Math.cos(angle);
+ target.translationY = centerY + radius * Math.sin(angle);
+ target.rotation = angle + rotation;
+ });
+ }
+ getTargetStyle(isHighlight, { datumIndex, style }) {
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ return mergeDefaults17(highlightStyle, {
+ ...style,
+ opacity: 1
+ });
+ }
+ updateTargetLabelSelection(opts) {
+ return opts.targetLabelSelection.update(opts.targetData, void 0, (target) => target.itemId);
+ }
+ updateTargetLabelNodes(opts) {
+ const { targetLabelSelection } = opts;
+ targetLabelSelection.each((label, target) => {
+ const { centerX, centerY, radius, angle, text } = target;
+ const { offsetX, offsetY, fill, fontStyle, fontWeight, fontSize, fontFamily, textAlign, textBaseline } = target.label;
+ if (text == null) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.x = centerX + radius * Math.cos(angle) + offsetX;
+ label.y = centerY + radius * Math.sin(angle) + offsetY;
+ label.text = text;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = textBaseline;
+ });
+ }
+ updateLabelSelection(opts) {
+ return opts.labelSelection.update(opts.labelData, void 0, (datum) => datum.label);
+ }
+ updateLabelNodes(opts) {
+ const { labelSelection } = opts;
+ const animationDisabled = this.ctx.animationManager.isSkipped();
+ labelSelection.each((label, datum) => {
+ label.fill = datum.fill;
+ label.fontStyle = datum.fontStyle;
+ label.fontWeight = datum.fontWeight;
+ label.fontFamily = datum.fontFamily;
+ });
+ if (animationDisabled || this.labelsHaveExplicitText()) {
+ this.formatLabelText();
+ }
+ }
+ updateTickSelection(opts) {
+ return opts.tickSelection.update(opts.tickData, void 0, (datum) => datum.index);
+ }
+ updateTickNodes(opts) {
+ const { scale, radius, centerX, centerY, properties } = this;
+ const { enabled, color: color6, fontFamily, fontSize, fontStyle, fontWeight, spacing } = properties.scale.label;
+ const rotation = toRadians4(properties.scale.label.rotation ?? 0);
+ opts.tickSelection.each((label, datum) => {
+ if (!enabled) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.text = datum.text;
+ label.fill = color6;
+ label.fontFamily = fontFamily;
+ label.fontSize = fontSize;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ const angle = scale.convert(datum.value);
+ const { width, height } = datum;
+ const originX = Math.abs(radius * Math.cos(angle));
+ const originY = Math.abs(radius * Math.sin(angle));
+ const x0 = Math.min(Math.max(Math.abs(radius / Math.tan(angle)), originX - width / 2), originX + width / 2);
+ const y0 = Math.min(
+ Math.max(Math.abs(radius * Math.tan(angle)), originY - height / 2),
+ originY + height / 2
+ );
+ const outerR = Math.hypot(x0, y0);
+ const x = centerX + (outerR + spacing) * Math.cos(angle);
+ const y = centerY + (outerR + spacing) * Math.sin(angle);
+ label.x = x;
+ label.y = y;
+ label.rotationCenterX = x;
+ label.rotationCenterY = y;
+ label.rotation = rotation;
+ });
+ }
+ labelsHaveExplicitText() {
+ for (const { datum } of this.labelSelection) {
+ if (datum.text == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+ formatLabelText(datum) {
+ const { labelSelection, radius, textAlign, verticalAlign } = this;
+ const { spacing: padding, innerRadiusRatio } = this.properties;
+ formatRadialGaugeLabels(
+ this,
+ this.ctx,
+ labelSelection,
+ { padding, textAlign, verticalAlign },
+ radius * innerRadiusRatio,
+ datum
+ );
+ }
+ resetAllAnimation() {
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ resetMotion4([this.datumSelection], resetRadialGaugeSeriesResetSectorFunction);
+ resetMotion4([this.needleSelection], resetRadialGaugeSeriesResetNeedleFunction);
+ this.formatLabelText();
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ animateLabelText(params = {}) {
+ const { animationManager } = this.ctx;
+ let labelFrom;
+ let labelTo;
+ let secondaryLabelFrom;
+ let secondaryLabelTo;
+ this.labelSelection.each((label, datum) => {
+ label.opacity = 1;
+ if (datum.label === "primary" /* Primary */) {
+ labelFrom = label.previousDatum?.value ?? params.from ?? datum.value;
+ labelTo = datum.value;
+ } else if (datum.label === "secondary" /* Secondary */) {
+ secondaryLabelFrom = label.previousDatum?.value ?? params.from ?? datum.value;
+ secondaryLabelTo = datum.value;
+ }
+ });
+ if (this.labelsHaveExplicitText()) {
+ } else if (labelTo == null || secondaryLabelTo == null) {
+ this.formatLabelText();
+ } else if (labelFrom === labelTo && secondaryLabelFrom === secondaryLabelTo) {
+ this.formatLabelText({ label: labelTo, secondaryLabel: secondaryLabelTo });
+ } else {
+ const animationId = `${this.id}_labels`;
+ animationManager.animate({
+ id: animationId,
+ groupId: "label",
+ from: { label: labelFrom, secondaryLabel: secondaryLabelFrom },
+ to: { label: labelTo, secondaryLabel: secondaryLabelTo },
+ phase: params.phase ?? "update",
+ onUpdate: (datum) => this.formatLabelText(datum),
+ onStop: () => this.formatLabelText({ label: labelTo, secondaryLabel: secondaryLabelTo })
+ });
+ }
+ }
+ animateEmptyUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node, needle } = prepareRadialGaugeSeriesAnimationFunctions(true, this.scale.range[0]);
+ fromToMotion5(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ fromToMotion5(this.id, "needle", animationManager, [this.needleSelection], needle, () => "needle");
+ fromToMotion5(
+ this.id,
+ "label",
+ animationManager,
+ [this.labelSelection],
+ fadeInFns,
+ (_label, datum) => datum.label
+ );
+ this.animateLabelText({
+ from: this.properties.scale.min,
+ phase: "initial"
+ });
+ }
+ animateWaitingUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node, needle } = prepareRadialGaugeSeriesAnimationFunctions(false, this.scale.range[0]);
+ fromToMotion5(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ fromToMotion5(this.id, "needle", animationManager, [this.needleSelection], needle, () => "needle");
+ this.animateLabelText();
+ }
+ animateReadyResize() {
+ this.resetAllAnimation();
+ }
+ dataCount() {
+ return Number.NaN;
+ }
+ getSeriesDomain() {
+ return [Number.NaN, Number.NaN];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties } = this;
+ const { tooltip } = properties;
+ let value;
+ let text;
+ let fallbackLabel;
+ if (datumIndex.type === 0 /* Node */) {
+ value = properties.value;
+ text = properties.label.text;
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeValue");
+ } else {
+ ({ value, text } = properties.targets[datumIndex.index]);
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeTarget");
+ }
+ if (value == null)
+ return;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ data: [{ label: text, fallbackLabel, value: this.formatLabel(value) }]
+ },
+ { seriesId, title: void 0, datum: void 0, value }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return pickGaugeNearestDatum(this, point);
+ }
+ pickFocus(opts) {
+ return pickGaugeFocus(this, opts);
+ }
+ getCaptionText() {
+ const { value } = this.properties;
+ const description = [];
+ description.push(this.formatLabel(value));
+ this.labelSelection.each((_label, datum) => {
+ const text = getLabelText(this.id, this.ctx, datum);
+ if (text != null) {
+ description.push(toPlainText7(text));
+ }
+ });
+ return description.join(". ");
+ }
+ getCategoryValue(_datumIndex) {
+ return;
+ }
+ datumIndexForCategoryValue(_categoryValue) {
+ return;
+ }
+ hasItemStylers() {
+ return this.properties.label.itemStyler != null;
+ }
+};
+RadialGaugeSeries.className = "RadialGaugeSeries";
+RadialGaugeSeries.type = "radial-gauge";
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeModule.ts
+var { FONT_SIZE_RATIO } = _ModuleSupport151;
+var RadialGaugeModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "radial-gauge",
+ moduleFactory: (ctx) => new RadialGaugeSeries(ctx),
+ themeTemplate: {
+ minWidth: 200,
+ minHeight: 200,
+ tooltip: {
+ enabled: false
+ },
+ series: {
+ outerRadiusRatio: 1,
+ innerRadiusRatio: 0.8,
+ startAngle: 270,
+ endAngle: 270 + 180,
+ defaultColorRange: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $interpolate: [{ $palette: "secondDivergingColors" }, 5] },
+ _ModuleSupport151.SAFE_RANGE2_OPERATION
+ ]
+ },
+ scale: {
+ // @ts-expect-error undocumented option
+ defaultFill: { $path: ["/1", { $palette: "fill" }, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ stroke: { $path: ["/2", _ModuleSupport151.SAFE_STROKE_FILL_OPERATION, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ spacing: 12
+ }
+ },
+ bar: {
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ segmentation: {
+ enabled: false,
+ interval: {},
+ spacing: 2
+ },
+ defaultTarget: {
+ fill: { $ref: "foregroundColor" },
+ stroke: { $ref: "foregroundColor" },
+ size: 10,
+ shape: "triangle",
+ placement: "outside",
+ spacing: 5,
+ label: {
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ spacing: 5
+ }
+ },
+ needle: {
+ enabled: false,
+ fill: { $ref: "foregroundColor" },
+ spacing: 10
+ },
+ label: {
+ ..._ModuleSupport151.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: 56,
+ minimumFontSize: 18 / 56,
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" }
+ },
+ secondaryLabel: {
+ ..._ModuleSupport151.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $rem: FONT_SIZE_RATIO.LARGE },
+ minimumFontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "subtleTextColor" }
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", 10] }
+ }
+ }
+ }
+};
+var RadialGaugeSeriesModule = {
+ type: "series",
+ name: "radial-gauge",
+ chartType: "standalone",
+ enterprise: true,
+ options: _ModuleSupport151.radialGaugeSeriesOptionsDef,
+ create: (ctx) => new RadialGaugeSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeyModule.ts
+import { _ModuleSupport as _ModuleSupport156 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeries.ts
+import {
+ _ModuleSupport as _ModuleSupport154
+} from "ag-charts-community";
+import { Logger as Logger12, cachedTextMeasurer as cachedTextMeasurer10, calcLineHeight as calcLineHeight2, toPlainText as toPlainText8, wrapText as wrapText2 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeyLink.ts
+import { _ModuleSupport as _ModuleSupport152 } from "ag-charts-community";
+import { clamp as clamp3 } from "ag-charts-core";
+var { BBox: BBox15, Path: Path12, Vec2, SceneChangeDetection: SceneChangeDetection7 } = _ModuleSupport152;
+var SankeyLink = class extends Path12 {
+ constructor() {
+ super(...arguments);
+ this.x1 = 0;
+ this.x2 = 0;
+ this.y1 = 0;
+ this.y2 = 0;
+ this.height = 0;
+ this.inset = 0;
+ this.elbows = [];
+ }
+ computeBBox() {
+ const x = Math.min(this.x1, this.x2);
+ const width = Math.max(this.x1, this.x2) - x;
+ const y = Math.min(this.y1, this.y2);
+ const height = Math.max(this.y1, this.y2) - y + this.height;
+ return new BBox15(x, y, width, height);
+ }
+ updatePath() {
+ const { path, inset } = this;
+ path.clear();
+ const height = this.height - 2 * this.inset;
+ const offset = height / 2;
+ let x1 = this.x1 + inset;
+ let y1 = this.y1 + inset;
+ path.moveTo(x1, y1);
+ for (const elbow of this.elbows) {
+ this.updatePathSection(x1, y1, elbow.x, elbow.y, height, -offset);
+ x1 = elbow.x;
+ y1 = elbow.y;
+ }
+ const x2 = this.x2 - inset;
+ const y2 = this.y2 + inset;
+ this.updatePathSection(x1, y1, x2, y2, height, -offset);
+ path.lineTo(x2, y2 + height);
+ x1 = x2;
+ y1 = y2;
+ for (const elbow of this.elbows.toReversed()) {
+ this.updatePathSection(x1, y1, elbow.x, elbow.y, height, offset);
+ x1 = elbow.x;
+ y1 = elbow.y;
+ }
+ this.updatePathSection(x1, y1, this.x1 + inset, this.y1 + inset, height, offset);
+ path.closePath();
+ }
+ updatePathSection(x1, y1, x2, y2, height, yOffset) {
+ const { path } = this;
+ const start = Vec2.from(x1, y1 + yOffset + height / 2);
+ const end = Vec2.from(x2, y2 + yOffset + height / 2);
+ if (Math.abs(end.y - start.y) < 2) {
+ path.lineTo(end.x, end.y);
+ return;
+ }
+ let angle = Vec2.angle(Vec2.sub(end, start));
+ if (angle < 0)
+ angle = 2 * Math.PI + angle;
+ const right = 0;
+ const down = Math.PI / 2;
+ const left = Math.PI;
+ const up = Math.PI * 1.5;
+ const innerArc = getArcValues(start, end, 0);
+ const outerArc = getArcValues(start, end, height);
+ if (innerArc.radius < height) {
+ path.cubicCurveTo((start.x + end.x) / 2, start.y, (start.x + end.x) / 2, end.y, end.x, end.y);
+ return;
+ }
+ if (angle >= up) {
+ path.arc(start.x, y1 - innerArc.radius, innerArc.radius, down, down + outerArc.angle, true);
+ path.arc(end.x, y2 + outerArc.radius, outerArc.radius, up + outerArc.angle, up);
+ path.lineTo(end.x, end.y);
+ } else if (angle > right && angle <= down) {
+ path.arc(start.x, y1 + outerArc.radius, outerArc.radius, up, up + outerArc.angle);
+ path.arc(end.x, y2 - innerArc.radius, innerArc.radius, down + innerArc.angle, down, true);
+ path.lineTo(end.x, end.y);
+ } else if (angle > down && angle <= left) {
+ path.arc(start.x, y1 + outerArc.radius, outerArc.radius - height, up, up + outerArc.angle, true);
+ path.arc(end.x, y2 - innerArc.radius, innerArc.radius + height, down + innerArc.angle, down);
+ path.lineTo(end.x, end.y);
+ } else {
+ path.arc(start.x, y1 - innerArc.radius, innerArc.radius + height, down, down + innerArc.angle);
+ path.arc(end.x, y2 + outerArc.radius, outerArc.radius - height, up + outerArc.angle, up, true);
+ path.lineTo(end.x, end.y);
+ }
+ }
+};
+__decorateClass([
+ SceneChangeDetection7()
+], SankeyLink.prototype, "x1", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], SankeyLink.prototype, "x2", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], SankeyLink.prototype, "y1", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], SankeyLink.prototype, "y2", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], SankeyLink.prototype, "height", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], SankeyLink.prototype, "inset", 2);
+function getArcValues(start, end, minRadius) {
+ const lineAngle = Vec2.angle(Vec2.sub(end, start));
+ const chordLength = Vec2.distance(start, end);
+ const bisect = Vec2.add(start, Vec2.rotate(Vec2.from(chordLength / 2, 0), lineAngle));
+ const gradient = -1 / Vec2.gradient(start, end);
+ const intercept = Vec2.intercept(bisect, gradient);
+ const offset = lerpClamp(0.1, 0.5, Math.PI / 2 - Math.abs(Vec2.gradient(start, end)));
+ const center = Vec2.intersectAtX(gradient, intercept, start.x);
+ const radius = Math.max(minRadius, Vec2.distance(start, center) * offset);
+ const angle = Vec2.angle(Vec2.sub(center, start), Vec2.sub(center, bisect)) / -(1.1 - offset);
+ return { angle, radius };
+}
+function lerpClamp(a, b, ratio3) {
+ return clamp3(a, (b - a) * ratio3 + a, b);
+}
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeriesProperties.ts
+import {
+ _ModuleSupport as _ModuleSupport153
+} from "ag-charts-community";
+var {
+ BaseProperties: BaseProperties12,
+ FillGradientDefaults: FillGradientDefaults2,
+ FillPatternDefaults: FillPatternDefaults2,
+ FillImageDefaults: FillImageDefaults2,
+ makeSeriesTooltip: makeSeriesTooltip22,
+ SeriesProperties: SeriesProperties13,
+ Property: Property37,
+ Label: Label15
+} = _ModuleSupport153;
+var SankeySeriesLabelProperties = class extends Label15 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.placement = void 0;
+ this.edgePlacement = void 0;
+ }
+};
+__decorateClass([
+ Property37
+], SankeySeriesLabelProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLabelProperties.prototype, "placement", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLabelProperties.prototype, "edgePlacement", 2);
+var SankeySeriesLinkProperties = class extends BaseProperties12 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "fill", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property37
+], SankeySeriesLinkProperties.prototype, "itemStyler", 2);
+var SankeySeriesNodeProperties = class extends BaseProperties12 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.minSpacing = 0;
+ this.width = 1;
+ this.alignment = "justify";
+ this.verticalAlignment = "center";
+ this.sort = "auto";
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "minSpacing", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "width", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "alignment", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "verticalAlignment", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "sort", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "fill", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property37
+], SankeySeriesNodeProperties.prototype, "itemStyler", 2);
+var SankeySeriesProperties = class extends SeriesProperties13 {
+ constructor() {
+ super();
+ this.nodes = void 0;
+ this.idKey = "";
+ this.idName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.sizeKey = void 0;
+ this.sizeName = void 0;
+ this.fillGradientDefaults = new FillGradientDefaults2();
+ this.fillPatternDefaults = new FillPatternDefaults2();
+ this.fillImageDefaults = new FillImageDefaults2();
+ this.defaultColorRange = [];
+ this.defaultPatternFills = [];
+ this.fills = [];
+ this.strokes = [];
+ this.label = new SankeySeriesLabelProperties();
+ this.link = new SankeySeriesLinkProperties();
+ this.node = new SankeySeriesNodeProperties();
+ this.tooltip = makeSeriesTooltip22();
+ this.highlightStyle.deprecated = false;
+ }
+ getStyle(isLink, fills, strokes, index) {
+ const {
+ fillOpacity,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ fill = fills[index % fills.length],
+ stroke = strokes[index % fills.length]
+ } = isLink ? this.link : this.node;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "nodes", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "fromKey", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "toKey", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "fillGradientDefaults", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "fillPatternDefaults", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "fillImageDefaults", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "defaultPatternFills", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "fills", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "link", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "node", 2);
+__decorateClass([
+ Property37
+], SankeySeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeries.ts
+var {
+ Transformable: Transformable3,
+ applyShapeStyle: applyShapeStyle18,
+ SeriesNodePickMode: SeriesNodePickMode16,
+ createDatumId: createDatumId20,
+ getShapeStyle: getShapeStyle2,
+ getLabelStyles: getLabelStyles6,
+ Rect: Rect6,
+ BBox: BBox16,
+ mergeDefaults: mergeDefaults18
+} = _ModuleSupport154;
+var SankeySeries = class extends FlowProportionSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode16.NEAREST_NODE, SeriesNodePickMode16.EXACT_SHAPE_MATCH]
+ });
+ this.properties = new SankeySeriesProperties();
+ }
+ isLabelEnabled() {
+ return (this.properties.labelKey != null || this.nodes == null) && this.properties.label.enabled;
+ }
+ linkFactory() {
+ return new SankeyLink();
+ }
+ nodeFactory() {
+ return new Rect6();
+ }
+ createNodeData() {
+ const {
+ id: seriesId,
+ _nodeDataDependencies: { seriesRectWidth, seriesRectHeight } = { seriesRectWidth: 0, seriesRectHeight: 0 }
+ } = this;
+ const {
+ fromKey,
+ toKey,
+ sizeKey,
+ labelKey,
+ label: { spacing: labelSpacing, placement: labelPlacement, edgePlacement: edgeLabelPlacement },
+ node: { width: nodeWidth, alignment }
+ } = this.properties;
+ const createNode = (node) => ({
+ ...node,
+ x: Number.NaN,
+ y: Number.NaN,
+ width: nodeWidth,
+ height: Number.NaN
+ });
+ const createLink = (link) => ({
+ ...link,
+ x1: Number.NaN,
+ x2: Number.NaN,
+ y1: Number.NaN,
+ y2: Number.NaN,
+ height: Number.NaN,
+ elbows: []
+ });
+ const {
+ nodeGraph: baseNodeGraph,
+ links,
+ maxPathLength
+ } = this.getNodeGraph(createNode, createLink, { includeCircularReferences: false });
+ const nodeGraph = baseNodeGraph;
+ if (nodeGraph.size === 0)
+ return;
+ const columns = [];
+ for (let index = 0; index < maxPathLength; index += 1) {
+ columns.push({ index, size: 0, nodes: [], x: 0 });
+ }
+ for (const graphNode of nodeGraph.values()) {
+ const { datum: node, linksBefore, linksAfter, maxPathLengthBefore, maxPathLengthAfter } = graphNode;
+ const size = Math.max(
+ linksBefore.reduce((acc, { link }) => acc + link.size, 0),
+ linksAfter.reduce((acc, { link }) => acc + link.size, 0)
+ );
+ if (linksBefore.length === 0 && linksAfter.length === 0 || size === 0) {
+ graphNode.columnIndex = -1;
+ continue;
+ }
+ let column;
+ switch (alignment) {
+ case "left":
+ column = columns[maxPathLengthBefore];
+ break;
+ case "right":
+ column = columns[maxPathLength - 1 - maxPathLengthAfter];
+ break;
+ case "center": {
+ if (linksBefore.length !== 0) {
+ column = columns[maxPathLengthBefore];
+ } else if (linksAfter.length === 0) {
+ column = columns[0];
+ } else {
+ const columnIndex = linksAfter.reduce(
+ (acc, link) => Math.min(acc, link.node.maxPathLengthBefore),
+ maxPathLength
+ ) - 1;
+ column = columns[columnIndex];
+ }
+ break;
+ }
+ case "justify": {
+ column = linksAfter.length === 0 ? columns[maxPathLength - 1] : columns[maxPathLengthBefore];
+ break;
+ }
+ }
+ node.size = size;
+ const { label } = this.properties;
+ const labelText = label.enabled ? this.getLabelText(
+ node.label,
+ node.datum,
+ labelKey,
+ "label",
+ [],
+ this.properties.label,
+ { datum: node.datum, value: node.label, fromKey, toKey, sizeKey, size }
+ ) : void 0;
+ node.label = toPlainText8(labelText);
+ column.nodes.push(graphNode);
+ column.size += size;
+ graphNode.columnIndex = column.index;
+ }
+ const measurer = cachedTextMeasurer10(this.properties.label);
+ let columnLabelInsetBefore = 0;
+ let columnLabelInsetAfter = 0;
+ if (this.isLabelEnabled()) {
+ if (labelPlacement == null && edgeLabelPlacement == null) {
+ columnLabelInsetBefore = (seriesRectWidth - nodeWidth) * (1 - maxPathLength / (maxPathLength + 1));
+ columnLabelInsetAfter = columnLabelInsetBefore;
+ } else if (edgeLabelPlacement === "outside" || edgeLabelPlacement == null) {
+ const reduceLabelWidthFn = (acc, n) => {
+ const node = n;
+ if (node.datum.label == null || node.datum.label === "")
+ return acc;
+ let maxWidth = (seriesRectWidth - nodeWidth) / (maxPathLength - 1) - labelSpacing;
+ if (labelPlacement === "center" && edgeLabelPlacement == null)
+ maxWidth /= 2;
+ const text = wrapText2(node.datum.label, {
+ maxWidth,
+ maxHeight: node.datum.height,
+ font: this.properties.label,
+ textWrap: "never"
+ });
+ let { width } = measurer.measureLines(text);
+ if (labelPlacement === "center" && edgeLabelPlacement == null)
+ width /= 2;
+ return Math.max(acc, width);
+ };
+ if (labelPlacement !== "right" || edgeLabelPlacement === "outside") {
+ columnLabelInsetBefore = nodeWidth + columns[0].nodes.reduce(reduceLabelWidthFn, 0);
+ }
+ if (labelPlacement !== "left" || edgeLabelPlacement === "outside") {
+ columnLabelInsetAfter = nodeWidth + columns.at(-1).nodes.reduce(reduceLabelWidthFn, 0);
+ }
+ }
+ }
+ const columnWidth = (seriesRectWidth - nodeWidth - columnLabelInsetBefore - columnLabelInsetAfter) / (maxPathLength - 1);
+ for (let index = 0; index < columns.length; index++) {
+ const column = columns[index];
+ column.x = columnLabelInsetBefore + index * columnWidth;
+ for (const graphNode of column.nodes) {
+ graphNode.datum.x = column.x;
+ }
+ }
+ for (const graphNode of nodeGraph.values()) {
+ graphNode.weight = 0;
+ let closestColumnDiff = Infinity;
+ for (const link of graphNode.linksAfter) {
+ const node = link.node;
+ closestColumnDiff = Math.min(closestColumnDiff, node.columnIndex - graphNode.columnIndex);
+ }
+ if (closestColumnDiff === Infinity) {
+ for (const link of graphNode.linksBefore) {
+ const node = link.node;
+ closestColumnDiff = Math.min(closestColumnDiff, graphNode.columnIndex - node.columnIndex);
+ }
+ }
+ graphNode.closestColumnDiff = closestColumnDiff;
+ for (const link of graphNode.linksAfter) {
+ const node = link.node;
+ if (node.columnIndex <= graphNode.columnIndex)
+ continue;
+ for (let i = node.columnIndex - 1; i > graphNode.columnIndex; i--) {
+ const size = link.link.size;
+ const ghostNode = {
+ ghost: true,
+ datum: { ...graphNode.datum, size, y: 0, height: 0 },
+ weight: 0,
+ linksBefore: [{ node: { columnIndex: i - 1, datum: { size } } }],
+ linksAfter: [{ node: { columnIndex: i + 1, datum: { size } } }],
+ link: link.link,
+ columnIndex: graphNode.columnIndex,
+ size: graphNode.datum.size,
+ closestColumnDiff,
+ fromNode: { y: node.datum.y },
+ toNode: { y: 0 }
+ };
+ columns[i].size += size;
+ columns[i].nodes.push(ghostNode);
+ }
+ }
+ }
+ const sortedColumns = columns.toSorted((a, b) => {
+ const aMax = a.nodes.reduce((acc, n) => Math.max(acc, n.datum.size), 0);
+ const bMax = b.nodes.reduce((acc, n) => Math.max(acc, n.datum.size), 0);
+ return bMax - aMax;
+ });
+ const columnWeights = {};
+ for (let i = 0; i < sortedColumns.length; i++) {
+ columnWeights[sortedColumns[i].index] = Math.pow(10, sortedColumns.length - i - 1);
+ }
+ for (const column of columns) {
+ for (const node of column.nodes) {
+ node.weight = node.datum.size / column.size * columnWeights[column.index];
+ if ("ghost" in node && node.ghost) {
+ node.weight = node.size / column.size * columnWeights[column.index];
+ continue;
+ }
+ node.weight += node.linksBefore.reduce((acc, before) => {
+ if (before.node.columnIndex !== column.index - 1)
+ return acc;
+ const weight = before.node.datum.size / columns[before.node.columnIndex].size * columnWeights[before.node.columnIndex];
+ return Math.max(acc, weight);
+ }, 0);
+ node.weight += node.linksAfter.reduce((acc, after) => {
+ if (after.node.columnIndex !== column.index + 1)
+ return acc;
+ const weight = after.node.datum.size / columns[after.node.columnIndex].size * columnWeights[after.node.columnIndex];
+ return Math.max(acc, weight);
+ }, 0);
+ }
+ column.nodes.sort((a, b) => this.sortNodes(a, b));
+ }
+ const minSize = 1;
+ const getSizeScale = (spacing) => {
+ return columns.reduce((acc, { size, nodes }) => {
+ const spacingAccomodation = seriesRectHeight - nodes.length * minSize;
+ const spacingOccupation = (nodes.length - 1) * spacing / spacingAccomodation;
+ const columnSizeScale = (1 - spacingOccupation) / size;
+ return Math.min(acc, columnSizeScale);
+ }, Infinity);
+ };
+ let nodeSpacing = this.properties.node.spacing;
+ let sizeScale = getSizeScale(nodeSpacing);
+ while (sizeScale < 0 && nodeSpacing > this.properties.node.minSpacing) {
+ nodeSpacing -= 1;
+ sizeScale = getSizeScale(nodeSpacing);
+ }
+ if (sizeScale < 0) {
+ Logger12.warnOnce(
+ "There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container."
+ );
+ return;
+ }
+ for (const column of columns) {
+ let columnNodesHeight = 0;
+ for (const node of column.nodes) {
+ const height = seriesRectHeight * node.datum.size * sizeScale;
+ node.datum.height = Math.max(minSize, height);
+ columnNodesHeight += height;
+ }
+ const spacingOccupation = nodeSpacing * (column.nodes.length - 1);
+ let y = 0;
+ if (this.properties.node.verticalAlignment === "bottom") {
+ y = seriesRectHeight - columnNodesHeight - spacingOccupation;
+ } else if (this.properties.node.verticalAlignment === "center") {
+ y = (seriesRectHeight - columnNodesHeight - spacingOccupation) / 2;
+ }
+ for (const node of column.nodes) {
+ node.datum.y = y;
+ y += seriesRectHeight * node.datum.size * sizeScale + nodeSpacing;
+ if ("ghost" in node && node.ghost) {
+ node.link.elbows.push({ x: column.x, y: node.datum.y });
+ }
+ }
+ }
+ for (const { datum, linksBefore, linksAfter } of nodeGraph.values()) {
+ let y2 = datum.y;
+ linksBefore.sort(
+ (a, b) => this.sortNodes(a.node, b.node)
+ );
+ for (const { link } of linksBefore) {
+ link.y2 = y2;
+ y2 += link.size * seriesRectHeight * sizeScale;
+ }
+ let y1 = datum.y;
+ linksAfter.sort(
+ (a, b) => this.sortNodes(a.node, b.node, {
+ invertColumnSort: true
+ })
+ );
+ for (const { link } of linksAfter) {
+ link.y1 = y1;
+ y1 += link.size * seriesRectHeight * sizeScale;
+ }
+ }
+ const nodeData = [];
+ const labelData = [];
+ const { fontSize } = this.properties.label;
+ for (const [index, column] of columns.entries()) {
+ const leading = index === 0;
+ const trailing = index === columns.length - 1;
+ let bottom = -Infinity;
+ column.nodes.sort((a, b) => a.datum.y - b.datum.y);
+ for (const n of column.nodes) {
+ if ("ghost" in n && n.ghost)
+ continue;
+ const { datum: node } = n;
+ node.midPoint = {
+ x: node.x + node.width / 2,
+ y: node.y + node.height / 2
+ };
+ nodeData.push(node);
+ if (node.label == null)
+ continue;
+ const y = node.y + node.height / 2;
+ let text;
+ if (!leading && !trailing) {
+ const lineHeight = calcLineHeight2(fontSize);
+ const y12 = y - lineHeight;
+ const y2 = y + lineHeight;
+ let maxX = seriesRectWidth;
+ for (const { datum } of nodeGraph.values()) {
+ const intersectsLabel = datum.x > node.x && Math.max(datum.y, y12) <= Math.min(datum.y + datum.height, y2);
+ if (intersectsLabel) {
+ maxX = Math.min(maxX, datum.x - labelSpacing);
+ }
+ }
+ const maxWidth = maxX - node.x - 2 * labelSpacing;
+ text = wrapText2(node.label, {
+ maxWidth,
+ maxHeight: node.height,
+ font: this.properties.label,
+ textWrap: "never",
+ overflow: "hide"
+ });
+ }
+ if (text == null || text === "") {
+ const labelInset = edgeLabelPlacement == null && (leading || trailing) ? labelSpacing : labelSpacing * 2;
+ text = wrapText2(node.label, {
+ maxWidth: columnWidth - labelInset,
+ maxHeight: node.height,
+ font: this.properties.label,
+ textWrap: "never"
+ });
+ }
+ if (text === "")
+ continue;
+ const { height } = measurer.measureLines(text);
+ const y0 = y - height / 2;
+ const y1 = y + height / 2;
+ let x = node.x + node.width + labelSpacing;
+ let textAlign = "left";
+ let placement = labelPlacement;
+ if (leading && edgeLabelPlacement == null && labelPlacement == null) {
+ placement = "left";
+ }
+ if (edgeLabelPlacement === "outside") {
+ if (leading)
+ placement = "left";
+ if (trailing)
+ placement = "right";
+ } else if (edgeLabelPlacement === "inside") {
+ if (leading)
+ placement = "right";
+ if (trailing)
+ placement = "left";
+ }
+ if (placement === "left") {
+ x = node.x - labelSpacing;
+ textAlign = "right";
+ } else if (placement === "center") {
+ x = node.x + node.width / 2;
+ textAlign = "center";
+ }
+ if (y0 >= bottom) {
+ labelData.push({ x, y, textAlign, text, size: node.size });
+ bottom = y1;
+ }
+ }
+ }
+ for (const link of links) {
+ const { fromNode, toNode, size } = link;
+ link.height = Math.max(minSize, seriesRectHeight * size * sizeScale);
+ link.x1 = fromNode.x + nodeWidth;
+ link.x2 = toNode.x;
+ link.midPoint = {
+ x: (link.x1 + link.x2) / 2,
+ y: (link.y1 + link.y2) / 2 + link.height / 2
+ };
+ nodeData.push(link);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ sortNodes(a, b, opts) {
+ const { properties } = this;
+ if (properties.node.sort === "ascending") {
+ return (a.datum.label ?? "").localeCompare(b.datum.label ?? "");
+ } else if (properties.node.sort === "descending") {
+ return (b.datum.label ?? "").localeCompare(a.datum.label ?? "");
+ } else if (properties.node.sort === "data") {
+ return 0;
+ }
+ if (a.columnIndex < b.columnIndex)
+ return opts?.invertColumnSort ? 1 : -1;
+ if (a.columnIndex > b.columnIndex)
+ return opts?.invertColumnSort ? -1 : 1;
+ if (a.weight === b.weight) {
+ return a.datum.size - b.datum.size;
+ }
+ if (a.closestColumnDiff < b.closestColumnDiff)
+ return 1;
+ if (a.closestColumnDiff > b.closestColumnDiff)
+ return -1;
+ return a.weight - b.weight;
+ }
+ updateLabelSelection(opts) {
+ const labels = this.isLabelEnabled() ? opts.labelData : [];
+ return opts.labelSelection.update(labels);
+ }
+ updateLabelNodes(opts) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, datum) => {
+ const { x, y, textAlign, text } = datum;
+ const params = datum;
+ const style = getLabelStyles6(this, void 0, params, this.properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontSize, fontFamily } = style;
+ label.visible = true;
+ label.x = x;
+ label.y = y;
+ label.text = text;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = "middle";
+ label.setBoxing(style);
+ });
+ }
+ updateNodeSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId20(datum.type, datum.id));
+ }
+ getNodeStyle(nodeDatum, fromNodeDatumIndex, isHighlight) {
+ const { properties } = this;
+ const {
+ fills,
+ strokes,
+ defaultColorRange,
+ defaultPatternFills,
+ fillGradientDefaults: fillGradientDefaults3,
+ fillPatternDefaults: fillPatternDefaults3,
+ fillImageDefaults: fillImageDefaults3
+ } = properties;
+ const { itemStyler } = properties.node;
+ const defaultColorStops = defaultColorRange[fromNodeDatumIndex % defaultColorRange.length].map((color6) => ({
+ color: color6
+ }));
+ const defaultPatternFill = defaultPatternFills[fromNodeDatumIndex % defaultPatternFills.length];
+ const highlightStyle = this.getHighlightStyle(isHighlight, nodeDatum.datumIndex);
+ const baseStyle = mergeDefaults18(highlightStyle, properties.getStyle(false, fills, strokes, fromNodeDatumIndex));
+ const hasNodeFill = properties.node.fill != null;
+ let style = getShapeStyle2(
+ baseStyle,
+ hasNodeFill ? fillGradientDefaults3 : { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ hasNodeFill ? fillPatternDefaults3 : { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ if (itemStyler != null && nodeDatum.datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId20(nodeDatum.datumIndex.index, "node", isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults18(
+ overrides,
+ style,
+ { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ makeItemStylerParams({ datum, datumIndex, size = 0, label }, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ size,
+ label,
+ fill
+ };
+ }
+ updateNodeNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const { datumIndex } = datum;
+ const style = this.getNodeStyle(datum, datumIndex.index, isHighlight);
+ rect.x = datum.x;
+ rect.y = datum.y;
+ rect.width = Math.max(datum.width, 0);
+ rect.height = Math.max(datum.height, 0);
+ applyShapeStyle18(rect, style, fillBBox);
+ });
+ }
+ getShapeFillBBox() {
+ const width = this._nodeDataDependencies?.seriesRectWidth ?? 0;
+ const height = this._nodeDataDependencies?.seriesRectHeight ?? 0;
+ const bbox = new BBox16(0, 0, width, height);
+ return { series: bbox, axis: bbox };
+ }
+ updateLinkSelection(opts) {
+ return opts.datumSelection.update(
+ opts.nodeData,
+ void 0,
+ (datum) => createDatumId20(datum.type, datum.index, datum.fromNode.id, datum.toNode.id)
+ );
+ }
+ getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, isHighlight) {
+ const { id: seriesId, properties } = this;
+ const {
+ fills,
+ strokes,
+ defaultColorRange,
+ defaultPatternFills,
+ fillGradientDefaults: fillGradientDefaults3,
+ fillPatternDefaults: fillPatternDefaults3,
+ fillImageDefaults: fillImageDefaults3
+ } = properties;
+ const { itemStyler } = properties.link;
+ const defaultColorStops = defaultColorRange[fromNodeDatumIndex.index % defaultColorRange.length].map(
+ (color6) => ({
+ color: color6
+ })
+ );
+ const defaultPatternFill = defaultPatternFills[fromNodeDatumIndex.index % defaultPatternFills.length];
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults18(
+ highlightStyle,
+ properties.getStyle(true, fills, strokes, fromNodeDatumIndex.index)
+ );
+ const hasLinkFill = properties.link.fill != null;
+ let style = getShapeStyle2(
+ baseStyle,
+ hasLinkFill ? fillGradientDefaults3 : { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ hasLinkFill ? fillPatternDefaults3 : { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId20(datumIndex.index, "link", isHighlight ? "highlight" : "node"),
+ () => {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ return this.callWithContext(itemStyler, {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style
+ });
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults18(
+ overrides,
+ style,
+ { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ updateLinkNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((link, datum) => {
+ const fromNodeDatumIndex = datum.fromNode.datumIndex;
+ const style = this.getLinkStyle(datum, fromNodeDatumIndex, isHighlight);
+ link.x1 = datum.x1;
+ link.y1 = datum.y1;
+ link.x2 = datum.x2;
+ link.y2 = datum.y2;
+ link.height = datum.height;
+ link.elbows = datum.elbows;
+ applyShapeStyle18(link, style, fillBBox);
+ link.inset = link.strokeWidth / 2;
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ linksProcessedData,
+ nodesProcessedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const { fromKey, toKey, sizeKey, sizeName, tooltip } = properties;
+ const seriesDatum = this.contextNodeData?.nodeData.find(
+ (d) => d.datumIndex.type === datumIndex.type && d.datumIndex.index === datumIndex.index
+ );
+ if (seriesDatum == null)
+ return;
+ const nodeIndex = seriesDatum.type === 0 /* Link */ ? seriesDatum.fromNode.index : seriesDatum.index;
+ const title = seriesDatum.type === 0 /* Link */ ? `${seriesDatum.fromNode.label} - ${seriesDatum.toNode.label}` : seriesDatum.label;
+ const datum = datumIndex.type === 0 /* Link */ ? linksProcessedData?.dataSources.get(this.id)?.data[datumIndex.index] : nodesProcessedData?.dataSources.get(this.id)?.data[datumIndex.index];
+ const size = seriesDatum.size;
+ let format;
+ if (seriesDatum.type === 0 /* Link */) {
+ const fromNodeDatumIndex = seriesDatum.fromNode.datumIndex;
+ format = this.getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, false);
+ } else {
+ format = this.getNodeStyle({ datumIndex, datum }, datumIndex.index, false);
+ }
+ const data = [];
+ if (sizeKey != null) {
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: size,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain: [],
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(size) });
+ }
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title,
+ symbol: this.legendItemSymbol(seriesDatum.type, nodeIndex, format),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ fromKey,
+ toKey,
+ sizeKey,
+ sizeName,
+ size,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(node) {
+ if (node instanceof Rect6) {
+ const { x, y, width, height } = node;
+ const bbox = new BBox16(x, y, width, height);
+ return Transformable3.toCanvas(this.contentGroup, bbox);
+ }
+ return node;
+ }
+ hasItemStylers() {
+ return this.properties.node.itemStyler != null || this.properties.link.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+SankeySeries.className = "SankeySeries";
+SankeySeries.type = "sankey";
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport155 } from "ag-charts-community";
+import {
+ arrayOf as arrayOf4,
+ color as color4,
+ constant as constant23,
+ fillGradientDefaults as fillGradientDefaults2,
+ fillImageDefaults as fillImageDefaults2,
+ fillPatternDefaults as fillPatternDefaults2,
+ required as required23,
+ string as string21,
+ undocumented as undocumented7
+} from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs21, sankeySeriesThemeableOptionsDef } = _ModuleSupport155;
+var sankeySeriesOptionsDef = {
+ ...sankeySeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs21,
+ type: required23(constant23("sankey")),
+ fromKey: required23(string21),
+ toKey: required23(string21),
+ sizeKey: string21,
+ sizeName: string21
+};
+sankeySeriesOptionsDef.fillGradientDefaults = undocumented7(fillGradientDefaults2);
+sankeySeriesOptionsDef.fillPatternDefaults = undocumented7(fillPatternDefaults2);
+sankeySeriesOptionsDef.fillImageDefaults = undocumented7(fillImageDefaults2);
+sankeySeriesOptionsDef.defaultColorRange = undocumented7(arrayOf4(arrayOf4(color4)));
+sankeySeriesOptionsDef.defaultPatternFills = undocumented7(arrayOf4(color4));
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeyModule.ts
+var SankeyModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ solo: true,
+ identifier: "sankey",
+ moduleFactory: (ctx) => new SankeySeries(ctx),
+ themeTemplate: {
+ seriesArea: {
+ padding: {
+ top: 10,
+ bottom: 10
+ }
+ },
+ series: {
+ fills: { $palette: "fills" },
+ strokes: { $palette: "strokes" },
+ // @ts-expect-error undocumented option
+ fillGradientDefaults: _ModuleSupport156.FILL_GRADIENT_LINEAR_DEFAULTS,
+ fillPatternDefaults: _ModuleSupport156.FILL_PATTERN_DEFAULTS,
+ fillImageDefaults: _ModuleSupport156.FILL_IMAGE_DEFAULTS,
+ defaultColorRange: { $palette: "gradients" },
+ defaultPatternFills: _ModuleSupport156.SAFE_FILLS_OPERATION,
+ highlightStyle: {
+ series: {
+ dimOpacity: 0.2
+ }
+ },
+ highlight: {
+ ..._ModuleSupport156.singleSeriesHighlightStyle()
+ },
+ label: {
+ ..._ModuleSupport156.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ spacing: 10
+ },
+ node: {
+ spacing: { $if: [{ $greaterThan: [{ $path: "./minSpacing" }, 20] }, { $path: "./minSpacing" }, 20] },
+ minSpacing: 0,
+ width: 10,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ link: {
+ fillOpacity: 0.5,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ }
+ },
+ legend: {
+ enabled: false,
+ toggleSeries: false
+ }
+ }
+};
+var SankeySeriesModule = {
+ type: "series",
+ name: "sankey",
+ chartType: "standalone",
+ enterprise: true,
+ options: sankeySeriesOptionsDef,
+ create: (ctx) => new SankeySeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstModule.ts
+import { _ModuleSupport as _ModuleSupport160 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeries.ts
+import { _ModuleSupport as _ModuleSupport158 } from "ag-charts-community";
+import { toPlainText as toPlainText9 } from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport157 } from "ag-charts-community";
+var { HierarchySeriesProperties, HighlightStyle, makeSeriesTooltip: makeSeriesTooltip23, Property: Property38 } = _ModuleSupport157;
+var SunburstSeriesTileHighlightStyle = class extends HighlightStyle {
+ constructor() {
+ super(false);
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedLabel();
+ }
+};
+__decorateClass([
+ Property38
+], SunburstSeriesTileHighlightStyle.prototype, "fill", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesTileHighlightStyle.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesTileHighlightStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesTileHighlightStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesTileHighlightStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesTileHighlightStyle.prototype, "label", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesTileHighlightStyle.prototype, "secondaryLabel", 2);
+var SunburstSeriesProperties = class extends HierarchySeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.fillOpacity = 1;
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.cornerRadius = 0;
+ this.highlightStyle = new SunburstSeriesTileHighlightStyle();
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedSecondaryLabel();
+ this.tooltip = makeSeriesTooltip23();
+ }
+ getStyle(index) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity } = this;
+ return {
+ fill: fills[index % fills.length],
+ fillOpacity,
+ stroke: strokes[index % strokes.length],
+ strokeWidth,
+ strokeOpacity,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "secondaryLabelKey", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "sectorSpacing", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "padding", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "highlightStyle", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "secondaryLabel", 2);
+__decorateClass([
+ Property38
+], SunburstSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeries.ts
+var {
+ fromToMotion: fromToMotion6,
+ normalizeAngle360: normalizeAngle3608,
+ createDatumId: createDatumId21,
+ PointerEvents: PointerEvents13,
+ Sector: Sector7,
+ Group: Group16,
+ ScalableGroup,
+ Selection: Selection15,
+ TransformableText: TransformableText3,
+ BBox: BBox17,
+ applyShapeStyle: applyShapeStyle19,
+ mergeDefaults: mergeDefaults19,
+ formatValue: formatValue2,
+ getLabelStyles: getLabelStyles7
+} = _ModuleSupport158;
+var SunburstNode = class extends _ModuleSupport158.HierarchyNode {
+ constructor() {
+ super(...arguments);
+ this.label = void 0;
+ this.secondaryLabel = void 0;
+ this.contentHeight = 0;
+ this.bbox = void 0;
+ // cspell:ignore bbox
+ this.startAngle = 0;
+ this.endAngle = 0;
+ }
+};
+function setAngleData(node, startAngle = 0, angleScale = 2 * Math.PI / node.sumSize) {
+ for (const child of node.children) {
+ const endAngle = startAngle + child.sumSize * angleScale;
+ child.startAngle = startAngle;
+ child.endAngle = endAngle;
+ setAngleData(child, startAngle, angleScale);
+ startAngle = endAngle;
+ }
+}
+var SunburstSeries = class extends _ModuleSupport158.HierarchySeries {
+ constructor(moduleCtx) {
+ super(moduleCtx);
+ this.NodeClass = SunburstNode;
+ this.properties = new SunburstSeriesProperties();
+ this.scalingGroup = this.contentGroup.appendChild(new ScalableGroup());
+ this.sectorGroup = this.scalingGroup.appendChild(new Group16());
+ this.sectorLabelGroup = this.scalingGroup.appendChild(new Group16());
+ this.highlightSectorGroup = this.scalingGroup.appendChild(new Group16());
+ this.datumSelection = Selection15.select(this.sectorGroup, Sector7);
+ this.labelSelection = Selection15.select(
+ this.sectorLabelGroup,
+ Group16
+ );
+ this.highlightSelection = Selection15.select(
+ this.highlightSectorGroup,
+ Sector7
+ );
+ this.sectorLabelGroup.pointerEvents = PointerEvents13.None;
+ }
+ processData() {
+ super.processData();
+ setAngleData(this.rootNode);
+ }
+ updateSelections() {
+ const highlightedNode = this.ctx.highlightManager?.getActiveHighlight();
+ this.highlightSelection.update(
+ highlightedNode == null ? [] : [highlightedNode],
+ void 0,
+ (node) => this.getDatumId(node)
+ );
+ if (!this.nodeDataRefresh)
+ return;
+ this.nodeDataRefresh = false;
+ const { chart } = this;
+ if (chart == null)
+ return;
+ const seriesRect = chart.seriesRect;
+ if (seriesRect == null)
+ return;
+ const descendants = Array.from(this.rootNode);
+ const updateLabelGroup = (group) => {
+ group.append([
+ new TransformableText3({ tag: 0 /* Primary */ }),
+ new TransformableText3({ tag: 1 /* Secondary */ })
+ ]);
+ };
+ this.datumSelection.update(descendants, void 0, (node) => this.getDatumId(node));
+ this.labelSelection.update(descendants, updateLabelGroup, (node) => this.getDatumId(node));
+ }
+ getItemStyle(nodeDatum, isHighlight) {
+ const { properties, colorScale } = this;
+ const { itemStyler } = properties;
+ const rootIndex = nodeDatum.datumIndex?.[0] ?? 0;
+ const highlightStyle = isHighlight ? properties.highlightStyle : void 0;
+ const baseStyle = mergeDefaults19(highlightStyle, properties.getStyle(rootIndex));
+ if (!isHighlight && nodeDatum.colorValue != null) {
+ baseStyle.fill = colorScale.convert(nodeDatum.colorValue);
+ }
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId21(this.getDatumId(nodeDatum), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults19(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(nodeDatum, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum: nodeDatum.datum,
+ depth: nodeDatum.depth ?? 0,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateNodes() {
+ const { chart, data, maxDepth } = this;
+ if (chart == null || data == null) {
+ return;
+ }
+ const { width, height } = chart.seriesRect;
+ const {
+ sectorSpacing = 0,
+ padding = 0,
+ cornerRadius,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName
+ } = this.properties;
+ this.contentGroup.translationX = width / 2;
+ this.contentGroup.translationY = height / 2;
+ const baseInset = sectorSpacing * 0.5;
+ const radius = Math.min(width, height) / 2;
+ const radiusScale = radius / (maxDepth + 1);
+ const angleOffset = -Math.PI / 2;
+ const seriesFillBBox = {
+ series: new BBox17(-radius, -radius, 2 * radius, 2 * radius),
+ axis: new BBox17(-radius, -radius, 2 * radius, 2 * radius)
+ };
+ this.rootNode?.walk((node) => {
+ const { startAngle, endAngle } = node;
+ if (node.depth != null) {
+ const midAngle = (startAngle + endAngle) / 2 + angleOffset;
+ const midRadius = (node.depth + 0.5) * radiusScale;
+ node.midPoint.x = Math.cos(midAngle) * midRadius;
+ node.midPoint.y = Math.sin(midAngle) * midRadius;
+ }
+ });
+ this.rootNode?.walk((node) => {
+ const { datum, depth, startAngle, endAngle, parent, sumSize } = node;
+ node.label = void 0;
+ node.secondaryLabel = void 0;
+ node.contentHeight = 0;
+ let labelValue;
+ if (datum != null && depth != null && labelKey != null) {
+ const value = datum[labelKey];
+ labelValue = this.getLabelText(
+ value,
+ datum,
+ labelKey,
+ "label",
+ [],
+ this.properties.label,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (labelValue === "") {
+ labelValue = void 0;
+ }
+ let secondaryLabelValue;
+ if (datum != null && depth != null && secondaryLabelKey != null) {
+ const value = datum[secondaryLabelKey];
+ secondaryLabelValue = this.getLabelText(
+ value,
+ datum,
+ secondaryLabelKey,
+ "secondaryLabel",
+ [],
+ this.properties.secondaryLabel,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (secondaryLabelValue === "") {
+ secondaryLabelValue = void 0;
+ }
+ if (depth == null)
+ return;
+ const innerRadius = depth * radiusScale + baseInset;
+ const outerRadius = (depth + 1) * radiusScale - baseInset;
+ const innerAngleOffset = innerRadius > baseInset ? baseInset / innerRadius : baseInset;
+ const outerAngleOffset = outerRadius > baseInset ? baseInset / outerRadius : baseInset;
+ const innerStartAngle = startAngle + innerAngleOffset;
+ const innerEndAngle = endAngle + innerAngleOffset;
+ const deltaInnerAngle = innerEndAngle - innerStartAngle;
+ const outerStartAngle = startAngle + outerAngleOffset;
+ const outerEndAngle = endAngle + outerAngleOffset;
+ const deltaOuterAngle = outerEndAngle - outerStartAngle;
+ const sizeFittingHeight = (labelHeight2) => {
+ const isCenterCircle = depth === 0 && parent?.sumSize === sumSize;
+ if (isCenterCircle) {
+ const labelWidth2 = 2 * Math.sqrt(outerRadius ** 2 - (labelHeight2 * 0.5) ** 2);
+ return { width: labelWidth2, height: labelHeight2, meta: 0 /* CenterCircle */ };
+ }
+ const parallelHeight = labelHeight2;
+ const availableWidthUntilItHitsTheOuterRadius = 2 * Math.sqrt(outerRadius ** 2 - (innerRadius + parallelHeight) ** 2);
+ const availableWidthUntilItHitsTheStraightEdges = deltaInnerAngle < Math.PI ? 2 * innerRadius * Math.tan(deltaInnerAngle * 0.5) : Infinity;
+ const parallelWidth = Math.min(
+ availableWidthUntilItHitsTheOuterRadius,
+ availableWidthUntilItHitsTheStraightEdges
+ );
+ const maxPerpendicularAngle = Math.PI / 4;
+ let perpendicularHeight;
+ let perpendicularWidth;
+ if (depth === 0) {
+ perpendicularHeight = labelHeight2;
+ perpendicularWidth = Math.sqrt(outerRadius ** 2 - (perpendicularHeight / 2) ** 2) - labelHeight2 / (2 * Math.tan(deltaOuterAngle * 0.5));
+ } else if (normalizeAngle3608(deltaInnerAngle) < maxPerpendicularAngle) {
+ perpendicularHeight = 2 * innerRadius * Math.tan(deltaInnerAngle * 0.5);
+ perpendicularWidth = Math.sqrt(outerRadius ** 2 - (perpendicularHeight / 2) ** 2) - innerRadius;
+ } else {
+ perpendicularWidth = 0;
+ perpendicularHeight = 0;
+ }
+ return parallelWidth >= perpendicularWidth ? { width: parallelWidth, height: parallelHeight, meta: 1 /* Parallel */ } : { width: perpendicularWidth, height: perpendicularHeight, meta: 2 /* Perpendicular */ };
+ };
+ const formatting = formatLabels(
+ toPlainText9(labelValue),
+ this.properties.label,
+ toPlainText9(secondaryLabelValue),
+ this.properties.secondaryLabel,
+ { padding },
+ sizeFittingHeight
+ );
+ if (formatting == null)
+ return;
+ const { width: labelWidth, height: labelHeight, meta: labelPlacement, label, secondaryLabel } = formatting;
+ const theta = angleOffset + (startAngle + endAngle) / 2;
+ const top = Math.sin(theta) >= 0;
+ const right = Math.cos(theta) >= 0;
+ const circleQuarter = (top ? 3 /* Top */ : 12 /* Bottom */) & (right ? 6 /* Right */ : 9 /* Left */);
+ let labelRadius;
+ switch (labelPlacement) {
+ case 0 /* CenterCircle */:
+ labelRadius = 0;
+ break;
+ case 1 /* Parallel */: {
+ const opticalCentering = 0.58;
+ const idealRadius = outerRadius - (radiusScale - labelHeight) * opticalCentering;
+ const maximumRadius = Math.sqrt((outerRadius - padding) ** 2 - (labelWidth / 2) ** 2);
+ labelRadius = Math.min(idealRadius, maximumRadius);
+ break;
+ }
+ case 2 /* Perpendicular */:
+ if (depth === 0) {
+ const minimumRadius = labelHeight / (2 * Math.tan(deltaInnerAngle * 0.5)) + labelWidth * 0.5;
+ const maximumRadius = Math.sqrt(outerRadius ** 2 - (labelHeight * 0.5) ** 2) - labelWidth * 0.5;
+ labelRadius = (minimumRadius + maximumRadius) * 0.5;
+ } else {
+ labelRadius = (innerRadius + outerRadius) * 0.5;
+ }
+ break;
+ }
+ if (label != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.label;
+ node.label = {
+ ...label,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ labelPlacement,
+ circleQuarter,
+ radius: labelRadius,
+ theta
+ };
+ }
+ if (secondaryLabel != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.secondaryLabel;
+ node.secondaryLabel = {
+ ...secondaryLabel,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ labelPlacement,
+ circleQuarter,
+ radius: labelRadius,
+ theta
+ };
+ }
+ node.contentHeight = formatting.height;
+ });
+ const updateSector = (nodeDatum, sector, highlighted) => {
+ const { depth, startAngle, endAngle } = nodeDatum;
+ if (depth == null) {
+ sector.visible = false;
+ return;
+ }
+ sector.visible = true;
+ const style = this.getItemStyle(nodeDatum, highlighted);
+ const fill = style.fill;
+ const strokeWidth = style.strokeWidth;
+ const fillBBox = _ModuleSupport158.isGradientFill(fill) && fill.bounds !== "item" ? seriesFillBBox : void 0;
+ applyShapeStyle19(sector, style, fillBBox);
+ sector.centerX = 0;
+ sector.centerY = 0;
+ sector.innerRadius = depth * radiusScale;
+ sector.outerRadius = (depth + 1) * radiusScale;
+ sector.startAngle = startAngle + angleOffset;
+ sector.endAngle = endAngle + angleOffset;
+ sector.inset = baseInset + strokeWidth * 0.5;
+ sector.cornerRadius = cornerRadius;
+ };
+ this.datumSelection.each((sector, datum) => {
+ updateSector(datum, sector, false);
+ });
+ this.highlightSelection.each((rect, datum) => {
+ updateSector(datum, rect, true);
+ });
+ const updateText = (node, text, tag, highlighted) => {
+ const { depth, contentHeight } = node;
+ const primary = tag === 0 /* Primary */;
+ const label = primary ? node.label : node.secondaryLabel;
+ if (depth == null || label == null) {
+ text.visible = false;
+ return;
+ }
+ const { labelPlacement, circleQuarter, radius: textRadius, theta } = label;
+ let highlightedColor;
+ if (highlighted) {
+ const highlightedLabelStyle = primary ? this.properties.highlightStyle.label : this.properties.highlightStyle.secondaryLabel;
+ highlightedColor = highlightedLabelStyle.color;
+ }
+ const params = {
+ childrenKey: this.properties.childrenKey,
+ colorKey: this.properties.colorKey,
+ colorName: this.properties.colorName ?? this.properties.colorKey,
+ depth: node.depth ?? Number.NaN,
+ labelKey: this.properties.labelKey,
+ secondaryLabelKey: this.properties.secondaryLabelKey,
+ sizeKey: this.properties.sizeKey,
+ sizeName: this.properties.sizeName ?? this.properties.sizeKey
+ };
+ const baseLabelStyle = primary ? this.properties.label : this.properties.secondaryLabel;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const style = getLabelStyles7(this, node, params, baseLabelStyle, highlighted, activeHighlight);
+ text.text = label.text;
+ text.fontSize = label.fontSize;
+ text.lineHeight = label.lineHeight;
+ text.fontStyle = label.fontStyle;
+ text.fontFamily = label.fontFamily;
+ text.fontWeight = label.fontWeight;
+ text.fill = highlightedColor ?? label.color;
+ text.fillOpacity = this.getHighlightStyle(highlighted, node.datumIndex)?.opacity ?? 1;
+ text.setBoxing(style);
+ switch (labelPlacement) {
+ case 0 /* CenterCircle */:
+ text.textAlign = "center";
+ text.textBaseline = "top";
+ text.translationX = 0;
+ text.translationY = (primary ? 0 : contentHeight - label.height) - contentHeight * 0.5;
+ text.rotation = 0;
+ break;
+ case 1 /* Parallel */: {
+ const topHalf = (circleQuarter & 3 /* Top */) !== 0;
+ const translationRadius = primary === !topHalf ? textRadius : textRadius - (contentHeight - label.height);
+ text.textAlign = "center";
+ text.textBaseline = topHalf ? "bottom" : "top";
+ text.translationX = Math.cos(theta) * translationRadius;
+ text.translationY = Math.sin(theta) * translationRadius;
+ text.rotation = topHalf ? theta - Math.PI * 0.5 : theta + Math.PI * 0.5;
+ break;
+ }
+ case 2 /* Perpendicular */: {
+ const rightHalf = (circleQuarter & 6 /* Right */) !== 0;
+ const translation = primary === !rightHalf ? (contentHeight - label.height) * 0.5 : (label.height - contentHeight) * 0.5;
+ text.textAlign = "center";
+ text.textBaseline = "middle";
+ text.translationX = Math.cos(theta) * textRadius + Math.cos(theta + Math.PI / 2) * translation;
+ text.translationY = Math.sin(theta) * textRadius + Math.sin(theta + Math.PI / 2) * translation;
+ text.rotation = rightHalf ? theta : theta + Math.PI;
+ break;
+ }
+ }
+ text.visible = true;
+ };
+ const highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ for (const text of this.labelSelection.selectByClass(TransformableText3)) {
+ const datum = text.closestDatum();
+ updateText(datum, text, text.tag, datum === highlightedDatum);
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties, ctx } = this;
+ const { labelKey, secondaryLabelKey, childrenKey, sizeKey, sizeName, colorKey, colorName, tooltip } = properties;
+ const { formatManager } = ctx;
+ const nodeDatum = datumIndex.reduce((n, i) => n?.children[i], this.rootNode);
+ if (nodeDatum == null)
+ return;
+ const { datum, depth } = nodeDatum;
+ if (datum == null || depth == null)
+ return;
+ const data = [];
+ const datumSize = sizeKey == null ? void 0 : datum[sizeKey];
+ if (datumSize != null) {
+ const sizeDomain = [0, this.rootNode?.sumSize ?? 0];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumSize,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ boundSeries: this.getFormatterContext("size"),
+ domain: sizeDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? formatValue2(datumSize) });
+ }
+ const datumColor = colorKey == null ? void 0 : datum[colorKey];
+ if (datumColor != null) {
+ const { colorDomain } = this;
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumColor,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ boundSeries: this.getFormatterContext("color"),
+ domain: colorDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? formatValue2(datumColor) });
+ }
+ const format = this.getItemStyle(
+ { ...nodeDatum, colorValue: datumColor ?? nodeDatum.colorValue },
+ false
+ );
+ const color6 = format.fill;
+ const markerStyle = {
+ shape: "square",
+ fill: color6,
+ fillOpacity: 1,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ };
+ if (_ModuleSupport158.isGradientFill(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title: labelKey == null ? void 0 : datum[labelKey],
+ symbol: {
+ marker: markerStyle
+ },
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title: void 0,
+ depth,
+ labelKey,
+ secondaryLabelKey,
+ childrenKey,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ ...format
+ }
+ );
+ }
+ createNodeData() {
+ return void 0;
+ }
+ pickNodeClosestDatum(point) {
+ return this.pickNodeNearestDistantObject(point, this.datumSelection.nodes());
+ }
+ animateEmptyUpdateReady() {
+ fromToMotion6(this.id, "nodes", this.ctx.animationManager, [this.scalingGroup], {
+ toFn() {
+ return { scalingX: 1, scalingY: 1 };
+ },
+ fromFn() {
+ return { scalingX: 0, scalingY: 0 };
+ }
+ });
+ }
+ computeFocusBounds(node) {
+ return node;
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+SunburstSeries.className = "SunburstSeries";
+SunburstSeries.type = "sunburst";
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport159 } from "ag-charts-community";
+import { constant as constant24, required as required24, string as string22 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs22, sunburstSeriesThemeableOptionsDef, without: without8 } = _ModuleSupport159;
+var sunburstSeriesOptionsDef = {
+ ...sunburstSeriesThemeableOptionsDef,
+ ...without8(commonSeriesOptionsDefs22, ["highlightStyle", "highlight", "showInLegend"]),
+ type: required24(constant24("sunburst")),
+ labelKey: string22,
+ secondaryLabelKey: string22,
+ childrenKey: string22,
+ sizeKey: string22,
+ colorKey: string22,
+ sizeName: string22,
+ colorName: string22
+};
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstModule.ts
+var { BASE_FONT_SIZE, FONT_SIZE_RATIO: FONT_SIZE_RATIO2 } = _ModuleSupport160;
+var SunburstModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "sunburst",
+ moduleFactory: (ctx) => new SunburstSeries(ctx),
+ solo: true,
+ themeTemplate: {
+ series: {
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ { $palette: "fills" },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", _ModuleSupport160.FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS],
+ ["pattern", _ModuleSupport160.FILL_PATTERN_DEFAULTS],
+ ["image", _ModuleSupport160.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [{ $size: { $path: ["./data", { $path: "/data" }] } }, { $palette: "strokes" }]
+ },
+ colorRange: { $palette: "divergingColors" },
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ label: {
+ ..._ModuleSupport160.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $rem: FONT_SIZE_RATIO2.LARGE },
+ minimumFontSize: { $rem: 9 / BASE_FONT_SIZE },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" },
+ overflowStrategy: "ellipsis",
+ wrapping: "never",
+ spacing: 2
+ },
+ secondaryLabel: {
+ ..._ModuleSupport160.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $rem: FONT_SIZE_RATIO2.SMALLEST },
+ minimumFontSize: { $rem: 7 / BASE_FONT_SIZE },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" },
+ overflowStrategy: "ellipsis",
+ wrapping: "never"
+ },
+ sectorSpacing: 2,
+ padding: 3,
+ highlightStyle: {
+ label: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ secondaryLabel: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ fill: "rgba(255,255,255, 0.33)",
+ stroke: `rgba(0, 0, 0, 0.4)`,
+ strokeWidth: 2
+ }
+ },
+ gradientLegend: {
+ enabled: true,
+ ..._ModuleSupport160.LEGEND_CONTAINER_THEME
+ }
+ }
+};
+var SunburstSeriesModule = {
+ type: "series",
+ name: "sunburst",
+ chartType: "standalone",
+ enterprise: true,
+ options: sunburstSeriesOptionsDef,
+ create: (ctx) => new SunburstSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapModule.ts
+import { _ModuleSupport as _ModuleSupport164 } from "ag-charts-community";
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeries.ts
+import {
+ _ModuleSupport as _ModuleSupport162
+} from "ag-charts-community";
+import {
+ cachedTextMeasurer as cachedTextMeasurer11,
+ calcLineHeight as calcLineHeight3,
+ isNumberEqual as isNumberEqual9,
+ toPlainText as toPlainText10,
+ wrapText as wrapText3
+} from "ag-charts-core";
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeriesProperties.ts
+import { _ModuleSupport as _ModuleSupport161 } from "ag-charts-community";
+var { BaseProperties: BaseProperties13, HierarchySeriesProperties: HierarchySeriesProperties2, HighlightStyle: HighlightStyle2, makeSeriesTooltip: makeSeriesTooltip24, Property: Property39, Label: Label16 } = _ModuleSupport161;
+var TreemapGroupLabel = class extends Label16 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property39
+], TreemapGroupLabel.prototype, "spacing", 2);
+var TreemapSeriesGroup = class extends BaseProperties13 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.cornerRadius = 0;
+ this.textAlign = "center";
+ this.gap = 0;
+ this.padding = 0;
+ this.interactive = true;
+ this.label = new TreemapGroupLabel();
+ }
+};
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "fill", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "stroke", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "textAlign", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "gap", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "padding", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "interactive", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroup.prototype, "label", 2);
+var TreemapSeriesTile = class extends BaseProperties13 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.cornerRadius = 0;
+ this.textAlign = "center";
+ this.verticalAlign = "middle";
+ this.gap = 0;
+ this.padding = 0;
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedSecondaryLabel();
+ }
+};
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "fill", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "stroke", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "textAlign", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "verticalAlign", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "gap", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "padding", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "label", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTile.prototype, "secondaryLabel", 2);
+var TreemapSeriesGroupHighlightStyle = class extends BaseProperties13 {
+ constructor() {
+ super(...arguments);
+ this.label = new AutoSizedLabel();
+ }
+};
+__decorateClass([
+ Property39
+], TreemapSeriesGroupHighlightStyle.prototype, "fill", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroupHighlightStyle.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroupHighlightStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroupHighlightStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroupHighlightStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesGroupHighlightStyle.prototype, "label", 2);
+var TreemapSeriesTileHighlightStyle = class extends BaseProperties13 {
+ constructor() {
+ super(...arguments);
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedSecondaryLabel();
+ }
+};
+__decorateClass([
+ Property39
+], TreemapSeriesTileHighlightStyle.prototype, "fill", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTileHighlightStyle.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTileHighlightStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTileHighlightStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTileHighlightStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTileHighlightStyle.prototype, "label", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesTileHighlightStyle.prototype, "secondaryLabel", 2);
+var TreemapSeriesHighlightStyle = class extends HighlightStyle2 {
+ constructor() {
+ super(false);
+ this.group = new TreemapSeriesGroupHighlightStyle();
+ this.tile = new TreemapSeriesTileHighlightStyle();
+ }
+ getStyle(isLeaf) {
+ return isLeaf ? this.tile : this.group;
+ }
+};
+__decorateClass([
+ Property39
+], TreemapSeriesHighlightStyle.prototype, "group", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesHighlightStyle.prototype, "tile", 2);
+var TreemapSeriesProperties = class extends HierarchySeriesProperties2 {
+ constructor() {
+ super(...arguments);
+ this.highlightStyle = new TreemapSeriesHighlightStyle();
+ this.tooltip = makeSeriesTooltip24();
+ this.group = new TreemapSeriesGroup();
+ this.tile = new TreemapSeriesTile();
+ this.undocumentedGroupFills = [];
+ this.undocumentedGroupStrokes = [];
+ }
+ getStyle(isLeaf, fills, strokes, index) {
+ const {
+ fillOpacity,
+ strokeWidth,
+ strokeOpacity,
+ fill = isLeaf ? fills[index % fills.length] : fills[Math.min(index, fills.length)],
+ stroke = isLeaf ? strokes[index % fills.length] : strokes[Math.min(index, strokes.length)]
+ } = isLeaf ? this.tile : this.group;
+ return {
+ fill,
+ fillOpacity,
+ stroke,
+ strokeWidth,
+ strokeOpacity,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "secondaryLabelKey", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "highlightStyle", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "group", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "tile", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "undocumentedGroupFills", 2);
+__decorateClass([
+ Property39
+], TreemapSeriesProperties.prototype, "undocumentedGroupStrokes", 2);
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeries.ts
+var {
+ createDatumId: createDatumId22,
+ Rect: Rect7,
+ Group: Group17,
+ BBox: BBox18,
+ Selection: Selection16,
+ Text: Text8,
+ Transformable: Transformable4,
+ applyShapeStyle: applyShapeStyle20,
+ getLabelStyles: getLabelStyles8,
+ mergeDefaults: mergeDefaults20,
+ formatValue: formatValue3
+} = _ModuleSupport162;
+var TreemapNode = class extends _ModuleSupport162.HierarchyNode {
+ constructor() {
+ super(...arguments);
+ this.labelValue = void 0;
+ this.secondaryLabelValue = void 0;
+ this.label = void 0;
+ this.secondaryLabel = void 0;
+ this.bbox = void 0;
+ this.padding = void 0;
+ }
+};
+function nodeSize(node) {
+ return node.children.length > 0 ? node.sumSize - node.sizeValue : node.sizeValue;
+}
+var textAlignFactors2 = {
+ left: 0,
+ center: 0.5,
+ right: 1
+};
+var verticalAlignFactors4 = {
+ top: 0,
+ middle: 0.5,
+ bottom: 1
+};
+var DistantGroup = class extends _ModuleSupport162.Group {
+ distanceSquared(x, y) {
+ return this.getBBox().distanceSquared(x, y);
+ }
+};
+var TreemapSeries = class extends _ModuleSupport162.HierarchySeries {
+ constructor() {
+ super(...arguments);
+ this.NodeClass = TreemapNode;
+ this.properties = new TreemapSeriesProperties();
+ this.rectGroup = this.contentGroup.appendChild(new Group17());
+ this.datumSelection = Selection16.select(this.rectGroup, Rect7);
+ this.labelSelection = Selection16.select(this.labelGroup, Group17);
+ this.highlightSelection = Selection16.select(
+ this.rectGroup,
+ Rect7
+ );
+ }
+ groupTitleHeight(node, bbox) {
+ const { labelValue } = node;
+ const { label: font } = this.properties.group;
+ const heightRatioThreshold = 3;
+ if (labelValue == null) {
+ return;
+ } else if (font.fontSize > bbox.width / heightRatioThreshold || font.fontSize > bbox.height / heightRatioThreshold) {
+ return;
+ } else {
+ const { height: fontHeight } = cachedTextMeasurer11(font).measureLines(labelValue);
+ return Math.max(fontHeight, font.fontSize);
+ }
+ }
+ getNodePadding(node, bbox) {
+ if (node.parent == null) {
+ return {
+ top: 0,
+ right: 0,
+ bottom: 0,
+ left: 0
+ };
+ } else if (node.children.length === 0) {
+ const { padding: padding2 } = this.properties.tile;
+ return {
+ top: padding2,
+ right: padding2,
+ bottom: padding2,
+ left: padding2
+ };
+ }
+ const {
+ label: { spacing },
+ padding
+ } = this.properties.group;
+ const fontHeight = this.groupTitleHeight(node, bbox);
+ const titleHeight = fontHeight == null ? 0 : fontHeight + spacing;
+ return {
+ top: padding + titleHeight,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+ sortChildren({ children }) {
+ const sortedChildrenIndices = Array.from(children, (_, i) => i).filter((i) => nodeSize(children[i]) > 0).sort((aIndex, bIndex) => nodeSize(children[bIndex]) - nodeSize(children[aIndex]));
+ const childAt = (i) => {
+ const sortedIndex = sortedChildrenIndices[i];
+ return children[sortedIndex];
+ };
+ return { sortedChildrenIndices, childAt };
+ }
+ /**
+ * Squarified Treemap algorithm
+ * https://www.win.tue.nl/~vanwijk/stm.pdf
+ */
+ squarify(node, bbox) {
+ const { datum, children } = node;
+ if (bbox.width <= 0 || bbox.height <= 0) {
+ node.bbox = void 0;
+ node.padding = void 0;
+ node.midPoint.x = Number.NaN;
+ node.midPoint.y = Number.NaN;
+ return;
+ }
+ const padding = datum == null ? { top: 0, right: 0, bottom: 0, left: 0 } : this.getNodePadding(node, bbox);
+ if (node.parent == null) {
+ node.bbox = void 0;
+ node.padding = void 0;
+ node.midPoint.x = Number.NaN;
+ node.midPoint.y = Number.NaN;
+ } else {
+ node.bbox = bbox;
+ node.padding = padding;
+ node.midPoint.x = bbox.x + bbox.width / 2;
+ node.midPoint.y = bbox.y;
+ }
+ const { sortedChildrenIndices, childAt } = this.sortChildren(node);
+ const allLeafNodes = sortedChildrenIndices.every((sortedIndex) => children[sortedIndex].children.length === 0);
+ const targetTileAspectRatio = 1;
+ const width = bbox.width - padding.left - padding.right;
+ const height = bbox.height - padding.top - padding.bottom;
+ if (width <= 0 || height <= 0)
+ return;
+ const numChildren = sortedChildrenIndices.length;
+ let stackSum = 0;
+ let startIndex = 0;
+ let minRatioDiff = Infinity;
+ let partitionSum = sortedChildrenIndices.reduce((sum, sortedIndex) => sum + nodeSize(children[sortedIndex]), 0);
+ const innerBox = new BBox18(bbox.x + padding.left, bbox.y + padding.top, width, height);
+ const partition = innerBox.clone();
+ let i = 0;
+ while (i < numChildren) {
+ const value = nodeSize(childAt(i));
+ const firstValue = nodeSize(childAt(startIndex));
+ const isVertical2 = partition.width < partition.height;
+ stackSum += value;
+ const partThickness = isVertical2 ? partition.height : partition.width;
+ const partLength = isVertical2 ? partition.width : partition.height;
+ const firstTileLength = partLength * firstValue / stackSum;
+ let stackThickness = partThickness * stackSum / partitionSum;
+ const ratio3 = Math.max(firstTileLength, stackThickness) / Math.min(firstTileLength, stackThickness);
+ const diff8 = Math.abs(targetTileAspectRatio - ratio3);
+ if (diff8 < minRatioDiff) {
+ minRatioDiff = diff8;
+ i++;
+ continue;
+ }
+ stackSum -= value;
+ stackThickness = partThickness * stackSum / partitionSum;
+ let start2 = isVertical2 ? partition.x : partition.y;
+ for (let j = startIndex; j < i; j++) {
+ const child = childAt(j);
+ const childSize = nodeSize(child);
+ const x = isVertical2 ? start2 : partition.x;
+ const y = isVertical2 ? partition.y : start2;
+ const length = partLength * childSize / stackSum;
+ const stackWidth = isVertical2 ? length : stackThickness;
+ const stackHeight = isVertical2 ? stackThickness : length;
+ const childBbox = new BBox18(x, y, stackWidth, stackHeight);
+ this.applyGap(innerBox, childBbox, allLeafNodes);
+ this.squarify(child, childBbox);
+ partitionSum -= childSize;
+ start2 += length;
+ }
+ if (isVertical2) {
+ partition.y += stackThickness;
+ partition.height -= stackThickness;
+ } else {
+ partition.x += stackThickness;
+ partition.width -= stackThickness;
+ }
+ startIndex = i;
+ stackSum = 0;
+ minRatioDiff = Infinity;
+ }
+ const isVertical = partition.width < partition.height;
+ let start = isVertical ? partition.x : partition.y;
+ for (let childIdx = startIndex; childIdx < numChildren; childIdx++) {
+ const child = childAt(childIdx);
+ const x = isVertical ? start : partition.x;
+ const y = isVertical ? partition.y : start;
+ const part = nodeSize(child) / partitionSum;
+ const childWidth = partition.width * (isVertical ? part : 1);
+ const childHeight = partition.height * (isVertical ? 1 : part);
+ const childBox = new BBox18(x, y, childWidth, childHeight);
+ this.applyGap(innerBox, childBox, allLeafNodes);
+ this.squarify(child, childBox);
+ start += isVertical ? childWidth : childHeight;
+ }
+ }
+ applyGap(innerBox, childBox, allLeafNodes) {
+ const gap = allLeafNodes ? this.properties.tile.gap * 0.5 : this.properties.group.gap * 0.5;
+ const getBounds = (box) => ({
+ left: box.x,
+ top: box.y,
+ right: box.x + box.width,
+ bottom: box.y + box.height
+ });
+ const innerBounds = getBounds(innerBox);
+ const childBounds = getBounds(childBox);
+ const sides = ["top", "right", "bottom", "left"];
+ for (const side of sides) {
+ if (!isNumberEqual9(innerBounds[side], childBounds[side])) {
+ childBox.shrink(gap, side);
+ }
+ }
+ }
+ createNodeData() {
+ return void 0;
+ }
+ getItemStyle(nodeDatum, isLeaf, isHighlight) {
+ const { properties, colorScale } = this;
+ const { itemStyler } = properties;
+ const rootIndex = nodeDatum.datumIndex?.[0] ?? 0;
+ const fills = isLeaf ? properties.fills : properties.undocumentedGroupFills;
+ const strokes = isLeaf ? properties.strokes : properties.undocumentedGroupStrokes;
+ const index = isLeaf ? rootIndex : nodeDatum.depth ?? -1;
+ const highlightStyle = isHighlight ? properties.highlightStyle.getStyle(isLeaf) : void 0;
+ const baseStyle = mergeDefaults20(highlightStyle, properties.getStyle(isLeaf, fills, strokes, index));
+ if (!isHighlight && isLeaf && nodeDatum.colorValue != null) {
+ baseStyle.fill = colorScale.convert(nodeDatum.colorValue);
+ }
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId22(this.getDatumId(nodeDatum), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults20(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(nodeDatum, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum: nodeDatum.datum,
+ depth: nodeDatum.depth ?? -1,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateSelections() {
+ let highlightedNode = this.ctx.highlightManager?.getActiveHighlight();
+ if (highlightedNode != null && !this.properties.group.interactive && highlightedNode.children.length !== 0) {
+ highlightedNode = void 0;
+ }
+ this.highlightSelection.update(
+ highlightedNode == null ? [] : [highlightedNode],
+ void 0,
+ (node) => this.getDatumId(node)
+ );
+ if (!this.nodeDataRefresh) {
+ return;
+ }
+ this.nodeDataRefresh = false;
+ const { seriesRect } = this.chart ?? {};
+ if (!seriesRect)
+ return;
+ const descendants = Array.from(this.rootNode);
+ const updateLabelGroup = (group) => {
+ group.append([new Text8({ tag: 0 /* Primary */ }), new Text8({ tag: 1 /* Secondary */ })]);
+ };
+ this.datumSelection.update(descendants, void 0, (node) => this.getDatumId(node));
+ this.labelSelection.update(descendants, updateLabelGroup, (node) => this.getDatumId(node));
+ }
+ updateNodes() {
+ const { rootNode, data } = this;
+ const {
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ highlightStyle,
+ tile,
+ group
+ } = this.properties;
+ const { seriesRect } = this.chart ?? {};
+ if (!seriesRect || !data)
+ return;
+ this.rootNode?.walk((node) => {
+ const { datum, depth, children } = node;
+ const isLeaf = children.length === 0;
+ const labelStyle = isLeaf ? tile.label : group.label;
+ let labelValue;
+ if (labelStyle.enabled && datum != null && depth != null && labelKey != null) {
+ const value = datum[labelKey];
+ labelValue = this.getLabelText(
+ value,
+ datum,
+ labelKey,
+ "label",
+ [],
+ labelStyle,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (labelValue === "") {
+ labelValue = void 0;
+ }
+ let secondaryLabelValue;
+ if (tile.secondaryLabel.enabled && isLeaf && datum != null && depth != null && secondaryLabelKey != null) {
+ const value = datum[secondaryLabelKey];
+ secondaryLabelValue = this.getLabelText(
+ value,
+ datum,
+ secondaryLabelKey,
+ "secondaryLabel",
+ [],
+ tile.secondaryLabel,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (secondaryLabelValue === "") {
+ secondaryLabelValue = void 0;
+ }
+ node.labelValue = toPlainText10(labelValue);
+ node.secondaryLabelValue = toPlainText10(secondaryLabelValue);
+ });
+ const { width, height } = seriesRect;
+ this.squarify(rootNode, new BBox18(0, 0, width, height));
+ this.rootNode?.walk((node) => {
+ const { bbox, children, labelValue, secondaryLabelValue } = node;
+ node.label = void 0;
+ node.secondaryLabel = void 0;
+ if (bbox == null)
+ return;
+ if (children.length === 0) {
+ const layout = {
+ width: bbox.width,
+ height: bbox.height,
+ meta: null
+ };
+ const formatting = formatLabels(
+ labelValue,
+ this.properties.tile.label,
+ secondaryLabelValue,
+ this.properties.tile.secondaryLabel,
+ { padding: tile.padding },
+ () => layout
+ );
+ if (formatting == null) {
+ return;
+ }
+ const { height: labelHeight, label, secondaryLabel } = formatting;
+ const { textAlign, verticalAlign, padding } = tile;
+ const textAlignFactor = textAlignFactors2[textAlign] ?? 0.5;
+ const labelX = bbox.x + padding + (bbox.width - 2 * padding) * textAlignFactor;
+ const verticalAlignFactor = verticalAlignFactors4[verticalAlign] ?? 0.5;
+ const labelYStart = bbox.y + padding + labelHeight * 0.5 + (bbox.height - 2 * padding - labelHeight) * verticalAlignFactor;
+ if (label != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.tile.label;
+ node.label = {
+ text: label.text,
+ fontSize: label.fontSize,
+ lineHeight: label.lineHeight,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ verticalAlign: "middle",
+ x: labelX,
+ y: labelYStart - (labelHeight - label.height) * 0.5
+ };
+ }
+ if (secondaryLabel != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.tile.secondaryLabel;
+ node.secondaryLabel = {
+ text: secondaryLabel.text,
+ fontSize: secondaryLabel.fontSize,
+ lineHeight: secondaryLabel.fontSize,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ verticalAlign: "middle",
+ x: labelX,
+ y: labelYStart + (labelHeight - secondaryLabel.height) * 0.5
+ };
+ }
+ } else if (labelValue == null) {
+ return;
+ } else {
+ const { padding, textAlign } = group;
+ const groupTitleHeight = this.groupTitleHeight(node, bbox);
+ if (groupTitleHeight == null)
+ return;
+ const innerWidth = bbox.width - 2 * padding;
+ const text = wrapText3(labelValue, {
+ maxWidth: bbox.width - 2 * padding,
+ font: group.label,
+ textWrap: "never"
+ });
+ const textAlignFactor = textAlignFactors2[textAlign] ?? 0.5;
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.group.label;
+ node.label = {
+ text,
+ fontSize: group.label.fontSize,
+ lineHeight: calcLineHeight3(group.label.fontSize),
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ verticalAlign: "middle",
+ x: bbox.x + padding + innerWidth * textAlignFactor,
+ y: bbox.y + padding + groupTitleHeight * 0.5
+ };
+ }
+ });
+ const fillBBox = {
+ series: new BBox18(0, 0, width, height),
+ axis: new BBox18(0, 0, width, height)
+ };
+ const updateRectFn = (node, rect, isHighlight) => {
+ const { bbox } = node;
+ if (bbox == null) {
+ rect.visible = false;
+ return;
+ }
+ const { depth = -1 } = node;
+ const isLeaf = node.children.length === 0;
+ const style = this.getItemStyle(node, isLeaf, isHighlight);
+ rect.crisp = true;
+ applyShapeStyle20(rect, style, fillBBox);
+ rect.cornerRadius = isLeaf ? tile.cornerRadius : group.cornerRadius;
+ rect.zIndex = [0, depth, isHighlight ? 1 : 0];
+ const onlyLeaves = node.parent?.children.every((n) => n.children.length === 0);
+ const parentBbox = node.parent == null ? void 0 : node.parent.bbox;
+ const parentPadding = node.parent == null ? void 0 : node.parent.padding;
+ if (onlyLeaves === true && parentBbox != null && parentPadding != null) {
+ rect.clipBBox = bbox;
+ rect.x = parentBbox.x + parentPadding.left;
+ rect.y = parentBbox.y + parentPadding.top;
+ rect.width = parentBbox.width - (parentPadding.left + parentPadding.right);
+ rect.height = parentBbox.height - (parentPadding.top + parentPadding.bottom);
+ } else {
+ rect.clipBBox = void 0;
+ rect.x = bbox.x;
+ rect.y = bbox.y;
+ rect.width = bbox.width;
+ rect.height = bbox.height;
+ }
+ rect.visible = true;
+ };
+ this.datumSelection.each((rect, datum) => updateRectFn(datum, rect, false));
+ this.highlightSelection.each((rect, datum) => {
+ updateRectFn(datum, rect, true);
+ });
+ const updateLabelFn = (node, text, tag, highlighted) => {
+ const isLeaf = node.children.length === 0;
+ const label = tag === 0 /* Primary */ ? node.label : node.secondaryLabel;
+ if (label == null) {
+ text.visible = false;
+ return;
+ }
+ const labelProps = tag === 0 /* Primary */ ? tile.label : tile.secondaryLabel;
+ let highlightedColor;
+ if (highlighted) {
+ const { tile: hTitle, group: hGroup } = highlightStyle;
+ highlightedColor = hTitle.secondaryLabel.color;
+ if (!isLeaf) {
+ highlightedColor = hGroup.label.color;
+ } else if (tag === 0 /* Primary */) {
+ highlightedColor = hTitle.label.color;
+ }
+ }
+ const params = {
+ childrenKey: this.properties.childrenKey,
+ colorKey: this.properties.colorKey,
+ colorName: this.properties.colorName ?? this.properties.colorKey,
+ depth: node.depth ?? Number.NaN,
+ labelKey: this.properties.labelKey,
+ secondaryLabelKey: this.properties.secondaryLabelKey,
+ sizeKey: this.properties.sizeKey,
+ sizeName: this.properties.sizeName ?? this.properties.sizeKey
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const style = getLabelStyles8(this, node, params, labelProps, highlighted, activeHighlight);
+ text.text = label.text;
+ text.fontSize = label.fontSize;
+ text.lineHeight = label.lineHeight;
+ text.fontStyle = label.fontStyle;
+ text.fontFamily = label.fontFamily;
+ text.fontWeight = label.fontWeight;
+ text.fill = highlightedColor ?? label.color;
+ text.fillOpacity = this.getHighlightStyle(highlighted, node.datumIndex)?.opacity ?? 1;
+ text.textAlign = label.textAlign;
+ text.textBaseline = label.verticalAlign;
+ text.x = label.x;
+ text.y = label.y;
+ text.setBoxing(style);
+ text.visible = true;
+ text.zIndex = 1;
+ };
+ const highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ for (const text of this.labelSelection.selectByClass(Text8)) {
+ const datum = text.closestDatum();
+ updateLabelFn(datum, text, text.tag, datum === highlightedDatum);
+ }
+ }
+ pickNodesExactShape(point) {
+ const nodes = super.pickNodesExactShape(point);
+ nodes.sort((a, b) => b.datumIndex.length - a.datumIndex.length);
+ return nodes;
+ }
+ pickNodeClosestDatum(point) {
+ const exactMatch = this.pickNodesExactShape(point);
+ if (exactMatch.length !== 0) {
+ return { datum: exactMatch[0], distance: 0 };
+ }
+ return this.pickNodeNearestDistantObject(point, this.datumSelection.nodes());
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties, ctx } = this;
+ const { formatManager } = ctx;
+ const { labelKey, secondaryLabelKey, childrenKey, sizeKey, sizeName, colorKey, colorName, tooltip } = properties;
+ const nodeDatum = datumIndex.reduce((n, i) => n?.children[i], this.rootNode);
+ if (nodeDatum == null)
+ return;
+ const { datum, depth, children } = nodeDatum;
+ if (datum == null || depth == null)
+ return;
+ const isLeaf = children.length === 0;
+ const data = [];
+ const datumSize = sizeKey == null ? void 0 : datum[sizeKey];
+ if (datumSize != null) {
+ const sizeDomain = [0, this.rootNode?.sumSize ?? 0];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumSize,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ boundSeries: this.getFormatterContext("size"),
+ domain: sizeDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? formatValue3(datumSize) });
+ }
+ const datumColor = colorKey == null ? void 0 : datum[colorKey];
+ if (datumColor != null) {
+ const { colorDomain } = this;
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumColor,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ boundSeries: this.getFormatterContext("color"),
+ domain: colorDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? formatValue3(datumColor) });
+ }
+ const format = this.getItemStyle(
+ { ...nodeDatum, colorValue: datumColor ?? nodeDatum.colorValue },
+ isLeaf,
+ false
+ );
+ const color6 = format.fill;
+ const markerStyle = {
+ shape: "square",
+ fill: color6,
+ fillOpacity: 1,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ };
+ if (_ModuleSupport162.isGradientFill(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ const symbol = isLeaf ? { marker: markerStyle } : void 0;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title: labelKey == null ? void 0 : datum[labelKey],
+ symbol,
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title: void 0,
+ depth,
+ labelKey,
+ secondaryLabelKey,
+ childrenKey,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(node) {
+ return Transformable4.toCanvas(this.contentGroup, node.getBBox());
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.tile.label.itemStyler != null || this.properties.group.label.itemStyler != null;
+ }
+};
+TreemapSeries.className = "TreemapSeries";
+TreemapSeries.type = "treemap";
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeriesOptionsDef.ts
+import { _ModuleSupport as _ModuleSupport163 } from "ag-charts-community";
+import { arrayOf as arrayOf5, color as color5, constant as constant25, required as required25, string as string23, undocumented as undocumented8 } from "ag-charts-core";
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs23, treemapSeriesThemeableOptionsDef, without: without9 } = _ModuleSupport163;
+var treemapSeriesOptionsDef = {
+ ...treemapSeriesThemeableOptionsDef,
+ ...without9(commonSeriesOptionsDefs23, ["highlightStyle", "highlight", "showInLegend"]),
+ type: required25(constant25("treemap")),
+ labelKey: string23,
+ secondaryLabelKey: string23,
+ childrenKey: string23,
+ sizeKey: string23,
+ colorKey: string23,
+ sizeName: string23,
+ colorName: string23
+};
+treemapSeriesOptionsDef.undocumentedGroupFills = undocumented8(arrayOf5(color5));
+treemapSeriesOptionsDef.undocumentedGroupStrokes = undocumented8(arrayOf5(color5));
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapModule.ts
+var { FONT_SIZE_RATIO: FONT_SIZE_RATIO3 } = _ModuleSupport164;
+var TreemapModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "treemap",
+ moduleFactory: (ctx) => new TreemapSeries(ctx),
+ solo: true,
+ themeTemplate: {
+ series: {
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ { $palette: "fills" },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", _ModuleSupport164.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["pattern", _ModuleSupport164.FILL_PATTERN_DEFAULTS],
+ ["image", _ModuleSupport164.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [{ $size: { $path: ["./data", { $path: "/data" }] } }, { $palette: "strokes" }]
+ },
+ colorRange: { $palette: "divergingColors" },
+ // @ts-expect-error undocumented option
+ undocumentedGroupFills: { $palette: "hierarchyColors" },
+ undocumentedGroupStrokes: { $palette: "secondHierarchyColors" },
+ group: {
+ label: {
+ ..._ModuleSupport164.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ color: { $ref: "textColor" },
+ fontStyle: void 0,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ spacing: 4
+ },
+ fill: void 0,
+ // Override default fill
+ stroke: void 0,
+ // Override default stroke
+ strokeWidth: 1,
+ padding: 4,
+ gap: 2,
+ textAlign: "left"
+ },
+ tile: {
+ label: {
+ ..._ModuleSupport164.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ color: { $ref: "chartBackgroundColor" },
+ fontStyle: void 0,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $rem: 1.5 },
+ minimumFontSize: { $rem: FONT_SIZE_RATIO3.SMALLER },
+ fontFamily: { $ref: "fontFamily" },
+ wrapping: "on-space",
+ overflowStrategy: "ellipsis",
+ spacing: 2
+ },
+ secondaryLabel: {
+ ..._ModuleSupport164.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ color: { $ref: "chartBackgroundColor" },
+ fontStyle: void 0,
+ fontWeight: void 0,
+ fontSize: { $ref: "fontSize" },
+ minimumFontSize: { $rem: FONT_SIZE_RATIO3.SMALLER },
+ fontFamily: { $ref: "fontFamily" },
+ wrapping: "never",
+ overflowStrategy: "ellipsis"
+ },
+ fill: void 0,
+ // Override default fill
+ stroke: void 0,
+ // Override default stroke
+ strokeWidth: { $isUserOption: ["../strokes/0", 2, { $isUserOption: ["./stroke", 2, 0] }] },
+ padding: 3,
+ gap: 1
+ },
+ // Override defaults
+ highlightStyle: {
+ group: {
+ label: {
+ color: { $ref: "textColor" }
+ },
+ fill: "rgba(255,255,255, 0.33)",
+ stroke: `rgba(0, 0, 0, 0.4)`,
+ strokeWidth: 2
+ },
+ tile: {
+ label: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ secondaryLabel: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ fill: "rgba(255,255,255, 0.33)",
+ stroke: `rgba(0, 0, 0, 0.4)`,
+ strokeWidth: 2
+ }
+ }
+ },
+ gradientLegend: {
+ enabled: true,
+ ..._ModuleSupport164.LEGEND_CONTAINER_THEME
+ }
+ }
+};
+var TreemapSeriesModule = {
+ type: "series",
+ name: "treemap",
+ chartType: "standalone",
+ enterprise: true,
+ options: treemapSeriesOptionsDef,
+ create: (ctx) => new TreemapSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/main-modules.ts
+var ModuleRegistry = _ModuleSupport165.ModuleRegistry;
+var AllCartesianEnterpriseModules = [
+ OrdinalTimeAxisModule,
+ BoxPlotSeriesModule,
+ CandlestickSeriesModule,
+ ConeFunnelSeriesModule,
+ FunnelSeriesModule,
+ HeatmapSeriesModule,
+ OhlcSeriesModule,
+ RangeAreaSeriesModule,
+ RangeBarSeriesModule,
+ WaterfallSeriesModule
+];
+var AllPolarEnterpriseModules = [
+ AngleNumberAxisModule,
+ AngleCategoryAxisModule,
+ RadiusNumberAxisModule,
+ RadiusCategoryAxisModule,
+ NightingaleSeriesModule,
+ RadarAreaSeriesModule,
+ RadarLineSeriesModule,
+ RadialBarSeriesModule,
+ RadialColumnSeriesModule
+];
+var AllStandaloneEnterpriseModules = [
+ StandaloneChartModule,
+ PyramidSeriesModule,
+ LinearGaugeSeriesModule,
+ RadialGaugeSeriesModule,
+ SunburstSeriesModule,
+ TreemapSeriesModule,
+ ChordSeriesModule,
+ SankeySeriesModule
+];
+var AllTopologyEnterpriseModules = [
+ TopologyChartModule,
+ MapLineSeriesModule,
+ MapLineBackgroundSeriesModule,
+ MapMarkerSeriesModule,
+ MapShapeSeriesModule,
+ MapShapeBackgroundSeriesModule
+];
+var AllEnterpriseModules = [
+ ...AllCartesianEnterpriseModules,
+ ...AllPolarEnterpriseModules,
+ ...AllStandaloneEnterpriseModules,
+ ...AllTopologyEnterpriseModules,
+ // Plugins, WIP
+ AnnotationsModule,
+ NavigatorModule,
+ InitialStateModule
+];
+export {
+ AllCartesianEnterpriseModules,
+ AllEnterpriseModules,
+ AllPolarEnterpriseModules,
+ AllStandaloneEnterpriseModules,
+ AllTopologyEnterpriseModules,
+ AngleCategoryAxisModule,
+ AngleNumberAxisModule,
+ BoxPlotSeriesModule,
+ CandlestickSeriesModule,
+ ChordSeriesModule,
+ ConeFunnelSeriesModule,
+ FunnelSeriesModule,
+ HeatmapSeriesModule,
+ LinearGaugeSeriesModule,
+ MapLineBackgroundSeriesModule,
+ MapLineSeriesModule,
+ MapMarkerSeriesModule,
+ MapShapeBackgroundSeriesModule,
+ MapShapeSeriesModule,
+ ModuleRegistry,
+ NightingaleSeriesModule,
+ OhlcSeriesModule,
+ OrdinalTimeAxisModule,
+ PyramidSeriesModule,
+ RadarAreaSeriesModule,
+ RadarLineSeriesModule,
+ RadialBarSeriesModule,
+ RadialColumnSeriesModule,
+ RadialGaugeSeriesModule,
+ RadiusCategoryAxisModule,
+ RadiusNumberAxisModule,
+ RangeAreaSeriesModule,
+ RangeBarSeriesModule,
+ SankeySeriesModule,
+ StandaloneChartModule,
+ SunburstSeriesModule,
+ TopologyChartModule,
+ TreemapSeriesModule,
+ WaterfallSeriesModule
+};
diff --git a/yuthon_report/static/src/lib/ag-chart/dist/package/main.cjs.js b/yuthon_report/static/src/lib/ag-chart/dist/package/main.cjs.js
new file mode 100644
index 000000000..cc5828556
--- /dev/null
+++ b/yuthon_report/static/src/lib/ag-chart/dist/package/main.cjs.js
@@ -0,0 +1,44813 @@
+"use strict";
+var __defProp = Object.defineProperty;
+var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
+var __getOwnPropNames = Object.getOwnPropertyNames;
+var __hasOwnProp = Object.prototype.hasOwnProperty;
+var __export = (target, all) => {
+ for (var name in all)
+ __defProp(target, name, { get: all[name], enumerable: true });
+};
+var __copyProps = (to, from, except, desc) => {
+ if (from && typeof from === "object" || typeof from === "function") {
+ for (let key of __getOwnPropNames(from))
+ if (!__hasOwnProp.call(to, key) && key !== except)
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
+ }
+ return to;
+};
+var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
+var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
+var __decorateClass = (decorators, target, key, kind) => {
+ var result = kind > 1 ? void 0 : kind ? __getOwnPropDesc(target, key) : target;
+ for (var i = decorators.length - 1, decorator; i >= 0; i--)
+ if (decorator = decorators[i])
+ result = (kind ? decorator(target, key, result) : decorator(result)) || result;
+ if (kind && result)
+ __defProp(target, key, result);
+ return result;
+};
+
+// packages/ag-charts-enterprise/src/main.ts
+var main_exports = {};
+__export(main_exports, {
+ AgChartsEnterpriseModule: () => AgChartsEnterpriseModule,
+ LicenseManager: () => LicenseManager2,
+ setupEnterpriseModules: () => setupEnterpriseModules2
+});
+module.exports = __toCommonJS(main_exports);
+var import_ag_charts_community283 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/license/md5.ts
+var MD5 = class {
+ constructor() {
+ this.ieCompatibility = false;
+ }
+ init() {
+ this.ieCompatibility = this.md5("hello") != "5d41402abc4b2a76b9719d911017c592";
+ }
+ md5cycle(x, k) {
+ let a = x[0], b = x[1], c = x[2], d = x[3];
+ a = this.ff(a, b, c, d, k[0], 7, -680876936);
+ d = this.ff(d, a, b, c, k[1], 12, -389564586);
+ c = this.ff(c, d, a, b, k[2], 17, 606105819);
+ b = this.ff(b, c, d, a, k[3], 22, -1044525330);
+ a = this.ff(a, b, c, d, k[4], 7, -176418897);
+ d = this.ff(d, a, b, c, k[5], 12, 1200080426);
+ c = this.ff(c, d, a, b, k[6], 17, -1473231341);
+ b = this.ff(b, c, d, a, k[7], 22, -45705983);
+ a = this.ff(a, b, c, d, k[8], 7, 1770035416);
+ d = this.ff(d, a, b, c, k[9], 12, -1958414417);
+ c = this.ff(c, d, a, b, k[10], 17, -42063);
+ b = this.ff(b, c, d, a, k[11], 22, -1990404162);
+ a = this.ff(a, b, c, d, k[12], 7, 1804603682);
+ d = this.ff(d, a, b, c, k[13], 12, -40341101);
+ c = this.ff(c, d, a, b, k[14], 17, -1502002290);
+ b = this.ff(b, c, d, a, k[15], 22, 1236535329);
+ a = this.gg(a, b, c, d, k[1], 5, -165796510);
+ d = this.gg(d, a, b, c, k[6], 9, -1069501632);
+ c = this.gg(c, d, a, b, k[11], 14, 643717713);
+ b = this.gg(b, c, d, a, k[0], 20, -373897302);
+ a = this.gg(a, b, c, d, k[5], 5, -701558691);
+ d = this.gg(d, a, b, c, k[10], 9, 38016083);
+ c = this.gg(c, d, a, b, k[15], 14, -660478335);
+ b = this.gg(b, c, d, a, k[4], 20, -405537848);
+ a = this.gg(a, b, c, d, k[9], 5, 568446438);
+ d = this.gg(d, a, b, c, k[14], 9, -1019803690);
+ c = this.gg(c, d, a, b, k[3], 14, -187363961);
+ b = this.gg(b, c, d, a, k[8], 20, 1163531501);
+ a = this.gg(a, b, c, d, k[13], 5, -1444681467);
+ d = this.gg(d, a, b, c, k[2], 9, -51403784);
+ c = this.gg(c, d, a, b, k[7], 14, 1735328473);
+ b = this.gg(b, c, d, a, k[12], 20, -1926607734);
+ a = this.hh(a, b, c, d, k[5], 4, -378558);
+ d = this.hh(d, a, b, c, k[8], 11, -2022574463);
+ c = this.hh(c, d, a, b, k[11], 16, 1839030562);
+ b = this.hh(b, c, d, a, k[14], 23, -35309556);
+ a = this.hh(a, b, c, d, k[1], 4, -1530992060);
+ d = this.hh(d, a, b, c, k[4], 11, 1272893353);
+ c = this.hh(c, d, a, b, k[7], 16, -155497632);
+ b = this.hh(b, c, d, a, k[10], 23, -1094730640);
+ a = this.hh(a, b, c, d, k[13], 4, 681279174);
+ d = this.hh(d, a, b, c, k[0], 11, -358537222);
+ c = this.hh(c, d, a, b, k[3], 16, -722521979);
+ b = this.hh(b, c, d, a, k[6], 23, 76029189);
+ a = this.hh(a, b, c, d, k[9], 4, -640364487);
+ d = this.hh(d, a, b, c, k[12], 11, -421815835);
+ c = this.hh(c, d, a, b, k[15], 16, 530742520);
+ b = this.hh(b, c, d, a, k[2], 23, -995338651);
+ a = this.ii(a, b, c, d, k[0], 6, -198630844);
+ d = this.ii(d, a, b, c, k[7], 10, 1126891415);
+ c = this.ii(c, d, a, b, k[14], 15, -1416354905);
+ b = this.ii(b, c, d, a, k[5], 21, -57434055);
+ a = this.ii(a, b, c, d, k[12], 6, 1700485571);
+ d = this.ii(d, a, b, c, k[3], 10, -1894986606);
+ c = this.ii(c, d, a, b, k[10], 15, -1051523);
+ b = this.ii(b, c, d, a, k[1], 21, -2054922799);
+ a = this.ii(a, b, c, d, k[8], 6, 1873313359);
+ d = this.ii(d, a, b, c, k[15], 10, -30611744);
+ c = this.ii(c, d, a, b, k[6], 15, -1560198380);
+ b = this.ii(b, c, d, a, k[13], 21, 1309151649);
+ a = this.ii(a, b, c, d, k[4], 6, -145523070);
+ d = this.ii(d, a, b, c, k[11], 10, -1120210379);
+ c = this.ii(c, d, a, b, k[2], 15, 718787259);
+ b = this.ii(b, c, d, a, k[9], 21, -343485551);
+ x[0] = this.add32(a, x[0]);
+ x[1] = this.add32(b, x[1]);
+ x[2] = this.add32(c, x[2]);
+ x[3] = this.add32(d, x[3]);
+ }
+ cmn(q, a, b, x, s, t) {
+ a = this.add32(this.add32(a, q), this.add32(x, t));
+ return this.add32(a << s | a >>> 32 - s, b);
+ }
+ ff(a, b, c, d, x, s, t) {
+ return this.cmn(b & c | ~b & d, a, b, x, s, t);
+ }
+ gg(a, b, c, d, x, s, t) {
+ return this.cmn(b & d | c & ~d, a, b, x, s, t);
+ }
+ hh(a, b, c, d, x, s, t) {
+ return this.cmn(b ^ c ^ d, a, b, x, s, t);
+ }
+ ii(a, b, c, d, x, s, t) {
+ return this.cmn(c ^ (b | ~d), a, b, x, s, t);
+ }
+ md51(s) {
+ const n = s.length;
+ const state = [1732584193, -271733879, -1732584194, 271733878];
+ let i;
+ for (i = 64; i <= s.length; i += 64) {
+ this.md5cycle(state, this.md5blk(s.substring(i - 64, i)));
+ }
+ s = s.substring(i - 64);
+ const tail = [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0];
+ for (i = 0; i < s.length; i++) {
+ tail[i >> 2] |= s.charCodeAt(i) << (i % 4 << 3);
+ }
+ tail[i >> 2] |= 128 << (i % 4 << 3);
+ if (i > 55) {
+ this.md5cycle(state, tail);
+ for (i = 0; i < 16; i++) {
+ tail[i] = 0;
+ }
+ }
+ tail[14] = n * 8;
+ this.md5cycle(state, tail);
+ return state;
+ }
+ /* there needs to be support for Unicode here, * unless we pretend that we can redefine the MD-5
+ * algorithm for multi-byte characters (perhaps by adding every four 16-bit characters and
+ * shortening the sum to 32 bits). Otherwise I suthis.ggest performing MD-5 as if every character
+ * was two bytes--e.g., 0040 0025 = @%--but then how will an ordinary MD-5 sum be matched?
+ * There is no way to standardize text to something like UTF-8 before transformation; speed cost is
+ * utterly prohibitive. The JavaScript standard itself needs to look at this: it should start
+ * providing access to strings as preformed UTF-8 8-bit unsigned value arrays.
+ */
+ md5blk(s) {
+ const md5blks = [];
+ for (let i = 0; i < 64; i += 4) {
+ md5blks[i >> 2] = s.charCodeAt(i) + (s.charCodeAt(i + 1) << 8) + (s.charCodeAt(i + 2) << 16) + (s.charCodeAt(i + 3) << 24);
+ }
+ return md5blks;
+ }
+ rhex(n) {
+ const hex_chr = "0123456789abcdef".split("");
+ let s = "", j = 0;
+ for (; j < 4; j++) {
+ s += hex_chr[n >> j * 8 + 4 & 15] + hex_chr[n >> j * 8 & 15];
+ }
+ return s;
+ }
+ hex(x) {
+ for (let i = 0; i < x.length; i++) {
+ x[i] = this.rhex(x[i]);
+ }
+ return x.join("");
+ }
+ md5(s) {
+ return this.hex(this.md51(s));
+ }
+ add32(a, b) {
+ return this.ieCompatibility ? this.add32Compat(a, b) : this.add32Std(a, b);
+ }
+ /* this function is much faster, so if possible we use it. Some IEs are the only ones I know of that
+ need the idiotic second function, generated by an if clause. */
+ add32Std(a, b) {
+ return a + b & 4294967295;
+ }
+ add32Compat(x, y) {
+ const lsw = (x & 65535) + (y & 65535), msw = (x >> 16) + (y >> 16) + (lsw >> 16);
+ return msw << 16 | lsw & 65535;
+ }
+};
+
+// packages/ag-charts-enterprise/src/license/licenseManager.ts
+function missingOrEmpty(value) {
+ return value == null || value.length === 0;
+}
+var LICENSE_TYPES = {
+ "01": "GRID",
+ "02": "CHARTS",
+ "0102": "BOTH"
+};
+var LICENSING_HELP_URL = "https://www.ag-grid.com/charts/licensing/";
+var _LicenseManager = class _LicenseManager {
+ constructor(document2) {
+ this.watermarkMessage = void 0;
+ this.totalMessageLength = 124;
+ this.document = document2;
+ this.md5 = new MD5();
+ this.md5.init();
+ }
+ validateLicense() {
+ const licenseDetails = this.getLicenseDetails(_LicenseManager.licenseKey, _LicenseManager.gridContext);
+ const currentLicenseName = `AG ${licenseDetails.currentLicenseType === "BOTH" ? "Grid and " : ""}Charts Enterprise`;
+ let suppliedLicenseName = "";
+ if (licenseDetails.suppliedLicenseType === "BOTH") {
+ suppliedLicenseName = "AG Grid and AG Charts Enterprise";
+ } else if (licenseDetails.suppliedLicenseType === "GRID") {
+ suppliedLicenseName = "AG Grid Enterprise";
+ } else if (licenseDetails.suppliedLicenseType !== void 0) {
+ suppliedLicenseName = "AG Charts Enterprise";
+ }
+ if (licenseDetails.missing) {
+ if (!this.isWebsiteUrl() || this.isForceWatermark()) {
+ this.outputMissingLicenseKey(currentLicenseName);
+ }
+ } else if (licenseDetails.expired) {
+ const gridReleaseDate = _LicenseManager.getChartsReleaseDate();
+ const formattedReleaseDate = _LicenseManager.formatDate(gridReleaseDate);
+ this.outputExpiredKey(licenseDetails.expiry, formattedReleaseDate, suppliedLicenseName);
+ } else if (!licenseDetails.valid) {
+ this.outputInvalidLicenseKey(
+ !!licenseDetails.incorrectLicenseType,
+ currentLicenseName,
+ suppliedLicenseName
+ );
+ } else if (licenseDetails.isTrial && licenseDetails.trialExpired) {
+ this.outputExpiredTrialKey(licenseDetails.expiry, currentLicenseName, suppliedLicenseName);
+ }
+ }
+ static extractExpiry(license) {
+ const restrictionHashed = license.substring(license.lastIndexOf("_") + 1, license.length);
+ return new Date(Number.parseInt(_LicenseManager.decode(restrictionHashed), 10));
+ }
+ static extractLicenseComponents(licenseKey) {
+ let cleanedLicenseKey = licenseKey.replaceAll(/[\u200B-\u200D\uFEFF]/g, "");
+ cleanedLicenseKey = cleanedLicenseKey.replaceAll(/\r?\n|\r/g, "");
+ if (licenseKey.length <= 32) {
+ return { md5: null, license: licenseKey, version: null, isTrial: null };
+ }
+ const hashStart = cleanedLicenseKey.length - 32;
+ const md5 = cleanedLicenseKey.substring(hashStart);
+ const license = cleanedLicenseKey.substring(0, hashStart);
+ const [version, isTrial, type] = _LicenseManager.extractBracketedInformation(cleanedLicenseKey);
+ return { md5, license, version, isTrial, type };
+ }
+ getLicenseDetails(licenseKey, gridContext = false) {
+ const currentLicenseType = "CHARTS";
+ if (missingOrEmpty(licenseKey)) {
+ return {
+ licenseKey,
+ valid: false,
+ missing: true,
+ currentLicenseType
+ };
+ }
+ const chartsReleaseDate = _LicenseManager.getChartsReleaseDate();
+ const { md5, license, version, isTrial, type } = _LicenseManager.extractLicenseComponents(licenseKey);
+ let valid = md5 === this.md5.md5(license) && !licenseKey.includes("For_Trialing_ag-Grid_Only");
+ let trialExpired = void 0;
+ let expired = void 0;
+ let expiry = null;
+ let incorrectLicenseType = false;
+ let suppliedLicenseType = void 0;
+ function handleTrial() {
+ const now = /* @__PURE__ */ new Date();
+ trialExpired = expiry < now;
+ expired = void 0;
+ }
+ if (valid) {
+ expiry = _LicenseManager.extractExpiry(license);
+ valid = !Number.isNaN(expiry.getTime());
+ if (valid) {
+ expired = chartsReleaseDate > expiry;
+ switch (version) {
+ case "legacy":
+ case "2": {
+ valid = false;
+ break;
+ }
+ case "3": {
+ if (missingOrEmpty(type)) {
+ valid = false;
+ } else {
+ suppliedLicenseType = type;
+ if (type !== LICENSE_TYPES["02"] && type !== LICENSE_TYPES["0102"]) {
+ valid = false;
+ incorrectLicenseType = true;
+ } else if (isTrial) {
+ handleTrial();
+ }
+ }
+ }
+ }
+ }
+ }
+ if (!valid) {
+ return {
+ licenseKey,
+ valid,
+ incorrectLicenseType,
+ currentLicenseType,
+ suppliedLicenseType
+ };
+ }
+ return {
+ licenseKey,
+ valid,
+ expiry: _LicenseManager.formatDate(expiry),
+ expired,
+ version,
+ isTrial,
+ trialExpired,
+ invalidLicenseTypeForCombo: gridContext ? suppliedLicenseType !== "BOTH" : void 0,
+ incorrectLicenseType,
+ currentLicenseType,
+ suppliedLicenseType
+ };
+ }
+ isDisplayWatermark() {
+ return this.isForceWatermark() || !this.isLocalhost() && !this.isE2ETest() && !this.isWebsiteUrl() && !missingOrEmpty(this.watermarkMessage);
+ }
+ getWatermarkMessage() {
+ return this.watermarkMessage ?? "";
+ }
+ getHostname() {
+ if (!this.document) {
+ return "localhost";
+ }
+ const win = this.document.defaultView ?? globalThis;
+ if (!win) {
+ return "localhost";
+ }
+ const loc = win.location;
+ const { hostname = "" } = loc;
+ return hostname;
+ }
+ isForceWatermark() {
+ if (!this.document) {
+ return false;
+ }
+ const win = this.document?.defaultView ?? globalThis.window != void 0 ? globalThis : void 0;
+ if (!win) {
+ return false;
+ }
+ const { pathname } = win.location;
+ return pathname ? pathname.includes("forceWatermark") : false;
+ }
+ isWebsiteUrl() {
+ const hostname = this.getHostname();
+ return /^((?:[\w-]+\.)?ag-grid\.com)$/.exec(hostname) !== null;
+ }
+ isLocalhost() {
+ const hostname = this.getHostname();
+ return /^(?:127\.0\.0\.1|localhost)$/.exec(hostname) !== null;
+ }
+ isE2ETest() {
+ const hostname = this.getHostname();
+ return /^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(hostname) !== null;
+ }
+ static formatDate(date) {
+ const monthNames = [
+ "January",
+ "February",
+ "March",
+ "April",
+ "May",
+ "June",
+ "July",
+ "August",
+ "September",
+ "October",
+ "November",
+ "December"
+ ];
+ const day = date.getDate();
+ const monthIndex = date.getMonth();
+ const year = date.getFullYear();
+ return day + " " + monthNames[monthIndex] + " " + year;
+ }
+ static getChartsReleaseDate() {
+ return new Date(Number.parseInt(_LicenseManager.decode(_LicenseManager.RELEASE_INFORMATION), 10));
+ }
+ static decode(input) {
+ const keystr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";
+ let t = "";
+ let n, r, i;
+ let s, o, u, a;
+ let f = 0;
+ const e = input.replaceAll(/[^A-Za-z0-9+/=]/g, "");
+ while (f < e.length) {
+ s = keystr.indexOf(e.charAt(f++));
+ o = keystr.indexOf(e.charAt(f++));
+ u = keystr.indexOf(e.charAt(f++));
+ a = keystr.indexOf(e.charAt(f++));
+ n = s << 2 | o >> 4;
+ r = (o & 15) << 4 | u >> 2;
+ i = (u & 3) << 6 | a;
+ t = t + String.fromCodePoint(n);
+ if (u != 64) {
+ t = t + String.fromCodePoint(r);
+ }
+ if (a != 64) {
+ t = t + String.fromCodePoint(i);
+ }
+ }
+ t = _LicenseManager.utf8_decode(t);
+ return t;
+ }
+ static utf8_decode(input) {
+ input = input.replaceAll("rn", "n");
+ let t = "";
+ for (let n = 0; n < input.length; n++) {
+ const r = input.codePointAt(n);
+ if (r < 128) {
+ t += String.fromCodePoint(r);
+ } else if (r > 127 && r < 2048) {
+ t += String.fromCodePoint(r >> 6 | 192);
+ t += String.fromCodePoint(r & 63 | 128);
+ } else {
+ t += String.fromCodePoint(r >> 12 | 224);
+ t += String.fromCodePoint(r >> 6 & 63 | 128);
+ t += String.fromCodePoint(r & 63 | 128);
+ }
+ }
+ return t;
+ }
+ static setGridContext(gridContext = false) {
+ _LicenseManager.gridContext = gridContext;
+ }
+ static setLicenseKey(licenseKey) {
+ if (this.licenseKey && this.licenseKey !== licenseKey) {
+ console.warn(
+ `License Key being set multiple times with different values. This can result in an incorrect license key being used.`
+ );
+ }
+ _LicenseManager.licenseKey = licenseKey;
+ }
+ static extractBracketedInformation(licenseKey) {
+ if (!licenseKey.includes("[")) {
+ return ["legacy", false, void 0];
+ }
+ const matches = licenseKey.match(/\[(.*?)\]/g).map((match) => match.replace("[", "").replace("]", ""));
+ if (!matches || matches.length === 0) {
+ return ["legacy", false, void 0];
+ }
+ const isTrial = matches.filter((match) => match === "TRIAL").length === 1;
+ const rawVersion = matches.find((match) => match.startsWith("v"));
+ const version = rawVersion ? rawVersion.replace("v", "") : "legacy";
+ const type = LICENSE_TYPES[matches.find((match) => LICENSE_TYPES[match])];
+ return [version, isTrial, type];
+ }
+ centerPadAndOutput(input) {
+ const paddingRequired = this.totalMessageLength - input.length;
+ console.error(input.padStart(paddingRequired / 2 + input.length, "*").padEnd(this.totalMessageLength, "*"));
+ }
+ padAndOutput(input, padding = "*", terminateWithPadding = "") {
+ console.error(
+ input.padEnd(this.totalMessageLength - terminateWithPadding.length, padding) + terminateWithPadding
+ );
+ }
+ outputInvalidLicenseKey(incorrectLicenseType, currentLicenseName, suppliedLicenseName) {
+ if (!_LicenseManager.gridContext) {
+ if (incorrectLicenseType) {
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput(` ${currentLicenseName} License `);
+ this.centerPadAndOutput(" Incompatible License Key ");
+ this.padAndOutput(
+ `* Your license key is for ${suppliedLicenseName} only and does not cover you for ${currentLicenseName}.`,
+ " ",
+ "*"
+ );
+ this.padAndOutput(`* To troubleshoot your license key visit ${LICENSING_HELP_URL}.`, " ", "*");
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput("");
+ } else {
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput(` ${currentLicenseName} License `);
+ this.centerPadAndOutput(" Invalid License Key ");
+ this.padAndOutput(`* Your license key is not valid.`, " ", "*");
+ this.padAndOutput(`* To troubleshoot your license key visit ${LICENSING_HELP_URL}.`, " ", "*");
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput("");
+ }
+ }
+ this.watermarkMessage = "Invalid License";
+ }
+ outputExpiredTrialKey(formattedExpiryDate, currentLicenseName, suppliedLicenseName) {
+ if (!_LicenseManager.gridContext) {
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput(` ${currentLicenseName} License `);
+ this.centerPadAndOutput(" Trial Period Expired. ");
+ this.padAndOutput(
+ `* Your trial only license for ${suppliedLicenseName} expired on ${formattedExpiryDate}.`,
+ " ",
+ "*"
+ );
+ this.padAndOutput("* Please email info@ag-grid.com to purchase a license.", " ", "*");
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput("");
+ }
+ this.watermarkMessage = "Trial Period Expired";
+ }
+ outputMissingLicenseKey(currentLicenseName) {
+ if (!_LicenseManager.gridContext) {
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput(` ${currentLicenseName} License `);
+ this.centerPadAndOutput(" License Key Not Found ");
+ this.padAndOutput(`* All ${currentLicenseName} features are unlocked for trial.`, " ", "*");
+ this.padAndOutput(
+ "* If you want to hide the watermark please email info@ag-grid.com for a trial license key.",
+ " ",
+ "*"
+ );
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput("");
+ }
+ this.watermarkMessage = "For Trial Use Only";
+ }
+ outputExpiredKey(formattedExpiryDate, formattedReleaseDate, currentLicenseName) {
+ if (!_LicenseManager.gridContext) {
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput(` ${currentLicenseName} License `);
+ this.centerPadAndOutput(" Incompatible Software Version ");
+ this.padAndOutput(
+ `* Your license key works with versions of ${currentLicenseName} released before ${formattedExpiryDate}.`,
+ " ",
+ "*"
+ );
+ this.padAndOutput(`* The version you are trying to use was released on ${formattedReleaseDate}.`, " ", "*");
+ this.padAndOutput("* Please contact info@ag-grid.com to renew your license key.", " ", "*");
+ this.centerPadAndOutput("");
+ this.centerPadAndOutput("");
+ }
+ this.watermarkMessage = "License Expired";
+ }
+};
+_LicenseManager.RELEASE_INFORMATION = "MTc2MTcyODQ5OTU1NQ==";
+_LicenseManager.gridContext = false;
+var LicenseManager = _LicenseManager;
+
+// packages/ag-charts-enterprise/src/setup.ts
+var import_ag_charts_community282 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/axes/angle-category/angleCategoryAxis.ts
+var import_ag_charts_community5 = require("ag-charts-community");
+var import_ag_charts_core4 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/utils/polar.ts
+function loopSymmetrically(items, step, iterator) {
+ const loop = (start, end, loopStep, loopIterator) => {
+ let prev = items[0];
+ for (let i = start; loopStep > 0 ? i <= end : i > end; i += loopStep) {
+ const curr = items[i];
+ if (loopIterator(prev, curr))
+ return true;
+ prev = curr;
+ }
+ return false;
+ };
+ const midIndex = Math.floor(items.length / 2);
+ if (loop(step, midIndex, step, iterator))
+ return true;
+ return loop(items.length - step, midIndex, -step, iterator);
+}
+
+// packages/ag-charts-enterprise/src/axes/angle-number/angleAxisInterval.ts
+var import_ag_charts_community = require("ag-charts-community");
+var { AxisInterval, Property } = import_ag_charts_community._ModuleSupport;
+var AngleAxisInterval = class extends AxisInterval {
+};
+__decorateClass([
+ Property
+], AngleAxisInterval.prototype, "minSpacing", 2);
+
+// packages/ag-charts-enterprise/src/axes/angle/angleAxis.ts
+var import_ag_charts_community4 = require("ag-charts-community");
+var import_ag_charts_core3 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/angleCrossLine.ts
+var import_ag_charts_community3 = require("ag-charts-community");
+var import_ag_charts_core2 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/polarCrossLine.ts
+var import_ag_charts_community2 = require("ag-charts-community");
+var import_ag_charts_core = require("ag-charts-core");
+var { BaseProperties, ChartAxisDirection, Property: Property2, Group, FONT_SIZE } = import_ag_charts_community2._ModuleSupport;
+var PolarCrossLineLabel = class extends BaseProperties {
+ constructor() {
+ super(...arguments);
+ this.fontSize = FONT_SIZE.LARGE;
+ this.fontFamily = "Verdana, sans-serif";
+ this.padding = 5;
+ this.color = "rgba(87, 87, 87, 1)";
+ }
+};
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "enabled", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "text", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontStyle", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontWeight", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontSize", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "fontFamily", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "padding", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "color", 2);
+__decorateClass([
+ Property2
+], PolarCrossLineLabel.prototype, "parallel", 2);
+var PolarCrossLine = class extends BaseProperties {
+ constructor() {
+ super(...arguments);
+ this.id = (0, import_ag_charts_core.createId)(this);
+ this.defaultColorRange = [];
+ this.shape = "polygon";
+ this.label = new PolarCrossLineLabel();
+ this.scale = void 0;
+ this.clippedRange = [-Infinity, Infinity];
+ this.gridLength = 0;
+ this.sideFlag = -1;
+ this.parallelFlipRotation = 0;
+ this.regularFlipRotation = 0;
+ this.direction = ChartAxisDirection.Angle;
+ this.axisInnerRadius = 0;
+ this.axisOuterRadius = 0;
+ this.lineGroup = new Group({ name: this.id });
+ this.rangeGroup = new Group({ name: this.id });
+ this.labelGroup = new Group({ name: this.id });
+ this._isRange = void 0;
+ }
+ assignCrossLineGroup(isRange, crossLineRange) {
+ if (isRange !== this._isRange) {
+ if (isRange) {
+ this.rangeGroup.appendChild(crossLineRange);
+ } else {
+ this.lineGroup.appendChild(crossLineRange);
+ }
+ }
+ this._isRange = isRange;
+ }
+ setSectorNodeProps(node) {
+ node.fill = this.fill;
+ node.fillOpacity = this.fillOpacity ?? 1;
+ node.stroke = this.stroke;
+ node.strokeOpacity = this.strokeOpacity ?? 1;
+ node.strokeWidth = this.strokeWidth ?? 1;
+ node.lineDash = this.lineDash;
+ }
+ setLabelNodeProps(node, x, y, baseline, rotation) {
+ const { label } = this;
+ node.x = x;
+ node.y = y;
+ node.text = label.text;
+ node.textAlign = "center";
+ node.textBaseline = baseline;
+ node.rotation = rotation;
+ node.rotationCenterX = x;
+ node.rotationCenterY = y;
+ node.fill = label.color;
+ node.fontFamily = label.fontFamily;
+ node.fontSize = label.fontSize;
+ node.fontStyle = label.fontStyle;
+ node.visible = true;
+ }
+};
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "enabled", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "type", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "range", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "value", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "fill", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "stroke", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "lineDash", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "shape", 2);
+__decorateClass([
+ Property2
+], PolarCrossLine.prototype, "label", 2);
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/angleCrossLine.ts
+var {
+ ChartAxisDirection: ChartAxisDirection2,
+ getCrossLineValue,
+ validateCrossLineValue,
+ normalizeAngle360,
+ Group: Group2,
+ Path,
+ Sector,
+ RotatableText,
+ ContinuousScale
+} = import_ag_charts_community3._ModuleSupport;
+var AngleCrossLine = class extends PolarCrossLine {
+ constructor() {
+ super();
+ this.direction = ChartAxisDirection2.Angle;
+ this.polygonNode = new Path();
+ this.sectorNode = new Sector();
+ this.lineNode = new Path();
+ this.crossLineRange = new Group2();
+ this.labelNode = new RotatableText();
+ this.ticks = [];
+ this.crossLineRange.append(this.polygonNode);
+ this.crossLineRange.append(this.sectorNode);
+ this.crossLineRange.append(this.lineNode);
+ this.labelGroup.append(this.labelNode);
+ }
+ visibilityCheck() {
+ if (!ContinuousScale.is(this.scale)) {
+ return true;
+ }
+ const [d0, d1] = this.scale.domain;
+ const value = getCrossLineValue(this);
+ if (this.type === "range") {
+ const [start, end] = value;
+ return start >= d0 && start <= d1 && end >= start && end <= d1;
+ } else {
+ return value >= d0 && value <= d1;
+ }
+ }
+ update(visible) {
+ const { scale } = this;
+ if (!scale || !validateCrossLineValue(this, scale) || !this.visibilityCheck()) {
+ this.rangeGroup.visible = false;
+ this.lineGroup.visible = false;
+ this.labelGroup.visible = false;
+ return;
+ }
+ this.rangeGroup.visible = visible;
+ this.lineGroup.visible = visible;
+ this.labelGroup.visible = visible;
+ this.updateLineNode(visible);
+ this.updatePolygonNode(visible);
+ this.updateSectorNode(visible);
+ this.updateLabelNode(visible);
+ }
+ updateLineNode(visible) {
+ const { scale, type, value, lineNode: line } = this;
+ if (!visible || type !== "line" || !scale) {
+ line.visible = false;
+ return;
+ }
+ const angle = scale.convert(value);
+ if (Number.isNaN(angle)) {
+ line.visible = false;
+ return;
+ }
+ const { axisInnerRadius, axisOuterRadius } = this;
+ line.visible = true;
+ line.stroke = this.stroke;
+ line.strokeOpacity = this.strokeOpacity ?? 1;
+ line.strokeWidth = this.strokeWidth ?? 1;
+ line.fill = void 0;
+ line.lineDash = this.lineDash;
+ const x = axisOuterRadius * Math.cos(angle);
+ const y = axisOuterRadius * Math.sin(angle);
+ const x0 = axisInnerRadius * Math.cos(angle);
+ const y0 = axisInnerRadius * Math.sin(angle);
+ line.path.clear(true);
+ line.path.moveTo(x0, y0);
+ line.path.lineTo(x, y);
+ this.assignCrossLineGroup(false, this.crossLineRange);
+ }
+ updatePolygonNode(visible) {
+ const { polygonNode: polygon, range: range2, scale, shape, type, ticks } = this;
+ if (!visible || type !== "range" || shape !== "polygon" || !scale || !range2) {
+ polygon.visible = false;
+ return;
+ }
+ const { axisInnerRadius, axisOuterRadius } = this;
+ const startIndex = ticks.indexOf(range2[0]);
+ const endIndex = ticks.indexOf(range2[1]);
+ const stops = startIndex <= endIndex ? ticks.slice(startIndex, endIndex + 1) : ticks.slice(startIndex).concat(ticks.slice(0, endIndex + 1));
+ const angles = stops.map((value) => scale.convert(value));
+ polygon.visible = true;
+ this.setSectorNodeProps(polygon);
+ const { path } = polygon;
+ path.clear(true);
+ for (const [index, angle] of angles.entries()) {
+ const x = axisOuterRadius * Math.cos(angle);
+ const y = axisOuterRadius * Math.sin(angle);
+ if (index === 0) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ }
+ if (axisInnerRadius === 0) {
+ path.lineTo(0, 0);
+ } else {
+ const reversedAngles = angles.slice().reverse();
+ for (const angle of reversedAngles) {
+ const x = axisInnerRadius * Math.cos(angle);
+ const y = axisInnerRadius * Math.sin(angle);
+ path.lineTo(x, y);
+ }
+ }
+ polygon.path.closePath();
+ this.assignCrossLineGroup(true, this.crossLineRange);
+ }
+ updateSectorNode(visible) {
+ const { sectorNode: sector, range: range2, scale, shape, type } = this;
+ if (!visible || type !== "range" || shape !== "circle" || !scale || !range2) {
+ sector.visible = false;
+ return;
+ }
+ const { axisInnerRadius, axisOuterRadius } = this;
+ const angles = range2.map((value) => scale.convert(value));
+ const step = scale.step ?? 0;
+ const padding = scale instanceof import_ag_charts_community3._ModuleSupport.BandScale ? step / 2 : 0;
+ sector.visible = true;
+ this.setSectorNodeProps(sector);
+ sector.centerX = 0;
+ sector.centerY = 0;
+ sector.innerRadius = axisInnerRadius;
+ sector.outerRadius = axisOuterRadius;
+ sector.startAngle = angles[0] - padding;
+ sector.endAngle = angles[1] + padding;
+ this.assignCrossLineGroup(true, this.crossLineRange);
+ }
+ updateLabelNode(visible) {
+ const { label, labelNode: node, range: range2, scale, type, ticks } = this;
+ if (!visible || label.enabled === false || !label.text || !scale || type === "range" && !range2) {
+ node.visible = false;
+ return;
+ }
+ node.visible = true;
+ const { axisInnerRadius, axisOuterRadius } = this;
+ let labelX;
+ let labelY;
+ let rotation;
+ let textBaseline;
+ if (type === "line") {
+ const angle = normalizeAngle360(scale.convert(this.value));
+ const angle270 = 1.5 * Math.PI;
+ const isRightSide = (0, import_ag_charts_core2.isNumberEqual)(angle, angle270) || angle > angle270 || angle < Math.PI / 2;
+ const midX = (axisInnerRadius + axisOuterRadius) / 2 * Math.cos(angle);
+ const midY = (axisInnerRadius + axisOuterRadius) / 2 * Math.sin(angle);
+ labelX = midX + label.padding * Math.cos(angle + Math.PI / 2);
+ labelY = midY + label.padding * Math.sin(angle + Math.PI / 2);
+ textBaseline = isRightSide ? "top" : "bottom";
+ rotation = isRightSide ? angle : angle - Math.PI;
+ } else {
+ const [startAngle, endAngle] = range2.map((value) => normalizeAngle360(scale.convert(value)));
+ let angle = (startAngle + endAngle) / 2;
+ if (startAngle > endAngle) {
+ angle -= Math.PI;
+ }
+ angle = normalizeAngle360(angle);
+ const isBottomSide = ((0, import_ag_charts_core2.isNumberEqual)(angle, 0) || angle > 0) && angle < Math.PI;
+ let distance;
+ if (this.shape === "circle" || ticks.length < 3) {
+ distance = axisOuterRadius - label.padding;
+ } else {
+ distance = axisOuterRadius * Math.cos(Math.PI / ticks.length) - label.padding;
+ }
+ labelX = distance * Math.cos(angle);
+ labelY = distance * Math.sin(angle);
+ textBaseline = isBottomSide ? "bottom" : "top";
+ rotation = isBottomSide ? angle - Math.PI / 2 : angle + Math.PI / 2;
+ }
+ this.setLabelNodeProps(node, labelX, labelY, textBaseline, rotation);
+ }
+};
+AngleCrossLine.className = "AngleCrossLine";
+
+// packages/ag-charts-enterprise/src/axes/angle/angleAxis.ts
+var {
+ ChartAxisDirection: ChartAxisDirection3,
+ Property: Property3,
+ toRadians,
+ normalizeAngle360: normalizeAngle3602,
+ normalizeAngle360Inclusive,
+ Path: Path2,
+ RotatableText: RotatableText2,
+ Transformable,
+ BBox,
+ Selection,
+ Line
+} = import_ag_charts_community4._ModuleSupport;
+var AngleAxisLabel = class extends import_ag_charts_community4._ModuleSupport.AxisLabel {
+ constructor() {
+ super(...arguments);
+ this.orientation = "fixed";
+ }
+};
+__decorateClass([
+ Property3
+], AngleAxisLabel.prototype, "orientation", 2);
+var AngleAxis = class extends import_ag_charts_community4._ModuleSupport.PolarAxis {
+ constructor(moduleCtx, scale) {
+ super(moduleCtx, scale);
+ this.startAngle = 0;
+ this.endAngle = void 0;
+ this.tickLineGroupSelection = Selection.select(
+ this.tickLineGroup,
+ Line,
+ false
+ );
+ this.gridLineGroupSelection = Selection.select(
+ this.gridLineGroup,
+ Line,
+ false
+ );
+ this.labelData = [];
+ this.tickData = [];
+ this.radiusLineGroup = this.axisGroup.appendChild(new import_ag_charts_community4._ModuleSupport.TransformableGroup());
+ this.radiusLine = this.radiusLineGroup.appendChild(new Path2());
+ this.includeInvisibleDomains = true;
+ }
+ get direction() {
+ return ChartAxisDirection3.Angle;
+ }
+ createLabel() {
+ return new AngleAxisLabel();
+ }
+ calculateRotations() {
+ const rotation = toRadians(this.startAngle);
+ const parallelFlipRotation = normalizeAngle3602(rotation);
+ const regularFlipRotation = normalizeAngle3602(rotation - Math.PI / 2);
+ return { rotation, parallelFlipRotation, regularFlipRotation };
+ }
+ calculateTickLayout(domain) {
+ const { nice, scale } = this;
+ const ticksParams = {
+ nice,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ };
+ const niceDomain = nice ? scale.niceDomain(ticksParams, domain) : domain;
+ const tickData = this.generateAngleTicks(niceDomain);
+ this.tickData = tickData;
+ const ticks = tickData.map((t) => t.value);
+ const fractionDigits = ticks.reduce(
+ (f, t) => Math.max(typeof t === "number" ? (0, import_ag_charts_core3.countFractionDigits)(t) : 0, f),
+ 0
+ );
+ return {
+ niceDomain,
+ tickDomain: niceDomain,
+ ticks,
+ rawTickCount: void 0,
+ fractionDigits,
+ timeInterval: void 0,
+ bbox: this.getBBox()
+ };
+ }
+ update() {
+ super.update();
+ this.updateRadiusLine();
+ this.updateGridLines();
+ this.updateTickLines();
+ }
+ normalizedAngles() {
+ const startAngle = normalizeAngle3602(-Math.PI / 2 + toRadians(this.startAngle));
+ const sweep = this.endAngle == null ? 2 * Math.PI : normalizeAngle360Inclusive(toRadians(this.endAngle) - toRadians(this.startAngle));
+ const endAngle = startAngle + sweep;
+ return [startAngle, endAngle];
+ }
+ computeRange() {
+ this.range = this.normalizedAngles();
+ }
+ updateSelections() {
+ const data = this.tickData;
+ this.gridLineGroupSelection.update(this.gridLength && this.gridLine.enabled ? data : []);
+ this.tickLineGroupSelection.update(this.tick.enabled ? data : []);
+ this.tickLabelGroupSelection.update(this.label.enabled ? data : []);
+ this.gridLineGroupSelection.cleanup();
+ this.tickLineGroupSelection.cleanup();
+ this.tickLabelGroupSelection.cleanup();
+ }
+ updatePosition() {
+ super.updatePosition();
+ const { translation, radiusLineGroup } = this;
+ const translationX = Math.floor(translation.x);
+ const translationY = Math.floor(translation.y);
+ radiusLineGroup.translationX = translationX;
+ radiusLineGroup.translationY = translationY;
+ }
+ updateRadiusLine() {
+ const node = this.radiusLine;
+ const { path } = node;
+ path.clear(true);
+ const { points, closePath } = this.getAxisLinePoints();
+ for (const { x, y, moveTo: moveTo2, arc, radius = 0, startAngle = 0, endAngle = 0 } of points) {
+ if (arc) {
+ path.arc(x, y, radius, startAngle, endAngle);
+ } else if (moveTo2) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ }
+ if (closePath) {
+ path.closePath();
+ }
+ node.visible = this.line.enabled;
+ node.stroke = this.line.stroke;
+ node.strokeWidth = this.line.width;
+ node.fill = void 0;
+ }
+ getAxisLinePoints() {
+ const { scale, shape, gridLength: radius } = this;
+ const [startAngle, endAngle] = this.range;
+ const isFullCircle = (0, import_ag_charts_core3.isNumberEqual)(endAngle - startAngle, 2 * Math.PI);
+ const points = [];
+ if (shape === "circle") {
+ if (isFullCircle) {
+ points.push(
+ { x: radius, y: 0, moveTo: true },
+ {
+ x: 0,
+ y: 0,
+ radius,
+ startAngle: 0,
+ endAngle: 2 * Math.PI,
+ arc: true,
+ moveTo: false
+ }
+ );
+ } else {
+ points.push(
+ {
+ x: radius * Math.cos(startAngle),
+ y: radius * Math.sin(startAngle),
+ moveTo: true
+ },
+ {
+ x: 0,
+ y: 0,
+ radius,
+ startAngle: normalizeAngle3602(startAngle),
+ endAngle: normalizeAngle3602(endAngle),
+ arc: true,
+ moveTo: false
+ }
+ );
+ }
+ } else if (shape === "polygon") {
+ const angles = scale.ticks({
+ nice: this.nice,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ })?.ticks?.map((value) => scale.convert(value));
+ if (angles && angles.length > 2) {
+ for (const [i, angle] of angles.entries()) {
+ const x = radius * Math.cos(angle);
+ const y = radius * Math.sin(angle);
+ const moveTo2 = i === 0;
+ points.push({ x, y, moveTo: moveTo2 });
+ }
+ }
+ }
+ return { points, closePath: isFullCircle };
+ }
+ updateGridLines() {
+ const {
+ scale,
+ gridLength: radius,
+ gridLine: { style, width },
+ innerRadiusRatio
+ } = this;
+ if (!(style && radius > 0)) {
+ return;
+ }
+ const innerRadius = radius * innerRadiusRatio;
+ const styleCount = style.length;
+ this.gridLineGroupSelection.each((line, datum, index) => {
+ const { value } = datum;
+ const { stroke: stroke2, lineDash } = style[index % styleCount];
+ const angle = scale.convert(value);
+ line.x1 = innerRadius * Math.cos(angle);
+ line.y1 = innerRadius * Math.sin(angle);
+ line.x2 = radius * Math.cos(angle);
+ line.y2 = radius * Math.sin(angle);
+ line.stroke = stroke2;
+ line.strokeWidth = width;
+ line.lineDash = lineDash;
+ line.fill = void 0;
+ });
+ this.gridLineGroupSelection.cleanup();
+ }
+ updateLabels() {
+ const { label, tickLabelGroupSelection } = this;
+ tickLabelGroupSelection.each((node, _, index) => {
+ const labelDatum = this.labelData[index];
+ if (!labelDatum || labelDatum.hidden) {
+ node.visible = false;
+ return;
+ }
+ node.text = labelDatum.text;
+ node.setFont(label);
+ node.fill = label.color;
+ node.x = labelDatum.x;
+ node.y = labelDatum.y;
+ node.setAlign(labelDatum);
+ node.setBoxing(label);
+ node.visible = true;
+ if (labelDatum.rotation) {
+ node.rotation = labelDatum.rotation;
+ node.rotationCenterX = labelDatum.x;
+ node.rotationCenterY = labelDatum.y;
+ } else {
+ node.rotation = 0;
+ }
+ });
+ }
+ updateTickLines() {
+ const { scale, gridLength: radius, tick, tickLineGroupSelection } = this;
+ tickLineGroupSelection.each((line, datum) => {
+ const { value } = datum;
+ const angle = scale.convert(value);
+ const cos = Math.cos(angle);
+ const sin = Math.sin(angle);
+ line.x1 = radius * cos;
+ line.y1 = radius * sin;
+ line.x2 = (radius + tick.size) * cos;
+ line.y2 = (radius + tick.size) * sin;
+ line.stroke = tick.stroke;
+ line.strokeWidth = tick.width;
+ });
+ }
+ createLabelNodeData(ticks, options, seriesRect) {
+ const { label, gridLength: radius, scale, tick } = this;
+ if (!label.enabled) {
+ return [];
+ }
+ const tempText = new RotatableText2();
+ const seriesLeft = seriesRect.x - this.translation.x;
+ const seriesRight = seriesRect.x + seriesRect.width - this.translation.x;
+ const { fractionDigits } = this.layout.label;
+ const axisTickFormatter = this.tickFormatter(this.scale.domain, this.tickData, false, fractionDigits);
+ const labelData = ticks.map((datum, index) => {
+ const { value } = datum;
+ const distance = radius + label.spacing + tick.size;
+ const angle = scale.convert(value);
+ const cos = Math.cos(angle);
+ const sin = Math.sin(angle);
+ const x = distance * cos;
+ const y = distance * sin;
+ const { textAlign, textBaseline } = this.getLabelAlign(angle);
+ const isLastTickOverFirst = index === ticks.length - 1 && value !== ticks[0] && (0, import_ag_charts_core3.isNumberEqual)(normalizeAngle3602(angle), normalizeAngle3602(scale.convert(ticks[0])));
+ const rotation = this.getLabelRotation(angle);
+ let text2 = axisTickFormatter(value, index);
+ tempText.text = text2;
+ tempText.x = x;
+ tempText.y = y;
+ tempText.setFont(label);
+ tempText.textAlign = textAlign;
+ tempText.textBaseline = textBaseline;
+ tempText.rotation = rotation;
+ if (rotation) {
+ tempText.rotationCenterX = x;
+ tempText.rotationCenterY = y;
+ }
+ let box = rotation ? Transformable.toCanvas(tempText) : tempText.getBBox();
+ if (box && options.hideWhenNecessary && !rotation) {
+ const overflowLeft = seriesLeft - box.x;
+ const overflowRight = box.x + box.width - seriesRight;
+ const pixelError = 1;
+ if (overflowLeft > pixelError || overflowRight > pixelError) {
+ const availWidth = box.width - Math.max(overflowLeft, overflowRight);
+ const wrapOptions = { maxWidth: availWidth, font: label, textWrap: "never" };
+ text2 = (0, import_ag_charts_core3.wrapTextOrSegments)(text2, wrapOptions);
+ tempText.text = text2;
+ box = tempText.getBBox();
+ }
+ }
+ return {
+ text: text2,
+ x,
+ y,
+ textAlign,
+ textBaseline,
+ hidden: text2 === "" || (datum.hidden ?? isLastTickOverFirst),
+ rotation,
+ box
+ };
+ });
+ if (label.avoidCollisions) {
+ this.avoidLabelCollisions(labelData);
+ }
+ return labelData;
+ }
+ computeLabelsBBox(options, seriesRect) {
+ this.labelData = this.createLabelNodeData(this.tickData, options, seriesRect);
+ const textBoxes = this.labelData.map(({ box }) => box).filter((box) => box != null);
+ if (!this.label.enabled || textBoxes.length === 0) {
+ return null;
+ }
+ return BBox.merge(textBoxes);
+ }
+ getLabelOrientation() {
+ const { label } = this;
+ return label instanceof AngleAxisLabel ? label.orientation : "fixed";
+ }
+ getLabelRotation(tickAngle) {
+ let rotation = toRadians(this.label.rotation ?? 0);
+ tickAngle = normalizeAngle3602(tickAngle);
+ const orientation = this.getLabelOrientation();
+ if (orientation === "parallel") {
+ rotation += tickAngle;
+ if (tickAngle >= 0 && tickAngle < Math.PI) {
+ rotation -= Math.PI / 2;
+ } else {
+ rotation += Math.PI / 2;
+ }
+ } else if (orientation === "perpendicular") {
+ rotation += tickAngle;
+ if (tickAngle >= Math.PI / 2 && tickAngle < 1.5 * Math.PI) {
+ rotation += Math.PI;
+ }
+ }
+ return rotation;
+ }
+ getLabelAlign(tickAngle) {
+ const cos = Math.cos(tickAngle);
+ const sin = Math.sin(tickAngle);
+ let textAlign;
+ let textBaseline;
+ const orientation = this.getLabelOrientation();
+ const isCos0 = (0, import_ag_charts_core3.isNumberEqual)(cos, 0);
+ const isSin0 = (0, import_ag_charts_core3.isNumberEqual)(sin, 0);
+ const isCos1 = (0, import_ag_charts_core3.isNumberEqual)(cos, 1);
+ const isSinMinus1 = (0, import_ag_charts_core3.isNumberEqual)(sin, -1);
+ const isCosPositive = cos > 0 && !isCos0;
+ const isSinPositive = sin > 0 && !isSin0;
+ if (orientation === "parallel") {
+ textAlign = "center";
+ textBaseline = isCos1 && isSin0 || isSinPositive ? "top" : "bottom";
+ } else if (orientation === "perpendicular") {
+ textAlign = isSinMinus1 || isCosPositive ? "left" : "right";
+ textBaseline = "middle";
+ } else {
+ textAlign = "right";
+ if (isCos0) {
+ textAlign = "center";
+ } else if (isCosPositive) {
+ textAlign = "left";
+ }
+ textBaseline = "bottom";
+ if (isSin0) {
+ textBaseline = "middle";
+ } else if (isSinPositive) {
+ textBaseline = "top";
+ }
+ }
+ return { textAlign, textBaseline };
+ }
+ updateCrossLines() {
+ const { shape, gridLength: radius, innerRadiusRatio } = this;
+ for (const crossLine of this.crossLines) {
+ if (crossLine instanceof AngleCrossLine) {
+ crossLine.ticks = this.tickData.map((t) => t.value);
+ crossLine.shape = shape;
+ crossLine.axisOuterRadius = radius;
+ crossLine.axisInnerRadius = radius * innerRadiusRatio;
+ }
+ }
+ super.updateCrossLines();
+ }
+};
+AngleAxis.CrossLineConstructor = AngleCrossLine;
+__decorateClass([
+ Property3
+], AngleAxis.prototype, "startAngle", 2);
+__decorateClass([
+ Property3
+], AngleAxis.prototype, "endAngle", 2);
+
+// packages/ag-charts-enterprise/src/axes/angle-category/angleCategoryAxis.ts
+var { Property: Property4, CategoryScale } = import_ag_charts_community5._ModuleSupport;
+var AngleCategoryAxis = class extends AngleAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new CategoryScale());
+ this.groupPaddingInner = 0;
+ this.paddingInner = 0;
+ this.interval = new AngleAxisInterval();
+ }
+ hasDefinedDomain() {
+ return false;
+ }
+ generateAngleTicks(domain) {
+ const { scale, gridLength: radius } = this;
+ const { values, minSpacing } = this.interval;
+ const tickParams = {
+ nice: this.nice,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ };
+ const ticks = values ?? scale.ticks(tickParams, domain)?.ticks ?? [];
+ if (ticks.length < 2 || minSpacing == null) {
+ return ticks.map((value) => {
+ return { value, visible: true };
+ });
+ }
+ const startTick = ticks[0];
+ const startAngle = scale.convert(startTick);
+ const startX = radius * Math.cos(startAngle);
+ const startY = radius * Math.sin(startAngle);
+ for (let step = 1; step < ticks.length - 1; step++) {
+ const nextTick = ticks[step];
+ const nextAngle = scale.convert(nextTick);
+ if (nextAngle - startAngle > Math.PI) {
+ break;
+ }
+ const nextX = radius * Math.cos(nextAngle);
+ const nextY = radius * Math.sin(nextAngle);
+ const spacing = Math.hypot(nextX - startX, nextY - startY);
+ if (spacing > minSpacing) {
+ const visibleTicks = /* @__PURE__ */ new Set([startTick]);
+ loopSymmetrically(ticks, step, (_, next) => {
+ visibleTicks.add(next);
+ });
+ return ticks.map((value) => {
+ const visible = visibleTicks.has(value);
+ return { value, visible };
+ });
+ }
+ }
+ return [{ value: startTick, visible: true }];
+ }
+ avoidLabelCollisions(labelData) {
+ const { minSpacing } = this.label;
+ if (labelData.length < 3)
+ return;
+ const labelsCollide = (prev, next) => {
+ if (prev.hidden || next.hidden) {
+ return false;
+ } else if (minSpacing == null) {
+ return prev.box.collidesBBox(next.box);
+ }
+ const prevBox = prev.box.clone().grow(minSpacing / 2);
+ const nextBox = next.box.clone().grow(minSpacing / 2);
+ return prevBox.collidesBBox(nextBox);
+ };
+ const firstLabel = labelData[0];
+ const lastLabel = labelData.at(-1);
+ const visibleLabels = /* @__PURE__ */ new Set([firstLabel]);
+ const lastLabelIsOverFirst = (0, import_ag_charts_core4.isNumberEqual)(firstLabel.x, lastLabel.x) && (0, import_ag_charts_core4.isNumberEqual)(firstLabel.y, lastLabel.y);
+ const maxStep = Math.floor(labelData.length / 2);
+ for (let step = 1; step <= maxStep; step++) {
+ const labels = lastLabelIsOverFirst ? labelData.slice(0, -1) : labelData;
+ const collisionDetected = loopSymmetrically(labels, step, labelsCollide);
+ if (!collisionDetected) {
+ loopSymmetrically(labels, step, (_, next) => {
+ visibleLabels.add(next);
+ });
+ break;
+ }
+ }
+ for (const datum of labelData) {
+ if (!visibleLabels.has(datum)) {
+ datum.hidden = true;
+ datum.box = void 0;
+ }
+ }
+ }
+ tickFormatParams() {
+ return { type: "category" };
+ }
+ datumFormatParams(value, params) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return { type: "category", value, datum, seriesId, legendItemName, key, source, property, domain, boundSeries };
+ }
+};
+AngleCategoryAxis.className = "AngleCategoryAxis";
+AngleCategoryAxis.type = "angle-category";
+__decorateClass([
+ Property4
+], AngleCategoryAxis.prototype, "groupPaddingInner", 2);
+__decorateClass([
+ Property4
+], AngleCategoryAxis.prototype, "paddingInner", 2);
+__decorateClass([
+ Property4
+], AngleCategoryAxis.prototype, "interval", 2);
+
+// packages/ag-charts-enterprise/src/axes/angle-category/angleCategoryAxisModule.ts
+var AngleCategoryAxisModule = {
+ type: "axis",
+ optionsKey: "axes[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "angle-category",
+ moduleFactory: (ctx) => new AngleCategoryAxis(ctx)
+};
+
+// packages/ag-charts-enterprise/src/axes/angle-number/angleNumberAxis.ts
+var import_ag_charts_community7 = require("ag-charts-community");
+var import_ag_charts_core6 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/axes/angle-number/linearAngleScale.ts
+var import_ag_charts_community6 = require("ag-charts-community");
+var import_ag_charts_core5 = require("ag-charts-core");
+var { range, isDenseInterval, LinearScale } = import_ag_charts_community6._ModuleSupport;
+var LinearAngleScale = class _LinearAngleScale extends LinearScale {
+ constructor() {
+ super(...arguments);
+ this.arcLength = 0;
+ }
+ static getNiceStepAndTickCount(ticks, domain) {
+ const [start, stop] = domain;
+ let step = LinearScale.getTickStep(start, stop, ticks);
+ const maxTickCount = Number.isNaN(ticks.maxTickCount) ? Infinity : ticks.maxTickCount;
+ const expectedTickCount = Math.abs(stop - start) / step;
+ let niceTickCount = Math.pow(2, Math.ceil(Math.log(expectedTickCount) / Math.log(2)));
+ if (niceTickCount > maxTickCount) {
+ niceTickCount /= 2;
+ step *= 2;
+ }
+ return { count: niceTickCount, step };
+ }
+ ticks(ticks, domain = this.domain) {
+ const { arcLength } = this;
+ if (!domain || domain.length < 2 || domain.some((d) => !Number.isFinite(d)) || arcLength <= 0) {
+ return { ticks: [], count: 0 };
+ }
+ const { nice, interval } = ticks;
+ const [d0, d1] = domain;
+ if (interval) {
+ const step2 = Math.abs(interval);
+ const availableRange = this.getPixelRange();
+ if (!isDenseInterval((d1 - d0) / step2, availableRange)) {
+ return range(d0, d1, step2);
+ }
+ }
+ let step;
+ if (nice && this.hasNiceRange()) {
+ const linearNiceDomain = super.niceDomain(ticks, domain);
+ step = _LinearAngleScale.getNiceStepAndTickCount(ticks, linearNiceDomain).step;
+ } else {
+ step = LinearScale.getTickStep(d0, d1, ticks);
+ }
+ return range(d0, d1, step);
+ }
+ hasNiceRange() {
+ const sortedRange = this.range.slice().sort((a, b) => a - b);
+ const niceRanges = [Math.PI, 2 * Math.PI];
+ return niceRanges.some((r) => (0, import_ag_charts_core5.isNumberEqual)(r, sortedRange[1] - sortedRange[0]));
+ }
+ niceDomain(ticks, domain = this.domain) {
+ const linearNiceDomain = super.niceDomain(ticks, domain);
+ if (!this.hasNiceRange())
+ return linearNiceDomain;
+ const reversed = linearNiceDomain[0] > linearNiceDomain[1];
+ const start = reversed ? linearNiceDomain[1] : linearNiceDomain[0];
+ const { step, count } = _LinearAngleScale.getNiceStepAndTickCount(ticks, linearNiceDomain);
+ const s = 1 / step;
+ const stop = step >= 1 ? Math.ceil(start / step + count) * step : Math.ceil((start + count * step) * s) / s;
+ return reversed ? [stop, start] : [start, stop];
+ }
+ getPixelRange() {
+ return this.arcLength;
+ }
+};
+
+// packages/ag-charts-enterprise/src/axes/angle-number/angleNumberAxis.ts
+var { Property: Property5, angleBetween, normalisedExtentWithMetadata, findMinMax } = import_ag_charts_community7._ModuleSupport;
+var AngleNumberAxis = class extends AngleAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new LinearAngleScale());
+ this.shape = "circle";
+ this.interval = new AngleAxisInterval();
+ }
+ hasDefinedDomain() {
+ const { min, max } = this;
+ return min != null && max != null && min < max;
+ }
+ normaliseDataDomain(d) {
+ const { min, max } = this;
+ const { extent: extent3, clipped } = normalisedExtentWithMetadata(d, min, max);
+ return { domain: extent3, clipped };
+ }
+ updateScale() {
+ super.updateScale();
+ this.scale.arcLength = this.getRangeArcLength();
+ }
+ getRangeArcLength() {
+ const { range: requestedRange } = this;
+ const min = Math.min(...requestedRange);
+ const max = Math.max(...requestedRange);
+ const rotation = angleBetween(min, max) || 2 * Math.PI;
+ const radius = this.gridLength;
+ return rotation * radius;
+ }
+ generateAngleTicks(domain) {
+ const { scale, range: requestedRange, nice } = this;
+ const { values, step, minSpacing, maxSpacing } = this.interval;
+ let rawTicks;
+ if (values == null) {
+ const { arcLength } = scale;
+ const minTickCount = maxSpacing ? Math.floor(arcLength / maxSpacing) : 1;
+ const maxTickCount = minSpacing ? Math.floor(arcLength / minSpacing) : Infinity;
+ const preferredTickCount = Math.floor(4 / Math.PI * Math.abs(requestedRange[0] - requestedRange[1]));
+ const tickCount = Math.max(minTickCount, Math.min(maxTickCount, preferredTickCount));
+ const tickParams = {
+ nice,
+ interval: step,
+ tickCount,
+ minTickCount,
+ maxTickCount
+ };
+ rawTicks = scale.ticks(tickParams, domain)?.ticks ?? [];
+ } else {
+ const [d0, d1] = findMinMax(domain.map(Number));
+ rawTicks = values.filter((value) => value >= d0 && value <= d1).sort((a, b) => a - b);
+ }
+ return rawTicks.map((value) => ({ value, visible: true }));
+ }
+ avoidLabelCollisions(labelData) {
+ const { minSpacing } = this.label;
+ const labelsCollide = (prev, next) => {
+ if (prev.hidden || next.hidden) {
+ return false;
+ } else if (minSpacing == null) {
+ return prev.box.collidesBBox(next.box);
+ }
+ const prevBox = prev.box.clone().grow(minSpacing / 2);
+ const nextBox = next.box.clone().grow(minSpacing / 2);
+ return prevBox.collidesBBox(nextBox);
+ };
+ const firstLabel = labelData[0];
+ const lastLabel = labelData.at(-1);
+ if (firstLabel !== lastLabel && (0, import_ag_charts_core6.isNumberEqual)(firstLabel.x, lastLabel.x) && (0, import_ag_charts_core6.isNumberEqual)(firstLabel.y, lastLabel.y)) {
+ lastLabel.hidden = true;
+ }
+ for (let step = 1; step < labelData.length; step *= 2) {
+ let collisionDetected = false;
+ for (let i = step; i < labelData.length; i += step) {
+ const next = labelData[i];
+ const prev = labelData[i - step];
+ if (labelsCollide(prev, next)) {
+ collisionDetected = true;
+ break;
+ }
+ }
+ if (!collisionDetected) {
+ for (const [i, datum] of labelData.entries()) {
+ if (i % step > 0) {
+ datum.hidden = true;
+ datum.box = void 0;
+ }
+ }
+ return;
+ }
+ }
+ for (const [i, datum] of labelData.entries()) {
+ if (i > 0) {
+ datum.hidden = true;
+ datum.box = void 0;
+ }
+ }
+ }
+ tickFormatParams(_domain, _ticks, fractionDigits) {
+ return { type: "number", fractionDigits };
+ }
+ datumFormatParams(value, params, fractionDigits) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return {
+ type: "number",
+ value,
+ datum,
+ seriesId,
+ legendItemName,
+ key,
+ source,
+ property,
+ domain,
+ boundSeries,
+ fractionDigits
+ };
+ }
+};
+AngleNumberAxis.className = "AngleNumberAxis";
+AngleNumberAxis.type = "angle-number";
+__decorateClass([
+ Property5
+], AngleNumberAxis.prototype, "min", 2);
+__decorateClass([
+ Property5
+], AngleNumberAxis.prototype, "max", 2);
+__decorateClass([
+ Property5
+], AngleNumberAxis.prototype, "interval", 2);
+
+// packages/ag-charts-enterprise/src/axes/angle-number/angleNumberAxisModule.ts
+var AngleNumberAxisModule = {
+ type: "axis",
+ optionsKey: "axes[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "angle-number",
+ moduleFactory: (ctx) => new AngleNumberAxis(ctx)
+};
+
+// packages/ag-charts-enterprise/src/axes/ordinal/ordinalTimeAxis.ts
+var import_ag_charts_community8 = require("ag-charts-community");
+var {
+ OrdinalTimeScale,
+ Property: Property6,
+ TimeAxisParentLevel,
+ lowestGranularityUnitForTicks,
+ lowestGranularityUnitForValue,
+ minimumTimeAxisDatumGranularity,
+ dateTruncationForDomain,
+ intervalUnit,
+ intervalStep,
+ intervalEpoch,
+ intervalMilliseconds
+} = import_ag_charts_community8._ModuleSupport;
+var OrdinalTimeAxis = class extends import_ag_charts_community8._ModuleSupport.DiscreteTimeAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new OrdinalTimeScale());
+ this.parentLevel = new TimeAxisParentLevel();
+ }
+ get primaryLabel() {
+ return this.parentLevel.enabled ? this.parentLevel.label : void 0;
+ }
+ get primaryTick() {
+ return this.parentLevel.enabled ? this.parentLevel.tick : void 0;
+ }
+ processData() {
+ super.processData();
+ const { boundSeries, direction } = this;
+ this.minimumTimeGranularity = minimumTimeAxisDatumGranularity(boundSeries, direction, void 0, void 0);
+ }
+ tickFormatParams(domain, ticks, _fractionDigits, timeInterval) {
+ timeInterval ?? (timeInterval = lowestGranularityUnitForTicks(ticks));
+ const truncateDate = dateTruncationForDomain(domain);
+ const unit = intervalUnit(timeInterval);
+ const step = intervalStep(timeInterval);
+ const epoch = intervalEpoch(timeInterval);
+ return { type: "date", unit, step, epoch, truncateDate };
+ }
+ datumFormatParams(value, params, _fractionDigits, timeInterval, style) {
+ if (typeof value === "number")
+ value = new Date(value);
+ if (timeInterval == null) {
+ const { minimumTimeGranularity } = this;
+ const datumGranularity = lowestGranularityUnitForValue(value);
+ if (minimumTimeGranularity != null && intervalMilliseconds(minimumTimeGranularity) < intervalMilliseconds(datumGranularity)) {
+ timeInterval = minimumTimeGranularity;
+ } else {
+ timeInterval = datumGranularity;
+ }
+ }
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ const unit = intervalUnit(timeInterval);
+ const step = intervalStep(timeInterval);
+ const epoch = intervalEpoch(timeInterval);
+ return {
+ type: "date",
+ value,
+ datum,
+ seriesId,
+ legendItemName,
+ key,
+ source,
+ property,
+ domain,
+ boundSeries,
+ unit,
+ step,
+ epoch,
+ style
+ };
+ }
+};
+OrdinalTimeAxis.className = "OrdinalTimeAxis";
+OrdinalTimeAxis.type = "ordinal-time";
+__decorateClass([
+ Property6
+], OrdinalTimeAxis.prototype, "parentLevel", 2);
+
+// packages/ag-charts-enterprise/src/axes/ordinal/ordinalTimeAxisModule.ts
+var OrdinalTimeAxisModule = {
+ type: "axis",
+ optionsKey: "axes[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "ordinal-time",
+ moduleFactory: (ctx) => new OrdinalTimeAxis(ctx)
+};
+
+// packages/ag-charts-enterprise/src/axes/radius-category/radiusCategoryAxis.ts
+var import_ag_charts_community11 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/axes/radius/radiusAxis.ts
+var import_ag_charts_community10 = require("ag-charts-community");
+var import_ag_charts_core8 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/axes/polar-crosslines/radiusCrossLine.ts
+var import_ag_charts_community9 = require("ag-charts-community");
+var import_ag_charts_core7 = require("ag-charts-core");
+var {
+ ChartAxisDirection: ChartAxisDirection4,
+ Property: Property7,
+ validateCrossLineValue: validateCrossLineValue2,
+ normalizeAngle360FromDegrees,
+ Group: Group3,
+ Path: Path3,
+ Sector: Sector2,
+ RotatableText: RotatableText3
+} = import_ag_charts_community9._ModuleSupport;
+var RadiusCrossLineLabel = class extends PolarCrossLineLabel {
+ constructor() {
+ super(...arguments);
+ this.positionAngle = void 0;
+ }
+};
+__decorateClass([
+ Property7
+], RadiusCrossLineLabel.prototype, "positionAngle", 2);
+var RadiusCrossLine = class extends PolarCrossLine {
+ constructor() {
+ super();
+ this.direction = ChartAxisDirection4.Radius;
+ this.label = new RadiusCrossLineLabel();
+ this.polygonNode = new Path3();
+ this.sectorNode = new Sector2();
+ this.crossLineRange = new Group3();
+ this.labelNode = new RotatableText3();
+ this.outerRadius = 0;
+ this.innerRadius = 0;
+ this.crossLineRange.append(this.polygonNode);
+ this.crossLineRange.append(this.sectorNode);
+ this.labelGroup.append(this.labelNode);
+ }
+ update(visible) {
+ const { scale } = this;
+ if (!scale || !validateCrossLineValue2(this, scale)) {
+ this.rangeGroup.visible = false;
+ this.lineGroup.visible = false;
+ this.labelGroup.visible = false;
+ return;
+ }
+ this.updateRadii();
+ const { innerRadius, outerRadius } = this;
+ visible && (visible = innerRadius >= this.axisInnerRadius && outerRadius <= this.axisOuterRadius);
+ this.rangeGroup.visible = visible;
+ this.lineGroup.visible = visible;
+ this.labelGroup.visible = visible;
+ this.updatePolygonNode(visible);
+ this.updateSectorNode(visible);
+ this.updateLabelNode(visible);
+ this.assignCrossLineGroup(this.type === "range", this.crossLineRange);
+ }
+ updateRadii() {
+ const { range: range2, scale, type, axisInnerRadius, axisOuterRadius } = this;
+ if (!scale)
+ return { innerRadius: 0, outerRadius: 0 };
+ const getRadius = (value) => axisOuterRadius + axisInnerRadius - value;
+ let outerRadius, innerRadius;
+ if (type === "line") {
+ outerRadius = getRadius(scale.convert(this.value));
+ innerRadius = outerRadius;
+ } else {
+ const bandwidth = Math.abs(scale?.bandwidth ?? 0);
+ const convertedRange = range2.map((r) => scale.convert(r));
+ outerRadius = getRadius(Math.max(...convertedRange));
+ innerRadius = getRadius(Math.min(...convertedRange)) + bandwidth;
+ }
+ this.outerRadius = outerRadius;
+ this.innerRadius = innerRadius;
+ }
+ drawPolygon(radius, angles, polygon) {
+ for (const [index, angle] of angles.entries()) {
+ const x = radius * Math.cos(angle);
+ const y = radius * Math.sin(angle);
+ if (index === 0) {
+ polygon.path.moveTo(x, y);
+ } else {
+ polygon.path.lineTo(x, y);
+ }
+ }
+ polygon.path.closePath();
+ }
+ updatePolygonNode(visible) {
+ const { gridAngles, polygonNode: polygon, scale, shape, type, innerRadius, outerRadius } = this;
+ if (!visible || shape !== "polygon" || !scale || !gridAngles) {
+ polygon.visible = false;
+ return;
+ }
+ polygon.visible = true;
+ const padding = this.getPadding();
+ polygon.path.clear(true);
+ this.drawPolygon(outerRadius - padding, gridAngles, polygon);
+ const reversedAngles = gridAngles.slice().reverse();
+ const innerPolygonRadius = type === "line" ? outerRadius - padding : innerRadius + padding;
+ this.drawPolygon(innerPolygonRadius, reversedAngles, polygon);
+ this.setSectorNodeProps(polygon);
+ }
+ updateSectorNode(visible) {
+ const { axisInnerRadius, axisOuterRadius, scale, sectorNode: sector, shape, innerRadius, outerRadius } = this;
+ if (!visible || shape !== "circle" || !scale) {
+ sector.visible = false;
+ return;
+ }
+ sector.visible = true;
+ sector.startAngle = 0;
+ sector.endAngle = 2 * Math.PI;
+ const padding = this.getPadding();
+ const r0 = (0, import_ag_charts_core7.clamp)(axisInnerRadius, innerRadius + padding, axisOuterRadius);
+ const r1 = (0, import_ag_charts_core7.clamp)(axisInnerRadius, outerRadius - padding, axisOuterRadius);
+ sector.innerRadius = Math.min(r0, r1);
+ sector.outerRadius = Math.max(r0, r1);
+ this.setSectorNodeProps(sector);
+ }
+ updateLabelNode(visible) {
+ const { innerRadius, label, labelNode: node, scale, shape, type } = this;
+ if (!visible || label.enabled === false || !label.text || !scale) {
+ node.visible = false;
+ return;
+ }
+ const angle = normalizeAngle360FromDegrees((label.positionAngle ?? 0) - 90);
+ const isBottomSide = ((0, import_ag_charts_core7.isNumberEqual)(angle, 0) || angle > 0) && angle < Math.PI;
+ const rotation = isBottomSide ? angle - Math.PI / 2 : angle + Math.PI / 2;
+ let distance;
+ const angles = this.gridAngles ?? [];
+ if (type === "line") {
+ distance = innerRadius + label.padding;
+ } else if (shape === "circle" || angles.length < 3) {
+ distance = innerRadius - label.padding;
+ } else {
+ distance = innerRadius * Math.cos(Math.PI / angles.length) - label.padding;
+ }
+ const labelX = distance * Math.cos(angle);
+ const labelY = distance * Math.sin(angle);
+ let textBaseline;
+ if (type === "line") {
+ textBaseline = isBottomSide ? "top" : "bottom";
+ } else {
+ textBaseline = isBottomSide ? "bottom" : "top";
+ }
+ this.setLabelNodeProps(node, labelX, labelY, textBaseline, rotation);
+ }
+ getPadding() {
+ const { scale } = this;
+ if (!scale)
+ return 0;
+ const bandwidth = Math.abs(scale.bandwidth ?? 0);
+ const step = Math.abs(scale.step ?? 0);
+ return scale instanceof import_ag_charts_community9._ModuleSupport.BandScale ? (step - bandwidth) / 2 : 0;
+ }
+};
+RadiusCrossLine.className = "RadiusCrossLine";
+
+// packages/ag-charts-enterprise/src/axes/radius/radiusAxis.ts
+var {
+ ChartAxisDirection: ChartAxisDirection5,
+ ZIndexMap,
+ Property: Property8,
+ normalizeAngle360: normalizeAngle3603,
+ toRadians: toRadians2,
+ Caption,
+ Group: Group4,
+ TransformableGroup,
+ Path: Path4,
+ Line: Line2,
+ Selection: Selection2,
+ generateTicks,
+ AxisGroupZIndexMap
+} = import_ag_charts_community10._ModuleSupport;
+var RadiusAxisLabel = class extends import_ag_charts_community10._ModuleSupport.AxisLabel {
+ constructor() {
+ super(...arguments);
+ this.autoRotateAngle = 335;
+ }
+};
+__decorateClass([
+ Property8
+], RadiusAxisLabel.prototype, "autoRotate", 2);
+__decorateClass([
+ Property8
+], RadiusAxisLabel.prototype, "autoRotateAngle", 2);
+var RadiusAxis = class extends import_ag_charts_community10._ModuleSupport.PolarAxis {
+ constructor(moduleCtx, scale) {
+ super(moduleCtx, scale);
+ this.positionAngle = 0;
+ this.gridLineGroupSelection = Selection2.select(
+ this.gridLineGroup,
+ Line2,
+ false
+ );
+ this.generatedTicks = void 0;
+ this.headingLabelGroup = this.axisGroup.appendChild(
+ new TransformableGroup({ name: `${this.id}-Axis-heading` })
+ );
+ this.lineNodeGroup = this.axisGroup.appendChild(
+ new TransformableGroup({ name: `${this.id}-Axis-line` })
+ );
+ this.lineNode = this.lineNodeGroup.appendChild(
+ new Line2({
+ name: `${this.id}-Axis-line`,
+ zIndex: AxisGroupZIndexMap.AxisLine
+ })
+ );
+ this.gridPathGroup = this.gridGroup.appendChild(
+ new Group4({
+ name: `${this.id}-gridPaths`,
+ zIndex: ZIndexMap.AXIS_GRID
+ })
+ );
+ this.gridPathSelection = Selection2.select(this.gridPathGroup, Path4);
+ this.headingLabelGroup.appendChild(this.title.caption.node);
+ this.cleanup.register(this.title.caption.registerInteraction(this.moduleCtx, "afterend"));
+ }
+ get direction() {
+ return ChartAxisDirection5.Radius;
+ }
+ getAxisTransform() {
+ const maxRadius = this.scale.range[0];
+ const { translation, positionAngle, innerRadiusRatio } = this;
+ const innerRadius = maxRadius * innerRadiusRatio;
+ const rotation = toRadians2(positionAngle);
+ return {
+ translationX: translation.x,
+ translationY: translation.y - maxRadius - innerRadius,
+ rotation,
+ rotationCenterX: 0,
+ rotationCenterY: maxRadius + innerRadius
+ };
+ }
+ update() {
+ super.update();
+ this.updateTitle();
+ this.updateGridLines();
+ const { enabled, stroke: stroke2, width } = this.line;
+ this.lineNode.setProperties({
+ stroke: stroke2,
+ strokeWidth: enabled ? width : 0,
+ x1: 0,
+ y1: this.range[0],
+ x2: 0,
+ y2: this.range[1]
+ });
+ }
+ updatePosition() {
+ super.updatePosition();
+ const axisTransform = this.getAxisTransform();
+ this.tickLineGroup.setProperties(axisTransform);
+ this.tickLabelGroup.setProperties(axisTransform);
+ this.lineNodeGroup.setProperties(axisTransform);
+ this.headingLabelGroup.setProperties(axisTransform);
+ }
+ calculateRotations() {
+ const rotation = 0;
+ const parallelFlipRotation = 0;
+ const regularFlipRotation = -Math.PI / 2;
+ return { rotation, parallelFlipRotation, regularFlipRotation };
+ }
+ calculateTickLayout(domain, niceMode, _visibleRange) {
+ const visibleRange = [0, 1];
+ const sideFlag = this.label.getSideFlag();
+ const labelX = sideFlag * (this.getTickSize() + this.label.spacing + this.seriesAreaPadding);
+ const { range: range2, reverse, defaultTickMinSpacing } = this;
+ const tickGenerationResult = generateTicks({
+ scale: this.scale,
+ label: this.label,
+ interval: this.interval,
+ tickFormatter: (...args) => this.tickFormatter(...args),
+ domain,
+ range: range2,
+ reverse,
+ niceMode,
+ visibleRange,
+ defaultTickMinSpacing,
+ labelOffset: labelX,
+ sideFlag,
+ axisRotation: 0,
+ sizeLimit: void 0,
+ primaryTickCount: void 0
+ });
+ const { tickData } = tickGenerationResult;
+ const { ticks, rawTicks, rawTickCount, tickDomain, fractionDigits, niceDomain = domain } = tickData;
+ const labels = ticks.map((d) => this.getTickLabelProps(d, tickGenerationResult));
+ this.generatedTicks = { ticks, labels };
+ return { ticks: rawTicks, tickDomain, niceDomain, rawTickCount, fractionDigits, timeInterval: void 0 };
+ }
+ updateSelections() {
+ const { generatedTicks } = this;
+ if (!generatedTicks)
+ return;
+ const { ticks, labels } = generatedTicks;
+ this.gridLineGroupSelection.update(this.gridLength ? ticks : []);
+ this.tickLabelGroupSelection.update(labels);
+ this.gridPathSelection.update(this.gridLine.enabled ? this.prepareGridPathTickData(ticks) : []);
+ this.gridLineGroupSelection.cleanup();
+ this.tickLabelGroupSelection.cleanup();
+ this.gridPathSelection.cleanup();
+ }
+ // TODO - abstract out
+ updateLabels() {
+ if (!this.label.enabled)
+ return;
+ const axisLabelPositionFn = import_ag_charts_community10._ModuleSupport.resetAxisLabelSelectionFn();
+ this.tickLabelGroupSelection.each((node, datum) => {
+ node.fill = datum.color;
+ node.text = datum.text;
+ node.textBaseline = datum.textBaseline;
+ node.textAlign = datum.textAlign ?? "center";
+ node.setFont(datum);
+ node.setBoxing(datum);
+ node.setProperties(axisLabelPositionFn(node, datum));
+ });
+ }
+ updateGridLines() {
+ const {
+ gridLine: { style, width },
+ shape,
+ generatedTicks
+ } = this;
+ if (!style || !generatedTicks) {
+ return;
+ }
+ const styleCount = style.length;
+ const setStyle = (node, index) => {
+ const { stroke: stroke2, lineDash } = style[index % styleCount];
+ node.stroke = stroke2;
+ node.strokeWidth = width;
+ node.lineDash = lineDash;
+ node.fill = void 0;
+ };
+ const [startAngle, endAngle] = this.gridRange ?? [0, 2 * Math.PI];
+ const isFullCircle = (0, import_ag_charts_core8.isNumberEqual)(endAngle - startAngle, 2 * Math.PI);
+ const drawCircleShape = (node, value) => {
+ const { path } = node;
+ path.clear(true);
+ const radius = this.getTickRadius(value);
+ if (isFullCircle) {
+ path.moveTo(radius, 0);
+ path.arc(0, 0, radius, 0, 2 * Math.PI);
+ } else {
+ path.moveTo(radius * Math.cos(startAngle), radius * Math.sin(startAngle));
+ path.arc(0, 0, radius, normalizeAngle3603(startAngle), normalizeAngle3603(endAngle));
+ }
+ if (isFullCircle) {
+ path.closePath();
+ }
+ };
+ const drawPolygonShape = (node, value) => {
+ const { path } = node;
+ const angles = this.gridAngles;
+ path.clear(true);
+ if (!angles || angles.length < 3) {
+ return;
+ }
+ const radius = this.getTickRadius(value);
+ for (const [idx, angle] of angles.entries()) {
+ const x = radius * Math.cos(angle);
+ const y = radius * Math.sin(angle);
+ if (idx === 0) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ for (const [innerIdx, innerAngle] of angles.entries()) {
+ const x2 = radius * Math.cos(innerAngle);
+ const y2 = radius * Math.sin(innerAngle);
+ if (innerIdx === 0) {
+ path.moveTo(x2, y2);
+ } else {
+ path.lineTo(x2, y2);
+ }
+ }
+ path.closePath();
+ }
+ path.closePath();
+ };
+ const drawFn = shape === "circle" ? drawCircleShape : drawPolygonShape;
+ this.gridPathSelection.each((node, value, index) => {
+ setStyle(node, index);
+ drawFn(node, value);
+ });
+ }
+ updateTitle() {
+ const identityFormatter = (params) => params.defaultValue;
+ const { title, range: requestedRange } = this;
+ const { formatter = identityFormatter } = this.title;
+ title.caption.enabled = title.enabled;
+ title.caption.fontFamily = title.fontFamily;
+ title.caption.fontSize = title.fontSize;
+ title.caption.fontStyle = title.fontStyle;
+ title.caption.fontWeight = title.fontWeight;
+ title.caption.color = title.color;
+ title.caption.wrapping = title.wrapping;
+ let titleVisible = false;
+ const titleNode = title.caption.node;
+ if (title.enabled) {
+ titleVisible = true;
+ titleNode.rotation = Math.PI / 2;
+ titleNode.x = Math.floor((requestedRange[0] + requestedRange[1]) / 2);
+ titleNode.y = -Caption.SMALL_PADDING;
+ titleNode.textAlign = "center";
+ titleNode.textBaseline = "bottom";
+ titleNode.text = this.cachedCallWithContext(formatter, this.getTitleFormatterParams(this.scale.domain));
+ }
+ titleNode.visible = titleVisible;
+ }
+ updateCrossLines() {
+ for (const crossLine of this.crossLines) {
+ if (crossLine instanceof RadiusCrossLine) {
+ const { shape, gridAngles, range: range2, innerRadiusRatio } = this;
+ const radius = range2[0];
+ crossLine.shape = shape;
+ crossLine.gridAngles = gridAngles;
+ crossLine.axisOuterRadius = radius;
+ crossLine.axisInnerRadius = radius * innerRadiusRatio;
+ }
+ }
+ super.updateCrossLines();
+ }
+ createLabel() {
+ return new RadiusAxisLabel();
+ }
+ // TODO - abstract out (shared with cartesian axis)
+ getTickLabelProps(datum, tickGenerationResult) {
+ const { label } = this;
+ const { rotation, textBaseline, textAlign } = tickGenerationResult;
+ const range2 = this.scale.range;
+ const text2 = datum.tickLabel ?? "";
+ const sideFlag = label.getSideFlag();
+ const labelX = sideFlag * (this.getTickSize() + label.spacing + this.seriesAreaPadding);
+ const visible = text2 !== "" && text2 != null;
+ const combinedRotation = rotation;
+ return {
+ ...this.getLabelStyles({ value: datum.tick, formattedValue: datum.tickLabel }),
+ tickId: datum.tickId,
+ rotation: combinedRotation,
+ text: text2,
+ textAlign,
+ textBaseline,
+ visible,
+ x: labelX,
+ y: datum.translation,
+ rotationCenterX: labelX,
+ rotationCenterY: datum.translation,
+ range: range2
+ };
+ }
+};
+RadiusAxis.CrossLineConstructor = RadiusCrossLine;
+__decorateClass([
+ Property8
+], RadiusAxis.prototype, "positionAngle", 2);
+
+// packages/ag-charts-enterprise/src/axes/radius-category/radiusCategoryAxis.ts
+var { ProxyPropertyOnWrite, Property: Property9, CategoryScale: CategoryScale2 } = import_ag_charts_community11._ModuleSupport;
+var RadiusCategoryAxis = class extends RadiusAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new CategoryScale2());
+ this.shape = "circle";
+ this.groupPaddingInner = 0;
+ this.paddingInner = 0;
+ this.paddingOuter = 0;
+ }
+ hasDefinedDomain() {
+ return false;
+ }
+ normaliseDataDomain(domain) {
+ return { domain, clipped: false };
+ }
+ prepareGridPathTickData(data) {
+ return data.slice().reverse();
+ }
+ getTickRadius(tickDatum) {
+ const { scale, innerRadiusRatio } = this;
+ const maxRadius = scale.range[0];
+ const minRadius = maxRadius * innerRadiusRatio;
+ if (CategoryScale2.is(scale)) {
+ const ticks = scale.domain;
+ const index = ticks.length - 1 - ticks.indexOf(tickDatum.tick);
+ return index === 0 ? minRadius : scale.inset + scale.step * (index - 0.5) + scale.bandwidth / 2;
+ } else {
+ const tickRange = (maxRadius - minRadius) / scale.domain.length;
+ return maxRadius - tickDatum.translation + minRadius - tickRange / 2;
+ }
+ }
+ tickFormatParams() {
+ return { type: "category" };
+ }
+ datumFormatParams(value, params) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return { type: "category", value, datum, seriesId, legendItemName, key, source, property, domain, boundSeries };
+ }
+};
+RadiusCategoryAxis.className = "RadiusCategoryAxis";
+RadiusCategoryAxis.type = "radius-category";
+__decorateClass([
+ Property9
+], RadiusCategoryAxis.prototype, "groupPaddingInner", 2);
+__decorateClass([
+ ProxyPropertyOnWrite("scale", "paddingInner"),
+ Property9
+], RadiusCategoryAxis.prototype, "paddingInner", 2);
+__decorateClass([
+ ProxyPropertyOnWrite("scale", "paddingOuter"),
+ Property9
+], RadiusCategoryAxis.prototype, "paddingOuter", 2);
+
+// packages/ag-charts-enterprise/src/axes/radius-category/radiusCategoryAxisModule.ts
+var RadiusCategoryAxisModule = {
+ type: "axis",
+ optionsKey: "axes[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radius-category",
+ moduleFactory: (ctx) => new RadiusCategoryAxis(ctx)
+};
+
+// packages/ag-charts-enterprise/src/axes/radius-number/radiusNumberAxis.ts
+var import_ag_charts_community12 = require("ag-charts-community");
+var { Property: Property10, normalisedExtentWithMetadata: normalisedExtentWithMetadata2, LinearScale: LinearScale2 } = import_ag_charts_community12._ModuleSupport;
+var RadiusNumberAxis = class extends RadiusAxis {
+ constructor(moduleCtx) {
+ super(moduleCtx, new LinearScale2());
+ this.shape = "polygon";
+ }
+ hasDefinedDomain() {
+ const { min, max } = this;
+ return min != null && max != null && min < max;
+ }
+ prepareGridPathTickData(data) {
+ const { scale } = this;
+ const domainTop = scale.domain[1];
+ return data.filter(({ tick }) => tick !== domainTop).sort((a, b) => b.tick - a.tick);
+ }
+ getTickRadius(tickDatum) {
+ const { scale } = this;
+ const maxRadius = scale.range[0];
+ const minRadius = maxRadius * this.innerRadiusRatio;
+ return maxRadius - tickDatum.translation + minRadius;
+ }
+ normaliseDataDomain(d) {
+ const { min, max } = this;
+ const { extent: extent3, clipped } = normalisedExtentWithMetadata2(d, min, max);
+ return { domain: extent3, clipped };
+ }
+ tickFormatParams(_domain, _ticks, fractionDigits) {
+ return { type: "number", fractionDigits };
+ }
+ datumFormatParams(value, params, fractionDigits) {
+ const { datum, seriesId, legendItemName, key, source, property, domain, boundSeries } = params;
+ return {
+ type: "number",
+ value,
+ datum,
+ seriesId,
+ legendItemName,
+ key,
+ source,
+ property,
+ domain,
+ boundSeries,
+ fractionDigits
+ };
+ }
+};
+RadiusNumberAxis.className = "RadiusNumberAxis";
+RadiusNumberAxis.type = "radius-number";
+__decorateClass([
+ Property10
+], RadiusNumberAxis.prototype, "min", 2);
+__decorateClass([
+ Property10
+], RadiusNumberAxis.prototype, "max", 2);
+
+// packages/ag-charts-enterprise/src/axes/radius-number/radiusNumberAxisModule.ts
+var RadiusNumberAxisModule = {
+ type: "axis",
+ optionsKey: "axes[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radius-number",
+ moduleFactory: (ctx) => new RadiusNumberAxis(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/animation/animation.ts
+var import_ag_charts_community13 = require("ag-charts-community");
+var { ObserveChanges, Property: Property11 } = import_ag_charts_community13._ModuleSupport;
+var Animation = class extends import_ag_charts_community13._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = true;
+ ctx.animationManager.skip(false);
+ this.cleanup.register(() => {
+ ctx.animationManager.skip(true);
+ });
+ }
+};
+__decorateClass([
+ ObserveChanges((target, newValue) => {
+ target.ctx.animationManager.skip(!newValue);
+ }),
+ Property11
+], Animation.prototype, "enabled", 2);
+__decorateClass([
+ ObserveChanges((target, newValue) => {
+ target.ctx.animationManager.defaultDuration = newValue;
+ }),
+ Property11
+], Animation.prototype, "duration", 2);
+__decorateClass([
+ ObserveChanges((target, newValue) => {
+ target.ctx.animationManager.maxAnimatableItems = newValue ?? Infinity;
+ }),
+ Property11
+], Animation.prototype, "maxAnimatableItems", 2);
+
+// packages/ag-charts-enterprise/src/features/animation/animationModule.ts
+var AnimationModule = {
+ type: "root",
+ optionsKey: "animation",
+ packageType: "enterprise",
+ chartTypes: ["cartesian", "polar", "topology", "standalone"],
+ moduleFactory: (ctx) => new Animation(ctx),
+ themeTemplate: {
+ animation: {
+ enabled: true,
+ maxAnimatableItems: 1e3
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/annotations.ts
+var import_ag_charts_community88 = require("ag-charts-community");
+var import_ag_charts_core43 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/text-input/textInput.ts
+var import_ag_charts_community14 = require("ag-charts-community");
+var import_ag_charts_core9 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/text-input/textInputTemplate.html
+var textInputTemplate_default = '';
+
+// packages/ag-charts-enterprise/src/features/text-input/textInput.ts
+var { focusCursorAtEnd } = import_ag_charts_community14._ModuleSupport;
+var moduleId = "text-input";
+var canvasOverlay = "canvas-overlay";
+var TextInput = class extends import_ag_charts_community14._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.layout = {
+ getTextInputCoords: () => ({ x: 0, y: 0 }),
+ getTextPosition: () => "center",
+ alignment: "center",
+ textAlign: "center"
+ };
+ this.visible = false;
+ this.element = ctx.domManager.addChild(canvasOverlay, moduleId);
+ this.element.classList.add("ag-charts-text-input");
+ this.cleanup.register(() => ctx.domManager.removeChild(canvasOverlay, moduleId));
+ }
+ setKeyDownHandler(handler) {
+ this.cleanup.register((0, import_ag_charts_core9.attachListener)(this.element, "keydown", handler));
+ }
+ show(opts) {
+ this.element.innerHTML = textInputTemplate_default;
+ const textArea = this.element.firstElementChild;
+ (0, import_ag_charts_core9.setAttributes)(textArea, {
+ role: "textbox",
+ // AG-15233
+ "data-preventdefault": false
+ // AG-13715
+ });
+ if (!textArea.isContentEditable) {
+ textArea.contentEditable = "true";
+ }
+ textArea.setAttribute(
+ "placeholder",
+ this.ctx.localeManager.t(opts.placeholderText ?? "inputTextareaPlaceholder")
+ );
+ if (opts.styles?.placeholderColor) {
+ textArea.style.setProperty("--placeholder-text-color", opts.styles?.placeholderColor);
+ }
+ textArea.innerText = opts.text ?? "";
+ textArea.style.color = opts.styles?.color ?? "inherit";
+ textArea.style.fontFamily = opts.styles?.fontFamily ?? "inherit";
+ textArea.style.fontSize = opts.styles?.fontSize ? `${opts.styles.fontSize}px` : "inherit";
+ textArea.style.fontStyle = opts.styles?.fontStyle ?? "inherit";
+ textArea.style.fontWeight = typeof opts.styles?.fontWeight === "number" ? `${opts.styles.fontWeight}` : opts.styles?.fontWeight ?? "inherit";
+ focusCursorAtEnd(textArea);
+ textArea.addEventListener("input", () => {
+ this.updatePosition();
+ opts.onChange?.(this.getValue(), this.getBBox());
+ });
+ textArea.addEventListener("click", (event) => {
+ event.stopPropagation();
+ });
+ if (opts.layout) {
+ this.layout = opts.layout;
+ this.updatePosition();
+ }
+ opts.onChange?.(this.getValue(), this.getBBox());
+ this.visible = true;
+ }
+ hide() {
+ this.element.innerHTML = "";
+ this.layout = {
+ getTextInputCoords: () => ({ x: 0, y: 0 }),
+ getTextPosition: () => "center",
+ alignment: "center",
+ textAlign: "center"
+ };
+ this.visible = false;
+ }
+ isVisible() {
+ return this.visible;
+ }
+ updateColor(color6) {
+ if (!this.element.firstElementChild)
+ return;
+ this.element.firstElementChild.style.color = color6;
+ }
+ updateFontSize(fontSize) {
+ if (!this.element.firstElementChild)
+ return;
+ this.element.firstElementChild.style.fontSize = `${fontSize}px`;
+ this.updatePosition();
+ return this.getBBox();
+ }
+ getValue() {
+ if (!this.element.firstElementChild)
+ return;
+ return this.element.firstElementChild.innerText.trim();
+ }
+ updatePosition() {
+ const { element } = this;
+ const textArea = element.firstElementChild;
+ if (!textArea)
+ return;
+ const sceneRect = this.ctx.domManager.getBoundingClientRect();
+ const { width, getTextInputCoords, getTextPosition, alignment, textAlign } = this.layout;
+ element.style.setProperty("width", width ? `${width}px` : "unset");
+ const textRect = textArea.getBoundingClientRect();
+ const point = getTextInputCoords(textRect.height);
+ let horizontalPosition = point.x;
+ if (alignment === "center") {
+ horizontalPosition -= (width ?? textRect.width) / 2;
+ } else if (alignment === "right") {
+ horizontalPosition -= width ?? textRect.width;
+ }
+ const position = getTextPosition();
+ let verticalPosition = point.y;
+ if (position === "center") {
+ verticalPosition -= textRect.height / 2;
+ } else if (position === "bottom") {
+ verticalPosition -= textRect.height;
+ }
+ element.style.setProperty("top", `${verticalPosition}px`);
+ element.style.setProperty("left", `${horizontalPosition}px`);
+ element.style.setProperty("max-width", `${sceneRect.width - horizontalPosition}px`);
+ element.style.setProperty("text-align", alignment);
+ textArea.style.setProperty("text-align", textAlign);
+ }
+ getBBox() {
+ const { left, top, width, height } = this.element.getBoundingClientRect();
+ return new import_ag_charts_community14._ModuleSupport.BBox(left, top, width, height);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationAxesButtons.ts
+var import_ag_charts_community15 = require("ag-charts-community");
+var { BaseProperties: BaseProperties2, Property: Property12 } = import_ag_charts_community15._ModuleSupport;
+var AxesButtons = class extends BaseProperties2 {
+ constructor() {
+ super(...arguments);
+ this.enabled = false;
+ this.axes = "y";
+ }
+};
+__decorateClass([
+ Property12
+], AxesButtons.prototype, "enabled", 2);
+__decorateClass([
+ Property12
+], AxesButtons.prototype, "axes", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationDefaults.ts
+var import_ag_charts_community35 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationTypes.ts
+var AnnotationType = /* @__PURE__ */ ((AnnotationType3) => {
+ AnnotationType3["Line"] = "line";
+ AnnotationType3["HorizontalLine"] = "horizontal-line";
+ AnnotationType3["VerticalLine"] = "vertical-line";
+ AnnotationType3["DisjointChannel"] = "disjoint-channel";
+ AnnotationType3["ParallelChannel"] = "parallel-channel";
+ AnnotationType3["FibonacciRetracement"] = "fibonacci-retracement";
+ AnnotationType3["FibonacciRetracementTrendBased"] = "fibonacci-retracement-trend-based";
+ AnnotationType3["Callout"] = "callout";
+ AnnotationType3["Comment"] = "comment";
+ AnnotationType3["Note"] = "note";
+ AnnotationType3["Text"] = "text";
+ AnnotationType3["Arrow"] = "arrow";
+ AnnotationType3["ArrowUp"] = "arrow-up";
+ AnnotationType3["ArrowDown"] = "arrow-down";
+ AnnotationType3["DateRange"] = "date-range";
+ AnnotationType3["PriceRange"] = "price-range";
+ AnnotationType3["DatePriceRange"] = "date-price-range";
+ AnnotationType3["QuickDatePriceRange"] = "quick-date-price-range";
+ return AnnotationType3;
+})(AnnotationType || {});
+var ANNOTATION_TYPES = Object.values(AnnotationType);
+function stringToAnnotationType(value) {
+ for (const t of ANNOTATION_TYPES) {
+ if (t === value)
+ return t;
+ }
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/has.ts
+var import_ag_charts_core24 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/callout/calloutProperties.ts
+var import_ag_charts_community19 = require("ag-charts-community");
+var import_ag_charts_core12 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationProperties.ts
+var import_ag_charts_community16 = require("ag-charts-community");
+var import_ag_charts_core10 = require("ag-charts-core");
+var { BaseProperties: BaseProperties3, FONT_SIZE: FONT_SIZE2, Property: Property13 } = import_ag_charts_community16._ModuleSupport;
+var PointProperties = class extends BaseProperties3 {
+};
+__decorateClass([
+ Property13
+], PointProperties.prototype, "x", 2);
+__decorateClass([
+ Property13
+], PointProperties.prototype, "y", 2);
+var ChannelAnnotationMiddleProperties = class extends Stroke(LineStyle(Visible(BaseProperties3))) {
+};
+var AxisLabelProperties = class extends Stroke(LineStyle(Fill(Label(Font(BaseProperties3))))) {
+ constructor() {
+ super(...arguments);
+ this.cornerRadius = 2;
+ }
+};
+__decorateClass([
+ Property13
+], AxisLabelProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property13
+], AxisLabelProperties.prototype, "cornerRadius", 2);
+var BackgroundProperties = class extends Fill(BaseProperties3) {
+};
+var HandleProperties = class extends Stroke(LineStyle(Fill(BaseProperties3))) {
+};
+var LineTextProperties = class extends Font(BaseProperties3) {
+ constructor() {
+ super(...arguments);
+ this.label = "";
+ this.position = "top";
+ this.alignment = "left";
+ }
+};
+__decorateClass([
+ Property13
+], LineTextProperties.prototype, "label", 2);
+__decorateClass([
+ Property13
+], LineTextProperties.prototype, "position", 2);
+__decorateClass([
+ Property13
+], LineTextProperties.prototype, "alignment", 2);
+var LabelTextProperties = class extends Font(BaseProperties3) {
+};
+var ChannelTextProperties = class extends Font(BaseProperties3) {
+ constructor() {
+ super(...arguments);
+ this.label = "";
+ }
+};
+__decorateClass([
+ Property13
+], ChannelTextProperties.prototype, "label", 2);
+__decorateClass([
+ Property13
+], ChannelTextProperties.prototype, "position", 2);
+__decorateClass([
+ Property13
+], ChannelTextProperties.prototype, "alignment", 2);
+function Annotation(Parent) {
+ class AnnotationInternal extends Writeable(Visible(Parent)) {
+ constructor() {
+ super(...arguments);
+ // A uuid is required, over the usual incrementing index, as annotations can be restored from external databases
+ this.id = (0, import_ag_charts_core10.generateUUID)();
+ }
+ }
+ return AnnotationInternal;
+}
+function Line3(Parent) {
+ class LineInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.start = new PointProperties();
+ this.end = new PointProperties();
+ }
+ }
+ __decorateClass([
+ Property13
+ ], LineInternal.prototype, "start", 2);
+ __decorateClass([
+ Property13
+ ], LineInternal.prototype, "end", 2);
+ return LineInternal;
+}
+function Point(Parent) {
+ class PointInternal extends Parent {
+ }
+ __decorateClass([
+ Property13
+ ], PointInternal.prototype, "x", 2);
+ __decorateClass([
+ Property13
+ ], PointInternal.prototype, "y", 2);
+ return PointInternal;
+}
+function Value(Parent) {
+ class ValueInternal extends Parent {
+ }
+ __decorateClass([
+ Property13
+ ], ValueInternal.prototype, "value", 2);
+ return ValueInternal;
+}
+function Background(Parent) {
+ class BackgroundInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.background = new BackgroundProperties();
+ }
+ }
+ __decorateClass([
+ Property13
+ ], BackgroundInternal.prototype, "background", 2);
+ return BackgroundInternal;
+}
+function Handle(Parent) {
+ class HandleInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.handle = new HandleProperties();
+ }
+ }
+ __decorateClass([
+ Property13
+ ], HandleInternal.prototype, "handle", 2);
+ return HandleInternal;
+}
+function AxisLabel(Parent) {
+ class AxisLabelInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.axisLabel = new AxisLabelProperties();
+ }
+ }
+ __decorateClass([
+ Property13
+ ], AxisLabelInternal.prototype, "axisLabel", 2);
+ return AxisLabelInternal;
+}
+function Label(Parent) {
+ class LabelInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.padding = void 0;
+ this.textAlign = "center";
+ this.formatter = void 0;
+ }
+ // TODO: making this generic causes issues with mixins sequence
+ }
+ __decorateClass([
+ Property13
+ ], LabelInternal.prototype, "padding", 2);
+ __decorateClass([
+ Property13
+ ], LabelInternal.prototype, "textAlign", 2);
+ __decorateClass([
+ Property13
+ ], LabelInternal.prototype, "formatter", 2);
+ return LabelInternal;
+}
+function Cappable(Parent) {
+ class CappableInternal extends Parent {
+ }
+ return CappableInternal;
+}
+function Extendable(Parent) {
+ class ExtendableInternal extends Parent {
+ }
+ __decorateClass([
+ Property13
+ ], ExtendableInternal.prototype, "extendStart", 2);
+ __decorateClass([
+ Property13
+ ], ExtendableInternal.prototype, "extendEnd", 2);
+ return ExtendableInternal;
+}
+function Writeable(Parent) {
+ class WriteableInternal extends Parent {
+ isWriteable() {
+ return !this.locked && !this.readOnly;
+ }
+ isHoverable() {
+ return !this.readOnly;
+ }
+ }
+ __decorateClass([
+ Property13
+ ], WriteableInternal.prototype, "locked", 2);
+ __decorateClass([
+ Property13
+ ], WriteableInternal.prototype, "readOnly", 2);
+ return WriteableInternal;
+}
+function Localisable(Parent) {
+ class LocalisableInternal extends Parent {
+ setLocaleManager(localeManager) {
+ this.localeManager ?? (this.localeManager = localeManager);
+ }
+ }
+ return LocalisableInternal;
+}
+function Visible(Parent) {
+ class VisibleInternal extends Parent {
+ }
+ __decorateClass([
+ Property13
+ ], VisibleInternal.prototype, "visible", 2);
+ return VisibleInternal;
+}
+function Fill(Parent) {
+ class FillInternal extends Parent {
+ }
+ __decorateClass([
+ Property13
+ ], FillInternal.prototype, "fill", 2);
+ __decorateClass([
+ Property13
+ ], FillInternal.prototype, "fillOpacity", 2);
+ return FillInternal;
+}
+function Stroke(Parent) {
+ class StrokeInternal extends Parent {
+ }
+ __decorateClass([
+ Property13
+ ], StrokeInternal.prototype, "stroke", 2);
+ __decorateClass([
+ Property13
+ ], StrokeInternal.prototype, "strokeOpacity", 2);
+ __decorateClass([
+ Property13
+ ], StrokeInternal.prototype, "strokeWidth", 2);
+ return StrokeInternal;
+}
+function LineStyle(Parent) {
+ class LineDashInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.lineCap = void 0;
+ this.computedLineDash = void 0;
+ }
+ }
+ __decorateClass([
+ Property13
+ ], LineDashInternal.prototype, "lineDash", 2);
+ __decorateClass([
+ Property13
+ ], LineDashInternal.prototype, "lineDashOffset", 2);
+ __decorateClass([
+ Property13
+ ], LineDashInternal.prototype, "lineStyle", 2);
+ return LineDashInternal;
+}
+function Font(Parent) {
+ class FontInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.fontSize = FONT_SIZE2.SMALL;
+ this.fontFamily = "Verdana, sans-serif";
+ }
+ }
+ __decorateClass([
+ Property13
+ ], FontInternal.prototype, "fontStyle", 2);
+ __decorateClass([
+ Property13
+ ], FontInternal.prototype, "fontWeight", 2);
+ __decorateClass([
+ Property13
+ ], FontInternal.prototype, "fontSize", 2);
+ __decorateClass([
+ Property13
+ ], FontInternal.prototype, "fontFamily", 2);
+ __decorateClass([
+ Property13
+ ], FontInternal.prototype, "color", 2);
+ return FontInternal;
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/textualStartEndProperties.ts
+var import_ag_charts_community18 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/scale.ts
+var import_ag_charts_core11 = require("ag-charts-core");
+function getGrouping(d) {
+ if ((0, import_ag_charts_core11.isNumber)(d) || (0, import_ag_charts_core11.isString)(d) || (0, import_ag_charts_core11.isDate)(d)) {
+ return { value: d, groupPercentage: 0 };
+ }
+ return d ?? { value: void 0, groupPercentage: 0 };
+}
+function getGroupingValue(d) {
+ return getGrouping(d)?.value;
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/values.ts
+function convertLine(datum, context) {
+ if (datum.start == null || datum.end == null)
+ return;
+ const start = convertPoint(datum.start, context);
+ const end = convertPoint(datum.end, context);
+ if (start == null || end == null)
+ return;
+ return { x1: start.x, y1: start.y, x2: end.x, y2: end.y };
+}
+function convertPoint(point, context) {
+ const x = convert(point.x, context.xAxis);
+ const y = convert(point.y, context.yAxis);
+ return { x, y };
+}
+function convert(p, context) {
+ if (p == null)
+ return 0;
+ const { value, groupPercentage } = getGrouping(p);
+ const { scale, snapToGroup } = context;
+ const width = scale.bandwidth === 0 ? scale.step ?? 0 : scale.bandwidth ?? 0;
+ const offset = snapToGroup ? width / 2 : width * groupPercentage;
+ return scale.convert(value) + offset;
+}
+function invertCoords(coords, context) {
+ const x = invert(coords.x, context.xAxis);
+ const y = invert(coords.y, context.yAxis);
+ return { x, y };
+}
+function invert(n, context) {
+ const { scale } = context;
+ if (context.continuous && scale.step == null) {
+ return context.scaleInvert(n);
+ }
+ const value = context.scaleInvertNearest(n);
+ const width = scale.bandwidth === 0 ? scale.step : scale.bandwidth ?? 0;
+ const bandStart = scale.convert(value);
+ const bandEnd = bandStart + width;
+ const groupPercentage = bandStart === bandEnd ? 0 : (n - bandStart) / (bandEnd - bandStart);
+ return { value, groupPercentage };
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/startEndProperties.ts
+var import_ag_charts_community17 = require("ag-charts-community");
+var { BaseProperties: BaseProperties4 } = import_ag_charts_community17._ModuleSupport;
+var StartEndProperties = class extends Annotation(Line3(Handle(BaseProperties4))) {
+ constructor() {
+ super(...arguments);
+ this.snapToAngle = 45;
+ }
+ getDefaultColor(_colorPickerType) {
+ return void 0;
+ }
+ getDefaultOpacity(_colorPickerType) {
+ return void 0;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/textualStartEndProperties.ts
+var { Property: Property14 } = import_ag_charts_community18._ModuleSupport;
+var TextualStartEndProperties = class extends Localisable(Label(Font(StartEndProperties))) {
+ constructor() {
+ super(...arguments);
+ this.text = "";
+ this.position = "top";
+ this.alignment = "left";
+ this.placement = "inside";
+ this.placeholderText = "inputTextareaPlaceholder";
+ }
+ getDefaultColor(_colorPickerType) {
+ return this.color;
+ }
+ getDefaultOpacity(_colorPickerType) {
+ return void 0;
+ }
+ getPlaceholderColor() {
+ return void 0;
+ }
+ getPadding() {
+ const { padding = 0 } = this;
+ return {
+ top: padding,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+ getText() {
+ const isPlaceholder = this.text.length == 0;
+ let text2 = this.text;
+ if (isPlaceholder) {
+ text2 = this.placeholderText ?? "";
+ if (this.localeManager)
+ text2 = this.localeManager.t(text2);
+ }
+ return {
+ text: text2,
+ isPlaceholder
+ };
+ }
+ getTextInputCoords(context, _height) {
+ return convertPoint(this.end, context);
+ }
+ getTextPosition() {
+ return this.position;
+ }
+};
+__decorateClass([
+ Property14
+], TextualStartEndProperties.prototype, "text", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/callout/calloutProperties.ts
+var { Property: Property15, Color } = import_ag_charts_community19._ModuleSupport;
+var DEFAULT_CALLOUT_PADDING = {
+ top: 6,
+ right: 12,
+ bottom: 9,
+ left: 12
+};
+var CalloutProperties = class extends Fill(Stroke(TextualStartEndProperties)) {
+ constructor() {
+ super(...arguments);
+ this.type = "callout" /* Callout */;
+ this.position = "bottom";
+ this.alignment = "left";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core12.isObject)(value) && value.type === "callout" /* Callout */;
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.fill;
+ case `line-color`:
+ return this.stroke;
+ case `text-color`:
+ default:
+ return this.color;
+ }
+ }
+ getDefaultOpacity(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.fillOpacity;
+ case `line-color`:
+ return this.strokeOpacity;
+ case `text-color`:
+ default:
+ return void 0;
+ }
+ }
+ getPlaceholderColor() {
+ const { r, g, b } = Color.fromString(this.color ?? "#888888");
+ return new Color(r, g, b, 0.66).toString();
+ }
+ getPadding() {
+ const { padding } = this;
+ if (padding == null) {
+ return { ...DEFAULT_CALLOUT_PADDING };
+ }
+ return {
+ top: padding,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+ getTextInputCoords(context, height) {
+ const coords = super.getTextInputCoords(context, height);
+ const padding = this.getPadding();
+ const paddingLeft = padding.left ?? 0;
+ const paddingBottom = padding.bottom ?? 0;
+ return {
+ x: coords.x + paddingLeft,
+ y: coords.y - paddingBottom
+ };
+ }
+};
+__decorateClass([
+ Property15
+], CalloutProperties.prototype, "type", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/comment/commentProperties.ts
+var import_ag_charts_community21 = require("ag-charts-community");
+var import_ag_charts_core13 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/textualPointProperties.ts
+var import_ag_charts_community20 = require("ag-charts-community");
+var { BaseProperties: BaseProperties5, Property: Property16 } = import_ag_charts_community20._ModuleSupport;
+var TextualPointProperties = class extends Annotation(Point(Handle(Label(Font(BaseProperties5))))) {
+ constructor() {
+ super(...arguments);
+ this.text = "";
+ this.position = "top";
+ this.alignment = "left";
+ this.placement = "inside";
+ this.placeholderText = "inputTextareaPlaceholder";
+ }
+ getDefaultColor(_colorPickerType) {
+ return this.color;
+ }
+ getDefaultOpacity(_colorPickerType) {
+ return void 0;
+ }
+ getPlaceholderColor() {
+ return void 0;
+ }
+ getPadding() {
+ const { padding = 0 } = this;
+ return {
+ top: padding,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+ getText() {
+ const isPlaceholder = this.text.length == 0;
+ const text2 = isPlaceholder ? this.placeholderText ?? "" : this.text;
+ return {
+ text: text2,
+ isPlaceholder
+ };
+ }
+ getTextInputCoords(context, _height) {
+ return convertPoint(this, context);
+ }
+ getTextPosition() {
+ return this.position;
+ }
+};
+__decorateClass([
+ Property16
+], TextualPointProperties.prototype, "text", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/comment/commentProperties.ts
+var { Property: Property17, Color: Color2 } = import_ag_charts_community21._ModuleSupport;
+var DEFAULT_COMMENT_PADDING = {
+ top: 8,
+ right: 14,
+ bottom: 8,
+ left: 14
+};
+var CommentProperties = class extends Fill(Stroke(TextualPointProperties)) {
+ constructor() {
+ super(...arguments);
+ this.type = "comment" /* Comment */;
+ this.position = "bottom";
+ this.alignment = "left";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core13.isObject)(value) && value.type === "comment" /* Comment */;
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.fill;
+ case `line-color`:
+ return this.stroke;
+ case `text-color`:
+ default:
+ return this.color;
+ }
+ }
+ getDefaultOpacity(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.fillOpacity;
+ case `line-color`:
+ return this.strokeOpacity;
+ case `text-color`:
+ default:
+ return void 0;
+ }
+ }
+ getPlaceholderColor() {
+ const { r, g, b } = Color2.fromString(this.color ?? "#888888");
+ return new Color2(r, g, b, 0.66).toString();
+ }
+ getPadding() {
+ const { padding, fontSize } = this;
+ if (padding == null) {
+ return {
+ top: Math.max(fontSize * 0.4, DEFAULT_COMMENT_PADDING.top),
+ bottom: Math.max(fontSize * 0.4, DEFAULT_COMMENT_PADDING.bottom),
+ left: Math.max(fontSize * 0.8, DEFAULT_COMMENT_PADDING.left),
+ right: Math.max(fontSize * 0.8, DEFAULT_COMMENT_PADDING.right)
+ };
+ }
+ return {
+ top: padding,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+ getTextInputCoords(context, height) {
+ const coords = super.getTextInputCoords(context, height);
+ const padding = this.getPadding();
+ return {
+ x: coords.x + padding.left,
+ y: coords.y - padding.bottom
+ };
+ }
+};
+__decorateClass([
+ Property17
+], CommentProperties.prototype, "type", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerProperties.ts
+var import_ag_charts_community23 = require("ag-charts-community");
+var import_ag_charts_core14 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/line.ts
+var import_ag_charts_community22 = require("ag-charts-community");
+var { Vec2 } = import_ag_charts_community22._ModuleSupport;
+function getLineStyle(lineDash, lineStyle) {
+ return lineDash ? "dashed" : lineStyle ?? "solid";
+}
+function getComputedLineDash(strokeWidth, styleType) {
+ switch (styleType) {
+ case "solid":
+ return [];
+ case "dashed":
+ return [strokeWidth * 4, strokeWidth * 2];
+ case "dotted":
+ return [0, strokeWidth * 2];
+ }
+}
+function getLineDash(lineDash, computedLineDash, lineStyle, strokeWidth) {
+ const styleType = getLineStyle(lineDash, lineStyle);
+ return computedLineDash ?? lineDash ?? getComputedLineDash(strokeWidth ?? 1, styleType);
+}
+function getLineCap(lineCap, lineDash, lineStyle) {
+ const styleType = getLineStyle(lineDash, lineStyle);
+ return lineCap ?? styleType === "dotted" ? "round" : void 0;
+}
+function boundsIntersections(coords, bounds) {
+ const [p1, p2] = Vec2.from(coords);
+ const reflection = bounds.height;
+ const gradient = Vec2.gradient(p2, p1, reflection);
+ const intercept = Vec2.intercept(p2, gradient, reflection);
+ const fallback = [
+ { x: p1.x, y: reflection ?? 0 },
+ { x: p1.x, y: reflection == null ? bounds.height : reflection - bounds.height }
+ ];
+ if (gradient === Infinity) {
+ return fallback;
+ }
+ let points = [
+ Vec2.intersectAtY(gradient, intercept, 0, reflection),
+ Vec2.intersectAtY(gradient, intercept, bounds.height, reflection),
+ Vec2.intersectAtX(gradient, intercept, 0, reflection),
+ Vec2.intersectAtX(gradient, intercept, bounds.width, reflection)
+ ];
+ points = points.filter((p) => p.x >= bounds.x && p.x <= bounds.width && p.y >= bounds.y && p.y <= bounds.height).sort((a, b) => {
+ if (a.x === b.x)
+ return 0;
+ return a.x < b.x ? -1 : 1;
+ });
+ if (points.length !== 2) {
+ return fallback;
+ }
+ return points;
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerProperties.ts
+var { BaseProperties: BaseProperties6, Property: Property18 } = import_ag_charts_community23._ModuleSupport;
+var MeasurerStatisticsDivider = class extends Stroke(BaseProperties6) {
+};
+var MeasurerStatistics = class extends Font(Fill(Stroke(BaseProperties6))) {
+ constructor() {
+ super(...arguments);
+ this.divider = new MeasurerStatisticsDivider();
+ }
+};
+__decorateClass([
+ Property18
+], MeasurerStatistics.prototype, "divider", 2);
+var MeasurerDirectionProperties = class extends Fill(Stroke(Handle(BaseProperties6))) {
+ constructor() {
+ super(...arguments);
+ this.statistics = new MeasurerStatistics();
+ }
+};
+__decorateClass([
+ Property18
+], MeasurerDirectionProperties.prototype, "statistics", 2);
+var MeasurerTypeProperties = class extends Localisable(Background(Stroke(LineStyle(StartEndProperties)))) {
+ constructor() {
+ super(...arguments);
+ this.direction = "both";
+ this.hasDateRange = false;
+ this.hasPriceRange = false;
+ this.statistics = new MeasurerStatistics();
+ this.getVolume = () => void 0;
+ this.text = new LineTextProperties();
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.background.fill;
+ case `line-color`:
+ return this.stroke;
+ case `text-color`:
+ return this.text.color;
+ }
+ }
+ getDefaultOpacity(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.background.fillOpacity;
+ case `line-color`:
+ return this.strokeOpacity;
+ }
+ }
+ getLineDash() {
+ return getLineDash(this.lineDash, this.computedLineDash, this.lineStyle, this.strokeWidth);
+ }
+ getLineCap() {
+ return getLineCap(this.lineCap, this.lineDash, this.lineStyle);
+ }
+};
+__decorateClass([
+ Property18
+], MeasurerTypeProperties.prototype, "statistics", 2);
+__decorateClass([
+ Property18
+], MeasurerTypeProperties.prototype, "text", 2);
+function DateRange(Parent) {
+ class DateRangeInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.hasDateRange = true;
+ }
+ }
+ return DateRangeInternal;
+}
+function PriceRange(Parent) {
+ class PriceRangeInternal extends Parent {
+ constructor() {
+ super(...arguments);
+ this.hasPriceRange = true;
+ }
+ }
+ return PriceRangeInternal;
+}
+var DateRangeProperties = class extends DateRange(MeasurerTypeProperties) {
+ constructor() {
+ super(...arguments);
+ this.type = "date-range" /* DateRange */;
+ this.direction = "horizontal";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core14.isObject)(value) && value.type === "date-range" /* DateRange */;
+ }
+};
+__decorateClass([
+ Property18
+], DateRangeProperties.prototype, "type", 2);
+__decorateClass([
+ Property18
+], DateRangeProperties.prototype, "extendAbove", 2);
+__decorateClass([
+ Property18
+], DateRangeProperties.prototype, "extendBelow", 2);
+var PriceRangeProperties = class extends PriceRange(MeasurerTypeProperties) {
+ constructor() {
+ super(...arguments);
+ this.type = "price-range" /* PriceRange */;
+ this.direction = "vertical";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core14.isObject)(value) && value.type === "price-range" /* PriceRange */;
+ }
+};
+__decorateClass([
+ Property18
+], PriceRangeProperties.prototype, "type", 2);
+__decorateClass([
+ Property18
+], PriceRangeProperties.prototype, "extendLeft", 2);
+__decorateClass([
+ Property18
+], PriceRangeProperties.prototype, "extendRight", 2);
+var DatePriceRangeProperties = class extends DateRange(PriceRange(MeasurerTypeProperties)) {
+ constructor() {
+ super(...arguments);
+ this.type = "date-price-range" /* DatePriceRange */;
+ this.direction = "both";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core14.isObject)(value) && value.type === "date-price-range" /* DatePriceRange */;
+ }
+};
+__decorateClass([
+ Property18
+], DatePriceRangeProperties.prototype, "type", 2);
+var QuickDatePriceRangeProperties = class extends DateRange(PriceRange(MeasurerTypeProperties)) {
+ constructor() {
+ super(...arguments);
+ this.type = "quick-date-price-range" /* QuickDatePriceRange */;
+ this.up = new MeasurerDirectionProperties();
+ this.down = new MeasurerDirectionProperties();
+ this.direction = "both";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core14.isObject)(value) && value.type === "quick-date-price-range" /* QuickDatePriceRange */;
+ }
+};
+__decorateClass([
+ Property18
+], QuickDatePriceRangeProperties.prototype, "type", 2);
+__decorateClass([
+ Property18
+], QuickDatePriceRangeProperties.prototype, "up", 2);
+__decorateClass([
+ Property18
+], QuickDatePriceRangeProperties.prototype, "down", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/note/noteProperties.ts
+var import_ag_charts_community25 = require("ag-charts-community");
+var import_ag_charts_core16 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/text/util.ts
+var import_ag_charts_community24 = require("ag-charts-community");
+var import_ag_charts_core15 = require("ag-charts-core");
+var { BBox: BBox2 } = import_ag_charts_community24._ModuleSupport;
+var ANNOTATION_TEXT_LINE_HEIGHT = 1.38;
+function maybeWrapText(options, text2, maxWidth) {
+ return maxWidth ? (0, import_ag_charts_core15.wrapText)(text2, { maxWidth, font: options, textWrap: "always", avoidOrphans: false }) : text2;
+}
+function measureAnnotationText(options, text2) {
+ const { lineMetrics, width } = (0, import_ag_charts_core15.cachedTextMeasurer)(options).measureLines(text2);
+ const height = lineMetrics.length * (0, import_ag_charts_core15.calcLineHeight)(options.fontSize, ANNOTATION_TEXT_LINE_HEIGHT);
+ return { width, height };
+}
+function getBBox(options, text2, coords, bbox) {
+ let width = bbox?.width ?? 0;
+ let height = bbox?.height ?? 0;
+ if (!bbox) {
+ const wrappedText = options.width == null ? text2 : maybeWrapText(options, text2, options.width);
+ ({ width, height } = measureAnnotationText(options, wrappedText));
+ }
+ return new BBox2(coords.x, coords.y, width, height);
+}
+function updateTextNode(node, text2, isPlaceholder, config, { x, y }, textBaseline) {
+ const { visible = true, fontFamily, fontSize = 14, fontStyle, fontWeight, textAlign } = config;
+ const lineHeight = (0, import_ag_charts_core15.calcLineHeight)(fontSize, ANNOTATION_TEXT_LINE_HEIGHT);
+ textBaseline ?? (textBaseline = config.position == "center" ? "middle" : config.position);
+ const fill = isPlaceholder ? config.getPlaceholderColor() : config.color;
+ node.setProperties({
+ x,
+ y,
+ visible,
+ text: text2,
+ fill,
+ fontFamily,
+ fontSize,
+ fontStyle,
+ fontWeight,
+ textAlign,
+ lineHeight,
+ textBaseline
+ });
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/note/noteProperties.ts
+var { BaseProperties: BaseProperties7, Property: Property19 } = import_ag_charts_community25._ModuleSupport;
+var DEFAULT_NOTE_PADDING = 10;
+var HANDLE_SIZE = 11;
+var ICON_HEIGHT = 20;
+var ICON_WIDTH = 22;
+var ICON_SPACING = 10;
+var LABEL_OFFSET = ICON_HEIGHT + ICON_SPACING;
+var TOOLBAR_OFFSET = 34;
+var NoteBackgroundProperties = class extends Fill(Stroke(BaseProperties7)) {
+};
+var NoteProperties = class extends Fill(Stroke(TextualPointProperties)) {
+ constructor() {
+ super(...arguments);
+ this.type = "note" /* Note */;
+ this.background = new NoteBackgroundProperties();
+ this.position = "bottom";
+ this.alignment = "center";
+ this.width = 200;
+ }
+ static is(value) {
+ return (0, import_ag_charts_core16.isObject)(value) && value.type === "note" /* Note */;
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case `line-color`:
+ return this.fill;
+ case `text-color`:
+ return this.color;
+ }
+ }
+ getDefaultOpacity(colorPickerType) {
+ switch (colorPickerType) {
+ case `line-color`:
+ return this.fillOpacity;
+ case `text-color`:
+ return void 0;
+ }
+ }
+ getPadding() {
+ const padding = this.padding ?? DEFAULT_NOTE_PADDING;
+ return {
+ top: padding,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+ getTextInputCoords(context, height) {
+ const { width, text: text2 } = this;
+ const textInputCoords = super.getTextInputCoords(context, height);
+ const padding = this.getPadding().top;
+ const bbox = getBBox(this, text2, textInputCoords);
+ bbox.x = (0, import_ag_charts_core16.clamp)(width / 2, bbox.x, context.seriesRect.width - width / 2);
+ const topY = bbox.y - LABEL_OFFSET - padding * 2;
+ const bottomY = bbox.y + HANDLE_SIZE + padding * 2;
+ const textHeight = Math.max(bbox.height, height);
+ if (topY - textHeight - TOOLBAR_OFFSET < 0) {
+ bbox.y = bottomY;
+ this.position = "top";
+ } else {
+ bbox.y = topY + padding;
+ this.position = "bottom";
+ }
+ return {
+ x: bbox.x,
+ y: bbox.y
+ };
+ }
+ isHoverable() {
+ return true;
+ }
+};
+__decorateClass([
+ Property19
+], NoteProperties.prototype, "type", 2);
+__decorateClass([
+ Property19
+], NoteProperties.prototype, "background", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/pointProperties.ts
+var import_ag_charts_community26 = require("ag-charts-community");
+var { BaseProperties: BaseProperties8 } = import_ag_charts_community26._ModuleSupport;
+var PointProperties2 = class extends Annotation(Point(Handle(BaseProperties8))) {
+ getDefaultColor(_colorPickerType) {
+ return void 0;
+ }
+ getDefaultOpacity(_colorPickerType) {
+ return void 0;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/shapePointProperties.ts
+var ShapePointProperties = class _ShapePointProperties extends Fill(PointProperties2) {
+ constructor() {
+ super(...arguments);
+ this.size = 32;
+ }
+ static is(value) {
+ return value instanceof _ShapePointProperties;
+ }
+ getDefaultColor(colorPickerType) {
+ return colorPickerType === `fill-color` ? this.fill : void 0;
+ }
+ getDefaultOpacity(colorPickerType) {
+ return colorPickerType === `fill-color` ? this.fillOpacity : void 0;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/cross-line/crossLineProperties.ts
+var import_ag_charts_community27 = require("ag-charts-community");
+var import_ag_charts_core17 = require("ag-charts-core");
+var { BaseProperties: BaseProperties9, Property: Property20 } = import_ag_charts_community27._ModuleSupport;
+var HorizontalLineProperties = class extends Annotation(Value(Handle(AxisLabel(Stroke(LineStyle(BaseProperties9)))))) {
+ constructor() {
+ super(...arguments);
+ this.direction = "horizontal";
+ this.type = "horizontal-line" /* HorizontalLine */;
+ this.text = new LineTextProperties();
+ }
+ static is(value) {
+ return (0, import_ag_charts_core17.isObject)(value) && value.type === "horizontal-line" /* HorizontalLine */;
+ }
+ getDefaultColor() {
+ return this.stroke;
+ }
+ getDefaultOpacity() {
+ return this.strokeOpacity;
+ }
+ getLineDash() {
+ return getLineDash(this.lineDash, this.computedLineDash, this.lineStyle, this.strokeWidth);
+ }
+ getLineCap() {
+ return getLineCap(this.lineCap, this.lineDash, this.lineStyle);
+ }
+};
+__decorateClass([
+ Property20
+], HorizontalLineProperties.prototype, "type", 2);
+__decorateClass([
+ Property20
+], HorizontalLineProperties.prototype, "text", 2);
+var VerticalLineProperties = class extends Annotation(Value(Handle(AxisLabel(Stroke(LineStyle(BaseProperties9)))))) {
+ constructor() {
+ super(...arguments);
+ this.direction = "vertical";
+ this.type = "vertical-line" /* VerticalLine */;
+ this.text = new LineTextProperties();
+ }
+ static is(value) {
+ return (0, import_ag_charts_core17.isObject)(value) && value.type === "vertical-line" /* VerticalLine */;
+ }
+ getDefaultColor() {
+ return this.stroke;
+ }
+ getDefaultOpacity() {
+ return this.strokeOpacity;
+ }
+ getLineDash() {
+ return getLineDash(this.lineDash, this.computedLineDash, this.lineStyle, this.strokeWidth);
+ }
+ getLineCap() {
+ return getLineCap(this.lineCap, this.lineDash, this.lineStyle);
+ }
+};
+__decorateClass([
+ Property20
+], VerticalLineProperties.prototype, "type", 2);
+__decorateClass([
+ Property20
+], VerticalLineProperties.prototype, "text", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/disjoint-channel/disjointChannelProperties.ts
+var import_ag_charts_community28 = require("ag-charts-community");
+var import_ag_charts_core18 = require("ag-charts-core");
+var { BaseProperties: BaseProperties10, Property: Property21 } = import_ag_charts_community28._ModuleSupport;
+var DisjointChannelProperties = class extends Annotation(
+ Background(Line3(Handle(Extendable(Stroke(LineStyle(BaseProperties10))))))
+) {
+ constructor() {
+ super(...arguments);
+ this.type = "disjoint-channel" /* DisjointChannel */;
+ this.text = new ChannelTextProperties();
+ this.snapToAngle = 45;
+ }
+ static is(value) {
+ return (0, import_ag_charts_core18.isObject)(value) && value.type === "disjoint-channel" /* DisjointChannel */;
+ }
+ get bottom() {
+ const bottom = {
+ start: { x: this.start.x, y: this.start.y },
+ end: { x: this.end.x, y: this.end.y }
+ };
+ if (typeof bottom.start.y === "number" && typeof bottom.end.y === "number") {
+ bottom.start.y -= this.startHeight;
+ bottom.end.y -= this.endHeight;
+ } else {
+ import_ag_charts_core18.Logger.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`);
+ }
+ return bottom;
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.background.fill;
+ case `line-color`:
+ return this.stroke;
+ case "text-color":
+ return this.text.color;
+ }
+ }
+ getDefaultOpacity(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.background.fillOpacity;
+ case `line-color`:
+ return this.strokeOpacity;
+ }
+ }
+ getLineDash() {
+ return getLineDash(this.lineDash, this.computedLineDash, this.lineStyle, this.strokeWidth);
+ }
+ getLineCap() {
+ return getLineCap(this.lineCap, this.lineDash, this.lineStyle);
+ }
+};
+__decorateClass([
+ Property21
+], DisjointChannelProperties.prototype, "type", 2);
+__decorateClass([
+ Property21
+], DisjointChannelProperties.prototype, "startHeight", 2);
+__decorateClass([
+ Property21
+], DisjointChannelProperties.prototype, "endHeight", 2);
+__decorateClass([
+ Property21
+], DisjointChannelProperties.prototype, "text", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement-trend-based/fibonacciRetracementTrendBasedProperties.ts
+var import_ag_charts_community31 = require("ag-charts-community");
+var import_ag_charts_core20 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/fibonacciProperties.ts
+var import_ag_charts_community30 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/line/lineProperties.ts
+var import_ag_charts_community29 = require("ag-charts-community");
+var import_ag_charts_core19 = require("ag-charts-core");
+var { Property: Property22 } = import_ag_charts_community29._ModuleSupport;
+var LineTypeProperties = class extends Localisable(
+ Cappable(Extendable(Stroke(LineStyle(StartEndProperties))))
+) {
+ constructor() {
+ super(...arguments);
+ this.text = new LineTextProperties();
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case "line-color":
+ return this.stroke;
+ case "text-color":
+ return this.text.color;
+ }
+ }
+ getDefaultOpacity() {
+ return this.strokeOpacity;
+ }
+ getLineDash() {
+ return getLineDash(this.lineDash, this.computedLineDash, this.lineStyle, this.strokeWidth);
+ }
+ getLineCap() {
+ return getLineCap(this.lineCap, this.lineDash, this.lineStyle);
+ }
+};
+__decorateClass([
+ Property22
+], LineTypeProperties.prototype, "text", 2);
+var ArrowProperties = class extends LineTypeProperties {
+ constructor() {
+ super(...arguments);
+ this.type = "arrow" /* Arrow */;
+ this.endCap = "arrow";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core19.isObject)(value) && value.type === "arrow" /* Arrow */;
+ }
+};
+__decorateClass([
+ Property22
+], ArrowProperties.prototype, "type", 2);
+var LineProperties = class extends LineTypeProperties {
+ constructor() {
+ super(...arguments);
+ this.type = "line" /* Line */;
+ }
+ static is(value) {
+ return (0, import_ag_charts_core19.isObject)(value) && value.type === "line" /* Line */;
+ }
+};
+__decorateClass([
+ Property22
+], LineProperties.prototype, "type", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/properties/fibonacciProperties.ts
+var { Property: Property23 } = import_ag_charts_community30._ModuleSupport;
+var FibonacciProperties = class extends LineTypeProperties {
+ constructor() {
+ super(...arguments);
+ this.label = new LabelTextProperties();
+ this.reverse = false;
+ this.showFill = true;
+ this.isMultiColor = true;
+ this.strokes = [];
+ this.bands = 10;
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case "line-color":
+ return this.rangeStroke ?? this.stroke;
+ case "text-color":
+ return this.text.color;
+ }
+ }
+};
+__decorateClass([
+ Property23
+], FibonacciProperties.prototype, "label", 2);
+__decorateClass([
+ Property23
+], FibonacciProperties.prototype, "reverse", 2);
+__decorateClass([
+ Property23
+], FibonacciProperties.prototype, "showFill", 2);
+__decorateClass([
+ Property23
+], FibonacciProperties.prototype, "isMultiColor", 2);
+__decorateClass([
+ Property23
+], FibonacciProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property23
+], FibonacciProperties.prototype, "rangeStroke", 2);
+__decorateClass([
+ Property23
+], FibonacciProperties.prototype, "bands", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement-trend-based/fibonacciRetracementTrendBasedProperties.ts
+var { Property: Property24 } = import_ag_charts_community31._ModuleSupport;
+var FibonacciRetracementTrendBasedProperties = class extends FibonacciProperties {
+ constructor() {
+ super(...arguments);
+ this.type = "fibonacci-retracement-trend-based" /* FibonacciRetracementTrendBased */;
+ this.endRetracement = new PointProperties();
+ }
+ static is(value) {
+ return (0, import_ag_charts_core20.isObject)(value) && value.type === "fibonacci-retracement-trend-based" /* FibonacciRetracementTrendBased */;
+ }
+};
+__decorateClass([
+ Property24
+], FibonacciRetracementTrendBasedProperties.prototype, "type", 2);
+__decorateClass([
+ Property24
+], FibonacciRetracementTrendBasedProperties.prototype, "endRetracement", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement/fibonacciRetracementProperties.ts
+var import_ag_charts_community32 = require("ag-charts-community");
+var import_ag_charts_core21 = require("ag-charts-core");
+var { Property: Property25 } = import_ag_charts_community32._ModuleSupport;
+var FibonacciRetracementProperties = class extends FibonacciProperties {
+ constructor() {
+ super(...arguments);
+ this.type = "fibonacci-retracement" /* FibonacciRetracement */;
+ }
+ static is(value) {
+ return (0, import_ag_charts_core21.isObject)(value) && value.type === "fibonacci-retracement" /* FibonacciRetracement */;
+ }
+};
+__decorateClass([
+ Property25
+], FibonacciRetracementProperties.prototype, "type", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/parallel-channel/parallelChannelProperties.ts
+var import_ag_charts_community33 = require("ag-charts-community");
+var import_ag_charts_core22 = require("ag-charts-core");
+var { BaseProperties: BaseProperties11, Property: Property26 } = import_ag_charts_community33._ModuleSupport;
+var ParallelChannelProperties = class extends Annotation(
+ Background(Line3(Handle(Extendable(Stroke(LineStyle(BaseProperties11))))))
+) {
+ constructor() {
+ super(...arguments);
+ this.type = "parallel-channel" /* ParallelChannel */;
+ this.middle = new ChannelAnnotationMiddleProperties();
+ this.text = new ChannelTextProperties();
+ this.snapToAngle = 45;
+ }
+ static is(value) {
+ return (0, import_ag_charts_core22.isObject)(value) && value.type === "parallel-channel" /* ParallelChannel */;
+ }
+ get bottom() {
+ const bottom = {
+ start: { x: this.start.x, y: this.start.y },
+ end: { x: this.end.x, y: this.end.y }
+ };
+ if (typeof bottom.start.y === "number" && typeof bottom.end.y === "number") {
+ bottom.start.y -= this.height;
+ bottom.end.y -= this.height;
+ } else {
+ import_ag_charts_core22.Logger.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`);
+ }
+ return bottom;
+ }
+ getDefaultColor(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.background.fill;
+ case `line-color`:
+ return this.stroke;
+ case "text-color":
+ return this.text.color;
+ }
+ }
+ getDefaultOpacity(colorPickerType) {
+ switch (colorPickerType) {
+ case `fill-color`:
+ return this.background.fillOpacity;
+ case `line-color`:
+ return this.strokeOpacity;
+ }
+ }
+ getLineDash() {
+ return getLineDash(this.lineDash, this.computedLineDash, this.lineStyle, this.strokeWidth);
+ }
+ getLineCap() {
+ return getLineCap(this.lineCap, this.lineDash, this.lineStyle);
+ }
+};
+__decorateClass([
+ Property26
+], ParallelChannelProperties.prototype, "type", 2);
+__decorateClass([
+ Property26
+], ParallelChannelProperties.prototype, "height", 2);
+__decorateClass([
+ Property26
+], ParallelChannelProperties.prototype, "middle", 2);
+__decorateClass([
+ Property26
+], ParallelChannelProperties.prototype, "text", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/text/textProperties.ts
+var import_ag_charts_community34 = require("ag-charts-community");
+var import_ag_charts_core23 = require("ag-charts-core");
+var { Property: Property27 } = import_ag_charts_community34._ModuleSupport;
+var TextProperties = class extends TextualPointProperties {
+ constructor() {
+ super(...arguments);
+ this.type = "text" /* Text */;
+ this.position = "bottom";
+ }
+ static is(value) {
+ return (0, import_ag_charts_core23.isObject)(value) && value.type === "text" /* Text */;
+ }
+};
+__decorateClass([
+ Property27
+], TextProperties.prototype, "type", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/types.ts
+function isEphemeralType(datum) {
+ return QuickDatePriceRangeProperties.is(datum);
+}
+function isLineType(datum) {
+ return LineProperties.is(datum) || HorizontalLineProperties.is(datum) || VerticalLineProperties.is(datum) || ArrowProperties.is(datum) || isFibonacciType(datum);
+}
+function isChannelType(datum) {
+ return DisjointChannelProperties.is(datum) || ParallelChannelProperties.is(datum);
+}
+function isFibonacciType(datum) {
+ return FibonacciRetracementProperties.is(datum) || FibonacciRetracementTrendBasedProperties.is(datum);
+}
+function isTextType(datum) {
+ return CalloutProperties.is(datum) || CommentProperties.is(datum) || NoteProperties.is(datum) || TextProperties.is(datum);
+}
+function isMeasurerType(datum) {
+ return DateRangeProperties.is(datum) || PriceRangeProperties.is(datum) || DatePriceRangeProperties.is(datum) || QuickDatePriceRangeProperties.is(datum);
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/has.ts
+function hasFontSize(datum) {
+ return isTextType(datum) && !NoteProperties.is(datum);
+}
+function hasLineStyle(datum) {
+ return isLineType(datum) || isChannelType(datum) || isMeasurerType(datum) && !QuickDatePriceRangeProperties.is(datum);
+}
+function hasLineColor(datum) {
+ return isLineType(datum) || isChannelType(datum) || isMeasurerType(datum) || CalloutProperties.is(datum) || NoteProperties.is(datum);
+}
+function hasIconColor(datum) {
+ return NoteProperties.is(datum);
+}
+function hasFillColor(datum) {
+ return isChannelType(datum) || isMeasurerType(datum) || CalloutProperties.is(datum) || CommentProperties.is(datum) || ShapePointProperties.is(datum);
+}
+function hasTextColor(datum) {
+ return isTextType(datum) && !NoteProperties.is(datum);
+}
+function hasLineText(datum) {
+ return (isLineType(datum) || isChannelType(datum) || isMeasurerType(datum)) && !isEphemeralType(datum) && (0, import_ag_charts_core24.isObject)(datum.text);
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/styles.ts
+function setFontSize(datum, fontSize) {
+ if ("fontSize" in datum)
+ datum.fontSize = fontSize;
+ if (hasLineText(datum))
+ datum.text.fontSize = fontSize;
+}
+function setLineStyle(datum, style) {
+ const strokeWidth = style?.strokeWidth ?? datum.strokeWidth ?? 1;
+ const lineType = style?.type ?? datum.lineStyle;
+ const lineStyle = lineType ?? getLineStyle(datum.lineDash, lineType);
+ const computedLineDash = getComputedLineDash(strokeWidth, lineStyle);
+ datum.strokeWidth = strokeWidth;
+ datum.computedLineDash = computedLineDash;
+ datum.lineStyle = lineStyle;
+ datum.lineCap = lineStyle === "dotted" ? "round" : void 0;
+}
+function setColor(datum, colorPickerType, colorOpacity, color6, opacity, isMultiColor) {
+ switch (colorPickerType) {
+ case `fill-color`: {
+ if ("fill" in datum)
+ datum.fill = color6;
+ if ("fillOpacity" in datum)
+ datum.fillOpacity = opacity;
+ if ("background" in datum) {
+ datum.background.fill = color6;
+ datum.background.fillOpacity = opacity;
+ }
+ break;
+ }
+ case `line-color`: {
+ if ("axisLabel" in datum) {
+ datum.axisLabel.fill = color6;
+ datum.axisLabel.fillOpacity = opacity;
+ datum.axisLabel.stroke = color6;
+ datum.axisLabel.strokeOpacity = opacity;
+ }
+ if ("fill" in datum && "fillOpacity" in datum && hasIconColor(datum)) {
+ datum.fill = color6;
+ datum.fillOpacity = opacity;
+ } else {
+ if ("strokeOpacity" in datum)
+ datum.strokeOpacity = opacity;
+ if ("isMultiColor" in datum && "rangeStroke" in datum) {
+ datum.isMultiColor = isMultiColor;
+ datum.rangeStroke = color6;
+ } else if ("stroke" in datum) {
+ datum.stroke = color6;
+ }
+ }
+ break;
+ }
+ case `text-color`: {
+ if ("color" in datum)
+ datum.color = colorOpacity;
+ if (hasLineText(datum))
+ datum.text.color = color6;
+ break;
+ }
+ }
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationDefaults.ts
+var { deepClone } = import_ag_charts_community35._ModuleSupport;
+var AnnotationDefaults = class {
+ constructor() {
+ this.mementoOriginatorKey = "annotation-defaults";
+ this.colors = new Map(
+ Object.values(AnnotationType).map((type) => [
+ type,
+ /* @__PURE__ */ new Map([
+ ["line-color", void 0],
+ ["fill-color", void 0],
+ ["text-color", void 0]
+ ])
+ ])
+ );
+ this.fontSizes = /* @__PURE__ */ new Map([
+ ["callout" /* Callout */, void 0],
+ ["comment" /* Comment */, void 0],
+ ["text" /* Text */, void 0],
+ ["arrow" /* Arrow */, void 0],
+ ["line" /* Line */, void 0],
+ ["disjoint-channel" /* DisjointChannel */, void 0],
+ ["parallel-channel" /* ParallelChannel */, void 0],
+ ["date-range" /* DateRange */, void 0],
+ ["price-range" /* PriceRange */, void 0],
+ ["date-price-range" /* DatePriceRange */, void 0]
+ ]);
+ this.lineStyles = /* @__PURE__ */ new Map([
+ ["line" /* Line */, void 0],
+ ["horizontal-line" /* HorizontalLine */, void 0],
+ ["vertical-line" /* VerticalLine */, void 0],
+ ["disjoint-channel" /* DisjointChannel */, void 0],
+ ["parallel-channel" /* ParallelChannel */, void 0],
+ ["arrow" /* Arrow */, void 0],
+ ["date-range" /* DateRange */, void 0],
+ ["price-range" /* PriceRange */, void 0],
+ ["date-price-range" /* DatePriceRange */, void 0]
+ ]);
+ this.lineTextAlignments = /* @__PURE__ */ new Map([
+ ["line" /* Line */, void 0],
+ ["horizontal-line" /* HorizontalLine */, void 0],
+ ["vertical-line" /* VerticalLine */, void 0],
+ ["disjoint-channel" /* DisjointChannel */, void 0],
+ ["parallel-channel" /* ParallelChannel */, void 0],
+ ["arrow" /* Arrow */, void 0],
+ ["date-range" /* DateRange */, void 0],
+ ["price-range" /* PriceRange */, void 0],
+ ["date-price-range" /* DatePriceRange */, void 0]
+ ]);
+ this.lineTextPositions = /* @__PURE__ */ new Map([
+ ["line" /* Line */, void 0],
+ ["horizontal-line" /* HorizontalLine */, void 0],
+ ["vertical-line" /* VerticalLine */, void 0],
+ ["disjoint-channel" /* DisjointChannel */, void 0],
+ ["parallel-channel" /* ParallelChannel */, void 0],
+ ["arrow" /* Arrow */, void 0],
+ ["date-range" /* DateRange */, void 0],
+ ["price-range" /* PriceRange */, void 0],
+ ["date-price-range" /* DatePriceRange */, void 0]
+ ]);
+ this.fibonacciOptions = /* @__PURE__ */ new Map([
+ [
+ "fibonacci-retracement" /* FibonacciRetracement */,
+ {
+ bands: void 0,
+ reverse: void 0,
+ showFill: void 0
+ }
+ ],
+ [
+ "fibonacci-retracement-trend-based" /* FibonacciRetracementTrendBased */,
+ {
+ bands: void 0,
+ reverse: void 0,
+ showFill: void 0
+ }
+ ]
+ ]);
+ }
+ createMemento() {
+ return {
+ colors: deepClone(this.colors),
+ fontSizes: deepClone(this.fontSizes),
+ lineStyles: deepClone(this.lineStyles),
+ lineTextAlignments: deepClone(this.lineTextAlignments),
+ lineTextPositions: deepClone(this.lineTextPositions),
+ fibonacciOptions: deepClone(this.fibonacciOptions)
+ };
+ }
+ guardMemento(_blob) {
+ return true;
+ }
+ restoreMemento(_version, _mementoVersion, blob) {
+ this.colors = deepClone(blob.colors);
+ this.fontSizes = deepClone(blob.fontSizes);
+ this.lineStyles = deepClone(blob.lineStyles);
+ this.lineTextAlignments = deepClone(blob.lineTextAlignments);
+ this.lineTextPositions = deepClone(blob.lineTextPositions);
+ this.fibonacciOptions = deepClone(blob.fibonacciOptions);
+ }
+ setDefaultColor(type, colorType, colorOpacity, color6, opacity, isMultiColor) {
+ this.colors.get(type)?.set(colorType, [colorOpacity, color6, opacity, isMultiColor]);
+ }
+ setDefaultFontSize(type, fontSize) {
+ this.fontSizes.set(type, fontSize);
+ }
+ setDefaultLineStyleType(type, lineStyleType) {
+ const defaultStyle = this.lineStyles.get(type);
+ if (defaultStyle) {
+ defaultStyle.type = lineStyleType;
+ } else {
+ this.lineStyles.set(type, { type: lineStyleType });
+ }
+ }
+ setDefaultLineStyleWidth(type, strokeWidth) {
+ const defaultStyle = this.lineStyles.get(type);
+ if (defaultStyle) {
+ defaultStyle.strokeWidth = strokeWidth;
+ } else {
+ this.lineStyles.set(type, { strokeWidth });
+ }
+ }
+ setDefaultLineTextAlignment(type, alignment) {
+ this.lineTextAlignments.set(type, alignment);
+ }
+ setDefaultLineTextPosition(type, position) {
+ this.lineTextPositions.set(type, position);
+ }
+ setDefaultFibonacciOptions(type, key, value) {
+ if (type != "fibonacci-retracement" /* FibonacciRetracement */ && type != "fibonacci-retracement-trend-based" /* FibonacciRetracementTrendBased */)
+ return;
+ const options = this.fibonacciOptions.get(type);
+ options[key] = value;
+ this.fibonacciOptions.set(type, options);
+ }
+ applyDefaults(datum) {
+ for (const [annotationType, colors] of this.colors) {
+ if (datum.type !== annotationType)
+ continue;
+ for (const [colorPickerType, [colorOpacity, color6, opacity, isMultiColor] = []] of colors) {
+ if (colorOpacity && color6 && opacity != null && isMultiColor != null) {
+ setColor(datum, colorPickerType, colorOpacity, color6, opacity, isMultiColor);
+ }
+ }
+ }
+ for (const [annotationType, size] of this.fontSizes) {
+ if (datum.type !== annotationType || size == null)
+ continue;
+ setFontSize(datum, size);
+ }
+ for (const [annotationType, style] of this.lineStyles) {
+ if (datum.type !== annotationType || style == null)
+ continue;
+ setLineStyle(datum, style);
+ }
+ for (const [annotationType, position] of this.lineTextPositions) {
+ if (datum.type !== annotationType || position == null)
+ continue;
+ datum.text.position = position;
+ }
+ for (const [annotationType, alignment] of this.lineTextAlignments) {
+ if (datum.type !== annotationType || alignment == null)
+ continue;
+ datum.text.alignment = alignment;
+ }
+ for (const [annotationType, options] of this.fibonacciOptions) {
+ if (datum.type !== annotationType || options == null)
+ continue;
+ for (const option of Object.keys(options)) {
+ const value = options[option];
+ if (value == null) {
+ continue;
+ }
+ datum.set({ [option]: value });
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationOptionsToolbar.ts
+var import_ag_charts_community38 = require("ag-charts-community");
+var import_ag_charts_core26 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/components/color-picker/colorPicker.ts
+var import_ag_charts_community36 = require("ag-charts-community");
+var import_ag_charts_core25 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/components/color-picker/colorPickerTemplate.html
+var colorPickerTemplate_default = '
';
+
+// packages/ag-charts-enterprise/src/components/color-picker/colorPicker.ts
+var { Color: Color3 } = import_ag_charts_community36._ModuleSupport;
+var getHsva = (input) => {
+ try {
+ const color6 = Color3.fromString(input);
+ const [h, s, v] = color6.toHSB();
+ return [h, s, v, color6.a];
+ } catch {
+ return;
+ }
+};
+var ColorPicker = class extends import_ag_charts_community36._ModuleSupport.AnchoredPopover {
+ constructor(ctx, options) {
+ super(ctx, "color-picker", options);
+ this.hasChanged = false;
+ this.hideFns.push(() => {
+ this.i18nUpdater = void 0;
+ if (this.hasChanged)
+ this.onChangeHide?.();
+ });
+ this.cleanup.register(this.ctx.eventsHub.on("locale:change", () => this.i18nUpdater?.()));
+ }
+ show(options) {
+ this.hasChanged = false;
+ this.onChangeHide = options.onChangeHide;
+ const { element, initialFocus } = this.createColorPicker(options);
+ const popover = this.showWithChildren([element], { initialFocus, ...options });
+ popover.classList.add("ag-charts-color-picker");
+ popover.setAttribute("role", "dialog");
+ }
+ createColorPicker(opts) {
+ const { localeManager } = this.ctx;
+ let isMultiColor = opts.isMultiColor ?? false;
+ let [h, s, v, a] = getHsva(opts.color ?? "#f00") ?? [0, 1, 0.5, 1];
+ a = opts.opacity ?? a;
+ const colorPicker = (0, import_ag_charts_core25.createElement)("div", "ag-charts-color-picker__content");
+ colorPicker.innerHTML = colorPickerTemplate_default;
+ colorPicker.ariaLabel = this.ctx.localeManager.t("ariaLabelColorPicker");
+ const paletteInput = colorPicker.querySelector(".ag-charts-color-picker__palette");
+ const hueInput = colorPicker.querySelector(".ag-charts-color-picker__hue-input");
+ const multiColorButton = colorPicker.querySelector(
+ ".ag-charts-color-picker__multi-color-button"
+ );
+ const alphaInput = colorPicker.querySelector(".ag-charts-color-picker__alpha-input");
+ const colorInput = colorPicker.querySelector(".ag-charts-color-picker__color-input");
+ const colorInputLabel = colorPicker.querySelector(".ag-charts-color-picker__color-label");
+ const updatePaletteInputAriaValue = (first) => {
+ const key = { s: "ariaValueColorPalette", v: "ariaValueColorPaletteFirstV" }[first];
+ paletteInput.ariaValueText = localeManager.t(key, { s, v });
+ };
+ this.i18nUpdater = () => {
+ paletteInput.ariaRoleDescription = localeManager.t("ariaRoleDescription2DSlider");
+ paletteInput.ariaLabel = localeManager.t("ariaLabelColorPickerPalette");
+ hueInput.ariaLabel = localeManager.t("ariaLabelColorPickerHue");
+ multiColorButton.ariaLabel = localeManager.t("ariaLabelColorPickerMultiColor");
+ alphaInput.ariaLabel = localeManager.t("ariaLabelColorPickerAlpha");
+ colorInput.ariaLabel = localeManager.t("ariaLabelColor");
+ updatePaletteInputAriaValue("s");
+ };
+ this.i18nUpdater();
+ multiColorButton.classList.toggle(
+ "ag-charts-color-picker__multi-color-button--hidden",
+ !opts.hasMultiColorOption
+ );
+ const update = (trackChange = true) => {
+ const color6 = Color3.fromHSB(h, s, v, a);
+ const colorString = color6.toHexString();
+ colorPicker.style.setProperty("--h", `${h}`);
+ colorPicker.style.setProperty("--s", `${s}`);
+ colorPicker.style.setProperty("--v", `${v}`);
+ colorPicker.style.setProperty("--a", `${a}`);
+ colorPicker.style.setProperty("--color", colorString.slice(0, 7));
+ colorPicker.style.setProperty("--color-a", colorString);
+ hueInput.value = `${h}`;
+ alphaInput.value = `${a}`;
+ alphaInput.classList.toggle("ag-charts-color-picker__alpha-input--opaque", a === 1);
+ multiColorButton.classList.toggle("ag-charts-color-picker__multi-color-button--active", isMultiColor);
+ colorInputLabel.classList.toggle("ag-charts-color-picker__color-label--multi-color", isMultiColor);
+ if (document.activeElement !== colorInput) {
+ multiColorButton.ariaChecked = isMultiColor.toString();
+ colorInput.value = isMultiColor ? localeManager.t("ariaLabelColorPickerMultiColor") : colorString.toUpperCase();
+ }
+ if (trackChange || opts.color == null) {
+ const plainColor = Color3.fromHSB(h, s, v, 1).toHexString();
+ opts.onChange?.(colorString, plainColor, a, isMultiColor);
+ }
+ if (trackChange)
+ this.hasChanged = true;
+ };
+ update(false);
+ const preventDefault = (event) => event.preventDefault();
+ const stopPropagation = (event) => event.stopPropagation();
+ const beginPaletteInteraction = (e) => {
+ e.preventDefault();
+ const currentTarget = e.currentTarget;
+ currentTarget.focus();
+ const rect = currentTarget.getBoundingClientRect();
+ const pointerMove = ({ clientX, clientY }) => {
+ isMultiColor = false;
+ s = Math.min(Math.max((clientX - rect.left) / rect.width, 0), 1);
+ v = 1 - Math.min(Math.max((clientY - rect.top) / rect.height, 0), 1);
+ update();
+ updatePaletteInputAriaValue("s");
+ };
+ pointerMove(e);
+ const pointerUp = (0, import_ag_charts_core25.attachListener)((0, import_ag_charts_core25.getWindow)(), "pointermove", pointerMove);
+ (0, import_ag_charts_core25.getWindow)().addEventListener("pointerup", pointerUp, { once: true });
+ };
+ colorPicker.addEventListener("mousedown", stopPropagation);
+ colorPicker.addEventListener("touchstart", stopPropagation);
+ colorPicker.addEventListener("touchmove", stopPropagation);
+ colorPicker.addEventListener("keydown", (e) => {
+ e.stopPropagation();
+ switch (e.key) {
+ case "Enter":
+ case "Escape":
+ this.hide();
+ break;
+ default:
+ return;
+ }
+ e.preventDefault();
+ });
+ paletteInput.addEventListener("pointerdown", beginPaletteInteraction);
+ paletteInput.addEventListener("touchstart", preventDefault, { passive: false });
+ paletteInput.addEventListener("touchmove", preventDefault, { passive: false });
+ paletteInput.addEventListener("keydown", (e) => {
+ if (e.key === "ArrowLeft") {
+ s = (0, import_ag_charts_core25.clamp)(0, s - 0.01, 1);
+ updatePaletteInputAriaValue("s");
+ } else if (e.key === "ArrowRight") {
+ s = (0, import_ag_charts_core25.clamp)(0, s + 0.01, 1);
+ updatePaletteInputAriaValue("s");
+ } else if (e.key === "ArrowUp") {
+ v = (0, import_ag_charts_core25.clamp)(0, v + 0.01, 1);
+ updatePaletteInputAriaValue("v");
+ } else if (e.key === "ArrowDown") {
+ v = (0, import_ag_charts_core25.clamp)(0, v - 0.01, 1);
+ updatePaletteInputAriaValue("v");
+ } else {
+ return;
+ }
+ e.preventDefault();
+ update();
+ });
+ paletteInput.addEventListener("focus", () => {
+ updatePaletteInputAriaValue("s");
+ });
+ multiColorButton.addEventListener("click", () => {
+ isMultiColor = !isMultiColor;
+ update();
+ });
+ hueInput.addEventListener("input", (e) => {
+ isMultiColor = false;
+ h = e.currentTarget.valueAsNumber ?? 0;
+ update();
+ });
+ alphaInput.addEventListener("input", (e) => {
+ isMultiColor = false;
+ a = e.currentTarget.valueAsNumber ?? 0;
+ update();
+ });
+ colorInput.addEventListener("input", (e) => {
+ isMultiColor = false;
+ const hsva = getHsva(e.currentTarget.value);
+ if (hsva == null)
+ return;
+ [h, s, v, a] = hsva;
+ update();
+ });
+ colorInput.addEventListener("blur", () => update());
+ colorInput.addEventListener("keydown", (e) => {
+ if (e.key === "Enter") {
+ e.currentTarget.blur();
+ update();
+ }
+ });
+ return { element: colorPicker, initialFocus: paletteInput };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationsMenuOptions.ts
+var import_ag_charts_community37 = require("ag-charts-community");
+function channelMenuItemVisible(scale) {
+ return !(scale instanceof import_ag_charts_community37._ModuleSupport.LogScale) && !(scale instanceof import_ag_charts_community37._ModuleSupport.BandScale);
+}
+var LINE_ANNOTATION_ITEMS = [
+ {
+ label: "toolbarAnnotationsTrendLine",
+ icon: "trend-line-drawing",
+ value: "line" /* Line */
+ },
+ {
+ label: "toolbarAnnotationsHorizontalLine",
+ icon: "horizontal-line-drawing",
+ value: "horizontal-line" /* HorizontalLine */
+ },
+ {
+ label: "toolbarAnnotationsVerticalLine",
+ icon: "vertical-line-drawing",
+ value: "vertical-line" /* VerticalLine */
+ },
+ {
+ label: "toolbarAnnotationsParallelChannel",
+ icon: "parallel-channel-drawing",
+ value: "parallel-channel" /* ParallelChannel */,
+ visible: channelMenuItemVisible
+ },
+ {
+ label: "toolbarAnnotationsDisjointChannel",
+ icon: "disjoint-channel-drawing",
+ value: "disjoint-channel" /* DisjointChannel */,
+ visible: channelMenuItemVisible
+ }
+];
+var FIBONACCI_ANNOTATION_ITEMS = [
+ {
+ label: "toolbarAnnotationsFibonacciRetracement",
+ icon: "fibonacci-retracement-drawing",
+ value: "fibonacci-retracement" /* FibonacciRetracement */
+ },
+ {
+ label: "toolbarAnnotationsFibonacciRetracementTrendBased",
+ icon: "fibonacci-retracement-trend-based-drawing",
+ value: "fibonacci-retracement-trend-based" /* FibonacciRetracementTrendBased */
+ }
+];
+var FIBONACCI_RATIO_ITEMS = [
+ { label: "Fibonacci - Extended", value: 10 },
+ { label: "Fibonacci - 6 Band", value: 6 },
+ { label: "Fibonacci - 4 Band", value: 4 }
+];
+var TEXT_ANNOTATION_ITEMS = [
+ { label: "toolbarAnnotationsText", icon: "text-annotation", value: "text" /* Text */ },
+ { label: "toolbarAnnotationsComment", icon: "comment-annotation", value: "comment" /* Comment */ },
+ { label: "toolbarAnnotationsCallout", icon: "callout-annotation", value: "callout" /* Callout */ },
+ { label: "toolbarAnnotationsNote", icon: "note-annotation", value: "note" /* Note */ }
+];
+var SHAPE_ANNOTATION_ITEMS = [
+ { label: "toolbarAnnotationsArrow", icon: "arrow-drawing", value: "arrow" /* Arrow */ },
+ { label: "toolbarAnnotationsArrowUp", icon: "arrow-up-drawing", value: "arrow-up" /* ArrowUp */ },
+ { label: "toolbarAnnotationsArrowDown", icon: "arrow-down-drawing", value: "arrow-down" /* ArrowDown */ }
+];
+var MEASURER_ANNOTATION_ITEMS = [
+ {
+ label: "toolbarAnnotationsQuickDatePriceRange",
+ icon: "measurer-drawing",
+ value: "quick-date-price-range" /* QuickDatePriceRange */
+ },
+ { label: "toolbarAnnotationsDateRange", icon: "date-range-drawing", value: "date-range" /* DateRange */ },
+ { label: "toolbarAnnotationsPriceRange", icon: "price-range-drawing", value: "price-range" /* PriceRange */ },
+ {
+ label: "toolbarAnnotationsDatePriceRange",
+ icon: "date-price-range-drawing",
+ value: "date-price-range" /* DatePriceRange */
+ }
+];
+var LINE_STROKE_WIDTH_ITEMS = [
+ { strokeWidth: 1, label: "1", value: 1 },
+ { strokeWidth: 2, label: "2", value: 2 },
+ { strokeWidth: 3, label: "3", value: 3 },
+ { strokeWidth: 4, label: "4", value: 4 },
+ { strokeWidth: 8, label: "8", value: 8 }
+];
+var LINE_STYLE_TYPE_ITEMS = [
+ { icon: "line-style-solid", altText: "iconAltTextLineStyleSolid", value: "solid" },
+ { icon: "line-style-dashed", altText: "iconAltTextLineStyleDashed", value: "dashed" },
+ { icon: "line-style-dotted", altText: "iconAltTextLineStyleDotted", value: "dotted" }
+];
+var TEXT_SIZE_ITEMS = [
+ { label: "10", value: 10 },
+ { label: "12", value: 12 },
+ { label: "14", value: 14 },
+ { label: "16", value: 16 },
+ { label: "18", value: 18 },
+ { label: "22", value: 22 },
+ { label: "28", value: 28 },
+ { label: "36", value: 36 },
+ { label: "46", value: 46 }
+];
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationOptionsToolbar.ts
+var { Color: Color4, FloatingToolbar, Menu, PropertiesArray, ToolbarButtonProperties, ToolbarButtonWidget, Property: Property28 } = import_ag_charts_community38._ModuleSupport;
+var AnnotationOptionsButtonProperties = class extends ToolbarButtonProperties {
+ constructor() {
+ super(...arguments);
+ this.checkedOverrides = new ToolbarButtonProperties();
+ }
+};
+__decorateClass([
+ Property28
+], AnnotationOptionsButtonProperties.prototype, "value", 2);
+__decorateClass([
+ Property28
+], AnnotationOptionsButtonProperties.prototype, "checkedOverrides", 2);
+__decorateClass([
+ Property28
+], AnnotationOptionsButtonProperties.prototype, "color", 2);
+__decorateClass([
+ Property28
+], AnnotationOptionsButtonProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property28
+], AnnotationOptionsButtonProperties.prototype, "isMultiColor", 2);
+var AnnotationOptionsButtonWidget = class extends ToolbarButtonWidget {
+ update(options) {
+ super.update(options);
+ if (options.value === "line-stroke-width" /* LineStrokeWidth */) {
+ this.updateLineStrokeWidth(options);
+ }
+ if (options.value === "fill-color" /* FillColor */ || options.value === "line-color" /* LineColor */ || options.value === "text-color" /* TextColor */) {
+ this.updateFillColor(options);
+ }
+ }
+ updateFillColor(options) {
+ const element = this.getElement();
+ element.classList.add("ag-charts-annotations__color-picker-button");
+ element.classList.toggle("ag-charts-annotations__color-picker-button--multi-color", options.isMultiColor);
+ element.style.setProperty("--color", options.color ?? null);
+ }
+ updateLineStrokeWidth(options) {
+ const element = this.getElement();
+ element.classList.add("ag-charts-annotations__stroke-width-button");
+ element.style.setProperty("--stroke-width", `${options.strokeWidth}px`);
+ }
+};
+var FloatingAnnotationOptionsToolbar = class extends FloatingToolbar {
+ createButtonWidget() {
+ return new AnnotationOptionsButtonWidget(this.localeManager);
+ }
+};
+var AnnotationOptionsToolbar = class extends import_ag_charts_community38._ModuleSupport.BaseProperties {
+ constructor(ctx, getActiveDatum) {
+ super();
+ this.ctx = ctx;
+ this.getActiveDatum = getActiveDatum;
+ this.enabled = true;
+ this.buttons = new PropertiesArray(AnnotationOptionsButtonProperties);
+ this.cleanup = new import_ag_charts_core26.CleanupRegistry();
+ this.events = new import_ag_charts_core26.EventEmitter();
+ this.visibleButtons = [];
+ this.toolbar = new FloatingAnnotationOptionsToolbar(
+ this.ctx,
+ "ariaLabelAnnotationOptionsToolbar",
+ "annotation-options"
+ );
+ this.colorPicker = new ColorPicker(this.ctx);
+ this.textSizeMenu = new Menu(this.ctx, "text-size");
+ this.lineStyleTypeMenu = new Menu(this.ctx, "annotations-line-style-type");
+ this.lineStrokeWidthMenu = new Menu(this.ctx, "annotations-line-stroke-width");
+ this.cleanup.register(
+ this.toolbar.addToolbarListener("button-pressed", this.onButtonPress.bind(this)),
+ this.toolbar.addToolbarListener("toolbar-moved", this.onToolbarMoved.bind(this)),
+ ctx.widgets.seriesWidget.addListener("drag-start", this.onDragStart.bind(this)),
+ ctx.widgets.seriesWidget.addListener("drag-end", this.onDragEnd.bind(this)),
+ () => {
+ this.colorPicker.destroy();
+ this.toolbar.destroy();
+ }
+ );
+ }
+ onDragStart() {
+ this.toolbar.ignorePointerEvents();
+ }
+ onDragEnd() {
+ this.toolbar.capturePointerEvents();
+ }
+ destroy() {
+ this.cleanup.flush();
+ }
+ show() {
+ if (!this.enabled)
+ return;
+ this.toolbar.show();
+ }
+ hide() {
+ this.toolbar.hide();
+ }
+ updateButtons(datum) {
+ if (!this.enabled)
+ return;
+ const visible = {
+ ["line-style-type" /* LineStyleType */]: hasLineStyle(datum),
+ ["line-stroke-width" /* LineStrokeWidth */]: hasLineStyle(datum),
+ ["line-color" /* LineColor */]: hasLineColor(datum),
+ ["text-color" /* TextColor */]: hasTextColor(datum),
+ ["fill-color" /* FillColor */]: hasFillColor(datum),
+ ["text-size" /* TextSize */]: hasFontSize(datum),
+ ["settings" /* Settings */]: hasLineText(datum),
+ ["lock" /* Lock */]: true,
+ ["delete" /* Delete */]: true
+ };
+ this.visibleButtons = this.buttons.filter((button) => visible[button.value]);
+ this.toolbar.clearButtons();
+ this.toolbar.updateButtons(this.visibleButtons);
+ this.refreshButtons(datum);
+ }
+ setAnchorScene(scene) {
+ if (this.toolbar.hasBeenDragged())
+ return;
+ this.toolbar.setAnchor(scene.getAnchor());
+ }
+ hideOverlays() {
+ this.toolbar.clearActiveButton();
+ this.colorPicker.hide({ lastFocus: null });
+ this.textSizeMenu.hide();
+ this.lineStyleTypeMenu.hide();
+ this.lineStrokeWidthMenu.hide();
+ this.events.emit("hid-overlays", null);
+ }
+ clearActiveButton() {
+ this.toolbar.clearActiveButton();
+ }
+ updateColors(datum) {
+ this.updateColorPickerColor(
+ "line-color" /* LineColor */,
+ datum.getDefaultColor("line-color" /* LineColor */),
+ datum.getDefaultOpacity("line-color" /* LineColor */),
+ "isMultiColor" in datum && datum?.isMultiColor
+ );
+ this.updateColorPickerColor(
+ "fill-color" /* FillColor */,
+ datum.getDefaultColor("fill-color" /* FillColor */),
+ datum.getDefaultOpacity("fill-color" /* FillColor */),
+ "isMultiColor" in datum && datum?.isMultiColor
+ );
+ this.updateColorPickerColor(
+ "text-color" /* TextColor */,
+ datum.getDefaultColor("text-color" /* TextColor */),
+ datum.getDefaultOpacity("text-color" /* TextColor */),
+ "isMultiColor" in datum && datum?.isMultiColor
+ );
+ }
+ updateColorPickerColor(colorPickerType, color6, opacity, isMultiColor) {
+ if (color6 != null && opacity != null) {
+ const { r, g, b } = Color4.fromString(color6);
+ color6 = Color4.fromArray([r, g, b, opacity]).toHexString();
+ }
+ this.updateButtonByValue(colorPickerType, { color: color6, isMultiColor });
+ }
+ updateFontSize(fontSize) {
+ this.updateButtonByValue("text-size" /* TextSize */, {
+ label: fontSize == null ? void 0 : String(fontSize)
+ });
+ }
+ updateLineStyleType(item) {
+ this.updateButtonByValue("line-style-type" /* LineStyleType */, {
+ icon: item.icon
+ });
+ }
+ updateStrokeWidth(item) {
+ this.updateButtonByValue("line-stroke-width" /* LineStrokeWidth */, {
+ label: item.label,
+ strokeWidth: item.value
+ });
+ }
+ onButtonPress({
+ event,
+ button,
+ buttonWidget
+ }) {
+ const datum = this.getActiveDatum();
+ if (!datum)
+ return;
+ this.hideOverlays();
+ switch (button.value) {
+ case "line-style-type" /* LineStyleType */: {
+ const lineStyle = hasLineStyle(datum) ? getLineStyle(datum.lineDash, datum.lineStyle) : void 0;
+ this.lineStyleTypeMenu.show(buttonWidget, {
+ items: LINE_STYLE_TYPE_ITEMS,
+ ariaLabel: this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),
+ value: lineStyle,
+ onPress: (item) => this.onLineStyleTypeMenuPress(item, datum),
+ class: "ag-charts-annotations__line-style-type-menu"
+ });
+ break;
+ }
+ case "line-stroke-width" /* LineStrokeWidth */: {
+ const strokeWidth = hasLineStyle(datum) ? datum.strokeWidth : void 0;
+ this.lineStrokeWidthMenu.show(buttonWidget, {
+ items: LINE_STROKE_WIDTH_ITEMS,
+ ariaLabel: this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),
+ value: strokeWidth,
+ onPress: (item) => this.onLineStrokeWidthMenuPress(item, datum),
+ class: "ag-charts-annotations__line-stroke-width-menu"
+ });
+ break;
+ }
+ case "line-color" /* LineColor */:
+ case "fill-color" /* FillColor */:
+ case "text-color" /* TextColor */: {
+ this.toolbar.toggleActiveButtonByIndex(button.index);
+ this.colorPicker.show({
+ color: datum?.getDefaultColor(button.value),
+ opacity: datum?.getDefaultOpacity(button.value),
+ sourceEvent: event.sourceEvent,
+ hasMultiColorOption: "isMultiColor" in datum,
+ isMultiColor: "isMultiColor" in datum && datum?.isMultiColor,
+ onChange: datum == null ? void 0 : this.onColorPickerChange.bind(this, button.value, datum),
+ onChangeHide: ((type) => {
+ this.events.emit("saved-color", {
+ type: datum.type,
+ colorPickerType: button.value,
+ color: datum.getDefaultColor(type)
+ });
+ }).bind(this, button.value)
+ });
+ break;
+ }
+ case "text-size" /* TextSize */: {
+ const fontSize = isTextType(datum) ? datum.fontSize : void 0;
+ this.textSizeMenu.show(buttonWidget, {
+ items: TEXT_SIZE_ITEMS,
+ ariaLabel: this.ctx.localeManager.t("toolbarAnnotationsTextSize"),
+ value: fontSize,
+ onPress: (item) => this.onTextSizeMenuPress(item, datum),
+ class: "ag-charts-annotations__text-size-menu"
+ });
+ break;
+ }
+ case "delete" /* Delete */: {
+ this.events.emit("pressed-delete", null);
+ break;
+ }
+ case "lock" /* Lock */: {
+ datum.locked = !datum.locked;
+ this.refreshButtons(datum);
+ this.events.emit("pressed-lock", { locked: datum.locked });
+ break;
+ }
+ case "settings" /* Settings */: {
+ this.toolbar.toggleActiveButtonByIndex(button.index);
+ this.events.emit("pressed-settings", event);
+ break;
+ }
+ }
+ }
+ onToolbarMoved(event) {
+ const { buttonBounds, popoverBounds } = event;
+ const colorPickerAnchor = { x: popoverBounds.x, y: popoverBounds.y + popoverBounds.height + 4 };
+ const colorPickerFallbackAnchor = { y: popoverBounds.y - 4 };
+ this.colorPicker.setAnchor(colorPickerAnchor, colorPickerFallbackAnchor);
+ for (const [index, bounds] of buttonBounds.entries()) {
+ const button = this.visibleButtons.at(index);
+ if (!button)
+ continue;
+ const anchor = { x: bounds.x, y: bounds.y + bounds.height - 1 };
+ const fallbackAnchor = { y: bounds.y };
+ switch (button.value) {
+ case "line-stroke-width" /* LineStrokeWidth */:
+ this.lineStrokeWidthMenu.setAnchor(anchor, fallbackAnchor);
+ break;
+ case "line-style-type" /* LineStyleType */:
+ this.lineStyleTypeMenu.setAnchor(anchor, fallbackAnchor);
+ break;
+ case "text-size" /* TextSize */:
+ this.textSizeMenu.setAnchor(anchor, fallbackAnchor);
+ break;
+ }
+ }
+ }
+ onColorPickerChange(colorPickerType, datum, colorOpacity, color6, opacity, isMultiColor) {
+ this.events.emit("updated-color", {
+ type: datum.type,
+ colorPickerType,
+ colorOpacity,
+ color: color6,
+ opacity,
+ isMultiColor
+ });
+ this.updateColorPickerColor(colorPickerType, colorOpacity, opacity, isMultiColor);
+ }
+ onTextSizeMenuPress(item, datum) {
+ if (!hasFontSize(datum))
+ return;
+ const fontSize = item.value;
+ this.events.emit("updated-font-size", { type: datum.type, fontSize });
+ this.textSizeMenu.hide();
+ this.updateFontSize(fontSize);
+ }
+ onLineStyleTypeMenuPress(item, datum) {
+ if (!hasLineStyle(datum))
+ return;
+ const type = item.value;
+ this.events.emit("updated-line-style", { type: datum.type, lineStyleType: type });
+ this.lineStyleTypeMenu.hide();
+ this.updateLineStyleType(item);
+ }
+ onLineStrokeWidthMenuPress(item, datum) {
+ if (!hasLineStyle(datum)) {
+ return;
+ }
+ const strokeWidth = item.value;
+ this.events.emit("updated-line-width", { type: datum.type, strokeWidth });
+ this.lineStrokeWidthMenu.hide();
+ this.updateStrokeWidth(item);
+ }
+ refreshButtons(datum) {
+ const locked = datum.locked ?? false;
+ for (const [index, button] of this.visibleButtons.entries()) {
+ if (!button)
+ continue;
+ if (button.value === "lock" /* Lock */) {
+ this.toolbar.toggleSwitchCheckedByIndex(index, locked);
+ this.updateButtonByIndex(index, locked ? button.checkedOverrides.toJson() : button.toJson());
+ } else {
+ this.toolbar.toggleButtonEnabledByIndex(index, !locked);
+ }
+ }
+ if (hasFontSize(datum))
+ this.updateFontSize(datum.fontSize);
+ this.updateColors(datum);
+ this.updateLineStyles(datum);
+ }
+ updateLineStyles(datum) {
+ if (!hasLineStyle(datum))
+ return;
+ const strokeWidth = datum.strokeWidth ?? 1;
+ const lineStyleType = getLineStyle(datum.lineDash, datum.lineStyle);
+ this.updateStrokeWidth({
+ strokeWidth,
+ value: strokeWidth,
+ label: String(strokeWidth)
+ });
+ this.updateLineStyleType(
+ LINE_STYLE_TYPE_ITEMS.find((item) => item.value === lineStyleType) ?? LINE_STYLE_TYPE_ITEMS[0]
+ );
+ }
+ updateButtonByValue(value, change) {
+ const index = this.visibleButtons.findIndex((button) => button.value === value);
+ if (index === -1)
+ return;
+ this.updateButtonByIndex(index, change);
+ }
+ updateButtonByIndex(index, change) {
+ const button = this.visibleButtons.at(index);
+ if (!button)
+ return;
+ this.toolbar.updateButtonByIndex(index, { ...button.toJson(), ...change, value: change.value ?? button.value });
+ }
+};
+__decorateClass([
+ Property28
+], AnnotationOptionsToolbar.prototype, "enabled", 2);
+__decorateClass([
+ Property28
+], AnnotationOptionsToolbar.prototype, "buttons", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/states/dragState.ts
+var import_ag_charts_community39 = require("ag-charts-community");
+var { StateMachine, StateMachineProperty, Vec2: Vec22, Debug } = import_ag_charts_community39._ModuleSupport;
+var DragStateMachine = class extends StateMachine {
+ constructor(ctx) {
+ const actionKeyChange = ({ context }) => {
+ this.node?.drag(this.datum, this.offset, context, this.snapping);
+ ctx.update();
+ };
+ super("idle", {
+ idle: {
+ dragStart: {
+ target: "dragging",
+ action: ({ offset, context }) => {
+ this.hasMoved = false;
+ this.dragStart = offset;
+ this.offset = offset;
+ this.node?.dragStart(this.datum, offset, context);
+ }
+ }
+ },
+ dragging: {
+ keyDown: actionKeyChange,
+ keyUp: actionKeyChange,
+ drag: ({ offset, context }) => {
+ this.hasMoved = Vec22.lengthSquared(Vec22.sub(offset, this.dragStart)) > 0;
+ this.offset = offset;
+ this.node?.drag(this.datum, offset, context, this.snapping);
+ ctx.update();
+ },
+ dragEnd: {
+ target: StateMachine.parent,
+ action: () => {
+ this.node?.stopDragging();
+ if (this.hasMoved)
+ ctx.recordAction("Move annotation");
+ ctx.update();
+ }
+ }
+ }
+ });
+ this.debug = Debug.create(true, "annotations");
+ this.hasMoved = false;
+ this.snapping = false;
+ }
+};
+__decorateClass([
+ StateMachineProperty()
+], DragStateMachine.prototype, "snapping", 2);
+__decorateClass([
+ StateMachineProperty()
+], DragStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty()
+], DragStateMachine.prototype, "node", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-down/arrowDownProperties.ts
+var import_ag_charts_community40 = require("ag-charts-community");
+var import_ag_charts_core27 = require("ag-charts-core");
+var { Property: Property29 } = import_ag_charts_community40._ModuleSupport;
+var ArrowDownProperties = class extends ShapePointProperties {
+ constructor() {
+ super(...arguments);
+ this.type = "arrow-down" /* ArrowDown */;
+ }
+ static is(value) {
+ return (0, import_ag_charts_core27.isObject)(value) && value.type === "arrow-down" /* ArrowDown */;
+ }
+};
+__decorateClass([
+ Property29
+], ArrowDownProperties.prototype, "type", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-down/arrowDownScene.ts
+var import_ag_charts_community47 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-up/arrowUpScene.ts
+var import_ag_charts_community46 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/annotationScene.ts
+var import_ag_charts_community43 = require("ag-charts-community");
+var import_ag_charts_core28 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/handle.ts
+var import_ag_charts_community42 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/annotationShape.ts
+var import_ag_charts_community41 = require("ag-charts-community");
+var AnnotationShape = class extends import_ag_charts_community41._ModuleSupport.Marker {
+ // Use exact method for this, rather than the Marker's high performance approximation.
+ isPointInPath(x, y) {
+ this.updatePathIfDirty();
+ return this.path.closedPath && this.path.isPointInPath(x, y);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/handle.ts
+var _Handle = class _Handle extends import_ag_charts_community42._ModuleSupport.Group {
+ constructor() {
+ super(...arguments);
+ this.active = false;
+ this.locked = false;
+ this.visible = false;
+ this.zIndex = 1;
+ }
+ drag(target) {
+ const { handle: handle2, locked } = this;
+ if (locked) {
+ return { point: { x: handle2.x, y: handle2.y }, offset: { x: 0, y: 0 } };
+ }
+ return {
+ point: target,
+ offset: { x: target.x - handle2.x, y: target.y - handle2.y }
+ };
+ }
+ toggleActive(active) {
+ this.active = active;
+ if (!active) {
+ this.handle.strokeWidth = _Handle.INACTIVE_STROKE_WIDTH;
+ }
+ }
+ toggleHovered(hovered) {
+ this.glow.visible = !this.locked && hovered;
+ this.glow.dirtyPath = true;
+ }
+ toggleDragging(dragging) {
+ if (this.locked)
+ return;
+ this.handle.visible = !dragging;
+ this.glow.visible = this.glow.visible && !dragging;
+ this.handle.dirtyPath = true;
+ this.glow.dirtyPath = true;
+ }
+ toggleLocked(locked) {
+ this.locked = locked;
+ }
+ getCursor() {
+ return void 0;
+ }
+ containsPoint(x, y) {
+ return this.handle.containsPoint(x, y);
+ }
+};
+_Handle.INACTIVE_STROKE_WIDTH = 2;
+var Handle2 = _Handle;
+var _InvariantHandle = class _InvariantHandle extends Handle2 {
+ constructor() {
+ super();
+ this.handle = new AnnotationShape({ shape: "circle" });
+ this.glow = new AnnotationShape({ shape: "circle" });
+ this.append([this.handle]);
+ this.handle.size = _InvariantHandle.HANDLE_SIZE;
+ this.handle.strokeWidth = Handle2.INACTIVE_STROKE_WIDTH;
+ this.handle.zIndex = 2;
+ }
+ update(styles) {
+ this.handle.setProperties({ ...styles, strokeWidth: Handle2.INACTIVE_STROKE_WIDTH });
+ }
+ drag(target) {
+ return { point: target, offset: { x: 0, y: 0 } };
+ }
+};
+_InvariantHandle.HANDLE_SIZE = 7;
+_InvariantHandle.GLOW_SIZE = 9;
+var InvariantHandle = _InvariantHandle;
+var _UnivariantHandle = class _UnivariantHandle extends Handle2 {
+ constructor() {
+ super();
+ this.handle = new import_ag_charts_community42._ModuleSupport.Rect();
+ this.glow = new import_ag_charts_community42._ModuleSupport.Rect();
+ this.gradient = "horizontal";
+ this.append([this.glow, this.handle]);
+ this.handle.cornerRadius = _UnivariantHandle.CORNER_RADIUS;
+ this.handle.width = _UnivariantHandle.HANDLE_SIZE;
+ this.handle.height = _UnivariantHandle.HANDLE_SIZE;
+ this.handle.strokeWidth = Handle2.INACTIVE_STROKE_WIDTH;
+ this.handle.zIndex = 2;
+ this.glow.cornerRadius = _UnivariantHandle.CORNER_RADIUS;
+ this.glow.width = _UnivariantHandle.GLOW_SIZE;
+ this.glow.height = _UnivariantHandle.GLOW_SIZE;
+ this.glow.strokeWidth = 0;
+ this.glow.fillOpacity = 0.2;
+ this.glow.zIndex = 1;
+ this.glow.visible = false;
+ }
+ toggleLocked(locked) {
+ super.toggleLocked(locked);
+ if (locked) {
+ const offset = (_UnivariantHandle.HANDLE_SIZE - InvariantHandle.HANDLE_SIZE) / 2;
+ this.handle.cornerRadius = 1;
+ this.handle.fill = this.handle.stroke;
+ this.handle.strokeWidth = 0;
+ this.handle.x += offset;
+ this.handle.y += offset;
+ this.handle.width = InvariantHandle.HANDLE_SIZE;
+ this.handle.height = InvariantHandle.HANDLE_SIZE;
+ this.glow.width = InvariantHandle.GLOW_SIZE;
+ this.glow.height = InvariantHandle.GLOW_SIZE;
+ } else {
+ this.handle.cornerRadius = _UnivariantHandle.CORNER_RADIUS;
+ this.handle.width = _UnivariantHandle.HANDLE_SIZE;
+ this.handle.height = _UnivariantHandle.HANDLE_SIZE;
+ this.glow.width = _UnivariantHandle.GLOW_SIZE;
+ this.glow.height = _UnivariantHandle.GLOW_SIZE;
+ if (this.cachedStyles) {
+ this.handle.setProperties(this.cachedStyles);
+ }
+ }
+ }
+ update(styles) {
+ this.cachedStyles = { ...styles };
+ if (!this.active) {
+ delete styles.strokeWidth;
+ }
+ if (this.locked) {
+ delete styles.fill;
+ delete styles.strokeWidth;
+ const offset = (_UnivariantHandle.HANDLE_SIZE - InvariantHandle.HANDLE_SIZE) / 2;
+ styles.x -= offset;
+ styles.y -= offset;
+ this.cachedStyles.x -= offset;
+ this.cachedStyles.y -= offset;
+ }
+ this.handle.setProperties(styles);
+ this.glow.setProperties({
+ ...styles,
+ x: (styles.x ?? this.glow.x) - 2,
+ y: (styles.y ?? this.glow.y) - 2,
+ strokeWidth: 0,
+ fill: styles.stroke
+ });
+ }
+ drag(target) {
+ if (this.locked) {
+ return { point: target, offset: { x: 0, y: 0 } };
+ }
+ if (this.gradient === "vertical") {
+ return {
+ point: { x: target.x, y: this.handle.y },
+ offset: { x: target.x - this.handle.x, y: 0 }
+ };
+ }
+ return {
+ point: { x: this.handle.x, y: target.y },
+ offset: { x: 0, y: target.y - this.handle.y }
+ };
+ }
+ getCursor() {
+ if (this.locked)
+ return;
+ return this.gradient === "vertical" ? "col-resize" : "row-resize";
+ }
+};
+_UnivariantHandle.HANDLE_SIZE = 12;
+_UnivariantHandle.GLOW_SIZE = 16;
+_UnivariantHandle.CORNER_RADIUS = 4;
+var UnivariantHandle = _UnivariantHandle;
+var _DivariantHandle = class _DivariantHandle extends Handle2 {
+ constructor() {
+ super();
+ this.handle = new AnnotationShape({ shape: "circle" });
+ this.glow = new AnnotationShape({ shape: "circle" });
+ this.append([this.glow, this.handle]);
+ this.handle.size = _DivariantHandle.HANDLE_SIZE;
+ this.handle.strokeWidth = Handle2.INACTIVE_STROKE_WIDTH;
+ this.handle.zIndex = 2;
+ this.glow.size = _DivariantHandle.GLOW_SIZE;
+ this.glow.strokeWidth = 0;
+ this.glow.fillOpacity = 0.2;
+ this.glow.zIndex = 1;
+ this.glow.visible = false;
+ }
+ toggleLocked(locked) {
+ super.toggleLocked(locked);
+ if (locked) {
+ this.handle.fill = this.handle.stroke;
+ this.handle.strokeWidth = 0;
+ this.handle.size = InvariantHandle.HANDLE_SIZE;
+ this.glow.size = InvariantHandle.GLOW_SIZE;
+ } else {
+ this.handle.size = _DivariantHandle.HANDLE_SIZE;
+ this.glow.size = _DivariantHandle.GLOW_SIZE;
+ if (this.cachedStyles) {
+ this.handle.setProperties(this.cachedStyles);
+ }
+ }
+ }
+ update(styles) {
+ this.cachedStyles = { ...styles };
+ if (!this.active) {
+ delete styles.strokeWidth;
+ }
+ if (this.locked) {
+ delete styles.fill;
+ delete styles.strokeWidth;
+ }
+ this.handle.setProperties(styles);
+ this.glow.setProperties({ ...styles, strokeWidth: 0, fill: styles.stroke });
+ }
+ getCursor() {
+ return "pointer";
+ }
+};
+_DivariantHandle.HANDLE_SIZE = 11;
+_DivariantHandle.GLOW_SIZE = 17;
+var DivariantHandle = _DivariantHandle;
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/annotationScene.ts
+var { ZIndexMap: ZIndexMap2 } = import_ag_charts_community43._ModuleSupport;
+var AnnotationScene = class extends import_ag_charts_community43._ModuleSupport.Group {
+ constructor() {
+ super(...arguments);
+ this.name = "AnnotationScene";
+ this.zIndex = ZIndexMap2.CHART_ANNOTATION;
+ }
+ static isCheck(value, type) {
+ return (0, import_ag_charts_core28.isObject)(value) && Object.hasOwn(value, "type") && value.type === type;
+ }
+ toggleHovered(hovered, active, readOnly) {
+ if (readOnly === true)
+ return;
+ this.toggleHandles(hovered || active);
+ }
+ computeBBoxWithoutHandles() {
+ return import_ag_charts_community43._ModuleSupport.Transformable.toCanvas(
+ this,
+ import_ag_charts_community43._ModuleSupport.Group.computeChildrenBBox(this.excludeChildren({ instance: Handle2 }))
+ );
+ }
+ updateNode(constructor, node, isConfigured) {
+ if (!isConfigured && node) {
+ node.remove();
+ return;
+ }
+ if (isConfigured && node == null) {
+ node = new constructor();
+ this.appendChild(node);
+ }
+ return node;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/pointScene.ts
+var import_ag_charts_community45 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/coords.ts
+var import_ag_charts_community44 = require("ag-charts-community");
+var import_ag_charts_core29 = require("ag-charts-core");
+var { ContinuousScale: ContinuousScale2, Vec2: Vec23, toRadians: toRadians3 } = import_ag_charts_community44._ModuleSupport;
+function snapPoint(offset, context, snapping = false, origin, angleStep = 1) {
+ if (!snapping)
+ return invertCoords(offset, context);
+ const center = origin ? convertPoint(origin, context) : Vec23.origin();
+ return invertCoords(snapToAngle(offset, center, angleStep), context);
+}
+function snapToAngle(vector, center, step) {
+ const radial = Vec23.sub(vector, center);
+ const stepRadians = toRadians3(step);
+ const theta = Math.round(Vec23.angle(radial) / stepRadians) * stepRadians;
+ return Vec23.rotate(radial, theta, center);
+}
+function getDragStartState(points, context) {
+ const dragState = {};
+ for (const [name, point] of (0, import_ag_charts_core29.entries)(points)) {
+ dragState[name] = convertPoint(point, context);
+ }
+ return dragState;
+}
+function translate(vectors, translation, context, options = {
+ overflowContinuous: 0,
+ translateVectors: void 0,
+ invertYVectors: void 0,
+ snap: void 0
+}) {
+ const { xAxis, yAxis } = context;
+ const vectorNames = Object.keys(vectors);
+ const overflowsX = [];
+ const overflowsY = [];
+ const translateVectors = new Set(options.translateVectors ?? vectorNames);
+ const invertYVectors = new Set(options.invertYVectors ?? []);
+ const movingVectors = /* @__PURE__ */ new Set([...translateVectors, ...invertYVectors]);
+ const invertYTranslation = Vec23.multiply(translation, Vec23.from(1, -1));
+ for (const name of vectorNames) {
+ if (movingVectors.has(name)) {
+ vectors[name] = Vec23.add(vectors[name], invertYVectors.has(name) ? invertYTranslation : translation);
+ if (options.snap) {
+ vectors[name] = snapToAngle(vectors[name], options.snap.vectors[name], options.snap.angle);
+ }
+ }
+ overflowsX.push(xAxis.getRangeOverflow(vectors[name].x));
+ overflowsY.push(yAxis.getRangeOverflow(vectors[name].y));
+ }
+ const sortNumbersAbs = (a, b) => Math.abs(a) - Math.abs(b);
+ const overflowDirection = (scale, directionTranslation, overflows) => {
+ if (options.overflowContinuous === 0 || !ContinuousScale2.is(scale)) {
+ return overflows.toSorted(sortNumbersAbs).at(-1) ?? 0;
+ }
+ if (vectorNames.length === movingVectors.size) {
+ return overflows.toSorted(sortNumbersAbs).at(-options.overflowContinuous - 1) ?? 0;
+ }
+ if (overflows.filter((value) => value !== 0).length <= options.overflowContinuous) {
+ return 0;
+ }
+ const newTranslatedOverflows = overflows.filter(
+ (value, index) => value !== 0 && Math.abs(value) <= Math.abs(directionTranslation) && movingVectors.has(vectorNames[index])
+ );
+ return newTranslatedOverflows.toSorted(sortNumbersAbs).at(-1) ?? 0;
+ };
+ const overflow = Vec23.from(
+ overflowDirection(xAxis.scale, translation.x, overflowsX),
+ overflowDirection(yAxis.scale, translation.y, overflowsY)
+ );
+ if (!Vec23.equal(overflow, Vec23.origin())) {
+ for (const name of vectorNames) {
+ if (!movingVectors.has(name))
+ continue;
+ vectors[name] = Vec23.round(Vec23.sub(vectors[name], overflow), 4);
+ }
+ }
+ const result = {};
+ for (const name of vectorNames) {
+ result[name] = invertCoords(vectors[name], context);
+ }
+ return result;
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/pointScene.ts
+var { Vec2: Vec24 } = import_ag_charts_community45._ModuleSupport;
+var PointScene = class extends AnnotationScene {
+ constructor() {
+ super(...arguments);
+ this.handle = new DivariantHandle();
+ this.anchor = {
+ x: 0,
+ y: 0,
+ position: "above"
+ };
+ }
+ update(datum, context) {
+ const coords = convertPoint(datum, context);
+ this.updateHandle(datum, coords);
+ this.anchor = this.updateAnchor(datum, coords, context);
+ }
+ dragStart(datum, target, context) {
+ this.dragState = {
+ offset: target,
+ ...getDragStartState({ handle: datum }, context)
+ };
+ }
+ drag(datum, target, context) {
+ const { dragState } = this;
+ if (!datum.isWriteable() || !dragState)
+ return;
+ const { point } = translate({ point: dragState.handle }, Vec24.sub(target, dragState.offset), context);
+ datum.x = point.x;
+ datum.y = point.y;
+ }
+ translate(datum, translation, context) {
+ if (!datum.isWriteable())
+ return;
+ const { point } = translate({ point: convertPoint(datum, context) }, translation, context);
+ datum.x = point.x;
+ datum.y = point.y;
+ }
+ toggleHandles(show) {
+ this.handle.visible = Boolean(show);
+ this.handle.toggleHovered(this.activeHandle === "handle");
+ }
+ toggleActive(active) {
+ this.toggleHandles(active);
+ this.handle.toggleActive(active);
+ }
+ stopDragging() {
+ this.handle.toggleDragging(false);
+ }
+ copy(datum, copiedDatum, context) {
+ const coords = convertPoint(datum, context);
+ const point = invertCoords({ x: coords.x - 30, y: coords.y - 30 }, context);
+ copiedDatum.x = point.x;
+ copiedDatum.y = point.y;
+ return copiedDatum;
+ }
+ getAnchor() {
+ return this.anchor;
+ }
+ getCursor() {
+ return "pointer";
+ }
+ containsPoint(x, y) {
+ const { handle: handle2 } = this;
+ this.activeHandle = void 0;
+ if (handle2.containsPoint(x, y)) {
+ this.activeHandle = "handle";
+ return true;
+ }
+ return false;
+ }
+ getNodeAtCoords(x, y) {
+ if (this.handle.containsPoint(x, y))
+ return "handle";
+ }
+ updateHandle(datum, point, bbox) {
+ const { x, y } = this.getHandleCoords(datum, point, bbox);
+ const styles = this.getHandleStyles(datum);
+ this.handle.update({ ...styles, x, y });
+ this.handle.toggleLocked(datum.locked ?? false);
+ }
+ updateAnchor(datum, point, context) {
+ const coords = this.getHandleCoords(datum, point);
+ return {
+ x: coords.x + context.seriesRect.x,
+ y: coords.y + context.seriesRect.y,
+ position: this.anchor.position
+ };
+ }
+ getHandleCoords(_datum, point, _bbox) {
+ return {
+ x: point.x,
+ y: point.y
+ };
+ }
+ getHandleStyles(datum) {
+ return {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke,
+ strokeOpacity: datum.handle.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/shapePointScene.ts
+var ShapePointScene = class extends PointScene {
+ constructor() {
+ super();
+ this.append([this.handle]);
+ }
+ update(datum, context) {
+ super.update(datum, context);
+ const coords = convertPoint(datum, context);
+ this.updateShape(datum, coords);
+ }
+ updateShape(datum, point) {
+ this.updateShapeStyles(datum);
+ this.updateShapePath(datum, point);
+ }
+ updateShapeStyles(datum) {
+ const { shape } = this;
+ shape.fill = datum.fill;
+ shape.fillOpacity = datum.fillOpacity ?? 1;
+ }
+ updateShapePath(datum, point) {
+ const { shape } = this;
+ shape.x = point.x;
+ shape.y = point.y;
+ shape.size = datum.size;
+ }
+ containsPoint(x, y) {
+ return super.containsPoint(x, y) || this.shape.containsPoint(x, y);
+ }
+ getNodeAtCoords(x, y) {
+ if (this.shape.containsPoint(x, y))
+ return "shape";
+ return super.getNodeAtCoords(x, y);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-up/arrowUpScene.ts
+var arrowUpPoints = [
+ [0.5, 0],
+ [1, 0.5],
+ [0.75, 0.5],
+ [0.75, 1],
+ [0.25, 1],
+ [0.25, 0.5],
+ [0, 0.5]
+];
+function arrowUp(params) {
+ import_ag_charts_community46._ModuleSupport.drawMarkerUnitPolygon(params, arrowUpPoints);
+}
+arrowUp.anchor = { x: 0.5, y: 0 };
+var ArrowUpScene = class extends ShapePointScene {
+ constructor() {
+ super();
+ this.type = "arrow-up" /* ArrowUp */;
+ this.shape = new AnnotationShape({ shape: arrowUp });
+ this.append([this.shape]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "arrow-up" /* ArrowUp */);
+ }
+ getHandleCoords(datum, point) {
+ const halfSize = DivariantHandle.HANDLE_SIZE / 2;
+ const handleCoords = super.getHandleCoords(datum, point);
+ handleCoords.y -= halfSize;
+ return handleCoords;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-down/arrowDownScene.ts
+var arrowDownPoints = arrowUpPoints.map(([x, y]) => [x, 1 - y]);
+function arrowDown(params) {
+ import_ag_charts_community47._ModuleSupport.drawMarkerUnitPolygon(params, arrowDownPoints);
+}
+arrowDown.anchor = { x: 0.5, y: 1 };
+var ArrowDownScene = class extends ShapePointScene {
+ constructor() {
+ super();
+ this.type = "arrow-down" /* ArrowDown */;
+ this.shape = new AnnotationShape({ shape: arrowDown });
+ this.append([this.shape]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "arrow-down" /* ArrowDown */);
+ }
+ updateAnchor(datum, point, context) {
+ const anchor = super.updateAnchor(datum, point, context);
+ anchor.y -= datum.size;
+ return anchor;
+ }
+ getHandleCoords(datum, point) {
+ const halfSize = DivariantHandle.HANDLE_SIZE / 2;
+ const handleCoords = super.getHandleCoords(datum, point);
+ handleCoords.y += halfSize;
+ return handleCoords;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/states/pointState.ts
+var import_ag_charts_community48 = require("ag-charts-community");
+var { StateMachine: StateMachine2, StateMachineProperty: StateMachineProperty2, Debug: Debug2 } = import_ag_charts_community48._ModuleSupport;
+var PointStateMachine = class extends StateMachine2 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = this.createDatum();
+ datum.set({ x: point.x, y: point.y });
+ ctx.create(datum);
+ };
+ const actionFirstRender = () => {
+ this.node?.toggleActive(true);
+ ctx.showAnnotationOptions();
+ ctx.update();
+ };
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ drag: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ cancel: StateMachine2.parent,
+ reset: StateMachine2.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: StateMachine2.parent,
+ action: actionFirstRender
+ }
+ }
+ });
+ this.debug = Debug2.create(true, "annotations");
+ }
+};
+__decorateClass([
+ StateMachineProperty2()
+], PointStateMachine.prototype, "node", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-down/arrowDownState.ts
+var ArrowDownStateMachine = class extends PointStateMachine {
+ createDatum() {
+ return new ArrowDownProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-down/arrowDownConfig.ts
+var arrowDownConfig = {
+ type: "arrow-down" /* ArrowDown */,
+ datum: ArrowDownProperties,
+ scene: ArrowDownScene,
+ isDatum: ArrowDownProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (ArrowDownProperties.is(datum) && ArrowDownScene.is(node))
+ node.translate(datum, translation, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (ArrowDownProperties.is(datum) && ArrowDownProperties.is(copiedDatum) && ArrowDownScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (ArrowDownProperties.is(datum) && ArrowDownScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new ArrowDownStateMachine({
+ ...ctx,
+ create: createDatum("arrow-down" /* ArrowDown */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-up/arrowUpProperties.ts
+var import_ag_charts_community49 = require("ag-charts-community");
+var import_ag_charts_core30 = require("ag-charts-core");
+var { Property: Property30 } = import_ag_charts_community49._ModuleSupport;
+var ArrowUpProperties = class extends ShapePointProperties {
+ constructor() {
+ super(...arguments);
+ this.type = "arrow-up" /* ArrowUp */;
+ }
+ static is(value) {
+ return (0, import_ag_charts_core30.isObject)(value) && value.type === "arrow-up" /* ArrowUp */;
+ }
+};
+__decorateClass([
+ Property30
+], ArrowUpProperties.prototype, "type", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-up/arrowUpState.ts
+var ArrowUpStateMachine = class extends PointStateMachine {
+ createDatum() {
+ return new ArrowUpProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/arrow-up/arrowUpConfig.ts
+var arrowUpConfig = {
+ type: "arrow-up" /* ArrowUp */,
+ datum: ArrowUpProperties,
+ scene: ArrowUpScene,
+ isDatum: ArrowUpProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (ArrowUpProperties.is(datum) && ArrowUpScene.is(node))
+ node.translate(datum, translation, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (ArrowUpProperties.is(datum) && ArrowUpProperties.is(copiedDatum) && ArrowUpScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (ArrowUpProperties.is(datum) && ArrowUpScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new ArrowUpStateMachine({
+ ...ctx,
+ create: createDatum("arrow-up" /* ArrowUp */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/callout/calloutScene.ts
+var import_ag_charts_community53 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/textualStartEndScene.ts
+var import_ag_charts_community52 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/startEndScene.ts
+var import_ag_charts_community51 = require("ag-charts-community");
+var import_ag_charts_core31 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/linearScene.ts
+var import_ag_charts_community50 = require("ag-charts-community");
+var { Vec2: Vec25, Vec4 } = import_ag_charts_community50._ModuleSupport;
+var LinearScene = class extends AnnotationScene {
+ constructor() {
+ super(...arguments);
+ this.overflowContinuous = 0;
+ }
+ extendLine({ x1, y1, x2, y2 }, datum, context) {
+ const linePoints = { x1, y1, x2, y2 };
+ if (!datum.extendStart && !datum.extendEnd) {
+ return linePoints;
+ }
+ const [left, right] = boundsIntersections(linePoints, context.yAxis.bounds);
+ const isFlippedX = linePoints.x2 < linePoints.x1;
+ const isFlippedY = linePoints.y1 >= linePoints.y2;
+ const isVertical = linePoints.x2 === linePoints.x1;
+ if (datum.extendEnd) {
+ if (isVertical) {
+ linePoints.y2 = isFlippedY ? right.y : left.y;
+ } else {
+ linePoints.x2 = isFlippedX ? left.x : right.x;
+ linePoints.y2 = isFlippedX ? left.y : right.y;
+ }
+ }
+ if (datum.extendStart) {
+ if (isVertical) {
+ linePoints.y1 = isFlippedY ? left.y : right.y;
+ } else {
+ linePoints.x1 = isFlippedX ? right.x : left.x;
+ linePoints.y1 = isFlippedX ? right.y : left.y;
+ }
+ }
+ return linePoints;
+ }
+ dragStart(datum, target, context) {
+ this.dragState = {
+ offset: target,
+ ...getDragStartState({ start: datum.start, end: datum.end }, context)
+ };
+ }
+ drag(datum, target, context, snapping) {
+ if (!datum.isWriteable())
+ return;
+ if (this.activeHandle) {
+ this.dragHandle(datum, target, context, snapping);
+ } else {
+ this.dragAll(datum, target, context);
+ }
+ }
+ dragAll(datum, target, context) {
+ const { dragState } = this;
+ if (!dragState)
+ return;
+ this.translatePoints(datum, dragState.start, dragState.end, Vec25.sub(target, dragState.offset), context);
+ }
+ translate(datum, translation, context) {
+ if (!datum.isWriteable())
+ return;
+ this.translatePoints(
+ datum,
+ convertPoint(datum.start, context),
+ convertPoint(datum.end, context),
+ translation,
+ context
+ );
+ }
+ copy(datum, copiedDatum, context) {
+ const coords = convertLine(datum, context);
+ if (!coords) {
+ return;
+ }
+ const bbox = this.computeBBoxWithoutHandles();
+ const translation = { x: -bbox.width / 2, y: -bbox.height / 2 };
+ this.translatePoints(copiedDatum, Vec4.start(coords), Vec4.end(coords), translation, context);
+ return copiedDatum;
+ }
+ translatePoints(datum, start, end, translation, context) {
+ const vectors = this.getTranslatePointsVectors(start, end);
+ const points = translate(vectors, translation, context, {
+ overflowContinuous: this.overflowContinuous
+ });
+ datum.start.x = points.start.x;
+ datum.end.x = points.end.x;
+ datum.start.y = points.start.y;
+ datum.end.y = points.end.y;
+ }
+ getTranslatePointsVectors(start, end) {
+ return { start, end };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/startEndScene.ts
+var { Vec2: Vec26, Vec4: Vec42 } = import_ag_charts_community51._ModuleSupport;
+var StartEndScene = class extends LinearScene {
+ constructor() {
+ super(...arguments);
+ this.start = new DivariantHandle();
+ this.end = new DivariantHandle();
+ this.anchor = {
+ x: 0,
+ y: 0,
+ position: "above"
+ };
+ }
+ update(datum, context) {
+ const coords = convertLine(datum, context);
+ if (coords == null) {
+ return;
+ }
+ this.updateHandles(datum, coords);
+ this.updateAnchor(datum, coords, context);
+ }
+ toggleHandles(show) {
+ if (typeof show === "boolean") {
+ this.start.visible = show;
+ this.end.visible = show;
+ } else {
+ for (const [handle2, visible] of (0, import_ag_charts_core31.entries)(show)) {
+ this[handle2].visible = visible;
+ }
+ }
+ this.start.toggleHovered(this.activeHandle === "start");
+ this.end.toggleHovered(this.activeHandle === "end");
+ }
+ toggleActive(active) {
+ this.toggleHandles(active);
+ this.start.toggleActive(active);
+ this.end.toggleActive(active);
+ }
+ dragHandle(datum, target, context, snapping) {
+ const { activeHandle, dragState } = this;
+ if (!activeHandle || !dragState)
+ return;
+ this[activeHandle].toggleDragging(true);
+ const snapHandle = activeHandle === "start" ? "end" : "start";
+ const snap = snapping ? { vectors: { [activeHandle]: convertPoint(datum[snapHandle], context) }, angle: datum.snapToAngle } : void 0;
+ const { [activeHandle]: point } = translate(
+ { [activeHandle]: dragState[activeHandle] },
+ Vec26.sub(target, dragState.offset),
+ context,
+ { overflowContinuous: 0, snap }
+ );
+ datum[activeHandle].x = point.x;
+ datum[activeHandle].y = point.y;
+ }
+ stopDragging() {
+ this.start.toggleDragging(false);
+ this.end.toggleDragging(false);
+ }
+ getAnchor() {
+ return this.anchor;
+ }
+ getCursor() {
+ return "pointer";
+ }
+ containsPoint(x, y) {
+ const { start, end } = this;
+ this.activeHandle = void 0;
+ if (start.containsPoint(x, y)) {
+ this.activeHandle = "start";
+ return true;
+ }
+ if (end.containsPoint(x, y)) {
+ this.activeHandle = "end";
+ return true;
+ }
+ return false;
+ }
+ getNodeAtCoords(x, y) {
+ if (this.start.containsPoint(x, y) || this.end.containsPoint(x, y))
+ return "handle";
+ }
+ updateHandles(datum, coords, bbox) {
+ this.start.update({
+ ...this.getHandleStyles(datum, "start"),
+ ...this.getHandleCoords(datum, coords, "start")
+ });
+ this.end.update({
+ ...this.getHandleStyles(datum, "end"),
+ ...this.getHandleCoords(datum, coords, "end", bbox)
+ });
+ this.start.toggleLocked(datum.locked ?? false);
+ this.end.toggleLocked(datum.locked ?? false);
+ }
+ updateAnchor(_datum, coords, context, _bbox) {
+ this.anchor = {
+ x: coords.x1 + context.seriesRect.x,
+ y: coords.y1 + context.seriesRect.y,
+ position: this.anchor.position
+ };
+ }
+ getHandleCoords(_datum, coords, handle2, _bbox) {
+ return handle2 === "start" ? Vec42.start(coords) : Vec42.end(coords);
+ }
+ getHandleStyles(datum, _handle) {
+ return {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke,
+ strokeOpacity: datum.handle.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/textualStartEndScene.ts
+var { Vec4: Vec43 } = import_ag_charts_community52._ModuleSupport;
+var TextualStartEndScene = class extends StartEndScene {
+ constructor() {
+ super(...arguments);
+ this.label = new import_ag_charts_community52._ModuleSupport.Text({ zIndex: 1 });
+ this.anchor = {
+ x: 0,
+ y: 0,
+ position: "above-left"
+ };
+ }
+ setTextInputBBox(bbox) {
+ this.textInputBBox = bbox;
+ this.markDirty("TextualStartEndScene");
+ }
+ update(datum, context) {
+ const coords = convertLine(datum, context);
+ if (coords == null) {
+ return;
+ }
+ const bbox = this.getTextBBox(datum, coords);
+ this.updateLabel(datum, bbox, coords);
+ this.updateHandles(datum, coords, bbox);
+ this.updateShape(datum, bbox, coords);
+ this.updateAnchor(datum, coords, context, bbox);
+ }
+ containsPoint(x, y) {
+ return super.containsPoint(x, y) || this.label.containsPoint(x, y);
+ }
+ getNodeAtCoords(x, y) {
+ if (this.label.containsPoint(x, y))
+ return "text";
+ return super.getNodeAtCoords(x, y);
+ }
+ getTextBBox(datum, coords) {
+ const { text: text2 } = datum.getText();
+ return getBBox(datum, text2, Vec43.end(coords), this.textInputBBox);
+ }
+ updateLabel(datum, bbox, coords) {
+ const { text: text2, isPlaceholder } = datum.getText();
+ updateTextNode(this.label, text2, isPlaceholder, datum, this.getLabelCoords(datum, bbox, coords));
+ }
+ updateShape(_datum, _textBBox, _coords) {
+ }
+ getLabelCoords(_datum, _bbox, coords) {
+ return Vec43.end(coords);
+ }
+ getHandleStyles(datum, handle2) {
+ return {
+ ...super.getHandleStyles(datum, handle2),
+ stroke: datum.handle.stroke ?? datum.color
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/callout/calloutScene.ts
+var { drawCorner, Path: Path5 } = import_ag_charts_community53._ModuleSupport;
+var CalloutScene = class extends TextualStartEndScene {
+ constructor() {
+ super();
+ this.type = "callout" /* Callout */;
+ this.shape = new Path5();
+ this.append([this.shape, this.label, this.start, this.end]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "callout" /* Callout */);
+ }
+ drag(datum, target, context, snapping) {
+ if (!datum.isWriteable())
+ return;
+ if (this.activeHandle === "end") {
+ this.dragHandle(datum, target, context, snapping);
+ } else {
+ this.dragAll(datum, target, context);
+ }
+ }
+ getLabelCoords(datum, bbox, coords) {
+ const padding = datum.getPadding();
+ const {
+ bodyBounds = {
+ x: 0,
+ y: 0,
+ width: 0,
+ height: 0
+ }
+ } = this.getDimensions(datum, bbox, coords) ?? {};
+ return {
+ x: bodyBounds.x + padding.left,
+ y: bodyBounds.y - padding.bottom
+ };
+ }
+ getHandleStyles(datum, handle2) {
+ return handle2 === "start" ? {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.stroke,
+ strokeOpacity: datum.handle.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth
+ } : { fill: void 0, strokeWidth: 0 };
+ }
+ updateAnchor(datum, coords, context, bbox) {
+ const { bodyBounds } = this.getDimensions(datum, bbox, coords) ?? {};
+ const bounds = bodyBounds ?? bbox;
+ this.anchor = {
+ x: bounds.x + context.seriesRect.x,
+ y: bounds.y + context.seriesRect.y - bounds.height,
+ position: this.anchor.position
+ };
+ }
+ updateShape(datum, textBBox, coords) {
+ const { shape } = this;
+ shape.fill = datum.fill;
+ shape.fillOpacity = datum.fillOpacity ?? 1;
+ shape.stroke = datum.stroke;
+ shape.strokeWidth = datum.strokeWidth ?? 1;
+ shape.strokeOpacity = datum.strokeOpacity ?? 1;
+ const { tailPoint, bodyBounds } = this.getDimensions(datum, textBBox, coords) ?? {};
+ if (!tailPoint || !bodyBounds) {
+ return;
+ }
+ this.updatePath(tailPoint, bodyBounds);
+ }
+ updatePath(tailPoint, bodyBounds) {
+ const { x: tailX, y: tailY } = tailPoint;
+ const { x, y, width, height } = bodyBounds;
+ const top = y - height;
+ const right = x + width;
+ const placement = this.calculateCalloutPlacement({ x: tailX, y: tailY }, bodyBounds);
+ const cornerRadius = 8;
+ const pathParams = [
+ {
+ coordinates: {
+ x0: x,
+ x1: x + cornerRadius,
+ y0: top + cornerRadius,
+ y1: top,
+ cx: placement === `topLeft` ? tailX : x + cornerRadius,
+ cy: placement === `topLeft` ? tailY : top + cornerRadius
+ },
+ type: placement === `topLeft` ? "calloutCorner" : "corner"
+ },
+ {
+ coordinates: {
+ x0: x + cornerRadius,
+ x1: right - cornerRadius,
+ y0: top,
+ y1: top,
+ cx: tailX,
+ cy: tailY
+ },
+ type: placement === `top` ? "calloutSide" : "side"
+ },
+ {
+ coordinates: {
+ x0: right - cornerRadius,
+ x1: right,
+ y0: top,
+ y1: top + cornerRadius,
+ cx: placement === `topRight` ? tailX : right - cornerRadius,
+ cy: placement === `topRight` ? tailY : top + cornerRadius
+ },
+ type: placement === `topRight` ? "calloutCorner" : "corner"
+ },
+ {
+ coordinates: {
+ x0: right,
+ x1: right,
+ y0: top + cornerRadius,
+ y1: y - cornerRadius,
+ cx: tailX,
+ cy: tailY
+ },
+ type: placement === `right` ? "calloutSide" : "side"
+ },
+ {
+ coordinates: {
+ x0: right,
+ x1: right - cornerRadius,
+ y0: y - cornerRadius,
+ y1: y,
+ cx: placement === `bottomRight` ? tailX : right - cornerRadius,
+ cy: placement === `bottomRight` ? tailY : y - cornerRadius
+ },
+ type: placement === `bottomRight` ? "calloutCorner" : "corner"
+ },
+ {
+ coordinates: {
+ x0: right - cornerRadius,
+ x1: x + cornerRadius,
+ y0: y,
+ y1: y,
+ cx: tailX,
+ cy: tailY
+ },
+ type: placement === `bottom` ? "calloutSide" : "side"
+ },
+ {
+ coordinates: {
+ x0: x + cornerRadius,
+ x1: x,
+ y0: y,
+ y1: y - cornerRadius,
+ cx: placement === `bottomLeft` ? tailX : x + cornerRadius,
+ cy: placement === `bottomLeft` ? tailY : y - cornerRadius
+ },
+ type: placement === `bottomLeft` ? "calloutCorner" : "corner"
+ },
+ {
+ coordinates: {
+ x0: x,
+ x1: x,
+ y0: y - cornerRadius,
+ y1: top + cornerRadius,
+ cx: tailX,
+ cy: tailY
+ },
+ type: placement === `left` ? "calloutSide" : "side"
+ }
+ ];
+ const { path } = this.shape;
+ path.clear();
+ path.moveTo(x, top + cornerRadius);
+ for (const { coordinates, type } of pathParams) {
+ this.drawPath(path, coordinates, cornerRadius, type);
+ }
+ path.closePath();
+ }
+ drawPath(path, { x0, y0, x1, y1, cx, cy }, cornerRadius, type) {
+ const sideTailRadius = 6;
+ switch (type) {
+ case "calloutCorner": {
+ path.lineTo(cx, cy);
+ path.lineTo(x1, y1);
+ break;
+ }
+ case "corner": {
+ drawCorner(
+ path,
+ {
+ x0,
+ x1,
+ y0,
+ y1,
+ cx,
+ cy
+ },
+ cornerRadius,
+ false
+ );
+ break;
+ }
+ case "calloutSide": {
+ if (x0 === x1) {
+ const direction = y0 > y1 ? -1 : 1;
+ const midY = Math.min(y0, y1) + Math.abs(y0 - y1) / 2;
+ path.lineTo(x0, midY - sideTailRadius * direction);
+ path.lineTo(cx, cy);
+ path.lineTo(x0, midY + sideTailRadius * direction);
+ path.lineTo(x1, y1);
+ } else {
+ const direction = x0 > x1 ? -1 : 1;
+ const midX = Math.min(x0, x1) + Math.abs(x1 - x0) / 2;
+ path.lineTo(midX - sideTailRadius * direction, y0);
+ path.lineTo(cx, cy);
+ path.lineTo(midX + sideTailRadius * direction, y0);
+ path.lineTo(x1, y1);
+ }
+ break;
+ }
+ case "side":
+ default: {
+ path.lineTo(x1, y1);
+ break;
+ }
+ }
+ }
+ calculateCalloutPlacement(placement, bounds) {
+ const right = bounds.x + bounds.width;
+ const top = bounds.y - bounds.height;
+ let xPlacement;
+ let yPlacement;
+ if (placement.x > right) {
+ xPlacement = "right";
+ } else if (placement.x < bounds.x) {
+ xPlacement = "left";
+ }
+ if (placement.y > bounds.y) {
+ yPlacement = "bottom";
+ } else if (placement.y < top) {
+ yPlacement = "top";
+ }
+ if (xPlacement && yPlacement) {
+ return `${yPlacement}${xPlacement[0].toUpperCase()}${xPlacement.substring(1)}`;
+ } else {
+ return yPlacement ?? xPlacement;
+ }
+ }
+ getDimensions(datum, textBBox, coords) {
+ const { fontSize } = datum;
+ const padding = datum.getPadding();
+ const horizontalPadding = padding.left + padding.right;
+ const verticalPadding = padding.top + padding.bottom;
+ const width = textBBox.width + horizontalPadding;
+ const height = Math.max(textBBox.height + verticalPadding, fontSize + verticalPadding);
+ return {
+ tailPoint: {
+ x: coords.x1,
+ y: coords.y1
+ },
+ bodyBounds: {
+ x: textBBox.x,
+ y: textBBox.y,
+ width,
+ height
+ }
+ };
+ }
+ containsPoint(x, y) {
+ const { start, end, shape } = this;
+ this.activeHandle = void 0;
+ if (start.containsPoint(x, y)) {
+ this.activeHandle = "start";
+ return true;
+ }
+ const bodyContainsPoint = end.containsPoint(x, y) || shape.containsPoint(x, y);
+ if (bodyContainsPoint) {
+ this.activeHandle = "end";
+ }
+ return bodyContainsPoint;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/states/textualStartEndState.ts
+var import_ag_charts_community54 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/states/textualStateUtils.ts
+function guardCancelAndExit({ key }) {
+ return key === "Escape";
+}
+function guardSaveAndExit({ key, shiftKey }) {
+ return !shiftKey && key === "Enter";
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/states/textualStartEndState.ts
+var { StateMachine: StateMachine3, StateMachineProperty: StateMachineProperty3, Debug: Debug3 } = import_ag_charts_community54._ModuleSupport;
+var TextualStartEndStateMachine = class extends StateMachine3 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = this.createDatum();
+ datum.set({ start: point, end: point, visible: true });
+ ctx.create(datum);
+ };
+ const actionFirstRender = () => {
+ const { node } = this;
+ node?.toggleActive(true);
+ node?.toggleHandles({ start: true });
+ };
+ const onStartEditing = () => {
+ ctx.showTextInput();
+ if (this.datum)
+ this.datum.visible = false;
+ };
+ const onStopEditing = () => {
+ ctx.hideTextInput();
+ if (this.datum)
+ this.datum.visible = true;
+ ctx.deselect();
+ };
+ const actionUpdateTextInputBBox = (bbox) => {
+ this.node?.setTextInputBBox(bbox);
+ ctx.update();
+ };
+ const onEndHover = ({ point }) => {
+ const { datum, node } = this;
+ datum?.set({ end: point });
+ node?.toggleActive(true);
+ node?.toggleHandles({ end: false });
+ ctx.update();
+ };
+ const onEndClick = () => {
+ ctx.showAnnotationOptions();
+ this.node?.toggleHandles({ end: true });
+ };
+ const actionColor = ({
+ colorPickerType,
+ colorOpacity,
+ color: color6,
+ opacity,
+ isMultiColor
+ }) => {
+ const { datum } = this;
+ if (!datum)
+ return;
+ if (colorPickerType === "text-color") {
+ ctx.updateTextInputColor(color6);
+ }
+ setColor(datum, colorPickerType, colorOpacity, color6, opacity, isMultiColor);
+ ctx.update();
+ };
+ const actionFontSize = (fontSize) => {
+ const { datum, node } = this;
+ if (!datum || !node || !isTextType(datum))
+ return;
+ datum.fontSize = fontSize;
+ ctx.updateTextInputFontSize(fontSize);
+ ctx.update();
+ };
+ const actionCancel = () => {
+ ctx.delete();
+ };
+ const actionSave = ({ textInputValue, bbox }) => {
+ const { datum } = this;
+ if (bbox != null && textInputValue != null && textInputValue.length > 0) {
+ if (!isTextType(datum)) {
+ return;
+ }
+ const wrappedText = maybeWrapText(datum, textInputValue, bbox.width);
+ datum?.set({ text: wrappedText });
+ ctx.update();
+ ctx.recordAction(`Create ${datum?.type} annotation`);
+ } else {
+ ctx.delete();
+ }
+ };
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ dragStart: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ cancel: StateMachine3.parent,
+ reset: StateMachine3.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: "end",
+ action: actionFirstRender
+ }
+ },
+ end: {
+ hover: onEndHover,
+ drag: onEndHover,
+ click: {
+ target: "edit",
+ action: onEndClick
+ },
+ dragEnd: {
+ target: "edit",
+ action: onEndClick
+ },
+ reset: {
+ target: StateMachine3.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine3.parent,
+ action: actionCancel
+ }
+ },
+ edit: {
+ onEnter: onStartEditing,
+ updateTextInputBBox: actionUpdateTextInputBBox,
+ color: actionColor,
+ fontSize: actionFontSize,
+ textInput: [
+ {
+ guard: guardCancelAndExit,
+ target: StateMachine3.parent,
+ action: actionCancel
+ },
+ {
+ guard: guardSaveAndExit,
+ target: StateMachine3.parent,
+ action: actionSave
+ }
+ ],
+ click: {
+ target: StateMachine3.parent,
+ action: actionSave
+ },
+ dragStart: {
+ target: StateMachine3.parent,
+ action: actionSave
+ },
+ resize: {
+ target: StateMachine3.parent,
+ action: actionSave
+ },
+ onExit: onStopEditing,
+ cancel: {
+ target: StateMachine3.parent,
+ action: actionCancel
+ }
+ }
+ });
+ this.debug = Debug3.create(true, "annotations");
+ }
+};
+__decorateClass([
+ StateMachineProperty3()
+], TextualStartEndStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty3()
+], TextualStartEndStateMachine.prototype, "node", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/callout/calloutState.ts
+var CalloutStateMachine = class extends TextualStartEndStateMachine {
+ createDatum() {
+ return new CalloutProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/callout/calloutConfig.ts
+var calloutConfig = {
+ type: "callout" /* Callout */,
+ datum: CalloutProperties,
+ scene: CalloutScene,
+ isDatum: CalloutProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (CalloutProperties.is(datum) && CalloutScene.is(node))
+ return node.translate(datum, transition, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (CalloutProperties.is(datum) && CalloutProperties.is(copiedDatum) && CalloutScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (CalloutProperties.is(datum) && CalloutScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new CalloutStateMachine({
+ ...ctx,
+ create: createDatum("callout" /* Callout */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/comment/commentScene.ts
+var import_ag_charts_community56 = require("ag-charts-community");
+var import_ag_charts_core32 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/textualPointScene.ts
+var import_ag_charts_community55 = require("ag-charts-community");
+var TextualPointScene = class extends PointScene {
+ constructor() {
+ super(...arguments);
+ this.label = new import_ag_charts_community55._ModuleSupport.Text({ zIndex: 1 });
+ this.anchor = {
+ x: 0,
+ y: 0,
+ position: "above-left"
+ };
+ }
+ setTextInputBBox(bbox) {
+ this.textInputBBox = bbox;
+ this.markDirty("TextualPointScene");
+ }
+ update(datum, context) {
+ const coords = convertPoint(datum, context);
+ const bbox = this.getTextBBox(datum, coords, context);
+ this.updateLabel(datum, bbox);
+ this.updateHandle(datum, coords, bbox);
+ this.updateShape(datum, bbox);
+ this.anchor = this.updateAnchor(datum, bbox, context);
+ }
+ copy(datum, copiedDatum, context) {
+ const coords = convertPoint(datum, context);
+ const bbox = this.getTextBBox(datum, coords, context);
+ const padding = datum.getPadding();
+ const horizontalPadding = padding.left + padding.right;
+ const verticalPadding = padding.top + padding.bottom;
+ const xOffset = (bbox.width + horizontalPadding) / 2;
+ const yOffset = bbox.height + verticalPadding;
+ const point = invertCoords({ x: coords.x - xOffset, y: coords.y - yOffset }, context);
+ copiedDatum.x = point.x;
+ copiedDatum.y = point.y;
+ return copiedDatum;
+ }
+ containsPoint(x, y) {
+ const { label } = this;
+ return super.containsPoint(x, y) || label.visible && label.containsPoint(x, y);
+ }
+ getNodeAtCoords(x, y) {
+ if (this.label.visible && this.label.containsPoint(x, y))
+ return "text";
+ return super.getNodeAtCoords(x, y);
+ }
+ getTextBBox(datum, coords, _context) {
+ const { text: text2 } = datum.getText();
+ return getBBox(datum, text2, { x: coords.x, y: coords.y }, this.textInputBBox);
+ }
+ updateLabel(datum, bbox) {
+ const { text: text2, isPlaceholder } = datum.getText();
+ updateTextNode(
+ this.label,
+ text2,
+ isPlaceholder,
+ datum,
+ this.getLabelCoords(datum, bbox),
+ this.getTextBaseline(datum)
+ );
+ }
+ updateShape(_datum, _bbox) {
+ }
+ updateAnchor(_datum, bbox, context) {
+ return {
+ x: bbox.x + context.seriesRect.x,
+ y: bbox.y + context.seriesRect.y - bbox.height,
+ position: this.anchor.position
+ };
+ }
+ getLabelCoords(_datum, bbox) {
+ return bbox;
+ }
+ getTextBaseline(datum) {
+ return datum.position == "center" ? "middle" : datum.position;
+ }
+ getHandleCoords(_datum, _coords, bbox) {
+ return bbox;
+ }
+ getHandleStyles(datum) {
+ const styles = super.getHandleStyles(datum);
+ styles.stroke = datum.handle.stroke ?? datum.color;
+ return styles;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/comment/commentScene.ts
+var { drawCorner: drawCorner2 } = import_ag_charts_community56._ModuleSupport;
+var CommentScene = class extends TextualPointScene {
+ constructor() {
+ super();
+ this.type = "comment" /* Comment */;
+ this.shape = new import_ag_charts_community56._ModuleSupport.Path();
+ this.append([this.shape, this.label, this.handle]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "comment" /* Comment */);
+ }
+ updateShape(datum, bbox) {
+ const { shape } = this;
+ shape.fill = datum.fill;
+ shape.fillOpacity = datum.fillOpacity ?? 1;
+ shape.stroke = datum.stroke ?? "transparent";
+ shape.strokeWidth = datum.strokeWidth ?? 1;
+ shape.strokeOpacity = datum.strokeOpacity ?? 1;
+ this.updatePath(datum, bbox);
+ }
+ getLabelCoords(datum, point) {
+ const padding = datum.getPadding();
+ return {
+ x: point.x + padding.left,
+ y: point.y - padding.bottom
+ };
+ }
+ getHandleStyles(datum) {
+ return {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.stroke ?? datum.fill,
+ strokeOpacity: datum.handle.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth
+ };
+ }
+ updateAnchor(datum, bbox, context) {
+ const anchor = super.updateAnchor(datum, bbox, context);
+ const padding = datum.getPadding();
+ anchor.y -= padding.bottom + padding.top;
+ return anchor;
+ }
+ updatePath(datum, bbox) {
+ const padding = datum.getPadding();
+ const { x, y } = bbox;
+ let { width, height } = bbox;
+ const { fontSize } = datum;
+ const horizontalPadding = padding.left + padding.right;
+ const verticalPadding = padding.top + padding.bottom;
+ width = width + horizontalPadding;
+ height = Math.max(height + verticalPadding, fontSize + verticalPadding);
+ const top = y - height;
+ const right = x + width;
+ const cornerRadius = ((0, import_ag_charts_core32.calcLineHeight)(fontSize, ANNOTATION_TEXT_LINE_HEIGHT) + verticalPadding) / 2;
+ const { path } = this.shape;
+ path.clear();
+ path.moveTo(x, y);
+ path.lineTo(x, top + cornerRadius);
+ drawCorner2(
+ path,
+ {
+ x0: x,
+ x1: x + cornerRadius,
+ y0: top + cornerRadius,
+ y1: top,
+ cx: x + cornerRadius,
+ cy: top + cornerRadius
+ },
+ cornerRadius,
+ false
+ );
+ path.lineTo(right - cornerRadius, top);
+ drawCorner2(
+ path,
+ {
+ x0: right - cornerRadius,
+ x1: right,
+ y0: top,
+ y1: top + cornerRadius,
+ cx: right - cornerRadius,
+ cy: top + cornerRadius
+ },
+ cornerRadius,
+ false
+ );
+ path.lineTo(right, y - cornerRadius);
+ drawCorner2(
+ path,
+ {
+ x0: right,
+ x1: right - cornerRadius,
+ y0: y - cornerRadius,
+ y1: y,
+ cx: right - cornerRadius,
+ cy: y - cornerRadius
+ },
+ cornerRadius,
+ false
+ );
+ path.closePath();
+ }
+ containsPoint(x, y) {
+ return super.containsPoint(x, y) || this.shape.containsPoint(x, y);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/states/textualPointState.ts
+var import_ag_charts_community57 = require("ag-charts-community");
+var { StateMachine: StateMachine4, StateMachineProperty: StateMachineProperty4, Debug: Debug4 } = import_ag_charts_community57._ModuleSupport;
+var TextualPointStateMachine = class extends StateMachine4 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = this.createDatum();
+ datum.set({ x: point.x, y: point.y });
+ ctx.create(datum);
+ };
+ const actionFirstRender = () => {
+ this.node?.toggleActive(true);
+ ctx.showAnnotationOptions();
+ ctx.update();
+ };
+ const onStartEditing = () => {
+ ctx.showTextInput();
+ if (this.datum) {
+ this.datum.visible = false;
+ }
+ };
+ const onStopEditing = () => {
+ ctx.hideTextInput();
+ if (this.datum)
+ this.datum.visible = true;
+ ctx.deselect();
+ };
+ const actionUpdateTextInputBBox = (bbox) => {
+ this.node?.setTextInputBBox(bbox);
+ ctx.update();
+ };
+ const actionColor = ({
+ colorPickerType,
+ colorOpacity,
+ color: color6,
+ opacity,
+ isMultiColor
+ }) => {
+ if (!this.datum)
+ return;
+ if (colorPickerType === "text-color") {
+ ctx.updateTextInputColor(color6);
+ }
+ setColor(this.datum, colorPickerType, colorOpacity, color6, opacity, isMultiColor);
+ ctx.update();
+ };
+ const actionFontSize = (fontSize) => {
+ const { datum, node } = this;
+ if (!datum || !node || !isTextType(datum))
+ return;
+ datum.fontSize = fontSize;
+ ctx.updateTextInputFontSize(fontSize);
+ ctx.update();
+ };
+ const actionCancel = () => {
+ ctx.delete();
+ };
+ const actionSave = ({ textInputValue, bbox }) => {
+ if (bbox != null && textInputValue != null && textInputValue.length > 0) {
+ const { datum } = this;
+ if (!isTextType(datum)) {
+ return;
+ }
+ const wrappedText = maybeWrapText(datum, textInputValue, bbox.width);
+ datum?.set({ text: wrappedText });
+ ctx.update();
+ ctx.recordAction(`Create ${datum?.type} annotation`);
+ } else {
+ ctx.delete();
+ }
+ };
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ dragStart: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ cancel: StateMachine4.parent,
+ reset: StateMachine4.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: "edit",
+ action: actionFirstRender
+ }
+ },
+ edit: {
+ onEnter: onStartEditing,
+ updateTextInputBBox: actionUpdateTextInputBBox,
+ color: actionColor,
+ fontSize: actionFontSize,
+ textInput: [
+ {
+ guard: guardCancelAndExit,
+ target: StateMachine4.parent,
+ action: actionCancel
+ },
+ {
+ guard: guardSaveAndExit,
+ target: StateMachine4.parent,
+ action: actionSave
+ }
+ ],
+ click: {
+ target: StateMachine4.parent,
+ action: actionSave
+ },
+ dragStart: {
+ target: StateMachine4.parent,
+ action: actionSave
+ },
+ resize: {
+ target: StateMachine4.parent,
+ action: actionSave
+ },
+ onExit: onStopEditing,
+ cancel: {
+ target: StateMachine4.parent,
+ action: actionCancel
+ }
+ }
+ });
+ this.debug = Debug4.create(true, "annotations");
+ }
+};
+__decorateClass([
+ StateMachineProperty4()
+], TextualPointStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty4()
+], TextualPointStateMachine.prototype, "node", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/comment/commentState.ts
+var CommentStateMachine = class extends TextualPointStateMachine {
+ createDatum() {
+ return new CommentProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/comment/commentConfig.ts
+var commentConfig = {
+ type: "comment" /* Comment */,
+ datum: CommentProperties,
+ scene: CommentScene,
+ isDatum: CommentProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (CommentProperties.is(datum) && CommentScene.is(node))
+ node.translate(datum, translation, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (CommentProperties.is(datum) && CommentProperties.is(copiedDatum) && CommentScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (CommentProperties.is(datum) && CommentScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new CommentStateMachine({
+ ...ctx,
+ create: createDatum("comment" /* Comment */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/cross-line/crossLineScene.ts
+var import_ag_charts_community62 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/axisLabelScene.ts
+var import_ag_charts_community58 = require("ag-charts-community");
+var { calculateLabelTranslation } = import_ag_charts_community58._ModuleSupport;
+var AxisLabelScene = class extends import_ag_charts_community58._ModuleSupport.Group {
+ constructor() {
+ super({ name: "AnnotationAxisLabelGroup" });
+ this.label = new import_ag_charts_community58._ModuleSupport.Text({ zIndex: 1 });
+ this.rect = new import_ag_charts_community58._ModuleSupport.Rect();
+ const { label } = this;
+ label.fontSize = 12;
+ label.fontFamily = "Verdana, sans-serif";
+ label.fill = "black";
+ label.textBaseline = "middle";
+ label.textAlign = "center";
+ this.append([this.rect, this.label]);
+ }
+ update(opts) {
+ this.updateLabel(opts);
+ this.updateRect(opts);
+ this.updatePosition(opts);
+ }
+ updateLabel({ value, styles, context }) {
+ const { fontWeight, fontSize, fontStyle, fontFamily, textAlign, color: color6 = "white", formatter } = styles;
+ const text2 = formatter ? formatter({ value }) : context.formatScaleValue(value, "annotation-label");
+ this.label.setProperties({
+ fontWeight,
+ fontSize,
+ fontStyle,
+ fontFamily,
+ textAlign,
+ fill: color6,
+ text: text2
+ });
+ }
+ updateRect({ styles }) {
+ const { rect } = this;
+ const { cornerRadius, fill, fillOpacity, stroke: stroke2, strokeOpacity } = styles;
+ rect.fill = fill;
+ rect.fillOpacity = fillOpacity ?? 1;
+ rect.stroke = stroke2;
+ rect.strokeOpacity = strokeOpacity ?? 1;
+ rect.cornerRadius = cornerRadius ?? 0;
+ }
+ updatePosition({ x, y, context, styles: { padding } }) {
+ const { label, rect } = this;
+ const labelBBox = label.getBBox()?.clone();
+ const horizontalPadding = padding ?? 8;
+ const verticalPadding = padding ?? 4;
+ const { xTranslation, yTranslation } = calculateLabelTranslation({
+ yDirection: true,
+ padding: context.labelPadding,
+ position: context.position ?? "left",
+ bbox: labelBBox
+ });
+ labelBBox.grow(horizontalPadding, "horizontal");
+ labelBBox.grow(verticalPadding, "vertical");
+ const translationX = x + xTranslation;
+ const translationY = y + yTranslation;
+ label.x = translationX;
+ label.y = translationY;
+ rect.y = translationY - Math.round(labelBBox.height / 2);
+ rect.x = translationX - Math.round(labelBBox.width / 2);
+ rect.height = labelBBox.height;
+ rect.width = labelBBox.width;
+ }
+};
+AxisLabelScene.className = "AxisLabel";
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/collidableLineScene.ts
+var import_ag_charts_community59 = require("ag-charts-community");
+var { Vec2: Vec27 } = import_ag_charts_community59._ModuleSupport;
+var CollidableLine = class extends import_ag_charts_community59._ModuleSupport.Line {
+ constructor() {
+ super(...arguments);
+ this.growCollisionBox = 9;
+ this.clipMask = /* @__PURE__ */ new Map();
+ }
+ setProperties(styles) {
+ super.setProperties(styles);
+ this.updateCollisionBBox();
+ return this;
+ }
+ updateCollisionBBox() {
+ const { growCollisionBox, strokeWidth, x1, y1, x2, y2 } = this;
+ let height = strokeWidth + growCollisionBox;
+ if (height % 2 === 0)
+ height += 1;
+ const topLeft = Vec27.from(x1, y1 - Math.floor(height / 2));
+ const bottomRight = Vec27.from(x2, y2);
+ const width = Vec27.distance(topLeft, bottomRight);
+ this.collisionBBox = new import_ag_charts_community59._ModuleSupport.BBox(topLeft.x, topLeft.y, width, height);
+ }
+ isPointInPath(pointX, pointY) {
+ const { collisionBBox, x1, y1, x2, y2 } = this;
+ if (!collisionBBox)
+ return false;
+ const v1 = Vec27.from(x1, y1);
+ const v2 = Vec27.from(x2, y2);
+ const point = Vec27.sub(Vec27.from(pointX, pointY), v1);
+ const end = Vec27.sub(v2, v1);
+ const rotated = Vec27.rotate(point, Vec27.angle(point, end), v1);
+ return collisionBBox.containsPoint(rotated.x, rotated.y) ?? false;
+ }
+ render(renderCtx) {
+ const { clipMask } = this;
+ const { ctx } = renderCtx;
+ if (clipMask.size === 0) {
+ super.render(renderCtx);
+ return;
+ }
+ ctx.save();
+ try {
+ for (const mask of this.clipMask.values()) {
+ const { x, y, radius } = mask;
+ ctx.beginPath();
+ ctx.rect(0, 0, ctx.canvas.width, ctx.canvas.height);
+ ctx.ellipse(x, y, radius, radius, 0, Math.PI * 2, 0, true);
+ ctx.clip();
+ }
+ super.render(renderCtx);
+ } finally {
+ ctx.restore();
+ }
+ }
+ setClipMask(id, mask) {
+ const cm = this.clipMask.get(id);
+ if (import_ag_charts_community59._ModuleSupport.jsonDiff(cm, mask) != null) {
+ this.markDirty("CollidableLine");
+ }
+ if (mask) {
+ this.clipMask.set(id, mask);
+ } else {
+ this.clipMask.delete(id);
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/collidableTextScene.ts
+var import_ag_charts_community60 = require("ag-charts-community");
+var CollidableText = class extends import_ag_charts_community60._ModuleSupport.TransformableText {
+ constructor() {
+ super(...arguments);
+ this.growCollisionBox = {
+ top: 4,
+ right: 4,
+ bottom: 4,
+ left: 4
+ };
+ }
+ isPointInPath(pointX, pointY) {
+ const localPoint = this.fromParentPoint(pointX, pointY);
+ const uBBox = this.computeBBoxWithoutTransforms();
+ if (!uBBox)
+ return false;
+ return uBBox.grow(this.growCollisionBox).containsPoint(localPoint.x, localPoint.y);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/lineWithText.ts
+var import_ag_charts_community61 = require("ag-charts-community");
+var { Vec2: Vec28 } = import_ag_charts_community61._ModuleSupport;
+function updateLineText(id, line, coords, textProperties, textNode, text2, lineWidth) {
+ if (!text2 || !textNode || !textProperties) {
+ line.setClipMask(id);
+ return;
+ }
+ const { alignment, position } = textProperties;
+ const numbers = getNumbers(coords, textProperties.fontSize, lineWidth);
+ const { point, textBaseline } = positionAndAlignment(numbers, position, alignment);
+ setProperties(textNode, text2, textProperties, point, numbers.angle, textBaseline);
+ const { x, y, width, height } = textNode.getBBox();
+ const diameter = Vec28.length(Vec28.from(width, height));
+ const clipMask = {
+ x: x + width / 2,
+ y: y + height / 2,
+ radius: diameter / 2 + Vec28.length(numbers.offset)
+ };
+ if (position === "center") {
+ line.setClipMask(id, clipMask);
+ } else {
+ line.setClipMask(id);
+ }
+ return { clipMask, numbers };
+}
+function updateChannelText(offsetInsideTextLabel, top, bottom, textProperties, lineWidth, textNode, text2) {
+ if (!text2 || !textNode)
+ return;
+ const { alignment, position } = textProperties;
+ const [actualTop, actualBottom] = top.y1 <= bottom.y1 ? [top, bottom] : [bottom, top];
+ let relativeLine = actualTop;
+ if (position === "bottom") {
+ relativeLine = actualBottom;
+ } else if (position === "inside") {
+ relativeLine = {
+ x1: (actualTop.x1 + actualBottom.x1) / 2,
+ y1: (actualTop.y1 + actualBottom.y1) / 2,
+ x2: (actualTop.x2 + actualBottom.x2) / 2,
+ y2: (actualTop.y2 + actualBottom.y2) / 2
+ };
+ }
+ const numbers = getNumbers(relativeLine, textProperties.fontSize, lineWidth);
+ const { point, textBaseline } = positionAndAlignment(
+ numbers,
+ position === "inside" ? "center" : position,
+ alignment,
+ offsetInsideTextLabel
+ );
+ setProperties(textNode, text2, textProperties, point, numbers.angle, textBaseline);
+}
+function getNumbers(coords, fontSize, strokeWidth) {
+ let [left, right] = Vec28.from(coords);
+ if (left.x > right.x)
+ [left, right] = [right, left];
+ const normal = Vec28.normalized(Vec28.sub(right, left));
+ const angle = Vec28.angle(normal);
+ const inset = Vec28.multiply(normal, DivariantHandle.HANDLE_SIZE / 2 + (fontSize ?? 14) / 2);
+ const offset = Vec28.multiply(normal, (strokeWidth ?? 2) / 2 + (fontSize ?? 14) / 3);
+ return { left, right, normal, angle, inset, offset };
+}
+function positionAndAlignment({ left, right, normal, angle, inset, offset }, position, alignment, offsetInsideTextLabel) {
+ let point;
+ if (alignment === "right") {
+ point = Vec28.sub(right, inset);
+ } else if (alignment === "center") {
+ point = Vec28.add(left, Vec28.multiply(normal, Vec28.distance(left, right) / 2));
+ } else {
+ point = Vec28.add(left, inset);
+ }
+ let textBaseline = "bottom";
+ if (position === "bottom") {
+ point = Vec28.rotate(offset, angle + Math.PI / 2, point);
+ textBaseline = "top";
+ } else if (position === "center" && !offsetInsideTextLabel) {
+ textBaseline = "middle";
+ } else {
+ point = Vec28.rotate(offset, angle - Math.PI / 2, point);
+ }
+ return { point, textBaseline };
+}
+function setProperties(scene, text2, textProperties, point, angle, textBaseline) {
+ scene.setProperties({
+ text: text2,
+ x: point.x,
+ y: point.y,
+ rotation: angle,
+ rotationCenterX: point.x,
+ rotationCenterY: point.y,
+ fill: textProperties.color,
+ fontFamily: textProperties.fontFamily,
+ fontSize: textProperties.fontSize,
+ fontStyle: textProperties.fontStyle,
+ fontWeight: textProperties.fontWeight,
+ textAlign: textProperties.alignment,
+ textBaseline
+ });
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/cross-line/crossLineScene.ts
+var { ChartAxisDirection: ChartAxisDirection6, Vec2: Vec29, Vec4: Vec44 } = import_ag_charts_community62._ModuleSupport;
+var CrossLineScene = class extends AnnotationScene {
+ constructor() {
+ super();
+ this.type = "cross-line";
+ this.line = new CollidableLine();
+ this.middle = new UnivariantHandle();
+ this.isHorizontal = false;
+ this.append([this.line, this.middle]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "cross-line");
+ }
+ update(datum, context) {
+ const { seriesRect } = context;
+ this.seriesRect = seriesRect;
+ this.isHorizontal = HorizontalLineProperties.is(datum);
+ const axisContext = this.isHorizontal ? context.yAxis : context.xAxis;
+ const coords = this.convertCrossLine(datum, axisContext);
+ if (coords == null) {
+ this.visible = false;
+ return;
+ }
+ this.visible = datum.visible ?? true;
+ if (!this.visible)
+ return;
+ this.updateLine(datum, coords);
+ this.updateHandle(datum, coords);
+ this.updateText(datum, coords);
+ this.updateAxisLabel(datum, axisContext, coords);
+ }
+ updateLine(datum, coords) {
+ const { line } = this;
+ const { lineDashOffset, stroke: stroke2, strokeWidth, strokeOpacity } = datum;
+ const { x1, y1, x2, y2 } = coords;
+ line.setProperties({
+ x1,
+ y1,
+ x2,
+ y2,
+ lineCap: datum.getLineCap(),
+ lineDash: datum.getLineDash(),
+ lineDashOffset,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ fillOpacity: 0
+ });
+ }
+ updateHandle(datum, coords) {
+ const { middle } = this;
+ const { locked, stroke: stroke2, strokeWidth, strokeOpacity } = datum;
+ const handleStyles = {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? stroke2,
+ strokeOpacity: datum.handle.strokeOpacity ?? strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth ?? strokeWidth
+ };
+ const handlePosition = Vec29.sub(
+ Vec44.center(coords),
+ Vec29.from(middle.handle.width / 2, middle.handle.height / 2)
+ );
+ middle.gradient = this.isHorizontal ? "horizontal" : "vertical";
+ middle.update({ ...handleStyles, ...handlePosition });
+ middle.toggleLocked(locked ?? false);
+ }
+ updateText(datum, coords) {
+ this.text = this.updateNode(CollidableText, this.text, !!datum.text.label);
+ updateLineText(this.line.id, this.line, coords, datum.text, this.text, datum.text.label, datum.strokeWidth);
+ }
+ createAxisLabel(context) {
+ const axisLabel2 = new AxisLabelScene();
+ context.attachLabel(axisLabel2);
+ return axisLabel2;
+ }
+ updateAxisLabel(datum, axisContext, coords) {
+ this.axisLabel ?? (this.axisLabel = this.createAxisLabel(axisContext));
+ const { axisLabel: axisLabel2, seriesRect } = this;
+ const { direction, position } = axisContext;
+ if (datum.axisLabel.enabled) {
+ axisLabel2.visible = this.visible;
+ const labelCorner = position === "left" || position === "top" ? Vec44.start(coords) : Vec44.end(coords);
+ const labelPosition = direction === ChartAxisDirection6.X ? labelCorner.x : labelCorner.y;
+ if (!axisContext.inRange(labelPosition)) {
+ axisLabel2.visible = false;
+ return;
+ }
+ const value = getGroupingValue(datum.value);
+ axisLabel2.update({
+ ...Vec29.add(labelCorner, Vec29.required(seriesRect)),
+ value,
+ styles: datum.axisLabel,
+ context: axisContext
+ });
+ } else {
+ axisLabel2.visible = false;
+ }
+ }
+ setAxisLabelOpacity(opacity) {
+ if (!this.axisLabel)
+ return;
+ this.axisLabel.opacity = opacity;
+ }
+ setAxisLabelVisible(visible) {
+ if (!this.axisLabel)
+ return;
+ this.axisLabel.visible = visible;
+ }
+ toggleHandles(show) {
+ this.middle.visible = show;
+ this.middle.toggleHovered(this.activeHandle === "middle");
+ }
+ destroy() {
+ super.destroy();
+ this.axisLabel?.destroy();
+ }
+ toggleActive(active) {
+ this.toggleHandles(active);
+ this.middle.toggleActive(active);
+ }
+ dragStart(datum, target, context) {
+ const middle = HorizontalLineProperties.is(datum) ? { x: target.x, y: convert(datum.value, context.yAxis) } : { x: convert(datum.value, context.xAxis), y: target.y };
+ this.dragState = {
+ offset: target,
+ middle
+ };
+ }
+ drag(datum, target, context) {
+ const { activeHandle, dragState } = this;
+ if (!datum.isWriteable() || !dragState)
+ return;
+ if (activeHandle) {
+ this[activeHandle].toggleDragging(true);
+ }
+ this.translatePoint(datum, dragState.middle, Vec29.sub(target, dragState.offset), context);
+ }
+ translate(datum, translation, context) {
+ if (!datum.isWriteable())
+ return;
+ const vector = HorizontalLineProperties.is(datum) ? Vec29.from(0, convert(datum.value, context.yAxis)) : Vec29.from(convert(datum.value, context.xAxis), 0);
+ this.translatePoint(datum, vector, translation, context);
+ }
+ translatePoint(datum, value, translation, context) {
+ const isHorizontal2 = HorizontalLineProperties.is(datum);
+ if (isHorizontal2) {
+ translation.x = 0;
+ } else {
+ translation.y = 0;
+ }
+ const { point } = translate({ point: value }, translation, context);
+ datum.value = isHorizontal2 ? point.y : point.x;
+ }
+ stopDragging() {
+ this.middle.toggleDragging(false);
+ }
+ copy(datum, copiedDatum, context) {
+ const isHorizontal2 = HorizontalLineProperties.is(datum);
+ const axisContext = this.isHorizontal ? context.yAxis : context.xAxis;
+ const coords = this.convertCrossLine(datum, axisContext);
+ if (!coords) {
+ return;
+ }
+ const yOffset = isHorizontal2 ? -30 : 0;
+ const xOffset = isHorizontal2 ? 0 : -30;
+ const point = invertCoords({ x: coords.x1 + xOffset, y: coords.y1 + yOffset }, context);
+ copiedDatum.set({ value: isHorizontal2 ? point.y : point.x });
+ return copiedDatum;
+ }
+ getCursor() {
+ if (this.activeHandle == null)
+ return "pointer";
+ return this[this.activeHandle].getCursor();
+ }
+ containsPoint(x, y) {
+ const { middle, line, text: text2 } = this;
+ this.activeHandle = void 0;
+ if (middle.containsPoint(x, y)) {
+ this.activeHandle = "middle";
+ return true;
+ }
+ return line.isPointInPath(x, y) || Boolean(text2?.containsPoint(x, y));
+ }
+ getNodeAtCoords(x, y) {
+ if (this.text?.containsPoint(x, y))
+ return "text";
+ if (this.line.isPointInPath(x, y))
+ return "line";
+ if (this.middle.containsPoint(x, y))
+ return "handle";
+ }
+ getAnchor() {
+ const bbox = this.computeBBoxWithoutHandles();
+ if (this.isHorizontal) {
+ return { x: bbox.x + bbox.width / 2, y: bbox.y };
+ }
+ return { x: bbox.x + bbox.width, y: bbox.y + bbox.height / 2, position: "right" };
+ }
+ convertCrossLine(datum, context) {
+ if (datum.value == null)
+ return;
+ let x1 = 0;
+ let y1 = 0;
+ let x2, y2;
+ const { bounds } = context;
+ const scaledValue = convert(datum.value, context);
+ if (HorizontalLineProperties.is(datum)) {
+ x2 = bounds.width;
+ y1 = scaledValue;
+ y2 = scaledValue;
+ } else {
+ x1 = scaledValue;
+ x2 = scaledValue;
+ y2 = bounds.height;
+ }
+ return { x1, y1, x2, y2 };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/cross-line/crossLineState.ts
+var import_ag_charts_community63 = require("ag-charts-community");
+var { StateMachine: StateMachine5, StateMachineProperty: StateMachineProperty5, Debug: Debug5 } = import_ag_charts_community63._ModuleSupport;
+var CrossLineStateMachine = class extends StateMachine5 {
+ constructor(direction, ctx) {
+ const onClick = ({ point }) => {
+ const isHorizontal2 = direction === "horizontal";
+ const datum = isHorizontal2 ? new HorizontalLineProperties() : new VerticalLineProperties();
+ datum.set({ value: isHorizontal2 ? point.y : point.x });
+ ctx.create(datum);
+ ctx.recordAction(
+ `Create ${isHorizontal2 ? "horizontal-line" /* HorizontalLine */ : "vertical-line" /* VerticalLine */} annotation`
+ );
+ };
+ const actionFirstRender = () => {
+ this.node?.toggleActive(true);
+ ctx.showAnnotationOptions();
+ ctx.update();
+ };
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: onClick
+ },
+ drag: {
+ target: "waiting-first-render",
+ action: onClick
+ },
+ reset: StateMachine5.parent,
+ cancel: StateMachine5.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: StateMachine5.parent,
+ action: actionFirstRender
+ }
+ }
+ });
+ this.debug = Debug5.create(true, "annotations");
+ }
+};
+__decorateClass([
+ StateMachineProperty5()
+], CrossLineStateMachine.prototype, "node", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/cross-line/crossLineConfig.ts
+var horizontalLineConfig = {
+ type: "horizontal-line" /* HorizontalLine */,
+ datum: HorizontalLineProperties,
+ scene: CrossLineScene,
+ isDatum: HorizontalLineProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (HorizontalLineProperties.is(datum) && CrossLineScene.is(node))
+ node.translate(datum, translation, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (HorizontalLineProperties.is(datum) && HorizontalLineProperties.is(copiedDatum) && CrossLineScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (HorizontalLineProperties.is(datum) && CrossLineScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new CrossLineStateMachine("horizontal", {
+ ...ctx,
+ create: createDatum("horizontal-line" /* HorizontalLine */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+var verticalLineConfig = {
+ type: "vertical-line" /* VerticalLine */,
+ datum: VerticalLineProperties,
+ scene: CrossLineScene,
+ isDatum: VerticalLineProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (VerticalLineProperties.is(datum) && CrossLineScene.is(node))
+ node.translate(datum, translation, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (VerticalLineProperties.is(datum) && VerticalLineProperties.is(copiedDatum) && CrossLineScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (VerticalLineProperties.is(datum) && CrossLineScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new CrossLineStateMachine("vertical", {
+ ...ctx,
+ create: createDatum("vertical-line" /* VerticalLine */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/disjoint-channel/disjointChannelScene.ts
+var import_ag_charts_community66 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/channelScene.ts
+var import_ag_charts_community65 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/withBackgroundScene.ts
+var import_ag_charts_community64 = require("ag-charts-community");
+var { Vec4: Vec45 } = import_ag_charts_community64._ModuleSupport;
+var WithBackgroundScene = class {
+ static updateBackground(datum, top, bottom, context) {
+ const { background } = this;
+ const { seriesRect } = context;
+ background.path.clear(true);
+ const bounds = Vec45.from(0, 0, seriesRect.width, seriesRect.height);
+ const points = this.getBackgroundPoints(datum, top, bottom, bounds);
+ for (let i = 0; i < points.length; i++) {
+ const point = points[i];
+ if (i === 0) {
+ background.path.moveTo(point.x, point.y);
+ } else {
+ background.path.lineTo(point.x, point.y);
+ }
+ }
+ background.path.closePath();
+ background.checkPathDirty();
+ const backgroundStyles = this.getBackgroundStyles?.(datum) ?? datum.background;
+ background.fill = backgroundStyles.fill;
+ background.fillOpacity = backgroundStyles.fillOpacity ?? 1;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/channelScene.ts
+var ChannelScene = class extends LinearScene {
+ constructor() {
+ super(...arguments);
+ this.handles = {};
+ this.overflowContinuous = 2;
+ this.topLine = new CollidableLine();
+ this.bottomLine = new CollidableLine();
+ this.background = new import_ag_charts_community65._ModuleSupport.Path({ zIndex: -1 });
+ this.anchor = { x: 0, y: 0 };
+ this.updateBackground = WithBackgroundScene.updateBackground.bind(this);
+ }
+ update(datum, context) {
+ const { locked, visible } = datum;
+ const top = convertLine(datum, context);
+ const bottom = convertLine(datum.bottom, context);
+ if (top == null || bottom == null) {
+ this.visible = false;
+ return;
+ } else {
+ this.visible = visible ?? true;
+ }
+ const topLine = this.extendLine(top, datum, context);
+ const bottomLine = this.extendLine(bottom, datum, context);
+ this.updateLines(datum, topLine, bottomLine, context, top, bottom);
+ this.updateHandles(datum, top, bottom);
+ this.updateText(datum, top, bottom);
+ this.updateBackground(datum, topLine, bottomLine, context);
+ this.updateAnchor(top, bottom);
+ for (const handle2 of Object.values(this.handles)) {
+ handle2.toggleLocked(locked ?? false);
+ }
+ }
+ toggleHandles(show) {
+ const { handles } = this;
+ if (typeof show === "boolean") {
+ for (const [handle2, node] of Object.entries(handles)) {
+ node.visible = show;
+ node.toggleHovered(this.activeHandle === handle2);
+ }
+ return;
+ }
+ for (const [handle2, visible] of Object.entries(show)) {
+ const node = handles[handle2];
+ node.visible = visible ?? true;
+ node.toggleHovered(this.activeHandle === handle2);
+ }
+ }
+ toggleActive(active) {
+ this.toggleHandles(active);
+ for (const node of Object.values(this.handles)) {
+ node.toggleActive(active);
+ }
+ }
+ stopDragging() {
+ const { activeHandle, handles } = this;
+ if (activeHandle == null)
+ return;
+ handles[activeHandle].toggleDragging(false);
+ }
+ getAnchor() {
+ return this.anchor;
+ }
+ getCursor() {
+ if (this.activeHandle == null)
+ return "pointer";
+ return this.handles[this.activeHandle].getCursor();
+ }
+ containsPoint(x, y) {
+ const { handles, topLine, bottomLine, text: text2 } = this;
+ this.activeHandle = void 0;
+ for (const [handle2, child] of Object.entries(handles)) {
+ if (child.containsPoint(x, y)) {
+ this.activeHandle = handle2;
+ return true;
+ }
+ }
+ return topLine.containsPoint(x, y) || bottomLine.containsPoint(x, y) || Boolean(text2?.containsPoint(x, y));
+ }
+ getNodeAtCoords(x, y) {
+ if (this.text?.containsPoint(x, y))
+ return "text";
+ if (this.topLine.containsPoint(x, y) || this.bottomLine.containsPoint(x, y))
+ return "line";
+ for (const [, child] of Object.entries(this.handles)) {
+ if (child.containsPoint(x, y))
+ return "handle";
+ }
+ }
+ updateAnchor(top, bottom) {
+ const { x, y } = import_ag_charts_community65._ModuleSupport.Transformable.toCanvasPoint(
+ this.topLine,
+ (top.x1 + top.x2) / 2,
+ Math.min(top.y1, top.y2, bottom.y1, bottom.y2)
+ );
+ this.anchor.x = x;
+ this.anchor.y = y;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/disjoint-channel/disjointChannelScene.ts
+var { Vec2: Vec210, Vec4: Vec46 } = import_ag_charts_community66._ModuleSupport;
+var DisjointChannelScene = class extends ChannelScene {
+ constructor() {
+ super();
+ this.type = "disjoint-channel";
+ this.handles = {
+ topLeft: new DivariantHandle(),
+ topRight: new DivariantHandle(),
+ bottomLeft: new DivariantHandle(),
+ bottomRight: new UnivariantHandle()
+ };
+ this.append([this.background, this.topLine, this.bottomLine, ...Object.values(this.handles)]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "disjoint-channel");
+ }
+ dragHandle(datum, target, context, snapping) {
+ const { activeHandle, handles } = this;
+ if (activeHandle == null)
+ return;
+ const { offset } = handles[activeHandle].drag(target);
+ handles[activeHandle].toggleDragging(true);
+ if (activeHandle === "bottomRight") {
+ offset.x = 0;
+ }
+ let translateVectors = [];
+ let invertYVectors = [];
+ let allowSnapping = snapping;
+ switch (activeHandle) {
+ case "topLeft":
+ translateVectors = ["topLeft"];
+ invertYVectors = ["bottomLeft"];
+ break;
+ case "bottomLeft":
+ translateVectors = ["bottomLeft"];
+ invertYVectors = ["topLeft"];
+ break;
+ case "topRight":
+ translateVectors = ["topRight"];
+ invertYVectors = ["bottomRight"];
+ break;
+ case "bottomRight":
+ translateVectors = ["bottomLeft", "bottomRight"];
+ allowSnapping = false;
+ break;
+ }
+ const top = convertLine(datum, context);
+ const bottom = convertLine(datum.bottom, context);
+ if (!top || !bottom)
+ return;
+ const vectors = {
+ topLeft: Vec46.start(top),
+ topRight: Vec46.end(top),
+ bottomLeft: Vec46.start(bottom),
+ bottomRight: Vec46.end(bottom)
+ };
+ const snap = {
+ vectors: {
+ topLeft: vectors.topRight,
+ bottomLeft: vectors.bottomRight,
+ topRight: vectors.topLeft,
+ bottomRight: vectors.bottomLeft
+ },
+ angle: datum.snapToAngle
+ };
+ const points = translate(vectors, offset, context, {
+ overflowContinuous: this.overflowContinuous,
+ translateVectors,
+ invertYVectors,
+ snap: allowSnapping ? snap : void 0
+ });
+ datum.start.x = points.topLeft.x;
+ datum.start.y = points.topLeft.y;
+ datum.end.x = points.topRight.x;
+ datum.end.y = points.topRight.y;
+ datum.startHeight = points.topLeft.y - points.bottomLeft.y;
+ datum.endHeight = points.topRight.y - points.bottomRight.y;
+ }
+ getTranslatePointsVectors(start, end) {
+ const { bottomLeft, bottomRight, topLeft, topRight } = this.handles;
+ const startHeight = bottomLeft.getBBox().y - topLeft.getBBox().y;
+ const endHeight = bottomRight.getBBox().y - topRight.getBBox().y;
+ const bottomStart = Vec210.add(start, Vec210.from(0, startHeight));
+ const bottomEnd = Vec210.add(end, Vec210.from(0, endHeight));
+ return { start, end, bottomStart, bottomEnd };
+ }
+ updateLines(datum, top, bottom) {
+ const { topLine, bottomLine } = this;
+ const { lineDashOffset, stroke: stroke2, strokeOpacity, strokeWidth } = datum;
+ const lineStyles = {
+ lineCap: datum.getLineCap(),
+ lineDash: datum.getLineDash(),
+ lineDashOffset,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth
+ };
+ topLine.setProperties({ ...top, ...lineStyles });
+ bottomLine.setProperties({ ...bottom, ...lineStyles });
+ }
+ updateHandles(datum, top, bottom) {
+ const {
+ handles: { topLeft, topRight, bottomLeft, bottomRight }
+ } = this;
+ const handleStyles = {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.stroke,
+ strokeOpacity: datum.handle.strokeOpacity ?? datum.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth ?? datum.strokeWidth
+ };
+ topLeft.update({ ...handleStyles, ...Vec46.start(top) });
+ topRight.update({ ...handleStyles, ...Vec46.end(top) });
+ bottomLeft.update({ ...handleStyles, ...Vec46.start(bottom) });
+ bottomRight.update({
+ ...handleStyles,
+ ...Vec210.sub(Vec46.end(bottom), Vec210.from(bottomRight.handle.width / 2, bottomRight.handle.height / 2))
+ });
+ }
+ updateText(datum, top, bottom) {
+ this.text = this.updateNode(CollidableText, this.text, !!datum.text.label);
+ updateChannelText(false, top, bottom, datum.text, datum.strokeWidth, this.text, datum.text.label);
+ }
+ getBackgroundPoints(datum, top, bottom, bounds) {
+ const isFlippedX = top.x1 > top.x2;
+ const isFlippedY = top.y1 > top.y2;
+ const topY = isFlippedY ? bounds.y2 : bounds.y1;
+ const bottomY = isFlippedY ? bounds.y1 : bounds.y2;
+ const points = Vec210.from(top);
+ if (datum.extendEnd && top.y2 === bottomY) {
+ points.push(Vec210.from(isFlippedX ? bounds.x1 : bounds.x2, isFlippedY ? bounds.y1 : bounds.y2));
+ }
+ if (datum.extendEnd && bottom.y2 === topY) {
+ points.push(Vec210.from(isFlippedX ? bounds.x1 : bounds.x2, isFlippedY ? bounds.y2 : bounds.y1));
+ }
+ points.push(...Vec210.from(bottom).reverse());
+ if (datum.extendStart && bottom.y1 === bottomY) {
+ points.push(Vec210.from(isFlippedX ? bounds.x2 : bounds.x1, isFlippedY ? bounds.y1 : bounds.y2));
+ }
+ if (datum.extendStart && top.y1 === topY) {
+ points.push(Vec210.from(isFlippedX ? bounds.x2 : bounds.x1, isFlippedY ? bounds.y2 : bounds.y1));
+ }
+ return points;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/disjoint-channel/disjointChannelState.ts
+var import_ag_charts_community67 = require("ag-charts-community");
+var import_ag_charts_core33 = require("ag-charts-core");
+var { StateMachine: StateMachine6, StateMachineProperty: StateMachineProperty6, Debug: Debug6 } = import_ag_charts_community67._ModuleSupport;
+var DisjointChannelStateMachine = class extends StateMachine6 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = new DisjointChannelProperties();
+ datum.set({ start: point, end: point, startHeight: 0, endHeight: 0 });
+ ctx.create(datum);
+ };
+ const actionFirstRender = () => {
+ const { node } = this;
+ node?.toggleActive(true);
+ node?.toggleHandles({ topLeft: true, topRight: false, bottomLeft: false, bottomRight: false });
+ };
+ const actionEndUpdate = ({ offset, context }) => {
+ const { datum, snapping } = this;
+ if (!datum)
+ return;
+ datum.set({ end: snapPoint(offset, context, snapping, datum.start, datum.snapToAngle) });
+ ctx.update();
+ };
+ const actionEndFinish = () => {
+ this.node?.toggleHandles({ topRight: true });
+ ctx.update();
+ };
+ const actionHeightUpdate = ({ point }) => {
+ const { datum, node } = this;
+ const endY = getGroupingValue(datum?.end.y);
+ const startY = getGroupingValue(datum?.start.y);
+ const { y: pointY } = point;
+ if (datum == null || !(0, import_ag_charts_core33.isNumber)(startY) || !(0, import_ag_charts_core33.isNumber)(endY) || !(0, import_ag_charts_core33.isNumber)(pointY))
+ return;
+ const endHeight = endY - (pointY ?? 0);
+ const startHeight = (startY - endY) * 2 + endHeight;
+ const bottomStart = { x: datum?.start.x, y: startY - startHeight };
+ const bottomEnd = { x: datum?.end.x, y: point.y };
+ node?.toggleHandles({ bottomLeft: true, bottomRight: true });
+ if (!ctx.validatePoint(bottomStart, { overflowContinuous: true }) || !ctx.validatePoint(bottomEnd, { overflowContinuous: true })) {
+ return;
+ }
+ datum.set({ startHeight, endHeight });
+ ctx.update();
+ };
+ const actionHeightFinish = ({ point }) => {
+ const { datum, node } = this;
+ const endY = getGroupingValue(datum?.end.y);
+ const startY = getGroupingValue(datum?.start.y);
+ const { y: pointY } = point;
+ if (datum == null || !(0, import_ag_charts_core33.isNumber)(startY) || !(0, import_ag_charts_core33.isNumber)(endY) || !(0, import_ag_charts_core33.isNumber)(pointY))
+ return;
+ const endHeight = endY - (pointY ?? 0);
+ const startHeight = (startY - endY) * 2 + endHeight;
+ const bottomStart = { x: datum.start.x, y: startY - endHeight };
+ const bottomEnd = { x: datum.end.x, y: point.y };
+ node?.toggleHandles(true);
+ if (!ctx.validatePoint(bottomStart, { overflowContinuous: true }) || !ctx.validatePoint(bottomEnd, { overflowContinuous: true })) {
+ return;
+ }
+ datum.set({ startHeight, endHeight });
+ ctx.recordAction(`Create ${"disjoint-channel" /* DisjointChannel */} annotation`);
+ ctx.showAnnotationOptions();
+ ctx.update();
+ };
+ const actionCancel = () => ctx.delete();
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ drag: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ reset: StateMachine6.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: "end",
+ action: actionFirstRender
+ }
+ },
+ end: {
+ hover: actionEndUpdate,
+ drag: actionEndUpdate,
+ click: {
+ target: "height",
+ action: actionEndFinish
+ },
+ dragEnd: {
+ target: "height",
+ action: actionEndFinish
+ },
+ reset: {
+ target: StateMachine6.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine6.parent,
+ action: actionCancel
+ }
+ },
+ height: {
+ hover: actionHeightUpdate,
+ click: {
+ target: StateMachine6.parent,
+ action: actionHeightFinish
+ },
+ drag: {
+ target: StateMachine6.parent,
+ action: actionHeightFinish
+ },
+ reset: {
+ target: StateMachine6.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine6.parent,
+ action: actionCancel
+ }
+ }
+ });
+ this.debug = Debug6.create(true, "annotations");
+ this.snapping = false;
+ }
+};
+__decorateClass([
+ StateMachineProperty6()
+], DisjointChannelStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty6()
+], DisjointChannelStateMachine.prototype, "node", 2);
+__decorateClass([
+ StateMachineProperty6()
+], DisjointChannelStateMachine.prototype, "snapping", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/disjoint-channel/disjointChannelConfig.ts
+var disjointChannelConfig = {
+ type: "disjoint-channel" /* DisjointChannel */,
+ datum: DisjointChannelProperties,
+ scene: DisjointChannelScene,
+ isDatum: DisjointChannelProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (DisjointChannelProperties.is(datum) && DisjointChannelScene.is(node)) {
+ node.translate(datum, transition, context);
+ }
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (DisjointChannelProperties.is(datum) && DisjointChannelProperties.is(copiedDatum) && DisjointChannelScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (DisjointChannelProperties.is(datum) && DisjointChannelScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new DisjointChannelStateMachine({
+ ...ctx,
+ create: createDatum("disjoint-channel" /* DisjointChannel */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement-trend-based/fibonacciRetracementTrendBasedScene.ts
+var import_ag_charts_community70 = require("ag-charts-community");
+var import_ag_charts_core35 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/fibonacciScene.ts
+var import_ag_charts_community68 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/fibonacci.ts
+var FIBONACCI_RETRACEMENT_RATIOS = [0, 23.6, 38.2, 50, 61.8, 78.6, 100];
+var FIBONACCI_EXTENSION_RATIOS = [161.8, 261.8, 361.8, 423.6];
+var FIBONACCI_RATIOS = [...FIBONACCI_RETRACEMENT_RATIOS, ...FIBONACCI_EXTENSION_RATIOS];
+var FIBONACCI_RATIOS_MAP = {
+ 10: FIBONACCI_RATIOS,
+ 6: FIBONACCI_RETRACEMENT_RATIOS,
+ 4: FIBONACCI_RETRACEMENT_RATIOS.filter((r) => r !== 78.6 && r !== 23.6)
+};
+var FIBONACCI_RANGE_LABEL_PADDING = 10;
+function getFibonacciCoords(coords1, coords2) {
+ const { x2, y1, y2 } = coords1;
+ const trendLineVerticalDistance = y1 - y2;
+ if (coords2 == null) {
+ return {
+ x1: x2,
+ x2,
+ y1: y2 - trendLineVerticalDistance,
+ y2
+ };
+ }
+ return {
+ x1: coords2.x1,
+ x2: coords2.x2,
+ y1: coords2.y2 - trendLineVerticalDistance,
+ y2: coords2.y2
+ };
+}
+function createFibonacciRangesData({ x1, y1, x2, y2 }, context, reverse, yZero, bands = 10) {
+ const verticalDistance = y1 - y2;
+ const direction = reverse ? -1 : 1;
+ let startY = yZero;
+ const data = [];
+ for (const [index, ratio3] of FIBONACCI_RATIOS_MAP[bands].entries()) {
+ const endY = yZero + verticalDistance * (ratio3 / 100) * direction;
+ const yDatumVal = context.yAxis.scaleInvert(endY);
+ data.push({
+ id: index,
+ x1,
+ x2,
+ y1: startY,
+ y2: endY,
+ tag: ratio3 == 100 ? 0 /* OneLine */ : 1 /* HorizontalLine */,
+ label: {
+ x1: Math.min(x1, x2) - FIBONACCI_RANGE_LABEL_PADDING,
+ x2,
+ y1: endY,
+ y2: endY,
+ text: `${(ratio3 / 100).toFixed(3)} (${yDatumVal.toFixed(2)})`
+ }
+ });
+ startY = endY;
+ }
+ return data;
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/fibonacciScene.ts
+var { Vec2: Vec211, Vec4: Vec47 } = import_ag_charts_community68._ModuleSupport;
+var FibonacciScene = class extends AnnotationScene {
+ constructor() {
+ super();
+ this.trendLine = new CollidableLine();
+ this.rangeFillsGroup = new import_ag_charts_community68._ModuleSupport.Group({
+ name: `${this.id}-range-fills`
+ });
+ this.rangeFillsGroupSelection = import_ag_charts_community68._ModuleSupport.Selection.select(this.rangeFillsGroup, import_ag_charts_community68._ModuleSupport.Range);
+ this.rangeStrokesGroup = new import_ag_charts_community68._ModuleSupport.Group({
+ name: `${this.id}-range-strokes`
+ });
+ this.rangeStrokesGroupSelection = import_ag_charts_community68._ModuleSupport.Selection.select(this.rangeStrokesGroup, CollidableLine);
+ this.labelsGroup = new import_ag_charts_community68._ModuleSupport.Group({
+ name: `${this.id}-ranges-labels`
+ });
+ this.labelsGroupSelection = import_ag_charts_community68._ModuleSupport.Selection.select(this.labelsGroup, CollidableText);
+ this.anchor = {
+ x: 0,
+ y: 0,
+ position: "above"
+ };
+ this.append([this.trendLine, this.rangeFillsGroup, this.rangeStrokesGroup, this.labelsGroup]);
+ }
+ update(datum, context) {
+ let coords = convertLine(datum, context);
+ if (coords == null) {
+ this.visible = false;
+ return;
+ }
+ coords = Vec47.round(coords);
+ this.visible = datum.visible ?? true;
+ if (!this.visible)
+ return;
+ this.updateLine(datum, coords, this.trendLine);
+ this.updateHandles(datum, coords);
+ this.updateAnchor(datum, coords, context);
+ const { reverse } = datum;
+ const extendedCoords = this.extendLine(coords, datum, context);
+ const yZero = reverse ? extendedCoords.y1 : extendedCoords.y2;
+ const yOne = reverse ? extendedCoords.y2 : extendedCoords.y1;
+ const data = createFibonacciRangesData(extendedCoords, context, datum.reverse, yZero, datum.bands);
+ this.updateRanges(datum, data, context);
+ const oneLinePoints = { ...extendedCoords, y1: yOne, y2: yOne };
+ this.updateText(datum, oneLinePoints);
+ }
+ extendLine({ x1, y1, x2, y2 }, datum, context) {
+ const linePoints = { x1, y1, x2, y2 };
+ if (!datum.extendStart && !datum.extendEnd) {
+ return linePoints;
+ }
+ const { x, width } = context.xAxis.bounds;
+ if (datum.extendEnd) {
+ linePoints[x1 > x2 ? "x1" : "x2"] = x + width;
+ }
+ if (datum.extendStart) {
+ linePoints[x1 > x2 ? "x2" : "x1"] = x;
+ }
+ return linePoints;
+ }
+ updateLine(datum, coords, line) {
+ if (!coords || !line) {
+ return;
+ }
+ const { lineDashOffset, strokeWidth, strokeOpacity, stroke: stroke2 } = datum;
+ line.setProperties({
+ ...coords,
+ lineCap: datum.getLineCap(),
+ lineDash: [3, 4],
+ lineDashOffset,
+ strokeWidth,
+ strokeOpacity,
+ fillOpacity: 0,
+ stroke: stroke2
+ });
+ }
+ updateRangeStrokes(datum) {
+ const { lineDashOffset, strokeWidth, strokeOpacity, strokes, rangeStroke, isMultiColor } = datum;
+ this.rangeStrokesGroupSelection.each((line, { x1, x2, y2, tag }, index) => {
+ const y = y2;
+ const color6 = isMultiColor ? strokes[index % strokes.length] : rangeStroke;
+ line.setProperties({
+ x1,
+ x2,
+ y1: y,
+ y2: y,
+ stroke: color6,
+ strokeOpacity,
+ strokeWidth,
+ lineCap: datum.getLineCap(),
+ lineDash: datum.getLineDash(),
+ lineDashOffset,
+ tag
+ });
+ });
+ }
+ updateRanges(datum, data, context) {
+ const getDatumId = (d) => d.id;
+ this.rangeFillsGroupSelection.update(data, void 0, getDatumId);
+ this.rangeStrokesGroupSelection.update(data, void 0, getDatumId);
+ this.labelsGroupSelection.update(data, void 0, getDatumId);
+ this.updateRangeFills(datum);
+ this.updateRangeStrokes(datum);
+ this.updateRangeLabels(datum, context);
+ }
+ updateRangeFills(datum) {
+ const {
+ lineDashOffset,
+ strokeWidth,
+ strokeOpacity,
+ strokes: colors,
+ rangeStroke,
+ showFill,
+ isMultiColor
+ } = datum;
+ this.rangeFillsGroupSelection.each((range2, { x1, x2, y1, y2 }, index) => {
+ const color6 = isMultiColor ? colors[index % colors.length] : rangeStroke;
+ if (!showFill) {
+ range2.visible = false;
+ return;
+ }
+ range2.setProperties({
+ x1,
+ x2,
+ y1,
+ y2,
+ startLine: false,
+ endLine: false,
+ stroke: color6,
+ strokeOpacity,
+ fill: color6,
+ fillOpacity: (strokeOpacity ?? 1) * 0.15,
+ strokeWidth,
+ lineCap: datum.getLineCap(),
+ lineDash: datum.getLineDash(),
+ lineDashOffset,
+ visible: true
+ });
+ });
+ }
+ updateRangeLabels(trendLineProperties, { xAxis }) {
+ const { rangeStrokesGroupSelection } = this;
+ const {
+ strokes: colors,
+ strokeWidth,
+ rangeStroke,
+ isMultiColor,
+ label: { fontFamily, fontSize, fontStyle, fontWeight, color: color6 }
+ } = trendLineProperties;
+ const labelProperties = {
+ fontFamily,
+ fontSize,
+ fontStyle,
+ fontWeight
+ };
+ const withinBounds = this.checkWithinBounds(xAxis, labelProperties, this.labelsGroupSelection.at(0));
+ this.labelsGroupSelection.each((textNode, datum, index) => {
+ const textColor = color6 ?? (isMultiColor ? colors[index % colors.length] : rangeStroke);
+ const line = rangeStrokesGroupSelection.at(index);
+ if (!line) {
+ return;
+ }
+ const { text: text2, ...coords } = datum.label;
+ if (withinBounds) {
+ textNode.setProperties({
+ ...labelProperties,
+ text: text2,
+ x: coords.x1,
+ y: coords.y1,
+ textBaseline: "middle",
+ textAlign: "end",
+ fill: textColor
+ });
+ updateLineText(textNode.id, line, coords);
+ } else {
+ const textProperties = {
+ ...labelProperties,
+ label: text2,
+ position: "center",
+ alignment: "left",
+ color: textColor
+ };
+ updateLineText(textNode.id, line, coords, textProperties, textNode, text2, strokeWidth);
+ }
+ });
+ }
+ checkWithinBounds(xAxis, fontOptions, textNode) {
+ if (!textNode) {
+ return false;
+ }
+ const { text: text2, ...coords } = textNode.datum.label;
+ textNode.setProperties({
+ ...fontOptions,
+ text: text2,
+ x: coords.x1,
+ y: coords.y1,
+ textBaseline: "middle",
+ textAlign: "end"
+ });
+ const { x } = textNode.getBBox();
+ return x >= xAxis.bounds.x && x <= xAxis.bounds.x + xAxis.bounds.width;
+ }
+ updateText(datum, coords) {
+ const oneLine = this.rangeStrokesGroupSelection.selectByTag(0 /* OneLine */)[0];
+ if (!oneLine) {
+ return;
+ }
+ const { text: textProperties, strokeWidth } = datum;
+ this.text = this.updateNode(CollidableText, this.text, !!textProperties.label);
+ updateLineText(oneLine.id, oneLine, coords, textProperties, this.text, textProperties.label, strokeWidth);
+ }
+ updateAnchor(_datum, coords, _context, _bbox) {
+ const point = Vec47.topCenter(coords);
+ Vec211.apply(this.anchor, import_ag_charts_community68._ModuleSupport.Transformable.toCanvasPoint(this.trendLine, point.x, point.y));
+ }
+ containsPoint(x, y) {
+ const { trendLine, rangeStrokesGroupSelection, text: text2 } = this;
+ let isInStrokePath = false;
+ rangeStrokesGroupSelection.each((line) => isInStrokePath || (isInStrokePath = line.isPointInPath(x, y)));
+ return isInStrokePath || trendLine.isPointInPath(x, y) || Boolean(text2?.containsPoint(x, y));
+ }
+ getNodeAtCoords(x, y) {
+ if (this.text?.containsPoint(x, y))
+ return "text";
+ if (this.trendLine.isPointInPath(x, y))
+ return "line";
+ }
+ getHandleStyles(datum) {
+ return {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.stroke,
+ strokeOpacity: datum.handle.strokeOpacity ?? datum.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth ?? datum.strokeWidth
+ };
+ }
+ drag(datum, target, context, snapping) {
+ if (!datum.isWriteable())
+ return;
+ if (this.activeHandle) {
+ this.dragHandle(datum, target, context, snapping);
+ } else {
+ this.dragAll(datum, target, context);
+ }
+ }
+ getAnchor() {
+ return this.anchor;
+ }
+ getCursor() {
+ return "pointer";
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/validation.ts
+var import_ag_charts_community69 = require("ag-charts-community");
+var import_ag_charts_core34 = require("ag-charts-core");
+var { ContinuousScale: ContinuousScale3 } = import_ag_charts_community69._ModuleSupport;
+function validateDatumPoint(context, point, options = { overflowContinuous: false }, warningPrefix) {
+ if (point.x == null || point.y == null) {
+ if (warningPrefix) {
+ import_ag_charts_core34.Logger.warnOnce(`${warningPrefix}requires both an [x] and [y] property, ignoring.`);
+ }
+ return false;
+ }
+ const { xAxis, yAxis } = context;
+ const continuousX = options.overflowContinuous && ContinuousScale3.is(xAxis.scale);
+ const continuousY = options.overflowContinuous && ContinuousScale3.is(yAxis.scale);
+ const validX = continuousX || validateDatumPointDirection(point.x, xAxis);
+ const validY = continuousY || validateDatumPointDirection(point.y, yAxis);
+ if (validX && validY)
+ return true;
+ if (warningPrefix) {
+ let text2 = "x & y domains";
+ if (validX)
+ text2 = "y domain";
+ if (validY)
+ text2 = "x domain";
+ const xValue2 = getGroupingValue(point.x);
+ const yValue = getGroupingValue(point.y);
+ import_ag_charts_core34.Logger.warnOnce(`${warningPrefix}is outside the ${text2}, ignoring. - x: [${xValue2}], y: ${yValue}]`);
+ }
+ return false;
+}
+function validateDatumPointDirection(d, context) {
+ const { domain } = context.scale;
+ const value = getGroupingValue(d);
+ if (domain && value != null && context.continuous) {
+ return value >= domain[0] && value <= domain.at(-1);
+ }
+ return true;
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement-trend-based/fibonacciRetracementTrendBasedScene.ts
+var { Vec2: Vec212, Vec4: Vec48 } = import_ag_charts_community70._ModuleSupport;
+var FibonacciRetracementTrendBasedScene = class extends FibonacciScene {
+ constructor() {
+ super();
+ this.type = "fibonacci-retracement-trend-based";
+ this.endRetracementLine = new CollidableLine();
+ this.start = new DivariantHandle();
+ this.end = new DivariantHandle();
+ this.endRetracement = new DivariantHandle();
+ this.append([this.endRetracementLine, this.start, this.end, this.endRetracement]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "fibonacci-retracement-trend-based");
+ }
+ update(datum, context) {
+ let { coords1, coords2 } = this.getCoords(datum, context);
+ if (coords1 == null || coords2 == null) {
+ this.visible = false;
+ return;
+ }
+ coords1 = Vec48.round(coords1);
+ coords2 = Vec48.round(coords2);
+ this.visible = datum.visible ?? true;
+ if (!this.visible)
+ return;
+ if (datum.endRetracement.x == void 0 || datum.endRetracement.y == void 0) {
+ coords2 = void 0;
+ }
+ this.updateLine(datum, coords1, this.trendLine);
+ this.updateLine(datum, coords2, this.endRetracementLine);
+ this.updateHandles(datum, coords1, coords2);
+ this.updateAnchor(datum, coords2 ?? coords1, context);
+ const { reverse, bands } = datum;
+ const coords = getFibonacciCoords(coords1, coords2);
+ const extendedCoords = this.extendLine(coords, datum, context);
+ const yZero = extendedCoords.y2;
+ const yOne = extendedCoords.y1;
+ const data = coords2 ? createFibonacciRangesData(extendedCoords, context, reverse, yZero, bands) : [];
+ this.updateRanges(datum, data, context);
+ const oneLinePoints = { ...extendedCoords, y1: yOne, y2: yOne };
+ this.updateText(datum, oneLinePoints);
+ }
+ containsPoint(x, y) {
+ const { start, end, endRetracement, endRetracementLine } = this;
+ this.activeHandle = void 0;
+ if (start.containsPoint(x, y)) {
+ this.activeHandle = "start";
+ return true;
+ }
+ if (end.containsPoint(x, y)) {
+ this.activeHandle = "end";
+ return true;
+ }
+ if (endRetracement.containsPoint(x, y)) {
+ this.activeHandle = "endRetracement";
+ return true;
+ }
+ return endRetracementLine.isPointInPath(x, y) || super.containsPoint(x, y);
+ }
+ getNodeAtCoords(x, y) {
+ if (this.start.containsPoint(x, y) || this.end.containsPoint(x, y) || this.endRetracement.containsPoint(x, y))
+ return "handle";
+ if (this.endRetracementLine.isPointInPath(x, y))
+ return "line";
+ return super.getNodeAtCoords(x, y);
+ }
+ dragStart(datum, target, context) {
+ this.dragState = {
+ offset: target,
+ ...getDragStartState({ start: datum.start, end: datum.end, endRetracement: datum.endRetracement }, context)
+ };
+ }
+ stopDragging() {
+ this.start.toggleDragging(false);
+ this.end.toggleDragging(false);
+ this.endRetracement.toggleDragging(false);
+ }
+ dragAll(datum, target, context) {
+ const { dragState } = this;
+ if (!dragState)
+ return;
+ this.translatePoints({
+ datum,
+ start: dragState.start,
+ end: dragState.end,
+ endRetracement: dragState.endRetracement,
+ translation: Vec212.sub(target, dragState.offset),
+ context
+ });
+ }
+ dragHandle(datum, target, context, snapping) {
+ const { activeHandle, dragState } = this;
+ if (!activeHandle || !dragState)
+ return;
+ this[activeHandle].toggleDragging(true);
+ const point = snapping ? this.snapToAngle(datum, target, context) : invertCoords(this[activeHandle].drag(target).point, context);
+ if (!point || !validateDatumPoint(context, point))
+ return;
+ datum[activeHandle].x = point.x;
+ datum[activeHandle].y = point.y;
+ }
+ snapToAngle(datum, coords, context) {
+ const { activeHandle } = this;
+ const handles = ["start", "end", "endRetracement"];
+ if (!activeHandle)
+ return;
+ const index = (handles.indexOf(activeHandle) + 1) % handles.length;
+ const fixedHandle = handles[index];
+ this[activeHandle].toggleDragging(true);
+ const fixed = convertPoint(datum[fixedHandle], context);
+ return invertCoords(snapToAngle(coords, fixed, datum.snapToAngle), context);
+ }
+ translatePoints({
+ datum,
+ start,
+ end,
+ endRetracement,
+ translation,
+ context
+ }) {
+ const points = translate({ start, end, endRetracement }, translation, context, { overflowContinuous: 2 });
+ datum.start.x = points.start.x;
+ datum.end.x = points.end.x;
+ datum.endRetracement.x = points.endRetracement.x;
+ datum.start.y = points.start.y;
+ datum.end.y = points.end.y;
+ datum.endRetracement.y = points.endRetracement.y;
+ }
+ translate(datum, translation, context) {
+ this.translatePoints({
+ datum,
+ start: convertPoint(datum.start, context),
+ end: convertPoint(datum.end, context),
+ endRetracement: convertPoint(datum.endRetracement, context),
+ translation,
+ context
+ });
+ }
+ copy(datum, copiedDatum, context) {
+ const { coords1, coords2 } = this.getCoords(datum, context);
+ if (!coords1 || !coords2) {
+ return;
+ }
+ const bbox = this.computeBBoxWithoutHandles();
+ this.translatePoints({
+ datum: copiedDatum,
+ start: Vec48.start(coords1),
+ end: Vec48.end(coords1),
+ endRetracement: Vec48.end(coords2),
+ translation: { x: -bbox.width / 2, y: -bbox.height / 2 },
+ context
+ });
+ return copiedDatum;
+ }
+ getCoords(datum, context) {
+ return {
+ coords1: convertLine(datum, context),
+ coords2: convertLine({ start: datum.end, end: datum.endRetracement }, context)
+ };
+ }
+ toggleHandles(show) {
+ if (typeof show === "boolean") {
+ this.start.visible = show;
+ this.end.visible = show;
+ this.endRetracement.visible = show;
+ } else {
+ for (const [handle2, visible] of (0, import_ag_charts_core35.entries)(show)) {
+ this[handle2].visible = visible;
+ }
+ }
+ this.start.toggleHovered(this.activeHandle === "start");
+ this.end.toggleHovered(this.activeHandle === "end");
+ this.endRetracement.toggleHovered(this.activeHandle === "endRetracement");
+ }
+ toggleActive(active) {
+ this.toggleHandles(active);
+ this.start.toggleActive(active);
+ this.end.toggleActive(active);
+ this.endRetracement.toggleActive(active);
+ }
+ updateHandles(datum, coords1, coords2, bbox) {
+ this.start.update({
+ ...this.getHandleStyles(datum),
+ ...this.getHandleCoords(datum, coords1, "start")
+ });
+ this.end.update({
+ ...this.getHandleStyles(datum),
+ ...this.getHandleCoords(datum, coords1, "end", bbox)
+ });
+ if (coords2) {
+ this.endRetracement.update({
+ ...this.getHandleStyles(datum),
+ ...this.getHandleCoords(datum, coords2, "endRetracement", bbox)
+ });
+ }
+ this.start.toggleLocked(datum.locked ?? false);
+ this.end.toggleLocked(datum.locked ?? false);
+ this.endRetracement.toggleLocked(datum.locked ?? false);
+ }
+ getHandleCoords(_datum, coords, handle2, _bbox) {
+ return handle2 === "start" ? Vec48.start(coords) : Vec48.end(coords);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement-trend-based/fibonacciRetracementTrendBasedState.ts
+var import_ag_charts_community71 = require("ag-charts-community");
+var { StateMachine: StateMachine7, StateMachineProperty: StateMachineProperty7, Debug: Debug7 } = import_ag_charts_community71._ModuleSupport;
+var FibonacciRetracementTrendBasedStateMachine = class extends StateMachine7 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = this.createDatum();
+ datum.set({ start: point, end: point });
+ ctx.create(datum);
+ };
+ const actionFirstRender = () => {
+ const { node } = this;
+ node?.toggleActive(true);
+ node?.toggleHandles({ start: true, end: false, endRetracement: false });
+ };
+ const actionEndUpdate = ({ offset, context }) => {
+ const { datum, snapping } = this;
+ if (!datum)
+ return;
+ datum.set({ end: snapPoint(offset, context, snapping, datum.start, datum.snapToAngle) });
+ ctx.update();
+ };
+ const actionEndFinish = () => {
+ const { datum } = this;
+ if (!datum)
+ return;
+ datum.endRetracement.x = datum.end.x;
+ datum.endRetracement.y = datum.end.y;
+ this.node?.toggleHandles({ end: true });
+ ctx.update();
+ };
+ const actionEndRetracementUpdate = ({
+ offset,
+ context
+ }) => {
+ const { datum, snapping } = this;
+ if (!datum)
+ return;
+ datum.set({ endRetracement: snapPoint(offset, context, snapping, datum.end, datum.snapToAngle) });
+ ctx.update();
+ };
+ const actionEndRetracementFinish = () => {
+ this.node?.toggleHandles({ endRetracement: true });
+ ctx.update();
+ };
+ const actionCancel = () => ctx.delete();
+ const onExitEnd = () => {
+ ctx.showAnnotationOptions();
+ ctx.recordAction(`Create ${this.datum?.type} annotation`);
+ };
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ drag: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ reset: StateMachine7.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: "end",
+ action: actionFirstRender
+ }
+ },
+ end: {
+ hover: actionEndUpdate,
+ click: {
+ target: "endRetracement",
+ action: actionEndFinish
+ },
+ drag: actionEndUpdate,
+ dragEnd: {
+ target: "endRetracement",
+ action: actionEndFinish
+ },
+ reset: {
+ target: StateMachine7.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine7.parent,
+ action: actionCancel
+ },
+ onExit: onExitEnd
+ },
+ endRetracement: {
+ hover: actionEndRetracementUpdate,
+ click: {
+ target: StateMachine7.parent,
+ action: actionEndRetracementFinish
+ },
+ drag: {
+ target: StateMachine7.parent,
+ action: actionEndRetracementFinish
+ },
+ reset: {
+ target: StateMachine7.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine7.parent,
+ action: actionCancel
+ }
+ }
+ });
+ this.debug = Debug7.create(true, "annotations");
+ this.snapping = false;
+ }
+ createDatum() {
+ return new FibonacciRetracementTrendBasedProperties();
+ }
+};
+__decorateClass([
+ StateMachineProperty7()
+], FibonacciRetracementTrendBasedStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty7()
+], FibonacciRetracementTrendBasedStateMachine.prototype, "node", 2);
+__decorateClass([
+ StateMachineProperty7()
+], FibonacciRetracementTrendBasedStateMachine.prototype, "snapping", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement-trend-based/fibonacciRetracementTrendBasedConfig.ts
+var fibonacciRetracementTrendBasedConfig = {
+ type: "fibonacci-retracement-trend-based" /* FibonacciRetracementTrendBased */,
+ datum: FibonacciRetracementTrendBasedProperties,
+ scene: FibonacciRetracementTrendBasedScene,
+ isDatum: FibonacciRetracementTrendBasedProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (FibonacciRetracementTrendBasedProperties.is(datum) && FibonacciRetracementTrendBasedScene.is(node))
+ node.translate(datum, transition, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (FibonacciRetracementTrendBasedProperties.is(datum) && FibonacciRetracementTrendBasedProperties.is(copiedDatum) && FibonacciRetracementTrendBasedScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (FibonacciRetracementTrendBasedProperties.is(datum) && FibonacciRetracementTrendBasedScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new FibonacciRetracementTrendBasedStateMachine({
+ ...ctx,
+ create: createDatum("fibonacci-retracement-trend-based" /* FibonacciRetracementTrendBased */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement/fibonacciRetracementScene.ts
+var import_ag_charts_community72 = require("ag-charts-community");
+var import_ag_charts_core36 = require("ag-charts-core");
+var { Vec2: Vec213, Vec4: Vec49 } = import_ag_charts_community72._ModuleSupport;
+var FibonacciRetracementScene = class extends FibonacciScene {
+ constructor() {
+ super();
+ this.type = "fibonacci-retracement";
+ this.start = new DivariantHandle();
+ this.end = new DivariantHandle();
+ this.append([this.start, this.end]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "fibonacci-retracement");
+ }
+ containsPoint(x, y) {
+ const { start, end } = this;
+ this.activeHandle = void 0;
+ if (start.containsPoint(x, y)) {
+ this.activeHandle = "start";
+ return true;
+ }
+ if (end.containsPoint(x, y)) {
+ this.activeHandle = "end";
+ return true;
+ }
+ return super.containsPoint(x, y);
+ }
+ getNodeAtCoords(x, y) {
+ if (this.start.containsPoint(x, y) || this.end.containsPoint(x, y))
+ return "handle";
+ return super.getNodeAtCoords(x, y);
+ }
+ dragStart(datum, target, context) {
+ this.dragState = {
+ offset: target,
+ ...getDragStartState({ start: datum.start, end: datum.end }, context)
+ };
+ }
+ stopDragging() {
+ this.start.toggleDragging(false);
+ this.end.toggleDragging(false);
+ }
+ dragAll(datum, target, context) {
+ const { dragState } = this;
+ if (!dragState)
+ return;
+ this.translatePoints({
+ datum,
+ start: dragState.start,
+ end: dragState.end,
+ translation: Vec213.sub(target, dragState.offset),
+ context
+ });
+ }
+ dragHandle(datum, target, context, snapping) {
+ const { activeHandle, dragState } = this;
+ if (!activeHandle || !dragState)
+ return;
+ this[activeHandle].toggleDragging(true);
+ const point = snapping ? this.snapToAngle(datum, target, context) : invertCoords(this[activeHandle].drag(target).point, context);
+ if (!point || !validateDatumPoint(context, point))
+ return;
+ datum[activeHandle].x = point.x;
+ datum[activeHandle].y = point.y;
+ }
+ snapToAngle(datum, coords, context) {
+ const { activeHandle } = this;
+ const handles = ["start", "end"];
+ const fixedHandle = handles.find((handle2) => handle2 !== activeHandle);
+ if (!activeHandle || !fixedHandle)
+ return;
+ this[activeHandle].toggleDragging(true);
+ const fixed = convertPoint(datum[fixedHandle], context);
+ return invertCoords(snapToAngle(coords, fixed, datum.snapToAngle), context);
+ }
+ translatePoints({
+ datum,
+ start,
+ end,
+ translation,
+ context
+ }) {
+ const points = translate({ start, end }, translation, context, { overflowContinuous: 1 });
+ datum.start.x = points.start.x;
+ datum.end.x = points.end.x;
+ datum.start.y = points.start.y;
+ datum.end.y = points.end.y;
+ }
+ translate(datum, translation, context) {
+ this.translatePoints({
+ datum,
+ start: convertPoint(datum.start, context),
+ end: convertPoint(datum.end, context),
+ translation,
+ context
+ });
+ }
+ copy(datum, copiedDatum, context) {
+ const coords = convertLine(datum, context);
+ if (!coords) {
+ return;
+ }
+ const bbox = this.computeBBoxWithoutHandles();
+ this.translatePoints({
+ datum: copiedDatum,
+ start: { x: coords.x1, y: coords.y1 },
+ end: { x: coords.x2, y: coords.y2 },
+ translation: { x: -bbox.width / 2, y: -bbox.height / 2 },
+ context
+ });
+ return copiedDatum;
+ }
+ toggleHandles(show) {
+ if (typeof show === "boolean") {
+ this.start.visible = show;
+ this.end.visible = show;
+ } else {
+ for (const [handle2, visible] of (0, import_ag_charts_core36.entries)(show)) {
+ this[handle2].visible = visible;
+ }
+ }
+ this.start.toggleHovered(this.activeHandle === "start");
+ this.end.toggleHovered(this.activeHandle === "end");
+ }
+ toggleActive(active) {
+ this.toggleHandles(active);
+ this.start.toggleActive(active);
+ this.end.toggleActive(active);
+ }
+ updateHandles(datum, coords, _coords2, bbox) {
+ this.start.update({
+ ...this.getHandleStyles(datum),
+ ...this.getHandleCoords(datum, coords, "start")
+ });
+ this.end.update({
+ ...this.getHandleStyles(datum),
+ ...this.getHandleCoords(datum, coords, "end", bbox)
+ });
+ this.start.toggleLocked(datum.locked ?? false);
+ this.end.toggleLocked(datum.locked ?? false);
+ }
+ getHandleCoords(_datum, coords, handle2, _bbox) {
+ return handle2 === "start" ? Vec49.start(coords) : Vec49.end(coords);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/line/lineState.ts
+var import_ag_charts_community73 = require("ag-charts-community");
+var { StateMachine: StateMachine8, StateMachineProperty: StateMachineProperty8, Debug: Debug8 } = import_ag_charts_community73._ModuleSupport;
+var LineTypeStateMachine = class extends StateMachine8 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = this.createDatum();
+ datum.set({ start: point, end: point });
+ ctx.create(datum);
+ };
+ const actionFirstRender = () => {
+ const { node } = this;
+ node?.toggleActive(true);
+ node?.toggleHandles({ start: true, end: false });
+ };
+ const actionEndUpdate = ({ offset, context }) => {
+ const { datum, snapping } = this;
+ if (!datum)
+ return;
+ datum.set({ end: snapPoint(offset, context, snapping, datum.start, datum.snapToAngle) });
+ ctx.update();
+ };
+ const actionEndFinish = () => {
+ this.node?.toggleHandles({ end: true });
+ ctx.update();
+ };
+ const actionCancel = () => ctx.delete();
+ const onExitEnd = () => {
+ ctx.showAnnotationOptions();
+ ctx.recordAction(`Create ${this.datum?.type} annotation`);
+ };
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ drag: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ reset: StateMachine8.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: "end",
+ action: actionFirstRender
+ }
+ },
+ end: {
+ hover: actionEndUpdate,
+ click: {
+ target: StateMachine8.parent,
+ action: actionEndFinish
+ },
+ drag: actionEndUpdate,
+ dragEnd: {
+ target: StateMachine8.parent,
+ action: actionEndFinish
+ },
+ reset: {
+ target: StateMachine8.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine8.parent,
+ action: actionCancel
+ },
+ onExit: onExitEnd
+ }
+ });
+ this.debug = Debug8.create(true, "annotations");
+ this.snapping = false;
+ }
+};
+__decorateClass([
+ StateMachineProperty8()
+], LineTypeStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty8()
+], LineTypeStateMachine.prototype, "node", 2);
+__decorateClass([
+ StateMachineProperty8()
+], LineTypeStateMachine.prototype, "snapping", 2);
+var ArrowStateMachine = class extends LineTypeStateMachine {
+ createDatum() {
+ return new ArrowProperties();
+ }
+};
+var LineStateMachine = class extends LineTypeStateMachine {
+ createDatum() {
+ return new LineProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement/fibonacciRetracementState.ts
+var FibonacciRetracementStateMachine = class extends LineTypeStateMachine {
+ createDatum() {
+ return new FibonacciRetracementProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/fibonacci-retracement/fibonacciRetracementConfig.ts
+var fibonacciRetracementConfig = {
+ type: "fibonacci-retracement" /* FibonacciRetracement */,
+ datum: FibonacciRetracementProperties,
+ scene: FibonacciRetracementScene,
+ isDatum: FibonacciRetracementProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (FibonacciRetracementProperties.is(datum) && FibonacciRetracementScene.is(node))
+ node.translate(datum, transition, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (FibonacciRetracementProperties.is(datum) && FibonacciRetracementProperties.is(copiedDatum) && FibonacciRetracementScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (FibonacciRetracementProperties.is(datum) && FibonacciRetracementScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new FibonacciRetracementStateMachine({
+ ...ctx,
+ create: createDatum("fibonacci-retracement" /* FibonacciRetracement */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/line/lineScene.ts
+var import_ag_charts_community75 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/scenes/capScene.ts
+var import_ag_charts_community74 = require("ag-charts-community");
+var { Vec2: Vec214 } = import_ag_charts_community74._ModuleSupport;
+var CapScene = class extends import_ag_charts_community74._ModuleSupport.Group {
+};
+var ArrowCapScene = class extends CapScene {
+ constructor() {
+ super();
+ this.type = "arrow";
+ this.path = new import_ag_charts_community74._ModuleSupport.Path();
+ this.armLength = 6;
+ this.append([this.path]);
+ }
+ update(options) {
+ const { path } = this;
+ const { x, y, angle, ...rest } = options;
+ const origin = Vec214.from(x, y);
+ const offsetAngle = 3 * Math.PI / 4;
+ const armLength = this.armLength + (options.strokeWidth ?? 0) * 2;
+ const leftEnd = Vec214.rotate(Vec214.from(0, armLength), angle + offsetAngle, origin);
+ const rightEnd = Vec214.rotate(Vec214.from(armLength, 0), angle - offsetAngle, origin);
+ path.setProperties(rest);
+ path.fillOpacity = 0;
+ path.path.clear();
+ path.path.moveTo(leftEnd.x, leftEnd.y);
+ path.path.lineTo(origin.x, origin.y);
+ path.path.lineTo(rightEnd.x, rightEnd.y);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/line/lineScene.ts
+var { Vec2: Vec215, Vec4: Vec410 } = import_ag_charts_community75._ModuleSupport;
+var LineScene = class extends StartEndScene {
+ constructor() {
+ super();
+ this.type = "line";
+ this.line = new CollidableLine();
+ this.append([this.line, this.start, this.end]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "line");
+ }
+ update(datum, context) {
+ let coords = convertLine(datum, context);
+ if (coords == null) {
+ this.visible = false;
+ return;
+ }
+ coords = Vec410.round(coords);
+ this.visible = datum.visible ?? true;
+ if (!this.visible)
+ return;
+ this.updateLine(datum, coords, context);
+ this.updateHandles(datum, coords);
+ this.updateText(datum, coords);
+ this.updateCaps(datum, coords);
+ this.updateAnchor(datum, coords, context);
+ }
+ updateLine(datum, coords, context) {
+ const { line } = this;
+ const { lineDashOffset, stroke: stroke2, strokeWidth, strokeOpacity } = datum;
+ const linePoints = this.extendLine(coords, datum, context);
+ line.setProperties({
+ ...linePoints,
+ lineCap: datum.getLineCap(),
+ lineDash: datum.getLineDash(),
+ lineDashOffset,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ fillOpacity: 0
+ });
+ }
+ updateText(datum, coords) {
+ this.text = this.updateNode(CollidableText, this.text, !!datum.text.label);
+ updateLineText(this.line.id, this.line, coords, datum.text, this.text, datum.text.label, datum.strokeWidth);
+ }
+ updateCaps(datum, coords) {
+ if (!datum.startCap && this.startCap) {
+ this.startCap.remove();
+ this.startCap = void 0;
+ }
+ if (!datum.endCap && this.endCap) {
+ this.endCap.remove();
+ this.endCap = void 0;
+ }
+ if (!datum.startCap && !datum.endCap)
+ return;
+ const { stroke: stroke2, strokeWidth, strokeOpacity } = datum;
+ const [start, end] = Vec215.from(coords);
+ const angle = Vec215.angle(Vec215.sub(end, start));
+ if (datum.startCap) {
+ if (this.startCap && this.startCap.type !== datum.startCap) {
+ this.startCap.remove();
+ this.startCap = void 0;
+ }
+ if (this.startCap == null) {
+ this.startCap = new ArrowCapScene();
+ this.append([this.startCap]);
+ }
+ this.startCap.update({
+ x: start.x,
+ y: start.y,
+ angle: angle - Math.PI,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity
+ });
+ }
+ if (datum.endCap) {
+ if (this.endCap && this.endCap.type !== datum.endCap) {
+ this.endCap.remove();
+ this.endCap = void 0;
+ }
+ if (this.endCap == null) {
+ this.endCap = new ArrowCapScene();
+ this.append([this.endCap]);
+ }
+ this.endCap.update({
+ x: end.x,
+ y: end.y,
+ angle,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity
+ });
+ }
+ }
+ updateAnchor(_datum, coords, _context, _bbox) {
+ const point = Vec410.topCenter(coords);
+ Vec215.apply(this.anchor, import_ag_charts_community75._ModuleSupport.Transformable.toCanvasPoint(this.line, point.x, point.y));
+ }
+ containsPoint(x, y) {
+ const { line, text: text2 } = this;
+ return super.containsPoint(x, y) || line.isPointInPath(x, y) || Boolean(text2?.containsPoint(x, y));
+ }
+ getNodeAtCoords(x, y) {
+ if (this.text?.containsPoint(x, y))
+ return "text";
+ if (this.line.isPointInPath(x, y))
+ return "line";
+ return super.getNodeAtCoords(x, y);
+ }
+ getHandleCoords(_datum, coords, handle2, _bbox) {
+ const { startCap, endCap } = this;
+ let [startPoint, endPoint] = Vec215.from(coords);
+ const angle = Vec215.angle(Vec215.sub(endPoint, startPoint));
+ if (startCap) {
+ startPoint = Vec215.rotate(Vec215.from(0, -DivariantHandle.HANDLE_SIZE / 2), angle, startPoint);
+ }
+ if (endCap) {
+ endPoint = Vec215.rotate(Vec215.from(0, DivariantHandle.HANDLE_SIZE / 2), angle, endPoint);
+ }
+ return handle2 === "start" ? startPoint : endPoint;
+ }
+ getHandleStyles(datum) {
+ return {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.stroke,
+ strokeOpacity: datum.handle.strokeOpacity ?? datum.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth ?? datum.strokeWidth
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/line/lineConfig.ts
+var lineConfig = {
+ type: "line" /* Line */,
+ datum: LineProperties,
+ scene: LineScene,
+ isDatum: LineProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (LineProperties.is(datum) && LineScene.is(node))
+ node.translate(datum, transition, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (LineProperties.is(datum) && LineProperties.is(copiedDatum) && LineScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (LineProperties.is(datum) && LineScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new LineStateMachine({
+ ...ctx,
+ create: createDatum("line" /* Line */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+var arrowConfig = {
+ type: "arrow" /* Arrow */,
+ datum: ArrowProperties,
+ scene: LineScene,
+ isDatum: ArrowProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (ArrowProperties.is(datum) && LineScene.is(node))
+ node.translate(datum, transition, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (ArrowProperties.is(datum) && ArrowProperties.is(copiedDatum) && LineScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (ArrowProperties.is(datum) && LineScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new ArrowStateMachine({
+ ...ctx,
+ create: createDatum("arrow" /* Arrow */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerScene.ts
+var import_ag_charts_community78 = require("ag-charts-community");
+var import_ag_charts_core37 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerStatisticsScene.ts
+var import_ag_charts_community77 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/layout.ts
+var import_ag_charts_community76 = require("ag-charts-community");
+function layoutScenesRow(scenes, startX = 0, gap = 0) {
+ let x = startX;
+ for (const scene of scenes) {
+ if (Array.isArray(scene)) {
+ for (const scene_ of scene) {
+ layoutSetX(scene_, x);
+ }
+ x += import_ag_charts_community76._ModuleSupport.Group.computeChildrenBBox(scene).width + gap;
+ } else {
+ layoutSetX(scene, x);
+ x += scene.getBBox().width + gap;
+ }
+ }
+}
+function layoutScenesColumn(scenes, startY = 0, gap = 0) {
+ let y = startY;
+ for (const scene of scenes) {
+ if (Array.isArray(scene)) {
+ for (const scene_ of scene) {
+ layoutSetY(scene_, y);
+ }
+ y += import_ag_charts_community76._ModuleSupport.Group.computeChildrenBBox(scene).height + gap;
+ } else {
+ layoutSetY(scene, y);
+ y += scene.getBBox().height + gap;
+ }
+ }
+}
+function layoutSetX(scene, x) {
+ if ("x1" in scene) {
+ scene.x2 = x + (scene.x2 - scene.x1);
+ scene.x1 = x;
+ } else {
+ scene.x = x;
+ }
+}
+function layoutSetY(scene, y) {
+ if ("y1" in scene) {
+ scene.y2 = y + (scene.y2 - scene.y1);
+ scene.y1 = y;
+ } else {
+ scene.y = y;
+ }
+}
+function layoutAddX(scene, x) {
+ if ("x1" in scene) {
+ scene.x1 += x;
+ scene.x2 += x;
+ } else {
+ scene.x += x;
+ }
+}
+function layoutAddY(scene, y) {
+ if ("y1" in scene) {
+ scene.y1 += y;
+ scene.y2 += y;
+ } else {
+ scene.y += y;
+ }
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerStatisticsScene.ts
+var { Vec4: Vec411 } = import_ag_charts_community77._ModuleSupport;
+var MeasurerStatisticsScene = class extends import_ag_charts_community77._ModuleSupport.Group {
+ constructor() {
+ super();
+ this.name = "MeasurerStatisticsScene";
+ this.background = new import_ag_charts_community77._ModuleSupport.Rect();
+ this.dateRangeBarsText = new import_ag_charts_community77._ModuleSupport.Text();
+ this.dateRangeDivider = new import_ag_charts_community77._ModuleSupport.Line();
+ this.dateRangeValueText = new import_ag_charts_community77._ModuleSupport.Text();
+ this.priceRangeValueText = new import_ag_charts_community77._ModuleSupport.Text();
+ this.priceRangeDivider = new import_ag_charts_community77._ModuleSupport.Line();
+ this.priceRangePercentageText = new import_ag_charts_community77._ModuleSupport.Text();
+ this.volumeText = new import_ag_charts_community77._ModuleSupport.Text();
+ this.volumeFormatter = new Intl.NumberFormat("en-US", {
+ notation: "compact",
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ });
+ this.append([
+ this.background,
+ this.dateRangeBarsText,
+ this.dateRangeDivider,
+ this.dateRangeValueText,
+ this.priceRangeValueText,
+ this.priceRangeDivider,
+ this.priceRangePercentageText,
+ this.volumeText
+ ]);
+ }
+ update(datum, stats, anchor, coords, context, verticalDirection, localeManager) {
+ this.verticalDirection = verticalDirection;
+ const scenes = this.updateStatistics(datum, stats, anchor, localeManager);
+ const bbox = import_ag_charts_community77._ModuleSupport.Group.computeChildrenBBox(scenes.flat());
+ const padding = 10;
+ bbox.grow(padding);
+ this.updateBackground(datum, bbox, padding);
+ this.reposition(scenes, padding, context);
+ this.checkVisibility(datum, context, coords);
+ }
+ checkVisibility(datum, context, coords) {
+ const bounds = Vec411.from(new import_ag_charts_community77._ModuleSupport.BBox(0, 0, context.seriesRect.width, context.seriesRect.height));
+ if (Vec411.collides(coords, bounds)) {
+ this.visible = datum.visible ?? true;
+ } else {
+ this.visible = false;
+ }
+ }
+ updateStatistics(datum, stats, anchor, localeManager) {
+ const {
+ dateRangeBarsText,
+ dateRangeDivider,
+ dateRangeValueText,
+ priceRangeValueText,
+ priceRangeDivider,
+ priceRangePercentageText,
+ volumeText
+ } = this;
+ const horizontalGap = 8;
+ const verticalGap = 6;
+ const dividerLineHeight = datum.statistics.fontSize + 3;
+ const dividerLineOffset = -2;
+ const textStyles = this.getTextStyles(datum);
+ const dividerLineStyles = {
+ ...this.getDividerStyles(datum),
+ x1: 0,
+ y1: 0,
+ x2: 0,
+ y2: dividerLineHeight
+ };
+ const dateScenes = [dateRangeBarsText, dateRangeDivider, dateRangeValueText];
+ const priceScenes = [priceRangeValueText, priceRangeDivider, priceRangePercentageText];
+ const scenes = [];
+ if (stats.priceRange) {
+ priceRangeValueText.setProperties({
+ ...textStyles,
+ text: this.formatPriceRangeValue(stats.priceRange.value, localeManager)
+ });
+ priceRangeDivider.setProperties(dividerLineStyles);
+ priceRangePercentageText.setProperties({
+ ...textStyles,
+ text: this.formatPriceRangePercentage(stats.priceRange.percentage, localeManager)
+ });
+ layoutScenesRow(priceScenes, anchor.x, horizontalGap);
+ scenes.push(priceScenes);
+ }
+ if (stats.dateRange) {
+ dateRangeBarsText.setProperties({
+ ...textStyles,
+ text: this.formatDateRangeBars(stats.dateRange.bars, localeManager)
+ });
+ dateRangeDivider.setProperties(dividerLineStyles);
+ dateRangeValueText.setProperties({
+ ...textStyles,
+ text: this.formatDateRangeValue(stats.dateRange.value)
+ });
+ layoutScenesRow(dateScenes, anchor.x, horizontalGap);
+ scenes.push(dateScenes);
+ }
+ if (stats.volume == null) {
+ volumeText.visible = false;
+ } else {
+ volumeText.setProperties({
+ ...textStyles,
+ x: anchor.x,
+ text: this.formatVolume(stats.volume, localeManager),
+ visible: true
+ });
+ scenes.push(volumeText);
+ }
+ layoutScenesColumn(scenes, anchor.y, verticalGap);
+ priceRangeDivider.y1 += dividerLineOffset;
+ priceRangeDivider.y2 += dividerLineOffset;
+ dateRangeDivider.y1 += dividerLineOffset;
+ dateRangeDivider.y2 += dividerLineOffset;
+ return scenes;
+ }
+ updateBackground(datum, bbox, padding) {
+ const styles = this.getBackgroundStyles(datum);
+ this.background.setProperties({
+ ...styles,
+ ...bbox,
+ x: bbox.x - bbox.width / 2 + padding,
+ y: bbox.y
+ });
+ }
+ reposition(scenes, padding, context) {
+ const { width, height } = context.seriesRect;
+ const background = Vec411.from(this.background.getBBox());
+ let offsetX = 0;
+ if (background.x1 < 0)
+ offsetX = -background.x1;
+ if (background.x2 > width)
+ offsetX = width - background.x2;
+ const offsetY = Math.min(padding, height - background.y2);
+ for (const scene of scenes) {
+ if (Array.isArray(scene)) {
+ const rowWidth = import_ag_charts_community77._ModuleSupport.Group.computeChildrenBBox(scene).width;
+ for (const scene_ of scene) {
+ layoutAddX(scene_, offsetX - rowWidth / 2);
+ layoutAddY(scene_, offsetY);
+ }
+ } else {
+ layoutAddX(scene, offsetX - scene.getBBox().width / 2);
+ layoutAddY(scene, offsetY);
+ }
+ }
+ this.background.x += offsetX;
+ this.background.y += offsetY;
+ }
+ getTextStyles(datum) {
+ return {
+ fill: datum.statistics.color,
+ fontFamily: datum.statistics.fontFamily,
+ fontSize: datum.statistics.fontSize,
+ fontStyle: datum.statistics.fontStyle,
+ fontWeight: datum.statistics.fontWeight,
+ textBaseline: "top"
+ };
+ }
+ getDividerStyles(datum) {
+ return {
+ stroke: datum.statistics.divider.stroke,
+ strokeOpacity: datum.statistics.divider.strokeOpacity,
+ strokeWidth: datum.statistics.divider.strokeWidth
+ };
+ }
+ getBackgroundStyles(datum) {
+ return {
+ fill: datum.statistics.fill,
+ stroke: datum.statistics.stroke,
+ strokeOpacity: datum.statistics.strokeOpacity,
+ strokeWidth: datum.statistics.strokeWidth,
+ cornerRadius: 4
+ };
+ }
+ formatDateRangeBars(bars, localeManager) {
+ return localeManager?.t("measurerDateRangeBars", { value: bars }) ?? `${bars}`;
+ }
+ formatDateRangeValue(time) {
+ const range2 = [];
+ const sign = time >= 0 ? "" : "-";
+ time = Math.abs(time);
+ const MINUTE = 1e3 * 60;
+ const HOUR = MINUTE * 60;
+ const DAY2 = HOUR * 24;
+ const minutes = Math.floor(time / MINUTE);
+ const hours = Math.floor(time / HOUR);
+ const days = Math.floor(time / DAY2);
+ const remainderHours = hours % (DAY2 / HOUR);
+ const remainderMinutes = minutes % (HOUR / MINUTE);
+ if (days >= 1)
+ range2.push(`${days}d`);
+ if (hours >= 1 && (time < DAY2 || remainderHours !== 0))
+ range2.push(`${remainderHours}h`);
+ if (time < HOUR || remainderMinutes !== 0)
+ range2.push(`${remainderMinutes}m`);
+ range2[0] = `${sign}${range2[0]}`;
+ return range2.join(" ");
+ }
+ formatPriceRangeValue(value, localeManager) {
+ return localeManager?.t("measurerPriceRangeValue", { value: Number(value.toFixed(2)) }) ?? `${value}`;
+ }
+ formatPriceRangePercentage(percentage, localeManager) {
+ return localeManager?.t("measurerPriceRangePercent", { value: percentage }) ?? `${percentage}`;
+ }
+ formatVolume(volume, localeManager) {
+ const volumeString = Number.isNaN(volume) ? "" : this.volumeFormatter.format(volume);
+ return localeManager?.t("measurerVolume", { value: volumeString }) ?? volumeString;
+ }
+};
+var QuickMeasurerStatisticsScene = class extends MeasurerStatisticsScene {
+ getDirectionStyles(datum) {
+ return this.verticalDirection === "down" ? datum.down.statistics : datum.up.statistics;
+ }
+ getTextStyles(datum) {
+ const styles = this.getDirectionStyles(datum);
+ return {
+ ...super.getTextStyles(datum),
+ fill: styles.color,
+ fontFamily: styles.fontFamily,
+ fontSize: styles.fontSize,
+ fontStyle: styles.fontStyle,
+ fontWeight: styles.fontWeight
+ };
+ }
+ getDividerStyles(datum) {
+ const styles = this.getDirectionStyles(datum);
+ return {
+ stroke: styles.divider.stroke,
+ strokeOpacity: styles.divider.strokeOpacity,
+ strokeWidth: styles.divider.strokeWidth
+ };
+ }
+ getBackgroundStyles(datum) {
+ const styles = this.getDirectionStyles(datum);
+ return {
+ ...super.getBackgroundStyles(datum),
+ fill: styles.fill,
+ stroke: styles.stroke,
+ strokeOpacity: styles.strokeOpacity,
+ strokeWidth: styles.strokeWidth
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerScene.ts
+var { Vec2: Vec216, Vec4: Vec412 } = import_ag_charts_community78._ModuleSupport;
+var MeasurerScene = class extends StartEndScene {
+ constructor() {
+ super();
+ this.type = "measurer";
+ this.horizontalLine = new CollidableLine();
+ this.verticalLine = new CollidableLine();
+ // These four bounding lines are named after the way they are drawn, e.g. the horizontalStartLine is a horizontal
+ // line that is only shown when the measurer has the 'vertical' direction.
+ this.horizontalStartLine = new CollidableLine();
+ this.horizontalEndLine = new CollidableLine();
+ this.verticalStartLine = new CollidableLine();
+ this.verticalEndLine = new CollidableLine();
+ this.horizontalEndCap = new ArrowCapScene();
+ this.verticalEndCap = new ArrowCapScene();
+ this.background = new import_ag_charts_community78._ModuleSupport.Path({ zIndex: -1 });
+ this.updateBackground = WithBackgroundScene.updateBackground.bind(this);
+ this.statistics = this.createStatisticsScene();
+ this.statistics.zIndex = 1;
+ this.append([
+ this.background,
+ this.verticalStartLine,
+ this.verticalEndLine,
+ this.horizontalStartLine,
+ this.horizontalEndLine,
+ this.horizontalLine,
+ this.verticalLine,
+ this.horizontalEndCap,
+ this.verticalEndCap,
+ this.start,
+ this.end,
+ this.statistics
+ ]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "measurer");
+ }
+ createStatisticsScene() {
+ return new MeasurerStatisticsScene();
+ }
+ update(datum, context) {
+ const coords = convertLine(datum, context);
+ if (coords == null) {
+ this.visible = false;
+ return;
+ }
+ this.visible = datum.visible ?? true;
+ if (!this.visible)
+ return;
+ const extended = this.extendPerpendicular(coords, datum, context);
+ const verticalStart = { ...extended, y2: extended.y1 };
+ const verticalEnd = { ...extended, y1: extended.y2 };
+ this.verticalDirection = coords.y1 < coords.y2 ? "down" : "up";
+ this.updateVisibilities(datum);
+ this.updateLines(datum, coords);
+ this.updateHandles(datum, coords);
+ this.updateText(datum, coords);
+ this.updateCaps(datum, coords);
+ this.updateBoundingLines(datum, extended);
+ this.updateBackground(datum, verticalStart, verticalEnd, context);
+ this.updateStatistics(datum, coords, context);
+ this.updateAnchor(datum, coords, context);
+ }
+ extendPerpendicular(coords, datum, context) {
+ const extended = {
+ x1: Math.min(coords.x1, coords.x2),
+ x2: Math.max(coords.x1, coords.x2),
+ y1: Math.min(coords.y1, coords.y2),
+ y2: Math.max(coords.y1, coords.y2)
+ };
+ const [start, end] = Vec216.from(context.yAxis.bounds);
+ if (DateRangeProperties.is(datum)) {
+ if (datum.extendAbove)
+ extended.y1 = start.y;
+ if (datum.extendBelow)
+ extended.y2 = end.y;
+ } else if (PriceRangeProperties.is(datum)) {
+ if (datum.extendLeft)
+ extended.x1 = start.x;
+ if (datum.extendRight)
+ extended.x2 = end.x;
+ }
+ return extended;
+ }
+ updateVisibilities(datum) {
+ const {
+ horizontalStartLine,
+ horizontalEndLine,
+ horizontalEndCap,
+ verticalStartLine,
+ verticalEndLine,
+ verticalEndCap
+ } = this;
+ const { direction } = datum;
+ verticalStartLine.visible = direction !== "vertical";
+ verticalEndLine.visible = direction !== "vertical";
+ horizontalEndCap.visible = direction !== "vertical";
+ horizontalStartLine.visible = direction !== "horizontal";
+ horizontalEndLine.visible = direction !== "horizontal";
+ verticalEndCap.visible = direction !== "horizontal";
+ }
+ updateLines(datum, coords) {
+ const { horizontalLine, verticalLine } = this;
+ const { direction } = datum;
+ const { x1, y1, x2, y2 } = coords;
+ const center = Vec216.round(Vec412.center(coords), 0);
+ const lineStyles = this.getLineStyles(datum);
+ if (direction !== "vertical") {
+ horizontalLine.setProperties({
+ ...lineStyles,
+ x1,
+ x2,
+ y1: center.y,
+ y2: center.y
+ });
+ }
+ if (direction !== "horizontal") {
+ verticalLine.setProperties({
+ ...lineStyles,
+ x1: center.x,
+ x2: center.x,
+ y1,
+ y2
+ });
+ }
+ }
+ updateText(datum, coords) {
+ const { direction } = datum;
+ const center = Vec216.round(Vec412.center(coords), 0);
+ let line;
+ const textCoords = { ...coords };
+ if (direction === "vertical") {
+ line = this.verticalLine;
+ textCoords.x1 = center.x;
+ textCoords.x2 = center.x;
+ } else {
+ line = this.horizontalLine;
+ textCoords.y1 = center.y;
+ textCoords.y2 = center.y;
+ }
+ this.text = this.updateNode(CollidableText, this.text, !!datum.text.label);
+ const { id } = line;
+ const clip = updateLineText(id, line, textCoords, datum.text, this.text, datum.text.label, datum.strokeWidth);
+ let verticalClipMask;
+ if (direction === "both" && clip && this.text) {
+ const textBBox = Vec412.from(this.text.getBBox());
+ const { offset } = clip.numbers;
+ const crossesVerticalLine = textBBox.x1 <= center.x + offset.x && textBBox.x2 >= center.x - offset.x;
+ if (crossesVerticalLine) {
+ verticalClipMask = {
+ x: center.x,
+ y: clip.clipMask.y,
+ radius: this.text.getBBox().height / 2 + Vec216.length(offset)
+ };
+ }
+ }
+ this.verticalLine.setClipMask(id, verticalClipMask);
+ }
+ updateCaps(datum, coords) {
+ const { horizontalEndCap, verticalEndCap } = this;
+ const { direction } = datum;
+ const { x1, y1, x2, y2 } = coords;
+ const center = Vec216.round(Vec412.center(coords), 0);
+ const { stroke: stroke2, strokeWidth, strokeOpacity } = this.getLineStyles(datum);
+ const capStyles = { stroke: stroke2, strokeWidth, strokeOpacity };
+ if (direction !== "vertical") {
+ const angle = x1 <= x2 ? 0 : Math.PI;
+ let x = x2;
+ if (direction === "horizontal") {
+ x += x1 <= x2 ? -2 : 2;
+ }
+ horizontalEndCap.update({ ...capStyles, x, y: center.y, angle });
+ }
+ if (direction !== "horizontal") {
+ const angle = y1 <= y2 ? Math.PI / 2 : Math.PI / -2;
+ let y = y2;
+ if (direction === "vertical") {
+ y += y1 <= y2 ? -2 : 2;
+ }
+ verticalEndCap.update({ ...capStyles, x: center.x, y, angle });
+ }
+ }
+ updateBoundingLines(datum, extendedCoords) {
+ const { verticalStartLine, verticalEndLine, horizontalStartLine, horizontalEndLine } = this;
+ const { direction } = datum;
+ const { x1, y1, x2, y2 } = extendedCoords;
+ const lineStyles = this.getLineStyles(datum);
+ if (direction === "horizontal") {
+ verticalStartLine.setProperties({ ...lineStyles, x1, y1, x2: x1, y2 });
+ verticalEndLine.setProperties({ ...lineStyles, x1: x2, y1, x2, y2 });
+ }
+ if (direction === "vertical") {
+ horizontalStartLine.setProperties({ ...lineStyles, x1, y1, x2, y2: y1 });
+ horizontalEndLine.setProperties({ ...lineStyles, x1, y1: y2, x2, y2 });
+ }
+ }
+ updateStatistics(datum, coords, context) {
+ const point = Vec216.add(Vec412.bottomCenter(coords), Vec216.from(0, 10));
+ const statistics = { volume: this.getVolume(datum) };
+ if (datum.hasPriceRange) {
+ statistics.priceRange = {
+ percentage: this.getPriceRangePercentage(datum),
+ value: this.getPriceRangeValue(datum)
+ };
+ }
+ if (datum.hasDateRange) {
+ statistics.dateRange = {
+ bars: this.getDateRangeBars(coords, context),
+ value: this.getDateRangeValue(datum)
+ };
+ }
+ this.statistics.update(datum, statistics, point, coords, context, this.verticalDirection, datum.localeManager);
+ }
+ updateAnchor(_datum, coords, _context, _bbox) {
+ const point = Vec412.topCenter(coords);
+ Vec216.apply(this.anchor, import_ag_charts_community78._ModuleSupport.Transformable.toCanvasPoint(this.horizontalLine, point.x, point.y));
+ }
+ getBackgroundPoints(_datum, verticalStart, verticalEnd, _bounds) {
+ const [startStart, startEnd] = Vec216.from(verticalStart);
+ const [endStart, endEnd] = Vec216.from(verticalEnd);
+ return [startStart, startEnd, endEnd, endStart];
+ }
+ getLineStyles(datum) {
+ const { lineDashOffset, stroke: stroke2, strokeWidth, strokeOpacity } = datum;
+ return {
+ lineCap: datum.getLineCap(),
+ lineDash: datum.getLineDash(),
+ lineDashOffset,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ fillOpacity: 0
+ };
+ }
+ getBackgroundStyles(datum) {
+ const { background } = datum;
+ return {
+ fill: background.fill,
+ fillOpacity: background.fillOpacity
+ };
+ }
+ getHandleStyles(datum) {
+ return {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.stroke,
+ strokeOpacity: datum.handle.strokeOpacity ?? datum.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth ?? datum.strokeWidth
+ };
+ }
+ containsPoint(x, y) {
+ const {
+ horizontalLine,
+ text: text2,
+ verticalLine,
+ horizontalStartLine,
+ horizontalEndLine,
+ verticalStartLine,
+ verticalEndLine
+ } = this;
+ return super.containsPoint(x, y) || horizontalLine.isPointInPath(x, y) || verticalLine.isPointInPath(x, y) || horizontalStartLine.visible && horizontalStartLine.isPointInPath(x, y) || horizontalEndLine.visible && horizontalEndLine.isPointInPath(x, y) || verticalStartLine.visible && verticalStartLine.isPointInPath(x, y) || verticalEndLine.visible && verticalEndLine.isPointInPath(x, y) || Boolean(text2?.containsPoint(x, y));
+ }
+ getNodeAtCoords(x, y) {
+ if (this.text?.containsPoint(x, y))
+ return "text";
+ if (this.start.containsPoint(x, y) || this.end.containsPoint(x, y))
+ return "handle";
+ return "line";
+ }
+ getDateRangeBars(coords, context) {
+ const { step } = context.xAxis.scale;
+ const sign = coords.x1 <= coords.x2 ? 1 : -1;
+ return step ? Math.round(Vec412.width(coords) / step) * sign : 0;
+ }
+ getDateRangeValue(datum) {
+ const start = getGroupingValue(datum.start.x);
+ const end = getGroupingValue(datum.end.x);
+ if (!(0, import_ag_charts_core37.isDate)(start) || !(0, import_ag_charts_core37.isDate)(end)) {
+ throw new Error("Can not create a date range measurement of non-date x-axis.");
+ }
+ return end.getTime() - start.getTime();
+ }
+ getPriceRangePercentage(datum) {
+ if (datum.start.y == null || datum.end.y == null) {
+ throw new Error("Can not create a price range measurement of a non-numeric y-axis");
+ }
+ const endY = getGroupingValue(datum.end.y);
+ const startY = getGroupingValue(datum.start.y);
+ if (!(0, import_ag_charts_core37.isNumber)(endY) || !(0, import_ag_charts_core37.isNumber)(startY)) {
+ throw new Error("Can not create a price range measurement of a non-numeric y-axis");
+ }
+ return (endY - startY) / startY;
+ }
+ getPriceRangeValue(datum) {
+ if (datum.start.y == null || datum.end.y == null) {
+ throw new Error("Can not create a price range measurement of a non-numeric y-axis");
+ }
+ const endY = getGroupingValue(datum.end.y);
+ const startY = getGroupingValue(datum.start.y);
+ if (!(0, import_ag_charts_core37.isNumber)(endY) || !(0, import_ag_charts_core37.isNumber)(startY)) {
+ throw new Error("Can not create a price range measurement of a non-numeric y-axis");
+ }
+ return endY - startY;
+ }
+ getVolume(datum) {
+ return datum.getVolume(datum.start.x, datum.end.x);
+ }
+};
+var QuickMeasurerScene = class extends MeasurerScene {
+ constructor() {
+ super(...arguments);
+ this.type = "quick-measurer";
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "quick-measurer");
+ }
+ createStatisticsScene() {
+ return new QuickMeasurerStatisticsScene();
+ }
+ getDirectionStyles(datum) {
+ return this.verticalDirection === "down" ? datum.down : datum.up;
+ }
+ getLineStyles(datum) {
+ const styles = this.getDirectionStyles(datum);
+ return {
+ ...super.getLineStyles(datum),
+ stroke: styles.stroke,
+ strokeWidth: styles.strokeWidth,
+ strokeOpacity: styles.strokeOpacity
+ };
+ }
+ getBackgroundStyles(datum) {
+ const styles = this.getDirectionStyles(datum);
+ return {
+ fill: styles.fill,
+ fillOpacity: styles.fillOpacity
+ };
+ }
+ getHandleStyles(datum) {
+ const styles = this.getDirectionStyles(datum);
+ return {
+ fill: styles.handle.fill,
+ stroke: styles.handle.stroke ?? styles.stroke,
+ strokeOpacity: styles.handle.strokeOpacity ?? styles.strokeOpacity,
+ strokeWidth: styles.handle.strokeWidth ?? styles.strokeWidth
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerState.ts
+var import_ag_charts_community79 = require("ag-charts-community");
+var { StateMachine: StateMachine9, StateMachineProperty: StateMachineProperty9, Debug: Debug9 } = import_ag_charts_community79._ModuleSupport;
+var MeasurerTypeStateMachine = class extends StateMachine9 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = this.createDatum();
+ datum.set({ start: point, end: point });
+ ctx.create(datum);
+ };
+ const actionEndUpdate = ({ point }) => {
+ const { datum, node } = this;
+ datum?.set({ end: point });
+ node?.toggleActive(true);
+ node?.toggleHandles({ end: false });
+ ctx.update();
+ };
+ const actionEndFinish = () => {
+ this.node?.toggleHandles({ end: true });
+ };
+ const actionCancel = () => ctx.delete();
+ const onExitEnd = () => {
+ ctx.showAnnotationOptions();
+ ctx.recordAction(`Create ${this.node?.type} annotation`);
+ };
+ super("start", {
+ start: {
+ reset: StateMachine9.parent,
+ click: {
+ target: "end",
+ action: actionCreate
+ },
+ drag: {
+ target: "end",
+ action: actionCreate
+ }
+ },
+ end: {
+ hover: actionEndUpdate,
+ drag: actionEndUpdate,
+ click: {
+ target: StateMachine9.parent,
+ action: actionEndFinish
+ },
+ dragEnd: {
+ target: StateMachine9.parent,
+ action: actionEndFinish
+ },
+ reset: {
+ target: StateMachine9.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine9.parent,
+ action: actionCancel
+ },
+ onExit: onExitEnd
+ }
+ });
+ this.debug = Debug9.create(true, "annotations");
+ }
+};
+__decorateClass([
+ StateMachineProperty9()
+], MeasurerTypeStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty9()
+], MeasurerTypeStateMachine.prototype, "node", 2);
+var DateRangeStateMachine = class extends MeasurerTypeStateMachine {
+ createDatum() {
+ return new DateRangeProperties();
+ }
+};
+var PriceRangeStateMachine = class extends MeasurerTypeStateMachine {
+ createDatum() {
+ return new PriceRangeProperties();
+ }
+};
+var DatePriceRangeStateMachine = class extends MeasurerTypeStateMachine {
+ createDatum() {
+ return new DatePriceRangeProperties();
+ }
+};
+var QuickDatePriceRangeStateMachine = class extends MeasurerTypeStateMachine {
+ createDatum() {
+ return new QuickDatePriceRangeProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/measurer/measurerConfig.ts
+var dateRangeConfig = {
+ type: "date-range" /* DateRange */,
+ datum: DateRangeProperties,
+ scene: MeasurerScene,
+ isDatum: DateRangeProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (DateRangeProperties.is(datum) && MeasurerScene.is(node)) {
+ node.translate(datum, translation, context);
+ }
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (DateRangeProperties.is(datum) && DateRangeProperties.is(copiedDatum) && MeasurerScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (DateRangeProperties.is(datum) && MeasurerScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new DateRangeStateMachine({
+ ...ctx,
+ create: createDatum("date-range" /* DateRange */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+var priceRangeConfig = {
+ type: "price-range" /* PriceRange */,
+ datum: PriceRangeProperties,
+ scene: MeasurerScene,
+ isDatum: PriceRangeProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (PriceRangeProperties.is(datum) && MeasurerScene.is(node)) {
+ node.translate(datum, translation, context);
+ }
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (PriceRangeProperties.is(datum) && PriceRangeProperties.is(copiedDatum) && MeasurerScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (PriceRangeProperties.is(datum) && MeasurerScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new PriceRangeStateMachine({
+ ...ctx,
+ create: createDatum("date-range" /* DateRange */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+var datePriceRangeConfig = {
+ type: "date-price-range" /* DatePriceRange */,
+ datum: DatePriceRangeProperties,
+ scene: MeasurerScene,
+ isDatum: DatePriceRangeProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (DatePriceRangeProperties.is(datum) && MeasurerScene.is(node)) {
+ node.translate(datum, translation, context);
+ }
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (DatePriceRangeProperties.is(datum) && DatePriceRangeProperties.is(copiedDatum) && MeasurerScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (DatePriceRangeProperties.is(datum) && MeasurerScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new DatePriceRangeStateMachine({
+ ...ctx,
+ create: createDatum("date-range" /* DateRange */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+var quickDatePriceRangeConfig = {
+ type: "quick-date-price-range" /* QuickDatePriceRange */,
+ datum: QuickDatePriceRangeProperties,
+ scene: QuickMeasurerScene,
+ isDatum: QuickDatePriceRangeProperties.is,
+ translate: (node, datum, translation, context) => {
+ if (QuickDatePriceRangeProperties.is(datum) && QuickMeasurerScene.is(node)) {
+ node.translate(datum, translation, context);
+ }
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (QuickDatePriceRangeProperties.is(datum) && QuickDatePriceRangeProperties.is(copiedDatum) && QuickMeasurerScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (QuickDatePriceRangeProperties.is(datum) && QuickMeasurerScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new QuickDatePriceRangeStateMachine({
+ ...ctx,
+ create: createDatum("quick-date-price-range" /* QuickDatePriceRange */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/note/noteScene.ts
+var import_ag_charts_community80 = require("ag-charts-community");
+var import_ag_charts_core38 = require("ag-charts-core");
+var { ZIndexMap: ZIndexMap3 } = import_ag_charts_community80._ModuleSupport;
+var NoteScene = class extends TextualPointScene {
+ constructor() {
+ super();
+ this.type = "note" /* Note */;
+ this.shape = new import_ag_charts_community80._ModuleSupport.Rect();
+ this.iconBackground = new import_ag_charts_community80._ModuleSupport.TranslatableSvgPath(
+ "M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"
+ );
+ this.iconLines = new import_ag_charts_community80._ModuleSupport.TranslatableSvgPath(
+ "M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"
+ );
+ this.active = false;
+ this.shape.visible = false;
+ this.label.visible = false;
+ this.iconBackground.fillShadow = new import_ag_charts_community80._ModuleSupport.DropShadow();
+ this.append([this.shape, this.label, this.iconBackground, this.iconLines, this.handle]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "note" /* Note */);
+ }
+ update(datum, context) {
+ this.updateIcon(datum, context);
+ super.update(datum, context);
+ }
+ getTextBBox(datum, coords, context) {
+ const bbox = super.getTextBBox(datum, coords, context);
+ bbox.x -= datum.width / 2;
+ bbox.x = (0, import_ag_charts_core38.clamp)(0, bbox.x, context.seriesRect.width - datum.width);
+ const padding = datum.getPadding().top;
+ const topY = bbox.y - LABEL_OFFSET - padding * 2;
+ const bottomY = bbox.y + DivariantHandle.HANDLE_SIZE + padding * 2;
+ if (topY - bbox.height - TOOLBAR_OFFSET < 0) {
+ bbox.y = bottomY;
+ datum.position = "top";
+ } else {
+ bbox.y = topY + padding;
+ datum.position = "bottom";
+ }
+ return bbox;
+ }
+ updateLabel(datum, bbox) {
+ const labelVisibility = datum.visible === false ? false : this.label.visible;
+ super.updateLabel(datum, bbox);
+ this.label.visible = labelVisibility;
+ this.label.text = (0, import_ag_charts_core38.wrapText)(datum.text, {
+ maxWidth: 200,
+ font: datum,
+ textWrap: "always",
+ avoidOrphans: false
+ });
+ }
+ updateShape(datum, bbox) {
+ const { shape } = this;
+ shape.fill = datum.background.fill;
+ shape.fillOpacity = datum.background.fillOpacity ?? 1;
+ shape.stroke = datum.background.stroke;
+ shape.strokeOpacity = datum.background.strokeOpacity ?? 1;
+ shape.strokeWidth = datum.background.strokeWidth ?? 1;
+ shape.cornerRadius = 4;
+ const padding = datum.getPadding().top;
+ const isPositionTop = datum.position === "top";
+ shape.x = bbox.x - padding;
+ shape.width = datum.width + padding * 2;
+ shape.height = bbox.height + padding * 2;
+ shape.y = bbox.y + (isPositionTop ? 0 : -bbox.height) - padding;
+ }
+ updateIcon(datum, context) {
+ const { active, iconBackground, iconLines } = this;
+ const { x, y } = convertPoint(datum, context);
+ iconBackground.translationX = x - ICON_WIDTH / 2;
+ iconBackground.translationY = y - ICON_HEIGHT;
+ iconLines.translationX = iconBackground.translationX;
+ iconLines.translationY = iconBackground.translationY;
+ iconBackground.fill = datum.fill;
+ iconBackground.fillOpacity = datum.fillOpacity ?? 1;
+ iconBackground.stroke = datum.stroke;
+ iconBackground.strokeOpacity = datum.strokeOpacity ?? 1;
+ iconBackground.strokeWidth = datum.strokeWidth ?? 1;
+ iconLines.fill = datum.stroke;
+ if (active) {
+ iconBackground.fillShadow.color = datum.fill ?? "rgba(0, 0, 0, 0.22)";
+ } else {
+ iconBackground.fillShadow.color = "rgba(0, 0, 0, 0.22)";
+ }
+ }
+ updateAnchor(datum, bbox, context) {
+ const padding = datum.getPadding().top;
+ const isPositionTop = datum.position === "top";
+ const direction = isPositionTop ? 1 : -1;
+ return {
+ x: bbox.x + context.seriesRect.x + datum.width / 2,
+ y: bbox.y + context.seriesRect.y + direction * (bbox.height + padding),
+ position: isPositionTop ? "below" : "above"
+ };
+ }
+ getLabelCoords(datum, bbox) {
+ const isPositionTop = datum.position === "top";
+ const padding = datum.getPadding().top + (0, import_ag_charts_core38.calcLineHeight)(datum.fontSize, ANNOTATION_TEXT_LINE_HEIGHT) / 2;
+ return { x: bbox.x, y: bbox.y + (isPositionTop ? padding / 2 : 0) };
+ }
+ getTextBaseline(datum) {
+ return datum.position === "top" ? "middle" : datum.position;
+ }
+ getHandleCoords(_datum, coords, _bbox) {
+ return {
+ x: coords.x,
+ y: coords.y + DivariantHandle.HANDLE_SIZE / 2 + 4
+ };
+ }
+ getHandleStyles(datum) {
+ return {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.fill,
+ strokeOpacity: datum.handle.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth
+ };
+ }
+ toggleHovered(hovered, active, readOnly) {
+ super.toggleHovered(hovered, active, readOnly);
+ const visible = hovered || active && !readOnly;
+ this.label.visible = visible;
+ this.shape.visible = visible;
+ this.zIndex = visible ? ZIndexMap3.CHART_ANNOTATION_FOCUSED : ZIndexMap3.CHART_ANNOTATION;
+ }
+ toggleActive(active) {
+ super.toggleActive(active);
+ this.label.visible = active;
+ this.shape.visible = active;
+ this.active = active;
+ }
+ containsPoint(x, y) {
+ if (this.shape.visible && this.shape.containsPoint(x, y))
+ return true;
+ if (this.iconBackground.containsPoint(x, y))
+ return true;
+ return super.containsPoint(x, y);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/note/noteState.ts
+var NoteStateMachine = class extends TextualPointStateMachine {
+ createDatum() {
+ return new NoteProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/note/noteConfig.ts
+var noteConfig = {
+ type: "note" /* Note */,
+ datum: NoteProperties,
+ scene: NoteScene,
+ isDatum: NoteProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (NoteProperties.is(datum) && NoteScene.is(node))
+ node.translate(datum, transition, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (NoteProperties.is(datum) && NoteProperties.is(copiedDatum) && NoteScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (NoteProperties.is(datum) && NoteScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new NoteStateMachine({
+ ...ctx,
+ create: createDatum("note" /* Note */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/parallel-channel/parallelChannelScene.ts
+var import_ag_charts_community81 = require("ag-charts-community");
+var { Vec2: Vec217, Vec4: Vec413 } = import_ag_charts_community81._ModuleSupport;
+var ParallelChannelScene = class extends ChannelScene {
+ constructor() {
+ super();
+ this.type = "parallel-channel";
+ this.handles = {
+ topLeft: new DivariantHandle(),
+ topMiddle: new UnivariantHandle(),
+ topRight: new DivariantHandle(),
+ bottomLeft: new DivariantHandle(),
+ bottomMiddle: new UnivariantHandle(),
+ bottomRight: new DivariantHandle()
+ };
+ this.middleLine = new CollidableLine();
+ this.append([this.background, this.topLine, this.middleLine, this.bottomLine, ...Object.values(this.handles)]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "parallel-channel");
+ }
+ dragHandle(datum, target, context, snapping) {
+ const { activeHandle, handles } = this;
+ if (activeHandle == null)
+ return;
+ const { offset } = handles[activeHandle].drag(target);
+ handles[activeHandle].toggleDragging(true);
+ if (activeHandle === "topMiddle" || activeHandle === "bottomMiddle") {
+ offset.x = 0;
+ }
+ let translateVectors = [];
+ let allowSnapping = snapping;
+ switch (activeHandle) {
+ case "topLeft":
+ case "bottomLeft":
+ translateVectors = ["topLeft", "bottomLeft"];
+ break;
+ case "topMiddle":
+ translateVectors = ["topLeft", "topRight"];
+ offset.y -= UnivariantHandle.HANDLE_SIZE / 2;
+ allowSnapping = false;
+ break;
+ case "topRight":
+ case "bottomRight":
+ translateVectors = ["topRight", "bottomRight"];
+ break;
+ case "bottomMiddle":
+ translateVectors = ["bottomLeft", "bottomRight"];
+ offset.y -= UnivariantHandle.HANDLE_SIZE / 2;
+ allowSnapping = false;
+ break;
+ }
+ const top = convertLine(datum, context);
+ const bottom = convertLine(datum.bottom, context);
+ if (!top || !bottom)
+ return;
+ const vectors = {
+ topLeft: Vec413.start(top),
+ topRight: Vec413.end(top),
+ bottomLeft: Vec413.start(bottom),
+ bottomRight: Vec413.end(bottom)
+ };
+ const snap = {
+ vectors: {
+ topLeft: vectors.topRight,
+ bottomLeft: vectors.bottomRight,
+ topRight: vectors.topLeft,
+ bottomRight: vectors.bottomLeft
+ },
+ angle: datum.snapToAngle
+ };
+ const points = translate(vectors, offset, context, {
+ overflowContinuous: this.overflowContinuous,
+ translateVectors,
+ snap: allowSnapping ? snap : void 0
+ });
+ datum.start.x = points.topLeft.x;
+ datum.start.y = points.topLeft.y;
+ datum.end.x = points.topRight.x;
+ datum.end.y = points.topRight.y;
+ datum.height = points.topLeft.y - points.bottomLeft.y;
+ }
+ getTranslatePointsVectors(start, end) {
+ const { bottomLeft, topLeft } = this.handles;
+ const height = bottomLeft.getBBox().y - topLeft.getBBox().y;
+ const bottomStart = Vec217.add(start, Vec217.from(0, height));
+ const bottomEnd = Vec217.add(end, Vec217.from(0, height));
+ return { start, end, bottomStart, bottomEnd };
+ }
+ containsPoint(x, y) {
+ return super.containsPoint(x, y) || this.middleLine.visible && this.middleLine.strokeWidth > 0 && this.middleLine.containsPoint(x, y);
+ }
+ getNodeAtCoords(x, y) {
+ if (this.middleLine.visible && this.middleLine.strokeWidth > 0 && this.middleLine.containsPoint(x, y))
+ return "line";
+ return super.getNodeAtCoords(x, y);
+ }
+ updateLines(datum, top, bottom, context, naturalTop, naturalBottom) {
+ const { topLine, middleLine, bottomLine } = this;
+ const { lineDashOffset, stroke: stroke2, strokeOpacity, strokeWidth } = datum;
+ const lineDash = datum.getLineDash();
+ const lineStyles = {
+ lineCap: datum.getLineCap(),
+ lineDash,
+ lineDashOffset,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth
+ };
+ topLine.setProperties({ ...top, ...lineStyles });
+ bottomLine.setProperties({ ...bottom, ...lineStyles });
+ const middlePoints = this.extendLine(
+ {
+ x1: naturalTop.x1,
+ y1: naturalBottom.y1 + (naturalTop.y1 - naturalBottom.y1) / 2,
+ x2: naturalTop.x2,
+ y2: naturalBottom.y2 + (naturalTop.y2 - naturalBottom.y2) / 2
+ },
+ datum,
+ context
+ );
+ middleLine.setProperties({
+ ...middlePoints,
+ lineDash: datum.middle.lineDash ?? lineDash,
+ lineDashOffset: datum.middle.lineDashOffset ?? lineDashOffset,
+ stroke: datum.middle.stroke ?? stroke2,
+ strokeOpacity: datum.middle.strokeOpacity ?? strokeOpacity,
+ strokeWidth: datum.middle.strokeWidth ?? strokeWidth,
+ visible: datum.middle.visible ?? true
+ });
+ }
+ updateHandles(datum, top, bottom) {
+ const {
+ handles: { topLeft, topMiddle, topRight, bottomLeft, bottomMiddle, bottomRight }
+ } = this;
+ const handleStyles = {
+ fill: datum.handle.fill,
+ stroke: datum.handle.stroke ?? datum.stroke,
+ strokeOpacity: datum.handle.strokeOpacity ?? datum.strokeOpacity,
+ strokeWidth: datum.handle.strokeWidth ?? datum.strokeWidth
+ };
+ topLeft.update({ ...handleStyles, ...Vec413.start(top) });
+ topRight.update({ ...handleStyles, ...Vec413.end(top) });
+ bottomLeft.update({ ...handleStyles, ...Vec413.start(bottom) });
+ bottomRight.update({ ...handleStyles, ...Vec413.end(bottom) });
+ topMiddle.update({
+ ...handleStyles,
+ ...Vec217.sub(Vec413.center(top), Vec217.from(topMiddle.handle.width / 2, topMiddle.handle.height / 2))
+ });
+ bottomMiddle.update({
+ ...handleStyles,
+ ...Vec217.sub(Vec413.center(bottom), Vec217.from(bottomMiddle.handle.width / 2, bottomMiddle.handle.height / 2))
+ });
+ }
+ updateText(datum, top, bottom) {
+ this.text = this.updateNode(CollidableText, this.text, !!datum.text.label);
+ updateChannelText(true, top, bottom, datum.text, datum.strokeWidth, this.text, datum.text.label);
+ }
+ getBackgroundPoints(datum, top, bottom, bounds) {
+ const isFlippedX = top.x1 > top.x2;
+ const isFlippedY = top.y1 > top.y2;
+ const outOfBoundsStart = top.x1 !== bottom.x1 && top.y1 !== bottom.y1;
+ const outOfBoundsEnd = top.x2 !== bottom.x2 && top.y2 !== bottom.y2;
+ const points = Vec217.from(top);
+ if (datum.extendEnd && outOfBoundsEnd) {
+ points.push(Vec217.from(isFlippedX ? bounds.x1 : bounds.x2, isFlippedY ? bounds.y1 : bounds.y2));
+ }
+ points.push(...Vec217.from(bottom).reverse());
+ if (datum.extendStart && outOfBoundsStart) {
+ points.push(Vec217.from(isFlippedX ? bounds.x2 : bounds.x1, isFlippedY ? bounds.y2 : bounds.y1));
+ }
+ return points;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/parallel-channel/parallelChannelState.ts
+var import_ag_charts_community82 = require("ag-charts-community");
+var import_ag_charts_core39 = require("ag-charts-core");
+var { StateMachine: StateMachine10, StateMachineProperty: StateMachineProperty10, Debug: Debug10 } = import_ag_charts_community82._ModuleSupport;
+var ParallelChannelStateMachine = class extends StateMachine10 {
+ constructor(ctx) {
+ const actionCreate = ({ point }) => {
+ const datum = new ParallelChannelProperties();
+ datum.set({ start: point, end: point, height: 0 });
+ ctx.create(datum);
+ };
+ const actionFirstRender = () => {
+ const { node } = this;
+ node?.toggleActive(true);
+ node?.toggleHandles({
+ topLeft: true,
+ topMiddle: false,
+ topRight: false,
+ bottomLeft: false,
+ bottomMiddle: false,
+ bottomRight: false
+ });
+ };
+ const actionEndUpdate = ({ offset, context }) => {
+ const { datum, snapping } = this;
+ if (!datum)
+ return;
+ datum.set({ end: snapPoint(offset, context, snapping, datum.start, datum.snapToAngle) });
+ ctx.update();
+ };
+ const actionEndFinish = () => {
+ this.node?.toggleHandles({
+ topRight: true
+ });
+ ctx.update();
+ };
+ const actionHeightUpdate = ({ point }) => {
+ const { datum, node } = this;
+ const endY = getGroupingValue(datum?.end.y);
+ const startY = getGroupingValue(datum?.start.y);
+ const { y: pointY } = point;
+ if (datum == null || !(0, import_ag_charts_core39.isNumber)(startY) || !(0, import_ag_charts_core39.isNumber)(endY) || !(0, import_ag_charts_core39.isNumber)(pointY))
+ return;
+ const height = endY - (pointY ?? 0);
+ const bottomStartY = startY - height;
+ node?.toggleHandles({ bottomLeft: true, bottomRight: true });
+ if (!ctx.validatePoint({ x: datum.start.x, y: bottomStartY }, { overflowContinuous: true }) || !ctx.validatePoint({ x: datum.end.x, y: point.y }, { overflowContinuous: true })) {
+ return;
+ }
+ datum.set({ height });
+ ctx.update();
+ };
+ const actionHeightFinish = ({ point }) => {
+ const { datum, node } = this;
+ const endY = getGroupingValue(datum?.end.y);
+ const startY = getGroupingValue(datum?.start.y);
+ const { y: pointY } = point;
+ if (datum == null || !(0, import_ag_charts_core39.isNumber)(startY) || !(0, import_ag_charts_core39.isNumber)(endY) || !(0, import_ag_charts_core39.isNumber)(pointY))
+ return;
+ const height = endY - (pointY ?? 0);
+ const bottomStartY = startY - height;
+ node?.toggleHandles(true);
+ if (!ctx.validatePoint({ x: datum.start.x, y: bottomStartY }, { overflowContinuous: true }) || !ctx.validatePoint({ x: datum.end.x, y: point.y }, { overflowContinuous: true })) {
+ return;
+ }
+ datum.set({ height });
+ ctx.recordAction(`Create ${"parallel-channel" /* ParallelChannel */} annotation`);
+ ctx.showAnnotationOptions();
+ ctx.update();
+ };
+ const actionCancel = () => ctx.delete();
+ super("start", {
+ start: {
+ click: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ drag: {
+ target: "waiting-first-render",
+ action: actionCreate
+ },
+ reset: StateMachine10.parent
+ },
+ "waiting-first-render": {
+ render: {
+ target: "end",
+ action: actionFirstRender
+ }
+ },
+ end: {
+ hover: actionEndUpdate,
+ drag: actionEndUpdate,
+ click: {
+ target: "height",
+ action: actionEndFinish
+ },
+ dragEnd: {
+ target: "height",
+ action: actionEndFinish
+ },
+ reset: {
+ target: StateMachine10.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine10.parent,
+ action: actionCancel
+ }
+ },
+ height: {
+ hover: actionHeightUpdate,
+ click: {
+ target: StateMachine10.parent,
+ action: actionHeightFinish
+ },
+ drag: {
+ target: StateMachine10.parent,
+ action: actionHeightFinish
+ },
+ reset: {
+ target: StateMachine10.parent,
+ action: actionCancel
+ },
+ cancel: {
+ target: StateMachine10.parent,
+ action: actionCancel
+ }
+ }
+ });
+ this.debug = Debug10.create(true, "annotations");
+ this.snapping = false;
+ }
+};
+__decorateClass([
+ StateMachineProperty10()
+], ParallelChannelStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty10()
+], ParallelChannelStateMachine.prototype, "node", 2);
+__decorateClass([
+ StateMachineProperty10()
+], ParallelChannelStateMachine.prototype, "snapping", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/parallel-channel/parallelChannelConfig.ts
+var parallelChannelConfig = {
+ type: "parallel-channel" /* ParallelChannel */,
+ datum: ParallelChannelProperties,
+ scene: ParallelChannelScene,
+ isDatum: ParallelChannelProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (ParallelChannelProperties.is(datum) && ParallelChannelScene.is(node)) {
+ node.translate(datum, transition, context);
+ }
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (ParallelChannelProperties.is(datum) && ParallelChannelProperties.is(copiedDatum) && ParallelChannelScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (ParallelChannelProperties.is(datum) && ParallelChannelScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new ParallelChannelStateMachine({
+ ...ctx,
+ create: createDatum("parallel-channel" /* ParallelChannel */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/text/textScene.ts
+var TextScene = class extends TextualPointScene {
+ constructor() {
+ super();
+ this.type = "text" /* Text */;
+ this.append([this.label, this.handle]);
+ }
+ static is(value) {
+ return AnnotationScene.isCheck(value, "text" /* Text */);
+ }
+ getHandleCoords(_datum, point) {
+ const halfSize = DivariantHandle.HANDLE_SIZE / 2;
+ return {
+ x: point.x + halfSize,
+ y: point.y + 2 + halfSize
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/text/textState.ts
+var TextStateMachine = class extends TextualPointStateMachine {
+ createDatum() {
+ return new TextProperties();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/text/textConfig.ts
+var textConfig = {
+ type: "text" /* Text */,
+ datum: TextProperties,
+ scene: TextScene,
+ isDatum: TextProperties.is,
+ translate: (node, datum, transition, context) => {
+ if (TextProperties.is(datum) && TextScene.is(node))
+ node.translate(datum, transition, context);
+ },
+ copy: (node, datum, copiedDatum, context) => {
+ if (TextProperties.is(datum) && TextProperties.is(copiedDatum) && TextScene.is(node)) {
+ return node.copy(datum, copiedDatum, context);
+ }
+ },
+ update: (node, datum, context) => {
+ if (TextProperties.is(datum) && TextScene.is(node)) {
+ node.update(datum, context);
+ }
+ },
+ createState: (ctx, { createDatum }) => new TextStateMachine({
+ ...ctx,
+ create: createDatum("text" /* Text */)
+ }),
+ dragState: (ctx) => new DragStateMachine(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationsConfig.ts
+var annotationConfigs = {
+ // Lines
+ [lineConfig.type]: lineConfig,
+ [horizontalLineConfig.type]: horizontalLineConfig,
+ [verticalLineConfig.type]: verticalLineConfig,
+ // Channels
+ [parallelChannelConfig.type]: parallelChannelConfig,
+ [disjointChannelConfig.type]: disjointChannelConfig,
+ // Fibonaccis
+ [fibonacciRetracementConfig.type]: fibonacciRetracementConfig,
+ [fibonacciRetracementTrendBasedConfig.type]: fibonacciRetracementTrendBasedConfig,
+ // Texts
+ [calloutConfig.type]: calloutConfig,
+ [commentConfig.type]: commentConfig,
+ [noteConfig.type]: noteConfig,
+ [textConfig.type]: textConfig,
+ // Shapes
+ [arrowConfig.type]: arrowConfig,
+ [arrowUpConfig.type]: arrowUpConfig,
+ [arrowDownConfig.type]: arrowDownConfig,
+ // Measurers
+ [dateRangeConfig.type]: dateRangeConfig,
+ [priceRangeConfig.type]: priceRangeConfig,
+ [datePriceRangeConfig.type]: datePriceRangeConfig,
+ [quickDatePriceRangeConfig.type]: quickDatePriceRangeConfig
+};
+function getTypedDatum(datum) {
+ for (const { isDatum } of Object.values(annotationConfigs)) {
+ if (isDatum(datum)) {
+ return datum;
+ }
+ }
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationsStateMachine.ts
+var import_ag_charts_community83 = require("ag-charts-community");
+var { ActionOnSet, ParallelStateMachine, StateMachine: StateMachine11, StateMachineProperty: StateMachineProperty11, Debug: Debug11 } = import_ag_charts_community83._ModuleSupport;
+var AnnotationsStateMachine = class extends ParallelStateMachine {
+ constructor(ctx) {
+ super(
+ new SnappingStateMachine((snapping) => {
+ this.snapping = snapping;
+ }),
+ new UpdateMachine(() => {
+ this.node = this.active == null ? void 0 : ctx.node(this.active);
+ }),
+ new AnnotationsMainStateMachine(ctx, (index) => {
+ this.active = index;
+ this.datum = this.active == null ? void 0 : ctx.datum(this.active);
+ this.node = this.active == null ? void 0 : ctx.node(this.active);
+ })
+ );
+ this.snapping = false;
+ }
+ // TODO: remove this leak
+ getActive() {
+ return this.active;
+ }
+ // TODO: remove this leak
+ isActive(index) {
+ return index === this.active;
+ }
+};
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsStateMachine.prototype, "snapping", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsStateMachine.prototype, "node", 2);
+var SnappingStateMachine = class extends StateMachine11 {
+ constructor(setSnapping) {
+ super("idle" /* Idle */, {
+ ["idle" /* Idle */]: {
+ hover: ({ shiftKey }) => setSnapping(shiftKey),
+ keyDown: ({ shiftKey }) => setSnapping(shiftKey),
+ keyUp: ({ shiftKey }) => setSnapping(shiftKey),
+ click: ({ shiftKey }) => setSnapping(shiftKey),
+ drag: ({ shiftKey }) => setSnapping(shiftKey)
+ },
+ ["dragging" /* Dragging */]: {},
+ ["translating" /* Translating */]: {},
+ ["text-input" /* TextInput */]: {}
+ });
+ }
+};
+var UpdateMachine = class extends StateMachine11 {
+ constructor(update) {
+ super("idle" /* Idle */, {
+ ["idle" /* Idle */]: {
+ onEnter: update,
+ render: update
+ },
+ ["dragging" /* Dragging */]: {
+ onEnter: update,
+ render: update
+ },
+ ["translating" /* Translating */]: {
+ onEnter: update,
+ render: update
+ },
+ ["text-input" /* TextInput */]: {
+ render: update
+ }
+ });
+ }
+};
+var AnnotationsMainStateMachine = class extends StateMachine11 {
+ constructor(ctx, setActive) {
+ const createDatum = (type) => (datum) => {
+ ctx.create(type, datum);
+ this.active = ctx.selectLast();
+ };
+ const deleteDatum = () => {
+ if (this.active != null)
+ ctx.delete(this.active);
+ this.active = void 0;
+ ctx.select();
+ };
+ const stateMachineHelpers = {
+ createDatum
+ };
+ const createStateMachineContext = {
+ ...ctx,
+ delete: deleteDatum,
+ showTextInput: () => {
+ if (this.active != null)
+ ctx.showTextInput(this.active);
+ },
+ deselect: () => {
+ const prevActive = this.active;
+ this.active = void 0;
+ this.hovered = void 0;
+ ctx.select(this.active, prevActive);
+ },
+ showAnnotationOptions: () => {
+ if (this.active != null)
+ ctx.showAnnotationOptions(this.active);
+ }
+ };
+ const createStateMachines = Object.fromEntries(
+ Object.entries(annotationConfigs).map(([type, config]) => [
+ type,
+ config.createState(createStateMachineContext, stateMachineHelpers)
+ ])
+ );
+ const dragStateMachines = Object.fromEntries(
+ Object.entries(annotationConfigs).map(([type, config]) => [
+ type,
+ config.dragState(ctx, stateMachineHelpers)
+ ])
+ );
+ const actionColor = ({
+ colorPickerType,
+ colorOpacity,
+ color: color6,
+ opacity,
+ isMultiColor
+ }) => {
+ if (!this.datum)
+ return;
+ if (colorPickerType === "text-color") {
+ ctx.updateTextInputColor(color6);
+ }
+ setColor(this.datum, colorPickerType, colorOpacity, color6, opacity, isMultiColor);
+ ctx.update();
+ };
+ const actionFontSize = (fontSize) => {
+ const { datum, node } = this;
+ if (!datum || !node)
+ return;
+ if (isTextType(datum)) {
+ datum.fontSize = fontSize;
+ ctx.updateTextInputFontSize(fontSize);
+ } else if (hasLineText(datum)) {
+ datum.text.fontSize = fontSize;
+ }
+ ctx.update();
+ };
+ const actionLineStyle = (lineStyle) => {
+ const { datum, node } = this;
+ if (!datum || !node || !hasLineStyle(datum))
+ return;
+ setLineStyle(datum, lineStyle);
+ ctx.update();
+ };
+ const actionUpdateTextInputBBox = (bbox) => {
+ const { node } = this;
+ if (!node || !("setTextInputBBox" in node))
+ return;
+ node.setTextInputBBox(bbox);
+ ctx.update();
+ };
+ const actionSaveText = ({ textInputValue, bbox }) => {
+ const { datum } = this;
+ if (bbox != null && textInputValue != null && textInputValue.length > 0) {
+ if (!isTextType(datum)) {
+ return;
+ }
+ const wrappedText = maybeWrapText(datum, textInputValue, bbox.width);
+ datum.set({ text: wrappedText });
+ ctx.update();
+ ctx.recordAction(`Change ${datum.type} annotation text`);
+ } else {
+ ctx.delete(this.active);
+ ctx.recordAction(`Delete ${datum?.type} annotation`);
+ }
+ };
+ const actionCancel = () => {
+ ctx.updateTextInputBBox(void 0);
+ };
+ const guardActive = () => this.active != null;
+ const guardCopied = () => this.copied != null;
+ const guardActiveHasLineText = () => {
+ const { active, datum } = this;
+ if (active == null)
+ return false;
+ if (!datum)
+ return false;
+ return hasLineText(datum) && datum.isWriteable();
+ };
+ const guardActiveNotEphemeral = () => this.active != null && !isEphemeralType(this.datum);
+ const guardHovered = () => this.hovered != null;
+ super("idle" /* Idle */, {
+ ["idle" /* Idle */]: {
+ onEnter: () => {
+ ctx.select(this.active, this.active);
+ if (this.hoverCoords) {
+ this.hovered = ctx.hoverAtCoords(this.hoverCoords, this.active, this.hovered);
+ }
+ },
+ hover: ({ offset }) => {
+ this.hovered = ctx.hoverAtCoords(offset, this.active, this.hovered);
+ this.hoverCoords = offset;
+ },
+ translate: {
+ guard: guardActive,
+ target: "translating" /* Translating */,
+ action: ({ translation }) => {
+ ctx.startInteracting();
+ ctx.translate(this.active, translation);
+ ctx.update();
+ }
+ },
+ copy: {
+ guard: guardActiveNotEphemeral,
+ action: () => {
+ this.copied = ctx.copy(this.active);
+ }
+ },
+ cut: {
+ guard: guardActiveNotEphemeral,
+ action: () => {
+ this.copied = ctx.copy(this.active);
+ deleteDatum();
+ }
+ },
+ paste: {
+ guard: guardCopied,
+ action: () => {
+ ctx.paste(this.copied);
+ }
+ },
+ selectLast: () => {
+ const previousActive = this.active;
+ this.active = ctx.selectLast();
+ ctx.select(this.active, previousActive);
+ },
+ click: [
+ {
+ guard: () => {
+ const { active, hovered, datum } = this;
+ if (active == null || hovered !== active)
+ return false;
+ if (!datum)
+ return false;
+ return isTextType(datum) && datum.isWriteable();
+ },
+ target: "text-input" /* TextInput */
+ },
+ {
+ action: () => {
+ const prevActive = this.active;
+ this.active = this.hovered;
+ ctx.select(this.active, prevActive);
+ }
+ }
+ ],
+ dblclick: {
+ guard: guardActiveHasLineText,
+ action: ({ offset }) => {
+ const nodeAtCoords = ctx.getNodeAtCoords(offset, this.active) === "text" ? "text" : "line";
+ ctx.showAnnotationSettings(this.active, void 0, nodeAtCoords);
+ }
+ },
+ dragStart: [
+ {
+ guard: guardHovered,
+ target: "dragging" /* Dragging */,
+ action: () => {
+ const prevActive = this.active;
+ this.active = this.hovered;
+ ctx.select(this.active, prevActive);
+ ctx.startInteracting();
+ }
+ },
+ {
+ action: () => {
+ const prevActive = this.active;
+ this.active = this.hovered;
+ ctx.select(this.active, prevActive);
+ }
+ }
+ ],
+ color: {
+ guard: guardActive,
+ action: actionColor
+ },
+ fontSize: {
+ guard: guardActive,
+ action: actionFontSize
+ },
+ lineProps: {
+ guard: guardActive,
+ action: (props) => {
+ const datum = getTypedDatum(this.datum);
+ datum?.set(props);
+ ctx.update();
+ ctx.recordAction(
+ `Change ${datum?.type} ${Object.entries(props).map(([key, value]) => `${key} to ${value}`).join(", ")}`
+ );
+ }
+ },
+ lineStyle: {
+ guard: guardActive,
+ action: actionLineStyle
+ },
+ lineText: {
+ guard: guardActive,
+ action: (props) => {
+ const datum = getTypedDatum(this.datum);
+ if (!hasLineText(datum))
+ return;
+ if (isChannelType(datum) && props.position === "center") {
+ props.position = "inside";
+ }
+ datum.text.set(props);
+ ctx.update();
+ }
+ },
+ updateTextInputBBox: {
+ guard: guardActive,
+ action: actionUpdateTextInputBBox
+ },
+ toolbarPressSettings: {
+ guard: guardActiveHasLineText,
+ action: (sourceEvent) => {
+ ctx.showAnnotationSettings(this.active, sourceEvent);
+ }
+ },
+ reset: () => {
+ if (this.active != null) {
+ this.node?.toggleActive(false);
+ }
+ this.hovered = void 0;
+ this.active = void 0;
+ ctx.select(this.active, this.active);
+ ctx.resetToIdle();
+ },
+ delete: () => {
+ if (this.active == null)
+ return;
+ ctx.delete(this.active);
+ if (isEphemeralType(this.datum))
+ return;
+ ctx.recordAction(`Delete ${this.datum?.type} annotation`);
+ },
+ deleteAll: () => {
+ ctx.deleteAll();
+ },
+ ...createStateMachines
+ },
+ ["dragging" /* Dragging */]: {
+ onEnter: (_, data) => {
+ if (this.active == null)
+ return;
+ const type = ctx.getAnnotationType(this.active);
+ if (!type)
+ return;
+ this.transitionRoot(type);
+ this.transitionRoot("dragStart", data);
+ },
+ ...dragStateMachines
+ },
+ ["translating" /* Translating */]: {
+ onEnter: () => {
+ },
+ translate: {
+ guard: guardActive,
+ target: "translating" /* Translating */,
+ action: ({ translation }) => {
+ ctx.startInteracting();
+ ctx.translate(this.active, translation);
+ ctx.update();
+ }
+ },
+ translateEnd: {
+ guard: guardActive,
+ target: "idle" /* Idle */
+ },
+ onExit: () => {
+ ctx.stopInteracting();
+ ctx.update();
+ ctx.recordAction("Translate annotation");
+ }
+ },
+ ["text-input" /* TextInput */]: {
+ onEnter: () => {
+ if (this.active == null)
+ return;
+ const datum = getTypedDatum(this.datum);
+ if (!datum || !("getTextInputCoords" in datum))
+ return;
+ ctx.startInteracting();
+ ctx.showTextInput(this.active);
+ datum.visible = false;
+ ctx.update();
+ },
+ updateTextInputBBox: {
+ guard: guardActive,
+ action: actionUpdateTextInputBBox
+ },
+ resize: {
+ target: "idle" /* Idle */,
+ action: actionSaveText
+ },
+ click: {
+ target: "idle" /* Idle */,
+ action: actionSaveText
+ },
+ drag: {
+ target: "idle" /* Idle */,
+ action: actionSaveText
+ },
+ textInput: [
+ {
+ guard: guardCancelAndExit,
+ target: "idle" /* Idle */,
+ action: actionCancel
+ },
+ {
+ guard: guardSaveAndExit,
+ target: "idle" /* Idle */,
+ action: actionSaveText
+ }
+ ],
+ color: {
+ guard: guardActive,
+ action: actionColor
+ },
+ fontSize: {
+ guard: guardActive,
+ action: actionFontSize
+ },
+ cancel: {
+ target: "idle" /* Idle */,
+ action: actionCancel
+ },
+ onExit: () => {
+ ctx.stopInteracting();
+ ctx.hideTextInput();
+ const wasActive = this.active;
+ this.active = this.hovered = void 0;
+ ctx.select(this.active, wasActive);
+ if (wasActive == null)
+ return;
+ const datum = ctx.datum(wasActive);
+ const node = ctx.node(wasActive);
+ if (!datum || !node)
+ return;
+ datum.visible = true;
+ }
+ }
+ });
+ this.setActive = setActive;
+ this.debug = Debug11.create(true, "annotations");
+ this.snapping = false;
+ }
+};
+__decorateClass([
+ ActionOnSet({
+ changeValue(newValue) {
+ this.setActive(newValue);
+ }
+ }),
+ StateMachineProperty11()
+], AnnotationsMainStateMachine.prototype, "active", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsMainStateMachine.prototype, "hovered", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsMainStateMachine.prototype, "hoverCoords", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsMainStateMachine.prototype, "copied", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsMainStateMachine.prototype, "snapping", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsMainStateMachine.prototype, "datum", 2);
+__decorateClass([
+ StateMachineProperty11()
+], AnnotationsMainStateMachine.prototype, "node", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationsToolbar.ts
+var import_ag_charts_community84 = require("ag-charts-community");
+var import_ag_charts_core40 = require("ag-charts-core");
+var { ActionOnSet: ActionOnSet2, LayoutElement, Menu: Menu2, PropertiesArray: PropertiesArray2, ToolbarButtonProperties: ToolbarButtonProperties2, Property: Property31, ChartAxisDirection: ChartAxisDirection7 } = import_ag_charts_community84._ModuleSupport;
+var AnnotationsToolbarButtonProperties = class extends ToolbarButtonProperties2 {
+};
+__decorateClass([
+ Property31
+], AnnotationsToolbarButtonProperties.prototype, "value", 2);
+var AnnotationsToolbar = class extends import_ag_charts_community84._ModuleSupport.BaseProperties {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = true;
+ this.padding = 20;
+ this.buttons = new PropertiesArray2(AnnotationsToolbarButtonProperties);
+ this.events = new import_ag_charts_core40.EventEmitter();
+ this.annotationMenu = new Menu2(this.ctx, "annotations");
+ this.cleanup = new import_ag_charts_core40.CleanupRegistry();
+ this.toolbar = ctx.sharedToolbar.getSharedToolbar("annotations");
+ const onKeyDown = this.onKeyDown.bind(this);
+ this.toolbar.addListener("keydown", onKeyDown);
+ this.cleanup.register(
+ this.toolbar.addToolbarListener("button-pressed", this.onToolbarButtonPress.bind(this)),
+ ctx.layoutManager.registerElement(LayoutElement.ToolbarLeft, this.onLayoutStart.bind(this)),
+ () => {
+ this.toolbar.removeListener("keydown", onKeyDown);
+ this.toolbar.destroy();
+ }
+ );
+ }
+ destroy() {
+ this.cleanup.flush();
+ }
+ toggleClearButtonEnabled(enabled) {
+ const index = this.buttons.findIndex((button) => button.value === "clear");
+ this.toolbar.toggleButtonEnabledByIndex(index, enabled);
+ }
+ resetButtonIcons() {
+ for (const [index, button] of this.buttons.entries()) {
+ switch (button.value) {
+ case "line-menu":
+ this.updateButtonByIndex(index, { icon: "trend-line-drawing", value: "line-menu" });
+ break;
+ case "fibonacci-menu":
+ this.updateButtonByIndex(index, { icon: "fibonacci-retracement-drawing", value: "fibonacci-menu" });
+ break;
+ case "text-menu":
+ this.updateButtonByIndex(index, { icon: "text-annotation", value: "text-menu" });
+ break;
+ case "shape-menu":
+ this.updateButtonByIndex(index, { icon: "arrow-drawing", value: "shape-menu" });
+ break;
+ case "measurer-menu":
+ this.updateButtonByIndex(index, { icon: "measurer-drawing", value: "measurer-menu" });
+ break;
+ }
+ }
+ }
+ hideOverlays() {
+ this.annotationMenu.hide();
+ }
+ clearActiveButton() {
+ this.toolbar.clearActiveButton();
+ }
+ onLayoutStart(event) {
+ if (!this.enabled)
+ return;
+ this.toolbar.updateButtons(this.buttons);
+ this.toolbar.layout(event.layoutBox, this.padding);
+ }
+ refreshButtonsEnabled(enabled) {
+ for (const [index, button] of this.buttons.entries()) {
+ if (!button)
+ continue;
+ this.toolbar.toggleButtonEnabledByIndex(index, enabled);
+ }
+ }
+ onToolbarButtonPress({
+ event,
+ button,
+ buttonBounds,
+ buttonWidget
+ }) {
+ const axisScale = this.ctx.axisManager.getAxisContext(ChartAxisDirection7.Y)[0].scale;
+ switch (button.value) {
+ case "clear":
+ this.events.emit("pressed-clear", null);
+ break;
+ case "line-menu":
+ this.onToolbarButtonPressShowMenu(
+ event,
+ buttonBounds,
+ buttonWidget,
+ button.value,
+ "toolbarAnnotationsLineAnnotations",
+ LINE_ANNOTATION_ITEMS.filter((item) => item.visible ? item.visible(axisScale) : true)
+ );
+ break;
+ case "fibonacci-menu":
+ this.onToolbarButtonPressShowMenu(
+ event,
+ buttonBounds,
+ buttonWidget,
+ button.value,
+ "toolbarAnnotationsFibonacciAnnotations",
+ FIBONACCI_ANNOTATION_ITEMS
+ );
+ break;
+ case "text-menu":
+ this.onToolbarButtonPressShowMenu(
+ event,
+ buttonBounds,
+ buttonWidget,
+ button.value,
+ "toolbarAnnotationsTextAnnotations",
+ TEXT_ANNOTATION_ITEMS
+ );
+ break;
+ case "shape-menu":
+ this.onToolbarButtonPressShowMenu(
+ event,
+ buttonBounds,
+ buttonWidget,
+ button.value,
+ "toolbarAnnotationsShapeAnnotations",
+ SHAPE_ANNOTATION_ITEMS
+ );
+ break;
+ case "measurer-menu":
+ this.onToolbarButtonPressShowMenu(
+ event,
+ buttonBounds,
+ buttonWidget,
+ button.value,
+ "toolbarAnnotationsMeasurerAnnotations",
+ MEASURER_ANNOTATION_ITEMS
+ );
+ break;
+ }
+ }
+ onToolbarButtonPressShowMenu(event, buttonBounds, controller, menu, ariaLabel, items) {
+ this.events.emit("pressed-show-menu", null);
+ const index = this.buttons.findIndex((button) => button.value === menu);
+ this.toolbar.toggleActiveButtonByIndex(index);
+ this.annotationMenu.setAnchor({ x: buttonBounds.x + buttonBounds.width + 6, y: buttonBounds.y });
+ this.annotationMenu.show(controller, {
+ items,
+ ariaLabel: this.ctx.localeManager.t(ariaLabel),
+ class: "ag-charts-annotations__toolbar-menu",
+ sourceEvent: event.sourceEvent,
+ onPress: this.onButtonPressMenuCreateAnnotation.bind(this, menu)
+ });
+ }
+ onButtonPressMenuCreateAnnotation(menu, item) {
+ const index = this.buttons.findIndex((button) => button.value === menu);
+ this.updateButtonByIndex(index, { icon: item.icon });
+ this.events.emit("pressed-create-annotation", { annotation: item.value });
+ this.annotationMenu.hide();
+ }
+ onKeyDown({ sourceEvent }) {
+ if (sourceEvent.key === "Escape") {
+ this.events.emit("cancel-create-annotation", null);
+ }
+ }
+ updateButtonByIndex(index, change) {
+ const button = this.buttons.at(index);
+ if (!button)
+ return;
+ button.set({ ...button.toJson(), ...change, value: change.value ?? button.value });
+ this.toolbar.updateButtonByIndex(index, { ...button.toJson() });
+ }
+};
+__decorateClass([
+ Property31,
+ ActionOnSet2({
+ changeValue(enabled) {
+ this.toolbar?.setHidden(!enabled);
+ }
+ })
+], AnnotationsToolbar.prototype, "enabled", 2);
+__decorateClass([
+ Property31
+], AnnotationsToolbar.prototype, "padding", 2);
+__decorateClass([
+ Property31
+], AnnotationsToolbar.prototype, "buttons", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/axisButton.ts
+var import_ag_charts_community85 = require("ag-charts-community");
+var { BaseModuleInstance, InteractionState, Property: Property32, ChartAxisDirection: ChartAxisDirection8, getIconClassNames } = import_ag_charts_community85._ModuleSupport;
+var DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS = `ag-charts-annotations__axis-button`;
+var AxisButton = class extends BaseModuleInstance {
+ constructor(ctx, axisCtx, onButtonClick, seriesRect) {
+ super();
+ this.ctx = ctx;
+ this.axisCtx = axisCtx;
+ this.onButtonClick = onButtonClick;
+ this.seriesRect = seriesRect;
+ this.enabled = true;
+ this.snap = false;
+ this.padding = 0;
+ this.button = this.setup();
+ this.toggleVisibility(false);
+ this.updateButtonElement();
+ this.snap = Boolean(axisCtx.scale.bandwidth);
+ ctx.domManager.addEventListener("focusin", ({ target }) => {
+ const htmlTarget = target instanceof HTMLElement ? target : void 0;
+ const isSeriesAreaChild = htmlTarget && ctx.domManager.contains(htmlTarget, "series-area");
+ if (!isSeriesAreaChild && htmlTarget !== this.button.getElement())
+ this.hide();
+ });
+ this.cleanup.register(
+ ctx.widgets.seriesWidget.addListener("drag-move", (e) => this.onMouseDrag(e)),
+ ctx.widgets.seriesWidget.addListener("mousemove", (e) => this.onMouseMove(e)),
+ ctx.widgets.seriesWidget.addListener("mouseleave", () => this.onMouseLeave()),
+ ctx.widgets.seriesDragInterpreter?.events.on("click", (e) => this.onClick(e)),
+ ctx.eventsHub.on("series:focus-change", () => this.onKeyPress()),
+ ctx.eventsHub.on("zoom:pan-start", () => this.hide()),
+ ctx.eventsHub.on("zoom:change", () => this.hide()),
+ () => this.destroyElements(),
+ () => this.button.destroy()
+ );
+ }
+ update(seriesRect, padding) {
+ this.seriesRect = seriesRect;
+ this.padding = padding;
+ }
+ setup() {
+ const button = new import_ag_charts_community85._Widget.ButtonWidget();
+ button.addClass(DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS);
+ button.setTabIndex(-1);
+ button.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine"));
+ this.ctx.widgets.seriesWidget.getElement().appendChild(button.getElement());
+ return button;
+ }
+ destroyElements() {
+ this.ctx.domManager.removeChild("canvas-overlay", DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS);
+ }
+ onMouseMove(e) {
+ if (this.ctx.interactionManager.isState(InteractionState.Clickable))
+ this.show(e);
+ }
+ onMouseDrag(e) {
+ if (this.ctx.interactionManager.isState(InteractionState.AnnotationsMoveable))
+ this.show(e);
+ }
+ onMouseLeave() {
+ if (this.ctx.interactionManager.isState(InteractionState.Clickable))
+ this.hide();
+ }
+ onClick(e) {
+ if (this.ctx.interactionManager.isState(InteractionState.Clickable) && e.device === "touch")
+ this.show(e);
+ }
+ show(event) {
+ const { sourceEvent, currentX: x, currentY: y } = event;
+ if (!(this.enabled && this.ctx.widgets.seriesWidget.getElement().contains(sourceEvent.target))) {
+ this.hide();
+ return;
+ }
+ this.toggleVisibility(true);
+ const buttonCoords = this.getButtonCoordinates({ x, y });
+ this.coords = {
+ x: buttonCoords.x + this.button.clientWidth / 2,
+ y: buttonCoords.y + this.button.clientHeight / 2
+ };
+ this.updatePosition(buttonCoords);
+ }
+ hide() {
+ this.toggleVisibility(false);
+ }
+ onKeyPress() {
+ if (this.snap && this.ctx.interactionManager.isState(InteractionState.Default))
+ return;
+ this.hide();
+ }
+ getButtonCoordinates({ x, y }) {
+ const {
+ axisCtx: { direction, position },
+ seriesRect,
+ snap,
+ axisCtx,
+ padding
+ } = this;
+ const { clientWidth: buttonWidth, clientHeight: buttonHeight } = this.button;
+ const [minY, maxY] = [0, seriesRect.height];
+ const [minX, maxX] = [0, seriesRect.width];
+ if (snap) {
+ x = convert(invert(x - seriesRect.x, axisCtx), axisCtx) + seriesRect.x;
+ y = convert(invert(y - seriesRect.y, axisCtx), axisCtx) + seriesRect.y;
+ }
+ if (direction === ChartAxisDirection8.X) {
+ const crosshairLabelPadding = 5;
+ const offset = buttonHeight - Math.max(0, padding - crosshairLabelPadding);
+ x = x - buttonWidth / 2;
+ y = position === "top" ? minY - buttonHeight + offset : maxY - offset;
+ } else {
+ const crosshairLabelPadding = 9;
+ const offset = buttonWidth - Math.max(0, padding - crosshairLabelPadding);
+ x = position === "left" ? minX - buttonWidth + offset : maxX - offset;
+ y = y - buttonHeight / 2;
+ }
+ return { x, y };
+ }
+ toggleVisibility(visible) {
+ const { button } = this;
+ if (button == null)
+ return;
+ const isVisible = this.enabled && visible;
+ this.toggleClass("-hidden", !isVisible);
+ }
+ toggleClass(name, include) {
+ this.button.toggleClass(`${DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS}-${name}`, include);
+ }
+ updatePosition({ x, y }) {
+ this.button.getElement().style.transform = `translate(${Math.round(x)}px, ${Math.round(y)}px)`;
+ }
+ updateButtonElement() {
+ const { button } = this;
+ button.addListener("click", () => this.onButtonClick(this.coords));
+ button.addListener("touchend", () => this.onButtonClick(this.coords));
+ button.addListener("drag-start", () => {
+ });
+ button.setInnerHTML(
+ ``
+ );
+ }
+};
+__decorateClass([
+ Property32
+], AxisButton.prototype, "enabled", 2);
+
+// packages/ag-charts-enterprise/src/features/annotations/settings-dialog/settingsDialog.ts
+var import_ag_charts_community87 = require("ag-charts-community");
+var import_ag_charts_core42 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/components/dialog/dialog.ts
+var import_ag_charts_community86 = require("ag-charts-community");
+var import_ag_charts_core41 = require("ag-charts-core");
+var {
+ Color: Color5,
+ DraggablePopover,
+ NativeWidget,
+ Vec2: Vec218,
+ createButton,
+ createCheckbox,
+ createSelect,
+ createTextArea,
+ initRovingTabIndex,
+ getIconClassNames: getIconClassNames2,
+ mapValues
+} = import_ag_charts_community86._ModuleSupport;
+var _Dialog = class _Dialog extends DraggablePopover {
+ constructor(ctx, id) {
+ super(ctx, id);
+ this.dragHandleDraggingClass = "ag-charts-dialog__drag-handle--dragging";
+ this.colorPicker = new ColorPicker(this.ctx, { detached: true });
+ this.cleanup.register(ctx.eventsHub.on("layout:complete", this.onLayoutComplete.bind(this)));
+ }
+ showWithChildren(children, options) {
+ const popover = super.showWithChildren(children, options);
+ popover.classList.add("ag-charts-dialog");
+ popover.setAttribute("role", "dialog");
+ popover.addEventListener("mousedown", (event) => {
+ if (event.target.classList?.contains("ag-charts-dialog__color-picker-button"))
+ return;
+ this.colorPicker.hide();
+ });
+ popover.addEventListener("keydown", this.onKeyDown.bind(this));
+ (0, import_ag_charts_core41.getWindow)().requestAnimationFrame(() => this.reposition());
+ this.colorPicker.attachTo(this);
+ return popover;
+ }
+ updatePosition(position) {
+ super.updatePosition(position);
+ const { anchor, fallbackAnchor } = this.getColorPickerAnchors() ?? {};
+ if (!anchor)
+ return;
+ this.colorPicker.setAnchor(anchor, fallbackAnchor);
+ }
+ /**************
+ * Containers *
+ **************/
+ createTabs(tablistLabel, initial, tabs) {
+ const element = (0, import_ag_charts_core41.createElement)("div", "ag-charts-dialog__tabs");
+ const tabButtonIds = mapValues(tabs, () => (0, import_ag_charts_core41.createElementId)());
+ const tabPanelIds = mapValues(tabs, () => (0, import_ag_charts_core41.createElementId)());
+ for (const [key, tab] of (0, import_ag_charts_core41.entries)(tabs)) {
+ (0, import_ag_charts_core41.setAttributes)(tab.panel, {
+ id: tabPanelIds[key],
+ role: "tabpanel",
+ "aria-labelledby": tabButtonIds[key]
+ });
+ }
+ const onPressTab = (active) => {
+ for (const [key, tab] of (0, import_ag_charts_core41.entries)(tabs)) {
+ tab.panel.classList.toggle("ag-charts-dialog__tab-panel--active", key === active);
+ tabButtons[key].classList.toggle("ag-charts-dialog__tab-button--active", key === active);
+ (0, import_ag_charts_core41.setAttribute)(tabButtons[key], "aria-selected", key === active);
+ if (key === active)
+ tab.onShow?.();
+ }
+ };
+ const header = new NativeWidget((0, import_ag_charts_core41.createElement)("div", "ag-charts-dialog__header"));
+ header.addListener("drag-start", (event) => {
+ const { sourceEvent } = event;
+ if (sourceEvent.target instanceof Element && sourceEvent.target.classList.contains("ag-charts-dialog__header")) {
+ this.onDragStart(event);
+ }
+ });
+ header.addListener("drag-move", (event) => this.onDragMove(event));
+ header.addListener("drag-end", () => this.onDragEnd());
+ const dragHandle = new DragHandleWidget();
+ this.setDragHandle(dragHandle);
+ const tabButtons = mapValues(
+ tabs,
+ (tab, key) => createButton(
+ {
+ label: this.ctx.localeManager.t(tab.label),
+ onPress: () => onPressTab(key)
+ },
+ {
+ id: tabButtonIds[key],
+ class: "ag-charts-dialog__tab-button",
+ role: "tab",
+ "aria-controls": tabPanelIds[key]
+ }
+ )
+ );
+ const tabList = (0, import_ag_charts_core41.createElement)("div", "ag-charts-dialog__tab-list");
+ (0, import_ag_charts_core41.setAttributes)(tabList, { role: "tablist", "aria-label": this.ctx.localeManager.t(tablistLabel) });
+ tabList.append(...Object.values(tabButtons));
+ const closeButton = this.createHeaderCloseButton();
+ header.getElement().append(dragHandle.getElement(), tabList, closeButton);
+ element.append(header.getElement(), ...Object.values(tabs).map((t) => t.panel));
+ onPressTab(initial);
+ initRovingTabIndex({ orientation: "horizontal", buttons: Object.values(tabButtons) });
+ return { tabs: element, initialFocus: tabButtons[initial] };
+ }
+ createTabPanel() {
+ return (0, import_ag_charts_core41.createElement)("div", "ag-charts-dialog__tab-panel");
+ }
+ /**********
+ * Inputs *
+ **********/
+ createInputGroupLine() {
+ return (0, import_ag_charts_core41.createElement)("div", "ag-charts-dialog__input-group-line");
+ }
+ createRadioGroup({ label, options, value, onChange }) {
+ const group = this.createInputGroup(label);
+ (0, import_ag_charts_core41.setAttributes)(group, {
+ role: "radiogroup",
+ tabindex: -1,
+ "aria-label": this.ctx.localeManager.t(label)
+ });
+ const activeClass = "ag-charts-dialog__button--active";
+ const buttons2 = [];
+ for (const button of options) {
+ const { icon, altText: altTextKey } = button;
+ const altText = this.ctx.localeManager.t(altTextKey);
+ const buttonEl = createButton(
+ {
+ icon,
+ altText,
+ onPress: () => {
+ for (const b of Array.from(group.children)) {
+ b.classList.remove(activeClass);
+ b.ariaChecked = "false";
+ }
+ buttonEl.classList.add(activeClass);
+ buttonEl.ariaChecked = "true";
+ onChange(button.value);
+ }
+ },
+ {
+ "aria-checked": button.value === value,
+ class: "ag-charts-dialog__button",
+ role: "radio",
+ title: altText
+ }
+ );
+ if (button.value === value) {
+ buttonEl.classList.add(activeClass);
+ }
+ group.appendChild(buttonEl);
+ buttons2.push(buttonEl);
+ }
+ initRovingTabIndex({ orientation: "horizontal", buttons: buttons2 });
+ return group;
+ }
+ createSelect({ altText, label, options, value, onChange }) {
+ const group = this.createInputGroup(label);
+ const altTextT = this.ctx.localeManager.t(altText);
+ const select = createSelect(
+ { value, options, onChange },
+ { class: "ag-charts-dialog__select", "aria-label": altTextT, title: altTextT }
+ );
+ group.append(select);
+ return group;
+ }
+ createTextArea({ placeholder, value, onChange }) {
+ const placeholderT = placeholder ? this.ctx.localeManager.t(placeholder) : void 0;
+ return createTextArea({ value, onChange }, { placeholder: placeholderT });
+ }
+ createCheckbox({ label, checked, onChange }) {
+ const id = (0, import_ag_charts_core41.createElementId)();
+ const group = this.createInputGroup(label, { for: id });
+ const checkbox = createCheckbox(
+ { checked, onChange },
+ { class: "ag-charts-dialog__checkbox", role: "switch", id }
+ );
+ group.append(checkbox);
+ return group;
+ }
+ createColorPicker({
+ color: color6,
+ opacity,
+ label,
+ altText,
+ onChange,
+ onChangeHide,
+ isMultiColor,
+ hasMultiColorOption
+ }) {
+ const group = this.createInputGroup(label);
+ const altTextT = this.ctx.localeManager.t(altText);
+ const colorEl = createButton(
+ {
+ label: altTextT,
+ onPress: (event) => {
+ const { anchor, fallbackAnchor } = this.getColorPickerAnchors(colorEl) ?? {};
+ this.colorPicker.show({
+ anchor,
+ fallbackAnchor,
+ color: color6,
+ opacity,
+ isMultiColor,
+ hasMultiColorOption,
+ sourceEvent: event,
+ onChange: (newColorOpacity, newColor, newOpacity, newIsMultiColor) => {
+ colorEl.style.setProperty("--color", newColorOpacity);
+ colorEl.classList.toggle(
+ "ag-charts-dialog__color-picker-button--multi-color",
+ newIsMultiColor
+ );
+ onChange(newColorOpacity, newColor, newOpacity, newIsMultiColor);
+ },
+ onChangeHide
+ });
+ }
+ },
+ {
+ "aria-label": altTextT,
+ tabindex: 0,
+ class: "ag-charts-dialog__color-picker-button",
+ title: altTextT
+ }
+ );
+ if (isMultiColor) {
+ colorEl.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");
+ } else if (color6) {
+ const hex = Color5.fromString(color6);
+ const hexWithOpacity = new Color5(hex.r, hex.g, hex.b, opacity);
+ colorEl.style.setProperty("--color", hexWithOpacity.toHexString());
+ }
+ group.append(colorEl);
+ this.hideFns.push(() => {
+ this.colorPicker.hide();
+ });
+ return group;
+ }
+ /***********
+ * Private *
+ ***********/
+ createHeaderCloseButton() {
+ return createButton(
+ { icon: "close", altText: this.ctx.localeManager.t("iconAltTextClose"), onPress: () => this.hide() },
+ { class: "ag-charts-dialog__close-button" }
+ );
+ }
+ createInputGroup(label, options) {
+ const group = (0, import_ag_charts_core41.createElement)("div", "ag-charts-dialog__input-group");
+ const labelEl = (0, import_ag_charts_core41.createElement)("label", "ag-charts-dialog__input-group-label");
+ labelEl.innerText = this.ctx.localeManager.t(label);
+ (0, import_ag_charts_core41.setAttribute)(labelEl, "for", options?.for);
+ group.appendChild(labelEl);
+ return group;
+ }
+ onLayoutComplete(event) {
+ this.seriesRect = event.series.paddedRect;
+ this.reposition();
+ }
+ onKeyDown(event) {
+ if (event.altKey || event.ctrlKey || event.metaKey || event.isComposing || event.key !== "Escape")
+ return;
+ this.hide();
+ }
+ reposition() {
+ const { seriesRect, ctx } = this;
+ const clientRect = ctx.domManager.getBoundingClientRect();
+ const popover = this.getPopoverElement();
+ if (!seriesRect || !popover)
+ return;
+ const outerOffset = Vec218.from(0, seriesRect.y);
+ const outerSize = Vec218.from(clientRect.width, seriesRect.height);
+ const popoverSize = Vec218.from(popover);
+ const halfWidth = Vec218.from(0.5, 1);
+ let position;
+ if (seriesRect.width > 1e3) {
+ const bottomCenter = Vec218.sub(
+ Vec218.add(outerOffset, Vec218.multiply(outerSize, halfWidth)),
+ Vec218.multiply(popoverSize, halfWidth)
+ );
+ position = Vec218.sub(bottomCenter, Vec218.from(0, _Dialog.offset));
+ } else {
+ const bottomRight = Vec218.sub(Vec218.add(outerOffset, outerSize), popoverSize);
+ position = Vec218.sub(bottomRight, _Dialog.offset);
+ }
+ this.updatePosition(position);
+ }
+ getColorPickerAnchors(element) {
+ if (element)
+ this.colorPickerAnchorElement = element;
+ if (!this.colorPickerAnchorElement)
+ return;
+ const rect = this.colorPickerAnchorElement.getBoundingClientRect();
+ const canvasRect = this.ctx.domManager.getBoundingClientRect();
+ const topLeft = Vec218.sub(Vec218.from(rect.x, rect.y), Vec218.from(canvasRect.left, canvasRect.top));
+ const anchor = Vec218.add(topLeft, Vec218.from(0, rect.height + 5));
+ const fallbackAnchor = Vec218.sub(topLeft, Vec218.from(0, 5));
+ return { anchor, fallbackAnchor };
+ }
+};
+_Dialog.offset = 60;
+var Dialog = _Dialog;
+var DragHandleWidget = class extends NativeWidget {
+ constructor() {
+ super((0, import_ag_charts_core41.createElement)("div", "ag-charts-dialog__drag-handle"));
+ const icon = new NativeWidget((0, import_ag_charts_core41.createElement)("span", getIconClassNames2("drag-handle")));
+ icon.setAriaHidden(true);
+ this.addChild(icon);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/settings-dialog/settingsDialog.ts
+var { focusCursorAtEnd: focusCursorAtEnd2 } = import_ag_charts_community87._ModuleSupport;
+var AnnotationSettingsDialog = class extends Dialog {
+ constructor(ctx) {
+ super(ctx, "settings");
+ this.events = new import_ag_charts_core42.EventEmitter();
+ this.hideFns.push(() => this.events.emit("hidden", null));
+ }
+ show(datum, options) {
+ const lineTab = this.createLinearLineTab(datum, options);
+ const textTab = this.createLinearTextTab(datum, options);
+ let lineLabel = "dialogHeaderLine";
+ if (isChannelType(datum)) {
+ lineLabel = "dialogHeaderChannel";
+ } else if (isFibonacciType(datum)) {
+ lineLabel = "dialogHeaderFibonacciRange";
+ } else if (datum.type === "date-range" /* DateRange */) {
+ lineLabel = "dialogHeaderDateRange";
+ } else if (datum.type === "price-range" /* PriceRange */) {
+ lineLabel = "dialogHeaderPriceRange";
+ } else if (datum.type === "date-price-range" /* DatePriceRange */) {
+ lineLabel = "dialogHeaderDatePriceRange";
+ }
+ const { tabs, initialFocus } = this.createTabs("ariaLabelSettingsTabBar", options.initialSelectedTab, {
+ line: {
+ label: lineLabel,
+ panel: lineTab
+ },
+ text: {
+ label: "dialogHeaderText",
+ panel: textTab.panel,
+ onShow: textTab.onShow
+ }
+ });
+ options.initialFocus = initialFocus;
+ const popover = this.showWithChildren([tabs], options);
+ popover.classList.add("ag-charts-dialog--annotation-settings");
+ }
+ createLinearLineTab(datum, options) {
+ const panel = this.createTabPanel();
+ const groupOne = this.createInputGroupLine();
+ const groupTwo = this.createInputGroupLine();
+ const hasMultiColorOption = "isMultiColor" in datum;
+ const lineColorPicker = this.createColorPickerInput(
+ "line-color",
+ datum.getDefaultColor("line-color"),
+ datum.getDefaultOpacity("line-color"),
+ hasMultiColorOption ? datum.isMultiColor : false,
+ hasMultiColorOption,
+ options.onChangeLineColor,
+ options.onChangeHideLineColor
+ );
+ const strokeWidth = this.createStrokeWidthSelect(datum.strokeWidth ?? 2, options.onChangeLineStyleWidth);
+ const lineStyle = this.createLineStyleRadioGroup(datum.lineStyle ?? "solid", options.onChangeLineStyleType);
+ groupOne.append(lineColorPicker);
+ if ("background" in datum) {
+ const fillColorPicker = this.createColorPickerInput(
+ "fill-color",
+ datum.getDefaultColor("fill-color"),
+ datum.getDefaultOpacity("fill-color"),
+ false,
+ false,
+ options.onChangeFillColor,
+ options.onChangeHideFillColor
+ );
+ groupOne.append(fillColorPicker);
+ groupTwo.append(strokeWidth);
+ } else if ("showFill" in datum) {
+ groupOne.append(
+ this.createCheckbox({
+ label: "dialogInputShowFill",
+ checked: datum.showFill ?? true,
+ onChange: (showFill) => options.onChangeLine({ showFill })
+ })
+ );
+ groupTwo.append(strokeWidth);
+ } else {
+ groupOne.append(strokeWidth);
+ }
+ groupTwo.append(lineStyle);
+ panel.append(groupOne, groupTwo);
+ if ("bands" in datum) {
+ panel.append(
+ this.createFibonacciRatioSelect(datum.bands ?? 10, (bands) => options.onChangeLine({ bands }))
+ );
+ }
+ if ("extendStart" in datum && "extendEnd" in datum) {
+ panel.append(
+ this.createCheckbox({
+ label: isChannelType(datum) ? "dialogInputExtendChannelStart" : "dialogInputExtendLineStart",
+ checked: datum.extendStart ?? false,
+ onChange: (extendStart) => options.onChangeLine({ extendStart })
+ }),
+ this.createCheckbox({
+ label: isChannelType(datum) ? "dialogInputExtendChannelEnd" : "dialogInputExtendLineEnd",
+ checked: datum.extendEnd ?? false,
+ onChange: (extendEnd) => options.onChangeLine({ extendEnd })
+ })
+ );
+ }
+ if ("extendAbove" in datum && "extendBelow" in datum) {
+ panel.append(
+ this.createCheckbox({
+ label: "dialogInputExtendAbove",
+ checked: datum.extendAbove ?? false,
+ onChange: (extendAbove) => options.onChangeLine({ extendAbove })
+ }),
+ this.createCheckbox({
+ label: "dialogInputExtendBelow",
+ checked: datum.extendBelow ?? false,
+ onChange: (extendBelow) => options.onChangeLine({ extendBelow })
+ })
+ );
+ }
+ if ("extendLeft" in datum && "extendRight" in datum) {
+ panel.append(
+ this.createCheckbox({
+ label: "dialogInputExtendLeft",
+ checked: datum.extendLeft ?? false,
+ onChange: (extendLeft) => options.onChangeLine({ extendLeft })
+ }),
+ this.createCheckbox({
+ label: "dialogInputExtendRight",
+ checked: datum.extendRight ?? false,
+ onChange: (extendRight) => options.onChangeLine({ extendRight })
+ })
+ );
+ }
+ if ("reverse" in datum && "showFill" in datum) {
+ panel.append(
+ this.createCheckbox({
+ label: "dialogInputReverse",
+ checked: datum.reverse ?? false,
+ onChange: (reverse) => options.onChangeLine({ reverse })
+ })
+ );
+ }
+ return panel;
+ }
+ createLinearTextTab(datum, options) {
+ const panel = this.createTabPanel();
+ const textArea = this.createTextArea({
+ placeholder: "inputTextareaPlaceholder",
+ value: datum.text.label,
+ onChange: (value) => options.onChangeText({ label: value })
+ });
+ const fontSize = this.createFontSizeSelect(datum.text.fontSize, options.onChangeTextFontSize);
+ const colorPicker = this.createColorPickerInput(
+ "text-color",
+ datum.text.color,
+ 1,
+ false,
+ false,
+ options.onChangeTextColor,
+ options.onChangeHideTextColor
+ );
+ const textPosition = datum.text.position === "inside" ? "center" : datum.text.position;
+ const position = this.createPositionRadioGroup(
+ textPosition ?? "top",
+ (value) => options.onChangeText({ position: value })
+ );
+ const alignment = this.createAlignmentRadioGroup(
+ datum.text.alignment ?? "center",
+ (value) => options.onChangeText({ alignment: value })
+ );
+ const inputGroupLine = this.createInputGroupLine();
+ inputGroupLine.append(fontSize, colorPicker, position, alignment);
+ panel.append(textArea, inputGroupLine);
+ return { panel, onShow: () => focusCursorAtEnd2(textArea) };
+ }
+ createColorPickerInput(colorType, color6, opacity, isMultiColor, hasMultiColorOption, onChange, onChangeHide) {
+ const label = colorType === "fill-color" ? "dialogInputFillColorPicker" : "dialogInputColorPicker";
+ const altText = colorType === "fill-color" ? "dialogInputFillColorPickerAltText" : "dialogInputColorPickerAltText";
+ return this.createColorPicker({
+ label,
+ altText,
+ color: color6,
+ opacity,
+ isMultiColor,
+ hasMultiColorOption,
+ onChange,
+ onChangeHide
+ });
+ }
+ createStrokeWidthSelect(strokeWidth, onChange) {
+ return this.createSelect({
+ label: "dialogInputStrokeWidth",
+ altText: "dialogInputStrokeWidthAltText",
+ options: LINE_STROKE_WIDTH_ITEMS.map(({ label, value }) => ({ label, value: `${value}` })),
+ value: String(strokeWidth),
+ onChange: (value) => onChange(Number(value))
+ });
+ }
+ createFibonacciRatioSelect(bands, onChange) {
+ return this.createSelect({
+ label: "dialogInputFibonacciBands",
+ altText: "dialogInputFibonacciBandsAltText",
+ options: FIBONACCI_RATIO_ITEMS.map(({ label, value }) => ({ label, value: `${value}` })),
+ value: String(bands),
+ onChange: (value) => onChange(Number(value))
+ });
+ }
+ createLineStyleRadioGroup(lineStyle, onChange) {
+ return this.createRadioGroup({
+ label: "dialogInputLineStyle",
+ options: [
+ { icon: "line-style-solid", altText: "iconAltTextLineStyleSolid", value: "solid" },
+ { icon: "line-style-dashed", altText: "iconAltTextLineStyleDashed", value: "dashed" },
+ { icon: "line-style-dotted", altText: "iconAltTextLineStyleDotted", value: "dotted" }
+ ],
+ value: lineStyle,
+ onChange
+ });
+ }
+ createFontSizeSelect(fontSize, onChange) {
+ return this.createSelect({
+ label: "dialogInputFontSize",
+ altText: "dialogInputFontSizeAltText",
+ options: TEXT_SIZE_ITEMS.map(({ label, value }) => ({ label, value: String(value) })),
+ value: String(fontSize),
+ onChange: (value) => onChange(Number(value))
+ });
+ }
+ createPositionRadioGroup(position, onChange) {
+ return this.createRadioGroup({
+ label: "dialogInputPosition",
+ options: [
+ { icon: "position-top", altText: "iconAltTextPositionTop", value: "top" },
+ { icon: "position-center", altText: "iconAltTextPositionCenter", value: "center" },
+ { icon: "position-bottom", altText: "iconAltTextPositionBottom", value: "bottom" }
+ ],
+ value: position,
+ onChange
+ });
+ }
+ createAlignmentRadioGroup(alignment, onChange) {
+ return this.createRadioGroup({
+ label: "dialogInputAlign",
+ options: [
+ { icon: "align-left", altText: "iconAltTextAlignLeft", value: "left" },
+ { icon: "align-center", altText: "iconAltTextAlignCenter", value: "center" },
+ { icon: "align-right", altText: "iconAltTextAlignRight", value: "right" }
+ ],
+ value: alignment,
+ onChange
+ });
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/axis.ts
+function calculateAxisLabelPadding(axisLayout) {
+ return axisLayout.gridPadding + axisLayout.seriesAreaPadding + axisLayout.tickSize + axisLayout.label.spacing;
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/utils/update.ts
+function updateAnnotation(node, datum, context) {
+ for (const { update } of Object.values(annotationConfigs)) {
+ update(node, datum, context);
+ }
+}
+
+// packages/ag-charts-enterprise/src/features/annotations/annotations.ts
+var {
+ ChartUpdateType,
+ InteractionState: InteractionState2,
+ PropertiesArray: PropertiesArray3,
+ Property: Property33,
+ ChartAxisDirection: ChartAxisDirection9,
+ keyProperty,
+ valueProperty,
+ Vec2: Vec219,
+ Selection: Selection3,
+ BBox: BBox3
+} = import_ag_charts_community88._ModuleSupport;
+var _Annotations = class _Annotations extends import_ag_charts_community88._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = true;
+ this.toolbar = new AnnotationsToolbar(this.ctx);
+ this.optionsToolbar = new AnnotationOptionsToolbar(this.ctx, () => {
+ const active = this.state.getActive();
+ if (active == null)
+ return;
+ return getTypedDatum(this.annotationData.at(active));
+ });
+ this.axesButtons = new AxesButtons();
+ this.snap = false;
+ // Hidden options for use with measurer statistics
+ this.data = void 0;
+ this.xKey = void 0;
+ this.volumeKey = void 0;
+ this.annotationData = new PropertiesArray3(
+ _Annotations.createAnnotationDatum
+ );
+ this.defaults = new AnnotationDefaults();
+ this.container = new import_ag_charts_community88._ModuleSupport.Group({ name: "static-annotations" });
+ this.annotations = new Selection3(
+ this.container,
+ this.createAnnotationScene.bind(this)
+ );
+ this.settingsDialog = new AnnotationSettingsDialog(this.ctx);
+ this.textInput = new TextInput(this.ctx);
+ this.postUpdateFns = [];
+ this.state = this.setupStateMachine();
+ this.setupListeners();
+ this.setupDOM();
+ this.ctx.historyManager.addMementoOriginator(ctx.annotationManager);
+ this.ctx.historyManager.addMementoOriginator(this.defaults);
+ this.textInput.setKeyDownHandler(this.onTextInput.bind(this));
+ this.cleanup.register(() => {
+ this.clear();
+ this.xAxis?.button?.destroy();
+ this.yAxis?.button?.destroy();
+ });
+ }
+ setupStateMachine() {
+ const { ctx } = this;
+ return new AnnotationsStateMachine({
+ resetToIdle: () => {
+ ctx.domManager.updateCursor("annotations");
+ this.popAnnotationState(InteractionState2.Annotations);
+ this.hideOverlays();
+ this.optionsToolbar.hide();
+ this.deleteEphemeralAnnotations();
+ this.update();
+ },
+ hoverAtCoords: (coords, active, previousHovered) => {
+ let hovered;
+ this.annotations.each((annotation, datum, index) => {
+ if (!datum.isHoverable())
+ return;
+ const contains = annotation.containsPoint(coords.x, coords.y);
+ if (contains)
+ hovered ?? (hovered = index);
+ annotation.toggleHovered(contains, active === index, datum.readOnly);
+ });
+ if (hovered != null) {
+ ctx.tooltipManager.suppressTooltip("annotations");
+ } else if (!this.isAnnotationState()) {
+ ctx.tooltipManager.unsuppressTooltip("annotations");
+ }
+ if (hovered == null || !this.annotationData.at(hovered)?.readOnly) {
+ this.ctx.domManager.updateCursor(
+ "annotations",
+ hovered == null ? void 0 : this.annotations.at(hovered)?.getCursor()
+ );
+ }
+ if (hovered !== previousHovered) {
+ this.update();
+ }
+ return hovered;
+ },
+ getNodeAtCoords: (coords, active) => {
+ const node = this.annotations.at(active);
+ if (!node) {
+ return;
+ }
+ return node.getNodeAtCoords(coords.x, coords.y);
+ },
+ translate: (index, translation) => {
+ const node = this.annotations.at(index);
+ const datum = getTypedDatum(this.annotationData.at(index));
+ if (!node || !datum) {
+ return;
+ }
+ return this.translateNode(node, datum, translation);
+ },
+ copy: (index) => {
+ const node = this.annotations.at(index);
+ const datum = getTypedDatum(this.annotationData.at(index));
+ if (!node || !datum) {
+ return;
+ }
+ return this.createAnnotationDatumCopy(node, datum);
+ },
+ paste: (datum) => {
+ this.createAnnotation(datum.type, datum, false);
+ this.postUpdateFns.push(() => {
+ this.state.transitionAsync("selectLast");
+ this.state.transitionAsync("copy");
+ });
+ },
+ select: (index, previous) => {
+ const { annotations, optionsToolbar: optionsToolbar2, toolbar: toolbar2 } = this;
+ this.hideOverlays();
+ toolbar2.clearActiveButton();
+ toolbar2.resetButtonIcons();
+ const selectedNode = index == null ? null : annotations.at(index);
+ const previousNode = previous == null ? null : annotations.at(previous);
+ const selectedDatum = index == null ? null : this.annotationData.at(index);
+ if (previousNode === selectedNode && selectedNode != null) {
+ return;
+ }
+ previousNode?.toggleActive(false);
+ optionsToolbar2.hide();
+ if (selectedNode && !selectedDatum?.readOnly) {
+ this.pushAnnotationState(InteractionState2.AnnotationsSelected);
+ selectedNode.toggleActive(true);
+ if (!isEphemeralType(selectedDatum)) {
+ optionsToolbar2.updateButtons(this.annotationData.at(index));
+ this.postUpdateFns.push(() => {
+ optionsToolbar2.show();
+ optionsToolbar2.setAnchorScene(selectedNode);
+ });
+ }
+ } else {
+ this.popAnnotationState(InteractionState2.AnnotationsSelected);
+ this.popAnnotationState(InteractionState2.Annotations);
+ }
+ if (!isEphemeralType(selectedDatum)) {
+ this.deleteEphemeralAnnotations();
+ }
+ this.update();
+ },
+ selectLast: () => {
+ this.pushAnnotationState(InteractionState2.AnnotationsSelected);
+ return this.annotationData.length - 1;
+ },
+ startInteracting: () => {
+ this.pushAnnotationState(InteractionState2.Annotations);
+ },
+ stopInteracting: () => {
+ this.popAnnotationState(InteractionState2.Annotations);
+ },
+ create: (type, datum) => {
+ this.createAnnotation(type, datum);
+ },
+ delete: (index) => {
+ this.annotationData.splice(index, 1);
+ },
+ deleteAll: () => {
+ const readOnly = this.annotationData.filter((datum) => {
+ if (datum.readOnly === true)
+ return datum;
+ });
+ this.annotationData.splice(0, this.annotationData.length);
+ for (const datum of readOnly) {
+ this.annotationData.push(datum);
+ }
+ },
+ validatePoint: (point, options) => {
+ const context = this.getAnnotationContext();
+ return context ? validateDatumPoint(context, point, options) : true;
+ },
+ getAnnotationType: (index) => {
+ return stringToAnnotationType(this.annotationData[index].type);
+ },
+ datum: (index) => {
+ return this.annotationData.at(index);
+ },
+ node: (index) => {
+ return this.annotations.at(index);
+ },
+ recordAction: (label) => {
+ this.recordActionAfterNextUpdate(label);
+ },
+ update: () => {
+ this.postUpdateFns.push(() => {
+ const active = this.state.getActive();
+ const node = active == null ? null : this.annotations.at(active);
+ if (node == null)
+ return;
+ this.optionsToolbar.setAnchorScene(node);
+ });
+ this.update();
+ },
+ showTextInput: (active) => {
+ const datum = getTypedDatum(this.annotationData.at(active));
+ const node = this.annotations.at(active);
+ if (!node || !datum || !("getTextInputCoords" in datum) || !("getTextPosition" in datum))
+ return;
+ const styles = {
+ color: datum.color,
+ fontFamily: datum.fontFamily,
+ fontSize: datum.fontSize,
+ fontStyle: datum.fontStyle,
+ fontWeight: datum.fontWeight,
+ placeholderColor: datum.getPlaceholderColor()
+ };
+ const context = this.getAnnotationContext();
+ const getTextInputCoords = (height) => Vec219.add(datum.getTextInputCoords(context, height), Vec219.required(this.seriesRect));
+ const getTextPosition = () => datum.getTextPosition();
+ this.textInput.show({
+ styles,
+ layout: {
+ getTextInputCoords,
+ getTextPosition,
+ alignment: datum.alignment,
+ textAlign: datum.textAlign,
+ width: datum.width
+ },
+ text: datum.text,
+ placeholderText: datum.placeholderText,
+ onChange: (_text, bbox) => {
+ this.state.transition("updateTextInputBBox", bbox);
+ }
+ });
+ this.ctx.domManager.updateCursor("annotations");
+ },
+ hideTextInput: () => {
+ this.textInput.hide();
+ },
+ updateTextInputColor: (color6) => {
+ this.textInput.updateColor(color6);
+ },
+ updateTextInputFontSize: (fontSize) => {
+ const bbox = this.textInput.updateFontSize(fontSize);
+ this.state.transition("updateTextInputBBox", bbox);
+ },
+ updateTextInputBBox: (bbox) => {
+ this.state.transition("updateTextInputBBox", bbox);
+ },
+ showAnnotationOptions: (active) => {
+ const node = this.annotations.at(active);
+ if (!node || isEphemeralType(this.annotationData.at(active)))
+ return;
+ this.optionsToolbar.updateButtons(this.annotationData.at(active));
+ this.optionsToolbar.show();
+ this.optionsToolbar.setAnchorScene(node);
+ },
+ showAnnotationSettings: (active, sourceEvent, initialTab = "line") => {
+ const datum = this.annotationData.at(active);
+ if (!isLineType(datum) && !isChannelType(datum) && !isMeasurerType(datum))
+ return;
+ if (isEphemeralType(datum))
+ return;
+ const onChangeColor = (colorType) => (colorOpacity, color6, opacity, isMultiColor) => {
+ this.setColorAndDefault(datum.type, colorType, colorOpacity, color6, opacity, isMultiColor);
+ this.optionsToolbar.updateColorPickerColor(colorType, color6, opacity, isMultiColor);
+ };
+ const onChangeHideColor = (colorType) => () => {
+ this.recordActionAfterNextUpdate(
+ `Change ${datum.type} ${colorType} to ${datum.getDefaultColor(colorType)}`,
+ ["annotations", "defaults"]
+ );
+ this.update();
+ };
+ const options = {
+ initialSelectedTab: initialTab,
+ ariaLabel: this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),
+ sourceEvent,
+ onChangeLine: (props) => {
+ this.state.transition("lineProps", props);
+ if (props.bands != null)
+ this.defaults.setDefaultFibonacciOptions(datum.type, "bands", props.bands);
+ if (props.reverse != null)
+ this.defaults.setDefaultFibonacciOptions(datum.type, "reverse", props.reverse);
+ if (props.showFill != null)
+ this.defaults.setDefaultFibonacciOptions(datum.type, "showFill", props.showFill);
+ },
+ onChangeText: (props) => {
+ this.state.transition("lineText", props);
+ if (props.alignment)
+ this.defaults.setDefaultLineTextAlignment(datum.type, props.alignment);
+ if (props.position)
+ this.defaults.setDefaultLineTextPosition(datum.type, props.position);
+ this.recordActionAfterNextUpdate(
+ `Change ${datum.type} text ${Object.keys(props).map((key) => `${key} to ${props[key]}`).join(", ")}`
+ );
+ },
+ onChangeFillColor: onChangeColor("fill-color"),
+ onChangeHideFillColor: onChangeHideColor("fill-color"),
+ onChangeLineColor: onChangeColor("line-color"),
+ onChangeHideLineColor: onChangeHideColor("line-color"),
+ onChangeLineStyleType: (lineStyleType) => {
+ this.setLineStyleTypeAndDefault(datum.type, lineStyleType);
+ this.optionsToolbar.updateLineStyleType(
+ LINE_STYLE_TYPE_ITEMS.find((item) => item.value === lineStyleType) ?? LINE_STYLE_TYPE_ITEMS[0]
+ );
+ },
+ onChangeLineStyleWidth: (strokeWidth) => {
+ this.setLineStyleWidthAndDefault(datum.type, strokeWidth);
+ this.optionsToolbar.updateStrokeWidth({
+ strokeWidth,
+ value: strokeWidth,
+ label: String(strokeWidth)
+ });
+ },
+ onChangeTextColor: onChangeColor("text-color"),
+ onChangeHideTextColor: onChangeHideColor("text-color"),
+ onChangeTextFontSize: (fontSize) => {
+ this.setFontSizeAndDefault(datum.type, fontSize);
+ }
+ };
+ this.settingsDialog.show(datum, options);
+ }
+ });
+ }
+ setupListeners() {
+ const { ctx, optionsToolbar: optionsToolbar2, settingsDialog, toolbar: toolbar2 } = this;
+ const { seriesWidget, seriesDragInterpreter, chartWidget } = ctx.widgets;
+ if (seriesDragInterpreter) {
+ this.cleanup.register(
+ // Interactions
+ seriesDragInterpreter.events.on("click", this.hoverTouchPreHandler.bind(this)),
+ seriesDragInterpreter.events.on("drag-start", this.hoverTouchPreHandler.bind(this)),
+ seriesDragInterpreter.events.on("drag-move", this.dragMoveTouchPreHandler.bind(this)),
+ seriesDragInterpreter.events.on("mousemove", this.onHover.bind(this)),
+ seriesDragInterpreter.events.on("click", this.onClick.bind(this)),
+ seriesDragInterpreter.events.on("dblclick", this.onDoubleClick.bind(this)),
+ seriesDragInterpreter.events.on("drag-start", this.onDragStart.bind(this)),
+ seriesDragInterpreter.events.on("drag-move", this.onDrag.bind(this)),
+ seriesDragInterpreter.events.on("drag-end", this.onDragEnd.bind(this))
+ );
+ }
+ this.cleanup.register(
+ // Interactions
+ seriesWidget.addListener("keydown", this.onKeyDown.bind(this)),
+ seriesWidget.addListener("keyup", this.onKeyUp.bind(this)),
+ chartWidget.addListener("click", this.onCancel.bind(this)),
+ // Services
+ ctx.eventsHub.on("annotations:restore", this.onRestoreAnnotations.bind(this)),
+ ctx.eventsHub.on("layout:complete", this.onLayoutComplete.bind(this)),
+ ctx.updateService.addListener("pre-scene-render", this.onPreRender.bind(this)),
+ ctx.eventsHub.on("zoom:change", () => this.onResize()),
+ ctx.eventsHub.on("dom:resize", () => this.onResize()),
+ // Toolbar
+ toolbar2.events.on("cancel-create-annotation", () => {
+ this.cancel();
+ this.reset();
+ this.update();
+ }),
+ toolbar2.events.on("pressed-create-annotation", ({ annotation }) => {
+ this.cancel();
+ this.pushAnnotationState(InteractionState2.Annotations);
+ this.state.transition(annotation);
+ this.update();
+ }),
+ toolbar2.events.on("pressed-clear", () => {
+ this.clear();
+ this.recordActionAfterNextUpdate("Clear all");
+ }),
+ toolbar2.events.on("pressed-show-menu", () => {
+ this.cancel();
+ this.reset();
+ }),
+ toolbar2.events.on("pressed-unrelated", () => {
+ this.reset();
+ }),
+ // Annotation Options Toolbar
+ optionsToolbar2.events.on("pressed-delete", () => {
+ this.cancel();
+ this.delete();
+ this.reset();
+ }),
+ optionsToolbar2.events.on("pressed-settings", ({ sourceEvent }) => {
+ this.state.transition("toolbarPressSettings", sourceEvent);
+ }),
+ optionsToolbar2.events.on("pressed-lock", ({ locked }) => {
+ this.recordActionAfterNextUpdate(locked ? "Locked" : "Unlocked");
+ this.update();
+ }),
+ optionsToolbar2.events.on("hid-overlays", () => {
+ this.settingsDialog.hide();
+ }),
+ optionsToolbar2.events.on("saved-color", ({ type, colorPickerType, color: color6 }) => {
+ this.recordActionAfterNextUpdate(`Change ${type} ${colorPickerType} to ${color6}`, [
+ "annotations",
+ "defaults"
+ ]);
+ }),
+ optionsToolbar2.events.on(
+ "updated-color",
+ ({ type, colorPickerType, colorOpacity, color: color6, opacity, isMultiColor }) => {
+ this.setColorAndDefault(type, colorPickerType, colorOpacity, color6, opacity, isMultiColor);
+ }
+ ),
+ optionsToolbar2.events.on("updated-font-size", ({ type, fontSize }) => {
+ this.setFontSizeAndDefault(type, fontSize);
+ }),
+ optionsToolbar2.events.on("updated-line-style", ({ type, lineStyleType }) => {
+ this.setLineStyleTypeAndDefault(type, lineStyleType);
+ }),
+ optionsToolbar2.events.on("updated-line-width", ({ type, strokeWidth }) => {
+ this.setLineStyleWidthAndDefault(type, strokeWidth);
+ }),
+ // Settings Dialog
+ settingsDialog.events.on("hidden", () => {
+ this.optionsToolbar.clearActiveButton();
+ })
+ );
+ }
+ setupDOM() {
+ const { ctx, toolbar: toolbar2, optionsToolbar: optionsToolbar2 } = this;
+ this.cleanup.register(ctx.annotationManager.attachNode(this.container), () => {
+ ctx.domManager.removeStyles(DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS);
+ toolbar2.destroy();
+ optionsToolbar2.destroy();
+ });
+ }
+ async processData(dataController) {
+ if (!this.enabled || this.data == null || this.xKey == null || this.volumeKey == null)
+ return;
+ const props = [
+ keyProperty(this.xKey, void 0, { id: "date" }),
+ valueProperty(this.volumeKey, "number", { id: "volume" })
+ ];
+ const dataSet = import_ag_charts_community88._ModuleSupport.DataSet.wrap(this.data) ?? import_ag_charts_community88._ModuleSupport.DataSet.empty();
+ const { dataModel, processedData } = await dataController.request("annotations", dataSet, {
+ props
+ });
+ this.dataModel = dataModel;
+ this.processedData = processedData;
+ }
+ /**
+ * Create an annotation scene within the `this.annotations` scene selection. This method is automatically called by
+ * the selection when a new scene is required.
+ */
+ createAnnotationScene(datum) {
+ if (datum.type in annotationConfigs) {
+ return new annotationConfigs[datum.type].scene();
+ }
+ throw new Error(
+ `AG Charts - Cannot create annotation scene of type [${datum.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`
+ );
+ }
+ /**
+ * Create an annotation datum within the `this.annotationData` properties array. It is created as an instance
+ * of `AnnotationProperties` from the given config for its type. This method is only called when annotations
+ * are added from the initial state.
+ */
+ static createAnnotationDatum(params) {
+ if (params.type in annotationConfigs) {
+ return new annotationConfigs[params.type].datum().set(params);
+ }
+ throw new Error(
+ `AG Charts - Cannot create annotation datum of unknown type [${params.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`
+ );
+ }
+ /**
+ * Append an annotation datum to `this.annotationData`, applying default styles. This method is called when a user
+ * interacts with the chart to draw their own annotations.
+ */
+ createAnnotation(type, datum, applyDefaults = true) {
+ this.annotationData.push(datum);
+ if (applyDefaults) {
+ const styles = this.ctx.annotationManager.getAnnotationTypeStyles(type);
+ if (styles)
+ datum.set(styles);
+ this.defaults.applyDefaults(datum);
+ }
+ this.injectDatumDependencies(datum);
+ this.update();
+ }
+ injectDatumDependencies(datum) {
+ if ("setLocaleManager" in datum) {
+ datum.setLocaleManager(this.ctx.localeManager);
+ }
+ if ("getVolume" in datum) {
+ datum.getVolume = this.getDatumRangeVolume.bind(this);
+ }
+ }
+ getDatumRangeVolume(fromPoint, toPoint) {
+ const { dataModel, processedData } = this;
+ let from = getGroupingValue(fromPoint);
+ let to = getGroupingValue(toPoint);
+ if (!(0, import_ag_charts_core43.isValidDate)(from) || !(0, import_ag_charts_core43.isValidDate)(to) || !dataModel || !processedData || this.volumeKey == null)
+ return;
+ if (from > to) {
+ [from, to] = [to, from];
+ }
+ const dateValues = dataModel.resolveKeysById({ id: "annotations" }, "date", processedData);
+ const volumeValues = dataModel.resolveColumnById({ id: "annotations" }, "volume", processedData);
+ let sum = 0;
+ for (let datumIndex = 0; datumIndex < processedData.input.count; datumIndex++) {
+ const key = dateValues[datumIndex];
+ if ((0, import_ag_charts_core43.isValidDate)(key) && key >= from && key <= to) {
+ sum += volumeValues[datumIndex];
+ }
+ }
+ return sum;
+ }
+ translateNode(node, datum, translation) {
+ const config = this.getAnnotationConfig(datum);
+ const context = this.getAnnotationContext();
+ if (!context) {
+ return;
+ }
+ config.translate(node, datum, translation, context);
+ }
+ createAnnotationDatumCopy(node, datum) {
+ const config = this.getAnnotationConfig(datum);
+ const newDatum = new config.datum();
+ newDatum.set(datum.toJson());
+ const context = this.getAnnotationContext();
+ if (!context) {
+ return;
+ }
+ return config.copy(node, datum, newDatum, context);
+ }
+ getAnnotationConfig(datum) {
+ if (datum.type in annotationConfigs) {
+ return annotationConfigs[datum.type];
+ }
+ throw new Error(
+ `AG Charts - Cannot get annotation config of unknown type [${datum.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`
+ );
+ }
+ onRestoreAnnotations(event) {
+ if (!this.enabled)
+ return;
+ this.clear();
+ this.annotationData.set(event.annotations);
+ this.postUpdateFns.push(() => {
+ this.ctx.annotationManager.fireChangedEvent();
+ });
+ this.update();
+ }
+ onLayoutComplete(event) {
+ const seriesRect = event.series.paddedRect;
+ this.seriesRect = seriesRect;
+ this.container.setClipRect(seriesRect);
+ for (const axisLayout of event.axes ?? []) {
+ if (axisLayout.direction === import_ag_charts_community88._ModuleSupport.ChartAxisDirection.X) {
+ this.xAxis = this.getAxis(axisLayout, seriesRect, this.xAxis?.button);
+ } else {
+ this.yAxis = this.getAxis(axisLayout, seriesRect, this.yAxis?.button);
+ }
+ }
+ if (this.showAnnotations()) {
+ this.animateAnnotations({ from: 0, to: 1, phase: "trailing" });
+ } else {
+ this.animateAnnotations({ from: 1, to: 0, phase: "remove" });
+ }
+ }
+ showAnnotations() {
+ if (!this.yAxis || !this.xAxis) {
+ return false;
+ }
+ const hasData = this.ctx.chartService.series.some((s) => s.hasData);
+ const seriesIds = this.yAxis.context.seriesIds();
+ const anyBoundSeriesVisible = seriesIds.some((id) => {
+ const series = this.ctx.chartService.series.find((s) => s.id === id);
+ return series?.visible;
+ });
+ return hasData && anyBoundSeriesVisible;
+ }
+ animateAnnotations({ from, to, phase }) {
+ const { annotations } = this;
+ this.ctx.animationManager?.animate({
+ from,
+ to,
+ id: "chart-annotations",
+ phase,
+ groupId: "opacity",
+ onUpdate(value) {
+ annotations.each((node) => {
+ node.opacity = value;
+ if ("setAxisLabelOpacity" in node) {
+ node.setAxisLabelOpacity(value);
+ }
+ });
+ },
+ onStop() {
+ annotations.each((node) => {
+ node.opacity = to;
+ if ("setAxisLabelOpacity" in node) {
+ node.setAxisLabelOpacity(to);
+ }
+ });
+ }
+ });
+ }
+ onPreRender() {
+ this.updateAnnotations();
+ this.state.transition("render");
+ }
+ getAxis(axisLayout, seriesRect, button) {
+ const axisCtx = this.ctx.axisManager.getAxisContext(axisLayout.direction)[0];
+ const { position: axisPosition = "bottom", direction } = axisCtx;
+ const padding = axisLayout.gridPadding + axisLayout.seriesAreaPadding;
+ const bounds = new BBox3(0, 0, seriesRect.width, seriesRect.height).grow(padding, axisPosition);
+ const lineDirection = direction === ChartAxisDirection9.X ? "vertical" : "horizontal";
+ const { axesButtons, snap } = this;
+ const buttonEnabled = this.enabled && axesButtons.enabled && (axesButtons.axes === "xy" || axesButtons.axes === direction);
+ if (buttonEnabled) {
+ button ?? (button = new AxisButton(
+ this.ctx,
+ { ...axisCtx, snapToGroup: snap },
+ (coords) => this.onAxisButtonClick(coords, lineDirection),
+ seriesRect
+ ));
+ const axisLabelPadding = calculateAxisLabelPadding(axisLayout);
+ button.update(seriesRect, axisLabelPadding);
+ } else {
+ button?.destroy();
+ button = void 0;
+ }
+ return { layout: axisLayout, context: axisCtx, bounds, button };
+ }
+ recordActionAfterNextUpdate(label, types = ["annotations"]) {
+ const {
+ defaults,
+ ctx: { annotationManager, historyManager }
+ } = this;
+ const originators = types.map((type) => type === "defaults" ? defaults : annotationManager);
+ this.postUpdateFns.push(() => {
+ historyManager.record(label, ...originators);
+ annotationManager.fireChangedEvent();
+ });
+ }
+ setColorAndDefault(datumType, colorPickerType, colorOpacity, color6, opacity, isMultiColor) {
+ this.state.transition("color", { colorPickerType, colorOpacity, color: color6, opacity, isMultiColor });
+ this.defaults.setDefaultColor(datumType, colorPickerType, colorOpacity, color6, opacity, isMultiColor);
+ }
+ setFontSizeAndDefault(datumType, fontSize) {
+ this.state.transition("fontSize", fontSize);
+ this.defaults.setDefaultFontSize(datumType, fontSize);
+ this.recordActionAfterNextUpdate(`Change ${datumType} font size to ${fontSize}`, ["annotations", "defaults"]);
+ }
+ setLineStyleTypeAndDefault(datumType, styleType) {
+ this.state.transition("lineStyle", { type: styleType });
+ this.defaults.setDefaultLineStyleType(datumType, styleType);
+ this.recordActionAfterNextUpdate(`Change ${datumType} line style to ${styleType}`, ["annotations", "defaults"]);
+ }
+ setLineStyleWidthAndDefault(datumType, strokeWidth) {
+ this.state.transition("lineStyle", { strokeWidth });
+ this.defaults.setDefaultLineStyleWidth(datumType, strokeWidth);
+ this.recordActionAfterNextUpdate(`Change ${datumType} stroke width to ${strokeWidth}`, [
+ "annotations",
+ "defaults"
+ ]);
+ }
+ updateAnnotations() {
+ const {
+ annotationData,
+ annotations,
+ seriesRect,
+ ctx: { annotationManager }
+ } = this;
+ const context = this.getAnnotationContext();
+ if (!seriesRect || !context)
+ return;
+ annotationManager.updateData(annotationData.toJson());
+ const showAnnotations = this.showAnnotations();
+ this.toolbar.refreshButtonsEnabled(showAnnotations);
+ this.toolbar.toggleClearButtonEnabled(annotationData.length > 0 && showAnnotations);
+ annotations.update(annotationData ?? [], void 0, (datum) => datum.id).each((node, datum) => {
+ if (!showAnnotations) {
+ node.visible = false;
+ if ("setAxisLabelVisible" in node) {
+ node.setAxisLabelVisible(false);
+ }
+ return;
+ }
+ if ("setAxisLabelVisible" in node) {
+ node.setAxisLabelVisible(true);
+ }
+ this.injectDatumDependencies(datum);
+ updateAnnotation(node, datum, context);
+ });
+ for (const fn of this.postUpdateFns) {
+ fn();
+ }
+ this.postUpdateFns = [];
+ }
+ getAnnotationContext() {
+ const { seriesRect, xAxis, yAxis, snap } = this;
+ if (!(seriesRect && xAxis && yAxis)) {
+ return;
+ }
+ return {
+ seriesRect,
+ xAxis: {
+ ...xAxis.context,
+ bounds: xAxis.bounds,
+ labelPadding: calculateAxisLabelPadding(xAxis.layout),
+ snapToGroup: snap
+ },
+ yAxis: {
+ ...yAxis.context,
+ bounds: yAxis.bounds,
+ labelPadding: calculateAxisLabelPadding(xAxis.layout),
+ snapToGroup: snap
+ }
+ };
+ }
+ onHover(event) {
+ const { state } = this;
+ const context = this.getAnnotationContext();
+ if (!context)
+ return;
+ const shiftKey = event.sourceEvent.shiftKey;
+ const offset = Vec219.from(event);
+ const point = invertCoords(offset, context);
+ state.transition("hover", { offset, point, shiftKey, context });
+ }
+ onClick(event) {
+ const { state } = this;
+ const context = this.getAnnotationContext();
+ if (!context)
+ return;
+ const shiftKey = event.sourceEvent.shiftKey;
+ const point = invertCoords(Vec219.from(event), context);
+ const textInputValue = this.textInput.getValue();
+ const bbox = this.textInput.getBBox();
+ state.transition("click", { point, shiftKey, textInputValue, bbox });
+ }
+ onDoubleClick(event) {
+ const { state } = this;
+ const context = this.getAnnotationContext();
+ if (!context)
+ return;
+ const offset = Vec219.from(event);
+ state.transition("dblclick", { offset });
+ }
+ onAxisButtonClick(coords, direction) {
+ this.cancel();
+ this.reset();
+ const context = this.getAnnotationContext();
+ if (!this.annotationData || !context)
+ return;
+ const { state } = this;
+ this.pushAnnotationState(InteractionState2.Annotations);
+ const isHorizontal2 = direction === "horizontal";
+ state.transition(isHorizontal2 ? "horizontal-line" /* HorizontalLine */ : "vertical-line" /* VerticalLine */);
+ this.optionsToolbar.hide();
+ if (!coords) {
+ return;
+ }
+ const point = invertCoords(coords, context);
+ if (!validateDatumPoint(context, point)) {
+ return;
+ }
+ state.transition("click", { point, shiftKey: false });
+ this.update();
+ }
+ onResize() {
+ const textInputValue = this.textInput.getValue();
+ const bbox = this.textInput.getBBox();
+ this.state.transition("resize", { textInputValue, bbox });
+ }
+ hoverTouchPreHandler(event) {
+ if (event.device === "touch") {
+ this.onHover(event);
+ }
+ }
+ dragMoveTouchPreHandler(event) {
+ if (event.device === "touch" && this.ctx.interactionManager.isState(InteractionState2.AnnotationsSelected)) {
+ event.sourceEvent.preventDefault();
+ }
+ }
+ onDragStart(event) {
+ if (!this.ctx.interactionManager.isState(InteractionState2.AnnotationsDraggable))
+ return;
+ const context = this.getAnnotationContext();
+ if (!context)
+ return;
+ const offset = Vec219.from(event);
+ const point = invertCoords(offset, context);
+ const textInputValue = this.textInput.getValue();
+ const bbox = this.textInput.getBBox();
+ this.state.transition("dragStart", { context, offset, point, textInputValue, bbox });
+ }
+ onDrag(event) {
+ if (!this.ctx.interactionManager.isState(InteractionState2.AnnotationsDraggable))
+ return;
+ const context = this.getAnnotationContext();
+ if (!context)
+ return;
+ const offset = Vec219.from(event);
+ const point = invertCoords(offset, context);
+ const shiftKey = event.sourceEvent.shiftKey;
+ const textInputValue = this.textInput.getValue();
+ const bbox = this.textInput.getBBox();
+ this.state.transition("drag", { context, offset, point, shiftKey, textInputValue, bbox });
+ }
+ onDragEnd() {
+ this.state.transition("dragEnd");
+ }
+ onCancel(widgetEvent) {
+ const { sourceEvent } = widgetEvent ?? {};
+ if (sourceEvent?.currentTarget !== sourceEvent?.target)
+ return;
+ this.cancel();
+ this.reset();
+ }
+ onDelete() {
+ if (this.textInput.isVisible())
+ return;
+ this.cancel();
+ this.delete();
+ this.reset();
+ this.update();
+ }
+ onTextInput(event) {
+ const { state } = this;
+ const context = this.getAnnotationContext();
+ if (!context)
+ return;
+ const { key, shiftKey } = event;
+ const textInputValue = this.textInput.getValue();
+ const bbox = this.textInput.getBBox();
+ state.transition("textInput", { key, shiftKey, textInputValue, bbox, context });
+ }
+ onKeyDown(event) {
+ const { state } = this;
+ const context = this.getAnnotationContext();
+ if (!context) {
+ return;
+ }
+ const { sourceEvent } = event;
+ const { shiftKey, ctrlKey, metaKey } = sourceEvent;
+ const ctrlMeta = ctrlKey || metaKey;
+ const ctrlShift = ctrlKey || shiftKey;
+ state.transition("keyDown", { shiftKey, context });
+ const translation = { x: 0, y: 0 };
+ const xStep = Math.max(context?.xAxis.scale.bandwidth ?? 0, ctrlShift ? 10 : 1);
+ const yStep = Math.max(context?.yAxis.scale.bandwidth ?? 0, ctrlShift ? 10 : 1);
+ switch (sourceEvent.key) {
+ case "ArrowDown":
+ translation.y = yStep;
+ break;
+ case "ArrowUp":
+ translation.y = -yStep;
+ break;
+ case "ArrowLeft":
+ translation.x = -xStep;
+ break;
+ case "ArrowRight":
+ translation.x = xStep;
+ break;
+ case "Escape":
+ this.onCancel();
+ return;
+ case "Backspace":
+ case "Delete":
+ this.onDelete();
+ return;
+ }
+ if (translation.x || translation.y) {
+ state.transition("translate", { translation });
+ sourceEvent.stopPropagation();
+ sourceEvent.preventDefault();
+ }
+ if (!ctrlMeta) {
+ return;
+ }
+ switch (sourceEvent.key) {
+ case "c":
+ state.transition("copy");
+ return;
+ case "x":
+ state.transition("cut");
+ this.recordActionAfterNextUpdate("Cut annotation");
+ return;
+ case "v":
+ state.transition("paste");
+ this.recordActionAfterNextUpdate("Paste annotation");
+ return;
+ }
+ }
+ onKeyUp(event) {
+ const { shiftKey } = event.sourceEvent;
+ const context = this.getAnnotationContext();
+ if (!context) {
+ return;
+ }
+ this.state.transition("keyUp", { shiftKey, context });
+ this.state.transition("translateEnd");
+ }
+ clear() {
+ this.cancel();
+ this.deleteAll();
+ this.reset();
+ }
+ reset() {
+ this.state.transition("reset");
+ }
+ cancel() {
+ this.state.transition("cancel");
+ }
+ delete() {
+ this.state.transition("delete");
+ }
+ deleteAll() {
+ this.state.transition("deleteAll");
+ }
+ deleteEphemeralAnnotations() {
+ let deletedEphemeral = false;
+ for (const [index, datum] of this.annotationData.entries()) {
+ if (isEphemeralType(datum)) {
+ this.annotationData.splice(index, 1);
+ deletedEphemeral = true;
+ }
+ }
+ if (deletedEphemeral) {
+ this.recordActionAfterNextUpdate("Delete ephemeral annotations");
+ }
+ }
+ hideOverlays() {
+ this.settingsDialog.hide();
+ this.toolbar.hideOverlays();
+ this.optionsToolbar.hideOverlays();
+ }
+ pushAnnotationState(state) {
+ this.ctx.interactionManager.pushState(state);
+ this.ctx.tooltipManager.suppressTooltip("annotations");
+ }
+ popAnnotationState(state) {
+ this.ctx.interactionManager.popState(state);
+ this.ctx.tooltipManager.unsuppressTooltip("annotations");
+ }
+ isAnnotationState() {
+ return this.ctx.interactionManager.isState(InteractionState2.Annotations) || this.ctx.interactionManager.isState(InteractionState2.AnnotationsSelected);
+ }
+ update(status = ChartUpdateType.PRE_SCENE_RENDER) {
+ this.ctx.updateService.update(status);
+ }
+};
+__decorateClass([
+ Property33
+], _Annotations.prototype, "enabled", 2);
+__decorateClass([
+ Property33
+], _Annotations.prototype, "toolbar", 2);
+__decorateClass([
+ Property33
+], _Annotations.prototype, "optionsToolbar", 2);
+__decorateClass([
+ Property33
+], _Annotations.prototype, "axesButtons", 2);
+__decorateClass([
+ Property33
+], _Annotations.prototype, "snap", 2);
+var Annotations = _Annotations;
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationsTheme.ts
+var import_ag_charts_community89 = require("ag-charts-community");
+var { FONT_SIZE_RATIO, ThemeSymbols } = import_ag_charts_community89._ModuleSupport;
+var stroke = {
+ stroke: { $ref: "foregroundColor" },
+ strokeOpacity: 1,
+ strokeWidth: 2
+};
+var handle = {
+ fill: ThemeSymbols.DEFAULT_ANNOTATION_HANDLE_FILL,
+ strokeOpacity: 1,
+ strokeWidth: 2
+};
+var font = {
+ color: { $ref: "chartBackgroundColor" },
+ fontSize: { $rem: FONT_SIZE_RATIO.LARGE },
+ fontFamily: { $ref: "fontFamily" }
+};
+var axisLabel = {
+ ...font,
+ enabled: true,
+ fill: { $ref: "foregroundColor" },
+ fontSize: { $ref: "fontSize" }
+};
+var text = {
+ ...font,
+ textAlign: "left"
+};
+var lineText = {
+ ...font,
+ position: "top",
+ alignment: "center",
+ color: { $ref: "textColor" }
+};
+var channelText = {
+ ...font,
+ position: "top",
+ alignment: "center",
+ color: { $ref: "textColor" }
+};
+var measurerStatistics = {
+ ...font,
+ fontSize: { $ref: "fontSize" },
+ color: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_COLOR,
+ fill: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_FILL,
+ stroke: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_STROKE,
+ strokeWidth: 1,
+ divider: {
+ stroke: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,
+ strokeWidth: 1,
+ strokeOpacity: 0.5
+ }
+};
+var measurer = {
+ ...stroke,
+ background: {
+ fill: { $ref: "foregroundColor" },
+ fillOpacity: 0.075
+ },
+ handle: { ...handle },
+ text: { ...lineText },
+ statistics: { ...measurerStatistics }
+};
+var toolbar = {
+ buttons: {
+ $shallowSimple: [
+ {
+ icon: "text-annotation",
+ tooltip: "toolbarAnnotationsTextAnnotations",
+ value: "text-menu"
+ },
+ {
+ icon: "trend-line-drawing",
+ tooltip: "toolbarAnnotationsLineAnnotations",
+ value: "line-menu"
+ },
+ {
+ icon: "arrow-drawing",
+ tooltip: "toolbarAnnotationsShapeAnnotations",
+ value: "shape-menu"
+ },
+ {
+ icon: "delete",
+ tooltip: "toolbarAnnotationsClearAll",
+ value: "clear"
+ }
+ ]
+ },
+ padding: { $ref: "chartPadding" }
+};
+var optionsToolbar = {
+ buttons: {
+ $shallowSimple: [
+ {
+ icon: "text-annotation",
+ tooltip: "toolbarAnnotationsTextColor",
+ value: "text-color"
+ },
+ {
+ icon: "line-color",
+ tooltip: "toolbarAnnotationsLineColor",
+ value: "line-color"
+ },
+ {
+ icon: "fill-color",
+ tooltip: "toolbarAnnotationsFillColor",
+ value: "fill-color"
+ },
+ {
+ tooltip: "toolbarAnnotationsTextSize",
+ value: "text-size"
+ },
+ {
+ tooltip: "toolbarAnnotationsLineStrokeWidth",
+ value: "line-stroke-width"
+ },
+ {
+ icon: "line-style-solid",
+ tooltip: "toolbarAnnotationsLineStyle",
+ value: "line-style-type"
+ },
+ {
+ icon: "settings",
+ tooltip: "toolbarAnnotationsSettings",
+ value: "settings"
+ },
+ {
+ icon: "unlocked",
+ tooltip: "toolbarAnnotationsLock",
+ ariaLabel: "toolbarAnnotationsLock",
+ checkedOverrides: {
+ icon: "locked",
+ tooltip: "toolbarAnnotationsUnlock"
+ },
+ value: "lock"
+ },
+ {
+ icon: "delete",
+ tooltip: "toolbarAnnotationsDelete",
+ value: "delete"
+ }
+ ]
+ }
+};
+var annotationsTheme = {
+ enabled: false,
+ // Lines
+ line: {
+ ...stroke,
+ handle: { ...handle },
+ text: { ...lineText }
+ },
+ "horizontal-line": {
+ ...stroke,
+ handle: { ...handle },
+ axisLabel: { ...axisLabel },
+ text: { ...lineText }
+ },
+ "vertical-line": {
+ ...stroke,
+ handle: { ...handle },
+ axisLabel: { ...axisLabel },
+ text: { ...lineText }
+ },
+ // Channels
+ "disjoint-channel": {
+ ...stroke,
+ background: {
+ fill: { $ref: "foregroundColor" },
+ fillOpacity: 0.075
+ },
+ handle: { ...handle },
+ text: { ...channelText }
+ },
+ "parallel-channel": {
+ ...stroke,
+ middle: {
+ lineDash: [6, 5],
+ strokeWidth: 1
+ },
+ background: {
+ fill: { $ref: "foregroundColor" },
+ fillOpacity: 0.075
+ },
+ handle: { ...handle },
+ text: { ...channelText }
+ },
+ // Fibonnaccis
+ "fibonacci-retracement": {
+ ...stroke,
+ strokes: ThemeSymbols.DEFAULT_FIBONACCI_STROKES,
+ rangeStroke: { $ref: "foregroundColor" },
+ handle: { ...handle },
+ text: { ...lineText, position: "center" },
+ label: {
+ ...font,
+ color: void 0,
+ fontSize: { $rem: FONT_SIZE_RATIO.SMALLER }
+ }
+ },
+ "fibonacci-retracement-trend-based": {
+ ...stroke,
+ strokes: ThemeSymbols.DEFAULT_FIBONACCI_STROKES,
+ rangeStroke: { $ref: "foregroundColor" },
+ handle: { ...handle },
+ text: { ...lineText, position: "center" },
+ label: {
+ ...font,
+ color: void 0,
+ fontSize: { $rem: FONT_SIZE_RATIO.SMALLER }
+ }
+ },
+ // Texts
+ callout: {
+ ...stroke,
+ ...text,
+ color: { $ref: "textColor" },
+ handle: { ...handle },
+ fill: { $ref: "foregroundColor" },
+ fillOpacity: 0.075
+ },
+ comment: {
+ ...text,
+ fontWeight: 700,
+ handle: { ...handle },
+ fill: { $ref: "foregroundColor" }
+ },
+ note: {
+ ...text,
+ color: ThemeSymbols.DEFAULT_TEXTBOX_COLOR,
+ fill: ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,
+ stroke: { $ref: "chartBackgroundColor" },
+ strokeWidth: 1,
+ strokeOpacity: 1,
+ handle: { ...handle },
+ background: {
+ fill: ThemeSymbols.DEFAULT_TEXTBOX_FILL,
+ stroke: ThemeSymbols.DEFAULT_TEXTBOX_STROKE,
+ strokeWidth: 1
+ }
+ },
+ text: {
+ ...text,
+ color: { $ref: "textColor" },
+ handle: { ...handle }
+ },
+ // Shapes
+ arrow: {
+ ...stroke,
+ handle: { ...handle },
+ text: { ...lineText }
+ },
+ "arrow-up": {
+ fill: { $palette: "up.fill" },
+ handle: { ...handle, stroke: { $ref: "foregroundColor" } }
+ },
+ "arrow-down": {
+ fill: { $palette: "down.fill" },
+ handle: { ...handle, stroke: { $ref: "foregroundColor" } }
+ },
+ // Measurers
+ "date-range": {
+ ...measurer
+ },
+ "price-range": {
+ ...measurer
+ },
+ "date-price-range": {
+ ...measurer
+ },
+ "quick-date-price-range": {
+ up: {
+ ...stroke,
+ fill: ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,
+ fillOpacity: 0.2,
+ handle: { ...handle },
+ statistics: {
+ ...measurerStatistics,
+ color: "#fff",
+ fill: ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,
+ strokeWidth: 0,
+ divider: {
+ stroke: "#fff",
+ strokeWidth: 1,
+ strokeOpacity: 0.5
+ }
+ }
+ },
+ down: {
+ ...stroke,
+ stroke: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,
+ fill: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,
+ fillOpacity: 0.2,
+ handle: {
+ ...handle,
+ stroke: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE
+ },
+ statistics: {
+ ...measurerStatistics,
+ color: "#fff",
+ fill: ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,
+ strokeWidth: 0,
+ divider: {
+ stroke: "#fff",
+ strokeWidth: 1,
+ strokeOpacity: 0.5
+ }
+ }
+ }
+ },
+ axesButtons: {},
+ // Toolbars
+ toolbar,
+ optionsToolbar
+};
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationsModule.ts
+var AnnotationsModule = {
+ type: "root",
+ optionsKey: "annotations",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ moduleFactory: (ctx) => new Annotations(ctx),
+ themeTemplate: {
+ annotations: annotationsTheme
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/background/background.ts
+var import_ag_charts_community91 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/image/image.ts
+var import_ag_charts_community90 = require("ag-charts-community");
+var import_ag_charts_core44 = require("ag-charts-core");
+var { BaseProperties: BaseProperties12, ObserveChanges: ObserveChanges2, ProxyProperty, Property: Property34, calculatePlacement } = import_ag_charts_community90._ModuleSupport;
+var Image = class extends BaseProperties12 {
+ constructor() {
+ super();
+ this.opacity = 1;
+ this.loadedSynchronously = true;
+ this.containerWidth = 0;
+ this.containerHeight = 0;
+ this.onLoad = void 0;
+ this.onImageLoad = () => {
+ if (this.loadedSynchronously) {
+ return;
+ }
+ this.node.visible = false;
+ this.performLayout(this.containerWidth, this.containerHeight);
+ this.onLoad?.();
+ };
+ this.imageElement = (0, import_ag_charts_core44.createElement)("img");
+ this.imageElement.onload = this.onImageLoad;
+ this.node = new import_ag_charts_community90._ModuleSupport.Image(this.imageElement);
+ }
+ get complete() {
+ return this.imageElement.width > 0 && this.imageElement.height > 0;
+ }
+ performLayout(containerWidth, containerHeight) {
+ this.containerWidth = containerWidth;
+ this.containerHeight = containerHeight;
+ const container = { width: containerWidth, height: containerHeight };
+ const placement = calculatePlacement(this.imageElement.width, this.imageElement.height, container, this);
+ this.node.setProperties(
+ this.complete ? {
+ visible: true,
+ opacity: this.opacity,
+ ...placement
+ } : { visible: false }
+ );
+ return placement;
+ }
+};
+__decorateClass([
+ Property34
+], Image.prototype, "top", 2);
+__decorateClass([
+ Property34
+], Image.prototype, "right", 2);
+__decorateClass([
+ Property34
+], Image.prototype, "bottom", 2);
+__decorateClass([
+ Property34
+], Image.prototype, "left", 2);
+__decorateClass([
+ Property34
+], Image.prototype, "width", 2);
+__decorateClass([
+ Property34
+], Image.prototype, "height", 2);
+__decorateClass([
+ Property34
+], Image.prototype, "opacity", 2);
+__decorateClass([
+ ProxyProperty("imageElement.src"),
+ ObserveChanges2((target) => target.loadedSynchronously = target.complete)
+], Image.prototype, "url", 2);
+
+// packages/ag-charts-enterprise/src/features/background/background.ts
+var { ActionOnSet: ActionOnSet3, Property: Property35 } = import_ag_charts_community91._ModuleSupport;
+var Background2 = class extends import_ag_charts_community91._ModuleSupport.Background {
+ constructor() {
+ super(...arguments);
+ this.image = new Image();
+ }
+ onLayoutComplete(event) {
+ super.onLayoutComplete(event);
+ if (this.image) {
+ const { width, height } = event.chart;
+ this.image.performLayout(width, height);
+ }
+ }
+ onImageLoad() {
+ this.ctx.updateService.update(import_ag_charts_community91._ModuleSupport.ChartUpdateType.SCENE_RENDER);
+ }
+};
+__decorateClass([
+ Property35,
+ ActionOnSet3({
+ newValue(image) {
+ this.node.appendChild(image.node);
+ image.onLoad = () => this.onImageLoad();
+ },
+ oldValue(image) {
+ image.node.remove();
+ image.onLoad = void 0;
+ }
+ })
+], Background2.prototype, "image", 2);
+
+// packages/ag-charts-enterprise/src/features/background/backgroundModule.ts
+var BackgroundModule = {
+ type: "root",
+ optionsKey: "background",
+ packageType: "enterprise",
+ chartTypes: ["cartesian", "polar", "topology", "standalone"],
+ moduleFactory: (ctx) => new Background2(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/band-highlight/bandHighlight.ts
+var import_ag_charts_community92 = require("ag-charts-community");
+var import_ag_charts_core45 = require("ag-charts-core");
+var {
+ Range,
+ TranslatableGroup,
+ BBox: BBox4,
+ Property: Property36,
+ ZIndexMap: ZIndexMap4,
+ ChartAxisDirection: ChartAxisDirection10,
+ FillGradientDefaults,
+ FillImageDefaults,
+ FillPatternDefaults,
+ getShapeFill,
+ InteractionState: InteractionState3
+} = import_ag_charts_community92._ModuleSupport;
+var BandHighlight = class extends import_ag_charts_community92._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.id = (0, import_ag_charts_core45.createId)(this);
+ this.enabled = false;
+ this.stroke = "rgb(195, 195, 195)";
+ this.lineDash = [6, 3];
+ this.lineDashOffset = 0;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.fill = "#c16068";
+ this.fillOpacity = 1;
+ this.fillGradientDefaults = new FillGradientDefaults();
+ this.fillPatternDefaults = new FillPatternDefaults();
+ this.fillImageDefaults = new FillImageDefaults();
+ this.bounds = new BBox4(0, 0, 0, 0);
+ this.bandHighlightGroup = new TranslatableGroup({
+ name: "bandHighlight",
+ zIndex: ZIndexMap4.AXIS_BAND_HIGHLIGHT
+ });
+ this.rangeNode = this.bandHighlightGroup.appendChild(new Range());
+ this.activeAxisHighlight = void 0;
+ this.axisCtx = ctx.parent;
+ this.hideBand();
+ ctx.domManager.addEventListener("focusin", ({ target }) => {
+ const isSeriesAreaChild = target instanceof HTMLElement && ctx.domManager.contains(target, "series-area");
+ if (this.bandHighlightGroup.visible && !isSeriesAreaChild) {
+ this.hideBand();
+ this.ctx.updateService.update(import_ag_charts_community92._ModuleSupport.ChartUpdateType.PERFORM_LAYOUT);
+ }
+ });
+ const {
+ widgets: { seriesWidget, seriesDragInterpreter },
+ animationManager,
+ eventsHub
+ } = ctx;
+ this.cleanup.register(
+ ctx.scene.attachNode(this.bandHighlightGroup),
+ seriesWidget.addListener("mousemove", (event) => this.onHoverLikeEvent(event)),
+ seriesWidget.addListener("mouseleave", () => this.clearAllHighlight()),
+ animationManager.addListener("animation-start", () => this.clearAllHighlight()),
+ eventsHub.on("layout:complete", (event) => this.layout(event)),
+ eventsHub.on("series:focus-change", () => this.onKeyPress()),
+ eventsHub.on("zoom:pan-start", () => this.clearAllHighlight()),
+ eventsHub.on("zoom:change", () => this.clearAllHighlight()),
+ eventsHub.on("dom:resize", () => this.clearAllHighlight()),
+ eventsHub.on("axis:change", () => this.axisChange())
+ );
+ if (seriesDragInterpreter) {
+ this.cleanup.register(
+ seriesDragInterpreter.events.on("drag-move", (event) => this.onHoverLikeEvent(event)),
+ seriesDragInterpreter.events.on("click", (event) => this.onClick(event))
+ );
+ }
+ }
+ axisChange() {
+ this.onHighlightChange();
+ }
+ isHover(event) {
+ return event.type === "mousemove" || event.type === "click" || event.device === "touch" && this.ctx.chartService.touch.dragAction === "hover";
+ }
+ onClick(event) {
+ if (event.device === "touch") {
+ this.onHoverLikeEvent(event);
+ }
+ }
+ clearAllHighlight() {
+ if (!this.ctx.interactionManager.isState(InteractionState3.Clickable))
+ return;
+ this.onHighlightChange();
+ }
+ onKeyPress() {
+ if (this.ctx.interactionManager.isState(InteractionState3.Default)) {
+ this.onHighlightChange();
+ }
+ }
+ onHoverLikeEvent(event) {
+ const requiredState = this.isHover(event) ? InteractionState3.Clickable : InteractionState3.AnnotationsMoveable;
+ if (!this.ctx.interactionManager.isState(requiredState))
+ return;
+ this.handleHoverHighlight(event);
+ }
+ handleHoverHighlight(event) {
+ if (!event)
+ return;
+ const { currentX: x, currentY: y } = event;
+ this.onHighlightChange(this.axisCtx.pickBand({ x, y }));
+ }
+ layout({ series: { rect, visible }, axes }) {
+ if (!visible || !axes || !this.enabled)
+ return;
+ const { position: axisPosition = "left", axisId } = this.axisCtx;
+ const axisLayout = axes.find((a) => a.id === axisId);
+ if (!axisLayout)
+ return;
+ this.axisLayout = axisLayout;
+ this.bounds = rect.clone().grow(axisLayout.gridPadding, axisPosition);
+ const { bandHighlightGroup, bounds } = this;
+ bandHighlightGroup.translationX = Math.round(bounds.x);
+ bandHighlightGroup.translationY = Math.round(bounds.y);
+ this.updateBand();
+ }
+ updateBand() {
+ const {
+ rangeNode: node,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ fill,
+ fillOpacity,
+ fillGradientDefaults: fillGradientDefaults3,
+ fillPatternDefaults: fillPatternDefaults3,
+ fillImageDefaults: fillImageDefaults3,
+ lineDashOffset,
+ axisLayout
+ } = this;
+ if (!axisLayout)
+ return;
+ node.stroke = stroke2;
+ node.strokeWidth = strokeWidth;
+ node.strokeOpacity = strokeOpacity;
+ node.lineDash = lineDash;
+ node.lineDashOffset = lineDashOffset;
+ node.fill = getShapeFill(fill, fillGradientDefaults3, fillPatternDefaults3, fillImageDefaults3);
+ node.fillOpacity = fillOpacity;
+ node.startLine = true;
+ node.endLine = true;
+ }
+ isVertical() {
+ return this.axisCtx.direction === ChartAxisDirection10.X;
+ }
+ onHighlightChange(axisBandDatum) {
+ if (!this.enabled)
+ return;
+ this.activeAxisHighlight = axisBandDatum;
+ if (this.activeAxisHighlight) {
+ this.showBand();
+ } else {
+ this.hideBand();
+ }
+ this.ctx.updateService.update(import_ag_charts_community92._ModuleSupport.ChartUpdateType.SCENE_RENDER);
+ }
+ updateBandPosition() {
+ const { rangeNode, bounds } = this;
+ const { band } = this.activeAxisHighlight ?? {};
+ if (band == void 0) {
+ this.hideBand();
+ return;
+ }
+ let r0 = Math.min(...band);
+ let r1 = Math.max(...band);
+ if (r1 - r0 < 1) {
+ const mid = (r0 + r1) / 2;
+ r0 = mid - 0.5;
+ r1 = mid + 0.5;
+ }
+ if (this.isVertical()) {
+ rangeNode.y1 = 0;
+ rangeNode.y2 = bounds.height;
+ rangeNode.x1 = r0;
+ rangeNode.x2 = r1;
+ rangeNode.horizontal = true;
+ } else {
+ rangeNode.y1 = r0;
+ rangeNode.y2 = r1;
+ rangeNode.x1 = 0;
+ rangeNode.x2 = bounds.width;
+ rangeNode.horizontal = false;
+ }
+ }
+ showBand() {
+ this.updateBandPosition();
+ this.bandHighlightGroup.visible = true;
+ }
+ hideBand() {
+ this.bandHighlightGroup.visible = false;
+ }
+};
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "enabled", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "stroke", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "lineDash", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "fill", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "fillGradientDefaults", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "fillPatternDefaults", 2);
+__decorateClass([
+ Property36
+], BandHighlight.prototype, "fillImageDefaults", 2);
+
+// packages/ag-charts-enterprise/src/features/band-highlight/bandHighlightModule.ts
+var BandHighlightModule = {
+ type: "axis-option",
+ optionsKey: "bandHighlight",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ axisTypes: ["category", "ordinal-time", "unit-time", "grouped-category"],
+ moduleFactory: (ctx) => new BandHighlight(ctx),
+ themeTemplate: {
+ bandHighlight: {
+ enabled: false,
+ strokeWidth: 0,
+ lineDash: [],
+ fill: { $foregroundBackgroundMix: 0.05 }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/chart-toolbar/chartToolbar.ts
+var import_ag_charts_community93 = require("ag-charts-community");
+var import_ag_charts_core46 = require("ag-charts-core");
+var { ActionOnSet: ActionOnSet4, LayoutElement: LayoutElement2, Menu: Menu3, Property: Property37 } = import_ag_charts_community93._ModuleSupport;
+var menuItems = [
+ { label: "toolbarSeriesTypeOHLC", icon: "ohlc-series", value: "ohlc" },
+ { label: "toolbarSeriesTypeCandles", icon: "candlestick-series", value: "candlestick" },
+ { label: "toolbarSeriesTypeHollowCandles", icon: "hollow-candlestick-series", value: "hollow-candlestick" },
+ { label: "toolbarSeriesTypeLine", icon: "line-series", value: "line" },
+ { label: "toolbarSeriesTypeStepLine", icon: "step-line-series", value: "step-line" },
+ { label: "toolbarSeriesTypeHLC", icon: "hlc-series", value: "hlc" },
+ { label: "toolbarSeriesTypeHighLow", icon: "high-low-series", value: "high-low" }
+];
+var ChartToolbar = class extends import_ag_charts_community93._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = false;
+ this.menu = new Menu3(this.ctx, "chart-toolbar");
+ this.toolbar = ctx.sharedToolbar.getSharedToolbar("chartToolbar");
+ this.cleanup.register(
+ this.toolbar.addToolbarListener("button-pressed", this.onButtonPressed.bind(this)),
+ ctx.layoutManager.registerElement(LayoutElement2.ToolbarLeft, this.onLayoutStart.bind(this)),
+ () => this.toolbar.destroy()
+ );
+ }
+ onLayoutStart(event) {
+ if (!this.enabled)
+ return;
+ this.updateButton();
+ this.toolbar.layout(event.layoutBox);
+ }
+ onButtonPressed({ event, buttonBounds, buttonWidget }) {
+ this.menu.setAnchor({ x: buttonBounds.x + buttonBounds.width + 6, y: buttonBounds.y });
+ this.menu.show(buttonWidget, {
+ items: menuItems,
+ menuItemRole: "menuitemradio",
+ ariaLabel: this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),
+ class: "ag-charts-chart-toolbar__menu",
+ value: this.getChartType(),
+ sourceEvent: event.sourceEvent,
+ onPress: (item) => {
+ this.setChartType(item.value);
+ this.hidePopover();
+ },
+ onHide: () => {
+ this.toolbar.clearActiveButton();
+ }
+ });
+ this.toolbar.toggleActiveButtonByIndex(0);
+ }
+ updateButton() {
+ const chartType = this.getChartType();
+ const icon = menuItems.find((item) => item.value === chartType)?.icon;
+ if (icon != null) {
+ this.toolbar.updateButtons([{ icon, tooltip: "toolbarSeriesTypeDropdown", value: "menu" }]);
+ }
+ }
+ hidePopover() {
+ this.toolbar.clearActiveButton();
+ this.menu.hide();
+ }
+ setChartType(chartType) {
+ const options = { chartType };
+ this.ctx.chartService.publicApi?.updateDelta(options).catch((e) => import_ag_charts_core46.Logger.error(e));
+ }
+ getChartType() {
+ const chartType = this.ctx.chartService.publicApi?.getOptions()?.chartType;
+ if (chartType == null || !menuItems.some((item) => item.value === chartType)) {
+ return "candlestick";
+ }
+ return chartType;
+ }
+};
+__decorateClass([
+ Property37,
+ ActionOnSet4({
+ changeValue(enabled) {
+ this.toolbar?.setHidden(!enabled);
+ }
+ })
+], ChartToolbar.prototype, "enabled", 2);
+
+// packages/ag-charts-enterprise/src/features/chart-toolbar/chartToolbarModule.ts
+var ChartToolbarModule = {
+ type: "root",
+ optionsKey: "chartToolbar",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ moduleFactory: (ctx) => new ChartToolbar(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/context-menu/contextMenuModule.ts
+var import_ag_charts_community95 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/context-menu/contextMenu.ts
+var import_ag_charts_community94 = require("ag-charts-community");
+var import_ag_charts_core48 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/context-menu/contextMenuItem.ts
+var import_ag_charts_core47 = require("ag-charts-core");
+function showsFor(showOn, showing) {
+ if (showOn === "always")
+ return true;
+ if (showOn === "series-area")
+ return showing === "series-area" || showing === "series-node";
+ return showOn === showing;
+}
+function appendItem(showing, item, result) {
+ let mustShow = true;
+ if (item.type === "separator") {
+ const last = result.at(-1);
+ mustShow = last !== void 0 && last.type !== "separator";
+ }
+ mustShow && (mustShow = showsFor(item.showOn ?? "always", showing));
+ if (mustShow) {
+ const menuItem = new ContextMenuItem(item);
+ result.push(menuItem);
+ return menuItem;
+ }
+}
+function appendBuiltinItem(showing, registry, keyword, result) {
+ if (registry.isVisible(keyword)) {
+ appendItem(showing, registry.builtins.items[keyword], result);
+ }
+}
+function expandBuiltin(showing, registry, keyword, result) {
+ const { builtins } = registry;
+ if ((0, import_ag_charts_core47.isKeyOf)(keyword, builtins.lists)) {
+ for (const childKeyword of builtins.lists[keyword]) {
+ appendBuiltinItem(showing, registry, childKeyword, result);
+ }
+ } else {
+ appendBuiltinItem(showing, registry, keyword, result);
+ }
+}
+function expandItems(showing, registry, items, result) {
+ for (const item of items) {
+ if (typeof item === "string") {
+ expandBuiltin(showing, registry, item, result);
+ } else {
+ const menuItem = appendItem(showing, item, result);
+ if (item.items && menuItem && item.items.length > 0) {
+ expandItems(showing, registry, item.items, menuItem.items);
+ }
+ }
+ }
+ if (result.at(-1)?.type === "separator") {
+ result.pop();
+ }
+}
+var ContextMenuItem = class {
+ constructor(options) {
+ this.type = "action";
+ this.showOn = "always";
+ this.label = "";
+ this.iconUrl = void 0;
+ this.enabled = true;
+ this.items = [];
+ this.action = void 0;
+ if (options)
+ this.setOptions(options);
+ this.items = [];
+ }
+ setField(key, that, value) {
+ that[key] = value;
+ }
+ setOptions(options) {
+ let key;
+ for (key in options) {
+ if (options[key] !== void 0) {
+ this.setField(key, this, options[key]);
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/context-menu/contextMenuStyles.ts
+var DEFAULT_CONTEXT_MENU_CLASS = "ag-charts-context-menu";
+
+// packages/ag-charts-enterprise/src/features/context-menu/contextMenu.ts
+var { Property: Property38, ContextMenuRegistry, callWithContext, getIconClassNames: getIconClassNames3 } = import_ag_charts_community94._ModuleSupport;
+var moduleId2 = "context-menu";
+var ContextMenu = class extends import_ag_charts_community94._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = true;
+ this.darkTheme = false;
+ this.items = ["defaults"];
+ // State
+ this.pickedNode = void 0;
+ this.showEvent = void 0;
+ this.x = 0;
+ this.y = 0;
+ this.collapsingSubMenus = 0;
+ this.menuWidget = new import_ag_charts_community94._Widget.MenuWidget();
+ this.interactionManager = ctx.interactionManager;
+ this.element = ctx.domManager.addChild("canvas-overlay", moduleId2);
+ this.element.classList.add(DEFAULT_CONTEXT_MENU_CLASS);
+ this.element.style.display = "none";
+ this.element.addEventListener("contextmenu", (event) => event.preventDefault());
+ this.element.addEventListener("focusout", ({ relatedTarget }) => {
+ if (this.collapsingSubMenus > 0)
+ return;
+ if (relatedTarget == null || relatedTarget instanceof Node && !this.element.contains(relatedTarget)) {
+ this.hide();
+ }
+ });
+ this.cleanup.register(
+ () => this.element.remove(),
+ () => this.menuWidget.destroy(),
+ ctx.eventsHub.on("dom:hidden", () => this.hide()),
+ this.menuWidget.addListener("collapse-widget", () => this.onCollapse())
+ );
+ this.menuWidget.addClass(`${DEFAULT_CONTEXT_MENU_CLASS}__menu`);
+ if (typeof MutationObserver !== "undefined") {
+ const observer = new MutationObserver(() => {
+ if (this.element.contains(this.menuWidget.getElement())) {
+ this.reposition();
+ }
+ });
+ observer.observe(this.element, { childList: true });
+ this.mutationObserver = observer;
+ this.cleanup.register(() => observer.disconnect());
+ }
+ this.ctx.contextMenuRegistry.builtins.items["download"].action = () => {
+ const title = ctx.chartService.title;
+ let fileName = "image";
+ if (title?.enabled) {
+ fileName = title.node.getPlainText().replace(/\.+/, "");
+ }
+ this.ctx.chartService.publicApi?.download({ fileName }).catch((e) => {
+ import_ag_charts_core48.Logger.error("Unable to download chart", e);
+ });
+ };
+ this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete", (e) => this.onContext(e)));
+ }
+ expandItemsOptions(showing) {
+ const result = [];
+ expandItems(showing, this.ctx.contextMenuRegistry, this.items, result);
+ return result;
+ }
+ onContext(event) {
+ if (!this.enabled)
+ return;
+ event.widgetEvent.sourceEvent.preventDefault();
+ this.showEvent = event.widgetEvent.sourceEvent;
+ this.x = event.x;
+ this.y = event.y;
+ this.pickedNode = void 0;
+ this.pickedLegendItem = void 0;
+ if (ContextMenuRegistry.check("series-node", event)) {
+ this.pickedNode = event.context.pickedNode;
+ } else if (ContextMenuRegistry.check("legend-item", event)) {
+ this.pickedLegendItem = event.context.legendItem;
+ }
+ const expandedItems = this.expandItemsOptions(event.showOn);
+ if (expandedItems.length === 0)
+ return;
+ this.show(event.widgetEvent, expandedItems);
+ }
+ show(widgetEvent, expandedItems) {
+ const { sourceEvent } = widgetEvent;
+ this.interactionManager.pushState(import_ag_charts_community94._ModuleSupport.InteractionState.ContextMenu);
+ this.element.style.display = "block";
+ const overrideFocusVisible = sourceEvent.pointerType === "touch" ? false : void 0;
+ if (overrideFocusVisible !== void 0) {
+ this.ctx.chartService.overrideFocusVisible(overrideFocusVisible);
+ }
+ this.createMenu(expandedItems);
+ this.element.appendChild(this.menuWidget.getElement());
+ this.menuWidget.expand({ sourceEvent, overrideFocusVisible });
+ }
+ hide() {
+ this.menuWidget.collapse();
+ }
+ onCollapse() {
+ this.interactionManager.popState(import_ag_charts_community94._ModuleSupport.InteractionState.ContextMenu);
+ this.menuWidget.getElement().remove();
+ this.element.style.display = "none";
+ }
+ onSubMenuExpand(button, menu) {
+ const bounds = button.getBounds();
+ button.setFocusOverride(true);
+ button.getElement().insertAdjacentElement("afterend", menu.getElement());
+ menu.getElement().style.position = "absolute";
+ const canvasRect = this.ctx.domManager.getBoundingClientRect();
+ const buttonClientRect = button.getBoundingClientRect();
+ const remainingSpaceOnRight = canvasRect.right - buttonClientRect.right;
+ const remainingSpaceOnLeft = buttonClientRect.left - canvasRect.left;
+ const { offsetWidth: menuOffsetWidth, offsetHeight: menuOffsetHeight } = menu.getElement();
+ let y = bounds.y;
+ if (canvasRect.height > menuOffsetHeight) {
+ const remainingSpaceOnBottom = canvasRect.bottom - buttonClientRect.top;
+ if (remainingSpaceOnBottom < menuOffsetHeight) {
+ y -= menuOffsetHeight - remainingSpaceOnBottom;
+ }
+ }
+ if (remainingSpaceOnRight >= menuOffsetWidth) {
+ menu.setBounds({ x: bounds.x + bounds.width, y });
+ } else {
+ const x = bounds.x - menuOffsetWidth;
+ const leftDelta = remainingSpaceOnLeft + x;
+ if (leftDelta >= 0) {
+ menu.setBounds({ x, y });
+ } else {
+ menu.setBounds({ x: x - leftDelta, y });
+ }
+ }
+ }
+ onSubMenuCollapse(button, menu) {
+ button.setFocusOverride(void 0);
+ this.collapsingSubMenus++;
+ menu.remove();
+ this.collapsingSubMenus--;
+ }
+ createMenu(expandedItems) {
+ const { menuWidget } = this;
+ menuWidget.clear();
+ menuWidget.setTabIndex(-1);
+ this.createMenuItems(menuWidget, expandedItems);
+ }
+ createMenuItems(menuWidget, expandedItems) {
+ for (const item of expandedItems) {
+ switch (item.type) {
+ case "separator": {
+ const sep = menuWidget.addSeparator();
+ sep.classList.add(`${DEFAULT_CONTEXT_MENU_CLASS}__divider`);
+ break;
+ }
+ case "action": {
+ if (item.items.length === 0) {
+ const btn = new import_ag_charts_community94._Widget.MenuItemWidget();
+ this.initButtonElement(btn, item);
+ menuWidget.addChild(btn);
+ } else {
+ const { subMenuButton, subMenu } = menuWidget.addSubMenu();
+ subMenu.addClass(`${DEFAULT_CONTEXT_MENU_CLASS}__menu`);
+ subMenu.addListener("expand-widget", () => this.onSubMenuExpand(subMenuButton, subMenu));
+ subMenu.addListener("collapse-widget", () => this.onSubMenuCollapse(subMenuButton, subMenu));
+ this.initButtonElement(subMenuButton, item);
+ this.createMenuItems(subMenu, item.items);
+ }
+ break;
+ }
+ default:
+ throw new Error("unhandled case");
+ }
+ }
+ }
+ createButtonOnClick(showOn, callback) {
+ if (ContextMenuRegistry.checkCallback("legend-item", showOn, callback)) {
+ return (widgetEvent) => {
+ const event = widgetEvent.sourceEvent;
+ if (this.pickedLegendItem) {
+ const { seriesId, itemId, label } = this.pickedLegendItem;
+ const { chartService: chart } = this.ctx;
+ if (typeof itemId !== "string") {
+ import_ag_charts_core48.Logger.error(`unexpected itemId type: [${typeof itemId}] (expected [string])`);
+ return;
+ }
+ const series = chart.series.find((s) => s.id === seriesId);
+ const callers = [series?.properties, chart];
+ const apiEvent = {
+ type: "contextmenu",
+ seriesId,
+ itemId,
+ text: (0, import_ag_charts_core48.toPlainText)(label.text),
+ event
+ };
+ callWithContext(callers, callback, apiEvent);
+ this.hide();
+ } else {
+ import_ag_charts_core48.Logger.error("legend item not found");
+ }
+ };
+ } else if (ContextMenuRegistry.checkCallback("series-area", showOn, callback)) {
+ return () => {
+ const caller = this.ctx.chartService;
+ const apiEvent = { type: "seriesContextMenuAction", event: this.showEvent };
+ callWithContext(caller, callback, apiEvent);
+ this.hide();
+ };
+ } else if (ContextMenuRegistry.checkCallback("series-node", showOn, callback)) {
+ return () => {
+ const { showEvent } = this;
+ const { chartService: chart } = this.ctx;
+ const pickedNode = this.pickedNode;
+ const callers = [pickedNode?.series.properties, chart];
+ const apiEvent = pickedNode?.series.createNodeContextMenuActionEvent(showEvent, pickedNode);
+ if (apiEvent) {
+ callWithContext(callers, callback, apiEvent);
+ } else {
+ import_ag_charts_core48.Logger.error("series node not found");
+ }
+ this.hide();
+ };
+ }
+ return () => {
+ const caller = this.ctx.chartService;
+ const apiEvent = { type: "contextMenuEvent", event: this.showEvent };
+ callWithContext(caller, callback, apiEvent);
+ this.hide();
+ };
+ }
+ initTableCells(elem) {
+ const cellIcon = (0, import_ag_charts_core48.createElement)("div");
+ const cellLabel = (0, import_ag_charts_core48.createElement)("div");
+ const cellArrow = (0, import_ag_charts_core48.createElement)("div");
+ cellIcon.classList.toggle(`${DEFAULT_CONTEXT_MENU_CLASS}__icon`, true);
+ cellLabel.classList.toggle(`${DEFAULT_CONTEXT_MENU_CLASS}__cell`, true);
+ cellArrow.classList.toggle(`${DEFAULT_CONTEXT_MENU_CLASS}__cell`, true);
+ cellIcon.ariaHidden = "true";
+ cellLabel.role = "presentation";
+ cellArrow.ariaHidden = "true";
+ elem.append(cellIcon, cellLabel, cellArrow);
+ return { cellIcon, cellLabel, cellArrow };
+ }
+ initButtonElement(button, item) {
+ button.addClass(`${DEFAULT_CONTEXT_MENU_CLASS}__item`);
+ button.setEnabled(item.enabled);
+ const label = this.ctx.localeManager.t(item.label);
+ const cellPaddingClass = `${DEFAULT_CONTEXT_MENU_CLASS}__cellpadding`;
+ const { cellIcon, cellLabel, cellArrow } = this.initTableCells(button.getElement());
+ cellLabel.textContent = label;
+ cellLabel.classList.add(cellPaddingClass);
+ if (item.iconUrl != null) {
+ const img = (0, import_ag_charts_core48.createElement)("img");
+ img.src = item.iconUrl;
+ cellIcon.append(img);
+ cellIcon.classList.add(cellPaddingClass);
+ }
+ if (item.items.length > 0) {
+ const span = (0, import_ag_charts_core48.createElement)("span", getIconClassNames3("chevron-right"));
+ cellArrow.append(span);
+ cellArrow.classList.add(cellPaddingClass);
+ }
+ const { showOn, action } = item;
+ if (action != null) {
+ button.addListener("click", this.createButtonOnClick(showOn, action));
+ }
+ if (item.items.length === 0) {
+ button.addListener("mouseleave", () => button.setFocusOverride(false));
+ button.addListener("mouseenter", () => button.setFocusOverride(void 0));
+ }
+ }
+ reposition() {
+ let { x, y } = this;
+ this.element.style.top = "unset";
+ this.element.style.bottom = "unset";
+ const canvasRect = this.ctx.domManager.getBoundingClientRect();
+ const { offsetWidth: width, offsetHeight: height } = this.element;
+ x = (0, import_ag_charts_core48.clamp)(0, x, canvasRect.width - width);
+ y = (0, import_ag_charts_core48.clamp)(0, y, canvasRect.height - height);
+ this.element.style.left = `${x}px`;
+ this.element.style.top = `calc(${y}px - 0.5em)`;
+ }
+ destroy() {
+ super.destroy();
+ this.mutationObserver?.disconnect();
+ this.ctx.domManager.removeStyles(moduleId2);
+ this.ctx.domManager.removeChild("canvas-overlay", moduleId2);
+ }
+};
+__decorateClass([
+ Property38
+], ContextMenu.prototype, "enabled", 2);
+__decorateClass([
+ Property38
+], ContextMenu.prototype, "darkTheme", 2);
+__decorateClass([
+ Property38
+], ContextMenu.prototype, "items", 2);
+
+// packages/ag-charts-enterprise/src/features/context-menu/contextMenuModule.ts
+var ContextMenuModule = {
+ type: "root",
+ packageType: "enterprise",
+ chartTypes: ["cartesian", "polar", "topology", "standalone"],
+ optionsKey: "contextMenu",
+ moduleFactory: (ctx) => new ContextMenu(ctx),
+ themeTemplate: {
+ contextMenu: {
+ enabled: true,
+ darkTheme: import_ag_charts_community95._ModuleSupport.ThemeSymbols.IS_DARK_THEME
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/crosshair/crosshair.ts
+var import_ag_charts_community97 = require("ag-charts-community");
+var import_ag_charts_core50 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/utils/datum.ts
+function readDatum(nodeDatum) {
+ if (typeof nodeDatum?.datum === "object") {
+ return nodeDatum.datum;
+ }
+ return null;
+}
+
+// packages/ag-charts-enterprise/src/features/crosshair/crosshairLabel.ts
+var import_ag_charts_community96 = require("ag-charts-community");
+var import_ag_charts_core49 = require("ag-charts-core");
+var { FormatManager, BaseProperties: BaseProperties13, Property: Property39 } = import_ag_charts_community96._ModuleSupport;
+var DEFAULT_LABEL_CLASS = "ag-charts-crosshair-label";
+var CrosshairLabelProperties = class extends BaseProperties13 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.xOffset = 0;
+ this.yOffset = 0;
+ this.format = void 0;
+ this.renderer = void 0;
+ this._cachedFormatter = void 0;
+ }
+ formatValue(callWithContext2, type, value, params) {
+ const { formatter, format } = this;
+ const { domain, boundSeries } = params;
+ let result;
+ if (formatter != null) {
+ const fractionDigits = params.type === "number" ? params.fractionDigits : void 0;
+ const unit = params.type === "date" ? params.unit : void 0;
+ const step = params.type === "date" ? params.step : void 0;
+ result = callWithContext2(formatter, { value, domain, fractionDigits, unit, step, boundSeries });
+ }
+ if (format != null) {
+ let cachedFormatter = this._cachedFormatter;
+ if (cachedFormatter == null || cachedFormatter.type !== type || cachedFormatter.format !== format) {
+ cachedFormatter = {
+ type,
+ format,
+ formatter: FormatManager.getFormatter(type, format)
+ };
+ this._cachedFormatter = cachedFormatter;
+ }
+ result ?? (result = cachedFormatter.formatter?.(value));
+ }
+ return result == null ? void 0 : String(result);
+ }
+};
+__decorateClass([
+ Property39
+], CrosshairLabelProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property39
+], CrosshairLabelProperties.prototype, "xOffset", 2);
+__decorateClass([
+ Property39
+], CrosshairLabelProperties.prototype, "yOffset", 2);
+__decorateClass([
+ Property39
+], CrosshairLabelProperties.prototype, "formatter", 2);
+__decorateClass([
+ Property39
+], CrosshairLabelProperties.prototype, "format", 2);
+__decorateClass([
+ Property39
+], CrosshairLabelProperties.prototype, "renderer", 2);
+var CrosshairLabel = class extends CrosshairLabelProperties {
+ constructor(domManager, key, axisId) {
+ super();
+ this.domManager = domManager;
+ this.id = (0, import_ag_charts_core49.createId)(this);
+ this.element = domManager.addChild("canvas-overlay", `crosshair-label-${this.id}`);
+ this.element.classList.add(DEFAULT_LABEL_CLASS);
+ (0, import_ag_charts_core49.setAttribute)(this.element, "aria-hidden", true);
+ this.element.dataset.key = key;
+ this.element.dataset.axisId = axisId;
+ }
+ show(meta) {
+ const { element } = this;
+ const left = meta.x + this.xOffset;
+ const top = meta.y + this.yOffset;
+ element.style.top = `${Math.round(top)}px`;
+ element.style.left = `${Math.round(left)}px`;
+ this.toggle(true);
+ }
+ setLabelHtml({ html, styles }) {
+ if (html !== void 0) {
+ this.element.innerHTML = html;
+ }
+ if (styles !== void 0) {
+ const styleElement = this.element.children[0] ?? this.element;
+ Object.assign(styleElement.style, styles);
+ }
+ }
+ getBBox() {
+ const { element } = this;
+ return new import_ag_charts_community96._ModuleSupport.BBox(
+ element.clientLeft,
+ element.clientTop,
+ element.clientWidth,
+ element.clientHeight
+ );
+ }
+ toggle(visible) {
+ this.element.classList.toggle(`ag-charts-crosshair-label--hidden`, !visible);
+ }
+ destroy() {
+ this.domManager.removeChild("canvas-overlay", `crosshair-label-${this.id}`);
+ }
+ toLabelHtml(input, defaults) {
+ if (typeof input === "string") {
+ return { html: input, styles: {} };
+ }
+ defaults = defaults ?? {};
+ const {
+ text: text2 = defaults.text ?? "",
+ color: color6 = defaults.color,
+ backgroundColor = defaults.backgroundColor,
+ opacity = defaults.opacity ?? 1
+ } = input;
+ const styles = {
+ opacity,
+ "background-color": backgroundColor?.toLowerCase(),
+ color: color6
+ };
+ return {
+ html: `
+ ${text2}
+
`,
+ styles
+ };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/crosshair/crosshair.ts
+var { Group: Group5, TranslatableGroup: TranslatableGroup2, Line: Line4, BBox: BBox5, InteractionState: InteractionState4, Property: Property40, ZIndexMap: ZIndexMap5, ChartAxisDirection: ChartAxisDirection11 } = import_ag_charts_community97._ModuleSupport;
+var Crosshair = class extends import_ag_charts_community97._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.id = (0, import_ag_charts_core50.createId)(this);
+ this.enabled = false;
+ this.stroke = "rgb(195, 195, 195)";
+ this.lineDash = [6, 3];
+ this.lineDashOffset = 0;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.snap = true;
+ this.label = new CrosshairLabelProperties();
+ this.seriesRect = new BBox5(0, 0, 0, 0);
+ this.bounds = new BBox5(0, 0, 0, 0);
+ this.crosshairGroup = new TranslatableGroup2({
+ name: "crosshairs",
+ zIndex: ZIndexMap5.SERIES_CROSSHAIR
+ });
+ this.lineGroup = this.crosshairGroup.appendChild(
+ new Group5({
+ name: `${this.id}-crosshair-lines`,
+ zIndex: ZIndexMap5.SERIES_CROSSHAIR
+ })
+ );
+ this.lineGroupSelection = import_ag_charts_community97._ModuleSupport.Selection.select(this.lineGroup, Line4, false);
+ this.activeHighlight = void 0;
+ this.axisCtx = ctx.parent;
+ this.labels = {};
+ this.hideCrosshairs();
+ ctx.domManager.addEventListener("focusin", ({ target }) => {
+ const isSeriesAreaChild = target instanceof HTMLElement && ctx.domManager.contains(target, "series-area");
+ if (this.crosshairGroup.visible && !isSeriesAreaChild) {
+ this.hideCrosshairs();
+ this.ctx.updateService.update(import_ag_charts_community97._ModuleSupport.ChartUpdateType.PERFORM_LAYOUT);
+ }
+ });
+ const { seriesDragInterpreter } = ctx.widgets;
+ this.cleanup.register(
+ ctx.scene.attachNode(this.crosshairGroup),
+ ctx.widgets.seriesWidget.addListener("mousemove", (event) => this.onMouseHoverLike(event)),
+ ctx.widgets.seriesWidget.addListener("mouseleave", () => this.onMouseOut()),
+ ctx.eventsHub.on("series:focus-change", () => this.onKeyPress()),
+ ctx.eventsHub.on("zoom:pan-start", () => this.onMouseOut()),
+ ctx.eventsHub.on("zoom:change", () => this.onMouseOut()),
+ ctx.eventsHub.on("highlight:change", (event) => this.onHighlightChange(event)),
+ ctx.eventsHub.on("layout:complete", (event) => this.layout(event)),
+ () => {
+ for (const label of Object.values(this.labels)) {
+ label.destroy();
+ }
+ }
+ );
+ if (seriesDragInterpreter) {
+ this.cleanup.register(
+ seriesDragInterpreter.events.on("drag-move", (event) => this.onMouseHoverLike(event)),
+ seriesDragInterpreter.events.on("click", (event) => this.onClick(event))
+ );
+ }
+ }
+ layout({ series: { rect, visible }, axes }) {
+ if (!visible || !axes || !this.enabled)
+ return;
+ this.seriesRect = rect;
+ const { position: axisPosition = "left", axisId } = this.axisCtx;
+ const axisLayout = axes.find((a) => a.id === axisId);
+ if (!axisLayout)
+ return;
+ this.axisLayout = axisLayout;
+ this.bounds = rect.clone().grow(axisLayout.gridPadding + axisLayout.seriesAreaPadding, axisPosition);
+ const { crosshairGroup, bounds } = this;
+ crosshairGroup.translationX = Math.round(bounds.x);
+ crosshairGroup.translationY = Math.round(bounds.y);
+ const crosshairKeys = ["pointer", ...this.axisCtx.seriesKeyProperties()];
+ this.updateSelections(crosshairKeys);
+ this.updateLines();
+ this.updateLabels(crosshairKeys);
+ }
+ updateSelections(data) {
+ this.lineGroupSelection.update(data, void 0, (key) => key);
+ }
+ updateLabels(keys) {
+ const { labels, ctx } = this;
+ for (const key of keys) {
+ if (this.label.enabled) {
+ labels[key] ?? (labels[key] = new CrosshairLabel(ctx.domManager, key, this.axisCtx.axisId));
+ }
+ if (labels[key]) {
+ this.updateLabel(labels[key]);
+ }
+ }
+ }
+ updateLabel(label) {
+ const { enabled, xOffset, yOffset, format, renderer } = this.label;
+ label.enabled = enabled;
+ label.xOffset = xOffset;
+ label.yOffset = yOffset;
+ label.format = format;
+ label.renderer = renderer;
+ }
+ updateLines() {
+ const { lineGroupSelection, bounds, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset, axisLayout } = this;
+ if (!axisLayout)
+ return;
+ const isVertical = this.isVertical();
+ lineGroupSelection.each((line) => {
+ line.stroke = stroke2;
+ line.strokeWidth = strokeWidth;
+ line.strokeOpacity = strokeOpacity;
+ line.lineDash = lineDash;
+ line.lineDashOffset = lineDashOffset;
+ line.y1 = 0;
+ line.y2 = isVertical ? bounds.height : 0;
+ line.x1 = 0;
+ line.x2 = isVertical ? 0 : bounds.width;
+ });
+ }
+ isVertical() {
+ return this.axisCtx.direction === ChartAxisDirection11.X;
+ }
+ isHover(event) {
+ return event.type === "mousemove" || event.type === "click" || event.device === "touch" && this.ctx.chartService.touch.dragAction === "hover";
+ }
+ formatValue(value) {
+ return (0, import_ag_charts_core50.toPlainText)(this.axisCtx.formatScaleValue(value, "crosshair", this.label));
+ }
+ onClick(event) {
+ if (event.device === "touch") {
+ this.onMouseHoverLike(event);
+ }
+ }
+ onMouseHoverLike(event) {
+ if (!this.enabled || this.snap)
+ return;
+ const requiredState = this.isHover(event) ? InteractionState4.Clickable : InteractionState4.AnnotationsMoveable;
+ if (!this.ctx.interactionManager.isState(requiredState))
+ return;
+ this.updatePositions(this.getData(event));
+ this.crosshairGroup.visible = true;
+ this.ctx.updateService.update(import_ag_charts_community97._ModuleSupport.ChartUpdateType.SCENE_RENDER);
+ }
+ onMouseOut() {
+ if (!this.ctx.interactionManager.isState(InteractionState4.Clickable))
+ return;
+ this.hideCrosshairs();
+ this.ctx.updateService.update(import_ag_charts_community97._ModuleSupport.ChartUpdateType.SCENE_RENDER);
+ }
+ onKeyPress() {
+ if (this.enabled && !this.snap && this.ctx.interactionManager.isState(InteractionState4.Default)) {
+ this.hideCrosshairs();
+ }
+ }
+ onHighlightChange(event) {
+ if (!this.enabled)
+ return;
+ const { crosshairGroup, axisCtx } = this;
+ const { datum, series } = event.currentHighlight ?? {};
+ const hasCrosshair = datum && (series?.axes.x?.id === axisCtx.axisId || series?.axes.y?.id === axisCtx.axisId);
+ this.activeHighlight = hasCrosshair ? event.currentHighlight : void 0;
+ if (!this.activeHighlight) {
+ this.hideCrosshairs();
+ } else if (this.snap) {
+ const activeHighlightData = this.getActiveHighlightData(this.activeHighlight);
+ this.updatePositions(activeHighlightData);
+ crosshairGroup.visible = true;
+ }
+ }
+ isInRange(value) {
+ return this.axisCtx.inRange(value);
+ }
+ updatePositions(data) {
+ const { seriesRect, lineGroupSelection } = this;
+ lineGroupSelection.each((line, key) => {
+ const lineData = data[key];
+ if (!lineData) {
+ line.visible = false;
+ this.hideLabel(key);
+ return;
+ }
+ line.visible = true;
+ const { value, position } = lineData;
+ let x = 0;
+ let y = 0;
+ if (this.isVertical()) {
+ x = position;
+ line.x = Math.round(x);
+ } else {
+ y = position;
+ line.y = Math.round(y);
+ }
+ if (this.label.enabled) {
+ this.showLabel(x + seriesRect.x, y + seriesRect.y, value, key);
+ } else {
+ this.hideLabel(key);
+ }
+ });
+ }
+ getData(event) {
+ const { axisCtx } = this;
+ const key = "pointer";
+ const { xKey = "", yKey = "" } = this.activeHighlight ?? {};
+ const { currentX, currentY } = event;
+ const datum = readDatum(this.activeHighlight);
+ const isVertical = this.isVertical();
+ const position = isVertical ? currentX : currentY;
+ let value = datum?.[isVertical ? xKey : yKey] ?? "";
+ if (axisCtx.continuous) {
+ value = axisCtx.scaleInvert(position);
+ }
+ return { [key]: { position, value } };
+ }
+ getActiveHighlightData(activeHighlight) {
+ const { axisCtx } = this;
+ const { series, xKey = "", aggregatedValue, cumulativeValue, midPoint } = activeHighlight;
+ const datum = readDatum(activeHighlight);
+ const seriesKeyProperties = series.getKeyProperties(axisCtx.direction);
+ const halfBandwidth = (axisCtx.scale.bandwidth ?? 0) / 2;
+ const matchingAxisId = series.axes[axisCtx.direction]?.id === axisCtx.axisId;
+ const isYKey = seriesKeyProperties.includes("yKey") && matchingAxisId;
+ const isXKey = seriesKeyProperties.includes("xKey") && matchingAxisId;
+ const datumValue = aggregatedValue ?? cumulativeValue;
+ if (isYKey && datumValue !== void 0) {
+ const position = axisCtx.scale.convert(datumValue) + halfBandwidth;
+ const isInRange = this.isInRange(position);
+ return isInRange ? {
+ yKey: { value: datumValue, position }
+ } : {};
+ }
+ if (isXKey) {
+ const position = (this.isVertical() ? midPoint?.x : midPoint?.y) ?? 0;
+ const value = axisCtx.continuous ? axisCtx.scaleInvert(position) : datum?.[xKey];
+ return this.isInRange(position) ? { xKey: { value, position } } : {};
+ }
+ const activeHighlightData = {};
+ for (const key of seriesKeyProperties) {
+ const keyValue = series.properties[key];
+ const value = datum?.[keyValue];
+ const position = axisCtx.scale.convert(value) + halfBandwidth;
+ const isInRange = this.isInRange(position);
+ if (isInRange) {
+ activeHighlightData[key] = { value, position };
+ }
+ }
+ return activeHighlightData;
+ }
+ getLabelHtml(value, label) {
+ const fractionDigits = this.axisLayout?.label?.fractionDigits ?? 0;
+ const defaults = { text: this.formatValue(value) };
+ if (this.label.renderer) {
+ return label.toLabelHtml(this.label.renderer({ value, fractionDigits }), defaults);
+ }
+ return label.toLabelHtml(defaults);
+ }
+ showLabel(x, y, value, key) {
+ if (!this.axisLayout)
+ return;
+ const { bounds } = this;
+ const label = this.labels[key];
+ const html = this.getLabelHtml(value, label);
+ label.setLabelHtml(html);
+ const { width, height } = label.getBBox();
+ const axisPosition = this.axisCtx.position;
+ let padding = this.axisLayout.label.spacing + this.axisLayout.tickSize;
+ if (this.axisCtx.direction === ChartAxisDirection11.X) {
+ padding -= 4;
+ label.show({
+ x: x - width / 2,
+ y: axisPosition === "bottom" ? bounds.y + bounds.height + padding : bounds.y - height - padding
+ });
+ } else {
+ padding -= 8;
+ label.show({
+ x: axisPosition === "right" ? bounds.x + bounds.width + padding : bounds.x - width - padding,
+ y: y - height / 2
+ });
+ }
+ }
+ hideCrosshairs() {
+ this.crosshairGroup.visible = false;
+ for (const key of Object.keys(this.labels)) {
+ this.hideLabel(key);
+ }
+ }
+ hideLabel(key) {
+ this.labels[key]?.toggle(false);
+ }
+};
+__decorateClass([
+ Property40
+], Crosshair.prototype, "enabled", 2);
+__decorateClass([
+ Property40
+], Crosshair.prototype, "stroke", 2);
+__decorateClass([
+ Property40
+], Crosshair.prototype, "lineDash", 2);
+__decorateClass([
+ Property40
+], Crosshair.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property40
+], Crosshair.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property40
+], Crosshair.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property40
+], Crosshair.prototype, "snap", 2);
+__decorateClass([
+ Property40
+], Crosshair.prototype, "label", 2);
+
+// packages/ag-charts-enterprise/src/features/crosshair/crosshairModule.ts
+var CrosshairModule = {
+ type: "axis-option",
+ optionsKey: "crosshair",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ axisTypes: ["category", "time", "unit-time", "ordinal-time", "number", "log"],
+ moduleFactory: (ctx) => new Crosshair(ctx),
+ themeTemplate: {
+ crosshair: {
+ snap: true,
+ stroke: { $ref: "subtleTextColor" },
+ strokeWidth: 1,
+ strokeOpacity: 1,
+ lineDash: [5, 6],
+ lineDashOffset: 0,
+ label: {
+ enabled: true
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/data-source/dataSource.ts
+var import_ag_charts_community98 = require("ag-charts-community");
+var { ActionOnSet: ActionOnSet5, Property: Property41 } = import_ag_charts_community98._ModuleSupport;
+var DataSource = class extends import_ag_charts_community98._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.enabled = false;
+ this.getData = () => Promise.resolve();
+ this.dataService = ctx.dataService;
+ }
+ updateCallback(enabled, getData) {
+ if (!this.dataService)
+ return;
+ if (enabled && getData != null) {
+ this.dataService.updateCallback(getData);
+ } else {
+ this.dataService.clearCallback();
+ }
+ }
+};
+__decorateClass([
+ ActionOnSet5({
+ newValue(enabled) {
+ this.updateCallback(enabled, this.getData);
+ }
+ }),
+ Property41
+], DataSource.prototype, "enabled", 2);
+__decorateClass([
+ ActionOnSet5({
+ newValue(getData) {
+ this.updateCallback(this.enabled, getData);
+ }
+ }),
+ Property41
+], DataSource.prototype, "getData", 2);
+__decorateClass([
+ ActionOnSet5({
+ newValue(requestThrottle) {
+ this.dataService.requestThrottle = requestThrottle;
+ }
+ })
+], DataSource.prototype, "requestThrottle", 2);
+__decorateClass([
+ ActionOnSet5({
+ newValue(updateThrottle) {
+ this.dataService.dispatchThrottle = updateThrottle;
+ }
+ })
+], DataSource.prototype, "updateThrottle", 2);
+__decorateClass([
+ ActionOnSet5({
+ newValue(updateDuringInteraction) {
+ this.dataService.dispatchOnlyLatest = !updateDuringInteraction;
+ }
+ })
+], DataSource.prototype, "updateDuringInteraction", 2);
+
+// packages/ag-charts-enterprise/src/features/data-source/dataSourceModule.ts
+var DataSourceModule = {
+ type: "root",
+ optionsKey: "dataSource",
+ packageType: "enterprise",
+ chartTypes: ["cartesian", "polar", "topology", "standalone"],
+ moduleFactory: (ctx) => new DataSource(ctx),
+ themeTemplate: {
+ dataSource: { enabled: false }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/error-bar/errorBarModule.ts
+var import_ag_charts_community102 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/error-bar/errorBar.ts
+var import_ag_charts_community101 = require("ag-charts-community");
+var import_ag_charts_core51 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/error-bar/errorBarNode.ts
+var import_ag_charts_community99 = require("ag-charts-community");
+var { nearestSquared, nearestSquaredInContainer, partialAssign, mergeDefaults, BBox: BBox6 } = import_ag_charts_community99._ModuleSupport;
+var HierarchicalBBox = class {
+ constructor(components) {
+ this.components = components;
+ this.union = BBox6.merge(components);
+ }
+ containsPoint(x, y) {
+ if (!this.union.containsPoint(x, y)) {
+ return false;
+ }
+ for (const bbox of this.components) {
+ if (bbox.containsPoint(x, y)) {
+ return true;
+ }
+ }
+ return false;
+ }
+};
+var ErrorBarNode = class extends import_ag_charts_community99._ModuleSupport.Group {
+ constructor() {
+ super();
+ this.capLength = Number.NaN;
+ this._datum = void 0;
+ this.whiskerPath = new import_ag_charts_community99._ModuleSupport.Path();
+ this.capsPath = new import_ag_charts_community99._ModuleSupport.Path();
+ this.bboxes = new HierarchicalBBox([]);
+ this.append([this.whiskerPath, this.capsPath]);
+ }
+ get datum() {
+ return this._datum;
+ }
+ set datum(datum) {
+ this._datum = datum;
+ }
+ calculateCapLength(capsTheme, capDefaults) {
+ const { lengthRatio = 1, length } = capsTheme;
+ const { lengthRatioMultiplier, lengthMax } = capDefaults;
+ const desiredLength = length ?? lengthRatio * lengthRatioMultiplier;
+ return Math.min(desiredLength, lengthMax);
+ }
+ getItemStylerParams(options, style, highlighted, highlightState) {
+ const { datum } = this;
+ if (datum == null || options.itemStyler == null)
+ return;
+ const { xLowerKey, xUpperKey, yLowerKey, yUpperKey } = options;
+ return {
+ ...style,
+ datum: datum.datum,
+ seriesId: datum.series.id,
+ xKey: datum.xKey,
+ yKey: datum.yKey,
+ xLowerKey,
+ xUpperKey,
+ yLowerKey,
+ yUpperKey,
+ highlighted,
+ highlightState
+ };
+ }
+ formatStyles(style, options, caller, highlighted, highlightState) {
+ let { cap: capsStyle, ...whiskerStyle } = style;
+ const params = this.getItemStylerParams(options, style, highlighted, highlightState);
+ if (params != null && options.itemStyler != null) {
+ const result = caller.callWithContext(options.itemStyler, params);
+ whiskerStyle = mergeDefaults(result, whiskerStyle);
+ capsStyle = mergeDefaults(result?.cap, result, capsStyle);
+ }
+ return { whiskerStyle, capsStyle };
+ }
+ applyStyling(target, source) {
+ partialAssign(
+ ["visible", "stroke", "strokeWidth", "strokeOpacity", "lineDash", "lineDashOffset"],
+ target,
+ source
+ );
+ }
+ update(style, formatters, caller, highlighted, highlightState) {
+ if (this.datum === void 0) {
+ return;
+ }
+ const { whiskerStyle, capsStyle } = this.formatStyles(style, formatters, caller, highlighted, highlightState);
+ const { xBar, yBar, capDefaults } = this.datum;
+ const whisker = this.whiskerPath;
+ this.applyStyling(whisker, whiskerStyle);
+ whisker.path.clear(true);
+ if (yBar !== void 0) {
+ whisker.path.moveTo(yBar.lowerPoint.x, yBar.lowerPoint.y);
+ whisker.path.lineTo(yBar.upperPoint.x, yBar.upperPoint.y);
+ }
+ if (xBar !== void 0) {
+ whisker.path.moveTo(xBar.lowerPoint.x, xBar.lowerPoint.y);
+ whisker.path.lineTo(xBar.upperPoint.x, xBar.upperPoint.y);
+ }
+ whisker.path.closePath();
+ this.capLength = this.calculateCapLength(capsStyle ?? {}, capDefaults);
+ const capOffset = this.capLength / 2;
+ const caps = this.capsPath;
+ this.applyStyling(caps, capsStyle);
+ caps.path.clear(true);
+ if (yBar !== void 0) {
+ caps.path.moveTo(yBar.lowerPoint.x - capOffset, yBar.lowerPoint.y);
+ caps.path.lineTo(yBar.lowerPoint.x + capOffset, yBar.lowerPoint.y);
+ caps.path.moveTo(yBar.upperPoint.x - capOffset, yBar.upperPoint.y);
+ caps.path.lineTo(yBar.upperPoint.x + capOffset, yBar.upperPoint.y);
+ }
+ if (xBar !== void 0) {
+ caps.path.moveTo(xBar.lowerPoint.x, xBar.lowerPoint.y - capOffset);
+ caps.path.lineTo(xBar.lowerPoint.x, xBar.lowerPoint.y + capOffset);
+ caps.path.moveTo(xBar.upperPoint.x, xBar.upperPoint.y - capOffset);
+ caps.path.lineTo(xBar.upperPoint.x, xBar.upperPoint.y + capOffset);
+ }
+ caps.path.closePath();
+ }
+ updateBBoxes() {
+ const { capLength, whiskerPath: whisker, capsPath: caps } = this;
+ const { yBar, xBar } = this.datum ?? {};
+ const capOffset = capLength / 2;
+ const components = [];
+ if (yBar !== void 0) {
+ const whiskerHeight = yBar.lowerPoint.y - yBar.upperPoint.y;
+ components.push(
+ new BBox6(yBar.lowerPoint.x, yBar.upperPoint.y, whisker.strokeWidth, whiskerHeight),
+ new BBox6(yBar.lowerPoint.x - capOffset, yBar.lowerPoint.y, capLength, caps.strokeWidth),
+ new BBox6(yBar.upperPoint.x - capOffset, yBar.upperPoint.y, capLength, caps.strokeWidth)
+ );
+ }
+ if (xBar !== void 0) {
+ const whiskerWidth = xBar.upperPoint.x - xBar.lowerPoint.x;
+ components.push(
+ new BBox6(xBar.lowerPoint.x, xBar.upperPoint.y, whiskerWidth, whisker.strokeWidth),
+ new BBox6(xBar.lowerPoint.x, xBar.lowerPoint.y - capOffset, caps.strokeWidth, capLength),
+ new BBox6(xBar.upperPoint.x, xBar.upperPoint.y - capOffset, caps.strokeWidth, capLength)
+ );
+ }
+ this.bboxes.components = components;
+ this.bboxes.union = BBox6.merge(components);
+ }
+ containsPoint(x, y) {
+ return this.bboxes.containsPoint(x, y);
+ }
+ pickNode(x, y) {
+ return this.containsPoint(x, y) ? this : void 0;
+ }
+ nearestSquared(x, y, maxDistance) {
+ const { bboxes } = this;
+ if (bboxes.union.distanceSquared(x, y) > maxDistance) {
+ return { nearest: void 0, distanceSquared: Infinity };
+ }
+ const { distanceSquared } = nearestSquared(x, y, bboxes.components);
+ return { nearest: this, distanceSquared };
+ }
+};
+var ErrorBarGroup = class extends import_ag_charts_community99._ModuleSupport.Group {
+ nearestSquared(x, y) {
+ const { nearest, distanceSquared } = nearestSquaredInContainer(x, y, {
+ children: this.children()
+ });
+ if (nearest !== void 0 && !Number.isNaN(distanceSquared)) {
+ return { datum: nearest.datum, distanceSquared };
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/error-bar/errorBarProperties.ts
+var import_ag_charts_community100 = require("ag-charts-community");
+var { BaseProperties: BaseProperties14, Property: Property42 } = import_ag_charts_community100._ModuleSupport;
+var ErrorBarCap = class extends BaseProperties14 {
+};
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "visible", 2);
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "stroke", 2);
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "lineDash", 2);
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "length", 2);
+__decorateClass([
+ Property42
+], ErrorBarCap.prototype, "lengthRatio", 2);
+var ErrorBarProperties = class extends BaseProperties14 {
+ constructor() {
+ super(...arguments);
+ this.visible = true;
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.cap = new ErrorBarCap();
+ }
+};
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "yLowerKey", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "yLowerName", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "yUpperKey", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "yUpperName", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "xLowerKey", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "xLowerName", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "xUpperKey", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "xUpperName", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "visible", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property42
+], ErrorBarProperties.prototype, "cap", 2);
+
+// packages/ag-charts-enterprise/src/features/error-bar/errorBar.ts
+var { fixNumericExtent, groupAccumulativeValueProperty, mergeDefaults: mergeDefaults2, valueProperty: valueProperty2, ChartAxisDirection: ChartAxisDirection12 } = import_ag_charts_community101._ModuleSupport;
+function toErrorBoundCartesianSeries(ctx) {
+ for (const supportedType of import_ag_charts_community101.AgErrorBarSupportedSeriesTypes) {
+ if (supportedType === ctx.series.type) {
+ return ctx.series;
+ }
+ }
+ throw new Error(
+ `AG Charts - unsupported series type '${ctx.series.type}', error bars supported series types: ${import_ag_charts_community101.AgErrorBarSupportedSeriesTypes.join(", ")}`
+ );
+}
+var ErrorBars = class _ErrorBars extends import_ag_charts_community101._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.properties = new ErrorBarProperties();
+ const series = toErrorBoundCartesianSeries(ctx);
+ const { annotationGroup, annotationSelections } = series;
+ this.cartesianSeries = series;
+ this.groupNode = new ErrorBarGroup({
+ name: `${annotationGroup.id}-errorBars`
+ });
+ annotationGroup.appendChild(this.groupNode);
+ this.selection = import_ag_charts_community101._ModuleSupport.Selection.select(this.groupNode, () => this.errorBarFactory());
+ annotationSelections.add(this.selection);
+ series.addEventListener("seriesVisibilityChange", (e) => this.onToggleSeriesItem(e));
+ this.cleanup.register(
+ series.events.on("data-processed", (e) => this.onDataProcessed(e)),
+ series.events.on("data-update", (e) => this.onDataUpdate(e)),
+ ctx.eventsHub.on("highlight:change", (event) => this.onHighlightChange(event)),
+ () => this.groupNode.remove(),
+ () => annotationSelections.delete(this.selection)
+ );
+ }
+ hasErrorBars() {
+ const { xLowerKey, xUpperKey, yLowerKey, yUpperKey } = this.properties;
+ return (0, import_ag_charts_core51.isDefined)(xLowerKey) && (0, import_ag_charts_core51.isDefined)(xUpperKey) || (0, import_ag_charts_core51.isDefined)(yLowerKey) && (0, import_ag_charts_core51.isDefined)(yUpperKey);
+ }
+ isStacked() {
+ const stackCount = this.cartesianSeries.seriesGrouping?.stackCount;
+ return stackCount == null ? false : stackCount > 0;
+ }
+ getUnstackPropertyDefinition(opts) {
+ const props = [];
+ const { xLowerKey, xUpperKey, yLowerKey, yUpperKey, xErrorsID, yErrorsID } = this.getMaybeFlippedKeys();
+ const { xScaleType, yScaleType } = opts;
+ if (yLowerKey != null && yUpperKey != null) {
+ props.push(
+ valueProperty2(yLowerKey, yScaleType, { id: `${yErrorsID}-lower` }),
+ valueProperty2(yUpperKey, yScaleType, { id: `${yErrorsID}-upper` })
+ );
+ }
+ if (xLowerKey != null && xUpperKey != null) {
+ props.push(
+ valueProperty2(xLowerKey, xScaleType, { id: `${xErrorsID}-lower` }),
+ valueProperty2(xUpperKey, xScaleType, { id: `${xErrorsID}-upper` })
+ );
+ }
+ return props;
+ }
+ getStackPropertyDefinition(opts) {
+ const props = [];
+ const { cartesianSeries } = this;
+ const { xLowerKey, xUpperKey, yLowerKey, yUpperKey, xErrorsID, yErrorsID } = this.getMaybeFlippedKeys();
+ const { xScaleType, yScaleType } = opts;
+ const groupIndex = cartesianSeries.seriesGrouping?.groupIndex ?? cartesianSeries.id;
+ const groupOpts = {
+ invalidValue: null,
+ missingValue: 0,
+ separateNegative: true,
+ ...cartesianSeries.visible ? {} : { forceValue: 0 }
+ };
+ const makeErrorProperty = (key, id, type, scaleType) => {
+ return groupAccumulativeValueProperty(
+ key,
+ "normal",
+ {
+ id: `${id}-${type}`,
+ groupId: `errorGroup-${groupIndex}-${type}`,
+ ...groupOpts
+ },
+ scaleType
+ );
+ };
+ const pushErrorProperties = (lowerKey, upperKey, id, scaleType) => {
+ props.push(
+ ...makeErrorProperty(lowerKey, id, "lower", scaleType),
+ ...makeErrorProperty(upperKey, id, "upper", scaleType)
+ );
+ };
+ if (yLowerKey != null && yUpperKey != null) {
+ pushErrorProperties(yLowerKey, yUpperKey, yErrorsID, yScaleType);
+ }
+ if (xLowerKey != null && xUpperKey != null) {
+ pushErrorProperties(xLowerKey, xUpperKey, xErrorsID, xScaleType);
+ }
+ return props;
+ }
+ getPropertyDefinitions(opts) {
+ if (this.isStacked()) {
+ return this.getStackPropertyDefinition(opts);
+ } else {
+ return this.getUnstackPropertyDefinition(opts);
+ }
+ }
+ onDataProcessed(event) {
+ this.dataModel = event.dataModel;
+ this.processedData = event.processedData;
+ }
+ getDomain(direction) {
+ const { xLowerKey, xUpperKey, xErrorsID, yLowerKey, yUpperKey, yErrorsID } = this.getMaybeFlippedKeys();
+ const hasAxisErrors = direction === ChartAxisDirection12.X ? (0, import_ag_charts_core51.isDefined)(xLowerKey) && (0, import_ag_charts_core51.isDefined)(xUpperKey) : (0, import_ag_charts_core51.isDefined)(yLowerKey) && (0, import_ag_charts_core51.isDefined)(yUpperKey);
+ if (hasAxisErrors) {
+ const { dataModel, processedData, cartesianSeries: series } = this;
+ if (dataModel != null && processedData != null) {
+ const id = { x: xErrorsID, y: yErrorsID }[direction];
+ const lowerDomain = dataModel.getDomain(series, `${id}-lower`, "value", processedData);
+ const upperDomain = dataModel.getDomain(series, `${id}-upper`, "value", processedData);
+ const domain = [Math.min(...lowerDomain, ...upperDomain), Math.max(...lowerDomain, ...upperDomain)];
+ return fixNumericExtent(domain);
+ }
+ }
+ return [];
+ }
+ onDataUpdate(event) {
+ this.dataModel = event.dataModel;
+ this.processedData = event.processedData;
+ if ((0, import_ag_charts_core51.isDefined)(event.dataModel) && (0, import_ag_charts_core51.isDefined)(event.processedData)) {
+ this.createNodeData();
+ this.update();
+ }
+ }
+ getNodeData() {
+ return this.hasErrorBars() ? this.cartesianSeries.contextNodeData?.nodeData : void 0;
+ }
+ createNodeData() {
+ const nodeData = this.getNodeData();
+ const xScale = this.cartesianSeries.axes[ChartAxisDirection12.X]?.scale;
+ const yScale = this.cartesianSeries.axes[ChartAxisDirection12.Y]?.scale;
+ if (!xScale || !yScale || !nodeData) {
+ return;
+ }
+ for (let i = 0; i < nodeData.length; i++) {
+ const { midPoint, xLower, xUpper, yLower, yUpper } = this.getDatum(nodeData, i);
+ if (midPoint != null) {
+ let xBar, yBar;
+ if ((0, import_ag_charts_core51.isDefined)(xLower) && (0, import_ag_charts_core51.isDefined)(xUpper)) {
+ xBar = {
+ lowerPoint: { x: this.convert(xScale, xLower), y: midPoint.y },
+ upperPoint: { x: this.convert(xScale, xUpper), y: midPoint.y }
+ };
+ }
+ if ((0, import_ag_charts_core51.isDefined)(yLower) && (0, import_ag_charts_core51.isDefined)(yUpper)) {
+ yBar = {
+ lowerPoint: { x: midPoint.x, y: this.convert(yScale, yLower) },
+ upperPoint: { x: midPoint.x, y: this.convert(yScale, yUpper) }
+ };
+ }
+ nodeData[i].xBar = xBar;
+ nodeData[i].yBar = yBar;
+ }
+ }
+ }
+ getMaybeFlippedKeys() {
+ let { xLowerKey, xUpperKey, yLowerKey, yUpperKey } = this.properties;
+ let [xErrorsID, yErrorsID] = ["xValue-errors", "yValue-errors"];
+ if (this.cartesianSeries.shouldFlipXY()) {
+ [xLowerKey, yLowerKey] = [yLowerKey, xLowerKey];
+ [xUpperKey, yUpperKey] = [yUpperKey, xUpperKey];
+ [xErrorsID, yErrorsID] = [yErrorsID, xErrorsID];
+ }
+ return { xLowerKey, xUpperKey, xErrorsID, yLowerKey, yUpperKey, yErrorsID };
+ }
+ static getDatumKey(nodeDatum, key, offset) {
+ if (key == null) {
+ return;
+ }
+ const datum = readDatum(nodeDatum);
+ const value = datum?.[key];
+ if (value == null) {
+ return;
+ }
+ if (typeof value !== "number") {
+ import_ag_charts_core51.Logger.warnOnce(`Found [${key}] error value of type ${typeof value}. Expected number type`);
+ return;
+ }
+ return value + offset;
+ }
+ getDatum(nodeData, datumIndex) {
+ const { xLowerKey, xUpperKey, yLowerKey, yUpperKey } = this.getMaybeFlippedKeys();
+ const datum = nodeData[datumIndex];
+ const d = datum.cumulativeValue == null || !this.isStacked() ? 0 : datum.cumulativeValue - datum.yValue;
+ const [xOffset, yOffset] = this.cartesianSeries.shouldFlipXY() ? [d, 0] : [0, d];
+ return {
+ midPoint: datum.midPoint,
+ xLower: _ErrorBars.getDatumKey(datum, xLowerKey, xOffset),
+ xUpper: _ErrorBars.getDatumKey(datum, xUpperKey, xOffset),
+ yLower: _ErrorBars.getDatumKey(datum, yLowerKey, yOffset),
+ yUpper: _ErrorBars.getDatumKey(datum, yUpperKey, yOffset)
+ };
+ }
+ convert(scale, value) {
+ const offset = (scale.bandwidth ?? 0) / 2;
+ return scale.convert(value) + offset;
+ }
+ update() {
+ const nodeData = this.getNodeData();
+ if (nodeData != null) {
+ this.selection.update(nodeData);
+ this.selection.each((node, datum, i) => this.updateNode(node, datum, i));
+ }
+ }
+ updateNode(node, datum, _index) {
+ node.datum = datum;
+ node.update(this.getDefaultStyle(), this.properties, this.cartesianSeries, false, "none");
+ node.updateBBoxes();
+ }
+ pickNodeExact(point) {
+ const { x, y } = point;
+ const node = this.groupNode.pickNode(x, y);
+ if (node != null) {
+ return { datum: node.datum, distanceSquared: 0 };
+ }
+ }
+ pickNodeNearest(point) {
+ return this.groupNode.nearestSquared(point.x, point.y);
+ }
+ pickNodeMainAxisFirst(point, majorDirection) {
+ let closestDatum;
+ let closestDistance = [Infinity, Infinity];
+ const referencePoints = [point.x, point.y];
+ if (majorDirection === ChartAxisDirection12.Y) {
+ referencePoints.reverse();
+ }
+ for (const child of this.groupNode.children()) {
+ const childBBox = child.getBBox();
+ const childReferencePoints = [childBBox.x + childBBox.width / 2, childBBox.y + childBBox.height / 2];
+ if (majorDirection === ChartAxisDirection12.Y) {
+ childReferencePoints.reverse();
+ }
+ const childDistances = [];
+ for (let i = 0; i < referencePoints.length; i++) {
+ childDistances.push(Math.abs(referencePoints[i] - childReferencePoints[i]));
+ }
+ if (childDistances[0] < closestDistance[0] || childDistances[0] == closestDistance[0] && childDistances[1] < closestDistance[1]) {
+ closestDatum = child.datum;
+ closestDistance = childDistances;
+ }
+ }
+ if (closestDatum) {
+ return {
+ datum: closestDatum,
+ distanceSquared: Math.pow(closestDistance[0], 2) + Math.pow(closestDistance[1], 2)
+ };
+ }
+ }
+ getTooltipParams() {
+ const {
+ xLowerKey,
+ xUpperKey,
+ yLowerKey,
+ yUpperKey,
+ xLowerName = xLowerKey,
+ xUpperName = xUpperKey,
+ yLowerName = yLowerKey,
+ yUpperName = yUpperKey
+ } = this.properties;
+ return { xLowerKey, xLowerName, xUpperKey, xUpperName, yLowerKey, yLowerName, yUpperKey, yUpperName };
+ }
+ onToggleSeriesItem(event) {
+ this.groupNode.visible = event.visible;
+ }
+ makeStyle(baseStyle) {
+ return {
+ visible: baseStyle.visible,
+ lineDash: baseStyle.lineDash,
+ lineDashOffset: baseStyle.lineDashOffset,
+ stroke: baseStyle.stroke,
+ strokeWidth: baseStyle.strokeWidth,
+ strokeOpacity: baseStyle.strokeOpacity,
+ cap: mergeDefaults2(this.properties.cap, baseStyle)
+ };
+ }
+ getDefaultStyle() {
+ return this.makeStyle(this.getWhiskerProperties());
+ }
+ getHighlightStyle() {
+ return this.makeStyle(this.getWhiskerProperties());
+ }
+ restyleHighlightChange(highlightChange, style, highlighted) {
+ const nodeData = this.getNodeData();
+ if (nodeData == null)
+ return;
+ for (let i = 0; i < nodeData.length; i++) {
+ if (highlightChange === nodeData[i]) {
+ this.selection.at(i)?.update(
+ style,
+ this.properties,
+ this.cartesianSeries,
+ highlighted,
+ highlighted ? "highlighted-item" : "unhighlighted-item"
+ );
+ break;
+ }
+ }
+ }
+ onHighlightChange(event) {
+ const { previousHighlight, currentHighlight } = event;
+ if (currentHighlight?.series === this.cartesianSeries) {
+ this.restyleHighlightChange(currentHighlight, this.getHighlightStyle(), true);
+ }
+ if (previousHighlight?.series === this.cartesianSeries) {
+ this.restyleHighlightChange(previousHighlight, this.getDefaultStyle(), false);
+ }
+ this.groupNode.opacity = this.cartesianSeries.getOpacity();
+ }
+ errorBarFactory() {
+ return new ErrorBarNode();
+ }
+ getWhiskerProperties() {
+ const { stroke: stroke2, strokeWidth, visible, strokeOpacity, lineDash, lineDashOffset } = this.properties;
+ return { stroke: stroke2, strokeWidth, visible, strokeOpacity, lineDash, lineDashOffset };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/error-bar/errorBarTheme.ts
+var ERROR_BARS_THEME = {
+ series: {
+ errorBar: {
+ visible: true,
+ stroke: { $ref: "foregroundColor" },
+ strokeWidth: 1,
+ strokeOpacity: 1,
+ cap: {
+ length: void 0,
+ lengthRatio: void 0
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/error-bar/errorBarModule.ts
+var ErrorBarsModule = {
+ type: "series-option",
+ identifier: "error-bars",
+ optionsKey: "errorBar",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ seriesTypes: import_ag_charts_community102.AgErrorBarSupportedSeriesTypes,
+ moduleFactory: (ctx) => new ErrorBars(ctx),
+ themeTemplate: ERROR_BARS_THEME
+};
+
+// packages/ag-charts-enterprise/src/features/foreground/foreground.ts
+var import_ag_charts_community103 = require("ag-charts-community");
+var { ZIndexMap: ZIndexMap6, ActionOnSet: ActionOnSet6, Property: Property43, ProxyPropertyOnWrite: ProxyPropertyOnWrite2 } = import_ag_charts_community103._ModuleSupport;
+var Foreground = class extends import_ag_charts_community103._ModuleSupport.Background {
+ constructor() {
+ super(...arguments);
+ this.image = new Image();
+ this.fill = "transparent";
+ this.fillOpacity = void 0;
+ }
+ createNode() {
+ return new import_ag_charts_community103._ModuleSupport.Group({ name: "foreground", zIndex: ZIndexMap6.FOREGROUND });
+ }
+ onLayoutComplete(event) {
+ super.onLayoutComplete(event);
+ const { width, height } = event.chart;
+ let placement = {
+ x: 0,
+ y: 0,
+ width,
+ height
+ };
+ if (this.image) {
+ placement = this.image.performLayout(width, height);
+ }
+ if (this.text) {
+ this.updateTextNode(placement);
+ }
+ }
+ onImageLoad() {
+ this.ctx.updateService.update(import_ag_charts_community103._ModuleSupport.ChartUpdateType.SCENE_RENDER);
+ }
+ updateTextNode(placement) {
+ const { textNode } = this;
+ textNode.fontWeight = "bold";
+ textNode.fontFamily = "Impact, sans-serif";
+ textNode.fontSize = 19;
+ textNode.opacity = 0.7;
+ textNode.fill = "#9b9b9b";
+ textNode.textBaseline = "top";
+ const textBBox = this.textNode.getBBox();
+ const textPadding = 10;
+ textNode.x = placement.x + placement.width / 2 - textBBox.width / 2;
+ textNode.y = placement.y + placement.height + textPadding;
+ }
+};
+__decorateClass([
+ Property43,
+ ActionOnSet6({
+ newValue(image) {
+ this.node.appendChild(image.node);
+ image.onLoad = () => this.onImageLoad();
+ },
+ oldValue(image) {
+ image.node.remove();
+ image.onLoad = void 0;
+ }
+ })
+], Foreground.prototype, "image", 2);
+__decorateClass([
+ Property43,
+ ProxyPropertyOnWrite2("rectNode", "fill")
+], Foreground.prototype, "fill", 2);
+__decorateClass([
+ Property43,
+ ProxyPropertyOnWrite2("rectNode", "fillOpacity")
+], Foreground.prototype, "fillOpacity", 2);
+
+// packages/ag-charts-enterprise/src/features/foreground/foregroundModule.ts
+var ForegroundModule = {
+ type: "root",
+ optionsKey: "foreground",
+ packageType: "enterprise",
+ chartTypes: ["cartesian", "polar", "topology", "standalone"],
+ moduleFactory: (ctx) => new Foreground(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/navigator.ts
+var import_ag_charts_community110 = require("ag-charts-community");
+var import_ag_charts_core54 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/navigator/miniChart.ts
+var import_ag_charts_community105 = require("ag-charts-community");
+var import_ag_charts_core52 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/navigator/shapes/miniChartGroup.ts
+var import_ag_charts_community104 = require("ag-charts-community");
+var { TranslatableGroup: TranslatableGroup3, SceneChangeDetection } = import_ag_charts_community104._ModuleSupport;
+var MiniChartGroup = class extends TranslatableGroup3 {
+ constructor() {
+ super(...arguments);
+ this.inset = 0;
+ this.cornerRadius = 0;
+ }
+ applyClip(ctx, clipRect) {
+ const { cornerRadius, inset } = this;
+ const { x, y, width, height } = clipRect;
+ const path = new Path2D();
+ path.roundRect(x + inset, y + inset, width - 2 * inset, height - 2 * inset, cornerRadius);
+ ctx.clip(path);
+ }
+};
+__decorateClass([
+ SceneChangeDetection()
+], MiniChartGroup.prototype, "inset", 2);
+__decorateClass([
+ SceneChangeDetection()
+], MiniChartGroup.prototype, "cornerRadius", 2);
+
+// packages/ag-charts-enterprise/src/features/navigator/miniChart.ts
+var { Property: Property44, ZIndexMap: ZIndexMap7, ActionOnSet: ActionOnSet7, CategoryAxis, Padding, Group: Group6, BBox: BBox7, ProxyProperty: ProxyProperty2, stackCartesianSeries } = import_ag_charts_community105._ModuleSupport;
+var MiniChartPadding = class {
+ constructor() {
+ this.top = 0;
+ this.bottom = 0;
+ }
+};
+__decorateClass([
+ Property44
+], MiniChartPadding.prototype, "top", 2);
+__decorateClass([
+ Property44
+], MiniChartPadding.prototype, "bottom", 2);
+var MiniChart = class extends import_ag_charts_community105._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = false;
+ this.padding = new MiniChartPadding();
+ this.root = new Group6({ name: "root" });
+ this.seriesRoot = this.root.appendChild(
+ new MiniChartGroup({ name: "Series-root", zIndex: ZIndexMap7.SERIES_LAYER, renderToOffscreenCanvas: true })
+ );
+ this.axisGridGroup = this.root.appendChild(new Group6({ name: "Axes-Grids", zIndex: ZIndexMap7.AXIS_GRID }));
+ this.axisGroup = this.root.appendChild(new Group6({ name: "Axes-Grids", zIndex: ZIndexMap7.AXIS_GRID }));
+ this.axisLabelGroup = this.root.appendChild(new Group6({ name: "Axes-Labels", zIndex: ZIndexMap7.SERIES_LABEL }));
+ this.axisCrosslineRangeGroup = this.root.appendChild(
+ new Group6({ name: "Axes-Crosslines-Range", zIndex: ZIndexMap7.SERIES_CROSSLINE_RANGE })
+ );
+ this.axisCrosslineLineGroup = this.root.appendChild(
+ new Group6({ name: "Axes-Crosslines-Line", zIndex: ZIndexMap7.SERIES_CROSSLINE_LINE })
+ );
+ this.axisCrosslineLabelGroup = this.root.appendChild(
+ new Group6({ name: "Axes-Crosslines-Label", zIndex: ZIndexMap7.SERIES_LABEL })
+ );
+ this.data = [];
+ this._destroyed = false;
+ this.miniChartAnimationPhase = "initial";
+ // Should be available after the first layout.
+ this.seriesRect = void 0;
+ this.axes = [];
+ this.series = [];
+ }
+ destroy() {
+ if (this._destroyed) {
+ return;
+ }
+ this.destroySeries(this.series);
+ for (const a of this.axes) {
+ a.destroy();
+ }
+ this.axes = [];
+ this._destroyed = true;
+ }
+ onSeriesChange(newValue, oldValue) {
+ const seriesToDestroy = oldValue?.filter((series) => !newValue.includes(series)) ?? [];
+ this.destroySeries(seriesToDestroy);
+ for (const series of newValue) {
+ if (oldValue?.includes(series))
+ continue;
+ series.attachSeries(this.seriesRoot, this.seriesRoot, void 0);
+ series.chart = {};
+ Object.defineProperty(series.chart, "mode", {
+ get: () => "standalone"
+ });
+ Object.defineProperty(series.chart, "isMiniChart", {
+ get: () => true
+ });
+ Object.defineProperty(series.chart, "seriesRect", {
+ get: () => this.seriesRect
+ });
+ series.resetAnimation(this.miniChartAnimationPhase === "initial" ? "initial" : "disabled");
+ }
+ this.seriesRect = void 0;
+ }
+ destroySeries(allSeries) {
+ if (allSeries) {
+ for (const series of allSeries) {
+ series.destroy();
+ series.detachSeries(this.seriesRoot, this.seriesRoot, void 0);
+ series.chart = void 0;
+ }
+ }
+ }
+ assignSeriesToAxes() {
+ for (const axis of this.axes) {
+ axis.boundSeries = this.series.filter((s) => {
+ const seriesAxis = s.axes[axis.direction];
+ return seriesAxis === axis;
+ });
+ }
+ }
+ assignAxesToSeries() {
+ const directionToAxesMap = {};
+ for (const axis of this.axes) {
+ const direction = axis.direction;
+ const directionAxes = directionToAxesMap[direction] ?? (directionToAxesMap[direction] = []);
+ directionAxes.push(axis);
+ }
+ for (const series of this.series) {
+ for (const direction of series.directions) {
+ const directionAxes = directionToAxesMap[direction];
+ if (!directionAxes) {
+ import_ag_charts_core52.Logger.warnOnce(
+ `no available axis for direction [${direction}]; check series and axes configuration.`
+ );
+ continue;
+ }
+ const seriesKeys = series.getKeys(direction);
+ const newAxis = this.findMatchingAxis(directionAxes, seriesKeys);
+ if (!newAxis) {
+ import_ag_charts_core52.Logger.warnOnce(
+ `no matching axis for direction [${direction}] and keys [${seriesKeys}]; check series and axes configuration.`
+ );
+ continue;
+ }
+ series.axes[direction] = newAxis;
+ }
+ }
+ }
+ findMatchingAxis(directionAxes, directionKeys) {
+ for (const axis of directionAxes) {
+ if (!axis.keys.length) {
+ return axis;
+ }
+ if (!directionKeys) {
+ continue;
+ }
+ for (const directionKey of directionKeys) {
+ if (axis.keys.includes(directionKey)) {
+ return axis;
+ }
+ }
+ }
+ }
+ updateData(data) {
+ for (const s of this.series) {
+ s.setChartData(data);
+ }
+ if (this.miniChartAnimationPhase === "initial") {
+ this.ctx.animationManager.onBatchStop(() => {
+ this.miniChartAnimationPhase = "ready";
+ for (const s of this.series) {
+ s.resetAnimation("disabled");
+ }
+ });
+ }
+ }
+ async processData(dataController) {
+ if (this.series.some((s) => s.canHaveAxes)) {
+ this.assignAxesToSeries();
+ this.assignSeriesToAxes();
+ }
+ await Promise.all(
+ this.series.map(async (s) => {
+ s.resetDatumCallbackCache();
+ return s.processData(dataController);
+ })
+ );
+ for (const axis of this.axes) {
+ axis.processData();
+ }
+ }
+ computeAxisPadding() {
+ const padding = new Padding();
+ if (!this.enabled) {
+ return padding;
+ }
+ for (const { position, thickness, line, label } of this.axes) {
+ if (position == null)
+ continue;
+ let size;
+ if (thickness) {
+ size = thickness;
+ } else {
+ size = (line.enabled ? line.width : 0) + (label.enabled ? (0, import_ag_charts_core52.calcLineHeight)(label.fontSize ?? 0) + label.spacing : 0);
+ }
+ padding[position] = Math.ceil(size);
+ }
+ return padding;
+ }
+ async layout(width, height) {
+ var _a;
+ const { padding } = this;
+ const animated = this.seriesRect != null;
+ const seriesRect = new BBox7(0, 0, width, height - (padding.top + padding.bottom));
+ const resized = this.seriesRect == null || this.seriesRect.width !== width || this.seriesRect.height !== height;
+ this.seriesRect = seriesRect;
+ this.seriesRoot.translationY = padding.top;
+ this.seriesRoot.setClipRectCanvasSpace(new BBox7(0, -padding.top, width, height));
+ for (const axis of this.axes) {
+ const { position = "left" } = axis;
+ switch (position) {
+ case "top":
+ case "bottom":
+ axis.range = [0, seriesRect.width];
+ axis.gridLength = seriesRect.height;
+ break;
+ case "right":
+ case "left": {
+ const isCategoryAxis = axis instanceof CategoryAxis;
+ axis.range = isCategoryAxis ? [0, seriesRect.height] : [seriesRect.height, 0];
+ axis.gridLength = seriesRect.width;
+ break;
+ }
+ }
+ axis.gridPadding = 0;
+ axis.translation.x = 0;
+ axis.translation.y = 0;
+ if (position === "right") {
+ axis.translation.x = width;
+ } else if (position === "bottom") {
+ axis.translation.y = height;
+ }
+ if (!animated) {
+ axis.resetAnimation("initial");
+ }
+ if (axis.crossLines) {
+ for (const crossLine of axis.crossLines) {
+ if (crossLine instanceof import_ag_charts_community105._ModuleSupport.CartesianCrossLine) {
+ crossLine.position = axis.position ?? "top";
+ (_a = crossLine.label).parallel ?? (_a.parallel = axis.label?.parallel);
+ }
+ }
+ }
+ axis.calculateLayout();
+ axis.update();
+ }
+ if (resized) {
+ stackCartesianSeries(this.series);
+ }
+ await Promise.all(this.series.map(async (series) => series.update({ seriesRect })));
+ }
+};
+__decorateClass([
+ Property44
+], MiniChart.prototype, "enabled", 2);
+__decorateClass([
+ ProxyProperty2(["seriesRoot", "inset"])
+], MiniChart.prototype, "inset", 2);
+__decorateClass([
+ ProxyProperty2(["seriesRoot", "cornerRadius"])
+], MiniChart.prototype, "cornerRadius", 2);
+__decorateClass([
+ ActionOnSet7({
+ changeValue(newValue, oldValue = []) {
+ const axisNodes = {
+ axisNode: this.axisGroup,
+ gridNode: this.axisGridGroup,
+ labelNode: this.axisLabelGroup,
+ crossLineLineNode: this.axisCrosslineLineGroup,
+ crossLineRangeNode: this.axisCrosslineRangeGroup,
+ crossLineLabelNode: this.axisCrosslineLabelGroup
+ };
+ for (const axis of oldValue) {
+ if (newValue.includes(axis))
+ continue;
+ axis.detachAxis();
+ axis.destroy();
+ }
+ for (const axis of newValue) {
+ if (oldValue?.includes(axis))
+ continue;
+ axis.attachAxis(axisNodes);
+ }
+ }
+ })
+], MiniChart.prototype, "axes", 2);
+__decorateClass([
+ ActionOnSet7({
+ changeValue(newValue, oldValue) {
+ this.onSeriesChange(newValue, oldValue);
+ }
+ })
+], MiniChart.prototype, "series", 2);
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorDOMProxy.ts
+var import_ag_charts_community106 = require("ag-charts-community");
+var import_ag_charts_core53 = require("ag-charts-core");
+var { SliderWidget } = import_ag_charts_community106._ModuleSupport;
+var NavigatorDOMProxy = class {
+ constructor(ctx, sliderHandlers) {
+ this.ctx = ctx;
+ this.sliderHandlers = sliderHandlers;
+ this._min = 0;
+ this._max = 1;
+ this.minRange = 1e-3;
+ this.dragStartX = 0;
+ this.ctx = ctx;
+ this.toolbar = ctx.proxyInteractionService.createProxyContainer({
+ type: "toolbar",
+ domManagerId: `navigator-toolbar`,
+ classList: ["ag-charts-proxy-navigator-toolbar"],
+ orientation: "vertical",
+ ariaLabel: { id: "ariaLabelNavigator" }
+ });
+ this.sliders = [
+ ctx.proxyInteractionService.createProxyElement({
+ type: "slider",
+ domIndex: 1,
+ ariaLabel: { id: "ariaLabelNavigatorMinimum" },
+ parent: this.toolbar,
+ cursor: "ew-resize"
+ }),
+ ctx.proxyInteractionService.createProxyElement({
+ type: "slider",
+ domIndex: -Infinity,
+ ariaLabel: { id: "ariaLabelNavigatorRange" },
+ parent: this.toolbar,
+ cursor: "grab"
+ }),
+ ctx.proxyInteractionService.createProxyElement({
+ type: "slider",
+ domIndex: 2,
+ ariaLabel: { id: "ariaLabelNavigatorMaximum" },
+ parent: this.toolbar,
+ cursor: "ew-resize"
+ })
+ ];
+ for (const [index, key] of ["min", "pan", "max"].entries()) {
+ const slider = this.sliders[index];
+ slider.step = SliderWidget.STEP_HUNDRETH;
+ slider.keyboardStep = SliderWidget.STEP_ONE;
+ slider.orientation = "horizontal";
+ slider.setPreventsDefault(false);
+ slider.addListener("drag-start", (ev) => this.onDragStart(index, ev, key));
+ slider.addListener("drag-move", (ev) => this.onDrag(slider, ev, key));
+ slider.addListener("drag-end", () => this.updateSliderRatios());
+ slider.addListener("contextmenu", (ev) => this.onContextMenu(slider, ev));
+ }
+ this.sliders[0].addListener("change", () => this.onMinSliderChange());
+ this.sliders[1].addListener("change", () => this.onPanSliderChange());
+ this.sliders[2].addListener("change", () => this.onMaxSliderChange());
+ this.updateSliderRatios();
+ this.updateVisibility(false);
+ }
+ destroy() {
+ this.toolbar.destroy();
+ }
+ updateVisibility(visible) {
+ this.toolbar.setHidden(!visible);
+ }
+ updateZoom() {
+ const { _min: min, _max: max } = this;
+ if (min == null || max == null)
+ return;
+ return this.ctx.zoomManager.updateZoom("navigator", { x: { min, max } });
+ }
+ updateBounds(bounds) {
+ this.toolbar.setBounds(bounds);
+ }
+ updateSliderBounds(sliderIndex, bounds) {
+ this.sliders[sliderIndex].setBounds(bounds);
+ }
+ updateMinMax(min, max) {
+ this._min = min;
+ this._max = max;
+ this.updateSliderRatios();
+ }
+ updateSliderRatios() {
+ let { _min: min, _max: max } = this;
+ min = Math.round(min * 100) / 100;
+ max = Math.round(max * 100) / 100;
+ const panAria = this.ctx.localeManager.t("ariaValuePanRange", { min, max });
+ this.sliders[0].setValueRatio(min);
+ this.sliders[1].setValueRatio(min, { ariaValueText: panAria });
+ this.sliders[2].setValueRatio(max);
+ }
+ toCanvasOffsets(event) {
+ return { offsetX: this.dragStartX + event.originDeltaX };
+ }
+ moveToFront(index) {
+ if (index === 1)
+ return;
+ const frontSlider = this.sliders[index];
+ const otherSlider = this.sliders[2 - index];
+ this.toolbar.moveChild(otherSlider, frontSlider.domIndex - 1);
+ }
+ onDragStart(index, event, key) {
+ const slider = this.sliders[index];
+ const toolbarLeft = this.toolbar.cssLeft();
+ const sliderLeft = slider.cssLeft();
+ this.dragStartX = toolbarLeft + sliderLeft + event.offsetX;
+ this.moveToFront(index);
+ event.sourceEvent.preventDefault();
+ this.sliderHandlers.onDragStart(key, this.toCanvasOffsets(event));
+ }
+ onDrag(_slider, event, key) {
+ event.sourceEvent.preventDefault();
+ this.sliderHandlers.onDrag(key, this.toCanvasOffsets(event));
+ }
+ onContextMenu(slider, widgetEvent) {
+ const { offsetX, offsetY } = widgetEvent;
+ const { x: toolbarX, y: toolbarY } = this.toolbar.getBounds();
+ const { x: sliderX, y: sliderY } = slider.getBounds();
+ const canvasX = offsetX + toolbarX + sliderX;
+ const canvasY = offsetY + toolbarY + sliderY;
+ this.ctx.contextMenuRegistry.dispatchContext("always", { widgetEvent, canvasX, canvasY }, void 0);
+ }
+ onPanSliderChange() {
+ const ratio3 = this.sliders[1].getValueRatio();
+ const span = this._max - this._min;
+ this._min = (0, import_ag_charts_core53.clamp)(0, ratio3, 1 - span);
+ this._max = this._min + span;
+ this.updateZoom();
+ }
+ onMinSliderChange() {
+ this._min = this.sliders[0].clampValueRatio(0, this._max - this.minRange);
+ this.updateZoom();
+ }
+ onMaxSliderChange() {
+ this._max = this.sliders[2].clampValueRatio(this._min + this.minRange, 1);
+ this.updateZoom();
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/shapes/rangeHandle.ts
+var import_ag_charts_community107 = require("ag-charts-community");
+var { Property: Property45, SceneChangeDetection: SceneChangeDetection2, BBox: BBox8, ExtendedPath2D } = import_ag_charts_community107._ModuleSupport;
+var RangeHandle = class extends import_ag_charts_community107._ModuleSupport.Path {
+ constructor() {
+ super(...arguments);
+ this.zIndex = 3;
+ this.centerX = 0;
+ this.centerY = 0;
+ this.width = 8;
+ this.height = 16;
+ this.cornerRadius = 4;
+ this.grip = true;
+ this.gripPath = new ExtendedPath2D();
+ }
+ setCenter(x, y) {
+ this.dirtyPath = true;
+ if (this.centerX !== x || this.centerY !== y) {
+ this.centerX = x;
+ this.centerY = y;
+ this.markDirty("center");
+ }
+ }
+ static align(minHandle, maxHandle, x, y, width, height, min, max, pixelAlign) {
+ const minHandleX = minHandle.align(x + width * min) + pixelAlign;
+ const maxHandleX = minHandleX + minHandle.align(x + width * min, width * (max - min)) - 2 * pixelAlign;
+ const handleY = minHandle.align(y + height / 2);
+ minHandle.setCenter(minHandleX, handleY);
+ maxHandle.setCenter(maxHandleX, handleY);
+ }
+ computeBBox() {
+ const { centerX, centerY, width, height } = this;
+ const x = centerX - width / 2;
+ const y = centerY - height / 2;
+ return new BBox8(x, y, width, height);
+ }
+ isPointInPath(x, y) {
+ const bbox = this.getBBox();
+ return bbox.containsPoint(x, y);
+ }
+ updatePath() {
+ const { centerX, centerY, path, gripPath, strokeWidth, cornerRadius, grip } = this;
+ const pixelAlign = strokeWidth / 2;
+ const pixelRatio = this.layerManager?.canvas?.pixelRatio ?? 1;
+ path.clear();
+ gripPath.clear();
+ const halfWidth = Math.floor(this.width / 2 * pixelRatio) / pixelRatio;
+ const halfHeight = Math.floor(this.height / 2 * pixelRatio) / pixelRatio;
+ path.roundRect(
+ centerX - halfWidth + pixelAlign,
+ centerY - halfHeight + pixelAlign,
+ 2 * (halfWidth - pixelAlign),
+ 2 * (halfHeight - pixelAlign),
+ cornerRadius
+ );
+ const gripSpacing = 3;
+ if (grip) {
+ for (let x = -0.5; x <= 0.5; x += 1) {
+ for (let y = -1; y <= 1; y += 1) {
+ gripPath.arc(centerX + x * gripSpacing, centerY + y * gripSpacing, 1, 0, 2 * Math.PI);
+ gripPath.closePath();
+ }
+ }
+ }
+ }
+ renderFill(ctx, path) {
+ const { stroke: stroke2 } = this;
+ super.renderFill(ctx, path);
+ ctx.fillStyle = typeof stroke2 === "string" ? stroke2 : "black";
+ ctx.fill(this.gripPath.getPath2D());
+ }
+};
+RangeHandle.className = "RangeHandle";
+__decorateClass([
+ Property45,
+ SceneChangeDetection2()
+], RangeHandle.prototype, "width", 2);
+__decorateClass([
+ Property45,
+ SceneChangeDetection2()
+], RangeHandle.prototype, "height", 2);
+__decorateClass([
+ Property45,
+ SceneChangeDetection2()
+], RangeHandle.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property45,
+ SceneChangeDetection2()
+], RangeHandle.prototype, "grip", 2);
+
+// packages/ag-charts-enterprise/src/features/navigator/shapes/rangeMask.ts
+var import_ag_charts_community108 = require("ag-charts-community");
+var { Path: Path6, BBox: BBox9, ExtendedPath2D: ExtendedPath2D2, clippedRoundRect, Property: Property46, SceneChangeDetection: SceneChangeDetection3 } = import_ag_charts_community108._ModuleSupport;
+var RangeMask = class extends Path6 {
+ constructor() {
+ super(...arguments);
+ this.cornerRadius = 4;
+ this.zIndex = 2;
+ this.x = 0;
+ this.y = 0;
+ this.width = 200;
+ this.height = 30;
+ this.min = 0;
+ this.max = 1;
+ this.visiblePath = new ExtendedPath2D2();
+ }
+ layout(x, y, width, height, min, max) {
+ min = Number.isNaN(min) ? this.min : min;
+ max = Number.isNaN(max) ? this.max : max;
+ if (x !== this.x || y !== this.y || width !== this.width || this.height !== height || min !== this.min || max !== this.max) {
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+ this.min = min;
+ this.max = max;
+ this.dirtyPath = true;
+ this.markDirty("RangeMask.layout");
+ }
+ }
+ computeBBox() {
+ const { x, y, width, height } = this;
+ return new BBox9(x, y, width, height);
+ }
+ computeVisibleRangeBBox() {
+ const { x, y, width, height, min, max } = this;
+ const minX = x + width * min;
+ const maxX = x + width * max;
+ return new BBox9(minX, y, maxX - minX, height);
+ }
+ updatePath() {
+ const { path, visiblePath, x, y, width, height, min, max, strokeWidth, cornerRadius } = this;
+ const pixelAlign = strokeWidth / 2;
+ path.clear();
+ visiblePath.clear();
+ const ax = this.align(x) + pixelAlign;
+ const ay = this.align(y) + pixelAlign;
+ const aw = this.align(x, width) - 2 * pixelAlign;
+ const ah = this.align(y, height) - 2 * pixelAlign;
+ const minX = this.align(x + width * min) + pixelAlign;
+ const maxX = minX + this.align(x + width * min, width * (max - min)) - 2 * pixelAlign;
+ const cornerRadiusParams = {
+ topLeft: cornerRadius,
+ topRight: cornerRadius,
+ bottomRight: cornerRadius,
+ bottomLeft: cornerRadius
+ };
+ const drawRect = (p, x0, x1) => {
+ if (x1 - x0 < 1)
+ return;
+ const bbox = new BBox9(x0, ay, x1 - x0, ah);
+ clippedRoundRect(p, ax, ay, aw, ah, cornerRadiusParams, bbox);
+ };
+ drawRect(path, ax, minX);
+ drawRect(path, maxX, aw + ax);
+ drawRect(visiblePath, minX, maxX);
+ }
+ renderStroke(ctx, path) {
+ super.renderStroke(ctx, path);
+ super.renderStroke(ctx, this.visiblePath.getPath2D());
+ }
+};
+RangeMask.className = "RangeMask";
+__decorateClass([
+ Property46,
+ SceneChangeDetection3()
+], RangeMask.prototype, "cornerRadius", 2);
+
+// packages/ag-charts-enterprise/src/features/navigator/shapes/rangeSelector.ts
+var import_ag_charts_community109 = require("ag-charts-community");
+var RangeSelector = class extends import_ag_charts_community109._ModuleSupport.Group {
+ constructor(children) {
+ super({ name: "rangeSelectorGroup", zIndex: import_ag_charts_community109._ModuleSupport.ZIndexMap.NAVIGATOR });
+ this.x = 0;
+ this.y = 0;
+ this.width = 200;
+ this.height = 30;
+ this.lOffset = 0;
+ this.rOffset = 0;
+ this.background = this.appendChild(
+ new import_ag_charts_community109._ModuleSupport.TranslatableGroup({ name: "navigator-background", zIndex: 1 })
+ );
+ this.append(children);
+ }
+ layout(x, y, width, height, lOffset, rOffset) {
+ this.x = x;
+ this.y = y;
+ this.width = width;
+ this.height = height;
+ this.lOffset = lOffset;
+ this.rOffset = rOffset;
+ this.background.translationX = x;
+ this.background.translationY = y;
+ this.markDirty("RangeSelector");
+ }
+ updateBackground(oldGroup, newGroup) {
+ if (oldGroup != null) {
+ oldGroup.remove();
+ }
+ if (newGroup != null) {
+ this.background.appendChild(newGroup);
+ }
+ this.markDirty("RangeSelector");
+ }
+ computeBBox() {
+ const { x, y, width, height, lOffset, rOffset } = this;
+ return new import_ag_charts_community109._ModuleSupport.BBox(x - lOffset, y, width + (lOffset + rOffset), height);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/navigator.ts
+var { BaseModuleInstance: BaseModuleInstance2, ObserveChanges: ObserveChanges3, Property: Property47 } = import_ag_charts_community110._ModuleSupport;
+var Navigator = class extends BaseModuleInstance2 {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = false;
+ this.mask = new RangeMask();
+ this.minHandle = new RangeHandle();
+ this.maxHandle = new RangeHandle();
+ this.maskVisibleRange = {
+ id: "navigator-mask-visible-range",
+ getBBox: () => this.mask.computeVisibleRangeBBox(),
+ toCanvasBBox: () => this.mask.computeVisibleRangeBBox(),
+ fromCanvasPoint: (x, y) => ({ x, y })
+ };
+ this.height = 30;
+ this.cornerRadius = 0;
+ this.spacing = 10;
+ this.x = 0;
+ this.y = 0;
+ this.width = 0;
+ this.rangeSelector = new RangeSelector([this.mask, this.minHandle, this.maxHandle]);
+ this.cleanup.register(
+ ctx.scene.attachNode(this.rangeSelector),
+ ctx.eventsHub.on("locale:change", () => this.updateZoom()),
+ ctx.layoutManager.registerElement(import_ag_charts_community110._ModuleSupport.LayoutElement.Navigator, (e) => this.onLayoutStart(e)),
+ ctx.eventsHub.on("layout:complete", (e) => this.onLayoutComplete(e)),
+ ctx.eventsHub.on("zoom:change", (event) => this.onZoomChange(event))
+ );
+ this.domProxy = new NavigatorDOMProxy(ctx, this);
+ this.updateGroupVisibility();
+ this.miniChart = new MiniChart(ctx);
+ }
+ updateBackground(oldGroup, newGroup) {
+ this.rangeSelector?.updateBackground(oldGroup, newGroup);
+ }
+ updateGroupVisibility() {
+ const { enabled } = this;
+ if (this.rangeSelector == null || enabled === this.rangeSelector.visible)
+ return;
+ this.rangeSelector.visible = enabled;
+ this.domProxy.updateVisibility(enabled);
+ if (enabled) {
+ this.updateZoom();
+ } else {
+ this.ctx.zoomManager.updateZoom("navigator");
+ }
+ }
+ onLayoutStart(ctx) {
+ if (this.enabled) {
+ const { layoutBox } = ctx;
+ const navigatorTotalHeight = this.height + this.spacing;
+ layoutBox.shrink(navigatorTotalHeight, "bottom");
+ this.y = layoutBox.y + layoutBox.height + this.spacing;
+ } else {
+ this.y = 0;
+ }
+ if (this.enabled && this.miniChart) {
+ const { top, bottom } = this.miniChart.computeAxisPadding();
+ ctx.layoutBox.shrink(top + bottom, "bottom");
+ this.y -= bottom;
+ this.miniChart.inset = this.mask.strokeWidth / 2;
+ this.miniChart.cornerRadius = this.mask.cornerRadius;
+ }
+ }
+ onLayoutComplete(opts) {
+ const { x, width } = opts.series.rect;
+ const { y, height } = this;
+ this.domProxy.updateVisibility(this.enabled);
+ if (this.enabled) {
+ const { _min: min, _max: max } = this.domProxy;
+ this.layoutNodes(x, y, width, height, min, max);
+ this.domProxy.updateBounds({ x, y, width, height });
+ }
+ this.x = x;
+ this.width = width;
+ this.miniChart?.layout(width, height).catch((e) => import_ag_charts_core54.Logger.error(e));
+ }
+ canDrag() {
+ return this.enabled && this.ctx.interactionManager.isState(import_ag_charts_community110._ModuleSupport.InteractionState.ZoomDraggable);
+ }
+ onDragStart(dragging, { offsetX }) {
+ if (!this.canDrag())
+ return;
+ if (dragging === "pan") {
+ this.panStart = (offsetX - this.x) / this.width - this.domProxy._min;
+ }
+ this.ctx.zoomManager.fireZoomPanStartEvent("navigator");
+ }
+ onDrag(dragging, { offsetX }) {
+ if (!this.canDrag())
+ return;
+ const { panStart, x, width } = this;
+ const { minRange } = this.domProxy;
+ let { _min: min, _max: max } = this.domProxy;
+ const ratio3 = (offsetX - x) / width;
+ if (dragging === "min") {
+ min = (0, import_ag_charts_core54.clamp)(0, ratio3, max - minRange);
+ } else if (dragging === "max") {
+ max = (0, import_ag_charts_core54.clamp)(min + minRange, ratio3, 1);
+ } else if (dragging === "pan" && panStart != null) {
+ const span = max - min;
+ min = (0, import_ag_charts_core54.clamp)(0, ratio3 - panStart, 1 - span);
+ max = min + span;
+ }
+ this.domProxy._min = min;
+ this.domProxy._max = max;
+ this.updateZoom();
+ }
+ onZoomChange(event) {
+ const { x: xZoom } = event;
+ if (!xZoom)
+ return;
+ const { x, y, width, height } = this;
+ const { min, max } = xZoom;
+ this.domProxy.updateMinMax(min, max);
+ this.layoutNodes(x, y, width, height, min, max);
+ }
+ layoutNodes(x, y, width, height, min, max) {
+ const { rangeSelector, mask, minHandle, maxHandle } = this;
+ mask.layout(x, y, width, height, min, max);
+ rangeSelector.layout(x, y, width, height, minHandle.width / 2, maxHandle.width / 2);
+ RangeHandle.align(minHandle, maxHandle, x, y, width, height, min, max, mask.strokeWidth / 2);
+ if (min + (max - min) / 2 < 0.5) {
+ minHandle.zIndex = 3;
+ maxHandle.zIndex = 4;
+ } else {
+ minHandle.zIndex = 4;
+ maxHandle.zIndex = 3;
+ }
+ for (const [index, node] of [minHandle, this.maskVisibleRange, maxHandle].entries()) {
+ const bbox = node.getBBox();
+ const tbox = { x: bbox.x - x, y: bbox.y - y, height: bbox.height, width: bbox.width };
+ this.domProxy.updateSliderBounds(index, tbox);
+ }
+ }
+ updateZoom() {
+ if (!this.enabled)
+ return;
+ this.domProxy.updateZoom();
+ }
+ updateData(data) {
+ return this.miniChart?.updateData(data);
+ }
+ async processData(dataController) {
+ if (this.miniChart) {
+ return this.miniChart?.processData(dataController);
+ }
+ }
+};
+__decorateClass([
+ ObserveChanges3((target, value, oldValue) => {
+ target.updateBackground(oldValue?.root, value?.root);
+ })
+], Navigator.prototype, "miniChart", 2);
+__decorateClass([
+ Property47,
+ ObserveChanges3((target, value) => {
+ target.ctx.zoomManager.setNavigatorEnabled(Boolean(value));
+ target.updateGroupVisibility();
+ })
+], Navigator.prototype, "enabled", 2);
+__decorateClass([
+ Property47
+], Navigator.prototype, "height", 2);
+__decorateClass([
+ Property47,
+ ObserveChanges3((target, value) => {
+ target.mask.cornerRadius = value;
+ })
+], Navigator.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property47
+], Navigator.prototype, "spacing", 2);
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorTheme.ts
+var import_ag_charts_community156 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorOptionsDefs.ts
+var import_ag_charts_community155 = require("ag-charts-community");
+var import_ag_charts_core65 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotModule.ts
+var import_ag_charts_community116 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeries.ts
+var import_ag_charts_community113 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/box-plot/blotPlotUtil.ts
+function prepareBoxPlotFromTo(isVertical) {
+ const from = isVertical ? { scalingX: 1, scalingY: 0 } : { scalingX: 0, scalingY: 1 };
+ const to = { scalingX: 1, scalingY: 1 };
+ return { from, to };
+}
+function resetBoxPlotSelectionsScalingCenterFn(isVertical) {
+ return (_node, datum) => {
+ if (isVertical) {
+ return { scalingCenterY: datum.scaledValues.medianValue };
+ }
+ return { scalingCenterX: datum.scaledValues.medianValue };
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotNode.ts
+var import_ag_charts_community111 = require("ag-charts-community");
+var {
+ Path: Path7,
+ Scalable,
+ ExtendedPath2D: ExtendedPath2D3,
+ SceneChangeDetection: SceneChangeDetection4,
+ SceneArrayChangeDetection,
+ BBox: BBox10,
+ clippedRoundRect: baseClippedRoundRect
+} = import_ag_charts_community111._ModuleSupport;
+var BoxPlotNode = class extends Scalable(Path7) {
+ constructor() {
+ super(...arguments);
+ this.wickPath = new ExtendedPath2D3();
+ this.horizontal = false;
+ this.center = 0;
+ this.thickness = 0;
+ this.min = 0;
+ this.q1 = 0;
+ this.median = 0;
+ this.q3 = 0;
+ this.max = 0;
+ this.cornerRadius = 0;
+ this.crisp = false;
+ this.strokeAlignment = 0;
+ this.wickStroke = void 0;
+ this.wickStrokeWidth = void 0;
+ this.wickStrokeOpacity = void 0;
+ this.capLengthRatio = 1;
+ this.wickStrokeAlignment = 0;
+ }
+ computeBBox() {
+ const { horizontal, center, thickness, min, max } = this;
+ return horizontal ? new BBox10(Math.min(min, max), center - thickness / 2, Math.abs(max - min), thickness) : new BBox10(center - thickness / 2, Math.min(min, max), thickness, Math.abs(max - min));
+ }
+ computeDefaultGradientFillBBox() {
+ const { horizontal, center, thickness, q1, q3 } = this;
+ return horizontal ? new BBox10(Math.min(q1, q3), center - thickness / 2, Math.abs(q3 - q1), thickness) : new BBox10(center - thickness / 2, Math.min(q1, q3), thickness, Math.abs(q3 - q1));
+ }
+ isPointInPath(x, y) {
+ return this.getBBox().containsPoint(x, y);
+ }
+ distanceSquared(x, y) {
+ return this.getBBox().distanceSquared(x, y);
+ }
+ get midPoint() {
+ return this.horizontal ? { x: (this.min + this.max) / 2, y: this.center } : { x: this.center, y: (this.min + this.max) / 2 };
+ }
+ alignedCoordinates() {
+ const { thickness, crisp } = this;
+ let { center, min, q1, median, q3, max } = this;
+ let x0 = center - thickness / 2;
+ let x1 = center + thickness / 2;
+ if (crisp && thickness > 1) {
+ min = this.align(min);
+ q1 = this.align(q1);
+ median = this.align(median);
+ q3 = this.align(q3);
+ max = min + this.align(min, max - min);
+ const halfWidth = this.align(thickness / 2);
+ center = this.align(center);
+ x0 = center - halfWidth;
+ x1 = center + halfWidth;
+ }
+ return { center, x0, x1, min, max, q1, median, q3 };
+ }
+ updatePath() {
+ const {
+ path,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke,
+ wickStrokeWidth,
+ wickStrokeOpacity,
+ wickLineDash,
+ wickLineDashOffset,
+ strokeAlignment,
+ cornerRadius,
+ capLengthRatio,
+ horizontal
+ } = this;
+ const { center, x0, x1, min, max, q1, median, q3 } = this.alignedCoordinates();
+ const pixelRatio = this.layerManager?.canvas.pixelRatio ?? 1;
+ const wickStrokeAlignment = this.wickStrokeAlignment > 0 ? pixelRatio / this.wickStrokeAlignment / 2 % 1 : 0;
+ this.path.clear();
+ this.wickPath.clear();
+ const needsWickPath = wickStroke != null && wickStroke !== stroke2 || wickStrokeWidth != null && wickStrokeWidth !== strokeWidth || wickStrokeOpacity != null && wickStrokeOpacity !== strokeOpacity || wickLineDash != null && wickLineDash !== lineDash || wickLineDashOffset != null && wickLineDashOffset !== lineDashOffset;
+ const wickPath = needsWickPath ? this.wickPath : path;
+ if (Math.abs(x1 - x0) <= 3) {
+ moveTo(wickPath, horizontal, center, min);
+ lineTo(wickPath, horizontal, center, max);
+ return;
+ }
+ const wickTop = Math.min(min, max);
+ const wickBottom = Math.max(min, max);
+ const boxTop = Math.min(q1, q3);
+ const boxBottom = Math.max(q1, q3);
+ const capX0 = center - Math.abs((x1 - x0) * capLengthRatio) / 2;
+ const capX1 = center + Math.abs((x1 - x0) * capLengthRatio) / 2;
+ moveTo(wickPath, horizontal, capX0, wickTop - wickStrokeAlignment);
+ lineTo(wickPath, horizontal, capX1, wickTop - wickStrokeAlignment);
+ moveTo(wickPath, horizontal, center - wickStrokeAlignment, wickTop - wickStrokeAlignment);
+ lineTo(wickPath, horizontal, center - wickStrokeAlignment, boxTop + strokeWidth / 2);
+ moveTo(wickPath, horizontal, center - wickStrokeAlignment, wickBottom + wickStrokeAlignment);
+ lineTo(wickPath, horizontal, center - wickStrokeAlignment, boxBottom - strokeWidth / 2);
+ moveTo(wickPath, horizontal, capX0, wickBottom + wickStrokeAlignment);
+ lineTo(wickPath, horizontal, capX1, wickBottom + wickStrokeAlignment);
+ const horizontalBoxStrokeAdjustment = strokeWidth / 2 + strokeAlignment;
+ const verticalBoxStrokeAdjustment = strokeWidth / 2 - strokeAlignment;
+ const rectHeight = boxBottom - boxTop - 2 * verticalBoxStrokeAdjustment;
+ if (rectHeight > 0) {
+ const rectX = x0 + horizontalBoxStrokeAdjustment;
+ const rectY = boxTop + verticalBoxStrokeAdjustment;
+ const rectWidth = x1 - x0 - 2 * horizontalBoxStrokeAdjustment;
+ const cornerRadii = {
+ topLeft: cornerRadius,
+ topRight: cornerRadius,
+ bottomRight: cornerRadius,
+ bottomLeft: cornerRadius
+ };
+ clippedRoundRect2(
+ path,
+ horizontal,
+ rectX,
+ rectY,
+ rectWidth,
+ rectHeight,
+ cornerRadii,
+ new BBox10(rectX, rectY, rectWidth, median - rectY)
+ );
+ clippedRoundRect2(
+ path,
+ horizontal,
+ rectX,
+ rectY,
+ rectWidth,
+ rectHeight,
+ cornerRadii,
+ new BBox10(rectX, median, rectWidth, rectY + rectHeight - median)
+ );
+ } else {
+ const boxMid = (boxTop + boxBottom) / 2;
+ moveTo(path, horizontal, x0, boxMid);
+ lineTo(path, horizontal, x1, boxMid);
+ }
+ }
+ drawPath(ctx) {
+ super.drawPath(ctx);
+ const { wickPath } = this;
+ if (wickPath.isEmpty())
+ return;
+ const {
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke = stroke2,
+ wickStrokeWidth = strokeWidth,
+ wickStrokeOpacity = strokeOpacity,
+ wickLineDash = lineDash,
+ wickLineDashOffset = lineDashOffset
+ } = this;
+ if (wickStrokeWidth === 0)
+ return;
+ ctx.globalAlpha *= wickStrokeOpacity;
+ if (typeof wickStroke === "string") {
+ ctx.strokeStyle = wickStroke;
+ }
+ ctx.lineWidth = wickStrokeWidth;
+ if (wickLineDash != null) {
+ ctx.setLineDash([...wickLineDash]);
+ }
+ ctx.lineDashOffset = wickLineDashOffset;
+ ctx.stroke(wickPath.getPath2D());
+ }
+};
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "horizontal", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "center", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "thickness", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "min", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "q1", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "median", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "q3", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "max", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "cornerRadius", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "crisp", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "strokeAlignment", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "wickStroke", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "wickStrokeWidth", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "wickStrokeOpacity", 2);
+__decorateClass([
+ SceneArrayChangeDetection()
+], BoxPlotNode.prototype, "wickLineDash", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "wickLineDashOffset", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "capLengthRatio", 2);
+__decorateClass([
+ SceneChangeDetection4()
+], BoxPlotNode.prototype, "wickStrokeAlignment", 2);
+function moveTo(path, horizontal, x, y) {
+ if (horizontal) {
+ path.moveTo(y, x);
+ } else {
+ path.moveTo(x, y);
+ }
+}
+function lineTo(path, horizontal, x, y) {
+ if (horizontal) {
+ path.lineTo(y, x);
+ } else {
+ path.lineTo(x, y);
+ }
+}
+function clippedRoundRect2(path, horizontal, x, y, width, height, cornerRadii, clipBBox) {
+ if (horizontal) {
+ baseClippedRoundRect(
+ // eslint-disable-next-line sonarjs/arguments-order
+ path,
+ y,
+ x,
+ height,
+ width,
+ cornerRadii,
+ clipBBox == null ? void 0 : new BBox10(clipBBox.y, clipBBox.x, clipBBox.height, clipBBox.width)
+ );
+ } else {
+ baseClippedRoundRect(path, x, y, width, height, cornerRadii, clipBBox);
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeriesProperties.ts
+var import_ag_charts_community112 = require("ag-charts-community");
+var { BaseProperties: BaseProperties15, AbstractBarSeriesProperties, makeSeriesTooltip, Property: Property48, mergeDefaults: mergeDefaults3 } = import_ag_charts_community112._ModuleSupport;
+var BoxPlotSeriesCap = class extends BaseProperties15 {
+ constructor() {
+ super(...arguments);
+ this.lengthRatio = 0.5;
+ }
+};
+__decorateClass([
+ Property48
+], BoxPlotSeriesCap.prototype, "lengthRatio", 2);
+var BoxPlotSeriesWhisker = class extends BaseProperties15 {
+};
+__decorateClass([
+ Property48
+], BoxPlotSeriesWhisker.prototype, "stroke", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesWhisker.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesWhisker.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesWhisker.prototype, "lineDash", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesWhisker.prototype, "lineDashOffset", 2);
+var BoxPlotSeriesProperties = class extends AbstractBarSeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.fill = "#c16068";
+ this.fillOpacity = 1;
+ this.stroke = "#333";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.cap = new BoxPlotSeriesCap();
+ this.whisker = new BoxPlotSeriesWhisker();
+ this.tooltip = makeSeriesTooltip();
+ }
+ toJson() {
+ const { stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ const properties = super.toJson();
+ properties.whisker = mergeDefaults3(properties.whisker, {
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ return properties;
+ }
+};
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "minKey", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "q1Key", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "medianKey", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "q3Key", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "maxKey", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "xName", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "yName", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "minName", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "q1Name", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "medianName", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "q3Name", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "maxName", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "styler", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "cap", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "whisker", 2);
+__decorateClass([
+ Property48
+], BoxPlotSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeries.ts
+var {
+ fixNumericExtent: fixNumericExtent2,
+ keyProperty: keyProperty2,
+ mergeDefaults: mergeDefaults4,
+ SeriesNodePickMode,
+ SMALLEST_KEY_INTERVAL,
+ valueProperty: valueProperty3,
+ diff,
+ animationValidation,
+ computeBarFocusBounds,
+ createDatumId,
+ HighlightState,
+ ContinuousScale: ContinuousScale4,
+ ChartAxisDirection: ChartAxisDirection13,
+ motion,
+ getItemStyles,
+ applyShapeFillBBox,
+ calculateSegments,
+ toHighlightString
+} = import_ag_charts_community113._ModuleSupport;
+var BoxPlotSeriesNodeEvent = class extends import_ag_charts_community113._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.minKey = series.properties.minKey;
+ this.q1Key = series.properties.q1Key;
+ this.medianKey = series.properties.medianKey;
+ this.q3Key = series.properties.q3Key;
+ this.maxKey = series.properties.maxKey;
+ }
+};
+var BoxPlotSeries = class extends import_ag_charts_community113._ModuleSupport.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode.NEAREST_NODE, SeriesNodePickMode.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["xKey"],
+ y: ["medianKey", "q1Key", "q3Key", "minKey", "maxKey"]
+ },
+ propertyNames: {
+ x: ["xName"],
+ y: ["medianName", "q1Name", "q3Name", "minName", "maxName"]
+ },
+ categoryKey: "xValue",
+ pathsPerSeries: []
+ });
+ this.properties = new BoxPlotSeriesProperties();
+ this.NodeEvent = BoxPlotSeriesNodeEvent;
+ }
+ async processData(dataController) {
+ if (!this.visible)
+ return;
+ const { xKey, minKey, q1Key, medianKey, q3Key, maxKey } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (animationEnabled && this.processedData) {
+ extraProps.push(diff(this.id, this.processedData));
+ }
+ if (animationEnabled) {
+ extraProps.push(animationValidation());
+ }
+ const { processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty2(xKey, xScaleType, { id: `xValue` }),
+ valueProperty3(minKey, yScaleType, { id: `minValue` }),
+ valueProperty3(q1Key, yScaleType, { id: `q1Value` }),
+ valueProperty3(medianKey, yScaleType, { id: `medianValue` }),
+ valueProperty3(q3Key, yScaleType, { id: `q3Value` }),
+ valueProperty3(maxKey, yScaleType, { id: `maxValue` }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL] : [],
+ ...extraProps
+ ]
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.animationState.transition("updateData");
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!(processedData && dataModel))
+ return [];
+ if (direction !== this.getBarDirection()) {
+ const { index, def } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const keys = processedData.domain.keys[index];
+ if (def.type === "key" && def.valueType === "category") {
+ return keys;
+ }
+ return this.padBandExtent(keys);
+ }
+ const yExtent = this.domainForClippedRange(direction, ["minValue", "maxValue"], "xValue");
+ return fixNumericExtent2(yExtent);
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection13.Y, ["maxValue", "minValue"], "xValue", visibleRange);
+ }
+ createNodeData() {
+ const { visible, dataModel, processedData } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(dataModel && processedData && xAxis && yAxis))
+ return;
+ const { xKey } = this.properties;
+ const nodeData = [];
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const minValues = dataModel.resolveColumnById(this, "minValue", processedData);
+ const q1Values = dataModel.resolveColumnById(this, "q1Value", processedData);
+ const medianValues = dataModel.resolveColumnById(this, "medianValue", processedData);
+ const q3Values = dataModel.resolveColumnById(this, "q3Value", processedData);
+ const maxValues = dataModel.resolveColumnById(this, "maxValue", processedData);
+ const { barWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const barOffset = ContinuousScale4.is(xAxis.scale) ? barWidth * -0.5 : 0;
+ const { groupScale } = this;
+ const isVertical = this.isVertical();
+ const segments = calculateSegments(
+ this.properties.segmentation,
+ xAxis,
+ yAxis,
+ this.chart.seriesRect,
+ this.ctx.scene
+ );
+ const context = {
+ itemId: xKey,
+ nodeData,
+ labelData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStyles(this.getItemStyle.bind(this)),
+ segments
+ };
+ if (!visible)
+ return context;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ continue;
+ const minValue = minValues[datumIndex];
+ const q1Value = q1Values[datumIndex];
+ const medianValue = medianValues[datumIndex];
+ const q3Value = q3Values[datumIndex];
+ const maxValue = maxValues[datumIndex];
+ if ([minValue, q1Value, medianValue, q3Value, maxValue].some((value) => typeof value !== "number") || minValue > q1Value || q1Value > medianValue || medianValue > q3Value || q3Value > maxValue) {
+ continue;
+ }
+ const scaledValues = {
+ xValue: xAxis.scale.convert(xValue2),
+ minValue: yAxis.scale.convert(minValue),
+ q1Value: yAxis.scale.convert(q1Value),
+ medianValue: yAxis.scale.convert(medianValue),
+ q3Value: yAxis.scale.convert(q3Value),
+ maxValue: yAxis.scale.convert(maxValue)
+ };
+ const bandwidth = barWidth;
+ scaledValues.xValue += groupScale.convert(String(groupIndex)) + barOffset + bandwidth / 2;
+ const height = Math.abs(scaledValues.q3Value - scaledValues.q1Value);
+ const midX = scaledValues.xValue;
+ const midY = Math.min(scaledValues.q3Value, scaledValues.q1Value) + height / 2;
+ const midPoint = {
+ x: isVertical ? midX : midY,
+ y: isVertical ? midY : midX
+ };
+ let focusRect;
+ if (isVertical) {
+ focusRect = {
+ x: midPoint.x - bandwidth / 2,
+ y: scaledValues.minValue,
+ width: bandwidth,
+ height: scaledValues.maxValue - scaledValues.minValue
+ };
+ } else {
+ focusRect = {
+ x: scaledValues.minValue,
+ y: midPoint.y - bandwidth / 2,
+ width: scaledValues.maxValue - scaledValues.minValue,
+ height: bandwidth
+ };
+ }
+ nodeData.push({
+ series: this,
+ itemId: xValue2,
+ datum,
+ datumIndex,
+ xKey,
+ bandwidth,
+ scaledValues,
+ midPoint,
+ focusRect
+ });
+ }
+ return context;
+ }
+ legendItemSymbol() {
+ const { fill, stroke: stroke2, strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset } = this.getStyle(
+ false,
+ false,
+ HighlightState.None
+ );
+ return {
+ marker: {
+ fill: import_ag_charts_community113._ModuleSupport.deepClone(fill),
+ fillOpacity,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ id: seriesId,
+ ctx: { legendManager },
+ visible
+ } = this;
+ const { xKey, yName, showInLegend, legendItemName } = this.properties;
+ if (!xKey || legendType !== "category") {
+ return [];
+ }
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: seriesId }),
+ label: {
+ text: legendItemName ?? yName ?? seriesId
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const {
+ xKey,
+ xName,
+ yName,
+ medianKey,
+ medianName,
+ q1Key,
+ q1Name,
+ q3Key,
+ q3Name,
+ minKey,
+ minName,
+ maxKey,
+ maxName,
+ legendItemName,
+ tooltip
+ } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const minValue = dataModel.resolveColumnById(this, `minValue`, processedData)[datumIndex];
+ const q1Value = dataModel.resolveColumnById(this, `q1Value`, processedData)[datumIndex];
+ const medianValue = dataModel.resolveColumnById(this, `medianValue`, processedData)[datumIndex];
+ const q3Value = dataModel.resolveColumnById(this, `q3Value`, processedData)[datumIndex];
+ const maxValue = dataModel.resolveColumnById(this, `maxValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const format = this.getItemStyle(datumIndex, false);
+ const data = [
+ {
+ label: minName,
+ fallbackLabel: minKey,
+ value: this.getAxisValueText(yAxis, "tooltip", minValue, datum, minKey, legendItemName)
+ },
+ {
+ label: q1Name,
+ fallbackLabel: q1Key,
+ value: this.getAxisValueText(yAxis, "tooltip", q1Value, datum, q1Key, legendItemName)
+ },
+ {
+ label: medianName,
+ fallbackLabel: medianKey,
+ value: this.getAxisValueText(yAxis, "tooltip", medianValue, datum, medianKey, legendItemName)
+ },
+ {
+ label: q3Name,
+ fallbackLabel: q3Key,
+ value: this.getAxisValueText(yAxis, "tooltip", q3Value, datum, q3Key, legendItemName)
+ },
+ {
+ label: maxName,
+ fallbackLabel: maxKey,
+ value: this.getAxisValueText(yAxis, "tooltip", maxValue, datum, maxKey, legendItemName)
+ }
+ ];
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ title: legendItemName ?? yName,
+ symbol: this.legendItemSymbol(),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ xKey,
+ xName,
+ yName,
+ medianKey,
+ medianName,
+ q1Key,
+ q1Name,
+ q3Key,
+ q3Name,
+ minKey,
+ minName,
+ maxKey,
+ maxName,
+ ...format
+ }
+ );
+ }
+ animateEmptyUpdateReady({
+ datumSelection
+ }) {
+ const isVertical = this.isVertical();
+ const { from, to } = prepareBoxPlotFromTo(isVertical);
+ motion.resetMotion([datumSelection], resetBoxPlotSelectionsScalingCenterFn(isVertical));
+ motion.staticFromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], from, to, {
+ phase: "initial"
+ });
+ }
+ isLabelEnabled() {
+ return false;
+ }
+ updateDatumSelection(opts) {
+ const data = opts.nodeData ?? [];
+ return opts.datumSelection.update(data);
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { id: seriesId } = this;
+ const {
+ cornerRadius,
+ cap: { lengthRatio },
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ maxKey,
+ maxName,
+ medianKey,
+ medianName,
+ minKey,
+ minName,
+ q1Key,
+ q1Name,
+ q3Key,
+ q3Name,
+ whisker: {
+ lineDash: whiskerLineDash,
+ lineDashOffset: whiskerLineDashOffset,
+ stroke: whiskerStroke,
+ strokeOpacity: whiskerStrokeOpacity,
+ strokeWidth: whiskerStrokeWidth
+ },
+ xKey,
+ xName,
+ yName
+ } = this.properties;
+ const highlightState = toHighlightString(highlightStateEnum ?? HighlightState.None);
+ return {
+ cap: { lengthRatio },
+ cornerRadius,
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ lineDash,
+ lineDashOffset,
+ maxKey,
+ maxName: maxName ?? maxKey,
+ medianKey,
+ medianName: medianName ?? medianKey,
+ minKey,
+ minName: minName ?? minKey,
+ q1Key,
+ q1Name: q1Name ?? q1Key,
+ q3Key,
+ q3Name: q3Name ?? q3Key,
+ seriesId,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ whisker: {
+ lineDash: whiskerLineDash ?? lineDash,
+ lineDashOffset: whiskerLineDashOffset ?? lineDashOffset,
+ stroke: whiskerStroke ?? stroke2,
+ strokeOpacity: whiskerStrokeOpacity ?? strokeOpacity,
+ strokeWidth: whiskerStrokeWidth ?? strokeWidth
+ },
+ xKey,
+ xName: xName ?? xKey,
+ yName
+ };
+ }
+ getStyle(ignoreStylerCallback, highlighted, highlightState) {
+ const {
+ cap,
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ styler,
+ whisker
+ } = this.properties;
+ let stylerResult = {};
+ if (!ignoreStylerCallback && styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ stylerResult = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ return {
+ cornerRadius: stylerResult.cornerRadius ?? cornerRadius,
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ opacity: 1,
+ stroke: stylerResult.stroke ?? stroke2,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth,
+ cap: { lengthRatio: stylerResult.cap?.lengthRatio ?? cap.lengthRatio },
+ whisker: {
+ lineDash: stylerResult.whisker?.lineDash ?? whisker.lineDash,
+ lineDashOffset: stylerResult.whisker?.lineDashOffset ?? whisker.lineDashOffset,
+ stroke: stylerResult.whisker?.stroke ?? whisker.stroke,
+ strokeOpacity: stylerResult.whisker?.strokeOpacity ?? whisker.strokeOpacity,
+ strokeWidth: stylerResult.whisker?.strokeWidth ?? whisker.strokeWidth
+ }
+ };
+ }
+ getItemStyle(datumIndex, isHighlight, highlightState) {
+ const { properties } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ let style = mergeDefaults4(highlightStyle, this.getStyle(datumIndex === void 0, isHighlight, highlightState));
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datumIndex, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults4(overrides, style);
+ }
+ }
+ const { stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = style;
+ style.whisker = mergeDefaults4(style.whisker, {
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ return style;
+ }
+ makeItemStylerParams(datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const { xKey, minKey, q1Key, medianKey, q3Key, maxKey } = this.properties;
+ const datum = this.processedData?.dataSources.get(seriesId)?.data[datumIndex];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ xKey,
+ minKey,
+ q1Key,
+ medianKey,
+ q3Key,
+ maxKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ datumSelection.each((_, nodeDatum) => {
+ const highlightState = this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex);
+ nodeDatum.style = this.getItemStyle(nodeDatum.datumIndex, isHighlight, highlightState);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData, properties } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const isVertical = this.isVertical();
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const fillBBox = this.getShapeFillBBox();
+ const strokeAlignment = this.getStyle(false, false, HighlightState.None).strokeWidth / 2;
+ const wickStrokeAlignment = properties.whisker.strokeWidth ?? properties.strokeWidth;
+ datumSelection.each((boxPlotNode, nodeDatum) => {
+ const style = nodeDatum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex)];
+ applyShapeFillBBox(boxPlotNode, style.fill, fillBBox);
+ boxPlotNode.fill = style.fill;
+ boxPlotNode.fillOpacity = style.fillOpacity;
+ boxPlotNode.stroke = style.stroke;
+ boxPlotNode.strokeWidth = style.strokeWidth;
+ boxPlotNode.strokeOpacity = style.strokeOpacity;
+ boxPlotNode.lineDash = style.lineDash;
+ boxPlotNode.lineDashOffset = style.lineDashOffset;
+ boxPlotNode.wickStroke = style.whisker.stroke;
+ boxPlotNode.wickStrokeWidth = style.whisker.strokeWidth;
+ boxPlotNode.wickStrokeOpacity = style.whisker.strokeOpacity;
+ boxPlotNode.wickLineDash = style.whisker.lineDash;
+ boxPlotNode.wickLineDashOffset = style.whisker.lineDashOffset;
+ boxPlotNode.cornerRadius = style.cornerRadius;
+ boxPlotNode.crisp = true;
+ boxPlotNode.horizontal = !isVertical;
+ boxPlotNode.center = nodeDatum.scaledValues.xValue;
+ boxPlotNode.thickness = nodeDatum.bandwidth;
+ boxPlotNode.min = nodeDatum.scaledValues.minValue;
+ boxPlotNode.q1 = nodeDatum.scaledValues.q1Value;
+ boxPlotNode.median = nodeDatum.scaledValues.medianValue;
+ boxPlotNode.q3 = nodeDatum.scaledValues.q3Value;
+ boxPlotNode.max = nodeDatum.scaledValues.maxValue;
+ boxPlotNode.capLengthRatio = style.cap.lengthRatio;
+ boxPlotNode.strokeAlignment = strokeAlignment;
+ boxPlotNode.wickStrokeAlignment = wickStrokeAlignment;
+ });
+ }
+ updateLabelNodes() {
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ return labelSelection.update(labelData);
+ }
+ nodeFactory() {
+ return new BoxPlotNode();
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds(this, this.contextNodeData?.nodeData[datumIndex].focusRect);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null;
+ }
+};
+BoxPlotSeries.className = "BoxPlotSeries";
+BoxPlotSeries.type = "box-plot";
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotSeriesOptionsDef.ts
+var import_ag_charts_community114 = require("ag-charts-community");
+var import_ag_charts_core55 = require("ag-charts-core");
+var { boxPlotSeriesThemeableOptionsDef, commonSeriesOptionsDefs } = import_ag_charts_community114._ModuleSupport;
+var boxPlotSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs,
+ ...boxPlotSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core55.required)((0, import_ag_charts_core55.constant)("box-plot")),
+ xKey: (0, import_ag_charts_core55.required)(import_ag_charts_core55.string),
+ minKey: (0, import_ag_charts_core55.required)(import_ag_charts_core55.string),
+ q1Key: (0, import_ag_charts_core55.required)(import_ag_charts_core55.string),
+ medianKey: (0, import_ag_charts_core55.required)(import_ag_charts_core55.string),
+ q3Key: (0, import_ag_charts_core55.required)(import_ag_charts_core55.string),
+ maxKey: (0, import_ag_charts_core55.required)(import_ag_charts_core55.string),
+ xName: import_ag_charts_core55.string,
+ yName: import_ag_charts_core55.string,
+ minName: import_ag_charts_core55.string,
+ q1Name: import_ag_charts_core55.string,
+ medianName: import_ag_charts_core55.string,
+ q3Name: import_ag_charts_core55.string,
+ maxName: import_ag_charts_core55.string,
+ grouped: import_ag_charts_core55.boolean,
+ legendItemName: import_ag_charts_core55.string,
+ segmentation: import_ag_charts_core55.shapeSegmentation
+};
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotThemes.ts
+var import_ag_charts_community115 = require("ag-charts-community");
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE },
+ multiSeriesHighlightStyle,
+ FILL_GRADIENT_LINEAR_DEFAULTS,
+ FILL_IMAGE_DEFAULTS,
+ FILL_PATTERN_DEFAULTS,
+ SAFE_FILL_OPERATION,
+ SEGMENTATION_DEFAULTS
+} = import_ag_charts_community115._ModuleSupport;
+var BOX_PLOT_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ {
+ $if: [
+ {
+ $or: [
+ { $isGradient: { $palette: "fill" } },
+ { $isPattern: { $palette: "fill" } },
+ { $isImage: { $palette: "fill" } }
+ ]
+ },
+ { $palette: "fill" },
+ { $mix: [SAFE_FILL_OPERATION, { $ref: "chartBackgroundColor" }, 0.7] }
+ ]
+ },
+ ["gradient", FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", FILL_IMAGE_DEFAULTS],
+ ["pattern", FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ strokeWidth: 2,
+ fillOpacity: 1,
+ strokeOpacity: 1,
+ lineDash: void 0,
+ lineDashOffset: 0,
+ highlight: multiSeriesHighlightStyle(),
+ segmentation: SEGMENTATION_DEFAULTS
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE.NUMBER]: {
+ crosshair: {
+ snap: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE.CATEGORY]: {
+ groupPaddingInner: 0.2,
+ crosshair: {
+ enabled: false,
+ snap: false
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/box-plot/boxPlotModule.ts
+var BoxPlotModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "box-plot",
+ moduleFactory: (ctx) => new BoxPlotSeries(ctx),
+ predictAxis: import_ag_charts_community116._ModuleSupport.predictCartesianTimeAxis,
+ defaultAxes: import_ag_charts_community116._ModuleSupport.DIRECTION_SWAP_AXES,
+ themeTemplate: BOX_PLOT_SERIES_THEME,
+ groupable: true
+};
+var BoxPlotSeriesModule = {
+ type: "series",
+ name: "box-plot",
+ chartType: "cartesian",
+ enterprise: true,
+ options: boxPlotSeriesOptionsDef,
+ create: (ctx) => new BoxPlotSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickModule.ts
+var import_ag_charts_community126 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeries.ts
+var import_ag_charts_community123 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesBase.ts
+var import_ag_charts_community118 = require("ag-charts-community");
+var import_ag_charts_core56 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcAggregation.ts
+var import_ag_charts_community117 = require("ag-charts-community");
+var {
+ AGGREGATION_SPAN,
+ AGGREGATION_INDEX_X_MAX,
+ AGGREGATION_INDEX_X_MIN,
+ AGGREGATION_INDEX_Y_MAX,
+ AGGREGATION_INDEX_Y_MIN,
+ aggregationDomain,
+ aggregationRangeFittingPoints,
+ compactAggregationIndices,
+ createAggregationIndices
+} = import_ag_charts_community117._ModuleSupport;
+var AGGREGATION_THRESHOLD = 1e3;
+var OPEN = AGGREGATION_INDEX_X_MIN;
+var HIGH = AGGREGATION_INDEX_Y_MAX;
+var LOW = AGGREGATION_INDEX_Y_MIN;
+var CLOSE = AGGREGATION_INDEX_X_MAX;
+function aggregateOhlcData(scale, xValues, highValues, lowValues, domain, smallestKeyInterval) {
+ if (xValues.length < AGGREGATION_THRESHOLD)
+ return;
+ const [d0, d1] = aggregationDomain(scale, domain);
+ let maxRange = aggregationRangeFittingPoints(xValues, d0, d1, { smallestKeyInterval });
+ let { indexData, valueData } = createAggregationIndices(xValues, highValues, lowValues, d0, d1, maxRange);
+ const filters = [{ maxRange, indexData }];
+ while (maxRange > 64) {
+ ({ indexData, valueData, maxRange } = compactAggregationIndices(indexData, valueData, maxRange));
+ filters.push({ maxRange, indexData });
+ }
+ filters.reverse();
+ return filters;
+}
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesBase.ts
+var {
+ fixNumericExtent: fixNumericExtent3,
+ keyProperty: keyProperty3,
+ createDatumId: createDatumId2,
+ SeriesNodePickMode: SeriesNodePickMode2,
+ ChartAxisDirection: ChartAxisDirection14,
+ SMALLEST_KEY_INTERVAL: SMALLEST_KEY_INTERVAL2,
+ valueProperty: valueProperty4,
+ diff: diff2,
+ animationValidation: animationValidation2,
+ computeBarFocusBounds: computeBarFocusBounds2,
+ visibleRangeIndices,
+ BandScale,
+ processedDataIsAnimatable,
+ mergeDefaults: mergeDefaults5,
+ simpleMemorize2,
+ getItemStylesPerItemId
+} = import_ag_charts_community118._ModuleSupport;
+var memoizedAggregateOhlcData = simpleMemorize2(aggregateOhlcData);
+var OhlcSeriesNodeEvent = class extends import_ag_charts_community118._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.openKey = series.properties.openKey;
+ this.closeKey = series.properties.closeKey;
+ this.highKey = series.properties.highKey;
+ this.lowKey = series.properties.lowKey;
+ }
+};
+var OhlcSeriesBase = class extends import_ag_charts_community118._ModuleSupport.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode2.AXIS_ALIGNED, SeriesNodePickMode2.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["xKey"],
+ y: ["lowKey", "highKey", "openKey", "closeKey"]
+ },
+ propertyNames: {
+ x: ["xName"],
+ y: ["lowName", "highName", "openName", "closeName"]
+ },
+ categoryKey: "xValue",
+ pathsPerSeries: []
+ });
+ this.NodeEvent = OhlcSeriesNodeEvent;
+ this.dataAggregationFilters = void 0;
+ }
+ async processData(dataController) {
+ if (!this.visible)
+ return;
+ const { xKey, openKey, closeKey, highKey, lowKey } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (animationEnabled) {
+ if (this.processedData) {
+ extraProps.push(diff2(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation2());
+ }
+ if (openKey) {
+ extraProps.push(
+ valueProperty4(openKey, yScaleType, {
+ id: `openValue`,
+ invalidValue: void 0,
+ missingValue: void 0
+ })
+ );
+ }
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty3(xKey, xScaleType, { id: `xValue` }),
+ valueProperty4(closeKey, yScaleType, { id: `closeValue` }),
+ valueProperty4(highKey, yScaleType, { id: `highValue` }),
+ valueProperty4(lowKey, yScaleType, { id: `lowValue` }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL2] : [],
+ ...extraProps
+ ]
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.dataAggregationFilters = this.aggregateData(
+ dataModel,
+ processedData
+ );
+ this.animationState.transition("updateData");
+ }
+ aggregateData(dataModel, processedData) {
+ if (processedData.type !== "ungrouped")
+ return;
+ if (processedDataIsAnimatable(processedData))
+ return;
+ const xAxis = this.axes[ChartAxisDirection14.X];
+ if (xAxis == null)
+ return;
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const highValues = dataModel.resolveColumnById(this, `highValue`, processedData);
+ const lowValues = dataModel.resolveColumnById(this, `lowValue`, processedData);
+ const { index } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const domain = processedData.domain.keys[index];
+ return memoizedAggregateOhlcData(
+ xAxis.scale.type,
+ xValues,
+ highValues,
+ lowValues,
+ domain,
+ processedData.reduced?.smallestKeyInterval
+ );
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!(processedData && dataModel))
+ return [];
+ if (direction !== this.getBarDirection()) {
+ const { index, def } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const keys = processedData.domain.keys[index];
+ if (def.type === "key" && def.valueType === "category") {
+ return keys;
+ }
+ return this.padBandExtent(keys);
+ }
+ const yExtent = this.domainForClippedRange(direction, ["highValue", "lowValue"], "xValue");
+ return fixNumericExtent3(yExtent);
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection14.Y, ["highValue", "lowValue"], "xValue", visibleRange);
+ }
+ getZoomRangeFittingItems(xVisibleRange, yVisibleRange, minVisibleItems) {
+ return this.zoomFittingVisibleItems(
+ "xValue",
+ ["highValue", "lowValue"],
+ xVisibleRange,
+ yVisibleRange,
+ minVisibleItems
+ );
+ }
+ getVisibleItems(xVisibleRange, yVisibleRange, minVisibleItems) {
+ return this.countVisibleItems(
+ "xValue",
+ ["highValue", "lowValue"],
+ xVisibleRange,
+ yVisibleRange,
+ minVisibleItems
+ );
+ }
+ createNodeData() {
+ const { visible, dataModel, processedData } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(dataModel && processedData && xAxis && yAxis))
+ return;
+ const nodeData = [];
+ const { xKey, highKey, lowKey } = this.properties;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const openValues = dataModel.resolveColumnById(this, "openValue", processedData);
+ const closeValues = dataModel.resolveColumnById(this, "closeValue", processedData);
+ const highValues = dataModel.resolveColumnById(this, "highValue", processedData);
+ const lowValues = dataModel.resolveColumnById(this, "lowValue", processedData);
+ const { groupScale } = this;
+ const { barWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const groupOffset = groupScale.convert(String(groupIndex));
+ const effectiveBarWidth = barWidth >= 1 ? barWidth : groupScale.rawBandwidth;
+ const applyWidthOffset = BandScale.is(xAxis.scale);
+ const context = {
+ itemId: xKey,
+ nodeData,
+ labelData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStylesPerItemId(this.getItemStyle.bind(this), "up", "down")
+ };
+ if (!visible)
+ return context;
+ const handleDatum = (datumIndex, xValue2, openValue, closeValue, highValue, lowValue, width, crisp) => {
+ const datum = rawData[datumIndex];
+ const xOffset = applyWidthOffset ? width / 2 : 0;
+ const centerX = xAxis.scale.convert(xValue2) + groupOffset + xOffset;
+ const yOpen = yAxis.scale.convert(openValue);
+ const yClose = yAxis.scale.convert(closeValue);
+ const yHigh = yAxis.scale.convert(highValue);
+ const yLow = yAxis.scale.convert(lowValue);
+ const isRising = closeValue > openValue;
+ const itemId = isRising ? "up" : "down";
+ const y = Math.min(yHigh, yLow);
+ const height = Math.max(yHigh, yLow) - y;
+ const midPoint = {
+ x: centerX,
+ y: y + height / 2
+ };
+ nodeData.push({
+ series: this,
+ itemId,
+ datum,
+ datumIndex,
+ xKey,
+ xValue: xValue2,
+ openValue,
+ closeValue,
+ highValue,
+ lowValue,
+ midPoint,
+ aggregatedValue: closeValue,
+ isRising,
+ centerX,
+ width,
+ y,
+ height,
+ yOpen,
+ yClose,
+ crisp
+ });
+ };
+ const { dataAggregationFilters } = this;
+ const xScale = xAxis.scale;
+ const [r0, r1] = xScale.range;
+ const range2 = Math.abs(r1 - r0);
+ const xPosition = (index) => xScale.convert(xValues[index]) + groupOffset;
+ const dataAggregationFilter = dataAggregationFilters?.find((f) => f.maxRange > range2);
+ if (dataAggregationFilter == null) {
+ const invalidData = processedData.invalidData?.get(this.id);
+ let [start, end] = visibleRangeIndices(1, rawData.length, xAxis.range, (index) => {
+ const xOffset = applyWidthOffset ? 0 : -effectiveBarWidth / 2;
+ const x = xPosition(index) + xOffset;
+ return [x, x + effectiveBarWidth];
+ });
+ if (processedData.input.count < 1e3) {
+ start = 0;
+ end = processedData.input.count;
+ }
+ for (let datumIndex = start; datumIndex < end; datumIndex += 1) {
+ if (invalidData?.[datumIndex] === true)
+ continue;
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ continue;
+ const openValue = openValues[datumIndex];
+ const closeValue = closeValues[datumIndex];
+ const highValue = highValues[datumIndex];
+ const lowValue = lowValues[datumIndex];
+ const validLowValue = lowValue != null && lowValue <= openValue && lowValue <= closeValue;
+ const validHighValue = highValue != null && highValue >= openValue && highValue >= closeValue;
+ if (!validLowValue) {
+ import_ag_charts_core56.Logger.warnOnce(
+ `invalid low value for key [${lowKey}] in data element, low value cannot be higher than datum open or close values`
+ );
+ continue;
+ }
+ if (!validHighValue) {
+ import_ag_charts_core56.Logger.warnOnce(
+ `invalid high value for key [${highKey}] in data element, high value cannot be lower than datum open or close values.`
+ );
+ continue;
+ }
+ handleDatum(datumIndex, xValue2, openValue, closeValue, highValue, lowValue, effectiveBarWidth, true);
+ }
+ } else {
+ const { maxRange, indexData } = dataAggregationFilter;
+ const [start, end] = visibleRangeIndices(1, maxRange, xAxis.range, (index) => {
+ const aggIndex = index * AGGREGATION_SPAN;
+ const openIndex = indexData[aggIndex + OPEN];
+ const closeIndex = indexData[aggIndex + CLOSE];
+ if (openIndex === -1)
+ return;
+ const xOffset = applyWidthOffset ? 0 : -effectiveBarWidth / 2;
+ return [xPosition(openIndex) + xOffset, xPosition(closeIndex) + xOffset + effectiveBarWidth];
+ });
+ for (let i = start; i < end; i += 1) {
+ const aggIndex = i * AGGREGATION_SPAN;
+ const openIndex = indexData[aggIndex + OPEN];
+ const closeIndex = indexData[aggIndex + CLOSE];
+ const highIndex = indexData[aggIndex + HIGH];
+ const lowIndex = indexData[aggIndex + LOW];
+ if (openIndex === -1)
+ continue;
+ const midDatumIndex = Math.trunc((openIndex + closeIndex) / 2);
+ const xValue2 = xValues[midDatumIndex];
+ if (xValue2 == null)
+ continue;
+ const openValue = openValues[openIndex];
+ const closeValue = closeValues[closeIndex];
+ const highValue = highValues[highIndex];
+ const lowValue = lowValues[lowIndex];
+ const width = Math.abs(xPosition(closeIndex) - xPosition(openIndex)) + effectiveBarWidth;
+ handleDatum(midDatumIndex, xValue2, openValue, closeValue, highValue, lowValue, width, false);
+ }
+ }
+ return context;
+ }
+ isVertical() {
+ return true;
+ }
+ isLabelEnabled() {
+ return false;
+ }
+ updateDatumSelection(opts) {
+ const data = opts.nodeData ?? [];
+ return opts.datumSelection.update(data);
+ }
+ updateLabelNodes(_opts) {
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ return labelSelection.update(labelData);
+ }
+ getItemStyle(datumIndex, isHighlight, highlightState, itemId = "up") {
+ const { properties, dataModel, processedData } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ const baseStyle = mergeDefaults5(highlightStyle, properties.getStyle(itemId));
+ let style = baseStyle;
+ if (itemStyler && dataModel != null && processedData != null && datumIndex != null) {
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const overrides = this.cachedDatumCallback(
+ createDatumId2(createDatumId2(xValue2), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(itemId, datumIndex, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`, "item", itemId],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults5(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(itemId, datumIndex, isHighlight, style) {
+ const { id: seriesId, properties, processedData } = this;
+ const { xKey, openKey, closeKey, highKey, lowKey } = properties;
+ const datum = processedData.dataSources.get(seriesId)?.data[datumIndex];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const params = {
+ seriesId,
+ datum,
+ itemId,
+ xKey,
+ openKey,
+ closeKey,
+ highKey,
+ lowKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style
+ };
+ if ("fill" in params && "fill" in style) {
+ params.fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ }
+ return params;
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const {
+ xKey,
+ xName,
+ yName,
+ openKey,
+ openName,
+ highKey,
+ highName,
+ lowKey,
+ lowName,
+ closeKey,
+ closeName,
+ legendItemName,
+ tooltip
+ } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const openValue = dataModel.resolveColumnById(this, `openValue`, processedData)[datumIndex];
+ const highValue = dataModel.resolveColumnById(this, `highValue`, processedData)[datumIndex];
+ const lowValue = dataModel.resolveColumnById(this, `lowValue`, processedData)[datumIndex];
+ const closeValue = dataModel.resolveColumnById(this, `closeValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const itemId = closeValue >= openValue ? "up" : "down";
+ const item = this.properties.item[itemId];
+ const format = this.getItemStyle(datumIndex, false);
+ const marker = {
+ fill: item.fill ?? item.stroke,
+ fillOpacity: item.fillOpacity ?? item.strokeOpacity ?? 1,
+ stroke: item.stroke,
+ strokeWidth: item.strokeWidth ?? 1,
+ strokeOpacity: item.strokeOpacity ?? 1,
+ lineDash: item.lineDash ?? [0],
+ lineDashOffset: item.lineDashOffset ?? 0
+ };
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ title: legendItemName,
+ symbol: {
+ marker
+ },
+ data: [
+ {
+ label: openName,
+ fallbackLabel: openKey,
+ value: this.getAxisValueText(yAxis, "tooltip", openValue, datum, openKey, legendItemName)
+ },
+ {
+ label: highName,
+ fallbackLabel: highKey,
+ value: this.getAxisValueText(yAxis, "tooltip", highValue, datum, highKey, legendItemName)
+ },
+ {
+ label: lowName,
+ fallbackLabel: lowKey,
+ value: this.getAxisValueText(yAxis, "tooltip", lowValue, datum, lowKey, legendItemName)
+ },
+ {
+ label: closeName,
+ fallbackLabel: closeKey,
+ value: this.getAxisValueText(yAxis, "tooltip", closeValue, datum, closeKey, legendItemName)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ itemId,
+ xKey,
+ xName,
+ yName,
+ openKey,
+ openName,
+ highKey,
+ highName,
+ lowKey,
+ lowName,
+ closeKey,
+ closeName,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(opts) {
+ const nodeDatum = this.getNodeData()?.at(opts.datumIndex);
+ if (nodeDatum == null)
+ return;
+ const { centerX, y, width, height } = nodeDatum;
+ const datum = {
+ x: centerX - width / 2,
+ y,
+ width,
+ height
+ };
+ return computeBarFocusBounds2(this, datum);
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickNode.ts
+var import_ag_charts_community120 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcNode.ts
+var import_ag_charts_community119 = require("ag-charts-community");
+var { Path: Path8, SceneChangeDetection: SceneChangeDetection5, BBox: BBox11 } = import_ag_charts_community119._ModuleSupport;
+var OhlcBaseNode = class extends Path8 {
+ constructor() {
+ super(...arguments);
+ this.centerX = 0;
+ this.y = 0;
+ this.width = 0;
+ this.height = 0;
+ this.yOpen = 0;
+ this.yClose = 0;
+ this.crisp = false;
+ }
+ computeBBox() {
+ const { centerX, y, width, height } = this;
+ return new BBox11(centerX - width / 2, y, width, height);
+ }
+ isPointInPath(x, y) {
+ return this.getBBox().containsPoint(x, y);
+ }
+ distanceSquared(x, y) {
+ return this.getBBox().distanceSquared(x, y);
+ }
+ get midPoint() {
+ return { x: this.centerX, y: this.y + this.height / 2 };
+ }
+ alignedCoordinates() {
+ const { y, width, height, crisp } = this;
+ let { centerX, yOpen, yClose } = this;
+ let x0 = centerX - width / 2;
+ let x1 = centerX + width / 2;
+ let y0 = y;
+ let y1 = y + height;
+ if (crisp && width > 1) {
+ centerX = this.align(centerX);
+ if (yOpen <= yClose) {
+ const h = this.align(yOpen, yClose - yOpen);
+ yOpen = this.align(yOpen);
+ yClose = yOpen + h;
+ } else {
+ const h = this.align(yClose, yOpen - yClose);
+ yClose = this.align(yClose);
+ yOpen = yClose + h;
+ }
+ const halfWidth = this.align(width / 2);
+ x0 = centerX - halfWidth;
+ x1 = centerX + halfWidth;
+ y0 = this.align(y);
+ y1 = y0 + this.align(y0, height);
+ }
+ return { centerX, x0, x1, y0, y1, yOpen, yClose };
+ }
+ executeStroke(ctx, path) {
+ const { width, strokeWidth } = this;
+ if (width < strokeWidth) {
+ ctx.lineWidth = width;
+ }
+ super.executeStroke(ctx, path);
+ }
+};
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcBaseNode.prototype, "centerX", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcBaseNode.prototype, "y", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcBaseNode.prototype, "width", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcBaseNode.prototype, "height", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcBaseNode.prototype, "yOpen", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcBaseNode.prototype, "yClose", 2);
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcBaseNode.prototype, "crisp", 2);
+var OhlcNode = class extends OhlcBaseNode {
+ constructor() {
+ super(...arguments);
+ this.strokeAlignment = 0;
+ }
+ updatePath() {
+ const { path } = this;
+ const { centerX, x0, x1, y0, y1, yOpen, yClose } = this.alignedCoordinates();
+ const pixelRatio = this.layerManager?.canvas.pixelRatio ?? 1;
+ const strokeAlignment = this.strokeAlignment > 0 ? pixelRatio / this.strokeAlignment / 2 % 1 : 0;
+ path.clear();
+ path.moveTo(centerX - strokeAlignment, y0);
+ path.lineTo(centerX - strokeAlignment, y1);
+ if (Math.abs(x1 - x0) > 1) {
+ path.moveTo(x0, yOpen - strokeAlignment);
+ path.lineTo(centerX - strokeAlignment, yOpen - strokeAlignment);
+ path.moveTo(centerX - strokeAlignment, yClose - strokeAlignment);
+ path.lineTo(x1, yClose - strokeAlignment);
+ }
+ }
+};
+__decorateClass([
+ SceneChangeDetection5()
+], OhlcNode.prototype, "strokeAlignment", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickNode.ts
+var { SceneArrayChangeDetection: SceneArrayChangeDetection2, SceneChangeDetection: SceneChangeDetection6, ExtendedPath2D: ExtendedPath2D4, BBox: BBox12 } = import_ag_charts_community120._ModuleSupport;
+var CandlestickNode = class extends OhlcBaseNode {
+ constructor() {
+ super(...arguments);
+ this.wickPath = new ExtendedPath2D4();
+ this.wickStroke = void 0;
+ this.wickStrokeWidth = void 0;
+ this.wickStrokeOpacity = void 0;
+ this.wickStrokeAlignment = 0;
+ }
+ computeDefaultGradientFillBBox() {
+ const { width, centerX, yOpen, yClose } = this;
+ const boxTop = Math.min(yOpen, yClose);
+ const boxBottom = Math.max(yOpen, yClose);
+ const rectHeight = boxBottom - boxTop;
+ const x0 = centerX - width / 2;
+ const x1 = centerX + width / 2;
+ return new BBox12(x0, boxTop, x1 - x0, rectHeight);
+ }
+ updatePath() {
+ const {
+ path,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke,
+ wickStrokeWidth,
+ wickStrokeOpacity,
+ wickLineDash,
+ wickLineDashOffset
+ } = this;
+ const { centerX, x0, x1, y0, y1, yOpen, yClose } = this.alignedCoordinates();
+ const pixelRatio = this.layerManager?.canvas.pixelRatio ?? 1;
+ const wickStrokeAlignment = this.wickStrokeAlignment > 0 ? pixelRatio / this.wickStrokeAlignment / 2 % 1 : 0;
+ this.path.clear();
+ this.wickPath.clear();
+ const needsWickPath = wickStroke != null && wickStroke !== stroke2 || wickStrokeWidth != null && wickStrokeWidth !== strokeWidth || wickStrokeOpacity != null && wickStrokeOpacity !== strokeOpacity || wickLineDash != null && wickLineDash !== lineDash || wickLineDashOffset != null && wickLineDashOffset !== lineDashOffset;
+ const wickPath = needsWickPath ? this.wickPath : path;
+ if (Math.abs(x1 - x0) <= 3) {
+ wickPath.moveTo(centerX - wickStrokeAlignment, y0);
+ wickPath.lineTo(centerX - wickStrokeAlignment, y1);
+ return;
+ }
+ const boxTop = Math.min(yOpen, yClose);
+ const boxBottom = Math.max(yOpen, yClose);
+ const boxStrokeAdjustment = strokeWidth / 2;
+ wickPath.moveTo(centerX - wickStrokeAlignment, y0);
+ wickPath.lineTo(centerX - wickStrokeAlignment, boxTop + boxStrokeAdjustment);
+ wickPath.moveTo(centerX - wickStrokeAlignment, y1);
+ wickPath.lineTo(centerX - wickStrokeAlignment, boxBottom - boxStrokeAdjustment);
+ const rectHeight = boxBottom - boxTop - 2 * boxStrokeAdjustment;
+ if (rectHeight > 0) {
+ path.rect(
+ x0 + boxStrokeAdjustment,
+ boxTop + boxStrokeAdjustment,
+ x1 - x0 - 2 * boxStrokeAdjustment,
+ rectHeight
+ );
+ } else {
+ const boxMid = (boxTop + boxBottom) / 2;
+ path.moveTo(x0, boxMid);
+ path.lineTo(x1, boxMid);
+ }
+ }
+ drawPath(ctx) {
+ super.drawPath(ctx);
+ const { wickPath } = this;
+ if (wickPath.isEmpty())
+ return;
+ const {
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ wickStroke = stroke2,
+ wickStrokeWidth = strokeWidth,
+ wickStrokeOpacity = strokeOpacity,
+ wickLineDash = lineDash,
+ wickLineDashOffset = lineDashOffset
+ } = this;
+ if (wickStrokeWidth === 0)
+ return;
+ ctx.globalAlpha *= wickStrokeOpacity;
+ if (typeof wickStroke === "string") {
+ ctx.strokeStyle = wickStroke;
+ }
+ ctx.lineWidth = wickStrokeWidth;
+ if (wickLineDash != null) {
+ ctx.setLineDash([...wickLineDash]);
+ }
+ ctx.lineDashOffset = wickLineDashOffset;
+ ctx.stroke(wickPath.getPath2D());
+ }
+};
+__decorateClass([
+ SceneChangeDetection6()
+], CandlestickNode.prototype, "wickStroke", 2);
+__decorateClass([
+ SceneChangeDetection6()
+], CandlestickNode.prototype, "wickStrokeWidth", 2);
+__decorateClass([
+ SceneChangeDetection6()
+], CandlestickNode.prototype, "wickStrokeOpacity", 2);
+__decorateClass([
+ SceneArrayChangeDetection2()
+], CandlestickNode.prototype, "wickLineDash", 2);
+__decorateClass([
+ SceneChangeDetection6()
+], CandlestickNode.prototype, "wickLineDashOffset", 2);
+__decorateClass([
+ SceneChangeDetection6()
+], CandlestickNode.prototype, "wickStrokeAlignment", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeriesProperties.ts
+var import_ag_charts_community122 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesProperties.ts
+var import_ag_charts_community121 = require("ag-charts-community");
+var { BaseProperties: BaseProperties16, Property: Property49, AbstractBarSeriesProperties: AbstractBarSeriesProperties2, makeSeriesTooltip: makeSeriesTooltip2 } = import_ag_charts_community121._ModuleSupport;
+var OhlcSeriesItem = class extends BaseProperties16 {
+ constructor() {
+ super(...arguments);
+ this.stroke = "#333";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property49
+], OhlcSeriesItem.prototype, "stroke", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesItem.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesItem.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesItem.prototype, "lineDash", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesItem.prototype, "lineDashOffset", 2);
+var OhlcSeriesItems = class extends BaseProperties16 {
+ constructor() {
+ super(...arguments);
+ this.up = new OhlcSeriesItem();
+ this.down = new OhlcSeriesItem();
+ }
+};
+__decorateClass([
+ Property49
+], OhlcSeriesItems.prototype, "up", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesItems.prototype, "down", 2);
+var OhlcSeriesBaseProperties = class extends AbstractBarSeriesProperties2 {
+};
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "openKey", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "closeKey", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "highKey", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "lowKey", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "xName", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "yName", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "openName", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "closeName", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "highName", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesBaseProperties.prototype, "lowName", 2);
+var OhlcSeriesProperties = class extends OhlcSeriesBaseProperties {
+ constructor() {
+ super(...arguments);
+ this.tooltip = makeSeriesTooltip2();
+ this.item = new OhlcSeriesItems();
+ }
+ getStyle(itemId) {
+ const { strokeWidth, strokeOpacity, stroke: stroke2, lineDash, lineDashOffset } = this.item[itemId];
+ return {
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property49
+], OhlcSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesProperties.prototype, "item", 2);
+__decorateClass([
+ Property49
+], OhlcSeriesProperties.prototype, "itemStyler", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeriesProperties.ts
+var { BaseProperties: BaseProperties17, makeSeriesTooltip: makeSeriesTooltip3, Property: Property50 } = import_ag_charts_community122._ModuleSupport;
+var CandlestickSeriesWick = class extends BaseProperties17 {
+};
+__decorateClass([
+ Property50
+], CandlestickSeriesWick.prototype, "stroke", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesWick.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesWick.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesWick.prototype, "lineDash", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesWick.prototype, "lineDashOffset", 2);
+var CandlestickSeriesItem = class extends BaseProperties17 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#c16068";
+ this.fillOpacity = 1;
+ this.stroke = "#333";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.wick = new CandlestickSeriesWick();
+ }
+};
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "fill", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "stroke", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "lineDash", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItem.prototype, "wick", 2);
+var CandlestickSeriesItems = class extends BaseProperties17 {
+ constructor() {
+ super(...arguments);
+ this.up = new CandlestickSeriesItem();
+ this.down = new CandlestickSeriesItem();
+ }
+};
+__decorateClass([
+ Property50
+], CandlestickSeriesItems.prototype, "up", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesItems.prototype, "down", 2);
+var CandlestickSeriesProperties = class extends OhlcSeriesBaseProperties {
+ constructor() {
+ super();
+ this.item = new CandlestickSeriesItems();
+ this.tooltip = makeSeriesTooltip3();
+ this.highlightStyle.deprecated = false;
+ }
+ getStyle(itemId) {
+ const { fill, fillOpacity, strokeWidth, strokeOpacity, stroke: stroke2, lineDash, lineDashOffset, cornerRadius, wick } = this.item[itemId];
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1,
+ wick
+ };
+ }
+};
+__decorateClass([
+ Property50
+], CandlestickSeriesProperties.prototype, "item", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property50
+], CandlestickSeriesProperties.prototype, "itemStyler", 2);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeries.ts
+var { isGradientFill, isPatternFill, isImageFill, applyShapeStyle } = import_ag_charts_community123._ModuleSupport;
+var CandlestickSeries = class extends OhlcSeriesBase {
+ constructor() {
+ super(...arguments);
+ this.properties = new CandlestickSeriesProperties();
+ }
+ nodeFactory() {
+ const node = new CandlestickNode();
+ node.lineCap = "butt";
+ return node;
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, datum) => {
+ datum.style = this.getItemStyle(datum.datumIndex, isHighlight, void 0, datum.itemId);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData, properties } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const { up, down } = properties.item;
+ datumSelection.each((node, datum) => {
+ const { centerX, width, y, height, yOpen, yClose, crisp } = datum;
+ const baseStyle = datum.isRising ? up : down;
+ const style = datum.style ?? contextNodeData.styles[datum.itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ node.centerX = centerX;
+ node.width = width;
+ node.y = y;
+ node.height = height;
+ node.yOpen = yOpen;
+ node.yClose = yClose;
+ node.crisp = crisp;
+ applyShapeStyle(node, style, this.getShapeFillBBox());
+ const styleWick = style?.wick;
+ node.wickStroke = styleWick?.stroke;
+ node.wickStrokeWidth = styleWick?.strokeWidth;
+ node.wickStrokeOpacity = styleWick?.strokeOpacity;
+ node.wickLineDash = styleWick?.lineDash;
+ node.wickLineDashOffset = styleWick?.lineDashOffset;
+ node.wickStrokeAlignment = baseStyle.wick.strokeWidth ?? baseStyle.strokeWidth;
+ });
+ }
+ legendItemSymbol() {
+ const { up, down } = this.properties.item;
+ const upColorStops = isGradientFill(up.fill) ? up.fill.colorStops.map(
+ (c) => typeof c === "string" ? c : { color: c.color, stop: c.stop == null ? void 0 : c.stop * 0.5 }
+ ) : [
+ { color: isPatternFill(up.fill) || isImageFill(up.fill) ? up.stroke : up.fill, stop: 0 },
+ { color: isPatternFill(up.fill) || isImageFill(up.fill) ? up.stroke : up.fill, stop: 0.5 }
+ ];
+ const downColorStops = isGradientFill(down.fill) ? down.fill.colorStops.map(
+ (c) => typeof c === "string" ? c : { color: c.color, stop: c.stop == null ? void 0 : c.stop * 0.5 }
+ ) : [{ color: isPatternFill(down.fill) || isImageFill(down.fill) ? down.stroke : down.fill, stop: 0.5 }];
+ const fill = {
+ type: "gradient",
+ gradient: "linear",
+ rotation: 90,
+ colorStops: [...upColorStops, ...downColorStops],
+ reverse: false
+ };
+ const stroke2 = {
+ type: "gradient",
+ gradient: "linear",
+ rotation: 90,
+ colorStops: [
+ { color: up.stroke, stop: 0 },
+ { color: up.stroke, stop: 0.5 },
+ { color: down.stroke, stop: 0.5 }
+ ],
+ reverse: false
+ };
+ return {
+ marker: {
+ fill,
+ fillOpacity: up.fillOpacity,
+ stroke: stroke2,
+ strokeWidth: up.strokeWidth ?? 1,
+ strokeOpacity: up.strokeOpacity ?? 1,
+ lineDash: up.lineDash,
+ lineDashOffset: up.lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ id,
+ data,
+ visible,
+ ctx: { legendManager }
+ } = this;
+ const { xKey, yName, showInLegend, legendItemName } = this.properties;
+ if (!data?.data.length || !xKey || legendType !== "category") {
+ return [];
+ }
+ return [
+ {
+ legendType: "category",
+ id,
+ itemId: id,
+ seriesId: id,
+ enabled: visible && legendManager.getItemEnabled({ seriesId: id, itemId: id }),
+ label: {
+ text: legendItemName ?? yName ?? id
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null;
+ }
+};
+CandlestickSeries.className = "CandleStickSeries";
+CandlestickSeries.type = "candlestick";
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickSeriesOptionsDef.ts
+var import_ag_charts_community124 = require("ag-charts-community");
+var import_ag_charts_core57 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs2, candlestickSeriesThemeableOptionsDef } = import_ag_charts_community124._ModuleSupport;
+var candlestickSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs2,
+ ...candlestickSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core57.required)((0, import_ag_charts_core57.constant)("candlestick")),
+ xKey: (0, import_ag_charts_core57.required)(import_ag_charts_core57.string),
+ openKey: (0, import_ag_charts_core57.required)(import_ag_charts_core57.string),
+ highKey: (0, import_ag_charts_core57.required)(import_ag_charts_core57.string),
+ lowKey: (0, import_ag_charts_core57.required)(import_ag_charts_core57.string),
+ closeKey: (0, import_ag_charts_core57.required)(import_ag_charts_core57.string),
+ xName: import_ag_charts_core57.string,
+ yName: import_ag_charts_core57.string,
+ openName: import_ag_charts_core57.string,
+ highName: import_ag_charts_core57.string,
+ lowName: import_ag_charts_core57.string,
+ closeName: import_ag_charts_core57.string
+};
+candlestickSeriesOptionsDef.pickOutsideVisibleMinorAxis = (0, import_ag_charts_core57.undocumented)(import_ag_charts_core57.boolean);
+candlestickSeriesOptionsDef.focusPriority = (0, import_ag_charts_core57.undocumented)(import_ag_charts_core57.number);
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickThemes.ts
+var import_ag_charts_community125 = require("ag-charts-community");
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE2 },
+ multiSeriesHighlightStyle: multiSeriesHighlightStyle2,
+ FILL_GRADIENT_LINEAR_KEYED_DEFAULTS,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS2,
+ FILL_PATTERN_KEYED_DEFAULTS
+} = import_ag_charts_community125._ModuleSupport;
+function itemTheme(key) {
+ return {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ key === "up" ? "transparent" : { $palette: "fill" },
+ { $palette: `${key}.fill` }
+ ]
+ },
+ ["gradient", FILL_GRADIENT_LINEAR_KEYED_DEFAULTS(key)],
+ ["image", FILL_IMAGE_DEFAULTS2],
+ ["pattern", FILL_PATTERN_KEYED_DEFAULTS(key)]
+ ]
+ },
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $palette: "stroke" },
+ { $palette: `${key}.stroke` }
+ ]
+ }
+ };
+}
+var CANDLESTICK_SERIES_THEME = {
+ series: {
+ item: {
+ up: itemTheme("up"),
+ down: itemTheme("down")
+ },
+ highlightStyle: {
+ item: { strokeWidth: 3 }
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: multiSeriesHighlightStyle2()
+ },
+ animation: { enabled: false },
+ axes: {
+ [CARTESIAN_AXIS_TYPE2.NUMBER]: {
+ crosshair: {
+ snap: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE2.ORDINAL_TIME]: {
+ groupPaddingInner: 0,
+ crosshair: {
+ enabled: true
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/candlestick/candlestickModule.ts
+var { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE3, CARTESIAN_POSITION } = import_ag_charts_community126._ModuleSupport.ThemeConstants;
+var CandlestickModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "candlestick",
+ moduleFactory: (ctx) => new CandlestickSeries(ctx),
+ defaultAxes: [
+ {
+ type: CARTESIAN_AXIS_TYPE3.NUMBER,
+ position: CARTESIAN_POSITION.LEFT
+ },
+ {
+ type: CARTESIAN_AXIS_TYPE3.ORDINAL_TIME,
+ position: CARTESIAN_POSITION.BOTTOM
+ }
+ ],
+ themeTemplate: CANDLESTICK_SERIES_THEME,
+ groupable: false
+};
+var CandlestickSeriesModule = {
+ type: "series",
+ name: "candlestick",
+ chartType: "cartesian",
+ enterprise: true,
+ options: candlestickSeriesOptionsDef,
+ create: (ctx) => new CandlestickSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapModule.ts
+var import_ag_charts_community132 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeries.ts
+var import_ag_charts_community129 = require("ag-charts-community");
+var import_ag_charts_core59 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/util/labelFormatter.ts
+var import_ag_charts_core58 = require("ag-charts-core");
+function generateLabelSecondaryLabelFontSizeCandidates(label, secondaryLabel) {
+ const { fontSize: labelFontSize, minimumFontSize: labelMinimumFontSize = labelFontSize } = label;
+ const {
+ fontSize: secondaryLabelFontSize,
+ minimumFontSize: secondaryLabelMinimumFontSize = secondaryLabelFontSize
+ } = secondaryLabel;
+ const labelTracks = labelFontSize - labelMinimumFontSize;
+ const secondaryLabelTracks = secondaryLabelFontSize - secondaryLabelMinimumFontSize;
+ let currentLabelFontSize = label.fontSize;
+ let currentSecondaryLabelFontSize = secondaryLabel.fontSize;
+ const out = [{ labelFontSize, secondaryLabelFontSize }];
+ while (currentLabelFontSize > labelMinimumFontSize || currentSecondaryLabelFontSize > secondaryLabelMinimumFontSize) {
+ const labelProgress = labelTracks > 0 ? (currentLabelFontSize - labelMinimumFontSize) / labelTracks : -1;
+ const secondaryLabelProgress = secondaryLabelTracks > 0 ? (currentSecondaryLabelFontSize - secondaryLabelMinimumFontSize) / secondaryLabelTracks : -1;
+ if (labelProgress > secondaryLabelProgress) {
+ currentLabelFontSize--;
+ } else {
+ currentSecondaryLabelFontSize--;
+ }
+ out.push({
+ labelFontSize: currentLabelFontSize,
+ secondaryLabelFontSize: currentSecondaryLabelFontSize
+ });
+ }
+ out.reverse();
+ return out;
+}
+function formatStackedLabels(labelValue, labelProps, secondaryLabelValue, secondaryLabelProps, { padding }, sizeFittingHeight) {
+ const { spacing = 0 } = labelProps;
+ const widthAdjust = 2 * padding;
+ const heightAdjust = 2 * padding + spacing;
+ const minimumHeight = (labelProps.minimumFontSize ?? labelProps.fontSize) + (secondaryLabelProps.minimumFontSize ?? secondaryLabelProps.fontSize);
+ if (minimumHeight > sizeFittingHeight(minimumHeight + heightAdjust, false).height - heightAdjust)
+ return;
+ const fontSizeCandidates = generateLabelSecondaryLabelFontSizeCandidates(labelProps, secondaryLabelProps);
+ const labelTextSizeProps = {
+ fontFamily: labelProps.fontFamily,
+ fontStyle: labelProps.fontStyle,
+ fontWeight: labelProps.fontWeight
+ };
+ const secondaryLabelTextSizeProps = {
+ fontFamily: secondaryLabelProps.fontFamily,
+ fontStyle: secondaryLabelProps.fontStyle,
+ fontWeight: secondaryLabelProps.fontWeight
+ };
+ let label;
+ let secondaryLabel;
+ return (0, import_ag_charts_core58.findMaxValue)(0, fontSizeCandidates.length - 1, (index) => {
+ const { labelFontSize, secondaryLabelFontSize } = fontSizeCandidates[index];
+ const allowTruncation = index === 0;
+ const labelFont = { ...labelTextSizeProps, fontSize: labelFontSize };
+ const secondaryLabelFont = { ...secondaryLabelTextSizeProps, fontSize: secondaryLabelFontSize };
+ const labelLineHeight = (0, import_ag_charts_core58.cachedTextMeasurer)(labelFont).lineHeight();
+ const secondaryLabelLineHeight = (0, import_ag_charts_core58.cachedTextMeasurer)(secondaryLabelFont).lineHeight();
+ const sizeFitting = sizeFittingHeight(
+ labelLineHeight + secondaryLabelLineHeight + heightAdjust,
+ allowTruncation
+ );
+ const availableWidth = sizeFitting.width - widthAdjust;
+ const availableHeight = sizeFitting.height - heightAdjust;
+ if (labelLineHeight + secondaryLabelLineHeight > availableHeight)
+ return;
+ if (label == null || label.fontSize !== labelFontSize) {
+ label = wrapLabel(
+ labelProps,
+ labelValue,
+ availableWidth,
+ availableHeight,
+ labelFont,
+ labelProps.wrapping,
+ allowTruncation ? labelProps.overflowStrategy : "hide"
+ );
+ }
+ if (label == null || label.width > availableWidth || label.height > availableHeight)
+ return;
+ if (secondaryLabel == null || secondaryLabel.fontSize !== secondaryLabelFontSize) {
+ secondaryLabel = wrapLabel(
+ secondaryLabelProps,
+ secondaryLabelValue,
+ availableWidth,
+ availableHeight,
+ secondaryLabelFont,
+ secondaryLabelProps.wrapping,
+ allowTruncation ? secondaryLabelProps.overflowStrategy : "hide"
+ );
+ }
+ if (secondaryLabel == null)
+ return;
+ const totalLabelHeight = label.height + secondaryLabel.height;
+ if (secondaryLabel.width > availableWidth || totalLabelHeight > availableHeight)
+ return;
+ return {
+ width: Math.max(label.width, secondaryLabel.width),
+ height: totalLabelHeight + spacing,
+ meta: sizeFitting.meta,
+ label,
+ secondaryLabel
+ };
+ });
+}
+function formatSingleLabel(value, props, { padding }, sizeFittingHeight) {
+ const sizeAdjust = 2 * padding;
+ const minimumFontSize = Math.min(props.minimumFontSize ?? props.fontSize, props.fontSize);
+ const textSizeProps = {
+ fontFamily: props.fontFamily,
+ fontStyle: props.fontStyle,
+ fontWeight: props.fontWeight
+ };
+ return (0, import_ag_charts_core58.findMaxValue)(minimumFontSize, props.fontSize, (fontSize) => {
+ const currentFont = { ...textSizeProps, fontSize };
+ const measurer2 = (0, import_ag_charts_core58.cachedTextMeasurer)(currentFont);
+ const allowTruncation = fontSize === minimumFontSize;
+ const lineHeight = props.lineHeight ?? measurer2.lineHeight();
+ const sizeFitting = sizeFittingHeight(lineHeight + sizeAdjust, allowTruncation);
+ const availableWidth = sizeFitting.width - sizeAdjust;
+ const availableHeight = sizeFitting.height - sizeAdjust;
+ if (lineHeight > availableHeight || availableWidth < 0)
+ return;
+ const lines = (0, import_ag_charts_core58.wrapLines)(value, {
+ maxWidth: availableWidth,
+ maxHeight: availableHeight,
+ font: currentFont,
+ textWrap: props.wrapping,
+ overflow: (allowTruncation ? props.overflowStrategy : null) ?? "hide"
+ });
+ if (!lines.length)
+ return;
+ const { width, height } = measurer2.measureLines(lines);
+ const text2 = lines.join("\n");
+ return [{ width, height, text: text2, fontSize, lineHeight }, sizeFitting.meta];
+ });
+}
+function hasInvalidFontSize(label) {
+ return label?.minimumFontSize != null && label?.fontSize != null && label?.minimumFontSize > label?.fontSize;
+}
+function formatLabels(baseLabelValue, labelProps, baseSecondaryLabelValue, secondaryLabelProps, layoutParams, sizeFittingHeight) {
+ const labelValue = labelProps.enabled ? baseLabelValue : void 0;
+ const secondaryLabelValue = secondaryLabelProps.enabled ? baseSecondaryLabelValue : void 0;
+ if (hasInvalidFontSize(labelProps) || hasInvalidFontSize(secondaryLabelProps)) {
+ import_ag_charts_core58.Logger.warnOnce(`minimumFontSize should be set to a value less than or equal to the font size`);
+ }
+ let value;
+ if (labelValue != null && secondaryLabelValue != null) {
+ value = formatStackedLabels(
+ labelValue,
+ labelProps,
+ secondaryLabelValue,
+ secondaryLabelProps,
+ layoutParams,
+ sizeFittingHeight
+ );
+ }
+ let labelMeta;
+ if (value == null && labelValue != null) {
+ labelMeta = formatSingleLabel(labelValue, labelProps, layoutParams, sizeFittingHeight);
+ }
+ if (labelMeta != null) {
+ const [label, meta] = labelMeta;
+ value = {
+ width: label.width,
+ height: label.height,
+ meta,
+ label,
+ secondaryLabel: void 0
+ };
+ }
+ let secondaryLabelMeta;
+ if (value == null && labelValue == null && secondaryLabelValue != null) {
+ secondaryLabelMeta = formatSingleLabel(
+ secondaryLabelValue,
+ secondaryLabelProps,
+ layoutParams,
+ sizeFittingHeight
+ );
+ }
+ if (secondaryLabelMeta != null) {
+ const [secondaryLabel, meta] = secondaryLabelMeta;
+ value = {
+ width: secondaryLabel.width,
+ height: secondaryLabel.height,
+ meta,
+ label: void 0,
+ secondaryLabel
+ };
+ }
+ return value;
+}
+function wrapLabel(props, text2, maxWidth, maxHeight, font2, textWrap, overflow) {
+ const lines = (0, import_ag_charts_core58.wrapLines)(text2, { maxWidth, maxHeight, font: font2, textWrap, overflow });
+ if (!lines.length)
+ return;
+ const measurer2 = (0, import_ag_charts_core58.cachedTextMeasurer)(font2);
+ const lineHeight = props.lineHeight ?? measurer2.lineHeight();
+ const { width } = measurer2.measureLines(lines);
+ return {
+ width,
+ lineHeight,
+ text: lines.join("\n"),
+ height: lines.length * lineHeight,
+ fontSize: font2.fontSize
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeriesProperties.ts
+var import_ag_charts_community128 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/util/autoSizedLabel.ts
+var import_ag_charts_community127 = require("ag-charts-community");
+var { Property: Property51 } = import_ag_charts_community127._ModuleSupport;
+var BaseAutoSizedLabel = class extends import_ag_charts_community127._ModuleSupport.Label {
+ constructor() {
+ super(...arguments);
+ this.wrapping = "on-space";
+ this.overflowStrategy = "ellipsis";
+ }
+};
+__decorateClass([
+ Property51
+], BaseAutoSizedLabel.prototype, "wrapping", 2);
+__decorateClass([
+ Property51
+], BaseAutoSizedLabel.prototype, "overflowStrategy", 2);
+__decorateClass([
+ Property51
+], BaseAutoSizedLabel.prototype, "lineHeight", 2);
+__decorateClass([
+ Property51
+], BaseAutoSizedLabel.prototype, "minimumFontSize", 2);
+var AutoSizedLabel = class extends BaseAutoSizedLabel {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property51
+], AutoSizedLabel.prototype, "spacing", 2);
+var AutoSizedSecondaryLabel = class extends BaseAutoSizedLabel {
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeriesProperties.ts
+var { CartesianSeriesProperties, makeSeriesTooltip: makeSeriesTooltip4, Property: Property52 } = import_ag_charts_community128._ModuleSupport;
+var HeatmapSeriesProperties = class extends CartesianSeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.colorRange = ["black", "black"];
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.textAlign = "center";
+ this.verticalAlign = "middle";
+ this.itemPadding = 0;
+ this.label = new AutoSizedLabel();
+ this.tooltip = makeSeriesTooltip4();
+ }
+};
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "yKey", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "xName", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "yName", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "textAlign", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "verticalAlign", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "itemPadding", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property52
+], HeatmapSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode3,
+ computeBarFocusBounds: computeBarFocusBounds3,
+ getMissCount,
+ valueProperty: valueProperty5,
+ ChartAxisDirection: ChartAxisDirection15,
+ DEFAULT_CARTESIAN_DIRECTION_KEYS,
+ DEFAULT_CARTESIAN_DIRECTION_NAMES,
+ createDatumId: createDatumId3,
+ ColorScale,
+ Rect,
+ PointerEvents,
+ applyShapeStyle: applyShapeStyle2,
+ mergeDefaults: mergeDefaults6,
+ formatValue,
+ addHitTestersToQuadtree,
+ findQuadtreeMatch,
+ updateLabelNode
+} = import_ag_charts_community129._ModuleSupport;
+var HeatmapSeriesNodeEvent = class extends import_ag_charts_community129._ModuleSupport.CartesianSeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.colorKey = series.properties.colorKey;
+ }
+};
+var textAlignFactors = {
+ left: -0.5,
+ center: 0,
+ right: -0.5
+};
+var verticalAlignFactors = {
+ top: -0.5,
+ middle: 0,
+ bottom: -0.5
+};
+var HeatmapSeries = class extends import_ag_charts_community129._ModuleSupport.CartesianSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ propertyKeys: {
+ ...DEFAULT_CARTESIAN_DIRECTION_KEYS,
+ color: ["colorKey"]
+ },
+ propertyNames: {
+ ...DEFAULT_CARTESIAN_DIRECTION_NAMES,
+ color: ["colorName"]
+ },
+ categoryKey: void 0,
+ pickModes: [SeriesNodePickMode3.NEAREST_NODE, SeriesNodePickMode3.EXACT_SHAPE_MATCH],
+ pathsPerSeries: []
+ });
+ this.properties = new HeatmapSeriesProperties();
+ this.NodeEvent = HeatmapSeriesNodeEvent;
+ this.colorScale = new ColorScale();
+ }
+ async processData(dataController) {
+ const xAxis = this.axes[ChartAxisDirection15.X];
+ const yAxis = this.axes[ChartAxisDirection15.Y];
+ if (!xAxis || !yAxis || !this.data?.data.length) {
+ return;
+ }
+ const { xKey, yKey, colorRange, colorKey } = this.properties;
+ const xScale = this.axes[ChartAxisDirection15.X]?.scale;
+ const yScale = this.axes[ChartAxisDirection15.Y]?.scale;
+ const { xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const colorScaleType = this.colorScale.type;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ valueProperty5(xKey, xScaleType, { id: "xValue" }),
+ valueProperty5(yKey, yScaleType, { id: "yValue" }),
+ ...colorKey ? [valueProperty5(colorKey, colorScaleType, { id: "colorValue", invalidValue: void 0 })] : []
+ ]
+ });
+ if (this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const rawDomain = processedData.domain.values[colorKeyIdx].filter((v) => v != null);
+ const domain = import_ag_charts_community129._ModuleSupport.extent(rawDomain);
+ this.colorScale.domain = domain ?? [];
+ if (domain?.length && domain[0] === domain[1]) {
+ const midIndex = Math.floor(colorRange.length / 2);
+ this.colorScale.range = [colorRange[midIndex], colorRange[midIndex]];
+ } else {
+ this.colorScale.range = colorRange;
+ }
+ this.colorScale.update();
+ }
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorDataIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount(this, processedData.defs.values[colorDataIdx].missing);
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const actualCount = processedData.domain.values[colorKeyIdx].filter((v) => v != null).length;
+ const colorDataMissing = dataCount === 0 || dataCount === missCount || actualCount === 0;
+ return !colorDataMissing;
+ }
+ xCoordinateRange(xValue2, pixelSize) {
+ const xScale = this.axes[ChartAxisDirection15.X].scale;
+ const xOffset = pixelSize * (xScale.bandwidth ?? 0) / 2;
+ const x = xScale.convert(xValue2) + xOffset;
+ const width = pixelSize * (xScale.bandwidth ?? 10);
+ return [x, x + width];
+ }
+ yCoordinateRange(yValues, pixelSize) {
+ const yScale = this.axes[ChartAxisDirection15.Y].scale;
+ const yOffset = pixelSize * (yScale.bandwidth ?? 0) / 2;
+ const y = yScale.convert(yValues[0]) + yOffset;
+ const height = pixelSize * (yScale.bandwidth ?? 10);
+ return [y, y + height];
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData)
+ return [];
+ if (direction === ChartAxisDirection15.X) {
+ return dataModel.getDomain(this, `xValue`, "value", processedData);
+ } else {
+ return dataModel.getDomain(this, `yValue`, "value", processedData);
+ }
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ createNodeData() {
+ const { data, visible, axes, dataModel, processedData } = this;
+ const xAxis = axes[ChartAxisDirection15.X];
+ const yAxis = axes[ChartAxisDirection15.Y];
+ if (!(data && dataModel && processedData && visible && xAxis && yAxis))
+ return;
+ if (xAxis.type !== "category" || yAxis.type !== "category") {
+ import_ag_charts_core59.Logger.warnOnce(
+ `Heatmap series expected axes to have "category" type, but received "${xAxis.type}" and "${yAxis.type}" instead.`
+ );
+ return;
+ }
+ const { xKey, xName, yKey, yName, colorKey, colorName, textAlign, verticalAlign, itemPadding, label } = this.properties;
+ const xValues = dataModel.resolveColumnById(this, `xValue`, processedData);
+ const yValues = dataModel.resolveColumnById(this, `yValue`, processedData);
+ const colorValues = colorKey ? dataModel.resolveColumnById(this, `colorValue`, processedData) : void 0;
+ const colorDomain = colorKey ? dataModel.getDomain(this, "colorValue", "value", processedData) : [];
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const xOffset = (xScale.bandwidth ?? 0) / 2;
+ const yOffset = (yScale.bandwidth ?? 0) / 2;
+ const nodeData = [];
+ const labelData = [];
+ const width = xScale.bandwidth ?? 10;
+ const height = yScale.bandwidth ?? 10;
+ const textAlignFactor = (width - 2 * itemPadding) * textAlignFactors[textAlign];
+ const verticalAlignFactor = (height - 2 * itemPadding) * verticalAlignFactors[verticalAlign];
+ const sizeFittingHeight = () => ({ width, height, meta: null });
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xDatum = xValues[datumIndex];
+ const yDatum = yValues[datumIndex];
+ const x = xScale.convert(xDatum) + xOffset;
+ const y = yScale.convert(yDatum) + yOffset;
+ const colorValue = colorValues?.[datumIndex];
+ const labelText = label.enabled && colorValue != null ? this.getLabelText(
+ colorValue,
+ datum,
+ colorKey,
+ "color",
+ colorDomain,
+ label,
+ { value: colorValue, datum, colorKey, colorName, xKey, yKey, xName, yName }
+ ) : void 0;
+ const labels = formatLabels(
+ (0, import_ag_charts_core59.toPlainText)(labelText),
+ this.properties.label,
+ void 0,
+ this.properties.label,
+ { padding: itemPadding },
+ sizeFittingHeight
+ );
+ const point = { x, y, size: 0 };
+ const style = this.getItemStyle({ datumIndex, datum, colorValue }, false);
+ nodeData.push({
+ series: this,
+ itemId: yKey,
+ datumIndex,
+ yKey,
+ xKey,
+ xValue: xDatum,
+ yValue: yDatum,
+ colorValue,
+ datum,
+ point,
+ width,
+ height,
+ midPoint: { x, y },
+ missing: colorValues != null && colorValue == null,
+ style
+ });
+ if (labels?.label != null) {
+ const { text: text2, fontSize, lineHeight, height: labelHeight } = labels.label;
+ const { fontStyle, fontFamily, fontWeight, color: color6 } = this.properties.label;
+ const lx = point.x + textAlignFactor * (width - 2 * itemPadding);
+ const ly = point.y + verticalAlignFactor * (height - 2 * itemPadding) - (labels.height - labelHeight) * 0.5;
+ labelData.push({
+ series: this,
+ itemId: yKey,
+ datum,
+ datumIndex,
+ text: text2,
+ fontSize,
+ lineHeight,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ textBaseline: verticalAlign,
+ x: lx,
+ y: ly,
+ style
+ });
+ }
+ }
+ return {
+ itemId: this.properties.yKey ?? this.id,
+ nodeData,
+ labelData,
+ scales: this.calculateScaling(),
+ visible: this.visible
+ };
+ }
+ nodeFactory() {
+ return new Rect();
+ }
+ update(params) {
+ this.ctx.animationManager.skipCurrentBatch();
+ return super.update(params);
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data);
+ }
+ getItemStyle({ datumIndex, datum, colorValue }, isHighlight) {
+ const { properties } = this;
+ const { itemStyler, stroke: stroke2, strokeWidth, strokeOpacity } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const style = mergeDefaults6(highlightStyle, {
+ fill: this.isColorScaleValid() && colorValue != null ? this.colorScale.convert(colorValue) : "transparent",
+ fillOpacity: 1,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ opacity: 1
+ });
+ let overrides;
+ if (itemStyler != null && datumIndex != null) {
+ overrides = this.cachedDatumCallback(createDatumId3(datumIndex, isHighlight ? "highlight" : "node"), () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ });
+ }
+ return overrides ? mergeDefaults6(overrides, style) : style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId, properties } = this;
+ const { xKey, yKey } = properties;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ xKey,
+ yKey,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ const xAxis = this.axes[ChartAxisDirection15.X];
+ const [visibleMin, visibleMax] = xAxis?.visibleRange ?? [];
+ const isZoomed = visibleMin !== 0 || visibleMax !== 1;
+ const crisp = !isZoomed;
+ datumSelection.each((rect, nodeDatum) => {
+ const { point, width, height, style } = nodeDatum;
+ applyShapeStyle2(rect, style);
+ rect.crisp = crisp;
+ rect.x = Math.floor(point.x - width / 2);
+ rect.y = Math.floor(point.y - height / 2);
+ rect.width = Math.ceil(width);
+ rect.height = Math.ceil(height);
+ });
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ const { enabled } = this.properties.label;
+ const data = enabled ? labelData : [];
+ return labelSelection.update(data);
+ }
+ updateLabelNodes(opts) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((text2, datum) => {
+ text2.pointerEvents = PointerEvents.None;
+ text2.text = datum.text;
+ text2.fillOpacity = this.getHighlightStyle(false, datum.datumIndex)?.opacity ?? 1;
+ updateLabelNode(this, text2, this.properties, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties, colorScale, ctx } = this;
+ const { formatManager } = ctx;
+ const { xKey, xName, yKey, yName, colorKey, colorName, colorRange, title, legendItemName, tooltip } = properties;
+ const xAxis = axes[ChartAxisDirection15.X];
+ const yAxis = axes[ChartAxisDirection15.Y];
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveColumnById(this, `xValue`, processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yValue`, processedData)[datumIndex];
+ const colorValue = colorKey != null && this.isColorScaleValid() ? dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex] : void 0;
+ if (xValue2 == null)
+ return;
+ const data = [];
+ let fill;
+ if (colorValue == null) {
+ fill = colorRange[0];
+ } else {
+ fill = colorScale.convert(colorValue);
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? formatValue(colorValue) });
+ }
+ data.push(
+ {
+ label: xName,
+ fallbackLabel: xKey,
+ value: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName)
+ },
+ {
+ label: yName,
+ fallbackLabel: yKey,
+ value: this.getAxisValueText(yAxis, "tooltip", yValue, datum, yKey, legendItemName)
+ }
+ );
+ const format = this.getItemStyle({ datumIndex, datum, colorValue }, false);
+ if (format.fill != null) {
+ fill = format.fill;
+ }
+ const symbol = fill == null ? void 0 : {
+ marker: {
+ shape: "square",
+ fill,
+ fillOpacity: 1,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ }
+ };
+ return this.formatTooltipWithContext(
+ tooltip,
+ { title: title ?? legendItemName, symbol, data },
+ {
+ seriesId,
+ datum,
+ title,
+ xKey,
+ xName,
+ yKey,
+ yName,
+ colorKey,
+ colorName,
+ ...format
+ }
+ );
+ }
+ getLegendData(legendType) {
+ if (legendType !== "gradient" || !this.isColorScaleValid() || !this.dataModel) {
+ return [];
+ }
+ return [
+ {
+ legendType: "gradient",
+ enabled: this.visible,
+ seriesId: this.id,
+ series: this.getFormatterContext("color"),
+ colorDomain: this.colorScale.domain,
+ colorRange: this.colorScale.range
+ }
+ ];
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled && Boolean(this.properties.colorKey);
+ }
+ getBandScalePadding() {
+ return { inner: 0, outer: 0 };
+ }
+ computeFocusBounds({ datumIndex }) {
+ const datum = this.contextNodeData?.nodeData[datumIndex];
+ if (datum === void 0)
+ return void 0;
+ const { width, height, midPoint } = datum;
+ const focusRect = { x: midPoint.x - width / 2, y: midPoint.y - height / 2, width, height };
+ return computeBarFocusBounds3(this, focusRect);
+ }
+ initQuadTree(quadtree) {
+ addHitTestersToQuadtree(quadtree, this.datumNodesIter());
+ }
+ pickNodesExactShape(point) {
+ const item = findQuadtreeMatch(this, point);
+ return item != null && item.distance <= 0 ? [item.datum] : [];
+ }
+ pickNodeClosestDatum(point) {
+ return findQuadtreeMatch(this, point);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+HeatmapSeries.className = "HeatmapSeries";
+HeatmapSeries.type = "heatmap";
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapSeriesOptionsDef.ts
+var import_ag_charts_community130 = require("ag-charts-community");
+var import_ag_charts_core60 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs3, heatmapSeriesThemeableOptionsDef, without } = import_ag_charts_community130._ModuleSupport;
+var heatmapSeriesOptionsDef = {
+ ...without(heatmapSeriesThemeableOptionsDef, ["showInLegend"]),
+ ...without(commonSeriesOptionsDefs3, ["showInLegend"]),
+ type: (0, import_ag_charts_core60.required)((0, import_ag_charts_core60.constant)("heatmap")),
+ xKey: (0, import_ag_charts_core60.required)(import_ag_charts_core60.string),
+ yKey: (0, import_ag_charts_core60.required)(import_ag_charts_core60.string),
+ colorKey: import_ag_charts_core60.string,
+ xName: import_ag_charts_core60.string,
+ yName: import_ag_charts_core60.string,
+ colorName: import_ag_charts_core60.string,
+ colorRange: (0, import_ag_charts_core60.arrayOf)(import_ag_charts_core60.color)
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapThemes.ts
+var import_ag_charts_community131 = require("ag-charts-community");
+var HEATMAP_SERIES_THEME = {
+ series: {
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $ref: "chartBackgroundColor" },
+ { $path: ["/0", { $palette: "stroke" }, { $palette: "strokes" }] }
+ ]
+ },
+ strokeWidth: { $isUserOption: ["./stroke", 2, void 0] },
+ // @ts-expect-error undocumented option
+ colorRange: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $palette: "divergingColors" },
+ import_ag_charts_community131._ModuleSupport.SAFE_RANGE2_OPERATION
+ ]
+ },
+ label: {
+ ...import_ag_charts_community131._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ color: { $ref: "textColor" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ wrapping: "on-space",
+ overflowStrategy: "ellipsis"
+ },
+ itemPadding: 3,
+ highlight: import_ag_charts_community131._ModuleSupport.singleSeriesHighlightStyle()
+ },
+ gradientLegend: {
+ enabled: true,
+ ...import_ag_charts_community131._ModuleSupport.LEGEND_CONTAINER_THEME
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/heatmap/heatmapModule.ts
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE4, CARTESIAN_POSITION: CARTESIAN_POSITION2 }
+} = import_ag_charts_community132._ModuleSupport;
+var HeatmapModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "heatmap",
+ moduleFactory: (ctx) => new HeatmapSeries(ctx),
+ defaultAxes: [
+ { type: CARTESIAN_AXIS_TYPE4.CATEGORY, position: CARTESIAN_POSITION2.LEFT },
+ { type: CARTESIAN_AXIS_TYPE4.CATEGORY, position: CARTESIAN_POSITION2.BOTTOM }
+ ],
+ themeTemplate: HEATMAP_SERIES_THEME
+};
+var HeatmapSeriesModule = {
+ type: "series",
+ name: "heatmap",
+ chartType: "cartesian",
+ enterprise: true,
+ options: heatmapSeriesOptionsDef,
+ create: (ctx) => new HeatmapSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcModule.ts
+var import_ag_charts_community135 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeries.ts
+var import_ag_charts_community133 = require("ag-charts-community");
+var { applyShapeStyle: applyShapeStyle3 } = import_ag_charts_community133._ModuleSupport;
+var OhlcSeries = class extends OhlcSeriesBase {
+ constructor() {
+ super(...arguments);
+ this.properties = new OhlcSeriesProperties();
+ }
+ nodeFactory() {
+ const node = new OhlcNode();
+ node.lineCap = "square";
+ return node;
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, datum) => {
+ datum.style = this.getItemStyle(datum.datumIndex, isHighlight, void 0, datum.itemId);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData, properties } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const { up, down } = properties.item;
+ datumSelection.each((node, datum) => {
+ const { centerX, width, y, height, yOpen, yClose, crisp } = datum;
+ const baseStyle = datum.isRising ? up : down;
+ node.centerX = centerX;
+ node.width = width;
+ node.y = y;
+ node.height = height;
+ node.yOpen = yOpen;
+ node.yClose = yClose;
+ node.crisp = crisp;
+ const style = datum.style ?? contextNodeData.styles[datum.itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ applyShapeStyle3(node, style);
+ node.strokeAlignment = baseStyle.strokeWidth;
+ });
+ }
+ getLegendData(legendType) {
+ const {
+ id,
+ data,
+ ctx: { legendManager },
+ visible
+ } = this;
+ const {
+ xKey,
+ yName,
+ item: { up, down },
+ showInLegend,
+ legendItemName
+ } = this.properties;
+ if (!data?.data.length || !xKey || legendType !== "category") {
+ return [];
+ }
+ const fill = {
+ type: "gradient",
+ gradient: "linear",
+ colorSpace: "rgb",
+ colorStops: [
+ { color: up.stroke, stop: 0 },
+ { color: up.stroke, stop: 0.5 },
+ { color: down.stroke, stop: 0.5 }
+ ],
+ rotation: 90
+ };
+ return [
+ {
+ legendType: "category",
+ id,
+ itemId: id,
+ seriesId: id,
+ enabled: visible && legendManager.getItemEnabled({ seriesId: id, itemId: id }),
+ label: {
+ text: legendItemName ?? yName ?? id
+ },
+ symbol: {
+ marker: {
+ fill,
+ fillOpacity: up.strokeOpacity,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ }
+ },
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null;
+ }
+};
+OhlcSeries.className = "ohlc";
+OhlcSeries.type = "ohlc";
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcSeriesOptionsDef.ts
+var import_ag_charts_community134 = require("ag-charts-community");
+var import_ag_charts_core61 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs4, ohlcSeriesThemeableOptionsDef } = import_ag_charts_community134._ModuleSupport;
+var ohlcSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs4,
+ ...ohlcSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core61.required)((0, import_ag_charts_core61.constant)("ohlc")),
+ xKey: (0, import_ag_charts_core61.required)(import_ag_charts_core61.string),
+ openKey: (0, import_ag_charts_core61.required)(import_ag_charts_core61.string),
+ highKey: (0, import_ag_charts_core61.required)(import_ag_charts_core61.string),
+ lowKey: (0, import_ag_charts_core61.required)(import_ag_charts_core61.string),
+ closeKey: (0, import_ag_charts_core61.required)(import_ag_charts_core61.string),
+ xName: import_ag_charts_core61.string,
+ yName: import_ag_charts_core61.string,
+ openName: import_ag_charts_core61.string,
+ highName: import_ag_charts_core61.string,
+ lowName: import_ag_charts_core61.string,
+ closeName: import_ag_charts_core61.string
+};
+ohlcSeriesOptionsDef.pickOutsideVisibleMinorAxis = (0, import_ag_charts_core61.undocumented)(import_ag_charts_core61.boolean);
+ohlcSeriesOptionsDef.focusPriority = (0, import_ag_charts_core61.undocumented)(import_ag_charts_core61.number);
+
+// packages/ag-charts-enterprise/src/series/ohlc/ohlcModule.ts
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE5, CARTESIAN_POSITION: CARTESIAN_POSITION3 },
+ multiSeriesHighlightStyle: multiSeriesHighlightStyle3
+} = import_ag_charts_community135._ModuleSupport;
+var OhlcModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "ohlc",
+ moduleFactory: (ctx) => new OhlcSeries(ctx),
+ defaultAxes: [
+ { type: CARTESIAN_AXIS_TYPE5.NUMBER, position: CARTESIAN_POSITION3.LEFT },
+ { type: CARTESIAN_AXIS_TYPE5.ORDINAL_TIME, position: CARTESIAN_POSITION3.BOTTOM }
+ ],
+ themeTemplate: {
+ animation: { enabled: false },
+ series: {
+ item: {
+ up: {
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $palette: "stroke" },
+ { $palette: "up.stroke" }
+ ]
+ }
+ },
+ down: {
+ stroke: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $palette: "stroke" },
+ { $palette: "down.stroke" }
+ ]
+ }
+ }
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: multiSeriesHighlightStyle3(false)
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE5.NUMBER]: {
+ crosshair: {
+ snap: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE5.ORDINAL_TIME]: {
+ groupPaddingInner: 0,
+ crosshair: {
+ enabled: true
+ }
+ }
+ }
+ },
+ groupable: false
+};
+var OhlcSeriesModule = {
+ type: "series",
+ name: "ohlc",
+ chartType: "cartesian",
+ enterprise: true,
+ options: ohlcSeriesOptionsDef,
+ create: (ctx) => new OhlcSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaModule.ts
+var import_ag_charts_community143 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeArea.ts
+var import_ag_charts_community140 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaAggregation.ts
+var import_ag_charts_community136 = require("ag-charts-community");
+var {
+ AGGREGATION_INDEX_Y_MAX: AGGREGATION_INDEX_Y_MAX2,
+ AGGREGATION_INDEX_Y_MIN: AGGREGATION_INDEX_Y_MIN2,
+ aggregationDomain: aggregationDomain2,
+ aggregationIndexForXRatio,
+ aggregationRangeFittingPoints: aggregationRangeFittingPoints2,
+ aggregationXRatioForXValue,
+ compactAggregationIndices: compactAggregationIndices2,
+ createAggregationIndices: createAggregationIndices2
+} = import_ag_charts_community136._ModuleSupport;
+var AGGREGATION_THRESHOLD2 = 1e3;
+function aggregationContainsTopIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf) {
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ return false;
+ const xRatio = aggregationXRatioForXValue(xValue2, d0, d1, xNeedsValueOf);
+ const aggIndex = aggregationIndexForXRatio(xRatio, maxRange);
+ return datumIndex === indexData[aggIndex + AGGREGATION_INDEX_Y_MAX2];
+}
+function aggregationContainsBottomIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf) {
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ return false;
+ const xRatio = aggregationXRatioForXValue(xValue2, d0, d1, xNeedsValueOf);
+ const aggIndex = aggregationIndexForXRatio(xRatio, maxRange);
+ return datumIndex === indexData[aggIndex + AGGREGATION_INDEX_Y_MIN2];
+}
+function aggregateRangeAreaData(scale, xValues, highValues, lowValues, domain, xNeedsValueOf, yNeedsValueOf) {
+ if (xValues.length < AGGREGATION_THRESHOLD2)
+ return;
+ const [d0, d1] = aggregationDomain2(scale, domain);
+ let maxRange = aggregationRangeFittingPoints2(xValues, d0, d1, { xNeedsValueOf });
+ const { indexData, valueData } = createAggregationIndices2(xValues, highValues, lowValues, d0, d1, maxRange, {
+ xNeedsValueOf,
+ yNeedsValueOf
+ });
+ let topIndices = [];
+ let bottomIndices = [];
+ for (let datumIndex = 0; datumIndex < xValues.length; datumIndex += 1) {
+ if (aggregationContainsTopIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)) {
+ topIndices.push(datumIndex);
+ }
+ if (aggregationContainsBottomIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)) {
+ bottomIndices.push(datumIndex);
+ }
+ }
+ const filters = [{ maxRange, topIndices, bottomIndices }];
+ while (maxRange > 64) {
+ ({ maxRange } = compactAggregationIndices2(indexData, valueData, maxRange, { inPlace: true }));
+ topIndices = topIndices.filter(
+ (datumIndex) => aggregationContainsTopIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)
+ );
+ bottomIndices = bottomIndices.filter(
+ (datumIndex) => aggregationContainsBottomIndex(xValues, d0, d1, indexData, maxRange, datumIndex, xNeedsValueOf)
+ );
+ filters.push({ maxRange, topIndices, bottomIndices });
+ }
+ filters.reverse();
+ return filters;
+}
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaIntersection.ts
+var import_ag_charts_community137 = require("ag-charts-community");
+function getYValueAtX({ span }, x) {
+ switch (span.type) {
+ case "linear":
+ case "step":
+ case "multi-line": {
+ const t = (x - span.x0) / (span.x1 - span.x0);
+ return span.y0 + t * (span.y1 - span.y0);
+ }
+ case "cubic": {
+ const { cp0x, cp0y, cp1x, cp1y, cp2x, cp2y, cp3x, cp3y } = span;
+ let t = 0.5;
+ const tolerance = 1e-6;
+ for (let i = 0; i < 10; i++) {
+ const mt2 = 1 - t;
+ const xt = mt2 * mt2 * mt2 * cp0x + 3 * mt2 * mt2 * t * cp1x + 3 * mt2 * t * t * cp2x + t * t * t * cp3x;
+ const fx = xt - x;
+ if (Math.abs(fx) < tolerance)
+ break;
+ const dxdt = 3 * mt2 * mt2 * (cp1x - cp0x) + 6 * mt2 * t * (cp2x - cp1x) + 3 * t * t * (cp3x - cp2x);
+ if (Math.abs(dxdt) < 1e-12)
+ break;
+ t = t - fx / dxdt;
+ t = Math.max(0, Math.min(1, t));
+ }
+ const mt = 1 - t;
+ return mt * mt * mt * cp0y + 3 * mt * mt * t * cp1y + 3 * mt * t * t * cp2y + t * t * t * cp3y;
+ }
+ }
+}
+function findSpanForX(spans, x, startIndex = 0) {
+ for (let i = startIndex; i < spans.length; i++) {
+ const span = spans[i];
+ const [start, end] = import_ag_charts_community137._ModuleSupport.spanRange(span.span);
+ if (x >= start.x && x <= end.x) {
+ return { span, index: i };
+ }
+ if (x < start.x) {
+ break;
+ }
+ }
+ return { span: null, index: startIndex };
+}
+function checkForIntersection(highSpans, lowSpans, x, wasInverted, spanIndex) {
+ const high = findSpanForX(highSpans, x, spanIndex);
+ const low = findSpanForX(lowSpans, x, spanIndex);
+ if (!high.span || !low.span) {
+ return { intersection: null, spanIndex: high.index, isInverted: wasInverted };
+ }
+ const highY = getYValueAtX(high.span, x);
+ const lowY = getYValueAtX(low.span, x);
+ const isInverted = highY > lowY;
+ const intersection = wasInverted === isInverted ? null : { x, y: highY };
+ return { intersection, spanIndex: high.index, isInverted };
+}
+function findRangeAreaIntersections(highSpans, lowSpans, minX, maxX, initiallyInverted = false) {
+ if (highSpans.length === 0 || lowSpans.length === 0)
+ return [];
+ const intersections = [];
+ let wasInverted = initiallyInverted;
+ let spanIndex = 0;
+ for (let x = minX; x <= maxX; x += 0.5) {
+ const result = checkForIntersection(highSpans, lowSpans, x, wasInverted, spanIndex);
+ if (result.intersection) {
+ intersections.push(result.intersection.x);
+ }
+ spanIndex = result.spanIndex;
+ wasInverted = result.isInverted;
+ }
+ return intersections;
+}
+function calculateIntersectionSegments(intersections, seriesRect, chartSize, startsInverted, style = {}) {
+ const horizontalMargin = Math.max(seriesRect.x, chartSize.width - (seriesRect.x + seriesRect.width));
+ const verticalMargin = Math.max(seriesRect.y, chartSize.height - (seriesRect.y + seriesRect.height));
+ const result = [];
+ const createClipRect = (x0, x1) => ({
+ x0,
+ y0: -verticalMargin,
+ x1,
+ y1: seriesRect.height + verticalMargin
+ });
+ if (startsInverted) {
+ result.push({
+ clipRect: createClipRect(-horizontalMargin, intersections[0] ?? seriesRect.width + horizontalMargin),
+ ...style
+ });
+ }
+ const startIndex = startsInverted ? 1 : 0;
+ for (let i = startIndex; i < intersections.length; i += 2) {
+ result.push({
+ clipRect: createClipRect(intersections[i], intersections[i + 1] ?? seriesRect.width + horizontalMargin),
+ ...style
+ });
+ }
+ return result;
+}
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaProperties.ts
+var import_ag_charts_community138 = require("ag-charts-community");
+var {
+ BaseProperties: BaseProperties18,
+ CartesianSeriesProperties: CartesianSeriesProperties2,
+ InterpolationProperties,
+ SeriesMarker,
+ makeSeriesTooltip: makeSeriesTooltip5,
+ Property: Property53,
+ DropShadow,
+ Label: Label2
+} = import_ag_charts_community138._ModuleSupport;
+var RangeAreaSeriesLabel = class extends Label2 {
+ constructor() {
+ super(...arguments);
+ this.placement = "outside";
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property53
+], RangeAreaSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property53
+], RangeAreaSeriesLabel.prototype, "spacing", 2);
+var RangeAreaInvertedStyle = class {
+ constructor() {
+ this.enabled = false;
+ this.fillOpacity = 1;
+ }
+};
+__decorateClass([
+ Property53
+], RangeAreaInvertedStyle.prototype, "enabled", 2);
+__decorateClass([
+ Property53
+], RangeAreaInvertedStyle.prototype, "fill", 2);
+__decorateClass([
+ Property53
+], RangeAreaInvertedStyle.prototype, "fillOpacity", 2);
+var RangeAreaLineStyle = class extends BaseProperties18 {
+ constructor() {
+ super(...arguments);
+ this.stroke = "#99CCFF";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.marker = new SeriesMarker();
+ }
+};
+__decorateClass([
+ Property53
+], RangeAreaLineStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property53
+], RangeAreaLineStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property53
+], RangeAreaLineStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property53
+], RangeAreaLineStyle.prototype, "lineDash", 2);
+__decorateClass([
+ Property53
+], RangeAreaLineStyle.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property53
+], RangeAreaLineStyle.prototype, "marker", 2);
+var RangeAreaItemProperties = class extends BaseProperties18 {
+ constructor() {
+ super(...arguments);
+ this.low = new RangeAreaLineStyle();
+ this.high = new RangeAreaLineStyle();
+ }
+};
+__decorateClass([
+ Property53
+], RangeAreaItemProperties.prototype, "low", 2);
+__decorateClass([
+ Property53
+], RangeAreaItemProperties.prototype, "high", 2);
+var SharedRangeAreaMarker = class extends BaseProperties18 {
+};
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "enabled", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "shape", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "size", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "fill", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "stroke", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "lineDash", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property53
+], SharedRangeAreaMarker.prototype, "itemStyler", 2);
+var RangeAreaProperties = class extends CartesianSeriesProperties2 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#99CCFF";
+ this.fillOpacity = 1;
+ this.stroke = "#99CCFF";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.interpolation = new InterpolationProperties();
+ this.item = new RangeAreaItemProperties();
+ this.invertedStyle = new RangeAreaInvertedStyle();
+ this.shadow = new DropShadow().set({ enabled: false });
+ this.marker = new SharedRangeAreaMarker();
+ this.label = new RangeAreaSeriesLabel();
+ this.tooltip = makeSeriesTooltip5();
+ this.connectMissingData = false;
+ }
+};
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "yLowKey", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "yHighKey", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "xName", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "yName", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "yLowName", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "yHighName", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "fill", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "interpolation", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "styler", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "item", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "invertedStyle", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "marker", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "label", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property53
+], RangeAreaProperties.prototype, "connectMissingData", 2);
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaUtil.ts
+var import_ag_charts_community139 = require("ag-charts-community");
+var {
+ CollapseMode,
+ isScaleValid,
+ pairUpSpans,
+ prepareAreaFillAnimationFns,
+ plotInterpolatedLinePathStroke,
+ prepareLinePathPropertyAnimation,
+ areScalingEqual
+} = import_ag_charts_community139._ModuleSupport;
+function prepareRangeAreaPathStrokeAnimationFns(status, highSpans, lowSpans, visibleToggleMode) {
+ const removePhaseFn = (ratio3, path) => {
+ plotInterpolatedLinePathStroke(ratio3, path, highSpans.removed);
+ plotInterpolatedLinePathStroke(ratio3, path, lowSpans.removed);
+ };
+ const updatePhaseFn = (ratio3, path) => {
+ plotInterpolatedLinePathStroke(ratio3, path, highSpans.moved);
+ plotInterpolatedLinePathStroke(ratio3, path, lowSpans.moved);
+ };
+ const addPhaseFn = (ratio3, path) => {
+ plotInterpolatedLinePathStroke(ratio3, path, highSpans.added);
+ plotInterpolatedLinePathStroke(ratio3, path, lowSpans.added);
+ };
+ const pathProperties = prepareLinePathPropertyAnimation(status, visibleToggleMode);
+ return { status, path: { addPhaseFn, updatePhaseFn, removePhaseFn }, pathProperties };
+}
+function prepareRangeAreaPathAnimation(newData, oldData, diff8) {
+ const isCategoryBased = newData.scales.x?.type === "category";
+ const wasCategoryBased = oldData.scales.x?.type === "category";
+ if (isCategoryBased !== wasCategoryBased || !isScaleValid(newData.scales.x) || !isScaleValid(oldData.scales.x)) {
+ return;
+ }
+ let status = "updated";
+ if (oldData.visible && !newData.visible) {
+ status = "removed";
+ } else if (!oldData.visible && newData.visible) {
+ status = "added";
+ }
+ const fillSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.fillData.spans },
+ { scales: oldData.scales, data: oldData.fillData.spans },
+ CollapseMode.Split
+ );
+ if (fillSpans == null)
+ return;
+ const fillPhantomSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.fillData.phantomSpans },
+ { scales: oldData.scales, data: oldData.fillData.phantomSpans },
+ CollapseMode.Split
+ );
+ if (fillPhantomSpans == null)
+ return;
+ const highStrokeSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.highStrokeData.spans },
+ { scales: oldData.scales, data: oldData.highStrokeData.spans },
+ CollapseMode.Split
+ );
+ if (highStrokeSpans == null)
+ return;
+ const lowStrokeSpans = pairUpSpans(
+ { scales: newData.scales, data: newData.lowStrokeData.spans },
+ { scales: oldData.scales, data: oldData.lowStrokeData.spans },
+ CollapseMode.Split
+ );
+ if (lowStrokeSpans == null)
+ return;
+ const fadeMode = "fade";
+ const fill = prepareAreaFillAnimationFns(status, fillSpans, fillPhantomSpans, fadeMode);
+ const stroke2 = prepareRangeAreaPathStrokeAnimationFns(status, highStrokeSpans, lowStrokeSpans, fadeMode);
+ const hasMotion = (diff8?.changed ?? true) || !areScalingEqual(newData.scales.x, oldData.scales.x) || !areScalingEqual(newData.scales.y, oldData.scales.y) || status !== "updated";
+ return { status, fill, stroke: stroke2, hasMotion };
+}
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeArea.ts
+var {
+ valueProperty: valueProperty6,
+ keyProperty: keyProperty4,
+ ChartAxisDirection: ChartAxisDirection16,
+ mergeDefaults: mergeDefaults7,
+ updateLabelNode: updateLabelNode2,
+ fixNumericExtent: fixNumericExtent4,
+ buildResetPathFn,
+ resetLabelFn,
+ resetMarkerFn,
+ resetMarkerPositionFn,
+ pathSwipeInAnimation,
+ resetMotion,
+ markerSwipeScaleInAnimation,
+ seriesLabelFadeInAnimation,
+ animationValidation: animationValidation3,
+ diff: diff3,
+ updateClipPath,
+ computeMarkerFocusBounds,
+ plotAreaPathFill,
+ plotLinePathStroke,
+ interpolatePoints,
+ pathFadeInAnimation,
+ markerFadeInAnimation,
+ fromToMotion,
+ pathMotion,
+ extent,
+ applyShapeFillBBox: applyShapeFillBBox2,
+ PointerEvents: PointerEvents2,
+ Marker,
+ BBox: BBox13,
+ findMinMax: findMinMax2,
+ applyShapeStyle: applyShapeStyle4,
+ processedDataIsAnimatable: processedDataIsAnimatable2,
+ simpleMemorize2: simpleMemorize22,
+ markerEnabled,
+ getMarkerStyles,
+ calculateSegments: calculateSegments2,
+ toHighlightString: toHighlightString2,
+ HighlightState: HighlightState2
+} = import_ag_charts_community140._ModuleSupport;
+var memoizedAggregateRangeAreaData = simpleMemorize22(aggregateRangeAreaData);
+var RangeAreaSeriesNodeEvent = class extends import_ag_charts_community140._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.yLowKey = series.properties.yLowKey;
+ this.yHighKey = series.properties.yHighKey;
+ }
+};
+var BaseSeries = import_ag_charts_community140._ModuleSupport.CartesianSeries;
+var RangeAreaSeries = class extends BaseSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pathsPerSeries: ["fill", "lowStroke", "highStroke"],
+ pickModes: [import_ag_charts_community140._ModuleSupport.SeriesNodePickMode.AXIS_ALIGNED],
+ propertyKeys: {
+ [ChartAxisDirection16.X]: ["xKey"],
+ [ChartAxisDirection16.Y]: ["yLowKey", "yHighKey"]
+ },
+ propertyNames: {
+ [ChartAxisDirection16.X]: ["xName"],
+ [ChartAxisDirection16.Y]: ["yLowName", "yHighName", "yName"]
+ },
+ categoryKey: "xValue",
+ animationResetFns: {
+ path: buildResetPathFn({ getVisible: () => this.visible, getOpacity: () => this.getOpacity() }),
+ label: resetLabelFn,
+ datum: (node, datum) => ({ ...resetMarkerFn(node), ...resetMarkerPositionFn(node, datum) })
+ },
+ clipFocusBox: false
+ });
+ this.properties = new RangeAreaProperties();
+ this.NodeEvent = RangeAreaSeriesNodeEvent;
+ this.dataAggregationFilters = void 0;
+ }
+ async processData(dataController) {
+ const { xKey, yLowKey, yHighKey } = this.properties;
+ const xScale = this.axes[ChartAxisDirection16.X]?.scale;
+ const yScale = this.axes[ChartAxisDirection16.Y]?.scale;
+ const { xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ if (!this.ctx.animationManager.isSkipped() && this.processedData) {
+ extraProps.push(diff3(this.id, this.processedData));
+ }
+ if (animationEnabled) {
+ extraProps.push(animationValidation3());
+ }
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty4(xKey, xScaleType, { id: `xValue` }),
+ valueProperty6(yLowKey, yScaleType, { id: `yLowValue` }),
+ valueProperty6(yHighKey, yScaleType, { id: `yHighValue` }),
+ ...extraProps
+ ]
+ });
+ this.dataAggregationFilters = this.aggregateData(dataModel, processedData);
+ this.animationState.transition("updateData");
+ }
+ aggregateData(dataModel, processedData) {
+ if (processedData.type !== "ungrouped")
+ return;
+ if (processedDataIsAnimatable2(processedData))
+ return;
+ const xAxis = this.axes[ChartAxisDirection16.X];
+ if (xAxis == null)
+ return;
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yHighValues = dataModel.resolveColumnById(this, `yHighValue`, processedData);
+ const yLowValues = dataModel.resolveColumnById(this, `yLowValue`, processedData);
+ const { index } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const domain = processedData.domain.keys[index];
+ const xNeedsValueOf = dataModel.resolveColumnNeedsValueOf(this, `xValue`, processedData);
+ const yNeedsValueOf = dataModel.resolveColumnNeedsValueOf(this, `yHighValue`, processedData);
+ return memoizedAggregateRangeAreaData(
+ xAxis.scale.type,
+ xValues,
+ yHighValues,
+ yLowValues,
+ domain,
+ xNeedsValueOf,
+ yNeedsValueOf
+ );
+ }
+ xCoordinateRange(xValue2) {
+ const x = this.axes[ChartAxisDirection16.X].scale.convert(xValue2);
+ return [x, x];
+ }
+ yCoordinateRange(yValues) {
+ const y = this.axes[ChartAxisDirection16.Y].scale.convert(yValues[0]);
+ return [y, y];
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!(processedData && dataModel))
+ return [];
+ const {
+ domain: {
+ keys: [keys]
+ }
+ } = processedData;
+ if (direction === ChartAxisDirection16.X) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef.def.valueType === "category") {
+ return keys;
+ }
+ return fixNumericExtent4(extent(keys));
+ } else {
+ const yExtent = this.domainForClippedRange(ChartAxisDirection16.Y, ["yHighValue", "yLowValue"], "xValue");
+ const fixedYExtent = findMinMax2(yExtent);
+ return fixNumericExtent4(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection16.Y, ["yHighValue", "yLowValue"], "xValue", visibleRange);
+ }
+ createNodeData() {
+ const { data, dataModel, processedData, axes } = this;
+ const xAxis = axes[ChartAxisDirection16.X];
+ const yAxis = axes[ChartAxisDirection16.Y];
+ if (!(data && xAxis && yAxis && dataModel && processedData && this.chart?.seriesRect))
+ return;
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const { xKey, yLowKey, yHighKey, connectMissingData, interpolation, fill, fillOpacity, item } = this.properties;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const xOffset = (xScale.bandwidth ?? 0) / 2;
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const yHighValues = dataModel.resolveColumnById(this, "yHighValue", processedData);
+ const yLowValues = dataModel.resolveColumnById(this, "yLowValue", processedData);
+ const xPosition = (index) => xScale.convert(xValues[index]) + xOffset;
+ const labelData = [];
+ const markerData = [];
+ const spanPoints = [];
+ const handleDatumPoint = (datumIndex, yHighValue, yLowValue) => {
+ const datum = rawData[datumIndex];
+ const xValue2 = xValues[datumIndex];
+ if (xValue2 == null)
+ return;
+ const currentSpanPoints = spanPoints.at(-1);
+ if (Number.isFinite(yHighValue) && Number.isFinite(yLowValue)) {
+ const appendMarker = (id, yValue, y) => {
+ const { size } = item[id].marker;
+ markerData.push({
+ index: datumIndex,
+ series: this,
+ itemId: id,
+ datum,
+ datumIndex,
+ midPoint: { x, y },
+ yHighValue,
+ yLowValue,
+ xValue: xValue2,
+ xKey,
+ yLowKey,
+ yHighKey,
+ point: { x, y, size },
+ enabled: true
+ });
+ const highLabelDatum = this.createLabelData({
+ datumIndex,
+ point: { x, y },
+ value: yValue,
+ yLowValue,
+ yHighValue,
+ itemId: id,
+ inverted,
+ datum,
+ series: this
+ });
+ labelData.push(highLabelDatum);
+ };
+ const inverted = yLowValue > yHighValue;
+ const x = xPosition(datumIndex);
+ const yHighCoordinate = yScale.convert(yHighValue);
+ const yLowCoordinate = yScale.convert(yLowValue);
+ appendMarker("high", yHighValue, yHighCoordinate);
+ appendMarker("low", yLowValue, yLowCoordinate);
+ const spanPoint = {
+ high: {
+ point: { x, y: yHighCoordinate },
+ xDatum: xValue2,
+ yDatum: yHighValue
+ },
+ low: {
+ point: { x, y: yLowCoordinate },
+ xDatum: xValue2,
+ yDatum: yLowValue
+ }
+ };
+ if (Array.isArray(currentSpanPoints)) {
+ currentSpanPoints.push(spanPoint);
+ } else if (currentSpanPoints == null) {
+ spanPoints.push([spanPoint]);
+ } else {
+ currentSpanPoints.skip += 1;
+ spanPoints.push([spanPoint]);
+ }
+ } else if (!connectMissingData) {
+ if (Array.isArray(currentSpanPoints) || currentSpanPoints == null) {
+ spanPoints.push({ skip: 0 });
+ } else {
+ currentSpanPoints.skip += 1;
+ }
+ }
+ };
+ const { dataAggregationFilters } = this;
+ const [r0, r1] = xScale.range;
+ const range2 = Math.abs(r1 - r0);
+ const dataAggregationFilter = dataAggregationFilters?.find((f) => f.maxRange > range2);
+ const topIndices = dataAggregationFilter?.topIndices;
+ const bottomIndices = dataAggregationFilter?.bottomIndices;
+ let [start, end] = this.visibleRangeIndices("xValue", xAxis.range, topIndices);
+ start = Math.max(start - 1, 0);
+ end = Math.min(end + 1, topIndices?.length ?? xValues.length);
+ if (processedData.input.count < 1e3) {
+ start = 0;
+ end = processedData.input.count;
+ }
+ for (let i = start; i < end; i += 1) {
+ const topDatumIndex = topIndices?.[i] ?? i;
+ const bottomDatumIndex = bottomIndices?.[i] ?? i;
+ handleDatumPoint(topDatumIndex, yHighValues[topDatumIndex], yLowValues[bottomDatumIndex]);
+ }
+ const highSpans = spanPoints.flatMap((p) => {
+ if (!Array.isArray(p))
+ return [];
+ const highPoints = p.map((d) => d.high);
+ return interpolatePoints(highPoints, interpolation);
+ });
+ const lowSpans = spanPoints.flatMap((p) => {
+ if (!Array.isArray(p))
+ return [];
+ const lowPoints = p.map((d) => d.low);
+ return interpolatePoints(lowPoints, interpolation);
+ });
+ const segments = calculateSegments2(
+ this.properties.segmentation,
+ xAxis,
+ yAxis,
+ this.chart.seriesRect,
+ this.ctx.scene,
+ false
+ );
+ let intersectionSegments = void 0;
+ if (this.properties.invertedStyle.enabled) {
+ const startsInverted = yHighValues[0] < yLowValues[0];
+ const intersectionXValues = findRangeAreaIntersections(
+ highSpans,
+ lowSpans,
+ xScale.range[0],
+ xScale.range[1],
+ startsInverted
+ );
+ intersectionSegments = calculateIntersectionSegments(
+ intersectionXValues,
+ this.chart.seriesRect,
+ this.ctx.scene,
+ startsInverted,
+ this.properties.invertedStyle
+ );
+ }
+ const getLowOrHighMarkerStyles = (lowOrHigh) => {
+ const line = item[lowOrHigh];
+ const { stroke: stroke2, strokeWidth, strokeOpacity } = line;
+ const inheritedStyles = { fill, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity };
+ return getMarkerStyles(this, line, line.marker, inheritedStyles);
+ };
+ const context = {
+ itemId: `${yLowKey}-${yHighKey}`,
+ labelData,
+ nodeData: markerData,
+ fillData: { itemId: "high", spans: highSpans, phantomSpans: lowSpans },
+ highStrokeData: { itemId: "high", spans: highSpans },
+ lowStrokeData: { itemId: "low", spans: lowSpans },
+ scales: this.calculateScaling(),
+ visible: this.visible,
+ styles: {
+ low: getLowOrHighMarkerStyles("low"),
+ high: getLowOrHighMarkerStyles("high")
+ },
+ segments,
+ intersectionSegments
+ };
+ return context;
+ }
+ createLabelData({
+ datumIndex,
+ point,
+ value,
+ itemId,
+ inverted,
+ datum,
+ series
+ }) {
+ const { xKey, yLowKey, yHighKey, xName, yName, yLowName, yHighName, legendItemName, label } = this.properties;
+ const { placement } = label;
+ const spacing = label.spacing + (typeof label.padding === "number" ? label.padding : 0);
+ let actualItemId = itemId;
+ if (inverted) {
+ actualItemId = itemId === "low" ? "high" : "low";
+ }
+ const direction = placement === "outside" && actualItemId === "high" || placement === "inside" && actualItemId === "low" ? -1 : 1;
+ const yDomain = this.getSeriesDomain(ChartAxisDirection16.Y);
+ return {
+ x: point.x,
+ y: point.y + spacing * direction,
+ series,
+ itemId,
+ datum,
+ datumIndex,
+ text: this.getLabelText(
+ value,
+ datum,
+ itemId === "high" ? yHighKey : yLowKey,
+ "y",
+ yDomain,
+ label,
+ { value, datum, itemId, xKey, yLowKey, yHighKey, xName, yLowName, yHighName, yName, legendItemName }
+ ),
+ textAlign: "center",
+ textBaseline: direction === -1 ? "bottom" : "top"
+ };
+ }
+ isPathOrSelectionDirty() {
+ const { low, high } = this.properties.item;
+ return low.marker.isDirty() || high.marker.isDirty();
+ }
+ strokewidthChange() {
+ const itemStrokeWidthChange = (lowOrHigh) => {
+ const unhighlightedStrokeWidth = this.properties.item[lowOrHigh].strokeWidth ?? 0;
+ const highlightedSeriesStrokeWidth = this.properties.highlight.highlightedSeries.item?.[lowOrHigh]?.strokeWidth ?? unhighlightedStrokeWidth;
+ const highlightedItemStrokeWidth = this.properties.highlight.highlightedItem.item?.[lowOrHigh]?.strokeWidth ?? unhighlightedStrokeWidth;
+ return unhighlightedStrokeWidth > highlightedItemStrokeWidth || highlightedSeriesStrokeWidth > highlightedItemStrokeWidth;
+ };
+ return itemStrokeWidthChange("low") || itemStrokeWidthChange("high");
+ }
+ updatePathNodes(opts) {
+ const { visible } = opts;
+ const [fillPath, lowStrokePath, highStrokePath] = opts.paths;
+ const segments = this.contextNodeData?.segments;
+ const highlightDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightState(highlightDatum, false);
+ const highlightStyle = this.getHighlightStyle();
+ const { item, fill, fillOpacity, opacity } = mergeDefaults7(
+ highlightStyle,
+ this.getStyle(false, highlightState)
+ );
+ lowStrokePath.setProperties({
+ datum: segments,
+ segments,
+ fill: void 0,
+ lineCap: "round",
+ lineJoin: "round",
+ pointerEvents: PointerEvents2.None,
+ stroke: item.low.stroke,
+ strokeWidth: item.low.strokeWidth,
+ strokeOpacity: item.low.strokeOpacity,
+ lineDash: item.low.lineDash,
+ lineDashOffset: item.low.lineDashOffset,
+ opacity,
+ visible
+ });
+ highStrokePath.setProperties({
+ segments,
+ fill: void 0,
+ lineCap: "round",
+ lineJoin: "round",
+ pointerEvents: PointerEvents2.None,
+ stroke: item.high.stroke,
+ strokeWidth: item.high.strokeWidth,
+ strokeOpacity: item.high.strokeOpacity,
+ lineDash: item.high.lineDash,
+ lineDashOffset: item.high.lineDashOffset,
+ opacity,
+ visible
+ });
+ const fillBBox = this.getShapeFillBBox();
+ applyShapeFillBBox2(fillPath, fill, fillBBox);
+ applyShapeStyle4(fillPath, { stroke: void 0, fill, fillOpacity, opacity }, fillBBox);
+ const fillSegments = this.contextNodeData?.intersectionSegments ?? segments;
+ fillPath.setProperties({
+ segments: fillSegments,
+ pointerEvents: PointerEvents2.None,
+ lineJoin: "round",
+ fillShadow: this.properties.shadow,
+ opacity,
+ visible
+ });
+ fillPath.datum = fillSegments;
+ updateClipPath(this, fillPath);
+ updateClipPath(this, lowStrokePath);
+ updateClipPath(this, highStrokePath);
+ }
+ updatePaths(opts) {
+ this.updateAreaPaths(opts.paths, opts.contextData);
+ }
+ updateAreaPaths(paths, contextData) {
+ for (const path of paths) {
+ path.visible = contextData.visible;
+ }
+ if (contextData.visible) {
+ this.updateFillPath(paths, contextData);
+ this.updateStrokePath(paths, contextData);
+ } else {
+ for (const path of paths) {
+ path.path.clear();
+ path.markDirty("RangeArea");
+ }
+ }
+ }
+ updateFillPath(paths, contextData) {
+ const [fill] = paths;
+ fill.path.clear();
+ plotAreaPathFill(fill, contextData.fillData);
+ fill.markDirty("RangeArea");
+ }
+ updateStrokePath(paths, contextData) {
+ const [, lowStroke, highStroke] = paths;
+ lowStroke.path.clear();
+ highStroke.path.clear();
+ plotLinePathStroke(lowStroke, contextData.lowStrokeData.spans);
+ plotLinePathStroke(highStroke, contextData.highStrokeData.spans);
+ lowStroke.markDirty("RangeArea");
+ highStroke.markDirty("RangeArea");
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const { processedData, axes, properties } = this;
+ const rules = properties.styler ? this.getStylerMarkerOptions().item : properties.item;
+ const { low, high } = rules;
+ const markersEnabled = markerEnabled(processedData.input.count, axes[ChartAxisDirection16.X].scale, {
+ enabled: low.marker.enabled || high.marker.enabled
+ });
+ if (properties.item.low.marker.isDirty() || properties.item.high.marker.isDirty()) {
+ datumSelection.clear();
+ datumSelection.cleanup();
+ }
+ let resolvedNodeData;
+ if (markersEnabled) {
+ if (low.marker.enabled && high.marker.enabled) {
+ resolvedNodeData = nodeData;
+ } else {
+ resolvedNodeData = [];
+ for (const datum of nodeData) {
+ if (rules[datum.itemId].marker.enabled) {
+ resolvedNodeData.push(datum);
+ }
+ }
+ }
+ } else {
+ resolvedNodeData = [];
+ }
+ return datumSelection.update(resolvedNodeData);
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ datumSelection.each((_, datum) => {
+ const highlightState = this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex);
+ const stylerStyle = this.getStyle(isHighlight, highlightState);
+ const { fill, fillOpacity, item } = stylerStyle;
+ const { stroke: stroke2, strokeWidth, strokeOpacity } = item[datum.itemId];
+ const { marker } = this.properties.item[datum.itemId];
+ const params = this.makeItemStylerParams(datum.itemId);
+ datum.style = this.getMarkerStyle(
+ marker,
+ datum,
+ params,
+ { isHighlight, highlightState, resolveMarkerSubPath: ["item", datum.itemId, "marker"] },
+ stylerStyle.item[datum.itemId].marker,
+ {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity
+ }
+ );
+ });
+ }
+ updateDatumNodes(opts) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ datumSelection.each((node, datum) => {
+ const { itemId } = datum;
+ const style = datum.style ?? contextNodeData.styles[itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ this.applyMarkerStyle(style, node, datum.point, fillBBox);
+ });
+ if (!isHighlight) {
+ this.properties.item.low.marker.markClean();
+ this.properties.item.high.marker.markClean();
+ }
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ return labelSelection.update(labelData, (text2) => {
+ text2.pointerEvents = PointerEvents2.None;
+ });
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ xKey: this.properties.xKey,
+ xName: this.properties.xName ?? this.properties.xKey,
+ yName: this.properties.yName,
+ yLowKey: this.properties.yLowKey,
+ yLowName: this.properties.yLowName ?? this.properties.yLowKey,
+ yHighKey: this.properties.yHighKey,
+ yHighName: this.properties.yHighName ?? this.properties.yHighKey,
+ legendItemName: this.properties.legendItemName
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ textNode.fillOpacity = this.getHighlightStyle(false, datum.datumIndex).opacity ?? 1;
+ updateLabelNode2(this, textNode, params, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getHighlightData(nodeData, highlightedItem) {
+ const highlightItems = nodeData.filter((nodeDatum) => nodeDatum.datum === highlightedItem.datum);
+ return highlightItems.length > 0 ? highlightItems : void 0;
+ }
+ getStyle(highlighted, highlightState) {
+ return this.getStylerCouple(highlighted, highlightState)[0];
+ }
+ getStylerMarkerOptions() {
+ return this.getStylerCouple(false)[1];
+ }
+ getStylerCouple(highlighted, highlightState) {
+ const { fill, fillOpacity, item, styler } = this.properties;
+ let stylerResult = {};
+ if (styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ stylerResult = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ const markerOpts = {
+ item: { low: { marker: { enabled: false } }, high: { marker: { enabled: false } } }
+ };
+ const makeItemResult = (lowOrHigh) => {
+ const stylerItem = stylerResult.item?.[lowOrHigh];
+ const { lineDash, lineDashOffset, marker, stroke: stroke2, strokeOpacity, strokeWidth } = item[lowOrHigh];
+ markerOpts.item[lowOrHigh].marker.enabled = stylerItem?.marker?.enabled ?? marker.enabled;
+ return {
+ marker: {
+ fill: stylerItem?.marker?.fill ?? marker.fill ?? fill,
+ fillOpacity: stylerItem?.marker?.fillOpacity ?? marker.fillOpacity,
+ shape: stylerItem?.marker?.shape ?? marker.shape,
+ size: stylerItem?.marker?.size ?? marker.size,
+ lineDash: stylerItem?.marker?.lineDash ?? marker.lineDash,
+ lineDashOffset: stylerItem?.marker?.lineDashOffset ?? marker.lineDashOffset,
+ stroke: stylerItem?.marker?.stroke ?? marker.stroke ?? stroke2,
+ strokeOpacity: stylerItem?.marker?.strokeOpacity ?? marker.strokeOpacity,
+ strokeWidth: stylerItem?.marker?.strokeWidth ?? marker.strokeWidth
+ },
+ lineDash: stylerItem?.lineDash ?? lineDash,
+ lineDashOffset: stylerItem?.lineDashOffset ?? lineDashOffset,
+ stroke: stylerItem?.stroke ?? stroke2,
+ strokeOpacity: stylerItem?.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerItem?.strokeWidth ?? strokeWidth
+ };
+ };
+ const style = {
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ opacity: 1,
+ topLevel: {
+ lineDash: this.properties.lineDash,
+ lineDashOffset: this.properties.lineDashOffset,
+ marker: this.properties.marker,
+ stroke: this.properties.stroke,
+ strokeOpacity: this.properties.strokeOpacity,
+ strokeWidth: this.properties.strokeWidth
+ },
+ item: {
+ low: makeItemResult("low"),
+ high: makeItemResult("high")
+ }
+ };
+ return [style, markerOpts];
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { id: seriesId } = this;
+ const { fill, fillOpacity, item, xKey, yHighKey, yLowKey } = this.properties;
+ const highlightState = toHighlightString2(highlightStateEnum ?? HighlightState2.None);
+ const makeItemParam = (lowOrHigh) => {
+ const { lineDash, lineDashOffset, marker, stroke: stroke2, strokeOpacity, strokeWidth } = item[lowOrHigh];
+ return {
+ marker: {
+ fill: marker.fill ?? fill,
+ fillOpacity: marker.fillOpacity,
+ size: marker.size,
+ shape: marker.shape,
+ stroke: marker.stroke ?? stroke2,
+ strokeOpacity: marker.strokeOpacity,
+ strokeWidth: marker.strokeWidth,
+ lineDash: marker.lineDash,
+ lineDashOffset: marker.lineDashOffset
+ },
+ lineDash,
+ lineDashOffset,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth
+ };
+ };
+ return {
+ item: {
+ low: makeItemParam("low"),
+ high: makeItemParam("high")
+ },
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ seriesId,
+ xKey,
+ yLowKey,
+ yHighKey
+ };
+ }
+ makeItemStylerParams(itemId) {
+ const { xKey, yLowKey, yHighKey } = this.properties;
+ return { xKey, yLowKey, yHighKey, itemId };
+ }
+ getTooltipContent(datumIndex, removeThisDatum) {
+ const itemId = removeThisDatum?.itemId ?? "high";
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { xName, yName, yLowKey, yLowName, xKey, yHighKey, yHighName, tooltip, legendItemName } = properties;
+ const xAxis = axes[ChartAxisDirection16.X];
+ const yAxis = axes[ChartAxisDirection16.Y];
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const yHighValue = dataModel.resolveColumnById(this, `yHighValue`, processedData)[datumIndex];
+ const yLowValue = dataModel.resolveColumnById(this, `yLowValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const stylerStyle = this.getStyle(false);
+ const params = this.makeItemStylerParams(itemId);
+ const format = this.getMarkerStyle(
+ this.properties.item[itemId].marker,
+ { datumIndex, datum },
+ params,
+ { isHighlight: false, resolveMarkerSubPath: ["item", itemId, "marker"] },
+ stylerStyle.item[itemId].marker
+ );
+ const value = `${this.getAxisValueText(yAxis, "tooltip", yLowValue, datum, yLowKey, legendItemName)} - ${this.getAxisValueText(yAxis, "tooltip", yHighValue, datum, yHighKey, legendItemName)}`;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ symbol: this.legendItemSymbol(),
+ data: [{ label: yName, fallbackLabel: `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`, value }]
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ itemId,
+ xName,
+ yName,
+ yLowKey,
+ yLowName,
+ xKey,
+ yHighKey,
+ yHighName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ legendItemSymbol() {
+ const { fill, topLevel } = this.getStyle(false);
+ const { stroke: stroke2, strokeWidth, strokeOpacity, lineDash, marker } = topLevel;
+ const markerStyle = {
+ shape: marker.shape,
+ fill: marker.fill ?? fill,
+ stroke: marker.stroke ?? stroke2,
+ fillOpacity: marker.fillOpacity,
+ strokeOpacity: marker.strokeOpacity,
+ strokeWidth: marker.strokeWidth,
+ lineDash: marker.lineDash,
+ lineDashOffset: marker.lineDashOffset
+ };
+ return {
+ marker: markerStyle,
+ line: {
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ lineDash
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { yLowKey, yHighKey, yName, yLowName, yHighName, legendItemName, showInLegend } = this.properties;
+ const legendItemText = legendItemName ?? yName ?? `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`;
+ const itemId = `${yLowKey}-${yHighKey}`;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId,
+ seriesId,
+ enabled: visible,
+ label: { text: `${legendItemText}` },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled;
+ }
+ onDataChange() {
+ }
+ nodeFactory() {
+ return new Marker();
+ }
+ animateEmptyUpdateReady(animationData) {
+ const { datumSelection, labelSelection, contextData, paths } = animationData;
+ const { animationManager } = this.ctx;
+ this.updateAreaPaths(paths, contextData);
+ pathSwipeInAnimation(this, animationManager, ...paths);
+ resetMotion([datumSelection], resetMarkerPositionFn);
+ markerSwipeScaleInAnimation(this, animationManager, datumSelection);
+ seriesLabelFadeInAnimation(this, "labels", animationManager, labelSelection);
+ }
+ animateReadyResize(animationData) {
+ const { contextData, paths } = animationData;
+ this.updateAreaPaths(paths, contextData);
+ super.animateReadyResize(animationData);
+ }
+ animateWaitingUpdateReady(animationData) {
+ const { animationManager } = this.ctx;
+ const { datumSelection, labelSelection, contextData, paths, previousContextData } = animationData;
+ const [fill, lowStroke, highStroke] = paths;
+ if (fill == null && lowStroke == null && highStroke == null)
+ return;
+ this.resetDatumAnimation(animationData);
+ this.resetLabelAnimation(animationData);
+ const update = () => {
+ this.resetPathAnimation(animationData);
+ this.updateAreaPaths(paths, contextData);
+ };
+ const skip = () => {
+ animationManager.skipCurrentBatch();
+ update();
+ };
+ if (contextData == null || previousContextData == null) {
+ update();
+ markerFadeInAnimation(this, animationManager, "added", datumSelection);
+ pathFadeInAnimation(this, "fill_path_properties", animationManager, "add", fill);
+ pathFadeInAnimation(this, "low_stroke_path_properties", animationManager, "add", lowStroke);
+ pathFadeInAnimation(this, "high_stroke_path_properties", animationManager, "add", highStroke);
+ seriesLabelFadeInAnimation(this, "labels", animationManager, labelSelection);
+ return;
+ }
+ const fns = prepareRangeAreaPathAnimation(
+ contextData,
+ previousContextData,
+ this.processedData?.reduced?.diff?.[this.id]
+ );
+ if (fns === void 0) {
+ skip();
+ return;
+ } else if (fns.status === "no-op") {
+ return;
+ }
+ fromToMotion(this.id, "fill_path_properties", animationManager, [fill], fns.fill.pathProperties);
+ fromToMotion(this.id, "low_stroke_path_properties", animationManager, [lowStroke], fns.stroke.pathProperties);
+ fromToMotion(this.id, "high_stroke_path_properties", animationManager, [highStroke], fns.stroke.pathProperties);
+ if (fns.status === "added") {
+ this.updateAreaPaths(paths, contextData);
+ } else if (fns.status === "removed") {
+ this.updateAreaPaths(paths, previousContextData);
+ } else {
+ pathMotion(this.id, "fill_path_update", animationManager, [fill], fns.fill.path);
+ pathMotion(this.id, "low_stroke_path_update", animationManager, [lowStroke], fns.stroke.path);
+ pathMotion(this.id, "high_stroke_path_update", animationManager, [highStroke], fns.stroke.path);
+ }
+ if (fns.hasMotion) {
+ markerFadeInAnimation(this, animationManager, void 0, datumSelection);
+ seriesLabelFadeInAnimation(this, "labels", animationManager, labelSelection);
+ }
+ this.ctx.animationManager.animate({
+ id: this.id,
+ groupId: "reset_after_animation",
+ phase: "trailing",
+ from: {},
+ to: {},
+ onComplete: () => this.updateAreaPaths(paths, contextData)
+ });
+ }
+ getFormattedMarkerStyle(datum) {
+ const stylerStyle = this.getStyle(false);
+ const params = this.makeItemStylerParams(datum.itemId);
+ return this.getMarkerStyle(
+ this.properties.item[datum.itemId].marker,
+ datum,
+ params,
+ { isHighlight: true, resolveMarkerSubPath: ["item", datum.itemId, "marker"] },
+ void 0,
+ stylerStyle
+ );
+ }
+ getMarkerStyle(marker, datum, params, opts, defaultOverrideStyle, inheritedStyle) {
+ true;
+ marker.itemStyler = this.properties.marker.itemStyler;
+ return super.getMarkerStyle(marker, datum, params, opts, defaultOverrideStyle, inheritedStyle);
+ }
+ computeFocusBounds(opts) {
+ const hiBox = computeMarkerFocusBounds(this, opts);
+ const loBox = computeMarkerFocusBounds(this, { ...opts, datumIndex: opts.datumIndex + 1 });
+ if (hiBox && loBox) {
+ return BBox13.merge([hiBox, loBox]);
+ }
+ return void 0;
+ }
+ isDatumEnabled(nodeData, datumIndex) {
+ return datumIndex % 2 === 0 && super.isDatumEnabled(nodeData, datumIndex);
+ }
+ hasItemStylers() {
+ return this.properties.styler != null || this.properties.marker.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+RangeAreaSeries.className = "RangeAreaSeries";
+RangeAreaSeries.type = "range-area";
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaSeriesOptionsDef.ts
+var import_ag_charts_community141 = require("ag-charts-community");
+var import_ag_charts_core62 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs5, rangeAreaSeriesThemeableOptionsDef } = import_ag_charts_community141._ModuleSupport;
+var rangeAreaSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs5,
+ ...rangeAreaSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core62.required)((0, import_ag_charts_core62.constant)("range-area")),
+ xKey: (0, import_ag_charts_core62.required)(import_ag_charts_core62.string),
+ yLowKey: (0, import_ag_charts_core62.required)(import_ag_charts_core62.string),
+ yHighKey: (0, import_ag_charts_core62.required)(import_ag_charts_core62.string),
+ xName: import_ag_charts_core62.string,
+ yName: import_ag_charts_core62.string,
+ yLowName: import_ag_charts_core62.string,
+ yHighName: import_ag_charts_core62.string,
+ legendItemName: import_ag_charts_core62.string,
+ segmentation: import_ag_charts_core62.shapeSegmentation,
+ invertedStyle: {
+ enabled: import_ag_charts_core62.boolean,
+ ...import_ag_charts_core62.fillOptionsDef
+ }
+};
+rangeAreaSeriesOptionsDef.pickOutsideVisibleMinorAxis = (0, import_ag_charts_core62.undocumented)(import_ag_charts_core62.boolean);
+rangeAreaSeriesOptionsDef.focusPriority = (0, import_ag_charts_core62.undocumented)(import_ag_charts_core62.number);
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaThemes.ts
+var import_ag_charts_community142 = require("ag-charts-community");
+var RANGE_AREA_ITEM = {
+ lineDash: {
+ $path: "/series/$index/lineDash"
+ },
+ lineDashOffset: {
+ $path: "/series/$index/lineDashOffset"
+ },
+ stroke: {
+ $path: ["/series/$index/stroke", { $palette: "stroke" }]
+ },
+ strokeOpacity: {
+ $path: "/series/$index/strokeOpacity"
+ },
+ strokeWidth: {
+ $path: ["/series/$index/strokeWidth", 1]
+ },
+ marker: {
+ enabled: {
+ $path: "/series/$index/marker/enabled"
+ },
+ fill: {
+ $isUserOption: [
+ "/series/$index/marker/fill",
+ {
+ $if: [
+ {
+ $or: [
+ { $isGradient: { $path: "/series/$index/marker/fill" } },
+ { $isImage: { $path: "/series/$index/marker/fill" } },
+ { $isPattern: { $path: "/series/$index/marker/fill" } }
+ ]
+ },
+ {
+ $merge: [
+ { $path: "/series/$index/marker/fill" },
+ {
+ $applySwitch: [
+ { $path: "type" },
+ void 0,
+ // default case shouldn't be hit because of $if
+ ["gradient", import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ {
+ $isUserOption: [
+ "/series/$index/marker/fill",
+ { $path: "/series/$index/marker/fill" },
+ { $palette: "fill" }
+ ]
+ }
+ ]
+ },
+ {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ fillOpacity: {
+ $path: "/series/$index/marker/fillOpacity"
+ },
+ lineDash: {
+ $path: "/series/$index/marker/lineDash"
+ },
+ lineDashOffset: {
+ $path: "/series/$index/marker/lineDashOffset"
+ },
+ shape: {
+ $path: "/series/$index/marker/shape"
+ },
+ size: {
+ $path: ["/series/$index/marker/size", 6]
+ },
+ stroke: {
+ $path: ["/series/$index/marker/stroke", { $palette: "stroke" }]
+ },
+ strokeOpacity: {
+ $path: "/series/$index/marker/strokeOpacity"
+ },
+ strokeWidth: {
+ $path: ["/series/$index/marker/strokeWidth", 2]
+ }
+ }
+};
+var RANGE_AREA_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["pattern", import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ fillOpacity: 0.7,
+ stroke: { $palette: "stroke" },
+ strokeWidth: 1,
+ marker: {
+ enabled: false,
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ shape: "circle",
+ stroke: { $palette: "stroke" },
+ size: 6,
+ strokeWidth: 2
+ },
+ nodeClickRange: "nearest",
+ item: {
+ low: RANGE_AREA_ITEM,
+ high: RANGE_AREA_ITEM
+ },
+ label: {
+ ...import_ag_charts_community142._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ placement: "outside",
+ padding: { $isUserOption: ["./spacing", 0, 10] },
+ // compatibility with old `padding` property (now named `spacing`).
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ interpolation: {
+ type: "linear"
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: import_ag_charts_community142._ModuleSupport.multiSeriesHighlightStyle(),
+ segmentation: import_ag_charts_community142._ModuleSupport.SEGMENTATION_DEFAULTS,
+ invertedStyle: {
+ enabled: false,
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ // @todo(AG-14792) should be { $path: '../fill' } to inherit from series.fill
+ ["gradient", import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ fillOpacity: { $path: "../fillOpacity" }
+ }
+ },
+ axes: {
+ [import_ag_charts_community142._ModuleSupport.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]: {
+ crosshair: { enabled: true }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/range-area/rangeAreaModule.ts
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE6, CARTESIAN_POSITION: CARTESIAN_POSITION4 }
+} = import_ag_charts_community143._ModuleSupport;
+var RangeAreaModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "range-area",
+ moduleFactory: (ctx) => new RangeAreaSeries(ctx),
+ predictAxis: import_ag_charts_community143._ModuleSupport.predictCartesianTimeAxis,
+ defaultAxes: [
+ { type: CARTESIAN_AXIS_TYPE6.NUMBER, position: CARTESIAN_POSITION4.LEFT },
+ { type: CARTESIAN_AXIS_TYPE6.CATEGORY, position: CARTESIAN_POSITION4.BOTTOM }
+ ],
+ themeTemplate: RANGE_AREA_SERIES_THEME
+};
+var RangeAreaSeriesModule = {
+ type: "series",
+ name: "range-area",
+ chartType: "cartesian",
+ enterprise: true,
+ options: rangeAreaSeriesOptionsDef,
+ create: (ctx) => new RangeAreaSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarModule.ts
+var import_ag_charts_community149 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarSeries.ts
+var import_ag_charts_community146 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarAggregation.ts
+var import_ag_charts_community144 = require("ag-charts-community");
+var { aggregationDomain: aggregationDomain3, aggregationRangeFittingPoints: aggregationRangeFittingPoints3, compactAggregationIndices: compactAggregationIndices3, createAggregationIndices: createAggregationIndices3 } = import_ag_charts_community144._ModuleSupport;
+var AGGREGATION_THRESHOLD3 = 1e3;
+function aggregateRangeBarData(scale, xValues, highValues, lowValues, domain, smallestKeyInterval) {
+ if (xValues.length < AGGREGATION_THRESHOLD3)
+ return;
+ const [d0, d1] = aggregationDomain3(scale, domain);
+ let maxRange = aggregationRangeFittingPoints3(xValues, d0, d1, { smallestKeyInterval });
+ let { indexData, valueData } = createAggregationIndices3(xValues, highValues, lowValues, d0, d1, maxRange);
+ const filters = [{ maxRange, indexData }];
+ while (maxRange > 64) {
+ ({ indexData, valueData, maxRange } = compactAggregationIndices3(indexData, valueData, maxRange));
+ filters.push({ maxRange, indexData });
+ }
+ filters.reverse();
+ return filters;
+}
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarProperties.ts
+var import_ag_charts_community145 = require("ag-charts-community");
+var { AbstractBarSeriesProperties: AbstractBarSeriesProperties3, makeSeriesTooltip: makeSeriesTooltip6, Property: Property54, DropShadow: DropShadow2, Label: Label3 } = import_ag_charts_community145._ModuleSupport;
+var RangeBarSeriesLabel = class extends Label3 {
+ constructor() {
+ super(...arguments);
+ this.placement = "inside";
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property54
+], RangeBarSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property54
+], RangeBarSeriesLabel.prototype, "spacing", 2);
+var RangeBarProperties = class extends AbstractBarSeriesProperties3 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#99CCFF";
+ this.fillOpacity = 1;
+ this.stroke = "#99CCFF";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.shadow = new DropShadow2().set({ enabled: false });
+ this.label = new RangeBarSeriesLabel();
+ this.tooltip = makeSeriesTooltip6();
+ }
+};
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "yLowKey", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "yHighKey", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "xName", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "yName", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "yLowName", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "yHighName", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "fill", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "styler", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "label", 2);
+__decorateClass([
+ Property54
+], RangeBarProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode4,
+ valueProperty: valueProperty7,
+ keyProperty: keyProperty5,
+ ChartAxisDirection: ChartAxisDirection17,
+ checkCrisp,
+ updateLabelNode: updateLabelNode3,
+ SMALLEST_KEY_INTERVAL: SMALLEST_KEY_INTERVAL3,
+ LARGEST_KEY_INTERVAL,
+ diff: diff4,
+ prepareBarAnimationFunctions,
+ midpointStartingBarPosition,
+ resetBarSelectionsFn,
+ fixNumericExtent: fixNumericExtent5,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation2,
+ resetLabelFn: resetLabelFn2,
+ animationValidation: animationValidation4,
+ computeBarFocusBounds: computeBarFocusBounds4,
+ visibleRangeIndices: visibleRangeIndices2,
+ createDatumId: createDatumId4,
+ ContinuousScale: ContinuousScale5,
+ Rect: Rect2,
+ PointerEvents: PointerEvents3,
+ motion: motion2,
+ applyShapeStyle: applyShapeStyle5,
+ findMinMax: findMinMax3,
+ areScalingEqual: areScalingEqual2,
+ processedDataIsAnimatable: processedDataIsAnimatable3,
+ AGGREGATION_SPAN: AGGREGATION_SPAN2,
+ AGGREGATION_INDEX_X_MAX: AGGREGATION_INDEX_X_MAX2,
+ AGGREGATION_INDEX_X_MIN: AGGREGATION_INDEX_X_MIN2,
+ AGGREGATION_INDEX_Y_MAX: AGGREGATION_INDEX_Y_MAX3,
+ AGGREGATION_INDEX_Y_MIN: AGGREGATION_INDEX_Y_MIN3,
+ mergeDefaults: mergeDefaults8,
+ simpleMemorize2: simpleMemorize23,
+ getItemStyles: getItemStyles2,
+ calculateSegments: calculateSegments3,
+ toHighlightString: toHighlightString3,
+ HighlightState: HighlightState3
+} = import_ag_charts_community146._ModuleSupport;
+var memoizedAggregateRangeBarData = simpleMemorize23(aggregateRangeBarData);
+var RangeBarSeriesNodeEvent = class extends import_ag_charts_community146._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.xKey;
+ this.yLowKey = series.properties.yLowKey;
+ this.yHighKey = series.properties.yHighKey;
+ }
+};
+var RangeBarSeries = class extends import_ag_charts_community146._ModuleSupport.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode4.AXIS_ALIGNED, SeriesNodePickMode4.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["xKey"],
+ y: ["yLowKey", "yHighKey"]
+ },
+ propertyNames: {
+ x: ["xName"],
+ y: ["yLowName", "yHighName", "yName"]
+ },
+ categoryKey: "xValue",
+ datumSelectionGarbageCollection: false,
+ animationResetFns: {
+ datum: resetBarSelectionsFn,
+ label: resetLabelFn2
+ }
+ });
+ this.properties = new RangeBarProperties();
+ this.dataAggregationFilters = void 0;
+ this.NodeEvent = RangeBarSeriesNodeEvent;
+ }
+ async processData(dataController) {
+ const { xKey, yLowKey, yHighKey } = this.properties;
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ if (this.processedData) {
+ extraProps.push(diff4(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation4());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const { dataModel, processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty5(xKey, xScaleType, { id: "xValue" }),
+ valueProperty7(yLowKey, yScaleType, { id: `yLowValue`, invalidValue: null, ...visibleProps }),
+ valueProperty7(yHighKey, yScaleType, { id: `yHighValue`, invalidValue: null, ...visibleProps }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL3, LARGEST_KEY_INTERVAL] : [],
+ ...extraProps
+ ],
+ groupByKeys: false
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.largestDataInterval = processedData.reduced?.largestKeyInterval;
+ this.dataAggregationFilters = this.aggregateData(dataModel, processedData);
+ this.animationState.transition("updateData");
+ }
+ aggregateData(dataModel, processedData) {
+ if (processedData.type !== "ungrouped")
+ return;
+ if (processedDataIsAnimatable3(processedData))
+ return;
+ const xAxis = this.axes[ChartAxisDirection17.X];
+ if (xAxis == null)
+ return;
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yHighValues = dataModel.resolveColumnById(this, `yHighValue`, processedData);
+ const yLowValues = dataModel.resolveColumnById(this, `yLowValue`, processedData);
+ const { index } = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ const domain = processedData.domain.keys[index];
+ return memoizedAggregateRangeBarData(
+ xAxis.scale.type,
+ xValues,
+ yHighValues,
+ yLowValues,
+ domain,
+ processedData.reduced?.smallestKeyInterval
+ );
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!processedData || !dataModel)
+ return [];
+ const {
+ keys: [keys]
+ } = processedData.domain;
+ if (direction === this.getCategoryDirection()) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef?.def.valueType === "category") {
+ return keys;
+ }
+ return this.padBandExtent(keys);
+ } else {
+ const yExtent = this.domainForClippedRange(direction, ["yHighValue", "yLowValue"], "xValue");
+ const fixedYExtent = findMinMax3(yExtent);
+ return fixNumericExtent5(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, visibleRange) {
+ return this.domainForVisibleRange(ChartAxisDirection17.Y, ["yHighValue", "yLowValue"], "xValue", visibleRange);
+ }
+ createNodeData() {
+ const { data, dataModel, groupScale, processedData, visible } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(data && xAxis && yAxis && dataModel && processedData?.dataSources && this.chart?.seriesRect))
+ return;
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const barAlongX = this.getBarDirection() === ChartAxisDirection17.X;
+ const { xKey, yLowKey, yHighKey, strokeWidth } = this.properties;
+ const itemId = `${yLowKey}-${yHighKey}`;
+ const segments = calculateSegments3(
+ this.properties.segmentation,
+ xAxis,
+ yAxis,
+ this.chart.seriesRect,
+ this.ctx.scene
+ );
+ const context = {
+ itemId,
+ nodeData: [],
+ labelData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStyles2(this.getItemStyle.bind(this)),
+ segments
+ };
+ if (!visible)
+ return context;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yLowValues = dataModel.resolveColumnById(this, `yLowValue`, processedData);
+ const yHighValues = dataModel.resolveColumnById(this, `yHighValue`, processedData);
+ const { barWidth: effectiveBarWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const barOffset = ContinuousScale5.is(xScale) ? effectiveBarWidth * -0.5 : 0;
+ const groupOffset = groupScale.convert(String(groupIndex));
+ const defaultCrisp = checkCrisp(
+ xAxis?.scale,
+ xAxis?.visibleRange,
+ this.smallestDataInterval,
+ this.largestDataInterval
+ );
+ const xPosition = (datumIndex) => Math.round(xScale.convert(xValues[datumIndex])) + groupOffset + barOffset;
+ const handleDatum = (datumIndex, groupedDataIndex, x, width, yLow, yHigh, crisp) => {
+ const datum = rawData[datumIndex];
+ const xDatum = xValues[datumIndex];
+ if (xDatum == null)
+ return;
+ const rawLowValue = yLowValues[datumIndex];
+ const rawHighValue = yHighValues[datumIndex];
+ if (!Number.isFinite(rawLowValue?.valueOf()) || !Number.isFinite(rawHighValue?.valueOf()))
+ return;
+ const [yLowValue, yHighValue] = rawLowValue < rawHighValue ? [rawLowValue, rawHighValue] : [rawHighValue, rawLowValue];
+ const y = Math.round(yScale.convert(yHigh));
+ const bottomY = Math.round(yScale.convert(yLow));
+ const height = Math.max(strokeWidth, Math.abs(bottomY - y));
+ const rect = {
+ x: barAlongX ? Math.min(y, bottomY) : x,
+ y: barAlongX ? x : Math.min(y, bottomY),
+ width: barAlongX ? height : width,
+ height: barAlongX ? width : height
+ };
+ const nodeMidPoint = {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2
+ };
+ const labelData = this.createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yLowValue,
+ yHighValue,
+ datum,
+ series: this
+ });
+ const nodeDatum = {
+ index: groupedDataIndex,
+ series: this,
+ itemId,
+ datum,
+ datumIndex,
+ xValue: xDatum,
+ yLowValue: rawLowValue,
+ yHighValue: rawHighValue,
+ yLowKey,
+ yHighKey,
+ xKey,
+ x: rect.x,
+ y: rect.y,
+ width: rect.width,
+ height: rect.height,
+ midPoint: nodeMidPoint,
+ crisp,
+ labels: labelData
+ };
+ context.nodeData.push(nodeDatum);
+ context.labelData.push(...labelData);
+ };
+ const { dataAggregationFilters } = this;
+ const [r0, r1] = xScale.range;
+ const range2 = Math.abs(r1 - r0);
+ const dataAggregationFilter = dataAggregationFilters?.find((f) => f.maxRange > range2);
+ if (dataAggregationFilter != null) {
+ const { maxRange, indexData } = dataAggregationFilter;
+ const [start, end] = visibleRangeIndices2(1, maxRange, xAxis.range, (index) => {
+ const aggIndex = index * AGGREGATION_SPAN2;
+ const xMinIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MIN2];
+ const xMaxIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MAX2];
+ if (xMinIndex === -1)
+ return;
+ const midDatumIndex = Math.trunc((xMinIndex + xMaxIndex) / 2);
+ return [xPosition(midDatumIndex), xPosition(xMaxIndex) + effectiveBarWidth];
+ });
+ for (let i = start; i < end; i += 1) {
+ const aggIndex = i * AGGREGATION_SPAN2;
+ const xMinIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MIN2];
+ const xMaxIndex = indexData[aggIndex + AGGREGATION_INDEX_X_MAX2];
+ const yMinIndex = indexData[aggIndex + AGGREGATION_INDEX_Y_MIN3];
+ const yMaxIndex = indexData[aggIndex + AGGREGATION_INDEX_Y_MAX3];
+ if (xMinIndex === -1)
+ continue;
+ const midDatumIndex = Math.trunc((xMinIndex + xMaxIndex) / 2);
+ const xValue2 = xValues[midDatumIndex];
+ if (xValue2 == null)
+ continue;
+ const x = xPosition(midDatumIndex);
+ const width = Math.abs(xPosition(xMinIndex) - xPosition(xMaxIndex)) + effectiveBarWidth;
+ const yLow = yLowValues[yMinIndex];
+ const yHigh = yHighValues[yMaxIndex];
+ handleDatum(midDatumIndex, 0, x, width, yLow, yHigh, false);
+ }
+ } else if (processedData.type === "ungrouped") {
+ const invalidData = processedData.invalidData?.get(this.id);
+ let [start, end] = this.visibleRangeIndices("xValue", xAxis.range);
+ if (processedData.input.count < 1e3) {
+ start = 0;
+ end = processedData.input.count;
+ }
+ for (let datumIndex = start; datumIndex < end; datumIndex += 1) {
+ if (invalidData?.[datumIndex] === true)
+ continue;
+ const x = xPosition(datumIndex);
+ const width = effectiveBarWidth;
+ const yLow = yLowValues[datumIndex];
+ const yHigh = yHighValues[datumIndex];
+ handleDatum(datumIndex, 0, x, width, yLow, yHigh, defaultCrisp);
+ }
+ } else {
+ for (const { datumIndex, groupIndex: groupDataIndex } of dataModel.forEachGroupDatum(this, processedData)) {
+ const x = xPosition(datumIndex);
+ const width = effectiveBarWidth;
+ const yLow = yLowValues[datumIndex];
+ const yHigh = yHighValues[datumIndex];
+ handleDatum(datumIndex, groupDataIndex, x, width, yLow, yHigh, defaultCrisp);
+ }
+ }
+ return context;
+ }
+ createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yLowValue,
+ yHighValue,
+ datum,
+ series
+ }) {
+ const { xKey, yLowKey, yHighKey, xName, yLowName, yHighName, yName, legendItemName, label } = this.properties;
+ const labelParams = { datum, xKey, yLowKey, yHighKey, xName, yLowName, yHighName, yName, legendItemName };
+ const { placement } = label;
+ const spacing = label.spacing + (typeof label.padding === "number" ? label.padding : 0);
+ const paddingDirection = placement === "outside" ? 1 : -1;
+ const labelPadding = spacing * paddingDirection;
+ const yDomain = this.getSeriesDomain(ChartAxisDirection17.Y);
+ const yLowLabel = {
+ datumIndex,
+ x: rect.x + (barAlongX ? -labelPadding : rect.width / 2),
+ y: rect.y + (barAlongX ? rect.height / 2 : rect.height + labelPadding),
+ textAlign: barAlongX ? "left" : "center",
+ textBaseline: barAlongX ? "middle" : "bottom",
+ text: this.getLabelText(
+ yLowValue,
+ datum,
+ yLowKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: "low", value: yLowValue, ...labelParams }
+ ),
+ itemId: "low",
+ datum,
+ series
+ };
+ const yHighLabel = {
+ datumIndex,
+ x: rect.x + (barAlongX ? rect.width + labelPadding : rect.width / 2),
+ y: rect.y + (barAlongX ? rect.height / 2 : -labelPadding),
+ textAlign: barAlongX ? "right" : "center",
+ textBaseline: barAlongX ? "middle" : "top",
+ text: this.getLabelText(
+ yHighValue,
+ datum,
+ yHighKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: "high", value: yHighValue, ...labelParams }
+ ),
+ itemId: "high",
+ datum,
+ series
+ };
+ if (placement === "outside") {
+ yLowLabel.textAlign = barAlongX ? "right" : "center";
+ yLowLabel.textBaseline = barAlongX ? "middle" : "top";
+ yHighLabel.textAlign = barAlongX ? "left" : "center";
+ yHighLabel.textBaseline = barAlongX ? "middle" : "bottom";
+ }
+ return [yLowLabel, yHighLabel];
+ }
+ nodeFactory() {
+ return new Rect2();
+ }
+ getStyle(ignoreStylerCallback, highlighted, highlightState) {
+ const {
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ styler
+ } = this.properties;
+ let stylerResult = {};
+ if (!ignoreStylerCallback && styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ stylerResult = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ return {
+ cornerRadius: stylerResult.cornerRadius ?? cornerRadius,
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ opacity: 1,
+ stroke: stylerResult.stroke ?? stroke2,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth
+ };
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { id: seriesId } = this;
+ const {
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ xKey,
+ yLowKey,
+ yHighKey
+ } = this.properties;
+ const highlightState = toHighlightString3(highlightStateEnum ?? HighlightState3.None);
+ return {
+ cornerRadius,
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ lineDash,
+ lineDashOffset,
+ seriesId,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ xKey,
+ yLowKey,
+ yHighKey
+ };
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data, void 0, (datum) => this.getDatumId(datum));
+ }
+ getItemStyle(datumIndex, isHighlight, highlightState) {
+ const { properties, dataModel, processedData } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ let style = mergeDefaults8(highlightStyle, this.getStyle(datumIndex === void 0, isHighlight, highlightState));
+ if (itemStyler && dataModel != null && processedData != null && datumIndex != null) {
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const overrides = this.cachedDatumCallback(
+ createDatumId4(this.getDatumId({ xValue: xValue2 }), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults8(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datumIndex, isHighlight, style) {
+ const { id: seriesId, properties, processedData } = this;
+ const { xKey, yHighKey, yLowKey } = properties;
+ const datum = processedData.dataSources.get(seriesId)?.data[datumIndex];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ xKey,
+ yHighKey,
+ yLowKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles(opts) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ opts.datumSelection.each((node, datum) => {
+ if (!opts.datumSelection.isGarbage(node)) {
+ const highlightState = this.getHighlightState(highlightedDatum, opts.isHighlight, datum.datumIndex);
+ datum.style = this.getItemStyle(datum.datumIndex, opts.isHighlight, highlightState);
+ }
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const categoryAlongX = this.getCategoryDirection() === ChartAxisDirection17.X;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const style = datum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ applyShapeStyle5(rect, style, fillBBox);
+ rect.cornerRadius = style.cornerRadius ?? 0;
+ rect.visible = categoryAlongX ? datum.width > 0 : datum.height > 0;
+ rect.crisp = datum.crisp;
+ });
+ }
+ updateLabelSelection(opts) {
+ const labelData = this.properties.label.enabled ? opts.labelData : [];
+ return opts.labelSelection.update(labelData, (text2) => {
+ text2.pointerEvents = PointerEvents3.None;
+ });
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ xKey: this.properties.xKey,
+ xName: this.properties.xName ?? this.properties.xKey,
+ yName: this.properties.yName,
+ yLowKey: this.properties.yLowKey,
+ yLowName: this.properties.yLowName ?? this.properties.yLowKey,
+ yHighKey: this.properties.yHighKey,
+ yHighName: this.properties.yHighName ?? this.properties.yHighKey,
+ legendItemName: this.properties.legendItemName
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ textNode.fillOpacity = this.getHighlightStyle(false, datum?.datumIndex).opacity ?? 1;
+ updateLabelNode3(this, textNode, params, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { xKey, xName, yName, yLowKey, yHighKey, yLowName, yHighName, tooltip, legendItemName } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const yHighValue = dataModel.resolveColumnById(this, `yHighValue`, processedData)[datumIndex];
+ const yLowValue = dataModel.resolveColumnById(this, `yLowValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const format = this.getItemStyle(datumIndex, false);
+ const value = `${this.getAxisValueText(yAxis, "tooltip", yLowValue, datum, yLowKey, legendItemName)} - ${this.getAxisValueText(yAxis, "tooltip", yHighValue, datum, yHighKey, legendItemName)}`;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ symbol: this.legendItemSymbol(),
+ data: [{ label: yName, fallbackLabel: `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`, value }]
+ },
+ {
+ seriesId,
+ datum,
+ title: yName,
+ xKey,
+ xName,
+ yName,
+ yLowKey,
+ yHighKey,
+ yLowName,
+ yHighName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ legendItemSymbol() {
+ const { fill, stroke: stroke2, strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset } = this.getStyle(
+ false,
+ false,
+ HighlightState3.None
+ );
+ return {
+ marker: {
+ fill,
+ stroke: stroke2,
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { yName, yLowName, yHighName, yLowKey, yHighKey, legendItemName, showInLegend } = this.properties;
+ const legendItemText = legendItemName ?? yName ?? `${yLowName ?? yLowKey} - ${yHighName ?? yHighKey}`;
+ const itemId = `${yLowKey}-${yHighKey}`;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId,
+ seriesId,
+ enabled: visible,
+ label: { text: `${legendItemText}` },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ animateEmptyUpdateReady({ datumSelection, labelSelection }) {
+ const fns = prepareBarAnimationFunctions(midpointStartingBarPosition(this.isVertical(), "normal"), "unknown");
+ motion2.fromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], fns);
+ seriesLabelFadeInAnimation2(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateWaitingUpdateReady(data) {
+ const { datumSelection: datumSelections, labelSelection, contextData, previousContextData } = data;
+ const dataDiff = import_ag_charts_community146._ModuleSupport.calculateDataDiff(
+ this.id,
+ datumSelections,
+ this.getDatumId.bind(this),
+ contextData,
+ previousContextData,
+ this.processedData,
+ this.processedDataUpdated
+ );
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ const mode = previousContextData == null ? "fade" : "normal";
+ const fns = prepareBarAnimationFunctions(midpointStartingBarPosition(this.isVertical(), mode), "added");
+ motion2.fromToMotion(
+ this.id,
+ "datums",
+ this.ctx.animationManager,
+ [datumSelections],
+ fns,
+ (_, datum) => this.getDatumId(datum),
+ dataDiff
+ );
+ if (dataDiff?.changed || !areScalingEqual2(contextData.groupScale, previousContextData?.groupScale)) {
+ seriesLabelFadeInAnimation2(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ }
+ getDatumId(datum) {
+ return `${datum.xValue}`;
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled;
+ }
+ onDataChange() {
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds4(this, this.contextNodeData?.nodeData[datumIndex]);
+ }
+ hasItemStylers() {
+ return this.properties.styler != null || this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+RangeBarSeries.className = "RangeBarSeries";
+RangeBarSeries.type = "range-bar";
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarSeriesOptionsDef.ts
+var import_ag_charts_community147 = require("ag-charts-community");
+var import_ag_charts_core63 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs6, rangeBarSeriesThemeableOptionsDef } = import_ag_charts_community147._ModuleSupport;
+var rangeBarSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs6,
+ ...rangeBarSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core63.required)((0, import_ag_charts_core63.constant)("range-bar")),
+ xKey: (0, import_ag_charts_core63.required)(import_ag_charts_core63.string),
+ yLowKey: (0, import_ag_charts_core63.required)(import_ag_charts_core63.string),
+ yHighKey: (0, import_ag_charts_core63.required)(import_ag_charts_core63.string),
+ xName: import_ag_charts_core63.string,
+ yName: import_ag_charts_core63.string,
+ yLowName: import_ag_charts_core63.string,
+ yHighName: import_ag_charts_core63.string,
+ legendItemName: import_ag_charts_core63.string,
+ segmentation: import_ag_charts_core63.shapeSegmentation
+};
+rangeBarSeriesOptionsDef.pickOutsideVisibleMinorAxis = (0, import_ag_charts_core63.undocumented)(import_ag_charts_core63.boolean);
+rangeBarSeriesOptionsDef.focusPriority = (0, import_ag_charts_core63.undocumented)(import_ag_charts_core63.number);
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarThemes.ts
+var import_ag_charts_community148 = require("ag-charts-community");
+var RANGE_BAR_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", import_ag_charts_community148._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", import_ag_charts_community148._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community148._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ ...import_ag_charts_community148._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" },
+ placement: "inside",
+ padding: { $isUserOption: ["./spacing", 0, 6] }
+ // compatibility with old `padding` property (now named `spacing`).
+ },
+ highlight: import_ag_charts_community148._ModuleSupport.multiSeriesHighlightStyle(),
+ segmentation: import_ag_charts_community148._ModuleSupport.SEGMENTATION_DEFAULTS
+ },
+ axes: {
+ [import_ag_charts_community148._ModuleSupport.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]: {
+ crosshair: { enabled: true }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/range-bar/rangeBarModule.ts
+var RangeBarModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "range-bar",
+ moduleFactory: (ctx) => new RangeBarSeries(ctx),
+ predictAxis: import_ag_charts_community149._ModuleSupport.predictCartesianTimeAxis,
+ defaultAxes: import_ag_charts_community149._ModuleSupport.DIRECTION_SWAP_AXES,
+ themeTemplate: RANGE_BAR_SERIES_THEME,
+ groupable: true
+};
+var RangeBarSeriesModule = {
+ type: "series",
+ name: "range-bar",
+ chartType: "cartesian",
+ enterprise: true,
+ options: rangeBarSeriesOptionsDef,
+ create: (ctx) => new RangeBarSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallModule.ts
+var import_ag_charts_community154 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeries.ts
+var import_ag_charts_community151 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeriesProperties.ts
+var import_ag_charts_community150 = require("ag-charts-community");
+var { AbstractBarSeriesProperties: AbstractBarSeriesProperties4, BaseProperties: BaseProperties19, PropertiesArray: PropertiesArray4, makeSeriesTooltip: makeSeriesTooltip7, Property: Property55, DropShadow: DropShadow3, Label: Label4 } = import_ag_charts_community150._ModuleSupport;
+var WaterfallSeriesTotal = class extends BaseProperties19 {
+};
+__decorateClass([
+ Property55
+], WaterfallSeriesTotal.prototype, "totalType", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesTotal.prototype, "index", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesTotal.prototype, "axisLabel", 2);
+var WaterfallSeriesItemTooltip = class extends BaseProperties19 {
+};
+__decorateClass([
+ Property55
+], WaterfallSeriesItemTooltip.prototype, "renderer", 2);
+var WaterfallSeriesLabel = class extends Label4 {
+ constructor() {
+ super(...arguments);
+ this.placement = "outside-end";
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property55
+], WaterfallSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesLabel.prototype, "spacing", 2);
+var WaterfallSeriesItem = class extends BaseProperties19 {
+ constructor() {
+ super(...arguments);
+ this.fill = "#c16068";
+ this.stroke = "#c16068";
+ this.fillOpacity = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.strokeWidth = 1;
+ this.cornerRadius = 0;
+ this.shadow = new DropShadow3().set({ enabled: false });
+ this.label = new WaterfallSeriesLabel();
+ this.tooltip = new WaterfallSeriesItemTooltip();
+ }
+};
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "name", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "fill", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "stroke", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "lineDash", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "itemStyler", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "shadow", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "label", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItem.prototype, "tooltip", 2);
+var WaterfallSeriesConnectorLine = class extends BaseProperties19 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.strokeWidth = 2;
+ }
+};
+__decorateClass([
+ Property55
+], WaterfallSeriesConnectorLine.prototype, "enabled", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesConnectorLine.prototype, "stroke", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesConnectorLine.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesConnectorLine.prototype, "lineDash", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesConnectorLine.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesConnectorLine.prototype, "strokeWidth", 2);
+var WaterfallSeriesItems = class extends BaseProperties19 {
+ constructor() {
+ super(...arguments);
+ this.positive = new WaterfallSeriesItem();
+ this.negative = new WaterfallSeriesItem();
+ this.total = new WaterfallSeriesItem();
+ }
+};
+__decorateClass([
+ Property55
+], WaterfallSeriesItems.prototype, "positive", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItems.prototype, "negative", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesItems.prototype, "total", 2);
+var WaterfallSeriesProperties = class extends AbstractBarSeriesProperties4 {
+ constructor() {
+ super(...arguments);
+ this.item = new WaterfallSeriesItems();
+ this.totals = new PropertiesArray4(WaterfallSeriesTotal);
+ this.line = new WaterfallSeriesConnectorLine();
+ this.tooltip = makeSeriesTooltip7();
+ }
+ getStyle(itemId) {
+ const { fillOpacity, strokeWidth, strokeOpacity, fill, stroke: stroke2, lineDash, lineDashOffset, cornerRadius } = this.item[itemId === "subtotal" ? "total" : itemId];
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "xKey", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "yKey", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "xName", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "yName", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "item", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "totals", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "line", 2);
+__decorateClass([
+ Property55
+], WaterfallSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeries.ts
+var {
+ adjustLabelPlacement,
+ SeriesNodePickMode: SeriesNodePickMode5,
+ fixNumericExtent: fixNumericExtent6,
+ valueProperty: valueProperty8,
+ keyProperty: keyProperty6,
+ accumulativeValueProperty,
+ trailingAccumulatedValueProperty,
+ ChartAxisDirection: ChartAxisDirection18,
+ createDatumId: createDatumId5,
+ checkCrisp: checkCrisp2,
+ updateLabelNode: updateLabelNode4,
+ prepareBarAnimationFunctions: prepareBarAnimationFunctions2,
+ collapsedStartingBarPosition,
+ resetBarSelectionsFn: resetBarSelectionsFn2,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation3,
+ resetLabelFn: resetLabelFn3,
+ animationValidation: animationValidation5,
+ DEFAULT_CARTESIAN_DIRECTION_KEYS: DEFAULT_CARTESIAN_DIRECTION_KEYS2,
+ DEFAULT_CARTESIAN_DIRECTION_NAMES: DEFAULT_CARTESIAN_DIRECTION_NAMES2,
+ computeBarFocusBounds: computeBarFocusBounds5,
+ isContinuous,
+ Rect: Rect3,
+ motion: motion3,
+ applyShapeStyle: applyShapeStyle6,
+ mergeDefaults: mergeDefaults9,
+ getItemStylesPerItemId: getItemStylesPerItemId2,
+ DataSet
+} = import_ag_charts_community151._ModuleSupport;
+var WaterfallSeries = class extends import_ag_charts_community151._ModuleSupport.AbstractBarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ propertyKeys: DEFAULT_CARTESIAN_DIRECTION_KEYS2,
+ propertyNames: DEFAULT_CARTESIAN_DIRECTION_NAMES2,
+ categoryKey: void 0,
+ pickModes: [SeriesNodePickMode5.NEAREST_NODE, SeriesNodePickMode5.EXACT_SHAPE_MATCH],
+ pathsPerSeries: ["connector"],
+ pathsZIndexSubOrderOffset: [-1, -1],
+ animationResetFns: {
+ datum: resetBarSelectionsFn2,
+ label: resetLabelFn3
+ }
+ });
+ this.properties = new WaterfallSeriesProperties();
+ this.seriesItemTypes = /* @__PURE__ */ new Set(["positive", "negative", "total"]);
+ }
+ async processData(dataController) {
+ const { xKey, yKey, totals } = this.properties;
+ const { data } = this;
+ if (!this.visible)
+ return;
+ const positiveNumber3 = (v) => isContinuous(v) && Number(v) >= 0;
+ const negativeNumber = (v) => isContinuous(v) && Number(v) >= 0;
+ const totalTypeValue = (v) => v === "total" || v === "subtotal";
+ const propertyDefinition = { missingValue: void 0, invalidValue: void 0 };
+ const dataWithTotals = [];
+ const totalsMap = totals.reduce((result, total) => {
+ const totalsAtIndex = result.get(total.index);
+ if (totalsAtIndex) {
+ totalsAtIndex.push(total);
+ } else {
+ result.set(total.index, [total]);
+ }
+ return result;
+ }, /* @__PURE__ */ new Map());
+ for (const [i, datum] of data?.data.entries() ?? []) {
+ dataWithTotals.push(datum);
+ const totalsAtIndex = totalsMap.get(i);
+ if (totalsAtIndex) {
+ for (const total of totalsAtIndex) {
+ dataWithTotals.push({ ...total.toJson(), [xKey]: total.axisLabel });
+ }
+ }
+ }
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ extraProps.push(animationValidation5());
+ }
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const { processedData } = await this.requestDataModel(
+ dataController,
+ DataSet.wrap(dataWithTotals),
+ {
+ props: [
+ keyProperty6(xKey, xScaleType, { id: `xValue` }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yCurrent`
+ }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ missingValue: 0,
+ id: `yCurrentTotal`
+ }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yCurrentPositive`,
+ validation: positiveNumber3
+ }),
+ accumulativeValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yCurrentNegative`,
+ validation: negativeNumber
+ }),
+ trailingAccumulatedValueProperty(yKey, yScaleType, {
+ ...propertyDefinition,
+ id: `yPrevious`
+ }),
+ valueProperty8(yKey, yScaleType, { id: `yRaw` }),
+ // Raw value pass-through.
+ valueProperty8("totalType", "category", {
+ id: `totalTypeValue`,
+ missingValue: void 0,
+ validation: totalTypeValue
+ }),
+ ...isContinuousX ? [import_ag_charts_community151._ModuleSupport.SMALLEST_KEY_INTERVAL, import_ag_charts_community151._ModuleSupport.LARGEST_KEY_INTERVAL] : [],
+ ...extraProps
+ ]
+ }
+ );
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.largestDataInterval = processedData.reduced?.largestKeyInterval;
+ this.updateSeriesItemTypes();
+ this.animationState.transition("updateData");
+ }
+ getSeriesDomain(direction) {
+ const { processedData, dataModel } = this;
+ if (!processedData || !dataModel)
+ return [];
+ const {
+ keys: [keys],
+ values
+ } = processedData.domain;
+ if (direction === this.getCategoryDirection()) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef?.def.valueType === "category") {
+ return keys;
+ }
+ const isDirectionY = direction === ChartAxisDirection18.Y;
+ const isReversed = this.getCategoryAxis().isReversed();
+ return this.padBandExtent(keys, isReversed !== isDirectionY);
+ } else {
+ const yCurrIndex = dataModel.resolveProcessedDataIndexById(this, "yCurrent");
+ const yExtent = values[yCurrIndex];
+ const fixedYExtent = [Math.min(0, yExtent[0]), Math.max(0, yExtent[1])];
+ return fixNumericExtent6(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ createNodeData() {
+ const { data, dataModel, processedData } = this;
+ const categoryAxis = this.getCategoryAxis();
+ const valueAxis = this.getValueAxis();
+ if (!data || !categoryAxis || !valueAxis || !dataModel || !processedData) {
+ return;
+ }
+ const { line } = this.properties;
+ const xScale = categoryAxis.scale;
+ const yScale = valueAxis.scale;
+ const barAlongX = this.getBarDirection() === ChartAxisDirection18.X;
+ const barWidth = this.getBandwidth(categoryAxis) ?? 10;
+ const categoryAxisReversed = categoryAxis.isReversed();
+ const valueAxisReversed = valueAxis.isReversed();
+ if (processedData.type !== "ungrouped")
+ return;
+ const context = {
+ itemId: this.properties.yKey,
+ nodeData: [],
+ labelData: [],
+ pointData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible,
+ styles: getItemStylesPerItemId2(this.getItemStyle.bind(this), "total", "subtotal", "positive", "negative")
+ };
+ if (!this.visible)
+ return context;
+ const pointData = [];
+ const xValues = dataModel.resolveKeysById(this, `xValue`, processedData);
+ const yRawValues = dataModel.resolveColumnById(this, `yRaw`, processedData);
+ const totalTypeValues = dataModel.resolveColumnById(
+ this,
+ `totalTypeValue`,
+ processedData
+ );
+ const yCurrValues = dataModel.resolveColumnById(this, "yCurrent", processedData);
+ const yPrevValues = dataModel.resolveColumnById(this, "yPrevious", processedData);
+ const yCurrTotalValues = dataModel.resolveColumnById(this, "yCurrentTotal", processedData);
+ const yDomain = this.getSeriesDomain(ChartAxisDirection18.Y);
+ const crisp = checkCrisp2(
+ categoryAxis?.scale,
+ categoryAxis?.visibleRange,
+ this.smallestDataInterval,
+ this.largestDataInterval
+ );
+ function getValues(isTotal, isSubtotal, datumIndex) {
+ if (isTotal || isSubtotal) {
+ return {
+ cumulativeValue: yCurrTotalValues[datumIndex],
+ trailingValue: isSubtotal ? trailingSubtotal : 0
+ };
+ }
+ return {
+ cumulativeValue: yCurrValues[datumIndex],
+ trailingValue: yPrevValues[datumIndex]
+ };
+ }
+ function getValue(isTotal, isSubtotal, rawValue, cumulativeValue, trailingValue) {
+ if (isTotal) {
+ return cumulativeValue;
+ }
+ if (isSubtotal) {
+ return (cumulativeValue ?? 0) - (trailingValue ?? 0);
+ }
+ return rawValue;
+ }
+ let trailingSubtotal = 0;
+ const { xKey, yKey, xName, yName } = this.properties;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const datumType = totalTypeValues[datumIndex];
+ const isSubtotal = this.isSubtotal(datumType);
+ const isTotal = this.isTotal(datumType);
+ const isTotalOrSubtotal = isTotal || isSubtotal;
+ const xDatum = xValues[datumIndex];
+ if (xDatum == null)
+ continue;
+ const x = Math.round(xScale.convert(xDatum));
+ const rawValue = yRawValues[datumIndex];
+ const { cumulativeValue, trailingValue } = getValues(isTotal, isSubtotal, datumIndex);
+ if (isTotalOrSubtotal) {
+ trailingSubtotal = cumulativeValue ?? 0;
+ }
+ const currY = Math.round(yScale.convert(cumulativeValue));
+ const trailY = Math.round(yScale.convert(trailingValue));
+ const value = getValue(isTotal, isSubtotal, rawValue, cumulativeValue, trailingValue);
+ const isPositive = (value ?? 0) >= 0;
+ const seriesItemType = this.getSeriesItemType(isPositive, datumType);
+ const { strokeWidth, label } = this.getItemConfig(seriesItemType);
+ const y = isPositive ? currY : trailY;
+ const bottomY = isPositive ? trailY : currY;
+ const barHeight = Math.max(strokeWidth, Math.abs(bottomY - y));
+ const rect = {
+ x: barAlongX ? Math.min(y, bottomY) : x,
+ y: barAlongX ? x : Math.min(y, bottomY),
+ width: barAlongX ? barHeight : barWidth,
+ height: barAlongX ? barWidth : barHeight
+ };
+ const nodeMidPoint = {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2
+ };
+ const pointY = isTotalOrSubtotal ? currY : trailY;
+ const pixelAlignmentOffset = Math.floor(line.strokeWidth) % 2 / 2;
+ const startY = categoryAxisReversed ? currY : pointY;
+ const stopY = categoryAxisReversed ? pointY : currY;
+ let startCoordinates;
+ let stopCoordinates;
+ if (barAlongX) {
+ startCoordinates = {
+ x: startY + pixelAlignmentOffset,
+ y: rect.y
+ };
+ stopCoordinates = {
+ x: stopY + pixelAlignmentOffset,
+ y: rect.y + rect.height
+ };
+ } else {
+ startCoordinates = {
+ x: rect.x,
+ y: startY + pixelAlignmentOffset
+ };
+ stopCoordinates = {
+ x: rect.x + rect.width,
+ y: stopY + pixelAlignmentOffset
+ };
+ }
+ const pathPoint = {
+ // lineTo
+ x: categoryAxisReversed ? stopCoordinates.x : startCoordinates.x,
+ y: categoryAxisReversed ? stopCoordinates.y : startCoordinates.y,
+ // moveTo
+ x2: categoryAxisReversed ? startCoordinates.x : stopCoordinates.x,
+ y2: categoryAxisReversed ? startCoordinates.y : stopCoordinates.y,
+ size: 0
+ };
+ pointData.push(pathPoint);
+ const itemId = seriesItemType === "subtotal" ? "total" : seriesItemType;
+ const labelText = this.getLabelText(
+ value,
+ datum,
+ yKey,
+ "y",
+ yDomain,
+ label,
+ {
+ itemId,
+ value,
+ datum,
+ xKey,
+ yKey,
+ xName,
+ yName
+ }
+ );
+ const spacing = label.spacing + (typeof label.padding === "number" ? label.padding : 0);
+ const nodeDatum = {
+ index: datumIndex,
+ series: this,
+ itemId: seriesItemType,
+ datum,
+ datumIndex,
+ cumulativeValue: cumulativeValue ?? 0,
+ xValue: xDatum,
+ yValue: value,
+ yKey,
+ xKey,
+ x: rect.x,
+ y: rect.y,
+ width: rect.width,
+ height: rect.height,
+ midPoint: nodeMidPoint,
+ crisp,
+ label: {
+ text: labelText,
+ ...adjustLabelPlacement({
+ isUpward: (value ?? -1) >= 0 !== valueAxisReversed,
+ isVertical: !barAlongX,
+ placement: label.placement,
+ spacing,
+ rect
+ })
+ }
+ };
+ context.nodeData.push(nodeDatum);
+ context.labelData.push(nodeDatum);
+ }
+ const connectorLinesEnabled = this.properties.line.enabled;
+ if (yCurrValues != null && connectorLinesEnabled) {
+ context.pointData = pointData;
+ }
+ return context;
+ }
+ updateSeriesItemTypes() {
+ const { dataModel, seriesItemTypes, processedData } = this;
+ if (!dataModel || !processedData) {
+ return;
+ }
+ seriesItemTypes.clear();
+ const yPositiveIndex = dataModel.resolveProcessedDataIndexById(this, "yCurrentPositive");
+ const yNegativeIndex = dataModel.resolveProcessedDataIndexById(this, "yCurrentNegative");
+ const totalTypeIndex = dataModel.resolveProcessedDataIndexById(this, `totalTypeValue`);
+ const positiveDomain = processedData.domain.values[yPositiveIndex] ?? [];
+ const negativeDomain = processedData.domain.values[yNegativeIndex] ?? [];
+ if (positiveDomain.length > 0) {
+ seriesItemTypes.add("positive");
+ }
+ if (negativeDomain.length > 0) {
+ seriesItemTypes.add("negative");
+ }
+ const itemTypes = processedData?.domain.values[totalTypeIndex];
+ if (!itemTypes) {
+ return;
+ }
+ for (const type of itemTypes) {
+ if (type === "total" || type === "subtotal") {
+ seriesItemTypes.add("total");
+ }
+ }
+ }
+ isSubtotal(datumType) {
+ return datumType === "subtotal";
+ }
+ isTotal(datumType) {
+ return datumType === "total";
+ }
+ nodeFactory() {
+ return new Rect3();
+ }
+ getSeriesItemType(isPositive, datumType) {
+ return datumType ?? (isPositive ? "positive" : "negative");
+ }
+ getItemConfig(seriesItemType) {
+ switch (seriesItemType) {
+ case "positive": {
+ return this.properties.item.positive;
+ }
+ case "negative": {
+ return this.properties.item.negative;
+ }
+ case "subtotal":
+ case "total": {
+ return this.properties.item.total;
+ }
+ }
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data);
+ }
+ getItemStyle(nodeDatum, isHighlight, highlightState, itemId = "total") {
+ const { properties } = this;
+ const { datumIndex = 0, datum } = nodeDatum ?? {};
+ const propertyItemId = itemId === "subtotal" ? "total" : itemId;
+ const item = properties.item[propertyItemId];
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex, highlightState);
+ const baseStyle = mergeDefaults9(highlightStyle, properties.getStyle(itemId));
+ const { itemStyler } = item;
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId5(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(itemId, datumIndex, datum, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`, "item", propertyItemId],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults9(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(itemId, datumIndex, datum, isHighlight, style) {
+ const { id: seriesId, properties } = this;
+ const { xKey, yKey } = properties;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ itemId,
+ datum,
+ xKey,
+ yKey,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, datum) => {
+ datum.style = this.getItemStyle(datum, isHighlight, void 0, datum.itemId);
+ });
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const categoryAlongX = this.getCategoryDirection() === ChartAxisDirection18.X;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const style = datum.style ?? contextNodeData.styles[datum.itemId][this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ applyShapeStyle6(rect, style, fillBBox);
+ rect.cornerRadius = style.cornerRadius ?? 0;
+ rect.visible = categoryAlongX ? datum.width > 0 : datum.height > 0;
+ rect.crisp = datum.crisp;
+ });
+ }
+ updateLabelSelection(opts) {
+ const { labelData, labelSelection } = opts;
+ if (labelData.length === 0) {
+ return labelSelection.update([]);
+ }
+ const data = labelData.filter((labelDatum) => {
+ const { label } = this.getItemConfig(labelDatum.itemId);
+ return label.enabled;
+ });
+ return labelSelection.update(data);
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ itemId: "positive",
+ xKey: this.properties.xKey,
+ xName: this.properties.xName ?? this.properties.xName,
+ yKey: this.properties.yKey,
+ yName: this.properties.yName ?? this.properties.yName
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ params.itemId = datum.itemId;
+ textNode.fillOpacity = this.getHighlightStyle(false, datum.datumIndex)?.opacity ?? 1;
+ const label = this.getItemConfig(datum.itemId).label;
+ updateLabelNode4(this, textNode, params, label, datum.label, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { xKey, xName, yKey, yName, tooltip, legendItemName } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, `xValue`, processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yRaw`, processedData)[datumIndex];
+ const yCurrTotalValues = dataModel.resolveColumnById(this, "yCurrentTotal", processedData);
+ const totalTypeValues = dataModel.resolveColumnById(
+ this,
+ `totalTypeValue`,
+ processedData
+ );
+ if (xValue2 == null)
+ return;
+ const datumType = totalTypeValues[datumIndex];
+ const isPositive = (yValue ?? 0) >= 0;
+ const seriesItemType = this.getSeriesItemType(isPositive, datumType);
+ let total;
+ if (this.isTotal(datumType)) {
+ total = yCurrTotalValues[datumIndex];
+ } else if (this.isSubtotal(datumType)) {
+ total = yCurrTotalValues[datumIndex];
+ for (let previousIndex = datumIndex - 1; previousIndex >= 0; previousIndex -= 1) {
+ if (this.isSubtotal(totalTypeValues[previousIndex])) {
+ total = total - yCurrTotalValues[previousIndex];
+ break;
+ }
+ }
+ } else {
+ total = yValue;
+ }
+ const nodeDatum = this.contextNodeData?.nodeData?.[datumIndex];
+ const format = this.getItemStyle(nodeDatum, false, void 0, nodeDatum?.itemId);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, xKey, legendItemName),
+ symbol: this.legendItemSymbol(seriesItemType),
+ data: [
+ {
+ label: yName,
+ fallbackLabel: yKey,
+ value: this.getAxisValueText(yAxis, "tooltip", total, datum, yKey, legendItemName)
+ }
+ ]
+ },
+ { seriesId, datum, title: yName, itemId: seriesItemType, xKey, xName, yKey, yName, ...format }
+ );
+ }
+ legendItemSymbol(item) {
+ const { fill, stroke: stroke2, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.getItemConfig(item);
+ return {
+ marker: {
+ fill,
+ stroke: stroke2,
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id, seriesItemTypes } = this;
+ const legendData = [];
+ const capitalise = (text2) => text2.charAt(0).toUpperCase() + text2.substring(1);
+ const { showInLegend } = this.properties;
+ for (const item of seriesItemTypes) {
+ const { name } = this.getItemConfig(item);
+ legendData.push({
+ legendType: "category",
+ id,
+ itemId: item,
+ seriesId: id,
+ enabled: true,
+ label: { text: name ?? capitalise(item) },
+ symbol: this.legendItemSymbol(item),
+ hideInLegend: !showInLegend,
+ isFixed: true
+ });
+ }
+ return legendData;
+ }
+ toggleSeriesItem() {
+ }
+ animateEmptyUpdateReady(opts) {
+ const { datumSelection, labelSelection, contextData } = opts;
+ const fns = prepareBarAnimationFunctions2(
+ collapsedStartingBarPosition(this.isVertical(), this.axes, "normal"),
+ "unknown"
+ );
+ motion3.fromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], fns);
+ seriesLabelFadeInAnimation3(this, "labels", this.ctx.animationManager, labelSelection);
+ const { pointData } = contextData;
+ if (!pointData)
+ return;
+ if (this.isVertical()) {
+ this.animateConnectorLinesVertical(opts);
+ } else {
+ this.animateConnectorLinesHorizontal(opts);
+ }
+ }
+ animateConnectorLinesHorizontal(opts) {
+ const { pointData = [] } = opts.contextData;
+ const [lineNode] = opts.paths;
+ const { path: linePath } = lineNode;
+ this.updateLineNode(lineNode);
+ const valueAxis = this.getValueAxis();
+ const valueAxisReversed = valueAxis?.isReversed();
+ const compare = valueAxisReversed ? (v, v2) => v < v2 : (v, v2) => v > v2;
+ const startX = valueAxis?.scale.convert(0);
+ const endX = pointData.reduce(
+ (end, point) => {
+ if (compare(point.x, end)) {
+ end = point.x;
+ }
+ return end;
+ },
+ valueAxisReversed ? Infinity : 0
+ );
+ const scale = (value, start1, end1, start2, end2) => {
+ return (value - start1) / (end1 - start1) * (end2 - start2) + start2;
+ };
+ this.ctx.animationManager.animate({
+ id: `${this.id}_connectors`,
+ groupId: this.id,
+ phase: "initial",
+ from: startX,
+ to: endX,
+ ease: import_ag_charts_community151._ModuleSupport.Motion.easeOut,
+ collapsable: false,
+ onUpdate(pointX) {
+ linePath.clear(true);
+ for (const [index, point] of pointData.entries()) {
+ const x = scale(pointX, startX, endX, startX, point.x);
+ const x2 = scale(pointX, startX, endX, startX, point.x2);
+ if (index !== 0) {
+ linePath.lineTo(x, point.y);
+ }
+ linePath.moveTo(x2, point.y2);
+ }
+ lineNode.checkPathDirty();
+ },
+ onStop: () => this.resetConnectorLinesPath(opts)
+ });
+ }
+ animateConnectorLinesVertical(opts) {
+ const { pointData = [] } = opts.contextData;
+ const [lineNode] = opts.paths;
+ const { path: linePath } = lineNode;
+ this.updateLineNode(lineNode);
+ const valueAxis = this.getValueAxis();
+ const valueAxisReversed = valueAxis?.isReversed();
+ const compare = valueAxisReversed ? (v, v2) => v > v2 : (v, v2) => v < v2;
+ const startY = valueAxis?.scale.convert(0);
+ const endY = pointData.reduce(
+ (end, point) => {
+ if (compare(point.y, end)) {
+ end = point.y;
+ }
+ return end;
+ },
+ valueAxisReversed ? 0 : Infinity
+ );
+ const scale = (value, start1, end1, start2, end2) => {
+ return (value - start1) / (end1 - start1) * (end2 - start2) + start2;
+ };
+ this.ctx.animationManager.animate({
+ id: `${this.id}_connectors`,
+ groupId: this.id,
+ phase: "initial",
+ from: startY,
+ to: endY,
+ ease: import_ag_charts_community151._ModuleSupport.Motion.easeOut,
+ collapsable: false,
+ onUpdate(pointY) {
+ linePath.clear(true);
+ for (const [index, point] of pointData.entries()) {
+ const y = scale(pointY, startY, endY, startY, point.y);
+ const y2 = scale(pointY, startY, endY, startY, point.y2);
+ if (index !== 0) {
+ linePath.lineTo(point.x, y);
+ }
+ linePath.moveTo(point.x2, y2);
+ }
+ lineNode.checkPathDirty();
+ },
+ onStop: () => this.resetConnectorLinesPath(opts)
+ });
+ }
+ animateReadyResize(data) {
+ super.animateReadyResize(data);
+ this.resetConnectorLinesPath(data);
+ }
+ updatePaths(opts) {
+ this.resetConnectorLinesPath({ contextData: opts.contextData, paths: opts.paths });
+ }
+ resetConnectorLinesPath({
+ contextData,
+ paths
+ }) {
+ if (paths.length === 0) {
+ return;
+ }
+ const [lineNode] = paths;
+ this.updateLineNode(lineNode);
+ const { path: linePath } = lineNode;
+ linePath.clear(true);
+ const { pointData } = contextData;
+ if (!pointData) {
+ return;
+ }
+ for (const [index, point] of pointData.entries()) {
+ if (index !== 0) {
+ linePath.lineTo(point.x, point.y);
+ }
+ linePath.moveTo(point.x2, point.y2);
+ }
+ lineNode.checkPathDirty();
+ }
+ updateLineNode(lineNode) {
+ const { stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this.properties.line;
+ lineNode.setProperties({
+ fill: void 0,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ lineJoin: "round",
+ pointerEvents: import_ag_charts_community151._ModuleSupport.PointerEvents.None
+ });
+ }
+ isLabelEnabled() {
+ const { positive, negative, total } = this.properties.item;
+ return positive.label.enabled || negative.label.enabled || total.label.enabled;
+ }
+ onDataChange() {
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds5(this, this.contextNodeData?.nodeData[datumIndex]);
+ }
+ hasItemStylers() {
+ const { positive, negative, total } = this.properties.item;
+ return positive.itemStyler != null || positive.label.itemStyler != null || negative.itemStyler != null || negative.label.itemStyler != null || total.itemStyler != null || total.label.itemStyler != null;
+ }
+};
+WaterfallSeries.className = "WaterfallSeries";
+WaterfallSeries.type = "waterfall";
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallSeriesOptionsDef.ts
+var import_ag_charts_community152 = require("ag-charts-community");
+var import_ag_charts_core64 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs7, waterfallSeriesThemeableOptionsDef } = import_ag_charts_community152._ModuleSupport;
+var waterfallSeriesOptionsDef = {
+ ...waterfallSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs7,
+ type: (0, import_ag_charts_core64.required)((0, import_ag_charts_core64.constant)("waterfall")),
+ xKey: (0, import_ag_charts_core64.required)(import_ag_charts_core64.string),
+ yKey: (0, import_ag_charts_core64.required)(import_ag_charts_core64.string),
+ xName: import_ag_charts_core64.string,
+ yName: import_ag_charts_core64.string,
+ totals: (0, import_ag_charts_core64.arrayOfDefs)(
+ {
+ totalType: (0, import_ag_charts_core64.required)((0, import_ag_charts_core64.union)("total", "subtotal")),
+ index: (0, import_ag_charts_core64.required)(import_ag_charts_core64.positiveNumber),
+ axisLabel: (0, import_ag_charts_core64.required)(import_ag_charts_core64.string)
+ },
+ "a total definition options array"
+ )
+};
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallThemes.ts
+var import_ag_charts_community153 = require("ag-charts-community");
+var { FILL_GRADIENT_LINEAR_KEYED_DEFAULTS: FILL_GRADIENT_LINEAR_KEYED_DEFAULTS2, FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS3, FILL_PATTERN_KEYED_DEFAULTS: FILL_PATTERN_KEYED_DEFAULTS2 } = import_ag_charts_community153._ModuleSupport;
+function itemTheme2(key, index) {
+ return {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "user-indexed"] },
+ { $path: [`/${index}`, { $palette: "fill" }, { $palette: "fills" }] },
+ { $palette: `${key}.fill` }
+ ]
+ },
+ ["gradient", FILL_GRADIENT_LINEAR_KEYED_DEFAULTS2(key)],
+ ["image", FILL_IMAGE_DEFAULTS3],
+ ["pattern", FILL_PATTERN_KEYED_DEFAULTS2(key)]
+ ]
+ },
+ stroke: { $palette: `${key}.stroke` },
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ ...import_ag_charts_community153._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontStyle: void 0,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ formatter: void 0,
+ placement: "outside-end",
+ padding: { $isUserOption: ["./spacing", 0, 6] }
+ // compatibility with old `padding` property (now named `spacing`).
+ }
+ };
+}
+var WATERFALL_SERIES_THEME = {
+ series: {
+ item: {
+ positive: itemTheme2("altUp", 0),
+ negative: itemTheme2("altDown", 1),
+ total: itemTheme2("neutral", 2)
+ },
+ line: {
+ stroke: { $palette: "neutral.stroke" },
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0,
+ strokeWidth: 2
+ },
+ highlight: import_ag_charts_community153._ModuleSupport.singleSeriesHighlightStyle()
+ },
+ legend: {
+ enabled: true,
+ toggleSeries: false
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/waterfall/waterfallModule.ts
+var WaterfallModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "waterfall",
+ solo: true,
+ moduleFactory: (ctx) => new WaterfallSeries(ctx),
+ defaultAxes: import_ag_charts_community154._ModuleSupport.DIRECTION_SWAP_AXES,
+ themeTemplate: WATERFALL_SERIES_THEME
+};
+var WaterfallSeriesModule = {
+ type: "series",
+ name: "waterfall",
+ chartType: "cartesian",
+ enterprise: true,
+ options: waterfallSeriesOptionsDef,
+ create: (ctx) => new WaterfallSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorOptionsDefs.ts
+var {
+ NewAreaSeriesModule,
+ NewBarSeriesModule,
+ NewBubbleSeriesModule,
+ NewHistogramSeriesModule,
+ NewLineSeriesModule,
+ NewScatterSeriesModule,
+ numberFormatValidator,
+ textOrSegments,
+ without: without2
+} = import_ag_charts_community155._ModuleSupport;
+var navigatorHandleOptionsDef = {
+ width: import_ag_charts_core65.positiveNumber,
+ height: import_ag_charts_core65.positiveNumber,
+ grip: import_ag_charts_core65.boolean,
+ fill: import_ag_charts_core65.color,
+ stroke: import_ag_charts_core65.color,
+ strokeWidth: import_ag_charts_core65.positiveNumber,
+ cornerRadius: import_ag_charts_core65.positiveNumber
+};
+var commonIgnoredMiniChartProperties = [
+ "cursor",
+ "highlightStyle",
+ "listeners",
+ "nodeClickRange",
+ "showInLegend",
+ "showInMiniChart",
+ "tooltip",
+ "visible",
+ "xName",
+ "yName"
+];
+var barIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "errorBar",
+ "label",
+ "legendItemName",
+ "direction"
+];
+var boxPlotIngnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "direction",
+ "legendItemName",
+ "minName",
+ "q1Name",
+ "medianName",
+ "q3Name",
+ "maxName"
+];
+var bubbleIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "title",
+ "label",
+ "labelKey",
+ "labelName",
+ "sizeName"
+];
+var heatmapIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "title",
+ "label",
+ "colorName",
+ "textAlign",
+ "verticalAlign",
+ "itemPadding",
+ "colorRange"
+];
+var histogramIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "label"
+];
+var lineIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "errorBar",
+ "title",
+ "label"
+];
+var rangeAreaIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "label",
+ "yLowName",
+ "yHighName"
+];
+var rangeBarIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "direction",
+ "label",
+ "yLowName",
+ "yHighName"
+];
+var scatterIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "errorBar",
+ "title",
+ "label",
+ "labelKey",
+ "labelName"
+];
+var waterfallIgnoredMiniChartProperties = [
+ ...commonIgnoredMiniChartProperties,
+ "direction"
+];
+var navigatorOptionsDef = {
+ enabled: import_ag_charts_core65.boolean,
+ height: import_ag_charts_core65.positiveNumber,
+ spacing: import_ag_charts_core65.positiveNumber,
+ cornerRadius: import_ag_charts_core65.number,
+ mask: {
+ fill: import_ag_charts_core65.color,
+ fillOpacity: import_ag_charts_core65.ratio,
+ stroke: import_ag_charts_core65.color,
+ strokeWidth: import_ag_charts_core65.positiveNumber
+ },
+ minHandle: navigatorHandleOptionsDef,
+ maxHandle: navigatorHandleOptionsDef,
+ miniChart: {
+ enabled: import_ag_charts_core65.boolean,
+ padding: {
+ top: import_ag_charts_core65.positiveNumber,
+ bottom: import_ag_charts_core65.positiveNumber
+ },
+ label: {
+ enabled: import_ag_charts_core65.boolean,
+ avoidCollisions: import_ag_charts_core65.boolean,
+ spacing: import_ag_charts_core65.positiveNumber,
+ format: numberFormatValidator,
+ formatter: (0, import_ag_charts_core65.callbackOf)(textOrSegments),
+ interval: {
+ minSpacing: import_ag_charts_core65.positiveNumber,
+ maxSpacing: import_ag_charts_core65.positiveNumber,
+ values: import_ag_charts_core65.array,
+ step: import_ag_charts_core65.number
+ },
+ ...import_ag_charts_core65.fontOptionsDef
+ },
+ series: (0, import_ag_charts_core65.arrayOfDefs)(
+ (0, import_ag_charts_core65.typeUnion)(
+ {
+ area: without2(NewAreaSeriesModule.options, [...commonIgnoredMiniChartProperties, "type"]),
+ bar: without2(NewBarSeriesModule.options, [...barIgnoredMiniChartProperties, "type"]),
+ "box-plot": without2(BoxPlotSeriesModule.options, [...boxPlotIngnoredMiniChartProperties, "type"]),
+ bubble: without2(NewBubbleSeriesModule.options, [...bubbleIgnoredMiniChartProperties, "type"]),
+ candlestick: without2(CandlestickSeriesModule.options, [
+ ...commonIgnoredMiniChartProperties,
+ "type"
+ ]),
+ heatmap: without2(HeatmapSeriesModule.options, [...heatmapIgnoredMiniChartProperties, "type"]),
+ histogram: without2(NewHistogramSeriesModule.options, [
+ ...histogramIgnoredMiniChartProperties,
+ "type"
+ ]),
+ line: without2(NewLineSeriesModule.options, [...lineIgnoredMiniChartProperties, "type"]),
+ ohlc: without2(OhlcSeriesModule.options, [...commonIgnoredMiniChartProperties, "type"]),
+ "range-area": without2(RangeAreaSeriesModule.options, [
+ ...rangeAreaIgnoredMiniChartProperties,
+ "type"
+ ]),
+ "range-bar": without2(RangeBarSeriesModule.options, [...rangeBarIgnoredMiniChartProperties, "type"]),
+ scatter: without2(NewScatterSeriesModule.options, [...scatterIgnoredMiniChartProperties, "type"]),
+ waterfall: without2(WaterfallSeriesModule.options, [...waterfallIgnoredMiniChartProperties, "type"])
+ },
+ "miniChart series options"
+ )
+ )
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorTheme.ts
+var validMiniChartSeriesTypes = [
+ "area",
+ "bar",
+ "bubble",
+ "candlestick",
+ "heatmap",
+ "histogram",
+ "line",
+ "ohlc",
+ "range-area",
+ "range-bar",
+ "scatter",
+ "waterfall"
+];
+var priceVolumePresetIgnoredMiniChartProperties = [
+ "itemStyler",
+ "direction",
+ "fill",
+ "fillGradientDefaults",
+ "fillPatternDefaults",
+ "fillImageDefaults",
+ "fillOpacity",
+ "shadow",
+ "focusPriority",
+ "highlight",
+ "lineDash",
+ "lineDashOffset",
+ "strokeWidth"
+];
+function miniChartSeriesTheme(seriesPath, typePath) {
+ return {
+ $merge: [
+ {
+ $switch: [
+ typePath,
+ {},
+ [
+ ["area", "line", "range-area"],
+ {
+ marker: {
+ enabled: {
+ $isUserOption: [
+ "/series/$index/marker/enabled",
+ { $path: ["/series/$index/marker/enabled", false] },
+ false
+ ]
+ }
+ }
+ }
+ ]
+ ]
+ },
+ {
+ $omit: [
+ {
+ $switch: [
+ typePath,
+ commonIgnoredMiniChartProperties,
+ ["bar", barIgnoredMiniChartProperties],
+ ["box-plot", boxPlotIngnoredMiniChartProperties],
+ ["bubble", bubbleIgnoredMiniChartProperties],
+ ["heatmap", heatmapIgnoredMiniChartProperties],
+ ["histogram", histogramIgnoredMiniChartProperties],
+ [
+ "line",
+ [...lineIgnoredMiniChartProperties, ...priceVolumePresetIgnoredMiniChartProperties]
+ ],
+ ["range-area", rangeAreaIgnoredMiniChartProperties],
+ ["range-bar", rangeBarIgnoredMiniChartProperties],
+ ["scatter", scatterIgnoredMiniChartProperties],
+ ["waterfall", waterfallIgnoredMiniChartProperties]
+ ]
+ },
+ seriesPath
+ ]
+ }
+ ]
+ };
+}
+var NAVIGATOR_THEME = {
+ enabled: false,
+ height: { $if: [{ $path: "./miniChart/enabled" }, 40, 18] },
+ cornerRadius: 4,
+ mask: {
+ fill: { $ref: "foregroundColor" },
+ fillOpacity: 0.1,
+ stroke: { $ref: "borderColor" },
+ strokeWidth: 1
+ },
+ minHandle: {
+ fill: { $ref: "chartBackgroundColor" },
+ stroke: { $ref: "borderColor" },
+ strokeWidth: 1,
+ width: 12,
+ height: 24,
+ cornerRadius: 4
+ },
+ maxHandle: {
+ fill: { $ref: "chartBackgroundColor" },
+ stroke: { $ref: "borderColor" },
+ strokeWidth: 1,
+ width: 12,
+ height: 24,
+ cornerRadius: 4
+ },
+ miniChart: {
+ enabled: false,
+ label: {
+ color: { $ref: "textColor" },
+ fontSize: { $rem: import_ag_charts_community156._ModuleSupport.FONT_SIZE_RATIO.SMALLER },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ spacing: 5
+ },
+ padding: {
+ top: 0,
+ bottom: 0
+ },
+ series: {
+ $apply: [
+ miniChartSeriesTheme(
+ { $path: "/series/$index" },
+ {
+ $path: [
+ "/navigator/miniChart/series/$index/type",
+ { $path: ["type", { $path: "/series/$index/type" }] }
+ ]
+ }
+ ),
+ {
+ // TODO: this should be a $switch but switches can not resolve the case value yet
+ $if: [
+ {
+ $or: validMiniChartSeriesTypes.map((type) => ({
+ $eq: [{ $path: "/series/0/type" }, type]
+ }))
+ },
+ {
+ $map: [
+ miniChartSeriesTheme({ $value: "$1" }, { $path: "/series/$index/type" }),
+ { $path: "/series" }
+ ]
+ },
+ void 0
+ ]
+ }
+ ]
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/navigator/navigatorModule.ts
+var NavigatorModule = {
+ type: "root",
+ optionsKey: "navigator",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ moduleFactory: (ctx) => new Navigator(ctx),
+ removable: false,
+ // Toggling this module causes zoom state flakiness.
+ themeTemplate: {
+ navigator: NAVIGATOR_THEME
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/ranges/ranges.ts
+var import_ag_charts_community158 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/ranges/rangesButtonProperties.ts
+var import_ag_charts_community157 = require("ag-charts-community");
+var { ToolbarButtonProperties: ToolbarButtonProperties3, Property: Property56 } = import_ag_charts_community157._ModuleSupport;
+var RangesButtonProperties = class extends ToolbarButtonProperties3 {
+};
+__decorateClass([
+ Property56
+], RangesButtonProperties.prototype, "value", 2);
+
+// packages/ag-charts-enterprise/src/features/ranges/ranges.ts
+var { ChartAxisDirection: ChartAxisDirection19, LayoutElement: LayoutElement3, PropertiesArray: PropertiesArray5, Toolbar, Property: Property57 } = import_ag_charts_community158._ModuleSupport;
+var Ranges = class extends import_ag_charts_community158._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = false;
+ this.buttons = new PropertiesArray5(RangesButtonProperties);
+ this.verticalSpacing = 10;
+ this.container = ctx.domManager.addChild("canvas-overlay", "range-buttons");
+ this.container.role = "presentation";
+ this.toolbar = new Toolbar(this.ctx, "ariaLabelRangesToolbar", "horizontal");
+ this.toolbar.addClass("ag-charts-range-buttons");
+ this.container.append(this.toolbar.getElement());
+ this.cleanup.register(
+ this.toolbar.addToolbarListener("button-pressed", this.onButtonPress.bind(this)),
+ ctx.layoutManager.registerElement(LayoutElement3.ToolbarBottom, this.onLayoutStart.bind(this)),
+ ctx.eventsHub.on("zoom:change", this.onZoomChanged.bind(this)),
+ this.teardown.bind(this)
+ );
+ }
+ teardown() {
+ this.toolbar.getElement().remove();
+ this.toolbar.destroy();
+ }
+ onLayoutStart(event) {
+ const { buttons: buttons2, ctx, enabled, toolbar: toolbar2, verticalSpacing } = this;
+ const { layoutBox } = event;
+ if (!enabled || !ctx.zoomManager.isZoomEnabled()) {
+ toolbar2.setHidden(true);
+ return;
+ }
+ toolbar2.setHidden(false);
+ toolbar2.updateButtons(buttons2);
+ const height = toolbar2.getBounds().height;
+ toolbar2.setBounds({
+ x: layoutBox.x,
+ y: layoutBox.y + layoutBox.height - height,
+ width: layoutBox.width,
+ height
+ });
+ layoutBox.shrink({ bottom: height + verticalSpacing });
+ }
+ onZoomChanged() {
+ this.toolbar.clearActiveButton();
+ }
+ onButtonPress({ button: { index } }) {
+ const { zoomManager } = this.ctx;
+ const button = this.buttons.at(index);
+ if (!button)
+ return;
+ const { value } = button;
+ if (value == null) {
+ zoomManager.resetZoom("zoom-buttons");
+ } else if (typeof value === "number") {
+ zoomManager.extendToEnd("zoom-buttons", ChartAxisDirection19.X, value);
+ } else if (Array.isArray(value)) {
+ zoomManager.updateWith("zoom-buttons", ChartAxisDirection19.X, () => value);
+ } else if (typeof value === "function") {
+ zoomManager.updateWith("zoom-buttons", ChartAxisDirection19.X, value);
+ }
+ this.toolbar.toggleActiveButtonByIndex(index);
+ }
+};
+__decorateClass([
+ Property57
+], Ranges.prototype, "enabled", 2);
+__decorateClass([
+ Property57
+], Ranges.prototype, "buttons", 2);
+
+// packages/ag-charts-enterprise/src/features/ranges/rangesModule.ts
+var DAY = 1e3 * 60 * 60 * 24;
+var MONTH = DAY * 30;
+var YEAR = DAY * 365;
+var RangesModule = {
+ type: "root",
+ optionsKey: "ranges",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ moduleFactory: (ctx) => new Ranges(ctx),
+ themeTemplate: {
+ ranges: {
+ enabled: false,
+ buttons: {
+ $shallowSimple: [
+ {
+ label: "toolbarRange1Month",
+ ariaLabel: "toolbarRange1MonthAria",
+ value: MONTH
+ },
+ {
+ label: "toolbarRange3Months",
+ ariaLabel: "toolbarRange3MonthsAria",
+ value: 3 * MONTH
+ },
+ {
+ label: "toolbarRange6Months",
+ ariaLabel: "toolbarRange6MonthsAria",
+ value: 6 * MONTH
+ },
+ {
+ label: "toolbarRangeYearToDate",
+ ariaLabel: "toolbarRangeYearToDateAria",
+ value: (_start, end) => [
+ (/* @__PURE__ */ new Date(`${new Date(end).getFullYear()}-01-01`)).getTime(),
+ void 0
+ ]
+ },
+ {
+ label: "toolbarRange1Year",
+ ariaLabel: "toolbarRange1YearAria",
+ value: YEAR
+ },
+ {
+ label: "toolbarRangeAll",
+ ariaLabel: "toolbarRangeAllAria",
+ value: void 0
+ // Reset zoom
+ }
+ ]
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/shared-toolbar/sharedToolbar.ts
+var import_ag_charts_community159 = require("ag-charts-community");
+var _SharedToolbar = class _SharedToolbar extends import_ag_charts_community159._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.activeSections = /* @__PURE__ */ new Set();
+ this.sectionButtons = {
+ annotations: [],
+ chartToolbar: []
+ };
+ this.container = this.ctx.domManager.addChild("canvas-overlay", "shared-toolbar");
+ this.container.role = "presentation";
+ }
+ getSharedToolbar(section) {
+ if (!this.sharedToolbar) {
+ this.createSharedToolbar();
+ }
+ if (section === "chartToolbar" && this.sharedToolbar) {
+ this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts");
+ }
+ return this.toolbarWithSection(section);
+ }
+ createSharedToolbar() {
+ this.sharedToolbar = new import_ag_charts_community159._ModuleSupport.Toolbar(this.ctx, "ariaLabelAnnotationsToolbar", "vertical");
+ this.sharedToolbar.addClass("ag-charts-shared-toolbar");
+ this.container.append(this.sharedToolbar.getElement());
+ this.cleanup.register(() => {
+ if (!this.sharedToolbar)
+ return;
+ this.sharedToolbar.getElement().remove();
+ this.sharedToolbar.destroy();
+ this.sharedToolbar = void 0;
+ });
+ }
+ toolbarWithSection(section) {
+ const sharedToolbar = this.sharedToolbar;
+ const withSection = {
+ layout: (layoutBox, padding) => {
+ if (this.firstLayoutSection != null && this.firstLayoutSection !== section && this.activeSections.has(this.firstLayoutSection)) {
+ return;
+ }
+ this.firstLayoutSection = section;
+ const width = sharedToolbar.getBounds().width;
+ sharedToolbar.setBounds({
+ x: layoutBox.x,
+ y: layoutBox.y,
+ width
+ });
+ layoutBox.shrink({ left: width + sharedToolbar.horizontalSpacing + (padding ?? 0) });
+ },
+ addToolbarListener: (eventType, handler) => {
+ return sharedToolbar.addToolbarListener(eventType, (sharedEvent) => {
+ const sectionIndex = this.getSectionIndex(section, sharedEvent.button.index);
+ if (sectionIndex < 0)
+ return;
+ const event = {
+ ...sharedEvent,
+ button: this.sectionButtons[section][sectionIndex]
+ };
+ handler(event);
+ });
+ },
+ updateButtons: (buttons2) => {
+ this.sectionButtons[section] = buttons2;
+ const sharedButtons = _SharedToolbar.SECTION_ORDER.flatMap((order) => this.sectionButtons[order]);
+ sharedToolbar.updateButtons(sharedButtons);
+ },
+ updateButtonByIndex: (index, button) => {
+ sharedToolbar.updateButtonByIndex(this.getIndex(section, index), button);
+ },
+ toggleActiveButtonByIndex: (index) => {
+ sharedToolbar.toggleActiveButtonByIndex(this.getIndex(section, index));
+ },
+ toggleButtonEnabledByIndex: (index, enabled) => {
+ sharedToolbar.toggleButtonEnabledByIndex(this.getIndex(section, index), enabled);
+ },
+ setHidden: (hidden) => {
+ if (hidden) {
+ this.activeSections.delete(section);
+ } else {
+ this.activeSections.add(section);
+ }
+ let sum = 0;
+ for (const order of _SharedToolbar.SECTION_ORDER) {
+ if (order !== section) {
+ sum += this.sectionButtons[order].length;
+ continue;
+ }
+ for (const index of this.sectionButtons[section].keys()) {
+ sharedToolbar.setButtonHiddenByIndex(sum + index, hidden);
+ }
+ }
+ },
+ destroy: () => {
+ withSection.setHidden(true);
+ if (this.activeSections.size === 0) {
+ this.destroy();
+ }
+ },
+ clearActiveButton: sharedToolbar.clearActiveButton.bind(sharedToolbar),
+ addListener: sharedToolbar.addListener.bind(sharedToolbar),
+ removeListener: sharedToolbar.removeListener.bind(sharedToolbar)
+ };
+ withSection.setHidden(false);
+ return withSection;
+ }
+ getIndex(section, index) {
+ let sum = 0;
+ for (const order of _SharedToolbar.SECTION_ORDER) {
+ if (order === section)
+ return sum + index;
+ sum += this.sectionButtons[order].length;
+ }
+ return -1;
+ }
+ getSectionIndex(section, index) {
+ let sum = 0;
+ for (const order of _SharedToolbar.SECTION_ORDER) {
+ if (order === section) {
+ if (index >= sum + this.sectionButtons[section].length)
+ return -1;
+ return index - sum;
+ }
+ sum += this.sectionButtons[order].length;
+ }
+ return -1;
+ }
+};
+_SharedToolbar.SECTION_ORDER = ["chartToolbar", "annotations"];
+var SharedToolbar = _SharedToolbar;
+
+// packages/ag-charts-enterprise/src/features/shared-toolbar/sharedToolbarModule.ts
+var SharedToolbarModule = {
+ type: "context",
+ contextKey: "sharedToolbar",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ moduleFactory: (ctx) => new SharedToolbar(ctx)
+};
+
+// packages/ag-charts-enterprise/src/features/status-bar/statusBarModule.ts
+var import_ag_charts_community161 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/status-bar/statusBar.ts
+var import_ag_charts_community160 = require("ag-charts-community");
+var import_ag_charts_core66 = require("ag-charts-core");
+var { ZIndexMap: ZIndexMap8, LayoutElement: LayoutElement4, Property: Property58, BaseProperties: BaseProperties20, valueProperty: valueProperty9, Group: Group7, Label: Label5, Rect: Rect4, Text } = import_ag_charts_community160._ModuleSupport;
+var chartConfigurations = {
+ ohlc: 2 /* Open */ | 4 /* Close */ | 8 /* Low */ | 16 /* High */ | 32 /* Volume */,
+ candlestick: 2 /* Open */ | 4 /* Close */ | 8 /* Low */ | 16 /* High */ | 32 /* Volume */,
+ "hollow-candlestick": 2 /* Open */ | 4 /* Close */ | 8 /* Low */ | 16 /* High */ | 32 /* Volume */,
+ line: 64 /* UnlabelledClose */ | 32 /* Volume */,
+ "step-line": 64 /* UnlabelledClose */ | 32 /* Volume */,
+ hlc: 128 /* NeutralClose */ | 8 /* Low */ | 16 /* High */ | 32 /* Volume */,
+ "high-low": 512 /* NeutralLow */ | 256 /* NeutralHigh */ | 32 /* Volume */
+};
+var itemIdMap = {
+ up: "positive",
+ down: "negative"
+};
+var neutralColorMap = {
+ hlc: "altNeutral"
+};
+var StatusBarBackground = class extends BaseProperties20 {
+ constructor() {
+ super(...arguments);
+ this.fill = "black";
+ this.fillOpacity = 1;
+ }
+};
+__decorateClass([
+ Property58
+], StatusBarBackground.prototype, "fill", 2);
+__decorateClass([
+ Property58
+], StatusBarBackground.prototype, "fillOpacity", 2);
+var StatusBar = class extends import_ag_charts_community160._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = false;
+ this.openKey = void 0;
+ this.highKey = void 0;
+ this.lowKey = void 0;
+ this.closeKey = void 0;
+ this.volumeKey = void 0;
+ this.title = new Label5();
+ this.positive = new Label5();
+ this.negative = new Label5();
+ this.neutral = new Label5();
+ this.altNeutral = new Label5();
+ this.background = new StatusBarBackground();
+ this.layoutStyle = "block";
+ this.id = "status-bar";
+ this.data = void 0;
+ this.layer = new Group7({
+ name: "StatusBar",
+ zIndex: ZIndexMap8.STATUS_BAR
+ });
+ this.labelGroup = this.layer.appendChild(new import_ag_charts_community160._ModuleSupport.TranslatableGroup());
+ this.backgroundNode = this.labelGroup.appendChild(new Rect4());
+ this.labels = [
+ {
+ label: "O",
+ configuration: 2 /* Open */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ id: "openValue",
+ key: "openKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "H",
+ configuration: 16 /* High */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ id: "highValue",
+ key: "highKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "H",
+ configuration: 256 /* NeutralHigh */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ style: "neutral",
+ id: "highValue",
+ key: "highKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "L",
+ configuration: 8 /* Low */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ id: "lowValue",
+ key: "lowKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "L",
+ configuration: 512 /* NeutralLow */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ style: "neutral",
+ id: "lowValue",
+ key: "lowKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "C",
+ configuration: 4 /* Close */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ id: "closeValue",
+ key: "closeKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "C",
+ configuration: 128 /* NeutralClose */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ id: "closeValue",
+ key: "closeKey",
+ style: "neutral",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "",
+ configuration: 64 /* UnlabelledClose */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ style: "neutral",
+ id: "closeValue",
+ key: "closeKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ notation: "compact",
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ },
+ {
+ label: "Vol",
+ configuration: 32 /* Volume */,
+ title: this.labelGroup.appendChild(new Text()),
+ value: this.labelGroup.appendChild(new Text()),
+ id: "volumeValue",
+ key: "volumeKey",
+ domain: void 0,
+ formatter: new Intl.NumberFormat("en-US", {
+ notation: "compact",
+ minimumFractionDigits: 2,
+ maximumFractionDigits: 2
+ })
+ }
+ ];
+ this.highlightManager = ctx.highlightManager;
+ this.labelGroup.visible = false;
+ this.cleanup.register(
+ ctx.scene.attachNode(this.layer),
+ ctx.layoutManager.registerElement(LayoutElement4.Overlay, (e) => this.startPerformLayout(e)),
+ ctx.eventsHub.on("layout:complete", (e) => this.onLayoutComplete(e)),
+ ctx.eventsHub.on("highlight:change", () => this.updateHighlight())
+ );
+ }
+ async processData(dataController) {
+ if (!this.enabled || this.data == null)
+ return;
+ const props = [];
+ for (const label of this.labels) {
+ const { id, key } = label;
+ const datumKey = this[key];
+ if (datumKey == null) {
+ label.domain = void 0;
+ } else {
+ props.push(valueProperty9(datumKey, "number", { id }));
+ }
+ }
+ if (props.length === 0)
+ return;
+ const dataSet = import_ag_charts_community160._ModuleSupport.DataSet.wrap(this.data) ?? import_ag_charts_community160._ModuleSupport.DataSet.empty();
+ const { processedData, dataModel } = await dataController.request(this.id, dataSet, {
+ props
+ });
+ for (const label of this.labels) {
+ const { id, key } = label;
+ const datumKey = this[key];
+ if (datumKey != null) {
+ label.domain = dataModel.getDomain(this, id, "value", processedData);
+ }
+ }
+ }
+ startPerformLayout(opts) {
+ this.labelGroup.translationX = 0;
+ this.labelGroup.translationY = 0;
+ if (!this.enabled)
+ return;
+ const { layoutBox } = opts;
+ const innerSpacing = 4;
+ const outerSpacing = 12;
+ const spacingAbove = 0;
+ const spacingBelow = 8;
+ this.labelGroup.translationY = layoutBox.y + spacingAbove;
+ const maxFontSize = Math.max(this.title.fontSize, this.positive.fontSize, this.negative.fontSize);
+ const lineHeight = (0, import_ag_charts_core66.calcLineHeight)(maxFontSize);
+ const labelConfigurations = chartConfigurations[this.getChartType()] ?? 0;
+ let left = 0;
+ let offsetTop;
+ let textVAlign = "alphabetic";
+ if (this.layoutStyle === "block") {
+ layoutBox.shrink(spacingAbove + lineHeight + spacingBelow, "top");
+ offsetTop = maxFontSize + (lineHeight - maxFontSize) / 2;
+ } else {
+ const { title } = this.ctx.chartService;
+ textVAlign = "top";
+ offsetTop = spacingAbove + title.padding;
+ if (title.enabled) {
+ const titleBox = title.node.getBBox();
+ left = titleBox.x + titleBox.width + outerSpacing;
+ } else {
+ left = title.padding;
+ }
+ }
+ for (const { label, configuration, title, value, domain, formatter } of this.labels) {
+ if (domain == null || (labelConfigurations & configuration) === 0) {
+ title.visible = false;
+ value.visible = false;
+ continue;
+ }
+ const positiveTextMeasurer = (0, import_ag_charts_core66.cachedTextMeasurer)(this.positive);
+ const negativeTextMeasurer = (0, import_ag_charts_core66.cachedTextMeasurer)(this.negative);
+ const maxValueWidth = Math.max(
+ positiveTextMeasurer.textWidth(formatter.format(domain[0])),
+ positiveTextMeasurer.textWidth(formatter.format(domain[1])),
+ negativeTextMeasurer.textWidth(formatter.format(domain[0])),
+ negativeTextMeasurer.textWidth(formatter.format(domain[1]))
+ );
+ title.visible = true;
+ value.visible = true;
+ const titleMetrics = (0, import_ag_charts_core66.cachedTextMeasurer)(this.title).measureLines(label);
+ title.setFont(this.title);
+ title.fill = this.title.color;
+ title.text = label;
+ title.textBaseline = textVAlign;
+ title.y = offsetTop;
+ title.x = left;
+ left += titleMetrics.width + innerSpacing;
+ value.textBaseline = textVAlign;
+ value.y = offsetTop;
+ value.x = left;
+ left += maxValueWidth + outerSpacing;
+ }
+ this.backgroundNode.x = 0;
+ this.backgroundNode.y = 0;
+ this.backgroundNode.width = left - outerSpacing;
+ this.backgroundNode.height = lineHeight + spacingAbove + spacingBelow;
+ this.backgroundNode.fill = this.background.fill;
+ this.backgroundNode.fillOpacity = this.background.fillOpacity;
+ }
+ onLayoutComplete(opts) {
+ this.labelGroup.translationX = opts.series.rect.x;
+ this.updateHighlight();
+ }
+ updateHighlight() {
+ if (!this.enabled)
+ return;
+ const activeHighlight = this.highlightManager.getActiveHighlight();
+ const datum = activeHighlight?.datum ?? this.data?.at(-1);
+ if (datum == null) {
+ this.labelGroup.visible = false;
+ return;
+ }
+ this.labelGroup.visible = true;
+ const itemId = activeHighlight?.itemId;
+ let baseStyle = itemId == null ? void 0 : itemIdMap[itemId];
+ if (baseStyle == null && this.openKey != null && this.closeKey != null) {
+ if (datum[this.openKey] < datum[this.closeKey]) {
+ baseStyle = "positive";
+ } else {
+ baseStyle = "negative";
+ }
+ }
+ for (const { domain, value, key, formatter, style } of this.labels) {
+ if (domain == null)
+ continue;
+ let labelStyle = style ?? baseStyle ?? "neutral";
+ if (labelStyle === "neutral") {
+ labelStyle = neutralColorMap[this.getChartType()] ?? labelStyle;
+ }
+ const datumKey = this[key];
+ const datumValue = datumKey == null ? void 0 : datum?.[datumKey];
+ value.setFont(this[labelStyle]);
+ value.fill = this[labelStyle].color;
+ value.text = typeof datumValue === "number" ? formatter.format(datumValue) : "";
+ }
+ }
+ getChartType() {
+ let chartType = this.ctx.chartService.publicApi?.getOptions()?.chartType;
+ if (chartType == null || chartConfigurations[chartType] == null) {
+ chartType = "candlestick";
+ }
+ return chartType;
+ }
+};
+__decorateClass([
+ Property58
+], StatusBar.prototype, "enabled", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "openKey", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "highKey", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "lowKey", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "closeKey", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "volumeKey", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "title", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "positive", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "negative", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "neutral", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "altNeutral", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "background", 2);
+__decorateClass([
+ Property58
+], StatusBar.prototype, "layoutStyle", 2);
+
+// packages/ag-charts-enterprise/src/features/status-bar/statusBarModule.ts
+var StatusBarModule = {
+ type: "root",
+ identifier: "status-bar",
+ optionsKey: "statusBar",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ moduleFactory: (ctx) => new StatusBar(ctx),
+ themeTemplate: {
+ statusBar: {
+ enabled: false,
+ layoutStyle: import_ag_charts_community161._ModuleSupport.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,
+ title: {
+ color: { $ref: "textColor" },
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" }
+ },
+ positive: {
+ color: { $palette: "up.stroke" },
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" }
+ },
+ negative: {
+ color: { $palette: "down.stroke" },
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" }
+ },
+ neutral: {
+ color: { $palette: "neutral.stroke" },
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" }
+ },
+ background: {
+ fill: { $ref: "chartBackgroundColor" },
+ fillOpacity: 0.5
+ },
+ altNeutral: {
+ color: "gray",
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" }
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/sync/chartSync.ts
+var import_ag_charts_community162 = require("ag-charts-community");
+var import_ag_charts_core68 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomUtils.ts
+var import_ag_charts_core67 = require("ag-charts-core");
+var UNIT_MIN = 0;
+var UNIT_MAX = 1;
+var UNIT_SIZE = UNIT_MAX - UNIT_MIN;
+var DEFAULT_ANCHOR_POINT_X = "end";
+var DEFAULT_ANCHOR_POINT_Y = "middle";
+var ZOOM_VALID_CHECK_DEBOUNCE = 300;
+var constrain = (value, min = UNIT_MIN, max = UNIT_MAX) => (0, import_ag_charts_core67.clamp)(min, value, max);
+function unitZoomState() {
+ return { x: { min: UNIT_MIN, max: UNIT_MAX }, y: { min: UNIT_MIN, max: UNIT_MAX } };
+}
+function dx(zoom) {
+ return zoom.x.max - zoom.x.min;
+}
+function dy(zoom) {
+ return zoom.y.max - zoom.y.min;
+}
+function isZoomRangeEqual(left, right) {
+ return (0, import_ag_charts_core67.isNumberEqual)(left.min, right.min) && (0, import_ag_charts_core67.isNumberEqual)(left.max, right.max);
+}
+function isZoomEqual(left, right) {
+ return isZoomRangeEqual(left.x, right.x) && isZoomRangeEqual(left.y, right.y);
+}
+function isMaxZoom(zoom) {
+ return isZoomEqual(zoom, unitZoomState());
+}
+function definedZoomState(zoom) {
+ return {
+ x: { min: zoom?.x?.min ?? UNIT_MIN, max: zoom?.x?.max ?? UNIT_MAX },
+ y: { min: zoom?.y?.min ?? UNIT_MIN, max: zoom?.y?.max ?? UNIT_MAX }
+ };
+}
+function pointToRatio(bbox, x, y) {
+ if (!bbox)
+ return { x: 0, y: 0 };
+ const constrainedX = constrain(x - bbox.x, 0, bbox.x + bbox.width);
+ const constrainedY = constrain(y - bbox.y, 0, bbox.y + bbox.height);
+ const rx = 1 / bbox.width * constrainedX;
+ const ry = 1 - 1 / bbox.height * constrainedY;
+ return { x: constrain(rx), y: constrain(ry) };
+}
+function translateZoom(zoom, x, y) {
+ return {
+ x: { min: zoom.x.min + x, max: zoom.x.max + x },
+ y: { min: zoom.y.min + y, max: zoom.y.max + y }
+ };
+}
+function scaleZoom(zoom, sx, sy) {
+ return {
+ x: { min: zoom.x.min, max: zoom.x.min + dx(zoom) * sx },
+ y: { min: zoom.y.min, max: zoom.y.min + dy(zoom) * sy }
+ };
+}
+function scaleZoomCenter(zoom, sx, sy) {
+ const dx_ = dx(zoom);
+ const dy_ = dy(zoom);
+ const cx = zoom.x.min + dx_ / 2;
+ const cy = zoom.y.min + dy_ / 2;
+ return {
+ x: { min: cx - dx_ * sx / 2, max: cx + dx_ * sx / 2 },
+ y: { min: cy - dy_ * sy / 2, max: cy + dy_ * sy / 2 }
+ };
+}
+function scaleZoomAxisWithAnchor(newState, oldState, anchor, origin) {
+ const { min, max } = oldState;
+ const center = min + (max - min) / 2;
+ const diff8 = newState.max - newState.min;
+ switch (anchor) {
+ case "start":
+ return { min, max: oldState.min + diff8 };
+ case "end":
+ return { min: oldState.max - diff8, max };
+ case "middle":
+ return { min: center - diff8 / 2, max: center + diff8 / 2 };
+ case "pointer":
+ return scaleZoomAxisWithPoint(newState, oldState, origin ?? center);
+ default:
+ return { min, max };
+ }
+}
+function scaleZoomAxisWithPoint(newState, oldState, origin) {
+ const newDelta = newState.max - newState.min;
+ const oldDelta = oldState.max - oldState.min;
+ const scaledOrigin = origin * (1 - (oldDelta - newDelta));
+ const translation = origin - scaledOrigin;
+ const min = newState.min + translation;
+ const max = newState.max + translation;
+ return { min, max };
+}
+function multiplyZoom(zoom, nx, ny) {
+ return {
+ x: { min: zoom.x.min * nx, max: zoom.x.max * nx },
+ y: { min: zoom.y.min * ny, max: zoom.y.max * ny }
+ };
+}
+function constrainZoom(zoom) {
+ return {
+ x: constrainAxis(zoom.x),
+ y: constrainAxis(zoom.y)
+ };
+}
+function constrainAxis(axis) {
+ const size = axis.max - axis.min;
+ let min = axis.max > UNIT_MAX ? UNIT_MAX - size : axis.min;
+ let max = axis.min < UNIT_MIN ? size : axis.max;
+ min = Math.max(UNIT_MIN, min);
+ max = Math.min(UNIT_MAX, max);
+ return { min, max };
+}
+
+// packages/ag-charts-enterprise/src/features/sync/chartSync.ts
+var {
+ BaseProperties: BaseProperties21,
+ CartesianAxis,
+ ChartAxisDirection: ChartAxisDirection20,
+ ContinuousScale: ContinuousScale6,
+ TimeScale,
+ UnitTimeScale,
+ ChartUpdateType: ChartUpdateType2,
+ ObserveChanges: ObserveChanges4,
+ TooltipManager,
+ Property: Property59,
+ findMinMax: findMinMax4,
+ isObjectWithStringProperty
+} = import_ag_charts_community162._ModuleSupport;
+var debug = import_ag_charts_community162._ModuleSupport.Debug.create("sync");
+function getDirectionKeys(series, primary, secondary) {
+ const primaryKeys = series.getKeys(primary);
+ const secondaryKeys = series.getKeys(secondary);
+ if (series.shouldFlipXY?.()) {
+ return [secondaryKeys, primaryKeys];
+ }
+ return [primaryKeys, secondaryKeys];
+}
+function syncedDirections(axes = "x") {
+ switch (axes) {
+ case "x":
+ return [ChartAxisDirection20.X];
+ case "y":
+ return [ChartAxisDirection20.Y];
+ case "xy":
+ return [ChartAxisDirection20.X, ChartAxisDirection20.Y];
+ }
+}
+function domainChanged(scale, a, b) {
+ if (TimeScale.is(scale) || UnitTimeScale.is(scale)) {
+ return !(0, import_ag_charts_core68.arraysEqual)(
+ a.map((x) => x?.valueOf()),
+ b.map((x) => x?.valueOf())
+ );
+ } else {
+ return !(0, import_ag_charts_core68.arraysEqual)(a, b);
+ }
+}
+var ChartSync = class extends BaseProperties21 {
+ constructor(moduleContext) {
+ super();
+ this.moduleContext = moduleContext;
+ this.enabled = false;
+ this.axes = "x";
+ this.nodeInteraction = true;
+ this.zoom = true;
+ this.domainMode = "key";
+ this.domainSync = new import_ag_charts_core68.AsyncAwaitQueue();
+ }
+ updateSiblings(groupId) {
+ const { syncManager } = this.moduleContext;
+ for (const chart of syncManager.getGroupSiblings(groupId ?? this.groupId)) {
+ debug("ChartSync.updateSiblings()", chart.id, chart);
+ this.updateChart(chart);
+ }
+ }
+ updateChart(chart, updateType = ChartUpdateType2.PROCESS_DOMAIN) {
+ debug("ChartSync.updateChart()", chart.id, ChartUpdateType2[updateType], chart);
+ if (updateType === ChartUpdateType2.PROCESS_DOMAIN) {
+ chart.ctx.updateService.update(updateType, { forceNodeDataRefresh: true });
+ } else {
+ chart.ctx.updateService.update(updateType);
+ }
+ }
+ enabledZoomSync() {
+ const { eventsHub } = this.moduleContext;
+ this.disableZoomSync?.();
+ this.disableZoomSync = eventsHub.on("zoom:change", this.onZoom.bind(this));
+ }
+ onZoom() {
+ const { syncManager } = this.moduleContext;
+ for (const chart of syncManager.getGroupSiblings(this.groupId)) {
+ if (!chart.modulesManager.getModule("sync")?.zoom)
+ continue;
+ const zoomModule = chart.modulesManager.getModule("zoom");
+ if (!zoomModule)
+ continue;
+ const zoom = this.prepareZoomUpdate();
+ debug("ChartsSyncManager.enabledZoomSync()", chart.id, zoom);
+ zoomModule.updateSyncZoom(zoom);
+ }
+ }
+ enabledNodeInteractionSync() {
+ this.disableNodeInteractionSync?.();
+ this.disableNodeInteractionSync = this.moduleContext.eventsHub.on(
+ "highlight:change",
+ this.onHighlightChange.bind(this)
+ );
+ }
+ onHighlightChange(event) {
+ const { syncManager } = this.moduleContext;
+ if (event.callerId.endsWith("-sync"))
+ return;
+ debug("ChartSync.onHighlightChange()", event);
+ const series = event.currentHighlight?.series;
+ const [mainDirection] = syncedDirections(this.axes);
+ const secondaryDirection = mainDirection === ChartAxisDirection20.X ? ChartAxisDirection20.Y : ChartAxisDirection20.X;
+ const [primaryKeys, secondaryKeys] = series ? getDirectionKeys(series, mainDirection, secondaryDirection) : [];
+ const datum = readDatum(event.currentHighlight);
+ let eventValue = primaryKeys?.[0] ? datum?.[primaryKeys[0]] : void 0;
+ let valueIsDate = false;
+ if ((0, import_ag_charts_core68.isDate)(eventValue)) {
+ valueIsDate = true;
+ eventValue = eventValue.getTime();
+ }
+ if (!event.currentHighlight?.datum) {
+ for (const chart of syncManager.getGroupSiblings(this.groupId)) {
+ if (!chart.modulesManager.getModule("sync")?.nodeInteraction)
+ continue;
+ chart.ctx.highlightManager.updateHighlight(`${chart.id}-sync`);
+ chart.ctx.tooltipManager.removeTooltip(`${chart.id}-sync`);
+ }
+ return;
+ }
+ const useSecondaryDirectionKey = syncManager.getGroupSyncMode(this.groupId) === "multi-series";
+ this.findMatchingHighlightNodes(
+ mainDirection,
+ secondaryDirection,
+ useSecondaryDirectionKey ? secondaryKeys : [],
+ valueIsDate,
+ eventValue,
+ event
+ );
+ }
+ findMatchingHighlightNodes(primaryDirection, secondaryDirection, secondaryKeys, valueIsDate, eventValue, event) {
+ const { syncManager } = this.moduleContext;
+ debug("ChartSync.findMatchingHighlightNodes()", {
+ mainDirection: primaryDirection,
+ secondaryKeys
+ });
+ for (const chart of syncManager.getGroupSiblings(this.groupId)) {
+ if (!chart.modulesManager.getModule("sync")?.nodeInteraction)
+ continue;
+ let dispatched = false;
+ for (const axis of chart.axes) {
+ if (!CartesianAxis.is(axis) || axis.direction !== primaryDirection)
+ continue;
+ const matchingNodes = chart.series.filter((s) => {
+ if (!s.visible)
+ return false;
+ if (secondaryKeys.length > 0) {
+ const [, seriesKeys] = getDirectionKeys(s, primaryDirection, secondaryDirection);
+ return secondaryKeys.every((key) => seriesKeys.includes(key));
+ }
+ return true;
+ }).map(this.findMatchingNodes(axis, primaryDirection, valueIsDate, eventValue)).filter(import_ag_charts_core68.isDefined);
+ if (matchingNodes.length === 1 && matchingNodes[0]?.nodeDatum !== chart.ctx.highlightManager.getActiveHighlight()) {
+ this.dispatchHighlightUpdate(chart, matchingNodes[0].nodeDatum);
+ dispatched = true;
+ break;
+ }
+ }
+ if (!dispatched) {
+ debug("ChartSync.findMatchingHighlightNodes() - no matching nodes", chart.id, event);
+ this.dispatchHighlightUpdate(chart);
+ }
+ }
+ }
+ findMatchingNodes(axis, mainDirection, valueIsDate, eventValue) {
+ return (series) => {
+ const seriesKeys = series.getKeys(axis.direction);
+ if (axis.keys.length && !axis.keys.some((key) => seriesKeys.includes(key)))
+ return;
+ const nodeData = series.contextNodeData?.nodeData ?? [];
+ if (!nodeData?.length)
+ return;
+ const firstNode = nodeData[0];
+ const mainDirectionKey = `${mainDirection}Key`;
+ if (!isObjectWithStringProperty(firstNode, mainDirectionKey))
+ return;
+ const valueKey = firstNode[mainDirectionKey];
+ const nodeDatum = nodeData.find((datum) => {
+ const nodeValue = datum.datum[valueKey];
+ return valueIsDate ? nodeValue.getTime() === eventValue : nodeValue === eventValue;
+ });
+ return nodeDatum ? { series, nodeDatum } : null;
+ };
+ }
+ dispatchHighlightUpdate(chart, nodeDatum) {
+ debug("ChartSync.dispatchHighlightUpdate()", chart.id, nodeDatum);
+ chart.ctx.highlightManager.updateHighlight(`${chart.id}-sync`, nodeDatum);
+ const tooltipEnabled = nodeDatum?.series.tooltipEnabled ?? chart.tooltip.enabled;
+ if (nodeDatum && tooltipEnabled) {
+ const bbox = chart.seriesAreaBoundingBox;
+ const canvasX = bbox.x + (nodeDatum.midPoint?.x ?? nodeDatum.point?.x ?? 0);
+ const canvasY = bbox.y + (nodeDatum.midPoint?.y ?? nodeDatum.point?.y ?? 0);
+ const tooltipMeta = TooltipManager.makeTooltipMeta(
+ { type: "pointermove", canvasX, canvasY },
+ nodeDatum.series,
+ nodeDatum,
+ void 0
+ );
+ chart.ctx.tooltipManager.updateTooltip(
+ `${chart.id}-sync`,
+ tooltipMeta,
+ chart.getTooltipContent(nodeDatum.series, nodeDatum.datumIndex, nodeDatum, "tooltip")
+ );
+ } else {
+ chart.ctx.tooltipManager.removeTooltip(`${chart.id}-sync`);
+ }
+ this.updateChart(chart, ChartUpdateType2.SERIES_UPDATE);
+ }
+ async getSyncedDomain(axis) {
+ if (!CartesianAxis.is(axis) || this.axes !== "xy" && this.axes !== axis.direction) {
+ return;
+ }
+ const { groupState, directionDomains, domainsByKey, positionDomains } = this.updateDomainState(axis);
+ this.validateAxis(axis, groupState);
+ await this.waitForDomainsToBeReady();
+ if (this.domainMode === "position") {
+ return this.calculateDerivedDomain(axis, positionDomains);
+ }
+ if (this.domainMode === "direction" || axis.keys.length === 0) {
+ return this.calculateDerivedDomain(axis, directionDomains);
+ }
+ return this.calculateKeyDerivedDomain(axis, domainsByKey);
+ }
+ updateDomainState(axis) {
+ var _a, _b, _c, _d, _e;
+ const { syncManager } = this.moduleContext;
+ const chartId = syncManager.getChart().id;
+ const axisId = axis.id;
+ const groupState = syncManager.getGroupState(this.groupId);
+ if (!groupState)
+ throw new Error("AG Charts - no GroupState for groupId: " + this.groupId);
+ const domainsByDirection = groupState.domains ?? (groupState.domains = {});
+ const directionDomains = domainsByDirection[_a = axis.direction] ?? (domainsByDirection[_a] = { derived: [], sources: {}, dirty: true });
+ const chartDirectionDomains = (_b = directionDomains.sources)[chartId] ?? (_b[chartId] = {});
+ chartDirectionDomains[axisId] = axis.dataDomain.domain;
+ directionDomains.dirty = true;
+ const domainsByKey = groupState.domainsByKey ?? (groupState.domainsByKey = {});
+ for (const key of axis.keys ?? []) {
+ const keyDomains = domainsByKey[key] ?? (domainsByKey[key] = { derived: [], sources: {}, dirty: true });
+ const chartKeyDomains = (_c = keyDomains.sources)[chartId] ?? (_c[chartId] = {});
+ chartKeyDomains[axisId] = axis.dataDomain.domain;
+ keyDomains.dirty = true;
+ }
+ const domainsByPosition = groupState.domainsByPosition ?? (groupState.domainsByPosition = {});
+ const positionDomains = domainsByPosition[_d = axis.position] ?? (domainsByPosition[_d] = { derived: [], sources: {}, dirty: true });
+ const chartPositionDomains = (_e = positionDomains.sources)[chartId] ?? (_e[chartId] = {});
+ chartPositionDomains[axisId] = axis.dataDomain.domain;
+ positionDomains.dirty = true;
+ return { groupState, directionDomains, domainsByKey, positionDomains };
+ }
+ validateAxis(axis, groupState) {
+ const multiSeries = this.moduleContext.syncManager.getGroupSyncMode(this.groupId) === "multi-series";
+ if (!syncedDirections(this.axes).includes(axis.direction))
+ return;
+ if (multiSeries) {
+ this.validateMultiSeries(axis, groupState);
+ } else {
+ this.validateSingleSeries(axis, groupState);
+ }
+ }
+ validateMultiSeries(axis, groupState) {
+ const { min, max, nice, reverse } = axis;
+ const matchingKeys = new Set(axis.boundSeries.flatMap((s) => s.getKeys(axis.direction)));
+ for (const member of groupState.members) {
+ const { axes, modulesManager } = member;
+ const memberSyncDirections = syncedDirections(modulesManager.getModule("sync")?.axes);
+ const keyMatchedAxes = axes.filter((a) => memberSyncDirections.includes(a.direction)).filter((a) => a.boundSeries.some((s) => s.getKeys(a.direction).some((k) => matchingKeys.has(k))));
+ if (keyMatchedAxes.length === 0)
+ continue;
+ const [firstAxis] = keyMatchedAxes;
+ if (firstAxis.min !== min || firstAxis.max !== max || firstAxis.nice !== nice || firstAxis.reverse !== reverse) {
+ import_ag_charts_core68.Logger.warnOnce(
+ "To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."
+ );
+ this.enabled = false;
+ return;
+ }
+ }
+ }
+ validateSingleSeries(axis, groupState) {
+ const members = groupState.members;
+ const [{ axes: syncAxes }] = members;
+ const { direction, min, max, nice, reverse } = axis;
+ for (const nextAxis of syncAxes) {
+ if (direction !== nextAxis.direction)
+ continue;
+ if (nice !== nextAxis.nice || reverse !== nextAxis.reverse || min !== nextAxis.min && ((0, import_ag_charts_core68.isFiniteNumber)(min) || (0, import_ag_charts_core68.isFiniteNumber)(nextAxis.min)) || max !== nextAxis.max && ((0, import_ag_charts_core68.isFiniteNumber)(max) || (0, import_ag_charts_core68.isFiniteNumber)(nextAxis.max))) {
+ import_ag_charts_core68.Logger.warnOnce(
+ "To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."
+ );
+ this.enabled = false;
+ return;
+ }
+ }
+ }
+ calculateDerivedDomain(axis, directionDomains) {
+ if (!directionDomains.dirty)
+ return directionDomains.derived;
+ const previousDerived = directionDomains.derived;
+ directionDomains.derived = (0, import_ag_charts_core68.unique)(
+ Object.values(directionDomains.sources).map((d) => Object.values(d)).flat(2)
+ );
+ if (ContinuousScale6.is(axis.scale)) {
+ directionDomains.derived = findMinMax4(directionDomains.derived);
+ }
+ directionDomains.dirty = false;
+ if (domainChanged(axis.scale, previousDerived, directionDomains.derived)) {
+ debug(axis.id, "updated", axis.keys, { before: previousDerived, after: directionDomains.derived });
+ this.updateSiblings();
+ }
+ return directionDomains.derived;
+ }
+ calculateKeyDerivedDomain(axis, domainsByKey) {
+ let previousDerived = [];
+ let newDerived = [];
+ let updated = false;
+ for (const key of axis.keys ?? []) {
+ const keyDomains = domainsByKey[key];
+ const previousDerivedForKey = keyDomains.derived;
+ previousDerived.push(...previousDerivedForKey);
+ if (!keyDomains.dirty) {
+ newDerived.push(...keyDomains.derived);
+ continue;
+ }
+ keyDomains.derived = (0, import_ag_charts_core68.unique)(
+ Object.values(keyDomains.sources).map((d) => Object.values(d)).flat(2)
+ );
+ if (ContinuousScale6.is(axis.scale)) {
+ keyDomains.derived = findMinMax4(keyDomains.derived);
+ }
+ newDerived.push(...keyDomains.derived);
+ keyDomains.dirty = false;
+ updated || (updated = !(0, import_ag_charts_core68.arraysEqual)(previousDerivedForKey, keyDomains.derived));
+ }
+ if (ContinuousScale6.is(axis.scale)) {
+ previousDerived = findMinMax4(previousDerived);
+ newDerived = findMinMax4(newDerived);
+ }
+ if (updated && domainChanged(axis.scale, previousDerived, newDerived)) {
+ debug(axis.id, "updated", axis.keys, { before: previousDerived, after: newDerived });
+ this.updateSiblings();
+ }
+ return newDerived;
+ }
+ removeAxis(axis) {
+ if (!CartesianAxis.is(axis) || this.axes !== "xy" && this.axes !== axis.direction) {
+ return;
+ }
+ const { syncManager } = this.moduleContext;
+ const syncGroup = syncManager.getGroupState(this.groupId);
+ const chartId = syncManager.getChart().id;
+ const axisId = axis.id;
+ delete syncGroup?.domains?.[axis.direction]?.sources?.[chartId]?.[axisId];
+ for (const key of axis.keys ?? []) {
+ delete syncGroup?.domainsByKey?.[key]?.sources?.[chartId]?.[axisId];
+ }
+ delete syncGroup?.domainsByPosition?.[axis.position]?.sources?.[chartId]?.[axisId];
+ }
+ async waitForDomainsToBeReady() {
+ const { syncManager } = this.moduleContext;
+ let count = 0;
+ while (syncManager.getGroupMembers(this.groupId).some((c) => c.syncStatus === "init")) {
+ debug("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated", this.groupId);
+ await this.domainSync.await();
+ count++;
+ }
+ if (count > 0) {
+ debug("ChartSync.waitForDomainsToBeReady() - waited for", count, "iterations");
+ }
+ this.domainSync.notify();
+ }
+ prepareZoomUpdate() {
+ const { zoomManager } = this.moduleContext;
+ const zoom = zoomManager.getZoom();
+ if (this.axes === "x") {
+ delete zoom?.y;
+ } else if (this.axes === "y") {
+ delete zoom?.x;
+ }
+ return definedZoomState(zoom);
+ }
+ onEnabledChange() {
+ const { syncManager } = this.moduleContext;
+ if (this.enabled) {
+ syncManager.subscribe(this.groupId);
+ } else {
+ syncManager.unsubscribe(this.groupId);
+ }
+ this.updateSiblings();
+ this.onNodeInteractionChange();
+ this.onZoomChange();
+ }
+ onGroupIdChange(newValue, oldValue) {
+ if (!this.enabled || newValue === oldValue)
+ return;
+ const { syncManager } = this.moduleContext;
+ syncManager.unsubscribe(oldValue);
+ syncManager.subscribe(newValue);
+ this.updateSiblings(oldValue);
+ this.updateSiblings(newValue);
+ }
+ onAxesChange() {
+ if (!this.enabled)
+ return;
+ const { syncManager } = this.moduleContext;
+ this.updateChart(syncManager.getChart());
+ }
+ onNodeInteractionChange() {
+ if (this.enabled && this.nodeInteraction) {
+ this.enabledNodeInteractionSync();
+ } else {
+ this.disableNodeInteractionSync?.();
+ }
+ }
+ onZoomChange() {
+ if (this.enabled && this.zoom) {
+ this.enabledZoomSync();
+ } else {
+ this.disableZoomSync?.();
+ }
+ }
+ destroy() {
+ const { syncManager } = this.moduleContext;
+ syncManager.unsubscribe(this.groupId);
+ this.updateSiblings();
+ this.disableZoomSync?.();
+ }
+};
+ChartSync.className = "Sync";
+__decorateClass([
+ Property59,
+ ObserveChanges4((target) => target.onEnabledChange())
+], ChartSync.prototype, "enabled", 2);
+__decorateClass([
+ Property59,
+ ObserveChanges4((target, newValue, oldValue) => target.onGroupIdChange(newValue, oldValue))
+], ChartSync.prototype, "groupId", 2);
+__decorateClass([
+ Property59,
+ ObserveChanges4((target) => target.onAxesChange())
+], ChartSync.prototype, "axes", 2);
+__decorateClass([
+ Property59,
+ ObserveChanges4((target) => target.onNodeInteractionChange())
+], ChartSync.prototype, "nodeInteraction", 2);
+__decorateClass([
+ Property59,
+ ObserveChanges4((target) => target.onZoomChange())
+], ChartSync.prototype, "zoom", 2);
+__decorateClass([
+ Property59,
+ ObserveChanges4((target) => target.onAxesChange())
+], ChartSync.prototype, "domainMode", 2);
+
+// packages/ag-charts-enterprise/src/features/sync/syncModule.ts
+var SyncModule = {
+ type: "root",
+ optionsKey: "sync",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ moduleFactory: (ctx) => new ChartSync(ctx),
+ themeTemplate: {
+ sync: { enabled: false }
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoom.ts
+var import_ag_charts_community170 = require("ag-charts-community");
+var import_ag_charts_core74 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/features/zoom/scenes/zoomRect.ts
+var import_ag_charts_community163 = require("ag-charts-community");
+var { Property: Property60 } = import_ag_charts_community163._ModuleSupport;
+var VALID_COLOR = "#2196f3";
+var INVALID_COLOR = "#8a8a8a";
+var ZoomRect = class extends import_ag_charts_community163._ModuleSupport.Rect {
+ constructor() {
+ super(...arguments);
+ this.fill = VALID_COLOR;
+ this.fillOpacity = 0.2;
+ this.zIndex = import_ag_charts_community163._ModuleSupport.ZIndexMap.ZOOM_SELECTION;
+ }
+ updateValid() {
+ this.fill = VALID_COLOR;
+ }
+ updateInvalid() {
+ this.fill = INVALID_COLOR;
+ }
+};
+ZoomRect.className = "ZoomRect";
+__decorateClass([
+ Property60
+], ZoomRect.prototype, "fill", 2);
+__decorateClass([
+ Property60
+], ZoomRect.prototype, "fillOpacity", 2);
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomAxisDragger.ts
+var import_ag_charts_community164 = require("ag-charts-community");
+var ZoomAxisDragger = class {
+ update(event, direction, anchor, bbox, zoom, axisZoom) {
+ this.oldZoom ?? (this.oldZoom = definedZoomState(
+ direction === import_ag_charts_community164._ModuleSupport.ChartAxisDirection.X ? { ...zoom, x: axisZoom } : { ...zoom, y: axisZoom }
+ ));
+ this.updateCoords(event.offsetX, event.offsetY);
+ return this.updateZoom(direction, anchor, bbox);
+ }
+ stop() {
+ this.coords = void 0;
+ this.oldZoom = void 0;
+ }
+ updateCoords(x, y) {
+ if (this.coords) {
+ this.coords.x2 = x;
+ this.coords.y2 = y;
+ } else {
+ this.coords = { x1: x, y1: y, x2: x, y2: y };
+ }
+ }
+ updateZoom(direction, anchor, bbox) {
+ const { coords, oldZoom } = this;
+ let newZoom = definedZoomState(oldZoom);
+ if (!coords || !oldZoom) {
+ if (direction === import_ag_charts_community164._ModuleSupport.ChartAxisDirection.X)
+ return newZoom.x;
+ return newZoom.y;
+ }
+ const origin = pointToRatio(bbox, coords.x1, coords.y1);
+ const target = pointToRatio(bbox, coords.x2, coords.y2);
+ if (direction === import_ag_charts_community164._ModuleSupport.ChartAxisDirection.X) {
+ const scaleX = (target.x - origin.x) * dx(oldZoom);
+ newZoom.x.max += scaleX;
+ newZoom.x = scaleZoomAxisWithAnchor(newZoom.x, oldZoom.x, anchor, origin.x);
+ newZoom = constrainZoom(newZoom);
+ return newZoom.x;
+ }
+ const scaleY = (target.y - origin.y) * dy(oldZoom);
+ newZoom.y.max -= scaleY;
+ newZoom.y = scaleZoomAxisWithAnchor(newZoom.y, oldZoom.y, anchor, origin.y);
+ newZoom = constrainZoom(newZoom);
+ return newZoom.y;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomContextMenu.ts
+var ZoomContextMenu = class {
+ constructor(eventsHub, contextMenuRegistry, zoomManager, getModuleProperties, canResetZoom, getRect, updateZoom, isZoomValid) {
+ this.eventsHub = eventsHub;
+ this.contextMenuRegistry = contextMenuRegistry;
+ this.zoomManager = zoomManager;
+ this.getModuleProperties = getModuleProperties;
+ this.canResetZoom = canResetZoom;
+ this.getRect = getRect;
+ this.updateZoom = updateZoom;
+ this.isZoomValid = isZoomValid;
+ }
+ registerActions(enabled) {
+ const { contextMenuRegistry } = this;
+ const action = enabled ? "show" : "hide";
+ contextMenuRegistry.toggle("zoom-to-cursor", action);
+ contextMenuRegistry.toggle("pan-to-cursor", action);
+ contextMenuRegistry.toggle("reset-zoom", action);
+ if (!enabled) {
+ return;
+ }
+ contextMenuRegistry.builtins.items["zoom-to-cursor"].action = this.onZoomToHere.bind(this);
+ contextMenuRegistry.builtins.items["pan-to-cursor"].action = this.onPanToHere.bind(this);
+ contextMenuRegistry.builtins.items["reset-zoom"].action = this.onResetZoom.bind(this);
+ const shouldEnableZoomToHere = (event) => {
+ const rect = this.getRect();
+ if (!rect)
+ return true;
+ const origin = pointToRatio(rect, event.x, event.y);
+ return this.iterateFindNextZoomAtPoint(origin) != null;
+ };
+ const shouldEnablePanToHere = () => {
+ return !isZoomEqual(definedZoomState(this.zoomManager.getZoom()), unitZoomState());
+ };
+ const removeListener = this.eventsHub.on("context-menu:setup", (event) => {
+ contextMenuRegistry.builtins.items["zoom-to-cursor"].enabled = shouldEnableZoomToHere(event);
+ contextMenuRegistry.builtins.items["pan-to-cursor"].enabled = shouldEnablePanToHere();
+ contextMenuRegistry.builtins.items["reset-zoom"].enabled = this.canResetZoom();
+ });
+ return () => {
+ removeListener();
+ contextMenuRegistry.toggle("zoom-to-cursor", "hide");
+ contextMenuRegistry.toggle("pan-to-cursor", "hide");
+ contextMenuRegistry.toggle("reset-zoom", "hide");
+ };
+ }
+ computeOrigin(event) {
+ const rect = this.getRect();
+ const { enabled } = this.getModuleProperties();
+ if (!enabled || !rect || !event?.target || !(event instanceof MouseEvent))
+ return;
+ const relativeRect = { x: 0, y: 0, width: rect.width, height: rect.height };
+ return pointToRatio(relativeRect, event.offsetX, event.offsetY);
+ }
+ onZoomToHere({ event }) {
+ const origin = this.computeOrigin(event);
+ if (!origin)
+ return;
+ const zoom = this.iterateFindNextZoomAtPoint(origin);
+ if (zoom == null)
+ return;
+ this.updateZoom(zoom);
+ }
+ onPanToHere({ event }) {
+ const origin = this.computeOrigin(event);
+ if (!origin)
+ return;
+ const zoom = definedZoomState(this.zoomManager.getZoom());
+ const scaleX = dx(zoom);
+ const scaleY = dy(zoom);
+ const scaledOriginX = origin.x * scaleX;
+ const scaledOriginY = origin.y * scaleY;
+ const halfSize = UNIT_SIZE / 2;
+ let newZoom = {
+ x: { min: origin.x - halfSize, max: origin.x + halfSize },
+ y: { min: origin.y - halfSize, max: origin.y + halfSize }
+ };
+ newZoom = scaleZoomCenter(newZoom, scaleX, scaleY);
+ newZoom = translateZoom(newZoom, zoom.x.min - origin.x + scaledOriginX, zoom.y.min - origin.y + scaledOriginY);
+ this.updateZoom(constrainZoom(newZoom));
+ }
+ onResetZoom(_actionEvent) {
+ this.zoomManager.resetZoom("zoom");
+ }
+ iterateFindNextZoomAtPoint(origin) {
+ const { scrollingStep } = this.getModuleProperties();
+ for (let i = scrollingStep; i <= 1 - scrollingStep; i += scrollingStep) {
+ const zoom = this.getNextZoomAtPoint(origin, i);
+ if (this.isZoomValid(zoom)) {
+ return zoom;
+ }
+ }
+ }
+ getNextZoomAtPoint(origin, step) {
+ const { isScalingX, isScalingY } = this.getModuleProperties();
+ const zoom = definedZoomState(this.zoomManager.getZoom());
+ const scaledOriginX = origin.x * dx(zoom);
+ const scaledOriginY = origin.y * dy(zoom);
+ const halfSize = UNIT_SIZE / 2;
+ let newZoom = {
+ x: { min: origin.x - halfSize, max: origin.x + halfSize },
+ y: { min: origin.y - halfSize, max: origin.y + halfSize }
+ };
+ newZoom = scaleZoomCenter(
+ newZoom,
+ isScalingX ? dx(zoom) * step : UNIT_SIZE,
+ isScalingY ? dy(zoom) * step : UNIT_SIZE
+ );
+ newZoom = translateZoom(newZoom, zoom.x.min - origin.x + scaledOriginX, zoom.y.min - origin.y + scaledOriginY);
+ return constrainZoom(newZoom);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomDOMProxy.ts
+var import_ag_charts_community165 = require("ag-charts-community");
+var import_ag_charts_core69 = require("ag-charts-core");
+var { ChartAxisDirection: ChartAxisDirection21 } = import_ag_charts_community165._ModuleSupport;
+var ZoomDOMProxy = class {
+ constructor(axesHandlers) {
+ this.axesHandlers = axesHandlers;
+ this.axes = [];
+ this.overlappingAxisIds = /* @__PURE__ */ new Set();
+ }
+ destroy() {
+ for (const a of this.axes) {
+ a.div.destroy();
+ }
+ }
+ update(enableAxisDragging, enableAxisScrolling, ctx, seriesRect) {
+ this.seriesRect = seriesRect;
+ for (const ax of this.axes) {
+ ax.div.setHidden(!enableAxisDragging && !enableAxisScrolling);
+ }
+ if (!enableAxisDragging && !enableAxisScrolling)
+ return;
+ const { X, Y } = ChartAxisDirection21;
+ const axesCtx = [...ctx.axisManager.getAxisContext(X), ...ctx.axisManager.getAxisContext(Y)];
+ const { removed, added } = this.diffAxisIds(axesCtx);
+ if (removed.length > 0) {
+ this.axes = this.axes.filter((entry) => {
+ if (removed.includes(entry.axisId)) {
+ entry.div.destroy();
+ this.overlappingAxisIds.delete(entry.axisId);
+ if (this.hoveredAxisId === entry.axisId)
+ this.hoveredAxisId = void 0;
+ if (this.activeAxisId === entry.axisId)
+ this.activeAxisId = void 0;
+ return false;
+ }
+ return true;
+ });
+ }
+ for (const newAxisCtx of added) {
+ const { axisId, direction } = newAxisCtx;
+ this.axes.push(this.initAxis(ctx, axisId, this.axesHandlers, direction));
+ }
+ for (const axis of this.axes) {
+ const axisCtx = axesCtx.find((ac) => ac.axisId === axis.axisId);
+ const bbox = axisCtx.getCanvasBounds();
+ axis.div.setHidden((0, import_ag_charts_core69.boxEmpty)(bbox));
+ if (bbox == void 0) {
+ axis.bounds = void 0;
+ } else {
+ axis.div.setBounds(bbox);
+ axis.bounds = new import_ag_charts_community165._ModuleSupport.BBox(bbox.x, bbox.y, bbox.width, bbox.height);
+ }
+ }
+ this.updateOverlappingAxisPointerEvents(enableAxisDragging, enableAxisScrolling);
+ }
+ setAxisCursor(cursor) {
+ this.cursor = cursor;
+ for (const axis of this.axes) {
+ axis.div.setCursor(this.getCursor(axis.direction));
+ }
+ }
+ toggleAxisDraggingCursor(direction, enabled) {
+ for (const axis of this.axes) {
+ if (axis.direction !== direction)
+ continue;
+ axis.div.setCursor(enabled ? this.getCursor(direction) : void 0);
+ }
+ }
+ updateOverlappingAxisPointerEvents(enableAxisDragging, enableAxisScrolling) {
+ this.overlappingAxisIds.clear();
+ const shouldEnableInteraction = (enableAxisDragging || enableAxisScrolling) && this.seriesRect;
+ for (const axis of this.axes) {
+ if (!shouldEnableInteraction) {
+ axis.div.setPointerEvents(void 0);
+ continue;
+ }
+ const isOverlapping = Boolean(axis.bounds?.collidesBBox(this.seriesRect));
+ if (isOverlapping) {
+ this.overlappingAxisIds.add(axis.axisId);
+ axis.div.setPointerEvents("none");
+ } else {
+ axis.div.setPointerEvents(void 0);
+ }
+ }
+ this.cleanupAxisState();
+ }
+ cleanupAxisState() {
+ if (this.hoveredAxisId && !this.overlappingAxisIds.has(this.hoveredAxisId)) {
+ this.hoveredAxisId = void 0;
+ }
+ if (this.activeAxisId && !this.overlappingAxisIds.has(this.activeAxisId)) {
+ this.activeAxisId = void 0;
+ }
+ }
+ pickAxisAtPoint(x, y) {
+ for (const axis of this.axes) {
+ if (!this.overlappingAxisIds.has(axis.axisId))
+ continue;
+ if (axis.bounds?.containsPoint(x, y)) {
+ return { axisId: axis.axisId, direction: axis.direction };
+ }
+ }
+ return void 0;
+ }
+ setHoveredAxis(axisId) {
+ if (this.overlappingAxisIds.has(axisId)) {
+ this.hoveredAxisId = axisId;
+ }
+ }
+ clearHoveredAxis() {
+ if (!this.activeAxisId) {
+ this.hoveredAxisId = void 0;
+ }
+ }
+ beginDelegatedAxisDrag(axisId) {
+ if (!this.overlappingAxisIds.has(axisId))
+ return false;
+ this.activeAxisId = axisId;
+ this.hoveredAxisId = void 0;
+ return true;
+ }
+ endDelegatedAxisDrag(axisId) {
+ if (this.activeAxisId === axisId) {
+ this.activeAxisId = void 0;
+ }
+ this.hoveredAxisId = void 0;
+ }
+ hasOverlappingAxes() {
+ return this.overlappingAxisIds.size > 0;
+ }
+ getHoveredAxis() {
+ if (!this.hoveredAxisId)
+ return void 0;
+ const axis = this.axes.find((a) => a.axisId === this.hoveredAxisId);
+ return axis ? { axisId: axis.axisId, direction: axis.direction } : void 0;
+ }
+ getCursor(direction) {
+ if (this.cursor)
+ return this.cursor;
+ return direction === ChartAxisDirection21.X ? "ew-resize" : "ns-resize";
+ }
+ initAxis(ctx, axisId, handlers, direction) {
+ const where = "afterend";
+ const div = ctx.proxyInteractionService.createProxyElement({ type: "region", domManagerId: axisId, where });
+ div.setCursor(this.getCursor(direction));
+ div.addListener("drag-start", (e) => {
+ if (e.device === "touch") {
+ e.sourceEvent.preventDefault();
+ }
+ this.activeAxisId = axisId;
+ handlers.onAxisDragStart(direction);
+ });
+ div.addListener("drag-move", (event) => handlers.onAxisDragMove(axisId, direction, event));
+ div.addListener("drag-end", () => {
+ this.activeAxisId = void 0;
+ this.hoveredAxisId = void 0;
+ handlers.onAxisDragEnd();
+ });
+ div.addListener("dblclick", () => handlers.onAxisDoubleClick(axisId, direction));
+ div.addListener("wheel", (event) => handlers.onAxisWheel(axisId, direction, event));
+ return { axisId, div, direction };
+ }
+ diffAxisIds(axesCtx) {
+ const myIds = this.axes.map((entry) => entry.axisId);
+ const ctxIds = axesCtx.map((ctx) => ctx.axisId);
+ const removed = myIds.filter((id) => !ctxIds.includes(id));
+ const added = axesCtx.filter((ac) => !myIds.includes(ac.axisId));
+ return { removed, added };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomPanner.ts
+var import_ag_charts_community166 = require("ag-charts-community");
+var import_ag_charts_core70 = require("ag-charts-core");
+var maxZoomCoords = 16;
+var decelerationValues = {
+ off: 1,
+ short: 0.01,
+ long: 2e-3
+};
+var ZoomPanner = class {
+ constructor() {
+ this.deceleration = 1;
+ this.zoomCoordsHistoryIndex = 0;
+ this.coordsHistory = [];
+ }
+ get decelerationValue() {
+ const { deceleration } = this;
+ return Math.max(
+ typeof deceleration === "number" ? deceleration : decelerationValues[deceleration] ?? 1,
+ 1e-4
+ );
+ }
+ addListener(_type, fn) {
+ this.onUpdate = fn;
+ return () => {
+ this.onUpdate = void 0;
+ };
+ }
+ stopInteractions() {
+ if (this.inertiaHandle != null) {
+ cancelAnimationFrame(this.inertiaHandle);
+ this.inertiaHandle = void 0;
+ }
+ }
+ update(event) {
+ this.updateCoords(event.currentX, event.currentY);
+ const { x1 = 0, y1 = 0, x2 = 0, y2 = 0 } = this.coords ?? {};
+ this.onUpdate?.({
+ type: "update",
+ deltaX: this.isPanningX() ? x1 - x2 : 0,
+ deltaY: this.isPanningY() ? y1 - y2 : 0
+ });
+ }
+ start(direction) {
+ this.direction = direction;
+ this.coordsMonitorTimeout = setInterval(this.recordCurrentZoomCoords.bind(this), 16);
+ }
+ stop() {
+ const { coordsHistory } = this;
+ let deltaX = 0;
+ let deltaY = 0;
+ let deltaT = 0;
+ if (coordsHistory.length > 0) {
+ const arrayIndex = this.zoomCoordsHistoryIndex % maxZoomCoords;
+ let index1 = arrayIndex - 1;
+ if (index1 < 0)
+ index1 = coordsHistory.length - 1;
+ let index0 = arrayIndex;
+ if (index0 >= coordsHistory.length)
+ index0 = 0;
+ const coords1 = coordsHistory[index1];
+ const coords0 = coordsHistory[index0];
+ deltaX = this.isPanningX() ? coords1.x - coords0.x : 0;
+ deltaY = this.isPanningY() ? coords1.y - coords0.y : 0;
+ deltaT = coords1.t - coords0.t;
+ }
+ this.coords = void 0;
+ this.direction = void 0;
+ clearInterval(this.coordsMonitorTimeout);
+ this.coordsMonitorTimeout = void 0;
+ this.zoomCoordsHistoryIndex = 0;
+ this.coordsHistory.length = 0;
+ if (deltaT > 0 && this.decelerationValue < 1) {
+ const xVelocity = deltaX / deltaT;
+ const yVelocity = deltaY / deltaT;
+ const velocity = Math.hypot(xVelocity, yVelocity);
+ const angle = Math.atan2(yVelocity, xVelocity);
+ const t0 = performance.now();
+ this.inertiaHandle = (0, import_ag_charts_core70.getWindow)().requestAnimationFrame((t) => {
+ this.animateInertia(t, t, t0, velocity, angle);
+ });
+ }
+ }
+ recordCurrentZoomCoords() {
+ const { coords, coordsHistory, zoomCoordsHistoryIndex } = this;
+ if (!coords)
+ return;
+ const { x2: x, y2: y } = coords;
+ const t = Date.now();
+ coordsHistory[zoomCoordsHistoryIndex % maxZoomCoords] = { x, y, t };
+ this.zoomCoordsHistoryIndex += 1;
+ }
+ animateInertia(t, prevT, t0, velocity, angle) {
+ const friction = 1 - this.decelerationValue;
+ const maxS = -velocity / Math.log(friction);
+ const s0 = velocity * (friction ** (prevT - t0) - 1) / Math.log(friction);
+ const s1 = velocity * (friction ** (t - t0) - 1) / Math.log(friction);
+ this.onUpdate?.({
+ type: "update",
+ deltaX: this.isPanningX() ? -Math.cos(angle) * (s1 - s0) : 0,
+ deltaY: this.isPanningY() ? -Math.sin(angle) * (s1 - s0) : 0
+ });
+ if (s1 >= maxS - 1)
+ return;
+ this.inertiaHandle = requestAnimationFrame((nextT) => {
+ this.animateInertia(nextT, t, t0, velocity, angle);
+ });
+ }
+ updateCoords(x, y) {
+ if (this.coords) {
+ this.coords = { x1: this.coords.x2, y1: this.coords.y2, x2: x, y2: y };
+ } else {
+ this.coords = { x1: x, y1: y, x2: x, y2: y };
+ }
+ }
+ isPanningX() {
+ return this.direction == null || this.direction === import_ag_charts_community166._ModuleSupport.ChartAxisDirection.X;
+ }
+ isPanningY() {
+ return this.direction == null || this.direction === import_ag_charts_community166._ModuleSupport.ChartAxisDirection.Y;
+ }
+ translateZooms(bbox, currentZooms, deltaX, deltaY) {
+ const offset = pointToRatio(bbox, bbox.x + Math.abs(deltaX), bbox.y + bbox.height - Math.abs(deltaY));
+ const offsetX = Math.sign(deltaX) * offset.x;
+ const offsetY = -Math.sign(deltaY) * offset.y;
+ const newZooms = {};
+ for (const [axisId, { direction, zoom: currentZoom }] of (0, import_ag_charts_core70.entries)(currentZooms)) {
+ if (currentZoom && currentZoom.min === UNIT_MIN && currentZoom.max === UNIT_MAX) {
+ continue;
+ }
+ let zoom = definedZoomState({ [direction]: currentZoom });
+ zoom = constrainZoom(translateZoom(zoom, offsetX * dx(zoom), offsetY * dy(zoom)));
+ newZooms[axisId] = { direction, zoom: zoom[direction] };
+ }
+ return newZooms;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomScrollPanner.ts
+var import_ag_charts_community167 = require("ag-charts-community");
+var import_ag_charts_core71 = require("ag-charts-core");
+var DELTA_SCALE = 200;
+var ZoomScrollPanner = class {
+ update(event, step, bbox, zooms) {
+ const deltaX = event.deltaX * step * DELTA_SCALE;
+ return this.translateZooms(bbox, zooms, deltaX);
+ }
+ translateZooms(bbox, currentZooms, deltaX) {
+ const newZooms = {};
+ const offset = pointToRatio(bbox, bbox.x + Math.abs(deltaX), 0);
+ const offsetX = deltaX < 0 ? -offset.x : offset.x;
+ for (const [axisId, { direction, zoom: currentZoom }] of (0, import_ag_charts_core71.entries)(currentZooms)) {
+ if (direction !== import_ag_charts_community167._ModuleSupport.ChartAxisDirection.X)
+ continue;
+ let zoom = definedZoomState({ x: currentZoom });
+ zoom = constrainZoom(translateZoom(zoom, offsetX * dx(zoom), 0));
+ newZooms[axisId] = { direction, zoom: zoom.x };
+ }
+ return newZooms;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomScroller.ts
+var import_ag_charts_community168 = require("ag-charts-community");
+var import_ag_charts_core72 = require("ag-charts-core");
+var ZoomScroller = class {
+ updateAxes(event, props, bbox, zooms) {
+ const sourceEvent = event.sourceEvent;
+ const newZooms = {};
+ const { anchorPointX, anchorPointY, isScalingX, isScalingY, scrollingStep } = props;
+ const origin = pointToRatio(
+ bbox,
+ sourceEvent.offsetX ?? sourceEvent.clientX,
+ sourceEvent.offsetY ?? sourceEvent.clientY
+ );
+ for (const [axisId, { direction, zoom }] of (0, import_ag_charts_core72.entries)(zooms)) {
+ if (zoom == null)
+ continue;
+ let newZoom = { ...zoom };
+ const delta3 = scrollingStep * event.deltaY * (zoom.max - zoom.min);
+ if (direction === import_ag_charts_community168._ModuleSupport.ChartAxisDirection.X && isScalingX) {
+ newZoom.max += delta3;
+ newZoom = scaleZoomAxisWithAnchor(newZoom, zoom, anchorPointX, origin.x);
+ } else if (direction === import_ag_charts_community168._ModuleSupport.ChartAxisDirection.Y && isScalingY) {
+ newZoom.max += delta3;
+ newZoom = scaleZoomAxisWithAnchor(newZoom, zoom, anchorPointY, origin.y);
+ } else {
+ continue;
+ }
+ if (newZoom.max < newZoom.min)
+ continue;
+ newZooms[axisId] = { direction, zoom: constrainAxis(newZoom) };
+ }
+ return newZooms;
+ }
+ update(event, props, bbox, oldZoom) {
+ const { anchorPointX, anchorPointY, isScalingX, isScalingY, scrollingStep } = props;
+ const canvasX = event.offsetX + bbox.x;
+ const canvasY = event.offsetY + bbox.y;
+ const origin = pointToRatio(bbox, canvasX, canvasY);
+ const dir = event.deltaY;
+ let newZoom = definedZoomState(oldZoom);
+ newZoom.x.max += isScalingX ? scrollingStep * dir * dx(oldZoom) : 0;
+ newZoom.y.max += isScalingY ? scrollingStep * dir * dy(oldZoom) : 0;
+ if (newZoom.x.max < newZoom.x.min || newZoom.y.max < newZoom.y.min)
+ return;
+ if (isScalingX) {
+ newZoom.x = scaleZoomAxisWithAnchor(newZoom.x, oldZoom.x, anchorPointX, origin.x);
+ }
+ if (isScalingY) {
+ newZoom.y = scaleZoomAxisWithAnchor(newZoom.y, oldZoom.y, anchorPointY, origin.y);
+ }
+ newZoom = constrainZoom(newZoom);
+ return newZoom;
+ }
+ updateDelta(delta3, props, oldZoom) {
+ const { anchorPointX, anchorPointY, isScalingX, isScalingY, scrollingStep } = props;
+ let newZoom = definedZoomState(oldZoom);
+ newZoom.x.max += isScalingX ? scrollingStep * -delta3 * dx(oldZoom) : 0;
+ newZoom.y.max += isScalingY ? scrollingStep * -delta3 * dy(oldZoom) : 0;
+ if (isScalingX) {
+ newZoom.x = scaleZoomAxisWithAnchor(newZoom.x, oldZoom.x, anchorPointX);
+ }
+ if (isScalingY) {
+ newZoom.y = scaleZoomAxisWithAnchor(newZoom.y, oldZoom.y, anchorPointY);
+ }
+ newZoom = constrainZoom(newZoom);
+ return newZoom;
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomSelector.ts
+var ZoomSelector = class {
+ constructor(rect, getZoom, isZoomValid) {
+ this.rect = rect;
+ this.getZoom = getZoom;
+ this.isZoomValid = isZoomValid;
+ this.rect.visible = false;
+ }
+ update(event, props, bbox) {
+ const canvasX = event.currentX + (bbox?.x ?? 0);
+ const canvasY = event.currentY + (bbox?.y ?? 0);
+ this.rect.visible = true;
+ this.updateCoords(canvasX, canvasY, props, bbox);
+ this.updateRect(bbox);
+ }
+ stop(innerBBox, bbox, currentZoom) {
+ let zoom = definedZoomState();
+ if (!innerBBox || !bbox)
+ return zoom;
+ if (this.coords) {
+ zoom = this.createZoomFromCoords(bbox, currentZoom);
+ }
+ const multiplyX = bbox.width / innerBBox.width;
+ const multiplyY = bbox.height / innerBBox.height;
+ zoom = constrainZoom(multiplyZoom(zoom, multiplyX, multiplyY));
+ this.reset();
+ return zoom;
+ }
+ reset() {
+ this.coords = void 0;
+ this.rect.visible = false;
+ }
+ didUpdate() {
+ return this.rect.visible && this.rect.width > 0 && this.rect.height > 0;
+ }
+ updateCoords(x, y, props, bbox) {
+ if (!this.coords) {
+ this.coords = { x1: x, y1: y, x2: x, y2: y };
+ return;
+ }
+ const { coords } = this;
+ coords.x2 = x;
+ coords.y2 = y;
+ if (!bbox)
+ return;
+ const { isScalingX, isScalingY, keepAspectRatio } = props;
+ const normal = this.getNormalisedDimensions();
+ if (keepAspectRatio && isScalingX && isScalingY) {
+ const aspectRatio = bbox.width / bbox.height;
+ if (coords.y2 < coords.y1) {
+ coords.y2 = Math.min(coords.y1 - normal.width / aspectRatio, coords.y1);
+ } else {
+ coords.y2 = Math.max(coords.y1 + normal.width / aspectRatio, coords.y1);
+ }
+ }
+ if (!isScalingX) {
+ coords.x1 = bbox.x;
+ coords.x2 = bbox.x + bbox.width;
+ }
+ if (!isScalingY) {
+ coords.y1 = bbox.y;
+ coords.y2 = bbox.y + bbox.height;
+ }
+ }
+ updateRect(bbox) {
+ if (!bbox)
+ return;
+ const { rect } = this;
+ const normal = this.getNormalisedDimensions();
+ const { width, height } = normal;
+ let { x, y } = normal;
+ x = Math.max(x, bbox.x);
+ x -= Math.max(0, x + width - (bbox.x + bbox.width));
+ y = Math.max(y, bbox.y);
+ y -= Math.max(0, y + height - (bbox.y + bbox.height));
+ rect.x = x;
+ rect.y = y;
+ rect.width = width;
+ rect.height = height;
+ const zoom = this.createZoomFromCoords(bbox, this.getZoom());
+ if (this.isZoomValid(zoom)) {
+ rect.updateValid();
+ } else {
+ rect.updateInvalid();
+ }
+ }
+ createZoomFromCoords(bbox, currentZoom) {
+ const oldZoom = definedZoomState(currentZoom);
+ const normal = this.getNormalisedDimensions();
+ const origin = pointToRatio(bbox, normal.x, normal.y + normal.height);
+ const xFactor = normal.width / bbox.width;
+ const yFactor = normal.height / bbox.height;
+ let newZoom = scaleZoom(oldZoom, xFactor, yFactor);
+ const translateX = origin.x * dx(oldZoom);
+ const translateY = origin.y * dy(oldZoom);
+ newZoom = translateZoom(newZoom, translateX, translateY);
+ newZoom = constrainZoom(newZoom);
+ return newZoom;
+ }
+ getNormalisedDimensions() {
+ const { x1 = 0, y1 = 0, x2 = 0, y2 = 0 } = this.coords ?? {};
+ const x = Math.min(x1, x2);
+ const y = Math.min(y1, y2);
+ const width = x1 <= x2 ? x2 - x1 : x1 - x2;
+ const height = y1 <= y2 ? y2 - y1 : y1 - y2;
+ return { x, y, width, height };
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomToolbar.ts
+var import_ag_charts_community169 = require("ag-charts-community");
+var import_ag_charts_core73 = require("ag-charts-core");
+var {
+ ActionOnSet: ActionOnSet8,
+ BaseProperties: BaseProperties22,
+ ChartAxisDirection: ChartAxisDirection22,
+ NativeWidget: NativeWidget2,
+ PropertiesArray: PropertiesArray6,
+ Toolbar: Toolbar2,
+ ToolbarButtonProperties: ToolbarButtonProperties4,
+ Property: Property61
+} = import_ag_charts_community169._ModuleSupport;
+var ZoomButtonProperties = class extends ToolbarButtonProperties4 {
+};
+__decorateClass([
+ Property61
+], ZoomButtonProperties.prototype, "value", 2);
+__decorateClass([
+ Property61
+], ZoomButtonProperties.prototype, "section", 2);
+var ZoomToolbar = class extends BaseProperties22 {
+ constructor(ctx, getModuleProperties, canResetZoom, updateZoom, updateAxisZoom, resetZoom, isZoomValid) {
+ super();
+ this.ctx = ctx;
+ this.getModuleProperties = getModuleProperties;
+ this.canResetZoom = canResetZoom;
+ this.updateZoom = updateZoom;
+ this.updateAxisZoom = updateAxisZoom;
+ this.resetZoom = resetZoom;
+ this.isZoomValid = isZoomValid;
+ this.enabled = false;
+ this.buttons = new PropertiesArray6(ZoomButtonProperties);
+ this.visible = "hover";
+ this.verticalSpacing = 10;
+ this.detectionRange = 38;
+ this.cleanup = new import_ag_charts_core73.CleanupRegistry();
+ this.toggleButtonsDebounced = (0, import_ag_charts_core73.debounce)(this.toggleButtons.bind(this), ZOOM_VALID_CHECK_DEBOUNCE, {
+ leading: true,
+ trailing: true
+ });
+ this.container = new NativeWidget2((0, import_ag_charts_core73.createElement)("div"));
+ this.container.addClass("ag-charts-zoom-buttons");
+ ctx.domManager.addChild("canvas-overlay", "zoom-buttons", this.container.getElement());
+ this.toolbar = new Toolbar2(ctx, "ariaLabelZoomToolbar", "horizontal");
+ this.container.addChild(this.toolbar);
+ this.toolbar.getElement().style.transform = `translateY(54px)`;
+ this.toggleVisibility(this.visible === "always");
+ this.cleanup.register(
+ this.toolbar.addToolbarListener("button-pressed", this.onButtonPress.bind(this)),
+ this.toolbar.addToolbarListener("button-focused", this.onButtonFocus.bind(this)),
+ ctx.widgets.containerWidget.addListener("mousemove", this.onHover.bind(this)),
+ ctx.widgets.containerWidget.addListener("mouseleave", this.onLeave.bind(this)),
+ ctx.eventsHub.on("layout:complete", this.onLayoutComplete.bind(this)),
+ this.teardown.bind(this)
+ );
+ }
+ destroy() {
+ this.cleanup.flush();
+ }
+ toggleVisibleZoomed(maxZoom) {
+ if (this.visible !== "zoomed")
+ return;
+ this.toggleVisibility(!maxZoom);
+ }
+ teardown() {
+ this.ctx.domManager.removeChild("canvas-overlay", "zoom-buttons");
+ this.container.destroy();
+ }
+ onLayoutComplete(event) {
+ const { buttons: buttons2, container } = this;
+ const { rect } = event.series;
+ for (const b of buttons2) {
+ if (b.tooltip == null && b.label == null) {
+ const map = {
+ "pan-end": "toolbarZoomPanEnd",
+ "pan-left": "toolbarZoomPanLeft",
+ "pan-right": "toolbarZoomPanRight",
+ "pan-start": "toolbarZoomPanStart",
+ "zoom-in": "toolbarZoomZoomIn",
+ "zoom-out": "toolbarZoomZoomOut",
+ reset: "toolbarZoomReset"
+ };
+ b.tooltip = map[b.value];
+ }
+ }
+ this.toolbar.updateButtons(buttons2);
+ this.toggleButtonsDebounced();
+ const height = container.getBounds().height;
+ container.setBounds({ y: rect.y + rect.height - height });
+ }
+ onHover(event) {
+ if (!this.enabled || this.visible !== "hover" || this.toolbar.isHidden())
+ return;
+ const {
+ container,
+ detectionRange,
+ ctx: { scene }
+ } = this;
+ const {
+ currentY,
+ sourceEvent: { target }
+ } = event;
+ const element = container.getElement();
+ const detectionY = element.offsetTop - detectionRange;
+ const visible = currentY > detectionY && currentY < scene.canvas.element.offsetHeight || target === element;
+ this.toggleVisibility(visible);
+ }
+ onLeave() {
+ if (this.visible !== "hover")
+ return;
+ this.toggleVisibility(false);
+ }
+ toggleVisibility(visible, immediate = false) {
+ const { container, toolbar: toolbar2, verticalSpacing } = this;
+ toolbar2.toggleClass("ag-charts-zoom-buttons__toolbar--hidden", !visible);
+ const element = toolbar2.getElement();
+ element.style.transitionDuration = immediate ? "0s" : "";
+ element.style.transform = visible ? "translateY(0)" : `translateY(${container.getBounds().height + verticalSpacing}px)`;
+ }
+ toggleButtons() {
+ const zoom = definedZoomState(this.ctx.zoomManager.getZoom());
+ if (this.previousZoom && isZoomEqual(this.previousZoom, zoom))
+ return;
+ this.previousZoom = zoom;
+ for (const [index, button] of this.buttons.entries()) {
+ let enabled = true;
+ switch (button?.value) {
+ case "pan-start":
+ enabled = zoom.x.min > UNIT_MIN;
+ break;
+ case "pan-end":
+ enabled = zoom.x.max < UNIT_MAX;
+ break;
+ case "pan-left":
+ enabled = zoom.x.min > UNIT_MIN;
+ break;
+ case "pan-right":
+ enabled = zoom.x.max < UNIT_MAX;
+ break;
+ case "zoom-out":
+ enabled = !isZoomEqual(zoom, unitZoomState());
+ break;
+ case "zoom-in":
+ enabled = this.isZoomValid(
+ this.getNextZoomStateUnified("zoom-in", zoom, this.getModuleProperties())
+ );
+ break;
+ case "reset":
+ enabled = this.canResetZoom(zoom);
+ break;
+ }
+ this.toolbar.toggleButtonEnabledByIndex(index, enabled);
+ }
+ }
+ onButtonPress({ button }) {
+ if (!this.enabled || this.toolbar.isHidden())
+ return;
+ const props = this.getModuleProperties();
+ if (props.independentAxes && button.value !== "reset") {
+ const axisZooms = this.ctx.zoomManager.getAxisZooms();
+ for (const [axisId, { direction, zoom }] of (0, import_ag_charts_core73.entries)(axisZooms)) {
+ if (zoom == null)
+ continue;
+ this.onButtonPressAxis(button, props, axisId, direction, zoom);
+ }
+ } else {
+ this.onButtonPressUnified(button, props);
+ }
+ }
+ onButtonFocus(_event) {
+ this.toggleVisibility(true, true);
+ }
+ onButtonPressAxis(event, props, axisId, direction, zoom) {
+ const { isScalingX, isScalingY, scrollingStep } = props;
+ let newZoom = { ...zoom };
+ const delta3 = zoom.max - zoom.min;
+ switch (event.value) {
+ case "pan-start":
+ newZoom.max = delta3;
+ newZoom.min = 0;
+ break;
+ case "pan-end":
+ newZoom.min = newZoom.max - delta3;
+ newZoom.max = UNIT_MAX;
+ break;
+ case "pan-left":
+ newZoom.min -= delta3 * scrollingStep;
+ newZoom.max -= delta3 * scrollingStep;
+ break;
+ case "pan-right":
+ newZoom.min += delta3 * scrollingStep;
+ newZoom.max += delta3 * scrollingStep;
+ break;
+ case "zoom-in":
+ case "zoom-out": {
+ const isDirectionX = direction === ChartAxisDirection22.X;
+ const isScalingDirection = isDirectionX && isScalingX || !isDirectionX && isScalingY;
+ let scale = event.value === "zoom-in" ? 1 - scrollingStep : 1 + scrollingStep;
+ if (!isScalingDirection)
+ scale = 1;
+ const placement = isDirectionX ? this.getAnchorPointX(props) : this.getAnchorPointY(props);
+ newZoom.max = newZoom.min + (newZoom.max - newZoom.min) * scale;
+ newZoom = scaleZoomAxisWithAnchor(newZoom, zoom, placement);
+ break;
+ }
+ }
+ this.updateAxisZoom(axisId, direction, constrainAxis(newZoom));
+ }
+ onButtonPressUnified(event, props) {
+ const { scrollingStep } = props;
+ const oldZoom = definedZoomState(this.ctx.zoomManager.getZoom());
+ let zoom = definedZoomState(oldZoom);
+ switch (event.value) {
+ case "reset":
+ this.resetZoom();
+ return;
+ case "pan-start":
+ zoom.x.max = dx(zoom);
+ zoom.x.min = 0;
+ break;
+ case "pan-end":
+ zoom.x.min = UNIT_MAX - dx(zoom);
+ zoom.x.max = UNIT_MAX;
+ break;
+ case "pan-left":
+ zoom = translateZoom(zoom, -dx(zoom) * scrollingStep, 0);
+ break;
+ case "pan-right":
+ zoom = translateZoom(zoom, dx(zoom) * scrollingStep, 0);
+ break;
+ case "zoom-in":
+ case "zoom-out": {
+ zoom = this.getNextZoomStateUnified(event.value, oldZoom, props);
+ break;
+ }
+ }
+ this.updateZoom(constrainZoom(zoom));
+ }
+ getNextZoomStateUnified(button, oldZoom, props) {
+ const { isScalingX, isScalingY, scrollingStep } = props;
+ const scale = button === "zoom-in" ? 1 - scrollingStep : 1 + scrollingStep;
+ const zoom = scaleZoom(oldZoom, isScalingX ? scale : 1, isScalingY ? scale : 1);
+ zoom.x = scaleZoomAxisWithAnchor(zoom.x, oldZoom.x, this.getAnchorPointX(props));
+ zoom.y = scaleZoomAxisWithAnchor(zoom.y, oldZoom.y, this.getAnchorPointY(props));
+ return zoom;
+ }
+ getAnchorPointX(props) {
+ const anchorPointX = this.anchorPointX ?? props.anchorPointX;
+ return anchorPointX === "pointer" ? DEFAULT_ANCHOR_POINT_X : anchorPointX;
+ }
+ getAnchorPointY(props) {
+ const anchorPointY = this.anchorPointY ?? props.anchorPointY;
+ return anchorPointY === "pointer" ? DEFAULT_ANCHOR_POINT_Y : anchorPointY;
+ }
+};
+__decorateClass([
+ Property61,
+ ActionOnSet8({
+ changeValue(enabled) {
+ this.toolbar?.setHidden(!enabled);
+ }
+ })
+], ZoomToolbar.prototype, "enabled", 2);
+__decorateClass([
+ Property61
+], ZoomToolbar.prototype, "buttons", 2);
+__decorateClass([
+ Property61,
+ ActionOnSet8({
+ changeValue(visible, oldValue) {
+ if (oldValue == null)
+ return;
+ const always = visible === "always";
+ const zoomed = visible === "zoomed" && this.previousZoom != null && !isMaxZoom(this.previousZoom);
+ this.toggleVisibility(always || zoomed);
+ }
+ })
+], ZoomToolbar.prototype, "visible", 2);
+__decorateClass([
+ Property61
+], ZoomToolbar.prototype, "anchorPointX", 2);
+__decorateClass([
+ Property61
+], ZoomToolbar.prototype, "anchorPointY", 2);
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomTwoFingers.ts
+var N = 1e6;
+function clientToNormal({ min, max }, a, Rx, Rw) {
+ if (Rw === 0)
+ return 0;
+ return N * ((a - Rx) / Rw * (max - min) + min);
+}
+function solveTwoUnknowns(x1, x2, a1, a2, Rx, Rw) {
+ [x1, x2] = [Math.min(x1, x2), Math.max(x1, x2)];
+ [a1, a2] = [Math.min(a1, a2), Math.max(a1, a2)];
+ const t1 = N * (a1 - Rx) / Rw;
+ const t2 = N * (a2 - Rx) / Rw;
+ const c = (a1 - Rx) / (a2 - Rx);
+ const min = (x1 - c * x2) / (N - t1 + c * (t2 - N));
+ const max = (x2 + (t2 - N) * min) / t2;
+ return { min, max };
+}
+function isRangeOverlapping(centerA, radiusA, centerB, radiusB) {
+ if (radiusA === 0)
+ radiusA = 30;
+ if (radiusB === 0)
+ radiusB = 30;
+ const minA = centerA - radiusA;
+ const maxA = centerA + radiusA;
+ const minB = centerB - radiusB;
+ const maxB = centerB + radiusB;
+ return !(maxA < minB || maxB < minA);
+}
+var ZoomTwoFingers = class {
+ constructor() {
+ this.touchStart = {
+ origins: [
+ { identifier: 0, normalX: Number.NaN, normalY: Number.NaN },
+ { identifier: 0, normalX: Number.NaN, normalY: Number.NaN }
+ ]
+ };
+ this.initialZoom = { x: { min: 0, max: 1 }, y: { min: 0, max: 1 } };
+ this.previous = { a1: Number.NaN, a2: Number.NaN, b1: Number.NaN, b2: Number.NaN };
+ }
+ start(event, target, zoom) {
+ if (event.sourceEvent.targetTouches.length !== 2)
+ return false;
+ event.sourceEvent.preventDefault();
+ const targetTouches = Array.from(event.sourceEvent.targetTouches);
+ const { x: Rx, y: Ry, width: Rw, height: Rh } = target.getBoundingClientRect();
+ this.initialZoom.x.min = zoom.x?.min ?? 0;
+ this.initialZoom.x.max = zoom.x?.max ?? 1;
+ this.initialZoom.y.min = zoom.y?.min ?? 0;
+ this.initialZoom.y.max = zoom.y?.max ?? 1;
+ for (const t of this.touchStart.origins) {
+ t.identifier = 0;
+ }
+ this.previous.a1 = Number.NaN;
+ this.previous.a2 = Number.NaN;
+ this.previous.b1 = Number.NaN;
+ this.previous.b2 = Number.NaN;
+ for (const i of [0, 1]) {
+ const a = targetTouches[i].clientX;
+ const b = Ry + Rh - targetTouches[i].clientY;
+ this.touchStart.origins[i].identifier = targetTouches[i].identifier;
+ this.touchStart.origins[i].normalX = clientToNormal(this.initialZoom.x, a, Rx, Rw);
+ this.touchStart.origins[i].normalY = clientToNormal(this.initialZoom.y, b, Ry, Rh);
+ }
+ const [tA, tB] = targetTouches;
+ const [oA, oB] = this.touchStart.origins;
+ const xOverlap = isRangeOverlapping(tA.clientX, tA.radiusX, tB.clientX, tB.radiusX);
+ const yOverlap = isRangeOverlapping(tA.clientY, tA.radiusY, tB.clientY, tB.radiusY);
+ if (yOverlap)
+ oA.normalY = oB.normalY = (oA.normalY + oB.normalY) / 2;
+ if (xOverlap)
+ oA.normalX = oB.normalX = (oA.normalX + oB.normalX) / 2;
+ return true;
+ }
+ update(event, target) {
+ event.sourceEvent.preventDefault();
+ const targetTouches = Array.from(event.sourceEvent.targetTouches);
+ const { x: Rx, y: Ry, width: Rw, height: Rh } = target.getBoundingClientRect();
+ const { origins } = this.touchStart;
+ const touches = [0, 1].map((i) => targetTouches.find((t) => t.identifier === origins[i].identifier));
+ const x1 = origins[0].normalX;
+ const x2 = origins[1].normalX;
+ const a1 = touches[0].clientX;
+ const a2 = touches[1].clientX;
+ const y1 = origins[0].normalY;
+ const y2 = origins[1].normalY;
+ const b1 = Ry + Rh - touches[0].clientY;
+ const b2 = Ry + Rh - touches[1].clientY;
+ return this.twitchTolerantZoomPan4(x1, x2, a1, a2, y1, y2, b1, b2, Rx, Ry, Rw, Rh);
+ }
+ end(event) {
+ const identifiers = Array.from(event.sourceEvent.targetTouches).map((t) => t.identifier);
+ return !identifiers.includes(this.touchStart.origins[0].identifier) || !identifiers.includes(this.touchStart.origins[1].identifier);
+ }
+ // Small touch deltas on an axis, which can defined as one fingers moving ±1 pixel and the other not moving, can
+ // cause the canvas to flicker between two zoompan views.
+ //
+ // For example, consider two fingers moving upwards slowly on the Y-axis with the following events (Y=0 is the top
+ // of the screen):
+ //
+ // [0]: { finger1: { clientY: 101 }, finger2: { clientY: 201 } }
+ // [1]: { finger1: { clientY: 101 }, finger2: { clientY: 200 } }
+ // [2]: { finger1: { clientY: 100 }, finger2: { clientY: 200 } }
+ //
+ // The following transitions cause these changes to the zoompan respectively.
+ //
+ // [0] => [1] : yMin decreases, yMax increases
+ // [1] => [2] : yMin increases, yMax decreases
+ //
+ // At highly-zoomed views, this sudden shift in yMin/yMax in the [1] => [2] transition is very noticeable. When many
+ // of these kind of a transitions occur, the chart flickers between pan states instead of smoothly panning. Note
+ // however that, if we didn't receive event [1], our transition would like this:
+ //
+ // [0] => [2] : yMin increases, yMax increases
+ //
+ // ... which is a smooth panning transition. Therefore to prevent flickering, we skip event [1].
+ twitchTolerantZoomPan4(x1, x2, a1, a2, y1, y2, b1, b2, Rx, Ry, Rw, Rh) {
+ const { initialZoom, previous } = this;
+ const x = twitchTolerantZoomPan2(x1, x2, a1, a2, previous, "a1", "a2", Rx, Rw, initialZoom.x);
+ const y = twitchTolerantZoomPan2(y1, y2, b1, b2, previous, "b1", "b2", Ry, Rh, initialZoom.y);
+ return { x, y };
+ }
+};
+function twitchTolerantZoomPan2(x1, x2, a1, a2, previous, previousKey1, previousKey2, Rx, Rw, initialZoom) {
+ if (x1 == x2) {
+ const xn1 = clientToNormal(initialZoom, a1, Rx, Rw);
+ const xn2 = clientToNormal(initialZoom, a2, Rx, Rw);
+ const xavg = (xn1 + xn2) / 2;
+ const dzoom = (x1 - xavg) / N;
+ return { min: initialZoom.min + dzoom, max: initialZoom.max + dzoom };
+ } else {
+ const a1prev = previous[previousKey1];
+ const a2prev = previous[previousKey2];
+ const dx2 = Math.abs(a1 - a1prev) + Math.abs(a2 - a2prev);
+ if (dx2 <= 1) {
+ a1 = a1prev;
+ a2 = a2prev;
+ } else {
+ previous[previousKey1] = a1;
+ previous[previousKey2] = a2;
+ }
+ return solveTwoUnknowns(x1, x2, a1, a2, Rx, Rw);
+ }
+}
+
+// packages/ag-charts-enterprise/src/features/zoom/zoom.ts
+var { ActionOnSet: ActionOnSet9, ChartAxisDirection: ChartAxisDirection23, ChartUpdateType: ChartUpdateType3, Property: Property62, InteractionState: InteractionState5, ProxyProperty: ProxyProperty3 } = import_ag_charts_community170._ModuleSupport;
+var round = (value) => (0, import_ag_charts_core74.roundTo)(value, 10);
+var CURSOR_ID = "zoom-cursor";
+var TOOLTIP_ID = "zoom-tooltip";
+var ZoomAutoScaling = class extends import_ag_charts_community170._ModuleSupport.BaseProperties {
+ constructor(onChange) {
+ super();
+ this.onChange = onChange;
+ this.enabled = false;
+ this.padding = 0;
+ }
+};
+__decorateClass([
+ Property62,
+ ActionOnSet9({
+ changeValue(enabled) {
+ this.onChange({ enabled, padding: this.padding });
+ }
+ })
+], ZoomAutoScaling.prototype, "enabled", 2);
+__decorateClass([
+ Property62,
+ ActionOnSet9({
+ changeValue(padding) {
+ this.onChange({ enabled: this.enabled, padding });
+ }
+ })
+], ZoomAutoScaling.prototype, "padding", 2);
+var Zoom = class extends import_ag_charts_community170._ModuleSupport.BaseModuleInstance {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.enabled = false;
+ this.enableAxisDragging = true;
+ this.enableAxisScrolling = false;
+ this.enableDoubleClickToReset = true;
+ this.enablePanning = true;
+ this.enableScrolling = true;
+ this.enableSelecting = false;
+ this.enableTwoFingerZoom = true;
+ this.panKey = "alt";
+ this.axes = "x";
+ this.scrollingStep = UNIT_SIZE / 10;
+ this.keepAspectRatio = false;
+ this.minVisibleItems = 2;
+ this.anchorPointX = DEFAULT_ANCHOR_POINT_X;
+ this.anchorPointY = DEFAULT_ANCHOR_POINT_Y;
+ this.autoScaling = new ZoomAutoScaling((newValue) => {
+ this.ctx.zoomManager.setAutoScaleYAxis(newValue.enabled, newValue.padding);
+ });
+ this.axisDraggingMode = "zoom";
+ this.canResetZoom = (zoom) => {
+ zoom ?? (zoom = this.getZoom());
+ return !isZoomEqual(zoom, this.getResetZoom());
+ };
+ this.buttons = new ZoomToolbar(
+ this.ctx,
+ this.getModuleProperties.bind(this),
+ this.canResetZoom,
+ this.updateZoom.bind(this),
+ this.updateAxisZoom.bind(this),
+ this.resetZoom.bind(this),
+ this.isZoomValid.bind(this)
+ );
+ // Zoom methods
+ this.axisDragger = new ZoomAxisDragger();
+ this.panner = new ZoomPanner();
+ this.scroller = new ZoomScroller();
+ this.scrollPanner = new ZoomScrollPanner();
+ this.twoFingers = new ZoomTwoFingers();
+ this.deceleration = "short";
+ // State
+ this.dragState = 0 /* None */;
+ this.isState = (state) => this.ctx.interactionManager.isState(state);
+ this.destroyContextMenuActions = void 0;
+ this.isFirstWheelEvent = true;
+ this.debouncedWheelReset = (0, import_ag_charts_core74.debounce)(() => {
+ this.isFirstWheelEvent = true;
+ this.wasFirstWheelEventZoomCapped = void 0;
+ }, 100);
+ this.previousZoomValid = true;
+ this.previousAxisZoomValid = {
+ [import_ag_charts_community170._ModuleSupport.ChartAxisDirection.X]: true,
+ [import_ag_charts_community170._ModuleSupport.ChartAxisDirection.Y]: true
+ };
+ this.toggleAxisDraggingCursorsDebounced = (0, import_ag_charts_core74.debounce)(
+ this.toggleAxisDraggingCursors.bind(this),
+ ZOOM_VALID_CHECK_DEBOUNCE,
+ {
+ leading: true,
+ trailing: true
+ }
+ );
+ const selectionRect = new ZoomRect();
+ this.selector = new ZoomSelector(selectionRect, this.getZoom.bind(this), this.isZoomValid.bind(this));
+ this.contextMenu = new ZoomContextMenu(
+ ctx.eventsHub,
+ ctx.contextMenuRegistry,
+ ctx.zoomManager,
+ this.getModuleProperties.bind(this),
+ this.canResetZoom,
+ () => this.paddedRect,
+ this.updateZoom.bind(this),
+ this.isZoomValid.bind(this)
+ );
+ this.domProxy = new ZoomDOMProxy({
+ onAxisDragStart: (direction) => this.onAxisDragStart(direction),
+ onAxisDragMove: (id, direction, event) => this.onAxisDragMove(id, direction, event),
+ onAxisDragEnd: () => this.onAxisDragEnd(),
+ onAxisDoubleClick: (id) => this.onAxisDoubleClick(id),
+ onAxisWheel: (id, direction, event) => this.onAxisWheel(id, direction, event)
+ });
+ if (ctx.widgets.seriesDragInterpreter) {
+ this.cleanup.register(
+ ctx.widgets.seriesDragInterpreter.events.on("dblclick", (event) => this.onSeriesAreaDoubleClick(event)),
+ ctx.widgets.seriesDragInterpreter.events.on("drag-move", (event) => this.onSeriesAreaDragMove(event)),
+ ctx.widgets.seriesDragInterpreter.events.on("drag-start", (event) => this.onSeriesAreaDragStart(event)),
+ ctx.widgets.seriesDragInterpreter.events.on("drag-end", () => this.onSeriesAreaDragEnd())
+ );
+ }
+ this.cleanup.register(
+ ctx.scene.attachNode(selectionRect),
+ ctx.eventsHub.on("series-area:hover", (event) => this.onSeriesAreaHoverEvent(event)),
+ ctx.eventsHub.on("series-area:click", (event) => this.onSeriesAreaClickEvent(event)),
+ ctx.eventsHub.on("series:keynav-zoom", (event) => this.onNavZoom(event)),
+ ctx.widgets.seriesWidget.addListener("wheel", (event) => this.onWheel(event)),
+ ctx.widgets.seriesWidget.addListener("touchstart", (event, current) => this.onTouchStart(event, current)),
+ ctx.widgets.seriesWidget.addListener("touchmove", (event, current) => this.onTouchMove(event, current)),
+ ctx.widgets.seriesWidget.addListener("touchend", (event) => this.onTouchEnd(event)),
+ ctx.widgets.seriesWidget.addListener("touchcancel", (event) => this.onTouchEnd(event)),
+ ctx.updateService.addListener("process-data", (event) => this.onProcessData(event)),
+ ctx.eventsHub.on("layout:complete", (event) => this.onLayoutComplete(event)),
+ ctx.eventsHub.on("zoom:change", (event) => this.onZoomChange(event)),
+ ctx.eventsHub.on("zoom:pan-start", (event) => this.onZoomPanStart(event)),
+ this.panner.addListener("update", (event) => this.onPanUpdate(event)),
+ () => this.teardown()
+ );
+ }
+ teardown() {
+ this.ctx.zoomManager.setZoomModuleEnabled(false);
+ this.buttons.destroy();
+ this.destroyContextMenuActions?.();
+ this.domProxy.destroy();
+ }
+ onEnabledChange(enabled) {
+ this.ctx.zoomManager.setZoomModuleEnabled(enabled);
+ if (this.contextMenu) {
+ this.destroyContextMenuActions?.();
+ this.destroyContextMenuActions = this.contextMenu.registerActions(enabled);
+ }
+ }
+ isIgnoredTouch(event) {
+ if (event?.device !== "touch") {
+ return false;
+ }
+ if (this.ctx.chartService.touch.dragAction !== "drag") {
+ return true;
+ }
+ if (this.enableSelecting) {
+ return false;
+ }
+ if (!this.enablePanning) {
+ return true;
+ }
+ return isMaxZoom(this.getZoom());
+ }
+ onSeriesAreaDoubleClick(event) {
+ const { enabled, enableDoubleClickToReset } = this;
+ if (!enabled || !enableDoubleClickToReset)
+ return;
+ if (event?.preventZoomDblClick || !this.isState(InteractionState5.ZoomClickable))
+ return;
+ this.resetZoom();
+ }
+ onSeriesAreaHoverEvent(event) {
+ if (!this.shouldHandleAxisHover(event)) {
+ this.clearHoveredAxis();
+ return;
+ }
+ const axis = this.domProxy.pickAxisAtPoint(event.x, event.y);
+ if (axis) {
+ this.domProxy.setHoveredAxis(axis.axisId);
+ this.ctx.domManager.updateCursor(CURSOR_ID, this.domProxy.getCursor(axis.direction));
+ } else {
+ this.clearHoveredAxis();
+ }
+ }
+ onSeriesAreaClickEvent(event) {
+ if (!this.shouldHandleAxisClick(event))
+ return;
+ const axis = this.domProxy.pickAxisAtPoint(event.x, event.y);
+ if (axis && event.sourceEvent?.type === "dblclick") {
+ this.onAxisDoubleClick(axis.axisId);
+ }
+ }
+ shouldHandleAxisHover(event) {
+ const { enabled, enableAxisDragging, enableAxisScrolling, dragState } = this;
+ return enabled && (enableAxisDragging || enableAxisScrolling) && !event.consumed && !this.activeAxis && dragState === 0 /* None */ && this.domProxy.hasOverlappingAxes();
+ }
+ shouldHandleAxisClick(event) {
+ const { enabled, enableAxisDragging, enableAxisScrolling, enableDoubleClickToReset } = this;
+ return enabled && !this.activeAxis && !event.consumed && (enableAxisDragging || enableAxisScrolling || enableDoubleClickToReset);
+ }
+ clearHoveredAxis() {
+ if (this.activeAxis)
+ return;
+ this.domProxy.clearHoveredAxis();
+ if (this.dragState === 0 /* None */) {
+ this.ctx.domManager.updateCursor(CURSOR_ID);
+ }
+ }
+ tryBeginAxisDelegation(event) {
+ const hoveredAxis = this.domProxy.getHoveredAxis();
+ if (!this.enabled || !this.enableAxisDragging || !hoveredAxis) {
+ return false;
+ }
+ if (!this.domProxy.beginDelegatedAxisDrag(hoveredAxis.axisId)) {
+ return false;
+ }
+ this.activeAxis = hoveredAxis;
+ this.onAxisDragStart(hoveredAxis.direction);
+ const cursor = this.dragState === 2 /* Pan */ ? "grabbing" : this.domProxy.getCursor(hoveredAxis.direction);
+ this.ctx.domManager.updateCursor(CURSOR_ID, cursor);
+ if (event.device === "touch") {
+ event.sourceEvent.preventDefault();
+ }
+ return true;
+ }
+ onSeriesAreaDragStart(event) {
+ const {
+ enabled,
+ enablePanning,
+ enableSelecting,
+ ctx: { domManager, zoomManager }
+ } = this;
+ if (!enabled || !this.isState(InteractionState5.ZoomDraggable) || this.dragState !== 0 /* None */ || this.isIgnoredTouch(event)) {
+ return;
+ }
+ this.panner.stopInteractions();
+ if (this.tryBeginAxisDelegation(event)) {
+ return;
+ }
+ let newDragState = 0 /* None */;
+ const panKeyPressed = this.isPanningKeyPressed(event.sourceEvent);
+ if (enablePanning && (!enableSelecting || panKeyPressed)) {
+ domManager.updateCursor(CURSOR_ID, "grabbing");
+ newDragState = 2 /* Pan */;
+ this.panner.start();
+ } else if (enableSelecting && !panKeyPressed) {
+ newDragState = 3 /* Select */;
+ }
+ if ((this.dragState = newDragState) !== 0 /* None */) {
+ zoomManager.fireZoomPanStartEvent("zoom");
+ }
+ }
+ onSeriesAreaDragMove(event) {
+ const {
+ dragState,
+ enabled,
+ paddedRect,
+ panner,
+ selector,
+ ctx: { interactionManager, tooltipManager, updateService }
+ } = this;
+ if (this.activeAxis) {
+ this.onAxisDragMove(this.activeAxis.axisId, this.activeAxis.direction, event);
+ return;
+ }
+ if (!enabled || !paddedRect || !this.isState(InteractionState5.ZoomDraggable) || this.isIgnoredTouch(event)) {
+ return;
+ }
+ interactionManager.pushState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag);
+ if (event.device === "touch") {
+ event.sourceEvent.preventDefault();
+ }
+ switch (dragState) {
+ case 2 /* Pan */:
+ panner.update(event);
+ break;
+ case 3 /* Select */:
+ selector.update(event, this.getModuleProperties(), paddedRect);
+ break;
+ case 0 /* None */:
+ return;
+ }
+ tooltipManager.updateTooltip(TOOLTIP_ID);
+ updateService.update(ChartUpdateType3.PERFORM_LAYOUT, { skipAnimations: true });
+ }
+ onSeriesAreaDragEnd() {
+ const {
+ ctx: { interactionManager }
+ } = this;
+ if (this.activeAxis) {
+ this.handleAxisDragEnd();
+ return;
+ }
+ interactionManager.popState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag);
+ if (!this.enabled || this.dragState === 0 /* None */)
+ return;
+ this.handleRegularDragEnd();
+ this.resetDragState();
+ }
+ handleAxisDragEnd() {
+ this.onAxisDragEnd();
+ this.domProxy.endDelegatedAxisDrag(this.activeAxis.axisId);
+ this.activeAxis = void 0;
+ this.clearHoveredAxis();
+ }
+ handleRegularDragEnd() {
+ const { panner, selector } = this;
+ switch (this.dragState) {
+ case 2 /* Pan */:
+ panner.stop();
+ break;
+ case 3 /* Select */:
+ if (selector.didUpdate()) {
+ const newZoom = selector.stop(this.seriesRect, this.paddedRect, this.getZoom());
+ this.updateZoom(newZoom);
+ }
+ break;
+ }
+ }
+ resetDragState() {
+ this.dragState = 0 /* None */;
+ this.ctx.domManager.updateCursor(CURSOR_ID);
+ this.ctx.tooltipManager.removeTooltip(TOOLTIP_ID);
+ }
+ onAxisDoubleClick(id) {
+ const {
+ enabled,
+ enableDoubleClickToReset,
+ ctx: { zoomManager }
+ } = this;
+ if (!enabled || !enableDoubleClickToReset || !this.isState(InteractionState5.ZoomClickable))
+ return;
+ this.previousAxisZoomValid = { [ChartAxisDirection23.X]: true, [ChartAxisDirection23.Y]: true };
+ zoomManager.resetAxisZoom("zoom", id);
+ }
+ onAxisDragStart(direction) {
+ const {
+ axisDraggingMode,
+ domProxy,
+ enabled,
+ enableAxisDragging,
+ panner,
+ ctx: { zoomManager }
+ } = this;
+ if (!enabled || !enableAxisDragging)
+ return;
+ panner.stopInteractions();
+ if (axisDraggingMode === "pan") {
+ domProxy.setAxisCursor("grabbing");
+ this.dragState = 2 /* Pan */;
+ this.panner.start(direction);
+ zoomManager.fireZoomPanStartEvent("zoom");
+ } else {
+ this.dragState = 1 /* Axis */;
+ }
+ }
+ onAxisDragMove(axisId, direction, event) {
+ const {
+ anchorPointX,
+ anchorPointY,
+ axisDragger,
+ dragState,
+ enabled,
+ enableAxisDragging,
+ seriesRect,
+ shouldFlipXY,
+ ctx: { interactionManager, tooltipManager, updateService, zoomManager }
+ } = this;
+ if (!enabled || !enableAxisDragging || !seriesRect)
+ return;
+ interactionManager.pushState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag);
+ if (event.device === "touch") {
+ event.sourceEvent.preventDefault();
+ }
+ const zoom = this.getZoom();
+ if (dragState === 2 /* Pan */) {
+ this.panner.update({ currentX: event.offsetX, currentY: event.offsetY });
+ } else {
+ let anchor = direction === ChartAxisDirection23.X ? anchorPointX : anchorPointY;
+ if (shouldFlipXY)
+ anchor = direction === ChartAxisDirection23.X ? anchorPointY : anchorPointX;
+ const axisZoom = zoomManager.getAxisZoom(axisId);
+ const newZoom = axisDragger.update(event, direction, anchor, seriesRect, zoom, axisZoom);
+ zoomManager.setAxisManuallyAdjusted("zoom", axisId);
+ this.updateAxisZoom(axisId, direction, newZoom, {
+ directional: true
+ });
+ }
+ tooltipManager.updateTooltip(TOOLTIP_ID);
+ updateService.update(ChartUpdateType3.PERFORM_LAYOUT, { skipAnimations: true });
+ }
+ onAxisDragEnd() {
+ const {
+ axisDraggingMode,
+ axisDragger,
+ dragState,
+ domProxy,
+ enabled,
+ enableAxisDragging,
+ ctx: { domManager, interactionManager, tooltipManager }
+ } = this;
+ interactionManager.popState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag);
+ if (!enabled || !enableAxisDragging || dragState === 0 /* None */)
+ return;
+ this.dragState = 0 /* None */;
+ if (axisDraggingMode === "pan") {
+ domProxy.setAxisCursor("grab");
+ this.panner.stop();
+ }
+ axisDragger.stop();
+ domManager.updateCursor(CURSOR_ID);
+ tooltipManager.removeTooltip(TOOLTIP_ID);
+ }
+ onNavZoom(event) {
+ const { enabled, enableScrolling, scroller } = this;
+ const isDefaultState = this.ctx.interactionManager.isState(import_ag_charts_community170._ModuleSupport.InteractionState.Default);
+ if (!isDefaultState || !enabled || !enableScrolling)
+ return;
+ event.widgetEvent.sourceEvent.preventDefault();
+ this.updateZoom(scroller.updateDelta(event.delta, this.getModuleProperties(), this.getZoom()));
+ }
+ onWheel(event) {
+ const { enabled, enablePanning, enableScrolling, paddedRect } = this;
+ if (!enabled || !enableScrolling || !paddedRect || !this.isState(InteractionState5.ZoomWheelable))
+ return;
+ const { deltaX, deltaY } = event.sourceEvent;
+ const isHorizontalScrolling = deltaX != null && deltaY != null && Math.abs(deltaX) > Math.abs(deltaY);
+ if (enablePanning && isHorizontalScrolling) {
+ this.onWheelPanning(event);
+ } else {
+ this.onWheelScrolling(event);
+ }
+ }
+ onWheelPanning(event) {
+ const {
+ scrollingStep,
+ scrollPanner,
+ seriesRect,
+ ctx: { zoomManager }
+ } = this;
+ if (!seriesRect)
+ return;
+ event.sourceEvent.preventDefault();
+ const newZooms = scrollPanner.update(event, scrollingStep, seriesRect, zoomManager.getAxisZooms());
+ for (const [axisId, { direction, zoom }] of (0, import_ag_charts_core74.entries)(newZooms)) {
+ this.updateAxisZoom(axisId, direction, zoom);
+ }
+ }
+ onWheelScrolling(event) {
+ const zoom = this.getZoom();
+ const isZoomCapped = event.deltaY > 0 && isMaxZoom(zoom);
+ this.handleWheelScrolling(event, isZoomCapped);
+ }
+ onAxisWheel(axisId, axisDirection, event) {
+ const {
+ enableAxisScrolling,
+ ctx: { zoomManager }
+ } = this;
+ if (!enableAxisScrolling)
+ return;
+ if (axisDirection !== ChartAxisDirection23.X && axisDirection !== ChartAxisDirection23.Y) {
+ return;
+ }
+ const isScalingX = axisDirection === ChartAxisDirection23.X;
+ const isScalingY = !isScalingX;
+ const props = this.getModuleProperties({ isScalingX, isScalingY });
+ const zoom = this.getZoom();
+ const isZoomCapped = event.deltaY > 0 && zoom[axisDirection].min === UNIT_MIN && zoom[axisDirection].max === UNIT_MAX;
+ zoomManager.setAxisManuallyAdjusted("zoom", axisId);
+ this.handleWheelScrolling(event, isZoomCapped, props);
+ }
+ handleWheelScrolling(event, isZoomCapped, props = this.getModuleProperties()) {
+ const {
+ enableIndependentAxes,
+ scroller,
+ seriesRect,
+ ctx: { zoomManager }
+ } = this;
+ if (!seriesRect)
+ return;
+ let updated = true;
+ if (enableIndependentAxes === true) {
+ const newZooms = scroller.updateAxes(event, props, seriesRect, zoomManager.getAxisZooms());
+ for (const [axisId, { direction, zoom: axisZoom }] of (0, import_ag_charts_core74.entries)(newZooms)) {
+ const constrainedZoom = direction === ChartAxisDirection23.X ? this.constrainZoom({ x: axisZoom, y: { min: UNIT_MAX, max: UNIT_MAX } }).x : axisZoom;
+ updated && (updated = this.updateAxisZoom(
+ axisId,
+ direction,
+ constrainedZoom
+ ));
+ }
+ } else {
+ const newZoom = scroller.update(event, props, seriesRect, this.getZoom());
+ if (newZoom == null)
+ return;
+ updated = this.updateUnifiedZoom(newZoom, { directional: true });
+ }
+ isZoomCapped || (isZoomCapped = event.deltaY < 0 && !updated);
+ if (this.firstWheelEventDirection != null && this.firstWheelEventDirection !== event.deltaY < 0) {
+ this.isFirstWheelEvent = true;
+ }
+ if (this.isFirstWheelEvent) {
+ this.wasFirstWheelEventZoomCapped = isZoomCapped;
+ this.firstWheelEventDirection = event.deltaY < 0;
+ if (!isZoomCapped) {
+ event.sourceEvent.preventDefault();
+ }
+ } else if (this.wasFirstWheelEventZoomCapped === false) {
+ event.sourceEvent.preventDefault();
+ }
+ this.isFirstWheelEvent = false;
+ this.debouncedWheelReset();
+ }
+ onTouchStart(event, current) {
+ if (!this.enableTwoFingerZoom || this.dragState !== 0 /* None */)
+ return;
+ if (this.twoFingers.start(event, current, this.getZoom())) {
+ this.dragState = 4 /* TwoFingers */;
+ }
+ }
+ onTouchMove(event, current) {
+ if (!this.enableTwoFingerZoom || this.dragState !== 4 /* TwoFingers */)
+ return;
+ const newZoom = this.twoFingers.update(event, current);
+ this.updateZoom(constrainZoom(newZoom));
+ }
+ onTouchEnd(event) {
+ if (!this.enableTwoFingerZoom || this.dragState !== 4 /* TwoFingers */)
+ return;
+ event.sourceEvent.preventDefault();
+ if (this.twoFingers.end(event)) {
+ this.dragState = 0 /* None */;
+ }
+ }
+ onProcessData(event) {
+ this.shouldFlipXY = event.series.shouldFlipXY;
+ }
+ onLayoutComplete(event) {
+ this.domProxy.update(this.enableAxisDragging, this.enableAxisScrolling, this.ctx, event.series.rect);
+ if (!this.enabled)
+ return;
+ this.seriesRect = event.series.rect;
+ this.paddedRect = event.series.paddedRect;
+ if (this.enableAxisDragging) {
+ this.toggleAxisDraggingCursorsDebounced();
+ }
+ }
+ onZoomChange(event) {
+ if (event.callerId !== "zoom") {
+ this.panner.stopInteractions();
+ }
+ const zoom = this.getZoom();
+ this.buttons.toggleVisibleZoomed(isMaxZoom(zoom));
+ }
+ onZoomPanStart(event) {
+ if (event.callerId === "zoom") {
+ this.panner.stopInteractions();
+ }
+ }
+ onPanUpdate(event) {
+ const {
+ panner,
+ seriesRect,
+ ctx: { tooltipManager, zoomManager }
+ } = this;
+ if (!seriesRect)
+ return;
+ const newZooms = panner.translateZooms(seriesRect, zoomManager.getAxisZooms(), event.deltaX, event.deltaY);
+ for (const [axisId, { direction, zoom }] of (0, import_ag_charts_core74.entries)(newZooms)) {
+ this.updateAxisZoom(axisId, direction, zoom);
+ }
+ tooltipManager.updateTooltip(TOOLTIP_ID);
+ }
+ isPanningKeyPressed(event) {
+ switch (this.panKey) {
+ case "alt":
+ return event.altKey;
+ case "ctrl":
+ return event.ctrlKey;
+ case "shift":
+ return event.shiftKey;
+ case "meta":
+ return event.metaKey;
+ }
+ }
+ isScalingX() {
+ if (this.axes === "xy")
+ return true;
+ return this.shouldFlipXY ? this.axes === "y" : this.axes === "x";
+ }
+ isScalingY() {
+ if (this.axes === "xy")
+ return true;
+ return this.shouldFlipXY ? this.axes === "x" : this.axes === "y";
+ }
+ getAnchorPointX() {
+ return this.shouldFlipXY ? this.anchorPointY : this.anchorPointX;
+ }
+ getAnchorPointY() {
+ return this.shouldFlipXY ? this.anchorPointX : this.anchorPointY;
+ }
+ constrainZoom(newZoom) {
+ const {
+ minVisibleItems,
+ ctx: { zoomManager }
+ } = this;
+ if (minVisibleItems === 0)
+ return newZoom;
+ const constrainedZoom = zoomManager.constrainZoomToItemCount(newZoom, minVisibleItems);
+ return constrainedZoom ?? newZoom;
+ }
+ isZoomValid(newZoom, options) {
+ const {
+ minVisibleItems,
+ ctx: { zoomManager }
+ } = this;
+ if (minVisibleItems === 0) {
+ this.previousZoomValid = true;
+ return true;
+ }
+ const zoom = this.getZoom();
+ const zoomedInX = round(dx(newZoom)) < round(dx(zoom));
+ const zoomedInY = round(dy(newZoom)) < round(dy(zoom));
+ if (!zoomedInX && !zoomedInY) {
+ this.previousZoomValid = true;
+ return true;
+ }
+ if (!this.previousZoomValid && options?.directional) {
+ return false;
+ }
+ const valid = zoomManager.isVisibleItemsCountAtLeast(newZoom, minVisibleItems, options?.includeYVisibleRange);
+ this.previousZoomValid = options?.directional ? valid : true;
+ return valid;
+ }
+ isAxisZoomValid(direction, axisZoom, options) {
+ const {
+ minVisibleItems,
+ ctx: { zoomManager }
+ } = this;
+ const zoom = this.getZoom();
+ const deltaAxis = axisZoom.max - axisZoom.min;
+ const deltaOld = zoom[direction].max - zoom[direction].min;
+ const newZoom = { ...zoom, [direction]: axisZoom };
+ if (deltaAxis >= deltaOld) {
+ this.previousAxisZoomValid[direction] = true;
+ return true;
+ }
+ if (!this.previousAxisZoomValid[direction] && options?.directional) {
+ return false;
+ }
+ const valid = zoomManager.isVisibleItemsCountAtLeast(newZoom, minVisibleItems);
+ this.previousAxisZoomValid[direction] = options?.directional ? valid : true;
+ return valid;
+ }
+ resetZoom() {
+ this.previousZoomValid = true;
+ this.previousAxisZoomValid = { [ChartAxisDirection23.X]: true, [ChartAxisDirection23.Y]: true };
+ this.ctx.zoomManager.resetZoom("zoom");
+ }
+ updateSyncZoom(zoom) {
+ this.updateZoom(zoom);
+ }
+ updateZoom(zoom) {
+ if (this.enableIndependentAxes) {
+ this.updatePrimaryAxisZooms(zoom);
+ } else {
+ this.updateUnifiedZoom(zoom);
+ }
+ }
+ updateUnifiedZoom(zoom, validOptions) {
+ zoom = this.constrainZoom(zoom);
+ if (!this.isZoomValid(zoom, validOptions)) {
+ this.ctx.updateService.update(ChartUpdateType3.SCENE_RENDER, { skipAnimations: true });
+ return false;
+ }
+ this.ctx.zoomManager.updateZoom("zoom", zoom);
+ return true;
+ }
+ updatePrimaryAxisZooms(zoom) {
+ this.updatePrimaryAxisZoom(zoom, ChartAxisDirection23.X);
+ this.updatePrimaryAxisZoom(zoom, ChartAxisDirection23.Y);
+ }
+ updatePrimaryAxisZoom(zoom, direction) {
+ const axisId = this.ctx.zoomManager.getPrimaryAxisId(direction);
+ if (axisId == null)
+ return;
+ this.updateAxisZoom(axisId, direction, zoom[direction]);
+ }
+ updateAxisZoom(axisId, direction, axisZoom, validOptions) {
+ const {
+ enableIndependentAxes,
+ ctx: { zoomManager }
+ } = this;
+ if (!axisZoom)
+ return false;
+ const zoom = this.getZoom();
+ if (enableIndependentAxes !== true) {
+ zoom[direction] = axisZoom;
+ return this.updateUnifiedZoom(zoom, validOptions);
+ }
+ if (!this.isAxisZoomValid(direction, axisZoom, validOptions))
+ return false;
+ zoomManager.updateAxisZoom("zoom", axisId, axisZoom);
+ return true;
+ }
+ updateAxisCursor(opts) {
+ if (!this.domProxy)
+ return;
+ const {
+ enableAxisDragging = this.enableAxisDragging,
+ enableAxisScrolling = this.enableAxisScrolling,
+ axisDraggingMode = this.axisDraggingMode
+ } = opts;
+ if (enableAxisDragging) {
+ this.domProxy.setAxisCursor(axisDraggingMode === "pan" ? "grab" : void 0);
+ } else if (enableAxisScrolling) {
+ this.domProxy.setAxisCursor("default");
+ } else {
+ this.domProxy.setAxisCursor(void 0);
+ }
+ }
+ toggleAxisDraggingCursors() {
+ const { anchorPointX, anchorPointY, domProxy } = this;
+ const zoom = this.getZoom();
+ let showCursorX = dx(zoom) !== UNIT_SIZE;
+ let showCursorY = dy(zoom) !== UNIT_SIZE;
+ if (!showCursorX) {
+ const checkZoomX = scaleZoom(zoom, 0.999, 1);
+ checkZoomX.x = scaleZoomAxisWithAnchor(checkZoomX.x, zoom.x, anchorPointX);
+ showCursorX = this.isZoomValid(checkZoomX, { includeYVisibleRange: true });
+ }
+ if (!showCursorY) {
+ const checkZoomY = scaleZoom(zoom, 1, 0.999);
+ checkZoomY.y = scaleZoomAxisWithAnchor(checkZoomY.y, zoom.y, anchorPointY);
+ showCursorY = this.isZoomValid(checkZoomY, { includeYVisibleRange: true });
+ }
+ domProxy.toggleAxisDraggingCursor(ChartAxisDirection23.X, showCursorX);
+ domProxy.toggleAxisDraggingCursor(ChartAxisDirection23.Y, showCursorY);
+ }
+ getZoom() {
+ return definedZoomState(this.ctx.zoomManager.getZoom());
+ }
+ getResetZoom() {
+ return definedZoomState(this.ctx.zoomManager.getRestoredZoom());
+ }
+ getModuleProperties(overrides) {
+ return {
+ anchorPointX: overrides?.anchorPointX ?? this.getAnchorPointX(),
+ anchorPointY: overrides?.anchorPointY ?? this.getAnchorPointY(),
+ enabled: overrides?.enabled ?? this.enabled,
+ independentAxes: overrides?.independentAxes ?? this.enableIndependentAxes === true,
+ isScalingX: overrides?.isScalingX ?? this.isScalingX(),
+ isScalingY: overrides?.isScalingY ?? this.isScalingY(),
+ keepAspectRatio: overrides?.keepAspectRatio ?? this.keepAspectRatio,
+ scrollingStep: overrides?.scrollingStep ?? this.scrollingStep
+ };
+ }
+};
+__decorateClass([
+ ActionOnSet9({
+ newValue(enabled) {
+ this.onEnabledChange(enabled);
+ }
+ }),
+ Property62
+], Zoom.prototype, "enabled", 2);
+__decorateClass([
+ ActionOnSet9({
+ changeValue(newValue) {
+ this.updateAxisCursor({ enableAxisDragging: newValue });
+ }
+ }),
+ Property62
+], Zoom.prototype, "enableAxisDragging", 2);
+__decorateClass([
+ ActionOnSet9({
+ changeValue(newValue) {
+ this.updateAxisCursor({ enableAxisScrolling: newValue });
+ }
+ }),
+ Property62
+], Zoom.prototype, "enableAxisScrolling", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "enableDoubleClickToReset", 2);
+__decorateClass([
+ ActionOnSet9({
+ changeValue(newValue) {
+ this.ctx.zoomManager.setIndependentAxes(Boolean(newValue));
+ }
+ }),
+ Property62
+], Zoom.prototype, "enableIndependentAxes", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "enablePanning", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "enableScrolling", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "enableSelecting", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "enableTwoFingerZoom", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "panKey", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "axes", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "scrollingStep", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "keepAspectRatio", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "minVisibleItems", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "anchorPointX", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "anchorPointY", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "autoScaling", 2);
+__decorateClass([
+ ActionOnSet9({
+ changeValue(newValue) {
+ this.updateAxisCursor({ axisDraggingMode: newValue });
+ }
+ }),
+ Property62
+], Zoom.prototype, "axisDraggingMode", 2);
+__decorateClass([
+ Property62
+], Zoom.prototype, "buttons", 2);
+__decorateClass([
+ ProxyProperty3("panner.deceleration"),
+ Property62
+], Zoom.prototype, "deceleration", 2);
+
+// packages/ag-charts-enterprise/src/features/zoom/zoomModule.ts
+var buttons = {
+ enabled: true,
+ visible: "hover",
+ buttons: [
+ {
+ icon: "zoom-out",
+ value: "zoom-out",
+ section: "scale"
+ },
+ {
+ icon: "zoom-in",
+ value: "zoom-in",
+ section: "scale"
+ },
+ {
+ icon: "pan-left",
+ value: "pan-left",
+ section: "pan"
+ },
+ {
+ icon: "pan-right",
+ value: "pan-right",
+ section: "pan"
+ },
+ {
+ icon: "reset",
+ value: "reset",
+ section: "reset"
+ }
+ ]
+};
+var ZoomModule = {
+ type: "root",
+ optionsKey: "zoom",
+ packageType: "enterprise",
+ chartTypes: ["cartesian", "topology"],
+ moduleFactory: (ctx) => new Zoom(ctx),
+ themeTemplate: {
+ zoom: {
+ anchorPointX: "end",
+ anchorPointY: "middle",
+ axes: "x",
+ buttons,
+ enabled: false,
+ enableAxisDragging: true,
+ enableDoubleClickToReset: true,
+ enablePanning: true,
+ enableScrolling: true,
+ enableSelecting: false,
+ enableTwoFingerZoom: true,
+ deceleration: "short",
+ minVisibleItems: 2,
+ panKey: "alt",
+ scrollingStep: 0.1,
+ autoScaling: {
+ enabled: { $eq: [{ $path: "../axes" }, "x"] },
+ padding: 0.05
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/gradient-legend/gradientLegendModule.ts
+var import_ag_charts_community174 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/gradient-legend/gradientLegend.ts
+var import_ag_charts_community173 = require("ag-charts-community");
+var import_ag_charts_core76 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/gradient-legend/axisTicks.ts
+var import_ag_charts_community172 = require("ag-charts-community");
+var import_ag_charts_core75 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/utils/formatter.ts
+var import_ag_charts_community171 = require("ag-charts-community");
+function formatWithContext(ctx, formatter, params) {
+ return import_ag_charts_community171._ModuleSupport.callWithContext(ctx.chartService, formatter, params);
+}
+
+// packages/ag-charts-enterprise/src/gradient-legend/axisTicks.ts
+var {
+ AxisInterval: AxisInterval2,
+ AxisLabel: AxisLabel2,
+ ZIndexMap: ZIndexMap9,
+ LinearScale: LinearScale3,
+ BBox: BBox14,
+ TranslatableGroup: TranslatableGroup4,
+ Selection: Selection4,
+ Text: Text2,
+ createIdsGenerator,
+ findMinMax: findMinMax5,
+ findRangeExtent,
+ estimateTickCount
+} = import_ag_charts_community172._ModuleSupport;
+var _AxisTicks = class _AxisTicks {
+ constructor(ctx, dataProvider) {
+ this.ctx = ctx;
+ this.dataProvider = dataProvider;
+ this.id = (0, import_ag_charts_core75.createId)(this);
+ this.axisGroup = new TranslatableGroup4({ name: `${this.id}-AxisTicks`, zIndex: ZIndexMap9.AXIS });
+ this.labelSelection = Selection4.select(this.axisGroup, Text2);
+ this.interval = new AxisInterval2();
+ this.label = new AxisLabel2();
+ this.scale = new LinearScale3();
+ this.placement = "bottom";
+ this.translationX = 0;
+ this.translationY = 0;
+ this.padding = 0;
+ }
+ get horizontal() {
+ return this.placement.startsWith("top") || this.placement.startsWith("bottom");
+ }
+ attachAxis(axisNode) {
+ axisNode.appendChild(this.axisGroup);
+ }
+ calculateLayout() {
+ const { placement, translationX, translationY, horizontal, label } = this;
+ function unreachable(_a) {
+ return void 0;
+ }
+ let textBaseline;
+ let textAlign;
+ switch (placement) {
+ case "top":
+ case "top-right":
+ case "top-left":
+ textBaseline = "bottom";
+ textAlign = "center";
+ label.mirrored = false;
+ label.parallel = true;
+ break;
+ case "bottom":
+ case "bottom-right":
+ case "bottom-left":
+ textBaseline = "top";
+ textAlign = "center";
+ label.mirrored = false;
+ label.parallel = true;
+ break;
+ case "right":
+ case "right-top":
+ case "right-bottom":
+ case "left":
+ case "left-top":
+ case "left-bottom":
+ textBaseline = "middle";
+ textAlign = "left";
+ label.mirrored = true;
+ label.parallel = false;
+ break;
+ default:
+ unreachable(placement);
+ }
+ const boxes = [];
+ const tickGenerationResult = this.generateTicks();
+ const { ticks } = tickGenerationResult;
+ this.labelSelection.update(ticks, void 0, (datum) => datum.tickId);
+ this.axisGroup.setProperties({ translationX, translationY });
+ this.labelSelection.each((node, datum) => {
+ node.fontFamily = label.fontFamily;
+ node.fontSize = label.fontSize;
+ node.fontStyle = label.fontStyle;
+ node.fontWeight = label.fontWeight;
+ node.fill = label.color;
+ node.textBaseline = textBaseline;
+ node.textAlign = textAlign;
+ node.text = datum.tickLabel;
+ node.x = horizontal ? datum.translation : 0;
+ node.y = horizontal ? 0 : datum.translation;
+ boxes.push(node.getBBox());
+ });
+ return boxes.length > 0 ? BBox14.merge(boxes).translate(translationX, translationY) : void 0;
+ }
+ tickFormatter(domain, _ticks, _primary, fractionDigits) {
+ const { ctx } = this;
+ const { formatManager } = ctx;
+ const boundSeries = this.dataProvider.data.flatMap((d) => d.series);
+ return (value, index) => {
+ const formatParams = {
+ type: "number",
+ value,
+ datum: void 0,
+ seriesId: void 0,
+ legendItemName: void 0,
+ key: void 0,
+ source: "gradient-legend",
+ property: "color",
+ domain,
+ boundSeries,
+ fractionDigits
+ };
+ return this.label.formatValue((fn, params) => formatWithContext(ctx, fn, params), formatParams, index) ?? formatManager.format((fn, params) => formatWithContext(ctx, fn, params), formatParams) ?? formatManager.defaultFormat(formatParams);
+ };
+ }
+ inRange(x, tolerance = 1e-3) {
+ const [min, max] = findMinMax5(this.scale.range);
+ return x >= min - tolerance && x <= max + tolerance;
+ }
+ generateTicks() {
+ const { minSpacing, maxSpacing } = this.interval;
+ const { maxTickCount, minTickCount, tickCount } = estimateTickCount(
+ findRangeExtent(this.scale.range),
+ 1,
+ minSpacing,
+ maxSpacing,
+ _AxisTicks.DefaultTickCount,
+ _AxisTicks.DefaultMinSpacing
+ );
+ const tickData = this.getTicksData({
+ nice: true,
+ interval: this.interval.step,
+ tickCount,
+ minTickCount,
+ maxTickCount
+ });
+ if (this.placement === "bottom" || this.placement === "top") {
+ const measurer2 = (0, import_ag_charts_core75.cachedTextMeasurer)(this.label);
+ const { domain } = this.scale;
+ const reversed = domain[0] > domain[1];
+ const direction = reversed ? -1 : 1;
+ let lastTickPosition = -Infinity * direction;
+ tickData.ticks = tickData.ticks.filter((data) => {
+ if (Math.sign(data.translation - lastTickPosition) !== direction)
+ return false;
+ const { width: labelWidth } = (0, import_ag_charts_core75.isArray)(data.tickLabel) ? (0, import_ag_charts_core75.measureTextSegments)(data.tickLabel, this.label) : measurer2.measureLines(data.tickLabel);
+ lastTickPosition = data.translation + labelWidth * direction;
+ return true;
+ });
+ }
+ return tickData;
+ }
+ getTicksData(tickParams) {
+ const ticks = [];
+ const domain = tickParams.nice ? this.scale.niceDomain(tickParams) : this.scale.domain;
+ const rawTicks = this.scale.ticks(tickParams, domain)?.ticks ?? [];
+ const fractionDigits = rawTicks.reduce((max, tick) => Math.max(max, (0, import_ag_charts_core75.countFractionDigits)(tick)), 0);
+ const idGenerator = createIdsGenerator();
+ const tickFormatter = this.tickFormatter(domain, rawTicks, false, fractionDigits);
+ for (let index = 0; index < rawTicks.length; index++) {
+ const tick = rawTicks[index];
+ const translation = this.scale.convert(tick);
+ if (!this.inRange(translation))
+ continue;
+ const tickLabel = tickFormatter(tick, index);
+ if (tickLabel == null || tickLabel === "")
+ continue;
+ const tickId = idGenerator((0, import_ag_charts_core75.toPlainText)(tickLabel));
+ ticks.push({ tick, tickId, tickLabel, translation });
+ }
+ return { rawTicks, fractionDigits, ticks };
+ }
+};
+_AxisTicks.DefaultTickCount = 5;
+_AxisTicks.DefaultMinSpacing = 10;
+var AxisTicks = _AxisTicks;
+
+// packages/ag-charts-enterprise/src/gradient-legend/gradientLegend.ts
+var {
+ BaseProperties: BaseProperties23,
+ ZIndexMap: ZIndexMap10,
+ ProxyProperty: ProxyProperty4,
+ Property: Property63,
+ LayoutElement: LayoutElement5,
+ Group: Group8,
+ Rect: Rect5,
+ Marker: Marker2,
+ TranslatableGroup: TranslatableGroup5,
+ BBox: BBox15,
+ expandLegendPosition
+} = import_ag_charts_community173._ModuleSupport;
+var GradientBar = class extends BaseProperties23 {
+ constructor() {
+ super(...arguments);
+ this.thickness = 16;
+ this.preferredLength = 100;
+ }
+};
+__decorateClass([
+ Property63
+], GradientBar.prototype, "thickness", 2);
+__decorateClass([
+ Property63
+], GradientBar.prototype, "preferredLength", 2);
+var GradientLegendScale = class extends import_ag_charts_community173._ModuleSupport.BaseProperties {
+ constructor(axisTicks) {
+ super();
+ this.axisTicks = axisTicks;
+ }
+};
+__decorateClass([
+ ProxyProperty4("axisTicks.label")
+], GradientLegendScale.prototype, "label", 2);
+__decorateClass([
+ ProxyProperty4("axisTicks.interval")
+], GradientLegendScale.prototype, "interval", 2);
+__decorateClass([
+ ProxyProperty4("axisTicks.padding")
+], GradientLegendScale.prototype, "padding", 2);
+var GradientLegend = class extends import_ag_charts_community173._ModuleSupport.BaseProperties {
+ constructor(ctx) {
+ super();
+ this.ctx = ctx;
+ this.id = (0, import_ag_charts_core76.createId)(this);
+ this.legendGroup = new TranslatableGroup5({ name: "legend", zIndex: ZIndexMap10.LEGEND });
+ this.containerNode = this.legendGroup.appendChild(new Rect5({ name: "legend-container" }));
+ this.gradientRect = new Rect5();
+ this.arrow = new Marker2({ shape: "triangle" });
+ this.ticksGroup = new Group8({ name: "legend-axis-group" });
+ this.cleanup = new import_ag_charts_core76.CleanupRegistry();
+ this.enabled = false;
+ this.position = "bottom";
+ this.reverseOrder = false;
+ this.gradient = new GradientBar();
+ this.spacing = 20;
+ this.border = new import_ag_charts_community173._ModuleSupport.Border(this.containerNode);
+ this.cornerRadius = 0;
+ this.fillOpacity = 1;
+ this.padding = 4;
+ this.data = [];
+ this.highlightManager = ctx.highlightManager;
+ this.axisTicks = new AxisTicks(ctx, this);
+ this.axisTicks.attachAxis(this.ticksGroup);
+ this.scale = new GradientLegendScale(this.axisTicks);
+ this.legendGroup.append([this.gradientRect, this.arrow, this.ticksGroup]);
+ this.cleanup.register(
+ ctx.eventsHub.on("highlight:change", () => this.onChartHoverChange()),
+ ctx.layoutManager.registerElement(LayoutElement5.Legend, (e) => this.onStartLayout(e)),
+ () => this.legendGroup.remove()
+ );
+ }
+ isVertical() {
+ const { placement } = expandLegendPosition(this.position);
+ return placement.startsWith("right") || placement.startsWith("left");
+ }
+ destroy() {
+ this.cleanup.flush();
+ }
+ attachLegend(scene) {
+ scene.appendChild(this.legendGroup);
+ }
+ onStartLayout(ctx) {
+ const [data] = this.data;
+ if (!this.enabled || !data?.enabled || data.legendType !== "gradient") {
+ this.legendGroup.visible = false;
+ return;
+ }
+ const { colorRange } = this.normalizeColorArrays(data);
+ const gradientRectBBox = this.updateGradientRect(ctx.layoutBox, colorRange);
+ const axisBBox = this.updateAxis(data, gradientRectBBox) ?? new BBox15(0, 0, 0, 0);
+ const legendBBox = BBox15.merge([gradientRectBBox, axisBBox]);
+ const { strokeWidth, padding } = this.getContainerStyles();
+ legendBBox.grow(padding).grow(strokeWidth);
+ const { left, top } = this.getMeasurements(ctx.layoutBox, legendBBox);
+ this.updateContainer(legendBBox);
+ this.updateArrow();
+ this.legendGroup.visible = true;
+ this.legendGroup.translationX = left;
+ this.legendGroup.translationY = top;
+ }
+ normalizeColorArrays(data) {
+ let colorDomain = data.colorDomain.slice();
+ const colorRange = data.colorRange.slice();
+ if (colorDomain.length === colorRange.length) {
+ return { colorDomain, colorRange };
+ }
+ if (colorDomain.length > colorRange.length) {
+ colorRange.splice(colorDomain.length);
+ }
+ const [d0, d1] = colorDomain;
+ const count = colorRange.length;
+ colorDomain = colorRange.map((_, i) => {
+ if (i === 0) {
+ return d0;
+ } else if (i === count - 1) {
+ return d1;
+ }
+ return d0 + (d1 - d0) * i / (count - 1);
+ });
+ return { colorDomain, colorRange };
+ }
+ updateGradientRect(shrinkRect, colorRange) {
+ const { gradientRect, gradient } = this;
+ const { preferredLength, thickness } = gradient;
+ const gradientRectBBox = new BBox15(0, 0, 0, 0);
+ let angle;
+ if (this.isVertical()) {
+ angle = 0;
+ gradientRectBBox.width = thickness;
+ gradientRectBBox.height = Math.min(shrinkRect.height, preferredLength);
+ } else {
+ angle = 90;
+ gradientRectBBox.width = Math.min(shrinkRect.width, preferredLength);
+ gradientRectBBox.height = thickness;
+ }
+ gradientRect.x = gradientRectBBox.x;
+ gradientRect.y = gradientRectBBox.y;
+ gradientRect.width = gradientRectBBox.width;
+ gradientRect.height = gradientRectBBox.height;
+ gradientRect.fill = {
+ type: "gradient",
+ gradient: "linear",
+ colorSpace: "oklch",
+ colorStops: colorRange.map((color6, i) => ({
+ stop: i / (colorRange.length - 1),
+ color: color6
+ })),
+ rotation: angle
+ };
+ return gradientRectBBox;
+ }
+ updateAxis(data, gradientRectBBox) {
+ const { axisTicks, gradient, scale } = this;
+ const { placement } = expandLegendPosition(this.position);
+ const vertical = this.isVertical();
+ const positiveAxis = this.reverseOrder !== vertical;
+ axisTicks.placement = placement;
+ const offset = gradient.thickness + (scale.padding ?? 0);
+ axisTicks.translationX = vertical ? offset : gradientRectBBox.x;
+ axisTicks.translationY = vertical ? gradientRectBBox.y : offset;
+ axisTicks.scale.domain = positiveAxis ? data.colorDomain.slice().reverse() : data.colorDomain;
+ axisTicks.scale.range = vertical ? [gradientRectBBox.x, gradientRectBBox.height] : [gradientRectBBox.y, gradientRectBBox.width];
+ return axisTicks.calculateLayout();
+ }
+ updateContainer(bbox) {
+ const containerStyles = this.getContainerStyles();
+ import_ag_charts_community173._ModuleSupport.applyShapeStyle(this.containerNode, containerStyles);
+ this.containerNode.cornerRadius = containerStyles.cornerRadius;
+ this.containerNode.x = bbox.x;
+ this.containerNode.y = bbox.y;
+ this.containerNode.width = bbox.width;
+ this.containerNode.height = bbox.height;
+ }
+ updateArrow() {
+ const highlighted = this.highlightManager.getActiveHighlight();
+ const { arrow } = this;
+ if (highlighted?.colorValue == null) {
+ arrow.visible = false;
+ return;
+ }
+ const { scale, label } = this.axisTicks;
+ const size = label.fontSize ?? 0;
+ const t = scale.convert(highlighted.colorValue);
+ let { x, y } = this.gradientRect;
+ let rotation = Math.PI;
+ if (this.isVertical()) {
+ x -= size / 2;
+ y += t;
+ rotation /= 2;
+ } else {
+ x += t;
+ y -= size / 2;
+ }
+ arrow.visible = true;
+ arrow.fill = label.color;
+ arrow.rotation = rotation;
+ arrow.size = size;
+ arrow.translationX = x;
+ arrow.translationY = y;
+ }
+ getMeasurements(shrinkRect, legendBBox) {
+ function unreachable(_a) {
+ return void 0;
+ }
+ let { x: left, y: top } = shrinkRect;
+ const { width, height } = legendBBox;
+ const { placement, floating, xOffset, yOffset } = expandLegendPosition(this.position);
+ const containerStyles = this.getContainerStyles();
+ left += containerStyles.strokeWidth + containerStyles.padding.left;
+ top += containerStyles.strokeWidth + containerStyles.padding.top;
+ switch (placement) {
+ case "left":
+ top += shrinkRect.height / 2 - height / 2;
+ break;
+ case "right":
+ left += shrinkRect.width - width;
+ top += shrinkRect.height / 2 - height / 2;
+ break;
+ case "top":
+ left += shrinkRect.width / 2 - width / 2;
+ break;
+ case "bottom":
+ left += shrinkRect.width / 2 - width / 2;
+ top += shrinkRect.height - height;
+ break;
+ case "right-top":
+ case "top-right":
+ left += shrinkRect.width - width;
+ break;
+ case "right-bottom":
+ case "bottom-right":
+ left += shrinkRect.width - width;
+ top += shrinkRect.height - height;
+ break;
+ case "left-bottom":
+ case "bottom-left":
+ top += shrinkRect.height - height;
+ break;
+ case "left-top":
+ case "top-left":
+ break;
+ default:
+ unreachable(placement);
+ }
+ if (!floating) {
+ switch (placement) {
+ case "left":
+ case "left-top":
+ case "left-bottom":
+ shrinkRect.shrink(width + this.spacing, "left");
+ break;
+ case "right":
+ case "right-top":
+ case "right-bottom":
+ shrinkRect.shrink(width + this.spacing, "right");
+ break;
+ case "top":
+ case "top-left":
+ case "top-right":
+ shrinkRect.shrink(height + this.spacing, "top");
+ break;
+ case "bottom":
+ case "bottom-left":
+ case "bottom-right":
+ shrinkRect.shrink(height + this.spacing, "bottom");
+ break;
+ default:
+ unreachable(placement);
+ }
+ }
+ left += xOffset;
+ top += yOffset;
+ return { top, left };
+ }
+ getContainerStyles() {
+ const { stroke: stroke2, strokeOpacity, strokeWidth } = this.border;
+ const { cornerRadius, fill, fillOpacity, padding } = this;
+ const isPaddingNumber = typeof padding === "number";
+ return {
+ cornerRadius,
+ fill,
+ fillOpacity,
+ padding: {
+ top: isPaddingNumber ? padding : padding.top ?? 0,
+ right: isPaddingNumber ? padding : padding.right ?? 0,
+ bottom: isPaddingNumber ? padding : padding.bottom ?? 0,
+ left: isPaddingNumber ? padding : padding.left ?? 0
+ },
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth: this.border.enabled ? strokeWidth : 0
+ };
+ }
+ onChartHoverChange() {
+ if (!this.enabled)
+ return;
+ this.updateArrow();
+ }
+};
+GradientLegend.className = "GradientLegend";
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "enabled", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "position", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "reverseOrder", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "gradient", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "spacing", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "border", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "fill", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "padding", 2);
+__decorateClass([
+ Property63
+], GradientLegend.prototype, "scale", 2);
+
+// packages/ag-charts-enterprise/src/gradient-legend/gradientLegendModule.ts
+var GradientLegendModule = {
+ type: "legend",
+ optionsKey: "gradientLegend",
+ packageType: "enterprise",
+ chartTypes: ["cartesian", "polar", "topology", "standalone"],
+ identifier: "gradient",
+ moduleFactory: (ctx) => new GradientLegend(ctx),
+ themeTemplate: {
+ enabled: false,
+ position: "bottom",
+ spacing: 20,
+ scale: {
+ padding: 13,
+ label: {
+ color: { $ref: "textColor" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ minSpacing: 5
+ },
+ interval: {
+ minSpacing: 15
+ }
+ },
+ gradient: {
+ preferredLength: 100,
+ thickness: 16
+ },
+ reverseOrder: false,
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $ref: "chartBackgroundColour" },
+ ["gradient", import_ag_charts_community174._ModuleSupport.FILL_GRADIENT_BLANK_DEFAULTS],
+ ["pattern", import_ag_charts_community174._ModuleSupport.FILL_PATTERN_BLANK_DEFAULTS],
+ ["image", import_ag_charts_community174._ModuleSupport.FILL_IMAGE_BLANK_DEFAULTS]
+ ]
+ }
+ },
+ removable: "standalone-only"
+};
+
+// packages/ag-charts-enterprise/src/license/watermark.ts
+var import_ag_charts_core77 = require("ag-charts-core");
+function injectWatermark(domManager, text2) {
+ const element = domManager.addChild("canvas-overlay", "watermark");
+ const textElement = (0, import_ag_charts_core77.createElement)("span");
+ textElement.innerText = text2;
+ element.addEventListener("animationend", () => {
+ domManager.removeChild("canvas-overlay", "watermark");
+ domManager.removeStyles("watermark");
+ });
+ element.classList.add("ag-watermark");
+ element.appendChild(textElement);
+}
+
+// packages/ag-charts-enterprise/src/main-modules.ts
+var import_ag_charts_community281 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/axes/axisModules.ts
+var import_ag_charts_community175 = require("ag-charts-community");
+var {
+ ordinalTimeAxisOptionsDefs,
+ angleNumberAxisOptionsDefs,
+ angleCategoryAxisOptionsDefs,
+ radiusNumberAxisOptionsDefs,
+ radiusCategoryAxisOptionsDefs
+} = import_ag_charts_community175._ModuleSupport;
+var OrdinalTimeAxisModule2 = {
+ type: "axis",
+ name: "ordinal-time",
+ chartType: "cartesian",
+ enterprise: true,
+ options: ordinalTimeAxisOptionsDefs,
+ create: (ctx) => new OrdinalTimeAxis(ctx)
+};
+var AngleNumberAxisModule2 = {
+ type: "axis",
+ name: "angle-number",
+ chartType: "polar",
+ enterprise: true,
+ options: angleNumberAxisOptionsDefs,
+ create: (ctx) => new AngleNumberAxis(ctx)
+};
+var AngleCategoryAxisModule2 = {
+ type: "axis",
+ name: "angle-category",
+ chartType: "polar",
+ enterprise: true,
+ options: angleCategoryAxisOptionsDefs,
+ create: (ctx) => new AngleCategoryAxis(ctx)
+};
+var RadiusNumberAxisModule2 = {
+ type: "axis",
+ name: "radius-number",
+ chartType: "polar",
+ enterprise: true,
+ options: radiusNumberAxisOptionsDefs,
+ create: (ctx) => new RadiusNumberAxis(ctx)
+};
+var RadiusCategoryAxisModule2 = {
+ type: "axis",
+ name: "radius-category",
+ chartType: "polar",
+ enterprise: true,
+ options: radiusCategoryAxisOptionsDefs,
+ create: (ctx) => new RadiusCategoryAxis(ctx)
+};
+
+// packages/ag-charts-enterprise/src/charts/standaloneChartModule.ts
+var import_ag_charts_community177 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/charts/standaloneChart.ts
+var import_ag_charts_community176 = require("ag-charts-community");
+var { Chart } = import_ag_charts_community176._ModuleSupport;
+var StandaloneChart = class extends Chart {
+ getChartType() {
+ return "standalone";
+ }
+ performLayout(ctx) {
+ const { seriesRoot, annotationRoot } = this;
+ const { layoutBox } = ctx;
+ const seriesRect = layoutBox.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());
+ this.seriesRect = seriesRect;
+ this.animationRect = seriesRect;
+ for (const group of [seriesRoot, annotationRoot]) {
+ group.translationX = Math.floor(seriesRect.x);
+ group.translationY = Math.floor(seriesRect.y);
+ }
+ seriesRoot.visible = this.series[0].visible;
+ this.ctx.layoutManager.emitLayoutComplete(ctx, {
+ series: { visible: true, rect: seriesRect, paddedRect: layoutBox }
+ });
+ }
+ getAriaLabel() {
+ const seriesType = this.series[0]?.type;
+ if (seriesType == null)
+ return "";
+ const caption = this.getCaptionText();
+ switch (seriesType) {
+ case "radial-gauge":
+ case "linear-gauge": {
+ const captions = [];
+ if (caption.length !== 0) {
+ captions.push(caption);
+ }
+ for (const series of this.series) {
+ captions.push(series.getCaptionText());
+ }
+ return this.ctx.localeManager.t("ariaAnnounceGaugeChart", { caption: captions.join(". ") });
+ }
+ case "treemap":
+ case "sunburst":
+ return this.ctx.localeManager.t("ariaAnnounceHierarchyChart", { caption });
+ default: {
+ return this.ctx.localeManager.t("ariaAnnounceStandaloneChart", { caption });
+ }
+ }
+ }
+};
+StandaloneChart.className = "StandaloneChart";
+StandaloneChart.type = "standalone";
+
+// packages/ag-charts-enterprise/src/charts/standaloneChartModule.ts
+var { isAgStandaloneChartOptions, standaloneChartOptionsDefs } = import_ag_charts_community177._ModuleSupport;
+var StandaloneChartModule = {
+ type: "chart",
+ name: "standalone",
+ enterprise: true,
+ options: standaloneChartOptionsDefs,
+ detect: isAgStandaloneChartOptions,
+ create(options, resources) {
+ return new StandaloneChart(options, resources);
+ }
+};
+
+// packages/ag-charts-enterprise/src/charts/topologyChartModule.ts
+var import_ag_charts_community179 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/charts/topologyChart.ts
+var import_ag_charts_community178 = require("ag-charts-community");
+var { Chart: Chart2, MercatorScale, ChartAxisDirection: ChartAxisDirection24, Property: Property64 } = import_ag_charts_community178._ModuleSupport;
+function isTopologySeries(series) {
+ return series.type === "map-shape" || series.type === "map-line" || series.type === "map-marker" || series.type === "map-shape-background" || series.type === "map-line-background";
+}
+var TopologyChart = class extends Chart2 {
+ constructor(options, resources) {
+ super(options, resources);
+ this.ctx.zoomManager.updateAxes([ChartAxisDirection24.X, ChartAxisDirection24.Y]);
+ }
+ getChartType() {
+ return "topology";
+ }
+ async updateData() {
+ await super.updateData();
+ const options = this.getOptions();
+ if (this.topology !== options.topology) {
+ this.topology = options.topology;
+ }
+ const { topology } = this;
+ for (const series of this.series) {
+ if (isTopologySeries(series)) {
+ series.setChartTopology(topology);
+ }
+ }
+ }
+ performLayout(ctx) {
+ const { seriesRoot, annotationRoot } = this;
+ const { layoutBox } = ctx;
+ const seriesRect = layoutBox.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());
+ this.seriesRect = seriesRect;
+ this.animationRect = seriesRect;
+ const mapSeries = this.series.filter(isTopologySeries);
+ const combinedBbox = mapSeries.reduce((combined, series) => {
+ if (!series.visible)
+ return combined;
+ const bbox = series.topologyBounds;
+ if (bbox == null)
+ return combined;
+ if (combined == null)
+ return bbox;
+ return combined.merge(bbox);
+ }, void 0);
+ let scale;
+ if (combinedBbox != null) {
+ const { lon0, lat0, lon1, lat1 } = combinedBbox;
+ const domain = [
+ [lon0, lat0],
+ [lon1, lat1]
+ ];
+ const bounds = MercatorScale.bounds(domain);
+ const { width, height } = seriesRect;
+ const viewBoxScale = Math.min(width / bounds.width, height / bounds.height);
+ const viewBoxWidth = bounds.width * viewBoxScale;
+ const viewBoxHeight = bounds.height * viewBoxScale;
+ const viewBoxOriginX = (width - viewBoxWidth) / 2;
+ const viewBoxOriginY = (height - viewBoxHeight) / 2;
+ const x0 = viewBoxOriginX;
+ const y0 = viewBoxOriginY;
+ const x1 = viewBoxOriginX + viewBoxWidth;
+ const y1 = viewBoxOriginY + viewBoxHeight;
+ const xZoom = this.ctx.zoomManager.getAxisZoom(ChartAxisDirection24.X);
+ const yZoom = this.ctx.zoomManager.getAxisZoom(ChartAxisDirection24.Y);
+ const xSpan = (x1 - x0) / (xZoom.max - xZoom.min);
+ const xStart = x0 - xSpan * xZoom.min;
+ const ySpan = (y1 - y0) / (1 - yZoom.min - (1 - yZoom.max));
+ const yStart = y0 - ySpan * (1 - yZoom.max);
+ scale = new MercatorScale(domain, [
+ [xStart, yStart],
+ [xStart + xSpan, yStart + ySpan]
+ ]);
+ }
+ for (const series of mapSeries) {
+ series.scale = scale;
+ }
+ const seriesVisible = this.series.some((s) => s.visible);
+ seriesRoot.visible = seriesVisible;
+ for (const group of [seriesRoot, annotationRoot]) {
+ group.translationX = Math.floor(seriesRect.x);
+ group.translationY = Math.floor(seriesRect.y);
+ group.setClipRect(seriesRect.clone());
+ }
+ this.ctx.layoutManager.emitLayoutComplete(ctx, {
+ series: { visible: seriesVisible, rect: seriesRect, paddedRect: layoutBox }
+ });
+ }
+};
+TopologyChart.className = "TopologyChart";
+TopologyChart.type = "topology";
+__decorateClass([
+ Property64
+], TopologyChart.prototype, "topology", 2);
+
+// packages/ag-charts-enterprise/src/charts/topologyChartModule.ts
+var { isAgTopologyChartOptions, topologyChartOptionsDefs } = import_ag_charts_community179._ModuleSupport;
+var TopologyChartModule = {
+ type: "chart",
+ name: "topology",
+ enterprise: true,
+ options: topologyChartOptionsDefs,
+ detect: isAgTopologyChartOptions,
+ create(options, resources) {
+ return new TopologyChart(options, resources);
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/sync/pluginModules.ts
+var import_ag_charts_community181 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/features/annotations/annotationOptionsDef.ts
+var import_ag_charts_community180 = require("ag-charts-community");
+var import_ag_charts_core78 = require("ag-charts-core");
+var {
+ annotationCalloutStylesDefs,
+ annotationNoteStylesDefs,
+ annotationTextStylesDef,
+ annotationCommentStylesDefs,
+ annotationMeasurerStylesDefs,
+ annotationQuickMeasurerStylesDefs,
+ annotationShapeStylesDefs,
+ annotationChannelTextDefs,
+ annotationCrossLineStyleDefs,
+ annotationFibonacciStylesDefs,
+ annotationLineStyleDefs,
+ annotationLineTextDefs,
+ annotationDisjointChannelStyleDefs,
+ annotationParallelChannelStyleDefs
+} = import_ag_charts_community180._ModuleSupport;
+var serializableDate = (0, import_ag_charts_core78.optionsDefs)(
+ {
+ __type: (0, import_ag_charts_core78.required)((0, import_ag_charts_core78.constant)("date")),
+ value: (0, import_ag_charts_core78.or)(import_ag_charts_core78.string, import_ag_charts_core78.number)
+ },
+ "a serializable date object"
+);
+var xValue = (0, import_ag_charts_core78.or)(import_ag_charts_core78.string, import_ag_charts_core78.number, serializableDate);
+var annotationValue = (0, import_ag_charts_core78.or)(
+ xValue,
+ (0, import_ag_charts_core78.optionsDefs)({
+ value: xValue,
+ groupPercentage: (0, import_ag_charts_core78.numberRange)(-1, 2)
+ })
+);
+var channelAnnotationTextOptionsDef = {
+ ...annotationChannelTextDefs,
+ label: import_ag_charts_core78.string
+};
+var lineAnnotationTextOptionsDef = {
+ ...annotationLineTextDefs,
+ label: import_ag_charts_core78.string
+};
+var annotationPointOptionsDef = {
+ x: annotationValue,
+ y: import_ag_charts_core78.number
+};
+var annotationInitialStateOptionsDef = (0, import_ag_charts_core78.typeUnion)(
+ {
+ line: {
+ ...annotationLineStyleDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: lineAnnotationTextOptionsDef
+ },
+ "horizontal-line": {
+ ...annotationCrossLineStyleDefs,
+ value: annotationValue,
+ text: lineAnnotationTextOptionsDef
+ },
+ "vertical-line": {
+ ...annotationCrossLineStyleDefs,
+ value: annotationValue,
+ text: lineAnnotationTextOptionsDef
+ },
+ "disjoint-channel": {
+ ...annotationDisjointChannelStyleDefs,
+ startHeight: import_ag_charts_core78.number,
+ endHeight: import_ag_charts_core78.number,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: channelAnnotationTextOptionsDef
+ },
+ "parallel-channel": {
+ ...annotationParallelChannelStyleDefs,
+ height: import_ag_charts_core78.number,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: channelAnnotationTextOptionsDef
+ },
+ "fibonacci-retracement": {
+ ...annotationFibonacciStylesDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: lineAnnotationTextOptionsDef,
+ reverse: import_ag_charts_core78.boolean
+ },
+ "fibonacci-retracement-trend-based": {
+ ...annotationFibonacciStylesDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ endRetracement: annotationPointOptionsDef,
+ text: lineAnnotationTextOptionsDef,
+ reverse: import_ag_charts_core78.boolean
+ },
+ callout: {
+ ...annotationCalloutStylesDefs,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef,
+ text: import_ag_charts_core78.string
+ },
+ comment: {
+ ...annotationCommentStylesDefs,
+ ...annotationPointOptionsDef,
+ text: import_ag_charts_core78.string
+ },
+ note: {
+ ...annotationNoteStylesDefs,
+ ...annotationPointOptionsDef,
+ text: import_ag_charts_core78.string
+ },
+ text: {
+ ...annotationTextStylesDef,
+ ...annotationPointOptionsDef,
+ text: import_ag_charts_core78.string
+ },
+ arrow: {
+ ...annotationLineStyleDefs,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "arrow-up": {
+ ...annotationShapeStylesDefs,
+ ...annotationPointOptionsDef
+ },
+ "arrow-down": {
+ ...annotationShapeStylesDefs,
+ ...annotationPointOptionsDef
+ },
+ "date-range": {
+ ...annotationMeasurerStylesDefs,
+ extendAbove: import_ag_charts_core78.boolean,
+ extendBelow: import_ag_charts_core78.boolean,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "price-range": {
+ ...annotationMeasurerStylesDefs,
+ extendLeft: import_ag_charts_core78.boolean,
+ extendRight: import_ag_charts_core78.boolean,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "date-price-range": {
+ ...annotationMeasurerStylesDefs,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ },
+ "quick-date-price-range": {
+ ...annotationMeasurerStylesDefs,
+ ...annotationQuickMeasurerStylesDefs,
+ text: lineAnnotationTextOptionsDef,
+ start: annotationPointOptionsDef,
+ end: annotationPointOptionsDef
+ }
+ },
+ "an annotation initial state object"
+);
+var initialStateOptionsDef = {
+ chartType: (0, import_ag_charts_core78.union)("candlestick", "hollow-candlestick", "ohlc", "line", "step-line", "hlc", "high-low"),
+ annotations: (0, import_ag_charts_core78.arrayOfDefs)(annotationInitialStateOptionsDef),
+ legend: (0, import_ag_charts_core78.arrayOfDefs)(
+ {
+ visible: import_ag_charts_core78.boolean,
+ seriesId: import_ag_charts_core78.string,
+ itemId: import_ag_charts_core78.string,
+ legendItemName: import_ag_charts_core78.string
+ },
+ "legend state array"
+ ),
+ zoom: {
+ rangeX: {
+ start: (0, import_ag_charts_core78.or)(import_ag_charts_core78.number, serializableDate),
+ end: (0, import_ag_charts_core78.or)(import_ag_charts_core78.number, serializableDate)
+ },
+ rangeY: {
+ start: (0, import_ag_charts_core78.or)(import_ag_charts_core78.number, serializableDate),
+ end: (0, import_ag_charts_core78.or)(import_ag_charts_core78.number, serializableDate)
+ },
+ ratioX: {
+ start: (0, import_ag_charts_core78.and)(import_ag_charts_core78.ratio, (0, import_ag_charts_core78.lessThan)("end")),
+ end: (0, import_ag_charts_core78.and)(import_ag_charts_core78.ratio, (0, import_ag_charts_core78.greaterThan)("start"))
+ },
+ ratioY: {
+ start: (0, import_ag_charts_core78.and)(import_ag_charts_core78.ratio, (0, import_ag_charts_core78.lessThan)("end")),
+ end: (0, import_ag_charts_core78.and)(import_ag_charts_core78.ratio, (0, import_ag_charts_core78.greaterThan)("start"))
+ },
+ autoScaledAxes: (0, import_ag_charts_core78.arrayOf)((0, import_ag_charts_core78.constant)("y"))
+ }
+};
+
+// packages/ag-charts-enterprise/src/features/sync/pluginModules.ts
+var { annotationOptionsDef } = import_ag_charts_community181._ModuleSupport;
+var AnnotationsModule2 = {
+ type: "plugin",
+ name: "annotations",
+ chartType: "cartesian",
+ options: annotationOptionsDef,
+ create() {
+ return null;
+ }
+};
+var NavigatorModule2 = {
+ type: "plugin",
+ name: "navigator",
+ chartType: "cartesian",
+ options: navigatorOptionsDef,
+ create() {
+ return null;
+ }
+};
+var InitialStateModule = {
+ type: "plugin",
+ name: "initialState",
+ options: initialStateOptionsDef,
+ create() {
+ return null;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/chord/chordModule.ts
+var import_ag_charts_community187 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeries.ts
+var import_ag_charts_community185 = require("ag-charts-community");
+var import_ag_charts_core80 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/flow-proportion/flowProportionSeries.ts
+var import_ag_charts_community182 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/flow-proportion/flowProportionUtil.ts
+var import_ag_charts_core79 = require("ag-charts-core");
+function computeNodeGraph(nodes, links, includeCircularReferences) {
+ if (!includeCircularReferences) {
+ links = removeCircularLinks(links);
+ }
+ const nodeGraph = /* @__PURE__ */ new Map();
+ for (const datum of nodes) {
+ nodeGraph.set(datum.id, {
+ datum,
+ linksBefore: [],
+ linksAfter: [],
+ maxPathLengthBefore: -1,
+ maxPathLengthAfter: -1
+ });
+ }
+ let maxPathLength = 0;
+ for (const [id, node] of nodeGraph.entries()) {
+ maxPathLength = Math.max(
+ maxPathLength,
+ computePathLength(nodeGraph, links, node, id, -1, []) + computePathLength(nodeGraph, links, node, id, 1, []) + 1
+ );
+ }
+ return { links, nodeGraph, maxPathLength };
+}
+function findCircularLinks(links, link, into, stack) {
+ const stackIndex = stack.indexOf(link);
+ if (stackIndex !== -1) {
+ for (let i = stackIndex; i < stack.length; i += 1) {
+ into.add(stack[i]);
+ }
+ return;
+ }
+ stack.push(link);
+ const { toNode } = link;
+ for (const next of links) {
+ if (next.fromNode === toNode) {
+ findCircularLinks(links, next, into, stack);
+ }
+ }
+ stack.pop();
+}
+function removeCircularLinks(links) {
+ const circularLinks = /* @__PURE__ */ new Set();
+ for (const link of links) {
+ findCircularLinks(links, link, circularLinks, []);
+ }
+ if (circularLinks.size !== 0) {
+ import_ag_charts_core79.Logger.warnOnce("Some links formed circular references. These will be removed from the output.");
+ }
+ return circularLinks.size === 0 ? links : links.filter((link) => !circularLinks.has(link));
+}
+function computePathLength(nodeGraph, links, node, id, direction, stack) {
+ if (stack.includes(id)) {
+ return Infinity;
+ }
+ let maxPathLength = direction === -1 ? node.maxPathLengthBefore : node.maxPathLengthAfter;
+ if (maxPathLength === -1) {
+ maxPathLength = 0;
+ const connectedLinks = direction === -1 ? node.linksBefore : node.linksAfter;
+ for (const link of links) {
+ const { fromNode, toNode } = link;
+ const linkId = direction === -1 ? toNode.id : fromNode.id;
+ const nextNodeId = direction === -1 ? fromNode.id : toNode.id;
+ const nextNode = id === linkId ? nodeGraph.get(nextNodeId) : void 0;
+ if (nextNode == null)
+ continue;
+ connectedLinks.push({ node: nextNode, link });
+ stack?.push(id);
+ maxPathLength = Math.max(
+ maxPathLength,
+ computePathLength(nodeGraph, links, nextNode, nextNodeId, direction, stack) + 1
+ );
+ stack?.pop();
+ }
+ if (direction === -1) {
+ node.maxPathLengthBefore = maxPathLength;
+ } else {
+ node.maxPathLengthAfter = maxPathLength;
+ }
+ }
+ return maxPathLength;
+}
+
+// packages/ag-charts-enterprise/src/series/flow-proportion/flowProportionSeries.ts
+var { Series, DataController, keyProperty: keyProperty7, valueProperty: valueProperty10, Selection: Selection5, Group: Group9, TransformableText } = import_ag_charts_community182._ModuleSupport;
+var FlowProportionSeriesNodeEvent = class extends import_ag_charts_community182._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ const { datumIndex } = datum;
+ const nodeDatum = series.contextNodeData?.nodeData.find(
+ (d) => d.datumIndex.type === datumIndex.type && d.datumIndex.index === datumIndex.index
+ );
+ this.size = nodeDatum?.size;
+ this.label = nodeDatum?.type === 1 /* Node */ ? nodeDatum?.label : void 0;
+ }
+};
+var FlowProportionSeries = class extends Series {
+ constructor() {
+ super(...arguments);
+ this.NodeEvent = FlowProportionSeriesNodeEvent;
+ this.nodeCount = 0;
+ this.linkCount = 0;
+ this.linksDataModel = void 0;
+ this.linksProcessedData = void 0;
+ this.nodesDataModel = void 0;
+ this.nodesProcessedData = void 0;
+ this.processedNodes = /* @__PURE__ */ new Map();
+ this.linkGroup = this.contentGroup.appendChild(new Group9({ name: "linkGroup" }));
+ this.nodeGroup = this.contentGroup.appendChild(new Group9({ name: "nodeGroup" }));
+ this.focusLinkGroup = this.highlightGroup.appendChild(new Group9({ name: "linkGroup" }));
+ this.focusNodeGroup = this.highlightGroup.appendChild(new Group9({ name: "nodeGroup" }));
+ this.highlightLinkGroup = this.highlightGroup.appendChild(new Group9({ name: "linkGroup" }));
+ this.highlightNodeGroup = this.highlightGroup.appendChild(new Group9({ name: "nodeGroup" }));
+ this.labelSelection = Selection5.select(
+ this.labelGroup,
+ TransformableText
+ );
+ this.linkSelection = Selection5.select(
+ this.linkGroup,
+ () => this.linkFactory()
+ );
+ this.nodeSelection = Selection5.select(
+ this.nodeGroup,
+ () => this.nodeFactory()
+ );
+ this.focusLinkSelection = Selection5.select(
+ this.focusLinkGroup,
+ () => this.linkFactory()
+ );
+ this.focusNodeSelection = Selection5.select(
+ this.focusNodeGroup,
+ () => this.nodeFactory()
+ );
+ this.highlightLinkSelection = Selection5.select(
+ this.highlightLinkGroup,
+ () => this.linkFactory()
+ );
+ this.highlightNodeSelection = Selection5.select(
+ this.highlightNodeGroup,
+ () => this.nodeFactory()
+ );
+ }
+ get nodes() {
+ return this.properties.nodes;
+ }
+ async processData(dataController) {
+ const { data, nodes } = this;
+ if (data == null)
+ return;
+ const { fromKey, toKey, sizeKey, idKey, labelKey } = this.properties;
+ const nodesDataController = new DataController("standalone", dataController.suppressFieldDotNotation);
+ const nodesDataModelPromise = nodes == null ? null : nodesDataController.request(
+ this.id,
+ import_ag_charts_community182._ModuleSupport.DataSet.wrap(nodes) ?? import_ag_charts_community182._ModuleSupport.DataSet.empty(),
+ {
+ props: [
+ keyProperty7(idKey, void 0, { id: "idValue", includeProperty: false }),
+ ...labelKey == null ? [] : [valueProperty10(labelKey, void 0, { id: "labelValue", includeProperty: false })]
+ ],
+ groupByKeys: true
+ }
+ );
+ const linksDataModelPromise = dataController.request(this.id, data, {
+ props: [
+ valueProperty10(fromKey, void 0, { id: "fromValue", includeProperty: false }),
+ valueProperty10(toKey, void 0, { id: "toValue", includeProperty: false }),
+ ...sizeKey == null ? [] : [
+ valueProperty10(sizeKey, void 0, {
+ id: "sizeValue",
+ includeProperty: false,
+ missingValue: 0
+ })
+ ]
+ ],
+ groupByKeys: false
+ });
+ if (nodes != null) {
+ nodesDataController.execute();
+ }
+ const [nodesDataModel, linksDataModel] = await Promise.all([
+ nodesDataModelPromise ?? Promise.resolve(null),
+ linksDataModelPromise
+ ]);
+ this.nodesDataModel = nodesDataModel?.dataModel;
+ this.nodesProcessedData = nodesDataModel?.processedData;
+ this.linksDataModel = linksDataModel?.dataModel;
+ this.linksProcessedData = linksDataModel?.processedData;
+ const processedNodes = /* @__PURE__ */ new Map();
+ if (nodesDataModel == null) {
+ const fromIdValues = linksDataModel.dataModel.resolveColumnById(
+ this,
+ "fromValue",
+ linksDataModel.processedData
+ );
+ const toIdValues = linksDataModel.dataModel.resolveColumnById(
+ this,
+ "toValue",
+ linksDataModel.processedData
+ );
+ const createImplicitNode = (id) => {
+ const datumIndex = processedNodes.size;
+ const label = id;
+ return {
+ series: this,
+ itemId: void 0,
+ datum: {},
+ // Must be a referential object for tooltips
+ datumIndex: { type: 1 /* Node */, index: datumIndex },
+ type: 1 /* Node */,
+ index: datumIndex,
+ linksBefore: [],
+ linksAfter: [],
+ id,
+ size: 0,
+ label,
+ style: this.getNodeStyle(
+ {
+ datumIndex: { type: 1 /* Node */, index: datumIndex },
+ datum: {},
+ size: 0,
+ label
+ },
+ datumIndex,
+ false
+ )
+ };
+ };
+ const linkData = linksDataModel.processedData.dataSources.get(this.id)?.data;
+ if (linkData) {
+ for (const [datumIndex] of linkData.entries()) {
+ const fromId = fromIdValues[datumIndex];
+ const toId = toIdValues[datumIndex];
+ if (fromId == null || toId == null)
+ continue;
+ if (!processedNodes.has(fromId)) {
+ processedNodes.set(fromId, createImplicitNode(fromId));
+ }
+ if (!processedNodes.has(toId)) {
+ processedNodes.set(toId, createImplicitNode(toId));
+ }
+ }
+ }
+ } else {
+ const nodeIdValues = nodesDataModel.dataModel.resolveColumnById(
+ this,
+ "idValue",
+ nodesDataModel.processedData
+ );
+ const labelValues = labelKey == null ? void 0 : nodesDataModel.dataModel.resolveColumnById(
+ this,
+ "labelValue",
+ nodesDataModel.processedData
+ );
+ const nodeData = nodesDataModel.processedData.dataSources.get(this.id)?.data;
+ if (nodeData) {
+ for (const [datumIndex, datum] of nodeData.entries()) {
+ const id = nodeIdValues[datumIndex];
+ const label = labelValues?.[datumIndex];
+ const nodeDatumIndex = { type: 1 /* Node */, index: datumIndex };
+ processedNodes.set(id, {
+ series: this,
+ itemId: void 0,
+ datum,
+ datumIndex: nodeDatumIndex,
+ type: 1 /* Node */,
+ index: datumIndex,
+ linksBefore: [],
+ linksAfter: [],
+ id,
+ size: 0,
+ label,
+ style: this.getNodeStyle(
+ { datumIndex: nodeDatumIndex, datum, size: 0, label },
+ datumIndex,
+ false
+ )
+ });
+ }
+ }
+ }
+ this.processedNodes = processedNodes;
+ }
+ getNodeGraph(createNode, createLink, { includeCircularReferences }) {
+ const { linksDataModel, linksProcessedData } = this;
+ if (linksDataModel == null || linksProcessedData == null) {
+ const { links: links2, nodeGraph: nodeGraph2, maxPathLength: maxPathLength2 } = computeNodeGraph(
+ (/* @__PURE__ */ new Map()).values(),
+ [],
+ includeCircularReferences
+ );
+ this.nodeCount = 0;
+ this.linkCount = 0;
+ return { nodeGraph: nodeGraph2, links: links2, maxPathLength: maxPathLength2 };
+ }
+ const { sizeKey } = this.properties;
+ const fromIdValues = linksDataModel.resolveColumnById(this, "fromValue", linksProcessedData);
+ const toIdValues = linksDataModel.resolveColumnById(this, "toValue", linksProcessedData);
+ const sizeValues = sizeKey == null ? void 0 : linksDataModel.resolveColumnById(this, "sizeValue", linksProcessedData);
+ const nodesById = /* @__PURE__ */ new Map();
+ for (const datum of this.processedNodes.values()) {
+ const node = createNode(datum);
+ nodesById.set(datum.id, node);
+ }
+ const baseLinks = [];
+ const linkData = linksProcessedData.dataSources.get(this.id)?.data;
+ if (linkData) {
+ for (const [datumIndex, datum] of linkData.entries()) {
+ const fromId = fromIdValues[datumIndex];
+ const toId = toIdValues[datumIndex];
+ const size = sizeValues == null ? 1 : sizeValues[datumIndex];
+ const fromNode = nodesById.get(fromId);
+ const toNode = nodesById.get(toId);
+ if (size <= 0 || fromNode == null || toNode == null)
+ continue;
+ const linkNodeDatumIndex = { type: 0 /* Link */, index: datumIndex };
+ const link = createLink({
+ series: this,
+ itemId: void 0,
+ datum,
+ datumIndex: linkNodeDatumIndex,
+ type: 0 /* Link */,
+ index: datumIndex,
+ fromNode,
+ toNode,
+ size,
+ style: this.getLinkStyle(
+ { datum, datumIndex: linkNodeDatumIndex },
+ fromNode.datumIndex,
+ false
+ )
+ });
+ baseLinks.push(link);
+ }
+ }
+ const { links, nodeGraph, maxPathLength } = computeNodeGraph(
+ nodesById.values(),
+ baseLinks,
+ includeCircularReferences
+ );
+ for (const node of nodeGraph.values()) {
+ node.datum.linksBefore = node.linksBefore.map((linkedNode) => linkedNode.link);
+ node.datum.linksAfter = node.linksAfter.map((linkedNode) => linkedNode.link);
+ }
+ this.nodeCount = nodeGraph.size;
+ this.linkCount = links.length;
+ return { nodeGraph, links, maxPathLength };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update(opts) {
+ const { seriesRect } = opts;
+ const newNodeDataDependencies = {
+ seriesRectWidth: seriesRect?.width ?? 0,
+ seriesRectHeight: seriesRect?.height ?? 0
+ };
+ if (this._nodeDataDependencies == null || this._nodeDataDependencies.seriesRectWidth !== newNodeDataDependencies.seriesRectWidth || this._nodeDataDependencies.seriesRectHeight !== newNodeDataDependencies.seriesRectHeight) {
+ this._nodeDataDependencies = newNodeDataDependencies;
+ }
+ this.updateSelections();
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ if (highlightedDatum?.series === this && highlightedDatum.type == null) {
+ const { itemId } = highlightedDatum;
+ highlightedDatum = itemId == null ? void 0 : nodeData.find((node) => node.type === 1 /* Node */ && node.id === itemId);
+ } else if (highlightedDatum?.series !== this) {
+ highlightedDatum = void 0;
+ }
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = highlightedDatum == null ? 1 : this.properties.highlight.unhighlightedItem.opacity ?? 1;
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection: this.labelSelection });
+ this.updateLabelNodes({ labelSelection: this.labelSelection });
+ this.linkSelection = this.updateLinkSelection({
+ nodeData: nodeData.filter((d) => d.type === 0 /* Link */),
+ datumSelection: this.linkSelection
+ });
+ this.updateLinkNodes({ datumSelection: this.linkSelection, isHighlight: false });
+ this.nodeSelection = this.updateNodeSelection({
+ nodeData: nodeData.filter((d) => d.type === 1 /* Node */),
+ datumSelection: this.nodeSelection
+ });
+ this.updateNodeNodes({ datumSelection: this.nodeSelection, isHighlight: false });
+ let focusLinkSelection;
+ let focusNodeSelection;
+ let highlightLinkSelection;
+ let highlightNodeSelection;
+ if (highlightedDatum?.type === 1 /* Node */) {
+ focusLinkSelection = nodeData.filter((node) => {
+ return node.type === 0 /* Link */ && (node.toNode === highlightedDatum || node.fromNode === highlightedDatum);
+ });
+ focusNodeSelection = focusLinkSelection.map((link) => {
+ return link.fromNode === highlightedDatum ? link.toNode : link.fromNode;
+ });
+ focusNodeSelection.push(highlightedDatum);
+ highlightLinkSelection = [];
+ highlightNodeSelection = [highlightedDatum];
+ } else if (highlightedDatum?.type === 0 /* Link */) {
+ focusLinkSelection = [highlightedDatum];
+ focusNodeSelection = [highlightedDatum.fromNode, highlightedDatum.toNode];
+ highlightLinkSelection = [highlightedDatum];
+ highlightNodeSelection = [];
+ } else {
+ focusLinkSelection = [];
+ focusNodeSelection = [];
+ highlightLinkSelection = [];
+ highlightNodeSelection = [];
+ }
+ this.focusLinkSelection = this.updateLinkSelection({
+ nodeData: focusLinkSelection,
+ datumSelection: this.focusLinkSelection
+ });
+ this.updateLinkNodes({ datumSelection: this.focusLinkSelection, isHighlight: false });
+ this.focusNodeSelection = this.updateNodeSelection({
+ nodeData: focusNodeSelection,
+ datumSelection: this.focusNodeSelection
+ });
+ this.updateNodeNodes({ datumSelection: this.focusNodeSelection, isHighlight: false });
+ this.highlightLinkSelection = this.updateLinkSelection({
+ nodeData: highlightLinkSelection,
+ datumSelection: this.highlightLinkSelection
+ });
+ this.updateLinkNodes({ datumSelection: this.highlightLinkSelection, isHighlight: true });
+ this.highlightNodeSelection = this.updateNodeSelection({
+ nodeData: highlightNodeSelection,
+ datumSelection: this.highlightNodeSelection
+ });
+ this.updateNodeNodes({ datumSelection: this.highlightNodeSelection, isHighlight: true });
+ }
+ resetAnimation(_chartAnimationPhase) {
+ }
+ dataCount() {
+ return Number.NaN;
+ }
+ getSeriesDomain(_direction) {
+ return [];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ legendItemSymbol(_type, nodeIndex, format = {}) {
+ const { fills, strokes } = this.properties;
+ const {
+ fill = fills[nodeIndex % fills.length],
+ fillOpacity = 1,
+ stroke: stroke2 = strokes[nodeIndex % strokes.length],
+ strokeWidth = 0,
+ strokeOpacity = 1,
+ lineDash = [0],
+ lineDashOffset = 0
+ } = format;
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category")
+ return [];
+ const { showInLegend } = this.properties;
+ return Array.from(
+ this.processedNodes.values(),
+ ({ id, label }, nodeIndex) => ({
+ legendType: "category",
+ id: this.id,
+ itemId: id,
+ seriesId: this.id,
+ enabled: true,
+ label: { text: label ?? id },
+ symbol: this.legendItemSymbol(1 /* Node */, nodeIndex),
+ hideInLegend: !showInLegend,
+ isFixed: true
+ })
+ );
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.linkSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ this.nodeSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ getDatumAriaText(datum, description) {
+ if (datum.type === 0 /* Link */) {
+ return this.ctx.localeManager.t("ariaAnnounceFlowProportionLink", {
+ index: datum.index + 1,
+ count: this.linkCount,
+ from: datum.fromNode.id,
+ to: datum.toNode.id,
+ size: datum.size,
+ sizeName: this.properties.sizeName ?? this.properties.sizeKey
+ });
+ } else if (datum.type === 1 /* Node */) {
+ return this.ctx.localeManager.t("ariaAnnounceFlowProportionNode", {
+ index: datum.index + 1,
+ count: this.nodeCount,
+ description
+ });
+ }
+ }
+ pickFocus(opts) {
+ const { datumIndexDelta: childDelta, otherIndexDelta: depthDelta } = opts;
+ const currentNodeDatum = this.contextNodeData?.nodeData[opts.datumIndex - opts.datumIndexDelta];
+ let nextNodeDatum = currentNodeDatum;
+ if (depthDelta !== 0 || childDelta === 0)
+ return;
+ if (currentNodeDatum?.type === 0 /* Link */) {
+ const allLinks = Array.from(this.linkSelection, (link) => link.datum);
+ const selfIndex = allLinks.indexOf(currentNodeDatum);
+ const nextIndex = selfIndex + childDelta;
+ if (nextIndex >= 0 && nextIndex < allLinks.length) {
+ nextNodeDatum = allLinks[nextIndex];
+ } else if (nextIndex > 0) {
+ nextNodeDatum = allLinks.at(-1);
+ } else {
+ const allNodes = Array.from(this.nodeSelection, (node) => node.datum);
+ nextNodeDatum = allNodes.at(-1);
+ }
+ } else if (currentNodeDatum?.type === 1 /* Node */) {
+ const allNodes = Array.from(this.nodeSelection, (node) => node.datum);
+ const selfIndex = allNodes.indexOf(currentNodeDatum);
+ const nextIndex = selfIndex + childDelta;
+ if (nextIndex >= 0 && nextIndex < allNodes.length) {
+ nextNodeDatum = allNodes[nextIndex];
+ } else if (nextIndex < 0) {
+ nextNodeDatum = allNodes[0];
+ } else {
+ const allLinks = Array.from(this.linkSelection, (link) => link.datum);
+ nextNodeDatum = allLinks[0];
+ }
+ }
+ if (nextNodeDatum == null)
+ return;
+ const nodeDatum = nextNodeDatum.type === 1 /* Node */ ? Array.from(this.nodeSelection).find((n) => n.datum === nextNodeDatum) : Array.from(this.linkSelection).find((n) => n.datum === nextNodeDatum);
+ if (nodeDatum == null)
+ return;
+ const bounds = this.computeFocusBounds(nodeDatum.node);
+ if (bounds == null)
+ return;
+ return {
+ datum: nodeDatum.datum,
+ datumIndex: this.contextNodeData?.nodeData.indexOf(nodeDatum.datum) ?? 0,
+ otherIndex: 0,
+ bounds,
+ clipFocusBox: true
+ };
+ }
+ getCategoryValue(_datumIndex) {
+ return;
+ }
+ datumIndexForCategoryValue(_categoryValue) {
+ return;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/chord/chordLink.ts
+var import_ag_charts_community183 = require("ag-charts-community");
+var { Path: Path9, SceneChangeDetection: SceneChangeDetection7 } = import_ag_charts_community183._ModuleSupport;
+function bezierControlPoints({
+ radius,
+ startAngle,
+ endAngle,
+ tension
+}) {
+ const cp0x = radius * Math.cos(startAngle);
+ const cp0y = radius * Math.sin(startAngle);
+ const cp3x = radius * Math.cos(endAngle);
+ const cp3y = radius * Math.sin(endAngle);
+ const cp1x = cp0x * tension;
+ const cp1y = cp0y * tension;
+ const cp2x = cp3x * tension;
+ const cp2y = cp3y * tension;
+ return {
+ x: [cp0x, cp1x, cp2x, cp3x],
+ y: [cp0y, cp1y, cp2y, cp3y]
+ };
+}
+var ChordLink = class extends Path9 {
+ constructor() {
+ super(...arguments);
+ this.centerX = 0;
+ this.centerY = 0;
+ this.radius = 0;
+ this.startAngle1 = 0;
+ this.endAngle1 = 0;
+ this.startAngle2 = 0;
+ this.endAngle2 = 0;
+ this.tension = 1;
+ }
+ tensionedCurveTo(cp0x, cp0y, cp1x, cp1y, cp2x, cp2y, cp3x, cp3y) {
+ const { path, tension } = this;
+ const scale = 1 - tension;
+ path.cubicCurveTo(
+ (cp1x - cp0x) * scale + cp0x,
+ (cp1y - cp0y) * scale + cp0y,
+ (cp2x - cp3x) * scale + cp3x,
+ (cp2y - cp3y) * scale + cp3y,
+ cp3x,
+ cp3y
+ );
+ }
+ updatePath() {
+ const { path, centerX, centerY, radius } = this;
+ let { startAngle1, endAngle1, startAngle2, endAngle2 } = this;
+ if (startAngle1 > startAngle2) {
+ [startAngle1, startAngle2] = [startAngle2, startAngle1];
+ [endAngle1, endAngle2] = [endAngle2, endAngle1];
+ }
+ path.clear();
+ const startX = centerX + radius * Math.cos(startAngle1);
+ const startY = centerY + radius * Math.sin(startAngle1);
+ path.moveTo(startX, startY);
+ this.tensionedCurveTo(
+ startX,
+ startY,
+ centerX,
+ centerY,
+ centerX,
+ centerY,
+ centerX + radius * Math.cos(endAngle2),
+ centerY + radius * Math.sin(endAngle2)
+ );
+ path.arc(centerX, centerY, radius, endAngle2, startAngle2, true);
+ this.tensionedCurveTo(
+ centerX + radius * Math.cos(startAngle2),
+ centerY + radius * Math.sin(startAngle2),
+ centerX,
+ centerY,
+ centerX,
+ centerY,
+ centerX + radius * Math.cos(endAngle1),
+ centerY + radius * Math.sin(endAngle1)
+ );
+ path.arc(centerX, centerY, radius, endAngle1, startAngle1, true);
+ path.closePath();
+ }
+};
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "centerX", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "centerY", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "radius", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "startAngle1", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "endAngle1", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "startAngle2", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "endAngle2", 2);
+__decorateClass([
+ SceneChangeDetection7()
+], ChordLink.prototype, "tension", 2);
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeriesProperties.ts
+var import_ag_charts_community184 = require("ag-charts-community");
+var {
+ FillGradientDefaults: FillGradientDefaults2,
+ FillPatternDefaults: FillPatternDefaults2,
+ FillImageDefaults: FillImageDefaults2,
+ BaseProperties: BaseProperties24,
+ makeSeriesTooltip: makeSeriesTooltip8,
+ SeriesProperties,
+ Property: Property65,
+ Label: Label6
+} = import_ag_charts_community184._ModuleSupport;
+var ChordSeriesLabelProperties = class extends Label6 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.maxWidth = 1;
+ }
+};
+__decorateClass([
+ Property65
+], ChordSeriesLabelProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLabelProperties.prototype, "maxWidth", 2);
+var ChordSeriesLinkProperties = class extends BaseProperties24 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.tension = 0;
+ }
+ getStyle(fills, strokes, index) {
+ const { fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset, tension } = this;
+ const fill = this.fill ?? fills[index % fills.length];
+ const stroke2 = this.stroke ?? strokes[index % fills.length];
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ tension
+ };
+ }
+};
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "fill", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "tension", 2);
+__decorateClass([
+ Property65
+], ChordSeriesLinkProperties.prototype, "itemStyler", 2);
+var ChordSeriesNodeProperties = class extends BaseProperties24 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.width = 1;
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle(fills, strokes, index) {
+ const { fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ const fill = this.fill ?? fills[index % fills.length];
+ const stroke2 = this.stroke ?? strokes[index % fills.length];
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "width", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "fill", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property65
+], ChordSeriesNodeProperties.prototype, "itemStyler", 2);
+var ChordSeriesProperties = class extends SeriesProperties {
+ constructor() {
+ super();
+ this.idKey = "";
+ this.idName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.sizeKey = void 0;
+ this.sizeName = void 0;
+ this.nodes = void 0;
+ this.fillGradientDefaults = new FillGradientDefaults2();
+ this.fillPatternDefaults = new FillPatternDefaults2();
+ this.fillImageDefaults = new FillImageDefaults2();
+ this.fills = [];
+ this.strokes = [];
+ this.label = new ChordSeriesLabelProperties();
+ this.link = new ChordSeriesLinkProperties();
+ this.node = new ChordSeriesNodeProperties();
+ this.tooltip = makeSeriesTooltip8();
+ this.highlightStyle.deprecated = false;
+ }
+};
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "fromKey", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "toKey", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "nodes", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "fillGradientDefaults", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "fillPatternDefaults", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "fillImageDefaults", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "fills", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "link", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "node", 2);
+__decorateClass([
+ Property65
+], ChordSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode6,
+ createDatumId: createDatumId6,
+ angleBetween: angleBetween2,
+ normalizeAngle360: normalizeAngle3604,
+ isBetweenAngles,
+ Sector: Sector3,
+ evaluateBezier,
+ applyShapeStyle: applyShapeStyle7,
+ getShapeStyle,
+ getLabelStyles,
+ BBox: BBox16,
+ mergeDefaults: mergeDefaults10
+} = import_ag_charts_community185._ModuleSupport;
+var nodeMidAngle = (node) => node.startAngle + angleBetween2(node.startAngle, node.endAngle) / 2;
+var ChordSeries = class extends FlowProportionSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode6.NEAREST_NODE, SeriesNodePickMode6.EXACT_SHAPE_MATCH]
+ });
+ this.properties = new ChordSeriesProperties();
+ }
+ isLabelEnabled() {
+ return (this.properties.labelKey != null || this.nodes == null) && this.properties.label.enabled;
+ }
+ linkFactory() {
+ return new ChordLink();
+ }
+ nodeFactory() {
+ return new Sector3();
+ }
+ createNodeData() {
+ const {
+ id: seriesId,
+ _nodeDataDependencies: { seriesRectWidth, seriesRectHeight } = { seriesRectWidth: 0, seriesRectHeight: 0 },
+ properties
+ } = this;
+ const {
+ fromKey,
+ toKey,
+ sizeKey,
+ labelKey,
+ label: { spacing: labelSpacing, maxWidth: labelMaxWidth, fontSize },
+ node: { width: nodeWidth, spacing: nodeSpacing }
+ } = properties;
+ const centerX = seriesRectWidth / 2;
+ const centerY = seriesRectHeight / 2;
+ let labelData = [];
+ const { nodeGraph, links } = this.getNodeGraph(
+ (node) => ({
+ ...node,
+ centerX,
+ centerY,
+ innerRadius: Number.NaN,
+ outerRadius: Number.NaN,
+ startAngle: Number.NaN,
+ endAngle: Number.NaN
+ }),
+ (link) => ({
+ ...link,
+ centerX,
+ centerY,
+ radius: Number.NaN,
+ startAngle1: Number.NaN,
+ endAngle1: Number.NaN,
+ startAngle2: Number.NaN,
+ endAngle2: Number.NaN
+ }),
+ { includeCircularReferences: true }
+ );
+ let totalSize = 0;
+ for (const [id, { datum: node, linksBefore, linksAfter }] of nodeGraph.entries()) {
+ const size = linksBefore.reduce((acc, { link }) => acc + link.size, 0) + linksAfter.reduce((acc, { link }) => acc + link.size, 0);
+ if (size === 0) {
+ nodeGraph.delete(id);
+ } else {
+ const { label } = properties;
+ node.size = size;
+ totalSize += node.size;
+ const labelText = label.enabled ? this.getLabelText(
+ node.label,
+ node.datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ { datum: node.datum, value: node.label, fromKey, toKey, sizeKey, size: node.size }
+ ) : void 0;
+ node.label = (0, import_ag_charts_core80.toPlainText)(labelText);
+ }
+ }
+ let labelInset = 0;
+ if (this.isLabelEnabled()) {
+ const measurer2 = (0, import_ag_charts_core80.cachedTextMeasurer)(this.properties.label);
+ let maxMeasuredLabelWidth = 0;
+ for (const { datum: node } of nodeGraph.values()) {
+ const { id, label } = node;
+ if (label == null)
+ continue;
+ const text2 = (0, import_ag_charts_core80.wrapText)(label, {
+ maxWidth: labelMaxWidth,
+ font: this.properties.label,
+ textWrap: "never"
+ });
+ const { width } = measurer2.measureLines(text2);
+ maxMeasuredLabelWidth = Math.max(width, maxMeasuredLabelWidth);
+ labelData.push({
+ id,
+ text: text2,
+ centerX,
+ centerY,
+ angle: Number.NaN,
+ radius: Number.NaN,
+ size: node.size
+ });
+ }
+ labelInset = maxMeasuredLabelWidth + labelSpacing;
+ }
+ const nodeCount = nodeGraph.size;
+ let radius = Math.min(seriesRectWidth, seriesRectHeight) / 2 - nodeWidth - labelInset;
+ let spacingSweep = nodeSpacing / radius;
+ if (labelInset !== 0 && (nodeCount * spacingSweep >= 1.5 * Math.PI || radius <= 0)) {
+ labelData = [];
+ radius = Math.min(seriesRectWidth, seriesRectHeight) / 2 - nodeWidth;
+ spacingSweep = nodeSpacing / radius;
+ }
+ if (nodeCount * spacingSweep >= 2 * Math.PI || radius <= 0) {
+ import_ag_charts_core80.Logger.warnOnce("There was insufficient space to display the Chord Series.");
+ return;
+ }
+ const innerRadius = radius;
+ const outerRadius = radius + nodeWidth;
+ const sizeScale = Math.max((2 * Math.PI - nodeCount * spacingSweep) / totalSize, 0);
+ let nodeAngle = 0;
+ for (const { datum: node } of nodeGraph.values()) {
+ node.innerRadius = innerRadius;
+ node.outerRadius = outerRadius;
+ node.startAngle = nodeAngle;
+ node.endAngle = nodeAngle + node.size * sizeScale;
+ nodeAngle = node.endAngle + spacingSweep;
+ const midR = (node.innerRadius + node.outerRadius) / 2;
+ const midAngle = nodeMidAngle(node);
+ node.midPoint = {
+ x: node.centerX + midR * Math.cos(midAngle),
+ y: node.centerY + midR * Math.sin(midAngle)
+ };
+ }
+ const nodeData = [];
+ for (const { datum: node, linksBefore, linksAfter } of nodeGraph.values()) {
+ const midAngle = nodeMidAngle(node);
+ const combinedLinks = [
+ ...linksBefore.map((l) => ({
+ link: l.link,
+ distance: angleBetween2(nodeMidAngle(l.node.datum), midAngle),
+ after: false
+ })),
+ ...linksAfter.map((l) => ({
+ link: l.link,
+ distance: angleBetween2(nodeMidAngle(l.node.datum), midAngle),
+ after: true
+ }))
+ ];
+ let linkAngle = node.startAngle;
+ for (const { link, after } of combinedLinks.toSorted((a, b) => a.distance - b.distance)) {
+ const linkSweep = link.size * sizeScale;
+ if (after) {
+ link.startAngle1 = linkAngle;
+ link.endAngle1 = linkAngle + linkSweep;
+ } else {
+ link.startAngle2 = linkAngle;
+ link.endAngle2 = linkAngle + linkSweep;
+ }
+ linkAngle += link.size * sizeScale;
+ }
+ nodeData.push(node);
+ }
+ const { tension } = this.properties.link;
+ for (const link of links) {
+ link.radius = radius;
+ const outer = bezierControlPoints({
+ radius,
+ startAngle: link.startAngle1,
+ endAngle: link.endAngle2,
+ tension
+ });
+ const inner = bezierControlPoints({
+ radius,
+ startAngle: link.startAngle2,
+ endAngle: link.endAngle1,
+ tension
+ });
+ const outerX = evaluateBezier(...outer.x, 0.5);
+ const outerY = evaluateBezier(...outer.y, 0.5);
+ const innerX = evaluateBezier(...inner.x, 0.5);
+ const innerY = evaluateBezier(...inner.y, 0.5);
+ link.midPoint = {
+ x: link.centerX + (outerX + innerX) / 2,
+ y: link.centerY + (outerY + innerY) / 2
+ };
+ nodeData.push(link);
+ }
+ for (const label of labelData) {
+ const node = nodeGraph.get(label.id)?.datum;
+ if (node == null)
+ continue;
+ label.radius = outerRadius + labelSpacing;
+ label.angle = normalizeAngle3604(node.startAngle + angleBetween2(node.startAngle, node.endAngle) / 2);
+ }
+ labelData.sort((a, b) => a.angle - b.angle);
+ let minAngle = Infinity;
+ let maxAngle = -Infinity;
+ labelData = labelData.filter((label) => {
+ const labelHeight = (0, import_ag_charts_core80.calcLineHeight)(fontSize);
+ const da = Math.atan2(labelHeight / 2, label.radius);
+ const a0 = label.angle - da;
+ const a1 = label.angle + da;
+ if (isBetweenAngles(minAngle, a0, a1))
+ return false;
+ if (isBetweenAngles(maxAngle, a0, a1))
+ return false;
+ minAngle = Math.min(a0, minAngle);
+ maxAngle = Math.max(a1, maxAngle);
+ return true;
+ });
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateLabelSelection(opts) {
+ const labels = this.isLabelEnabled() ? opts.labelData : [];
+ return opts.labelSelection.update(labels);
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ toKey: this.properties.toKey,
+ fromKey: this.properties.fromKey,
+ sizeKey: this.properties.sizeKey,
+ size: Number.NaN
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { size, text: text2, centerX, centerY, radius, angle }) => {
+ params.size = size;
+ const style = getLabelStyles(this, void 0, params, this.properties.label, false, activeHighlight);
+ const { fontStyle, fontWeight, fontSize, fontFamily, color: fill } = style;
+ label.visible = true;
+ label.translationX = centerX + radius * Math.cos(angle);
+ label.translationY = centerY + radius * Math.sin(angle);
+ label.text = text2;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textBaseline = "middle";
+ if (Math.cos(angle) >= 0) {
+ label.textAlign = "left";
+ label.rotation = angle;
+ } else {
+ label.textAlign = "right";
+ label.rotation = angle - Math.PI;
+ }
+ label.setBoxing(style);
+ });
+ }
+ updateNodeSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId6(datum.type, datum.id));
+ }
+ getNodeStyle(nodeDatum, fromNodeDatumIndex, isHighlight) {
+ const { properties } = this;
+ const { fills, strokes, fillGradientDefaults: fillGradientDefaults3, fillPatternDefaults: fillPatternDefaults3, fillImageDefaults: fillImageDefaults3 } = properties;
+ const { itemStyler } = properties.node;
+ const highlightStyle = this.getHighlightStyle(isHighlight, nodeDatum.datumIndex);
+ const baseStyle = mergeDefaults10(highlightStyle, properties.node.getStyle(fills, strokes, fromNodeDatumIndex));
+ let style = getShapeStyle(baseStyle, fillGradientDefaults3, fillPatternDefaults3, fillImageDefaults3);
+ if (itemStyler != null && nodeDatum.datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId6(nodeDatum.datumIndex.index, "node", isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = getShapeStyle(
+ mergeDefaults10(overrides, style),
+ fillGradientDefaults3,
+ fillPatternDefaults3,
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ makeItemStylerParams({ datum, datumIndex, size = 0, label }, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ size,
+ label,
+ fill
+ };
+ }
+ updateNodeNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((sector, datum) => {
+ const { datumIndex } = datum;
+ const style = this.getNodeStyle(datum, datumIndex.index, isHighlight);
+ applyShapeStyle7(sector, style, fillBBox);
+ sector.centerX = datum.centerX;
+ sector.centerY = datum.centerY;
+ sector.innerRadius = datum.innerRadius;
+ sector.outerRadius = datum.outerRadius;
+ sector.startAngle = datum.startAngle;
+ sector.endAngle = datum.endAngle;
+ sector.inset = sector.strokeWidth / 2;
+ });
+ }
+ updateLinkSelection(opts) {
+ return opts.datumSelection.update(
+ opts.nodeData,
+ void 0,
+ (datum) => createDatumId6(datum.type, datum.index, datum.fromNode.id, datum.toNode.id)
+ );
+ }
+ getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, isHighlight) {
+ const { id: seriesId, properties } = this;
+ const { fills, strokes, fillGradientDefaults: fillGradientDefaults3, fillPatternDefaults: fillPatternDefaults3, fillImageDefaults: fillImageDefaults3 } = properties;
+ const { itemStyler } = properties.link;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults10(
+ highlightStyle,
+ properties.link.getStyle(fills, strokes, fromNodeDatumIndex.index)
+ );
+ let style = getShapeStyle(baseStyle, fillGradientDefaults3, fillPatternDefaults3, fillImageDefaults3);
+ if (itemStyler != null && datumIndex != null) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const overrides = this.cachedDatumCallback(
+ createDatumId6(datumIndex.index, "link", isHighlight ? "highlight" : "node"),
+ () => {
+ const highlightState = this.getHighlightStateString(
+ activeHighlight,
+ isHighlight,
+ fromNodeDatumIndex
+ );
+ return this.callWithContext(itemStyler, {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style
+ });
+ }
+ );
+ if (overrides) {
+ style = getShapeStyle(
+ mergeDefaults10(overrides, style),
+ fillGradientDefaults3,
+ fillPatternDefaults3,
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ updateLinkNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((link, datum) => {
+ const fromNodeDatumIndex = datum.fromNode.datumIndex;
+ const style = this.getLinkStyle(datum, fromNodeDatumIndex, isHighlight);
+ link.centerX = datum.centerX;
+ link.centerY = datum.centerY;
+ link.radius = datum.radius;
+ link.startAngle1 = datum.startAngle1;
+ link.endAngle1 = datum.endAngle1;
+ link.startAngle2 = datum.startAngle2;
+ link.endAngle2 = datum.endAngle2;
+ link.tension = style.tension;
+ applyShapeStyle7(link, style, fillBBox);
+ });
+ }
+ getShapeFillBBox() {
+ const width = this._nodeDataDependencies?.seriesRectWidth ?? 0;
+ const height = this._nodeDataDependencies?.seriesRectHeight ?? 0;
+ const size = Math.min(width, height);
+ const x = (width - size) / 2;
+ const y = (height - size) / 2;
+ const bbox = new BBox16(x, y, width, height);
+ return { series: bbox, axis: bbox };
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ linksProcessedData,
+ nodesProcessedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const { fromKey, toKey, sizeKey, sizeName, tooltip } = properties;
+ const seriesDatum = this.contextNodeData?.nodeData.find(
+ (d) => d.datumIndex.type === datumIndex.type && d.datumIndex.index === datumIndex.index
+ );
+ if (seriesDatum == null)
+ return;
+ const nodeIndex = seriesDatum.type === 0 /* Link */ ? seriesDatum.fromNode.index : seriesDatum.index;
+ const title = seriesDatum.type === 0 /* Link */ ? `${seriesDatum.fromNode.label} - ${seriesDatum.toNode.label}` : seriesDatum.label;
+ const datum = datumIndex.type === 0 /* Link */ ? linksProcessedData?.dataSources.get(this.id)?.data[datumIndex.index] : nodesProcessedData?.dataSources.get(this.id)?.data[datumIndex.index];
+ const size = seriesDatum.size;
+ let format;
+ if (seriesDatum.type === 0 /* Link */) {
+ const fromNodeDatumIndex = seriesDatum.fromNode.datumIndex;
+ format = this.getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, false);
+ } else {
+ const label = seriesDatum.label;
+ format = this.getNodeStyle({ datumIndex, datum, size, label }, datumIndex.index, false);
+ }
+ const data = [];
+ if (sizeKey != null) {
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: size,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain: [],
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(size) });
+ }
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title,
+ symbol: this.legendItemSymbol(seriesDatum.type, nodeIndex, format),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ fromKey,
+ toKey,
+ sizeKey,
+ sizeName,
+ size,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(node) {
+ return node;
+ }
+ hasItemStylers() {
+ return this.properties.node.itemStyler != null || this.properties.link.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+ChordSeries.className = "ChordSeries";
+ChordSeries.type = "chord";
+
+// packages/ag-charts-enterprise/src/series/chord/chordSeriesOptionsDef.ts
+var import_ag_charts_community186 = require("ag-charts-community");
+var import_ag_charts_core81 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs8, chordSeriesThemeableOptionsDef } = import_ag_charts_community186._ModuleSupport;
+var chordSeriesOptionsDef = {
+ ...chordSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs8,
+ type: (0, import_ag_charts_core81.required)((0, import_ag_charts_core81.constant)("chord")),
+ fromKey: (0, import_ag_charts_core81.required)(import_ag_charts_core81.string),
+ toKey: (0, import_ag_charts_core81.required)(import_ag_charts_core81.string),
+ sizeKey: import_ag_charts_core81.string,
+ sizeName: import_ag_charts_core81.string
+};
+chordSeriesOptionsDef.fillGradientDefaults = (0, import_ag_charts_core81.undocumented)(import_ag_charts_core81.fillGradientDefaults);
+chordSeriesOptionsDef.fillPatternDefaults = (0, import_ag_charts_core81.undocumented)(import_ag_charts_core81.fillPatternDefaults);
+chordSeriesOptionsDef.fillImageDefaults = (0, import_ag_charts_core81.undocumented)(import_ag_charts_core81.fillImageDefaults);
+
+// packages/ag-charts-enterprise/src/series/chord/chordModule.ts
+var ChordModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ solo: true,
+ identifier: "chord",
+ moduleFactory: (ctx) => new ChordSeries(ctx),
+ themeTemplate: {
+ series: {
+ fills: { $palette: "fills" },
+ strokes: { $palette: "strokes" },
+ // @ts-expect-error undocumented option
+ fillGradientDefaults: import_ag_charts_community187._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS,
+ fillPatternDefaults: import_ag_charts_community187._ModuleSupport.FILL_PATTERN_DEFAULTS,
+ fillImageDefaults: import_ag_charts_community187._ModuleSupport.FILL_IMAGE_DEFAULTS,
+ highlightStyle: {
+ series: {
+ dimOpacity: 0.2
+ }
+ },
+ highlight: import_ag_charts_community187._ModuleSupport.singleSeriesHighlightStyle(),
+ label: {
+ ...import_ag_charts_community187._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ spacing: 5,
+ maxWidth: 100
+ },
+ node: {
+ spacing: 8,
+ width: 10,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ link: {
+ fillOpacity: 0.5,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ tension: 0.4
+ }
+ },
+ legend: {
+ enabled: false,
+ toggleSeries: false
+ }
+ }
+};
+var ChordSeriesModule = {
+ type: "series",
+ name: "chord",
+ chartType: "standalone",
+ enterprise: true,
+ options: chordSeriesOptionsDef,
+ create: (ctx) => new ChordSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelThemes.ts
+var import_ag_charts_community188 = require("ag-charts-community");
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE7, CARTESIAN_POSITION: CARTESIAN_POSITION5 },
+ ThemeSymbols: { DEFAULT_SHADOW_COLOUR }
+} = import_ag_charts_community188._ModuleSupport;
+var isHorizontal = { $eq: [{ $path: ["/series/0/direction", void 0] }, "horizontal"] };
+var labelOptions = {
+ autoRotate: { $path: "/series/0/stageLabel/autoRotate" },
+ autoRotateAngle: { $path: "/series/0/stageLabel/autoRotateAngle" },
+ avoidCollisions: { $path: ["/series/0/stageLabel/avoidCollisions", true] },
+ border: { $path: ["/series/0/stageLabel/border"] },
+ color: { $path: ["/series/0/stageLabel/color", { $ref: "textColor" }] },
+ cornerRadius: { $path: ["/series/0/stageLabel/cornerRadius"] },
+ enabled: {
+ $if: [
+ { $eq: [{ $path: "/series/0/stageLabel/enabled" }, void 0] },
+ true,
+ { $path: "/series/0/stageLabel/enabled" }
+ ]
+ },
+ fill: { $path: ["/series/0/stageLabel/fill"] },
+ fillOpacity: { $path: ["/series/0/stageLabel/fillOpacity"] },
+ fontSize: { $path: ["/series/0/stageLabel/fontSize", { $ref: "fontSize" }] },
+ fontStyle: { $path: ["/series/0/stageLabel/fontStyle", { $ref: "fontStyle" }] },
+ fontWeight: { $path: ["/series/0/stageLabel/fontWeight", { $ref: "fontWeight" }] },
+ format: { $path: "/series/0/stageLabel/format" },
+ formatter: { $path: "/series/0/stageLabel/formatter" },
+ itemStyler: { $path: "/series/0/stageLabel/itemStyler" },
+ minSpacing: { $path: "/series/0/stageLabel/minSpacing" },
+ padding: { $path: ["/series/0/stageLabel/padding"] },
+ rotation: { $path: ["/series/0/stageLabel/rotation", 0] }
+};
+var FUNNEL_SERIES_AXES = [
+ {
+ type: {
+ $if: [isHorizontal, CARTESIAN_AXIS_TYPE7.NUMBER, CARTESIAN_AXIS_TYPE7.CATEGORY]
+ },
+ position: {
+ $if: [
+ isHorizontal,
+ CARTESIAN_POSITION5.LEFT,
+ {
+ $if: [
+ { $eq: [{ $path: ["/series/0/stageLabel/placement", void 0] }, "after"] },
+ CARTESIAN_POSITION5.RIGHT,
+ CARTESIAN_POSITION5.LEFT
+ ]
+ }
+ ]
+ },
+ label: {
+ $if: [isHorizontal, void 0, labelOptions]
+ }
+ },
+ {
+ type: {
+ $if: [isHorizontal, CARTESIAN_AXIS_TYPE7.CATEGORY, CARTESIAN_AXIS_TYPE7.NUMBER]
+ },
+ position: {
+ $if: [
+ isHorizontal,
+ {
+ $if: [
+ { $eq: [{ $path: ["/series/0/stageLabel/placement", void 0] }, "before"] },
+ CARTESIAN_POSITION5.TOP,
+ CARTESIAN_POSITION5.BOTTOM
+ ]
+ },
+ CARTESIAN_POSITION5.BOTTOM
+ ]
+ },
+ label: {
+ $if: [isHorizontal, labelOptions, void 0]
+ }
+ }
+];
+var FUNNEL_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ spacingRatio: 0.25,
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ [{ $path: ["/0", void 0, { $palette: "fills" }] }],
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", import_ag_charts_community188._ModuleSupport.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],
+ ["pattern", import_ag_charts_community188._ModuleSupport.FILL_PATTERN_SINGLE_DEFAULTS],
+ ["image", import_ag_charts_community188._ModuleSupport.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ [{ $path: ["/0", void 0, { $palette: "strokes" }] }]
+ ]
+ },
+ label: {
+ ...import_ag_charts_community188._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" }
+ },
+ dropOff: {
+ enabled: true,
+ fillOpacity: 0.2,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ shadow: {
+ enabled: false,
+ color: DEFAULT_SHADOW_COLOUR,
+ xOffset: 3,
+ yOffset: 3,
+ blur: 5
+ },
+ highlight: import_ag_charts_community188._ModuleSupport.singleSeriesHighlightStyle()
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE7.NUMBER]: {
+ nice: false,
+ gridLine: {
+ enabled: false
+ },
+ crosshair: {
+ enabled: false
+ },
+ label: {
+ enabled: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE7.CATEGORY]: {
+ line: {
+ enabled: false
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelSeries.ts
+var import_ag_charts_community193 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/funnel/baseFunnelSeries.ts
+var import_ag_charts_community191 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelConnector.ts
+var import_ag_charts_community189 = require("ag-charts-community");
+var { lineDistanceSquared, BBox: BBox17, Path: Path10, SceneChangeDetection: SceneChangeDetection8 } = import_ag_charts_community189._ModuleSupport;
+var delta = 1e-6;
+function pointsEq([ax, ay], [bx, by]) {
+ return Math.abs(ax - bx) <= delta && Math.abs(ay - by) <= delta;
+}
+var FunnelConnector = class extends Path10 {
+ constructor() {
+ super(...arguments);
+ this.x0 = 0;
+ this.y0 = 0;
+ this.x1 = 0;
+ this.y1 = 0;
+ this.x2 = 0;
+ this.y2 = 0;
+ this.x3 = 0;
+ this.y3 = 0;
+ }
+ get midPoint() {
+ const { x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ return {
+ x: (x0 + x1 + x2 + x3) / 4,
+ y: (y0 + y1 + y2 + y3) / 4
+ };
+ }
+ distanceSquared(x, y) {
+ if (this.containsPoint(x, y))
+ return 0;
+ const { x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ return Math.min(
+ lineDistanceSquared(x, y, x0, y0, x1, y1, Infinity),
+ lineDistanceSquared(x, y, x1, y1, x2, y2, Infinity),
+ lineDistanceSquared(x, y, x2, y2, x3, y3, Infinity),
+ lineDistanceSquared(x, y, x3, y3, x0, y0, Infinity)
+ );
+ }
+ computeBBox() {
+ const { x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ const x = Math.min(x0, x1, x2, x3);
+ const width = Math.max(x0, x1, x2, x3) - x;
+ const y = Math.min(y0, y1, y2, y3);
+ const height = Math.max(y0, y1, y2, y3) - y;
+ return new BBox17(x, y, width, height);
+ }
+ updatePath() {
+ const { path, x0, y0, x1, y1, x2, y2, x3, y3 } = this;
+ const points = [
+ [x0, y0],
+ [x1, y1],
+ [x2, y2],
+ [x3, y3]
+ ];
+ path.clear();
+ let start;
+ let current;
+ for (const p of points) {
+ if (start != null && pointsEq(start, p) || current != null && pointsEq(current, p)) {
+ continue;
+ }
+ const [x, y] = p;
+ if (start == null) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ start ?? (start = p);
+ current = p;
+ }
+ path.closePath();
+ }
+};
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "x0", 2);
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "y0", 2);
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "x1", 2);
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "y1", 2);
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "x2", 2);
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "y2", 2);
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "x3", 2);
+__decorateClass([
+ SceneChangeDetection8()
+], FunnelConnector.prototype, "y3", 2);
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelUtil.ts
+var import_ag_charts_community190 = require("ag-charts-community");
+var { NODE_UPDATE_STATE_TO_PHASE_MAPPING } = import_ag_charts_community190._ModuleSupport;
+function connectorStartingPosition(datum, _prevDatum, isVertical, _mode) {
+ const { x0, y0, x1, y1, x2, y2, x3, y3, opacity } = datum;
+ if (isVertical) {
+ return {
+ x0: (x0 + x3) / 2,
+ y0: (y0 + y3) / 2,
+ x1: (x1 + x2) / 2,
+ y1: (y1 + y2) / 2,
+ x2: (x1 + x2) / 2,
+ y2: (y1 + y2) / 2,
+ x3: (x0 + x3) / 2,
+ y3: (y0 + y3) / 2,
+ opacity
+ };
+ } else {
+ return {
+ x0: (x0 + x1) / 2,
+ y0: (y0 + y1) / 2,
+ x1: (x0 + x1) / 2,
+ y1: (y0 + y1) / 2,
+ x2: (x2 + x3) / 2,
+ y2: (y2 + y3) / 2,
+ x3: (x2 + x3) / 2,
+ y3: (y2 + y3) / 2,
+ opacity
+ };
+ }
+}
+function prepareConnectorAnimationFunctions(isVertical, mode) {
+ const isRemoved = (datum) => datum == null;
+ const fromFn = (connector, datum, status) => {
+ if (status === "updated" && isRemoved(datum)) {
+ status = "removed";
+ } else if (status === "updated" && isRemoved(connector.previousDatum)) {
+ status = "added";
+ }
+ let source;
+ if (status === "added" && connector.previousDatum == null && mode === "fade") {
+ source = { ...resetConnectorSelectionsFn(connector, datum), opacity: 0 };
+ } else if (status === "unknown" || status === "added") {
+ source = connectorStartingPosition(datum, connector.previousDatum, isVertical, mode);
+ } else {
+ source = {
+ x0: connector.x0,
+ y0: connector.y0,
+ x1: connector.x1,
+ y1: connector.y1,
+ x2: connector.x2,
+ y2: connector.y2,
+ x3: connector.x3,
+ y3: connector.y3,
+ opacity: connector.opacity
+ };
+ }
+ const phase = NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return { ...source, phase };
+ };
+ const toFn = (connector, datum, status) => {
+ let source;
+ if (status === "removed" && connector.datum == null && mode === "fade") {
+ source = { ...resetConnectorSelectionsFn(connector, datum), opacity: 0 };
+ } else if (status === "removed" || isRemoved(datum)) {
+ source = connectorStartingPosition(datum, connector.previousDatum, isVertical, mode);
+ } else {
+ source = resetConnectorSelectionsFn(connector, datum);
+ }
+ return source;
+ };
+ return { fromFn, toFn };
+}
+function resetConnectorSelectionsFn(_node, datum) {
+ const { x0, y0, x1, y1, x2, y2, x3, y3, opacity } = datum;
+ return { x0, y0, x1, y1, x2, y2, x3, y3, opacity };
+}
+
+// packages/ag-charts-enterprise/src/series/funnel/baseFunnelSeries.ts
+var {
+ SeriesNodePickMode: SeriesNodePickMode7,
+ SeriesZIndexMap,
+ valueProperty: valueProperty11,
+ keyProperty: keyProperty8,
+ ChartAxisDirection: ChartAxisDirection25,
+ updateLabelNode: updateLabelNode5,
+ SMALLEST_KEY_INTERVAL: SMALLEST_KEY_INTERVAL4,
+ LARGEST_KEY_INTERVAL: LARGEST_KEY_INTERVAL2,
+ diff: diff5,
+ fixNumericExtent: fixNumericExtent7,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation4,
+ resetMotion: resetMotion2,
+ resetLabelFn: resetLabelFn4,
+ animationValidation: animationValidation6,
+ computeBarFocusBounds: computeBarFocusBounds6,
+ ContinuousScale: ContinuousScale7,
+ Group: Group10,
+ Selection: Selection6,
+ PointerEvents: PointerEvents4,
+ motion: motion4,
+ checkCrisp: checkCrisp3,
+ createDatumId: createDatumId7,
+ applyShapeStyle: applyShapeStyle8
+} = import_ag_charts_community191._ModuleSupport;
+var FunnelSeriesNodeEvent = class extends import_ag_charts_community191._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.xKey = series.properties.stageKey;
+ this.yKey = series.properties.valueKey;
+ }
+};
+var BaseFunnelSeries = class extends import_ag_charts_community191._ModuleSupport.AbstractBarSeries {
+ constructor({
+ moduleCtx,
+ animationResetFns
+ }) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode7.AXIS_ALIGNED, SeriesNodePickMode7.EXACT_SHAPE_MATCH],
+ propertyKeys: {
+ x: ["stageKey"],
+ y: ["valueKey"]
+ },
+ propertyNames: {
+ x: [],
+ y: []
+ },
+ categoryKey: "xValue",
+ datumSelectionGarbageCollection: false,
+ animationResetFns: {
+ datum: animationResetFns.datum,
+ label: resetLabelFn4
+ }
+ });
+ // @ts-expect-error xKey/yKey renamed
+ this.NodeEvent = FunnelSeriesNodeEvent;
+ this.connectorNodeGroup = this.contentGroup.appendChild(
+ new Group10({
+ name: `${this.id}-series-connectorNodes`,
+ zIndex: SeriesZIndexMap.BACKGROUND
+ })
+ );
+ this.connectorSelection = Selection6.select(
+ this.connectorNodeGroup,
+ () => this.connectionFactory()
+ );
+ this.connectorNodeGroup.pointerEvents = PointerEvents4.None;
+ }
+ get pickModeAxis() {
+ return "main-category";
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.connectorNodeGroup.zIndex = [SeriesZIndexMap.BACKGROUND, zIndex];
+ return true;
+ }
+ isVertical() {
+ return !super.isVertical();
+ }
+ connectionFactory() {
+ return new FunnelConnector();
+ }
+ async processData(dataController) {
+ const { stageKey, valueKey } = this.properties;
+ const { visible, id: seriesId } = this;
+ const validation = (_value, _datum, index) => visible && this.ctx.legendManager.getItemEnabled({ seriesId, itemId: index });
+ const xScale = this.getCategoryAxis()?.scale;
+ const yScale = this.getValueAxis()?.scale;
+ const { isContinuousX, xScaleType, yScaleType } = this.getScaleInformation({ xScale, yScale });
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ if (this.processedData) {
+ extraProps.push(diff5(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation6());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const { processedData } = await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty8(stageKey, xScaleType, { id: "xValue" }),
+ valueProperty11(valueKey, yScaleType, { id: `yValue`, ...visibleProps, validation, invalidValue: 0 }),
+ ...isContinuousX ? [SMALLEST_KEY_INTERVAL4, LARGEST_KEY_INTERVAL2] : [],
+ ...extraProps
+ ],
+ groupByKeys: false
+ });
+ this.smallestDataInterval = processedData.reduced?.smallestKeyInterval;
+ this.largestDataInterval = processedData.reduced?.largestKeyInterval;
+ this.animationState.transition("updateData");
+ }
+ getSeriesDomain(direction) {
+ const {
+ processedData,
+ dataModel,
+ id: seriesId,
+ ctx: { legendManager }
+ } = this;
+ if (!processedData || !dataModel)
+ return [];
+ const {
+ keys: [keys]
+ } = processedData.domain;
+ if (direction === this.getCategoryDirection()) {
+ const keyDef = dataModel.resolveProcessedDataDefById(this, `xValue`);
+ if (keyDef?.def.type === "key" && keyDef?.def.valueType === "category") {
+ if (!this.hasData)
+ return [];
+ return keys.filter((_key, index) => legendManager.getItemEnabled({ seriesId, itemId: index }));
+ }
+ return this.padBandExtent(keys);
+ } else {
+ const yExtent = this.domainForClippedRange(direction, ["yValue"], "xValue");
+ const maxExtent = Math.max(...yExtent);
+ const fixedYExtent = [-maxExtent, maxExtent];
+ return fixNumericExtent7(fixedYExtent);
+ }
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ createNodeData() {
+ const {
+ hasData,
+ data,
+ dataModel,
+ groupScale,
+ processedData,
+ id: seriesId,
+ ctx: { legendManager }
+ } = this;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!(hasData && data && xAxis && yAxis && dataModel && processedData?.type === "ungrouped")) {
+ return;
+ }
+ const xScale = xAxis.scale;
+ const yScale = yAxis.scale;
+ const barAlongX = this.getBarDirection() === ChartAxisDirection25.X;
+ const { stageKey, valueKey } = this.properties;
+ const itemId = `${valueKey}`;
+ const context = {
+ itemId,
+ nodeData: [],
+ labelData: [],
+ connectorData: [],
+ scales: this.calculateScaling(),
+ groupScale: this.getScaling(this.groupScale),
+ visible: this.visible
+ };
+ const isVisible = this.visible;
+ if (!isVisible)
+ return context;
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ const yValues = dataModel.resolveColumnById(this, `yValue`, processedData);
+ const { barWidth, groupIndex } = this.updateGroupScale(xAxis);
+ const barOffset = ContinuousScale7.is(xScale) ? barWidth * -0.5 : 0;
+ const crisp = checkCrisp3(
+ xAxis?.scale,
+ xAxis?.visibleRange,
+ this.smallestDataInterval,
+ this.largestDataInterval
+ );
+ let previousConnection;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const visible = isVisible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex });
+ const xDatum = xValues[datumIndex];
+ if (xDatum == null)
+ continue;
+ const x = Math.round(xScale.convert(xDatum)) + groupScale.convert(String(groupIndex)) + barOffset;
+ const yDatum = yValues[datumIndex];
+ const yNegative = Math.round(yScale.convert(-yDatum));
+ const yPositive = Math.round(yScale.convert(yDatum));
+ const style = this.getItemStyle({ datum, datumIndex }, false);
+ const barHeight = Math.max(style.strokeWidth ?? 0, Math.abs(yPositive - yNegative));
+ const rect = {
+ x: barAlongX ? Math.min(yPositive, yNegative) : x,
+ y: barAlongX ? x : Math.min(yPositive, yNegative),
+ width: barAlongX ? barHeight : barWidth,
+ height: barAlongX ? barWidth : barHeight
+ };
+ const nodeMidPoint = {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2
+ };
+ const labelData = this.createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yDatum,
+ datum,
+ visible
+ });
+ const nodeDatum = {
+ index: datumIndex,
+ series: this,
+ itemId,
+ datum,
+ datumIndex,
+ xValue: xDatum,
+ yValue: yDatum,
+ xKey: stageKey,
+ yKey: valueKey,
+ x: rect.x,
+ y: rect.y,
+ width: rect.width,
+ height: rect.height,
+ midPoint: nodeMidPoint,
+ crisp,
+ label: labelData,
+ visible
+ };
+ context.nodeData.push(nodeDatum);
+ if (labelData != null) {
+ context.labelData.push(labelData);
+ }
+ if (previousConnection != null) {
+ const prevRect = previousConnection.rect;
+ const startNodeDatum = previousConnection.nodeDatum;
+ const startDatumIndex = previousConnection.datumIndex;
+ if (barAlongX) {
+ context.connectorData.push({
+ datum: startNodeDatum,
+ datumIndex: startDatumIndex,
+ x0: prevRect.x,
+ y0: prevRect.y + prevRect.height,
+ x1: prevRect.x + prevRect.width,
+ y1: prevRect.y + prevRect.height,
+ x2: rect.x + rect.width,
+ y2: rect.y,
+ x3: rect.x,
+ y3: rect.y,
+ opacity: 1
+ });
+ } else {
+ context.connectorData.push({
+ datum: startNodeDatum,
+ datumIndex: startDatumIndex,
+ x0: prevRect.x + prevRect.width,
+ y0: prevRect.y,
+ x1: rect.x,
+ y1: rect.y,
+ x2: rect.x,
+ y2: rect.y + rect.height,
+ x3: prevRect.x + prevRect.width,
+ y3: prevRect.y + prevRect.height,
+ opacity: 1
+ });
+ }
+ }
+ if (visible) {
+ previousConnection = {
+ itemId,
+ rect,
+ nodeDatum,
+ datumIndex
+ };
+ }
+ }
+ return context;
+ }
+ updateNodes(seriesHighlighted, nodeRefresh) {
+ super.updateNodes(seriesHighlighted, nodeRefresh);
+ const { connectorSelection } = this;
+ const connectorData = this.contextNodeData?.connectorData ?? [];
+ this.connectorSelection = this.updateConnectorSelection({ connectorSelection, connectorData });
+ this.updateConnectorNodes({ connectorSelection });
+ }
+ updateDatumSelection(opts) {
+ const { nodeData, datumSelection } = opts;
+ const data = nodeData ?? [];
+ return datumSelection.update(data, void 0, (datum) => this.getDatumId(datum));
+ }
+ updateConnectorSelection(opts) {
+ const { connectorData, connectorSelection } = opts;
+ return connectorSelection.update(
+ this.connectorEnabled() ? connectorData : [],
+ void 0,
+ (connector) => this.getDatumId(connector.datum)
+ );
+ }
+ updateConnectorNodes(opts) {
+ const fillBBox = this.getShapeFillBBox();
+ opts.connectorSelection.each((connector, datum) => {
+ const { fill, fillOpacity, stroke: stroke2, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.connectorStyle(datum.datumIndex);
+ connector.setProperties(resetConnectorSelectionsFn(connector, datum));
+ applyShapeStyle8(
+ connector,
+ {
+ fill,
+ stroke: stroke2,
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ },
+ fillBBox
+ );
+ });
+ }
+ updateLabelSelection(opts) {
+ const labelData = this.properties.label.enabled ? opts.labelData : [];
+ return opts.labelSelection.update(labelData, (text2) => {
+ text2.pointerEvents = PointerEvents4.None;
+ });
+ }
+ updateLabelNodes(opts) {
+ const params = {
+ stageKey: this.properties.stageKey,
+ valueKey: this.properties.valueKey
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((textNode, datum) => {
+ textNode.fillOpacity = this.getHighlightStyle(false, datum.datumIndex).opacity ?? 1;
+ updateLabelNode5(this, textNode, params, this.properties.label, datum, false, activeHighlight);
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { stageKey, valueKey, tooltip, legendItemName } = properties;
+ const xAxis = this.getCategoryAxis();
+ const yAxis = this.getValueAxis();
+ if (!dataModel || !processedData || !xAxis || !yAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveKeysById(this, "xValue", processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ symbol: this.legendItemSymbol(datumIndex),
+ data: [
+ {
+ label: this.getAxisValueText(xAxis, "tooltip", xValue2, datum, stageKey, legendItemName),
+ value: this.getAxisValueText(yAxis, "tooltip", yValue, datum, valueKey, legendItemName)
+ }
+ ]
+ },
+ { seriesId, datum, title: stageKey, stageKey, valueKey, ...this.tooltipStyle(datum, datumIndex) }
+ );
+ }
+ resetAllAnimation(data) {
+ super.resetAllAnimation(data);
+ resetMotion2([this.connectorSelection], resetConnectorSelectionsFn);
+ }
+ animateEmptyUpdateReady({ labelSelection }) {
+ const { connectorSelection } = this;
+ const isVertical = this.isVertical();
+ const mode = "normal";
+ const connectorFns = prepareConnectorAnimationFunctions(isVertical, mode);
+ motion4.fromToMotion(this.id, "connectors", this.ctx.animationManager, [connectorSelection], connectorFns);
+ seriesLabelFadeInAnimation4(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateWaitingUpdateReady(data) {
+ const { labelSelection: labelSelections } = data;
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ seriesLabelFadeInAnimation4(this, "labels", this.ctx.animationManager, labelSelections);
+ }
+ getDatumId(datum) {
+ return createDatumId7(datum.xValue);
+ }
+ isLabelEnabled() {
+ return this.properties.label.enabled;
+ }
+ computeFocusBounds({ datumIndex }) {
+ return computeBarFocusBounds6(this, this.contextNodeData?.nodeData[datumIndex]);
+ }
+ legendItemSymbol(datumIndex) {
+ const { strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset, fill, stroke: stroke2 } = this.properties.getStyle(datumIndex);
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ id: seriesId,
+ processedData,
+ dataModel,
+ ctx: { legendManager },
+ visible
+ } = this;
+ if (!dataModel || !processedData || legendType !== "category") {
+ return [];
+ }
+ const { showInLegend } = this.properties;
+ const xValues = dataModel.resolveKeysById(this, "xValue", processedData);
+ return (processedData.dataSources.get(this.id)?.data ?? []).map((datum, datumIndex) => {
+ const stageValue = xValues[datumIndex];
+ if (stageValue == null)
+ return;
+ return {
+ legendType: "category",
+ id: seriesId,
+ datum,
+ itemId: datumIndex,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex }),
+ label: { text: String(stageValue) },
+ symbol: this.legendItemSymbol(datumIndex),
+ skipAnimations: true,
+ hideInLegend: !showInLegend
+ };
+ }).filter((datum) => datum != null);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelProperties.ts
+var import_ag_charts_community192 = require("ag-charts-community");
+var { Label: Label7, AbstractBarSeriesProperties: AbstractBarSeriesProperties5, makeSeriesTooltip: makeSeriesTooltip9, AxisLabel: AxisLabel3, Property: Property66 } = import_ag_charts_community192._ModuleSupport;
+var ConeFunnelSeriesLabel = class extends Label7 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property66
+], ConeFunnelSeriesLabel.prototype, "placement", 2);
+__decorateClass([
+ Property66
+], ConeFunnelSeriesLabel.prototype, "spacing", 2);
+var ConeFunnelSeriesStageLabel = class extends AxisLabel3 {
+};
+__decorateClass([
+ Property66
+], ConeFunnelSeriesStageLabel.prototype, "placement", 2);
+var ConeFunnelProperties = class extends AbstractBarSeriesProperties5 {
+ constructor() {
+ super(...arguments);
+ this.fills = [];
+ this.fillOpacity = 1;
+ this.strokes = [];
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.label = new ConeFunnelSeriesLabel();
+ this.stageLabel = new ConeFunnelSeriesStageLabel();
+ this.tooltip = makeSeriesTooltip9();
+ }
+ getStyle(index) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill: fills[index],
+ fillOpacity,
+ stroke: strokes[index],
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "stageKey", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "valueKey", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "fills", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "label", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "stageLabel", 2);
+__decorateClass([
+ Property66
+], ConeFunnelProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelUtil.ts
+function resetLineSelectionsFn(_node, { x, y, width, height, opacity }) {
+ return { x1: x, y1: y, x2: x + width, y2: y + height, opacity: opacity ?? 1 };
+}
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelSeries.ts
+var { Line: Line5, ChartAxisDirection: ChartAxisDirection26 } = import_ag_charts_community193._ModuleSupport;
+var ConeFunnelSeries = class extends BaseFunnelSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ animationResetFns: {
+ datum: resetLineSelectionsFn
+ }
+ });
+ this.properties = new ConeFunnelProperties();
+ }
+ get hasData() {
+ const {
+ id: seriesId,
+ ctx: { legendManager }
+ } = this;
+ const visibleItems = this.data?.data.reduce(
+ (accum, _, datumIndex) => accum + (legendManager.getItemEnabled({ seriesId, itemId: datumIndex }) ? 1 : 0),
+ 0
+ );
+ return visibleItems != null && visibleItems > 1;
+ }
+ getBandScalePadding() {
+ return { inner: 1, outer: 0 };
+ }
+ connectorEnabled() {
+ return true;
+ }
+ getItemStyle({ datumIndex }, _isHighlight) {
+ return this.properties.getStyle(datumIndex);
+ }
+ connectorStyle(index) {
+ return this.properties.getStyle(index);
+ }
+ nodeFactory() {
+ return new Line5();
+ }
+ createLabelData({
+ datumIndex,
+ rect,
+ barAlongX,
+ yDatum,
+ datum,
+ visible
+ }) {
+ const { stageKey, valueKey, label } = this.properties;
+ const { spacing, placement } = label;
+ if (!label.enabled)
+ return;
+ let x;
+ let y;
+ let textAlign;
+ let textBaseline;
+ if (barAlongX) {
+ x = rect.x + rect.width / 2;
+ textAlign = "center";
+ switch (placement) {
+ case "before":
+ y = rect.y - spacing;
+ textBaseline = "bottom";
+ break;
+ case "after":
+ y = rect.y + rect.height + spacing;
+ textBaseline = "top";
+ break;
+ default:
+ y = rect.y + rect.height / 2;
+ textBaseline = "middle";
+ }
+ } else {
+ y = rect.y + rect.height / 2;
+ textBaseline = "middle";
+ switch (placement) {
+ case "before":
+ x = rect.x - spacing;
+ textAlign = "right";
+ break;
+ case "after":
+ x = rect.x + rect.width + spacing;
+ textAlign = "left";
+ break;
+ default:
+ x = rect.x + rect.width / 2;
+ textAlign = "center";
+ }
+ }
+ const yDomain = this.getSeriesDomain(ChartAxisDirection26.Y);
+ const text2 = this.getLabelText(
+ yDatum,
+ datum,
+ valueKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: valueKey, value: yDatum, datum, stageKey, valueKey }
+ );
+ return {
+ x,
+ y,
+ textAlign,
+ textBaseline,
+ text: text2,
+ itemId: valueKey,
+ datum,
+ datumIndex,
+ series: this,
+ visible
+ };
+ }
+ updateDatumNodes(opts) {
+ const highlightStyle = this.getHighlightStyle(opts.isHighlight);
+ opts.datumSelection.each((line, datum) => {
+ line.setProperties(resetLineSelectionsFn(line, datum));
+ line.stroke = highlightStyle?.stroke;
+ line.strokeWidth = highlightStyle?.strokeWidth ?? 0;
+ line.strokeOpacity = highlightStyle?.strokeOpacity ?? 1;
+ line.lineDash = highlightStyle?.lineDash;
+ line.lineDashOffset = highlightStyle?.lineDashOffset ?? 0;
+ line.opacity = highlightStyle?.opacity ?? 1;
+ });
+ }
+ tooltipStyle(_datum, datumIndex) {
+ const { fill, stroke: stroke2, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.properties.getStyle(datumIndex);
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ }
+ hasItemStylers() {
+ return this.properties.label.itemStyler != null;
+ }
+};
+ConeFunnelSeries.className = "ConeFunnelSeries";
+ConeFunnelSeries.type = "cone-funnel";
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelSeriesOptionsDef.ts
+var import_ag_charts_community194 = require("ag-charts-community");
+var import_ag_charts_core82 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs9, coneFunnelSeriesThemeableOptionsDef, without: without3 } = import_ag_charts_community194._ModuleSupport;
+var coneFunnelSeriesOptionsDef = {
+ ...without3(commonSeriesOptionsDefs9, ["showInLegend"]),
+ ...coneFunnelSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core82.required)((0, import_ag_charts_core82.constant)("cone-funnel")),
+ stageKey: (0, import_ag_charts_core82.required)(import_ag_charts_core82.string),
+ valueKey: (0, import_ag_charts_core82.required)(import_ag_charts_core82.string)
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelThemes.ts
+var import_ag_charts_community195 = require("ag-charts-community");
+var {
+ ThemeConstants: { CARTESIAN_AXIS_TYPE: CARTESIAN_AXIS_TYPE8 }
+} = import_ag_charts_community195._ModuleSupport;
+var CONE_FUNNEL_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $palette: "secondSequentialColors" },
+ import_ag_charts_community195._ModuleSupport.SAFE_RANGE2_OPERATION
+ ]
+ },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", import_ag_charts_community195._ModuleSupport.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],
+ ["pattern", import_ag_charts_community195._ModuleSupport.FILL_PATTERN_SINGLE_DEFAULTS],
+ ["image", import_ag_charts_community195._ModuleSupport.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $palette: "secondSequentialColors" },
+ import_ag_charts_community195._ModuleSupport.SAFE_RANGE2_OPERATION
+ ]
+ }
+ ]
+ },
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ label: {
+ ...import_ag_charts_community195._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ placement: "before",
+ spacing: 4
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ },
+ highlight: import_ag_charts_community195._ModuleSupport.singleSeriesHighlightStyle(false)
+ },
+ seriesArea: {
+ padding: {
+ top: 20,
+ bottom: 20
+ }
+ },
+ axes: {
+ [CARTESIAN_AXIS_TYPE8.NUMBER]: {
+ nice: false,
+ gridLine: {
+ enabled: false
+ },
+ crosshair: {
+ enabled: false
+ },
+ label: {
+ enabled: false
+ }
+ },
+ [CARTESIAN_AXIS_TYPE8.CATEGORY]: {
+ line: {
+ enabled: false
+ }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/cone-funnel/coneFunnelModule.ts
+var ConeFunnelModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "cone-funnel",
+ moduleFactory: (ctx) => new ConeFunnelSeries(ctx),
+ solo: true,
+ defaultAxes: FUNNEL_SERIES_AXES,
+ themeTemplate: CONE_FUNNEL_SERIES_THEME
+};
+var ConeFunnelSeriesModule = {
+ type: "series",
+ name: "cone-funnel",
+ chartType: "cartesian",
+ enterprise: true,
+ options: coneFunnelSeriesOptionsDef,
+ create: (ctx) => new ConeFunnelSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelSeries.ts
+var import_ag_charts_community197 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelProperties.ts
+var import_ag_charts_community196 = require("ag-charts-community");
+var { Label: Label8, DropShadow: DropShadow4, AbstractBarSeriesProperties: AbstractBarSeriesProperties6, BaseProperties: BaseProperties25, makeSeriesTooltip: makeSeriesTooltip10, AxisLabel: AxisLabel4, Property: Property67 } = import_ag_charts_community196._ModuleSupport;
+var FunnelSeriesLabel = class extends Label8 {
+};
+var FunnelSeriesStageLabel = class extends AxisLabel4 {
+};
+__decorateClass([
+ Property67
+], FunnelSeriesStageLabel.prototype, "placement", 2);
+var FunnelDropOff = class extends BaseProperties25 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle() {
+ const { fill, stroke: stroke2, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "enabled", 2);
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "fill", 2);
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "stroke", 2);
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "lineDash", 2);
+__decorateClass([
+ Property67
+], FunnelDropOff.prototype, "lineDashOffset", 2);
+var FunnelProperties = class extends AbstractBarSeriesProperties6 {
+ constructor() {
+ super(...arguments);
+ this.fills = [];
+ this.fillOpacity = 1;
+ this.strokes = [];
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.spacingRatio = 0;
+ this.dropOff = new FunnelDropOff();
+ this.shadow = new DropShadow4().set({ enabled: false });
+ this.label = new FunnelSeriesLabel();
+ this.stageLabel = new FunnelSeriesStageLabel();
+ this.tooltip = makeSeriesTooltip10();
+ }
+ getStyle(index) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill: fills[index],
+ fillOpacity,
+ stroke: strokes[index],
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "stageKey", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "valueKey", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "fills", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "spacingRatio", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "dropOff", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "label", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "stageLabel", 2);
+__decorateClass([
+ Property67
+], FunnelProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelSeries.ts
+var {
+ ChartAxisDirection: ChartAxisDirection27,
+ resetBarSelectionsFn: resetBarSelectionsFn3,
+ prepareBarAnimationFunctions: prepareBarAnimationFunctions3,
+ midpointStartingBarPosition: midpointStartingBarPosition2,
+ createDatumId: createDatumId8,
+ Rect: Rect6,
+ motion: motion5,
+ applyShapeStyle: applyShapeStyle9,
+ mergeDefaults: mergeDefaults11
+} = import_ag_charts_community197._ModuleSupport;
+var FunnelSeries = class extends BaseFunnelSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ animationResetFns: {
+ datum: resetBarSelectionsFn3
+ }
+ });
+ this.properties = new FunnelProperties();
+ }
+ getBandScalePadding() {
+ return { inner: this.properties.spacingRatio, outer: 0 };
+ }
+ connectorEnabled() {
+ return this.properties.dropOff.enabled;
+ }
+ connectorStyle(index) {
+ return mergeDefaults11(this.properties.dropOff.getStyle(), this.properties.getStyle(index));
+ }
+ nodeFactory() {
+ return new Rect6();
+ }
+ createLabelData({
+ datumIndex,
+ rect,
+ yDatum,
+ datum,
+ visible
+ }) {
+ const { valueKey, stageKey, label } = this.properties;
+ if (!label.enabled)
+ return;
+ const yDomain = this.getSeriesDomain(ChartAxisDirection27.Y);
+ const text2 = this.getLabelText(
+ yDatum,
+ datum,
+ valueKey,
+ "y",
+ yDomain,
+ label,
+ { itemId: valueKey, value: yDatum, datum, stageKey, valueKey }
+ );
+ return {
+ x: rect.x + rect.width / 2,
+ y: rect.y + rect.height / 2,
+ textAlign: "center",
+ textBaseline: "middle",
+ text: text2,
+ itemId: stageKey,
+ datum,
+ datumIndex,
+ series: this,
+ visible
+ };
+ }
+ getItemStyle({ datum, datumIndex }, isHighlight) {
+ const { id: seriesId, properties } = this;
+ const { stageKey, valueKey, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults11(highlightStyle, properties.getStyle(datumIndex));
+ let style = baseStyle;
+ if (itemStyler != null) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const overrides = this.cachedDatumCallback(
+ createDatumId8(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const highlightStateString = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ return this.callWithContext(itemStyler, {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ stageKey,
+ valueKey,
+ ...style
+ });
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults11(overrides, style);
+ }
+ }
+ return style;
+ }
+ updateDatumNodes({
+ datumSelection,
+ isHighlight
+ }) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const { shadow } = this.properties;
+ const categoryAlongX = this.getCategoryDirection() === ChartAxisDirection27.X;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const style = this.getItemStyle(datum, isHighlight);
+ applyShapeStyle9(rect, style, fillBBox);
+ rect.visible = categoryAlongX ? datum.width > 0 : datum.height > 0;
+ rect.crisp = datum.crisp;
+ rect.fillShadow = shadow;
+ });
+ }
+ tooltipStyle(datum, datumIndex) {
+ return this.getItemStyle({ datum, datumIndex }, false);
+ }
+ animateEmptyUpdateReady(params) {
+ super.animateEmptyUpdateReady(params);
+ const { datumSelection } = params;
+ const isVertical = this.isVertical();
+ const mode = "normal";
+ const barFns = prepareBarAnimationFunctions3(midpointStartingBarPosition2(isVertical, mode), "unknown");
+ motion5.fromToMotion(this.id, "datums", this.ctx.animationManager, [datumSelection], barFns);
+ }
+ animateWaitingUpdateReady(data) {
+ super.animateWaitingUpdateReady(data);
+ const { datumSelection: datumSelections } = data;
+ const { processedData } = this;
+ const dataDiff = processedData?.reduced?.diff?.[this.id];
+ const fns = prepareBarAnimationFunctions3(midpointStartingBarPosition2(this.isVertical(), "fade"), "added");
+ motion5.fromToMotion(
+ this.id,
+ "datums",
+ this.ctx.animationManager,
+ [datumSelections],
+ fns,
+ (_, datum) => datum.xValue,
+ dataDiff
+ );
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+FunnelSeries.className = "FunnelSeries";
+FunnelSeries.type = "funnel";
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelSeriesOptionsDef.ts
+var import_ag_charts_community198 = require("ag-charts-community");
+var import_ag_charts_core83 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs10, funnelSeriesThemeableOptionsDef, without: without4 } = import_ag_charts_community198._ModuleSupport;
+var funnelSeriesOptionsDef = {
+ ...funnelSeriesThemeableOptionsDef,
+ ...without4(commonSeriesOptionsDefs10, ["showInLegend"]),
+ type: (0, import_ag_charts_core83.required)((0, import_ag_charts_core83.constant)("funnel")),
+ stageKey: (0, import_ag_charts_core83.required)(import_ag_charts_core83.string),
+ valueKey: (0, import_ag_charts_core83.required)(import_ag_charts_core83.string)
+};
+
+// packages/ag-charts-enterprise/src/series/funnel/funnelModule.ts
+var FunnelModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["cartesian"],
+ identifier: "funnel",
+ moduleFactory: (ctx) => new FunnelSeries(ctx),
+ solo: true,
+ defaultAxes: FUNNEL_SERIES_AXES,
+ themeTemplate: FUNNEL_SERIES_THEME
+};
+var FunnelSeriesModule = {
+ type: "series",
+ name: "funnel",
+ chartType: "cartesian",
+ enterprise: true,
+ options: funnelSeriesOptionsDef,
+ create: (ctx) => new FunnelSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeModule.ts
+var import_ag_charts_community203 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeries.ts
+var import_ag_charts_community202 = require("ag-charts-community");
+var import_ag_charts_core88 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/gauge-util/datumUnion.ts
+var DatumUnion = class {
+ *[Symbol.iterator]() {
+ const { node, datum } = this;
+ if (node && datum)
+ yield { node, datum };
+ }
+ nodes() {
+ return this.node ? [this.node] : [];
+ }
+ update(datumSelection, group, ctor, nodeUpdater) {
+ const nodes = datumSelection.nodes();
+ if (nodes.length === 0) {
+ this.node?.remove();
+ this.node = void 0;
+ } else {
+ if (this.node === void 0) {
+ this.node = new ctor();
+ this.node.fillOpacity = 0;
+ this.node.strokeOpacity = 0;
+ group.appendChild(this.node);
+ }
+ const first = nodes[0];
+ const last = nodes.toReversed().find((n) => n.datum.datum.value > n.datum.datum.segmentStart) ?? nodes.at(-1);
+ this.node.datum = this.datum = first.datum;
+ nodeUpdater(this.node, first, last);
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/gauge-util/label.ts
+var import_ag_charts_core84 = require("ag-charts-core");
+var fadeInFns = {
+ fromFn: () => ({ opacity: 0, phase: "initial" }),
+ toFn: () => ({ opacity: 1 })
+};
+function formatLabel(value, scale) {
+ if (value == null)
+ return "";
+ const { min, max } = scale;
+ const minLog10 = min === 0 ? 0 : Math.ceil(Math.log10(Math.abs(min)));
+ const maxLog10 = max === 0 ? 0 : Math.ceil(Math.log10(Math.abs(max)));
+ const dp = Math.max(2 - Math.max(minLog10, maxLog10), 0);
+ return value.toFixed(dp);
+}
+function getLabelText(seriesId, ctx, datum, valueOverride) {
+ if (datum.text != null)
+ return datum.text;
+ const value = valueOverride ?? datum.value;
+ let labelFormat;
+ if (datum?.formatter != null) {
+ labelFormat = formatWithContext(ctx, datum.formatter, { seriesId, datum: void 0, value });
+ }
+ return labelFormat == null || (0, import_ag_charts_core84.isArray)(labelFormat) ? labelFormat : String(labelFormat);
+}
+
+// packages/ag-charts-enterprise/src/series/gauge-util/lineMarker.ts
+function lineMarker({ path, x, y, size }) {
+ path.moveTo(x, y - size / 2);
+ path.lineTo(x, y + size / 2);
+}
+
+// packages/ag-charts-enterprise/src/series/gauge-util/pick.ts
+var import_ag_charts_core85 = require("ag-charts-core");
+function pickGaugeNearestDatum(self, point) {
+ const it = (0, import_ag_charts_core85.iterate)(self.datumUnion.nodes(), self.targetSelection.nodes());
+ return self.pickNodeNearestDistantObject(point, it);
+}
+function pickGaugeFocus(self, opts) {
+ const others = [
+ { data: self.contextNodeData?.nodeData, selection: self.datumUnion },
+ { data: self.contextNodeData?.targetData, selection: self.targetSelection }
+ ].filter((v) => v.data && v.data.length > 0);
+ const otherIndex = (0, import_ag_charts_core85.clamp)(0, opts.otherIndex + opts.otherIndexDelta, others.length - 1);
+ if (others.length === 0)
+ return;
+ const { data, selection } = others[otherIndex];
+ if (data == null || data.length === 0)
+ return;
+ const datumIndex = (0, import_ag_charts_core85.clamp)(0, opts.datumIndex, data.length - 1);
+ const datum = data[datumIndex];
+ for (const node of selection) {
+ if (node.datum === datum) {
+ const bounds = node.node;
+ return { bounds, clipFocusBox: true, datum, datumIndex, otherIndex };
+ }
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeriesProperties.ts
+var import_ag_charts_community200 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/gauge-util/segmentation.ts
+var import_ag_charts_community199 = require("ag-charts-community");
+var import_ag_charts_core86 = require("ag-charts-core");
+var { BaseProperties: BaseProperties26, Property: Property68 } = import_ag_charts_community199._ModuleSupport;
+var GaugeSegmentationIntervalProperties = class extends BaseProperties26 {
+ getSegments(scale, maxTicks) {
+ const { values, step, count } = this;
+ const d0 = Math.min(...scale.domain);
+ const d1 = Math.max(...scale.domain);
+ let ticks;
+ if (values != null) {
+ const segments = values.filter((v) => v > d0 && v < d1).sort((a, b) => a - b);
+ ticks = [d0, ...segments, d1];
+ } else if (step != null) {
+ const segments = [];
+ for (let i = d0; i < d1; i += step) {
+ segments.push(i);
+ }
+ segments.push(d1);
+ ticks = segments;
+ } else if (count == null) {
+ const segments = scale.ticks({
+ nice: true,
+ interval: void 0,
+ tickCount: void 0,
+ minTickCount: 0,
+ maxTickCount: Infinity
+ })?.ticks?.filter((v) => v > d0 && v < d1);
+ ticks = segments == null ? void 0 : [d0, ...segments, d1];
+ } else {
+ const segments = count + 1;
+ ticks = Array.from({ length: segments + 1 }, (_, i) => i / segments * (d1 - d0) + d0);
+ }
+ if (ticks != null && ticks.length > maxTicks) {
+ import_ag_charts_core86.Logger.warnOnce(
+ `the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration`
+ );
+ ticks = void 0;
+ }
+ ticks ?? (ticks = [d0, d1]);
+ return ticks;
+ }
+};
+__decorateClass([
+ Property68
+], GaugeSegmentationIntervalProperties.prototype, "values", 2);
+__decorateClass([
+ Property68
+], GaugeSegmentationIntervalProperties.prototype, "step", 2);
+__decorateClass([
+ Property68
+], GaugeSegmentationIntervalProperties.prototype, "count", 2);
+var GaugeSegmentationProperties = class extends BaseProperties26 {
+ constructor() {
+ super(...arguments);
+ this.enabled = false;
+ this.interval = new GaugeSegmentationIntervalProperties();
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property68
+], GaugeSegmentationProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property68
+], GaugeSegmentationProperties.prototype, "interval", 2);
+__decorateClass([
+ Property68
+], GaugeSegmentationProperties.prototype, "spacing", 2);
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeriesProperties.ts
+var {
+ BaseProperties: BaseProperties27,
+ makeSeriesTooltip: makeSeriesTooltip11,
+ SeriesProperties: SeriesProperties2,
+ PropertiesArray: PropertiesArray7,
+ Property: Property69,
+ Label: Label9,
+ AxisLabel: AxisLabel5,
+ getColorStops
+} = import_ag_charts_community200._ModuleSupport;
+var LinearGaugeDefaultTargetLabelProperties = class extends Label9 {
+};
+__decorateClass([
+ Property69
+], LinearGaugeDefaultTargetLabelProperties.prototype, "spacing", 2);
+var LinearGaugeTargetProperties = class extends BaseProperties27 {
+ constructor() {
+ super(...arguments);
+ this.value = 0;
+ this.label = new LinearGaugeDefaultTargetLabelProperties();
+ }
+ getStyle(defaultTarget) {
+ const {
+ fill = defaultTarget.fill ?? "black",
+ fillOpacity = defaultTarget.fillOpacity ?? 1,
+ stroke: stroke2 = defaultTarget.stroke ?? "black",
+ strokeWidth = defaultTarget.strokeWidth ?? 0,
+ strokeOpacity = defaultTarget.strokeOpacity ?? 1,
+ lineDash = defaultTarget.lineDash ?? [0],
+ lineDashOffset = defaultTarget.lineDashOffset ?? 0
+ } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "text", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "value", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "shape", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "placement", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "size", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "fill", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property69
+], LinearGaugeTargetProperties.prototype, "label", 2);
+var LinearGaugeBarProperties = class extends BaseProperties27 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.thicknessRatio = 1;
+ this.fills = new PropertiesArray7(import_ag_charts_community200._ModuleSupport.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle(defaultColorRange, horizontal, scale) {
+ const { fill, fills, fillMode, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ const barFill = fill ?? createLinearGradient(fills, fillMode, defaultColorRange, scale, horizontal);
+ return {
+ fill: barFill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "thickness", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "thicknessRatio", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "fills", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "fill", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property69
+], LinearGaugeBarProperties.prototype, "lineDashOffset", 2);
+var LinearGaugeScaleIntervalProperties = class extends BaseProperties27 {
+ constructor() {
+ super(...arguments);
+ this.values = void 0;
+ this.step = void 0;
+ this.minSpacing = 0;
+ this.maxSpacing = 1e3;
+ }
+};
+__decorateClass([
+ Property69
+], LinearGaugeScaleIntervalProperties.prototype, "values", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleIntervalProperties.prototype, "step", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleIntervalProperties.prototype, "minSpacing", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleIntervalProperties.prototype, "maxSpacing", 2);
+var LinearGaugeScaleLabelProperties = class extends AxisLabel5 {
+ constructor() {
+ super(...arguments);
+ this.placement = void 0;
+ }
+};
+__decorateClass([
+ Property69
+], LinearGaugeScaleLabelProperties.prototype, "placement", 2);
+var LinearGaugeScaleProperties = class extends BaseProperties27 {
+ constructor() {
+ super(...arguments);
+ this.min = 0;
+ this.max = 1;
+ this.fills = new PropertiesArray7(import_ag_charts_community200._ModuleSupport.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.defaultFill = "black";
+ this.interval = new LinearGaugeScaleIntervalProperties();
+ this.label = new LinearGaugeScaleLabelProperties();
+ }
+ getStyle(barEnabled, defaultColorRange, horizontal, scale) {
+ const {
+ fill,
+ fills,
+ defaultFill,
+ fillMode,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ } = this;
+ const scaleFill = fill ?? (barEnabled && fills.length === 0 ? defaultFill : void 0) ?? createLinearGradient(fills, fillMode, defaultColorRange, scale, horizontal);
+ return {
+ fill: scaleFill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "min", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "max", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "fills", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "fill", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "defaultFill", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "interval", 2);
+__decorateClass([
+ Property69
+], LinearGaugeScaleProperties.prototype, "label", 2);
+var LinearGaugeLabelProperties = class extends AutoSizedLabel {
+ constructor() {
+ super(...arguments);
+ this.placement = "inside-center";
+ this.avoidCollisions = true;
+ }
+};
+__decorateClass([
+ Property69
+], LinearGaugeLabelProperties.prototype, "text", 2);
+__decorateClass([
+ Property69
+], LinearGaugeLabelProperties.prototype, "placement", 2);
+__decorateClass([
+ Property69
+], LinearGaugeLabelProperties.prototype, "avoidCollisions", 2);
+var LinearGaugeSeriesProperties = class extends SeriesProperties2 {
+ constructor() {
+ super(...arguments);
+ this.value = 0;
+ this.segmentation = new GaugeSegmentationProperties();
+ this.defaultColorRange = [];
+ this.targets = new PropertiesArray7(LinearGaugeTargetProperties);
+ this.defaultTarget = new LinearGaugeTargetProperties();
+ this.defaultScale = new LinearGaugeScaleProperties();
+ this.direction = "vertical";
+ this.thickness = 1;
+ this.cornerRadius = 0;
+ this.cornerMode = "container";
+ this.margin = 0;
+ this.scale = new LinearGaugeScaleProperties();
+ this.bar = new LinearGaugeBarProperties();
+ this.label = new LinearGaugeLabelProperties();
+ this.tooltip = makeSeriesTooltip11();
+ }
+};
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "value", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "segmentation", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "targets", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "defaultTarget", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "defaultScale", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "direction", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "thickness", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "cornerMode", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "margin", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "scale", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "bar", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property69
+], LinearGaugeSeriesProperties.prototype, "tooltip", 2);
+function createLinearGradient(fills, fillMode, defaultColorRange, scale, horizontal) {
+ const colorStops = getColorStops(fills, defaultColorRange, scale.domain, fillMode);
+ return {
+ type: "gradient",
+ gradient: "linear",
+ colorSpace: "oklch",
+ colorStops,
+ rotation: horizontal ? 90 : 0,
+ bounds: "series"
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeUtil.ts
+var import_ag_charts_community201 = require("ag-charts-community");
+var import_ag_charts_core87 = require("ag-charts-core");
+var { BBox: BBox18 } = import_ag_charts_community201._ModuleSupport;
+function datumRect(datum) {
+ const { x0, y0, x1, y1, horizontalInset, verticalInset } = datum;
+ const x = Math.min(x0, x1) + horizontalInset;
+ const y = Math.min(y0, y1) + verticalInset;
+ const width = Math.max(Math.abs(x1 - x0) - 2 * horizontalInset, 0);
+ const height = Math.max(Math.abs(y1 - y0) - 2 * verticalInset, 0);
+ return { x, y, width, height };
+}
+function clipBBoxVisibility(datum, clipBBox) {
+ if (clipBBox == null)
+ return true;
+ const rect = datumRect(datum);
+ const delta3 = 1e-6;
+ const x0 = rect.x + delta3;
+ const y0 = rect.y + delta3;
+ const x1 = rect.x + rect.width - delta3;
+ const y1 = rect.y + rect.height - delta3;
+ const clipX0 = clipBBox.x;
+ const clipX1 = clipBBox.x + clipBBox.width;
+ const clipY0 = clipBBox.y;
+ const clipY1 = clipBBox.y + clipBBox.height;
+ return Math.max(x0, clipX0) <= Math.min(x1, clipX1) && Math.max(y0, clipY0) <= Math.min(y1, clipY1);
+}
+function hasClipBBox(datum) {
+ const { clipX0, clipX1, clipY0, clipY1 } = datum;
+ return clipX0 != null && clipX1 != null || clipY0 != null && clipY1 != null;
+}
+function computeClipBBox(datum) {
+ if (!hasClipBBox(datum))
+ return;
+ const { x0, y0, x1, y1 } = datum;
+ const { x, y, width, height } = datumRect(datum);
+ let { clipX0, clipX1, clipY0, clipY1 } = datum;
+ if (clipX0 == null || clipX1 == null) {
+ clipX0 = x0;
+ clipX1 = x1;
+ }
+ if (clipY0 == null || clipY1 == null) {
+ clipY0 = y0;
+ clipY1 = y1;
+ }
+ const clipX = Math.min(clipX0, clipX1);
+ const clipY = Math.min(clipY0, clipY1);
+ const clipWidth = Math.abs(clipX1 - clipX0);
+ const clipHeight = Math.abs(clipY1 - clipY0);
+ clipX0 = Math.max(x, clipX);
+ clipY0 = Math.max(y, clipY);
+ clipX1 = Math.min(x + width, clipX + clipWidth);
+ clipY1 = Math.min(y + height, clipY + clipHeight);
+ return new BBox18(
+ Math.min(clipX0, clipX1),
+ Math.min(clipY0, clipY1),
+ Math.abs(clipX1 - clipX0),
+ Math.abs(clipY1 - clipY0)
+ );
+}
+function prepareLinearGaugeSeriesAnimationFunctions(initialLoad, horizontal) {
+ const phase = initialLoad ? "initial" : "update";
+ const node = {
+ fromFn(sect, datum) {
+ const previousDatum = sect.previousDatum;
+ let { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1 } = previousDatum ?? datum;
+ const { horizontalInset, verticalInset } = datum;
+ const previousHadClipBBox = previousDatum != null && hasClipBBox(previousDatum);
+ const nextHasClipBBox = hasClipBBox(datum);
+ if (previousHadClipBBox && nextHasClipBBox) {
+ } else if (!previousHadClipBBox && nextHasClipBBox) {
+ ({ x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1 } = datum);
+ if (initialLoad) {
+ if (horizontal) {
+ clipX1 = datum.clipX0;
+ } else {
+ clipY1 = datum.clipY0;
+ }
+ }
+ } else if (previousHadClipBBox && !nextHasClipBBox) {
+ ({ x0, y0, x1, y1 } = datum);
+ clipX0 = void 0;
+ clipY0 = void 0;
+ clipX1 = void 0;
+ clipY1 = void 0;
+ } else if (initialLoad) {
+ if (horizontal) {
+ x1 = x0;
+ } else {
+ y1 = y0;
+ }
+ }
+ return { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1, horizontalInset, verticalInset, phase };
+ },
+ toFn(_sect, datum) {
+ const { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1, horizontalInset, verticalInset } = datum;
+ return { x0, y0, x1, y1, clipX0, clipY0, clipX1, clipY1, horizontalInset, verticalInset };
+ },
+ applyFn(rect, params) {
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, params));
+ }
+ };
+ return { node };
+}
+function resetLinearGaugeSeriesResetRectFunction(_node, datum) {
+ const { x, y, width, height } = datumRect(datum);
+ const clipBBox = computeClipBBox(datum);
+ const visible = clipBBoxVisibility(datum, clipBBox);
+ return { x, y, width, height, clipBBox, visible };
+}
+var horizontalTextAligns = {
+ ["Before" /* Before */]: "right",
+ ["Center" /* Center */]: "center",
+ ["After" /* After */]: "left"
+};
+var verticalTextBaselines = {
+ ["Before" /* Before */]: "top",
+ ["Center" /* Center */]: "middle",
+ ["After" /* After */]: "bottom"
+};
+var horizontalAlignFactors = {
+ ["Before" /* Before */]: -1,
+ ["Center" /* Center */]: -0.5,
+ ["After" /* After */]: 0
+};
+var verticalAlignFactors2 = {
+ ["Before" /* Before */]: 0,
+ ["Center" /* Center */]: -0.5,
+ ["After" /* After */]: -1
+};
+function formatLinearGaugeLabels(series, ctx, selection, opts, bboxes, datumOverrides) {
+ const { seriesRect, gaugeRect, barRect } = bboxes;
+ const { padding, horizontal } = opts;
+ selection.each((label, labelDatum) => {
+ const labelText = getLabelText(series.id, ctx, labelDatum, datumOverrides?.label);
+ let boundingWidth;
+ let boundingHeight;
+ if (labelDatum.placement === "outside-start") {
+ if (horizontal) {
+ boundingWidth = gaugeRect.x;
+ boundingHeight = seriesRect.height;
+ } else {
+ boundingWidth = seriesRect.width;
+ boundingHeight = seriesRect.height - (gaugeRect.y + gaugeRect.height);
+ }
+ } else if (labelDatum.placement === "outside-end") {
+ if (horizontal) {
+ boundingWidth = seriesRect.width - (gaugeRect.x + gaugeRect.width);
+ boundingHeight = seriesRect.height;
+ } else {
+ boundingWidth = seriesRect.width;
+ boundingHeight = gaugeRect.y;
+ }
+ } else if (labelDatum.avoidCollisions) {
+ boundingWidth = gaugeRect.width;
+ boundingHeight = gaugeRect.height;
+ }
+ let layout;
+ if (labelText == null) {
+ return;
+ } else if (boundingWidth != null && boundingHeight != null) {
+ const sizeFittingHeight = () => ({
+ width: boundingWidth,
+ height: boundingHeight,
+ meta: null
+ });
+ const labelMeta = formatSingleLabel((0, import_ag_charts_core87.toPlainText)(labelText), labelDatum, { padding }, sizeFittingHeight);
+ layout = labelMeta?.[0];
+ } else {
+ const measurer2 = (0, import_ag_charts_core87.cachedTextMeasurer)(labelDatum);
+ const { width, height } = (0, import_ag_charts_core87.isArray)(labelText) ? (0, import_ag_charts_core87.measureTextSegments)(labelText, labelDatum) : measurer2.measureLines(labelText);
+ layout = {
+ text: labelText,
+ fontSize: labelDatum.fontSize,
+ lineHeight: labelDatum.lineHeight ?? measurer2.lineHeight(),
+ width,
+ height
+ };
+ }
+ if (layout == null) {
+ label.visible = false;
+ return;
+ }
+ const scale0 = horizontal ? gaugeRect.x : gaugeRect.y + gaugeRect.height;
+ const scale1 = horizontal ? gaugeRect.x + gaugeRect.width : gaugeRect.y;
+ const bar0 = horizontal ? barRect.x : barRect.y + barRect.height;
+ const bar1 = horizontal ? barRect.x + barRect.width : barRect.y;
+ const offset = labelDatum.spacing * (horizontal ? 1 : -1);
+ let bounds0;
+ let bounds1;
+ let s;
+ let align;
+ switch (labelDatum.placement) {
+ case "outside-start":
+ bounds0 = -Infinity;
+ bounds1 = Infinity;
+ s = scale0 - offset;
+ align = "Before" /* Before */;
+ break;
+ case "outside-end":
+ bounds0 = -Infinity;
+ bounds1 = Infinity;
+ s = scale1 + offset;
+ align = "After" /* After */;
+ break;
+ case "inside-start":
+ bounds0 = scale0;
+ bounds1 = bar1;
+ s = scale0 + offset;
+ align = "After" /* After */;
+ break;
+ case "inside-end":
+ bounds0 = bar1;
+ bounds1 = scale1;
+ s = scale1 - offset;
+ align = "Before" /* Before */;
+ break;
+ case "inside-center":
+ bounds0 = scale0;
+ bounds1 = scale1;
+ s = (scale0 + scale1) / 2;
+ align = "Center" /* Center */;
+ break;
+ case "bar-inside":
+ bounds0 = bar0;
+ bounds1 = bar1;
+ s = (bar0 + bar1) / 2;
+ align = "Center" /* Center */;
+ break;
+ case "bar-inside-end":
+ bounds0 = bar0;
+ bounds1 = bar1;
+ s = bar1 - offset;
+ align = "Before" /* Before */;
+ break;
+ case "bar-outside-end":
+ bounds0 = bar1;
+ bounds1 = scale1;
+ s = bar1 + offset;
+ align = "After" /* After */;
+ break;
+ case "bar-end":
+ bounds0 = -Infinity;
+ bounds1 = Infinity;
+ s = bar1;
+ align = "Center" /* Center */;
+ break;
+ }
+ const x = horizontal ? s : gaugeRect.x + gaugeRect.width / 2;
+ const y = horizontal ? gaugeRect.y + gaugeRect.height / 2 : s;
+ let s0;
+ let s1;
+ if (horizontal) {
+ s0 = x + horizontalAlignFactors[align] * layout.width;
+ s1 = s0 + layout.width;
+ } else {
+ s0 = y + verticalAlignFactors2[align] * layout.height;
+ s1 = s0 + layout.height;
+ }
+ const inside = Math.min(s0, s1) >= Math.min(bounds0, bounds1) && Math.max(s0, s1) <= Math.max(bounds0, bounds1);
+ if (labelDatum.avoidCollisions && !inside) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.text = layout.text;
+ label.fontSize = layout.fontSize;
+ label.lineHeight = layout.lineHeight;
+ label.textAlign = horizontal ? horizontalTextAligns[align] : "center";
+ label.textBaseline = horizontal ? "middle" : verticalTextBaselines[align];
+ label.x = x;
+ label.y = y;
+ });
+}
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeSeries.ts
+var {
+ fromToMotion: fromToMotion2,
+ resetMotion: resetMotion3,
+ SeriesNodePickMode: SeriesNodePickMode8,
+ StateMachine: StateMachine12,
+ createDatumId: createDatumId9,
+ toRadians: toRadians4,
+ BBox: BBox19,
+ Group: Group11,
+ PointerEvents: PointerEvents5,
+ Selection: Selection7,
+ Rect: Rect7,
+ Text: Text3,
+ TransformableText: TransformableText2,
+ Marker: Marker3,
+ LinearScale: LinearScale4,
+ generateTicks: generateTicks2,
+ NiceMode,
+ easing,
+ findRangeExtent: findRangeExtent2,
+ tickFormat,
+ mergeDefaults: mergeDefaults12,
+ applyShapeStyle: applyShapeStyle10
+} = import_ag_charts_community202._ModuleSupport;
+var horizontalTargetPlacementRotation = {
+ before: 180,
+ middle: 0,
+ after: 0
+};
+var verticalTargetPlacementRotation = {
+ before: 90,
+ middle: 0,
+ after: -90
+};
+var LinearGaugeSeries = class extends import_ag_charts_community202._ModuleSupport.Series {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode8.EXACT_SHAPE_MATCH, SeriesNodePickMode8.NEAREST_NODE]
+ });
+ this.properties = new LinearGaugeSeriesProperties();
+ this.seriesRect = BBox19.NaN;
+ this.gaugeRect = BBox19.NaN;
+ this.scale = new LinearScale4();
+ this.originX = 0;
+ this.originY = 0;
+ this.scaleGroup = this.contentGroup.appendChild(new Group11({ name: "scaleGroup" }));
+ this.itemGroup = this.contentGroup.appendChild(new Group11({ name: "itemGroup" }));
+ this.itemTargetGroup = this.contentGroup.appendChild(new Group11({ name: "itemTargetGroup" }));
+ this.itemTargetLabelGroup = this.contentGroup.appendChild(new Group11({ name: "itemTargetLabelGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group11({ name: "itemLabelGroup" }));
+ this.highlightTargetGroup = this.highlightGroup.appendChild(
+ new Group11({ name: "itemTargetLabelGroup" })
+ );
+ this.tickGroup = this.contentGroup.appendChild(new Group11({ name: "tickGroup" }));
+ this.scaleSelection = Selection7.select(
+ this.scaleGroup,
+ () => this.nodeFactory()
+ );
+ this.datumSelection = Selection7.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.targetSelection = Selection7.select(
+ this.itemTargetGroup,
+ () => this.markerFactory()
+ );
+ this.targetLabelSelection = Selection7.select(this.itemTargetLabelGroup, Text3);
+ this.labelSelection = Selection7.select(
+ this.itemLabelGroup,
+ Text3
+ );
+ this.highlightTargetSelection = Selection7.select(this.highlightTargetGroup, () => this.markerFactory());
+ this.tickSelection = Selection7.select(this.tickGroup, TransformableText2);
+ this.datumUnion = new DatumUnion();
+ this.animationState = new StateMachine12("empty", {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateEmptyUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ updateData: "waiting",
+ clear: "clearing",
+ resize: () => this.animateReadyResize(),
+ reset: "empty",
+ skip: "ready"
+ },
+ waiting: {
+ update: {
+ target: "ready",
+ action: () => this.animateWaitingUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ clearing: {
+ update: {
+ target: "empty"
+ },
+ reset: "empty",
+ skip: "ready"
+ }
+ });
+ this.scaleGroup.pointerEvents = PointerEvents5.None;
+ this.tickGroup.pointerEvents = PointerEvents5.None;
+ }
+ get range() {
+ return this.horizontal ? [0, this.gaugeRect.width] : [0, this.gaugeRect.height];
+ }
+ get horizontal() {
+ return this.properties.direction === "horizontal";
+ }
+ get hasData() {
+ return true;
+ }
+ nodeFactory() {
+ const rect = new Rect7();
+ rect.crisp = true;
+ return rect;
+ }
+ markerFactory() {
+ return new Marker3();
+ }
+ processData() {
+ this.nodeDataRefresh = true;
+ this.animationState.transition("updateData");
+ }
+ formatLabel(value) {
+ return formatLabel(value, this.properties.scale);
+ }
+ getShapeFillBBox() {
+ const { properties, originX, originY, horizontal, scale } = this;
+ const { thickness } = properties;
+ const length = findRangeExtent2(scale.range);
+ const bbox = new BBox19(originX, originY, horizontal ? length : thickness, horizontal ? thickness : length);
+ return {
+ axis: bbox,
+ series: bbox
+ };
+ }
+ getTargets() {
+ const { properties } = this;
+ const defaultTarget = properties.defaultTarget;
+ return Array.from(properties.targets).map((target) => {
+ const {
+ text: text2 = defaultTarget.text,
+ value = defaultTarget.value ?? 0,
+ shape = defaultTarget.shape ?? "triangle",
+ rotation = defaultTarget.rotation ?? 0,
+ placement = defaultTarget.placement ?? "middle",
+ spacing = defaultTarget.spacing ?? 0,
+ size = defaultTarget.size ?? 0
+ } = target;
+ const {
+ enabled: labelEnabled = defaultTarget.label.enabled,
+ color: labelColor = defaultTarget.label.color ?? "black",
+ fontStyle: labelFontStyle = defaultTarget.label.fontStyle ?? "normal",
+ fontWeight: labelFontWeight = defaultTarget.label.fontWeight ?? "normal",
+ fontSize: labelFontSize = defaultTarget.label.fontSize,
+ fontFamily: labelFontFamily = defaultTarget.label.fontFamily,
+ spacing: labelSpacing = defaultTarget.label.spacing ?? 0
+ } = target.label;
+ return {
+ text: text2,
+ value,
+ shape,
+ placement,
+ spacing,
+ size,
+ rotation,
+ label: {
+ enabled: labelEnabled,
+ color: labelColor,
+ fontStyle: labelFontStyle,
+ fontWeight: labelFontWeight,
+ fontSize: labelFontSize,
+ fontFamily: labelFontFamily,
+ spacing: labelSpacing
+ },
+ style: target.getStyle(defaultTarget)
+ };
+ });
+ }
+ getTargetPoint(target) {
+ const { properties, originX, originY, horizontal, scale, gaugeRect } = this;
+ const { thickness } = properties;
+ const { value, placement, spacing, size } = target;
+ const mainOffset = scale.convert(value);
+ let crossOffset;
+ switch (placement) {
+ case "before":
+ crossOffset = -(spacing + size / 2);
+ break;
+ case "after":
+ crossOffset = thickness + spacing + size / 2;
+ break;
+ default:
+ crossOffset = thickness / 2;
+ break;
+ }
+ return {
+ x: originX + gaugeRect.x + (horizontal ? mainOffset : crossOffset),
+ y: originY + gaugeRect.y + (horizontal ? crossOffset : mainOffset)
+ };
+ }
+ getTargetLabel(target) {
+ const { size, placement, label } = target;
+ const { spacing, color: fill, fontStyle, fontWeight, fontSize, fontFamily } = label;
+ const lineHeight = void 0;
+ const offset = size / 2 + spacing;
+ let textAlign;
+ let textBaseline;
+ let offsetX = 0;
+ let offsetY = 0;
+ if (this.horizontal) {
+ textAlign = "center";
+ if (placement === "after") {
+ textBaseline = "top";
+ offsetY = offset;
+ } else {
+ textBaseline = "bottom";
+ offsetY = -offset;
+ }
+ } else {
+ textBaseline = "middle";
+ if (placement === "before") {
+ textAlign = "right";
+ offsetX = -offset;
+ } else {
+ textAlign = "left";
+ offsetX = offset;
+ }
+ }
+ return {
+ offsetX,
+ offsetY,
+ fill,
+ textAlign,
+ textBaseline,
+ fontStyle,
+ fontWeight,
+ fontSize,
+ fontFamily,
+ lineHeight
+ };
+ }
+ labelDatum(label, value) {
+ const {
+ placement,
+ avoidCollisions,
+ spacing,
+ text: text2,
+ color: fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ wrapping,
+ overflowStrategy,
+ formatter = (params) => this.formatLabel(params.value)
+ } = label;
+ return {
+ placement,
+ avoidCollisions,
+ spacing,
+ text: text2,
+ value,
+ fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ wrapping,
+ overflowStrategy,
+ formatter
+ };
+ }
+ verticalLabelInset() {
+ const { label } = this.properties;
+ const measurer2 = (0, import_ag_charts_core88.cachedTextMeasurer)(label);
+ const lines = label.text?.split("\n");
+ const labelSize = (label.lineHeight ?? measurer2.lineHeight()) * (lines?.length ?? 1);
+ return label.spacing + labelSize;
+ }
+ horizontalLabelInset() {
+ const { scale, properties } = this;
+ const { scale: scaleProps, label } = properties;
+ const lines = label.text?.split("\n");
+ const measurer2 = (0, import_ag_charts_core88.cachedTextMeasurer)(label);
+ const ticks = scaleProps.interval.values ?? scale.ticks({
+ nice: false,
+ interval: scaleProps.interval.step,
+ minTickCount: 0,
+ maxTickCount: 6,
+ tickCount: 5
+ })?.ticks ?? [];
+ const linesOrTicks = lines ?? ticks?.map((tick) => getLabelText(this.id, this.ctx, this.labelDatum(label, tick)) ?? "");
+ const labelSize = linesOrTicks.reduce((accum, text2) => {
+ const { width } = (0, import_ag_charts_core88.isArray)(text2) ? (0, import_ag_charts_core88.measureTextSegments)(text2, label) : measurer2.measureLines(text2);
+ return Math.max(accum, width);
+ }, 0);
+ return label.spacing + labelSize;
+ }
+ tickFormatter(domain, ticks) {
+ const { format, formatter } = this.properties.scale.label;
+ let tickFormatter;
+ if (format != null) {
+ tickFormatter = tickFormat(ticks, typeof format === "string" ? format : void 0);
+ }
+ return (value, index) => {
+ let r = void 0;
+ if (formatter) {
+ r ?? (r = formatWithContext(this.ctx, formatter, { value, index, domain, boundSeries: void 0 }));
+ }
+ r ?? (r = tickFormatter?.(value));
+ return r ?? this.formatLabel(value);
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, properties, horizontal, scale, seriesRect } = this;
+ const {
+ value,
+ segmentation,
+ thickness,
+ cornerRadius,
+ cornerMode,
+ bar,
+ scale: scaleProps,
+ label,
+ defaultColorRange
+ } = properties;
+ scale.domain = [scaleProps.min, scaleProps.max];
+ scale.range = horizontal ? [0, seriesRect.width] : [seriesRect.height, 0];
+ let axisRotation;
+ let sideFlag;
+ if (horizontal) {
+ sideFlag = 1;
+ axisRotation = Math.PI / 2;
+ } else if (scaleProps.label.placement === "before") {
+ sideFlag = 1;
+ axisRotation = 0;
+ } else {
+ sideFlag = -1;
+ axisRotation = 0;
+ }
+ let x0;
+ let x1;
+ let y0;
+ let y1;
+ if (horizontal) {
+ x0 = 0;
+ x1 = seriesRect.width;
+ y0 = (seriesRect.height - thickness) / 2;
+ y1 = y0 + thickness;
+ if (label.placement === "outside-start") {
+ x0 += this.horizontalLabelInset();
+ } else if (label.placement === "outside-end") {
+ x1 -= this.horizontalLabelInset();
+ }
+ } else {
+ x0 = (seriesRect.width - thickness) / 2;
+ x1 = x0 + thickness;
+ y1 = 0;
+ y0 = seriesRect.height;
+ if (label.placement === "outside-start") {
+ y0 -= this.verticalLabelInset();
+ } else if (label.placement === "outside-end") {
+ y1 += this.verticalLabelInset();
+ }
+ }
+ this.gaugeRect = new BBox19(Math.min(x0, x1), Math.min(y0, y1), Math.abs(x1 - x0), Math.abs(y1 - y0));
+ const originX = 0;
+ const originY = 0;
+ scale.domain = [scaleProps.min, scaleProps.max];
+ scale.range = horizontal ? [x0, x1] : [y0, y1];
+ const {
+ tickData: { ticks: tickData }
+ } = generateTicks2({
+ scale,
+ label: this.properties.scale.label,
+ interval: this.properties.scale.interval,
+ tickFormatter: (domain, ticks) => this.tickFormatter(domain, ticks),
+ domain: scale.domain,
+ range: this.range,
+ reverse: false,
+ primaryTickCount: void 0,
+ defaultTickMinSpacing: 0,
+ visibleRange: [0, 1],
+ niceMode: NiceMode.Off,
+ labelOffset: 0,
+ axisRotation,
+ sideFlag
+ });
+ const isReversed = false;
+ const targets = this.getTargets();
+ const nodeData = [];
+ const targetData = [];
+ const labelData = [];
+ const scaleData = [];
+ const [m0, m1] = scale.range;
+ const mainAxisSize = Math.abs(m1 - m0);
+ const containerX = horizontal ? scale.convert(value) : x1;
+ const containerY = horizontal ? y1 : scale.convert(value);
+ const inset = segmentation.enabled ? segmentation.spacing / 2 : 0;
+ const horizontalInset = horizontal ? inset : 0;
+ const verticalInset = horizontal ? 0 : inset;
+ const barThickness = Math.min(bar.thickness ?? Math.round(bar.thicknessRatio * thickness), thickness);
+ const barInset = -(thickness - barThickness) / 2;
+ const barXInset = horizontal ? 0 : barInset;
+ const barYInset = horizontal ? barInset : 0;
+ const cornersOnAllItems = cornerMode === "item";
+ const maxTicks = Math.ceil(mainAxisSize);
+ let segments = segmentation.enabled ? segmentation.interval.getSegments(scale, maxTicks) : void 0;
+ const barStyle = bar.getStyle(defaultColorRange, horizontal, scale);
+ const scaleStyle = scaleProps.getStyle(bar.enabled, defaultColorRange, horizontal, scale);
+ if (segments == null && cornersOnAllItems) {
+ const segmentStart = Math.min(...scale.domain);
+ const segmentEnd = Math.max(...scale.domain);
+ const datum = { value, segmentStart, segmentEnd };
+ if (bar.enabled) {
+ const barAppliedCornerRadius = Math.min(cornerRadius, barThickness / 2, mainAxisSize / 2);
+ const barCornerInset = barAppliedCornerRadius * (isReversed ? -1 : 1);
+ const barCornerXInset = horizontal ? barCornerInset : 0;
+ const barCornerYInset = horizontal ? 0 : barCornerInset;
+ nodeData.push({
+ series: this,
+ itemId: `value`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + x0 - barCornerXInset - barXInset,
+ y0: originY + y0 - barCornerYInset - barYInset,
+ x1: originX + containerX + barCornerXInset + barXInset,
+ y1: originY + containerY + barCornerYInset + barYInset,
+ clipX0: void 0,
+ clipY0: void 0,
+ clipX1: void 0,
+ clipY1: void 0,
+ topLeftCornerRadius: cornerRadius,
+ topRightCornerRadius: cornerRadius,
+ bottomRightCornerRadius: cornerRadius,
+ bottomLeftCornerRadius: cornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: barStyle
+ });
+ }
+ const scaleAppliedCornerRadius = Math.min(cornerRadius, thickness / 2, mainAxisSize / 2);
+ const scaleCornerInset = scaleAppliedCornerRadius * (isReversed ? -1 : 1);
+ const scaleCornerXInset = horizontal ? scaleCornerInset : 0;
+ const scaleCornerYInset = horizontal ? 0 : scaleCornerInset;
+ scaleData.push({
+ series: this,
+ itemId: `scale`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + x0 - scaleCornerXInset,
+ y0: originY + y0 - scaleCornerYInset,
+ x1: originX + x1 + scaleCornerXInset,
+ y1: originY + y1 + scaleCornerYInset,
+ clipX0: void 0,
+ clipY0: void 0,
+ clipX1: void 0,
+ clipY1: void 0,
+ topLeftCornerRadius: cornerRadius,
+ topRightCornerRadius: cornerRadius,
+ bottomRightCornerRadius: cornerRadius,
+ bottomLeftCornerRadius: cornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: scaleStyle
+ });
+ } else {
+ segments ?? (segments = scale.domain);
+ const clipX0 = originX + x0 - barXInset;
+ const clipY0 = originY + y0 - barYInset;
+ const clipX1 = originX + containerX + barXInset;
+ const clipY1 = originY + containerY + barYInset;
+ for (let i = 0; i < segments.length - 1; i += 1) {
+ const segmentStart = segments[i + 0];
+ const segmentEnd = segments[i + 1];
+ const datum = { value, segmentStart, segmentEnd };
+ const isStart = i === 0;
+ const isEnd = i === segments.length - 2;
+ const itemStart = scale.convert(segmentStart);
+ const itemEnd = scale.convert(segmentEnd);
+ const startCornerRadius = cornersOnAllItems || isStart ? cornerRadius : 0;
+ const endCornerRadius = cornersOnAllItems || isEnd ? cornerRadius : 0;
+ const topLeftCornerRadius = horizontal ? startCornerRadius : endCornerRadius;
+ const topRightCornerRadius = endCornerRadius;
+ const bottomRightCornerRadius = horizontal ? endCornerRadius : startCornerRadius;
+ const bottomLeftCornerRadius = startCornerRadius;
+ if (bar.enabled) {
+ nodeData.push({
+ series: this,
+ itemId: `value-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + (horizontal ? itemStart : x0),
+ y0: originY + (horizontal ? y0 : itemStart),
+ x1: originX + (horizontal ? itemEnd : x1),
+ y1: originY + (horizontal ? y1 : itemEnd),
+ clipX0,
+ clipY0,
+ clipX1,
+ clipY1,
+ topLeftCornerRadius,
+ topRightCornerRadius,
+ bottomRightCornerRadius,
+ bottomLeftCornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: barStyle
+ });
+ }
+ scaleData.push({
+ series: this,
+ itemId: `scale-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ x0: originX + (horizontal ? itemStart : x0),
+ y0: originY + (horizontal ? y0 : itemStart),
+ x1: originX + (horizontal ? itemEnd : x1),
+ y1: originY + (horizontal ? y1 : itemEnd),
+ clipX0: void 0,
+ clipY0: void 0,
+ clipX1: void 0,
+ clipY1: void 0,
+ topLeftCornerRadius,
+ topRightCornerRadius,
+ bottomRightCornerRadius,
+ bottomLeftCornerRadius,
+ horizontalInset,
+ verticalInset,
+ style: scaleStyle
+ });
+ }
+ }
+ if (label.enabled) {
+ labelData.push(this.labelDatum(label, value));
+ }
+ const targetPlacementRotation2 = horizontal ? horizontalTargetPlacementRotation : verticalTargetPlacementRotation;
+ for (let i = 0; i < targets.length; i += 1) {
+ const target = targets[i];
+ const { value: targetValue, text: text2, shape, size, style } = target;
+ const targetPoint = this.getTargetPoint(target);
+ const targetRotation = toRadians4(target.rotation + targetPlacementRotation2[target.placement]);
+ targetData.push({
+ series: this,
+ itemId: `target-${i}`,
+ midPoint: targetPoint,
+ datum: { value: targetValue },
+ datumIndex: { type: 1 /* Target */, index: i },
+ type: 1 /* Target */,
+ value: targetValue,
+ text: text2,
+ x: targetPoint.x,
+ y: targetPoint.y,
+ shape,
+ size,
+ rotation: targetRotation,
+ label: this.getTargetLabel(target),
+ style
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ tickData,
+ targetData,
+ labelData,
+ scaleData
+ };
+ }
+ updateSelections(resize) {
+ if (this.nodeDataRefresh || resize) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ highlightDatum(node) {
+ if (node != null && node.series === this && node.type === 1 /* Target */) {
+ return node;
+ }
+ }
+ update({ seriesRect }) {
+ const {
+ datumSelection,
+ labelSelection,
+ targetSelection,
+ targetLabelSelection,
+ scaleSelection,
+ highlightTargetSelection,
+ tickSelection
+ } = this;
+ this.seriesRect = seriesRect ?? BBox19.NaN;
+ const resize = this.checkResize(seriesRect);
+ this.updateSelections(resize);
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = this.getOpacity();
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ const targetData = this.contextNodeData?.targetData ?? [];
+ const scaleData = this.contextNodeData?.scaleData ?? [];
+ const tickData = this.contextNodeData?.tickData ?? [];
+ const highlightTargetDatum = this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());
+ this.scaleSelection = this.updateScaleSelection({ scaleData, scaleSelection });
+ this.updateScaleNodes({ scaleSelection });
+ this.targetSelection = this.updateTargetSelection({ targetData, targetSelection });
+ this.updateTargetNodes({ targetSelection, isHighlight: false });
+ this.targetLabelSelection = this.updateTargetLabelSelection({ targetData, targetLabelSelection });
+ this.updateTargetLabelNodes({ targetLabelSelection });
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection });
+ this.highlightTargetSelection = this.updateTargetSelection({
+ targetData: highlightTargetDatum == null ? [] : [highlightTargetDatum],
+ targetSelection: highlightTargetSelection
+ });
+ this.updateTargetNodes({ targetSelection: highlightTargetSelection, isHighlight: true });
+ this.tickSelection = this.updateTickSelection({ tickData, tickSelection });
+ this.updateTickNodes({ tickSelection });
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => {
+ return createDatumId9(opts.nodeData.length, datum.itemId);
+ });
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ const { ctx } = this;
+ const animationDisabled = ctx.animationManager.isSkipped();
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const { topLeftCornerRadius, topRightCornerRadius, bottomRightCornerRadius, bottomLeftCornerRadius } = datum;
+ applyShapeStyle10(rect, datum.style, fillBBox);
+ rect.topLeftCornerRadius = topLeftCornerRadius;
+ rect.topRightCornerRadius = topRightCornerRadius;
+ rect.bottomRightCornerRadius = bottomRightCornerRadius;
+ rect.bottomLeftCornerRadius = bottomLeftCornerRadius;
+ rect.pointerEvents = this.properties.bar.enabled ? import_ag_charts_community202._ModuleSupport.PointerEvents.All : import_ag_charts_community202._ModuleSupport.PointerEvents.None;
+ if (animationDisabled || rect.previousDatum == null) {
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, datum));
+ }
+ });
+ const { horizontal } = this;
+ this.datumUnion.update(datumSelection, this.itemGroup, import_ag_charts_community202._ModuleSupport.Rect, (node, first, last) => {
+ const left = Math.min(first.x, last.x);
+ const right = Math.max(first.x + first.width, last.x + last.width);
+ const top = Math.min(first.y, last.y);
+ const bottom = Math.max(first.y + first.height, last.y + last.height);
+ const width = right - left;
+ const height = bottom - top;
+ node.pointerEvents = import_ag_charts_community202._ModuleSupport.PointerEvents.None;
+ node.x = left;
+ node.y = top;
+ node.width = width;
+ node.height = height;
+ node.topLeftCornerRadius = horizontal ? first.topLeftCornerRadius : last.topLeftCornerRadius;
+ node.topRightCornerRadius = last.topRightCornerRadius;
+ node.bottomRightCornerRadius = horizontal ? last.bottomRightCornerRadius : first.bottomRightCornerRadius;
+ node.bottomLeftCornerRadius = first.bottomLeftCornerRadius;
+ const firstClipBBox = first.clipBBox;
+ const lastClipBBox = last.clipBBox ?? firstClipBBox;
+ if (firstClipBBox && lastClipBBox) {
+ node.clipBBox = BBox19.merge([firstClipBBox, lastClipBBox]).intersection(
+ horizontal ? new BBox19(left, -Infinity, width, Infinity) : new BBox19(-Infinity, top, Infinity, height)
+ );
+ } else {
+ node.clipBBox = void 0;
+ }
+ });
+ }
+ updateScaleSelection(opts) {
+ return opts.scaleSelection.update(opts.scaleData, void 0, (datum) => {
+ return createDatumId9(opts.scaleData.length, datum.itemId);
+ });
+ }
+ updateScaleNodes(opts) {
+ const { scaleSelection } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ scaleSelection.each((rect, datum) => {
+ const { topLeftCornerRadius, topRightCornerRadius, bottomRightCornerRadius, bottomLeftCornerRadius } = datum;
+ applyShapeStyle10(rect, datum.style, fillBBox);
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, datum));
+ rect.topLeftCornerRadius = topLeftCornerRadius;
+ rect.topRightCornerRadius = topRightCornerRadius;
+ rect.bottomRightCornerRadius = bottomRightCornerRadius;
+ rect.bottomLeftCornerRadius = bottomLeftCornerRadius;
+ rect.setProperties(resetLinearGaugeSeriesResetRectFunction(rect, datum));
+ });
+ }
+ updateTargetSelection(opts) {
+ return opts.targetSelection.update(opts.targetData, void 0, (target) => target.itemId);
+ }
+ updateTargetNodes(opts) {
+ const { targetSelection, isHighlight } = opts;
+ targetSelection.each((target, datum) => {
+ const { x, y, shape, size, rotation } = datum;
+ const style = this.getTargetStyle(isHighlight, datum);
+ applyShapeStyle10(target, style);
+ target.size = size;
+ target.shape = shape === "line" ? lineMarker : shape;
+ target.translationX = x;
+ target.translationY = y;
+ target.rotation = rotation;
+ });
+ }
+ getTargetStyle(isHighlight, { datumIndex, style }) {
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ return mergeDefaults12(highlightStyle, {
+ ...style,
+ opacity: 1
+ });
+ }
+ updateTargetLabelSelection(opts) {
+ return opts.targetLabelSelection.update(opts.targetData);
+ }
+ updateTargetLabelNodes(opts) {
+ const { targetLabelSelection } = opts;
+ targetLabelSelection.each((label, target) => {
+ const { x, y, text: text2 } = target;
+ const { offsetX, offsetY, fill, fontStyle, fontWeight, fontSize, fontFamily, textAlign, textBaseline } = target.label;
+ label.visible = true;
+ label.x = x + offsetX;
+ label.y = y + offsetY;
+ label.text = text2;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = textBaseline;
+ });
+ }
+ updateTickSelection(opts) {
+ return opts.tickSelection.update(opts.tickData, void 0, (datum) => datum.tickId);
+ }
+ updateTickNodes(opts) {
+ const { gaugeRect, properties } = this;
+ const defaultScale = properties.defaultScale;
+ const {
+ enabled,
+ color: color6,
+ fontFamily = defaultScale.label.fontFamily,
+ fontSize = defaultScale.label.fontSize,
+ fontStyle,
+ fontWeight = defaultScale.label.fontWeight,
+ spacing
+ } = properties.scale.label;
+ let { placement } = properties.scale.label;
+ const rotation = toRadians4(properties.scale.label.rotation ?? 0);
+ let textAlign;
+ let textBaseline;
+ let textX;
+ let textY;
+ if (this.horizontal) {
+ placement ?? (placement = "after");
+ textAlign = "center";
+ textBaseline = placement === "before" ? "bottom" : "top";
+ textY = this.originY + gaugeRect.y + (placement === "before" ? -spacing : gaugeRect.height + spacing);
+ } else {
+ placement ?? (placement = "before");
+ textAlign = placement === "before" ? "end" : "start";
+ textBaseline = "middle";
+ textX = this.originX + gaugeRect.x + (placement === "before" ? -spacing : gaugeRect.width + spacing);
+ }
+ opts.tickSelection.each((label, datum) => {
+ if (!enabled) {
+ label.visible = false;
+ return;
+ }
+ const x = textX ?? datum.translation;
+ const y = textY ?? datum.translation;
+ label.visible = true;
+ label.text = datum.tickLabel;
+ label.fill = color6;
+ label.fontFamily = fontFamily;
+ label.fontSize = fontSize;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.textBaseline = textBaseline;
+ label.textAlign = textAlign;
+ label.x = x;
+ label.y = y;
+ label.rotationCenterX = x;
+ label.rotationCenterY = y;
+ label.rotation = rotation;
+ });
+ }
+ updateLabelSelection(opts) {
+ return opts.labelSelection.update(opts.labelData, void 0, (_datum) => "primary");
+ }
+ updateLabelNodes(opts) {
+ const { labelSelection } = opts;
+ const animationDisabled = this.ctx.animationManager.isSkipped();
+ labelSelection.each((label, datum) => {
+ label.fill = datum.fill;
+ label.fontStyle = datum.fontStyle;
+ label.fontWeight = datum.fontWeight;
+ label.fontFamily = datum.fontFamily;
+ });
+ if (animationDisabled || this.labelsHaveExplicitText()) {
+ this.formatLabelText();
+ }
+ }
+ labelsHaveExplicitText() {
+ for (const { datum } of this.labelSelection) {
+ if (datum.text == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+ formatLabelText(datum) {
+ const { labelSelection, horizontal, scale, seriesRect, gaugeRect } = this;
+ const { x, y, width, height } = gaugeRect;
+ const value = datum?.label ?? this.properties.value;
+ let barRect;
+ if (horizontal) {
+ const xValue2 = scale.convert(value);
+ barRect = new BBox19(x, y, xValue2 - x, height);
+ } else {
+ const yValue = scale.convert(value);
+ barRect = new BBox19(x, yValue, width, height - yValue);
+ }
+ const bboxes = { seriesRect, gaugeRect, barRect };
+ const { margin: padding } = this.properties;
+ formatLinearGaugeLabels(this, this.ctx, labelSelection, { padding, horizontal }, bboxes, datum);
+ }
+ resetAllAnimation() {
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ resetMotion3([this.datumSelection], resetLinearGaugeSeriesResetRectFunction);
+ this.formatLabelText();
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ animateLabelText(params = {}) {
+ const { animationManager } = this.ctx;
+ let labelFrom = 0;
+ let labelTo = 0;
+ this.labelSelection.each((label, datum) => {
+ label.opacity = 1;
+ labelFrom = label.previousDatum?.value ?? params.from ?? datum.value;
+ labelTo = datum.value;
+ });
+ if (this.labelsHaveExplicitText()) {
+ } else if (labelFrom === labelTo) {
+ this.formatLabelText({ label: labelTo });
+ } else {
+ const animationId = `${this.id}_labels`;
+ animationManager.animate({
+ id: animationId,
+ groupId: "label",
+ from: { label: labelFrom },
+ to: { label: labelTo },
+ phase: params.phase ?? "update",
+ ease: easing.easeOut,
+ onUpdate: (datum) => this.formatLabelText(datum),
+ onStop: () => this.formatLabelText({ label: labelTo })
+ });
+ }
+ }
+ animateEmptyUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node } = prepareLinearGaugeSeriesAnimationFunctions(true, this.horizontal);
+ fromToMotion2(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ fromToMotion2(this.id, "label", animationManager, [this.labelSelection], fadeInFns, () => "primary");
+ this.animateLabelText({ from: 0, phase: "initial" });
+ }
+ animateWaitingUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node } = prepareLinearGaugeSeriesAnimationFunctions(false, this.horizontal);
+ fromToMotion2(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ this.animateLabelText();
+ }
+ animateReadyResize() {
+ this.resetAllAnimation();
+ }
+ getSeriesDomain() {
+ return [0, 1];
+ }
+ dataCount() {
+ return Number.NaN;
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties } = this;
+ const { tooltip } = properties;
+ if (datumIndex == null)
+ return;
+ let value;
+ let text2;
+ let fallbackLabel;
+ if (datumIndex.type === 0 /* Node */) {
+ value = properties.value;
+ text2 = properties.label.text;
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeValue");
+ } else {
+ ({ value, text: text2 } = properties.targets[datumIndex.index]);
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeTarget");
+ }
+ if (value == null)
+ return;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ data: [{ label: text2, fallbackLabel, value: this.formatLabel(value) }]
+ },
+ { seriesId, title: void 0, datum: void 0, value }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return pickGaugeNearestDatum(this, point);
+ }
+ pickFocus(opts) {
+ return pickGaugeFocus(this, opts);
+ }
+ getCaptionText() {
+ return this.formatLabel(this.properties.value);
+ }
+ getCategoryValue(_datumIndex) {
+ return;
+ }
+ datumIndexForCategoryValue(_categoryValue) {
+ return;
+ }
+ hasItemStylers() {
+ return this.properties.label.itemStyler != null;
+ }
+};
+LinearGaugeSeries.className = "LinearGaugeSeries";
+LinearGaugeSeries.type = "linear-gauge";
+
+// packages/ag-charts-enterprise/src/series/linear-gauge/linearGaugeModule.ts
+var LinearGaugeModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "linear-gauge",
+ moduleFactory: (ctx) => new LinearGaugeSeries(ctx),
+ themeTemplate: {
+ minWidth: 200,
+ minHeight: 200,
+ tooltip: {
+ enabled: false
+ },
+ series: {
+ thickness: 50,
+ defaultColorRange: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $interpolate: [{ $palette: "secondDivergingColors" }, 5] },
+ import_ag_charts_community203._ModuleSupport.SAFE_RANGE2_OPERATION
+ ]
+ },
+ scale: {
+ // @ts-expect-error undocumented option
+ defaultFill: { $path: ["/1", { $palette: "fill" }, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ stroke: { $path: ["/2", import_ag_charts_community203._ModuleSupport.SAFE_STROKE_FILL_OPERATION, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ spacing: 11
+ }
+ },
+ bar: {
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ segmentation: {
+ enabled: false,
+ interval: {},
+ spacing: 1
+ },
+ defaultTarget: {
+ fill: { $ref: "foregroundColor" },
+ stroke: { $ref: "foregroundColor" },
+ size: 10,
+ shape: "triangle",
+ placement: "after",
+ spacing: 5,
+ label: {
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ spacing: 5
+ }
+ },
+ defaultScale: {
+ label: {
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" }
+ }
+ },
+ label: {
+ ...import_ag_charts_community203._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ placement: "inside-start",
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $rem: 2 },
+ minimumFontSize: import_ag_charts_community203._ModuleSupport.FONT_SIZE.SMALL,
+ spacing: 18,
+ color: { $ref: "chartBackgroundColor" }
+ },
+ margin: 4,
+ tooltip: {
+ range: { $path: ["/tooltip/range", 10] }
+ }
+ }
+ }
+};
+var LinearGaugeSeriesModule = {
+ type: "series",
+ name: "linear-gauge",
+ chartType: "standalone",
+ enterprise: true,
+ options: import_ag_charts_community203._ModuleSupport.linearGaugeSeriesOptionsDef,
+ create: (ctx) => new LinearGaugeSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineModule.ts
+var import_ag_charts_community212 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/map-util/mapThemeDefaults.ts
+var import_ag_charts_community204 = require("ag-charts-community");
+var MAP_THEME_DEFAULTS = {
+ zoom: {
+ axes: "xy",
+ anchorPointX: "pointer",
+ anchorPointY: "pointer",
+ buttons: {
+ // @ts-expect-error undocumented options
+ anchorPointX: "middle",
+ anchorPointY: "middle"
+ }
+ },
+ legend: {
+ enabled: false
+ },
+ gradientLegend: {
+ enabled: false,
+ ...import_ag_charts_community204._ModuleSupport.LEGEND_CONTAINER_THEME
+ }
+};
+function applyMapPalette(object) {
+ const clone = import_ag_charts_community204._ModuleSupport.deepClone(object);
+ import_ag_charts_community204._ModuleSupport.jsonWalk(clone, (value) => {
+ if (typeof value === "object" && "$palette" in value) {
+ value["$mapPalette"] = value["$palette"];
+ delete value["$palette"];
+ }
+ });
+ return clone;
+}
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeries.ts
+var import_ag_charts_community210 = require("ag-charts-community");
+var import_ag_charts_core89 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/map-util/geoGeometry.ts
+var import_ag_charts_community206 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/map-util/lineStringUtil.ts
+var delta2 = 1e-9;
+function lineSegmentDistanceToPointSquared(a, b, x, y) {
+ const [ax, ay] = a;
+ const [bx, by] = b;
+ const abx = bx - ax;
+ const aby = by - ay;
+ const l = abx * abx + aby * aby;
+ let x0;
+ let y0;
+ if (Math.abs(l) < delta2) {
+ x0 = ax;
+ y0 = ay;
+ } else {
+ let t = ((x - ax) * abx + (y - ay) * aby) / l;
+ t = Math.max(0, Math.min(1, t));
+ x0 = ax + t * (bx - ax);
+ y0 = ay + t * (by - ay);
+ }
+ const dx2 = x - x0;
+ const dy2 = y - y0;
+ return dx2 * dx2 + dy2 * dy2;
+}
+function lineStringDistance(lineString, x, y) {
+ let minDistanceSquared = Infinity;
+ let p0 = lineString.at(-1);
+ for (const p1 of lineString) {
+ minDistanceSquared = Math.min(minDistanceSquared, lineSegmentDistanceToPointSquared(p0, p1, x, y));
+ p0 = p1;
+ }
+ return Math.sqrt(minDistanceSquared);
+}
+function lineStringLength(lineSegment) {
+ let [x0, y0] = lineSegment[0];
+ let totalDistance = 0;
+ for (let i = 1; i < lineSegment.length; i += 1) {
+ const [x1, y1] = lineSegment[i];
+ const distance = Math.hypot(x1 - x0, y1 - y0);
+ totalDistance += distance;
+ x0 = x1;
+ y0 = y1;
+ }
+ return totalDistance;
+}
+function lineStringCenter(lineSegment) {
+ if (lineSegment.length === 0)
+ return;
+ const targetDistance = lineStringLength(lineSegment) / 2;
+ let [x0, y0] = lineSegment[0];
+ let totalDistance = 0;
+ for (let i = 1; i < lineSegment.length; i += 1) {
+ const [x1, y1] = lineSegment[i];
+ const segmentDistance = Math.hypot(x1 - x0, y1 - y0);
+ const nextDistance = totalDistance + segmentDistance;
+ if (nextDistance > targetDistance) {
+ const ratio3 = (targetDistance - totalDistance) / segmentDistance;
+ const point = [x0 + (x1 - x0) * ratio3, y0 + (y1 - y0) * ratio3];
+ const angle = Math.atan2(y1 - y0, x1 - x0);
+ return { point, angle };
+ }
+ totalDistance = nextDistance;
+ x0 = x1;
+ y0 = y1;
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/polygonUtil.ts
+var import_ag_charts_community205 = require("ag-charts-community");
+var { LonLatBBox } = import_ag_charts_community205._ModuleSupport;
+function polygonBbox(polygon, into) {
+ for (const coordinates of polygon) {
+ const [lon, lat] = coordinates;
+ into = LonLatBBox.extend(into, lon, lat, lon, lat);
+ }
+ return into;
+}
+function polygonCentroid(polygon) {
+ if (polygon.length === 0)
+ return;
+ let x = 0;
+ let y = 0;
+ let k = 0;
+ let [x0, y0] = polygon.at(-1);
+ for (const [x1, y1] of polygon) {
+ const c = x0 * y1 - x1 * y0;
+ k += c;
+ x += (x0 + x1) * c;
+ y += (y0 + y1) * c;
+ x0 = x1;
+ y0 = y1;
+ }
+ k *= 3;
+ return [x / k, y / k];
+}
+function polygonDistance(polygons, x, y) {
+ let inside = false;
+ let minDistanceSquared = Infinity;
+ for (const polygon of polygons) {
+ let p0 = polygon.at(-1);
+ let [x0, y0] = p0;
+ for (const p1 of polygon) {
+ const [x1, y1] = p1;
+ if (y1 > y !== y0 > y && x < (x0 - x1) * (y - y1) / (y0 - y1) + x1) {
+ inside = !inside;
+ }
+ minDistanceSquared = Math.min(minDistanceSquared, lineSegmentDistanceToPointSquared(p0, p1, x, y));
+ p0 = p1;
+ x0 = x1;
+ y0 = y1;
+ }
+ }
+ return (inside ? -1 : 1) * Math.sqrt(minDistanceSquared);
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/geoGeometry.ts
+var { Path: Path11, ExtendedPath2D: ExtendedPath2D5, BBox: BBox20, SceneChangeDetection: SceneChangeDetection9, SceneObjectChangeDetection, objectsEqual } = import_ag_charts_community206._ModuleSupport;
+var GeoGeometry = class extends Path11 {
+ constructor() {
+ super(...arguments);
+ this.projectedGeometry = void 0;
+ this.renderMode = 3 /* All */;
+ // Keep non-filled shapes separate so we don't fill them
+ this.strokePath = new ExtendedPath2D5();
+ }
+ computeBBox() {
+ if (this.dirtyPath || this.isDirtyPath()) {
+ this.updatePath();
+ this.dirtyPath = false;
+ }
+ return this.bbox?.clone();
+ }
+ updatePath() {
+ const { projectedGeometry } = this;
+ this.strokePath.clear();
+ this.path.clear();
+ this.bbox = projectedGeometry == null ? void 0 : this.drawGeometry(projectedGeometry, void 0);
+ }
+ drawPath(ctx) {
+ super.drawPath(ctx);
+ this.renderStroke(ctx, this.strokePath.getPath2D());
+ }
+ containsPoint(x, y) {
+ const { projectedGeometry } = this;
+ if (projectedGeometry == null)
+ return false;
+ if (!this.getBBox().containsPoint(x, y))
+ return false;
+ return this.geometryDistance(projectedGeometry, x, y) <= 0;
+ }
+ distanceSquared(x, y) {
+ const { projectedGeometry } = this;
+ if (projectedGeometry == null)
+ return Infinity;
+ const distance = this.geometryDistance(projectedGeometry, x, y);
+ return distance > 0 ? distance * distance : 0;
+ }
+ geometryDistance(geometry, x, y) {
+ const { renderMode, strokeWidth } = this;
+ const drawPolygons = (renderMode & 1 /* Polygons */) !== 0;
+ const drawLines = (renderMode & 2 /* Lines */) !== 0;
+ const minStrokeDistance = Math.max(strokeWidth / 2, 1) + 1;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return geometry.geometries.reduce(
+ (minDistance, g) => Math.min(minDistance, this.geometryDistance(g, x, y)),
+ Infinity
+ );
+ case "MultiPolygon":
+ return drawPolygons ? geometry.coordinates.reduce(
+ (minDistance, polygon) => Math.min(minDistance, Math.max(polygonDistance(polygon, x, y), 0)),
+ Infinity
+ ) : Infinity;
+ case "Polygon":
+ return drawPolygons ? Math.max(polygonDistance(geometry.coordinates, x, y), 0) : Infinity;
+ case "MultiLineString":
+ return drawLines ? geometry.coordinates.reduce((minDistance, lineString) => {
+ return Math.min(
+ minDistance,
+ Math.max(lineStringDistance(lineString, x, y) - minStrokeDistance, 0)
+ );
+ }, Infinity) : Infinity;
+ case "LineString":
+ return drawLines ? Math.max(lineStringDistance(geometry.coordinates, x, y) - minStrokeDistance, 0) : Infinity;
+ case "MultiPoint":
+ case "Point":
+ default:
+ return Infinity;
+ }
+ }
+ drawGeometry(geometry, bbox) {
+ const { renderMode, path, strokePath } = this;
+ const drawPolygons = (renderMode & 1 /* Polygons */) !== 0;
+ const drawLines = (renderMode & 2 /* Lines */) !== 0;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ for (const g of geometry.geometries) {
+ bbox = this.drawGeometry(g, bbox);
+ }
+ break;
+ case "MultiPolygon":
+ if (drawPolygons) {
+ for (const coordinates of geometry.coordinates) {
+ bbox = this.drawPolygon(path, coordinates, bbox);
+ }
+ }
+ break;
+ case "Polygon":
+ if (drawPolygons) {
+ bbox = this.drawPolygon(path, geometry.coordinates, bbox);
+ }
+ break;
+ case "LineString":
+ if (drawLines) {
+ bbox = this.drawLineString(strokePath, geometry.coordinates, bbox, false);
+ }
+ break;
+ case "MultiLineString":
+ if (drawLines) {
+ for (const coordinates of geometry.coordinates) {
+ bbox = this.drawLineString(strokePath, coordinates, bbox, false);
+ }
+ }
+ break;
+ case "Point":
+ case "MultiPoint":
+ break;
+ }
+ return bbox;
+ }
+ drawPolygon(path, polygons, bbox) {
+ if (polygons.length < 1)
+ return bbox;
+ bbox = this.drawLineString(path, polygons[0], bbox, true);
+ for (let i = 1; i < polygons.length; i += 1) {
+ const enclave = polygons[i];
+ this.drawLineString(path, enclave, void 0, true);
+ }
+ return bbox;
+ }
+ drawLineString(path, coordinates, bbox, isClosed) {
+ if (coordinates.length < 2)
+ return bbox;
+ const end = isClosed ? coordinates.length - 1 : coordinates.length;
+ for (let i = 0; i < end; i += 1) {
+ const [x, y] = coordinates[i];
+ if (i === 0) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ if (bbox == null) {
+ bbox = new BBox20(x, y, 0, 0);
+ } else {
+ const { x: x0, y: y0 } = bbox;
+ const x1 = x0 + bbox.width;
+ const y1 = y0 + bbox.height;
+ bbox.x = Math.min(x0, x);
+ bbox.y = Math.min(y0, y);
+ bbox.width = Math.max(x1, x) - bbox.x;
+ bbox.height = Math.max(y1, y) - bbox.y;
+ }
+ }
+ if (isClosed) {
+ path.closePath();
+ }
+ return bbox;
+ }
+};
+__decorateClass([
+ SceneObjectChangeDetection({ equals: objectsEqual })
+], GeoGeometry.prototype, "projectedGeometry", 2);
+__decorateClass([
+ SceneChangeDetection9()
+], GeoGeometry.prototype, "renderMode", 2);
+
+// packages/ag-charts-enterprise/src/series/map-util/geometryUtil.ts
+var import_ag_charts_community207 = require("ag-charts-community");
+var { LonLatBBox: LonLatBBox2 } = import_ag_charts_community207._ModuleSupport;
+function geometryBbox(geometry, into) {
+ if (geometry.bbox != null) {
+ const [lon0, lat0, lon1, lat1] = geometry.bbox;
+ into = LonLatBBox2.extend(into, lon0, lat0, lon1, lat1);
+ return into;
+ }
+ switch (geometry.type) {
+ case "GeometryCollection":
+ for (const g of geometry.geometries) {
+ into = geometryBbox(g, into);
+ }
+ break;
+ case "MultiPolygon":
+ for (const c of geometry.coordinates) {
+ if (c.length > 0) {
+ into = polygonBbox(c[0], into);
+ }
+ }
+ break;
+ case "Polygon":
+ if (geometry.coordinates.length > 0) {
+ into = polygonBbox(geometry.coordinates[0], into);
+ }
+ break;
+ case "MultiLineString":
+ for (const c of geometry.coordinates) {
+ into = polygonBbox(c, into);
+ }
+ break;
+ case "LineString":
+ into = polygonBbox(geometry.coordinates, into);
+ break;
+ case "MultiPoint":
+ for (const p of geometry.coordinates) {
+ const [lon, lat] = p;
+ into = LonLatBBox2.extend(into, lon, lat, lon, lat);
+ }
+ break;
+ case "Point": {
+ const [lon, lat] = geometry.coordinates;
+ into = LonLatBBox2.extend(into, lon, lat, lon, lat);
+ break;
+ }
+ }
+ return into;
+}
+function largestPolygon(geometry) {
+ switch (geometry.type) {
+ case "GeometryCollection": {
+ let maxArea;
+ let maxPolygon;
+ for (const g of geometry.geometries) {
+ const polygon = largestPolygon(g);
+ if (polygon == null)
+ continue;
+ const bbox = polygonBbox(polygon[0], void 0);
+ if (bbox == null)
+ continue;
+ const area = Math.abs(bbox.lat1 - bbox.lat0) * Math.abs(bbox.lon1 - bbox.lon0);
+ if (maxArea == null || area > maxArea) {
+ maxArea = area;
+ maxPolygon = polygon;
+ }
+ }
+ return maxPolygon;
+ }
+ case "MultiPolygon": {
+ let maxArea;
+ let maxPolygon;
+ for (const polygon of geometry.coordinates) {
+ const bbox = polygonBbox(polygon[0], void 0);
+ if (bbox == null)
+ continue;
+ const area = Math.abs(bbox.lat1 - bbox.lat0) * Math.abs(bbox.lon1 - bbox.lon0);
+ if (maxArea == null || area > maxArea) {
+ maxArea = area;
+ maxPolygon = polygon;
+ }
+ }
+ return maxPolygon;
+ }
+ case "Polygon":
+ return geometry.coordinates;
+ case "MultiLineString":
+ case "LineString":
+ case "MultiPoint":
+ case "Point":
+ return;
+ }
+}
+function largestLineString(geometry) {
+ switch (geometry.type) {
+ case "GeometryCollection": {
+ let maxLength;
+ let maxLineString;
+ for (const g of geometry.geometries) {
+ const lineString = largestLineString(g);
+ if (lineString == null)
+ continue;
+ const length = lineStringLength(lineString);
+ if (length == null)
+ continue;
+ if (maxLength == null || length > maxLength) {
+ maxLength = length;
+ maxLineString = lineString;
+ }
+ }
+ return maxLineString;
+ }
+ case "MultiLineString": {
+ let maxLength = 0;
+ let maxLineString;
+ for (const lineString of geometry.coordinates) {
+ const length = lineStringLength(lineString);
+ if (length > maxLength) {
+ maxLength = length;
+ maxLineString = lineString;
+ }
+ }
+ return maxLineString;
+ }
+ case "LineString":
+ return geometry.coordinates;
+ case "MultiPolygon":
+ case "Polygon":
+ case "MultiPoint":
+ case "Point":
+ return;
+ }
+}
+function containsType(geometry, type) {
+ if (geometry == null)
+ return false;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return geometry.geometries.some((g) => containsType(g, type));
+ case "MultiPolygon":
+ case "Polygon":
+ return (type & 1 /* Polygon */) !== 0;
+ case "MultiLineString":
+ case "LineString":
+ return (type & 2 /* LineString */) !== 0;
+ case "MultiPoint":
+ case "Point":
+ return (type & 4 /* Point */) !== 0;
+ }
+}
+function projectGeometry(geometry, scale) {
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return {
+ type: "GeometryCollection",
+ geometries: geometry.geometries.map((g) => projectGeometry(g, scale))
+ };
+ case "Polygon":
+ return {
+ type: "Polygon",
+ coordinates: projectPolygon(geometry.coordinates, scale)
+ };
+ case "MultiPolygon":
+ return {
+ type: "MultiPolygon",
+ coordinates: projectMultiPolygon(geometry.coordinates, scale)
+ };
+ case "MultiLineString":
+ return {
+ type: "MultiLineString",
+ coordinates: projectPolygon(geometry.coordinates, scale)
+ };
+ case "LineString":
+ return {
+ type: "LineString",
+ coordinates: projectLineString(geometry.coordinates, scale)
+ };
+ case "MultiPoint":
+ return {
+ type: "MultiPoint",
+ coordinates: projectLineString(geometry.coordinates, scale)
+ };
+ case "Point":
+ return {
+ type: "Point",
+ coordinates: scale.convert(geometry.coordinates)
+ };
+ }
+}
+function projectMultiPolygon(multiPolygon, scale) {
+ return multiPolygon.map((polygon) => projectPolygon(polygon, scale));
+}
+function projectPolygon(polygon, scale) {
+ return polygon.map((lineString) => projectLineString(lineString, scale));
+}
+function projectLineString(lineString, scale) {
+ return lineString.map((lonLat) => scale.convert(lonLat));
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/mapUtil.ts
+function prepareMapMarkerAnimationFunctions() {
+ const fromFn = (marker, _datum, status) => {
+ if (status === "removed") {
+ return { scalingX: 1, scalingY: 1 };
+ } else if (marker.previousDatum == null) {
+ return { scalingX: 0, scalingY: 0 };
+ }
+ return { scalingX: marker.scalingX, scalingY: marker.scalingY };
+ };
+ const toFn = (_marker, _datum, status) => {
+ if (status === "removed") {
+ return { scalingX: 0, scalingY: 0 };
+ }
+ return { scalingX: 1, scalingY: 1 };
+ };
+ return { fromFn, toFn };
+}
+function findFocusedGeoGeometry(series, opts) {
+ const datum = series.contextNodeData?.nodeData[opts.datumIndex];
+ if (datum === void 0)
+ return void 0;
+ for (const node of series.datumSelection.nodes()) {
+ if (node.datum === datum) {
+ return node;
+ }
+ }
+ return void 0;
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/topologySeries.ts
+var import_ag_charts_community208 = require("ag-charts-community");
+var TopologySeriesProperties = class extends import_ag_charts_community208._ModuleSupport.SeriesProperties {
+};
+var TopologySeries = class extends import_ag_charts_community208._ModuleSupport.DataModelSeries {
+ addChartEventListeners() {
+ this.cleanup.register(
+ this.ctx.eventsHub.on("legend:item-click", (event) => {
+ this.onLegendItemClick(event);
+ }),
+ this.ctx.eventsHub.on("legend:item-double-click", (event) => {
+ this.onLegendItemDoubleClick(event);
+ })
+ );
+ }
+ getSeriesDomain() {
+ return [Number.NaN, Number.NaN];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeriesProperties.ts
+var import_ag_charts_community209 = require("ag-charts-community");
+var { Property: Property70, SeriesProperties: SeriesProperties3, makeSeriesTooltip: makeSeriesTooltip12, Label: Label10 } = import_ag_charts_community209._ModuleSupport;
+var MapLineSeriesProperties = class extends SeriesProperties3 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.idKey = "";
+ this.topologyIdKey = "name";
+ this.idName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.colorRange = void 0;
+ this.maxStrokeWidth = void 0;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.label = new Label10();
+ this.tooltip = makeSeriesTooltip12();
+ }
+ getStyle() {
+ const { stroke: stroke2, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this;
+ return {
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "topologyIdKey", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "sizeDomain", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "maxStrokeWidth", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property70
+], MapLineSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeries.ts
+var {
+ getMissCount: getMissCount2,
+ getLabelStyles: getLabelStyles2,
+ createDatumId: createDatumId10,
+ SeriesNodePickMode: SeriesNodePickMode9,
+ valueProperty: valueProperty12,
+ ColorScale: ColorScale2,
+ LinearScale: LinearScale5,
+ Selection: Selection8,
+ Text: Text4,
+ Transformable: Transformable2,
+ mergeDefaults: mergeDefaults13
+} = import_ag_charts_community210._ModuleSupport;
+var MapLineSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ propertyKeys: {
+ size: ["colorKey"],
+ color: ["colorKey"],
+ label: ["labelKey"]
+ },
+ propertyNames: {
+ size: ["sizeName"],
+ color: ["colorName"],
+ label: ["labelName"]
+ },
+ pickModes: [SeriesNodePickMode9.EXACT_SHAPE_MATCH, SeriesNodePickMode9.NEAREST_NODE],
+ usesPlacedLabels: true
+ });
+ this.properties = new MapLineSeriesProperties();
+ this._chartTopology = void 0;
+ this.colorScale = new ColorScale2();
+ this.sizeScale = new LinearScale5();
+ this.datumSelection = Selection8.select(
+ this.contentGroup,
+ () => this.nodeFactory()
+ );
+ this.labelSelection = Selection8.select(this.labelGroup, Text4);
+ this.highlightDatumSelection = Selection8.select(
+ this.highlightGroup,
+ () => this.nodeFactory()
+ );
+ this._previousDatumMidPoint = void 0;
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get hasData() {
+ return super.hasData && this.topology != null;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [1 /* ShapeLine */, zIndex];
+ this.highlightGroup.zIndex = [2 /* ShapeLineHighlight */, zIndex];
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ isLabelEnabled() {
+ return this.properties.labelKey != null && this.properties.label.enabled;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 2 /* Lines */;
+ geoGeometry.lineJoin = "round";
+ geoGeometry.lineCap = "round";
+ return geoGeometry;
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const { data, topology, sizeScale, colorScale } = this;
+ const { topologyIdKey, idKey, sizeKey, colorKey, labelKey, sizeDomain, colorRange } = this.properties;
+ const featureById = /* @__PURE__ */ new Map();
+ for (const feature of topology?.features.values() ?? []) {
+ const property = feature.properties?.[topologyIdKey];
+ if (property == null || !containsType(feature.geometry, 2 /* LineString */))
+ continue;
+ featureById.set(property, feature);
+ }
+ const sizeScaleType = this.sizeScale.type;
+ const colorScaleType = this.colorScale.type;
+ const mercatorScaleType = this.scale?.type;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, data, {
+ props: [
+ valueProperty12(idKey, mercatorScaleType, { id: "idValue", includeProperty: false }),
+ valueProperty12(idKey, mercatorScaleType, {
+ id: "featureValue",
+ includeProperty: false,
+ processor: () => (datum) => featureById.get(datum)
+ }),
+ ...labelKey == null ? [] : [valueProperty12(labelKey, "category", { id: "labelValue" })],
+ ...sizeKey == null ? [] : [valueProperty12(sizeKey, sizeScaleType, { id: "sizeValue" })],
+ ...colorKey == null ? [] : [valueProperty12(colorKey, colorScaleType, { id: "colorValue" })]
+ ]
+ });
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ this.topologyBounds = featureValues.reduce((current, feature) => {
+ const geometry = feature?.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (sizeKey != null) {
+ const sizeIdx = dataModel.resolveProcessedDataIndexById(this, `sizeValue`);
+ const processedSize = processedData.domain.values[sizeIdx] ?? [];
+ sizeScale.domain = sizeDomain ?? processedSize;
+ }
+ if (colorRange != null && this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ colorScale.domain = processedData.domain.values[colorKeyIdx];
+ colorScale.range = colorRange;
+ colorScale.update();
+ }
+ if (topology == null) {
+ import_ag_charts_core89.Logger.warnOnce(`no topology was provided for [MapLineSeries]; nothing will be rendered.`);
+ }
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount2(this, processedData.defs.values[colorIdx].missing);
+ const colorDataMissing = dataCount === 0 || dataCount === missCount;
+ return !colorDataMissing;
+ }
+ getLabelDatum(datum, labelValue, projectedGeometry, measurer2) {
+ if (labelValue == null || projectedGeometry == null)
+ return;
+ const lineString = largestLineString(projectedGeometry);
+ if (lineString == null)
+ return;
+ const { idKey, idName, sizeKey, sizeName, colorKey, colorName, labelKey, labelName, label } = this.properties;
+ if (labelKey == null || !label.enabled)
+ return;
+ const labelText = this.getLabelText(
+ labelValue,
+ datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ {
+ value: labelValue,
+ datum,
+ idKey,
+ idName,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName
+ }
+ );
+ if (labelText == null)
+ return;
+ const labelSize = measurer2.measureLines(String(labelText));
+ const labelCenter = lineStringCenter(lineString);
+ if (labelCenter == null)
+ return;
+ const [x, y] = labelCenter.point;
+ const { width, height } = labelSize;
+ return {
+ point: { x, y, size: 0 },
+ label: { width, height, text: labelText },
+ anchor: void 0,
+ placement: void 0
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, dataModel, processedData, sizeScale, properties, scale } = this;
+ const { idKey, sizeKey, colorKey, labelKey, label, legendItemName } = properties;
+ if (dataModel == null || processedData == null)
+ return;
+ const idValues = dataModel.resolveColumnById(this, `idValue`, processedData);
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ const labelValues = labelKey == null ? void 0 : dataModel.resolveColumnById(this, `labelValue`, processedData);
+ const sizeValues = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData);
+ const colorValues = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData);
+ const maxStrokeWidth = properties.maxStrokeWidth ?? properties.strokeWidth;
+ sizeScale.range = [Math.min(properties.strokeWidth, maxStrokeWidth), maxStrokeWidth];
+ const measurer2 = (0, import_ag_charts_core89.cachedTextMeasurer)(label);
+ const projectedGeometries = /* @__PURE__ */ new Map();
+ for (const [datumIndex] of processedData.dataSources.get(this.id)?.data.entries() ?? []) {
+ const id = idValues[datumIndex];
+ const geometry = featureValues[datumIndex]?.geometry ?? void 0;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (id != null && projectedGeometry != null) {
+ projectedGeometries.set(id, projectedGeometry);
+ }
+ }
+ const nodeData = [];
+ const labelData = [];
+ const missingGeometries = [];
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const idValue = idValues[datumIndex];
+ const colorValue = colorValues?.[datumIndex];
+ const sizeValue = sizeValues?.[datumIndex];
+ const labelValue = labelValues?.[datumIndex];
+ const projectedGeometry = projectedGeometries.get(idValue);
+ if (projectedGeometry == null) {
+ missingGeometries.push(idValue);
+ }
+ const labelDatum = this.getLabelDatum(datum, labelValue, projectedGeometry, measurer2);
+ if (labelDatum != null) {
+ labelData.push(labelDatum);
+ }
+ nodeData.push({
+ series: this,
+ itemId: idKey,
+ datum,
+ datumIndex,
+ idValue,
+ labelValue,
+ colorValue,
+ sizeValue,
+ projectedGeometry,
+ legendItemName,
+ style: this.getItemStyle({ datumIndex, datum, colorValue, sizeValue }, false)
+ });
+ }
+ const missingGeometriesCap = 10;
+ if (missingGeometries.length > missingGeometriesCap) {
+ const excessItems = missingGeometries.length - missingGeometriesCap;
+ missingGeometries.length = missingGeometriesCap;
+ missingGeometries.push(`(+${excessItems} more)`);
+ }
+ if (missingGeometries.length > 0) {
+ import_ag_charts_core89.Logger.warnOnce(`some data items do not have matches in the provided topology`, missingGeometries);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection, highlightDatumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const { legendItemName } = this.properties;
+ const matchingLegendItemName = legendItemName != null && highlightedDatum?.datum == null && legendItemName === highlightedDatum?.legendItemName;
+ if (highlightedDatum != null && (highlightedDatum.series !== this && !matchingLegendItemName || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumStyles({ datumSelection, isHighlight: false });
+ this.updateDatumNodes({ datumSelection, isHighlight: false });
+ this.highlightDatumSelection = this.updateDatumSelection({
+ nodeData: highlightedDatum == null ? [] : [highlightedDatum],
+ datumSelection: highlightDatumSelection
+ });
+ this.updateDatumStyles({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.updateDatumNodes({ datumSelection: highlightDatumSelection, isHighlight: true });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId10(datum.idValue));
+ }
+ getItemStyle({ datumIndex = 0, datum, colorValue, sizeValue }, isHighlight) {
+ const { properties, colorScale, sizeScale } = this;
+ const { colorRange, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const style = mergeDefaults13(highlightStyle, properties.getStyle());
+ if (!isHighlight && colorValue != null) {
+ style.stroke = this.isColorScaleValid() ? colorScale.convert(colorValue) : colorRange?.[0] ?? properties.stroke;
+ }
+ if (sizeValue != null) {
+ style.strokeWidth = sizeScale.convert(sizeValue, { clamp: true });
+ }
+ let overrides;
+ if (itemStyler != null) {
+ overrides = this.cachedDatumCallback(createDatumId10(datumIndex, isHighlight ? "highlight" : "node"), () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ });
+ }
+ return overrides ? mergeDefaults13(style, overrides) : style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ datumSelection.each((geoGeometry, nodeDatum) => {
+ const { projectedGeometry, style } = nodeDatum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ geoGeometry.setProperties(style);
+ });
+ }
+ updatePlacedLabelData(labelData) {
+ this.labelSelection = this.labelSelection.update(labelData, (text2) => {
+ text2.pointerEvents = import_ag_charts_community210._ModuleSupport.PointerEvents.None;
+ });
+ this.updateLabelNodes({ labelSelection: this.labelSelection });
+ }
+ updateLabelNodes(opts) {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { x, y, width, height, text: text2 }, datumIndex) => {
+ const style = getLabelStyles2(this, void 0, properties, properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontSize, fontFamily } = style;
+ label.visible = true;
+ label.x = x + width / 2;
+ label.y = y + height / 2;
+ label.text = text2;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.setBoxing(style);
+ });
+ }
+ resetAnimation() {
+ }
+ getLabelData() {
+ if (!this.isLabelEnabled())
+ return [];
+ return this.contextNodeData?.labelData ?? [];
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.datumSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ datumMidPoint(datum) {
+ const { _previousDatumMidPoint } = this;
+ if (_previousDatumMidPoint?.datum === datum) {
+ return _previousDatumMidPoint.point;
+ }
+ const projectedGeometry = datum.projectedGeometry;
+ const lineString = projectedGeometry == null ? void 0 : largestLineString(projectedGeometry);
+ const center = lineString == null ? void 0 : lineStringCenter(lineString)?.point;
+ const point = center == null ? void 0 : { x: center[0], y: center[1] };
+ this._previousDatumMidPoint = { datum, point };
+ return point;
+ }
+ legendItemSymbol(datumIndex) {
+ const { dataModel, processedData, properties } = this;
+ const { strokeWidth, strokeOpacity, lineDash } = properties;
+ let { stroke: stroke2 } = properties;
+ if (datumIndex != null && this.isColorScaleValid()) {
+ const colorValues = dataModel.resolveColumnById(this, "colorValue", processedData);
+ const colorValue = colorValues[datumIndex];
+ stroke2 = this.colorScale.convert(colorValue);
+ }
+ return {
+ marker: {
+ fill: void 0,
+ fillOpacity: 0,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 0,
+ lineDash: [0],
+ lineDashOffset: 0,
+ enabled: false
+ },
+ line: {
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const { processedData, dataModel } = this;
+ if (processedData == null || dataModel == null)
+ return [];
+ const { id: seriesId, visible } = this;
+ const { title, legendItemName, idKey, idName, colorKey, colorRange, showInLegend } = this.properties;
+ if (legendType === "gradient" && colorKey != null && colorRange != null) {
+ const colorDomain = processedData.domain.values[dataModel.resolveProcessedDataIndexById(this, "colorValue")];
+ const legendDatum = {
+ legendType: "gradient",
+ enabled: visible,
+ seriesId,
+ series: this.getFormatterContext("color"),
+ colorRange,
+ colorDomain
+ };
+ return [legendDatum];
+ } else if (legendType === "category") {
+ const legendDatum = {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible,
+ label: { text: legendItemName ?? title ?? idName ?? idKey },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ };
+ return [legendDatum];
+ } else {
+ return [];
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const {
+ idKey,
+ idName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ title,
+ legendItemName,
+ tooltip
+ } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const idValues = dataModel.resolveColumnById(this, `idValue`, processedData);
+ const sizeValue = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData)[datumIndex];
+ const colorValue = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex];
+ const data = [];
+ if (this.isLabelEnabled() && labelKey != null && labelKey !== idKey) {
+ const labelValue = dataModel.resolveColumnById(this, `labelValue`, processedData)[datumIndex];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "category",
+ value: labelValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: labelKey,
+ source: "tooltip",
+ property: "label",
+ domain: [],
+ boundSeries: this.getFormatterContext("label")
+ });
+ data.push({ label: labelName, fallbackLabel: labelKey, value: content ?? labelValue });
+ }
+ if (sizeValue != null && sizeKey != null) {
+ const domain = dataModel.getDomain(this, `sizeValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: sizeValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain,
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(sizeValue) });
+ }
+ if (colorValue != null && colorKey != null) {
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? String(colorValue) });
+ }
+ const format = this.getItemStyle({ datumIndex, datum, colorValue, sizeValue }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: idValues[datumIndex],
+ title: title ?? legendItemName,
+ symbol: this.legendItemSymbol(datumIndex),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ idKey,
+ idName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(opts) {
+ const geometry = findFocusedGeoGeometry(this, opts);
+ return geometry ? Transformable2.toCanvas(this.contentGroup, geometry.getBBox()) : void 0;
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+MapLineSeries.className = "MapLineSeries";
+MapLineSeries.type = "map-line";
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineSeriesOptionsDef.ts
+var import_ag_charts_community211 = require("ag-charts-community");
+var import_ag_charts_core90 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs11, mapLineSeriesThemeableOptionsDef, without: without5 } = import_ag_charts_community211._ModuleSupport;
+var mapLineSeriesOptionsDef = {
+ ...without5(commonSeriesOptionsDefs11, ["highlightStyle", "highlight"]),
+ ...mapLineSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core90.required)((0, import_ag_charts_core90.constant)("map-line")),
+ idKey: (0, import_ag_charts_core90.required)(import_ag_charts_core90.string),
+ sizeKey: import_ag_charts_core90.string,
+ colorKey: import_ag_charts_core90.string,
+ labelKey: import_ag_charts_core90.string,
+ idName: import_ag_charts_core90.string,
+ sizeName: import_ag_charts_core90.string,
+ colorName: import_ag_charts_core90.string,
+ labelName: import_ag_charts_core90.string,
+ topology: import_ag_charts_core90.geoJson,
+ topologyIdKey: import_ag_charts_core90.string,
+ legendItemName: import_ag_charts_core90.string,
+ title: import_ag_charts_core90.string
+};
+mapLineSeriesOptionsDef.colorRange = (0, import_ag_charts_core90.undocumented)((0, import_ag_charts_core90.and)((0, import_ag_charts_core90.arrayOf)(import_ag_charts_core90.color), (0, import_ag_charts_core90.arrayLength)(1)));
+
+// packages/ag-charts-enterprise/src/series/map-line/mapLineModule.ts
+var MapLineModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-line",
+ moduleFactory: (ctx) => new MapLineSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ stroke: applyMapPalette(import_ag_charts_community212._ModuleSupport.SAFE_STROKE_FILL_OPERATION),
+ // @ts-expect-error undocumented option
+ colorRange: {
+ $if: [
+ { $eq: [{ $mapPalette: "type" }, "inbuilt"] },
+ { $mapPalette: "divergingColors" },
+ applyMapPalette(import_ag_charts_community212._ModuleSupport.SAFE_RANGE2_OPERATION)
+ ]
+ },
+ strokeWidth: 1,
+ maxStrokeWidth: 3,
+ lineDash: [0],
+ lineDashOffset: 0,
+ label: {
+ ...import_ag_charts_community212._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: applyMapPalette(import_ag_charts_community212._ModuleSupport.multiSeriesHighlightStyle(false))
+ },
+ tooltip: {
+ range: "exact"
+ }
+ }
+};
+var MapLineSeriesModule = {
+ type: "series",
+ name: "map-line",
+ chartType: "topology",
+ enterprise: true,
+ options: mapLineSeriesOptionsDef,
+ create: (ctx) => new MapLineSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeries.ts
+var import_ag_charts_community214 = require("ag-charts-community");
+var import_ag_charts_core91 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeriesProperties.ts
+var import_ag_charts_community213 = require("ag-charts-community");
+var { Property: Property71, SeriesProperties: SeriesProperties4, makeSeriesTooltip: makeSeriesTooltip13 } = import_ag_charts_community213._ModuleSupport;
+var MapLineBackgroundSeriesProperties = class extends SeriesProperties4 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.tooltip = makeSeriesTooltip13();
+ }
+};
+__decorateClass([
+ Property71
+], MapLineBackgroundSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property71
+], MapLineBackgroundSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property71
+], MapLineBackgroundSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property71
+], MapLineBackgroundSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property71
+], MapLineBackgroundSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property71
+], MapLineBackgroundSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property71
+], MapLineBackgroundSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeries.ts
+var { createDatumId: createDatumId11, Group: Group12, Selection: Selection9, PointerEvents: PointerEvents6 } = import_ag_charts_community214._ModuleSupport;
+var MapLineBackgroundSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ pickModes: []
+ });
+ this.properties = new MapLineBackgroundSeriesProperties();
+ this._chartTopology = void 0;
+ this.itemGroup = this.contentGroup.appendChild(new Group12({ name: "itemGroup" }));
+ this.datumSelection = Selection9.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.itemGroup.pointerEvents = PointerEvents6.None;
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get focusable() {
+ return false;
+ }
+ setOptionsData() {
+ }
+ setChartData() {
+ }
+ get hasData() {
+ return false;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 0];
+ this.highlightGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 1];
+ return true;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 2 /* Lines */;
+ geoGeometry.lineJoin = "round";
+ geoGeometry.lineCap = "round";
+ geoGeometry.pointerEvents = PointerEvents6.None;
+ return geoGeometry;
+ }
+ processData() {
+ const { topology } = this;
+ this.topologyBounds = topology?.features.reduce((current, feature) => {
+ const geometry = feature.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (topology == null) {
+ import_ag_charts_core91.Logger.warnOnce(`no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.`);
+ }
+ }
+ createNodeData() {
+ const { id: seriesId, topology, scale, properties } = this;
+ if (topology == null)
+ return;
+ const { stroke: stroke2, strokeOpacity, lineDash, lineDashOffset, strokeWidth } = properties;
+ const nodeData = [];
+ const labelData = [];
+ for (const [index, feature] of topology.features.entries()) {
+ const { geometry } = feature;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (projectedGeometry == null)
+ continue;
+ nodeData.push({
+ series: this,
+ itemId: index,
+ datum: feature,
+ datumIndex: 0,
+ index,
+ projectedGeometry,
+ style: { stroke: stroke2, strokeOpacity, lineDash, lineDashOffset, strokeWidth }
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ const { nodeData = [] } = this.contextNodeData ?? {};
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId11(datum.index));
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ datumSelection.each((geoGeometry, datum) => {
+ const { projectedGeometry } = datum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ geoGeometry.setProperties(datum.style);
+ });
+ }
+ resetAnimation() {
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(_seriesDatum) {
+ return;
+ }
+ computeFocusBounds(_opts) {
+ return void 0;
+ }
+ hasItemStylers() {
+ return false;
+ }
+};
+MapLineBackgroundSeries.className = "MapLineBackgroundSeries";
+MapLineBackgroundSeries.type = "map-line-background";
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundSeriesOptionsDef.ts
+var import_ag_charts_community215 = require("ag-charts-community");
+var import_ag_charts_core92 = require("ag-charts-core");
+var { mapLineBackgroundSeriesThemeableOptionsDef } = import_ag_charts_community215._ModuleSupport;
+var mapLineBackgroundSeriesOptionsDef = {
+ ...mapLineBackgroundSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core92.required)((0, import_ag_charts_core92.constant)("map-line-background")),
+ topology: import_ag_charts_core92.geoJson
+};
+
+// packages/ag-charts-enterprise/src/series/map-line-background/mapLineBackgroundModule.ts
+var MapLineBackgroundModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-line-background",
+ moduleFactory: (ctx) => new MapLineBackgroundSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ stroke: { $path: ["/1", { $mapPalette: "stroke" }, { $mapPalette: "secondHierarchyColors" }] },
+ strokeWidth: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ }
+ }
+};
+var MapLineBackgroundSeriesModule = {
+ type: "series",
+ name: "map-line-background",
+ chartType: "topology",
+ enterprise: true,
+ options: mapLineBackgroundSeriesOptionsDef,
+ create: (ctx) => new MapLineBackgroundSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerModule.ts
+var import_ag_charts_community220 = require("ag-charts-community");
+var import_ag_charts_core96 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeries.ts
+var import_ag_charts_community218 = require("ag-charts-community");
+var import_ag_charts_core94 = require("ag-charts-core");
+
+// packages/ag-charts-types/src/chart/navigatorOptions.ts
+var __MINI_CHART_SERIES_OPTIONS = void 0;
+var __VERIFY_MINI_CHART_SERIES_OPTIONS = void 0;
+__VERIFY_MINI_CHART_SERIES_OPTIONS = __MINI_CHART_SERIES_OPTIONS;
+
+// packages/ag-charts-types/src/chart/themeOptions.ts
+var __THEME_OVERRIDES = void 0;
+var __VERIFY_THEME_OVERRIDES = void 0;
+__VERIFY_THEME_OVERRIDES = __THEME_OVERRIDES;
+
+// packages/ag-charts-types/src/presets/gauge/commonOptions.ts
+var __THEMEABLE_OPTIONS = void 0;
+var __VERIFY_THEMEABLE_OPTIONS = void 0;
+__VERIFY_THEMEABLE_OPTIONS = __THEMEABLE_OPTIONS;
+var __AXIS_LABEL_OPTIONS = void 0;
+var __VERIFY_AXIS_LABEL_OPTIONS = void 0;
+__VERIFY_AXIS_LABEL_OPTIONS = __AXIS_LABEL_OPTIONS;
+
+// packages/ag-charts-enterprise/src/series/map-util/polygonPointSearch.ts
+var import_ag_charts_core93 = require("ag-charts-core");
+function polygonPointSearch(polygons, precision, valueFn) {
+ const bbox = polygonBbox(polygons[0], void 0);
+ if (bbox == null)
+ return;
+ const boundingXCenter = (bbox.lon0 + bbox.lon1) / 2;
+ const boundingYCenter = (bbox.lat0 + bbox.lat1) / 2;
+ const boundingWidth = Math.abs(bbox.lon1 - bbox.lon0);
+ const boundingHeight = Math.abs(bbox.lat1 - bbox.lat0);
+ const centroid = polygonCentroid(polygons[0]);
+ const [cx, cy] = centroid;
+ const centroidDistanceToPolygon = -polygonDistance(polygons, cx, cy);
+ let bestResult;
+ const cellValue = (distanceToPolygon, distanceToCentroid) => {
+ const centroidDriftFactor = 0.5;
+ const centroidDrift = Math.max(distanceToCentroid - centroidDistanceToPolygon, 0);
+ return distanceToPolygon - centroidDriftFactor * centroidDrift;
+ };
+ const createLabelPlacement = (x2, y2, stride) => {
+ const { distance: distance2, maxDistance } = valueFn(polygons, x2, y2, stride);
+ const distanceToCentroid = Math.hypot(cx - x2, cy - y2);
+ const maxXTowardsCentroid = Math.min(Math.max(cx, x2 - stride / 2), x2 + stride / 2);
+ const maxYTowardsCentroid = Math.min(Math.max(cy, y2 - stride / 2), y2 + stride / 2);
+ const minDistanceToCentroid = Math.hypot(cx - maxXTowardsCentroid, cy - maxYTowardsCentroid);
+ const value = cellValue(distance2, distanceToCentroid);
+ const maxValue = cellValue(maxDistance, minDistanceToCentroid);
+ return { distance: distance2, maxDistance, value, maxValue, x: x2, y: y2, stride };
+ };
+ const appendLabelPlacement = (into, x2, y2, stride) => {
+ const labelPlacement = createLabelPlacement(x2, y2, stride);
+ if (labelPlacement.maxDistance >= 0) {
+ into.push(labelPlacement);
+ }
+ };
+ const initialStride = Math.min(boundingWidth, boundingHeight) / 2;
+ let queue = {
+ value: createLabelPlacement(boundingXCenter, boundingYCenter, initialStride),
+ next: null
+ };
+ while (queue != null) {
+ const item = queue.value;
+ const { distance: distance2, value, maxValue, x: x2, y: y2, stride } = item;
+ queue = queue.next;
+ if (distance2 > 0 && (bestResult == null || value > bestResult.value)) {
+ bestResult = item;
+ }
+ if (bestResult != null && maxValue - bestResult.value <= precision) {
+ continue;
+ }
+ const nextStride = stride / 2;
+ const newLabelPlacements = [];
+ appendLabelPlacement(newLabelPlacements, x2 - nextStride, y2 - nextStride, nextStride);
+ appendLabelPlacement(newLabelPlacements, x2 + nextStride, y2 - nextStride, nextStride);
+ appendLabelPlacement(newLabelPlacements, x2 - nextStride, y2 + nextStride, nextStride);
+ appendLabelPlacement(newLabelPlacements, x2 + nextStride, y2 + nextStride, nextStride);
+ newLabelPlacements.sort(labelPlacementCmp);
+ queue = (0, import_ag_charts_core93.insertListItemsSorted)(queue, newLabelPlacements, labelPlacementCmp);
+ }
+ if (bestResult == null)
+ return;
+ const { distance, x, y } = bestResult;
+ return { x, y, distance };
+}
+var labelPlacementCmp = (a, b) => b.maxValue - a.maxValue;
+
+// packages/ag-charts-enterprise/src/series/map-util/markerUtil.ts
+function polygonMarkerCenter(polygons, precision) {
+ const result = polygonPointSearch(polygons, precision, (p, x2, y2, stride) => {
+ const distance = -polygonDistance(p, x2, y2);
+ const maxDistance = distance + stride * Math.SQRT2;
+ return { distance, maxDistance };
+ });
+ if (result == null)
+ return;
+ const { x, y } = result;
+ return [x, y];
+}
+function markerPositions(geometry, precision) {
+ let center;
+ switch (geometry.type) {
+ case "GeometryCollection":
+ return geometry.geometries.flatMap((g) => markerPositions(g, precision));
+ case "MultiPoint":
+ return geometry.coordinates;
+ case "Point":
+ return [geometry.coordinates];
+ case "MultiPolygon": {
+ const polygon = largestPolygon(geometry);
+ center = polygon == null ? void 0 : polygonMarkerCenter(polygon, precision);
+ break;
+ }
+ case "Polygon": {
+ const polygon = geometry.coordinates;
+ center = polygon == null ? void 0 : polygonMarkerCenter(polygon, precision);
+ break;
+ }
+ case "MultiLineString": {
+ const lineString = largestLineString(geometry);
+ center = lineString == null ? void 0 : lineStringCenter(lineString)?.point;
+ break;
+ }
+ case "LineString": {
+ const lineString = geometry.coordinates;
+ center = lineStringCenter(lineString)?.point;
+ break;
+ }
+ }
+ return center == null ? [] : [center];
+}
+
+// packages/ag-charts-enterprise/src/series/map-util/shapeFillBBox.ts
+var import_ag_charts_community216 = require("ag-charts-community");
+var { BBox: BBox21 } = import_ag_charts_community216._ModuleSupport;
+function getTopologyShapeFillBBox(scale) {
+ if (!scale)
+ return;
+ const { range: range2 } = scale;
+ const x = range2[0][0];
+ const y = range2[0][1];
+ const width = range2[1][0] - x;
+ const height = range2[1][1] - y;
+ const bbox = new BBox21(x, y, width, height);
+ return {
+ series: bbox,
+ axis: bbox
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeriesProperties.ts
+var import_ag_charts_community217 = require("ag-charts-community");
+var { Property: Property72, SeriesProperties: SeriesProperties5, makeSeriesTooltip: makeSeriesTooltip14, Label: Label11 } = import_ag_charts_community217._ModuleSupport;
+var MapMarkerSeriesLabel = class extends Label11 {
+ constructor() {
+ super(...arguments);
+ this.placement = "bottom";
+ }
+};
+__decorateClass([
+ Property72
+], MapMarkerSeriesLabel.prototype, "placement", 2);
+var MapMarkerSeriesProperties = class extends SeriesProperties5 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.idKey = void 0;
+ this.topologyIdKey = "name";
+ this.idName = void 0;
+ this.latitudeKey = void 0;
+ this.latitudeName = void 0;
+ this.longitudeKey = void 0;
+ this.longitudeName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.colorRange = void 0;
+ this.shape = "circle";
+ this.size = 6;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.label = new MapMarkerSeriesLabel();
+ this.tooltip = makeSeriesTooltip14();
+ }
+ getStyle() {
+ const { size, shape, fill, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ size,
+ shape,
+ fill,
+ fillOpacity,
+ opacity: 1,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "topologyIdKey", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "latitudeKey", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "latitudeName", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "longitudeKey", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "longitudeName", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "shape", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "size", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "maxSize", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "sizeDomain", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property72
+], MapMarkerSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeries.ts
+var {
+ fromToMotion: fromToMotion3,
+ StateMachine: StateMachine13,
+ getMissCount: getMissCount3,
+ createDatumId: createDatumId12,
+ SeriesNodePickMode: SeriesNodePickMode10,
+ valueProperty: valueProperty13,
+ computeMarkerFocusBounds: computeMarkerFocusBounds2,
+ ColorScale: ColorScale3,
+ LinearScale: LinearScale6,
+ Group: Group13,
+ Selection: Selection10,
+ Text: Text5,
+ Marker: Marker4,
+ applyShapeStyle: applyShapeStyle11,
+ getLabelStyles: getLabelStyles3,
+ LonLatBBox: LonLatBBox3,
+ mergeDefaults: mergeDefaults14
+} = import_ag_charts_community218._ModuleSupport;
+var MapMarkerSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ propertyKeys: {
+ size: ["colorKey"],
+ color: ["colorKey"],
+ label: ["labelKey"]
+ },
+ propertyNames: {
+ size: ["sizeName"],
+ color: ["colorName"],
+ label: ["labelName"]
+ },
+ pickModes: [SeriesNodePickMode10.EXACT_SHAPE_MATCH, SeriesNodePickMode10.NEAREST_NODE],
+ usesPlacedLabels: true
+ });
+ this.properties = new MapMarkerSeriesProperties();
+ this._chartTopology = void 0;
+ this.colorScale = new ColorScale3();
+ this.sizeScale = new LinearScale6();
+ this.markerGroup = this.contentGroup.appendChild(new Group13({ name: "markerGroup" }));
+ this.labelSelection = Selection10.select(this.labelGroup, Text5, false);
+ this.markerSelection = Selection10.select(
+ this.markerGroup,
+ Marker4,
+ false
+ );
+ this.highlightMarkerSelection = Selection10.select(this.highlightGroup, Marker4);
+ this.animationState = new StateMachine13(
+ "empty",
+ {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateMarkers()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ updateData: "waiting",
+ clear: "clearing",
+ resize: () => this.resetAllAnimation(),
+ reset: "empty",
+ skip: "ready"
+ },
+ waiting: {
+ update: {
+ target: "ready",
+ action: () => this.animateMarkers()
+ },
+ // chart.ts transitions to updateData on zoom change
+ resize: {
+ target: "ready",
+ action: () => this.resetAllAnimation()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ clearing: {
+ update: {
+ target: "empty",
+ action: () => this.resetAllAnimation()
+ },
+ reset: "empty",
+ skip: "ready"
+ }
+ },
+ () => this.checkProcessedDataAnimatable()
+ );
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get hasData() {
+ const hasLatLon = this.properties.latitudeKey != null && this.properties.longitudeKey != null;
+ return super.hasData && (this.topology != null || hasLatLon);
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [3 /* Marker */, zIndex];
+ this.highlightGroup.zIndex = [4 /* MarkerHighlight */, zIndex];
+ return true;
+ }
+ isLabelEnabled() {
+ return this.properties.labelKey != null && this.properties.label.enabled;
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const { data, topology, sizeScale, colorScale } = this;
+ const { topologyIdKey, idKey, latitudeKey, longitudeKey, sizeKey, colorKey, labelKey, sizeDomain, colorRange } = this.properties;
+ const featureById = /* @__PURE__ */ new Map();
+ for (const feature of topology?.features.values() ?? []) {
+ const property = feature.properties?.[topologyIdKey];
+ if (property == null)
+ continue;
+ featureById.set(property, feature);
+ }
+ const sizeScaleType = this.sizeScale.type;
+ const colorScaleType = this.colorScale.type;
+ const mercatorScaleType = this.scale?.type;
+ const hasLatLon = latitudeKey != null && longitudeKey != null;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, data, {
+ props: [
+ ...idKey == null ? [] : [
+ valueProperty13(idKey, mercatorScaleType, { id: "idValue", includeProperty: false }),
+ valueProperty13(idKey, mercatorScaleType, {
+ id: "featureValue",
+ includeProperty: false,
+ processor: () => (datum) => featureById.get(datum)
+ })
+ ],
+ ...hasLatLon ? [
+ valueProperty13(latitudeKey, mercatorScaleType, { id: "latValue" }),
+ valueProperty13(longitudeKey, mercatorScaleType, { id: "lonValue" })
+ ] : [],
+ ...labelKey ? [valueProperty13(labelKey, "category", { id: "labelValue" })] : [],
+ ...sizeKey ? [valueProperty13(sizeKey, sizeScaleType, { id: "sizeValue" })] : [],
+ ...colorKey ? [valueProperty13(colorKey, colorScaleType, { id: "colorValue" })] : []
+ ]
+ });
+ const featureValues = idKey == null ? void 0 : dataModel.resolveColumnById(this, `featureValue`, processedData);
+ const latValues = hasLatLon ? dataModel.resolveColumnById(this, `latValue`, processedData) : void 0;
+ const lonValues = hasLatLon ? dataModel.resolveColumnById(this, `lonValue`, processedData) : void 0;
+ this.topologyBounds = processedData.dataSources.get(this.id)?.data.reduce((current, _datum, datumIndex) => {
+ const feature = featureValues?.[datumIndex];
+ const geometry = feature?.geometry;
+ if (geometry != null) {
+ current = geometryBbox(geometry, current);
+ }
+ if (latValues != null && lonValues != null) {
+ const lon = lonValues[datumIndex];
+ const lat = latValues[datumIndex];
+ current = LonLatBBox3.extend(current, lon, lat, lon, lat);
+ }
+ return current;
+ }, void 0);
+ if (sizeKey != null) {
+ const sizeIdx = dataModel.resolveProcessedDataIndexById(this, `sizeValue`);
+ const processedSize = processedData.domain.values[sizeIdx] ?? [];
+ sizeScale.domain = sizeDomain ?? processedSize;
+ }
+ if (colorRange != null && this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ colorScale.domain = processedData.domain.values[colorKeyIdx];
+ colorScale.range = colorRange;
+ colorScale.update();
+ }
+ this.animationState.transition("updateData");
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount3(this, processedData.defs.values[colorIdx].missing);
+ const colorDataMissing = dataCount === 0 || dataCount === missCount;
+ return !colorDataMissing;
+ }
+ getLabelDatum(datum, labelValue, x, y, size, measurer2) {
+ if (labelValue == null)
+ return;
+ const {
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName,
+ label,
+ shape
+ } = this.properties;
+ if (labelKey == null || !label.enabled)
+ return;
+ const { placement } = label;
+ const labelText = this.getLabelText(
+ labelValue,
+ datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ {
+ value: labelValue,
+ datum,
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName
+ }
+ );
+ if (labelText == null)
+ return;
+ const { width, height } = measurer2.measureLines(String(labelText));
+ const anchor = Marker4.anchor(shape);
+ return {
+ point: { x, y, size },
+ label: { width, height, text: labelText },
+ anchor,
+ placement
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, dataModel, processedData, sizeScale, properties, scale } = this;
+ const { idKey, latitudeKey, longitudeKey, sizeKey, colorKey, labelKey, label, legendItemName } = properties;
+ if (dataModel == null || processedData == null || scale == null)
+ return;
+ const hasLatLon = latitudeKey != null && longitudeKey != null;
+ const idValues = idKey == null ? void 0 : dataModel.resolveColumnById(this, `idValue`, processedData);
+ const featureValues = idKey == null ? void 0 : dataModel.resolveColumnById(this, `featureValue`, processedData);
+ const latValues = hasLatLon ? dataModel.resolveColumnById(this, `latValue`, processedData) : void 0;
+ const lonValues = hasLatLon ? dataModel.resolveColumnById(this, `lonValue`, processedData) : void 0;
+ const labelValues = labelKey == null ? void 0 : dataModel.resolveColumnById(this, `labelValue`, processedData);
+ const sizeValues = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData);
+ const colorValues = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData);
+ const markerMaxSize = properties.maxSize ?? properties.size;
+ sizeScale.range = [Math.min(properties.size, markerMaxSize), markerMaxSize];
+ const measurer2 = (0, import_ag_charts_core94.cachedTextMeasurer)(label);
+ let projectedGeometries;
+ if (idValues != null && featureValues != null) {
+ projectedGeometries = /* @__PURE__ */ new Map();
+ for (const [datumIndex] of processedData.dataSources.get(this.id)?.data.entries() ?? []) {
+ const id = idValues[datumIndex];
+ const geometry = featureValues[datumIndex]?.geometry ?? void 0;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (id != null && projectedGeometry != null) {
+ projectedGeometries.set(id, projectedGeometry);
+ }
+ }
+ }
+ const nodeData = [];
+ const labelData = [];
+ const missingGeometries = [];
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const idValue = idValues?.[datumIndex];
+ const lonValue = lonValues?.[datumIndex];
+ const latValue = latValues?.[datumIndex];
+ const colorValue = colorValues?.[datumIndex];
+ const sizeValue = sizeValues?.[datumIndex];
+ const labelValue = labelValues?.[datumIndex];
+ const size = sizeValue == null ? properties.size : sizeScale.convert(sizeValue, { clamp: true });
+ const projectedGeometry = idValue == null ? void 0 : projectedGeometries?.get(idValue);
+ if (idValue != null && projectGeometry == null) {
+ missingGeometries.push(idValue);
+ }
+ if (lonValue != null && latValue != null) {
+ const [x, y] = scale.convert([lonValue, latValue]);
+ const labelDatum = this.getLabelDatum(datum, labelValue, x, y, size, measurer2);
+ if (labelDatum) {
+ labelData.push(labelDatum);
+ }
+ nodeData.push({
+ series: this,
+ itemId: latitudeKey,
+ datum,
+ datumIndex,
+ index: -1,
+ idValue,
+ lonValue,
+ latValue,
+ labelValue,
+ sizeValue,
+ colorValue,
+ point: { x, y, size },
+ midPoint: { x, y },
+ legendItemName,
+ style: this.getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, false)
+ });
+ } else if (projectedGeometry != null) {
+ for (const [index, [x, y]] of markerPositions(projectedGeometry, 1).entries()) {
+ const labelDatum = this.getLabelDatum(datum, labelValue, x, y, size, measurer2);
+ if (labelDatum) {
+ labelData.push(labelDatum);
+ }
+ nodeData.push({
+ series: this,
+ itemId: latitudeKey,
+ datum,
+ datumIndex,
+ index,
+ idValue,
+ lonValue,
+ latValue,
+ labelValue,
+ sizeValue,
+ colorValue,
+ point: { x, y, size },
+ midPoint: { x, y },
+ legendItemName,
+ style: this.getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, false)
+ });
+ }
+ }
+ }
+ const missingGeometriesCap = 10;
+ if (missingGeometries.length > missingGeometriesCap) {
+ const excessItems = missingGeometries.length - missingGeometriesCap;
+ missingGeometries.length = missingGeometriesCap;
+ missingGeometries.push(`(+${excessItems} more)`);
+ }
+ if (missingGeometries.length > 0) {
+ import_ag_charts_core94.Logger.warnOnce(`some data items do not have matches in the provided topology`, missingGeometries);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ checkScaleChange() {
+ if (this.previousScale === this.scale)
+ return false;
+ this.previousScale = this.scale;
+ return true;
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ const scaleChange = this.checkScaleChange();
+ const { markerSelection, highlightMarkerSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const { legendItemName } = this.properties;
+ const matchingLegendItemName = legendItemName != null && highlightedDatum?.datum == null && legendItemName === highlightedDatum?.legendItemName;
+ if (highlightedDatum != null && (highlightedDatum.series !== this && !matchingLegendItemName || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ this.markerSelection = this.updateMarkerSelection({ markerData: nodeData, markerSelection });
+ this.updateMarkerNodes({ markerSelection, isHighlight: false, highlightedDatum });
+ this.highlightMarkerSelection = this.updateMarkerSelection({
+ markerData: highlightedDatum == null ? [] : [highlightedDatum],
+ markerSelection: highlightMarkerSelection
+ });
+ this.updateMarkerNodes({
+ markerSelection: highlightMarkerSelection,
+ isHighlight: true,
+ highlightedDatum
+ });
+ if (scaleChange || resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updatePlacedLabelData(labelData) {
+ this.labelSelection = this.labelSelection.update(labelData, (text2) => {
+ text2.pointerEvents = import_ag_charts_community218._ModuleSupport.PointerEvents.None;
+ });
+ this.updateLabelNodes({ labelSelection: this.labelSelection });
+ }
+ updateLabelNodes(opts) {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { x, y, width, height, text: text2 }, datumIndex) => {
+ const style = getLabelStyles3(this, void 0, properties, properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontSize, fontFamily } = style;
+ label.visible = true;
+ label.x = x + width / 2;
+ label.y = y + height / 2;
+ label.text = text2;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.setBoxing(style);
+ });
+ }
+ updateMarkerSelection(opts) {
+ const { markerData, markerSelection } = opts;
+ return markerSelection.update(
+ markerData,
+ void 0,
+ (datum) => createDatumId12(datum.index, datum.idValue, datum.lonValue, datum.latValue)
+ );
+ }
+ getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, isHighlight) {
+ const { properties, colorScale, sizeScale } = this;
+ const { colorRange, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults14(highlightStyle, properties.getStyle());
+ if (!isHighlight && colorValue != null) {
+ baseStyle.fill = this.isColorScaleValid() ? colorScale.convert(colorValue) : colorRange?.[0] ?? baseStyle.fill;
+ }
+ if (sizeValue != null) {
+ baseStyle.size = sizeScale.convert(sizeValue, { clamp: true });
+ }
+ let style = baseStyle;
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId12(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults14(overrides, baseStyle);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateMarkerNodes(opts) {
+ const { markerSelection, isHighlight, highlightedDatum } = opts;
+ const fillBBox = getTopologyShapeFillBBox(this.scale);
+ markerSelection.each((marker, markerDatum) => {
+ const { datum, point } = markerDatum;
+ const style = this.getMarkerItemStyle(markerDatum, isHighlight);
+ marker.shape = style.shape;
+ marker.size = style.size;
+ applyShapeStyle11(marker, style, fillBBox);
+ marker.x = point.x;
+ marker.y = point.y;
+ marker.scalingCenterX = point.x;
+ marker.scalingCenterY = point.y;
+ marker.zIndex = !isHighlight && highlightedDatum != null && datum === highlightedDatum.datum ? 1 : 0;
+ });
+ }
+ isProcessedDataAnimatable() {
+ return true;
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ resetAllAnimation() {
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ this.ctx.animationManager.skipCurrentBatch();
+ this.labelSelection.cleanup();
+ this.markerSelection.cleanup();
+ this.highlightMarkerSelection.cleanup();
+ }
+ animateMarkers() {
+ const { animationManager } = this.ctx;
+ const fns = prepareMapMarkerAnimationFunctions();
+ fromToMotion3(this.id, "markers", animationManager, [this.markerSelection, this.highlightMarkerSelection], fns);
+ }
+ getLabelData() {
+ if (!this.isLabelEnabled())
+ return [];
+ return this.contextNodeData?.labelData ?? [];
+ }
+ pickNodeClosestDatum(p) {
+ const { x: x0, y: y0 } = p;
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ for (const datum of this.contextNodeData?.nodeData ?? []) {
+ const { x, y, size } = datum.point;
+ const dx2 = Math.max(Math.abs(x - x0) - size, 0);
+ const dy2 = Math.max(Math.abs(y - y0) - size, 0);
+ const distanceSquared = dx2 * dx2 + dy2 * dy2;
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ }
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ legendItemSymbol(datumIndex) {
+ const { dataModel, processedData, properties } = this;
+ const { shape, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = properties;
+ let { fill } = properties;
+ if (datumIndex != null && this.isColorScaleValid()) {
+ const colorValues = dataModel.resolveColumnById(this, "colorValue", processedData);
+ const colorValue = colorValues[datumIndex];
+ fill = this.colorScale.convert(colorValue);
+ }
+ return {
+ marker: {
+ shape,
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const { processedData, dataModel } = this;
+ if (processedData == null || dataModel == null)
+ return [];
+ const { id: seriesId, visible } = this;
+ const { title, legendItemName, idName, idKey, colorKey, colorRange, showInLegend } = this.properties;
+ if (legendType === "gradient" && colorKey != null && colorRange != null) {
+ const colorDomain = processedData.domain.values[dataModel.resolveProcessedDataIndexById(this, "colorValue")];
+ const legendDatum = {
+ legendType: "gradient",
+ enabled: visible,
+ seriesId,
+ series: this.getFormatterContext("color"),
+ colorRange,
+ colorDomain
+ };
+ return [legendDatum];
+ } else if (legendType === "category") {
+ const legendDatum = {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible,
+ label: { text: legendItemName ?? title ?? idName ?? idKey ?? seriesId },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ };
+ return [legendDatum];
+ } else {
+ return [];
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const {
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ title,
+ legendItemName,
+ tooltip
+ } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const sizeValue = sizeKey == null ? void 0 : dataModel.resolveColumnById(this, `sizeValue`, processedData)[datumIndex];
+ const colorValue = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex];
+ const data = [];
+ if (this.isLabelEnabled() && labelKey != null && labelKey !== idKey) {
+ const labelValue = dataModel.resolveColumnById(this, `labelValue`, processedData)[datumIndex];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "category",
+ value: labelValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: labelKey,
+ source: "tooltip",
+ property: "label",
+ domain: [],
+ boundSeries: this.getFormatterContext("label")
+ });
+ data.push({ label: labelName, fallbackLabel: labelKey, value: content ?? labelValue });
+ }
+ if (sizeKey != null && sizeValue != null) {
+ const domain = dataModel.getDomain(this, `sizeValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: sizeValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain,
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(sizeValue) });
+ }
+ if (colorKey != null && colorValue != null) {
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? String(colorValue) });
+ }
+ let heading;
+ if (idKey != null) {
+ heading = dataModel.resolveColumnById(this, `idValue`, processedData)[datumIndex];
+ } else if (latitudeKey != null && longitudeKey != null) {
+ const latValue = dataModel.resolveColumnById(this, `latValue`, processedData)[datumIndex];
+ const lonValue = dataModel.resolveColumnById(this, `lonValue`, processedData)[datumIndex];
+ heading = `${Math.abs(latValue).toFixed(4)}\xB0 ${latValue >= 0 ? "N" : "S"}, ${Math.abs(lonValue).toFixed(4)}\xB0 ${lonValue >= 0 ? "W" : "E"}`;
+ }
+ const format = this.getMarkerItemStyle({ datumIndex, datum, colorValue, sizeValue }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading,
+ title: title ?? legendItemName,
+ symbol: this.legendItemSymbol(datumIndex),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ idKey,
+ idName,
+ latitudeKey,
+ latitudeName,
+ longitudeKey,
+ longitudeName,
+ colorKey,
+ colorName,
+ sizeKey,
+ sizeName,
+ labelKey,
+ labelName,
+ ...format
+ }
+ );
+ }
+ getFormattedMarkerStyle(markerDatum) {
+ const format = this.getMarkerItemStyle(markerDatum, false);
+ return { size: format.size, shape: format.shape };
+ }
+ computeFocusBounds(opts) {
+ return computeMarkerFocusBounds2(this, opts);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+MapMarkerSeries.className = "MapMarkerSeries";
+MapMarkerSeries.type = "map-marker";
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerSeriesOptionsDef.ts
+var import_ag_charts_community219 = require("ag-charts-community");
+var import_ag_charts_core95 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs12, mapMarkerSeriesThemeableOptionsDef, without: without6 } = import_ag_charts_community219._ModuleSupport;
+var mapMarkerSeriesOptionsDef = {
+ ...without6(commonSeriesOptionsDefs12, ["highlightStyle", "highlight"]),
+ ...mapMarkerSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core95.required)((0, import_ag_charts_core95.constant)("map-marker")),
+ idKey: import_ag_charts_core95.string,
+ latitudeKey: import_ag_charts_core95.string,
+ longitudeKey: import_ag_charts_core95.string,
+ sizeKey: import_ag_charts_core95.string,
+ colorKey: import_ag_charts_core95.string,
+ labelKey: import_ag_charts_core95.string,
+ idName: import_ag_charts_core95.string,
+ latitudeName: import_ag_charts_core95.string,
+ longitudeName: import_ag_charts_core95.string,
+ sizeName: import_ag_charts_core95.string,
+ colorName: import_ag_charts_core95.string,
+ labelName: import_ag_charts_core95.string,
+ topology: import_ag_charts_core95.geoJson,
+ topologyIdKey: import_ag_charts_core95.string,
+ legendItemName: import_ag_charts_core95.string,
+ title: import_ag_charts_core95.string
+};
+
+// packages/ag-charts-enterprise/src/series/map-marker/mapMarkerModule.ts
+var MapMarkerModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-marker",
+ moduleFactory: (ctx) => new MapMarkerSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ shape: "circle",
+ maxSize: 30,
+ fill: applyMapPalette({
+ $applySwitch: [
+ { $path: "type" },
+ { $mapPalette: "fill" },
+ ["gradient", import_ag_charts_community220._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", import_ag_charts_community220._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community220._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ }),
+ stroke: { $mapPalette: "stroke" },
+ colorRange: {
+ $if: [
+ { $eq: [{ $mapPalette: "type" }, "inbuilt"] },
+ { $mapPalette: "divergingColors" },
+ applyMapPalette(import_ag_charts_community220._ModuleSupport.SAFE_RANGE2_OPERATION)
+ ]
+ },
+ fillOpacity: 0.5,
+ label: {
+ ...import_ag_charts_community220._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: applyMapPalette(import_ag_charts_community220._ModuleSupport.multiSeriesHighlightStyle())
+ },
+ tooltip: {
+ range: "exact"
+ }
+ }
+};
+var MapMarkerSeriesModule = {
+ type: "series",
+ name: "map-marker",
+ chartType: "topology",
+ enterprise: true,
+ options: mapMarkerSeriesOptionsDef,
+ create: (ctx) => new MapMarkerSeries(ctx),
+ validate(options, optionsDefs2, path) {
+ const result = (0, import_ag_charts_core96.validate)(options, optionsDefs2, path);
+ const { cleared, invalid } = result;
+ if (cleared?.idKey == null && (cleared?.latitudeKey == null || cleared?.longitudeKey == null)) {
+ const extendPath = (key) => path ? `${path}.${key}` : key;
+ const message = `Either \`${extendPath("idKey")}\` or both \`${extendPath("latitudeKey")}\` and \`${extendPath("longitudeKey")}\` are required.`;
+ invalid.push(new import_ag_charts_core96.ValidationError("required", message, null, path));
+ }
+ return result;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeModule.ts
+var import_ag_charts_community224 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeries.ts
+var import_ag_charts_community222 = require("ag-charts-community");
+var import_ag_charts_core97 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/map-util/polygonLabelUtil.ts
+function preferredLabelCenter(polygons, { aspectRatio, precision }) {
+ const result = polygonPointSearch(polygons, precision, (p, cx, cy, stride) => {
+ const width = maxWidthOfRectConstrainedByCenterAndAspectRatioToPolygon(p, cx, cy, aspectRatio);
+ const maxWidth2 = width + 2 * stride * aspectRatio;
+ const distance2 = width * Math.SQRT2;
+ const maxDistance = maxWidth2 * Math.SQRT2;
+ return { distance: distance2, maxDistance };
+ });
+ if (result == null)
+ return;
+ const { x, y, distance } = result;
+ const maxWidth = distance / Math.SQRT2;
+ return { x, y, maxWidth };
+}
+function maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(a, b, cx, cy, aspectRatio) {
+ const [ax, ay] = a;
+ const [bx, by] = b;
+ const positiveM = 1 / aspectRatio;
+ const abx = bx - ax;
+ const aby = by - ay;
+ const [topPointX, topPointY] = ay <= by ? a : b;
+ const [leftPointX, leftPointY] = ax <= bx ? a : b;
+ const [bottomPointX, bottomPointY] = ay <= by ? b : a;
+ const [rightPointX, rightPointY] = ax <= bx ? b : a;
+ let maxWidth = Infinity;
+ if (abx === 0) {
+ for (let i = 0; i <= 1; i += 1) {
+ const m = i === 0 ? positiveM : -positiveM;
+ const y = m * (ax - cx) + cy;
+ if (y >= topPointY && y <= bottomPointY) {
+ const height = Math.abs(cy - y) * 2;
+ const width = height * aspectRatio;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ }
+ } else {
+ const abm = aby / abx;
+ for (let i = 0; i <= 1; i += 1) {
+ const m = i === 0 ? positiveM : -positiveM;
+ const x = (abm * ax - ay - m * cx + cy) / (abm - m);
+ if (x >= leftPointX && x <= rightPointX) {
+ const width = Math.abs(cx - x) * 2;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ }
+ }
+ const positiveMRecip = aspectRatio;
+ const centerToTopMRecip = Math.abs((topPointX - cx) / (topPointY - cy));
+ const centerToBottomMRecip = Math.abs((bottomPointX - cx) / (bottomPointY - cy));
+ if (bottomPointY < cy && centerToBottomMRecip < positiveMRecip) {
+ const height = Math.abs(cy - bottomPointY) * 2;
+ const width = height * aspectRatio;
+ maxWidth = Math.min(maxWidth, width);
+ } else if (topPointY > cy && centerToTopMRecip < positiveMRecip) {
+ const height = Math.abs(cy - topPointY) * 2;
+ const width = height * aspectRatio;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ const centerToLeftM = Math.abs((leftPointY - cy) / (leftPointX - cx));
+ const centerToRightM = Math.abs((rightPointY - cy) / (rightPointX - cx));
+ if (rightPointX < cx && centerToRightM < positiveM) {
+ const width = Math.abs(cx - rightPointX) * 2;
+ maxWidth = Math.min(maxWidth, width);
+ } else if (leftPointX > cx && centerToLeftM < positiveM) {
+ const width = Math.abs(cx - leftPointX) * 2;
+ maxWidth = Math.min(maxWidth, width);
+ }
+ return maxWidth;
+}
+function maxWidthOfRectConstrainedByCenterAndAspectRatioToPolygon(polygons, cx, cy, aspectRatio) {
+ let inside = false;
+ let minWidth = Infinity;
+ for (const polygon of polygons) {
+ let p0 = polygon.at(-1);
+ let [x0, y0] = p0;
+ for (const p1 of polygon) {
+ const [x1, y1] = p1;
+ if (y1 > cy !== y0 > cy && cx < (x0 - x1) * (cy - y1) / (y0 - y1) + x1) {
+ inside = !inside;
+ }
+ const width = maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(p0, p1, cx, cy, aspectRatio);
+ minWidth = Math.min(minWidth, width);
+ p0 = p1;
+ x0 = x1;
+ y0 = y1;
+ }
+ }
+ return (inside ? 1 : -1) * minWidth;
+}
+function applyX(into, cx, x) {
+ if (x >= cx) {
+ into.maxX = Math.min(into.maxX, x - cx);
+ }
+ if (x <= cx) {
+ into.minX = Math.max(into.minX, x - cx);
+ }
+}
+function xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(into, a, b, cx, cy, height) {
+ const ry0 = cy - height / 2;
+ const ry1 = cy + height / 2;
+ const [ax, ay] = a;
+ const [bx, by] = b;
+ const abx = bx - ax;
+ const aby = by - ay;
+ const [leftPointX, leftPointY] = ax <= bx ? a : b;
+ const [rightPointX, rightPointY] = ax <= bx ? b : a;
+ if (abx !== 0) {
+ const abm = aby / abx;
+ for (let i = 0; i <= 1; i += 1) {
+ const y = i === 0 ? ry0 : ry1;
+ const x = (y - ay) / abm + ax;
+ if (x >= leftPointX && x <= rightPointX) {
+ applyX(into, cx, x);
+ }
+ }
+ } else if (Math.max(ry0, Math.min(ay, by)) <= Math.min(ry1, Math.max(ay, by))) {
+ applyX(into, cx, ax);
+ }
+ if (rightPointX < cx && rightPointY >= ry0 && rightPointY <= ry1) {
+ applyX(into, cx, rightPointX);
+ } else if (leftPointX > cx && leftPointY >= ry0 && leftPointY <= ry1) {
+ applyX(into, cx, leftPointX);
+ }
+ return into;
+}
+function maxWidthInPolygonForRectOfHeight(polygons, cx, cy, height) {
+ const result = {
+ minX: -Infinity,
+ maxX: Infinity
+ };
+ for (const polygon of polygons) {
+ let p0 = polygon.at(-1);
+ for (const p1 of polygon) {
+ xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(result, p0, p1, cx, cy, height);
+ p0 = p1;
+ }
+ }
+ const { minX, maxX } = result;
+ if (Number.isFinite(minX) && Number.isFinite(maxX)) {
+ return { x: cx + (minX + maxX) / 2, width: maxX - minX };
+ } else {
+ return { x: cx, width: 0 };
+ }
+}
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeriesProperties.ts
+var import_ag_charts_community221 = require("ag-charts-community");
+var { Property: Property73, SeriesProperties: SeriesProperties6, makeSeriesTooltip: makeSeriesTooltip15 } = import_ag_charts_community221._ModuleSupport;
+var MapShapeSeriesProperties = class extends SeriesProperties6 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.idKey = "";
+ this.idName = void 0;
+ this.topologyIdKey = "name";
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.colorRange = void 0;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.padding = 0;
+ this.label = new AutoSizedSecondaryLabel();
+ this.tooltip = makeSeriesTooltip15();
+ }
+ getStyle() {
+ const { fill, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "title", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "topologyIdKey", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "colorKey", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "colorName", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "colorRange", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "padding", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property73
+], MapShapeSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeries.ts
+var {
+ getMissCount: getMissCount4,
+ createDatumId: createDatumId13,
+ SeriesNodePickMode: SeriesNodePickMode11,
+ valueProperty: valueProperty14,
+ ColorScale: ColorScale4,
+ Group: Group14,
+ Selection: Selection11,
+ Text: Text6,
+ PointerEvents: PointerEvents7,
+ applyShapeStyle: applyShapeStyle12,
+ getLabelStyles: getLabelStyles4,
+ mergeDefaults: mergeDefaults15
+} = import_ag_charts_community222._ModuleSupport;
+var fixedScale = import_ag_charts_community222._ModuleSupport.MercatorScale.fixedScale();
+var MapShapeSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ propertyKeys: {
+ color: ["colorKey"],
+ label: ["labelKey"]
+ },
+ propertyNames: {
+ color: ["colorName"],
+ label: ["labelName"]
+ },
+ pickModes: [SeriesNodePickMode11.EXACT_SHAPE_MATCH, SeriesNodePickMode11.NEAREST_NODE]
+ });
+ this.properties = new MapShapeSeriesProperties();
+ this._chartTopology = void 0;
+ this.colorScale = new ColorScale4();
+ this.itemGroup = this.contentGroup.appendChild(new Group14({ name: "itemGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group14({ name: "itemLabelGroup" }));
+ this.datumSelection = Selection11.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.labelSelection = Selection11.select(
+ this.itemLabelGroup,
+ Text6
+ );
+ this.highlightDatumSelection = Selection11.select(
+ this.highlightGroup,
+ () => this.nodeFactory()
+ );
+ this.previousLabelLayouts = void 0;
+ this._previousDatumMidPoint = void 0;
+ this.itemLabelGroup.pointerEvents = PointerEvents7.None;
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get hasData() {
+ return super.hasData && this.topology != null;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [1 /* ShapeLine */, zIndex];
+ this.highlightGroup.zIndex = [2 /* ShapeLineHighlight */, zIndex];
+ return true;
+ }
+ isLabelEnabled() {
+ return this.properties.labelKey != null && this.properties.label.enabled;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 1 /* Polygons */;
+ geoGeometry.lineJoin = "round";
+ return geoGeometry;
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const { data, topology, colorScale } = this;
+ const { topologyIdKey, idKey, colorKey, labelKey, colorRange } = this.properties;
+ const featureById = /* @__PURE__ */ new Map();
+ for (const feature of topology?.features.values() ?? []) {
+ const property = feature.properties?.[topologyIdKey];
+ if (property == null || !containsType(feature.geometry, 1 /* Polygon */))
+ continue;
+ featureById.set(property, feature);
+ }
+ const colorScaleType = this.colorScale.type;
+ const mercatorScaleType = this.scale?.type;
+ const { dataModel, processedData } = await this.requestDataModel(dataController, data, {
+ props: [
+ valueProperty14(idKey, mercatorScaleType, { id: "idValue", includeProperty: false }),
+ valueProperty14(idKey, mercatorScaleType, {
+ id: "featureValue",
+ includeProperty: false,
+ processor: () => (datum) => featureById.get(datum)
+ }),
+ ...labelKey ? [valueProperty14(labelKey, "category", { id: "labelValue" })] : [],
+ ...colorKey ? [valueProperty14(colorKey, colorScaleType, { id: "colorValue" })] : []
+ ]
+ });
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ this.topologyBounds = featureValues.reduce((current, feature) => {
+ const geometry = feature?.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (colorRange != null && this.isColorScaleValid()) {
+ const colorKeyIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ colorScale.domain = processedData.domain.values[colorKeyIdx];
+ colorScale.range = colorRange;
+ colorScale.update();
+ }
+ if (topology == null) {
+ import_ag_charts_core97.Logger.warnOnce(`no topology was provided for [MapShapeSeries]; nothing will be rendered.`);
+ }
+ }
+ isColorScaleValid() {
+ const { colorKey } = this.properties;
+ if (!colorKey) {
+ return false;
+ }
+ const { dataModel, processedData } = this;
+ if (!dataModel || !processedData) {
+ return false;
+ }
+ const colorIdx = dataModel.resolveProcessedDataIndexById(this, "colorValue");
+ const dataCount = processedData.input.count;
+ const missCount = getMissCount4(this, processedData.defs.values[colorIdx].missing);
+ const colorDataMissing = dataCount === 0 || dataCount === missCount;
+ return !colorDataMissing;
+ }
+ getLabelLayout(datum, labelValue, measurer2, geometry, previousLabelLayout) {
+ if (labelValue == null || geometry == null)
+ return;
+ const { idKey, idName, colorKey, colorName, labelKey, labelName, padding, label } = this.properties;
+ if (labelKey == null || !label.enabled)
+ return;
+ const labelText = this.getLabelText(
+ labelValue,
+ datum,
+ labelKey,
+ "label",
+ [],
+ label,
+ {
+ value: labelValue,
+ datum,
+ idKey,
+ idName,
+ colorKey,
+ colorName,
+ labelKey,
+ labelName
+ }
+ );
+ if (labelText == null)
+ return;
+ const baseSize = (0, import_ag_charts_core97.isArray)(labelText) ? (0, import_ag_charts_core97.measureTextSegments)(labelText, label) : measurer2.measureLines(String(labelText));
+ const aspectRatio = (baseSize.width + 2 * padding) / (baseSize.height + 2 * padding);
+ if (previousLabelLayout?.geometry === geometry && previousLabelLayout?.labelText === labelText && previousLabelLayout?.aspectRatio === aspectRatio) {
+ return previousLabelLayout;
+ }
+ const fixedGeometry = projectGeometry(geometry, fixedScale);
+ const fixedPolygon = largestPolygon(fixedGeometry);
+ if (fixedPolygon == null)
+ return;
+ const labelPlacement = preferredLabelCenter(fixedPolygon, {
+ aspectRatio,
+ precision: 1e-3
+ });
+ if (labelPlacement == null)
+ return;
+ const { x, y, maxWidth } = labelPlacement;
+ return { geometry, labelText, aspectRatio, x, y, maxWidth, fixedPolygon };
+ }
+ getLabelDatum(labelLayout, scaling) {
+ const { scale } = this;
+ if (scale == null)
+ return;
+ const { padding, label } = this.properties;
+ const { labelText, aspectRatio, x: untruncatedX, y, maxWidth, fixedPolygon } = labelLayout;
+ const maxSizeWithoutTruncation = {
+ width: Math.ceil(maxWidth * scaling),
+ height: Math.ceil(maxWidth * scaling / aspectRatio),
+ meta: untruncatedX
+ };
+ const labelFormatting = formatSingleLabel(
+ (0, import_ag_charts_core97.toPlainText)(labelText),
+ label,
+ { padding },
+ (height, allowTruncation) => {
+ if (!allowTruncation) {
+ return maxSizeWithoutTruncation;
+ }
+ const result = maxWidthInPolygonForRectOfHeight(fixedPolygon, untruncatedX, y, height / scaling);
+ return {
+ width: result.width * scaling,
+ height,
+ meta: result.x
+ };
+ }
+ );
+ if (labelFormatting == null)
+ return;
+ const [{ text: text2, fontSize, lineHeight, width }, formattingX] = labelFormatting;
+ const x = width < maxSizeWithoutTruncation.width ? untruncatedX : formattingX;
+ const position = this.scale.convert(fixedScale.invert([x, y]));
+ return {
+ x: position[0],
+ y: position[1],
+ text: text2,
+ fontSize,
+ lineHeight
+ };
+ }
+ createNodeData() {
+ const { id: seriesId, dataModel, processedData, properties, scale, previousLabelLayouts } = this;
+ const { idKey, colorKey, labelKey, label, legendItemName } = properties;
+ if (dataModel == null || processedData == null)
+ return;
+ const scaling = scale == null ? Number.NaN : (scale.range[1][0] - scale.range[0][0]) / scale.bounds.width;
+ const idValues = dataModel.resolveColumnById(this, `idValue`, processedData);
+ const featureValues = dataModel.resolveColumnById(
+ this,
+ `featureValue`,
+ processedData
+ );
+ const labelValues = labelKey == null ? void 0 : dataModel.resolveColumnById(this, `labelValue`, processedData);
+ const colorValues = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData);
+ const measurer2 = (0, import_ag_charts_core97.cachedTextMeasurer)(label);
+ const labelLayouts = /* @__PURE__ */ new Map();
+ this.previousLabelLayouts = labelLayouts;
+ const nodeData = [];
+ const labelData = [];
+ const missingGeometries = [];
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const idValue = idValues[datumIndex];
+ const colorValue = colorValues?.[datumIndex];
+ const labelValue = labelValues?.[datumIndex];
+ const geometry = featureValues[datumIndex]?.geometry ?? void 0;
+ if (geometry == null) {
+ missingGeometries.push(idValue);
+ }
+ const labelLayout = this.getLabelLayout(
+ datum,
+ labelValue,
+ measurer2,
+ geometry,
+ previousLabelLayouts?.get(idValue)
+ );
+ if (labelLayout != null) {
+ labelLayouts.set(idValue, labelLayout);
+ }
+ const labelDatum = labelLayout != null && scale != null ? this.getLabelDatum(labelLayout, scaling) : void 0;
+ if (labelDatum != null) {
+ labelData.push(labelDatum);
+ }
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ nodeData.push({
+ series: this,
+ itemId: idKey,
+ datum,
+ datumIndex,
+ idValue,
+ colorValue,
+ labelValue,
+ projectedGeometry,
+ legendItemName,
+ style: this.getItemStyle({ datum, datumIndex, colorValue }, false)
+ });
+ }
+ const missingGeometriesCap = 10;
+ if (missingGeometries.length > missingGeometriesCap) {
+ const excessItems = missingGeometries.length - missingGeometriesCap;
+ missingGeometries.length = missingGeometriesCap;
+ missingGeometries.push(`(+${excessItems} more)`);
+ }
+ if (missingGeometries.length > 0) {
+ import_ag_charts_core97.Logger.warnOnce(`some data items do not have matches in the provided topology`, missingGeometries);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection, labelSelection, highlightDatumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const { legendItemName } = this.properties;
+ const matchingLegendItemName = legendItemName != null && highlightedDatum?.datum == null && legendItemName === highlightedDatum?.legendItemName;
+ if (highlightedDatum != null && (highlightedDatum.series !== this && !matchingLegendItemName || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumStyles({ datumSelection, isHighlight: false });
+ this.updateDatumNodes({ datumSelection });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection });
+ this.highlightDatumSelection = this.updateDatumSelection({
+ nodeData: highlightedDatum == null ? [] : [highlightedDatum],
+ datumSelection: highlightDatumSelection
+ });
+ this.updateDatumStyles({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.updateDatumNodes({ datumSelection: highlightDatumSelection });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId13(datum.idValue));
+ }
+ getItemStyle({ datumIndex, datum, colorValue }, isHighlight) {
+ const { properties, colorScale } = this;
+ const { colorRange, itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults15(highlightStyle, properties.getStyle());
+ if (!isHighlight && colorValue != null) {
+ baseStyle.fill = this.isColorScaleValid() ? colorScale.convert(colorValue) : colorRange?.[0] ?? baseStyle.fill;
+ }
+ let style = baseStyle;
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId13(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ this.callWithContext(itemStyler, params)
+ );
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults15(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ const fillBBox = getTopologyShapeFillBBox(this.scale);
+ datumSelection.each((geoGeometry, nodeDatum) => {
+ const { projectedGeometry } = nodeDatum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ applyShapeStyle12(geoGeometry, nodeDatum.style, fillBBox);
+ });
+ }
+ updateLabelSelection(opts) {
+ const labels = this.isLabelEnabled() ? opts.labelData : [];
+ return opts.labelSelection.update(labels);
+ }
+ updateLabelNodes(opts) {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, { x, y, text: text2, fontSize, lineHeight }, datumIndex) => {
+ const style = getLabelStyles4(this, void 0, properties, properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontFamily } = style;
+ label.visible = true;
+ label.x = x;
+ label.y = y;
+ label.text = text2;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.lineHeight = lineHeight;
+ label.fontFamily = fontFamily;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.setBoxing(style);
+ });
+ }
+ resetAnimation() {
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.datumSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ datumMidPoint(datum) {
+ const { _previousDatumMidPoint } = this;
+ if (_previousDatumMidPoint?.datum === datum) {
+ return _previousDatumMidPoint.point;
+ }
+ const projectedGeometry = datum.projectedGeometry;
+ const polygon = projectedGeometry == null ? void 0 : largestPolygon(projectedGeometry);
+ const center = polygon == null ? void 0 : polygonMarkerCenter(polygon, 2);
+ const point = center == null ? void 0 : { x: center[0], y: center[1] };
+ this._previousDatumMidPoint = { datum, point };
+ return point;
+ }
+ legendItemSymbol(datumIndex) {
+ const { dataModel, processedData, properties } = this;
+ const { fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = properties;
+ let { fill } = properties;
+ if (datumIndex != null && this.isColorScaleValid()) {
+ const colorValues = dataModel.resolveColumnById(this, "colorValue", processedData);
+ const colorValue = colorValues[datumIndex];
+ fill = this.colorScale.convert(colorValue);
+ }
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const { processedData, dataModel } = this;
+ if (processedData == null || dataModel == null)
+ return [];
+ const { id: seriesId, visible } = this;
+ const { title, legendItemName, idKey, idName, colorKey, colorRange, showInLegend } = this.properties;
+ if (legendType === "gradient" && colorKey != null && colorRange != null) {
+ const colorDomain = processedData.domain.values[dataModel.resolveProcessedDataIndexById(this, "colorValue")];
+ const legendDatum = {
+ legendType: "gradient",
+ enabled: visible,
+ seriesId,
+ series: this.getFormatterContext("color"),
+ colorRange,
+ colorDomain
+ };
+ return [legendDatum];
+ } else if (legendType === "category") {
+ const legendDatum = {
+ legendType: "category",
+ id: seriesId,
+ itemId: seriesId,
+ seriesId,
+ enabled: visible,
+ label: { text: legendItemName ?? title ?? idName ?? idKey },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ };
+ return [legendDatum];
+ } else {
+ return [];
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const { idKey, idName, colorKey, colorName, labelKey, labelName, legendItemName, title, tooltip } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const idValue = dataModel.resolveColumnById(this, `idValue`, processedData)[datumIndex];
+ const colorValue = colorKey == null ? void 0 : dataModel.resolveColumnById(this, `colorValue`, processedData)[datumIndex];
+ const data = [];
+ if (this.isLabelEnabled() && labelKey != null && labelKey !== idKey) {
+ const labelValue = dataModel.resolveColumnById(this, `labelValue`, processedData)[datumIndex];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "category",
+ value: labelValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: labelKey,
+ source: "tooltip",
+ property: "label",
+ domain: [],
+ boundSeries: this.getFormatterContext("label")
+ });
+ data.push({ label: labelName, fallbackLabel: labelKey, value: content ?? labelValue });
+ }
+ if (colorValue != null) {
+ const domain = dataModel.getDomain(this, `colorValue`, "value", processedData);
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: colorValue,
+ datum,
+ seriesId,
+ legendItemName,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ domain,
+ boundSeries: this.getFormatterContext("color"),
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? String(colorValue) });
+ }
+ const format = this.getItemStyle({ datum, datumIndex, colorValue }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: idValue,
+ title: title ?? legendItemName,
+ symbol: this.legendItemSymbol(datumIndex),
+ data
+ },
+ { seriesId, datum, title, idKey, idName, colorKey, colorName, labelKey, labelName, ...format }
+ );
+ }
+ computeFocusBounds(opts) {
+ return findFocusedGeoGeometry(this, opts);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+MapShapeSeries.className = "MapShapeSeries";
+MapShapeSeries.type = "map-shape";
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeSeriesOptionsDef.ts
+var import_ag_charts_community223 = require("ag-charts-community");
+var import_ag_charts_core98 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs13, mapShapeSeriesThemeableOptionsDef, without: without7 } = import_ag_charts_community223._ModuleSupport;
+var mapShapeSeriesOptionsDef = {
+ ...without7(commonSeriesOptionsDefs13, ["highlightStyle", "highlight"]),
+ ...mapShapeSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core98.required)((0, import_ag_charts_core98.constant)("map-shape")),
+ idKey: (0, import_ag_charts_core98.required)(import_ag_charts_core98.string),
+ colorKey: import_ag_charts_core98.string,
+ labelKey: import_ag_charts_core98.string,
+ idName: import_ag_charts_core98.string,
+ colorName: import_ag_charts_core98.string,
+ labelName: import_ag_charts_core98.string,
+ topology: import_ag_charts_core98.geoJson,
+ topologyIdKey: import_ag_charts_core98.string,
+ legendItemName: import_ag_charts_core98.string,
+ title: import_ag_charts_core98.string
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape/mapShapeModule.ts
+var MapShapeModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-shape",
+ moduleFactory: (ctx) => new MapShapeSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ fill: applyMapPalette({
+ $applySwitch: [
+ { $path: "type" },
+ { $mapPalette: "fill" },
+ ["gradient", import_ag_charts_community224._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", import_ag_charts_community224._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community224._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ }),
+ stroke: { $ref: "chartBackgroundColor" },
+ colorRange: {
+ $if: [
+ { $eq: [{ $mapPalette: "type" }, "inbuilt"] },
+ { $mapPalette: "divergingColors" },
+ applyMapPalette(import_ag_charts_community224._ModuleSupport.SAFE_RANGE2_OPERATION)
+ ]
+ },
+ fillOpacity: 1,
+ strokeWidth: 1,
+ lineDash: [0],
+ lineDashOffset: 0,
+ padding: 2,
+ label: {
+ ...import_ag_charts_community224._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ color: { $ref: "chartBackgroundColor" },
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: "bold",
+ overflowStrategy: "hide"
+ },
+ highlight: applyMapPalette(import_ag_charts_community224._ModuleSupport.multiSeriesHighlightStyle(true))
+ },
+ tooltip: {
+ range: "exact"
+ }
+ }
+};
+var MapShapeSeriesModule = {
+ type: "series",
+ name: "map-shape",
+ chartType: "topology",
+ enterprise: true,
+ options: mapShapeSeriesOptionsDef,
+ create: (ctx) => new MapShapeSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundModule.ts
+var import_ag_charts_community228 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeries.ts
+var import_ag_charts_community226 = require("ag-charts-community");
+var import_ag_charts_core99 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeriesProperties.ts
+var import_ag_charts_community225 = require("ag-charts-community");
+var { Property: Property74, SeriesProperties: SeriesProperties7, makeSeriesTooltip: makeSeriesTooltip16 } = import_ag_charts_community225._ModuleSupport;
+var MapShapeBackgroundSeriesProperties = class extends SeriesProperties7 {
+ constructor() {
+ super(...arguments);
+ this.topology = void 0;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeOpacity = 1;
+ this.strokeWidth = 0;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.tooltip = makeSeriesTooltip16();
+ }
+};
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "topology", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property74
+], MapShapeBackgroundSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeries.ts
+var { createDatumId: createDatumId14, Selection: Selection12, Group: Group15, PointerEvents: PointerEvents8 } = import_ag_charts_community226._ModuleSupport;
+var MapShapeBackgroundSeries = class extends TopologySeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ pickModes: []
+ });
+ this.properties = new MapShapeBackgroundSeriesProperties();
+ this._chartTopology = void 0;
+ this.itemGroup = this.contentGroup.appendChild(new Group15({ name: "itemGroup" }));
+ this.datumSelection = Selection12.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.itemGroup.pointerEvents = PointerEvents8.None;
+ }
+ get topology() {
+ return this.properties.topology ?? this._chartTopology;
+ }
+ get focusable() {
+ return false;
+ }
+ setOptionsData() {
+ }
+ setChartData() {
+ }
+ getNodeData() {
+ return;
+ }
+ get hasData() {
+ return false;
+ }
+ renderToOffscreenCanvas() {
+ return true;
+ }
+ setChartTopology(topology) {
+ this._chartTopology = topology;
+ if (this.topology === topology) {
+ this.nodeDataRefresh = true;
+ }
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 0];
+ this.highlightGroup.zIndex = [0 /* ShapeLineBackground */, zIndex, 1];
+ return true;
+ }
+ nodeFactory() {
+ const geoGeometry = new GeoGeometry();
+ geoGeometry.renderMode = 1 /* Polygons */;
+ geoGeometry.lineJoin = "round";
+ geoGeometry.pointerEvents = PointerEvents8.None;
+ return geoGeometry;
+ }
+ processData() {
+ const { topology } = this;
+ this.topologyBounds = topology?.features.reduce((current, feature) => {
+ const geometry = feature.geometry;
+ if (geometry == null)
+ return current;
+ return geometryBbox(geometry, current);
+ }, void 0);
+ if (topology == null) {
+ import_ag_charts_core99.Logger.warnOnce(`no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.`);
+ }
+ }
+ createNodeData() {
+ const { id: seriesId, topology, scale, properties } = this;
+ if (topology == null)
+ return;
+ const { fill, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = properties;
+ const nodeData = [];
+ const labelData = [];
+ for (const [index, feature] of topology.features.entries()) {
+ const { geometry } = feature;
+ const projectedGeometry = geometry != null && scale != null ? projectGeometry(geometry, scale) : void 0;
+ if (projectedGeometry == null)
+ continue;
+ nodeData.push({
+ series: this,
+ itemId: index,
+ datum: feature,
+ datumIndex: 0,
+ index,
+ projectedGeometry,
+ style: { fill, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset }
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update() {
+ const { datumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.labelGroup.visible = this.visible;
+ const { nodeData = [] } = this.contextNodeData ?? {};
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId14(datum.index));
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ datumSelection.each((geoGeometry, datum) => {
+ const { projectedGeometry } = datum;
+ if (projectedGeometry == null) {
+ geoGeometry.visible = false;
+ geoGeometry.projectedGeometry = void 0;
+ return;
+ }
+ geoGeometry.visible = true;
+ geoGeometry.projectedGeometry = projectedGeometry;
+ geoGeometry.setProperties(datum.style);
+ });
+ }
+ resetAnimation() {
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(_seriesDatum) {
+ return;
+ }
+ pickFocus() {
+ return void 0;
+ }
+ computeFocusBounds(_opts) {
+ return void 0;
+ }
+ hasItemStylers() {
+ return false;
+ }
+};
+MapShapeBackgroundSeries.className = "MapShapeBackgroundSeries";
+MapShapeBackgroundSeries.type = "map-shape-background";
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundSeriesOptionsDef.ts
+var import_ag_charts_community227 = require("ag-charts-community");
+var import_ag_charts_core100 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs14, mapShapeBackgroundSeriesThemeableOptionsDef } = import_ag_charts_community227._ModuleSupport;
+var mapShapeBackgroundSeriesOptionsDef = {
+ ...mapShapeBackgroundSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs14,
+ type: (0, import_ag_charts_core100.required)((0, import_ag_charts_core100.constant)("map-shape-background")),
+ topology: import_ag_charts_core100.geoJson
+};
+
+// packages/ag-charts-enterprise/src/series/map-shape-background/mapShapeBackgroundModule.ts
+var MapShapeBackgroundModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["topology"],
+ identifier: "map-shape-background",
+ moduleFactory: (ctx) => new MapShapeBackgroundSeries(ctx),
+ themeTemplate: {
+ ...MAP_THEME_DEFAULTS,
+ series: {
+ fill: applyMapPalette({
+ $applySwitch: [
+ { $path: "type" },
+ { $path: ["/1", { $mapPalette: "fill" }, { $mapPalette: "hierarchyColors" }] },
+ ["gradient", import_ag_charts_community228._ModuleSupport.FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS],
+ ["image", import_ag_charts_community228._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community228._ModuleSupport.FILL_PATTERN_HIERARCHY_DEFAULTS]
+ ]
+ }),
+ stroke: { $ref: "chartBackgroundColor" },
+ strokeWidth: 1
+ }
+ }
+};
+var MapShapeBackgroundSeriesModule = {
+ type: "series",
+ name: "map-shape-background",
+ chartType: "topology",
+ enterprise: true,
+ options: mapShapeBackgroundSeriesOptionsDef,
+ create: (ctx) => new MapShapeBackgroundSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleModule.ts
+var import_ag_charts_community237 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleSeries.ts
+var import_ag_charts_community234 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesBase.ts
+var import_ag_charts_community230 = require("ag-charts-community");
+var import_ag_charts_core101 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/util/radialUtil.ts
+var import_ag_charts_community229 = require("ag-charts-community");
+var { createDatumId: createDatumId15, mergeDefaults: mergeDefaults16, toHighlightString: toHighlightString4 } = import_ag_charts_community229._ModuleSupport;
+function makeStylerParams(series, highlighted, highlightStateEnum) {
+ const { id: seriesId } = series;
+ const {
+ angleKey,
+ cornerRadius,
+ fill,
+ fillOpacity,
+ lineDash,
+ lineDashOffset,
+ radiusKey,
+ stackGroup,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth
+ } = series.properties;
+ const highlightState = toHighlightString4(highlightStateEnum ?? import_ag_charts_community229._ModuleSupport.HighlightState.None);
+ return {
+ angleKey,
+ cornerRadius,
+ fill,
+ fillOpacity,
+ highlightState,
+ highlighted,
+ lineDash,
+ lineDashOffset,
+ radiusKey,
+ seriesId,
+ stackGroup,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth
+ };
+}
+function getStyle(series, ignoreStylerCallback, highlighted, highlightState) {
+ const { styler } = series.properties;
+ let stylerResult = {};
+ if (!ignoreStylerCallback && styler) {
+ const stylerParams = makeStylerParams(series, highlighted, highlightState);
+ stylerResult = series.ctx.optionsGraphService.resolvePartial(
+ ["series", `${series.declarationOrder}`],
+ series.cachedCallWithContext(styler, stylerParams) ?? {},
+ { pick: false }
+ ) ?? {};
+ }
+ return {
+ cornerRadius: stylerResult.cornerRadius ?? series.properties.cornerRadius,
+ fill: stylerResult.fill ?? series.properties.fill,
+ fillOpacity: stylerResult.fillOpacity ?? series.properties.fillOpacity,
+ lineDash: stylerResult.lineDash ?? series.properties.lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? series.properties.lineDashOffset,
+ stroke: stylerResult.stroke ?? series.properties.stroke,
+ strokeOpacity: stylerResult.strokeOpacity ?? series.properties.strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? series.properties.strokeWidth,
+ opacity: 1
+ };
+}
+function makeItemStylerParams(series, nodeDatum, isHighlight, style) {
+ const { id: seriesId, properties } = series;
+ const { angleKey, radiusKey } = properties;
+ const activeHighlight = series.ctx.highlightManager?.getActiveHighlight();
+ const highlightStateString = series.getHighlightStateString(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ const fill = series.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum: nodeDatum.datum,
+ highlighted: isHighlight,
+ highlightState: highlightStateString,
+ angleKey,
+ radiusKey,
+ ...style,
+ fill
+ };
+}
+function getItemStyle(series, nodeDatum, isHighlight, highlightState) {
+ const { properties } = series;
+ const { itemStyler } = properties;
+ const highlightStyle = series.getHighlightStyle(isHighlight, nodeDatum?.datumIndex, highlightState);
+ const baseStyle = mergeDefaults16(
+ highlightStyle,
+ getStyle(series, nodeDatum === void 0, isHighlight, highlightState)
+ );
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = series.cachedDatumCallback(
+ createDatumId15(series.getDatumId(nodeDatum), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = makeItemStylerParams(series, nodeDatum, isHighlight, style);
+ return series.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults16(overrides, style);
+ }
+ }
+ return style;
+}
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesBase.ts
+var {
+ DEFAULT_POLAR_DIRECTION_KEYS,
+ DEFAULT_POLAR_DIRECTION_NAMES,
+ ChartAxisDirection: ChartAxisDirection28,
+ PolarAxis,
+ diff: diff6,
+ fixNumericExtent: fixNumericExtent8,
+ groupAccumulativeValueProperty: groupAccumulativeValueProperty2,
+ keyProperty: keyProperty9,
+ normaliseGroupTo,
+ resetLabelFn: resetLabelFn5,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation5,
+ seriesLabelFadeOutAnimation,
+ valueProperty: valueProperty15,
+ animationValidation: animationValidation7,
+ createDatumId: createDatumId16,
+ SeriesNodePickMode: SeriesNodePickMode12,
+ normalizeAngle360: normalizeAngle3605,
+ CategoryScale: CategoryScale3,
+ motion: motion6,
+ applyShapeStyle: applyShapeStyle13,
+ isGradientFill: isGradientFill2,
+ updateLabelNode: updateLabelNode6,
+ getItemStyles: getItemStyles3
+} = import_ag_charts_community230._ModuleSupport;
+var RadialColumnSeriesNodeEvent = class extends import_ag_charts_community230._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.angleKey = series.properties.angleKey;
+ this.radiusKey = series.properties.radiusKey;
+ }
+};
+var RadialColumnSeriesBase = class extends import_ag_charts_community230._ModuleSupport.PolarSeries {
+ constructor(moduleCtx, {
+ animationResetFns
+ }) {
+ super({
+ moduleCtx,
+ categoryKey: "angleValue",
+ propertyKeys: DEFAULT_POLAR_DIRECTION_KEYS,
+ propertyNames: DEFAULT_POLAR_DIRECTION_NAMES,
+ canHaveAxes: true,
+ pickModes: [SeriesNodePickMode12.NEAREST_NODE, SeriesNodePickMode12.EXACT_SHAPE_MATCH],
+ animationResetFns: {
+ ...animationResetFns,
+ label: resetLabelFn5
+ }
+ });
+ this.NodeEvent = RadialColumnSeriesNodeEvent;
+ this.groupScale = new CategoryScale3();
+ this.circleCache = { r: 0, cx: 0, cy: 0 };
+ }
+ get hasData() {
+ return this.getHasData("radiusValue-raw");
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!processedData || !dataModel)
+ return [];
+ if (direction === ChartAxisDirection28.Angle) {
+ return dataModel.getDomain(this, "angleValue", "key", processedData);
+ } else {
+ const yExtent = dataModel.getDomain(this, "radiusValue-end", "value", processedData);
+ const fixedYExtent = Number.isFinite(yExtent[1] - yExtent[0]) ? [Math.min(yExtent[0], 0), Math.max(yExtent[1], 0)] : [];
+ return fixNumericExtent8(fixedYExtent);
+ }
+ }
+ async processData(dataController) {
+ const { angleKey, radiusKey, normalizedTo } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const stackGroupId = this.getStackId();
+ const stackGroupTrailingId = `${stackGroupId}-trailing`;
+ const extraProps = [];
+ if ((0, import_ag_charts_core101.isDefined)(normalizedTo)) {
+ extraProps.push(normaliseGroupTo([stackGroupId, stackGroupTrailingId], Math.abs(normalizedTo)));
+ }
+ if (animationEnabled && this.processedData) {
+ extraProps.push(diff6(this.id, this.processedData));
+ }
+ if (animationEnabled) {
+ extraProps.push(animationValidation7());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const radiusScaleType = this.axes[ChartAxisDirection28.Radius]?.scale.type;
+ const angleScaleType = this.axes[ChartAxisDirection28.Angle]?.scale.type;
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty9(angleKey, angleScaleType, { id: "angleValue" }),
+ valueProperty15(radiusKey, radiusScaleType, {
+ id: "radiusValue-raw",
+ invalidValue: null,
+ ...visibleProps
+ }),
+ ...groupAccumulativeValueProperty2(
+ radiusKey,
+ "normal",
+ {
+ id: `radiusValue-end`,
+ rangeId: `radiusValue-range`,
+ invalidValue: null,
+ groupId: stackGroupId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ radiusScaleType
+ ),
+ ...groupAccumulativeValueProperty2(
+ radiusKey,
+ "trailing",
+ {
+ id: `radiusValue-start`,
+ invalidValue: null,
+ groupId: stackGroupTrailingId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ radiusScaleType
+ ),
+ ...extraProps
+ ],
+ groupByKeys: true,
+ groupByData: false
+ });
+ this.animationState.transition("updateData");
+ }
+ didCircleChange() {
+ const r = this.radius;
+ const cx = this.centerX;
+ const cy = this.centerY;
+ const cache = this.circleCache;
+ if (r !== cache.r || cx !== cache.cx || cy !== cache.cy) {
+ this.circleCache = { r, cx, cy };
+ return true;
+ }
+ return false;
+ }
+ isRadiusAxisReversed() {
+ return this.axes[ChartAxisDirection28.Radius]?.isReversed();
+ }
+ maybeRefreshNodeData() {
+ const circleChanged = this.didCircleChange();
+ if (!circleChanged && !this.nodeDataRefresh)
+ return;
+ this.contextNodeData = this.createNodeData();
+ this.nodeData = this.contextNodeData?.nodeData ?? [];
+ this.nodeDataRefresh = false;
+ }
+ getAxisInnerRadius() {
+ const radiusAxis = this.axes[ChartAxisDirection28.Radius];
+ return radiusAxis instanceof PolarAxis ? this.radius * radiusAxis.innerRadiusRatio : 0;
+ }
+ createNodeData() {
+ const { processedData, dataModel, groupScale } = this;
+ if (!dataModel || !processedData || processedData.type !== "grouped")
+ return;
+ const angleAxis = this.axes[ChartAxisDirection28.Angle];
+ const radiusAxis = this.axes[ChartAxisDirection28.Radius];
+ const angleScale = angleAxis?.scale;
+ const radiusScale = radiusAxis?.scale;
+ if (!angleScale || !radiusScale) {
+ return;
+ }
+ const angleValues = dataModel.resolveKeysById(this, `angleValue`, processedData);
+ const radiusStartValues = dataModel.resolveColumnById(this, `radiusValue-start`, processedData);
+ const radiusEndValues = dataModel.resolveColumnById(this, `radiusValue-end`, processedData);
+ const radiusRawValues = dataModel.resolveColumnById(this, `radiusValue-raw`, processedData);
+ const radiusRangeIndex = dataModel.resolveProcessedDataIndexById(this, `radiusValue-range`);
+ let groupPaddingInner = 0;
+ let groupPaddingOuter = 0;
+ if (angleAxis instanceof AngleCategoryAxis) {
+ groupPaddingInner = angleAxis.groupPaddingInner;
+ groupPaddingOuter = angleAxis.paddingInner;
+ }
+ const groupAngleStep = angleScale.bandwidth ?? 0;
+ const paddedGroupAngleStep = groupAngleStep * (1 - groupPaddingOuter);
+ const { index: groupIndex, visibleGroupCount } = this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);
+ groupScale.domain = Array.from({ length: visibleGroupCount }).map((_, i) => String(i));
+ groupScale.range = [-paddedGroupAngleStep / 2, paddedGroupAngleStep / 2];
+ groupScale.paddingInner = visibleGroupCount > 1 ? groupPaddingInner : 0;
+ const radiusAxisReversed = this.isRadiusAxisReversed();
+ const axisInnerRadius = radiusAxisReversed ? this.radius : this.getAxisInnerRadius();
+ const axisOuterRadius = radiusAxisReversed ? this.getAxisInnerRadius() : this.radius;
+ const axisTotalRadius = axisOuterRadius + axisInnerRadius;
+ const { angleKey, radiusKey, angleName, radiusName, legendItemName, label } = this.properties;
+ const radiusDomain = this.getSeriesDomain(ChartAxisDirection28.Radius);
+ const getLabelNodeDatum = (datum, radiusDatum, x, y) => {
+ const labelText = this.getLabelText(
+ radiusDatum,
+ datum,
+ radiusKey,
+ "radius",
+ radiusDomain,
+ label,
+ { value: radiusDatum, datum, angleKey, radiusKey, angleName, radiusName, legendItemName }
+ );
+ if (labelText) {
+ return { x, y, text: labelText, textAlign: "center", textBaseline: "middle" };
+ }
+ };
+ const nodeData = [];
+ const styles = getItemStyles3(
+ (nodeDatum, isHighlight, highlightState) => getItemStyle(this, nodeDatum, isHighlight, highlightState)
+ );
+ const context = {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles
+ };
+ if (!this.visible)
+ return context;
+ const { dataSources } = processedData;
+ const rawData = dataSources.get(this.id)?.data ?? [];
+ for (const { datumIndex, group } of dataModel.forEachGroupDatum(this, processedData)) {
+ const datum = rawData[datumIndex];
+ const angleDatum = angleValues[datumIndex];
+ if (angleDatum == null)
+ return;
+ const radiusDatum = radiusRawValues[datumIndex];
+ const isPositive = radiusDatum >= 0 && !Object.is(radiusDatum, -0);
+ const innerRadiusDatum = radiusStartValues[datumIndex];
+ const outerRadiusDatum = radiusEndValues[datumIndex];
+ const radiusRange = group.aggregation[radiusRangeIndex][isPositive ? 1 : 0] ?? 0;
+ const negative = isPositive === radiusAxisReversed;
+ if (innerRadiusDatum === void 0 || outerRadiusDatum === void 0)
+ return;
+ let startAngle;
+ let endAngle;
+ if (rawData.length === 1) {
+ startAngle = -0.5 * Math.PI;
+ endAngle = 1.5 * Math.PI;
+ } else {
+ const groupAngle = angleScale.convert(angleDatum);
+ startAngle = normalizeAngle3605(groupAngle + groupScale.convert(String(groupIndex)));
+ endAngle = normalizeAngle3605(startAngle + groupScale.bandwidth);
+ }
+ const angle = startAngle + groupScale.bandwidth / 2;
+ const innerRadius = axisTotalRadius - radiusScale.convert(innerRadiusDatum);
+ const outerRadius = axisTotalRadius - radiusScale.convert(outerRadiusDatum);
+ const midRadius = (innerRadius + outerRadius) / 2;
+ const stackInnerRadius = axisTotalRadius - radiusScale.convert(0);
+ const stackOuterRadius = axisTotalRadius - radiusScale.convert(radiusRange);
+ const x = Math.cos(angle) * midRadius;
+ const y = Math.sin(angle) * midRadius;
+ const labelNodeDatum = this.properties.label.enabled ? getLabelNodeDatum(datum, radiusDatum, x, y) : void 0;
+ const columnWidth = this.getColumnWidth(startAngle, endAngle);
+ nodeData.push({
+ series: this,
+ datum,
+ datumIndex,
+ point: { x, y, size: 0 },
+ midPoint: { x, y },
+ label: labelNodeDatum,
+ angleValue: angleDatum,
+ radiusValue: radiusDatum,
+ negative,
+ innerRadius,
+ outerRadius,
+ stackInnerRadius,
+ stackOuterRadius,
+ startAngle,
+ endAngle,
+ midAngle: angle,
+ axisInnerRadius,
+ axisOuterRadius,
+ columnWidth,
+ index: datumIndex
+ });
+ }
+ return {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles
+ };
+ }
+ getColumnWidth(_startAngle, _endAngle) {
+ return Number.NaN;
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ this.maybeRefreshNodeData();
+ this.contentGroup.translationX = this.centerX;
+ this.contentGroup.translationY = this.centerY;
+ this.highlightGroup.translationX = this.centerX;
+ this.highlightGroup.translationY = this.centerY;
+ if (this.labelGroup) {
+ this.labelGroup.translationX = this.centerX;
+ this.labelGroup.translationY = this.centerY;
+ }
+ this.updateSectorSelection(this.itemSelection, false);
+ this.updateSectorSelection(this.highlightSelection, true);
+ this.updateLabels();
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateSectorSelection(selection, isHighlight) {
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ let selectionData = [];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ if (isHighlight) {
+ if (activeHighlight?.datum && activeHighlight.series === this) {
+ selectionData.push(activeHighlight);
+ }
+ } else {
+ selectionData = this.nodeData;
+ }
+ const radiusAxisReversed = this.isRadiusAxisReversed();
+ const axisInnerRadius = radiusAxisReversed ? this.radius : this.getAxisInnerRadius();
+ const axisOuterRadius = radiusAxisReversed ? this.getAxisInnerRadius() : this.radius;
+ const fillBBox = this.getShapeFillBBox();
+ const hasItemStylers = this.hasItemStylers();
+ selection.update(selectionData, void 0, (datum) => this.getDatumId(datum)).each((node, nodeDatum) => {
+ const { midPoint } = nodeDatum;
+ if (hasItemStylers) {
+ const highlightState = this.getHighlightState(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ nodeDatum.style = getItemStyle(this, nodeDatum, isHighlight, highlightState);
+ }
+ const style = nodeDatum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex)];
+ const fill = style.fill;
+ const itemBounds = isGradientFill2(fill) && fill.bounds === "item";
+ const fillParams = itemBounds ? { centerX: midPoint?.x ?? 0, centerY: midPoint?.y ?? 0 } : { centerX: 0, centerY: 0, innerRadius: axisInnerRadius, outerRadius: axisOuterRadius };
+ this.updateItemPath(node, nodeDatum, isHighlight);
+ applyShapeStyle13(node, style, fillBBox, fillParams);
+ node.cornerRadius = style.cornerRadius ?? 0;
+ node.lineJoin = "round";
+ });
+ }
+ updateLabels() {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ this.labelSelection.update(this.nodeData).each((node, datum) => {
+ updateLabelNode6(this, node, this.properties, this.properties.label, datum.label, false, activeHighlight);
+ node.fillOpacity = this.getHighlightStyle(false, datum.datumIndex).opacity ?? 1;
+ });
+ }
+ animateEmptyUpdateReady() {
+ const { labelSelection } = this;
+ const fns = this.getColumnTransitionFunctions();
+ motion6.fromToMotion(this.id, "datums", this.ctx.animationManager, [this.itemSelection], fns);
+ seriesLabelFadeInAnimation5(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateClearingUpdateEmpty() {
+ const { itemSelection } = this;
+ const { animationManager } = this.ctx;
+ const fns = this.getColumnTransitionFunctions();
+ motion6.fromToMotion(this.id, "datums", animationManager, [itemSelection], fns);
+ seriesLabelFadeOutAnimation(this, "labels", animationManager, this.labelSelection);
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { angleKey, angleName, radiusKey, radiusName, legendItemName, tooltip } = properties;
+ const angleAxis = axes[ChartAxisDirection28.Angle];
+ const radiusAxis = axes[ChartAxisDirection28.Radius];
+ const nodeDatum = this.nodeData?.[datumIndex];
+ if (!dataModel || !processedData || !angleAxis || !radiusAxis || !nodeDatum)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const angleValue = dataModel.resolveKeysById(this, `angleValue`, processedData)[datumIndex];
+ const radiusValue = dataModel.resolveColumnById(this, `radiusValue-raw`, processedData)[datumIndex];
+ if (angleValue == null)
+ return;
+ const format = getItemStyle(this, nodeDatum, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(angleAxis, "tooltip", angleValue, datum, angleKey, void 0),
+ symbol: this.legendItemSymbol(),
+ data: [
+ {
+ label: radiusName,
+ fallbackLabel: radiusKey,
+ value: this.getAxisValueText(radiusAxis, "tooltip", radiusValue, datum, radiusKey, void 0)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: angleName,
+ angleKey,
+ angleName,
+ radiusKey,
+ radiusName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return this.pickNodeNearestDistantObject(point, this.itemSelection.nodes());
+ }
+ legendItemSymbol() {
+ const { fill, stroke: stroke2, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = getStyle(
+ this,
+ false,
+ false,
+ import_ag_charts_community230._ModuleSupport.HighlightState.None
+ );
+ const markerStyle = {
+ fill: fill ?? "rgba(0, 0, 0, 0)",
+ stroke: stroke2 ?? "rgba(0, 0, 0, 0)",
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ if (import_ag_charts_community230._ModuleSupport.isGradientFill(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ return {
+ marker: markerStyle
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { radiusKey, radiusName, legendItemName, showInLegend } = this.properties;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: radiusKey,
+ seriesId,
+ enabled: visible,
+ label: {
+ text: legendItemName ?? radiusName ?? radiusKey
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ getDatumId(datum) {
+ return createDatumId16(datum.angleValue);
+ }
+ computeLabelsBBox() {
+ return null;
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesBaseProperties.ts
+var import_ag_charts_community231 = require("ag-charts-community");
+var { SeriesProperties: SeriesProperties8, makeSeriesTooltip: makeSeriesTooltip17, Property: Property75, Label: Label12 } = import_ag_charts_community231._ModuleSupport;
+var RadialColumnSeriesBaseProperties = class extends SeriesProperties8 {
+ constructor() {
+ super(...arguments);
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.rotation = 0;
+ this.label = new Label12();
+ this.tooltip = makeSeriesTooltip17();
+ }
+ getStyle() {
+ const { fill, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset, cornerRadius } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "angleKey", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "angleName", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "radiusKey", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "radiusName", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "fill", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "styler", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "stackGroup", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "normalizedTo", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "label", 2);
+__decorateClass([
+ Property75
+], RadialColumnSeriesBaseProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleUtil.ts
+var import_ag_charts_community233 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnUtil.ts
+var import_ag_charts_community232 = require("ag-charts-community");
+var { motion: motion7 } = import_ag_charts_community232._ModuleSupport;
+function createAngleMotionCalculator() {
+ const angles = {
+ startAngle: /* @__PURE__ */ new Map(),
+ endAngle: /* @__PURE__ */ new Map()
+ };
+ const angleKeys = ["startAngle", "endAngle"];
+ const calculate = (node, datum, status) => {
+ for (const key of angleKeys) {
+ const map = angles[key];
+ let from2 = (status === "removed" || status === "updated" ? node : datum)[key];
+ let to2 = (status === "removed" ? node : datum)[key];
+ if (Number.isNaN(to2)) {
+ to2 = node.previousDatum?.[key] ?? Number.NaN;
+ }
+ const diff8 = from2 - to2;
+ if (Math.abs(diff8) > Math.PI) {
+ from2 -= Math.sign(diff8) * 2 * Math.PI;
+ }
+ map.set(datum, { from: from2, to: to2 });
+ }
+ };
+ const getAngles = (datum, fromToKey) => {
+ return {
+ startAngle: angles.startAngle.get(datum)[fromToKey],
+ endAngle: angles.endAngle.get(datum)[fromToKey]
+ };
+ };
+ const from = (datum) => getAngles(datum, "from");
+ const to = (datum) => getAngles(datum, "to");
+ return { calculate, from, to };
+}
+function fixRadialColumnAnimationStatus(node, datum, status) {
+ if (status === "updated") {
+ if (node.previousDatum == null || Number.isNaN(node.previousDatum.startAngle) || Number.isNaN(node.previousDatum.endAngle)) {
+ return "added";
+ }
+ if (Number.isNaN(datum.startAngle) || Number.isNaN(datum.endAngle)) {
+ return "removed";
+ }
+ }
+ if (status === "added" && node.previousDatum != null) {
+ return "updated";
+ }
+ return status;
+}
+function prepareRadialColumnAnimationFunctions(axisZeroRadius) {
+ const angles = createAngleMotionCalculator();
+ const fromFn = (node, datum, status) => {
+ status = fixRadialColumnAnimationStatus(node, datum, status);
+ angles.calculate(node, datum, status);
+ const { startAngle, endAngle } = angles.from(datum);
+ let innerRadius;
+ let outerRadius;
+ let columnWidth;
+ let axisInnerRadius;
+ let axisOuterRadius;
+ if (status === "removed" || status === "updated") {
+ innerRadius = node.innerRadius;
+ outerRadius = node.outerRadius;
+ columnWidth = node.columnWidth;
+ axisInnerRadius = node.axisInnerRadius;
+ axisOuterRadius = node.axisOuterRadius;
+ } else {
+ innerRadius = axisZeroRadius;
+ outerRadius = axisZeroRadius;
+ columnWidth = datum.columnWidth;
+ axisInnerRadius = datum.axisInnerRadius;
+ axisOuterRadius = datum.axisOuterRadius;
+ }
+ const phase = motion7.NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return {
+ innerRadius,
+ outerRadius,
+ columnWidth,
+ axisInnerRadius,
+ axisOuterRadius,
+ startAngle,
+ endAngle,
+ phase
+ };
+ };
+ const toFn = (node, datum, status) => {
+ const { startAngle, endAngle } = angles.to(datum);
+ let innerRadius;
+ let outerRadius;
+ let columnWidth;
+ let axisInnerRadius;
+ let axisOuterRadius;
+ if (status === "removed") {
+ innerRadius = node.innerRadius;
+ outerRadius = node.innerRadius;
+ columnWidth = node.columnWidth;
+ axisInnerRadius = node.axisInnerRadius;
+ axisOuterRadius = node.axisOuterRadius;
+ } else {
+ innerRadius = Number.isNaN(datum.innerRadius) ? axisZeroRadius : datum.innerRadius;
+ outerRadius = Number.isNaN(datum.outerRadius) ? axisZeroRadius : datum.outerRadius;
+ columnWidth = Number.isNaN(datum.columnWidth) ? node.columnWidth : datum.columnWidth;
+ axisInnerRadius = datum.axisInnerRadius;
+ axisOuterRadius = datum.axisOuterRadius;
+ }
+ return { innerRadius, outerRadius, columnWidth, axisInnerRadius, axisOuterRadius, startAngle, endAngle };
+ };
+ return { toFn, fromFn };
+}
+function resetRadialColumnSelectionFn(_node, {
+ innerRadius,
+ outerRadius,
+ columnWidth,
+ axisInnerRadius,
+ axisOuterRadius,
+ startAngle,
+ endAngle
+}) {
+ return { innerRadius, outerRadius, columnWidth, axisInnerRadius, axisOuterRadius, startAngle, endAngle };
+}
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleUtil.ts
+var { SectorBox, motion: motion8 } = import_ag_charts_community233._ModuleSupport;
+function getRadii(datum) {
+ const { negative, innerRadius, outerRadius, stackInnerRadius, stackOuterRadius } = datum;
+ return {
+ innerRadius: negative ? stackOuterRadius : stackInnerRadius,
+ outerRadius: negative ? stackInnerRadius : stackOuterRadius,
+ clipInnerRadius: negative ? outerRadius : innerRadius,
+ clipOuterRadius: negative ? innerRadius : outerRadius
+ };
+}
+function prepareNightingaleAnimationFunctions(axisZeroRadius) {
+ const angles = createAngleMotionCalculator();
+ const fromFn = (sect, datum, status) => {
+ status = fixRadialColumnAnimationStatus(sect, datum, status);
+ angles.calculate(sect, datum, status);
+ const { startAngle, endAngle } = angles.from(datum);
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed" || status === "updated") {
+ innerRadius = sect.innerRadius;
+ outerRadius = sect.outerRadius;
+ clipSector = sect.clipSector;
+ } else {
+ innerRadius = axisZeroRadius;
+ outerRadius = axisZeroRadius;
+ }
+ clipSector ?? (clipSector = new SectorBox(startAngle, endAngle, innerRadius, outerRadius));
+ const phase = motion8.NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return { innerRadius, outerRadius, startAngle, endAngle, clipSector, phase };
+ };
+ const toFn = (_sect, datum, status) => {
+ const { startAngle, endAngle } = angles.to(datum);
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed") {
+ innerRadius = axisZeroRadius;
+ outerRadius = axisZeroRadius;
+ clipSector = new SectorBox(startAngle, endAngle, innerRadius, outerRadius);
+ } else {
+ let clipInnerRadius, clipOuterRadius;
+ ({ innerRadius, outerRadius, clipInnerRadius, clipOuterRadius } = getRadii(datum));
+ if (Number.isNaN(innerRadius))
+ innerRadius = axisZeroRadius;
+ if (Number.isNaN(outerRadius))
+ outerRadius = axisZeroRadius;
+ if (Number.isNaN(clipInnerRadius))
+ clipInnerRadius = axisZeroRadius;
+ if (Number.isNaN(clipOuterRadius))
+ clipOuterRadius = axisZeroRadius;
+ clipSector = new SectorBox(startAngle, endAngle, clipInnerRadius, clipOuterRadius);
+ }
+ return { innerRadius, outerRadius, startAngle, endAngle, clipSector };
+ };
+ return { toFn, fromFn };
+}
+function resetNightingaleSelectionFn(_sect, datum) {
+ const { startAngle, endAngle } = datum;
+ const { innerRadius, outerRadius, clipInnerRadius, clipOuterRadius } = getRadii(datum);
+ const clipSector = new SectorBox(startAngle, endAngle, clipInnerRadius, clipOuterRadius);
+ return { innerRadius, outerRadius, startAngle, endAngle, clipSector };
+}
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleSeries.ts
+var { Sector: Sector4, SectorBox: SectorBox2, PolarZIndexMap } = import_ag_charts_community234._ModuleSupport;
+var NightingaleSeries = class extends RadialColumnSeriesBase {
+ // TODO: Enable once the options contract has been revisited
+ // @TempValidate
+ // sectorSpacing = 1;
+ constructor(moduleCtx) {
+ super(moduleCtx, { animationResetFns: { item: resetNightingaleSelectionFn } });
+ this.properties = new RadialColumnSeriesBaseProperties();
+ }
+ setZIndex(zIndex) {
+ super.setZIndex(zIndex);
+ this.contentGroup.zIndex = [0, PolarZIndexMap.FOREGROUND, zIndex];
+ this.highlightGroup.zIndex = [0, PolarZIndexMap.HIGHLIGHT, zIndex];
+ this.labelGroup.zIndex = [0, PolarZIndexMap.LABEL, zIndex];
+ return true;
+ }
+ getStackId() {
+ const groupIndex = this.seriesGrouping?.groupIndex ?? this.id;
+ return `nightingale-stack-${groupIndex}-yValues`;
+ }
+ nodeFactory() {
+ return new Sector4();
+ }
+ updateItemPath(node, datum, highlight) {
+ const { negative } = datum;
+ node.centerX = 0;
+ node.centerY = 0;
+ node.startOuterCornerRadius = negative ? 0 : this.properties.cornerRadius;
+ node.endOuterCornerRadius = negative ? 0 : this.properties.cornerRadius;
+ node.startInnerCornerRadius = negative ? this.properties.cornerRadius : 0;
+ node.endInnerCornerRadius = negative ? this.properties.cornerRadius : 0;
+ if (highlight) {
+ const { startAngle, endAngle } = datum;
+ const { innerRadius, outerRadius, clipInnerRadius, clipOuterRadius } = getRadii(datum);
+ node.innerRadius = innerRadius;
+ node.outerRadius = outerRadius;
+ node.startAngle = startAngle;
+ node.endAngle = endAngle;
+ node.clipSector = new SectorBox2(startAngle, endAngle, clipInnerRadius, clipOuterRadius);
+ }
+ }
+ getColumnTransitionFunctions() {
+ const axisZeroRadius = this.isRadiusAxisReversed() ? this.radius : this.getAxisInnerRadius();
+ return prepareNightingaleAnimationFunctions(axisZeroRadius);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null || this.properties.label.itemStyler != null;
+ }
+};
+NightingaleSeries.className = "NightingaleSeries";
+NightingaleSeries.type = "nightingale";
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleSeriesOptionsDef.ts
+var import_ag_charts_community235 = require("ag-charts-community");
+var import_ag_charts_core102 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs15, nightingaleSeriesThemeableOptionsDef } = import_ag_charts_community235._ModuleSupport;
+var nightingaleSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs15,
+ ...nightingaleSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core102.required)((0, import_ag_charts_core102.constant)("nightingale")),
+ angleKey: (0, import_ag_charts_core102.required)(import_ag_charts_core102.string),
+ radiusKey: (0, import_ag_charts_core102.required)(import_ag_charts_core102.string),
+ angleName: import_ag_charts_core102.string,
+ radiusName: import_ag_charts_core102.string,
+ legendItemName: import_ag_charts_core102.string,
+ grouped: import_ag_charts_core102.boolean,
+ stacked: import_ag_charts_core102.boolean,
+ stackGroup: import_ag_charts_core102.string,
+ normalizedTo: import_ag_charts_core102.number
+};
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleThemes.ts
+var import_ag_charts_community236 = require("ag-charts-community");
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE, POLAR_AXIS_SHAPE },
+ FILL_GRADIENT_RADIAL_SERIES_DEFAULTS,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS4,
+ FILL_PATTERN_DEFAULTS: FILL_PATTERN_DEFAULTS2
+} = import_ag_charts_community236._ModuleSupport;
+var NIGHTINGALE_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", FILL_GRADIENT_RADIAL_SERIES_DEFAULTS],
+ ["image", FILL_IMAGE_DEFAULTS4],
+ ["pattern", FILL_PATTERN_DEFAULTS2]
+ ]
+ },
+ stroke: {
+ $if: [{ $eq: [{ $palette: "type" }, "inbuilt"] }, { $ref: "chartBackgroundColor" }, { $palette: "stroke" }]
+ },
+ strokeWidth: 1,
+ label: {
+ ...import_ag_charts_community236._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: import_ag_charts_community236._ModuleSupport.multiSeriesHighlightStyle()
+ },
+ axes: {
+ [POLAR_AXIS_TYPE.ANGLE_CATEGORY]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE.CIRCLE },
+ groupPaddingInner: 0,
+ paddingInner: 0,
+ label: {
+ spacing: 10
+ }
+ },
+ [POLAR_AXIS_TYPE.RADIUS_NUMBER]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE.CIRCLE }
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/nightingale/nightingaleModule.ts
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE2 }
+} = import_ag_charts_community237._ModuleSupport;
+var NightingaleModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "nightingale",
+ moduleFactory: (ctx) => new NightingaleSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE2.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE2.RADIUS_NUMBER }],
+ themeTemplate: NIGHTINGALE_SERIES_THEME,
+ stackable: true,
+ groupable: true,
+ stackedByDefault: true
+};
+var NightingaleSeriesModule = {
+ type: "series",
+ name: "nightingale",
+ chartType: "polar",
+ enterprise: true,
+ options: nightingaleSeriesOptionsDef,
+ create: (ctx) => new NightingaleSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidSeries.ts
+var import_ag_charts_community239 = require("ag-charts-community");
+var import_ag_charts_core103 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidProperties.ts
+var import_ag_charts_community238 = require("ag-charts-community");
+var { SeriesProperties: SeriesProperties9, makeSeriesTooltip: makeSeriesTooltip18, Property: Property76, Label: Label13, DropShadow: DropShadow5 } = import_ag_charts_community238._ModuleSupport;
+var PyramidSeriesLabel = class extends Label13 {
+};
+var PyramidSeriesStageLabel = class extends Label13 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property76
+], PyramidSeriesStageLabel.prototype, "spacing", 2);
+__decorateClass([
+ Property76
+], PyramidSeriesStageLabel.prototype, "placement", 2);
+var PyramidProperties = class extends SeriesProperties9 {
+ constructor() {
+ super(...arguments);
+ this.fills = [];
+ this.fillOpacity = 1;
+ this.strokes = [];
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.direction = "vertical";
+ this.reverse = void 0;
+ this.spacing = 0;
+ this.aspectRatio = void 0;
+ this.shadow = new DropShadow5().set({ enabled: false });
+ this.label = new PyramidSeriesLabel();
+ this.stageLabel = new PyramidSeriesStageLabel();
+ this.tooltip = makeSeriesTooltip18();
+ }
+ getStyle(index = 0) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity, lineDash, lineDashOffset } = this;
+ return {
+ fill: fills[index % fills.length],
+ fillOpacity,
+ stroke: strokes[index % strokes.length],
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "stageKey", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "valueKey", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "fills", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "direction", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "reverse", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "aspectRatio", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "shadow", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "label", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "stageLabel", 2);
+__decorateClass([
+ Property76
+], PyramidProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidUtil.ts
+function applyPyramidDatum(connector, { x, y, top, right, bottom, left }) {
+ connector.x0 = x - top / 2;
+ connector.x1 = x + top / 2;
+ connector.x2 = x + bottom / 2;
+ connector.x3 = x - bottom / 2;
+ connector.y0 = y - left / 2;
+ connector.y1 = y - right / 2;
+ connector.y2 = y + right / 2;
+ connector.y3 = y + left / 2;
+}
+function preparePyramidAnimationFunctions(direction) {
+ const fromFn = (_connector, datum) => {
+ const { x, y } = datum;
+ let { top, right, bottom, left } = datum;
+ if (direction === "vertical") {
+ top = 0;
+ bottom = 0;
+ } else {
+ left = 0;
+ right = 0;
+ }
+ return { x, y, top, right, bottom, left };
+ };
+ const toFn = (_connector, datum) => {
+ const { x, y, top, right, bottom, left } = datum;
+ return { x, y, top, right, bottom, left };
+ };
+ const applyFn = applyPyramidDatum;
+ return { fromFn, toFn, applyFn };
+}
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidSeries.ts
+var {
+ StateMachine: StateMachine14,
+ valueProperty: valueProperty16,
+ SeriesNodePickMode: SeriesNodePickMode13,
+ createDatumId: createDatumId17,
+ BBox: BBox22,
+ Group: Group16,
+ Selection: Selection13,
+ Text: Text7,
+ PointerEvents: PointerEvents9,
+ applyShapeStyle: applyShapeStyle14,
+ mergeDefaults: mergeDefaults17,
+ fromToMotion: fromToMotion4,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation6,
+ getLabelStyles: getLabelStyles5
+} = import_ag_charts_community239._ModuleSupport;
+var PyramidSeries = class extends import_ag_charts_community239._ModuleSupport.DataModelSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: void 0,
+ pickModes: [SeriesNodePickMode13.EXACT_SHAPE_MATCH, SeriesNodePickMode13.NEAREST_NODE]
+ });
+ this.properties = new PyramidProperties();
+ this.itemGroup = this.contentGroup.appendChild(new Group16({ name: "itemGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group16({ name: "itemLabelGroup" }));
+ this.stageLabelGroup = this.contentGroup.appendChild(new Group16({ name: "stageLabelGroup" }));
+ this.datumSelection = Selection13.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.labelSelection = Selection13.select(
+ this.itemLabelGroup,
+ Text7
+ );
+ this.stageLabelSelection = Selection13.select(this.stageLabelGroup, Text7);
+ this.highlightDatumSelection = Selection13.select(
+ this.highlightGroup,
+ () => this.nodeFactory()
+ );
+ this.animationState = new StateMachine14(
+ "empty",
+ {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateEmptyUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ clear: "empty",
+ reset: "empty",
+ skip: "ready"
+ }
+ },
+ () => this.checkProcessedDataAnimatable()
+ );
+ this.itemLabelGroup.pointerEvents = PointerEvents9.None;
+ this.stageLabelGroup.pointerEvents = PointerEvents9.None;
+ }
+ addChartEventListeners() {
+ this.cleanup.register(this.ctx.eventsHub.on("legend:item-click", (event) => this.onLegendItemClick(event)));
+ }
+ nodeFactory() {
+ return new FunnelConnector();
+ }
+ getNodeData() {
+ return this.contextNodeData?.nodeData;
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ async processData(dataController) {
+ if (this.data == null)
+ return;
+ const {
+ id: seriesId,
+ visible,
+ ctx: { legendManager }
+ } = this;
+ const { stageKey, valueKey } = this.properties;
+ const xScaleType = "category";
+ const yScaleType = "number";
+ const validation = (_value, _datum, index) => visible && legendManager.getItemEnabled({ seriesId, itemId: index });
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ valueProperty16(stageKey, xScaleType, { id: "xValue" }),
+ valueProperty16(valueKey, yScaleType, { id: `yValue`, ...visibleProps, validation, invalidValue: 0 })
+ ]
+ });
+ }
+ createNodeData() {
+ const {
+ id: seriesId,
+ dataModel,
+ processedData,
+ properties,
+ visible,
+ ctx: { legendManager }
+ } = this;
+ const {
+ stageKey,
+ valueKey,
+ direction,
+ reverse = direction === "horizontal",
+ spacing,
+ aspectRatio,
+ label,
+ stageLabel
+ } = properties;
+ if (dataModel == null || processedData == null)
+ return;
+ const horizontal = direction === "horizontal";
+ const xValues = dataModel.resolveColumnById(this, `xValue`, processedData);
+ const yValues = dataModel.resolveColumnById(this, `yValue`, processedData);
+ const xDomain = dataModel.getDomain(this, "xValue", "value", processedData);
+ const yDomain = dataModel.getDomain(this, "yValue", "value", processedData);
+ const textMeasurer = (0, import_ag_charts_core103.cachedTextMeasurer)(stageLabel);
+ let textAlign;
+ let textBaseline;
+ if (horizontal) {
+ textAlign = "center";
+ textBaseline = stageLabel.placement === "before" ? "bottom" : "top";
+ } else {
+ textAlign = stageLabel.placement === "after" ? "left" : "right";
+ textBaseline = "middle";
+ }
+ const stageLabelData = stageLabel.enabled ? [] : void 0;
+ let maxLabelWidth = 0;
+ let maxLabelHeight = 0;
+ let yTotal = 0;
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xValue2 = xValues[datumIndex];
+ const yValue = yValues[datumIndex];
+ const enabled = visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex });
+ yTotal += yValue;
+ if (stageLabelData == null)
+ continue;
+ const text2 = this.getLabelText(
+ xValue2,
+ datum,
+ stageKey,
+ "x",
+ xDomain,
+ this.properties.stageLabel,
+ { datum, value: yValue, stageKey, valueKey }
+ );
+ const { width, height } = (0, import_ag_charts_core103.isArray)(text2) ? (0, import_ag_charts_core103.measureTextSegments)(text2, label) : textMeasurer.measureLines(text2);
+ maxLabelWidth = Math.max(maxLabelWidth, width);
+ maxLabelHeight = Math.max(maxLabelHeight, height);
+ stageLabelData.push({
+ x: Number.NaN,
+ y: Number.NaN,
+ text: text2,
+ textAlign,
+ textBaseline,
+ visible: enabled
+ });
+ }
+ const seriesRectWidth = this._nodeDataDependencies?.seriesRectWidth ?? 0;
+ const seriesRectHeight = this._nodeDataDependencies?.seriesRectHeight ?? 0;
+ const totalSpacing = spacing * (processedData.input.count - 1);
+ let bounds;
+ if (horizontal) {
+ const verticalInset = maxLabelHeight + stageLabel.spacing;
+ bounds = new BBox22(
+ 0,
+ stageLabel.placement === "before" ? verticalInset : 0,
+ seriesRectWidth,
+ seriesRectHeight - verticalInset
+ );
+ } else {
+ const horizontalInset = maxLabelWidth + stageLabel.spacing;
+ bounds = new BBox22(
+ stageLabel.placement === "after" ? 0 : horizontalInset,
+ 0,
+ seriesRectWidth - horizontalInset,
+ seriesRectHeight
+ );
+ }
+ if (aspectRatio != null && aspectRatio !== 0) {
+ const directionalAspectRatio = direction === "horizontal" ? 1 / aspectRatio : aspectRatio;
+ const constrainedWidth = Math.min(bounds.width, bounds.height * directionalAspectRatio);
+ const constrainedHeight = constrainedWidth / directionalAspectRatio;
+ bounds = new BBox22(
+ bounds.x + (bounds.width - constrainedWidth) / 2,
+ bounds.y + (bounds.height - constrainedHeight) / 2,
+ constrainedWidth,
+ constrainedHeight
+ );
+ }
+ let labelX;
+ let labelY;
+ if (horizontal) {
+ labelY = stageLabel.placement === "before" ? bounds.y - stageLabel.spacing : bounds.y + bounds.height + stageLabel.spacing;
+ } else {
+ labelX = stageLabel.placement === "after" ? bounds.x + bounds.width + stageLabel.spacing : bounds.x - stageLabel.spacing;
+ }
+ const availableWidth = bounds.width - (horizontal ? totalSpacing : 0);
+ const availableHeight = bounds.height - (horizontal ? 0 : totalSpacing);
+ if (availableWidth < 0 || availableHeight < 0)
+ return;
+ const nodeData = [];
+ const labelData = [];
+ let yStart = 0;
+ for (const [datumIndex, datum] of rawData.entries()) {
+ const xValue2 = xValues[datumIndex];
+ const yValue = yValues[datumIndex];
+ const enabled = visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex });
+ const yEnd = yStart + yValue;
+ const yMidRatio = (yStart + yEnd) / (2 * yTotal);
+ const yRangeRatio = (yEnd - yStart) / yTotal;
+ const xOffset = horizontal ? availableWidth * yMidRatio + spacing * datumIndex : availableWidth * 0.5;
+ const yOffset = horizontal ? availableHeight * 0.5 : availableHeight * yMidRatio + spacing * datumIndex;
+ const x = bounds.x + xOffset;
+ const y = bounds.y + yOffset;
+ if (stageLabelData != null) {
+ const stageLabelDatum = stageLabelData[datumIndex];
+ stageLabelDatum.x = labelX ?? x;
+ stageLabelDatum.y = labelY ?? y;
+ }
+ let top;
+ let right;
+ let bottom;
+ let left;
+ if (horizontal) {
+ const barWidth = availableWidth * yRangeRatio;
+ top = barWidth;
+ bottom = barWidth;
+ const y0 = (xOffset + barWidth / 2) * (availableHeight / bounds.width);
+ const y1 = (xOffset - barWidth / 2) * (availableHeight / bounds.width);
+ right = reverse ? bounds.height - y0 : y0;
+ left = reverse ? bounds.height - y1 : y1;
+ } else {
+ const barHeight = availableHeight * yRangeRatio;
+ right = barHeight;
+ left = barHeight;
+ const x0 = (yOffset - barHeight / 2) * (availableWidth / bounds.height);
+ const x1 = (yOffset + barHeight / 2) * (availableWidth / bounds.height);
+ top = reverse ? bounds.width - x0 : x0;
+ bottom = reverse ? bounds.width - x1 : x1;
+ }
+ const text2 = this.getLabelText(
+ yValue,
+ datum,
+ valueKey,
+ "y",
+ yDomain,
+ label,
+ {
+ datum,
+ value: yValue,
+ stageKey,
+ valueKey
+ }
+ );
+ const labelDatum = {
+ x,
+ y,
+ text: text2,
+ textAlign: "center",
+ textBaseline: "middle",
+ visible: enabled
+ };
+ labelData.push(labelDatum);
+ nodeData.push({
+ series: this,
+ itemId: valueKey,
+ datum,
+ datumIndex,
+ index: datumIndex,
+ xValue: xValue2,
+ yValue,
+ x,
+ y,
+ top,
+ right,
+ bottom,
+ left,
+ label: labelDatum,
+ enabled,
+ midPoint: {
+ x,
+ y
+ },
+ style: this.getItemStyle({ datumIndex, datum }, false)
+ });
+ yStart = yEnd;
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData,
+ stageLabelData,
+ bounds
+ };
+ }
+ updateSelections() {
+ if (this.nodeDataRefresh) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ update({ seriesRect }) {
+ this.checkResize(seriesRect);
+ const { datumSelection, labelSelection, stageLabelSelection, highlightDatumSelection } = this;
+ this.updateSelections();
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = this.getOpacity();
+ let highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ if (highlightedDatum != null && (highlightedDatum.series !== this || highlightedDatum.datum == null)) {
+ highlightedDatum = void 0;
+ }
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ const stageLabelData = this.contextNodeData?.stageLabelData ?? [];
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumStyles({ datumSelection, isHighlight: false });
+ this.updateDatumNodes({ datumSelection, isHighlight: false });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection, labelProperties: this.properties.label });
+ this.stageLabelSelection = this.updateStageLabelSelection({ stageLabelData, stageLabelSelection });
+ this.updateLabelNodes({
+ labelSelection: stageLabelSelection,
+ labelProperties: this.properties.stageLabel
+ });
+ this.highlightDatumSelection = this.updateDatumSelection({
+ nodeData: highlightedDatum == null ? [] : [highlightedDatum],
+ datumSelection: highlightDatumSelection
+ });
+ this.updateDatumStyles({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.updateDatumNodes({ datumSelection: highlightDatumSelection, isHighlight: true });
+ this.animationState.transition("update");
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData);
+ }
+ getItemStyle({ datumIndex, datum }, isHighlight) {
+ const { properties } = this;
+ const { itemStyler } = properties;
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults17(highlightStyle, properties.getStyle(datumIndex));
+ let style = baseStyle;
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId17(datumIndex, isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(datum, datumIndex, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults17(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(datum, datumIndex, isHighlight, style) {
+ const { id: seriesId, properties } = this;
+ const { stageKey, valueKey } = properties;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ stageKey,
+ valueKey,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateDatumStyles({
+ datumSelection,
+ isHighlight
+ }) {
+ datumSelection.each((_, nodeDatum) => {
+ nodeDatum.style = this.getItemStyle(nodeDatum, isHighlight);
+ });
+ }
+ updateDatumNodes({
+ datumSelection
+ }) {
+ const { properties } = this;
+ const { shadow } = properties;
+ const bounds = this.contextNodeData?.bounds;
+ const fillBBox = bounds ? { series: bounds, axis: bounds } : void 0;
+ datumSelection.each((connector, nodeDatum) => {
+ applyShapeStyle14(connector, nodeDatum.style, fillBBox);
+ applyPyramidDatum(connector, nodeDatum);
+ connector.fillShadow = shadow;
+ });
+ }
+ updateLabelSelection(opts) {
+ return opts.labelSelection.update(this.properties.label.enabled ? opts.labelData : []);
+ }
+ updateStageLabelSelection(opts) {
+ return opts.stageLabelSelection.update(opts.stageLabelData);
+ }
+ updateLabelNodes(opts) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, nodeDatum, datumIndex) => {
+ const { visible, x, y, text: text2, textAlign, textBaseline } = nodeDatum;
+ const style = getLabelStyles5(
+ this,
+ void 0,
+ this.properties,
+ opts.labelProperties,
+ false,
+ activeHighlight
+ );
+ const { color: fill, fontSize, fontStyle, fontWeight, fontFamily } = style;
+ label.visible = visible;
+ label.x = x;
+ label.y = y;
+ label.text = text2;
+ label.fill = fill;
+ label.fillOpacity = this.getHighlightStyle(false, datumIndex).opacity ?? 1;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = textBaseline;
+ label.setBoxing(style);
+ });
+ }
+ computeFocusBounds(opts) {
+ const datum = this.getNodeData()?.[opts.datumIndex];
+ if (datum === void 0)
+ return;
+ for (const node of this.datumSelection) {
+ if (node.datum === datum) {
+ return node.node;
+ }
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, properties } = this;
+ const { stageKey, valueKey, tooltip } = properties;
+ if (!dataModel || !processedData)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const xValue2 = dataModel.resolveColumnById(this, "xValue", processedData)[datumIndex];
+ const yValue = dataModel.resolveColumnById(this, `yValue`, processedData)[datumIndex];
+ if (xValue2 == null)
+ return;
+ const label = this.getLabelText(
+ xValue2,
+ datum,
+ stageKey,
+ "x",
+ dataModel.getDomain(this, "xValue", "value", processedData),
+ this.properties.stageLabel,
+ { datum, value: xValue2, stageKey, valueKey }
+ );
+ const value = this.getLabelText(
+ yValue,
+ datum,
+ valueKey,
+ "y",
+ dataModel.getDomain(this, "yValue", "value", processedData),
+ this.properties.stageLabel,
+ { datum, value: yValue, stageKey, valueKey }
+ );
+ const format = this.getItemStyle({ datumIndex, datum }, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ symbol: this.legendItemSymbol(datumIndex),
+ data: [{ label: (0, import_ag_charts_core103.toPlainText)(label), value: (0, import_ag_charts_core103.toPlainText)(value) }]
+ },
+ {
+ seriesId,
+ datum,
+ title: void 0,
+ stageKey,
+ valueKey,
+ ...format
+ }
+ );
+ }
+ getSeriesDomain() {
+ return [Number.NaN, Number.NaN];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ pickNodeClosestDatum({ x, y }) {
+ let minDistanceSquared = Infinity;
+ let minDatum;
+ this.datumSelection.each((node, datum) => {
+ const distanceSquared = node.distanceSquared(x, y);
+ if (distanceSquared < minDistanceSquared) {
+ minDistanceSquared = distanceSquared;
+ minDatum = datum;
+ }
+ });
+ return minDatum == null ? void 0 : { datum: minDatum, distance: Math.sqrt(minDistanceSquared) };
+ }
+ legendItemSymbol(datumIndex) {
+ const { fills, strokes, strokeWidth, fillOpacity, strokeOpacity, lineDash, lineDashOffset } = this.properties;
+ const fill = fills[datumIndex] ?? "black";
+ const stroke2 = strokes[datumIndex] ?? "black";
+ return {
+ marker: {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ }
+ };
+ }
+ getLegendData(legendType) {
+ const {
+ processedData,
+ dataModel,
+ id: seriesId,
+ ctx: { legendManager },
+ visible
+ } = this;
+ if (!dataModel || !processedData || legendType !== "category") {
+ return [];
+ }
+ const { showInLegend } = this.properties;
+ const legendData = [];
+ const stageValues = dataModel.resolveColumnById(this, `xValue`, processedData);
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ for (const [datumIndex] of rawData.entries()) {
+ const stageValue = stageValues[datumIndex];
+ legendData.push({
+ legendType: "category",
+ id: seriesId,
+ itemId: datumIndex,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: datumIndex }),
+ label: { text: stageValue },
+ symbol: this.legendItemSymbol(datumIndex),
+ hideInLegend: !showInLegend
+ });
+ }
+ return legendData;
+ }
+ animateReset() {
+ this.ctx.animationManager.skipCurrentBatch();
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ }
+ animateEmptyUpdateReady() {
+ const { datumSelection, labelSelection, properties } = this;
+ const fns = preparePyramidAnimationFunctions(properties.direction);
+ fromToMotion4(this.id, "nodes", this.ctx.animationManager, [datumSelection], fns);
+ seriesLabelFadeInAnimation6(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+PyramidSeries.className = "PyramidSeries";
+PyramidSeries.type = "pyramid";
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidSeriesOptionsDef.ts
+var import_ag_charts_community240 = require("ag-charts-community");
+var import_ag_charts_core104 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs16, pyramidSeriesThemeableOptionsDef } = import_ag_charts_community240._ModuleSupport;
+var pyramidSeriesOptionsDef = {
+ ...pyramidSeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs16,
+ type: (0, import_ag_charts_core104.required)((0, import_ag_charts_core104.constant)("pyramid")),
+ stageKey: (0, import_ag_charts_core104.required)(import_ag_charts_core104.string),
+ valueKey: (0, import_ag_charts_core104.required)(import_ag_charts_core104.string)
+};
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidThemes.ts
+var import_ag_charts_community241 = require("ag-charts-community");
+var {
+ ThemeSymbols: { DEFAULT_SHADOW_COLOUR: DEFAULT_SHADOW_COLOUR2 }
+} = import_ag_charts_community241._ModuleSupport;
+var PYRAMID_SERIES_THEME = {
+ series: {
+ direction: "vertical",
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ spacing: 2,
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ { $palette: "fills" },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", import_ag_charts_community241._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["pattern", import_ag_charts_community241._ModuleSupport.FILL_PATTERN_DEFAULTS],
+ ["image", import_ag_charts_community241._ModuleSupport.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [{ $size: { $path: ["./data", { $path: "/data" }] } }, { $palette: "strokes" }]
+ },
+ label: {
+ ...import_ag_charts_community241._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" }
+ },
+ stageLabel: {
+ ...import_ag_charts_community241._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ spacing: 12
+ },
+ shadow: {
+ enabled: false,
+ color: DEFAULT_SHADOW_COLOUR2,
+ xOffset: 3,
+ yOffset: 3,
+ blur: 5
+ },
+ // @ts-expect-error undocumented option
+ highlight: import_ag_charts_community241._ModuleSupport.singleSeriesHighlightStyle()
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/pyramid/pyramidModule.ts
+var PyramidModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "pyramid",
+ moduleFactory: (ctx) => new PyramidSeries(ctx),
+ solo: true,
+ themeTemplate: PYRAMID_SERIES_THEME
+};
+var PyramidSeriesModule = {
+ type: "series",
+ name: "pyramid",
+ chartType: "standalone",
+ enterprise: true,
+ options: pyramidSeriesOptionsDef,
+ create: (ctx) => new PyramidSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaModule.ts
+var import_ag_charts_community248 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radar/radarThemes.ts
+var import_ag_charts_community242 = require("ag-charts-community");
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE3 }
+} = import_ag_charts_community242._ModuleSupport;
+var BASE_RADAR_SERIES_THEME = {
+ series: {
+ stroke: { $palette: "stroke" },
+ label: {
+ ...import_ag_charts_community242._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ marker: {
+ enabled: true,
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", import_ag_charts_community242._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],
+ ["image", import_ag_charts_community242._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community242._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ fillOpacity: 1,
+ shape: "circle",
+ size: 6,
+ strokeOpacity: 1,
+ strokeWidth: { $isUserOption: ["./stroke", 1, 0] }
+ },
+ highlight: import_ag_charts_community242._ModuleSupport.multiSeriesHighlightStyle(),
+ tooltip: {
+ range: { $path: ["/tooltip/range", "nearest"] }
+ }
+ },
+ axes: {
+ [POLAR_AXIS_TYPE3.ANGLE_CATEGORY]: {
+ label: {
+ spacing: 10
+ }
+ }
+ }
+};
+var RADAR_LINE_SERIES_THEME = import_ag_charts_community242._ModuleSupport.mergeDefaults(
+ {
+ series: {
+ stroke: import_ag_charts_community242._ModuleSupport.SAFE_STROKE_FILL_OPERATION,
+ strokeWidth: 2
+ }
+ },
+ BASE_RADAR_SERIES_THEME
+);
+var RADAR_AREA_SERIES_THEME = import_ag_charts_community242._ModuleSupport.mergeDefaults(
+ {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", import_ag_charts_community242._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["image", import_ag_charts_community242._ModuleSupport.FILL_IMAGE_DEFAULTS],
+ ["pattern", import_ag_charts_community242._ModuleSupport.FILL_PATTERN_DEFAULTS]
+ ]
+ },
+ fillOpacity: 0.8,
+ strokeWidth: 2,
+ marker: {
+ enabled: false
+ }
+ }
+ },
+ BASE_RADAR_SERIES_THEME
+);
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeries.ts
+var import_ag_charts_community246 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radar/radarSeries.ts
+var import_ag_charts_community244 = require("ag-charts-community");
+var import_ag_charts_core105 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/radar/radarSeriesProperties.ts
+var import_ag_charts_community243 = require("ag-charts-community");
+var { Label: Label14, SeriesMarker: SeriesMarker2, SeriesProperties: SeriesProperties10, makeSeriesTooltip: makeSeriesTooltip19, Property: Property77 } = import_ag_charts_community243._ModuleSupport;
+var RadarSeriesProperties = class extends SeriesProperties10 {
+ constructor() {
+ super(...arguments);
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.rotation = 0;
+ this.marker = new SeriesMarker2();
+ this.label = new Label14();
+ this.tooltip = makeSeriesTooltip19();
+ this.connectMissingData = false;
+ }
+};
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "angleKey", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "radiusKey", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "angleName", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "radiusName", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "styler", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "marker", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property77
+], RadarSeriesProperties.prototype, "connectMissingData", 2);
+
+// packages/ag-charts-enterprise/src/series/radar/radarSeries.ts
+var {
+ DEFAULT_POLAR_DIRECTION_KEYS: DEFAULT_POLAR_DIRECTION_KEYS2,
+ DEFAULT_POLAR_DIRECTION_NAMES: DEFAULT_POLAR_DIRECTION_NAMES2,
+ ChartAxisDirection: ChartAxisDirection29,
+ PolarAxis: PolarAxis2,
+ SeriesNodePickMode: SeriesNodePickMode14,
+ valueProperty: valueProperty17,
+ fixNumericExtent: fixNumericExtent9,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation7,
+ markerFadeInAnimation: markerFadeInAnimation2,
+ resetMarkerFn: resetMarkerFn2,
+ animationValidation: animationValidation8,
+ computeMarkerFocusBounds: computeMarkerFocusBounds3,
+ extent: extent2,
+ BBox: BBox23,
+ Group: Group17,
+ Path: Path12,
+ Selection: Selection14,
+ Text: Text8,
+ Marker: Marker5,
+ updateLabelNode: updateLabelNode7,
+ getMarkerStyles: getMarkerStyles2,
+ mergeDefaults: mergeDefaults18
+} = import_ag_charts_community244._ModuleSupport;
+var RadarSeriesNodeEvent = class extends import_ag_charts_community244._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.angleKey = series.properties.angleKey;
+ this.radiusKey = series.properties.radiusKey;
+ }
+};
+var RadarSeries = class extends import_ag_charts_community244._ModuleSupport.PolarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: "angleValue",
+ propertyKeys: DEFAULT_POLAR_DIRECTION_KEYS2,
+ propertyNames: DEFAULT_POLAR_DIRECTION_NAMES2,
+ pickModes: [SeriesNodePickMode14.NEAREST_NODE, SeriesNodePickMode14.EXACT_SHAPE_MATCH],
+ canHaveAxes: true,
+ animationResetFns: {
+ item: resetMarkerFn2
+ },
+ clipFocusBox: false
+ });
+ this.NodeEvent = RadarSeriesNodeEvent;
+ this.lineGroup = this.contentGroup.appendChild(new Group17({ name: "radar-line" }));
+ this.lineSelection = Selection14.select(
+ this.lineGroup,
+ Path12
+ );
+ this.resetInvalidToZero = false;
+ this.circleCache = { r: 0, cx: 0, cy: 0 };
+ this.lineGroup.zIndex = 0;
+ this.itemGroup.zIndex = 1;
+ }
+ get hasData() {
+ return this.getHasData("angleValue");
+ }
+ nodeFactory() {
+ return new Marker5();
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!processedData || !dataModel)
+ return [];
+ if (direction === ChartAxisDirection29.Angle) {
+ return dataModel.getDomain(this, `angleValue`, "value", processedData);
+ } else {
+ const domain = dataModel.getDomain(this, `radiusValue`, "value", processedData);
+ const ext = extent2(domain.length === 0 ? domain : [0].concat(domain));
+ return fixNumericExtent9(ext);
+ }
+ }
+ async processData(dataController) {
+ const { angleKey, radiusKey } = this.properties;
+ const extraProps = [];
+ if (!this.ctx.animationManager.isSkipped()) {
+ extraProps.push(animationValidation8());
+ }
+ const radiusScaleType = this.axes[ChartAxisDirection29.Radius]?.scale.type;
+ const angleScaleType = this.axes[ChartAxisDirection29.Angle]?.scale.type;
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ valueProperty17(angleKey, angleScaleType, { id: "angleValue" }),
+ valueProperty17(radiusKey, radiusScaleType, { id: "radiusValue", invalidValue: void 0 }),
+ ...extraProps
+ ]
+ });
+ this.animationState.transition("updateData");
+ }
+ didCircleChange() {
+ const r = this.radius;
+ const cx = this.centerX;
+ const cy = this.centerY;
+ const cache = this.circleCache;
+ if (!(r === cache.r && cx === cache.cx && cy === cache.cy)) {
+ this.circleCache = { r, cx, cy };
+ return true;
+ }
+ return false;
+ }
+ getAxisInnerRadius() {
+ const radiusAxis = this.axes[ChartAxisDirection29.Radius];
+ return radiusAxis instanceof PolarAxis2 ? this.radius * radiusAxis.innerRadiusRatio : 0;
+ }
+ maybeRefreshNodeData() {
+ const didCircleChange = this.didCircleChange();
+ if (!didCircleChange && !this.nodeDataRefresh)
+ return;
+ this.contextNodeData = this.createNodeData();
+ this.nodeData = this.contextNodeData?.nodeData ?? [];
+ this.nodeDataRefresh = false;
+ }
+ createNodeData() {
+ const { processedData, dataModel } = this;
+ if (!processedData || !dataModel)
+ return;
+ const { angleKey, radiusKey, angleName, radiusName, legendItemName, marker, label } = this.properties;
+ const angleScale = this.axes[ChartAxisDirection29.Angle]?.scale;
+ const radiusScale = this.axes[ChartAxisDirection29.Radius]?.scale;
+ if (!angleScale || !radiusScale) {
+ return;
+ }
+ const angleValues = dataModel.resolveColumnById(this, `angleValue`, processedData);
+ const radiusValues = dataModel.resolveColumnById(this, `radiusValue`, processedData);
+ const axisInnerRadius = this.getAxisInnerRadius();
+ const radiusDomain = this.getSeriesDomain(ChartAxisDirection29.Radius);
+ const rawData = processedData.dataSources.get(this.id)?.data ?? [];
+ const nodeData = rawData.map((datum, datumIndex) => {
+ const angleDatum = angleValues[datumIndex];
+ const radiusDatum = radiusValues[datumIndex];
+ const angle = angleScale.convert(angleDatum);
+ const radius = this.radius + axisInnerRadius - radiusScale.convert(radiusDatum);
+ const cos = Math.cos(angle);
+ const sin = Math.sin(angle);
+ const x = cos * radius;
+ const y = sin * radius;
+ let labelNodeDatum;
+ if (label.enabled) {
+ const labelText = this.getLabelText(
+ radiusDatum,
+ datum,
+ radiusKey,
+ "radius",
+ radiusDomain,
+ label,
+ { value: radiusDatum, datum, angleKey, radiusKey, angleName, radiusName, legendItemName }
+ );
+ if (labelText) {
+ let textAlign = "right";
+ if ((0, import_ag_charts_core105.isNumberEqual)(cos, 0)) {
+ textAlign = "center";
+ } else if (cos > 0) {
+ textAlign = "left";
+ }
+ let textBaseline = "bottom";
+ if ((0, import_ag_charts_core105.isNumberEqual)(sin, 0)) {
+ textBaseline = "middle";
+ } else if (sin > 0) {
+ textBaseline = "top";
+ }
+ labelNodeDatum = {
+ x: x + cos * marker.size,
+ y: y + sin * marker.size,
+ text: labelText,
+ textAlign,
+ textBaseline
+ };
+ }
+ }
+ return {
+ series: this,
+ datum,
+ datumIndex,
+ index: datumIndex,
+ point: { x, y, size: marker.size },
+ midPoint: { x, y },
+ label: labelNodeDatum,
+ angleValue: angleDatum,
+ radiusValue: radiusDatum,
+ missing: !(0, import_ag_charts_core105.isFiniteNumber)(angle) || !(0, import_ag_charts_core105.isFiniteNumber)(radius)
+ };
+ });
+ return {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles: getMarkerStyles2(this, this.properties, marker)
+ };
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const { series } = this.ctx.highlightManager?.getActiveHighlight() ?? {};
+ this.highlightGroup.visible = (animationEnabled || this.visible) && series === this;
+ this.maybeRefreshNodeData();
+ this.contentGroup.translationX = this.centerX;
+ this.contentGroup.translationY = this.centerY;
+ this.highlightGroup.translationX = this.centerX;
+ this.highlightGroup.translationY = this.centerY;
+ if (this.labelGroup) {
+ this.labelGroup.translationX = this.centerX;
+ this.labelGroup.translationY = this.centerY;
+ }
+ this.updatePathSelections();
+ this.updateMarkerSelection();
+ this.updateHighlightSelection();
+ this.updatePathNodes();
+ if (this.hasItemStylers()) {
+ this.updateDatumStyles(this.itemSelection, false);
+ this.updateDatumStyles(this.highlightSelection, true);
+ }
+ this.updateMarkers(this.itemSelection, false);
+ this.updateMarkers(this.highlightSelection, true);
+ this.updateLabels();
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updatePathSelections() {
+ const pathData = this.visible ? [true] : [];
+ this.lineSelection.update(pathData);
+ }
+ updateMarkerSelection() {
+ const { marker, styler } = this.properties;
+ if (marker.isDirty()) {
+ this.itemSelection.clear();
+ this.itemSelection.cleanup();
+ this.itemSelection = Selection14.select(this.itemGroup, () => this.nodeFactory(), false);
+ }
+ const markersEnabled = styler == null ? marker.enabled : this.getStyle(false).marker.enabled;
+ const data = this.visible && marker.shape && markersEnabled ? this.nodeData : [];
+ this.itemSelection.update(data);
+ }
+ updateHighlightSelection() {
+ const { marker, styler } = this.properties;
+ if (marker.isDirty()) {
+ this.highlightSelection.clear();
+ this.highlightSelection.cleanup();
+ this.highlightSelection = Selection14.select(this.highlightGroup, () => this.nodeFactory(), false);
+ }
+ const markersEnabled = styler == null ? marker.enabled : this.getStyle(false).marker.enabled;
+ const highlighted = this.ctx.highlightManager?.getActiveHighlight();
+ const data = this.visible && marker.shape && markersEnabled && highlighted?.datum ? [{ ...highlighted }] : [];
+ this.highlightSelection.update(data);
+ }
+ getMarkerFill(highlightedStyle) {
+ return highlightedStyle?.fill ?? this.getStyle(false).marker.fill;
+ }
+ getDatumStylerProperties(datum) {
+ const { id: seriesId, properties } = this;
+ const { angleKey, radiusKey } = properties;
+ return {
+ seriesId,
+ datum,
+ angleKey,
+ radiusKey
+ };
+ }
+ updateDatumStyles(selection, isHighlight) {
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ selection.each((_, datum) => {
+ const highlightState = this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex);
+ const stylerStyle = this.getStyle(isHighlight, highlightState);
+ const { stroke: stroke2, strokeWidth, strokeOpacity } = stylerStyle;
+ datum.style = this.getMarkerStyle(
+ this.properties.marker,
+ datum,
+ this.getDatumStylerProperties(datum.datum),
+ { isHighlight, highlightState },
+ stylerStyle.marker,
+ {
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity
+ }
+ );
+ });
+ }
+ updateMarkers(selection, isHighlight) {
+ const fillBBox = this.getShapeFillBBox();
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ selection.each((node, datum) => {
+ const style = datum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, datum.datumIndex)];
+ this.applyMarkerStyle(style, node, datum.point, fillBBox);
+ });
+ }
+ updateLabels() {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ this.labelSelection.update(this.nodeData).each((node, datum) => {
+ if (datum.label) {
+ const isHighlight = false;
+ node.fillOpacity = this.getHighlightStyle(isHighlight, datum.datumIndex).opacity ?? 1;
+ updateLabelNode7(this, node, properties, properties.label, datum.label, isHighlight, activeHighlight);
+ }
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { angleKey, angleName, radiusKey, radiusName, legendItemName, tooltip, marker } = properties;
+ const angleAxis = axes[ChartAxisDirection29.Angle];
+ const radiusAxis = axes[ChartAxisDirection29.Radius];
+ if (!dataModel || !processedData || !angleAxis || !radiusAxis)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const angleValue = dataModel.resolveColumnById(this, `angleValue`, processedData)[datumIndex];
+ const radiusValue = dataModel.resolveColumnById(this, `radiusValue`, processedData)[datumIndex];
+ if (angleValue == null)
+ return;
+ const activeStyle = this.getMarkerStyle(marker, { datum, datumIndex }, this.getDatumStylerProperties(datum), {
+ isHighlight: false
+ });
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(angleAxis, "tooltip", angleValue, datum, angleKey, void 0),
+ symbol: this.legendItemSymbol(),
+ data: [
+ {
+ label: radiusName,
+ fallbackLabel: radiusKey,
+ value: this.getAxisValueText(radiusAxis, "tooltip", radiusValue, datum, radiusKey, void 0)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: angleName,
+ angleKey,
+ radiusKey,
+ angleName,
+ radiusName,
+ legendItemName,
+ ...activeStyle
+ }
+ );
+ }
+ legendItemSymbol() {
+ const { stroke: stroke2, strokeWidth, strokeOpacity, lineDash, marker } = this.getStyle(false);
+ const markerStyle = {
+ shape: marker.shape,
+ enabled: marker.enabled || strokeWidth <= 0,
+ fill: this.getMarkerFill() ?? marker.stroke ?? stroke2 ?? "rgba(0, 0, 0, 0)",
+ stroke: marker.stroke ?? stroke2 ?? "rgba(0, 0, 0, 0)",
+ fillOpacity: marker.fillOpacity,
+ strokeOpacity: marker.strokeOpacity,
+ strokeWidth: marker.strokeWidth,
+ lineDash: marker.lineDash,
+ lineDashOffset: marker.lineDashOffset
+ };
+ return {
+ marker: markerStyle,
+ line: {
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth,
+ lineDash
+ }
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const {
+ id: seriesId,
+ ctx: { legendManager },
+ visible
+ } = this;
+ const { radiusKey, radiusName, legendItemName, showInLegend } = this.properties;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: radiusKey,
+ seriesId,
+ enabled: visible && legendManager.getItemEnabled({ seriesId, itemId: radiusKey }),
+ label: {
+ text: legendItemName ?? radiusName ?? radiusKey
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ pickNodeClosestDatum(hitPoint) {
+ const { nodeData, centerX: cx, centerY: cy } = this;
+ const { x, y } = hitPoint;
+ const radius = this.radius;
+ const distanceFromCenter = Math.hypot(x - cx, y - cy);
+ if (distanceFromCenter > radius + this.properties.marker.size) {
+ return;
+ }
+ let minDistance = Infinity;
+ let closestDatum;
+ for (const datum of nodeData) {
+ const { point: { x: datumX = Number.NaN, y: datumY = Number.NaN } = {} } = datum;
+ if (Number.isNaN(datumX) || Number.isNaN(datumY)) {
+ continue;
+ }
+ const distance = Math.hypot(hitPoint.x - datumX - cx, hitPoint.y - datumY - cy);
+ if (distance < minDistance) {
+ minDistance = distance;
+ closestDatum = datum;
+ }
+ }
+ if (closestDatum) {
+ const distance = Math.max(minDistance - (closestDatum.point?.size ?? 0), 0);
+ return { datum: closestDatum, distance };
+ }
+ }
+ computeLabelsBBox() {
+ const { label } = this.properties;
+ this.maybeRefreshNodeData();
+ const textBoxes = [];
+ const tempText = new Text8();
+ for (const nodeDatum of this.nodeData) {
+ if (!label.enabled || !nodeDatum.label) {
+ continue;
+ }
+ tempText.text = nodeDatum.label.text;
+ tempText.x = nodeDatum.label.x;
+ tempText.y = nodeDatum.label.y;
+ tempText.setFont(label);
+ tempText.setAlign(nodeDatum.label);
+ const box = tempText.getBBox();
+ textBoxes.push(box);
+ }
+ if (textBoxes.length === 0) {
+ return null;
+ }
+ return BBox23.merge(textBoxes);
+ }
+ getLineNode() {
+ return this.lineSelection?.at(0);
+ }
+ beforePathAnimation() {
+ this.updatePathNodes();
+ }
+ getPathNodesStyle() {
+ const highlightDatum = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightState(highlightDatum);
+ const highlightStyle = this.getHighlightStyle(void 0, void 0, highlightState);
+ const stylerStyle = this.getStyle(false, highlightState);
+ return mergeDefaults18(highlightStyle, stylerStyle);
+ }
+ getLinePoints() {
+ const { nodeData, resetInvalidToZero } = this;
+ const { connectMissingData } = this.properties;
+ if (nodeData.length === 0) {
+ return [];
+ }
+ const radiusAxis = this.axes[ChartAxisDirection29.Radius];
+ const angleAxis = this.axes[ChartAxisDirection29.Angle];
+ const reversedAngleAxis = angleAxis?.isReversed();
+ const reversedRadiusAxis = radiusAxis?.isReversed();
+ const data = reversedRadiusAxis && !reversedAngleAxis ? [...nodeData].reverse() : nodeData;
+ const points = [];
+ let prevPointInvalid = false;
+ let firstValid;
+ for (const [index, datum] of data.entries()) {
+ let { x, y } = datum.point;
+ const isPointInvalid = Number.isNaN(x) || Number.isNaN(y);
+ if (!isPointInvalid) {
+ firstValid ?? (firstValid = datum);
+ }
+ if (isPointInvalid && !connectMissingData) {
+ x = 0;
+ y = 0;
+ }
+ const moveTo2 = index === 0 || !resetInvalidToZero && !connectMissingData && (isPointInvalid || prevPointInvalid);
+ points.push({ x, y, moveTo: moveTo2 });
+ prevPointInvalid = isPointInvalid;
+ }
+ if (firstValid !== void 0) {
+ points.push({ x: firstValid.point.x, y: firstValid.point.y, moveTo: false });
+ }
+ return points;
+ }
+ animateSinglePath(pathNode, points, ratio3) {
+ const { path } = pathNode;
+ path.clear(true);
+ const axisInnerRadius = this.getAxisInnerRadius();
+ const radiusAxis = this.axes[ChartAxisDirection29.Radius];
+ const reversedRadiusAxis = radiusAxis?.isReversed();
+ const radiusZero = reversedRadiusAxis ? this.radius + axisInnerRadius - radiusAxis?.scale.convert(0) : axisInnerRadius;
+ for (const point of points) {
+ const { x: x1, y: y1, arc, radius = 0, startAngle = 0, endAngle = 0, moveTo: moveTo2 } = point;
+ const angle = Math.atan2(y1, x1);
+ const x0 = radiusZero * Math.cos(angle);
+ const y0 = radiusZero * Math.sin(angle);
+ const t = ratio3;
+ const x = x0 * (1 - t) + x1 * t;
+ const y = y0 * (1 - t) + y1 * t;
+ if (arc) {
+ path.arc(x1, y1, radius, startAngle, endAngle);
+ } else if (moveTo2) {
+ path.moveTo(x, y);
+ } else {
+ path.lineTo(x, y);
+ }
+ }
+ pathNode.checkPathDirty();
+ }
+ animatePaths(ratio3) {
+ const linePoints = this.getLinePoints();
+ const lineNode = this.getLineNode();
+ if (!lineNode)
+ return;
+ this.animateSinglePath(lineNode, linePoints, ratio3);
+ }
+ animateEmptyUpdateReady() {
+ const { itemSelection, labelSelection } = this;
+ const { animationManager } = this.ctx;
+ this.beforePathAnimation();
+ animationManager.animate({
+ id: `${this.id}_'path`,
+ groupId: this.id,
+ from: 0,
+ to: 1,
+ phase: "initial",
+ collapsable: false,
+ onUpdate: (ratio3) => this.animatePaths(ratio3),
+ onStop: () => this.animatePaths(1)
+ });
+ markerFadeInAnimation2(this, animationManager, "added", itemSelection);
+ seriesLabelFadeInAnimation7(this, "labels", animationManager, labelSelection);
+ }
+ animateWaitingUpdateReady(data) {
+ super.animateWaitingUpdateReady(data);
+ this.resetPaths();
+ }
+ animateReadyResize(data) {
+ super.animateReadyResize(data);
+ this.resetPaths();
+ }
+ resetPaths() {
+ const lineNode = this.getLineNode();
+ if (lineNode) {
+ const { path: linePath } = lineNode;
+ const linePoints = this.getLinePoints();
+ const stylerStyle = this.getStyle(false);
+ lineNode.fill = void 0;
+ lineNode.stroke = stylerStyle.stroke;
+ lineNode.strokeWidth = stylerStyle.strokeWidth;
+ lineNode.strokeOpacity = stylerStyle.strokeOpacity;
+ lineNode.lineDash = stylerStyle.lineDash;
+ lineNode.lineDashOffset = stylerStyle.lineDashOffset;
+ linePath.clear(true);
+ for (const { x, y, moveTo: moveTo2 } of linePoints) {
+ if (moveTo2) {
+ linePath.moveTo(x, y);
+ } else {
+ linePath.lineTo(x, y);
+ }
+ }
+ lineNode.checkPathDirty();
+ return stylerStyle;
+ }
+ }
+ getStylerResult(stylerResult, highlighted, highlightState) {
+ const { styler } = this.properties;
+ if (styler) {
+ const stylerParams = this.makeStylerParams(highlighted, highlightState);
+ const cbResult = this.cachedCallWithContext(styler, stylerParams) ?? {};
+ const resolved = this.ctx.optionsGraphService.resolvePartial(
+ ["series", `${this.declarationOrder}`],
+ cbResult,
+ { pick: false }
+ );
+ if (resolved) {
+ stylerResult = resolved;
+ }
+ }
+ return stylerResult;
+ }
+ getFormattedMarkerStyle(datum) {
+ const { angleKey, radiusKey } = this.properties;
+ return this.getMarkerStyle(this.properties.marker, datum, { angleKey, radiusKey }, { isHighlight: true });
+ }
+ computeFocusBounds(opts) {
+ return computeMarkerFocusBounds3(this, opts);
+ }
+ hasItemStylers() {
+ return this.properties.styler != null || this.properties.marker.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+RadarSeries.className = "RadarSeries";
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeriesProperties.ts
+var import_ag_charts_community245 = require("ag-charts-community");
+var { Property: Property78 } = import_ag_charts_community245._ModuleSupport;
+var RadarAreaSeriesProperties = class extends RadarSeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.fill = "black";
+ this.fillOpacity = 1;
+ }
+};
+__decorateClass([
+ Property78
+], RadarAreaSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property78
+], RadarAreaSeriesProperties.prototype, "fillOpacity", 2);
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeries.ts
+var {
+ ChartAxisDirection: ChartAxisDirection30,
+ Group: Group18,
+ HighlightState: HighlightState4,
+ Path: Path13,
+ PointerEvents: PointerEvents10,
+ Selection: Selection15,
+ applyShapeStyle: applyShapeStyle15,
+ toHighlightString: toHighlightString5
+} = import_ag_charts_community246._ModuleSupport;
+var RadarAreaSeries = class extends RadarSeries {
+ constructor(moduleCtx) {
+ super(moduleCtx);
+ this.properties = new RadarAreaSeriesProperties();
+ this.areaGroup = this.contentGroup.appendChild(new Group18({ name: "radar-area" }));
+ this.areaSelection = Selection15.select(
+ this.areaGroup,
+ Path13
+ );
+ this.resetInvalidToZero = true;
+ this.areaGroup.zIndex = -1;
+ }
+ updatePathSelections() {
+ const pathData = this.visible ? [true] : [];
+ this.areaSelection.update(pathData);
+ super.updatePathSelections();
+ }
+ getAreaNode() {
+ return this.areaSelection.at(0);
+ }
+ getMarkerFill(highlightedStyle) {
+ if (highlightedStyle?.fill != null)
+ return highlightedStyle.fill;
+ const stylerStyle = this.getStyle(false);
+ return stylerStyle.marker.fill ?? stylerStyle.fill;
+ }
+ updatePathNodes() {
+ const styles = this.getPathNodesStyle();
+ const { fill, fillOpacity, strokeWidth, stroke: stroke2, strokeOpacity, lineDash, lineDashOffset, opacity } = styles;
+ const lineNode = this.getLineNode();
+ if (lineNode) {
+ lineNode.setProperties({
+ fill: void 0,
+ lineJoin: "round",
+ lineCap: "round",
+ pointerEvents: PointerEvents10.None,
+ opacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ }
+ const areaNode = this.getAreaNode();
+ if (areaNode) {
+ applyShapeStyle15(areaNode, { fill, fillOpacity, stroke: void 0 }, this.getShapeFillBBox());
+ areaNode.setProperties({
+ lineJoin: "round",
+ pointerEvents: PointerEvents10.None,
+ opacity
+ });
+ }
+ }
+ animatePaths(ratio3) {
+ super.animatePaths(ratio3);
+ const areaNode = this.getAreaNode();
+ if (areaNode) {
+ this.animateSinglePath(areaNode, this.getAreaPoints(), ratio3);
+ }
+ }
+ getAreaPoints() {
+ const points = this.getLinePoints();
+ const getPolarAxis = (direction) => {
+ const axis = this.axes[direction];
+ return axis instanceof import_ag_charts_community246._ModuleSupport.PolarAxis ? axis : void 0;
+ };
+ const radiusAxis = getPolarAxis(ChartAxisDirection30.Radius);
+ const angleAxis = getPolarAxis(ChartAxisDirection30.Angle);
+ const reversedRadiusAxis = radiusAxis?.isReversed();
+ if (!reversedRadiusAxis) {
+ return points;
+ }
+ const zeroLinePoints = angleAxis?.getAxisLinePoints()?.points ?? [];
+ return points.concat(...zeroLinePoints);
+ }
+ resetPaths() {
+ const superStyle = super.resetPaths();
+ const areaNode = this.getAreaNode();
+ if (areaNode) {
+ const { path: areaPath } = areaNode;
+ const areaPoints = this.getAreaPoints();
+ const stylerStyle = superStyle ?? this.getStyle(false);
+ const fillBBox = this.getShapeFillBBox();
+ applyShapeStyle15(
+ areaNode,
+ {
+ fill: stylerStyle.fill,
+ stroke: void 0,
+ fillOpacity: stylerStyle.fillOpacity,
+ lineDash: stylerStyle.lineDash,
+ lineDashOffset: stylerStyle.lineDashOffset
+ },
+ fillBBox
+ );
+ areaNode.lineJoin = areaNode.lineCap = "round";
+ areaPath.clear(true);
+ for (const { x, y, moveTo: moveTo2, arc, radius = 0, startAngle = 0, endAngle = 0 } of areaPoints) {
+ if (arc) {
+ areaPath.arc(x, y, radius, startAngle, endAngle);
+ } else if (moveTo2) {
+ areaPath.moveTo(x, y);
+ } else {
+ areaPath.lineTo(x, y);
+ }
+ }
+ areaPath.closePath();
+ areaNode.checkPathDirty();
+ return stylerStyle;
+ }
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { properties } = this;
+ const highlightState = toHighlightString5(highlightStateEnum ?? HighlightState4.None);
+ return {
+ marker: {
+ fill: properties.marker.fill,
+ fillOpacity: properties.marker.fillOpacity,
+ size: properties.marker.size,
+ shape: properties.marker.shape,
+ stroke: properties.marker.stroke,
+ strokeOpacity: properties.marker.strokeOpacity,
+ strokeWidth: properties.marker.strokeWidth,
+ lineDash: properties.marker.lineDash,
+ lineDashOffset: properties.marker.lineDashOffset
+ },
+ highlightState,
+ highlighted,
+ fill: properties.fill,
+ fillOpacity: properties.fillOpacity,
+ lineDash: properties.lineDash,
+ lineDashOffset: properties.lineDashOffset,
+ seriesId: this.id,
+ stroke: properties.stroke,
+ strokeOpacity: properties.strokeOpacity,
+ strokeWidth: properties.strokeWidth,
+ angleKey: properties.angleKey,
+ radiusKey: properties.radiusKey
+ };
+ }
+ getStyle(highlighted, highlightState) {
+ const { marker, fill, fillOpacity, lineDash, lineDashOffset, stroke: stroke2, strokeOpacity, strokeWidth } = this.properties;
+ const { size, shape, fill: markerFill = "transparent", fillOpacity: markerFillOpacity } = marker;
+ const stylerResult = this.getStylerResult({}, highlighted, highlightState);
+ stylerResult.marker ?? (stylerResult.marker = {});
+ return {
+ fill: stylerResult.fill ?? fill,
+ fillOpacity: stylerResult.fillOpacity ?? fillOpacity,
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.stroke ?? stroke2,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth,
+ marker: {
+ enabled: stylerResult.marker.enabled ?? marker.enabled,
+ fill: stylerResult.marker.fill ?? markerFill,
+ fillOpacity: stylerResult.marker.fillOpacity ?? markerFillOpacity,
+ shape: stylerResult.marker.shape ?? shape,
+ size: stylerResult.marker.size ?? size,
+ lineDash: stylerResult.marker.lineDash ?? marker.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.marker.lineDashOffset ?? marker.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.marker.stroke ?? marker.stroke ?? stroke2,
+ strokeOpacity: stylerResult.marker.strokeOpacity ?? marker.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.marker.strokeWidth ?? marker.strokeWidth ?? strokeWidth
+ }
+ };
+ }
+};
+RadarAreaSeries.className = "RadarAreaSeries";
+RadarAreaSeries.type = "radar-area";
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaSeriesOptionsDef.ts
+var import_ag_charts_community247 = require("ag-charts-community");
+var import_ag_charts_core106 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs17, radarAreaSeriesThemeableOptionsDef } = import_ag_charts_community247._ModuleSupport;
+var radarAreaSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs17,
+ ...radarAreaSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core106.required)((0, import_ag_charts_core106.constant)("radar-area")),
+ angleKey: (0, import_ag_charts_core106.required)(import_ag_charts_core106.string),
+ radiusKey: (0, import_ag_charts_core106.required)(import_ag_charts_core106.string),
+ angleName: import_ag_charts_core106.string,
+ radiusName: import_ag_charts_core106.string,
+ legendItemName: import_ag_charts_core106.string
+};
+
+// packages/ag-charts-enterprise/src/series/radar-area/radarAreaModule.ts
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE4 }
+} = import_ag_charts_community248._ModuleSupport;
+var RadarAreaModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radar-area",
+ moduleFactory: (ctx) => new RadarAreaSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE4.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE4.RADIUS_NUMBER }],
+ themeTemplate: RADAR_AREA_SERIES_THEME
+};
+var RadarAreaSeriesModule = {
+ type: "series",
+ name: "radar-area",
+ chartType: "polar",
+ enterprise: true,
+ options: radarAreaSeriesOptionsDef,
+ create: (ctx) => new RadarAreaSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineModule.ts
+var import_ag_charts_community251 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineSeries.ts
+var import_ag_charts_community249 = require("ag-charts-community");
+var { HighlightState: HighlightState5, PointerEvents: PointerEvents11, toHighlightString: toHighlightString6 } = import_ag_charts_community249._ModuleSupport;
+var RadarLineSeries = class extends RadarSeries {
+ constructor() {
+ super(...arguments);
+ this.properties = new RadarSeriesProperties();
+ }
+ updatePathSelections() {
+ this.lineSelection.update(this.visible ? [true] : []);
+ }
+ updatePathNodes() {
+ const lineNode = this.getLineNode();
+ if (!lineNode)
+ return;
+ const style = this.getPathNodesStyle();
+ const { strokeWidth, stroke: stroke2, strokeOpacity, lineDash, lineDashOffset, opacity } = style;
+ lineNode.setProperties({
+ fill: void 0,
+ lineJoin: "round",
+ lineCap: "round",
+ pointerEvents: PointerEvents11.None,
+ opacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ });
+ }
+ makeStylerParams(highlighted, highlightStateEnum) {
+ const { properties } = this;
+ const highlightState = toHighlightString6(highlightStateEnum ?? HighlightState5.None);
+ return {
+ marker: {
+ fill: properties.marker.fill,
+ fillOpacity: properties.marker.fillOpacity,
+ size: properties.marker.size,
+ shape: properties.marker.shape,
+ stroke: properties.marker.stroke,
+ strokeOpacity: properties.marker.strokeOpacity,
+ strokeWidth: properties.marker.strokeWidth,
+ lineDash: properties.marker.lineDash,
+ lineDashOffset: properties.marker.lineDashOffset
+ },
+ highlightState,
+ highlighted,
+ lineDash: properties.lineDash,
+ lineDashOffset: properties.lineDashOffset,
+ seriesId: this.id,
+ stroke: properties.stroke,
+ strokeOpacity: properties.strokeOpacity,
+ strokeWidth: properties.strokeWidth,
+ angleKey: properties.angleKey,
+ radiusKey: properties.radiusKey
+ };
+ }
+ getStyle(highlighted, highlightState) {
+ const { marker, lineDash, lineDashOffset, stroke: stroke2, strokeOpacity, strokeWidth } = this.properties;
+ const { size, shape, fill = "transparent", fillOpacity } = marker;
+ const stylerResult = this.getStylerResult({}, highlighted, highlightState);
+ stylerResult.marker ?? (stylerResult.marker = {});
+ return {
+ lineDash: stylerResult.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.stroke ?? stroke2,
+ strokeOpacity: stylerResult.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.strokeWidth ?? strokeWidth,
+ marker: {
+ enabled: stylerResult.marker.enabled ?? marker.enabled,
+ fill: stylerResult.marker.fill ?? fill,
+ fillOpacity: stylerResult.marker.fillOpacity ?? fillOpacity,
+ shape: stylerResult.marker.shape ?? shape,
+ size: stylerResult.marker.size ?? size,
+ lineDash: stylerResult.marker.lineDash ?? marker.lineDash ?? lineDash,
+ lineDashOffset: stylerResult.marker.lineDashOffset ?? marker.lineDashOffset ?? lineDashOffset,
+ stroke: stylerResult.marker.stroke ?? marker.stroke ?? stroke2,
+ strokeOpacity: stylerResult.marker.strokeOpacity ?? marker.strokeOpacity ?? strokeOpacity,
+ strokeWidth: stylerResult.marker.strokeWidth ?? marker.strokeWidth ?? strokeWidth
+ }
+ };
+ }
+};
+RadarLineSeries.className = "RadarLineSeries";
+RadarLineSeries.type = "radar-line";
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineSeriesOptionsDef.ts
+var import_ag_charts_community250 = require("ag-charts-community");
+var import_ag_charts_core107 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs18, radarLineSeriesThemeableOptionsDef } = import_ag_charts_community250._ModuleSupport;
+var radarLineSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs18,
+ ...radarLineSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core107.required)((0, import_ag_charts_core107.constant)("radar-line")),
+ angleKey: (0, import_ag_charts_core107.required)(import_ag_charts_core107.string),
+ radiusKey: (0, import_ag_charts_core107.required)(import_ag_charts_core107.string),
+ angleName: import_ag_charts_core107.string,
+ radiusName: import_ag_charts_core107.string,
+ legendItemName: import_ag_charts_core107.string
+};
+
+// packages/ag-charts-enterprise/src/series/radar-line/radarLineModule.ts
+var { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE5 } = import_ag_charts_community251._ModuleSupport.ThemeConstants;
+var RadarLineModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radar-line",
+ moduleFactory: (ctx) => new RadarLineSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE5.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE5.RADIUS_NUMBER }],
+ themeTemplate: RADAR_LINE_SERIES_THEME
+};
+var RadarLineSeriesModule = {
+ type: "series",
+ name: "radar-line",
+ chartType: "polar",
+ enterprise: true,
+ options: radarLineSeriesOptionsDef,
+ create: (ctx) => new RadarLineSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarModule.ts
+var import_ag_charts_community257 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeries.ts
+var import_ag_charts_community254 = require("ag-charts-community");
+var import_ag_charts_core108 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeriesProperties.ts
+var import_ag_charts_community252 = require("ag-charts-community");
+var { SeriesProperties: SeriesProperties11, makeSeriesTooltip: makeSeriesTooltip20, Property: Property79, Label: Label15 } = import_ag_charts_community252._ModuleSupport;
+var RadialBarSeriesProperties = class extends SeriesProperties11 {
+ constructor() {
+ super(...arguments);
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.cornerRadius = 0;
+ this.rotation = 0;
+ this.label = new Label15();
+ this.tooltip = makeSeriesTooltip20();
+ }
+ getStyle() {
+ const { fill, fillOpacity, stroke: stroke2, strokeWidth, strokeOpacity, lineDash, lineDashOffset, cornerRadius } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ cornerRadius,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "angleKey", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "radiusKey", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "angleName", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "radiusName", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "legendItemName", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "fill", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "styler", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "stackGroup", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "normalizedTo", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property79
+], RadialBarSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarUtil.ts
+var import_ag_charts_community253 = require("ag-charts-community");
+var { SectorBox: SectorBox3, motion: motion9 } = import_ag_charts_community253._ModuleSupport;
+function fixRadialBarAnimationStatus(node, datum, status) {
+ if (status === "updated") {
+ if (node.previousDatum == null || Number.isNaN(node.previousDatum.innerRadius) || Number.isNaN(node.previousDatum.outerRadius)) {
+ return "added";
+ }
+ if (Number.isNaN(datum.innerRadius) || Number.isNaN(datum.outerRadius)) {
+ return "removed";
+ }
+ }
+ if (status === "added" && node.previousDatum != null) {
+ return "updated";
+ }
+ return status;
+}
+function prepareRadialBarSeriesAnimationFunctions(axisZeroAngle) {
+ const fromFn = (sect, datum, status) => {
+ status = fixRadialBarAnimationStatus(sect, datum, status);
+ let startAngle;
+ let endAngle;
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed" || status === "updated") {
+ startAngle = sect.startAngle;
+ endAngle = sect.endAngle;
+ innerRadius = sect.innerRadius;
+ outerRadius = sect.outerRadius;
+ clipSector = sect.clipSector;
+ } else {
+ startAngle = axisZeroAngle;
+ endAngle = axisZeroAngle;
+ innerRadius = datum.innerRadius;
+ outerRadius = datum.outerRadius;
+ }
+ clipSector ?? (clipSector = new SectorBox3(startAngle, endAngle, innerRadius, outerRadius));
+ const phase = motion9.NODE_UPDATE_STATE_TO_PHASE_MAPPING[status];
+ return { startAngle, endAngle, innerRadius, outerRadius, clipSector, phase };
+ };
+ const toFn = (sect, datum, status) => {
+ let startAngle;
+ let endAngle;
+ let innerRadius;
+ let outerRadius;
+ let clipSector;
+ if (status === "removed") {
+ startAngle = axisZeroAngle;
+ endAngle = axisZeroAngle;
+ innerRadius = datum.innerRadius;
+ outerRadius = datum.outerRadius;
+ clipSector = new SectorBox3(startAngle, endAngle, innerRadius, outerRadius);
+ } else {
+ startAngle = datum.startAngle;
+ endAngle = datum.endAngle;
+ innerRadius = Number.isNaN(datum.innerRadius) ? sect.innerRadius : datum.innerRadius;
+ outerRadius = Number.isNaN(datum.outerRadius) ? sect.outerRadius : datum.outerRadius;
+ clipSector = datum.clipSector;
+ }
+ return { startAngle, endAngle, innerRadius, outerRadius, clipSector };
+ };
+ return { toFn, fromFn };
+}
+function resetRadialBarSelectionsFn(_node, datum) {
+ return {
+ centerX: 0,
+ centerY: 0,
+ innerRadius: datum.innerRadius,
+ outerRadius: datum.outerRadius,
+ startAngle: datum.startAngle,
+ endAngle: datum.endAngle,
+ clipSector: datum.clipSector
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeries.ts
+var {
+ DEFAULT_POLAR_DIRECTION_KEYS: DEFAULT_POLAR_DIRECTION_KEYS3,
+ DEFAULT_POLAR_DIRECTION_NAMES: DEFAULT_POLAR_DIRECTION_NAMES3,
+ ChartAxisDirection: ChartAxisDirection31,
+ PolarAxis: PolarAxis3,
+ diff: diff7,
+ groupAccumulativeValueProperty: groupAccumulativeValueProperty3,
+ keyProperty: keyProperty10,
+ normaliseGroupTo: normaliseGroupTo2,
+ valueProperty: valueProperty18,
+ fixNumericExtent: fixNumericExtent10,
+ resetLabelFn: resetLabelFn6,
+ seriesLabelFadeInAnimation: seriesLabelFadeInAnimation8,
+ seriesLabelFadeOutAnimation: seriesLabelFadeOutAnimation2,
+ animationValidation: animationValidation9,
+ angleBetween: angleBetween3,
+ createDatumId: createDatumId18,
+ CategoryScale: CategoryScale4,
+ Sector: Sector5,
+ SectorBox: SectorBox4,
+ motion: motion10,
+ isGradientFill: isGradientFill3,
+ applyShapeStyle: applyShapeStyle16,
+ updateLabelNode: updateLabelNode8,
+ getItemStyles: getItemStyles4
+} = import_ag_charts_community254._ModuleSupport;
+var RadialBarSeriesNodeEvent = class extends import_ag_charts_community254._ModuleSupport.SeriesNodeEvent {
+ constructor(type, nativeEvent, datum, series) {
+ super(type, nativeEvent, datum, series);
+ this.angleKey = series.properties.angleKey;
+ this.radiusKey = series.properties.radiusKey;
+ }
+};
+var RadialBarSeries = class extends import_ag_charts_community254._ModuleSupport.PolarSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ categoryKey: "radiusValue",
+ propertyKeys: DEFAULT_POLAR_DIRECTION_KEYS3,
+ propertyNames: DEFAULT_POLAR_DIRECTION_NAMES3,
+ canHaveAxes: true,
+ animationResetFns: {
+ item: resetRadialBarSelectionsFn,
+ label: resetLabelFn6
+ }
+ });
+ this.properties = new RadialBarSeriesProperties();
+ this.NodeEvent = RadialBarSeriesNodeEvent;
+ this.groupScale = new CategoryScale4();
+ this.circleCache = { r: 0, cx: 0, cy: 0 };
+ }
+ get hasData() {
+ return this.getHasData("angleValue-raw");
+ }
+ nodeFactory() {
+ return new Sector5();
+ }
+ getSeriesDomain(direction) {
+ const { dataModel, processedData } = this;
+ if (!processedData || !dataModel)
+ return [];
+ if (direction === ChartAxisDirection31.Angle) {
+ const xExtent = dataModel.getDomain(this, "angleValue-end", "value", processedData);
+ const fixedXExtent = [Math.min(xExtent[0], 0), Math.max(xExtent[1], 0)];
+ return fixNumericExtent10(fixedXExtent);
+ } else {
+ return dataModel.getDomain(this, "radiusValue", "key", processedData);
+ }
+ }
+ async processData(dataController) {
+ const { angleKey, radiusKey, normalizedTo } = this.properties;
+ const animationEnabled = !this.ctx.animationManager.isSkipped();
+ const stackGroupId = this.getStackId();
+ const stackGroupTrailingId = `${stackGroupId}-trailing`;
+ const extraProps = [];
+ if ((0, import_ag_charts_core108.isDefined)(normalizedTo)) {
+ extraProps.push(normaliseGroupTo2([stackGroupId, stackGroupTrailingId], Math.abs(normalizedTo)));
+ }
+ if (animationEnabled) {
+ if (this.processedData) {
+ extraProps.push(diff7(this.id, this.processedData));
+ }
+ extraProps.push(animationValidation9());
+ }
+ const visibleProps = this.visible ? {} : { forceValue: 0 };
+ const radiusScaleType = this.axes[ChartAxisDirection31.Radius]?.scale.type;
+ const angleScaleType = this.axes[ChartAxisDirection31.Angle]?.scale.type;
+ await this.requestDataModel(dataController, this.data, {
+ props: [
+ keyProperty10(radiusKey, radiusScaleType, { id: "radiusValue" }),
+ valueProperty18(angleKey, angleScaleType, {
+ id: "angleValue-raw",
+ invalidValue: null,
+ ...visibleProps
+ }),
+ ...groupAccumulativeValueProperty3(
+ angleKey,
+ "normal",
+ {
+ id: `angleValue-end`,
+ rangeId: `angleValue-range`,
+ invalidValue: null,
+ groupId: stackGroupId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ angleScaleType
+ ),
+ ...groupAccumulativeValueProperty3(
+ angleKey,
+ "trailing",
+ {
+ id: `angleValue-start`,
+ invalidValue: null,
+ groupId: stackGroupTrailingId,
+ separateNegative: true,
+ ...visibleProps
+ },
+ angleScaleType
+ ),
+ ...extraProps
+ ],
+ groupByKeys: true,
+ groupByData: false
+ });
+ this.animationState.transition("updateData");
+ }
+ didCircleChange() {
+ const r = this.radius;
+ const cx = this.centerX;
+ const cy = this.centerY;
+ const cache = this.circleCache;
+ if (!(r === cache.r && cx === cache.cx && cy === cache.cy)) {
+ this.circleCache = { r, cx, cy };
+ return true;
+ }
+ return false;
+ }
+ maybeRefreshNodeData() {
+ const circleChanged = this.didCircleChange();
+ if (!circleChanged && !this.nodeDataRefresh)
+ return;
+ this.contextNodeData = this.createNodeData();
+ this.nodeData = this.contextNodeData?.nodeData ?? [];
+ this.nodeDataRefresh = false;
+ }
+ getAxisInnerRadius() {
+ const radiusAxis = this.axes[ChartAxisDirection31.Radius];
+ return radiusAxis instanceof PolarAxis3 ? this.radius * radiusAxis.innerRadiusRatio : 0;
+ }
+ createNodeData() {
+ const { processedData, dataModel } = this;
+ if (!dataModel || !processedData || processedData.type !== "grouped")
+ return;
+ const angleAxis = this.axes[ChartAxisDirection31.Angle];
+ const radiusAxis = this.axes[ChartAxisDirection31.Radius];
+ const angleScale = angleAxis?.scale;
+ const radiusScale = radiusAxis?.scale;
+ if (!angleScale || !radiusScale) {
+ return;
+ }
+ const radiusValues = dataModel.resolveKeysById(this, "radiusValue", processedData);
+ const angleStartValues = dataModel.resolveColumnById(this, `angleValue-start`, processedData);
+ const angleEndValues = dataModel.resolveColumnById(this, `angleValue-end`, processedData);
+ const angleRawValues = dataModel.resolveColumnById(this, `angleValue-raw`, processedData);
+ const angleRangeIndex = dataModel.resolveProcessedDataIndexById(this, `angleValue-range`);
+ let groupPaddingInner = 0;
+ if (radiusAxis instanceof RadiusCategoryAxis) {
+ groupPaddingInner = radiusAxis.groupPaddingInner;
+ }
+ const { groupScale } = this;
+ const { index: groupIndex, visibleGroupCount } = this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);
+ groupScale.domain = Array.from({ length: visibleGroupCount }).map((_, i) => String(i));
+ groupScale.range = [0, Math.abs(radiusScale.bandwidth ?? 0)];
+ groupScale.paddingInner = visibleGroupCount > 1 ? groupPaddingInner : 0;
+ const barWidth = groupScale.bandwidth >= 1 ? groupScale.bandwidth : groupScale.rawBandwidth;
+ const angleAxisReversed = angleAxis.isReversed();
+ const radiusAxisReversed = radiusAxis.isReversed();
+ const axisInnerRadius = radiusAxisReversed ? this.radius : this.getAxisInnerRadius();
+ const axisOuterRadius = radiusAxisReversed ? this.getAxisInnerRadius() : this.radius;
+ const axisTotalRadius = axisOuterRadius + axisInnerRadius;
+ const angleDomain = this.getSeriesDomain(ChartAxisDirection31.Angle);
+ const { angleKey, radiusKey, angleName, radiusName, legendItemName, label } = this.properties;
+ const getLabelNodeDatum = (datum, angleDatum, x, y) => {
+ const labelText = this.getLabelText(
+ angleDatum,
+ datum,
+ angleKey,
+ "angle",
+ angleDomain,
+ label,
+ { value: angleDatum, datum, angleKey, radiusKey, angleName, radiusName, legendItemName }
+ );
+ if (labelText) {
+ return { x, y, text: labelText, textAlign: "center", textBaseline: "middle" };
+ }
+ };
+ const nodeData = [];
+ const styles = getItemStyles4(
+ (nodeDatum, isHighlight, highlightState) => getItemStyle(this, nodeDatum, isHighlight, highlightState)
+ );
+ const context = {
+ itemId: radiusKey,
+ nodeData,
+ labelData: nodeData,
+ styles
+ };
+ if (!this.visible)
+ return context;
+ const { dataSources } = processedData;
+ const rawData = dataSources.get(this.id)?.data ?? [];
+ for (const { datumIndex, group } of dataModel.forEachGroupDatum(this, processedData)) {
+ const datum = rawData[datumIndex];
+ const radiusDatum = radiusValues[datumIndex];
+ if (radiusDatum == null)
+ return;
+ const angleDatum = angleRawValues[datumIndex];
+ const angleStartDatum = angleStartValues[datumIndex];
+ const angleEndDatum = angleEndValues[datumIndex];
+ const isPositive = angleDatum >= 0 && !Object.is(angleDatum, -0);
+ const angleRange = group.aggregation[angleRangeIndex][isPositive ? 1 : 0];
+ const reversed = isPositive === angleAxisReversed;
+ let startAngle = angleScale.convert(angleStartDatum, { clamp: true });
+ let endAngle = angleScale.convert(angleEndDatum, { clamp: true });
+ let rangeStartAngle = angleScale.convert(0, { clamp: true });
+ let rangeEndAngle = angleScale.convert(angleRange, { clamp: true });
+ if (reversed) {
+ [rangeStartAngle, rangeEndAngle] = [rangeEndAngle, rangeStartAngle];
+ [startAngle, endAngle] = [endAngle, startAngle];
+ }
+ const dataRadius = axisTotalRadius - radiusScale.convert(radiusDatum);
+ const innerRadius = dataRadius + groupScale.convert(String(groupIndex));
+ const outerRadius = innerRadius + barWidth;
+ const midRadius = (innerRadius + outerRadius) / 2;
+ const midAngle = startAngle + angleBetween3(startAngle, endAngle) / 2;
+ const x = Math.cos(midAngle) * midRadius;
+ const y = Math.sin(midAngle) * midRadius;
+ const labelNodeDatum = this.properties.label.enabled ? getLabelNodeDatum(datum, angleDatum, x, y) : void 0;
+ const clipSector = new SectorBox4(startAngle, endAngle, innerRadius, outerRadius);
+ nodeData.push({
+ series: this,
+ datum,
+ datumIndex,
+ point: { x, y, size: 0 },
+ midPoint: { x, y },
+ label: labelNodeDatum,
+ angleValue: angleDatum,
+ radiusValue: radiusDatum,
+ innerRadius,
+ outerRadius,
+ startAngle: rangeStartAngle,
+ endAngle: rangeEndAngle,
+ clipSector,
+ reversed,
+ index: datumIndex
+ });
+ }
+ return context;
+ }
+ update({ seriesRect }) {
+ const resize = this.checkResize(seriesRect);
+ this.maybeRefreshNodeData();
+ this.contentGroup.translationX = this.centerX;
+ this.contentGroup.translationY = this.centerY;
+ this.highlightGroup.translationX = this.centerX;
+ this.highlightGroup.translationY = this.centerY;
+ if (this.labelGroup) {
+ this.labelGroup.translationX = this.centerX;
+ this.labelGroup.translationY = this.centerY;
+ }
+ this.updateSectorSelection(this.itemSelection, false);
+ this.updateSectorSelection(this.highlightSelection, true);
+ this.updateLabels();
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateSectorSelection(selection, isHighlight) {
+ let selectionData = [];
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ if (isHighlight) {
+ if (activeHighlight?.datum && activeHighlight.series === this) {
+ selectionData.push(activeHighlight);
+ }
+ } else {
+ selectionData = this.nodeData;
+ }
+ const { contextNodeData } = this;
+ if (!contextNodeData) {
+ return;
+ }
+ const highlightedDatum = this.ctx.highlightManager.getActiveHighlight();
+ const fillBBox = this.getShapeFillBBox();
+ const hasItemStylers = this.hasItemStylers();
+ selection.update(selectionData, void 0, (datum) => this.getDatumId(datum)).each((node, nodeDatum) => {
+ const datum = readDatum(nodeDatum);
+ if (datum == null)
+ return;
+ if (hasItemStylers) {
+ const highlightState = this.getHighlightState(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ nodeDatum.style = getItemStyle(this, nodeDatum, isHighlight, highlightState);
+ }
+ const style = nodeDatum.style ?? contextNodeData.styles[this.getHighlightState(highlightedDatum, isHighlight, nodeDatum.datumIndex)];
+ const cornerRadius = style.cornerRadius;
+ const fill = style.fill;
+ const fillParams = import_ag_charts_community254._ModuleSupport.isGradientFill(fill) && fill.bounds !== "item" ? { centerX: 0, centerY: 0 } : void 0;
+ applyShapeStyle16(node, style, fillBBox, fillParams);
+ node.lineJoin = "round";
+ node.inset = node.stroke == null ? 0 : node.strokeWidth / 2;
+ node.startInnerCornerRadius = datum.reversed ? cornerRadius : 0;
+ node.startOuterCornerRadius = datum.reversed ? cornerRadius : 0;
+ node.endInnerCornerRadius = datum.reversed ? 0 : cornerRadius;
+ node.endOuterCornerRadius = datum.reversed ? 0 : cornerRadius;
+ if (isHighlight) {
+ node.startAngle = nodeDatum.startAngle;
+ node.endAngle = nodeDatum.endAngle;
+ node.clipSector = nodeDatum.clipSector;
+ node.innerRadius = nodeDatum.innerRadius;
+ node.outerRadius = nodeDatum.outerRadius;
+ }
+ });
+ }
+ updateLabels() {
+ const { properties } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ this.labelSelection.update(this.nodeData).each((node, datum) => {
+ const isHighlight = false;
+ updateLabelNode8(this, node, properties, properties.label, datum.label, isHighlight, activeHighlight);
+ node.fillOpacity = this.getHighlightStyle(isHighlight, datum.datumIndex).opacity ?? 1;
+ });
+ }
+ getBarTransitionFunctions() {
+ const angleScale = this.axes[ChartAxisDirection31.Angle]?.scale;
+ let axisZeroAngle = 0;
+ if (!angleScale) {
+ return prepareRadialBarSeriesAnimationFunctions(axisZeroAngle);
+ }
+ const d0 = Math.min(angleScale.domain[0], angleScale.domain[1]);
+ const d1 = Math.max(angleScale.domain[0], angleScale.domain[1]);
+ if (d0 <= 0 && d1 >= 0) {
+ axisZeroAngle = angleScale.convert(0);
+ }
+ return prepareRadialBarSeriesAnimationFunctions(axisZeroAngle);
+ }
+ animateEmptyUpdateReady() {
+ const { labelSelection } = this;
+ const fns = this.getBarTransitionFunctions();
+ motion10.fromToMotion(this.id, "datums", this.ctx.animationManager, [this.itemSelection], fns);
+ seriesLabelFadeInAnimation8(this, "labels", this.ctx.animationManager, labelSelection);
+ }
+ animateClearingUpdateEmpty() {
+ const { itemSelection } = this;
+ const { animationManager } = this.ctx;
+ const fns = this.getBarTransitionFunctions();
+ motion10.fromToMotion(this.id, "datums", animationManager, [itemSelection], fns);
+ seriesLabelFadeOutAnimation2(this, "labels", animationManager, this.labelSelection);
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, dataModel, processedData, axes, properties } = this;
+ const { angleKey, angleName, radiusKey, radiusName, legendItemName, tooltip } = properties;
+ const angleAxis = axes[ChartAxisDirection31.Angle];
+ const radiusAxis = axes[ChartAxisDirection31.Radius];
+ const nodeDatum = this.nodeData?.[datumIndex];
+ if (!dataModel || !processedData || !angleAxis || !radiusAxis || !nodeDatum)
+ return;
+ const datum = processedData.dataSources.get(this.id)?.data[datumIndex];
+ const radiusValue = dataModel.resolveKeysById(this, `radiusValue`, processedData)[datumIndex];
+ const angleValue = dataModel.resolveColumnById(this, `angleValue-raw`, processedData)[datumIndex];
+ if (radiusValue == null)
+ return;
+ const format = getItemStyle(this, nodeDatum, false);
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ heading: this.getAxisValueText(radiusAxis, "tooltip", radiusValue, datum, radiusKey, void 0),
+ symbol: this.legendItemSymbol(),
+ data: [
+ {
+ label: angleName,
+ fallbackLabel: angleKey,
+ value: this.getAxisValueText(angleAxis, "tooltip", angleValue, datum, angleKey, void 0)
+ }
+ ]
+ },
+ {
+ seriesId,
+ datum,
+ title: angleName,
+ angleKey,
+ angleName,
+ radiusKey,
+ radiusName,
+ legendItemName,
+ ...format
+ }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return this.pickNodeNearestDistantObject(point, this.itemSelection.nodes());
+ }
+ legendItemSymbol() {
+ const { fill, stroke: stroke2, fillOpacity, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = getStyle(
+ this,
+ false,
+ false,
+ import_ag_charts_community254._ModuleSupport.HighlightState.None
+ );
+ const markerStyle = {
+ fill: fill ?? "rgba(0, 0, 0, 0)",
+ stroke: stroke2 ?? "rgba(0, 0, 0, 0)",
+ fillOpacity,
+ strokeOpacity,
+ strokeWidth,
+ lineDash,
+ lineDashOffset
+ };
+ if (isGradientFill3(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ return {
+ marker: markerStyle
+ };
+ }
+ getLegendData(legendType) {
+ if (legendType !== "category") {
+ return [];
+ }
+ const { id: seriesId, visible } = this;
+ const { angleKey, angleName, legendItemName, showInLegend } = this.properties;
+ return [
+ {
+ legendType: "category",
+ id: seriesId,
+ itemId: angleKey,
+ seriesId,
+ enabled: visible,
+ label: {
+ text: legendItemName ?? angleName ?? angleKey
+ },
+ symbol: this.legendItemSymbol(),
+ legendItemName,
+ hideInLegend: !showInLegend
+ }
+ ];
+ }
+ getDatumId(datum) {
+ return createDatumId18(datum.radiusValue);
+ }
+ computeLabelsBBox() {
+ return null;
+ }
+ getStackId() {
+ const groupIndex = this.seriesGrouping?.groupIndex ?? this.id;
+ return `radialBar-stack-${groupIndex}-xValues`;
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null || this.properties.label.itemStyler != null;
+ }
+};
+RadialBarSeries.className = "RadialBarSeries";
+RadialBarSeries.type = "radial-bar";
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarSeriesOptionsDef.ts
+var import_ag_charts_community255 = require("ag-charts-community");
+var import_ag_charts_core109 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs19, radialBarSeriesThemeableOptionsDef } = import_ag_charts_community255._ModuleSupport;
+var radialBarSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs19,
+ ...radialBarSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core109.required)((0, import_ag_charts_core109.constant)("radial-bar")),
+ angleKey: (0, import_ag_charts_core109.required)(import_ag_charts_core109.string),
+ radiusKey: (0, import_ag_charts_core109.required)(import_ag_charts_core109.string),
+ angleName: import_ag_charts_core109.string,
+ radiusName: import_ag_charts_core109.string,
+ legendItemName: import_ag_charts_core109.string,
+ grouped: import_ag_charts_core109.boolean,
+ stacked: import_ag_charts_core109.boolean,
+ stackGroup: import_ag_charts_core109.string,
+ normalizedTo: import_ag_charts_core109.number
+};
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarThemes.ts
+var import_ag_charts_community256 = require("ag-charts-community");
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE6 },
+ FILL_GRADIENT_CONIC_SERIES_DEFAULTS,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS5,
+ FILL_PATTERN_DEFAULTS: FILL_PATTERN_DEFAULTS3
+} = import_ag_charts_community256._ModuleSupport;
+var RADIAL_BAR_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", FILL_GRADIENT_CONIC_SERIES_DEFAULTS],
+ ["image", FILL_IMAGE_DEFAULTS5],
+ ["pattern", FILL_PATTERN_DEFAULTS3]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ strokeWidth: { $isUserOption: ["./stroke", 1, 0] },
+ label: {
+ ...import_ag_charts_community256._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" }
+ },
+ highlight: import_ag_charts_community256._ModuleSupport.multiSeriesHighlightStyle()
+ },
+ axes: {
+ [POLAR_AXIS_TYPE6.RADIUS_CATEGORY]: {
+ innerRadiusRatio: 0.2,
+ groupPaddingInner: 0.2,
+ paddingInner: 0.2,
+ paddingOuter: 0.1
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/radial-bar/radialBarModule.ts
+var { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE7 } = import_ag_charts_community257._ModuleSupport.ThemeConstants;
+var RadialBarModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radial-bar",
+ moduleFactory: (ctx) => new RadialBarSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE7.ANGLE_NUMBER }, { type: POLAR_AXIS_TYPE7.RADIUS_CATEGORY }],
+ themeTemplate: RADIAL_BAR_SERIES_THEME,
+ stackable: true,
+ groupable: true
+};
+var RadialBarSeriesModule = {
+ type: "series",
+ name: "radial-bar",
+ chartType: "polar",
+ enterprise: true,
+ options: radialBarSeriesOptionsDef,
+ create: (ctx) => new RadialBarSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnModule.ts
+var import_ag_charts_community262 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeries.ts
+var import_ag_charts_community259 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesProperties.ts
+var import_ag_charts_community258 = require("ag-charts-community");
+var { Property: Property80 } = import_ag_charts_community258._ModuleSupport;
+var RadialColumnSeriesProperties = class extends RadialColumnSeriesBaseProperties {
+};
+__decorateClass([
+ Property80
+], RadialColumnSeriesProperties.prototype, "columnWidthRatio", 2);
+__decorateClass([
+ Property80
+], RadialColumnSeriesProperties.prototype, "maxColumnWidthRatio", 2);
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeries.ts
+var { ChartAxisDirection: ChartAxisDirection32, PolarAxis: PolarAxis4, RadialColumnShape, getRadialColumnWidth } = import_ag_charts_community259._ModuleSupport;
+var RadialColumnSeries = class extends RadialColumnSeriesBase {
+ constructor(moduleCtx) {
+ super(moduleCtx, {
+ animationResetFns: {
+ item: resetRadialColumnSelectionFn
+ }
+ });
+ this.properties = new RadialColumnSeriesProperties();
+ }
+ getStackId() {
+ const groupIndex = this.seriesGrouping?.groupIndex ?? this.id;
+ return `radarColumn-stack-${groupIndex}-yValues`;
+ }
+ nodeFactory() {
+ return new RadialColumnShape();
+ }
+ getColumnTransitionFunctions() {
+ const axisZeroRadius = this.isRadiusAxisReversed() ? this.radius : this.getAxisInnerRadius();
+ return prepareRadialColumnAnimationFunctions(axisZeroRadius);
+ }
+ isRadiusAxisCircle() {
+ const radiusAxis = this.axes[ChartAxisDirection32.Radius];
+ return radiusAxis instanceof PolarAxis4 ? radiusAxis.shape === "circle" : false;
+ }
+ updateItemPath(node, datum, highlight) {
+ node.isBeveled = this.isRadiusAxisCircle();
+ node.isRadiusAxisReversed = this.isRadiusAxisReversed();
+ if (highlight) {
+ node.innerRadius = datum.innerRadius;
+ node.outerRadius = datum.outerRadius;
+ node.startAngle = datum.startAngle;
+ node.endAngle = datum.endAngle;
+ node.columnWidth = datum.columnWidth;
+ node.axisInnerRadius = datum.axisInnerRadius;
+ node.axisOuterRadius = datum.axisOuterRadius;
+ }
+ }
+ getColumnWidth(startAngle, endAngle) {
+ const { columnWidthRatio = 0.5, maxColumnWidthRatio = 0.5 } = this.properties;
+ return getRadialColumnWidth(startAngle, endAngle, this.radius, columnWidthRatio, maxColumnWidthRatio);
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.styler != null || this.properties.label.itemStyler != null;
+ }
+};
+RadialColumnSeries.className = "RadialColumnSeries";
+RadialColumnSeries.type = "radial-column";
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnSeriesOptionsDef.ts
+var import_ag_charts_community260 = require("ag-charts-community");
+var import_ag_charts_core110 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs20, radialColumnSeriesThemeableOptionsDef } = import_ag_charts_community260._ModuleSupport;
+var radialColumnSeriesOptionsDef = {
+ ...commonSeriesOptionsDefs20,
+ ...radialColumnSeriesThemeableOptionsDef,
+ type: (0, import_ag_charts_core110.required)((0, import_ag_charts_core110.constant)("radial-column")),
+ angleKey: (0, import_ag_charts_core110.required)(import_ag_charts_core110.string),
+ radiusKey: (0, import_ag_charts_core110.required)(import_ag_charts_core110.string),
+ angleName: import_ag_charts_core110.string,
+ radiusName: import_ag_charts_core110.string,
+ legendItemName: import_ag_charts_core110.string,
+ grouped: import_ag_charts_core110.boolean,
+ stacked: import_ag_charts_core110.boolean,
+ stackGroup: import_ag_charts_core110.string,
+ normalizedTo: import_ag_charts_core110.number
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnThemes.ts
+var import_ag_charts_community261 = require("ag-charts-community");
+var {
+ ThemeConstants: { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE8, POLAR_AXIS_SHAPE: POLAR_AXIS_SHAPE2 },
+ FILL_GRADIENT_RADIAL_SERIES_DEFAULTS: FILL_GRADIENT_RADIAL_SERIES_DEFAULTS2,
+ FILL_IMAGE_DEFAULTS: FILL_IMAGE_DEFAULTS6,
+ FILL_PATTERN_DEFAULTS: FILL_PATTERN_DEFAULTS4
+} = import_ag_charts_community261._ModuleSupport;
+var RADIAL_COLUMN_SERIES_THEME = {
+ series: {
+ fill: {
+ $applySwitch: [
+ { $path: "type" },
+ { $palette: "fill" },
+ ["gradient", FILL_GRADIENT_RADIAL_SERIES_DEFAULTS2],
+ ["image", FILL_IMAGE_DEFAULTS6],
+ ["pattern", FILL_PATTERN_DEFAULTS4]
+ ]
+ },
+ stroke: { $palette: "stroke" },
+ columnWidthRatio: 0.5,
+ maxColumnWidthRatio: 0.5,
+ strokeWidth: { $isUserOption: ["./stroke", 1, 0] },
+ label: {
+ ...import_ag_charts_community261._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: false,
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" }
+ },
+ highlight: import_ag_charts_community261._ModuleSupport.multiSeriesHighlightStyle()
+ },
+ axes: {
+ [POLAR_AXIS_TYPE8.ANGLE_CATEGORY]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE2.CIRCLE },
+ groupPaddingInner: 0,
+ paddingInner: 0,
+ label: {
+ spacing: 10
+ }
+ },
+ [POLAR_AXIS_TYPE8.RADIUS_NUMBER]: {
+ shape: { $findFirstSiblingNotOperation: POLAR_AXIS_SHAPE2.CIRCLE },
+ innerRadiusRatio: 0.5
+ }
+ }
+};
+
+// packages/ag-charts-enterprise/src/series/radial-column/radialColumnModule.ts
+var { POLAR_AXIS_TYPE: POLAR_AXIS_TYPE9 } = import_ag_charts_community262._ModuleSupport.ThemeConstants;
+var RadialColumnModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["polar"],
+ identifier: "radial-column",
+ moduleFactory: (ctx) => new RadialColumnSeries(ctx),
+ defaultAxes: [{ type: POLAR_AXIS_TYPE9.ANGLE_CATEGORY }, { type: POLAR_AXIS_TYPE9.RADIUS_NUMBER }],
+ themeTemplate: RADIAL_COLUMN_SERIES_THEME,
+ stackable: true,
+ groupable: true
+};
+var RadialColumnSeriesModule = {
+ type: "series",
+ name: "radial-column",
+ chartType: "polar",
+ enterprise: true,
+ options: radialColumnSeriesOptionsDef,
+ create: (ctx) => new RadialColumnSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeModule.ts
+var import_ag_charts_community267 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeSeries.ts
+var import_ag_charts_community266 = require("ag-charts-community");
+var import_ag_charts_core112 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeNeedle.ts
+var import_ag_charts_community263 = require("ag-charts-community");
+var { SvgPath, Rotatable, Translatable, Scalable: Scalable2 } = import_ag_charts_community263._ModuleSupport;
+var RadialGaugeNeedle = class extends Rotatable(Scalable2(Translatable(SvgPath))) {
+ constructor() {
+ super(...arguments);
+ this.scalingCenterX = 0.5;
+ this.scalingCenterY = 0.5;
+ this.rotationCenterX = 0.5;
+ this.rotationCenterY = 0.5;
+ }
+};
+RadialGaugeNeedle.defaultPathData = "M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeSeriesProperties.ts
+var import_ag_charts_community264 = require("ag-charts-community");
+var { getColorStops: getColorStops2, normalizeAngle360: normalizeAngle3606, normalizeAngle360Inclusive: normalizeAngle360Inclusive2, toDegrees } = import_ag_charts_community264._ModuleSupport;
+var { BaseProperties: BaseProperties28, makeSeriesTooltip: makeSeriesTooltip21, SeriesProperties: SeriesProperties12, PropertiesArray: PropertiesArray8, AxisLabel: AxisLabel6, Property: Property81, Label: Label16 } = import_ag_charts_community264._ModuleSupport;
+var RadialGaugeDefaultTargetLabelProperties = class extends Label16 {
+};
+__decorateClass([
+ Property81
+], RadialGaugeDefaultTargetLabelProperties.prototype, "spacing", 2);
+var RadialGaugeTargetProperties = class extends BaseProperties28 {
+ constructor() {
+ super(...arguments);
+ this.label = new RadialGaugeDefaultTargetLabelProperties();
+ }
+ getStyle() {
+ const {
+ fill = "black",
+ fillOpacity = 1,
+ stroke: stroke2 = "black",
+ strokeWidth = 0,
+ strokeOpacity = 1,
+ lineDash = [0],
+ lineDashOffset = 0
+ } = this;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "text", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "value", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "shape", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "placement", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "size", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "rotation", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "fill", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property81
+], RadialGaugeTargetProperties.prototype, "label", 2);
+var RadialGaugeBarProperties = class extends BaseProperties28 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.fills = new PropertiesArray8(import_ag_charts_community264._ModuleSupport.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+ getStyle(defaultColorRange, scale) {
+ const {
+ enabled,
+ fill,
+ fills,
+ fillMode,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ } = this;
+ const barFill = enabled ? fill ?? createConicGradient(fills, fillMode, defaultColorRange, scale) : "none";
+ return {
+ fill: barFill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "fills", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "fill", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property81
+], RadialGaugeBarProperties.prototype, "lineDashOffset", 2);
+var RadialGaugeScaleIntervalProperties = class extends BaseProperties28 {
+ constructor() {
+ super(...arguments);
+ this.values = void 0;
+ this.step = void 0;
+ this.minSpacing = 0;
+ this.maxSpacing = 1e3;
+ }
+};
+__decorateClass([
+ Property81
+], RadialGaugeScaleIntervalProperties.prototype, "values", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleIntervalProperties.prototype, "step", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleIntervalProperties.prototype, "minSpacing", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleIntervalProperties.prototype, "maxSpacing", 2);
+var RadialGaugeScaleLabelProperties = class extends AxisLabel6 {
+};
+var RadialGaugeScaleProperties = class extends BaseProperties28 {
+ constructor() {
+ super(...arguments);
+ this.min = 0;
+ this.max = 1;
+ this.fills = new PropertiesArray8(import_ag_charts_community264._ModuleSupport.StopProperties);
+ this.fillMode = "continuous";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ this.defaultFill = "black";
+ this.interval = new RadialGaugeScaleIntervalProperties();
+ this.label = new RadialGaugeScaleLabelProperties();
+ }
+ getStyle(barEnabled, defaultColorRange, scale) {
+ const {
+ fill,
+ fills,
+ defaultFill,
+ fillMode,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ } = this;
+ const scaleFill = fill ?? (barEnabled && fills.length === 0 ? defaultFill : void 0) ?? createConicGradient(fills, fillMode, defaultColorRange, scale);
+ return {
+ fill: scaleFill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "min", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "max", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "fills", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "fillMode", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "fill", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "defaultFill", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "interval", 2);
+__decorateClass([
+ Property81
+], RadialGaugeScaleProperties.prototype, "label", 2);
+var RadialGaugeNeedleProperties = class extends BaseProperties28 {
+ constructor() {
+ super(...arguments);
+ this.enabled = true;
+ this.spacing = 0;
+ this.fill = "black";
+ this.fillOpacity = 1;
+ this.stroke = "black";
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "enabled", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "radiusRatio", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "fill", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property81
+], RadialGaugeNeedleProperties.prototype, "lineDashOffset", 2);
+var RadialGaugeLabelProperties = class extends AutoSizedLabel {
+};
+__decorateClass([
+ Property81
+], RadialGaugeLabelProperties.prototype, "text", 2);
+var RadialGaugeSecondaryLabelProperties = class extends AutoSizedSecondaryLabel {
+};
+__decorateClass([
+ Property81
+], RadialGaugeSecondaryLabelProperties.prototype, "text", 2);
+var RadialGaugeSeriesProperties = class extends SeriesProperties12 {
+ constructor() {
+ super(...arguments);
+ this.startAngle = 0;
+ this.endAngle = 0;
+ this.segmentation = new GaugeSegmentationProperties();
+ this.defaultColorRange = [];
+ this.targets = new PropertiesArray8(RadialGaugeTargetProperties);
+ this.defaultTarget = new RadialGaugeTargetProperties();
+ this.outerRadiusRatio = 1;
+ this.innerRadiusRatio = 1;
+ this.cornerRadius = 0;
+ this.cornerMode = "container";
+ this.spacing = 0;
+ this.scale = new RadialGaugeScaleProperties();
+ this.bar = new RadialGaugeBarProperties();
+ this.needle = new RadialGaugeNeedleProperties();
+ this.label = new RadialGaugeLabelProperties();
+ this.secondaryLabel = new RadialGaugeSecondaryLabelProperties();
+ this.tooltip = makeSeriesTooltip21();
+ }
+};
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "value", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "startAngle", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "endAngle", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "segmentation", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "targets", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "defaultTarget", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "outerRadiusRatio", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "innerRadiusRatio", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "outerRadius", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "innerRadius", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "cornerMode", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "scale", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "bar", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "needle", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "secondaryLabel", 2);
+__decorateClass([
+ Property81
+], RadialGaugeSeriesProperties.prototype, "tooltip", 2);
+function createConicGradient(fills, fillMode, defaultColorRange, scale) {
+ const { domain, range: range2 } = scale;
+ const [startAngle, endAngle] = range2;
+ const conicAngle = normalizeAngle3606((startAngle + endAngle) / 2 + Math.PI);
+ const sweepAngle = normalizeAngle360Inclusive2(endAngle - startAngle);
+ const colorStops = getColorStops2(fills, defaultColorRange, domain, fillMode).map(
+ ({ color: color6, stop }) => {
+ stop = Math.min(Math.max(stop, 0), 1);
+ const angle = startAngle + sweepAngle * stop;
+ stop = (angle - conicAngle) / (2 * Math.PI);
+ stop = (stop % 1 + 1) % 1;
+ return { stop, color: color6 };
+ }
+ );
+ return {
+ type: "gradient",
+ gradient: "conic",
+ colorSpace: "oklch",
+ colorStops,
+ bounds: "series",
+ rotation: toDegrees(conicAngle) + 90
+ };
+}
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeUtil.ts
+var import_ag_charts_community265 = require("ag-charts-community");
+var import_ag_charts_core111 = require("ag-charts-core");
+var { SectorBox: SectorBox5 } = import_ag_charts_community265._ModuleSupport;
+function computeClipSector(datum) {
+ const { startAngle, endAngle, clipStartAngle, clipEndAngle, innerRadius, outerRadius } = datum;
+ if (clipStartAngle == null || clipEndAngle == null)
+ return;
+ return new SectorBox5(
+ Math.max(clipStartAngle, startAngle),
+ Math.min(clipEndAngle, endAngle),
+ innerRadius,
+ outerRadius
+ );
+}
+function clipSectorVisibility(startAngle, endAngle, clipSector) {
+ return Math.max(startAngle, clipSector.startAngle) <= Math.min(endAngle, clipSector.endAngle);
+}
+function hasClipSector(datum) {
+ return datum.clipStartAngle != null && datum.clipEndAngle != null;
+}
+function datumClipSector(datum, zero) {
+ const { clipStartAngle, clipEndAngle, innerRadius, outerRadius } = datum;
+ return new SectorBox5(clipStartAngle, zero ? clipStartAngle : clipEndAngle, innerRadius, outerRadius);
+}
+function prepareRadialGaugeSeriesAnimationFunctions(initialLoad, initialStartAngle) {
+ const phase = initialLoad ? "initial" : "update";
+ const node = {
+ fromFn(sect, datum) {
+ const previousDatum = sect.previousDatum;
+ let { startAngle, endAngle } = previousDatum ?? datum;
+ const previousClipSector = previousDatum != null && hasClipSector(previousDatum) ? datumClipSector(previousDatum, initialLoad) : void 0;
+ const nextClipSector = hasClipSector(datum) ? datumClipSector(datum, initialLoad) : void 0;
+ let clipSector;
+ if (previousClipSector != null && nextClipSector != null) {
+ clipSector = previousClipSector;
+ } else if (previousClipSector == null && nextClipSector != null) {
+ clipSector = nextClipSector;
+ startAngle = datum.startAngle;
+ endAngle = datum.endAngle;
+ } else if (previousClipSector != null && nextClipSector == null) {
+ clipSector = void 0;
+ startAngle = datum.startAngle;
+ endAngle = datum.endAngle;
+ } else if (initialLoad) {
+ endAngle = startAngle;
+ }
+ return { startAngle, endAngle, clipSector, phase };
+ },
+ toFn(_sect, datum) {
+ const { startAngle, endAngle } = datum;
+ let clipSector;
+ if (hasClipSector(datum)) {
+ clipSector = datumClipSector(datum, false);
+ }
+ return { startAngle, endAngle, clipSector };
+ },
+ applyFn(sect, params) {
+ const { startAngle, endAngle } = params;
+ let { clipSector } = params;
+ if (clipSector != null) {
+ clipSector = new SectorBox5(
+ Math.max(startAngle, clipSector.startAngle),
+ Math.min(endAngle, clipSector.endAngle),
+ clipSector.innerRadius,
+ clipSector.outerRadius
+ );
+ }
+ const visible = clipSector == null || clipSectorVisibility(startAngle, endAngle, clipSector);
+ sect.startAngle = startAngle;
+ sect.endAngle = endAngle;
+ sect.clipSector = clipSector;
+ sect.visible = visible;
+ }
+ };
+ const needle = {
+ fromFn(needleNode) {
+ let { angle: rotation } = needleNode.previousDatum ?? needleNode.datum;
+ if (initialLoad) {
+ rotation = initialStartAngle;
+ }
+ return { rotation, phase };
+ },
+ toFn(_needleNode, datum) {
+ const { angle: rotation } = datum;
+ return { rotation };
+ }
+ };
+ return { node, needle };
+}
+function resetRadialGaugeSeriesResetSectorFunction(_node, datum) {
+ const { startAngle, endAngle } = datum;
+ const clipSector = computeClipSector(datum);
+ const visible = clipSector == null || clipSectorVisibility(startAngle, endAngle, clipSector);
+ return { startAngle, endAngle, clipSector, visible };
+}
+function resetRadialGaugeSeriesResetNeedleFunction(_node, datum) {
+ const { angle } = datum;
+ return { rotation: angle };
+}
+var verticalAlignFactors3 = {
+ top: 0,
+ middle: 0.5,
+ bottom: 1
+};
+function formatRadialGaugeLabels(series, ctx, selection, opts, innerRadius, datumOverrides) {
+ const { padding, textAlign, verticalAlign } = opts;
+ let labelDatum;
+ let secondaryLabelDatum;
+ selection.each((_node, datum) => {
+ if (datum.label === "primary" /* Primary */) {
+ labelDatum = datum;
+ } else if (datum.label === "secondary" /* Secondary */) {
+ secondaryLabelDatum = datum;
+ }
+ });
+ if (labelDatum == null)
+ return;
+ const labelText = getLabelText(series.id, ctx, labelDatum, datumOverrides?.label);
+ if (labelText == null)
+ return;
+ const secondaryLabelText = secondaryLabelDatum == null ? void 0 : getLabelText(series.id, ctx, secondaryLabelDatum, datumOverrides?.secondaryLabel);
+ const params = { padding };
+ const horizontalFactor = textAlign === "center" ? 2 : 1;
+ const verticalFactor = verticalAlign === "middle" ? 2 : 1;
+ const sizeFittingHeight = (height2) => ({
+ width: Math.sqrt(Math.max(innerRadius ** 2 - (height2 / verticalFactor) ** 2, 0)) * horizontalFactor,
+ height: Math.min(height2, verticalFactor * innerRadius),
+ meta: null
+ });
+ let labelLayout;
+ let secondaryLabelLayout;
+ let height;
+ if (secondaryLabelDatum != null && secondaryLabelText != null) {
+ const layout = formatStackedLabels(
+ (0, import_ag_charts_core111.toPlainText)(labelText),
+ labelDatum,
+ (0, import_ag_charts_core111.toPlainText)(secondaryLabelText),
+ secondaryLabelDatum,
+ params,
+ sizeFittingHeight
+ );
+ labelLayout = layout?.label;
+ secondaryLabelLayout = layout?.secondaryLabel;
+ height = layout?.height ?? 0;
+ } else {
+ const layout = formatSingleLabel((0, import_ag_charts_core111.toPlainText)(labelText), labelDatum, params, sizeFittingHeight);
+ labelLayout = layout?.[0];
+ secondaryLabelLayout = void 0;
+ height = layout?.[0].height ?? 0;
+ }
+ const rectYOffset = height * verticalAlignFactors3[verticalAlign];
+ selection.each((label, datum) => {
+ let layout;
+ if (datum.label === "primary" /* Primary */) {
+ layout = labelLayout;
+ } else if (datum.label === "secondary" /* Secondary */) {
+ layout = secondaryLabelLayout;
+ }
+ if (layout == null) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.text = layout.text;
+ label.fontSize = layout.fontSize;
+ label.lineHeight = layout.lineHeight;
+ label.textAlign = textAlign;
+ label.textBaseline = "middle";
+ const rectOriginInLabelRect = datum.label === "primary" /* Primary */ ? layout.height / 2 : height - layout.height / 2;
+ label.y = datum.centerY + rectOriginInLabelRect - rectYOffset;
+ label.x = datum.centerX;
+ });
+}
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeSeries.ts
+var {
+ fromToMotion: fromToMotion5,
+ resetMotion: resetMotion4,
+ SeriesNodePickMode: SeriesNodePickMode15,
+ StateMachine: StateMachine15,
+ createDatumId: createDatumId19,
+ normalizeAngle360: normalizeAngle3607,
+ normalizeAngle360Inclusive: normalizeAngle360Inclusive3,
+ isBetweenAngles: isBetweenAngles2,
+ sectorBox,
+ toRadians: toRadians5,
+ BBox: BBox24,
+ Group: Group19,
+ PointerEvents: PointerEvents12,
+ Selection: Selection16,
+ Sector: Sector6,
+ SectorBox: SectorBox6,
+ Text: Text9,
+ Marker: Marker6,
+ tickFormat: tickFormat2,
+ applyShapeStyle: applyShapeStyle17,
+ mergeDefaults: mergeDefaults19
+} = import_ag_charts_community266._ModuleSupport;
+var targetPlacementRotation = {
+ inside: 90,
+ middle: 0,
+ outside: -90
+};
+var outsideLabelPlacements = [
+ { textAlign: "left", textBaseline: "top" },
+ { textAlign: "right", textBaseline: "top" },
+ { textAlign: "right", textBaseline: "bottom" },
+ { textAlign: "left", textBaseline: "bottom" }
+];
+var insideLabelPlacements = [
+ { textAlign: "right", textBaseline: "bottom" },
+ { textAlign: "left", textBaseline: "bottom" },
+ { textAlign: "left", textBaseline: "top" },
+ { textAlign: "right", textBaseline: "top" }
+];
+var RadialGaugeSeries = class extends import_ag_charts_community266._ModuleSupport.Series {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode15.EXACT_SHAPE_MATCH, SeriesNodePickMode15.NEAREST_NODE]
+ });
+ this.centerX = 0;
+ this.centerY = 0;
+ this.radius = 0;
+ this.textAlign = "center";
+ this.verticalAlign = "middle";
+ this.properties = new RadialGaugeSeriesProperties();
+ this.scale = new LinearAngleScale();
+ this.scaleGroup = this.contentGroup.appendChild(new Group19({ name: "scaleGroup" }));
+ this.itemGroup = this.contentGroup.appendChild(new Group19({ name: "itemGroup" }));
+ this.itemNeedleGroup = this.contentGroup.appendChild(new Group19({ name: "itemNeedleGroup" }));
+ this.itemTargetGroup = this.contentGroup.appendChild(new Group19({ name: "itemTargetGroup" }));
+ this.itemTargetLabelGroup = this.contentGroup.appendChild(new Group19({ name: "itemTargetLabelGroup" }));
+ this.itemLabelGroup = this.contentGroup.appendChild(new Group19({ name: "itemLabelGroup" }));
+ this.highlightTargetGroup = this.highlightGroup.appendChild(
+ new Group19({ name: "itemTargetLabelGroup" })
+ );
+ this.tickGroup = this.contentGroup.appendChild(new Group19({ name: "tickGroup" }));
+ this.scaleSelection = Selection16.select(
+ this.scaleGroup,
+ () => this.nodeFactory()
+ );
+ this.datumSelection = Selection16.select(
+ this.itemGroup,
+ () => this.nodeFactory()
+ );
+ this.needleSelection = Selection16.select(
+ this.itemNeedleGroup,
+ RadialGaugeNeedle
+ );
+ this.targetSelection = Selection16.select(
+ this.itemTargetGroup,
+ () => this.markerFactory()
+ );
+ this.targetLabelSelection = Selection16.select(this.itemTargetLabelGroup, Text9);
+ this.labelSelection = Selection16.select(
+ this.itemLabelGroup,
+ Text9
+ );
+ this.highlightTargetSelection = Selection16.select(this.highlightTargetGroup, () => this.markerFactory());
+ this.tickSelection = Selection16.select(this.tickGroup, import_ag_charts_community266._ModuleSupport.TransformableText);
+ this.datumUnion = new DatumUnion();
+ this.animationState = new StateMachine15("empty", {
+ empty: {
+ update: {
+ target: "ready",
+ action: () => this.animateEmptyUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ ready: {
+ updateData: "waiting",
+ clear: "clearing",
+ resize: () => this.animateReadyResize(),
+ reset: "empty",
+ skip: "ready"
+ },
+ waiting: {
+ update: {
+ target: "ready",
+ action: () => this.animateWaitingUpdateReady()
+ },
+ reset: "empty",
+ skip: "ready"
+ },
+ clearing: {
+ update: {
+ target: "empty"
+ },
+ reset: "empty",
+ skip: "ready"
+ }
+ });
+ this.scaleGroup.pointerEvents = PointerEvents12.None;
+ this.tickGroup.pointerEvents = PointerEvents12.None;
+ this.itemNeedleGroup.pointerEvents = PointerEvents12.None;
+ this.itemLabelGroup.pointerEvents = PointerEvents12.None;
+ }
+ get hasData() {
+ return this.properties.value != null;
+ }
+ nodeFactory() {
+ return new Sector6();
+ }
+ markerFactory() {
+ const marker = new Marker6();
+ marker.size = 1;
+ return marker;
+ }
+ processData() {
+ this.nodeDataRefresh = true;
+ this.animationState.transition("updateData");
+ }
+ formatLabel(value) {
+ const { min, max } = this.properties.scale;
+ return formatLabel(value, { min, max });
+ }
+ layoutScale() {
+ const { scale, properties } = this;
+ const { seriesRectWidth, seriesRectHeight } = this.nodeDataDependencies;
+ const { scale: scaleProps, outerRadius } = this.properties;
+ const { min, max, label, interval } = scaleProps;
+ const startAngle = toRadians5(properties.startAngle - 90);
+ const endAngle = toRadians5(properties.endAngle - 90);
+ const sweepAngle = normalizeAngle360Inclusive3(endAngle - startAngle);
+ const largerThanHalf = sweepAngle > Math.PI;
+ const containsTop = largerThanHalf || isBetweenAngles2(1.5 * Math.PI, startAngle, endAngle);
+ const containsRight = largerThanHalf || isBetweenAngles2(0 * Math.PI, startAngle, endAngle);
+ const containsBottom = largerThanHalf || isBetweenAngles2(0.5 * Math.PI, startAngle, endAngle);
+ const containsLeft = largerThanHalf || isBetweenAngles2(1 * Math.PI, startAngle, endAngle);
+ let textAlign;
+ if (containsLeft && !containsRight) {
+ textAlign = "right";
+ } else if (!containsLeft && containsRight) {
+ textAlign = "left";
+ } else {
+ textAlign = "center";
+ }
+ let verticalAlign;
+ if (containsTop && !containsBottom) {
+ verticalAlign = "bottom";
+ } else if (!containsTop && containsBottom) {
+ verticalAlign = "top";
+ } else {
+ verticalAlign = "middle";
+ }
+ const unitBox = sectorBox({
+ startAngle,
+ endAngle,
+ innerRadius: 0,
+ outerRadius: 0.5
+ });
+ const centerXOffset = -(unitBox.x + unitBox.width / 2) * 2;
+ const centerYOffset = -(unitBox.y + unitBox.height / 2) * 2;
+ const unitBoxSize = Math.min(seriesRectWidth / unitBox.width, seriesRectHeight / unitBox.height);
+ scale.domain = [min, max];
+ scale.range = [startAngle, endAngle];
+ scale.arcLength = unitBoxSize / 2;
+ const { maxSpacing, minSpacing } = interval;
+ const { arcLength } = scale;
+ const minTickCount = maxSpacing ? Math.floor(arcLength / maxSpacing) : 1;
+ const maxTickCount = minSpacing ? Math.floor(arcLength / minSpacing) : Infinity;
+ const preferredTickCount = Math.floor(4 / Math.PI * Math.abs(scale.range[0] - scale.range[1]));
+ const tickCount = Math.max(minTickCount, Math.min(maxTickCount, preferredTickCount));
+ const ticks = interval.values ?? scale.ticks({
+ nice: false,
+ interval: interval.step,
+ minTickCount,
+ maxTickCount,
+ tickCount
+ })?.ticks ?? [];
+ const tickFormatter = tickFormat2(ticks, typeof label.format === "string" ? label.format : void 0);
+ const measurer2 = (0, import_ag_charts_core112.cachedTextMeasurer)(label);
+ const tickData = ticks.map((value, index) => {
+ let text2;
+ if (label.formatter) {
+ text2 = formatWithContext(this.ctx, label.formatter, {
+ value,
+ index,
+ domain: scale.domain,
+ boundSeries: void 0
+ });
+ }
+ text2 ?? (text2 = tickFormatter?.(value));
+ if (text2 == null)
+ return;
+ const { width, height } = (0, import_ag_charts_core112.isArray)(text2) ? (0, import_ag_charts_core112.measureTextSegments)(text2, label) : measurer2.measureLines(text2);
+ return { index, value, text: text2, width, height };
+ }).filter((value) => value != null);
+ const maxWidth = tickData.reduce((m, t) => Math.max(m, t.width), 0);
+ const maxHeight = tickData.reduce((m, t) => Math.max(m, t.height), 0);
+ const labelInset = label.enabled ? Math.max(maxWidth, maxHeight) + label.spacing : 0;
+ const radiusBounds = Math.max(
+ 0.5 * unitBoxSize - labelInset,
+ // seriesRect may have negative size
+ 0
+ );
+ const radius = outerRadius ?? radiusBounds;
+ this.centerX = seriesRectWidth / 2 + centerXOffset * radius;
+ this.centerY = seriesRectHeight / 2 + centerYOffset * radius;
+ this.radius = radius;
+ this.textAlign = textAlign;
+ this.verticalAlign = verticalAlign;
+ return tickData;
+ }
+ getShapeFillBBox() {
+ const { centerX, centerY, radius } = this;
+ const bbox = new BBox24(centerX - radius, centerY - radius, 2 * radius, 2 * radius);
+ return {
+ series: bbox,
+ axis: bbox
+ };
+ }
+ getTargets() {
+ const { properties } = this;
+ const defaultTarget = properties.defaultTarget;
+ return Array.from(properties.targets).map((target) => {
+ const {
+ text: text2 = defaultTarget.text,
+ value = defaultTarget.value ?? 0,
+ shape = defaultTarget.shape ?? "triangle",
+ rotation = defaultTarget.rotation ?? 0,
+ placement = defaultTarget.placement ?? "middle",
+ spacing = defaultTarget.spacing ?? 0,
+ size = defaultTarget.size ?? 0
+ } = target;
+ const {
+ enabled: labelEnabled = defaultTarget.label.enabled,
+ color: labelColor = defaultTarget.label.color ?? "black",
+ fontStyle: labelFontStyle = defaultTarget.label.fontStyle ?? "normal",
+ fontWeight: labelFontWeight = defaultTarget.label.fontWeight ?? "normal",
+ fontSize: labelFontSize = defaultTarget.label.fontSize,
+ fontFamily: labelFontFamily = defaultTarget.label.fontFamily,
+ spacing: labelSpacing = defaultTarget.label.spacing ?? 0
+ } = target.label;
+ return {
+ text: text2,
+ value,
+ shape,
+ placement,
+ spacing,
+ size,
+ rotation,
+ label: {
+ enabled: labelEnabled,
+ color: labelColor,
+ fontStyle: labelFontStyle,
+ fontWeight: labelFontWeight,
+ fontSize: labelFontSize,
+ fontFamily: labelFontFamily,
+ spacing: labelSpacing
+ },
+ style: target.getStyle()
+ };
+ });
+ }
+ getTargetRadius(target) {
+ const { radius, properties } = this;
+ const { innerRadiusRatio, outerRadiusRatio } = properties;
+ const { placement, spacing, size } = target;
+ const outerRadius = radius * outerRadiusRatio;
+ const innerRadius = radius * innerRadiusRatio;
+ switch (placement) {
+ case "inside":
+ return Math.max(innerRadius - spacing - size / 2, 0);
+ case "outside":
+ return outerRadius + spacing + size / 2;
+ default:
+ return (innerRadius + outerRadius) / 2;
+ }
+ }
+ getTargetLabel(target) {
+ const { scale } = this;
+ const { value, size, placement, label } = target;
+ const { spacing, color: fill, fontStyle, fontWeight, fontSize, fontFamily } = label;
+ const lineHeight = void 0;
+ const angle = scale.convert(value);
+ const quadrant = Math.trunc(normalizeAngle3607(angle) / (Math.PI / 2));
+ const offset = size / 2 + spacing;
+ let textAlign;
+ let textBaseline;
+ let offsetX;
+ let offsetY;
+ switch (placement) {
+ case "outside":
+ ({ textAlign, textBaseline } = outsideLabelPlacements[quadrant]);
+ offsetX = offset * Math.cos(angle);
+ offsetY = offset * Math.sin(angle);
+ break;
+ case "inside":
+ ({ textAlign, textBaseline } = insideLabelPlacements[quadrant]);
+ offsetX = -offset * Math.cos(angle);
+ offsetY = -offset * Math.sin(angle);
+ break;
+ default:
+ textAlign = "center";
+ textBaseline = "bottom";
+ offsetX = 0;
+ offsetY = -offset;
+ break;
+ }
+ return {
+ offsetX,
+ offsetY,
+ fill,
+ textAlign,
+ textBaseline,
+ fontStyle,
+ fontWeight,
+ fontSize,
+ fontFamily,
+ lineHeight
+ };
+ }
+ createNodeData() {
+ const tickData = this.layoutScale();
+ const { id: seriesId, scale, properties, radius, centerX, centerY } = this;
+ const {
+ value,
+ innerRadiusRatio,
+ outerRadiusRatio,
+ segmentation,
+ cornerRadius,
+ cornerMode,
+ needle,
+ bar,
+ scale: scaleProps,
+ label,
+ secondaryLabel
+ } = properties;
+ const {
+ outerRadius = radius * outerRadiusRatio,
+ innerRadius = radius * innerRadiusRatio,
+ defaultColorRange
+ } = properties;
+ const targets = this.getTargets();
+ const nodeData = [];
+ const targetData = [];
+ const needleData = [];
+ const labelData = [];
+ const scaleData = [];
+ const cornersOnAllItems = cornerMode === "item";
+ const containerStartAngle = scale.convert(scale.domain[0]);
+ const containerEndAngle = scale.convert(value);
+ const maxTicks = Math.ceil(normalizeAngle360Inclusive3(containerEndAngle - containerStartAngle) * radius);
+ let segments = segmentation.enabled ? segmentation.interval.getSegments(scale, maxTicks) : void 0;
+ const barStyle = bar.getStyle(defaultColorRange, scale);
+ const scaleStyle = scaleProps.getStyle(bar.enabled, defaultColorRange, scale);
+ if (segments == null && cornersOnAllItems) {
+ const segmentStart = Math.min(...scale.domain);
+ const segmentEnd = Math.max(...scale.domain);
+ const datum = { value, segmentStart, segmentEnd };
+ const appliedCornerRadius = Math.min(cornerRadius, (outerRadius - innerRadius) / 2);
+ const angleInset = appliedCornerRadius / ((innerRadius + outerRadius) / 2);
+ nodeData.push({
+ series: this,
+ itemId: `value`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: containerStartAngle - angleInset,
+ endAngle: containerEndAngle + angleInset,
+ clipStartAngle: void 0,
+ clipEndAngle: void 0,
+ startCornerRadius: cornerRadius,
+ endCornerRadius: cornerRadius,
+ style: barStyle
+ });
+ scaleData.push({
+ series: this,
+ itemId: `scale`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: scale.range[0] - angleInset,
+ endAngle: scale.range[1] + angleInset,
+ clipStartAngle: void 0,
+ clipEndAngle: void 0,
+ startCornerRadius: cornerRadius,
+ endCornerRadius: cornerRadius,
+ style: scaleStyle
+ });
+ } else {
+ segments ?? (segments = scale.domain);
+ for (let i = 0; i < segments.length - 1; i++) {
+ const segmentStart = segments[i];
+ const segmentEnd = segments[i + 1];
+ const datum = { value, segmentStart, segmentEnd };
+ const isStart = i === 0;
+ const isEnd = i === segments.length - 2;
+ const itemStartAngle = scale.convert(segmentStart);
+ const itemEndAngle = scale.convert(segmentEnd);
+ nodeData.push({
+ series: this,
+ itemId: `value-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: itemStartAngle,
+ endAngle: itemEndAngle,
+ clipStartAngle: containerStartAngle,
+ clipEndAngle: containerEndAngle,
+ startCornerRadius: cornersOnAllItems || isStart ? cornerRadius : 0,
+ endCornerRadius: cornersOnAllItems || isEnd ? cornerRadius : 0,
+ style: barStyle
+ });
+ scaleData.push({
+ series: this,
+ itemId: `scale-${i}`,
+ datum,
+ datumIndex: { type: 0 /* Node */ },
+ type: 0 /* Node */,
+ centerX,
+ centerY,
+ outerRadius,
+ innerRadius,
+ startAngle: itemStartAngle,
+ endAngle: itemEndAngle,
+ clipStartAngle: void 0,
+ clipEndAngle: void 0,
+ startCornerRadius: cornersOnAllItems || isStart ? cornerRadius : 0,
+ endCornerRadius: cornersOnAllItems || isEnd ? cornerRadius : 0,
+ style: scaleStyle
+ });
+ }
+ }
+ if (!needle.enabled && label.enabled) {
+ const {
+ text: text2,
+ color: fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter = (params) => this.formatLabel(params.value)
+ } = label;
+ labelData.push({
+ label: "primary" /* Primary */,
+ centerX,
+ centerY,
+ text: text2,
+ value,
+ fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter
+ });
+ }
+ if (!needle.enabled && secondaryLabel.enabled) {
+ const {
+ text: text2,
+ color: fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter
+ } = secondaryLabel;
+ labelData.push({
+ label: "secondary" /* Secondary */,
+ centerX,
+ centerY,
+ text: text2,
+ value,
+ fill,
+ fontSize,
+ minimumFontSize,
+ fontStyle,
+ fontWeight,
+ fontFamily,
+ lineHeight,
+ formatter
+ });
+ }
+ if (needle.enabled) {
+ let needleRadius = needle.radiusRatio == null ? innerRadius : radius * needle.radiusRatio;
+ needleRadius = Math.max(needleRadius - needle.spacing, 0);
+ const needleAngle = scale.convert(value);
+ needleData.push({
+ centerX,
+ centerY,
+ radius: needleRadius,
+ angle: needleAngle,
+ series: this
+ });
+ }
+ for (let i = 0; i < targets.length; i += 1) {
+ const target = targets[i];
+ const { value: targetValue, text: text2, size, shape, style } = target;
+ if (targetValue < Math.min(...scale.domain) || targetValue > Math.max(...scale.domain)) {
+ continue;
+ }
+ const targetRadius = this.getTargetRadius(target);
+ const targetAngle = scale.convert(targetValue);
+ const targetRotation = toRadians5(target.rotation + targetPlacementRotation[target.placement]);
+ targetData.push({
+ series: this,
+ itemId: `target-${i}`,
+ midPoint: {
+ x: targetRadius * Math.cos(targetAngle) + centerX,
+ y: targetRadius * Math.sin(targetAngle) + centerY
+ },
+ datum: { value: targetValue },
+ datumIndex: { type: 1 /* Target */, index: i },
+ type: 1 /* Target */,
+ value: targetValue,
+ text: text2,
+ centerX,
+ centerY,
+ shape,
+ radius: targetRadius,
+ angle: targetAngle,
+ rotation: targetRotation,
+ size,
+ label: this.getTargetLabel(target),
+ style
+ });
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ needleData,
+ targetData,
+ labelData,
+ scaleData,
+ tickData
+ };
+ }
+ updateSelections(resize) {
+ if (this.nodeDataRefresh || resize) {
+ this.contextNodeData = this.createNodeData();
+ this.nodeDataRefresh = false;
+ }
+ }
+ highlightDatum(node) {
+ if (node != null && node.series === this && node.type === 1 /* Target */) {
+ return node;
+ }
+ }
+ update({ seriesRect }) {
+ const {
+ datumSelection,
+ labelSelection,
+ needleSelection,
+ targetSelection,
+ targetLabelSelection,
+ scaleSelection,
+ highlightTargetSelection,
+ tickSelection
+ } = this;
+ const resize = this.checkResize(seriesRect);
+ this.updateSelections(resize);
+ this.contentGroup.visible = this.visible;
+ this.contentGroup.opacity = this.getOpacity();
+ const nodeData = this.contextNodeData?.nodeData ?? [];
+ const labelData = this.contextNodeData?.labelData ?? [];
+ const needleData = this.contextNodeData?.needleData ?? [];
+ const targetData = this.contextNodeData?.targetData ?? [];
+ const scaleData = this.contextNodeData?.scaleData ?? [];
+ const tickData = this.contextNodeData?.tickData ?? [];
+ const highlightTargetDatum = this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());
+ this.scaleSelection = this.updateScaleSelection({ scaleData, scaleSelection });
+ this.updateScaleNodes({ scaleSelection });
+ this.needleSelection = this.updateNeedleSelection({ needleData, needleSelection });
+ this.updateNeedleNodes({ needleSelection });
+ this.targetSelection = this.updateTargetSelection({ targetData, targetSelection });
+ this.updateTargetStyles({ targetSelection, isHighlight: false });
+ this.updateTargetNodes({ targetSelection });
+ this.targetLabelSelection = this.updateTargetLabelSelection({ targetData, targetLabelSelection });
+ this.updateTargetLabelNodes({ targetLabelSelection });
+ this.datumSelection = this.updateDatumSelection({ nodeData, datumSelection });
+ this.updateDatumNodes({ datumSelection });
+ this.labelSelection = this.updateLabelSelection({ labelData, labelSelection });
+ this.updateLabelNodes({ labelSelection });
+ this.highlightTargetSelection = this.updateTargetSelection({
+ targetData: highlightTargetDatum == null ? [] : [highlightTargetDatum],
+ targetSelection: highlightTargetSelection
+ });
+ this.updateTargetStyles({ targetSelection: highlightTargetSelection, isHighlight: true });
+ this.updateTargetNodes({ targetSelection: highlightTargetSelection });
+ this.tickSelection = this.updateTickSelection({ tickData, tickSelection });
+ this.updateTickNodes({ tickSelection });
+ if (resize) {
+ this.animationState.transition("resize");
+ }
+ this.animationState.transition("update");
+ }
+ updateDatumSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => {
+ return createDatumId19(opts.nodeData.length, datum.itemId);
+ });
+ }
+ updateDatumNodes(opts) {
+ const { datumSelection } = opts;
+ const { ctx, properties } = this;
+ const { segmentation } = properties;
+ const sectorSpacing = segmentation.spacing ?? 0;
+ const animationDisabled = ctx.animationManager.isSkipped();
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((sector, datum) => {
+ const { centerX, centerY, innerRadius, outerRadius, startCornerRadius, endCornerRadius } = datum;
+ sector.centerX = centerX;
+ sector.centerY = centerY;
+ sector.innerRadius = innerRadius;
+ sector.outerRadius = outerRadius;
+ sector.pointerEvents = this.properties.bar.enabled ? import_ag_charts_community266._ModuleSupport.PointerEvents.All : import_ag_charts_community266._ModuleSupport.PointerEvents.None;
+ applyShapeStyle17(sector, datum.style, fillBBox);
+ sector.startOuterCornerRadius = startCornerRadius;
+ sector.startInnerCornerRadius = startCornerRadius;
+ sector.endOuterCornerRadius = endCornerRadius;
+ sector.endInnerCornerRadius = endCornerRadius;
+ sector.radialEdgeInset = (sectorSpacing + sector.strokeWidth) / 2;
+ sector.concentricEdgeInset = sector.strokeWidth / 2;
+ if (animationDisabled || sector.previousDatum == null) {
+ sector.setProperties(resetRadialGaugeSeriesResetSectorFunction(sector, datum));
+ }
+ });
+ this.datumUnion.update(datumSelection, this.itemGroup, import_ag_charts_community266._ModuleSupport.Sector, (node, first, last) => {
+ node.clipSector ?? (node.clipSector = new SectorBox6(Number.NaN, Number.NaN, Number.NaN, Number.NaN));
+ node.centerX = first.centerX;
+ node.centerY = first.centerY;
+ node.outerRadius = node.clipSector.outerRadius = first.outerRadius;
+ node.innerRadius = node.clipSector.innerRadius = first.innerRadius;
+ node.startAngle = node.clipSector.startAngle = first.startAngle;
+ node.startInnerCornerRadius = first.startInnerCornerRadius;
+ node.startOuterCornerRadius = first.startOuterCornerRadius;
+ node.endAngle = last.endAngle;
+ node.clipSector.endAngle = last.clipSector?.endAngle ?? last.endAngle;
+ node.endInnerCornerRadius = last.endInnerCornerRadius;
+ node.endOuterCornerRadius = last.endOuterCornerRadius;
+ node.pointerEvents = import_ag_charts_community266._ModuleSupport.PointerEvents.None;
+ });
+ }
+ updateScaleSelection(opts) {
+ return opts.scaleSelection.update(opts.scaleData, void 0, (datum) => {
+ return createDatumId19(opts.scaleData.length, datum.itemId);
+ });
+ }
+ updateScaleNodes(opts) {
+ const { scaleSelection } = opts;
+ const { segmentation } = this.properties;
+ const sectorSpacing = segmentation.spacing ?? 0;
+ const fillBBox = this.getShapeFillBBox();
+ scaleSelection.each((sector, datum) => {
+ const { centerX, centerY, innerRadius, outerRadius, startCornerRadius, endCornerRadius } = datum;
+ sector.centerX = centerX;
+ sector.centerY = centerY;
+ sector.innerRadius = innerRadius;
+ sector.outerRadius = outerRadius;
+ applyShapeStyle17(sector, datum.style, fillBBox);
+ sector.startOuterCornerRadius = startCornerRadius;
+ sector.startInnerCornerRadius = startCornerRadius;
+ sector.endOuterCornerRadius = endCornerRadius;
+ sector.endInnerCornerRadius = endCornerRadius;
+ sector.radialEdgeInset = (sectorSpacing + sector.strokeWidth) / 2;
+ sector.concentricEdgeInset = sector.strokeWidth / 2;
+ sector.setProperties(resetRadialGaugeSeriesResetSectorFunction(sector, datum));
+ });
+ }
+ updateNeedleSelection(opts) {
+ return opts.needleSelection.update(opts.needleData, void 0, () => createDatumId19(0));
+ }
+ updateNeedleNodes(opts) {
+ const { needleSelection } = opts;
+ const { fill, fillOpacity, stroke: stroke2, strokeOpacity, strokeWidth, lineDash, lineDashOffset } = this.properties.needle;
+ const animationDisabled = this.ctx.animationManager.isSkipped();
+ needleSelection.each((needle, datum) => {
+ const { centerX, centerY, radius } = datum;
+ const scale = radius * 2;
+ needle.d = RadialGaugeNeedle.defaultPathData;
+ applyShapeStyle17(needle, {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeOpacity,
+ strokeWidth: strokeWidth / scale,
+ lineDash: lineDash.map((d) => d / scale),
+ lineDashOffset: lineDashOffset / scale
+ });
+ needle.translationX = centerX;
+ needle.translationY = centerY;
+ needle.scalingX = scale;
+ needle.scalingY = scale;
+ if (animationDisabled) {
+ needle.setProperties(resetRadialGaugeSeriesResetNeedleFunction(needle, datum));
+ }
+ });
+ }
+ updateTargetSelection(opts) {
+ return opts.targetSelection.update(opts.targetData, void 0, (target) => target.itemId);
+ }
+ updateTargetStyles({
+ targetSelection,
+ isHighlight
+ }) {
+ targetSelection.each((_, datum) => {
+ datum.style = this.getTargetStyle(isHighlight, datum);
+ });
+ }
+ updateTargetNodes({
+ targetSelection
+ }) {
+ targetSelection.each((target, datum) => {
+ const { centerX, centerY, angle, radius, shape, size, rotation } = datum;
+ applyShapeStyle17(target, datum.style);
+ target.size = size;
+ target.shape = shape === "line" ? lineMarker : shape;
+ target.translationX = centerX + radius * Math.cos(angle);
+ target.translationY = centerY + radius * Math.sin(angle);
+ target.rotation = angle + rotation;
+ });
+ }
+ getTargetStyle(isHighlight, { datumIndex, style }) {
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ return mergeDefaults19(highlightStyle, {
+ ...style,
+ opacity: 1
+ });
+ }
+ updateTargetLabelSelection(opts) {
+ return opts.targetLabelSelection.update(opts.targetData, void 0, (target) => target.itemId);
+ }
+ updateTargetLabelNodes(opts) {
+ const { targetLabelSelection } = opts;
+ targetLabelSelection.each((label, target) => {
+ const { centerX, centerY, radius, angle, text: text2 } = target;
+ const { offsetX, offsetY, fill, fontStyle, fontWeight, fontSize, fontFamily, textAlign, textBaseline } = target.label;
+ if (text2 == null) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.x = centerX + radius * Math.cos(angle) + offsetX;
+ label.y = centerY + radius * Math.sin(angle) + offsetY;
+ label.text = text2;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = textBaseline;
+ });
+ }
+ updateLabelSelection(opts) {
+ return opts.labelSelection.update(opts.labelData, void 0, (datum) => datum.label);
+ }
+ updateLabelNodes(opts) {
+ const { labelSelection } = opts;
+ const animationDisabled = this.ctx.animationManager.isSkipped();
+ labelSelection.each((label, datum) => {
+ label.fill = datum.fill;
+ label.fontStyle = datum.fontStyle;
+ label.fontWeight = datum.fontWeight;
+ label.fontFamily = datum.fontFamily;
+ });
+ if (animationDisabled || this.labelsHaveExplicitText()) {
+ this.formatLabelText();
+ }
+ }
+ updateTickSelection(opts) {
+ return opts.tickSelection.update(opts.tickData, void 0, (datum) => datum.index);
+ }
+ updateTickNodes(opts) {
+ const { scale, radius, centerX, centerY, properties } = this;
+ const { enabled, color: color6, fontFamily, fontSize, fontStyle, fontWeight, spacing } = properties.scale.label;
+ const rotation = toRadians5(properties.scale.label.rotation ?? 0);
+ opts.tickSelection.each((label, datum) => {
+ if (!enabled) {
+ label.visible = false;
+ return;
+ }
+ label.visible = true;
+ label.text = datum.text;
+ label.fill = color6;
+ label.fontFamily = fontFamily;
+ label.fontSize = fontSize;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.textAlign = "center";
+ label.textBaseline = "middle";
+ const angle = scale.convert(datum.value);
+ const { width, height } = datum;
+ const originX = Math.abs(radius * Math.cos(angle));
+ const originY = Math.abs(radius * Math.sin(angle));
+ const x0 = Math.min(Math.max(Math.abs(radius / Math.tan(angle)), originX - width / 2), originX + width / 2);
+ const y0 = Math.min(
+ Math.max(Math.abs(radius * Math.tan(angle)), originY - height / 2),
+ originY + height / 2
+ );
+ const outerR = Math.hypot(x0, y0);
+ const x = centerX + (outerR + spacing) * Math.cos(angle);
+ const y = centerY + (outerR + spacing) * Math.sin(angle);
+ label.x = x;
+ label.y = y;
+ label.rotationCenterX = x;
+ label.rotationCenterY = y;
+ label.rotation = rotation;
+ });
+ }
+ labelsHaveExplicitText() {
+ for (const { datum } of this.labelSelection) {
+ if (datum.text == null) {
+ return false;
+ }
+ }
+ return true;
+ }
+ formatLabelText(datum) {
+ const { labelSelection, radius, textAlign, verticalAlign } = this;
+ const { spacing: padding, innerRadiusRatio } = this.properties;
+ formatRadialGaugeLabels(
+ this,
+ this.ctx,
+ labelSelection,
+ { padding, textAlign, verticalAlign },
+ radius * innerRadiusRatio,
+ datum
+ );
+ }
+ resetAllAnimation() {
+ this.ctx.animationManager.stopByAnimationGroupId(this.id);
+ resetMotion4([this.datumSelection], resetRadialGaugeSeriesResetSectorFunction);
+ resetMotion4([this.needleSelection], resetRadialGaugeSeriesResetNeedleFunction);
+ this.formatLabelText();
+ }
+ resetAnimation(phase) {
+ if (phase === "initial") {
+ this.animationState.transition("reset");
+ } else if (phase === "ready") {
+ this.animationState.transition("skip");
+ }
+ }
+ animateLabelText(params = {}) {
+ const { animationManager } = this.ctx;
+ let labelFrom;
+ let labelTo;
+ let secondaryLabelFrom;
+ let secondaryLabelTo;
+ this.labelSelection.each((label, datum) => {
+ label.opacity = 1;
+ if (datum.label === "primary" /* Primary */) {
+ labelFrom = label.previousDatum?.value ?? params.from ?? datum.value;
+ labelTo = datum.value;
+ } else if (datum.label === "secondary" /* Secondary */) {
+ secondaryLabelFrom = label.previousDatum?.value ?? params.from ?? datum.value;
+ secondaryLabelTo = datum.value;
+ }
+ });
+ if (this.labelsHaveExplicitText()) {
+ } else if (labelTo == null || secondaryLabelTo == null) {
+ this.formatLabelText();
+ } else if (labelFrom === labelTo && secondaryLabelFrom === secondaryLabelTo) {
+ this.formatLabelText({ label: labelTo, secondaryLabel: secondaryLabelTo });
+ } else {
+ const animationId = `${this.id}_labels`;
+ animationManager.animate({
+ id: animationId,
+ groupId: "label",
+ from: { label: labelFrom, secondaryLabel: secondaryLabelFrom },
+ to: { label: labelTo, secondaryLabel: secondaryLabelTo },
+ phase: params.phase ?? "update",
+ onUpdate: (datum) => this.formatLabelText(datum),
+ onStop: () => this.formatLabelText({ label: labelTo, secondaryLabel: secondaryLabelTo })
+ });
+ }
+ }
+ animateEmptyUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node, needle } = prepareRadialGaugeSeriesAnimationFunctions(true, this.scale.range[0]);
+ fromToMotion5(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ fromToMotion5(this.id, "needle", animationManager, [this.needleSelection], needle, () => "needle");
+ fromToMotion5(
+ this.id,
+ "label",
+ animationManager,
+ [this.labelSelection],
+ fadeInFns,
+ (_label, datum) => datum.label
+ );
+ this.animateLabelText({
+ from: this.properties.scale.min,
+ phase: "initial"
+ });
+ }
+ animateWaitingUpdateReady() {
+ const { animationManager } = this.ctx;
+ const { node, needle } = prepareRadialGaugeSeriesAnimationFunctions(false, this.scale.range[0]);
+ fromToMotion5(this.id, "node", animationManager, [this.datumSelection], node, (_sector, datum) => datum.itemId);
+ fromToMotion5(this.id, "needle", animationManager, [this.needleSelection], needle, () => "needle");
+ this.animateLabelText();
+ }
+ animateReadyResize() {
+ this.resetAllAnimation();
+ }
+ dataCount() {
+ return Number.NaN;
+ }
+ getSeriesDomain() {
+ return [Number.NaN, Number.NaN];
+ }
+ getSeriesRange(_direction, _visibleRange) {
+ return [Number.NaN, Number.NaN];
+ }
+ getLegendData() {
+ return [];
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties } = this;
+ const { tooltip } = properties;
+ let value;
+ let text2;
+ let fallbackLabel;
+ if (datumIndex.type === 0 /* Node */) {
+ value = properties.value;
+ text2 = properties.label.text;
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeValue");
+ } else {
+ ({ value, text: text2 } = properties.targets[datumIndex.index]);
+ fallbackLabel = this.ctx.localeManager.t("ariaLabelGaugeTarget");
+ }
+ if (value == null)
+ return;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ data: [{ label: text2, fallbackLabel, value: this.formatLabel(value) }]
+ },
+ { seriesId, title: void 0, datum: void 0, value }
+ );
+ }
+ pickNodeClosestDatum(point) {
+ return pickGaugeNearestDatum(this, point);
+ }
+ pickFocus(opts) {
+ return pickGaugeFocus(this, opts);
+ }
+ getCaptionText() {
+ const { value } = this.properties;
+ const description = [];
+ description.push(this.formatLabel(value));
+ this.labelSelection.each((_label, datum) => {
+ const text2 = getLabelText(this.id, this.ctx, datum);
+ if (text2 != null) {
+ description.push((0, import_ag_charts_core112.toPlainText)(text2));
+ }
+ });
+ return description.join(". ");
+ }
+ getCategoryValue(_datumIndex) {
+ return;
+ }
+ datumIndexForCategoryValue(_categoryValue) {
+ return;
+ }
+ hasItemStylers() {
+ return this.properties.label.itemStyler != null;
+ }
+};
+RadialGaugeSeries.className = "RadialGaugeSeries";
+RadialGaugeSeries.type = "radial-gauge";
+
+// packages/ag-charts-enterprise/src/series/radial-gauge/radialGaugeModule.ts
+var { FONT_SIZE_RATIO: FONT_SIZE_RATIO2 } = import_ag_charts_community267._ModuleSupport;
+var RadialGaugeModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "radial-gauge",
+ moduleFactory: (ctx) => new RadialGaugeSeries(ctx),
+ themeTemplate: {
+ minWidth: 200,
+ minHeight: 200,
+ tooltip: {
+ enabled: false
+ },
+ series: {
+ outerRadiusRatio: 1,
+ innerRadiusRatio: 0.8,
+ startAngle: 270,
+ endAngle: 270 + 180,
+ defaultColorRange: {
+ $if: [
+ { $eq: [{ $palette: "type" }, "inbuilt"] },
+ { $interpolate: [{ $palette: "secondDivergingColors" }, 5] },
+ import_ag_charts_community267._ModuleSupport.SAFE_RANGE2_OPERATION
+ ]
+ },
+ scale: {
+ // @ts-expect-error undocumented option
+ defaultFill: { $path: ["/1", { $palette: "fill" }, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ stroke: { $path: ["/2", import_ag_charts_community267._ModuleSupport.SAFE_STROKE_FILL_OPERATION, { $palette: "hierarchyColors" }] },
+ // TODO: mix backgroundColor and foregroundColor?
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] },
+ label: {
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ spacing: 12
+ }
+ },
+ bar: {
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ segmentation: {
+ enabled: false,
+ interval: {},
+ spacing: 2
+ },
+ defaultTarget: {
+ fill: { $ref: "foregroundColor" },
+ stroke: { $ref: "foregroundColor" },
+ size: 10,
+ shape: "triangle",
+ placement: "outside",
+ spacing: 5,
+ label: {
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" },
+ spacing: 5
+ }
+ },
+ needle: {
+ enabled: false,
+ fill: { $ref: "foregroundColor" },
+ spacing: 10
+ },
+ label: {
+ ...import_ag_charts_community267._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: 56,
+ minimumFontSize: 18 / 56,
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "textColor" }
+ },
+ secondaryLabel: {
+ ...import_ag_charts_community267._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $rem: FONT_SIZE_RATIO2.LARGE },
+ minimumFontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ color: { $ref: "subtleTextColor" }
+ },
+ tooltip: {
+ range: { $path: ["/tooltip/range", 10] }
+ }
+ }
+ }
+};
+var RadialGaugeSeriesModule = {
+ type: "series",
+ name: "radial-gauge",
+ chartType: "standalone",
+ enterprise: true,
+ options: import_ag_charts_community267._ModuleSupport.radialGaugeSeriesOptionsDef,
+ create: (ctx) => new RadialGaugeSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeyModule.ts
+var import_ag_charts_community272 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeries.ts
+var import_ag_charts_community270 = require("ag-charts-community");
+var import_ag_charts_core114 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeyLink.ts
+var import_ag_charts_community268 = require("ag-charts-community");
+var import_ag_charts_core113 = require("ag-charts-core");
+var { BBox: BBox25, Path: Path14, Vec2: Vec220, SceneChangeDetection: SceneChangeDetection10 } = import_ag_charts_community268._ModuleSupport;
+var SankeyLink = class extends Path14 {
+ constructor() {
+ super(...arguments);
+ this.x1 = 0;
+ this.x2 = 0;
+ this.y1 = 0;
+ this.y2 = 0;
+ this.height = 0;
+ this.inset = 0;
+ this.elbows = [];
+ }
+ computeBBox() {
+ const x = Math.min(this.x1, this.x2);
+ const width = Math.max(this.x1, this.x2) - x;
+ const y = Math.min(this.y1, this.y2);
+ const height = Math.max(this.y1, this.y2) - y + this.height;
+ return new BBox25(x, y, width, height);
+ }
+ updatePath() {
+ const { path, inset } = this;
+ path.clear();
+ const height = this.height - 2 * this.inset;
+ const offset = height / 2;
+ let x1 = this.x1 + inset;
+ let y1 = this.y1 + inset;
+ path.moveTo(x1, y1);
+ for (const elbow of this.elbows) {
+ this.updatePathSection(x1, y1, elbow.x, elbow.y, height, -offset);
+ x1 = elbow.x;
+ y1 = elbow.y;
+ }
+ const x2 = this.x2 - inset;
+ const y2 = this.y2 + inset;
+ this.updatePathSection(x1, y1, x2, y2, height, -offset);
+ path.lineTo(x2, y2 + height);
+ x1 = x2;
+ y1 = y2;
+ for (const elbow of this.elbows.toReversed()) {
+ this.updatePathSection(x1, y1, elbow.x, elbow.y, height, offset);
+ x1 = elbow.x;
+ y1 = elbow.y;
+ }
+ this.updatePathSection(x1, y1, this.x1 + inset, this.y1 + inset, height, offset);
+ path.closePath();
+ }
+ updatePathSection(x1, y1, x2, y2, height, yOffset) {
+ const { path } = this;
+ const start = Vec220.from(x1, y1 + yOffset + height / 2);
+ const end = Vec220.from(x2, y2 + yOffset + height / 2);
+ if (Math.abs(end.y - start.y) < 2) {
+ path.lineTo(end.x, end.y);
+ return;
+ }
+ let angle = Vec220.angle(Vec220.sub(end, start));
+ if (angle < 0)
+ angle = 2 * Math.PI + angle;
+ const right = 0;
+ const down = Math.PI / 2;
+ const left = Math.PI;
+ const up = Math.PI * 1.5;
+ const innerArc = getArcValues(start, end, 0);
+ const outerArc = getArcValues(start, end, height);
+ if (innerArc.radius < height) {
+ path.cubicCurveTo((start.x + end.x) / 2, start.y, (start.x + end.x) / 2, end.y, end.x, end.y);
+ return;
+ }
+ if (angle >= up) {
+ path.arc(start.x, y1 - innerArc.radius, innerArc.radius, down, down + outerArc.angle, true);
+ path.arc(end.x, y2 + outerArc.radius, outerArc.radius, up + outerArc.angle, up);
+ path.lineTo(end.x, end.y);
+ } else if (angle > right && angle <= down) {
+ path.arc(start.x, y1 + outerArc.radius, outerArc.radius, up, up + outerArc.angle);
+ path.arc(end.x, y2 - innerArc.radius, innerArc.radius, down + innerArc.angle, down, true);
+ path.lineTo(end.x, end.y);
+ } else if (angle > down && angle <= left) {
+ path.arc(start.x, y1 + outerArc.radius, outerArc.radius - height, up, up + outerArc.angle, true);
+ path.arc(end.x, y2 - innerArc.radius, innerArc.radius + height, down + innerArc.angle, down);
+ path.lineTo(end.x, end.y);
+ } else {
+ path.arc(start.x, y1 - innerArc.radius, innerArc.radius + height, down, down + innerArc.angle);
+ path.arc(end.x, y2 + outerArc.radius, outerArc.radius - height, up + outerArc.angle, up, true);
+ path.lineTo(end.x, end.y);
+ }
+ }
+};
+__decorateClass([
+ SceneChangeDetection10()
+], SankeyLink.prototype, "x1", 2);
+__decorateClass([
+ SceneChangeDetection10()
+], SankeyLink.prototype, "x2", 2);
+__decorateClass([
+ SceneChangeDetection10()
+], SankeyLink.prototype, "y1", 2);
+__decorateClass([
+ SceneChangeDetection10()
+], SankeyLink.prototype, "y2", 2);
+__decorateClass([
+ SceneChangeDetection10()
+], SankeyLink.prototype, "height", 2);
+__decorateClass([
+ SceneChangeDetection10()
+], SankeyLink.prototype, "inset", 2);
+function getArcValues(start, end, minRadius) {
+ const lineAngle = Vec220.angle(Vec220.sub(end, start));
+ const chordLength = Vec220.distance(start, end);
+ const bisect = Vec220.add(start, Vec220.rotate(Vec220.from(chordLength / 2, 0), lineAngle));
+ const gradient = -1 / Vec220.gradient(start, end);
+ const intercept = Vec220.intercept(bisect, gradient);
+ const offset = lerpClamp(0.1, 0.5, Math.PI / 2 - Math.abs(Vec220.gradient(start, end)));
+ const center = Vec220.intersectAtX(gradient, intercept, start.x);
+ const radius = Math.max(minRadius, Vec220.distance(start, center) * offset);
+ const angle = Vec220.angle(Vec220.sub(center, start), Vec220.sub(center, bisect)) / -(1.1 - offset);
+ return { angle, radius };
+}
+function lerpClamp(a, b, ratio3) {
+ return (0, import_ag_charts_core113.clamp)(a, (b - a) * ratio3 + a, b);
+}
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeriesProperties.ts
+var import_ag_charts_community269 = require("ag-charts-community");
+var {
+ BaseProperties: BaseProperties29,
+ FillGradientDefaults: FillGradientDefaults3,
+ FillPatternDefaults: FillPatternDefaults3,
+ FillImageDefaults: FillImageDefaults3,
+ makeSeriesTooltip: makeSeriesTooltip22,
+ SeriesProperties: SeriesProperties13,
+ Property: Property82,
+ Label: Label17
+} = import_ag_charts_community269._ModuleSupport;
+var SankeySeriesLabelProperties = class extends Label17 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.placement = void 0;
+ this.edgePlacement = void 0;
+ }
+};
+__decorateClass([
+ Property82
+], SankeySeriesLabelProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLabelProperties.prototype, "placement", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLabelProperties.prototype, "edgePlacement", 2);
+var SankeySeriesLinkProperties = class extends BaseProperties29 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "fill", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property82
+], SankeySeriesLinkProperties.prototype, "itemStyler", 2);
+var SankeySeriesNodeProperties = class extends BaseProperties29 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 1;
+ this.minSpacing = 0;
+ this.width = 1;
+ this.alignment = "justify";
+ this.verticalAlignment = "center";
+ this.sort = "auto";
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.stroke = void 0;
+ this.strokeOpacity = 1;
+ this.strokeWidth = 1;
+ this.lineDash = [0];
+ this.lineDashOffset = 0;
+ }
+};
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "spacing", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "minSpacing", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "width", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "alignment", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "verticalAlignment", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "sort", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "fill", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "stroke", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "lineDash", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "lineDashOffset", 2);
+__decorateClass([
+ Property82
+], SankeySeriesNodeProperties.prototype, "itemStyler", 2);
+var SankeySeriesProperties = class extends SeriesProperties13 {
+ constructor() {
+ super();
+ this.nodes = void 0;
+ this.idKey = "";
+ this.idName = void 0;
+ this.labelKey = void 0;
+ this.labelName = void 0;
+ this.sizeKey = void 0;
+ this.sizeName = void 0;
+ this.fillGradientDefaults = new FillGradientDefaults3();
+ this.fillPatternDefaults = new FillPatternDefaults3();
+ this.fillImageDefaults = new FillImageDefaults3();
+ this.defaultColorRange = [];
+ this.defaultPatternFills = [];
+ this.fills = [];
+ this.strokes = [];
+ this.label = new SankeySeriesLabelProperties();
+ this.link = new SankeySeriesLinkProperties();
+ this.node = new SankeySeriesNodeProperties();
+ this.tooltip = makeSeriesTooltip22();
+ this.highlightStyle.deprecated = false;
+ }
+ getStyle(isLink, fills, strokes, index) {
+ const {
+ fillOpacity,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset,
+ fill = fills[index % fills.length],
+ stroke: stroke2 = strokes[index % fills.length]
+ } = isLink ? this.link : this.node;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ lineDash,
+ lineDashOffset
+ };
+ }
+};
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "nodes", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "fromKey", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "toKey", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "idKey", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "idName", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "labelName", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "sizeKey", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "fillGradientDefaults", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "fillPatternDefaults", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "fillImageDefaults", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "defaultColorRange", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "defaultPatternFills", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "fills", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "strokes", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "link", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "node", 2);
+__decorateClass([
+ Property82
+], SankeySeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeries.ts
+var {
+ Transformable: Transformable3,
+ applyShapeStyle: applyShapeStyle18,
+ SeriesNodePickMode: SeriesNodePickMode16,
+ createDatumId: createDatumId20,
+ getShapeStyle: getShapeStyle2,
+ getLabelStyles: getLabelStyles6,
+ Rect: Rect8,
+ BBox: BBox26,
+ mergeDefaults: mergeDefaults20
+} = import_ag_charts_community270._ModuleSupport;
+var SankeySeries = class extends FlowProportionSeries {
+ constructor(moduleCtx) {
+ super({
+ moduleCtx,
+ pickModes: [SeriesNodePickMode16.NEAREST_NODE, SeriesNodePickMode16.EXACT_SHAPE_MATCH]
+ });
+ this.properties = new SankeySeriesProperties();
+ }
+ isLabelEnabled() {
+ return (this.properties.labelKey != null || this.nodes == null) && this.properties.label.enabled;
+ }
+ linkFactory() {
+ return new SankeyLink();
+ }
+ nodeFactory() {
+ return new Rect8();
+ }
+ createNodeData() {
+ const {
+ id: seriesId,
+ _nodeDataDependencies: { seriesRectWidth, seriesRectHeight } = { seriesRectWidth: 0, seriesRectHeight: 0 }
+ } = this;
+ const {
+ fromKey,
+ toKey,
+ sizeKey,
+ labelKey,
+ label: { spacing: labelSpacing, placement: labelPlacement, edgePlacement: edgeLabelPlacement },
+ node: { width: nodeWidth, alignment }
+ } = this.properties;
+ const createNode = (node) => ({
+ ...node,
+ x: Number.NaN,
+ y: Number.NaN,
+ width: nodeWidth,
+ height: Number.NaN
+ });
+ const createLink = (link) => ({
+ ...link,
+ x1: Number.NaN,
+ x2: Number.NaN,
+ y1: Number.NaN,
+ y2: Number.NaN,
+ height: Number.NaN,
+ elbows: []
+ });
+ const {
+ nodeGraph: baseNodeGraph,
+ links,
+ maxPathLength
+ } = this.getNodeGraph(createNode, createLink, { includeCircularReferences: false });
+ const nodeGraph = baseNodeGraph;
+ if (nodeGraph.size === 0)
+ return;
+ const columns = [];
+ for (let index = 0; index < maxPathLength; index += 1) {
+ columns.push({ index, size: 0, nodes: [], x: 0 });
+ }
+ for (const graphNode of nodeGraph.values()) {
+ const { datum: node, linksBefore, linksAfter, maxPathLengthBefore, maxPathLengthAfter } = graphNode;
+ const size = Math.max(
+ linksBefore.reduce((acc, { link }) => acc + link.size, 0),
+ linksAfter.reduce((acc, { link }) => acc + link.size, 0)
+ );
+ if (linksBefore.length === 0 && linksAfter.length === 0 || size === 0) {
+ graphNode.columnIndex = -1;
+ continue;
+ }
+ let column;
+ switch (alignment) {
+ case "left":
+ column = columns[maxPathLengthBefore];
+ break;
+ case "right":
+ column = columns[maxPathLength - 1 - maxPathLengthAfter];
+ break;
+ case "center": {
+ if (linksBefore.length !== 0) {
+ column = columns[maxPathLengthBefore];
+ } else if (linksAfter.length === 0) {
+ column = columns[0];
+ } else {
+ const columnIndex = linksAfter.reduce(
+ (acc, link) => Math.min(acc, link.node.maxPathLengthBefore),
+ maxPathLength
+ ) - 1;
+ column = columns[columnIndex];
+ }
+ break;
+ }
+ case "justify": {
+ column = linksAfter.length === 0 ? columns[maxPathLength - 1] : columns[maxPathLengthBefore];
+ break;
+ }
+ }
+ node.size = size;
+ const { label } = this.properties;
+ const labelText = label.enabled ? this.getLabelText(
+ node.label,
+ node.datum,
+ labelKey,
+ "label",
+ [],
+ this.properties.label,
+ { datum: node.datum, value: node.label, fromKey, toKey, sizeKey, size }
+ ) : void 0;
+ node.label = (0, import_ag_charts_core114.toPlainText)(labelText);
+ column.nodes.push(graphNode);
+ column.size += size;
+ graphNode.columnIndex = column.index;
+ }
+ const measurer2 = (0, import_ag_charts_core114.cachedTextMeasurer)(this.properties.label);
+ let columnLabelInsetBefore = 0;
+ let columnLabelInsetAfter = 0;
+ if (this.isLabelEnabled()) {
+ if (labelPlacement == null && edgeLabelPlacement == null) {
+ columnLabelInsetBefore = (seriesRectWidth - nodeWidth) * (1 - maxPathLength / (maxPathLength + 1));
+ columnLabelInsetAfter = columnLabelInsetBefore;
+ } else if (edgeLabelPlacement === "outside" || edgeLabelPlacement == null) {
+ const reduceLabelWidthFn = (acc, n) => {
+ const node = n;
+ if (node.datum.label == null || node.datum.label === "")
+ return acc;
+ let maxWidth = (seriesRectWidth - nodeWidth) / (maxPathLength - 1) - labelSpacing;
+ if (labelPlacement === "center" && edgeLabelPlacement == null)
+ maxWidth /= 2;
+ const text2 = (0, import_ag_charts_core114.wrapText)(node.datum.label, {
+ maxWidth,
+ maxHeight: node.datum.height,
+ font: this.properties.label,
+ textWrap: "never"
+ });
+ let { width } = measurer2.measureLines(text2);
+ if (labelPlacement === "center" && edgeLabelPlacement == null)
+ width /= 2;
+ return Math.max(acc, width);
+ };
+ if (labelPlacement !== "right" || edgeLabelPlacement === "outside") {
+ columnLabelInsetBefore = nodeWidth + columns[0].nodes.reduce(reduceLabelWidthFn, 0);
+ }
+ if (labelPlacement !== "left" || edgeLabelPlacement === "outside") {
+ columnLabelInsetAfter = nodeWidth + columns.at(-1).nodes.reduce(reduceLabelWidthFn, 0);
+ }
+ }
+ }
+ const columnWidth = (seriesRectWidth - nodeWidth - columnLabelInsetBefore - columnLabelInsetAfter) / (maxPathLength - 1);
+ for (let index = 0; index < columns.length; index++) {
+ const column = columns[index];
+ column.x = columnLabelInsetBefore + index * columnWidth;
+ for (const graphNode of column.nodes) {
+ graphNode.datum.x = column.x;
+ }
+ }
+ for (const graphNode of nodeGraph.values()) {
+ graphNode.weight = 0;
+ let closestColumnDiff = Infinity;
+ for (const link of graphNode.linksAfter) {
+ const node = link.node;
+ closestColumnDiff = Math.min(closestColumnDiff, node.columnIndex - graphNode.columnIndex);
+ }
+ if (closestColumnDiff === Infinity) {
+ for (const link of graphNode.linksBefore) {
+ const node = link.node;
+ closestColumnDiff = Math.min(closestColumnDiff, graphNode.columnIndex - node.columnIndex);
+ }
+ }
+ graphNode.closestColumnDiff = closestColumnDiff;
+ for (const link of graphNode.linksAfter) {
+ const node = link.node;
+ if (node.columnIndex <= graphNode.columnIndex)
+ continue;
+ for (let i = node.columnIndex - 1; i > graphNode.columnIndex; i--) {
+ const size = link.link.size;
+ const ghostNode = {
+ ghost: true,
+ datum: { ...graphNode.datum, size, y: 0, height: 0 },
+ weight: 0,
+ linksBefore: [{ node: { columnIndex: i - 1, datum: { size } } }],
+ linksAfter: [{ node: { columnIndex: i + 1, datum: { size } } }],
+ link: link.link,
+ columnIndex: graphNode.columnIndex,
+ size: graphNode.datum.size,
+ closestColumnDiff,
+ fromNode: { y: node.datum.y },
+ toNode: { y: 0 }
+ };
+ columns[i].size += size;
+ columns[i].nodes.push(ghostNode);
+ }
+ }
+ }
+ const sortedColumns = columns.toSorted((a, b) => {
+ const aMax = a.nodes.reduce((acc, n) => Math.max(acc, n.datum.size), 0);
+ const bMax = b.nodes.reduce((acc, n) => Math.max(acc, n.datum.size), 0);
+ return bMax - aMax;
+ });
+ const columnWeights = {};
+ for (let i = 0; i < sortedColumns.length; i++) {
+ columnWeights[sortedColumns[i].index] = Math.pow(10, sortedColumns.length - i - 1);
+ }
+ for (const column of columns) {
+ for (const node of column.nodes) {
+ node.weight = node.datum.size / column.size * columnWeights[column.index];
+ if ("ghost" in node && node.ghost) {
+ node.weight = node.size / column.size * columnWeights[column.index];
+ continue;
+ }
+ node.weight += node.linksBefore.reduce((acc, before) => {
+ if (before.node.columnIndex !== column.index - 1)
+ return acc;
+ const weight = before.node.datum.size / columns[before.node.columnIndex].size * columnWeights[before.node.columnIndex];
+ return Math.max(acc, weight);
+ }, 0);
+ node.weight += node.linksAfter.reduce((acc, after) => {
+ if (after.node.columnIndex !== column.index + 1)
+ return acc;
+ const weight = after.node.datum.size / columns[after.node.columnIndex].size * columnWeights[after.node.columnIndex];
+ return Math.max(acc, weight);
+ }, 0);
+ }
+ column.nodes.sort((a, b) => this.sortNodes(a, b));
+ }
+ const minSize = 1;
+ const getSizeScale = (spacing) => {
+ return columns.reduce((acc, { size, nodes }) => {
+ const spacingAccomodation = seriesRectHeight - nodes.length * minSize;
+ const spacingOccupation = (nodes.length - 1) * spacing / spacingAccomodation;
+ const columnSizeScale = (1 - spacingOccupation) / size;
+ return Math.min(acc, columnSizeScale);
+ }, Infinity);
+ };
+ let nodeSpacing = this.properties.node.spacing;
+ let sizeScale = getSizeScale(nodeSpacing);
+ while (sizeScale < 0 && nodeSpacing > this.properties.node.minSpacing) {
+ nodeSpacing -= 1;
+ sizeScale = getSizeScale(nodeSpacing);
+ }
+ if (sizeScale < 0) {
+ import_ag_charts_core114.Logger.warnOnce(
+ "There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container."
+ );
+ return;
+ }
+ for (const column of columns) {
+ let columnNodesHeight = 0;
+ for (const node of column.nodes) {
+ const height = seriesRectHeight * node.datum.size * sizeScale;
+ node.datum.height = Math.max(minSize, height);
+ columnNodesHeight += height;
+ }
+ const spacingOccupation = nodeSpacing * (column.nodes.length - 1);
+ let y = 0;
+ if (this.properties.node.verticalAlignment === "bottom") {
+ y = seriesRectHeight - columnNodesHeight - spacingOccupation;
+ } else if (this.properties.node.verticalAlignment === "center") {
+ y = (seriesRectHeight - columnNodesHeight - spacingOccupation) / 2;
+ }
+ for (const node of column.nodes) {
+ node.datum.y = y;
+ y += seriesRectHeight * node.datum.size * sizeScale + nodeSpacing;
+ if ("ghost" in node && node.ghost) {
+ node.link.elbows.push({ x: column.x, y: node.datum.y });
+ }
+ }
+ }
+ for (const { datum, linksBefore, linksAfter } of nodeGraph.values()) {
+ let y2 = datum.y;
+ linksBefore.sort(
+ (a, b) => this.sortNodes(a.node, b.node)
+ );
+ for (const { link } of linksBefore) {
+ link.y2 = y2;
+ y2 += link.size * seriesRectHeight * sizeScale;
+ }
+ let y1 = datum.y;
+ linksAfter.sort(
+ (a, b) => this.sortNodes(a.node, b.node, {
+ invertColumnSort: true
+ })
+ );
+ for (const { link } of linksAfter) {
+ link.y1 = y1;
+ y1 += link.size * seriesRectHeight * sizeScale;
+ }
+ }
+ const nodeData = [];
+ const labelData = [];
+ const { fontSize } = this.properties.label;
+ for (const [index, column] of columns.entries()) {
+ const leading = index === 0;
+ const trailing = index === columns.length - 1;
+ let bottom = -Infinity;
+ column.nodes.sort((a, b) => a.datum.y - b.datum.y);
+ for (const n of column.nodes) {
+ if ("ghost" in n && n.ghost)
+ continue;
+ const { datum: node } = n;
+ node.midPoint = {
+ x: node.x + node.width / 2,
+ y: node.y + node.height / 2
+ };
+ nodeData.push(node);
+ if (node.label == null)
+ continue;
+ const y = node.y + node.height / 2;
+ let text2;
+ if (!leading && !trailing) {
+ const lineHeight = (0, import_ag_charts_core114.calcLineHeight)(fontSize);
+ const y12 = y - lineHeight;
+ const y2 = y + lineHeight;
+ let maxX = seriesRectWidth;
+ for (const { datum } of nodeGraph.values()) {
+ const intersectsLabel = datum.x > node.x && Math.max(datum.y, y12) <= Math.min(datum.y + datum.height, y2);
+ if (intersectsLabel) {
+ maxX = Math.min(maxX, datum.x - labelSpacing);
+ }
+ }
+ const maxWidth = maxX - node.x - 2 * labelSpacing;
+ text2 = (0, import_ag_charts_core114.wrapText)(node.label, {
+ maxWidth,
+ maxHeight: node.height,
+ font: this.properties.label,
+ textWrap: "never",
+ overflow: "hide"
+ });
+ }
+ if (text2 == null || text2 === "") {
+ const labelInset = edgeLabelPlacement == null && (leading || trailing) ? labelSpacing : labelSpacing * 2;
+ text2 = (0, import_ag_charts_core114.wrapText)(node.label, {
+ maxWidth: columnWidth - labelInset,
+ maxHeight: node.height,
+ font: this.properties.label,
+ textWrap: "never"
+ });
+ }
+ if (text2 === "")
+ continue;
+ const { height } = measurer2.measureLines(text2);
+ const y0 = y - height / 2;
+ const y1 = y + height / 2;
+ let x = node.x + node.width + labelSpacing;
+ let textAlign = "left";
+ let placement = labelPlacement;
+ if (leading && edgeLabelPlacement == null && labelPlacement == null) {
+ placement = "left";
+ }
+ if (edgeLabelPlacement === "outside") {
+ if (leading)
+ placement = "left";
+ if (trailing)
+ placement = "right";
+ } else if (edgeLabelPlacement === "inside") {
+ if (leading)
+ placement = "right";
+ if (trailing)
+ placement = "left";
+ }
+ if (placement === "left") {
+ x = node.x - labelSpacing;
+ textAlign = "right";
+ } else if (placement === "center") {
+ x = node.x + node.width / 2;
+ textAlign = "center";
+ }
+ if (y0 >= bottom) {
+ labelData.push({ x, y, textAlign, text: text2, size: node.size });
+ bottom = y1;
+ }
+ }
+ }
+ for (const link of links) {
+ const { fromNode, toNode, size } = link;
+ link.height = Math.max(minSize, seriesRectHeight * size * sizeScale);
+ link.x1 = fromNode.x + nodeWidth;
+ link.x2 = toNode.x;
+ link.midPoint = {
+ x: (link.x1 + link.x2) / 2,
+ y: (link.y1 + link.y2) / 2 + link.height / 2
+ };
+ nodeData.push(link);
+ }
+ return {
+ itemId: seriesId,
+ nodeData,
+ labelData
+ };
+ }
+ sortNodes(a, b, opts) {
+ const { properties } = this;
+ if (properties.node.sort === "ascending") {
+ return (a.datum.label ?? "").localeCompare(b.datum.label ?? "");
+ } else if (properties.node.sort === "descending") {
+ return (b.datum.label ?? "").localeCompare(a.datum.label ?? "");
+ } else if (properties.node.sort === "data") {
+ return 0;
+ }
+ if (a.columnIndex < b.columnIndex)
+ return opts?.invertColumnSort ? 1 : -1;
+ if (a.columnIndex > b.columnIndex)
+ return opts?.invertColumnSort ? -1 : 1;
+ if (a.weight === b.weight) {
+ return a.datum.size - b.datum.size;
+ }
+ if (a.closestColumnDiff < b.closestColumnDiff)
+ return 1;
+ if (a.closestColumnDiff > b.closestColumnDiff)
+ return -1;
+ return a.weight - b.weight;
+ }
+ updateLabelSelection(opts) {
+ const labels = this.isLabelEnabled() ? opts.labelData : [];
+ return opts.labelSelection.update(labels);
+ }
+ updateLabelNodes(opts) {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ opts.labelSelection.each((label, datum) => {
+ const { x, y, textAlign, text: text2 } = datum;
+ const params = datum;
+ const style = getLabelStyles6(this, void 0, params, this.properties.label, false, activeHighlight);
+ const { color: fill, fontStyle, fontWeight, fontSize, fontFamily } = style;
+ label.visible = true;
+ label.x = x;
+ label.y = y;
+ label.text = text2;
+ label.fill = fill;
+ label.fontStyle = fontStyle;
+ label.fontWeight = fontWeight;
+ label.fontSize = fontSize;
+ label.fontFamily = fontFamily;
+ label.textAlign = textAlign;
+ label.textBaseline = "middle";
+ label.setBoxing(style);
+ });
+ }
+ updateNodeSelection(opts) {
+ return opts.datumSelection.update(opts.nodeData, void 0, (datum) => createDatumId20(datum.type, datum.id));
+ }
+ getNodeStyle(nodeDatum, fromNodeDatumIndex, isHighlight) {
+ const { properties } = this;
+ const {
+ fills,
+ strokes,
+ defaultColorRange,
+ defaultPatternFills,
+ fillGradientDefaults: fillGradientDefaults3,
+ fillPatternDefaults: fillPatternDefaults3,
+ fillImageDefaults: fillImageDefaults3
+ } = properties;
+ const { itemStyler } = properties.node;
+ const defaultColorStops = defaultColorRange[fromNodeDatumIndex % defaultColorRange.length].map((color6) => ({
+ color: color6
+ }));
+ const defaultPatternFill = defaultPatternFills[fromNodeDatumIndex % defaultPatternFills.length];
+ const highlightStyle = this.getHighlightStyle(isHighlight, nodeDatum.datumIndex);
+ const baseStyle = mergeDefaults20(highlightStyle, properties.getStyle(false, fills, strokes, fromNodeDatumIndex));
+ const hasNodeFill = properties.node.fill != null;
+ let style = getShapeStyle2(
+ baseStyle,
+ hasNodeFill ? fillGradientDefaults3 : { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ hasNodeFill ? fillPatternDefaults3 : { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ if (itemStyler != null && nodeDatum.datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId20(nodeDatum.datumIndex.index, "node", isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults20(
+ overrides,
+ style,
+ { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ makeItemStylerParams({ datum, datumIndex, size = 0, label }, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ size,
+ label,
+ fill
+ };
+ }
+ updateNodeNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((rect, datum) => {
+ const { datumIndex } = datum;
+ const style = this.getNodeStyle(datum, datumIndex.index, isHighlight);
+ rect.x = datum.x;
+ rect.y = datum.y;
+ rect.width = Math.max(datum.width, 0);
+ rect.height = Math.max(datum.height, 0);
+ applyShapeStyle18(rect, style, fillBBox);
+ });
+ }
+ getShapeFillBBox() {
+ const width = this._nodeDataDependencies?.seriesRectWidth ?? 0;
+ const height = this._nodeDataDependencies?.seriesRectHeight ?? 0;
+ const bbox = new BBox26(0, 0, width, height);
+ return { series: bbox, axis: bbox };
+ }
+ updateLinkSelection(opts) {
+ return opts.datumSelection.update(
+ opts.nodeData,
+ void 0,
+ (datum) => createDatumId20(datum.type, datum.index, datum.fromNode.id, datum.toNode.id)
+ );
+ }
+ getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, isHighlight) {
+ const { id: seriesId, properties } = this;
+ const {
+ fills,
+ strokes,
+ defaultColorRange,
+ defaultPatternFills,
+ fillGradientDefaults: fillGradientDefaults3,
+ fillPatternDefaults: fillPatternDefaults3,
+ fillImageDefaults: fillImageDefaults3
+ } = properties;
+ const { itemStyler } = properties.link;
+ const defaultColorStops = defaultColorRange[fromNodeDatumIndex.index % defaultColorRange.length].map(
+ (color6) => ({
+ color: color6
+ })
+ );
+ const defaultPatternFill = defaultPatternFills[fromNodeDatumIndex.index % defaultPatternFills.length];
+ const highlightStyle = this.getHighlightStyle(isHighlight, datumIndex);
+ const baseStyle = mergeDefaults20(
+ highlightStyle,
+ properties.getStyle(true, fills, strokes, fromNodeDatumIndex.index)
+ );
+ const hasLinkFill = properties.link.fill != null;
+ let style = getShapeStyle2(
+ baseStyle,
+ hasLinkFill ? fillGradientDefaults3 : { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ hasLinkFill ? fillPatternDefaults3 : { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ if (itemStyler != null && datumIndex != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId20(datumIndex.index, "link", isHighlight ? "highlight" : "node"),
+ () => {
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, datumIndex);
+ return this.callWithContext(itemStyler, {
+ seriesId,
+ datum,
+ highlighted: isHighlight,
+ highlightState,
+ ...style
+ });
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults20(
+ overrides,
+ style,
+ { ...fillGradientDefaults3.toJson(), colorStops: defaultColorStops },
+ { ...fillPatternDefaults3.toJson(), fill: defaultPatternFill, stroke: defaultPatternFill },
+ fillImageDefaults3
+ );
+ }
+ }
+ style.opacity = 1;
+ return style;
+ }
+ updateLinkNodes(opts) {
+ const { datumSelection, isHighlight } = opts;
+ const fillBBox = this.getShapeFillBBox();
+ datumSelection.each((link, datum) => {
+ const fromNodeDatumIndex = datum.fromNode.datumIndex;
+ const style = this.getLinkStyle(datum, fromNodeDatumIndex, isHighlight);
+ link.x1 = datum.x1;
+ link.y1 = datum.y1;
+ link.x2 = datum.x2;
+ link.y2 = datum.y2;
+ link.height = datum.height;
+ link.elbows = datum.elbows;
+ applyShapeStyle18(link, style, fillBBox);
+ link.inset = link.strokeWidth / 2;
+ });
+ }
+ getTooltipContent(datumIndex) {
+ const {
+ id: seriesId,
+ linksProcessedData,
+ nodesProcessedData,
+ properties,
+ ctx: { formatManager }
+ } = this;
+ const { fromKey, toKey, sizeKey, sizeName, tooltip } = properties;
+ const seriesDatum = this.contextNodeData?.nodeData.find(
+ (d) => d.datumIndex.type === datumIndex.type && d.datumIndex.index === datumIndex.index
+ );
+ if (seriesDatum == null)
+ return;
+ const nodeIndex = seriesDatum.type === 0 /* Link */ ? seriesDatum.fromNode.index : seriesDatum.index;
+ const title = seriesDatum.type === 0 /* Link */ ? `${seriesDatum.fromNode.label} - ${seriesDatum.toNode.label}` : seriesDatum.label;
+ const datum = datumIndex.type === 0 /* Link */ ? linksProcessedData?.dataSources.get(this.id)?.data[datumIndex.index] : nodesProcessedData?.dataSources.get(this.id)?.data[datumIndex.index];
+ const size = seriesDatum.size;
+ let format;
+ if (seriesDatum.type === 0 /* Link */) {
+ const fromNodeDatumIndex = seriesDatum.fromNode.datumIndex;
+ format = this.getLinkStyle({ datumIndex, datum }, fromNodeDatumIndex, false);
+ } else {
+ format = this.getNodeStyle({ datumIndex, datum }, datumIndex.index, false);
+ }
+ const data = [];
+ if (sizeKey != null) {
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: size,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ domain: [],
+ boundSeries: this.getFormatterContext("size"),
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? String(size) });
+ }
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title,
+ symbol: this.legendItemSymbol(seriesDatum.type, nodeIndex, format),
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title,
+ fromKey,
+ toKey,
+ sizeKey,
+ sizeName,
+ size,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(node) {
+ if (node instanceof Rect8) {
+ const { x, y, width, height } = node;
+ const bbox = new BBox26(x, y, width, height);
+ return Transformable3.toCanvas(this.contentGroup, bbox);
+ }
+ return node;
+ }
+ hasItemStylers() {
+ return this.properties.node.itemStyler != null || this.properties.link.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+SankeySeries.className = "SankeySeries";
+SankeySeries.type = "sankey";
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeySeriesOptionsDef.ts
+var import_ag_charts_community271 = require("ag-charts-community");
+var import_ag_charts_core115 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs21, sankeySeriesThemeableOptionsDef } = import_ag_charts_community271._ModuleSupport;
+var sankeySeriesOptionsDef = {
+ ...sankeySeriesThemeableOptionsDef,
+ ...commonSeriesOptionsDefs21,
+ type: (0, import_ag_charts_core115.required)((0, import_ag_charts_core115.constant)("sankey")),
+ fromKey: (0, import_ag_charts_core115.required)(import_ag_charts_core115.string),
+ toKey: (0, import_ag_charts_core115.required)(import_ag_charts_core115.string),
+ sizeKey: import_ag_charts_core115.string,
+ sizeName: import_ag_charts_core115.string
+};
+sankeySeriesOptionsDef.fillGradientDefaults = (0, import_ag_charts_core115.undocumented)(import_ag_charts_core115.fillGradientDefaults);
+sankeySeriesOptionsDef.fillPatternDefaults = (0, import_ag_charts_core115.undocumented)(import_ag_charts_core115.fillPatternDefaults);
+sankeySeriesOptionsDef.fillImageDefaults = (0, import_ag_charts_core115.undocumented)(import_ag_charts_core115.fillImageDefaults);
+sankeySeriesOptionsDef.defaultColorRange = (0, import_ag_charts_core115.undocumented)((0, import_ag_charts_core115.arrayOf)((0, import_ag_charts_core115.arrayOf)(import_ag_charts_core115.color)));
+sankeySeriesOptionsDef.defaultPatternFills = (0, import_ag_charts_core115.undocumented)((0, import_ag_charts_core115.arrayOf)(import_ag_charts_core115.color));
+
+// packages/ag-charts-enterprise/src/series/sankey/sankeyModule.ts
+var SankeyModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ solo: true,
+ identifier: "sankey",
+ moduleFactory: (ctx) => new SankeySeries(ctx),
+ themeTemplate: {
+ seriesArea: {
+ padding: {
+ top: 10,
+ bottom: 10
+ }
+ },
+ series: {
+ fills: { $palette: "fills" },
+ strokes: { $palette: "strokes" },
+ // @ts-expect-error undocumented option
+ fillGradientDefaults: import_ag_charts_community272._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS,
+ fillPatternDefaults: import_ag_charts_community272._ModuleSupport.FILL_PATTERN_DEFAULTS,
+ fillImageDefaults: import_ag_charts_community272._ModuleSupport.FILL_IMAGE_DEFAULTS,
+ defaultColorRange: { $palette: "gradients" },
+ defaultPatternFills: import_ag_charts_community272._ModuleSupport.SAFE_FILLS_OPERATION,
+ highlightStyle: {
+ series: {
+ dimOpacity: 0.2
+ }
+ },
+ highlight: {
+ ...import_ag_charts_community272._ModuleSupport.singleSeriesHighlightStyle()
+ },
+ label: {
+ ...import_ag_charts_community272._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $ref: "fontSize" },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "textColor" },
+ spacing: 10
+ },
+ node: {
+ spacing: { $if: [{ $greaterThan: [{ $path: "./minSpacing" }, 20] }, { $path: "./minSpacing" }, 20] },
+ minSpacing: 0,
+ width: 10,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ },
+ link: {
+ fillOpacity: 0.5,
+ strokeWidth: { $isUserOption: ["./stroke", 2, 0] }
+ }
+ },
+ legend: {
+ enabled: false,
+ toggleSeries: false
+ }
+ }
+};
+var SankeySeriesModule = {
+ type: "series",
+ name: "sankey",
+ chartType: "standalone",
+ enterprise: true,
+ options: sankeySeriesOptionsDef,
+ create: (ctx) => new SankeySeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstModule.ts
+var import_ag_charts_community276 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeries.ts
+var import_ag_charts_community274 = require("ag-charts-community");
+var import_ag_charts_core116 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeriesProperties.ts
+var import_ag_charts_community273 = require("ag-charts-community");
+var { HierarchySeriesProperties, HighlightStyle, makeSeriesTooltip: makeSeriesTooltip23, Property: Property83 } = import_ag_charts_community273._ModuleSupport;
+var SunburstSeriesTileHighlightStyle = class extends HighlightStyle {
+ constructor() {
+ super(false);
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedLabel();
+ }
+};
+__decorateClass([
+ Property83
+], SunburstSeriesTileHighlightStyle.prototype, "fill", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesTileHighlightStyle.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesTileHighlightStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesTileHighlightStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesTileHighlightStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesTileHighlightStyle.prototype, "label", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesTileHighlightStyle.prototype, "secondaryLabel", 2);
+var SunburstSeriesProperties = class extends HierarchySeriesProperties {
+ constructor() {
+ super(...arguments);
+ this.fillOpacity = 1;
+ this.strokeWidth = 0;
+ this.strokeOpacity = 1;
+ this.cornerRadius = 0;
+ this.highlightStyle = new SunburstSeriesTileHighlightStyle();
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedSecondaryLabel();
+ this.tooltip = makeSeriesTooltip23();
+ }
+ getStyle(index) {
+ const { fills, strokes, fillOpacity, strokeWidth, strokeOpacity } = this;
+ return {
+ fill: fills[index % fills.length],
+ fillOpacity,
+ stroke: strokes[index % strokes.length],
+ strokeWidth,
+ strokeOpacity,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "secondaryLabelKey", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "sectorSpacing", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "padding", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "highlightStyle", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "label", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "secondaryLabel", 2);
+__decorateClass([
+ Property83
+], SunburstSeriesProperties.prototype, "tooltip", 2);
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeries.ts
+var {
+ fromToMotion: fromToMotion6,
+ normalizeAngle360: normalizeAngle3608,
+ createDatumId: createDatumId21,
+ PointerEvents: PointerEvents13,
+ Sector: Sector7,
+ Group: Group20,
+ ScalableGroup,
+ Selection: Selection17,
+ TransformableText: TransformableText3,
+ BBox: BBox27,
+ applyShapeStyle: applyShapeStyle19,
+ mergeDefaults: mergeDefaults21,
+ formatValue: formatValue2,
+ getLabelStyles: getLabelStyles7
+} = import_ag_charts_community274._ModuleSupport;
+var SunburstNode = class extends import_ag_charts_community274._ModuleSupport.HierarchyNode {
+ constructor() {
+ super(...arguments);
+ this.label = void 0;
+ this.secondaryLabel = void 0;
+ this.contentHeight = 0;
+ this.bbox = void 0;
+ // cspell:ignore bbox
+ this.startAngle = 0;
+ this.endAngle = 0;
+ }
+};
+function setAngleData(node, startAngle = 0, angleScale = 2 * Math.PI / node.sumSize) {
+ for (const child of node.children) {
+ const endAngle = startAngle + child.sumSize * angleScale;
+ child.startAngle = startAngle;
+ child.endAngle = endAngle;
+ setAngleData(child, startAngle, angleScale);
+ startAngle = endAngle;
+ }
+}
+var SunburstSeries = class extends import_ag_charts_community274._ModuleSupport.HierarchySeries {
+ constructor(moduleCtx) {
+ super(moduleCtx);
+ this.NodeClass = SunburstNode;
+ this.properties = new SunburstSeriesProperties();
+ this.scalingGroup = this.contentGroup.appendChild(new ScalableGroup());
+ this.sectorGroup = this.scalingGroup.appendChild(new Group20());
+ this.sectorLabelGroup = this.scalingGroup.appendChild(new Group20());
+ this.highlightSectorGroup = this.scalingGroup.appendChild(new Group20());
+ this.datumSelection = Selection17.select(this.sectorGroup, Sector7);
+ this.labelSelection = Selection17.select(
+ this.sectorLabelGroup,
+ Group20
+ );
+ this.highlightSelection = Selection17.select(
+ this.highlightSectorGroup,
+ Sector7
+ );
+ this.sectorLabelGroup.pointerEvents = PointerEvents13.None;
+ }
+ processData() {
+ super.processData();
+ setAngleData(this.rootNode);
+ }
+ updateSelections() {
+ const highlightedNode = this.ctx.highlightManager?.getActiveHighlight();
+ this.highlightSelection.update(
+ highlightedNode == null ? [] : [highlightedNode],
+ void 0,
+ (node) => this.getDatumId(node)
+ );
+ if (!this.nodeDataRefresh)
+ return;
+ this.nodeDataRefresh = false;
+ const { chart } = this;
+ if (chart == null)
+ return;
+ const seriesRect = chart.seriesRect;
+ if (seriesRect == null)
+ return;
+ const descendants = Array.from(this.rootNode);
+ const updateLabelGroup = (group) => {
+ group.append([
+ new TransformableText3({ tag: 0 /* Primary */ }),
+ new TransformableText3({ tag: 1 /* Secondary */ })
+ ]);
+ };
+ this.datumSelection.update(descendants, void 0, (node) => this.getDatumId(node));
+ this.labelSelection.update(descendants, updateLabelGroup, (node) => this.getDatumId(node));
+ }
+ getItemStyle(nodeDatum, isHighlight) {
+ const { properties, colorScale } = this;
+ const { itemStyler } = properties;
+ const rootIndex = nodeDatum.datumIndex?.[0] ?? 0;
+ const highlightStyle = isHighlight ? properties.highlightStyle : void 0;
+ const baseStyle = mergeDefaults21(highlightStyle, properties.getStyle(rootIndex));
+ if (!isHighlight && nodeDatum.colorValue != null) {
+ baseStyle.fill = colorScale.convert(nodeDatum.colorValue);
+ }
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId21(this.getDatumId(nodeDatum), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults21(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(nodeDatum, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum: nodeDatum.datum,
+ depth: nodeDatum.depth ?? 0,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateNodes() {
+ const { chart, data, maxDepth } = this;
+ if (chart == null || data == null) {
+ return;
+ }
+ const { width, height } = chart.seriesRect;
+ const {
+ sectorSpacing = 0,
+ padding = 0,
+ cornerRadius,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName
+ } = this.properties;
+ this.contentGroup.translationX = width / 2;
+ this.contentGroup.translationY = height / 2;
+ const baseInset = sectorSpacing * 0.5;
+ const radius = Math.min(width, height) / 2;
+ const radiusScale = radius / (maxDepth + 1);
+ const angleOffset = -Math.PI / 2;
+ const seriesFillBBox = {
+ series: new BBox27(-radius, -radius, 2 * radius, 2 * radius),
+ axis: new BBox27(-radius, -radius, 2 * radius, 2 * radius)
+ };
+ this.rootNode?.walk((node) => {
+ const { startAngle, endAngle } = node;
+ if (node.depth != null) {
+ const midAngle = (startAngle + endAngle) / 2 + angleOffset;
+ const midRadius = (node.depth + 0.5) * radiusScale;
+ node.midPoint.x = Math.cos(midAngle) * midRadius;
+ node.midPoint.y = Math.sin(midAngle) * midRadius;
+ }
+ });
+ this.rootNode?.walk((node) => {
+ const { datum, depth, startAngle, endAngle, parent, sumSize } = node;
+ node.label = void 0;
+ node.secondaryLabel = void 0;
+ node.contentHeight = 0;
+ let labelValue;
+ if (datum != null && depth != null && labelKey != null) {
+ const value = datum[labelKey];
+ labelValue = this.getLabelText(
+ value,
+ datum,
+ labelKey,
+ "label",
+ [],
+ this.properties.label,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (labelValue === "") {
+ labelValue = void 0;
+ }
+ let secondaryLabelValue;
+ if (datum != null && depth != null && secondaryLabelKey != null) {
+ const value = datum[secondaryLabelKey];
+ secondaryLabelValue = this.getLabelText(
+ value,
+ datum,
+ secondaryLabelKey,
+ "secondaryLabel",
+ [],
+ this.properties.secondaryLabel,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (secondaryLabelValue === "") {
+ secondaryLabelValue = void 0;
+ }
+ if (depth == null)
+ return;
+ const innerRadius = depth * radiusScale + baseInset;
+ const outerRadius = (depth + 1) * radiusScale - baseInset;
+ const innerAngleOffset = innerRadius > baseInset ? baseInset / innerRadius : baseInset;
+ const outerAngleOffset = outerRadius > baseInset ? baseInset / outerRadius : baseInset;
+ const innerStartAngle = startAngle + innerAngleOffset;
+ const innerEndAngle = endAngle + innerAngleOffset;
+ const deltaInnerAngle = innerEndAngle - innerStartAngle;
+ const outerStartAngle = startAngle + outerAngleOffset;
+ const outerEndAngle = endAngle + outerAngleOffset;
+ const deltaOuterAngle = outerEndAngle - outerStartAngle;
+ const sizeFittingHeight = (labelHeight2) => {
+ const isCenterCircle = depth === 0 && parent?.sumSize === sumSize;
+ if (isCenterCircle) {
+ const labelWidth2 = 2 * Math.sqrt(outerRadius ** 2 - (labelHeight2 * 0.5) ** 2);
+ return { width: labelWidth2, height: labelHeight2, meta: 0 /* CenterCircle */ };
+ }
+ const parallelHeight = labelHeight2;
+ const availableWidthUntilItHitsTheOuterRadius = 2 * Math.sqrt(outerRadius ** 2 - (innerRadius + parallelHeight) ** 2);
+ const availableWidthUntilItHitsTheStraightEdges = deltaInnerAngle < Math.PI ? 2 * innerRadius * Math.tan(deltaInnerAngle * 0.5) : Infinity;
+ const parallelWidth = Math.min(
+ availableWidthUntilItHitsTheOuterRadius,
+ availableWidthUntilItHitsTheStraightEdges
+ );
+ const maxPerpendicularAngle = Math.PI / 4;
+ let perpendicularHeight;
+ let perpendicularWidth;
+ if (depth === 0) {
+ perpendicularHeight = labelHeight2;
+ perpendicularWidth = Math.sqrt(outerRadius ** 2 - (perpendicularHeight / 2) ** 2) - labelHeight2 / (2 * Math.tan(deltaOuterAngle * 0.5));
+ } else if (normalizeAngle3608(deltaInnerAngle) < maxPerpendicularAngle) {
+ perpendicularHeight = 2 * innerRadius * Math.tan(deltaInnerAngle * 0.5);
+ perpendicularWidth = Math.sqrt(outerRadius ** 2 - (perpendicularHeight / 2) ** 2) - innerRadius;
+ } else {
+ perpendicularWidth = 0;
+ perpendicularHeight = 0;
+ }
+ return parallelWidth >= perpendicularWidth ? { width: parallelWidth, height: parallelHeight, meta: 1 /* Parallel */ } : { width: perpendicularWidth, height: perpendicularHeight, meta: 2 /* Perpendicular */ };
+ };
+ const formatting = formatLabels(
+ (0, import_ag_charts_core116.toPlainText)(labelValue),
+ this.properties.label,
+ (0, import_ag_charts_core116.toPlainText)(secondaryLabelValue),
+ this.properties.secondaryLabel,
+ { padding },
+ sizeFittingHeight
+ );
+ if (formatting == null)
+ return;
+ const { width: labelWidth, height: labelHeight, meta: labelPlacement, label, secondaryLabel } = formatting;
+ const theta = angleOffset + (startAngle + endAngle) / 2;
+ const top = Math.sin(theta) >= 0;
+ const right = Math.cos(theta) >= 0;
+ const circleQuarter = (top ? 3 /* Top */ : 12 /* Bottom */) & (right ? 6 /* Right */ : 9 /* Left */);
+ let labelRadius;
+ switch (labelPlacement) {
+ case 0 /* CenterCircle */:
+ labelRadius = 0;
+ break;
+ case 1 /* Parallel */: {
+ const opticalCentering = 0.58;
+ const idealRadius = outerRadius - (radiusScale - labelHeight) * opticalCentering;
+ const maximumRadius = Math.sqrt((outerRadius - padding) ** 2 - (labelWidth / 2) ** 2);
+ labelRadius = Math.min(idealRadius, maximumRadius);
+ break;
+ }
+ case 2 /* Perpendicular */:
+ if (depth === 0) {
+ const minimumRadius = labelHeight / (2 * Math.tan(deltaInnerAngle * 0.5)) + labelWidth * 0.5;
+ const maximumRadius = Math.sqrt(outerRadius ** 2 - (labelHeight * 0.5) ** 2) - labelWidth * 0.5;
+ labelRadius = (minimumRadius + maximumRadius) * 0.5;
+ } else {
+ labelRadius = (innerRadius + outerRadius) * 0.5;
+ }
+ break;
+ }
+ if (label != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.label;
+ node.label = {
+ ...label,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ labelPlacement,
+ circleQuarter,
+ radius: labelRadius,
+ theta
+ };
+ }
+ if (secondaryLabel != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.secondaryLabel;
+ node.secondaryLabel = {
+ ...secondaryLabel,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ labelPlacement,
+ circleQuarter,
+ radius: labelRadius,
+ theta
+ };
+ }
+ node.contentHeight = formatting.height;
+ });
+ const updateSector = (nodeDatum, sector, highlighted) => {
+ const { depth, startAngle, endAngle } = nodeDatum;
+ if (depth == null) {
+ sector.visible = false;
+ return;
+ }
+ sector.visible = true;
+ const style = this.getItemStyle(nodeDatum, highlighted);
+ const fill = style.fill;
+ const strokeWidth = style.strokeWidth;
+ const fillBBox = import_ag_charts_community274._ModuleSupport.isGradientFill(fill) && fill.bounds !== "item" ? seriesFillBBox : void 0;
+ applyShapeStyle19(sector, style, fillBBox);
+ sector.centerX = 0;
+ sector.centerY = 0;
+ sector.innerRadius = depth * radiusScale;
+ sector.outerRadius = (depth + 1) * radiusScale;
+ sector.startAngle = startAngle + angleOffset;
+ sector.endAngle = endAngle + angleOffset;
+ sector.inset = baseInset + strokeWidth * 0.5;
+ sector.cornerRadius = cornerRadius;
+ };
+ this.datumSelection.each((sector, datum) => {
+ updateSector(datum, sector, false);
+ });
+ this.highlightSelection.each((rect, datum) => {
+ updateSector(datum, rect, true);
+ });
+ const updateText = (node, text2, tag, highlighted) => {
+ const { depth, contentHeight } = node;
+ const primary = tag === 0 /* Primary */;
+ const label = primary ? node.label : node.secondaryLabel;
+ if (depth == null || label == null) {
+ text2.visible = false;
+ return;
+ }
+ const { labelPlacement, circleQuarter, radius: textRadius, theta } = label;
+ let highlightedColor;
+ if (highlighted) {
+ const highlightedLabelStyle = primary ? this.properties.highlightStyle.label : this.properties.highlightStyle.secondaryLabel;
+ highlightedColor = highlightedLabelStyle.color;
+ }
+ const params = {
+ childrenKey: this.properties.childrenKey,
+ colorKey: this.properties.colorKey,
+ colorName: this.properties.colorName ?? this.properties.colorKey,
+ depth: node.depth ?? Number.NaN,
+ labelKey: this.properties.labelKey,
+ secondaryLabelKey: this.properties.secondaryLabelKey,
+ sizeKey: this.properties.sizeKey,
+ sizeName: this.properties.sizeName ?? this.properties.sizeKey
+ };
+ const baseLabelStyle = primary ? this.properties.label : this.properties.secondaryLabel;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const style = getLabelStyles7(this, node, params, baseLabelStyle, highlighted, activeHighlight);
+ text2.text = label.text;
+ text2.fontSize = label.fontSize;
+ text2.lineHeight = label.lineHeight;
+ text2.fontStyle = label.fontStyle;
+ text2.fontFamily = label.fontFamily;
+ text2.fontWeight = label.fontWeight;
+ text2.fill = highlightedColor ?? label.color;
+ text2.fillOpacity = this.getHighlightStyle(highlighted, node.datumIndex)?.opacity ?? 1;
+ text2.setBoxing(style);
+ switch (labelPlacement) {
+ case 0 /* CenterCircle */:
+ text2.textAlign = "center";
+ text2.textBaseline = "top";
+ text2.translationX = 0;
+ text2.translationY = (primary ? 0 : contentHeight - label.height) - contentHeight * 0.5;
+ text2.rotation = 0;
+ break;
+ case 1 /* Parallel */: {
+ const topHalf = (circleQuarter & 3 /* Top */) !== 0;
+ const translationRadius = primary === !topHalf ? textRadius : textRadius - (contentHeight - label.height);
+ text2.textAlign = "center";
+ text2.textBaseline = topHalf ? "bottom" : "top";
+ text2.translationX = Math.cos(theta) * translationRadius;
+ text2.translationY = Math.sin(theta) * translationRadius;
+ text2.rotation = topHalf ? theta - Math.PI * 0.5 : theta + Math.PI * 0.5;
+ break;
+ }
+ case 2 /* Perpendicular */: {
+ const rightHalf = (circleQuarter & 6 /* Right */) !== 0;
+ const translation = primary === !rightHalf ? (contentHeight - label.height) * 0.5 : (label.height - contentHeight) * 0.5;
+ text2.textAlign = "center";
+ text2.textBaseline = "middle";
+ text2.translationX = Math.cos(theta) * textRadius + Math.cos(theta + Math.PI / 2) * translation;
+ text2.translationY = Math.sin(theta) * textRadius + Math.sin(theta + Math.PI / 2) * translation;
+ text2.rotation = rightHalf ? theta : theta + Math.PI;
+ break;
+ }
+ }
+ text2.visible = true;
+ };
+ const highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ for (const text2 of this.labelSelection.selectByClass(TransformableText3)) {
+ const datum = text2.closestDatum();
+ updateText(datum, text2, text2.tag, datum === highlightedDatum);
+ }
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties, ctx } = this;
+ const { labelKey, secondaryLabelKey, childrenKey, sizeKey, sizeName, colorKey, colorName, tooltip } = properties;
+ const { formatManager } = ctx;
+ const nodeDatum = datumIndex.reduce((n, i) => n?.children[i], this.rootNode);
+ if (nodeDatum == null)
+ return;
+ const { datum, depth } = nodeDatum;
+ if (datum == null || depth == null)
+ return;
+ const data = [];
+ const datumSize = sizeKey == null ? void 0 : datum[sizeKey];
+ if (datumSize != null) {
+ const sizeDomain = [0, this.rootNode?.sumSize ?? 0];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumSize,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ boundSeries: this.getFormatterContext("size"),
+ domain: sizeDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? formatValue2(datumSize) });
+ }
+ const datumColor = colorKey == null ? void 0 : datum[colorKey];
+ if (datumColor != null) {
+ const { colorDomain } = this;
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumColor,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ boundSeries: this.getFormatterContext("color"),
+ domain: colorDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? formatValue2(datumColor) });
+ }
+ const format = this.getItemStyle(
+ { ...nodeDatum, colorValue: datumColor ?? nodeDatum.colorValue },
+ false
+ );
+ const color6 = format.fill;
+ const markerStyle = {
+ shape: "square",
+ fill: color6,
+ fillOpacity: 1,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ };
+ if (import_ag_charts_community274._ModuleSupport.isGradientFill(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title: labelKey == null ? void 0 : datum[labelKey],
+ symbol: {
+ marker: markerStyle
+ },
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title: void 0,
+ depth,
+ labelKey,
+ secondaryLabelKey,
+ childrenKey,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ ...format
+ }
+ );
+ }
+ createNodeData() {
+ return void 0;
+ }
+ pickNodeClosestDatum(point) {
+ return this.pickNodeNearestDistantObject(point, this.datumSelection.nodes());
+ }
+ animateEmptyUpdateReady() {
+ fromToMotion6(this.id, "nodes", this.ctx.animationManager, [this.scalingGroup], {
+ toFn() {
+ return { scalingX: 1, scalingY: 1 };
+ },
+ fromFn() {
+ return { scalingX: 0, scalingY: 0 };
+ }
+ });
+ }
+ computeFocusBounds(node) {
+ return node;
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.label.itemStyler != null;
+ }
+};
+SunburstSeries.className = "SunburstSeries";
+SunburstSeries.type = "sunburst";
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstSeriesOptionsDef.ts
+var import_ag_charts_community275 = require("ag-charts-community");
+var import_ag_charts_core117 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs22, sunburstSeriesThemeableOptionsDef, without: without8 } = import_ag_charts_community275._ModuleSupport;
+var sunburstSeriesOptionsDef = {
+ ...sunburstSeriesThemeableOptionsDef,
+ ...without8(commonSeriesOptionsDefs22, ["highlightStyle", "highlight", "showInLegend"]),
+ type: (0, import_ag_charts_core117.required)((0, import_ag_charts_core117.constant)("sunburst")),
+ labelKey: import_ag_charts_core117.string,
+ secondaryLabelKey: import_ag_charts_core117.string,
+ childrenKey: import_ag_charts_core117.string,
+ sizeKey: import_ag_charts_core117.string,
+ colorKey: import_ag_charts_core117.string,
+ sizeName: import_ag_charts_core117.string,
+ colorName: import_ag_charts_core117.string
+};
+
+// packages/ag-charts-enterprise/src/series/sunburst/sunburstModule.ts
+var { BASE_FONT_SIZE, FONT_SIZE_RATIO: FONT_SIZE_RATIO3 } = import_ag_charts_community276._ModuleSupport;
+var SunburstModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "sunburst",
+ moduleFactory: (ctx) => new SunburstSeries(ctx),
+ solo: true,
+ themeTemplate: {
+ series: {
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ { $palette: "fills" },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", import_ag_charts_community276._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS],
+ ["pattern", import_ag_charts_community276._ModuleSupport.FILL_PATTERN_DEFAULTS],
+ ["image", import_ag_charts_community276._ModuleSupport.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [{ $size: { $path: ["./data", { $path: "/data" }] } }, { $palette: "strokes" }]
+ },
+ colorRange: { $palette: "divergingColors" },
+ strokeWidth: { $isUserOption: ["./strokes/0", 2, 0] },
+ label: {
+ ...import_ag_charts_community276._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $rem: FONT_SIZE_RATIO3.LARGE },
+ minimumFontSize: { $rem: 9 / BASE_FONT_SIZE },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" },
+ overflowStrategy: "ellipsis",
+ wrapping: "never",
+ spacing: 2
+ },
+ secondaryLabel: {
+ ...import_ag_charts_community276._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ fontFamily: { $ref: "fontFamily" },
+ fontSize: { $rem: FONT_SIZE_RATIO3.SMALLEST },
+ minimumFontSize: { $rem: 7 / BASE_FONT_SIZE },
+ fontWeight: { $ref: "fontWeight" },
+ color: { $ref: "chartBackgroundColor" },
+ overflowStrategy: "ellipsis",
+ wrapping: "never"
+ },
+ sectorSpacing: 2,
+ padding: 3,
+ highlightStyle: {
+ label: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ secondaryLabel: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ fill: "rgba(255,255,255, 0.33)",
+ stroke: `rgba(0, 0, 0, 0.4)`,
+ strokeWidth: 2
+ }
+ },
+ gradientLegend: {
+ enabled: true,
+ ...import_ag_charts_community276._ModuleSupport.LEGEND_CONTAINER_THEME
+ }
+ }
+};
+var SunburstSeriesModule = {
+ type: "series",
+ name: "sunburst",
+ chartType: "standalone",
+ enterprise: true,
+ options: sunburstSeriesOptionsDef,
+ create: (ctx) => new SunburstSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapModule.ts
+var import_ag_charts_community280 = require("ag-charts-community");
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeries.ts
+var import_ag_charts_community278 = require("ag-charts-community");
+var import_ag_charts_core118 = require("ag-charts-core");
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeriesProperties.ts
+var import_ag_charts_community277 = require("ag-charts-community");
+var { BaseProperties: BaseProperties30, HierarchySeriesProperties: HierarchySeriesProperties2, HighlightStyle: HighlightStyle2, makeSeriesTooltip: makeSeriesTooltip24, Property: Property84, Label: Label18 } = import_ag_charts_community277._ModuleSupport;
+var TreemapGroupLabel = class extends Label18 {
+ constructor() {
+ super(...arguments);
+ this.spacing = 0;
+ }
+};
+__decorateClass([
+ Property84
+], TreemapGroupLabel.prototype, "spacing", 2);
+var TreemapSeriesGroup = class extends BaseProperties30 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.cornerRadius = 0;
+ this.textAlign = "center";
+ this.gap = 0;
+ this.padding = 0;
+ this.interactive = true;
+ this.label = new TreemapGroupLabel();
+ }
+};
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "fill", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "stroke", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "textAlign", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "gap", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "padding", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "interactive", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroup.prototype, "label", 2);
+var TreemapSeriesTile = class extends BaseProperties30 {
+ constructor() {
+ super(...arguments);
+ this.fill = void 0;
+ this.fillOpacity = 1;
+ this.strokeWidth = 1;
+ this.strokeOpacity = 1;
+ this.cornerRadius = 0;
+ this.textAlign = "center";
+ this.verticalAlign = "middle";
+ this.gap = 0;
+ this.padding = 0;
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedSecondaryLabel();
+ }
+};
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "fill", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "stroke", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "cornerRadius", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "textAlign", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "verticalAlign", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "gap", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "padding", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "label", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTile.prototype, "secondaryLabel", 2);
+var TreemapSeriesGroupHighlightStyle = class extends BaseProperties30 {
+ constructor() {
+ super(...arguments);
+ this.label = new AutoSizedLabel();
+ }
+};
+__decorateClass([
+ Property84
+], TreemapSeriesGroupHighlightStyle.prototype, "fill", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroupHighlightStyle.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroupHighlightStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroupHighlightStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroupHighlightStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesGroupHighlightStyle.prototype, "label", 2);
+var TreemapSeriesTileHighlightStyle = class extends BaseProperties30 {
+ constructor() {
+ super(...arguments);
+ this.label = new AutoSizedLabel();
+ this.secondaryLabel = new AutoSizedSecondaryLabel();
+ }
+};
+__decorateClass([
+ Property84
+], TreemapSeriesTileHighlightStyle.prototype, "fill", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTileHighlightStyle.prototype, "fillOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTileHighlightStyle.prototype, "stroke", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTileHighlightStyle.prototype, "strokeWidth", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTileHighlightStyle.prototype, "strokeOpacity", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTileHighlightStyle.prototype, "label", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesTileHighlightStyle.prototype, "secondaryLabel", 2);
+var TreemapSeriesHighlightStyle = class extends HighlightStyle2 {
+ constructor() {
+ super(false);
+ this.group = new TreemapSeriesGroupHighlightStyle();
+ this.tile = new TreemapSeriesTileHighlightStyle();
+ }
+ getStyle(isLeaf) {
+ return isLeaf ? this.tile : this.group;
+ }
+};
+__decorateClass([
+ Property84
+], TreemapSeriesHighlightStyle.prototype, "group", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesHighlightStyle.prototype, "tile", 2);
+var TreemapSeriesProperties = class extends HierarchySeriesProperties2 {
+ constructor() {
+ super(...arguments);
+ this.highlightStyle = new TreemapSeriesHighlightStyle();
+ this.tooltip = makeSeriesTooltip24();
+ this.group = new TreemapSeriesGroup();
+ this.tile = new TreemapSeriesTile();
+ this.undocumentedGroupFills = [];
+ this.undocumentedGroupStrokes = [];
+ }
+ getStyle(isLeaf, fills, strokes, index) {
+ const {
+ fillOpacity,
+ strokeWidth,
+ strokeOpacity,
+ fill = isLeaf ? fills[index % fills.length] : fills[Math.min(index, fills.length)],
+ stroke: stroke2 = isLeaf ? strokes[index % fills.length] : strokes[Math.min(index, strokes.length)]
+ } = isLeaf ? this.tile : this.group;
+ return {
+ fill,
+ fillOpacity,
+ stroke: stroke2,
+ strokeWidth,
+ strokeOpacity,
+ opacity: 1
+ };
+ }
+};
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "sizeName", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "labelKey", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "secondaryLabelKey", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "itemStyler", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "highlightStyle", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "tooltip", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "group", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "tile", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "undocumentedGroupFills", 2);
+__decorateClass([
+ Property84
+], TreemapSeriesProperties.prototype, "undocumentedGroupStrokes", 2);
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeries.ts
+var {
+ createDatumId: createDatumId22,
+ Rect: Rect9,
+ Group: Group21,
+ BBox: BBox28,
+ Selection: Selection18,
+ Text: Text10,
+ Transformable: Transformable4,
+ applyShapeStyle: applyShapeStyle20,
+ getLabelStyles: getLabelStyles8,
+ mergeDefaults: mergeDefaults22,
+ formatValue: formatValue3
+} = import_ag_charts_community278._ModuleSupport;
+var TreemapNode = class extends import_ag_charts_community278._ModuleSupport.HierarchyNode {
+ constructor() {
+ super(...arguments);
+ this.labelValue = void 0;
+ this.secondaryLabelValue = void 0;
+ this.label = void 0;
+ this.secondaryLabel = void 0;
+ this.bbox = void 0;
+ this.padding = void 0;
+ }
+};
+function nodeSize(node) {
+ return node.children.length > 0 ? node.sumSize - node.sizeValue : node.sizeValue;
+}
+var textAlignFactors2 = {
+ left: 0,
+ center: 0.5,
+ right: 1
+};
+var verticalAlignFactors4 = {
+ top: 0,
+ middle: 0.5,
+ bottom: 1
+};
+var DistantGroup = class extends import_ag_charts_community278._ModuleSupport.Group {
+ distanceSquared(x, y) {
+ return this.getBBox().distanceSquared(x, y);
+ }
+};
+var TreemapSeries = class extends import_ag_charts_community278._ModuleSupport.HierarchySeries {
+ constructor() {
+ super(...arguments);
+ this.NodeClass = TreemapNode;
+ this.properties = new TreemapSeriesProperties();
+ this.rectGroup = this.contentGroup.appendChild(new Group21());
+ this.datumSelection = Selection18.select(this.rectGroup, Rect9);
+ this.labelSelection = Selection18.select(this.labelGroup, Group21);
+ this.highlightSelection = Selection18.select(
+ this.rectGroup,
+ Rect9
+ );
+ }
+ groupTitleHeight(node, bbox) {
+ const { labelValue } = node;
+ const { label: font2 } = this.properties.group;
+ const heightRatioThreshold = 3;
+ if (labelValue == null) {
+ return;
+ } else if (font2.fontSize > bbox.width / heightRatioThreshold || font2.fontSize > bbox.height / heightRatioThreshold) {
+ return;
+ } else {
+ const { height: fontHeight } = (0, import_ag_charts_core118.cachedTextMeasurer)(font2).measureLines(labelValue);
+ return Math.max(fontHeight, font2.fontSize);
+ }
+ }
+ getNodePadding(node, bbox) {
+ if (node.parent == null) {
+ return {
+ top: 0,
+ right: 0,
+ bottom: 0,
+ left: 0
+ };
+ } else if (node.children.length === 0) {
+ const { padding: padding2 } = this.properties.tile;
+ return {
+ top: padding2,
+ right: padding2,
+ bottom: padding2,
+ left: padding2
+ };
+ }
+ const {
+ label: { spacing },
+ padding
+ } = this.properties.group;
+ const fontHeight = this.groupTitleHeight(node, bbox);
+ const titleHeight = fontHeight == null ? 0 : fontHeight + spacing;
+ return {
+ top: padding + titleHeight,
+ right: padding,
+ bottom: padding,
+ left: padding
+ };
+ }
+ sortChildren({ children }) {
+ const sortedChildrenIndices = Array.from(children, (_, i) => i).filter((i) => nodeSize(children[i]) > 0).sort((aIndex, bIndex) => nodeSize(children[bIndex]) - nodeSize(children[aIndex]));
+ const childAt = (i) => {
+ const sortedIndex = sortedChildrenIndices[i];
+ return children[sortedIndex];
+ };
+ return { sortedChildrenIndices, childAt };
+ }
+ /**
+ * Squarified Treemap algorithm
+ * https://www.win.tue.nl/~vanwijk/stm.pdf
+ */
+ squarify(node, bbox) {
+ const { datum, children } = node;
+ if (bbox.width <= 0 || bbox.height <= 0) {
+ node.bbox = void 0;
+ node.padding = void 0;
+ node.midPoint.x = Number.NaN;
+ node.midPoint.y = Number.NaN;
+ return;
+ }
+ const padding = datum == null ? { top: 0, right: 0, bottom: 0, left: 0 } : this.getNodePadding(node, bbox);
+ if (node.parent == null) {
+ node.bbox = void 0;
+ node.padding = void 0;
+ node.midPoint.x = Number.NaN;
+ node.midPoint.y = Number.NaN;
+ } else {
+ node.bbox = bbox;
+ node.padding = padding;
+ node.midPoint.x = bbox.x + bbox.width / 2;
+ node.midPoint.y = bbox.y;
+ }
+ const { sortedChildrenIndices, childAt } = this.sortChildren(node);
+ const allLeafNodes = sortedChildrenIndices.every((sortedIndex) => children[sortedIndex].children.length === 0);
+ const targetTileAspectRatio = 1;
+ const width = bbox.width - padding.left - padding.right;
+ const height = bbox.height - padding.top - padding.bottom;
+ if (width <= 0 || height <= 0)
+ return;
+ const numChildren = sortedChildrenIndices.length;
+ let stackSum = 0;
+ let startIndex = 0;
+ let minRatioDiff = Infinity;
+ let partitionSum = sortedChildrenIndices.reduce((sum, sortedIndex) => sum + nodeSize(children[sortedIndex]), 0);
+ const innerBox = new BBox28(bbox.x + padding.left, bbox.y + padding.top, width, height);
+ const partition = innerBox.clone();
+ let i = 0;
+ while (i < numChildren) {
+ const value = nodeSize(childAt(i));
+ const firstValue = nodeSize(childAt(startIndex));
+ const isVertical2 = partition.width < partition.height;
+ stackSum += value;
+ const partThickness = isVertical2 ? partition.height : partition.width;
+ const partLength = isVertical2 ? partition.width : partition.height;
+ const firstTileLength = partLength * firstValue / stackSum;
+ let stackThickness = partThickness * stackSum / partitionSum;
+ const ratio3 = Math.max(firstTileLength, stackThickness) / Math.min(firstTileLength, stackThickness);
+ const diff8 = Math.abs(targetTileAspectRatio - ratio3);
+ if (diff8 < minRatioDiff) {
+ minRatioDiff = diff8;
+ i++;
+ continue;
+ }
+ stackSum -= value;
+ stackThickness = partThickness * stackSum / partitionSum;
+ let start2 = isVertical2 ? partition.x : partition.y;
+ for (let j = startIndex; j < i; j++) {
+ const child = childAt(j);
+ const childSize = nodeSize(child);
+ const x = isVertical2 ? start2 : partition.x;
+ const y = isVertical2 ? partition.y : start2;
+ const length = partLength * childSize / stackSum;
+ const stackWidth = isVertical2 ? length : stackThickness;
+ const stackHeight = isVertical2 ? stackThickness : length;
+ const childBbox = new BBox28(x, y, stackWidth, stackHeight);
+ this.applyGap(innerBox, childBbox, allLeafNodes);
+ this.squarify(child, childBbox);
+ partitionSum -= childSize;
+ start2 += length;
+ }
+ if (isVertical2) {
+ partition.y += stackThickness;
+ partition.height -= stackThickness;
+ } else {
+ partition.x += stackThickness;
+ partition.width -= stackThickness;
+ }
+ startIndex = i;
+ stackSum = 0;
+ minRatioDiff = Infinity;
+ }
+ const isVertical = partition.width < partition.height;
+ let start = isVertical ? partition.x : partition.y;
+ for (let childIdx = startIndex; childIdx < numChildren; childIdx++) {
+ const child = childAt(childIdx);
+ const x = isVertical ? start : partition.x;
+ const y = isVertical ? partition.y : start;
+ const part = nodeSize(child) / partitionSum;
+ const childWidth = partition.width * (isVertical ? part : 1);
+ const childHeight = partition.height * (isVertical ? 1 : part);
+ const childBox = new BBox28(x, y, childWidth, childHeight);
+ this.applyGap(innerBox, childBox, allLeafNodes);
+ this.squarify(child, childBox);
+ start += isVertical ? childWidth : childHeight;
+ }
+ }
+ applyGap(innerBox, childBox, allLeafNodes) {
+ const gap = allLeafNodes ? this.properties.tile.gap * 0.5 : this.properties.group.gap * 0.5;
+ const getBounds = (box) => ({
+ left: box.x,
+ top: box.y,
+ right: box.x + box.width,
+ bottom: box.y + box.height
+ });
+ const innerBounds = getBounds(innerBox);
+ const childBounds = getBounds(childBox);
+ const sides = ["top", "right", "bottom", "left"];
+ for (const side of sides) {
+ if (!(0, import_ag_charts_core118.isNumberEqual)(innerBounds[side], childBounds[side])) {
+ childBox.shrink(gap, side);
+ }
+ }
+ }
+ createNodeData() {
+ return void 0;
+ }
+ getItemStyle(nodeDatum, isLeaf, isHighlight) {
+ const { properties, colorScale } = this;
+ const { itemStyler } = properties;
+ const rootIndex = nodeDatum.datumIndex?.[0] ?? 0;
+ const fills = isLeaf ? properties.fills : properties.undocumentedGroupFills;
+ const strokes = isLeaf ? properties.strokes : properties.undocumentedGroupStrokes;
+ const index = isLeaf ? rootIndex : nodeDatum.depth ?? -1;
+ const highlightStyle = isHighlight ? properties.highlightStyle.getStyle(isLeaf) : void 0;
+ const baseStyle = mergeDefaults22(highlightStyle, properties.getStyle(isLeaf, fills, strokes, index));
+ if (!isHighlight && isLeaf && nodeDatum.colorValue != null) {
+ baseStyle.fill = colorScale.convert(nodeDatum.colorValue);
+ }
+ let style = baseStyle;
+ if (itemStyler != null && nodeDatum != null) {
+ const overrides = this.cachedDatumCallback(
+ createDatumId22(this.getDatumId(nodeDatum), isHighlight ? "highlight" : "node"),
+ () => {
+ const params = this.makeItemStylerParams(nodeDatum, isHighlight, style);
+ return this.callWithContext(itemStyler, params);
+ }
+ );
+ if (overrides) {
+ style = mergeDefaults22(overrides, style);
+ }
+ }
+ return style;
+ }
+ makeItemStylerParams(nodeDatum, isHighlight, style) {
+ const { id: seriesId } = this;
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const highlightState = this.getHighlightStateString(activeHighlight, isHighlight, nodeDatum.datumIndex);
+ const fill = this.filterItemStylerFillParams(style.fill) ?? style.fill;
+ return {
+ seriesId,
+ datum: nodeDatum.datum,
+ depth: nodeDatum.depth ?? -1,
+ highlighted: isHighlight,
+ highlightState,
+ ...style,
+ fill
+ };
+ }
+ updateSelections() {
+ let highlightedNode = this.ctx.highlightManager?.getActiveHighlight();
+ if (highlightedNode != null && !this.properties.group.interactive && highlightedNode.children.length !== 0) {
+ highlightedNode = void 0;
+ }
+ this.highlightSelection.update(
+ highlightedNode == null ? [] : [highlightedNode],
+ void 0,
+ (node) => this.getDatumId(node)
+ );
+ if (!this.nodeDataRefresh) {
+ return;
+ }
+ this.nodeDataRefresh = false;
+ const { seriesRect } = this.chart ?? {};
+ if (!seriesRect)
+ return;
+ const descendants = Array.from(this.rootNode);
+ const updateLabelGroup = (group) => {
+ group.append([new Text10({ tag: 0 /* Primary */ }), new Text10({ tag: 1 /* Secondary */ })]);
+ };
+ this.datumSelection.update(descendants, void 0, (node) => this.getDatumId(node));
+ this.labelSelection.update(descendants, updateLabelGroup, (node) => this.getDatumId(node));
+ }
+ updateNodes() {
+ const { rootNode, data } = this;
+ const {
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ highlightStyle,
+ tile,
+ group
+ } = this.properties;
+ const { seriesRect } = this.chart ?? {};
+ if (!seriesRect || !data)
+ return;
+ this.rootNode?.walk((node) => {
+ const { datum, depth, children } = node;
+ const isLeaf = children.length === 0;
+ const labelStyle = isLeaf ? tile.label : group.label;
+ let labelValue;
+ if (labelStyle.enabled && datum != null && depth != null && labelKey != null) {
+ const value = datum[labelKey];
+ labelValue = this.getLabelText(
+ value,
+ datum,
+ labelKey,
+ "label",
+ [],
+ labelStyle,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (labelValue === "") {
+ labelValue = void 0;
+ }
+ let secondaryLabelValue;
+ if (tile.secondaryLabel.enabled && isLeaf && datum != null && depth != null && secondaryLabelKey != null) {
+ const value = datum[secondaryLabelKey];
+ secondaryLabelValue = this.getLabelText(
+ value,
+ datum,
+ secondaryLabelKey,
+ "secondaryLabel",
+ [],
+ tile.secondaryLabel,
+ {
+ depth,
+ datum,
+ childrenKey,
+ colorKey,
+ colorName,
+ labelKey,
+ secondaryLabelKey,
+ sizeKey,
+ sizeName,
+ value
+ }
+ );
+ }
+ if (secondaryLabelValue === "") {
+ secondaryLabelValue = void 0;
+ }
+ node.labelValue = (0, import_ag_charts_core118.toPlainText)(labelValue);
+ node.secondaryLabelValue = (0, import_ag_charts_core118.toPlainText)(secondaryLabelValue);
+ });
+ const { width, height } = seriesRect;
+ this.squarify(rootNode, new BBox28(0, 0, width, height));
+ this.rootNode?.walk((node) => {
+ const { bbox, children, labelValue, secondaryLabelValue } = node;
+ node.label = void 0;
+ node.secondaryLabel = void 0;
+ if (bbox == null)
+ return;
+ if (children.length === 0) {
+ const layout = {
+ width: bbox.width,
+ height: bbox.height,
+ meta: null
+ };
+ const formatting = formatLabels(
+ labelValue,
+ this.properties.tile.label,
+ secondaryLabelValue,
+ this.properties.tile.secondaryLabel,
+ { padding: tile.padding },
+ () => layout
+ );
+ if (formatting == null) {
+ return;
+ }
+ const { height: labelHeight, label, secondaryLabel } = formatting;
+ const { textAlign, verticalAlign, padding } = tile;
+ const textAlignFactor = textAlignFactors2[textAlign] ?? 0.5;
+ const labelX = bbox.x + padding + (bbox.width - 2 * padding) * textAlignFactor;
+ const verticalAlignFactor = verticalAlignFactors4[verticalAlign] ?? 0.5;
+ const labelYStart = bbox.y + padding + labelHeight * 0.5 + (bbox.height - 2 * padding - labelHeight) * verticalAlignFactor;
+ if (label != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.tile.label;
+ node.label = {
+ text: label.text,
+ fontSize: label.fontSize,
+ lineHeight: label.lineHeight,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ verticalAlign: "middle",
+ x: labelX,
+ y: labelYStart - (labelHeight - label.height) * 0.5
+ };
+ }
+ if (secondaryLabel != null) {
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.tile.secondaryLabel;
+ node.secondaryLabel = {
+ text: secondaryLabel.text,
+ fontSize: secondaryLabel.fontSize,
+ lineHeight: secondaryLabel.fontSize,
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ verticalAlign: "middle",
+ x: labelX,
+ y: labelYStart + (labelHeight - secondaryLabel.height) * 0.5
+ };
+ }
+ } else if (labelValue == null) {
+ return;
+ } else {
+ const { padding, textAlign } = group;
+ const groupTitleHeight = this.groupTitleHeight(node, bbox);
+ if (groupTitleHeight == null)
+ return;
+ const innerWidth = bbox.width - 2 * padding;
+ const text2 = (0, import_ag_charts_core118.wrapText)(labelValue, {
+ maxWidth: bbox.width - 2 * padding,
+ font: group.label,
+ textWrap: "never"
+ });
+ const textAlignFactor = textAlignFactors2[textAlign] ?? 0.5;
+ const {
+ fontStyle = "normal",
+ fontFamily,
+ fontWeight = "normal",
+ color: color6 = "black"
+ } = this.properties.group.label;
+ node.label = {
+ text: text2,
+ fontSize: group.label.fontSize,
+ lineHeight: (0, import_ag_charts_core118.calcLineHeight)(group.label.fontSize),
+ fontStyle,
+ fontFamily,
+ fontWeight,
+ color: color6,
+ textAlign,
+ verticalAlign: "middle",
+ x: bbox.x + padding + innerWidth * textAlignFactor,
+ y: bbox.y + padding + groupTitleHeight * 0.5
+ };
+ }
+ });
+ const fillBBox = {
+ series: new BBox28(0, 0, width, height),
+ axis: new BBox28(0, 0, width, height)
+ };
+ const updateRectFn = (node, rect, isHighlight) => {
+ const { bbox } = node;
+ if (bbox == null) {
+ rect.visible = false;
+ return;
+ }
+ const { depth = -1 } = node;
+ const isLeaf = node.children.length === 0;
+ const style = this.getItemStyle(node, isLeaf, isHighlight);
+ rect.crisp = true;
+ applyShapeStyle20(rect, style, fillBBox);
+ rect.cornerRadius = isLeaf ? tile.cornerRadius : group.cornerRadius;
+ rect.zIndex = [0, depth, isHighlight ? 1 : 0];
+ const onlyLeaves = node.parent?.children.every((n) => n.children.length === 0);
+ const parentBbox = node.parent == null ? void 0 : node.parent.bbox;
+ const parentPadding = node.parent == null ? void 0 : node.parent.padding;
+ if (onlyLeaves === true && parentBbox != null && parentPadding != null) {
+ rect.clipBBox = bbox;
+ rect.x = parentBbox.x + parentPadding.left;
+ rect.y = parentBbox.y + parentPadding.top;
+ rect.width = parentBbox.width - (parentPadding.left + parentPadding.right);
+ rect.height = parentBbox.height - (parentPadding.top + parentPadding.bottom);
+ } else {
+ rect.clipBBox = void 0;
+ rect.x = bbox.x;
+ rect.y = bbox.y;
+ rect.width = bbox.width;
+ rect.height = bbox.height;
+ }
+ rect.visible = true;
+ };
+ this.datumSelection.each((rect, datum) => updateRectFn(datum, rect, false));
+ this.highlightSelection.each((rect, datum) => {
+ updateRectFn(datum, rect, true);
+ });
+ const updateLabelFn = (node, text2, tag, highlighted) => {
+ const isLeaf = node.children.length === 0;
+ const label = tag === 0 /* Primary */ ? node.label : node.secondaryLabel;
+ if (label == null) {
+ text2.visible = false;
+ return;
+ }
+ const labelProps = tag === 0 /* Primary */ ? tile.label : tile.secondaryLabel;
+ let highlightedColor;
+ if (highlighted) {
+ const { tile: hTitle, group: hGroup } = highlightStyle;
+ highlightedColor = hTitle.secondaryLabel.color;
+ if (!isLeaf) {
+ highlightedColor = hGroup.label.color;
+ } else if (tag === 0 /* Primary */) {
+ highlightedColor = hTitle.label.color;
+ }
+ }
+ const params = {
+ childrenKey: this.properties.childrenKey,
+ colorKey: this.properties.colorKey,
+ colorName: this.properties.colorName ?? this.properties.colorKey,
+ depth: node.depth ?? Number.NaN,
+ labelKey: this.properties.labelKey,
+ secondaryLabelKey: this.properties.secondaryLabelKey,
+ sizeKey: this.properties.sizeKey,
+ sizeName: this.properties.sizeName ?? this.properties.sizeKey
+ };
+ const activeHighlight = this.ctx.highlightManager?.getActiveHighlight();
+ const style = getLabelStyles8(this, node, params, labelProps, highlighted, activeHighlight);
+ text2.text = label.text;
+ text2.fontSize = label.fontSize;
+ text2.lineHeight = label.lineHeight;
+ text2.fontStyle = label.fontStyle;
+ text2.fontFamily = label.fontFamily;
+ text2.fontWeight = label.fontWeight;
+ text2.fill = highlightedColor ?? label.color;
+ text2.fillOpacity = this.getHighlightStyle(highlighted, node.datumIndex)?.opacity ?? 1;
+ text2.textAlign = label.textAlign;
+ text2.textBaseline = label.verticalAlign;
+ text2.x = label.x;
+ text2.y = label.y;
+ text2.setBoxing(style);
+ text2.visible = true;
+ text2.zIndex = 1;
+ };
+ const highlightedDatum = this.ctx.highlightManager?.getActiveHighlight();
+ for (const text2 of this.labelSelection.selectByClass(Text10)) {
+ const datum = text2.closestDatum();
+ updateLabelFn(datum, text2, text2.tag, datum === highlightedDatum);
+ }
+ }
+ pickNodesExactShape(point) {
+ const nodes = super.pickNodesExactShape(point);
+ nodes.sort((a, b) => b.datumIndex.length - a.datumIndex.length);
+ return nodes;
+ }
+ pickNodeClosestDatum(point) {
+ const exactMatch = this.pickNodesExactShape(point);
+ if (exactMatch.length !== 0) {
+ return { datum: exactMatch[0], distance: 0 };
+ }
+ return this.pickNodeNearestDistantObject(point, this.datumSelection.nodes());
+ }
+ getTooltipContent(datumIndex) {
+ const { id: seriesId, properties, ctx } = this;
+ const { formatManager } = ctx;
+ const { labelKey, secondaryLabelKey, childrenKey, sizeKey, sizeName, colorKey, colorName, tooltip } = properties;
+ const nodeDatum = datumIndex.reduce((n, i) => n?.children[i], this.rootNode);
+ if (nodeDatum == null)
+ return;
+ const { datum, depth, children } = nodeDatum;
+ if (datum == null || depth == null)
+ return;
+ const isLeaf = children.length === 0;
+ const data = [];
+ const datumSize = sizeKey == null ? void 0 : datum[sizeKey];
+ if (datumSize != null) {
+ const sizeDomain = [0, this.rootNode?.sumSize ?? 0];
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumSize,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: sizeKey,
+ source: "tooltip",
+ property: "size",
+ boundSeries: this.getFormatterContext("size"),
+ domain: sizeDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: sizeName, fallbackLabel: sizeKey, value: content ?? formatValue3(datumSize) });
+ }
+ const datumColor = colorKey == null ? void 0 : datum[colorKey];
+ if (datumColor != null) {
+ const { colorDomain } = this;
+ const content = formatManager.format(this.callWithContext.bind(this), {
+ type: "number",
+ value: datumColor,
+ datum,
+ seriesId,
+ legendItemName: void 0,
+ key: colorKey,
+ source: "tooltip",
+ property: "color",
+ boundSeries: this.getFormatterContext("color"),
+ domain: colorDomain,
+ fractionDigits: void 0
+ });
+ data.push({ label: colorName, fallbackLabel: colorKey, value: content ?? formatValue3(datumColor) });
+ }
+ const format = this.getItemStyle(
+ { ...nodeDatum, colorValue: datumColor ?? nodeDatum.colorValue },
+ isLeaf,
+ false
+ );
+ const color6 = format.fill;
+ const markerStyle = {
+ shape: "square",
+ fill: color6,
+ fillOpacity: 1,
+ stroke: void 0,
+ strokeWidth: 0,
+ strokeOpacity: 1,
+ lineDash: [0],
+ lineDashOffset: 0
+ };
+ if (import_ag_charts_community278._ModuleSupport.isGradientFill(markerStyle.fill)) {
+ markerStyle.fill = { ...markerStyle.fill, gradient: "linear", rotation: 0, reverse: false };
+ }
+ const symbol = isLeaf ? { marker: markerStyle } : void 0;
+ return this.formatTooltipWithContext(
+ tooltip,
+ {
+ title: labelKey == null ? void 0 : datum[labelKey],
+ symbol,
+ data
+ },
+ {
+ seriesId,
+ datum,
+ title: void 0,
+ depth,
+ labelKey,
+ secondaryLabelKey,
+ childrenKey,
+ sizeKey,
+ sizeName,
+ colorKey,
+ colorName,
+ ...format
+ }
+ );
+ }
+ computeFocusBounds(node) {
+ return Transformable4.toCanvas(this.contentGroup, node.getBBox());
+ }
+ hasItemStylers() {
+ return this.properties.itemStyler != null || this.properties.tile.label.itemStyler != null || this.properties.group.label.itemStyler != null;
+ }
+};
+TreemapSeries.className = "TreemapSeries";
+TreemapSeries.type = "treemap";
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapSeriesOptionsDef.ts
+var import_ag_charts_community279 = require("ag-charts-community");
+var import_ag_charts_core119 = require("ag-charts-core");
+var { commonSeriesOptionsDefs: commonSeriesOptionsDefs23, treemapSeriesThemeableOptionsDef, without: without9 } = import_ag_charts_community279._ModuleSupport;
+var treemapSeriesOptionsDef = {
+ ...treemapSeriesThemeableOptionsDef,
+ ...without9(commonSeriesOptionsDefs23, ["highlightStyle", "highlight", "showInLegend"]),
+ type: (0, import_ag_charts_core119.required)((0, import_ag_charts_core119.constant)("treemap")),
+ labelKey: import_ag_charts_core119.string,
+ secondaryLabelKey: import_ag_charts_core119.string,
+ childrenKey: import_ag_charts_core119.string,
+ sizeKey: import_ag_charts_core119.string,
+ colorKey: import_ag_charts_core119.string,
+ sizeName: import_ag_charts_core119.string,
+ colorName: import_ag_charts_core119.string
+};
+treemapSeriesOptionsDef.undocumentedGroupFills = (0, import_ag_charts_core119.undocumented)((0, import_ag_charts_core119.arrayOf)(import_ag_charts_core119.color));
+treemapSeriesOptionsDef.undocumentedGroupStrokes = (0, import_ag_charts_core119.undocumented)((0, import_ag_charts_core119.arrayOf)(import_ag_charts_core119.color));
+
+// packages/ag-charts-enterprise/src/series/treemap/treemapModule.ts
+var { FONT_SIZE_RATIO: FONT_SIZE_RATIO4 } = import_ag_charts_community280._ModuleSupport;
+var TreemapModule = {
+ type: "series",
+ optionsKey: "series[]",
+ packageType: "enterprise",
+ chartTypes: ["standalone"],
+ identifier: "treemap",
+ moduleFactory: (ctx) => new TreemapSeries(ctx),
+ solo: true,
+ themeTemplate: {
+ series: {
+ fills: {
+ $applyCycle: [
+ { $size: { $path: ["./data", { $path: "/data" }] } },
+ { $palette: "fills" },
+ {
+ $applySwitch: [
+ { $path: ["/type", void 0, { $value: "$1" }] },
+ { $value: "$1" },
+ ["gradient", import_ag_charts_community280._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],
+ ["pattern", import_ag_charts_community280._ModuleSupport.FILL_PATTERN_DEFAULTS],
+ ["image", import_ag_charts_community280._ModuleSupport.FILL_IMAGE_DEFAULTS]
+ ]
+ }
+ ]
+ },
+ strokes: {
+ $applyCycle: [{ $size: { $path: ["./data", { $path: "/data" }] } }, { $palette: "strokes" }]
+ },
+ colorRange: { $palette: "divergingColors" },
+ // @ts-expect-error undocumented option
+ undocumentedGroupFills: { $palette: "hierarchyColors" },
+ undocumentedGroupStrokes: { $palette: "secondHierarchyColors" },
+ group: {
+ label: {
+ ...import_ag_charts_community280._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ color: { $ref: "textColor" },
+ fontStyle: void 0,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $ref: "fontSize" },
+ fontFamily: { $ref: "fontFamily" },
+ spacing: 4
+ },
+ fill: void 0,
+ // Override default fill
+ stroke: void 0,
+ // Override default stroke
+ strokeWidth: 1,
+ padding: 4,
+ gap: 2,
+ textAlign: "left"
+ },
+ tile: {
+ label: {
+ ...import_ag_charts_community280._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ color: { $ref: "chartBackgroundColor" },
+ fontStyle: void 0,
+ fontWeight: { $ref: "fontWeight" },
+ fontSize: { $rem: 1.5 },
+ minimumFontSize: { $rem: FONT_SIZE_RATIO4.SMALLER },
+ fontFamily: { $ref: "fontFamily" },
+ wrapping: "on-space",
+ overflowStrategy: "ellipsis",
+ spacing: 2
+ },
+ secondaryLabel: {
+ ...import_ag_charts_community280._ModuleSupport.LABEL_BOXING_DEFAULTS,
+ enabled: true,
+ color: { $ref: "chartBackgroundColor" },
+ fontStyle: void 0,
+ fontWeight: void 0,
+ fontSize: { $ref: "fontSize" },
+ minimumFontSize: { $rem: FONT_SIZE_RATIO4.SMALLER },
+ fontFamily: { $ref: "fontFamily" },
+ wrapping: "never",
+ overflowStrategy: "ellipsis"
+ },
+ fill: void 0,
+ // Override default fill
+ stroke: void 0,
+ // Override default stroke
+ strokeWidth: { $isUserOption: ["../strokes/0", 2, { $isUserOption: ["./stroke", 2, 0] }] },
+ padding: 3,
+ gap: 1
+ },
+ // Override defaults
+ highlightStyle: {
+ group: {
+ label: {
+ color: { $ref: "textColor" }
+ },
+ fill: "rgba(255,255,255, 0.33)",
+ stroke: `rgba(0, 0, 0, 0.4)`,
+ strokeWidth: 2
+ },
+ tile: {
+ label: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ secondaryLabel: {
+ color: { $ref: "chartBackgroundColor" }
+ },
+ fill: "rgba(255,255,255, 0.33)",
+ stroke: `rgba(0, 0, 0, 0.4)`,
+ strokeWidth: 2
+ }
+ }
+ },
+ gradientLegend: {
+ enabled: true,
+ ...import_ag_charts_community280._ModuleSupport.LEGEND_CONTAINER_THEME
+ }
+ }
+};
+var TreemapSeriesModule = {
+ type: "series",
+ name: "treemap",
+ chartType: "standalone",
+ enterprise: true,
+ options: treemapSeriesOptionsDef,
+ create: (ctx) => new TreemapSeries(ctx)
+};
+
+// packages/ag-charts-enterprise/src/main-modules.ts
+var ModuleRegistry = import_ag_charts_community281._ModuleSupport.ModuleRegistry;
+var AllCartesianEnterpriseModules = [
+ OrdinalTimeAxisModule2,
+ BoxPlotSeriesModule,
+ CandlestickSeriesModule,
+ ConeFunnelSeriesModule,
+ FunnelSeriesModule,
+ HeatmapSeriesModule,
+ OhlcSeriesModule,
+ RangeAreaSeriesModule,
+ RangeBarSeriesModule,
+ WaterfallSeriesModule
+];
+var AllPolarEnterpriseModules = [
+ AngleNumberAxisModule2,
+ AngleCategoryAxisModule2,
+ RadiusNumberAxisModule2,
+ RadiusCategoryAxisModule2,
+ NightingaleSeriesModule,
+ RadarAreaSeriesModule,
+ RadarLineSeriesModule,
+ RadialBarSeriesModule,
+ RadialColumnSeriesModule
+];
+var AllStandaloneEnterpriseModules = [
+ StandaloneChartModule,
+ PyramidSeriesModule,
+ LinearGaugeSeriesModule,
+ RadialGaugeSeriesModule,
+ SunburstSeriesModule,
+ TreemapSeriesModule,
+ ChordSeriesModule,
+ SankeySeriesModule
+];
+var AllTopologyEnterpriseModules = [
+ TopologyChartModule,
+ MapLineSeriesModule,
+ MapLineBackgroundSeriesModule,
+ MapMarkerSeriesModule,
+ MapShapeSeriesModule,
+ MapShapeBackgroundSeriesModule
+];
+var AllEnterpriseModules = [
+ ...AllCartesianEnterpriseModules,
+ ...AllPolarEnterpriseModules,
+ ...AllStandaloneEnterpriseModules,
+ ...AllTopologyEnterpriseModules,
+ // Plugins, WIP
+ AnnotationsModule2,
+ NavigatorModule2,
+ InitialStateModule
+];
+
+// packages/ag-charts-enterprise/src/styles.css
+var styles_default = `.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-menu-border);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}}
+`;
+
+// packages/ag-charts-enterprise/src/setup.ts
+import_ag_charts_community282._ModuleSupport.ModuleRegistry.registerMany(AllEnterpriseModules, import_ag_charts_community282.VERSION);
+function setupEnterpriseModules() {
+ import_ag_charts_community282._ModuleSupport.moduleRegistry.register(
+ AngleCategoryAxisModule,
+ AngleNumberAxisModule,
+ AnimationModule,
+ AnnotationsModule,
+ BackgroundModule,
+ ForegroundModule,
+ BoxPlotModule,
+ CandlestickModule,
+ ChordModule,
+ ConeFunnelModule,
+ FunnelModule,
+ OhlcModule,
+ ChartToolbarModule,
+ ContextMenuModule,
+ CrosshairModule,
+ BandHighlightModule,
+ DataSourceModule,
+ ErrorBarsModule,
+ LinearGaugeModule,
+ MapLineModule,
+ MapLineBackgroundModule,
+ MapMarkerModule,
+ MapShapeModule,
+ MapShapeBackgroundModule,
+ NavigatorModule,
+ StatusBarModule,
+ GradientLegendModule,
+ HeatmapModule,
+ NightingaleModule,
+ OrdinalTimeAxisModule,
+ RadarAreaModule,
+ RadarLineModule,
+ RadialBarModule,
+ RadialColumnModule,
+ RadiusCategoryAxisModule,
+ RadialGaugeModule,
+ RadiusNumberAxisModule,
+ RangeBarModule,
+ RangeAreaModule,
+ RangesModule,
+ PyramidModule,
+ SankeyModule,
+ SharedToolbarModule,
+ SunburstModule,
+ SyncModule,
+ TreemapModule,
+ WaterfallModule,
+ ZoomModule
+ );
+ import_ag_charts_community282._ModuleSupport.enterpriseModule.isEnterprise = true;
+ import_ag_charts_community282._ModuleSupport.enterpriseModule.styles = styles_default;
+ import_ag_charts_community282._ModuleSupport.enterpriseModule.licenseManager = (options) => new LicenseManager(
+ options.container?.ownerDocument ?? (typeof document === "undefined" ? void 0 : document)
+ );
+ import_ag_charts_community282._ModuleSupport.enterpriseModule.injectWatermark = injectWatermark;
+}
+
+// packages/ag-charts-enterprise/src/main.ts
+__reExport(main_exports, require("ag-charts-community"), module.exports);
+setupEnterpriseModules();
+var LicenseManager2 = {
+ setLicenseKey(key) {
+ LicenseManager.setLicenseKey(key);
+ }
+};
+function setupEnterpriseModules2() {
+ setupEnterpriseModules();
+ (0, import_ag_charts_community283.setupCommunityModules)();
+}
+var AgChartsEnterpriseModule = {
+ VERSION: import_ag_charts_community283.VERSION,
+ _Scene: import_ag_charts_community283._Scene,
+ _Theme: import_ag_charts_community283._Theme,
+ _Util: import_ag_charts_community283._Util,
+ create: import_ag_charts_community283.AgCharts.create.bind(import_ag_charts_community283.AgCharts),
+ createSparkline: import_ag_charts_community283.AgCharts.__createSparkline.bind(import_ag_charts_community283.AgCharts),
+ setup: setupEnterpriseModules2,
+ setGridContext: LicenseManager.setGridContext.bind(LicenseManager),
+ setLicenseKey: LicenseManager.setLicenseKey.bind(LicenseManager),
+ isEnterprise: true
+};
diff --git a/yuthon_report/static/src/lib/ag-chart/dist/package/main.cjs.min.js b/yuthon_report/static/src/lib/ag-chart/dist/package/main.cjs.min.js
new file mode 100644
index 000000000..992a8c56c
--- /dev/null
+++ b/yuthon_report/static/src/lib/ag-chart/dist/package/main.cjs.min.js
@@ -0,0 +1,8 @@
+"use strict";var __defProp=Object.defineProperty,__getOwnPropDesc=Object.getOwnPropertyDescriptor,__getOwnPropNames=Object.getOwnPropertyNames,__hasOwnProp=Object.prototype.hasOwnProperty,__export=(t,e)=>{for(var i in e)__defProp(t,i,{get:e[i],enumerable:!0})},__copyProps=(t,e,i,o)=>{if(e&&typeof e=="object"||typeof e=="function")for(let s of __getOwnPropNames(e))!__hasOwnProp.call(t,s)&&s!==i&&__defProp(t,s,{get:()=>e[s],enumerable:!(o=__getOwnPropDesc(e,s))||o.enumerable});return t},__reExport=(t,e,i)=>(__copyProps(t,e,"default"),i&&__copyProps(i,e,"default")),__toCommonJS=t=>__copyProps(__defProp({},"__esModule",{value:!0}),t),__decorateClass=(t,e,i,o)=>{for(var s=o>1?void 0:o?__getOwnPropDesc(e,i):e,a=t.length-1,r;a>=0;a--)(r=t[a])&&(s=(o?r(e,i,s):r(s))||s);return o&&s&&__defProp(e,i,s),s},main_exports={};__export(main_exports,{AgChartsEnterpriseModule:()=>AgChartsEnterpriseModule,LicenseManager:()=>LicenseManager2,setupEnterpriseModules:()=>setupEnterpriseModules2}),module.exports=__toCommonJS(main_exports);var import_ag_charts_community283=require("ag-charts-community"),MD5=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(t,e){let i=t[0],o=t[1],s=t[2],a=t[3];i=this.ff(i,o,s,a,e[0],7,-680876936),a=this.ff(a,i,o,s,e[1],12,-389564586),s=this.ff(s,a,i,o,e[2],17,606105819),o=this.ff(o,s,a,i,e[3],22,-1044525330),i=this.ff(i,o,s,a,e[4],7,-176418897),a=this.ff(a,i,o,s,e[5],12,1200080426),s=this.ff(s,a,i,o,e[6],17,-1473231341),o=this.ff(o,s,a,i,e[7],22,-45705983),i=this.ff(i,o,s,a,e[8],7,1770035416),a=this.ff(a,i,o,s,e[9],12,-1958414417),s=this.ff(s,a,i,o,e[10],17,-42063),o=this.ff(o,s,a,i,e[11],22,-1990404162),i=this.ff(i,o,s,a,e[12],7,1804603682),a=this.ff(a,i,o,s,e[13],12,-40341101),s=this.ff(s,a,i,o,e[14],17,-1502002290),o=this.ff(o,s,a,i,e[15],22,1236535329),i=this.gg(i,o,s,a,e[1],5,-165796510),a=this.gg(a,i,o,s,e[6],9,-1069501632),s=this.gg(s,a,i,o,e[11],14,643717713),o=this.gg(o,s,a,i,e[0],20,-373897302),i=this.gg(i,o,s,a,e[5],5,-701558691),a=this.gg(a,i,o,s,e[10],9,38016083),s=this.gg(s,a,i,o,e[15],14,-660478335),o=this.gg(o,s,a,i,e[4],20,-405537848),i=this.gg(i,o,s,a,e[9],5,568446438),a=this.gg(a,i,o,s,e[14],9,-1019803690),s=this.gg(s,a,i,o,e[3],14,-187363961),o=this.gg(o,s,a,i,e[8],20,1163531501),i=this.gg(i,o,s,a,e[13],5,-1444681467),a=this.gg(a,i,o,s,e[2],9,-51403784),s=this.gg(s,a,i,o,e[7],14,1735328473),o=this.gg(o,s,a,i,e[12],20,-1926607734),i=this.hh(i,o,s,a,e[5],4,-378558),a=this.hh(a,i,o,s,e[8],11,-2022574463),s=this.hh(s,a,i,o,e[11],16,1839030562),o=this.hh(o,s,a,i,e[14],23,-35309556),i=this.hh(i,o,s,a,e[1],4,-1530992060),a=this.hh(a,i,o,s,e[4],11,1272893353),s=this.hh(s,a,i,o,e[7],16,-155497632),o=this.hh(o,s,a,i,e[10],23,-1094730640),i=this.hh(i,o,s,a,e[13],4,681279174),a=this.hh(a,i,o,s,e[0],11,-358537222),s=this.hh(s,a,i,o,e[3],16,-722521979),o=this.hh(o,s,a,i,e[6],23,76029189),i=this.hh(i,o,s,a,e[9],4,-640364487),a=this.hh(a,i,o,s,e[12],11,-421815835),s=this.hh(s,a,i,o,e[15],16,530742520),o=this.hh(o,s,a,i,e[2],23,-995338651),i=this.ii(i,o,s,a,e[0],6,-198630844),a=this.ii(a,i,o,s,e[7],10,1126891415),s=this.ii(s,a,i,o,e[14],15,-1416354905),o=this.ii(o,s,a,i,e[5],21,-57434055),i=this.ii(i,o,s,a,e[12],6,1700485571),a=this.ii(a,i,o,s,e[3],10,-1894986606),s=this.ii(s,a,i,o,e[10],15,-1051523),o=this.ii(o,s,a,i,e[1],21,-2054922799),i=this.ii(i,o,s,a,e[8],6,1873313359),a=this.ii(a,i,o,s,e[15],10,-30611744),s=this.ii(s,a,i,o,e[6],15,-1560198380),o=this.ii(o,s,a,i,e[13],21,1309151649),i=this.ii(i,o,s,a,e[4],6,-145523070),a=this.ii(a,i,o,s,e[11],10,-1120210379),s=this.ii(s,a,i,o,e[2],15,718787259),o=this.ii(o,s,a,i,e[9],21,-343485551),t[0]=this.add32(i,t[0]),t[1]=this.add32(o,t[1]),t[2]=this.add32(s,t[2]),t[3]=this.add32(a,t[3])}cmn(t,e,i,o,s,a){return e=this.add32(this.add32(e,t),this.add32(o,a)),this.add32(e<>>32-s,i)}ff(t,e,i,o,s,a,r){return this.cmn(e&i|~e&o,t,e,s,a,r)}gg(t,e,i,o,s,a,r){return this.cmn(e&o|i&~o,t,e,s,a,r)}hh(t,e,i,o,s,a,r){return this.cmn(e^i^o,t,e,s,a,r)}ii(t,e,i,o,s,a,r){return this.cmn(i^(e|~o),t,e,s,a,r)}md51(t){const e=t.length,i=[1732584193,-271733879,-1732584194,271733878];let o;for(o=64;o<=t.length;o+=64)this.md5cycle(i,this.md5blk(t.substring(o-64,o)));t=t.substring(o-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(o=0;o>2]|=t.charCodeAt(o)<<(o%4<<3);if(s[o>>2]|=128<<(o%4<<3),o>55)for(this.md5cycle(i,s),o=0;o<16;o++)s[o]=0;return s[14]=e*8,this.md5cycle(i,s),i}md5blk(t){const e=[];for(let i=0;i<64;i+=4)e[i>>2]=t.charCodeAt(i)+(t.charCodeAt(i+1)<<8)+(t.charCodeAt(i+2)<<16)+(t.charCodeAt(i+3)<<24);return e}rhex(t){const e="0123456789abcdef".split("");let i="",o=0;for(;o<4;o++)i+=e[t>>o*8+4&15]+e[t>>o*8&15];return i}hex(t){for(let e=0;e>16)+(e>>16)+(i>>16)<<16|i&65535}};function missingOrEmpty(t){return t==null||t.length===0}var LICENSE_TYPES={"01":"GRID","02":"CHARTS","0102":"BOTH"},LICENSING_HELP_URL="https://www.ag-grid.com/charts/licensing/",_LicenseManager=class at{constructor(e){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=e,this.md5=new MD5,this.md5.init()}validateLicense(){const e=this.getLicenseDetails(at.licenseKey,at.gridContext),i=`AG ${e.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let o="";if(e.suppliedLicenseType==="BOTH"?o="AG Grid and AG Charts Enterprise":e.suppliedLicenseType==="GRID"?o="AG Grid Enterprise":e.suppliedLicenseType!==void 0&&(o="AG Charts Enterprise"),e.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(e.expired){const s=at.getChartsReleaseDate(),a=at.formatDate(s);this.outputExpiredKey(e.expiry,a,o)}else e.valid?e.isTrial&&e.trialExpired&&this.outputExpiredTrialKey(e.expiry,i,o):this.outputInvalidLicenseKey(!!e.incorrectLicenseType,i,o)}static extractExpiry(e){const i=e.substring(e.lastIndexOf("_")+1,e.length);return new Date(Number.parseInt(at.decode(i),10))}static extractLicenseComponents(e){let i=e.replaceAll(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replaceAll(/\r?\n|\r/g,""),e.length<=32)return{md5:null,license:e,version:null,isTrial:null};const o=i.length-32,s=i.substring(o),a=i.substring(0,o),[r,n,l]=at.extractBracketedInformation(i);return{md5:s,license:a,version:r,isTrial:n,type:l}}getLicenseDetails(e,i=!1){const o="CHARTS";if(missingOrEmpty(e))return{licenseKey:e,valid:!1,missing:!0,currentLicenseType:o};const s=at.getChartsReleaseDate(),{md5:a,license:r,version:n,isTrial:l,type:c}=at.extractLicenseComponents(e);let h=a===this.md5.md5(r)&&!e.includes("For_Trialing_ag-Grid_Only"),d,u,p=null,g=!1,y;function f(){d=pp,n){case"legacy":case"2":{h=!1;break}case"3":missingOrEmpty(c)?h=!1:(y=c,c!==LICENSE_TYPES["02"]&&c!==LICENSE_TYPES["0102"]?(h=!1,g=!0):l&&f())}return h?{licenseKey:e,valid:h,expiry:at.formatDate(p),expired:u,version:n,isTrial:l,trialExpired:d,invalidLicenseTypeForCombo:i?y!=="BOTH":void 0,incorrectLicenseType:g,currentLicenseType:o,suppliedLicenseType:y}:{licenseKey:e,valid:h,incorrectLicenseType:g,currentLicenseType:o,suppliedLicenseType:y}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!missingOrEmpty(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const e=this.document.defaultView??globalThis;if(!e)return"localhost";const i=e.location,{hostname:o=""}=i;return o}isForceWatermark(){if(!this.document)return!1;const e=this.document?.defaultView??globalThis.window!=null?globalThis:void 0;if(!e)return!1;const{pathname:i}=e.location;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){const e=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(e)!==null}isLocalhost(){const e=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(e)!==null}isE2ETest(){const e=this.getHostname();return/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(e)!==null}static formatDate(e){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],o=e.getDate(),s=e.getMonth(),a=e.getFullYear();return o+" "+i[s]+" "+a}static getChartsReleaseDate(){return new Date(Number.parseInt(at.decode(at.RELEASE_INFORMATION),10))}static decode(e){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let o="",s,a,r,n,l,c,h,d=0;const u=e.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;d>4,a=(l&15)<<4|c>>2,r=(c&3)<<6|h,o=o+String.fromCodePoint(s),c!=64&&(o=o+String.fromCodePoint(a)),h!=64&&(o=o+String.fromCodePoint(r));return o=at.utf8_decode(o),o}static utf8_decode(e){e=e.replaceAll("rn","n");let i="";for(let o=0;o127&&s<2048?(i+=String.fromCodePoint(s>>6|192),i+=String.fromCodePoint(s&63|128)):(i+=String.fromCodePoint(s>>12|224),i+=String.fromCodePoint(s>>6&63|128),i+=String.fromCodePoint(s&63|128))}return i}static setGridContext(e=!1){at.gridContext=e}static setLicenseKey(e){this.licenseKey&&this.licenseKey!==e&&console.warn("License Key being set multiple times with different values. This can result in an incorrect license key being used."),at.licenseKey=e}static extractBracketedInformation(e){if(!e.includes("["))return["legacy",!1,void 0];const i=e.match(/\[(.*?)\]/g).map(n=>n.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const o=i.filter(n=>n==="TRIAL").length===1,s=i.find(n=>n.startsWith("v")),a=s?s.replace("v",""):"legacy",r=LICENSE_TYPES[i.find(n=>LICENSE_TYPES[n])];return[a,o,r]}centerPadAndOutput(e){const i=this.totalMessageLength-e.length;console.error(e.padStart(i/2+e.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(e,i="*",o=""){console.error(e.padEnd(this.totalMessageLength-o.length,i)+o)}outputInvalidLicenseKey(e,i,o){at.gridContext||(e?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${o} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${LICENSING_HELP_URL}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${LICENSING_HELP_URL}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(e,i,o){at.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${o} expired on ${e}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(e){at.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${e} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${e} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(e,i,o){at.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${o} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${o} released before ${e}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};_LicenseManager.RELEASE_INFORMATION="MTc2MTcyODQ5OTU1NQ==",_LicenseManager.gridContext=!1;var LicenseManager=_LicenseManager,import_ag_charts_community282=require("ag-charts-community"),import_ag_charts_community5=require("ag-charts-community"),import_ag_charts_core4=require("ag-charts-core");function loopSymmetrically(t,e,i){const o=(a,r,n,l)=>{let c=t[0];for(let h=a;n>0?h<=r:h>r;h+=n){const d=t[h];if(l(c,d))return!0;c=d}return!1},s=Math.floor(t.length/2);return o(e,s,e,i)?!0:o(t.length-e,s,-e,i)}var import_ag_charts_community=require("ag-charts-community"),{AxisInterval,Property}=import_ag_charts_community._ModuleSupport,AngleAxisInterval=class extends AxisInterval{};__decorateClass([Property],AngleAxisInterval.prototype,"minSpacing",2);var import_ag_charts_community4=require("ag-charts-community"),import_ag_charts_core3=require("ag-charts-core"),import_ag_charts_community3=require("ag-charts-community"),import_ag_charts_core2=require("ag-charts-core"),import_ag_charts_community2=require("ag-charts-community"),import_ag_charts_core=require("ag-charts-core"),{BaseProperties,ChartAxisDirection,Property:Property2,Group,FONT_SIZE}=import_ag_charts_community2._ModuleSupport,PolarCrossLineLabel=class extends BaseProperties{constructor(){super(...arguments),this.fontSize=FONT_SIZE.LARGE,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};__decorateClass([Property2],PolarCrossLineLabel.prototype,"enabled",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"text",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"fontStyle",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"fontWeight",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"fontSize",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"fontFamily",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"padding",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"color",2),__decorateClass([Property2],PolarCrossLineLabel.prototype,"parallel",2);var PolarCrossLine=class extends BaseProperties{constructor(){super(...arguments),this.id=(0,import_ag_charts_core.createId)(this),this.defaultColorRange=[],this.shape="polygon",this.label=new PolarCrossLineLabel,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=ChartAxisDirection.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Group({name:this.id}),this.rangeGroup=new Group({name:this.id}),this.labelGroup=new Group({name:this.id}),this._isRange=void 0}assignCrossLineGroup(t,e){t!==this._isRange&&(t?this.rangeGroup.appendChild(e):this.lineGroup.appendChild(e)),this._isRange=t}setSectorNodeProps(t){t.fill=this.fill,t.fillOpacity=this.fillOpacity??1,t.stroke=this.stroke,t.strokeOpacity=this.strokeOpacity??1,t.strokeWidth=this.strokeWidth??1,t.lineDash=this.lineDash}setLabelNodeProps(t,e,i,o,s){const{label:a}=this;t.x=e,t.y=i,t.text=a.text,t.textAlign="center",t.textBaseline=o,t.rotation=s,t.rotationCenterX=e,t.rotationCenterY=i,t.fill=a.color,t.fontFamily=a.fontFamily,t.fontSize=a.fontSize,t.fontStyle=a.fontStyle,t.visible=!0}};__decorateClass([Property2],PolarCrossLine.prototype,"enabled",2),__decorateClass([Property2],PolarCrossLine.prototype,"type",2),__decorateClass([Property2],PolarCrossLine.prototype,"range",2),__decorateClass([Property2],PolarCrossLine.prototype,"value",2),__decorateClass([Property2],PolarCrossLine.prototype,"defaultColorRange",2),__decorateClass([Property2],PolarCrossLine.prototype,"fill",2),__decorateClass([Property2],PolarCrossLine.prototype,"fillOpacity",2),__decorateClass([Property2],PolarCrossLine.prototype,"stroke",2),__decorateClass([Property2],PolarCrossLine.prototype,"strokeWidth",2),__decorateClass([Property2],PolarCrossLine.prototype,"strokeOpacity",2),__decorateClass([Property2],PolarCrossLine.prototype,"lineDash",2),__decorateClass([Property2],PolarCrossLine.prototype,"shape",2),__decorateClass([Property2],PolarCrossLine.prototype,"label",2);var{ChartAxisDirection:ChartAxisDirection2,getCrossLineValue,validateCrossLineValue,normalizeAngle360,Group:Group2,Path,Sector,RotatableText,ContinuousScale}=import_ag_charts_community3._ModuleSupport,AngleCrossLine=class extends PolarCrossLine{constructor(){super(),this.direction=ChartAxisDirection2.Angle,this.polygonNode=new Path,this.sectorNode=new Sector,this.lineNode=new Path,this.crossLineRange=new Group2,this.labelNode=new RotatableText,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!ContinuousScale.is(this.scale))return!0;const[t,e]=this.scale.domain,i=getCrossLineValue(this);if(this.type==="range"){const[o,s]=i;return o>=t&&o<=e&&s>=o&&s<=e}else return i>=t&&i<=e}update(t){const{scale:e}=this;if(!e||!validateCrossLineValue(this,e)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateLineNode(t),this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t)}updateLineNode(t){const{scale:e,type:i,value:o,lineNode:s}=this;if(!t||i!=="line"||!e){s.visible=!1;return}const a=e.convert(o);if(Number.isNaN(a)){s.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:n}=this;s.visible=!0,s.stroke=this.stroke,s.strokeOpacity=this.strokeOpacity??1,s.strokeWidth=this.strokeWidth??1,s.fill=void 0,s.lineDash=this.lineDash;const l=n*Math.cos(a),c=n*Math.sin(a),h=r*Math.cos(a),d=r*Math.sin(a);s.path.clear(!0),s.path.moveTo(h,d),s.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(t){const{polygonNode:e,range:i,scale:o,shape:s,type:a,ticks:r}=this;if(!t||a!=="range"||s!=="polygon"||!o||!i){e.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:l}=this,c=r.indexOf(i[0]),h=r.indexOf(i[1]),u=(c<=h?r.slice(c,h+1):r.slice(c).concat(r.slice(0,h+1))).map(g=>o.convert(g));e.visible=!0,this.setSectorNodeProps(e);const{path:p}=e;p.clear(!0);for(const[g,y]of u.entries()){const f=l*Math.cos(y),x=l*Math.sin(y);g===0?p.moveTo(f,x):p.lineTo(f,x)}if(n===0)p.lineTo(0,0);else{const g=u.slice().reverse();for(const y of g){const f=n*Math.cos(y),x=n*Math.sin(y);p.lineTo(f,x)}}e.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(t){const{sectorNode:e,range:i,scale:o,shape:s,type:a}=this;if(!t||a!=="range"||s!=="circle"||!o||!i){e.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:n}=this,l=i.map(d=>o.convert(d)),c=o.step??0,h=o instanceof import_ag_charts_community3._ModuleSupport.BandScale?c/2:0;e.visible=!0,this.setSectorNodeProps(e),e.centerX=0,e.centerY=0,e.innerRadius=r,e.outerRadius=n,e.startAngle=l[0]-h,e.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(t){const{label:e,labelNode:i,range:o,scale:s,type:a,ticks:r}=this;if(!t||e.enabled===!1||!e.text||!s||a==="range"&&!o){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:n,axisOuterRadius:l}=this;let c,h,d,u;if(a==="line"){const p=normalizeAngle360(s.convert(this.value)),g=1.5*Math.PI,y=(0,import_ag_charts_core2.isNumberEqual)(p,g)||p>g||pnormalizeAngle360(s.convert(b)));let y=(p+g)/2;p>g&&(y-=Math.PI),y=normalizeAngle360(y);const f=((0,import_ag_charts_core2.isNumberEqual)(y,0)||y>0)&&yl.value),n=r.reduce((l,c)=>Math.max(typeof c=="number"?(0,import_ag_charts_core3.countFractionDigits)(c):0,l),0);return{niceDomain:s,tickDomain:s,ticks:r,rawTickCount:void 0,fractionDigits:n,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const t=normalizeAngle3602(-Math.PI/2+toRadians(this.startAngle)),e=this.endAngle==null?2*Math.PI:normalizeAngle360Inclusive(toRadians(this.endAngle)-toRadians(this.startAngle)),i=t+e;return[t,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const t=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?t:[]),this.tickLineGroupSelection.update(this.tick.enabled?t:[]),this.tickLabelGroupSelection.update(this.label.enabled?t:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:t,radiusLineGroup:e}=this,i=Math.floor(t.x),o=Math.floor(t.y);e.translationX=i,e.translationY=o}updateRadiusLine(){const t=this.radiusLine,{path:e}=t;e.clear(!0);const{points:i,closePath:o}=this.getAxisLinePoints();for(const{x:s,y:a,moveTo:r,arc:n,radius:l=0,startAngle:c=0,endAngle:h=0}of i)n?e.arc(s,a,l,c,h):r?e.moveTo(s,a):e.lineTo(s,a);o&&e.closePath(),t.visible=this.line.enabled,t.stroke=this.line.stroke,t.strokeWidth=this.line.width,t.fill=void 0}getAxisLinePoints(){const{scale:t,shape:e,gridLength:i}=this,[o,s]=this.range,a=(0,import_ag_charts_core3.isNumberEqual)(s-o,2*Math.PI),r=[];if(e==="circle")a?r.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):r.push({x:i*Math.cos(o),y:i*Math.sin(o),moveTo:!0},{x:0,y:0,radius:i,startAngle:normalizeAngle3602(o),endAngle:normalizeAngle3602(s),arc:!0,moveTo:!1});else if(e==="polygon"){const n=t.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>t.convert(l));if(n&&n.length>2)for(const[l,c]of n.entries()){const h=i*Math.cos(c),d=i*Math.sin(c),u=l===0;r.push({x:h,y:d,moveTo:u})}}return{points:r,closePath:a}}updateGridLines(){const{scale:t,gridLength:e,gridLine:{style:i,width:o},innerRadiusRatio:s}=this;if(!(i&&e>0))return;const a=e*s,r=i.length;this.gridLineGroupSelection.each((n,l,c)=>{const{value:h}=l,{stroke:d,lineDash:u}=i[c%r],p=t.convert(h);n.x1=a*Math.cos(p),n.y1=a*Math.sin(p),n.x2=e*Math.cos(p),n.y2=e*Math.sin(p),n.stroke=d,n.strokeWidth=o,n.lineDash=u,n.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:t,tickLabelGroupSelection:e}=this;e.each((i,o,s)=>{const a=this.labelData[s];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(t),i.fill=t.color,i.x=a.x,i.y=a.y,i.setAlign(a),i.setBoxing(t),i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:t,gridLength:e,tick:i,tickLineGroupSelection:o}=this;o.each((s,a)=>{const{value:r}=a,n=t.convert(r),l=Math.cos(n),c=Math.sin(n);s.x1=e*l,s.y1=e*c,s.x2=(e+i.size)*l,s.y2=(e+i.size)*c,s.stroke=i.stroke,s.strokeWidth=i.width})}createLabelNodeData(t,e,i){const{label:o,gridLength:s,scale:a,tick:r}=this;if(!o.enabled)return[];const n=new RotatableText2,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,d=this.tickFormatter(this.scale.domain,this.tickData,!1,h),u=t.map((p,g)=>{const{value:y}=p,f=s+o.spacing+r.size,x=a.convert(y),b=Math.cos(x),m=Math.sin(x),S=f*b,v=f*m,{textAlign:M,textBaseline:D}=this.getLabelAlign(x),k=g===t.length-1&&y!==t[0]&&(0,import_ag_charts_core3.isNumberEqual)(normalizeAngle3602(x),normalizeAngle3602(a.convert(t[0]))),_=this.getLabelRotation(x);let T=d(y,g);n.text=T,n.x=S,n.y=v,n.setFont(o),n.textAlign=M,n.textBaseline=D,n.rotation=_,_&&(n.rotationCenterX=S,n.rotationCenterY=v);let w=_?Transformable.toCanvas(n):n.getBBox();if(w&&e.hideWhenNecessary&&!_){const R=l-w.x,F=w.x+w.width-c,O=1;if(R>O||F>O){const I={maxWidth:w.width-Math.max(R,F),font:o,textWrap:"never"};T=(0,import_ag_charts_core3.wrapTextOrSegments)(T,I),n.text=T,w=n.getBBox()}}return{text:T,x:S,y:v,textAlign:M,textBaseline:D,hidden:T===""||(p.hidden??k),rotation:_,box:w}});return o.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(t,e){this.labelData=this.createLabelNodeData(this.tickData,t,e);const i=this.labelData.map(({box:o})=>o).filter(o=>o!=null);return!this.label.enabled||i.length===0?null:BBox.merge(i)}getLabelOrientation(){const{label:t}=this;return t instanceof AngleAxisLabel?t.orientation:"fixed"}getLabelRotation(t){let e=toRadians(this.label.rotation??0);t=normalizeAngle3602(t);const i=this.getLabelOrientation();return i==="parallel"?(e+=t,t>=0&&t=Math.PI/2&&t<1.5*Math.PI&&(e+=Math.PI)),e}getLabelAlign(t){const e=Math.cos(t),i=Math.sin(t);let o,s;const a=this.getLabelOrientation(),r=(0,import_ag_charts_core3.isNumberEqual)(e,0),n=(0,import_ag_charts_core3.isNumberEqual)(i,0),l=(0,import_ag_charts_core3.isNumberEqual)(e,1),c=(0,import_ag_charts_core3.isNumberEqual)(i,-1),h=e>0&&!r,d=i>0&&!n;return a==="parallel"?(o="center",s=l&&n||d?"top":"bottom"):a==="perpendicular"?(o=c||h?"left":"right",s="middle"):(o="right",r?o="center":h&&(o="left"),s="bottom",n?s="middle":d&&(s="top")),{textAlign:o,textBaseline:s}}updateCrossLines(){const{shape:t,gridLength:e,innerRadiusRatio:i}=this;for(const o of this.crossLines)o instanceof AngleCrossLine&&(o.ticks=this.tickData.map(s=>s.value),o.shape=t,o.axisOuterRadius=e,o.axisInnerRadius=e*i);super.updateCrossLines()}};AngleAxis.CrossLineConstructor=AngleCrossLine,__decorateClass([Property3],AngleAxis.prototype,"startAngle",2),__decorateClass([Property3],AngleAxis.prototype,"endAngle",2);var{Property:Property4,CategoryScale}=import_ag_charts_community5._ModuleSupport,AngleCategoryAxis=class extends AngleAxis{constructor(t){super(t,new CategoryScale),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new AngleAxisInterval}hasDefinedDomain(){return!1}generateAngleTicks(t){const{scale:e,gridLength:i}=this,{values:o,minSpacing:s}=this.interval,a={nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},r=o??e.ticks(a,t)?.ticks??[];if(r.length<2||s==null)return r.map(d=>({value:d,visible:!0}));const n=r[0],l=e.convert(n),c=i*Math.cos(l),h=i*Math.sin(l);for(let d=1;dMath.PI)break;const g=i*Math.cos(p),y=i*Math.sin(p);if(Math.hypot(g-c,y-h)>s){const x=new Set([n]);return loopSymmetrically(r,d,(b,m)=>{x.add(m)}),r.map(b=>{const m=x.has(b);return{value:b,visible:m}})}}return[{value:n,visible:!0}]}avoidLabelCollisions(t){const{minSpacing:e}=this.label;if(t.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(e==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(e/2),d=c.box.clone().grow(e/2);return h.collidesBBox(d)},o=t[0],s=t.at(-1),a=new Set([o]),r=(0,import_ag_charts_core4.isNumberEqual)(o.x,s.x)&&(0,import_ag_charts_core4.isNumberEqual)(o.y,s.y),n=Math.floor(t.length/2);for(let l=1;l<=n;l++){const c=r?t.slice(0,-1):t;if(!loopSymmetrically(c,l,i)){loopSymmetrically(c,l,(d,u)=>{a.add(u)});break}}for(const l of t)a.has(l)||(l.hidden=!0,l.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(t,e){const{datum:i,seriesId:o,legendItemName:s,key:a,source:r,property:n,domain:l,boundSeries:c}=e;return{type:"category",value:t,datum:i,seriesId:o,legendItemName:s,key:a,source:r,property:n,domain:l,boundSeries:c}}};AngleCategoryAxis.className="AngleCategoryAxis",AngleCategoryAxis.type="angle-category",__decorateClass([Property4],AngleCategoryAxis.prototype,"groupPaddingInner",2),__decorateClass([Property4],AngleCategoryAxis.prototype,"paddingInner",2),__decorateClass([Property4],AngleCategoryAxis.prototype,"interval",2);var AngleCategoryAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:t=>new AngleCategoryAxis(t)},import_ag_charts_community7=require("ag-charts-community"),import_ag_charts_core6=require("ag-charts-core"),import_ag_charts_community6=require("ag-charts-community"),import_ag_charts_core5=require("ag-charts-core"),{range,isDenseInterval,LinearScale}=import_ag_charts_community6._ModuleSupport,LinearAngleScale=class ft extends LinearScale{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(e,i){const[o,s]=i;let a=LinearScale.getTickStep(o,s,e);const r=Number.isNaN(e.maxTickCount)?1/0:e.maxTickCount,n=Math.abs(s-o)/a;let l=Math.pow(2,Math.ceil(Math.log(n)/Math.log(2)));return l>r&&(l/=2,a*=2),{count:l,step:a}}ticks(e,i=this.domain){const{arcLength:o}=this;if(!i||i.length<2||i.some(c=>!Number.isFinite(c))||o<=0)return{ticks:[],count:0};const{nice:s,interval:a}=e,[r,n]=i;if(a){const c=Math.abs(a),h=this.getPixelRange();if(!isDenseInterval((n-r)/c,h))return range(r,n,c)}let l;if(s&&this.hasNiceRange()){const c=super.niceDomain(e,i);l=ft.getNiceStepAndTickCount(e,c).step}else l=LinearScale.getTickStep(r,n,e);return range(r,n,l)}hasNiceRange(){const e=this.range.slice().sort((o,s)=>o-s);return[Math.PI,2*Math.PI].some(o=>(0,import_ag_charts_core5.isNumberEqual)(o,e[1]-e[0]))}niceDomain(e,i=this.domain){const o=super.niceDomain(e,i);if(!this.hasNiceRange())return o;const s=o[0]>o[1],a=s?o[1]:o[0],{step:r,count:n}=ft.getNiceStepAndTickCount(e,o),l=1/r,c=r>=1?Math.ceil(a/r+n)*r:Math.ceil((a+n*r)*l)/l;return s?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{Property:Property5,angleBetween,normalisedExtentWithMetadata,findMinMax}=import_ag_charts_community7._ModuleSupport,AngleNumberAxis=class extends AngleAxis{constructor(t){super(t,new LinearAngleScale),this.shape="circle",this.interval=new AngleAxisInterval}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&td>=c&&d<=h).sort((d,u)=>d-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(t){const{minSpacing:e}=this.label,i=(a,r)=>{if(a.hidden||r.hidden)return!1;if(e==null)return a.box.collidesBBox(r.box);const n=a.box.clone().grow(e/2),l=r.box.clone().grow(e/2);return n.collidesBBox(l)},o=t[0],s=t.at(-1);o!==s&&(0,import_ag_charts_core6.isNumberEqual)(o.x,s.x)&&(0,import_ag_charts_core6.isNumberEqual)(o.y,s.y)&&(s.hidden=!0);for(let a=1;a0&&(l.hidden=!0,l.box=void 0);return}}for(const[a,r]of t.entries())a>0&&(r.hidden=!0,r.box=void 0)}tickFormatParams(t,e,i){return{type:"number",fractionDigits:i}}datumFormatParams(t,e,i){const{datum:o,seriesId:s,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:h}=e;return{type:"number",value:t,datum:o,seriesId:s,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:h,fractionDigits:i}}};AngleNumberAxis.className="AngleNumberAxis",AngleNumberAxis.type="angle-number",__decorateClass([Property5],AngleNumberAxis.prototype,"min",2),__decorateClass([Property5],AngleNumberAxis.prototype,"max",2),__decorateClass([Property5],AngleNumberAxis.prototype,"interval",2);var AngleNumberAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:t=>new AngleNumberAxis(t)},import_ag_charts_community8=require("ag-charts-community"),{OrdinalTimeScale,Property:Property6,TimeAxisParentLevel,lowestGranularityUnitForTicks,lowestGranularityUnitForValue,minimumTimeAxisDatumGranularity,dateTruncationForDomain,intervalUnit,intervalStep,intervalEpoch,intervalMilliseconds}=import_ag_charts_community8._ModuleSupport,OrdinalTimeAxis=class extends import_ag_charts_community8._ModuleSupport.DiscreteTimeAxis{constructor(t){super(t,new OrdinalTimeScale),this.parentLevel=new TimeAxisParentLevel}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}processData(){super.processData();const{boundSeries:t,direction:e}=this;this.minimumTimeGranularity=minimumTimeAxisDatumGranularity(t,e,void 0,void 0)}tickFormatParams(t,e,i,o){o??(o=lowestGranularityUnitForTicks(e));const s=dateTruncationForDomain(t),a=intervalUnit(o),r=intervalStep(o),n=intervalEpoch(o);return{type:"date",unit:a,step:r,epoch:n,truncateDate:s}}datumFormatParams(t,e,i,o,s){if(typeof t=="number"&&(t=new Date(t)),o==null){const{minimumTimeGranularity:f}=this,x=lowestGranularityUnitForValue(t);f!=null&&intervalMilliseconds(f)new OrdinalTimeAxis(t)},import_ag_charts_community11=require("ag-charts-community"),import_ag_charts_community10=require("ag-charts-community"),import_ag_charts_core8=require("ag-charts-core"),import_ag_charts_community9=require("ag-charts-community"),import_ag_charts_core7=require("ag-charts-core"),{ChartAxisDirection:ChartAxisDirection4,Property:Property7,validateCrossLineValue:validateCrossLineValue2,normalizeAngle360FromDegrees,Group:Group3,Path:Path3,Sector:Sector2,RotatableText:RotatableText3}=import_ag_charts_community9._ModuleSupport,RadiusCrossLineLabel=class extends PolarCrossLineLabel{constructor(){super(...arguments),this.positionAngle=void 0}};__decorateClass([Property7],RadiusCrossLineLabel.prototype,"positionAngle",2);var RadiusCrossLine=class extends PolarCrossLine{constructor(){super(),this.direction=ChartAxisDirection4.Radius,this.label=new RadiusCrossLineLabel,this.polygonNode=new Path3,this.sectorNode=new Sector2,this.crossLineRange=new Group3,this.labelNode=new RotatableText3,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(t){const{scale:e}=this;if(!e||!validateCrossLineValue2(this,e)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:o}=this;t&&(t=i>=this.axisInnerRadius&&o<=this.axisOuterRadius),this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updatePolygonNode(t),this.updateSectorNode(t),this.updateLabelNode(t),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:t,scale:e,type:i,axisInnerRadius:o,axisOuterRadius:s}=this;if(!e)return{innerRadius:0,outerRadius:0};const a=l=>s+o-l;let r,n;if(i==="line")r=a(e.convert(this.value)),n=r;else{const l=Math.abs(e?.bandwidth??0),c=t.map(h=>e.convert(h));r=a(Math.max(...c)),n=a(Math.min(...c))+l}this.outerRadius=r,this.innerRadius=n}drawPolygon(t,e,i){for(const[o,s]of e.entries()){const a=t*Math.cos(s),r=t*Math.sin(s);o===0?i.path.moveTo(a,r):i.path.lineTo(a,r)}i.path.closePath()}updatePolygonNode(t){const{gridAngles:e,polygonNode:i,scale:o,shape:s,type:a,innerRadius:r,outerRadius:n}=this;if(!t||s!=="polygon"||!o||!e){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(n-l,e,i);const c=e.slice().reverse(),h=a==="line"?n-l:r+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(t){const{axisInnerRadius:e,axisOuterRadius:i,scale:o,sectorNode:s,shape:a,innerRadius:r,outerRadius:n}=this;if(!t||a!=="circle"||!o){s.visible=!1;return}s.visible=!0,s.startAngle=0,s.endAngle=2*Math.PI;const l=this.getPadding(),c=(0,import_ag_charts_core7.clamp)(e,r+l,i),h=(0,import_ag_charts_core7.clamp)(e,n-l,i);s.innerRadius=Math.min(c,h),s.outerRadius=Math.max(c,h),this.setSectorNodeProps(s)}updateLabelNode(t){const{innerRadius:e,label:i,labelNode:o,scale:s,shape:a,type:r}=this;if(!t||i.enabled===!1||!i.text||!s){o.visible=!1;return}const n=normalizeAngle360FromDegrees((i.positionAngle??0)-90),l=((0,import_ag_charts_core7.isNumberEqual)(n,0)||n>0)&&nthis.tickFormatter(...b),domain:t,range:r,reverse:n,niceMode:e,visibleRange:o,defaultTickMinSpacing:l,labelOffset:a,sideFlag:s,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:h}=c,{ticks:d,rawTicks:u,rawTickCount:p,tickDomain:g,fractionDigits:y,niceDomain:f=t}=h,x=d.map(b=>this.getTickLabelProps(b,c));return this.generatedTicks={ticks:d,labels:x},{ticks:u,tickDomain:g,niceDomain:f,rawTickCount:p,fractionDigits:y,timeInterval:void 0}}updateSelections(){const{generatedTicks:t}=this;if(!t)return;const{ticks:e,labels:i}=t;this.gridLineGroupSelection.update(this.gridLength?e:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(e):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const t=import_ag_charts_community10._ModuleSupport.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.color,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center",e.setFont(i),e.setBoxing(i),e.setProperties(t(e,i))})}updateGridLines(){const{gridLine:{style:t,width:e},shape:i,generatedTicks:o}=this;if(!t||!o)return;const s=t.length,a=(u,p)=>{const{stroke:g,lineDash:y}=t[p%s];u.stroke=g,u.strokeWidth=e,u.lineDash=y,u.fill=void 0},[r,n]=this.gridRange??[0,2*Math.PI],l=(0,import_ag_charts_core8.isNumberEqual)(n-r,2*Math.PI),d=i==="circle"?(u,p)=>{const{path:g}=u;g.clear(!0);const y=this.getTickRadius(p);l?(g.moveTo(y,0),g.arc(0,0,y,0,2*Math.PI)):(g.moveTo(y*Math.cos(r),y*Math.sin(r)),g.arc(0,0,y,normalizeAngle3603(r),normalizeAngle3603(n))),l&&g.closePath()}:(u,p)=>{const{path:g}=u,y=this.gridAngles;if(g.clear(!0),!y||y.length<3)return;const f=this.getTickRadius(p);for(const[x,b]of y.entries()){const m=f*Math.cos(b),S=f*Math.sin(b);x===0?g.moveTo(m,S):g.lineTo(m,S);for(const[v,M]of y.entries()){const D=f*Math.cos(M),k=f*Math.sin(M);v===0?g.moveTo(D,k):g.lineTo(D,k)}g.closePath()}g.closePath()};this.gridPathSelection.each((u,p,g)=>{a(u,g),d(u,p)})}updateTitle(){const t=r=>r.defaultValue,{title:e,range:i}=this,{formatter:o=t}=this.title;e.caption.enabled=e.enabled,e.caption.fontFamily=e.fontFamily,e.caption.fontSize=e.fontSize,e.caption.fontStyle=e.fontStyle,e.caption.fontWeight=e.fontWeight,e.caption.color=e.color,e.caption.wrapping=e.wrapping;let s=!1;const a=e.caption.node;e.enabled&&(s=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-Caption.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(o,this.getTitleFormatterParams(this.scale.domain))),a.visible=s}updateCrossLines(){for(const t of this.crossLines)if(t instanceof RadiusCrossLine){const{shape:e,gridAngles:i,range:o,innerRadiusRatio:s}=this,a=o[0];t.shape=e,t.gridAngles=i,t.axisOuterRadius=a,t.axisInnerRadius=a*s}super.updateCrossLines()}createLabel(){return new RadiusAxisLabel}getTickLabelProps(t,e){const{label:i}=this,{rotation:o,textBaseline:s,textAlign:a}=e,r=this.scale.range,n=t.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=n!==""&&n!=null,d=o;return{...this.getLabelStyles({value:t.tick,formattedValue:t.tickLabel}),tickId:t.tickId,rotation:d,text:n,textAlign:a,textBaseline:s,visible:h,x:c,y:t.translation,rotationCenterX:c,rotationCenterY:t.translation,range:r}}};RadiusAxis.CrossLineConstructor=RadiusCrossLine,__decorateClass([Property8],RadiusAxis.prototype,"positionAngle",2);var{ProxyPropertyOnWrite,Property:Property9,CategoryScale:CategoryScale2}=import_ag_charts_community11._ModuleSupport,RadiusCategoryAxis=class extends RadiusAxis{constructor(t){super(t,new CategoryScale2),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(t){return{domain:t,clipped:!1}}prepareGridPathTickData(t){return t.slice().reverse()}getTickRadius(t){const{scale:e,innerRadiusRatio:i}=this,o=e.range[0],s=o*i;if(CategoryScale2.is(e)){const a=e.domain,r=a.length-1-a.indexOf(t.tick);return r===0?s:e.inset+e.step*(r-.5)+e.bandwidth/2}else{const a=(o-s)/e.domain.length;return o-t.translation+s-a/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(t,e){const{datum:i,seriesId:o,legendItemName:s,key:a,source:r,property:n,domain:l,boundSeries:c}=e;return{type:"category",value:t,datum:i,seriesId:o,legendItemName:s,key:a,source:r,property:n,domain:l,boundSeries:c}}};RadiusCategoryAxis.className="RadiusCategoryAxis",RadiusCategoryAxis.type="radius-category",__decorateClass([Property9],RadiusCategoryAxis.prototype,"groupPaddingInner",2),__decorateClass([ProxyPropertyOnWrite("scale","paddingInner"),Property9],RadiusCategoryAxis.prototype,"paddingInner",2),__decorateClass([ProxyPropertyOnWrite("scale","paddingOuter"),Property9],RadiusCategoryAxis.prototype,"paddingOuter",2);var RadiusCategoryAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:t=>new RadiusCategoryAxis(t)},import_ag_charts_community12=require("ag-charts-community"),{Property:Property10,normalisedExtentWithMetadata:normalisedExtentWithMetadata2,LinearScale:LinearScale2}=import_ag_charts_community12._ModuleSupport,RadiusNumberAxis=class extends RadiusAxis{constructor(t){super(t,new LinearScale2),this.shape="polygon"}hasDefinedDomain(){const{min:t,max:e}=this;return t!=null&&e!=null&&to!==i).sort((o,s)=>s.tick-o.tick)}getTickRadius(t){const{scale:e}=this,i=e.range[0],o=i*this.innerRadiusRatio;return i-t.translation+o}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:o,clipped:s}=normalisedExtentWithMetadata2(t,e,i);return{domain:o,clipped:s}}tickFormatParams(t,e,i){return{type:"number",fractionDigits:i}}datumFormatParams(t,e,i){const{datum:o,seriesId:s,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:h}=e;return{type:"number",value:t,datum:o,seriesId:s,legendItemName:a,key:r,source:n,property:l,domain:c,boundSeries:h,fractionDigits:i}}};RadiusNumberAxis.className="RadiusNumberAxis",RadiusNumberAxis.type="radius-number",__decorateClass([Property10],RadiusNumberAxis.prototype,"min",2),__decorateClass([Property10],RadiusNumberAxis.prototype,"max",2);var RadiusNumberAxisModule={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:t=>new RadiusNumberAxis(t)},import_ag_charts_community13=require("ag-charts-community"),{ObserveChanges,Property:Property11}=import_ag_charts_community13._ModuleSupport,Animation=class extends import_ag_charts_community13._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,t.animationManager.skip(!1),this.cleanup.register(()=>{t.animationManager.skip(!0)})}};__decorateClass([ObserveChanges((t,e)=>{t.ctx.animationManager.skip(!e)}),Property11],Animation.prototype,"enabled",2),__decorateClass([ObserveChanges((t,e)=>{t.ctx.animationManager.defaultDuration=e}),Property11],Animation.prototype,"duration",2),__decorateClass([ObserveChanges((t,e)=>{t.ctx.animationManager.maxAnimatableItems=e??1/0}),Property11],Animation.prototype,"maxAnimatableItems",2);var AnimationModule={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:t=>new Animation(t),themeTemplate:{animation:{enabled:!0,maxAnimatableItems:1e3}}},import_ag_charts_community88=require("ag-charts-community"),import_ag_charts_core43=require("ag-charts-core"),import_ag_charts_community14=require("ag-charts-community"),import_ag_charts_core9=require("ag-charts-core"),textInputTemplate_default='',{focusCursorAtEnd}=import_ag_charts_community14._ModuleSupport,moduleId="text-input",canvasOverlay="canvas-overlay",TextInput=class extends import_ag_charts_community14._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=t.domManager.addChild(canvasOverlay,moduleId),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>t.domManager.removeChild(canvasOverlay,moduleId))}setKeyDownHandler(t){this.cleanup.register((0,import_ag_charts_core9.attachListener)(this.element,"keydown",t))}show(t){this.element.innerHTML=textInputTemplate_default;const e=this.element.firstElementChild;(0,import_ag_charts_core9.setAttributes)(e,{role:"textbox","data-preventdefault":!1}),e.isContentEditable||(e.contentEditable="true"),e.setAttribute("placeholder",this.ctx.localeManager.t(t.placeholderText??"inputTextareaPlaceholder")),t.styles?.placeholderColor&&e.style.setProperty("--placeholder-text-color",t.styles?.placeholderColor),e.innerText=t.text??"",e.style.color=t.styles?.color??"inherit",e.style.fontFamily=t.styles?.fontFamily??"inherit",e.style.fontSize=t.styles?.fontSize?`${t.styles.fontSize}px`:"inherit",e.style.fontStyle=t.styles?.fontStyle??"inherit",e.style.fontWeight=typeof t.styles?.fontWeight=="number"?`${t.styles.fontWeight}`:t.styles?.fontWeight??"inherit",focusCursorAtEnd(e),e.addEventListener("input",()=>{this.updatePosition(),t.onChange?.(this.getValue(),this.getBBox())}),e.addEventListener("click",i=>{i.stopPropagation()}),t.layout&&(this.layout=t.layout,this.updatePosition()),t.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(t){this.element.firstElementChild&&(this.element.firstElementChild.style.color=t)}updateFontSize(t){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${t}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:t}=this,e=t.firstElementChild;if(!e)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:o,getTextInputCoords:s,getTextPosition:a,alignment:r,textAlign:n}=this.layout;t.style.setProperty("width",o?`${o}px`:"unset");const l=e.getBoundingClientRect(),c=s(l.height);let h=c.x;r==="center"?h-=(o??l.width)/2:r==="right"&&(h-=o??l.width);const d=a();let u=c.y;d==="center"?u-=l.height/2:d==="bottom"&&(u-=l.height),t.style.setProperty("top",`${u}px`),t.style.setProperty("left",`${h}px`),t.style.setProperty("max-width",`${i.width-h}px`),t.style.setProperty("text-align",r),e.style.setProperty("text-align",n)}getBBox(){const{left:t,top:e,width:i,height:o}=this.element.getBoundingClientRect();return new import_ag_charts_community14._ModuleSupport.BBox(t,e,i,o)}},import_ag_charts_community15=require("ag-charts-community"),{BaseProperties:BaseProperties2,Property:Property12}=import_ag_charts_community15._ModuleSupport,AxesButtons=class extends BaseProperties2{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};__decorateClass([Property12],AxesButtons.prototype,"enabled",2),__decorateClass([Property12],AxesButtons.prototype,"axes",2);var import_ag_charts_community35=require("ag-charts-community"),AnnotationType=(t=>(t.Line="line",t.HorizontalLine="horizontal-line",t.VerticalLine="vertical-line",t.DisjointChannel="disjoint-channel",t.ParallelChannel="parallel-channel",t.FibonacciRetracement="fibonacci-retracement",t.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",t.Callout="callout",t.Comment="comment",t.Note="note",t.Text="text",t.Arrow="arrow",t.ArrowUp="arrow-up",t.ArrowDown="arrow-down",t.DateRange="date-range",t.PriceRange="price-range",t.DatePriceRange="date-price-range",t.QuickDatePriceRange="quick-date-price-range",t))(AnnotationType||{}),ANNOTATION_TYPES=Object.values(AnnotationType);function stringToAnnotationType(t){for(const e of ANNOTATION_TYPES)if(e===t)return e}var import_ag_charts_core24=require("ag-charts-core"),import_ag_charts_community19=require("ag-charts-community"),import_ag_charts_core12=require("ag-charts-core"),import_ag_charts_community16=require("ag-charts-community"),import_ag_charts_core10=require("ag-charts-core"),{BaseProperties:BaseProperties3,FONT_SIZE:FONT_SIZE2,Property:Property13}=import_ag_charts_community16._ModuleSupport,PointProperties=class extends BaseProperties3{};__decorateClass([Property13],PointProperties.prototype,"x",2),__decorateClass([Property13],PointProperties.prototype,"y",2);var ChannelAnnotationMiddleProperties=class extends Stroke(LineStyle(Visible(BaseProperties3))){},AxisLabelProperties=class extends Stroke(LineStyle(Fill(Label(Font(BaseProperties3))))){constructor(){super(...arguments),this.cornerRadius=2}};__decorateClass([Property13],AxisLabelProperties.prototype,"enabled",2),__decorateClass([Property13],AxisLabelProperties.prototype,"cornerRadius",2);var BackgroundProperties=class extends Fill(BaseProperties3){},HandleProperties=class extends Stroke(LineStyle(Fill(BaseProperties3))){},LineTextProperties=class extends Font(BaseProperties3){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};__decorateClass([Property13],LineTextProperties.prototype,"label",2),__decorateClass([Property13],LineTextProperties.prototype,"position",2),__decorateClass([Property13],LineTextProperties.prototype,"alignment",2);var LabelTextProperties=class extends Font(BaseProperties3){},ChannelTextProperties=class extends Font(BaseProperties3){constructor(){super(...arguments),this.label=""}};__decorateClass([Property13],ChannelTextProperties.prototype,"label",2),__decorateClass([Property13],ChannelTextProperties.prototype,"position",2),__decorateClass([Property13],ChannelTextProperties.prototype,"alignment",2);function Annotation(t){class e extends Writeable(Visible(t)){constructor(){super(...arguments),this.id=(0,import_ag_charts_core10.generateUUID)()}}return e}function Line3(t){class e extends t{constructor(){super(...arguments),this.start=new PointProperties,this.end=new PointProperties}}return __decorateClass([Property13],e.prototype,"start",2),__decorateClass([Property13],e.prototype,"end",2),e}function Point(t){class e extends t{}return __decorateClass([Property13],e.prototype,"x",2),__decorateClass([Property13],e.prototype,"y",2),e}function Value(t){class e extends t{}return __decorateClass([Property13],e.prototype,"value",2),e}function Background(t){class e extends t{constructor(){super(...arguments),this.background=new BackgroundProperties}}return __decorateClass([Property13],e.prototype,"background",2),e}function Handle(t){class e extends t{constructor(){super(...arguments),this.handle=new HandleProperties}}return __decorateClass([Property13],e.prototype,"handle",2),e}function AxisLabel(t){class e extends t{constructor(){super(...arguments),this.axisLabel=new AxisLabelProperties}}return __decorateClass([Property13],e.prototype,"axisLabel",2),e}function Label(t){class e extends t{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return __decorateClass([Property13],e.prototype,"padding",2),__decorateClass([Property13],e.prototype,"textAlign",2),__decorateClass([Property13],e.prototype,"formatter",2),e}function Cappable(t){class e extends t{}return e}function Extendable(t){class e extends t{}return __decorateClass([Property13],e.prototype,"extendStart",2),__decorateClass([Property13],e.prototype,"extendEnd",2),e}function Writeable(t){class e extends t{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return __decorateClass([Property13],e.prototype,"locked",2),__decorateClass([Property13],e.prototype,"readOnly",2),e}function Localisable(t){class e extends t{setLocaleManager(o){this.localeManager??(this.localeManager=o)}}return e}function Visible(t){class e extends t{}return __decorateClass([Property13],e.prototype,"visible",2),e}function Fill(t){class e extends t{}return __decorateClass([Property13],e.prototype,"fill",2),__decorateClass([Property13],e.prototype,"fillOpacity",2),e}function Stroke(t){class e extends t{}return __decorateClass([Property13],e.prototype,"stroke",2),__decorateClass([Property13],e.prototype,"strokeOpacity",2),__decorateClass([Property13],e.prototype,"strokeWidth",2),e}function LineStyle(t){class e extends t{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return __decorateClass([Property13],e.prototype,"lineDash",2),__decorateClass([Property13],e.prototype,"lineDashOffset",2),__decorateClass([Property13],e.prototype,"lineStyle",2),e}function Font(t){class e extends t{constructor(){super(...arguments),this.fontSize=FONT_SIZE2.SMALL,this.fontFamily="Verdana, sans-serif"}}return __decorateClass([Property13],e.prototype,"fontStyle",2),__decorateClass([Property13],e.prototype,"fontWeight",2),__decorateClass([Property13],e.prototype,"fontSize",2),__decorateClass([Property13],e.prototype,"fontFamily",2),__decorateClass([Property13],e.prototype,"color",2),e}var import_ag_charts_community18=require("ag-charts-community"),import_ag_charts_core11=require("ag-charts-core");function getGrouping(t){return(0,import_ag_charts_core11.isNumber)(t)||(0,import_ag_charts_core11.isString)(t)||(0,import_ag_charts_core11.isDate)(t)?{value:t,groupPercentage:0}:t??{value:void 0,groupPercentage:0}}function getGroupingValue(t){return getGrouping(t)?.value}function convertLine(t,e){if(t.start==null||t.end==null)return;const i=convertPoint(t.start,e),o=convertPoint(t.end,e);if(!(i==null||o==null))return{x1:i.x,y1:i.y,x2:o.x,y2:o.y}}function convertPoint(t,e){const i=convert(t.x,e.xAxis),o=convert(t.y,e.yAxis);return{x:i,y:o}}function convert(t,e){if(t==null)return 0;const{value:i,groupPercentage:o}=getGrouping(t),{scale:s,snapToGroup:a}=e,r=s.bandwidth===0?s.step??0:s.bandwidth??0,n=a?r/2:r*o;return s.convert(i)+n}function invertCoords(t,e){const i=invert(t.x,e.xAxis),o=invert(t.y,e.yAxis);return{x:i,y:o}}function invert(t,e){const{scale:i}=e;if(e.continuous&&i.step==null)return e.scaleInvert(t);const o=e.scaleInvertNearest(t),s=i.bandwidth===0?i.step:i.bandwidth??0,a=i.convert(o),r=a+s,n=a===r?0:(t-a)/(r-a);return{value:o,groupPercentage:n}}var import_ag_charts_community17=require("ag-charts-community"),{BaseProperties:BaseProperties4}=import_ag_charts_community17._ModuleSupport,StartEndProperties=class extends Annotation(Line3(Handle(BaseProperties4))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(t){}getDefaultOpacity(t){}},{Property:Property14}=import_ag_charts_community18._ModuleSupport,TextualStartEndProperties=class extends Localisable(Label(Font(StartEndProperties))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;let e=this.text;return t&&(e=this.placeholderText??"",this.localeManager&&(e=this.localeManager.t(e))),{text:e,isPlaceholder:t}}getTextInputCoords(t,e){return convertPoint(this.end,t)}getTextPosition(){return this.position}};__decorateClass([Property14],TextualStartEndProperties.prototype,"text",2);var{Property:Property15,Color}=import_ag_charts_community19._ModuleSupport,DEFAULT_CALLOUT_PADDING={top:6,right:12,bottom:9,left:12},CalloutProperties=class extends Fill(Stroke(TextualStartEndProperties)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(t){return(0,import_ag_charts_core12.isObject)(t)&&t.type==="callout"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=Color.fromString(this.color??"#888888");return new Color(t,e,i,.66).toString()}getPadding(){const{padding:t}=this;return t==null?{...DEFAULT_CALLOUT_PADDING}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),o=this.getPadding(),s=o.left??0,a=o.bottom??0;return{x:i.x+s,y:i.y-a}}};__decorateClass([Property15],CalloutProperties.prototype,"type",2);var import_ag_charts_community21=require("ag-charts-community"),import_ag_charts_core13=require("ag-charts-core"),import_ag_charts_community20=require("ag-charts-community"),{BaseProperties:BaseProperties5,Property:Property16}=import_ag_charts_community20._ModuleSupport,TextualPointProperties=class extends Annotation(Point(Handle(Label(Font(BaseProperties5))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(t){return this.color}getDefaultOpacity(t){}getPlaceholderColor(){}getPadding(){const{padding:t=0}=this;return{top:t,right:t,bottom:t,left:t}}getText(){const t=this.text.length==0;return{text:t?this.placeholderText??"":this.text,isPlaceholder:t}}getTextInputCoords(t,e){return convertPoint(this,t)}getTextPosition(){return this.position}};__decorateClass([Property16],TextualPointProperties.prototype,"text",2);var{Property:Property17,Color:Color2}=import_ag_charts_community21._ModuleSupport,DEFAULT_COMMENT_PADDING={top:8,right:14,bottom:8,left:14},CommentProperties=class extends Fill(Stroke(TextualPointProperties)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(t){return(0,import_ag_charts_core13.isObject)(t)&&t.type==="comment"}getDefaultColor(t){switch(t){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:t,g:e,b:i}=Color2.fromString(this.color??"#888888");return new Color2(t,e,i,.66).toString()}getPadding(){const{padding:t,fontSize:e}=this;return t==null?{top:Math.max(e*.4,DEFAULT_COMMENT_PADDING.top),bottom:Math.max(e*.4,DEFAULT_COMMENT_PADDING.bottom),left:Math.max(e*.8,DEFAULT_COMMENT_PADDING.left),right:Math.max(e*.8,DEFAULT_COMMENT_PADDING.right)}:{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const i=super.getTextInputCoords(t,e),o=this.getPadding();return{x:i.x+o.left,y:i.y-o.bottom}}};__decorateClass([Property17],CommentProperties.prototype,"type",2);var import_ag_charts_community23=require("ag-charts-community"),import_ag_charts_core14=require("ag-charts-core"),import_ag_charts_community22=require("ag-charts-community"),{Vec2}=import_ag_charts_community22._ModuleSupport;function getLineStyle(t,e){return t?"dashed":e??"solid"}function getComputedLineDash(t,e){switch(e){case"solid":return[];case"dashed":return[t*4,t*2];case"dotted":return[0,t*2]}}function getLineDash(t,e,i,o){const s=getLineStyle(t,i);return e??t??getComputedLineDash(o??1,s)}function getLineCap(t,e,i){const o=getLineStyle(e,i);return t??o==="dotted"?"round":void 0}function boundsIntersections(t,e){const[i,o]=Vec2.from(t),s=e.height,a=Vec2.gradient(o,i,s),r=Vec2.intercept(o,a,s),n=[{x:i.x,y:s??0},{x:i.x,y:s==null?e.height:s-e.height}];if(a===1/0)return n;let l=[Vec2.intersectAtY(a,r,0,s),Vec2.intersectAtY(a,r,e.height,s),Vec2.intersectAtX(a,r,0,s),Vec2.intersectAtX(a,r,e.width,s)];return l=l.filter(c=>c.x>=e.x&&c.x<=e.width&&c.y>=e.y&&c.y<=e.height).sort((c,h)=>c.x===h.x?0:c.x{},this.text=new LineTextProperties}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([Property18],MeasurerTypeProperties.prototype,"statistics",2),__decorateClass([Property18],MeasurerTypeProperties.prototype,"text",2);function DateRange(t){class e extends t{constructor(){super(...arguments),this.hasDateRange=!0}}return e}function PriceRange(t){class e extends t{constructor(){super(...arguments),this.hasPriceRange=!0}}return e}var DateRangeProperties=class extends DateRange(MeasurerTypeProperties){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(t){return(0,import_ag_charts_core14.isObject)(t)&&t.type==="date-range"}};__decorateClass([Property18],DateRangeProperties.prototype,"type",2),__decorateClass([Property18],DateRangeProperties.prototype,"extendAbove",2),__decorateClass([Property18],DateRangeProperties.prototype,"extendBelow",2);var PriceRangeProperties=class extends PriceRange(MeasurerTypeProperties){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(t){return(0,import_ag_charts_core14.isObject)(t)&&t.type==="price-range"}};__decorateClass([Property18],PriceRangeProperties.prototype,"type",2),__decorateClass([Property18],PriceRangeProperties.prototype,"extendLeft",2),__decorateClass([Property18],PriceRangeProperties.prototype,"extendRight",2);var DatePriceRangeProperties=class extends DateRange(PriceRange(MeasurerTypeProperties)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(t){return(0,import_ag_charts_core14.isObject)(t)&&t.type==="date-price-range"}};__decorateClass([Property18],DatePriceRangeProperties.prototype,"type",2);var QuickDatePriceRangeProperties=class extends DateRange(PriceRange(MeasurerTypeProperties)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new MeasurerDirectionProperties,this.down=new MeasurerDirectionProperties,this.direction="both"}static is(t){return(0,import_ag_charts_core14.isObject)(t)&&t.type==="quick-date-price-range"}};__decorateClass([Property18],QuickDatePriceRangeProperties.prototype,"type",2),__decorateClass([Property18],QuickDatePriceRangeProperties.prototype,"up",2),__decorateClass([Property18],QuickDatePriceRangeProperties.prototype,"down",2);var import_ag_charts_community25=require("ag-charts-community"),import_ag_charts_core16=require("ag-charts-core"),import_ag_charts_community24=require("ag-charts-community"),import_ag_charts_core15=require("ag-charts-core"),{BBox:BBox2}=import_ag_charts_community24._ModuleSupport,ANNOTATION_TEXT_LINE_HEIGHT=1.38;function maybeWrapText(t,e,i){return i?(0,import_ag_charts_core15.wrapText)(e,{maxWidth:i,font:t,textWrap:"always",avoidOrphans:!1}):e}function measureAnnotationText(t,e){const{lineMetrics:i,width:o}=(0,import_ag_charts_core15.cachedTextMeasurer)(t).measureLines(e),s=i.length*(0,import_ag_charts_core15.calcLineHeight)(t.fontSize,ANNOTATION_TEXT_LINE_HEIGHT);return{width:o,height:s}}function getBBox(t,e,i,o){let s=o?.width??0,a=o?.height??0;if(!o){const r=t.width==null?e:maybeWrapText(t,e,t.width);({width:s,height:a}=measureAnnotationText(t,r))}return new BBox2(i.x,i.y,s,a)}function updateTextNode(t,e,i,o,{x:s,y:a},r){const{visible:n=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:d,textAlign:u}=o,p=(0,import_ag_charts_core15.calcLineHeight)(c,ANNOTATION_TEXT_LINE_HEIGHT);r??(r=o.position=="center"?"middle":o.position);const g=i?o.getPlaceholderColor():o.color;t.setProperties({x:s,y:a,visible:n,text:e,fill:g,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,textAlign:u,lineHeight:p,textBaseline:r})}var{BaseProperties:BaseProperties7,Property:Property19}=import_ag_charts_community25._ModuleSupport,DEFAULT_NOTE_PADDING=10,HANDLE_SIZE=11,ICON_HEIGHT=20,ICON_WIDTH=22,ICON_SPACING=10,LABEL_OFFSET=ICON_HEIGHT+ICON_SPACING,TOOLBAR_OFFSET=34,NoteBackgroundProperties=class extends Fill(Stroke(BaseProperties7)){},NoteProperties=class extends Fill(Stroke(TextualPointProperties)){constructor(){super(...arguments),this.type="note",this.background=new NoteBackgroundProperties,this.position="bottom",this.alignment="center",this.width=200}static is(t){return(0,import_ag_charts_core16.isObject)(t)&&t.type==="note"}getDefaultColor(t){switch(t){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(t){switch(t){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const t=this.padding??DEFAULT_NOTE_PADDING;return{top:t,right:t,bottom:t,left:t}}getTextInputCoords(t,e){const{width:i,text:o}=this,s=super.getTextInputCoords(t,e),a=this.getPadding().top,r=getBBox(this,o,s);r.x=(0,import_ag_charts_core16.clamp)(i/2,r.x,t.seriesRect.width-i/2);const n=r.y-LABEL_OFFSET-a*2,l=r.y+HANDLE_SIZE+a*2,c=Math.max(r.height,e);return n-c-TOOLBAR_OFFSET<0?(r.y=l,this.position="top"):(r.y=n+a,this.position="bottom"),{x:r.x,y:r.y}}isHoverable(){return!0}};__decorateClass([Property19],NoteProperties.prototype,"type",2),__decorateClass([Property19],NoteProperties.prototype,"background",2);var import_ag_charts_community26=require("ag-charts-community"),{BaseProperties:BaseProperties8}=import_ag_charts_community26._ModuleSupport,PointProperties2=class extends Annotation(Point(Handle(BaseProperties8))){getDefaultColor(t){}getDefaultOpacity(t){}},ShapePointProperties=class bt extends Fill(PointProperties2){constructor(){super(...arguments),this.size=32}static is(e){return e instanceof bt}getDefaultColor(e){return e==="fill-color"?this.fill:void 0}getDefaultOpacity(e){return e==="fill-color"?this.fillOpacity:void 0}},import_ag_charts_community27=require("ag-charts-community"),import_ag_charts_core17=require("ag-charts-core"),{BaseProperties:BaseProperties9,Property:Property20}=import_ag_charts_community27._ModuleSupport,HorizontalLineProperties=class extends Annotation(Value(Handle(AxisLabel(Stroke(LineStyle(BaseProperties9)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new LineTextProperties}static is(t){return(0,import_ag_charts_core17.isObject)(t)&&t.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([Property20],HorizontalLineProperties.prototype,"type",2),__decorateClass([Property20],HorizontalLineProperties.prototype,"text",2);var VerticalLineProperties=class extends Annotation(Value(Handle(AxisLabel(Stroke(LineStyle(BaseProperties9)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new LineTextProperties}static is(t){return(0,import_ag_charts_core17.isObject)(t)&&t.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([Property20],VerticalLineProperties.prototype,"type",2),__decorateClass([Property20],VerticalLineProperties.prototype,"text",2);var import_ag_charts_community28=require("ag-charts-community"),import_ag_charts_core18=require("ag-charts-core"),{BaseProperties:BaseProperties10,Property:Property21}=import_ag_charts_community28._ModuleSupport,DisjointChannelProperties=class extends Annotation(Background(Line3(Handle(Extendable(Stroke(LineStyle(BaseProperties10))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new ChannelTextProperties,this.snapToAngle=45}static is(t){return(0,import_ag_charts_core18.isObject)(t)&&t.type==="disjoint-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.startHeight,t.end.y-=this.endHeight):import_ag_charts_core18.Logger.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([Property21],DisjointChannelProperties.prototype,"type",2),__decorateClass([Property21],DisjointChannelProperties.prototype,"startHeight",2),__decorateClass([Property21],DisjointChannelProperties.prototype,"endHeight",2),__decorateClass([Property21],DisjointChannelProperties.prototype,"text",2);var import_ag_charts_community31=require("ag-charts-community"),import_ag_charts_core20=require("ag-charts-core"),import_ag_charts_community30=require("ag-charts-community"),import_ag_charts_community29=require("ag-charts-community"),import_ag_charts_core19=require("ag-charts-core"),{Property:Property22}=import_ag_charts_community29._ModuleSupport,LineTypeProperties=class extends Localisable(Cappable(Extendable(Stroke(LineStyle(StartEndProperties))))){constructor(){super(...arguments),this.text=new LineTextProperties}getDefaultColor(t){switch(t){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([Property22],LineTypeProperties.prototype,"text",2);var ArrowProperties=class extends LineTypeProperties{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(t){return(0,import_ag_charts_core19.isObject)(t)&&t.type==="arrow"}};__decorateClass([Property22],ArrowProperties.prototype,"type",2);var LineProperties=class extends LineTypeProperties{constructor(){super(...arguments),this.type="line"}static is(t){return(0,import_ag_charts_core19.isObject)(t)&&t.type==="line"}};__decorateClass([Property22],LineProperties.prototype,"type",2);var{Property:Property23}=import_ag_charts_community30._ModuleSupport,FibonacciProperties=class extends LineTypeProperties{constructor(){super(...arguments),this.label=new LabelTextProperties,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(t){switch(t){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};__decorateClass([Property23],FibonacciProperties.prototype,"label",2),__decorateClass([Property23],FibonacciProperties.prototype,"reverse",2),__decorateClass([Property23],FibonacciProperties.prototype,"showFill",2),__decorateClass([Property23],FibonacciProperties.prototype,"isMultiColor",2),__decorateClass([Property23],FibonacciProperties.prototype,"strokes",2),__decorateClass([Property23],FibonacciProperties.prototype,"rangeStroke",2),__decorateClass([Property23],FibonacciProperties.prototype,"bands",2);var{Property:Property24}=import_ag_charts_community31._ModuleSupport,FibonacciRetracementTrendBasedProperties=class extends FibonacciProperties{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new PointProperties}static is(t){return(0,import_ag_charts_core20.isObject)(t)&&t.type==="fibonacci-retracement-trend-based"}};__decorateClass([Property24],FibonacciRetracementTrendBasedProperties.prototype,"type",2),__decorateClass([Property24],FibonacciRetracementTrendBasedProperties.prototype,"endRetracement",2);var import_ag_charts_community32=require("ag-charts-community"),import_ag_charts_core21=require("ag-charts-core"),{Property:Property25}=import_ag_charts_community32._ModuleSupport,FibonacciRetracementProperties=class extends FibonacciProperties{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(t){return(0,import_ag_charts_core21.isObject)(t)&&t.type==="fibonacci-retracement"}};__decorateClass([Property25],FibonacciRetracementProperties.prototype,"type",2);var import_ag_charts_community33=require("ag-charts-community"),import_ag_charts_core22=require("ag-charts-core"),{BaseProperties:BaseProperties11,Property:Property26}=import_ag_charts_community33._ModuleSupport,ParallelChannelProperties=class extends Annotation(Background(Line3(Handle(Extendable(Stroke(LineStyle(BaseProperties11))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new ChannelAnnotationMiddleProperties,this.text=new ChannelTextProperties,this.snapToAngle=45}static is(t){return(0,import_ag_charts_core22.isObject)(t)&&t.type==="parallel-channel"}get bottom(){const t={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof t.start.y=="number"&&typeof t.end.y=="number"?(t.start.y-=this.height,t.end.y-=this.height):import_ag_charts_core22.Logger.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),t}getDefaultColor(t){switch(t){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(t){switch(t){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return getLineDash(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return getLineCap(this.lineCap,this.lineDash,this.lineStyle)}};__decorateClass([Property26],ParallelChannelProperties.prototype,"type",2),__decorateClass([Property26],ParallelChannelProperties.prototype,"height",2),__decorateClass([Property26],ParallelChannelProperties.prototype,"middle",2),__decorateClass([Property26],ParallelChannelProperties.prototype,"text",2);var import_ag_charts_community34=require("ag-charts-community"),import_ag_charts_core23=require("ag-charts-core"),{Property:Property27}=import_ag_charts_community34._ModuleSupport,TextProperties=class extends TextualPointProperties{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(t){return(0,import_ag_charts_core23.isObject)(t)&&t.type==="text"}};__decorateClass([Property27],TextProperties.prototype,"type",2);function isEphemeralType(t){return QuickDatePriceRangeProperties.is(t)}function isLineType(t){return LineProperties.is(t)||HorizontalLineProperties.is(t)||VerticalLineProperties.is(t)||ArrowProperties.is(t)||isFibonacciType(t)}function isChannelType(t){return DisjointChannelProperties.is(t)||ParallelChannelProperties.is(t)}function isFibonacciType(t){return FibonacciRetracementProperties.is(t)||FibonacciRetracementTrendBasedProperties.is(t)}function isTextType(t){return CalloutProperties.is(t)||CommentProperties.is(t)||NoteProperties.is(t)||TextProperties.is(t)}function isMeasurerType(t){return DateRangeProperties.is(t)||PriceRangeProperties.is(t)||DatePriceRangeProperties.is(t)||QuickDatePriceRangeProperties.is(t)}function hasFontSize(t){return isTextType(t)&&!NoteProperties.is(t)}function hasLineStyle(t){return isLineType(t)||isChannelType(t)||isMeasurerType(t)&&!QuickDatePriceRangeProperties.is(t)}function hasLineColor(t){return isLineType(t)||isChannelType(t)||isMeasurerType(t)||CalloutProperties.is(t)||NoteProperties.is(t)}function hasIconColor(t){return NoteProperties.is(t)}function hasFillColor(t){return isChannelType(t)||isMeasurerType(t)||CalloutProperties.is(t)||CommentProperties.is(t)||ShapePointProperties.is(t)}function hasTextColor(t){return isTextType(t)&&!NoteProperties.is(t)}function hasLineText(t){return(isLineType(t)||isChannelType(t)||isMeasurerType(t))&&!isEphemeralType(t)&&(0,import_ag_charts_core24.isObject)(t.text)}function setFontSize(t,e){"fontSize"in t&&(t.fontSize=e),hasLineText(t)&&(t.text.fontSize=e)}function setLineStyle(t,e){const i=e?.strokeWidth??t.strokeWidth??1,o=e?.type??t.lineStyle,s=o??getLineStyle(t.lineDash,o),a=getComputedLineDash(i,s);t.strokeWidth=i,t.computedLineDash=a,t.lineStyle=s,t.lineCap=s==="dotted"?"round":void 0}function setColor(t,e,i,o,s,a){switch(e){case"fill-color":{"fill"in t&&(t.fill=o),"fillOpacity"in t&&(t.fillOpacity=s),"background"in t&&(t.background.fill=o,t.background.fillOpacity=s);break}case"line-color":{"axisLabel"in t&&(t.axisLabel.fill=o,t.axisLabel.fillOpacity=s,t.axisLabel.stroke=o,t.axisLabel.strokeOpacity=s),"fill"in t&&"fillOpacity"in t&&hasIconColor(t)?(t.fill=o,t.fillOpacity=s):("strokeOpacity"in t&&(t.strokeOpacity=s),"isMultiColor"in t&&"rangeStroke"in t?(t.isMultiColor=a,t.rangeStroke=o):"stroke"in t&&(t.stroke=o));break}case"text-color":{"color"in t&&(t.color=i),hasLineText(t)&&(t.text.color=o);break}}}var{deepClone}=import_ag_charts_community35._ModuleSupport,AnnotationDefaults=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(AnnotationType).map(t=>[t,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:deepClone(this.colors),fontSizes:deepClone(this.fontSizes),lineStyles:deepClone(this.lineStyles),lineTextAlignments:deepClone(this.lineTextAlignments),lineTextPositions:deepClone(this.lineTextPositions),fibonacciOptions:deepClone(this.fibonacciOptions)}}guardMemento(t){return!0}restoreMemento(t,e,i){this.colors=deepClone(i.colors),this.fontSizes=deepClone(i.fontSizes),this.lineStyles=deepClone(i.lineStyles),this.lineTextAlignments=deepClone(i.lineTextAlignments),this.lineTextPositions=deepClone(i.lineTextPositions),this.fibonacciOptions=deepClone(i.fibonacciOptions)}setDefaultColor(t,e,i,o,s,a){this.colors.get(t)?.set(e,[i,o,s,a])}setDefaultFontSize(t,e){this.fontSizes.set(t,e)}setDefaultLineStyleType(t,e){const i=this.lineStyles.get(t);i?i.type=e:this.lineStyles.set(t,{type:e})}setDefaultLineStyleWidth(t,e){const i=this.lineStyles.get(t);i?i.strokeWidth=e:this.lineStyles.set(t,{strokeWidth:e})}setDefaultLineTextAlignment(t,e){this.lineTextAlignments.set(t,e)}setDefaultLineTextPosition(t,e){this.lineTextPositions.set(t,e)}setDefaultFibonacciOptions(t,e,i){if(t!="fibonacci-retracement"&&t!="fibonacci-retracement-trend-based")return;const o=this.fibonacciOptions.get(t);o[e]=i,this.fibonacciOptions.set(t,o)}applyDefaults(t){for(const[e,i]of this.colors)if(t.type===e)for(const[o,[s,a,r,n]=[]]of i)s&&a&&r!=null&&n!=null&&setColor(t,o,s,a,r,n);for(const[e,i]of this.fontSizes)t.type!==e||i==null||setFontSize(t,i);for(const[e,i]of this.lineStyles)t.type!==e||i==null||setLineStyle(t,i);for(const[e,i]of this.lineTextPositions)t.type!==e||i==null||(t.text.position=i);for(const[e,i]of this.lineTextAlignments)t.type!==e||i==null||(t.text.alignment=i);for(const[e,i]of this.fibonacciOptions)if(!(t.type!==e||i==null))for(const o of Object.keys(i)){const s=i[o];s!=null&&t.set({[o]:s})}}},import_ag_charts_community38=require("ag-charts-community"),import_ag_charts_core26=require("ag-charts-core"),import_ag_charts_community36=require("ag-charts-community"),import_ag_charts_core25=require("ag-charts-core"),colorPickerTemplate_default='
',{Color:Color3}=import_ag_charts_community36._ModuleSupport,getHsva=t=>{try{const e=Color3.fromString(t),[i,o,s]=e.toHSB();return[i,o,s,e.a]}catch{return}},ColorPicker=class extends import_ag_charts_community36._ModuleSupport.AnchoredPopover{constructor(t,e){super(t,"color-picker",e),this.hasChanged=!1,this.hideFns.push(()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()}),this.cleanup.register(this.ctx.eventsHub.on("locale:change",()=>this.i18nUpdater?.()))}show(t){this.hasChanged=!1,this.onChangeHide=t.onChangeHide;const{element:e,initialFocus:i}=this.createColorPicker(t),o=this.showWithChildren([e],{initialFocus:i,...t});o.classList.add("ag-charts-color-picker"),o.setAttribute("role","dialog")}createColorPicker(t){const{localeManager:e}=this.ctx;let i=t.isMultiColor??!1,[o,s,a,r]=getHsva(t.color??"#f00")??[0,1,.5,1];r=t.opacity??r;const n=(0,import_ag_charts_core25.createElement)("div","ag-charts-color-picker__content");n.innerHTML=colorPickerTemplate_default,n.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=n.querySelector(".ag-charts-color-picker__palette"),c=n.querySelector(".ag-charts-color-picker__hue-input"),h=n.querySelector(".ag-charts-color-picker__multi-color-button"),d=n.querySelector(".ag-charts-color-picker__alpha-input"),u=n.querySelector(".ag-charts-color-picker__color-input"),p=n.querySelector(".ag-charts-color-picker__color-label"),g=m=>{const S={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[m];l.ariaValueText=e.t(S,{s,v:a})};this.i18nUpdater=()=>{l.ariaRoleDescription=e.t("ariaRoleDescription2DSlider"),l.ariaLabel=e.t("ariaLabelColorPickerPalette"),c.ariaLabel=e.t("ariaLabelColorPickerHue"),h.ariaLabel=e.t("ariaLabelColorPickerMultiColor"),d.ariaLabel=e.t("ariaLabelColorPickerAlpha"),u.ariaLabel=e.t("ariaLabelColor"),g("s")},this.i18nUpdater(),h.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!t.hasMultiColorOption);const y=(m=!0)=>{const v=Color3.fromHSB(o,s,a,r).toHexString();if(n.style.setProperty("--h",`${o}`),n.style.setProperty("--s",`${s}`),n.style.setProperty("--v",`${a}`),n.style.setProperty("--a",`${r}`),n.style.setProperty("--color",v.slice(0,7)),n.style.setProperty("--color-a",v),c.value=`${o}`,d.value=`${r}`,d.classList.toggle("ag-charts-color-picker__alpha-input--opaque",r===1),h.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),p.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==u&&(h.ariaChecked=i.toString(),u.value=i?e.t("ariaLabelColorPickerMultiColor"):v.toUpperCase()),m||t.color==null){const M=Color3.fromHSB(o,s,a,1).toHexString();t.onChange?.(v,M,r,i)}m&&(this.hasChanged=!0)};y(!1);const f=m=>m.preventDefault(),x=m=>m.stopPropagation(),b=m=>{m.preventDefault();const S=m.currentTarget;S.focus();const v=S.getBoundingClientRect(),M=({clientX:k,clientY:_})=>{i=!1,s=Math.min(Math.max((k-v.left)/v.width,0),1),a=1-Math.min(Math.max((_-v.top)/v.height,0),1),y(),g("s")};M(m);const D=(0,import_ag_charts_core25.attachListener)((0,import_ag_charts_core25.getWindow)(),"pointermove",M);(0,import_ag_charts_core25.getWindow)().addEventListener("pointerup",D,{once:!0})};return n.addEventListener("mousedown",x),n.addEventListener("touchstart",x),n.addEventListener("touchmove",x),n.addEventListener("keydown",m=>{switch(m.stopPropagation(),m.key){case"Enter":case"Escape":this.hide();break;default:return}m.preventDefault()}),l.addEventListener("pointerdown",b),l.addEventListener("touchstart",f,{passive:!1}),l.addEventListener("touchmove",f,{passive:!1}),l.addEventListener("keydown",m=>{if(m.key==="ArrowLeft")s=(0,import_ag_charts_core25.clamp)(0,s-.01,1),g("s");else if(m.key==="ArrowRight")s=(0,import_ag_charts_core25.clamp)(0,s+.01,1),g("s");else if(m.key==="ArrowUp")a=(0,import_ag_charts_core25.clamp)(0,a+.01,1),g("v");else if(m.key==="ArrowDown")a=(0,import_ag_charts_core25.clamp)(0,a-.01,1),g("v");else return;m.preventDefault(),y()}),l.addEventListener("focus",()=>{g("s")}),h.addEventListener("click",()=>{i=!i,y()}),c.addEventListener("input",m=>{i=!1,o=m.currentTarget.valueAsNumber??0,y()}),d.addEventListener("input",m=>{i=!1,r=m.currentTarget.valueAsNumber??0,y()}),u.addEventListener("input",m=>{i=!1;const S=getHsva(m.currentTarget.value);S!=null&&([o,s,a,r]=S,y())}),u.addEventListener("blur",()=>y()),u.addEventListener("keydown",m=>{m.key==="Enter"&&(m.currentTarget.blur(),y())}),{element:n,initialFocus:l}}},import_ag_charts_community37=require("ag-charts-community");function channelMenuItemVisible(t){return!(t instanceof import_ag_charts_community37._ModuleSupport.LogScale)&&!(t instanceof import_ag_charts_community37._ModuleSupport.BandScale)}var LINE_ANNOTATION_ITEMS=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:channelMenuItemVisible},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:channelMenuItemVisible}],FIBONACCI_ANNOTATION_ITEMS=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],FIBONACCI_RATIO_ITEMS=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],TEXT_ANNOTATION_ITEMS=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],SHAPE_ANNOTATION_ITEMS=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],MEASURER_ANNOTATION_ITEMS=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],LINE_STROKE_WIDTH_ITEMS=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],LINE_STYLE_TYPE_ITEMS=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],TEXT_SIZE_ITEMS=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{Color:Color4,FloatingToolbar,Menu,PropertiesArray,ToolbarButtonProperties,ToolbarButtonWidget,Property:Property28}=import_ag_charts_community38._ModuleSupport,AnnotationOptionsButtonProperties=class extends ToolbarButtonProperties{constructor(){super(...arguments),this.checkedOverrides=new ToolbarButtonProperties}};__decorateClass([Property28],AnnotationOptionsButtonProperties.prototype,"value",2),__decorateClass([Property28],AnnotationOptionsButtonProperties.prototype,"checkedOverrides",2),__decorateClass([Property28],AnnotationOptionsButtonProperties.prototype,"color",2),__decorateClass([Property28],AnnotationOptionsButtonProperties.prototype,"strokeWidth",2),__decorateClass([Property28],AnnotationOptionsButtonProperties.prototype,"isMultiColor",2);var AnnotationOptionsButtonWidget=class extends ToolbarButtonWidget{update(t){super.update(t),t.value==="line-stroke-width"&&this.updateLineStrokeWidth(t),(t.value==="fill-color"||t.value==="line-color"||t.value==="text-color")&&this.updateFillColor(t)}updateFillColor(t){const e=this.getElement();e.classList.add("ag-charts-annotations__color-picker-button"),e.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",t.isMultiColor),e.style.setProperty("--color",t.color??null)}updateLineStrokeWidth(t){const e=this.getElement();e.classList.add("ag-charts-annotations__stroke-width-button"),e.style.setProperty("--stroke-width",`${t.strokeWidth}px`)}},FloatingAnnotationOptionsToolbar=class extends FloatingToolbar{createButtonWidget(){return new AnnotationOptionsButtonWidget(this.localeManager)}},AnnotationOptionsToolbar=class extends import_ag_charts_community38._ModuleSupport.BaseProperties{constructor(t,e){super(),this.ctx=t,this.getActiveDatum=e,this.enabled=!0,this.buttons=new PropertiesArray(AnnotationOptionsButtonProperties),this.cleanup=new import_ag_charts_core26.CleanupRegistry,this.events=new import_ag_charts_core26.EventEmitter,this.visibleButtons=[],this.toolbar=new FloatingAnnotationOptionsToolbar(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new ColorPicker(this.ctx),this.textSizeMenu=new Menu(this.ctx,"text-size"),this.lineStyleTypeMenu=new Menu(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new Menu(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),t.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),t.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>{this.colorPicker.destroy(),this.toolbar.destroy()})}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(t){if(!this.enabled)return;const e={"line-style-type":hasLineStyle(t),"line-stroke-width":hasLineStyle(t),"line-color":hasLineColor(t),"text-color":hasTextColor(t),"fill-color":hasFillColor(t),"text-size":hasFontSize(t),settings:hasLineText(t),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>e[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(t)}setAnchorScene(t){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(t.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(t){this.updateColorPickerColor("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),"isMultiColor"in t&&t?.isMultiColor),this.updateColorPickerColor("text-color",t.getDefaultColor("text-color"),t.getDefaultOpacity("text-color"),"isMultiColor"in t&&t?.isMultiColor)}updateColorPickerColor(t,e,i,o){if(e!=null&&i!=null){const{r:s,g:a,b:r}=Color4.fromString(e);e=Color4.fromArray([s,a,r,i]).toHexString()}this.updateButtonByValue(t,{color:e,isMultiColor:o})}updateFontSize(t){this.updateButtonByValue("text-size",{label:t==null?void 0:String(t)})}updateLineStyleType(t){this.updateButtonByValue("line-style-type",{icon:t.icon})}updateStrokeWidth(t){this.updateButtonByValue("line-stroke-width",{label:t.label,strokeWidth:t.value})}onButtonPress({event:t,button:e,buttonWidget:i}){const o=this.getActiveDatum();if(o)switch(this.hideOverlays(),e.value){case"line-style-type":{const s=hasLineStyle(o)?getLineStyle(o.lineDash,o.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:LINE_STYLE_TYPE_ITEMS,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,onPress:a=>this.onLineStyleTypeMenuPress(a,o),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=hasLineStyle(o)?o.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:LINE_STROKE_WIDTH_ITEMS,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,onPress:a=>this.onLineStrokeWidthMenuPress(a,o),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(e.index),this.colorPicker.show({color:o?.getDefaultColor(e.value),opacity:o?.getDefaultOpacity(e.value),sourceEvent:t.sourceEvent,hasMultiColorOption:"isMultiColor"in o,isMultiColor:"isMultiColor"in o&&o?.isMultiColor,onChange:o==null?void 0:this.onColorPickerChange.bind(this,e.value,o),onChangeHide:(s=>{this.events.emit("saved-color",{type:o.type,colorPickerType:e.value,color:o.getDefaultColor(s)})}).bind(this,e.value)});break}case"text-size":{const s=isTextType(o)?o.fontSize:void 0;this.textSizeMenu.show(i,{items:TEXT_SIZE_ITEMS,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,onPress:a=>this.onTextSizeMenuPress(a,o),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.events.emit("pressed-delete",null);break}case"lock":{o.locked=!o.locked,this.refreshButtons(o),this.events.emit("pressed-lock",{locked:o.locked});break}case"settings":{this.toolbar.toggleActiveButtonByIndex(e.index),this.events.emit("pressed-settings",t);break}}}onToolbarMoved(t){const{buttonBounds:e,popoverBounds:i}=t,o={x:i.x,y:i.y+i.height+4},s={y:i.y-4};this.colorPicker.setAnchor(o,s);for(const[a,r]of e.entries()){const n=this.visibleButtons.at(a);if(!n)continue;const l={x:r.x,y:r.y+r.height-1},c={y:r.y};switch(n.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(t,e,i,o,s,a){this.events.emit("updated-color",{type:e.type,colorPickerType:t,colorOpacity:i,color:o,opacity:s,isMultiColor:a}),this.updateColorPickerColor(t,i,s,a)}onTextSizeMenuPress(t,e){if(!hasFontSize(e))return;const i=t.value;this.events.emit("updated-font-size",{type:e.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(t,e){if(!hasLineStyle(e))return;const i=t.value;this.events.emit("updated-line-style",{type:e.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(t)}onLineStrokeWidthMenuPress(t,e){if(!hasLineStyle(e))return;const i=t.value;this.events.emit("updated-line-width",{type:e.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(t)}refreshButtons(t){const e=t.locked??!1;for(const[i,o]of this.visibleButtons.entries())o&&(o.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,e),this.updateButtonByIndex(i,e?o.checkedOverrides.toJson():o.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!e));hasFontSize(t)&&this.updateFontSize(t.fontSize),this.updateColors(t),this.updateLineStyles(t)}updateLineStyles(t){if(!hasLineStyle(t))return;const e=t.strokeWidth??1,i=getLineStyle(t.lineDash,t.lineStyle);this.updateStrokeWidth({strokeWidth:e,value:e,label:String(e)}),this.updateLineStyleType(LINE_STYLE_TYPE_ITEMS.find(o=>o.value===i)??LINE_STYLE_TYPE_ITEMS[0])}updateButtonByValue(t,e){const i=this.visibleButtons.findIndex(o=>o.value===t);i!==-1&&this.updateButtonByIndex(i,e)}updateButtonByIndex(t,e){const i=this.visibleButtons.at(t);i&&this.toolbar.updateButtonByIndex(t,{...i.toJson(),...e,value:e.value??i.value})}};__decorateClass([Property28],AnnotationOptionsToolbar.prototype,"enabled",2),__decorateClass([Property28],AnnotationOptionsToolbar.prototype,"buttons",2);var import_ag_charts_community39=require("ag-charts-community"),{StateMachine,StateMachineProperty,Vec2:Vec22,Debug}=import_ag_charts_community39._ModuleSupport,DragStateMachine=class extends StateMachine{constructor(t){const e=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),t.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:o})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,o)}}},dragging:{keyDown:e,keyUp:e,drag:({offset:i,context:o})=>{this.hasMoved=Vec22.lengthSquared(Vec22.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,o,this.snapping),t.update()},dragEnd:{target:StateMachine.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&t.recordAction("Move annotation"),t.update()}}}}),this.debug=Debug.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};__decorateClass([StateMachineProperty()],DragStateMachine.prototype,"snapping",2),__decorateClass([StateMachineProperty()],DragStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty()],DragStateMachine.prototype,"node",2);var import_ag_charts_community40=require("ag-charts-community"),import_ag_charts_core27=require("ag-charts-core"),{Property:Property29}=import_ag_charts_community40._ModuleSupport,ArrowDownProperties=class extends ShapePointProperties{constructor(){super(...arguments),this.type="arrow-down"}static is(t){return(0,import_ag_charts_core27.isObject)(t)&&t.type==="arrow-down"}};__decorateClass([Property29],ArrowDownProperties.prototype,"type",2);var import_ag_charts_community47=require("ag-charts-community"),import_ag_charts_community46=require("ag-charts-community"),import_ag_charts_community43=require("ag-charts-community"),import_ag_charts_core28=require("ag-charts-core"),import_ag_charts_community42=require("ag-charts-community"),import_ag_charts_community41=require("ag-charts-community"),AnnotationShape=class extends import_ag_charts_community41._ModuleSupport.Marker{isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}},_Handle=class vt extends import_ag_charts_community42._ModuleSupport.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(e){const{handle:i,locked:o}=this;return o?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:e,offset:{x:e.x-i.x,y:e.y-i.y}}}toggleActive(e){this.active=e,e||(this.handle.strokeWidth=vt.INACTIVE_STROKE_WIDTH)}toggleHovered(e){this.glow.visible=!this.locked&&e,this.glow.dirtyPath=!0}toggleDragging(e){this.locked||(this.handle.visible=!e,this.glow.visible=this.glow.visible&&!e,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(e){this.locked=e}getCursor(){}containsPoint(e,i){return this.handle.containsPoint(e,i)}};_Handle.INACTIVE_STROKE_WIDTH=2;var Handle2=_Handle,_InvariantHandle=class kt extends Handle2{constructor(){super(),this.handle=new AnnotationShape({shape:"circle"}),this.glow=new AnnotationShape({shape:"circle"}),this.append([this.handle]),this.handle.size=kt.HANDLE_SIZE,this.handle.strokeWidth=Handle2.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(e){this.handle.setProperties({...e,strokeWidth:Handle2.INACTIVE_STROKE_WIDTH})}drag(e){return{point:e,offset:{x:0,y:0}}}};_InvariantHandle.HANDLE_SIZE=7,_InvariantHandle.GLOW_SIZE=9;var InvariantHandle=_InvariantHandle,_UnivariantHandle=class nt extends Handle2{constructor(){super(),this.handle=new import_ag_charts_community42._ModuleSupport.Rect,this.glow=new import_ag_charts_community42._ModuleSupport.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=nt.CORNER_RADIUS,this.handle.width=nt.HANDLE_SIZE,this.handle.height=nt.HANDLE_SIZE,this.handle.strokeWidth=Handle2.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=nt.CORNER_RADIUS,this.glow.width=nt.GLOW_SIZE,this.glow.height=nt.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){if(super.toggleLocked(e),e){const i=(nt.HANDLE_SIZE-InvariantHandle.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=InvariantHandle.HANDLE_SIZE,this.handle.height=InvariantHandle.HANDLE_SIZE,this.glow.width=InvariantHandle.GLOW_SIZE,this.glow.height=InvariantHandle.GLOW_SIZE}else this.handle.cornerRadius=nt.CORNER_RADIUS,this.handle.width=nt.HANDLE_SIZE,this.handle.height=nt.HANDLE_SIZE,this.glow.width=nt.GLOW_SIZE,this.glow.height=nt.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(e){if(this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked){delete e.fill,delete e.strokeWidth;const i=(nt.HANDLE_SIZE-InvariantHandle.HANDLE_SIZE)/2;e.x-=i,e.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(e),this.glow.setProperties({...e,x:(e.x??this.glow.x)-2,y:(e.y??this.glow.y)-2,strokeWidth:0,fill:e.stroke})}drag(e){return this.locked?{point:e,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:e.x,y:this.handle.y},offset:{x:e.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:e.y},offset:{x:0,y:e.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};_UnivariantHandle.HANDLE_SIZE=12,_UnivariantHandle.GLOW_SIZE=16,_UnivariantHandle.CORNER_RADIUS=4;var UnivariantHandle=_UnivariantHandle,_DivariantHandle=class gt extends Handle2{constructor(){super(),this.handle=new AnnotationShape({shape:"circle"}),this.glow=new AnnotationShape({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=gt.HANDLE_SIZE,this.handle.strokeWidth=Handle2.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=gt.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(e){super.toggleLocked(e),e?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=InvariantHandle.HANDLE_SIZE,this.glow.size=InvariantHandle.GLOW_SIZE):(this.handle.size=gt.HANDLE_SIZE,this.glow.size=gt.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(e){this.cachedStyles={...e},this.active||delete e.strokeWidth,this.locked&&(delete e.fill,delete e.strokeWidth),this.handle.setProperties(e),this.glow.setProperties({...e,strokeWidth:0,fill:e.stroke})}getCursor(){return"pointer"}};_DivariantHandle.HANDLE_SIZE=11,_DivariantHandle.GLOW_SIZE=17;var DivariantHandle=_DivariantHandle,{ZIndexMap:ZIndexMap2}=import_ag_charts_community43._ModuleSupport,AnnotationScene=class extends import_ag_charts_community43._ModuleSupport.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=ZIndexMap2.CHART_ANNOTATION}static isCheck(t,e){return(0,import_ag_charts_core28.isObject)(t)&&Object.hasOwn(t,"type")&&t.type===e}toggleHovered(t,e,i){i!==!0&&this.toggleHandles(t||e)}computeBBoxWithoutHandles(){return import_ag_charts_community43._ModuleSupport.Transformable.toCanvas(this,import_ag_charts_community43._ModuleSupport.Group.computeChildrenBBox(this.excludeChildren({instance:Handle2})))}updateNode(t,e,i){if(!i&&e){e.remove();return}return i&&e==null&&(e=new t,this.appendChild(e)),e}},import_ag_charts_community45=require("ag-charts-community"),import_ag_charts_community44=require("ag-charts-community"),import_ag_charts_core29=require("ag-charts-core"),{ContinuousScale:ContinuousScale2,Vec2:Vec23,toRadians:toRadians3}=import_ag_charts_community44._ModuleSupport;function snapPoint(t,e,i=!1,o,s=1){if(!i)return invertCoords(t,e);const a=o?convertPoint(o,e):Vec23.origin();return invertCoords(snapToAngle(t,a,s),e)}function snapToAngle(t,e,i){const o=Vec23.sub(t,e),s=toRadians3(i),a=Math.round(Vec23.angle(o)/s)*s;return Vec23.rotate(o,a,e)}function getDragStartState(t,e){const i={};for(const[o,s]of(0,import_ag_charts_core29.entries)(t))i[o]=convertPoint(s,e);return i}function translate(t,e,i,o={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:s,yAxis:a}=i,r=Object.keys(t),n=[],l=[],c=new Set(o.translateVectors??r),h=new Set(o.invertYVectors??[]),d=new Set([...c,...h]),u=Vec23.multiply(e,Vec23.from(1,-1));for(const x of r)d.has(x)&&(t[x]=Vec23.add(t[x],h.has(x)?u:e),o.snap&&(t[x]=snapToAngle(t[x],o.snap.vectors[x],o.snap.angle))),n.push(s.getRangeOverflow(t[x].x)),l.push(a.getRangeOverflow(t[x].y));const p=(x,b)=>Math.abs(x)-Math.abs(b),g=(x,b,m)=>o.overflowContinuous===0||!ContinuousScale2.is(x)?m.toSorted(p).at(-1)??0:r.length===d.size?m.toSorted(p).at(-o.overflowContinuous-1)??0:m.filter(v=>v!==0).length<=o.overflowContinuous?0:m.filter((v,M)=>v!==0&&Math.abs(v)<=Math.abs(b)&&d.has(r[M])).toSorted(p).at(-1)??0,y=Vec23.from(g(s.scale,e.x,n),g(a.scale,e.y,l));if(!Vec23.equal(y,Vec23.origin()))for(const x of r)d.has(x)&&(t[x]=Vec23.round(Vec23.sub(t[x],y),4));const f={};for(const x of r)f[x]=invertCoords(t[x],i);return f}var{Vec2:Vec24}=import_ag_charts_community45._ModuleSupport,PointScene=class extends AnnotationScene{constructor(){super(...arguments),this.handle=new DivariantHandle,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=convertPoint(t,e);this.updateHandle(t,i),this.anchor=this.updateAnchor(t,i,e)}dragStart(t,e,i){this.dragState={offset:e,...getDragStartState({handle:t},i)}}drag(t,e,i){const{dragState:o}=this;if(!t.isWriteable()||!o)return;const{point:s}=translate({point:o.handle},Vec24.sub(e,o.offset),i);t.x=s.x,t.y=s.y}translate(t,e,i){if(!t.isWriteable())return;const{point:o}=translate({point:convertPoint(t,i)},e,i);t.x=o.x,t.y=o.y}toggleHandles(t){this.handle.visible=!!t,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(t){this.toggleHandles(t),this.handle.toggleActive(t)}stopDragging(){this.handle.toggleDragging(!1)}copy(t,e,i){const o=convertPoint(t,i),s=invertCoords({x:o.x-30,y:o.y-30},i);return e.x=s.x,e.y=s.y,e}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(t,e){if(this.handle.containsPoint(t,e))return"handle"}updateHandle(t,e,i){const{x:o,y:s}=this.getHandleCoords(t,e,i),a=this.getHandleStyles(t);this.handle.update({...a,x:o,y:s}),this.handle.toggleLocked(t.locked??!1)}updateAnchor(t,e,i){const o=this.getHandleCoords(t,e);return{x:o.x+i.seriesRect.x,y:o.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i){return{x:e.x,y:e.y}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},ShapePointScene=class extends PointScene{constructor(){super(),this.append([this.handle])}update(t,e){super.update(t,e);const i=convertPoint(t,e);this.updateShape(t,i)}updateShape(t,e){this.updateShapeStyles(t),this.updateShapePath(t,e)}updateShapeStyles(t){const{shape:e}=this;e.fill=t.fill,e.fillOpacity=t.fillOpacity??1}updateShapePath(t,e){const{shape:i}=this;i.x=e.x,i.y=e.y,i.size=t.size}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}getNodeAtCoords(t,e){return this.shape.containsPoint(t,e)?"shape":super.getNodeAtCoords(t,e)}},arrowUpPoints=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function arrowUp(t){import_ag_charts_community46._ModuleSupport.drawMarkerUnitPolygon(t,arrowUpPoints)}arrowUp.anchor={x:.5,y:0};var ArrowUpScene=class extends ShapePointScene{constructor(){super(),this.type="arrow-up",this.shape=new AnnotationShape({shape:arrowUp}),this.append([this.shape])}static is(t){return AnnotationScene.isCheck(t,"arrow-up")}getHandleCoords(t,e){const i=DivariantHandle.HANDLE_SIZE/2,o=super.getHandleCoords(t,e);return o.y-=i,o}},arrowDownPoints=arrowUpPoints.map(([t,e])=>[t,1-e]);function arrowDown(t){import_ag_charts_community47._ModuleSupport.drawMarkerUnitPolygon(t,arrowDownPoints)}arrowDown.anchor={x:.5,y:1};var ArrowDownScene=class extends ShapePointScene{constructor(){super(),this.type="arrow-down",this.shape=new AnnotationShape({shape:arrowDown}),this.append([this.shape])}static is(t){return AnnotationScene.isCheck(t,"arrow-down")}updateAnchor(t,e,i){const o=super.updateAnchor(t,e,i);return o.y-=t.size,o}getHandleCoords(t,e){const i=DivariantHandle.HANDLE_SIZE/2,o=super.getHandleCoords(t,e);return o.y+=i,o}},import_ag_charts_community48=require("ag-charts-community"),{StateMachine:StateMachine2,StateMachineProperty:StateMachineProperty2,Debug:Debug2}=import_ag_charts_community48._ModuleSupport,PointStateMachine=class extends StateMachine2{constructor(t){const e=({point:o})=>{const s=this.createDatum();s.set({x:o.x,y:o.y}),t.create(s)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},cancel:StateMachine2.parent,reset:StateMachine2.parent},"waiting-first-render":{render:{target:StateMachine2.parent,action:i}}}),this.debug=Debug2.create(!0,"annotations")}};__decorateClass([StateMachineProperty2()],PointStateMachine.prototype,"node",2);var ArrowDownStateMachine=class extends PointStateMachine{createDatum(){return new ArrowDownProperties}},arrowDownConfig={type:"arrow-down",datum:ArrowDownProperties,scene:ArrowDownScene,isDatum:ArrowDownProperties.is,translate:(t,e,i,o)=>{ArrowDownProperties.is(e)&&ArrowDownScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(ArrowDownProperties.is(e)&&ArrowDownProperties.is(i)&&ArrowDownScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{ArrowDownProperties.is(e)&&ArrowDownScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ArrowDownStateMachine({...t,create:e("arrow-down")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community49=require("ag-charts-community"),import_ag_charts_core30=require("ag-charts-core"),{Property:Property30}=import_ag_charts_community49._ModuleSupport,ArrowUpProperties=class extends ShapePointProperties{constructor(){super(...arguments),this.type="arrow-up"}static is(t){return(0,import_ag_charts_core30.isObject)(t)&&t.type==="arrow-up"}};__decorateClass([Property30],ArrowUpProperties.prototype,"type",2);var ArrowUpStateMachine=class extends PointStateMachine{createDatum(){return new ArrowUpProperties}},arrowUpConfig={type:"arrow-up",datum:ArrowUpProperties,scene:ArrowUpScene,isDatum:ArrowUpProperties.is,translate:(t,e,i,o)=>{ArrowUpProperties.is(e)&&ArrowUpScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(ArrowUpProperties.is(e)&&ArrowUpProperties.is(i)&&ArrowUpScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{ArrowUpProperties.is(e)&&ArrowUpScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ArrowUpStateMachine({...t,create:e("arrow-up")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community53=require("ag-charts-community"),import_ag_charts_community52=require("ag-charts-community"),import_ag_charts_community51=require("ag-charts-community"),import_ag_charts_core31=require("ag-charts-core"),import_ag_charts_community50=require("ag-charts-community"),{Vec2:Vec25,Vec4}=import_ag_charts_community50._ModuleSupport,LinearScene=class extends AnnotationScene{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:t,y1:e,x2:i,y2:o},s,a){const r={x1:t,y1:e,x2:i,y2:o};if(!s.extendStart&&!s.extendEnd)return r;const[n,l]=boundsIntersections(r,a.yAxis.bounds),c=r.x2=r.y2,d=r.x2===r.x1;return s.extendEnd&&(d?r.y2=h?l.y:n.y:(r.x2=c?n.x:l.x,r.y2=c?n.y:l.y)),s.extendStart&&(d?r.y1=h?n.y:l.y:(r.x1=c?l.x:n.x,r.y1=c?l.y:n.y)),r}dragStart(t,e,i){this.dragState={offset:e,...getDragStartState({start:t.start,end:t.end},i)}}drag(t,e,i,o){t.isWriteable()&&(this.activeHandle?this.dragHandle(t,e,i,o):this.dragAll(t,e,i))}dragAll(t,e,i){const{dragState:o}=this;o&&this.translatePoints(t,o.start,o.end,Vec25.sub(e,o.offset),i)}translate(t,e,i){t.isWriteable()&&this.translatePoints(t,convertPoint(t.start,i),convertPoint(t.end,i),e,i)}copy(t,e,i){const o=convertLine(t,i);if(!o)return;const s=this.computeBBoxWithoutHandles(),a={x:-s.width/2,y:-s.height/2};return this.translatePoints(e,Vec4.start(o),Vec4.end(o),a,i),e}translatePoints(t,e,i,o,s){const a=this.getTranslatePointsVectors(e,i),r=translate(a,o,s,{overflowContinuous:this.overflowContinuous});t.start.x=r.start.x,t.end.x=r.end.x,t.start.y=r.start.y,t.end.y=r.end.y}getTranslatePointsVectors(t,e){return{start:t,end:e}}},{Vec2:Vec26,Vec4:Vec42}=import_ag_charts_community51._ModuleSupport,StartEndScene=class extends LinearScene{constructor(){super(...arguments),this.start=new DivariantHandle,this.end=new DivariantHandle,this.anchor={x:0,y:0,position:"above"}}update(t,e){const i=convertLine(t,e);i!=null&&(this.updateHandles(t,i),this.updateAnchor(t,i,e))}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of(0,import_ag_charts_core31.entries)(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}dragHandle(t,e,i,o){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const r=s==="start"?"end":"start",n=o?{vectors:{[s]:convertPoint(t[r],i)},angle:t.snapToAngle}:void 0,{[s]:l}=translate({[s]:a[s]},Vec26.sub(e,a.offset),i,{overflowContinuous:0,snap:n});t[s].x=l.x,t[s].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(t,e){const{start:i,end:o}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):o.containsPoint(t,e)?(this.activeHandle="end",!0):!1}getNodeAtCoords(t,e){if(this.start.containsPoint(t,e)||this.end.containsPoint(t,e))return"handle"}updateHandles(t,e,i){this.start.update({...this.getHandleStyles(t,"start"),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t,"end"),...this.getHandleCoords(t,e,"end",i)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}updateAnchor(t,e,i,o){this.anchor={x:e.x1+i.seriesRect.x,y:e.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(t,e,i,o){return i==="start"?Vec42.start(e):Vec42.end(e)}getHandleStyles(t,e){return{fill:t.handle.fill,stroke:t.handle.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}},{Vec4:Vec43}=import_ag_charts_community52._ModuleSupport,TextualStartEndScene=class extends StartEndScene{constructor(){super(...arguments),this.label=new import_ag_charts_community52._ModuleSupport.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualStartEndScene")}update(t,e){const i=convertLine(t,e);if(i==null)return;const o=this.getTextBBox(t,i);this.updateLabel(t,o,i),this.updateHandles(t,i,o),this.updateShape(t,o,i),this.updateAnchor(t,i,e,o)}containsPoint(t,e){return super.containsPoint(t,e)||this.label.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e){const{text:i}=t.getText();return getBBox(t,i,Vec43.end(e),this.textInputBBox)}updateLabel(t,e,i){const{text:o,isPlaceholder:s}=t.getText();updateTextNode(this.label,o,s,t,this.getLabelCoords(t,e,i))}updateShape(t,e,i){}getLabelCoords(t,e,i){return Vec43.end(i)}getHandleStyles(t,e){return{...super.getHandleStyles(t,e),stroke:t.handle.stroke??t.color}}},{drawCorner,Path:Path5}=import_ag_charts_community53._ModuleSupport,CalloutScene=class extends TextualStartEndScene{constructor(){super(),this.type="callout",this.shape=new Path5,this.append([this.shape,this.label,this.start,this.end])}static is(t){return AnnotationScene.isCheck(t,"callout")}drag(t,e,i,o){t.isWriteable()&&(this.activeHandle==="end"?this.dragHandle(t,e,i,o):this.dragAll(t,e,i))}getLabelCoords(t,e,i){const o=t.getPadding(),{bodyBounds:s={x:0,y:0,width:0,height:0}}=this.getDimensions(t,e,i)??{};return{x:s.x+o.left,y:s.y-o.bottom}}getHandleStyles(t,e){return e==="start"?{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(t,e,i,o){const{bodyBounds:s}=this.getDimensions(t,o,e)??{},a=s??o;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(t,e,i){const{shape:o}=this;o.fill=t.fill,o.fillOpacity=t.fillOpacity??1,o.stroke=t.stroke,o.strokeWidth=t.strokeWidth??1,o.strokeOpacity=t.strokeOpacity??1;const{tailPoint:s,bodyBounds:a}=this.getDimensions(t,e,i)??{};!s||!a||this.updatePath(s,a)}updatePath(t,e){const{x:i,y:o}=t,{x:s,y:a,width:r,height:n}=e,l=a-n,c=s+r,h=this.calculateCalloutPlacement({x:i,y:o},e),d=8,u=[{coordinates:{x0:s,x1:s+d,y0:l+d,y1:l,cx:h==="topLeft"?i:s+d,cy:h==="topLeft"?o:l+d},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:s+d,x1:c-d,y0:l,y1:l,cx:i,cy:o},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-d,x1:c,y0:l,y1:l+d,cx:h==="topRight"?i:c-d,cy:h==="topRight"?o:l+d},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+d,y1:a-d,cx:i,cy:o},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-d,y0:a-d,y1:a,cx:h==="bottomRight"?i:c-d,cy:h==="bottomRight"?o:a-d},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-d,x1:s+d,y0:a,y1:a,cx:i,cy:o},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:s+d,x1:s,y0:a,y1:a-d,cx:h==="bottomLeft"?i:s+d,cy:h==="bottomLeft"?o:a-d},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:s,x1:s,y0:a-d,y1:l+d,cx:i,cy:o},type:h==="left"?"calloutSide":"side"}],{path:p}=this.shape;p.clear(),p.moveTo(s,l+d);for(const{coordinates:g,type:y}of u)this.drawPath(p,g,d,y);p.closePath()}drawPath(t,{x0:e,y0:i,x1:o,y1:s,cx:a,cy:r},n,l){switch(l){case"calloutCorner":{t.lineTo(a,r),t.lineTo(o,s);break}case"corner":{drawCorner(t,{x0:e,x1:o,y0:i,y1:s,cx:a,cy:r},n,!1);break}case"calloutSide":{if(e===o){const h=i>s?-1:1,d=Math.min(i,s)+Math.abs(i-s)/2;t.lineTo(e,d-6*h),t.lineTo(a,r),t.lineTo(e,d+6*h),t.lineTo(o,s)}else{const h=e>o?-1:1,d=Math.min(e,o)+Math.abs(o-e)/2;t.lineTo(d-6*h,i),t.lineTo(a,r),t.lineTo(d+6*h,i),t.lineTo(o,s)}break}case"side":default:{t.lineTo(o,s);break}}}calculateCalloutPlacement(t,e){const i=e.x+e.width,o=e.y-e.height;let s,a;return t.x>i?s="right":t.xe.y?a="bottom":t.y{const p=this.createDatum();p.set({start:u,end:u,visible:!0}),t.create(p)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},o=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},a=u=>{this.node?.setTextInputBBox(u),t.update()},r=({point:u})=>{const{datum:p,node:g}=this;p?.set({end:u}),g?.toggleActive(!0),g?.toggleHandles({end:!1}),t.update()},n=()=>{t.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:p,color:g,opacity:y,isMultiColor:f})=>{const{datum:x}=this;x&&(u==="text-color"&&t.updateTextInputColor(g),setColor(x,u,p,g,y,f),t.update())},c=u=>{const{datum:p,node:g}=this;!p||!g||!isTextType(p)||(p.fontSize=u,t.updateTextInputFontSize(u),t.update())},h=()=>{t.delete()},d=({textInputValue:u,bbox:p})=>{const{datum:g}=this;if(p!=null&&u!=null&&u.length>0){if(!isTextType(g))return;const y=maybeWrapText(g,u,p.width);g?.set({text:y}),t.update(),t.recordAction(`Create ${g?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:StateMachine3.parent,reset:StateMachine3.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:r,drag:r,click:{target:"edit",action:n},dragEnd:{target:"edit",action:n},reset:{target:StateMachine3.parent,action:h},cancel:{target:StateMachine3.parent,action:h}},edit:{onEnter:o,updateTextInputBBox:a,color:l,fontSize:c,textInput:[{guard:guardCancelAndExit,target:StateMachine3.parent,action:h},{guard:guardSaveAndExit,target:StateMachine3.parent,action:d}],click:{target:StateMachine3.parent,action:d},dragStart:{target:StateMachine3.parent,action:d},resize:{target:StateMachine3.parent,action:d},onExit:s,cancel:{target:StateMachine3.parent,action:h}}}),this.debug=Debug3.create(!0,"annotations")}};__decorateClass([StateMachineProperty3()],TextualStartEndStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty3()],TextualStartEndStateMachine.prototype,"node",2);var CalloutStateMachine=class extends TextualStartEndStateMachine{createDatum(){return new CalloutProperties}},calloutConfig={type:"callout",datum:CalloutProperties,scene:CalloutScene,isDatum:CalloutProperties.is,translate:(t,e,i,o)=>{if(CalloutProperties.is(e)&&CalloutScene.is(t))return t.translate(e,i,o)},copy:(t,e,i,o)=>{if(CalloutProperties.is(e)&&CalloutProperties.is(i)&&CalloutScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{CalloutProperties.is(e)&&CalloutScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CalloutStateMachine({...t,create:e("callout")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community56=require("ag-charts-community"),import_ag_charts_core32=require("ag-charts-core"),import_ag_charts_community55=require("ag-charts-community"),TextualPointScene=class extends PointScene{constructor(){super(...arguments),this.label=new import_ag_charts_community55._ModuleSupport.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(t){this.textInputBBox=t,this.markDirty("TextualPointScene")}update(t,e){const i=convertPoint(t,e),o=this.getTextBBox(t,i,e);this.updateLabel(t,o),this.updateHandle(t,i,o),this.updateShape(t,o),this.anchor=this.updateAnchor(t,o,e)}copy(t,e,i){const o=convertPoint(t,i),s=this.getTextBBox(t,o,i),a=t.getPadding(),r=a.left+a.right,n=a.top+a.bottom,l=(s.width+r)/2,c=s.height+n,h=invertCoords({x:o.x-l,y:o.y-c},i);return e.x=h.x,e.y=h.y,e}containsPoint(t,e){const{label:i}=this;return super.containsPoint(t,e)||i.visible&&i.containsPoint(t,e)}getNodeAtCoords(t,e){return this.label.visible&&this.label.containsPoint(t,e)?"text":super.getNodeAtCoords(t,e)}getTextBBox(t,e,i){const{text:o}=t.getText();return getBBox(t,o,{x:e.x,y:e.y},this.textInputBBox)}updateLabel(t,e){const{text:i,isPlaceholder:o}=t.getText();updateTextNode(this.label,i,o,t,this.getLabelCoords(t,e),this.getTextBaseline(t))}updateShape(t,e){}updateAnchor(t,e,i){return{x:e.x+i.seriesRect.x,y:e.y+i.seriesRect.y-e.height,position:this.anchor.position}}getLabelCoords(t,e){return e}getTextBaseline(t){return t.position=="center"?"middle":t.position}getHandleCoords(t,e,i){return i}getHandleStyles(t){const e=super.getHandleStyles(t);return e.stroke=t.handle.stroke??t.color,e}},{drawCorner:drawCorner2}=import_ag_charts_community56._ModuleSupport,CommentScene=class extends TextualPointScene{constructor(){super(),this.type="comment",this.shape=new import_ag_charts_community56._ModuleSupport.Path,this.append([this.shape,this.label,this.handle])}static is(t){return AnnotationScene.isCheck(t,"comment")}updateShape(t,e){const{shape:i}=this;i.fill=t.fill,i.fillOpacity=t.fillOpacity??1,i.stroke=t.stroke??"transparent",i.strokeWidth=t.strokeWidth??1,i.strokeOpacity=t.strokeOpacity??1,this.updatePath(t,e)}getLabelCoords(t,e){const i=t.getPadding();return{x:e.x+i.left,y:e.y-i.bottom}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}updateAnchor(t,e,i){const o=super.updateAnchor(t,e,i),s=t.getPadding();return o.y-=s.bottom+s.top,o}updatePath(t,e){const i=t.getPadding(),{x:o,y:s}=e;let{width:a,height:r}=e;const{fontSize:n}=t,l=i.left+i.right,c=i.top+i.bottom;a=a+l,r=Math.max(r+c,n+c);const h=s-r,d=o+a,u=((0,import_ag_charts_core32.calcLineHeight)(n,ANNOTATION_TEXT_LINE_HEIGHT)+c)/2,{path:p}=this.shape;p.clear(),p.moveTo(o,s),p.lineTo(o,h+u),drawCorner2(p,{x0:o,x1:o+u,y0:h+u,y1:h,cx:o+u,cy:h+u},u,!1),p.lineTo(d-u,h),drawCorner2(p,{x0:d-u,x1:d,y0:h,y1:h+u,cx:d-u,cy:h+u},u,!1),p.lineTo(d,s-u),drawCorner2(p,{x0:d,x1:d-u,y0:s-u,y1:s,cx:d-u,cy:s-u},u,!1),p.closePath()}containsPoint(t,e){return super.containsPoint(t,e)||this.shape.containsPoint(t,e)}},import_ag_charts_community57=require("ag-charts-community"),{StateMachine:StateMachine4,StateMachineProperty:StateMachineProperty4,Debug:Debug4}=import_ag_charts_community57._ModuleSupport,TextualPointStateMachine=class extends StateMachine4{constructor(t){const e=({point:h})=>{const d=this.createDatum();d.set({x:h.x,y:h.y}),t.create(d)},i=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()},o=()=>{t.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{t.hideTextInput(),this.datum&&(this.datum.visible=!0),t.deselect()},a=h=>{this.node?.setTextInputBBox(h),t.update()},r=({colorPickerType:h,colorOpacity:d,color:u,opacity:p,isMultiColor:g})=>{this.datum&&(h==="text-color"&&t.updateTextInputColor(u),setColor(this.datum,h,d,u,p,g),t.update())},n=h=>{const{datum:d,node:u}=this;!d||!u||!isTextType(d)||(d.fontSize=h,t.updateTextInputFontSize(h),t.update())},l=()=>{t.delete()},c=({textInputValue:h,bbox:d})=>{if(d!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!isTextType(u))return;const p=maybeWrapText(u,h,d.width);u?.set({text:p}),t.update(),t.recordAction(`Create ${u?.type} annotation`)}else t.delete()};super("start",{start:{click:{target:"waiting-first-render",action:e},dragStart:{target:"waiting-first-render",action:e},cancel:StateMachine4.parent,reset:StateMachine4.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:o,updateTextInputBBox:a,color:r,fontSize:n,textInput:[{guard:guardCancelAndExit,target:StateMachine4.parent,action:l},{guard:guardSaveAndExit,target:StateMachine4.parent,action:c}],click:{target:StateMachine4.parent,action:c},dragStart:{target:StateMachine4.parent,action:c},resize:{target:StateMachine4.parent,action:c},onExit:s,cancel:{target:StateMachine4.parent,action:l}}}),this.debug=Debug4.create(!0,"annotations")}};__decorateClass([StateMachineProperty4()],TextualPointStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty4()],TextualPointStateMachine.prototype,"node",2);var CommentStateMachine=class extends TextualPointStateMachine{createDatum(){return new CommentProperties}},commentConfig={type:"comment",datum:CommentProperties,scene:CommentScene,isDatum:CommentProperties.is,translate:(t,e,i,o)=>{CommentProperties.is(e)&&CommentScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(CommentProperties.is(e)&&CommentProperties.is(i)&&CommentScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{CommentProperties.is(e)&&CommentScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CommentStateMachine({...t,create:e("comment")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community62=require("ag-charts-community"),import_ag_charts_community58=require("ag-charts-community"),{calculateLabelTranslation}=import_ag_charts_community58._ModuleSupport,AxisLabelScene=class extends import_ag_charts_community58._ModuleSupport.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new import_ag_charts_community58._ModuleSupport.Text({zIndex:1}),this.rect=new import_ag_charts_community58._ModuleSupport.Rect;const{label:t}=this;t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.textBaseline="middle",t.textAlign="center",this.append([this.rect,this.label])}update(t){this.updateLabel(t),this.updateRect(t),this.updatePosition(t)}updateLabel({value:t,styles:e,context:i}){const{fontWeight:o,fontSize:s,fontStyle:a,fontFamily:r,textAlign:n,color:l="white",formatter:c}=e,h=c?c({value:t}):i.formatScaleValue(t,"annotation-label");this.label.setProperties({fontWeight:o,fontSize:s,fontStyle:a,fontFamily:r,textAlign:n,fill:l,text:h})}updateRect({styles:t}){const{rect:e}=this,{cornerRadius:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:r}=t;e.fill=o,e.fillOpacity=s??1,e.stroke=a,e.strokeOpacity=r??1,e.cornerRadius=i??0}updatePosition({x:t,y:e,context:i,styles:{padding:o}}){const{label:s,rect:a}=this,r=s.getBBox()?.clone(),n=o??8,l=o??4,{xTranslation:c,yTranslation:h}=calculateLabelTranslation({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:r});r.grow(n,"horizontal"),r.grow(l,"vertical");const d=t+c,u=e+h;s.x=d,s.y=u,a.y=u-Math.round(r.height/2),a.x=d-Math.round(r.width/2),a.height=r.height,a.width=r.width}};AxisLabelScene.className="AxisLabel";var import_ag_charts_community59=require("ag-charts-community"),{Vec2:Vec27}=import_ag_charts_community59._ModuleSupport,CollidableLine=class extends import_ag_charts_community59._ModuleSupport.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(t){return super.setProperties(t),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:t,strokeWidth:e,x1:i,y1:o,x2:s,y2:a}=this;let r=e+t;r%2===0&&(r+=1);const n=Vec27.from(i,o-Math.floor(r/2)),l=Vec27.from(s,a),c=Vec27.distance(n,l);this.collisionBBox=new import_ag_charts_community59._ModuleSupport.BBox(n.x,n.y,c,r)}isPointInPath(t,e){const{collisionBBox:i,x1:o,y1:s,x2:a,y2:r}=this;if(!i)return!1;const n=Vec27.from(o,s),l=Vec27.from(a,r),c=Vec27.sub(Vec27.from(t,e),n),h=Vec27.sub(l,n),d=Vec27.rotate(c,Vec27.angle(c,h),n);return i.containsPoint(d.x,d.y)??!1}render(t){const{clipMask:e}=this,{ctx:i}=t;if(e.size===0){super.render(t);return}i.save();try{for(const o of this.clipMask.values()){const{x:s,y:a,radius:r}=o;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(s,a,r,r,0,Math.PI*2,0,!0),i.clip()}super.render(t)}finally{i.restore()}}setClipMask(t,e){const i=this.clipMask.get(t);import_ag_charts_community59._ModuleSupport.jsonDiff(i,e)!=null&&this.markDirty("CollidableLine"),e?this.clipMask.set(t,e):this.clipMask.delete(t)}},import_ag_charts_community60=require("ag-charts-community"),CollidableText=class extends import_ag_charts_community60._ModuleSupport.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(t,e){const i=this.fromParentPoint(t,e),o=this.computeBBoxWithoutTransforms();return o?o.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}},import_ag_charts_community61=require("ag-charts-community"),{Vec2:Vec28}=import_ag_charts_community61._ModuleSupport;function updateLineText(t,e,i,o,s,a,r){if(!a||!s||!o){e.setClipMask(t);return}const{alignment:n,position:l}=o,c=getNumbers(i,o.fontSize,r),{point:h,textBaseline:d}=positionAndAlignment(c,l,n);setProperties(s,a,o,h,c.angle,d);const{x:u,y:p,width:g,height:y}=s.getBBox(),f=Vec28.length(Vec28.from(g,y)),x={x:u+g/2,y:p+y/2,radius:f/2+Vec28.length(c.offset)};return l==="center"?e.setClipMask(t,x):e.setClipMask(t),{clipMask:x,numbers:c}}function updateChannelText(t,e,i,o,s,a,r){if(!r||!a)return;const{alignment:n,position:l}=o,[c,h]=e.y1<=i.y1?[e,i]:[i,e];let d=c;l==="bottom"?d=h:l==="inside"&&(d={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=getNumbers(d,o.fontSize,s),{point:p,textBaseline:g}=positionAndAlignment(u,l==="inside"?"center":l,n,t);setProperties(a,r,o,p,u.angle,g)}function getNumbers(t,e,i){let[o,s]=Vec28.from(t);o.x>s.x&&([o,s]=[s,o]);const a=Vec28.normalized(Vec28.sub(s,o)),r=Vec28.angle(a),n=Vec28.multiply(a,DivariantHandle.HANDLE_SIZE/2+(e??14)/2),l=Vec28.multiply(a,(i??2)/2+(e??14)/3);return{left:o,right:s,normal:a,angle:r,inset:n,offset:l}}function positionAndAlignment({left:t,right:e,normal:i,angle:o,inset:s,offset:a},r,n,l){let c;n==="right"?c=Vec28.sub(e,s):n==="center"?c=Vec28.add(t,Vec28.multiply(i,Vec28.distance(t,e)/2)):c=Vec28.add(t,s);let h="bottom";return r==="bottom"?(c=Vec28.rotate(a,o+Math.PI/2,c),h="top"):r==="center"&&!l?h="middle":c=Vec28.rotate(a,o-Math.PI/2,c),{point:c,textBaseline:h}}function setProperties(t,e,i,o,s,a){t.setProperties({text:e,x:o.x,y:o.y,rotation:s,rotationCenterX:o.x,rotationCenterY:o.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:a})}var{ChartAxisDirection:ChartAxisDirection6,Vec2:Vec29,Vec4:Vec44}=import_ag_charts_community62._ModuleSupport,CrossLineScene=class extends AnnotationScene{constructor(){super(),this.type="cross-line",this.line=new CollidableLine,this.middle=new UnivariantHandle,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(t){return AnnotationScene.isCheck(t,"cross-line")}update(t,e){const{seriesRect:i}=e;this.seriesRect=i,this.isHorizontal=HorizontalLineProperties.is(t);const o=this.isHorizontal?e.yAxis:e.xAxis,s=this.convertCrossLine(t,o);if(s==null){this.visible=!1;return}this.visible=t.visible??!0,this.visible&&(this.updateLine(t,s),this.updateHandle(t,s),this.updateText(t,s),this.updateAxisLabel(t,o,s))}updateLine(t,e){const{line:i}=this,{lineDashOffset:o,stroke:s,strokeWidth:a,strokeOpacity:r}=t,{x1:n,y1:l,x2:c,y2:h}=e;i.setProperties({x1:n,y1:l,x2:c,y2:h,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:o,stroke:s,strokeWidth:a,strokeOpacity:r,fillOpacity:0})}updateHandle(t,e){const{middle:i}=this,{locked:o,stroke:s,strokeWidth:a,strokeOpacity:r}=t,n={fill:t.handle.fill,stroke:t.handle.stroke??s,strokeOpacity:t.handle.strokeOpacity??r,strokeWidth:t.handle.strokeWidth??a},l=Vec29.sub(Vec44.center(e),Vec29.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...n,...l}),i.toggleLocked(o??!1)}updateText(t,e){this.text=this.updateNode(CollidableText,this.text,!!t.text.label),updateLineText(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}createAxisLabel(t){const e=new AxisLabelScene;return t.attachLabel(e),e}updateAxisLabel(t,e,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(e));const{axisLabel:o,seriesRect:s}=this,{direction:a,position:r}=e;if(t.axisLabel.enabled){o.visible=this.visible;const n=r==="left"||r==="top"?Vec44.start(i):Vec44.end(i),l=a===ChartAxisDirection6.X?n.x:n.y;if(!e.inRange(l)){o.visible=!1;return}const c=getGroupingValue(t.value);o.update({...Vec29.add(n,Vec29.required(s)),value:c,styles:t.axisLabel,context:e})}else o.visible=!1}setAxisLabelOpacity(t){this.axisLabel&&(this.axisLabel.opacity=t)}setAxisLabelVisible(t){this.axisLabel&&(this.axisLabel.visible=t)}toggleHandles(t){this.middle.visible=t,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(t){this.toggleHandles(t),this.middle.toggleActive(t)}dragStart(t,e,i){const o=HorizontalLineProperties.is(t)?{x:e.x,y:convert(t.value,i.yAxis)}:{x:convert(t.value,i.xAxis),y:e.y};this.dragState={offset:e,middle:o}}drag(t,e,i){const{activeHandle:o,dragState:s}=this;!t.isWriteable()||!s||(o&&this[o].toggleDragging(!0),this.translatePoint(t,s.middle,Vec29.sub(e,s.offset),i))}translate(t,e,i){if(!t.isWriteable())return;const o=HorizontalLineProperties.is(t)?Vec29.from(0,convert(t.value,i.yAxis)):Vec29.from(convert(t.value,i.xAxis),0);this.translatePoint(t,o,e,i)}translatePoint(t,e,i,o){const s=HorizontalLineProperties.is(t);s?i.x=0:i.y=0;const{point:a}=translate({point:e},i,o);t.value=s?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(t,e,i){const o=HorizontalLineProperties.is(t),s=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(t,s);if(!a)return;const r=o?-30:0,n=o?0:-30,l=invertCoords({x:a.x1+n,y:a.y1+r},i);return e.set({value:o?l.y:l.x}),e}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(t,e){const{middle:i,line:o,text:s}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="middle",!0):o.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.line.isPointInPath(t,e))return"line";if(this.middle.containsPoint(t,e))return"handle"}getAnchor(){const t=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:t.x+t.width/2,y:t.y}:{x:t.x+t.width,y:t.y+t.height/2,position:"right"}}convertCrossLine(t,e){if(t.value==null)return;let i=0,o=0,s,a;const{bounds:r}=e,n=convert(t.value,e);return HorizontalLineProperties.is(t)?(s=r.width,o=n,a=n):(i=n,s=n,a=r.height),{x1:i,y1:o,x2:s,y2:a}}},import_ag_charts_community63=require("ag-charts-community"),{StateMachine:StateMachine5,StateMachineProperty:StateMachineProperty5,Debug:Debug5}=import_ag_charts_community63._ModuleSupport,CrossLineStateMachine=class extends StateMachine5{constructor(t,e){const i=({point:s})=>{const a=t==="horizontal",r=a?new HorizontalLineProperties:new VerticalLineProperties;r.set({value:a?s.y:s.x}),e.create(r),e.recordAction(`Create ${a?"horizontal-line":"vertical-line"} annotation`)},o=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:StateMachine5.parent,cancel:StateMachine5.parent},"waiting-first-render":{render:{target:StateMachine5.parent,action:o}}}),this.debug=Debug5.create(!0,"annotations")}};__decorateClass([StateMachineProperty5()],CrossLineStateMachine.prototype,"node",2);var horizontalLineConfig={type:"horizontal-line",datum:HorizontalLineProperties,scene:CrossLineScene,isDatum:HorizontalLineProperties.is,translate:(t,e,i,o)=>{HorizontalLineProperties.is(e)&&CrossLineScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(HorizontalLineProperties.is(e)&&HorizontalLineProperties.is(i)&&CrossLineScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{HorizontalLineProperties.is(e)&&CrossLineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CrossLineStateMachine("horizontal",{...t,create:e("horizontal-line")}),dragState:t=>new DragStateMachine(t)},verticalLineConfig={type:"vertical-line",datum:VerticalLineProperties,scene:CrossLineScene,isDatum:VerticalLineProperties.is,translate:(t,e,i,o)=>{VerticalLineProperties.is(e)&&CrossLineScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(VerticalLineProperties.is(e)&&VerticalLineProperties.is(i)&&CrossLineScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{VerticalLineProperties.is(e)&&CrossLineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new CrossLineStateMachine("vertical",{...t,create:e("vertical-line")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community66=require("ag-charts-community"),import_ag_charts_community65=require("ag-charts-community"),import_ag_charts_community64=require("ag-charts-community"),{Vec4:Vec45}=import_ag_charts_community64._ModuleSupport,WithBackgroundScene=class{static updateBackground(t,e,i,o){const{background:s}=this,{seriesRect:a}=o;s.path.clear(!0);const r=Vec45.from(0,0,a.width,a.height),n=this.getBackgroundPoints(t,e,i,r);for(let c=0;ce.x2,a=e.y1>e.y2,r=a?o.y2:o.y1,n=a?o.y1:o.y2,l=Vec210.from(e);return t.extendEnd&&e.y2===n&&l.push(Vec210.from(s?o.x1:o.x2,a?o.y1:o.y2)),t.extendEnd&&i.y2===r&&l.push(Vec210.from(s?o.x1:o.x2,a?o.y2:o.y1)),l.push(...Vec210.from(i).reverse()),t.extendStart&&i.y1===n&&l.push(Vec210.from(s?o.x2:o.x1,a?o.y1:o.y2)),t.extendStart&&e.y1===r&&l.push(Vec210.from(s?o.x2:o.x1,a?o.y2:o.y1)),l}},import_ag_charts_community67=require("ag-charts-community"),import_ag_charts_core33=require("ag-charts-core"),{StateMachine:StateMachine6,StateMachineProperty:StateMachineProperty6,Debug:Debug6}=import_ag_charts_community67._ModuleSupport,DisjointChannelStateMachine=class extends StateMachine6{constructor(t){const e=({point:l})=>{const c=new DisjointChannelProperties;c.set({start:l,end:l,startHeight:0,endHeight:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},o=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:snapPoint(l,c,d,h.start,h.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!(0,import_ag_charts_core33.isNumber)(u)||!(0,import_ag_charts_core33.isNumber)(d)||!(0,import_ag_charts_core33.isNumber)(p))return;const g=d-(p??0),y=(u-d)*2+g,f={x:c?.start.x,y:u-y},x={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint(f,{overflowContinuous:!0})||!t.validatePoint(x,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:g}),t.update())},r=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!(0,import_ag_charts_core33.isNumber)(u)||!(0,import_ag_charts_core33.isNumber)(d)||!(0,import_ag_charts_core33.isNumber)(p))return;const g=d-(p??0),y=(u-d)*2+g,f={x:c.start.x,y:u-g},x={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!t.validatePoint(f,{overflowContinuous:!0})||!t.validatePoint(x,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:g}),t.recordAction("Create disjoint-channel annotation"),t.showAnnotationOptions(),t.update())},n=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:StateMachine6.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:StateMachine6.parent,action:n},cancel:{target:StateMachine6.parent,action:n}},height:{hover:a,click:{target:StateMachine6.parent,action:r},drag:{target:StateMachine6.parent,action:r},reset:{target:StateMachine6.parent,action:n},cancel:{target:StateMachine6.parent,action:n}}}),this.debug=Debug6.create(!0,"annotations"),this.snapping=!1}};__decorateClass([StateMachineProperty6()],DisjointChannelStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty6()],DisjointChannelStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty6()],DisjointChannelStateMachine.prototype,"snapping",2);var disjointChannelConfig={type:"disjoint-channel",datum:DisjointChannelProperties,scene:DisjointChannelScene,isDatum:DisjointChannelProperties.is,translate:(t,e,i,o)=>{DisjointChannelProperties.is(e)&&DisjointChannelScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(DisjointChannelProperties.is(e)&&DisjointChannelProperties.is(i)&&DisjointChannelScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{DisjointChannelProperties.is(e)&&DisjointChannelScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DisjointChannelStateMachine({...t,create:e("disjoint-channel")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community70=require("ag-charts-community"),import_ag_charts_core35=require("ag-charts-core"),import_ag_charts_community68=require("ag-charts-community"),FIBONACCI_RETRACEMENT_RATIOS=[0,23.6,38.2,50,61.8,78.6,100],FIBONACCI_EXTENSION_RATIOS=[161.8,261.8,361.8,423.6],FIBONACCI_RATIOS=[...FIBONACCI_RETRACEMENT_RATIOS,...FIBONACCI_EXTENSION_RATIOS],FIBONACCI_RATIOS_MAP={10:FIBONACCI_RATIOS,6:FIBONACCI_RETRACEMENT_RATIOS,4:FIBONACCI_RETRACEMENT_RATIOS.filter(t=>t!==78.6&&t!==23.6)},FIBONACCI_RANGE_LABEL_PADDING=10;function getFibonacciCoords(t,e){const{x2:i,y1:o,y2:s}=t,a=o-s;return e==null?{x1:i,x2:i,y1:s-a,y2:s}:{x1:e.x1,x2:e.x2,y1:e.y2-a,y2:e.y2}}function createFibonacciRangesData({x1:t,y1:e,x2:i,y2:o},s,a,r,n=10){const l=e-o,c=a?-1:1;let h=r;const d=[];for(const[u,p]of FIBONACCI_RATIOS_MAP[n].entries()){const g=r+l*(p/100)*c,y=s.yAxis.scaleInvert(g);d.push({id:u,x1:t,x2:i,y1:h,y2:g,tag:p==100?0:1,label:{x1:Math.min(t,i)-FIBONACCI_RANGE_LABEL_PADDING,x2:i,y1:g,y2:g,text:`${(p/100).toFixed(3)} (${y.toFixed(2)})`}}),h=g}return d}var{Vec2:Vec211,Vec4:Vec47}=import_ag_charts_community68._ModuleSupport,FibonacciScene=class extends AnnotationScene{constructor(){super(),this.trendLine=new CollidableLine,this.rangeFillsGroup=new import_ag_charts_community68._ModuleSupport.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=import_ag_charts_community68._ModuleSupport.Selection.select(this.rangeFillsGroup,import_ag_charts_community68._ModuleSupport.Range),this.rangeStrokesGroup=new import_ag_charts_community68._ModuleSupport.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=import_ag_charts_community68._ModuleSupport.Selection.select(this.rangeStrokesGroup,CollidableLine),this.labelsGroup=new import_ag_charts_community68._ModuleSupport.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=import_ag_charts_community68._ModuleSupport.Selection.select(this.labelsGroup,CollidableText),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(t,e){let i=convertLine(t,e);if(i==null){this.visible=!1;return}if(i=Vec47.round(i),this.visible=t.visible??!0,!this.visible)return;this.updateLine(t,i,this.trendLine),this.updateHandles(t,i),this.updateAnchor(t,i,e);const{reverse:o}=t,s=this.extendLine(i,t,e),a=o?s.y1:s.y2,r=o?s.y2:s.y1,n=createFibonacciRangesData(s,e,t.reverse,a,t.bands);this.updateRanges(t,n,e);const l={...s,y1:r,y2:r};this.updateText(t,l)}extendLine({x1:t,y1:e,x2:i,y2:o},s,a){const r={x1:t,y1:e,x2:i,y2:o};if(!s.extendStart&&!s.extendEnd)return r;const{x:n,width:l}=a.xAxis.bounds;return s.extendEnd&&(r[t>i?"x1":"x2"]=n+l),s.extendStart&&(r[t>i?"x2":"x1"]=n),r}updateLine(t,e,i){if(!e||!i)return;const{lineDashOffset:o,strokeWidth:s,strokeOpacity:a,stroke:r}=t;i.setProperties({...e,lineCap:t.getLineCap(),lineDash:[3,4],lineDashOffset:o,strokeWidth:s,strokeOpacity:a,fillOpacity:0,stroke:r})}updateRangeStrokes(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:o,strokes:s,rangeStroke:a,isMultiColor:r}=t;this.rangeStrokesGroupSelection.each((n,{x1:l,x2:c,y2:h,tag:d},u)=>{const p=h,g=r?s[u%s.length]:a;n.setProperties({x1:l,x2:c,y1:p,y2:p,stroke:g,strokeOpacity:o,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,tag:d})})}updateRanges(t,e,i){const o=s=>s.id;this.rangeFillsGroupSelection.update(e,void 0,o),this.rangeStrokesGroupSelection.update(e,void 0,o),this.labelsGroupSelection.update(e,void 0,o),this.updateRangeFills(t),this.updateRangeStrokes(t),this.updateRangeLabels(t,i)}updateRangeFills(t){const{lineDashOffset:e,strokeWidth:i,strokeOpacity:o,strokes:s,rangeStroke:a,showFill:r,isMultiColor:n}=t;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:d,y2:u},p)=>{const g=n?s[p%s.length]:a;if(!r){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:d,y2:u,startLine:!1,endLine:!1,stroke:g,strokeOpacity:o,fill:g,fillOpacity:(o??1)*.15,strokeWidth:i,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,visible:!0})})}updateRangeLabels(t,{xAxis:e}){const{rangeStrokesGroupSelection:i}=this,{strokes:o,strokeWidth:s,rangeStroke:a,isMultiColor:r,label:{fontFamily:n,fontSize:l,fontStyle:c,fontWeight:h,color:d}}=t,u={fontFamily:n,fontSize:l,fontStyle:c,fontWeight:h},p=this.checkWithinBounds(e,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((g,y,f)=>{const x=d??(r?o[f%o.length]:a),b=i.at(f);if(!b)return;const{text:m,...S}=y.label;if(p)g.setProperties({...u,text:m,x:S.x1,y:S.y1,textBaseline:"middle",textAlign:"end",fill:x}),updateLineText(g.id,b,S);else{const v={...u,label:m,position:"center",alignment:"left",color:x};updateLineText(g.id,b,S,v,g,m,s)}})}checkWithinBounds(t,e,i){if(!i)return!1;const{text:o,...s}=i.datum.label;i.setProperties({...e,text:o,x:s.x1,y:s.y1,textBaseline:"middle",textAlign:"end"});const{x:a}=i.getBBox();return a>=t.bounds.x&&a<=t.bounds.x+t.bounds.width}updateText(t,e){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:o,strokeWidth:s}=t;this.text=this.updateNode(CollidableText,this.text,!!o.label),updateLineText(i.id,i,e,o,this.text,o.label,s)}updateAnchor(t,e,i,o){const s=Vec47.topCenter(e);Vec211.apply(this.anchor,import_ag_charts_community68._ModuleSupport.Transformable.toCanvasPoint(this.trendLine,s.x,s.y))}containsPoint(t,e){const{trendLine:i,rangeStrokesGroupSelection:o,text:s}=this;let a=!1;return o.each(r=>a||(a=r.isPointInPath(t,e))),a||i.isPointInPath(t,e)||!!s?.containsPoint(t,e)}getNodeAtCoords(t,e){if(this.text?.containsPoint(t,e))return"text";if(this.trendLine.isPointInPath(t,e))return"line"}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}drag(t,e,i,o){t.isWriteable()&&(this.activeHandle?this.dragHandle(t,e,i,o):this.dragAll(t,e,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}},import_ag_charts_community69=require("ag-charts-community"),import_ag_charts_core34=require("ag-charts-core"),{ContinuousScale:ContinuousScale3}=import_ag_charts_community69._ModuleSupport;function validateDatumPoint(t,e,i={overflowContinuous:!1},o){if(e.x==null||e.y==null)return o&&import_ag_charts_core34.Logger.warnOnce(`${o}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:s,yAxis:a}=t,r=i.overflowContinuous&&ContinuousScale3.is(s.scale),n=i.overflowContinuous&&ContinuousScale3.is(a.scale),l=r||validateDatumPointDirection(e.x,s),c=n||validateDatumPointDirection(e.y,a);if(l&&c)return!0;if(o){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const d=getGroupingValue(e.x),u=getGroupingValue(e.y);import_ag_charts_core34.Logger.warnOnce(`${o}is outside the ${h}, ignoring. - x: [${d}], y: ${u}]`)}return!1}function validateDatumPointDirection(t,e){const{domain:i}=e.scale,o=getGroupingValue(t);return i&&o!=null&&e.continuous?o>=i[0]&&o<=i.at(-1):!0}var{Vec2:Vec212,Vec4:Vec48}=import_ag_charts_community70._ModuleSupport,FibonacciRetracementTrendBasedScene=class extends FibonacciScene{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new CollidableLine,this.start=new DivariantHandle,this.end=new DivariantHandle,this.endRetracement=new DivariantHandle,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(t){return AnnotationScene.isCheck(t,"fibonacci-retracement-trend-based")}update(t,e){let{coords1:i,coords2:o}=this.getCoords(t,e);if(i==null||o==null){this.visible=!1;return}if(i=Vec48.round(i),o=Vec48.round(o),this.visible=t.visible??!0,!this.visible)return;(t.endRetracement.x==null||t.endRetracement.y==null)&&(o=void 0),this.updateLine(t,i,this.trendLine),this.updateLine(t,o,this.endRetracementLine),this.updateHandles(t,i,o),this.updateAnchor(t,o??i,e);const{reverse:s,bands:a}=t,r=getFibonacciCoords(i,o),n=this.extendLine(r,t,e),l=n.y2,c=n.y1,h=o?createFibonacciRangesData(n,e,s,l,a):[];this.updateRanges(t,h,e);const d={...n,y1:c,y2:c};this.updateText(t,d)}containsPoint(t,e){const{start:i,end:o,endRetracement:s,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):o.containsPoint(t,e)?(this.activeHandle="end",!0):s.containsPoint(t,e)?(this.activeHandle="endRetracement",!0):a.isPointInPath(t,e)||super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)||this.endRetracement.containsPoint(t,e)?"handle":this.endRetracementLine.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...getDragStartState({start:t.start,end:t.end,endRetracement:t.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(t,e,i){const{dragState:o}=this;o&&this.translatePoints({datum:t,start:o.start,end:o.end,endRetracement:o.endRetracement,translation:Vec212.sub(e,o.offset),context:i})}dragHandle(t,e,i,o){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const r=o?this.snapToAngle(t,e,i):invertCoords(this[s].drag(e).point,i);!r||!validateDatumPoint(i,r)||(t[s].x=r.x,t[s].y=r.y)}snapToAngle(t,e,i){const{activeHandle:o}=this,s=["start","end","endRetracement"];if(!o)return;const a=(s.indexOf(o)+1)%s.length,r=s[a];this[o].toggleDragging(!0);const n=convertPoint(t[r],i);return invertCoords(snapToAngle(e,n,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,endRetracement:o,translation:s,context:a}){const r=translate({start:e,end:i,endRetracement:o},s,a,{overflowContinuous:2});t.start.x=r.start.x,t.end.x=r.end.x,t.endRetracement.x=r.endRetracement.x,t.start.y=r.start.y,t.end.y=r.end.y,t.endRetracement.y=r.endRetracement.y}translate(t,e,i){this.translatePoints({datum:t,start:convertPoint(t.start,i),end:convertPoint(t.end,i),endRetracement:convertPoint(t.endRetracement,i),translation:e,context:i})}copy(t,e,i){const{coords1:o,coords2:s}=this.getCoords(t,i);if(!o||!s)return;const a=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:Vec48.start(o),end:Vec48.end(o),endRetracement:Vec48.end(s),translation:{x:-a.width/2,y:-a.height/2},context:i}),e}getCoords(t,e){return{coords1:convertLine(t,e),coords2:convertLine({start:t.end,end:t.endRetracement},e)}}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t,this.endRetracement.visible=t;else for(const[e,i]of(0,import_ag_charts_core35.entries)(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t),this.endRetracement.toggleActive(t)}updateHandles(t,e,i,o){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",o)}),i&&this.endRetracement.update({...this.getHandleStyles(t),...this.getHandleCoords(t,i,"endRetracement",o)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1),this.endRetracement.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,o){return i==="start"?Vec48.start(e):Vec48.end(e)}},import_ag_charts_community71=require("ag-charts-community"),{StateMachine:StateMachine7,StateMachineProperty:StateMachineProperty7,Debug:Debug7}=import_ag_charts_community71._ModuleSupport,FibonacciRetracementTrendBasedStateMachine=class extends StateMachine7{constructor(t){const e=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),t.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},o=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({end:snapPoint(c,h,u,d.start,d.snapToAngle)}),t.update())},s=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),t.update())},a=({offset:c,context:h})=>{const{datum:d,snapping:u}=this;d&&(d.set({endRetracement:snapPoint(c,h,u,d.end,d.snapToAngle)}),t.update())},r=()=>{this.node?.toggleHandles({endRetracement:!0}),t.update()},n=()=>t.delete(),l=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:StateMachine7.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,click:{target:"endRetracement",action:s},drag:o,dragEnd:{target:"endRetracement",action:s},reset:{target:StateMachine7.parent,action:n},cancel:{target:StateMachine7.parent,action:n},onExit:l},endRetracement:{hover:a,click:{target:StateMachine7.parent,action:r},drag:{target:StateMachine7.parent,action:r},reset:{target:StateMachine7.parent,action:n},cancel:{target:StateMachine7.parent,action:n}}}),this.debug=Debug7.create(!0,"annotations"),this.snapping=!1}createDatum(){return new FibonacciRetracementTrendBasedProperties}};__decorateClass([StateMachineProperty7()],FibonacciRetracementTrendBasedStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty7()],FibonacciRetracementTrendBasedStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty7()],FibonacciRetracementTrendBasedStateMachine.prototype,"snapping",2);var fibonacciRetracementTrendBasedConfig={type:"fibonacci-retracement-trend-based",datum:FibonacciRetracementTrendBasedProperties,scene:FibonacciRetracementTrendBasedScene,isDatum:FibonacciRetracementTrendBasedProperties.is,translate:(t,e,i,o)=>{FibonacciRetracementTrendBasedProperties.is(e)&&FibonacciRetracementTrendBasedScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(FibonacciRetracementTrendBasedProperties.is(e)&&FibonacciRetracementTrendBasedProperties.is(i)&&FibonacciRetracementTrendBasedScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{FibonacciRetracementTrendBasedProperties.is(e)&&FibonacciRetracementTrendBasedScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new FibonacciRetracementTrendBasedStateMachine({...t,create:e("fibonacci-retracement-trend-based")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community72=require("ag-charts-community"),import_ag_charts_core36=require("ag-charts-core"),{Vec2:Vec213,Vec4:Vec49}=import_ag_charts_community72._ModuleSupport,FibonacciRetracementScene=class extends FibonacciScene{constructor(){super(),this.type="fibonacci-retracement",this.start=new DivariantHandle,this.end=new DivariantHandle,this.append([this.start,this.end])}static is(t){return AnnotationScene.isCheck(t,"fibonacci-retracement")}containsPoint(t,e){const{start:i,end:o}=this;return this.activeHandle=void 0,i.containsPoint(t,e)?(this.activeHandle="start",!0):o.containsPoint(t,e)?(this.activeHandle="end",!0):super.containsPoint(t,e)}getNodeAtCoords(t,e){return this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":super.getNodeAtCoords(t,e)}dragStart(t,e,i){this.dragState={offset:e,...getDragStartState({start:t.start,end:t.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(t,e,i){const{dragState:o}=this;o&&this.translatePoints({datum:t,start:o.start,end:o.end,translation:Vec213.sub(e,o.offset),context:i})}dragHandle(t,e,i,o){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const r=o?this.snapToAngle(t,e,i):invertCoords(this[s].drag(e).point,i);!r||!validateDatumPoint(i,r)||(t[s].x=r.x,t[s].y=r.y)}snapToAngle(t,e,i){const{activeHandle:o}=this,a=["start","end"].find(n=>n!==o);if(!o||!a)return;this[o].toggleDragging(!0);const r=convertPoint(t[a],i);return invertCoords(snapToAngle(e,r,t.snapToAngle),i)}translatePoints({datum:t,start:e,end:i,translation:o,context:s}){const a=translate({start:e,end:i},o,s,{overflowContinuous:1});t.start.x=a.start.x,t.end.x=a.end.x,t.start.y=a.start.y,t.end.y=a.end.y}translate(t,e,i){this.translatePoints({datum:t,start:convertPoint(t.start,i),end:convertPoint(t.end,i),translation:e,context:i})}copy(t,e,i){const o=convertLine(t,i);if(!o)return;const s=this.computeBBoxWithoutHandles();return this.translatePoints({datum:e,start:{x:o.x1,y:o.y1},end:{x:o.x2,y:o.y2},translation:{x:-s.width/2,y:-s.height/2},context:i}),e}toggleHandles(t){if(typeof t=="boolean")this.start.visible=t,this.end.visible=t;else for(const[e,i]of(0,import_ag_charts_core36.entries)(t))this[e].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(t){this.toggleHandles(t),this.start.toggleActive(t),this.end.toggleActive(t)}updateHandles(t,e,i,o){this.start.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"start")}),this.end.update({...this.getHandleStyles(t),...this.getHandleCoords(t,e,"end",o)}),this.start.toggleLocked(t.locked??!1),this.end.toggleLocked(t.locked??!1)}getHandleCoords(t,e,i,o){return i==="start"?Vec49.start(e):Vec49.end(e)}},import_ag_charts_community73=require("ag-charts-community"),{StateMachine:StateMachine8,StateMachineProperty:StateMachineProperty8,Debug:Debug8}=import_ag_charts_community73._ModuleSupport,LineTypeStateMachine=class extends StateMachine8{constructor(t){const e=({point:n})=>{const l=this.createDatum();l.set({start:n,end:n}),t.create(l)},i=()=>{const{node:n}=this;n?.toggleActive(!0),n?.toggleHandles({start:!0,end:!1})},o=({offset:n,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:snapPoint(n,l,h,c.start,c.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({end:!0}),t.update()},a=()=>t.delete(),r=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:StateMachine8.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,click:{target:StateMachine8.parent,action:s},drag:o,dragEnd:{target:StateMachine8.parent,action:s},reset:{target:StateMachine8.parent,action:a},cancel:{target:StateMachine8.parent,action:a},onExit:r}}),this.debug=Debug8.create(!0,"annotations"),this.snapping=!1}};__decorateClass([StateMachineProperty8()],LineTypeStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty8()],LineTypeStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty8()],LineTypeStateMachine.prototype,"snapping",2);var ArrowStateMachine=class extends LineTypeStateMachine{createDatum(){return new ArrowProperties}},LineStateMachine=class extends LineTypeStateMachine{createDatum(){return new LineProperties}},FibonacciRetracementStateMachine=class extends LineTypeStateMachine{createDatum(){return new FibonacciRetracementProperties}},fibonacciRetracementConfig={type:"fibonacci-retracement",datum:FibonacciRetracementProperties,scene:FibonacciRetracementScene,isDatum:FibonacciRetracementProperties.is,translate:(t,e,i,o)=>{FibonacciRetracementProperties.is(e)&&FibonacciRetracementScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(FibonacciRetracementProperties.is(e)&&FibonacciRetracementProperties.is(i)&&FibonacciRetracementScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{FibonacciRetracementProperties.is(e)&&FibonacciRetracementScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new FibonacciRetracementStateMachine({...t,create:e("fibonacci-retracement")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community75=require("ag-charts-community"),import_ag_charts_community74=require("ag-charts-community"),{Vec2:Vec214}=import_ag_charts_community74._ModuleSupport,CapScene=class extends import_ag_charts_community74._ModuleSupport.Group{},ArrowCapScene=class extends CapScene{constructor(){super(),this.type="arrow",this.path=new import_ag_charts_community74._ModuleSupport.Path,this.armLength=6,this.append([this.path])}update(t){const{path:e}=this,{x:i,y:o,angle:s,...a}=t,r=Vec214.from(i,o),n=3*Math.PI/4,l=this.armLength+(t.strokeWidth??0)*2,c=Vec214.rotate(Vec214.from(0,l),s+n,r),h=Vec214.rotate(Vec214.from(l,0),s-n,r);e.setProperties(a),e.fillOpacity=0,e.path.clear(),e.path.moveTo(c.x,c.y),e.path.lineTo(r.x,r.y),e.path.lineTo(h.x,h.y)}},{Vec2:Vec215,Vec4:Vec410}=import_ag_charts_community75._ModuleSupport,LineScene=class extends StartEndScene{constructor(){super(),this.type="line",this.line=new CollidableLine,this.append([this.line,this.start,this.end])}static is(t){return AnnotationScene.isCheck(t,"line")}update(t,e){let i=convertLine(t,e);if(i==null){this.visible=!1;return}i=Vec410.round(i),this.visible=t.visible??!0,this.visible&&(this.updateLine(t,i,e),this.updateHandles(t,i),this.updateText(t,i),this.updateCaps(t,i),this.updateAnchor(t,i,e))}updateLine(t,e,i){const{line:o}=this,{lineDashOffset:s,stroke:a,strokeWidth:r,strokeOpacity:n}=t,l=this.extendLine(e,t,i);o.setProperties({...l,lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:s,stroke:a,strokeWidth:r,strokeOpacity:n,fillOpacity:0})}updateText(t,e){this.text=this.updateNode(CollidableText,this.text,!!t.text.label),updateLineText(this.line.id,this.line,e,t.text,this.text,t.text.label,t.strokeWidth)}updateCaps(t,e){if(!t.startCap&&this.startCap&&(this.startCap.remove(),this.startCap=void 0),!t.endCap&&this.endCap&&(this.endCap.remove(),this.endCap=void 0),!t.startCap&&!t.endCap)return;const{stroke:i,strokeWidth:o,strokeOpacity:s}=t,[a,r]=Vec215.from(e),n=Vec215.angle(Vec215.sub(r,a));t.startCap&&(this.startCap&&this.startCap.type!==t.startCap&&(this.startCap.remove(),this.startCap=void 0),this.startCap==null&&(this.startCap=new ArrowCapScene,this.append([this.startCap])),this.startCap.update({x:a.x,y:a.y,angle:n-Math.PI,stroke:i,strokeWidth:o,strokeOpacity:s})),t.endCap&&(this.endCap&&this.endCap.type!==t.endCap&&(this.endCap.remove(),this.endCap=void 0),this.endCap==null&&(this.endCap=new ArrowCapScene,this.append([this.endCap])),this.endCap.update({x:r.x,y:r.y,angle:n,stroke:i,strokeWidth:o,strokeOpacity:s}))}updateAnchor(t,e,i,o){const s=Vec410.topCenter(e);Vec215.apply(this.anchor,import_ag_charts_community75._ModuleSupport.Transformable.toCanvasPoint(this.line,s.x,s.y))}containsPoint(t,e){const{line:i,text:o}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||!!o?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.line.isPointInPath(t,e)?"line":super.getNodeAtCoords(t,e)}getHandleCoords(t,e,i,o){const{startCap:s,endCap:a}=this;let[r,n]=Vec215.from(e);const l=Vec215.angle(Vec215.sub(n,r));return s&&(r=Vec215.rotate(Vec215.from(0,-DivariantHandle.HANDLE_SIZE/2),l,r)),a&&(n=Vec215.rotate(Vec215.from(0,DivariantHandle.HANDLE_SIZE/2),l,n)),i==="start"?r:n}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}},lineConfig={type:"line",datum:LineProperties,scene:LineScene,isDatum:LineProperties.is,translate:(t,e,i,o)=>{LineProperties.is(e)&&LineScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(LineProperties.is(e)&&LineProperties.is(i)&&LineScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{LineProperties.is(e)&&LineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new LineStateMachine({...t,create:e("line")}),dragState:t=>new DragStateMachine(t)},arrowConfig={type:"arrow",datum:ArrowProperties,scene:LineScene,isDatum:ArrowProperties.is,translate:(t,e,i,o)=>{ArrowProperties.is(e)&&LineScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(ArrowProperties.is(e)&&ArrowProperties.is(i)&&LineScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{ArrowProperties.is(e)&&LineScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ArrowStateMachine({...t,create:e("arrow")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community78=require("ag-charts-community"),import_ag_charts_core37=require("ag-charts-core"),import_ag_charts_community77=require("ag-charts-community"),import_ag_charts_community76=require("ag-charts-community");function layoutScenesRow(t,e=0,i=0){let o=e;for(const s of t)if(Array.isArray(s)){for(const a of s)layoutSetX(a,o);o+=import_ag_charts_community76._ModuleSupport.Group.computeChildrenBBox(s).width+i}else layoutSetX(s,o),o+=s.getBBox().width+i}function layoutScenesColumn(t,e=0,i=0){let o=e;for(const s of t)if(Array.isArray(s)){for(const a of s)layoutSetY(a,o);o+=import_ag_charts_community76._ModuleSupport.Group.computeChildrenBBox(s).height+i}else layoutSetY(s,o),o+=s.getBBox().height+i}function layoutSetX(t,e){"x1"in t?(t.x2=e+(t.x2-t.x1),t.x1=e):t.x=e}function layoutSetY(t,e){"y1"in t?(t.y2=e+(t.y2-t.y1),t.y1=e):t.y=e}function layoutAddX(t,e){"x1"in t?(t.x1+=e,t.x2+=e):t.x+=e}function layoutAddY(t,e){"y1"in t?(t.y1+=e,t.y2+=e):t.y+=e}var{Vec4:Vec411}=import_ag_charts_community77._ModuleSupport,MeasurerStatisticsScene=class extends import_ag_charts_community77._ModuleSupport.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new import_ag_charts_community77._ModuleSupport.Rect,this.dateRangeBarsText=new import_ag_charts_community77._ModuleSupport.Text,this.dateRangeDivider=new import_ag_charts_community77._ModuleSupport.Line,this.dateRangeValueText=new import_ag_charts_community77._ModuleSupport.Text,this.priceRangeValueText=new import_ag_charts_community77._ModuleSupport.Text,this.priceRangeDivider=new import_ag_charts_community77._ModuleSupport.Line,this.priceRangePercentageText=new import_ag_charts_community77._ModuleSupport.Text,this.volumeText=new import_ag_charts_community77._ModuleSupport.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(t,e,i,o,s,a,r){this.verticalDirection=a;const n=this.updateStatistics(t,e,i,r),l=import_ag_charts_community77._ModuleSupport.Group.computeChildrenBBox(n.flat()),c=10;l.grow(c),this.updateBackground(t,l,c),this.reposition(n,c,s),this.checkVisibility(t,s,o)}checkVisibility(t,e,i){const o=Vec411.from(new import_ag_charts_community77._ModuleSupport.BBox(0,0,e.seriesRect.width,e.seriesRect.height));Vec411.collides(i,o)?this.visible=t.visible??!0:this.visible=!1}updateStatistics(t,e,i,o){const{dateRangeBarsText:s,dateRangeDivider:a,dateRangeValueText:r,priceRangeValueText:n,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,d=8,u=6,p=t.statistics.fontSize+3,g=-2,y=this.getTextStyles(t),f={...this.getDividerStyles(t),x1:0,y1:0,x2:0,y2:p},x=[s,a,r],b=[n,l,c],m=[];return e.priceRange&&(n.setProperties({...y,text:this.formatPriceRangeValue(e.priceRange.value,o)}),l.setProperties(f),c.setProperties({...y,text:this.formatPriceRangePercentage(e.priceRange.percentage,o)}),layoutScenesRow(b,i.x,d),m.push(b)),e.dateRange&&(s.setProperties({...y,text:this.formatDateRangeBars(e.dateRange.bars,o)}),a.setProperties(f),r.setProperties({...y,text:this.formatDateRangeValue(e.dateRange.value)}),layoutScenesRow(x,i.x,d),m.push(x)),e.volume==null?h.visible=!1:(h.setProperties({...y,x:i.x,text:this.formatVolume(e.volume,o),visible:!0}),m.push(h)),layoutScenesColumn(m,i.y,u),l.y1+=g,l.y2+=g,a.y1+=g,a.y2+=g,m}updateBackground(t,e,i){const o=this.getBackgroundStyles(t);this.background.setProperties({...o,...e,x:e.x-e.width/2+i,y:e.y})}reposition(t,e,i){const{width:o,height:s}=i.seriesRect,a=Vec411.from(this.background.getBBox());let r=0;a.x1<0&&(r=-a.x1),a.x2>o&&(r=o-a.x2);const n=Math.min(e,s-a.y2);for(const l of t)if(Array.isArray(l)){const c=import_ag_charts_community77._ModuleSupport.Group.computeChildrenBBox(l).width;for(const h of l)layoutAddX(h,r-c/2),layoutAddY(h,n)}else layoutAddX(l,r-l.getBBox().width/2),layoutAddY(l,n);this.background.x+=r,this.background.y+=n}getTextStyles(t){return{fill:t.statistics.color,fontFamily:t.statistics.fontFamily,fontSize:t.statistics.fontSize,fontStyle:t.statistics.fontStyle,fontWeight:t.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(t){return{stroke:t.statistics.divider.stroke,strokeOpacity:t.statistics.divider.strokeOpacity,strokeWidth:t.statistics.divider.strokeWidth}}getBackgroundStyles(t){return{fill:t.statistics.fill,stroke:t.statistics.stroke,strokeOpacity:t.statistics.strokeOpacity,strokeWidth:t.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(t,e){return e?.t("measurerDateRangeBars",{value:t})??`${t}`}formatDateRangeValue(t){const e=[],i=t>=0?"":"-";t=Math.abs(t);const o=1e3*60,s=o*60,a=s*24,r=Math.floor(t/o),n=Math.floor(t/s),l=Math.floor(t/a),c=n%(a/s),h=r%(s/o);return l>=1&&e.push(`${l}d`),n>=1&&(t=o.x-h.x&&(l={x:o.x,y:n.clipMask.y,radius:this.text.getBBox().height/2+Vec216.length(h)})}this.verticalLine.setClipMask(r,l)}updateCaps(t,e){const{horizontalEndCap:i,verticalEndCap:o}=this,{direction:s}=t,{x1:a,y1:r,x2:n,y2:l}=e,c=Vec216.round(Vec412.center(e),0),{stroke:h,strokeWidth:d,strokeOpacity:u}=this.getLineStyles(t),p={stroke:h,strokeWidth:d,strokeOpacity:u};if(s!=="vertical"){const g=a<=n?0:Math.PI;let y=n;s==="horizontal"&&(y+=a<=n?-2:2),i.update({...p,x:y,y:c.y,angle:g})}if(s!=="horizontal"){const g=r<=l?Math.PI/2:Math.PI/-2;let y=l;s==="vertical"&&(y+=r<=l?-2:2),o.update({...p,x:c.x,y,angle:g})}}updateBoundingLines(t,e){const{verticalStartLine:i,verticalEndLine:o,horizontalStartLine:s,horizontalEndLine:a}=this,{direction:r}=t,{x1:n,y1:l,x2:c,y2:h}=e,d=this.getLineStyles(t);r==="horizontal"&&(i.setProperties({...d,x1:n,y1:l,x2:n,y2:h}),o.setProperties({...d,x1:c,y1:l,x2:c,y2:h})),r==="vertical"&&(s.setProperties({...d,x1:n,y1:l,x2:c,y2:l}),a.setProperties({...d,x1:n,y1:h,x2:c,y2:h}))}updateStatistics(t,e,i){const o=Vec216.add(Vec412.bottomCenter(e),Vec216.from(0,10)),s={volume:this.getVolume(t)};t.hasPriceRange&&(s.priceRange={percentage:this.getPriceRangePercentage(t),value:this.getPriceRangeValue(t)}),t.hasDateRange&&(s.dateRange={bars:this.getDateRangeBars(e,i),value:this.getDateRangeValue(t)}),this.statistics.update(t,s,o,e,i,this.verticalDirection,t.localeManager)}updateAnchor(t,e,i,o){const s=Vec412.topCenter(e);Vec216.apply(this.anchor,import_ag_charts_community78._ModuleSupport.Transformable.toCanvasPoint(this.horizontalLine,s.x,s.y))}getBackgroundPoints(t,e,i,o){const[s,a]=Vec216.from(e),[r,n]=Vec216.from(i);return[s,a,n,r]}getLineStyles(t){const{lineDashOffset:e,stroke:i,strokeWidth:o,strokeOpacity:s}=t;return{lineCap:t.getLineCap(),lineDash:t.getLineDash(),lineDashOffset:e,stroke:i,strokeWidth:o,strokeOpacity:s,fillOpacity:0}}getBackgroundStyles(t){const{background:e}=t;return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}containsPoint(t,e){const{horizontalLine:i,text:o,verticalLine:s,horizontalStartLine:a,horizontalEndLine:r,verticalStartLine:n,verticalEndLine:l}=this;return super.containsPoint(t,e)||i.isPointInPath(t,e)||s.isPointInPath(t,e)||a.visible&&a.isPointInPath(t,e)||r.visible&&r.isPointInPath(t,e)||n.visible&&n.isPointInPath(t,e)||l.visible&&l.isPointInPath(t,e)||!!o?.containsPoint(t,e)}getNodeAtCoords(t,e){return this.text?.containsPoint(t,e)?"text":this.start.containsPoint(t,e)||this.end.containsPoint(t,e)?"handle":"line"}getDateRangeBars(t,e){const{step:i}=e.xAxis.scale,o=t.x1<=t.x2?1:-1;return i?Math.round(Vec412.width(t)/i)*o:0}getDateRangeValue(t){const e=getGroupingValue(t.start.x),i=getGroupingValue(t.end.x);if(!(0,import_ag_charts_core37.isDate)(e)||!(0,import_ag_charts_core37.isDate)(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-e.getTime()}getPriceRangePercentage(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=getGroupingValue(t.end.y),i=getGroupingValue(t.start.y);if(!(0,import_ag_charts_core37.isNumber)(e)||!(0,import_ag_charts_core37.isNumber)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(e-i)/i}getPriceRangeValue(t){if(t.start.y==null||t.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const e=getGroupingValue(t.end.y),i=getGroupingValue(t.start.y);if(!(0,import_ag_charts_core37.isNumber)(e)||!(0,import_ag_charts_core37.isNumber)(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return e-i}getVolume(t){return t.getVolume(t.start.x,t.end.x)}},QuickMeasurerScene=class extends MeasurerScene{constructor(){super(...arguments),this.type="quick-measurer"}static is(t){return AnnotationScene.isCheck(t,"quick-measurer")}createStatisticsScene(){return new QuickMeasurerStatisticsScene}getDirectionStyles(t){return this.verticalDirection==="down"?t.down:t.up}getLineStyles(t){const e=this.getDirectionStyles(t);return{...super.getLineStyles(t),stroke:e.stroke,strokeWidth:e.strokeWidth,strokeOpacity:e.strokeOpacity}}getBackgroundStyles(t){const e=this.getDirectionStyles(t);return{fill:e.fill,fillOpacity:e.fillOpacity}}getHandleStyles(t){const e=this.getDirectionStyles(t);return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},import_ag_charts_community79=require("ag-charts-community"),{StateMachine:StateMachine9,StateMachineProperty:StateMachineProperty9,Debug:Debug9}=import_ag_charts_community79._ModuleSupport,MeasurerTypeStateMachine=class extends StateMachine9{constructor(t){const e=({point:r})=>{const n=this.createDatum();n.set({start:r,end:r}),t.create(n)},i=({point:r})=>{const{datum:n,node:l}=this;n?.set({end:r}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),t.update()},o=()=>{this.node?.toggleHandles({end:!0})},s=()=>t.delete(),a=()=>{t.showAnnotationOptions(),t.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:StateMachine9.parent,click:{target:"end",action:e},drag:{target:"end",action:e}},end:{hover:i,drag:i,click:{target:StateMachine9.parent,action:o},dragEnd:{target:StateMachine9.parent,action:o},reset:{target:StateMachine9.parent,action:s},cancel:{target:StateMachine9.parent,action:s},onExit:a}}),this.debug=Debug9.create(!0,"annotations")}};__decorateClass([StateMachineProperty9()],MeasurerTypeStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty9()],MeasurerTypeStateMachine.prototype,"node",2);var DateRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new DateRangeProperties}},PriceRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new PriceRangeProperties}},DatePriceRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new DatePriceRangeProperties}},QuickDatePriceRangeStateMachine=class extends MeasurerTypeStateMachine{createDatum(){return new QuickDatePriceRangeProperties}},dateRangeConfig={type:"date-range",datum:DateRangeProperties,scene:MeasurerScene,isDatum:DateRangeProperties.is,translate:(t,e,i,o)=>{DateRangeProperties.is(e)&&MeasurerScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(DateRangeProperties.is(e)&&DateRangeProperties.is(i)&&MeasurerScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{DateRangeProperties.is(e)&&MeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DateRangeStateMachine({...t,create:e("date-range")}),dragState:t=>new DragStateMachine(t)},priceRangeConfig={type:"price-range",datum:PriceRangeProperties,scene:MeasurerScene,isDatum:PriceRangeProperties.is,translate:(t,e,i,o)=>{PriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(PriceRangeProperties.is(e)&&PriceRangeProperties.is(i)&&MeasurerScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{PriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new PriceRangeStateMachine({...t,create:e("date-range")}),dragState:t=>new DragStateMachine(t)},datePriceRangeConfig={type:"date-price-range",datum:DatePriceRangeProperties,scene:MeasurerScene,isDatum:DatePriceRangeProperties.is,translate:(t,e,i,o)=>{DatePriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(DatePriceRangeProperties.is(e)&&DatePriceRangeProperties.is(i)&&MeasurerScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{DatePriceRangeProperties.is(e)&&MeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new DatePriceRangeStateMachine({...t,create:e("date-range")}),dragState:t=>new DragStateMachine(t)},quickDatePriceRangeConfig={type:"quick-date-price-range",datum:QuickDatePriceRangeProperties,scene:QuickMeasurerScene,isDatum:QuickDatePriceRangeProperties.is,translate:(t,e,i,o)=>{QuickDatePriceRangeProperties.is(e)&&QuickMeasurerScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(QuickDatePriceRangeProperties.is(e)&&QuickDatePriceRangeProperties.is(i)&&QuickMeasurerScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{QuickDatePriceRangeProperties.is(e)&&QuickMeasurerScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new QuickDatePriceRangeStateMachine({...t,create:e("quick-date-price-range")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community80=require("ag-charts-community"),import_ag_charts_core38=require("ag-charts-core"),{ZIndexMap:ZIndexMap3}=import_ag_charts_community80._ModuleSupport,NoteScene=class extends TextualPointScene{constructor(){super(),this.type="note",this.shape=new import_ag_charts_community80._ModuleSupport.Rect,this.iconBackground=new import_ag_charts_community80._ModuleSupport.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new import_ag_charts_community80._ModuleSupport.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new import_ag_charts_community80._ModuleSupport.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(t){return AnnotationScene.isCheck(t,"note")}update(t,e){this.updateIcon(t,e),super.update(t,e)}getTextBBox(t,e,i){const o=super.getTextBBox(t,e,i);o.x-=t.width/2,o.x=(0,import_ag_charts_core38.clamp)(0,o.x,i.seriesRect.width-t.width);const s=t.getPadding().top,a=o.y-LABEL_OFFSET-s*2,r=o.y+DivariantHandle.HANDLE_SIZE+s*2;return a-o.height-TOOLBAR_OFFSET<0?(o.y=r,t.position="top"):(o.y=a+s,t.position="bottom"),o}updateLabel(t,e){const i=t.visible===!1?!1:this.label.visible;super.updateLabel(t,e),this.label.visible=i,this.label.text=(0,import_ag_charts_core38.wrapText)(t.text,{maxWidth:200,font:t,textWrap:"always",avoidOrphans:!1})}updateShape(t,e){const{shape:i}=this;i.fill=t.background.fill,i.fillOpacity=t.background.fillOpacity??1,i.stroke=t.background.stroke,i.strokeOpacity=t.background.strokeOpacity??1,i.strokeWidth=t.background.strokeWidth??1,i.cornerRadius=4;const o=t.getPadding().top,s=t.position==="top";i.x=e.x-o,i.width=t.width+o*2,i.height=e.height+o*2,i.y=e.y+(s?0:-e.height)-o}updateIcon(t,e){const{active:i,iconBackground:o,iconLines:s}=this,{x:a,y:r}=convertPoint(t,e);o.translationX=a-ICON_WIDTH/2,o.translationY=r-ICON_HEIGHT,s.translationX=o.translationX,s.translationY=o.translationY,o.fill=t.fill,o.fillOpacity=t.fillOpacity??1,o.stroke=t.stroke,o.strokeOpacity=t.strokeOpacity??1,o.strokeWidth=t.strokeWidth??1,s.fill=t.stroke,i?o.fillShadow.color=t.fill??"rgba(0, 0, 0, 0.22)":o.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(t,e,i){const o=t.getPadding().top,s=t.position==="top",a=s?1:-1;return{x:e.x+i.seriesRect.x+t.width/2,y:e.y+i.seriesRect.y+a*(e.height+o),position:s?"below":"above"}}getLabelCoords(t,e){const i=t.position==="top",o=t.getPadding().top+(0,import_ag_charts_core38.calcLineHeight)(t.fontSize,ANNOTATION_TEXT_LINE_HEIGHT)/2;return{x:e.x,y:e.y+(i?o/2:0)}}getTextBaseline(t){return t.position==="top"?"middle":t.position}getHandleCoords(t,e,i){return{x:e.x,y:e.y+DivariantHandle.HANDLE_SIZE/2+4}}getHandleStyles(t){return{fill:t.handle.fill,stroke:t.handle.stroke??t.fill,strokeOpacity:t.handle.strokeOpacity,strokeWidth:t.handle.strokeWidth}}toggleHovered(t,e,i){super.toggleHovered(t,e,i);const o=t||e&&!i;this.label.visible=o,this.shape.visible=o,this.zIndex=o?ZIndexMap3.CHART_ANNOTATION_FOCUSED:ZIndexMap3.CHART_ANNOTATION}toggleActive(t){super.toggleActive(t),this.label.visible=t,this.shape.visible=t,this.active=t}containsPoint(t,e){return this.shape.visible&&this.shape.containsPoint(t,e)||this.iconBackground.containsPoint(t,e)?!0:super.containsPoint(t,e)}},NoteStateMachine=class extends TextualPointStateMachine{createDatum(){return new NoteProperties}},noteConfig={type:"note",datum:NoteProperties,scene:NoteScene,isDatum:NoteProperties.is,translate:(t,e,i,o)=>{NoteProperties.is(e)&&NoteScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(NoteProperties.is(e)&&NoteProperties.is(i)&&NoteScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{NoteProperties.is(e)&&NoteScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new NoteStateMachine({...t,create:e("note")}),dragState:t=>new DragStateMachine(t)},import_ag_charts_community81=require("ag-charts-community"),{Vec2:Vec217,Vec4:Vec413}=import_ag_charts_community81._ModuleSupport,ParallelChannelScene=class extends ChannelScene{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new DivariantHandle,topMiddle:new UnivariantHandle,topRight:new DivariantHandle,bottomLeft:new DivariantHandle,bottomMiddle:new UnivariantHandle,bottomRight:new DivariantHandle},this.middleLine=new CollidableLine,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(t){return AnnotationScene.isCheck(t,"parallel-channel")}dragHandle(t,e,i,o){const{activeHandle:s,handles:a}=this;if(s==null)return;const{offset:r}=a[s].drag(e);a[s].toggleDragging(!0),(s==="topMiddle"||s==="bottomMiddle")&&(r.x=0);let n=[],l=o;switch(s){case"topLeft":case"bottomLeft":n=["topLeft","bottomLeft"];break;case"topMiddle":n=["topLeft","topRight"],r.y-=UnivariantHandle.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":n=["topRight","bottomRight"];break;case"bottomMiddle":n=["bottomLeft","bottomRight"],r.y-=UnivariantHandle.HANDLE_SIZE/2,l=!1;break}const c=convertLine(t,i),h=convertLine(t.bottom,i);if(!c||!h)return;const d={topLeft:Vec413.start(c),topRight:Vec413.end(c),bottomLeft:Vec413.start(h),bottomRight:Vec413.end(h)},u={vectors:{topLeft:d.topRight,bottomLeft:d.bottomRight,topRight:d.topLeft,bottomRight:d.bottomLeft},angle:t.snapToAngle},p=translate(d,r,i,{overflowContinuous:this.overflowContinuous,translateVectors:n,snap:l?u:void 0});t.start.x=p.topLeft.x,t.start.y=p.topLeft.y,t.end.x=p.topRight.x,t.end.y=p.topRight.y,t.height=p.topLeft.y-p.bottomLeft.y}getTranslatePointsVectors(t,e){const{bottomLeft:i,topLeft:o}=this.handles,s=i.getBBox().y-o.getBBox().y,a=Vec217.add(t,Vec217.from(0,s)),r=Vec217.add(e,Vec217.from(0,s));return{start:t,end:e,bottomStart:a,bottomEnd:r}}containsPoint(t,e){return super.containsPoint(t,e)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)}getNodeAtCoords(t,e){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(t,e)?"line":super.getNodeAtCoords(t,e)}updateLines(t,e,i,o,s,a){const{topLine:r,middleLine:n,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u}=t,p=t.getLineDash(),g={lineCap:t.getLineCap(),lineDash:p,lineDashOffset:c,stroke:h,strokeOpacity:d,strokeWidth:u};r.setProperties({...e,...g}),l.setProperties({...i,...g});const y=this.extendLine({x1:s.x1,y1:a.y1+(s.y1-a.y1)/2,x2:s.x2,y2:a.y2+(s.y2-a.y2)/2},t,o);n.setProperties({...y,lineDash:t.middle.lineDash??p,lineDashOffset:t.middle.lineDashOffset??c,stroke:t.middle.stroke??h,strokeOpacity:t.middle.strokeOpacity??d,strokeWidth:t.middle.strokeWidth??u,visible:t.middle.visible??!0})}updateHandles(t,e,i){const{handles:{topLeft:o,topMiddle:s,topRight:a,bottomLeft:r,bottomMiddle:n,bottomRight:l}}=this,c={fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth};o.update({...c,...Vec413.start(e)}),a.update({...c,...Vec413.end(e)}),r.update({...c,...Vec413.start(i)}),l.update({...c,...Vec413.end(i)}),s.update({...c,...Vec217.sub(Vec413.center(e),Vec217.from(s.handle.width/2,s.handle.height/2))}),n.update({...c,...Vec217.sub(Vec413.center(i),Vec217.from(n.handle.width/2,n.handle.height/2))})}updateText(t,e,i){this.text=this.updateNode(CollidableText,this.text,!!t.text.label),updateChannelText(!0,e,i,t.text,t.strokeWidth,this.text,t.text.label)}getBackgroundPoints(t,e,i,o){const s=e.x1>e.x2,a=e.y1>e.y2,r=e.x1!==i.x1&&e.y1!==i.y1,n=e.x2!==i.x2&&e.y2!==i.y2,l=Vec217.from(e);return t.extendEnd&&n&&l.push(Vec217.from(s?o.x1:o.x2,a?o.y1:o.y2)),l.push(...Vec217.from(i).reverse()),t.extendStart&&r&&l.push(Vec217.from(s?o.x2:o.x1,a?o.y2:o.y1)),l}},import_ag_charts_community82=require("ag-charts-community"),import_ag_charts_core39=require("ag-charts-core"),{StateMachine:StateMachine10,StateMachineProperty:StateMachineProperty10,Debug:Debug10}=import_ag_charts_community82._ModuleSupport,ParallelChannelStateMachine=class extends StateMachine10{constructor(t){const e=({point:l})=>{const c=new ParallelChannelProperties;c.set({start:l,end:l,height:0}),t.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},o=({offset:l,context:c})=>{const{datum:h,snapping:d}=this;h&&(h.set({end:snapPoint(l,c,d,h.start,h.snapToAngle)}),t.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),t.update()},a=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!(0,import_ag_charts_core39.isNumber)(u)||!(0,import_ag_charts_core39.isNumber)(d)||!(0,import_ag_charts_core39.isNumber)(p))return;const g=d-(p??0),y=u-g;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!t.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),t.update())},r=({point:l})=>{const{datum:c,node:h}=this,d=getGroupingValue(c?.end.y),u=getGroupingValue(c?.start.y),{y:p}=l;if(c==null||!(0,import_ag_charts_core39.isNumber)(u)||!(0,import_ag_charts_core39.isNumber)(d)||!(0,import_ag_charts_core39.isNumber)(p))return;const g=d-(p??0),y=u-g;h?.toggleHandles(!0),!(!t.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!t.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:g}),t.recordAction("Create parallel-channel annotation"),t.showAnnotationOptions(),t.update())},n=()=>t.delete();super("start",{start:{click:{target:"waiting-first-render",action:e},drag:{target:"waiting-first-render",action:e},reset:StateMachine10.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:StateMachine10.parent,action:n},cancel:{target:StateMachine10.parent,action:n}},height:{hover:a,click:{target:StateMachine10.parent,action:r},drag:{target:StateMachine10.parent,action:r},reset:{target:StateMachine10.parent,action:n},cancel:{target:StateMachine10.parent,action:n}}}),this.debug=Debug10.create(!0,"annotations"),this.snapping=!1}};__decorateClass([StateMachineProperty10()],ParallelChannelStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty10()],ParallelChannelStateMachine.prototype,"node",2),__decorateClass([StateMachineProperty10()],ParallelChannelStateMachine.prototype,"snapping",2);var parallelChannelConfig={type:"parallel-channel",datum:ParallelChannelProperties,scene:ParallelChannelScene,isDatum:ParallelChannelProperties.is,translate:(t,e,i,o)=>{ParallelChannelProperties.is(e)&&ParallelChannelScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(ParallelChannelProperties.is(e)&&ParallelChannelProperties.is(i)&&ParallelChannelScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{ParallelChannelProperties.is(e)&&ParallelChannelScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new ParallelChannelStateMachine({...t,create:e("parallel-channel")}),dragState:t=>new DragStateMachine(t)},TextScene=class extends TextualPointScene{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(t){return AnnotationScene.isCheck(t,"text")}getHandleCoords(t,e){const i=DivariantHandle.HANDLE_SIZE/2;return{x:e.x+i,y:e.y+2+i}}},TextStateMachine=class extends TextualPointStateMachine{createDatum(){return new TextProperties}},textConfig={type:"text",datum:TextProperties,scene:TextScene,isDatum:TextProperties.is,translate:(t,e,i,o)=>{TextProperties.is(e)&&TextScene.is(t)&&t.translate(e,i,o)},copy:(t,e,i,o)=>{if(TextProperties.is(e)&&TextProperties.is(i)&&TextScene.is(t))return t.copy(e,i,o)},update:(t,e,i)=>{TextProperties.is(e)&&TextScene.is(t)&&t.update(e,i)},createState:(t,{createDatum:e})=>new TextStateMachine({...t,create:e("text")}),dragState:t=>new DragStateMachine(t)},annotationConfigs={[lineConfig.type]:lineConfig,[horizontalLineConfig.type]:horizontalLineConfig,[verticalLineConfig.type]:verticalLineConfig,[parallelChannelConfig.type]:parallelChannelConfig,[disjointChannelConfig.type]:disjointChannelConfig,[fibonacciRetracementConfig.type]:fibonacciRetracementConfig,[fibonacciRetracementTrendBasedConfig.type]:fibonacciRetracementTrendBasedConfig,[calloutConfig.type]:calloutConfig,[commentConfig.type]:commentConfig,[noteConfig.type]:noteConfig,[textConfig.type]:textConfig,[arrowConfig.type]:arrowConfig,[arrowUpConfig.type]:arrowUpConfig,[arrowDownConfig.type]:arrowDownConfig,[dateRangeConfig.type]:dateRangeConfig,[priceRangeConfig.type]:priceRangeConfig,[datePriceRangeConfig.type]:datePriceRangeConfig,[quickDatePriceRangeConfig.type]:quickDatePriceRangeConfig};function getTypedDatum(t){for(const{isDatum:e}of Object.values(annotationConfigs))if(e(t))return t}var import_ag_charts_community83=require("ag-charts-community"),{ActionOnSet,ParallelStateMachine,StateMachine:StateMachine11,StateMachineProperty:StateMachineProperty11,Debug:Debug11}=import_ag_charts_community83._ModuleSupport,AnnotationsStateMachine=class extends ParallelStateMachine{constructor(t){super(new SnappingStateMachine(e=>{this.snapping=e}),new UpdateMachine(()=>{this.node=this.active==null?void 0:t.node(this.active)}),new AnnotationsMainStateMachine(t,e=>{this.active=e,this.datum=this.active==null?void 0:t.datum(this.active),this.node=this.active==null?void 0:t.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(t){return t===this.active}};__decorateClass([StateMachineProperty11()],AnnotationsStateMachine.prototype,"snapping",2),__decorateClass([StateMachineProperty11()],AnnotationsStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty11()],AnnotationsStateMachine.prototype,"node",2);var SnappingStateMachine=class extends StateMachine11{constructor(t){super("idle",{idle:{hover:({shiftKey:e})=>t(e),keyDown:({shiftKey:e})=>t(e),keyUp:({shiftKey:e})=>t(e),click:({shiftKey:e})=>t(e),drag:({shiftKey:e})=>t(e)},dragging:{},translating:{},"text-input":{}})}},UpdateMachine=class extends StateMachine11{constructor(t){super("idle",{idle:{onEnter:t,render:t},dragging:{onEnter:t,render:t},translating:{onEnter:t,render:t},"text-input":{render:t}})}},AnnotationsMainStateMachine=class extends StateMachine11{constructor(t,e){const i=m=>S=>{t.create(m,S),this.active=t.selectLast()},o=()=>{this.active!=null&&t.delete(this.active),this.active=void 0,t.select()},s={createDatum:i},a={...t,delete:o,showTextInput:()=>{this.active!=null&&t.showTextInput(this.active)},deselect:()=>{const m=this.active;this.active=void 0,this.hovered=void 0,t.select(this.active,m)},showAnnotationOptions:()=>{this.active!=null&&t.showAnnotationOptions(this.active)}},r=Object.fromEntries(Object.entries(annotationConfigs).map(([m,S])=>[m,S.createState(a,s)])),n=Object.fromEntries(Object.entries(annotationConfigs).map(([m,S])=>[m,S.dragState(t,s)])),l=({colorPickerType:m,colorOpacity:S,color:v,opacity:M,isMultiColor:D})=>{this.datum&&(m==="text-color"&&t.updateTextInputColor(v),setColor(this.datum,m,S,v,M,D),t.update())},c=m=>{const{datum:S,node:v}=this;!S||!v||(isTextType(S)?(S.fontSize=m,t.updateTextInputFontSize(m)):hasLineText(S)&&(S.text.fontSize=m),t.update())},h=m=>{const{datum:S,node:v}=this;!S||!v||!hasLineStyle(S)||(setLineStyle(S,m),t.update())},d=m=>{const{node:S}=this;!S||!("setTextInputBBox"in S)||(S.setTextInputBBox(m),t.update())},u=({textInputValue:m,bbox:S})=>{const{datum:v}=this;if(S!=null&&m!=null&&m.length>0){if(!isTextType(v))return;const M=maybeWrapText(v,m,S.width);v.set({text:M}),t.update(),t.recordAction(`Change ${v.type} annotation text`)}else t.delete(this.active),t.recordAction(`Delete ${v?.type} annotation`)},p=()=>{t.updateTextInputBBox(void 0)},g=()=>this.active!=null,y=()=>this.copied!=null,f=()=>{const{active:m,datum:S}=this;return m==null||!S?!1:hasLineText(S)&&S.isWriteable()},x=()=>this.active!=null&&!isEphemeralType(this.datum),b=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{t.select(this.active,this.active),this.hoverCoords&&(this.hovered=t.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:m})=>{this.hovered=t.hoverAtCoords(m,this.active,this.hovered),this.hoverCoords=m},translate:{guard:g,target:"translating",action:({translation:m})=>{t.startInteracting(),t.translate(this.active,m),t.update()}},copy:{guard:x,action:()=>{this.copied=t.copy(this.active)}},cut:{guard:x,action:()=>{this.copied=t.copy(this.active),o()}},paste:{guard:y,action:()=>{t.paste(this.copied)}},selectLast:()=>{const m=this.active;this.active=t.selectLast(),t.select(this.active,m)},click:[{guard:()=>{const{active:m,hovered:S,datum:v}=this;return m==null||S!==m||!v?!1:isTextType(v)&&v.isWriteable()},target:"text-input"},{action:()=>{const m=this.active;this.active=this.hovered,t.select(this.active,m)}}],dblclick:{guard:f,action:({offset:m})=>{const S=t.getNodeAtCoords(m,this.active)==="text"?"text":"line";t.showAnnotationSettings(this.active,void 0,S)}},dragStart:[{guard:b,target:"dragging",action:()=>{const m=this.active;this.active=this.hovered,t.select(this.active,m),t.startInteracting()}},{action:()=>{const m=this.active;this.active=this.hovered,t.select(this.active,m)}}],color:{guard:g,action:l},fontSize:{guard:g,action:c},lineProps:{guard:g,action:m=>{const S=getTypedDatum(this.datum);S?.set(m),t.update(),t.recordAction(`Change ${S?.type} ${Object.entries(m).map(([v,M])=>`${v} to ${M}`).join(", ")}`)}},lineStyle:{guard:g,action:h},lineText:{guard:g,action:m=>{const S=getTypedDatum(this.datum);hasLineText(S)&&(isChannelType(S)&&m.position==="center"&&(m.position="inside"),S.text.set(m),t.update())}},updateTextInputBBox:{guard:g,action:d},toolbarPressSettings:{guard:f,action:m=>{t.showAnnotationSettings(this.active,m)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,t.select(this.active,this.active),t.resetToIdle()},delete:()=>{this.active!=null&&(t.delete(this.active),!isEphemeralType(this.datum)&&t.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{t.deleteAll()},...r},dragging:{onEnter:(m,S)=>{if(this.active==null)return;const v=t.getAnnotationType(this.active);v&&(this.transitionRoot(v),this.transitionRoot("dragStart",S))},...n},translating:{onEnter:()=>{},translate:{guard:g,target:"translating",action:({translation:m})=>{t.startInteracting(),t.translate(this.active,m),t.update()}},translateEnd:{guard:g,target:"idle"},onExit:()=>{t.stopInteracting(),t.update(),t.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const m=getTypedDatum(this.datum);!m||!("getTextInputCoords"in m)||(t.startInteracting(),t.showTextInput(this.active),m.visible=!1,t.update())},updateTextInputBBox:{guard:g,action:d},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:guardCancelAndExit,target:"idle",action:p},{guard:guardSaveAndExit,target:"idle",action:u}],color:{guard:g,action:l},fontSize:{guard:g,action:c},cancel:{target:"idle",action:p},onExit:()=>{t.stopInteracting(),t.hideTextInput();const m=this.active;if(this.active=this.hovered=void 0,t.select(this.active,m),m==null)return;const S=t.datum(m),v=t.node(m);!S||!v||(S.visible=!0)}}}),this.setActive=e,this.debug=Debug11.create(!0,"annotations"),this.snapping=!1}};__decorateClass([ActionOnSet({changeValue(t){this.setActive(t)}}),StateMachineProperty11()],AnnotationsMainStateMachine.prototype,"active",2),__decorateClass([StateMachineProperty11()],AnnotationsMainStateMachine.prototype,"hovered",2),__decorateClass([StateMachineProperty11()],AnnotationsMainStateMachine.prototype,"hoverCoords",2),__decorateClass([StateMachineProperty11()],AnnotationsMainStateMachine.prototype,"copied",2),__decorateClass([StateMachineProperty11()],AnnotationsMainStateMachine.prototype,"snapping",2),__decorateClass([StateMachineProperty11()],AnnotationsMainStateMachine.prototype,"datum",2),__decorateClass([StateMachineProperty11()],AnnotationsMainStateMachine.prototype,"node",2);var import_ag_charts_community84=require("ag-charts-community"),import_ag_charts_core40=require("ag-charts-core"),{ActionOnSet:ActionOnSet2,LayoutElement,Menu:Menu2,PropertiesArray:PropertiesArray2,ToolbarButtonProperties:ToolbarButtonProperties2,Property:Property31,ChartAxisDirection:ChartAxisDirection7}=import_ag_charts_community84._ModuleSupport,AnnotationsToolbarButtonProperties=class extends ToolbarButtonProperties2{};__decorateClass([Property31],AnnotationsToolbarButtonProperties.prototype,"value",2);var AnnotationsToolbar=class extends import_ag_charts_community84._ModuleSupport.BaseProperties{constructor(t){super(),this.ctx=t,this.enabled=!0,this.padding=20,this.buttons=new PropertiesArray2(AnnotationsToolbarButtonProperties),this.events=new import_ag_charts_core40.EventEmitter,this.annotationMenu=new Menu2(this.ctx,"annotations"),this.cleanup=new import_ag_charts_core40.CleanupRegistry,this.toolbar=t.sharedToolbar.getSharedToolbar("annotations");const e=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",e),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),t.layoutManager.registerElement(LayoutElement.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",e),this.toolbar.destroy()})}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(t){const e=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(e,t)}resetButtonIcons(){for(const[t,e]of this.buttons.entries())switch(e.value){case"line-menu":this.updateButtonByIndex(t,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(t,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(t,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(t,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(t,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(t){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(t.layoutBox,this.padding))}refreshButtonsEnabled(t){for(const[e,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(e,t)}onToolbarButtonPress({event:t,button:e,buttonBounds:i,buttonWidget:o}){const s=this.ctx.axisManager.getAxisContext(ChartAxisDirection7.Y)[0].scale;switch(e.value){case"clear":this.events.emit("pressed-clear",null);break;case"line-menu":this.onToolbarButtonPressShowMenu(t,i,o,e.value,"toolbarAnnotationsLineAnnotations",LINE_ANNOTATION_ITEMS.filter(a=>a.visible?a.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(t,i,o,e.value,"toolbarAnnotationsFibonacciAnnotations",FIBONACCI_ANNOTATION_ITEMS);break;case"text-menu":this.onToolbarButtonPressShowMenu(t,i,o,e.value,"toolbarAnnotationsTextAnnotations",TEXT_ANNOTATION_ITEMS);break;case"shape-menu":this.onToolbarButtonPressShowMenu(t,i,o,e.value,"toolbarAnnotationsShapeAnnotations",SHAPE_ANNOTATION_ITEMS);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(t,i,o,e.value,"toolbarAnnotationsMeasurerAnnotations",MEASURER_ANNOTATION_ITEMS);break}}onToolbarButtonPressShowMenu(t,e,i,o,s,a){this.events.emit("pressed-show-menu",null);const r=this.buttons.findIndex(n=>n.value===o);this.toolbar.toggleActiveButtonByIndex(r),this.annotationMenu.setAnchor({x:e.x+e.width+6,y:e.y}),this.annotationMenu.show(i,{items:a,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:t.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,o)})}onButtonPressMenuCreateAnnotation(t,e){const i=this.buttons.findIndex(o=>o.value===t);this.updateButtonByIndex(i,{icon:e.icon}),this.events.emit("pressed-create-annotation",{annotation:e.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:t}){t.key==="Escape"&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(t,e){const i=this.buttons.at(t);i&&(i.set({...i.toJson(),...e,value:e.value??i.value}),this.toolbar.updateButtonByIndex(t,{...i.toJson()}))}};__decorateClass([Property31,ActionOnSet2({changeValue(t){this.toolbar?.setHidden(!t)}})],AnnotationsToolbar.prototype,"enabled",2),__decorateClass([Property31],AnnotationsToolbar.prototype,"padding",2),__decorateClass([Property31],AnnotationsToolbar.prototype,"buttons",2);var import_ag_charts_community85=require("ag-charts-community"),{BaseModuleInstance,InteractionState,Property:Property32,ChartAxisDirection:ChartAxisDirection8,getIconClassNames}=import_ag_charts_community85._ModuleSupport,DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS="ag-charts-annotations__axis-button",AxisButton=class extends BaseModuleInstance{constructor(t,e,i,o){super(),this.ctx=t,this.axisCtx=e,this.onButtonClick=i,this.seriesRect=o,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!e.scale.bandwidth,t.domManager.addEventListener("focusin",({target:s})=>{const a=s instanceof HTMLElement?s:void 0;!(a&&t.domManager.contains(a,"series-area"))&&a!==this.button.getElement()&&this.hide()}),this.cleanup.register(t.widgets.seriesWidget.addListener("drag-move",s=>this.onMouseDrag(s)),t.widgets.seriesWidget.addListener("mousemove",s=>this.onMouseMove(s)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),t.widgets.seriesDragInterpreter?.events.on("click",s=>this.onClick(s)),t.eventsHub.on("series:focus-change",()=>this.onKeyPress()),t.eventsHub.on("zoom:pan-start",()=>this.hide()),t.eventsHub.on("zoom:change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(t,e){this.seriesRect=t,this.padding=e}setup(){const t=new import_ag_charts_community85._Widget.ButtonWidget;return t.addClass(DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS),t.setTabIndex(-1),t.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(t.getElement()),t}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS)}onMouseMove(t){this.ctx.interactionManager.isState(InteractionState.Clickable)&&this.show(t)}onMouseDrag(t){this.ctx.interactionManager.isState(InteractionState.AnnotationsMoveable)&&this.show(t)}onMouseLeave(){this.ctx.interactionManager.isState(InteractionState.Clickable)&&this.hide()}onClick(t){this.ctx.interactionManager.isState(InteractionState.Clickable)&&t.device==="touch"&&this.show(t)}show(t){const{sourceEvent:e,currentX:i,currentY:o}=t;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(e.target))){this.hide();return}this.toggleVisibility(!0);const s=this.getButtonCoordinates({x:i,y:o});this.coords={x:s.x+this.button.clientWidth/2,y:s.y+this.button.clientHeight/2},this.updatePosition(s)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(InteractionState.Default)||this.hide()}getButtonCoordinates({x:t,y:e}){const{axisCtx:{direction:i,position:o},seriesRect:s,snap:a,axisCtx:r,padding:n}=this,{clientWidth:l,clientHeight:c}=this.button,[h,d]=[0,s.height],[u,p]=[0,s.width];if(a&&(t=convert(invert(t-s.x,r),r)+s.x,e=convert(invert(e-s.y,r),r)+s.y),i===ChartAxisDirection8.X){const y=c-Math.max(0,n-5);t=t-l/2,e=o==="top"?h-c+y:d-y}else{const y=l-Math.max(0,n-9);t=o==="left"?u-l+y:p-y,e=e-c/2}return{x:t,y:e}}toggleVisibility(t){const{button:e}=this;if(e==null)return;const i=this.enabled&&t;this.toggleClass("-hidden",!i)}toggleClass(t,e){this.button.toggleClass(`${DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS}-${t}`,e)}updatePosition({x:t,y:e}){this.button.getElement().style.transform=`translate(${Math.round(t)}px, ${Math.round(e)}px)`}updateButtonElement(){const{button:t}=this;t.addListener("click",()=>this.onButtonClick(this.coords)),t.addListener("touchend",()=>this.onButtonClick(this.coords)),t.addListener("drag-start",()=>{}),t.setInnerHTML(``)}};__decorateClass([Property32],AxisButton.prototype,"enabled",2);var import_ag_charts_community87=require("ag-charts-community"),import_ag_charts_core42=require("ag-charts-core"),import_ag_charts_community86=require("ag-charts-community"),import_ag_charts_core41=require("ag-charts-core"),{Color:Color5,DraggablePopover,NativeWidget,Vec2:Vec218,createButton,createCheckbox,createSelect,createTextArea,initRovingTabIndex,getIconClassNames:getIconClassNames2,mapValues}=import_ag_charts_community86._ModuleSupport,_Dialog=class xt extends DraggablePopover{constructor(e,i){super(e,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new ColorPicker(this.ctx,{detached:!0}),this.cleanup.register(e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(e,i){const o=super.showWithChildren(e,i);return o.classList.add("ag-charts-dialog"),o.setAttribute("role","dialog"),o.addEventListener("mousedown",s=>{s.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),o.addEventListener("keydown",this.onKeyDown.bind(this)),(0,import_ag_charts_core41.getWindow)().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),o}updatePosition(e){super.updatePosition(e);const{anchor:i,fallbackAnchor:o}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,o)}createTabs(e,i,o){const s=(0,import_ag_charts_core41.createElement)("div","ag-charts-dialog__tabs"),a=mapValues(o,()=>(0,import_ag_charts_core41.createElementId)()),r=mapValues(o,()=>(0,import_ag_charts_core41.createElementId)());for(const[p,g]of(0,import_ag_charts_core41.entries)(o))(0,import_ag_charts_core41.setAttributes)(g.panel,{id:r[p],role:"tabpanel","aria-labelledby":a[p]});const n=p=>{for(const[g,y]of(0,import_ag_charts_core41.entries)(o))y.panel.classList.toggle("ag-charts-dialog__tab-panel--active",g===p),h[g].classList.toggle("ag-charts-dialog__tab-button--active",g===p),(0,import_ag_charts_core41.setAttribute)(h[g],"aria-selected",g===p),g===p&&y.onShow?.()},l=new NativeWidget((0,import_ag_charts_core41.createElement)("div","ag-charts-dialog__header"));l.addListener("drag-start",p=>{const{sourceEvent:g}=p;g.target instanceof Element&&g.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(p)}),l.addListener("drag-move",p=>this.onDragMove(p)),l.addListener("drag-end",()=>this.onDragEnd());const c=new DragHandleWidget;this.setDragHandle(c);const h=mapValues(o,(p,g)=>createButton({label:this.ctx.localeManager.t(p.label),onPress:()=>n(g)},{id:a[g],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":r[g]})),d=(0,import_ag_charts_core41.createElement)("div","ag-charts-dialog__tab-list");(0,import_ag_charts_core41.setAttributes)(d,{role:"tablist","aria-label":this.ctx.localeManager.t(e)}),d.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),d,u),s.append(l.getElement(),...Object.values(o).map(p=>p.panel)),n(i),initRovingTabIndex({orientation:"horizontal",buttons:Object.values(h)}),{tabs:s,initialFocus:h[i]}}createTabPanel(){return(0,import_ag_charts_core41.createElement)("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return(0,import_ag_charts_core41.createElement)("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:e,options:i,value:o,onChange:s}){const a=this.createInputGroup(e);(0,import_ag_charts_core41.setAttributes)(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(e)});const r="ag-charts-dialog__button--active",n=[];for(const l of i){const{icon:c,altText:h}=l,d=this.ctx.localeManager.t(h),u=createButton({icon:c,altText:d,onPress:()=>{for(const p of Array.from(a.children))p.classList.remove(r),p.ariaChecked="false";u.classList.add(r),u.ariaChecked="true",s(l.value)}},{"aria-checked":l.value===o,class:"ag-charts-dialog__button",role:"radio",title:d});l.value===o&&u.classList.add(r),a.appendChild(u),n.push(u)}return initRovingTabIndex({orientation:"horizontal",buttons:n}),a}createSelect({altText:e,label:i,options:o,value:s,onChange:a}){const r=this.createInputGroup(i),n=this.ctx.localeManager.t(e),l=createSelect({value:s,options:o,onChange:a},{class:"ag-charts-dialog__select","aria-label":n,title:n});return r.append(l),r}createTextArea({placeholder:e,value:i,onChange:o}){const s=e?this.ctx.localeManager.t(e):void 0;return createTextArea({value:i,onChange:o},{placeholder:s})}createCheckbox({label:e,checked:i,onChange:o}){const s=(0,import_ag_charts_core41.createElementId)(),a=this.createInputGroup(e,{for:s}),r=createCheckbox({checked:i,onChange:o},{class:"ag-charts-dialog__checkbox",role:"switch",id:s});return a.append(r),a}createColorPicker({color:e,opacity:i,label:o,altText:s,onChange:a,onChangeHide:r,isMultiColor:n,hasMultiColorOption:l}){const c=this.createInputGroup(o),h=this.ctx.localeManager.t(s),d=createButton({label:h,onPress:u=>{const{anchor:p,fallbackAnchor:g}=this.getColorPickerAnchors(d)??{};this.colorPicker.show({anchor:p,fallbackAnchor:g,color:e,opacity:i,isMultiColor:n,hasMultiColorOption:l,sourceEvent:u,onChange:(y,f,x,b)=>{d.style.setProperty("--color",y),d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",b),a(y,f,x,b)},onChangeHide:r})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(n)d.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(e){const u=Color5.fromString(e),p=new Color5(u.r,u.g,u.b,i);d.style.setProperty("--color",p.toHexString())}return c.append(d),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return createButton({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(e,i){const o=(0,import_ag_charts_core41.createElement)("div","ag-charts-dialog__input-group"),s=(0,import_ag_charts_core41.createElement)("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(e),(0,import_ag_charts_core41.setAttribute)(s,"for",i?.for),o.appendChild(s),o}onLayoutComplete(e){this.seriesRect=e.series.paddedRect,this.reposition()}onKeyDown(e){e.altKey||e.ctrlKey||e.metaKey||e.isComposing||e.key!=="Escape"||this.hide()}reposition(){const{seriesRect:e,ctx:i}=this,o=i.domManager.getBoundingClientRect(),s=this.getPopoverElement();if(!e||!s)return;const a=Vec218.from(0,e.y),r=Vec218.from(o.width,e.height),n=Vec218.from(s),l=Vec218.from(.5,1);let c;if(e.width>1e3){const h=Vec218.sub(Vec218.add(a,Vec218.multiply(r,l)),Vec218.multiply(n,l));c=Vec218.sub(h,Vec218.from(0,xt.offset))}else{const h=Vec218.sub(Vec218.add(a,r),n);c=Vec218.sub(h,xt.offset)}this.updatePosition(c)}getColorPickerAnchors(e){if(e&&(this.colorPickerAnchorElement=e),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),o=this.ctx.domManager.getBoundingClientRect(),s=Vec218.sub(Vec218.from(i.x,i.y),Vec218.from(o.left,o.top)),a=Vec218.add(s,Vec218.from(0,i.height+5)),r=Vec218.sub(s,Vec218.from(0,5));return{anchor:a,fallbackAnchor:r}}};_Dialog.offset=60;var Dialog=_Dialog,DragHandleWidget=class extends NativeWidget{constructor(){super((0,import_ag_charts_core41.createElement)("div","ag-charts-dialog__drag-handle"));const t=new NativeWidget((0,import_ag_charts_core41.createElement)("span",getIconClassNames2("drag-handle")));t.setAriaHidden(!0),this.addChild(t)}},{focusCursorAtEnd:focusCursorAtEnd2}=import_ag_charts_community87._ModuleSupport,AnnotationSettingsDialog=class extends Dialog{constructor(t){super(t,"settings"),this.events=new import_ag_charts_core42.EventEmitter,this.hideFns.push(()=>this.events.emit("hidden",null))}show(t,e){const i=this.createLinearLineTab(t,e),o=this.createLinearTextTab(t,e);let s="dialogHeaderLine";isChannelType(t)?s="dialogHeaderChannel":isFibonacciType(t)?s="dialogHeaderFibonacciRange":t.type==="date-range"?s="dialogHeaderDateRange":t.type==="price-range"?s="dialogHeaderPriceRange":t.type==="date-price-range"&&(s="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:r}=this.createTabs("ariaLabelSettingsTabBar",e.initialSelectedTab,{line:{label:s,panel:i},text:{label:"dialogHeaderText",panel:o.panel,onShow:o.onShow}});e.initialFocus=r,this.showWithChildren([a],e).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(t,e){const i=this.createTabPanel(),o=this.createInputGroupLine(),s=this.createInputGroupLine(),a="isMultiColor"in t,r=this.createColorPickerInput("line-color",t.getDefaultColor("line-color"),t.getDefaultOpacity("line-color"),a?t.isMultiColor:!1,a,e.onChangeLineColor,e.onChangeHideLineColor),n=this.createStrokeWidthSelect(t.strokeWidth??2,e.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(t.lineStyle??"solid",e.onChangeLineStyleType);if(o.append(r),"background"in t){const c=this.createColorPickerInput("fill-color",t.getDefaultColor("fill-color"),t.getDefaultOpacity("fill-color"),!1,!1,e.onChangeFillColor,e.onChangeHideFillColor);o.append(c),s.append(n)}else"showFill"in t?(o.append(this.createCheckbox({label:"dialogInputShowFill",checked:t.showFill??!0,onChange:c=>e.onChangeLine({showFill:c})})),s.append(n)):o.append(n);return s.append(l),i.append(o,s),"bands"in t&&i.append(this.createFibonacciRatioSelect(t.bands??10,c=>e.onChangeLine({bands:c}))),"extendStart"in t&&"extendEnd"in t&&i.append(this.createCheckbox({label:isChannelType(t)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:t.extendStart??!1,onChange:c=>e.onChangeLine({extendStart:c})}),this.createCheckbox({label:isChannelType(t)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:t.extendEnd??!1,onChange:c=>e.onChangeLine({extendEnd:c})})),"extendAbove"in t&&"extendBelow"in t&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:t.extendAbove??!1,onChange:c=>e.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:t.extendBelow??!1,onChange:c=>e.onChangeLine({extendBelow:c})})),"extendLeft"in t&&"extendRight"in t&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:t.extendLeft??!1,onChange:c=>e.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:t.extendRight??!1,onChange:c=>e.onChangeLine({extendRight:c})})),"reverse"in t&&"showFill"in t&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:t.reverse??!1,onChange:c=>e.onChangeLine({reverse:c})})),i}createLinearTextTab(t,e){const i=this.createTabPanel(),o=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:t.text.label,onChange:h=>e.onChangeText({label:h})}),s=this.createFontSizeSelect(t.text.fontSize,e.onChangeTextFontSize),a=this.createColorPickerInput("text-color",t.text.color,1,!1,!1,e.onChangeTextColor,e.onChangeHideTextColor),r=t.text.position==="inside"?"center":t.text.position,n=this.createPositionRadioGroup(r??"top",h=>e.onChangeText({position:h})),l=this.createAlignmentRadioGroup(t.text.alignment??"center",h=>e.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(s,a,n,l),i.append(o,c),{panel:i,onShow:()=>focusCursorAtEnd2(o)}}createColorPickerInput(t,e,i,o,s,a,r){const n=t==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=t==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:n,altText:l,color:e,opacity:i,isMultiColor:o,hasMultiColorOption:s,onChange:a,onChangeHide:r})}createStrokeWidthSelect(t,e){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:LINE_STROKE_WIDTH_ITEMS.map(({label:i,value:o})=>({label:i,value:`${o}`})),value:String(t),onChange:i=>e(Number(i))})}createFibonacciRatioSelect(t,e){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:FIBONACCI_RATIO_ITEMS.map(({label:i,value:o})=>({label:i,value:`${o}`})),value:String(t),onChange:i=>e(Number(i))})}createLineStyleRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:t,onChange:e})}createFontSizeSelect(t,e){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:TEXT_SIZE_ITEMS.map(({label:i,value:o})=>({label:i,value:String(o)})),value:String(t),onChange:i=>e(Number(i))})}createPositionRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:t,onChange:e})}createAlignmentRadioGroup(t,e){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:t,onChange:e})}};function calculateAxisLabelPadding(t){return t.gridPadding+t.seriesAreaPadding+t.tickSize+t.label.spacing}function updateAnnotation(t,e,i){for(const{update:o}of Object.values(annotationConfigs))o(t,e,i)}var{ChartUpdateType,InteractionState:InteractionState2,PropertiesArray:PropertiesArray3,Property:Property33,ChartAxisDirection:ChartAxisDirection9,keyProperty,valueProperty,Vec2:Vec219,Selection:Selection3,BBox:BBox3}=import_ag_charts_community88._ModuleSupport,_Annotations=class Dt extends import_ag_charts_community88._ModuleSupport.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,this.toolbar=new AnnotationsToolbar(this.ctx),this.optionsToolbar=new AnnotationOptionsToolbar(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return getTypedDatum(this.annotationData.at(i))}),this.axesButtons=new AxesButtons,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new PropertiesArray3(Dt.createAnnotationDatum),this.defaults=new AnnotationDefaults,this.container=new import_ag_charts_community88._ModuleSupport.Group({name:"static-annotations"}),this.annotations=new Selection3(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new AnnotationSettingsDialog(this.ctx),this.textInput=new TextInput(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(e.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(()=>{this.clear(),this.xAxis?.button?.destroy(),this.yAxis?.button?.destroy()})}setupStateMachine(){const{ctx:e}=this;return new AnnotationsStateMachine({resetToIdle:()=>{e.domManager.updateCursor("annotations"),this.popAnnotationState(InteractionState2.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,o,s)=>{let a;return this.annotations.each((r,n,l)=>{if(!n.isHoverable())return;const c=r.containsPoint(i.x,i.y);c&&(a??(a=l)),r.toggleHovered(c,o===l,n.readOnly)}),a!=null?e.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||e.tooltipManager.unsuppressTooltip("annotations"),(a==null||!this.annotationData.at(a)?.readOnly)&&this.ctx.domManager.updateCursor("annotations",a==null?void 0:this.annotations.at(a)?.getCursor()),a!==s&&this.update(),a},getNodeAtCoords:(i,o)=>{const s=this.annotations.at(o);if(s)return s.getNodeAtCoords(i.x,i.y)},translate:(i,o)=>{const s=this.annotations.at(i),a=getTypedDatum(this.annotationData.at(i));if(!(!s||!a))return this.translateNode(s,a,o)},copy:i=>{const o=this.annotations.at(i),s=getTypedDatum(this.annotationData.at(i));if(!(!o||!s))return this.createAnnotationDatumCopy(o,s)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,o)=>{const{annotations:s,optionsToolbar:a,toolbar:r}=this;this.hideOverlays(),r.clearActiveButton(),r.resetButtonIcons();const n=i==null?null:s.at(i),l=o==null?null:s.at(o),c=i==null?null:this.annotationData.at(i);l===n&&n!=null||(l?.toggleActive(!1),a.hide(),n&&!c?.readOnly?(this.pushAnnotationState(InteractionState2.AnnotationsSelected),n.toggleActive(!0),isEphemeralType(c)||(a.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{a.show(),a.setAnchorScene(n)}))):(this.popAnnotationState(InteractionState2.AnnotationsSelected),this.popAnnotationState(InteractionState2.Annotations)),isEphemeralType(c)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(InteractionState2.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(InteractionState2.Annotations)},stopInteracting:()=>{this.popAnnotationState(InteractionState2.Annotations)},create:(i,o)=>{this.createAnnotation(i,o)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{const i=this.annotationData.filter(o=>{if(o.readOnly===!0)return o});this.annotationData.splice(0,this.annotationData.length);for(const o of i)this.annotationData.push(o)},validatePoint:(i,o)=>{const s=this.getAnnotationContext();return s?validateDatumPoint(s,i,o):!0},getAnnotationType:i=>stringToAnnotationType(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),o=i==null?null:this.annotations.at(i);o!=null&&this.optionsToolbar.setAnchorScene(o)}),this.update()},showTextInput:i=>{const o=getTypedDatum(this.annotationData.at(i));if(!this.annotations.at(i)||!o||!("getTextInputCoords"in o)||!("getTextPosition"in o))return;const a={color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,placeholderColor:o.getPlaceholderColor()},r=this.getAnnotationContext(),n=c=>Vec219.add(o.getTextInputCoords(r,c),Vec219.required(this.seriesRect)),l=()=>o.getTextPosition();this.textInput.show({styles:a,layout:{getTextInputCoords:n,getTextPosition:l,alignment:o.alignment,textAlign:o.textAlign,width:o.width},text:o.text,placeholderText:o.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const o=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",o)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const o=this.annotations.at(i);!o||isEphemeralType(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(o))},showAnnotationSettings:(i,o,s="line")=>{const a=this.annotationData.at(i);if(!isLineType(a)&&!isChannelType(a)&&!isMeasurerType(a)||isEphemeralType(a))return;const r=c=>(h,d,u,p)=>{this.setColorAndDefault(a.type,c,h,d,u,p),this.optionsToolbar.updateColorPickerColor(c,d,u,p)},n=c=>()=>{this.recordActionAfterNextUpdate(`Change ${a.type} ${c} to ${a.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:s,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:o,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(a.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(a.type,c.position),this.recordActionAfterNextUpdate(`Change ${a.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:r("fill-color"),onChangeHideFillColor:n("fill-color"),onChangeLineColor:r("line-color"),onChangeHideLineColor:n("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(a.type,c),this.optionsToolbar.updateLineStyleType(LINE_STYLE_TYPE_ITEMS.find(h=>h.value===c)??LINE_STYLE_TYPE_ITEMS[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(a.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:r("text-color"),onChangeHideTextColor:n("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(a.type,c)}};this.settingsDialog.show(a,l)}})}setupListeners(){const{ctx:e,optionsToolbar:i,settingsDialog:o,toolbar:s}=this,{seriesWidget:a,seriesDragInterpreter:r,chartWidget:n}=e.widgets;r&&this.cleanup.register(r.events.on("click",this.hoverTouchPreHandler.bind(this)),r.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),r.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),r.events.on("mousemove",this.onHover.bind(this)),r.events.on("click",this.onClick.bind(this)),r.events.on("dblclick",this.onDoubleClick.bind(this)),r.events.on("drag-start",this.onDragStart.bind(this)),r.events.on("drag-move",this.onDrag.bind(this)),r.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(a.addListener("keydown",this.onKeyDown.bind(this)),a.addListener("keyup",this.onKeyUp.bind(this)),n.addListener("click",this.onCancel.bind(this)),e.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),e.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),e.eventsHub.on("zoom:change",()=>this.onResize()),e.eventsHub.on("dom:resize",()=>this.onResize()),s.events.on("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),s.events.on("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(InteractionState2.Annotations),this.state.transition(l),this.update()}),s.events.on("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),s.events.on("pressed-show-menu",()=>{this.cancel(),this.reset()}),s.events.on("pressed-unrelated",()=>{this.reset()}),i.events.on("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.events.on("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.events.on("pressed-lock",({locked:l})=>{this.recordActionAfterNextUpdate(l?"Locked":"Unlocked"),this.update()}),i.events.on("hid-overlays",()=>{this.settingsDialog.hide()}),i.events.on("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.events.on("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:d,opacity:u,isMultiColor:p})=>{this.setColorAndDefault(l,c,h,d,u,p)}),i.events.on("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.events.on("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.events.on("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),o.events.on("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:e,toolbar:i,optionsToolbar:o}=this;this.cleanup.register(e.annotationManager.attachNode(this.container),()=>{e.domManager.removeStyles(DEFAULT_ANNOTATION_AXIS_BUTTON_CLASS),i.destroy(),o.destroy()})}async processData(e){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[keyProperty(this.xKey,void 0,{id:"date"}),valueProperty(this.volumeKey,"number",{id:"volume"})],o=import_ag_charts_community88._ModuleSupport.DataSet.wrap(this.data)??import_ag_charts_community88._ModuleSupport.DataSet.empty(),{dataModel:s,processedData:a}=await e.request("annotations",o,{props:i});this.dataModel=s,this.processedData=a}createAnnotationScene(e){if(e.type in annotationConfigs)return new annotationConfigs[e.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${e.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`)}static createAnnotationDatum(e){if(e.type in annotationConfigs)return new annotationConfigs[e.type].datum().set(e);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${e.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`)}createAnnotation(e,i,o=!0){if(this.annotationData.push(i),o){const s=this.ctx.annotationManager.getAnnotationTypeStyles(e);s&&i.set(s),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(e){"setLocaleManager"in e&&e.setLocaleManager(this.ctx.localeManager),"getVolume"in e&&(e.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(e,i){const{dataModel:o,processedData:s}=this;let a=getGroupingValue(e),r=getGroupingValue(i);if(!(0,import_ag_charts_core43.isValidDate)(a)||!(0,import_ag_charts_core43.isValidDate)(r)||!o||!s||this.volumeKey==null)return;a>r&&([a,r]=[r,a]);const n=o.resolveKeysById({id:"annotations"},"date",s),l=o.resolveColumnById({id:"annotations"},"volume",s);let c=0;for(let h=0;h=a&&d<=r&&(c+=l[h])}return c}translateNode(e,i,o){const s=this.getAnnotationConfig(i),a=this.getAnnotationContext();a&&s.translate(e,i,o,a)}createAnnotationDatumCopy(e,i){const o=this.getAnnotationConfig(i),s=new o.datum;s.set(i.toJson());const a=this.getAnnotationContext();if(a)return o.copy(e,i,s,a)}getAnnotationConfig(e){if(e.type in annotationConfigs)return annotationConfigs[e.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${e.type}], expected one of [${Object.keys(annotationConfigs)}], ignoring.`)}onRestoreAnnotations(e){this.enabled&&(this.clear(),this.annotationData.set(e.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(e){const i=e.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const o of e.axes??[])o.direction===import_ag_charts_community88._ModuleSupport.ChartAxisDirection.X?this.xAxis=this.getAxis(o,i,this.xAxis?.button):this.yAxis=this.getAxis(o,i,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const e=this.ctx.chartService.series.some(s=>s.hasData),o=this.yAxis.context.seriesIds().some(s=>this.ctx.chartService.series.find(r=>r.id===s)?.visible);return e&&o}animateAnnotations({from:e,to:i,phase:o}){const{annotations:s}=this;this.ctx.animationManager?.animate({from:e,to:i,id:"chart-annotations",phase:o,groupId:"opacity",onUpdate(a){s.each(r=>{r.opacity=a,"setAxisLabelOpacity"in r&&r.setAxisLabelOpacity(a)})},onStop(){s.each(a=>{a.opacity=i,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(e,i,o){const s=this.ctx.axisManager.getAxisContext(e.direction)[0],{position:a="bottom",direction:r}=s,n=e.gridPadding+e.seriesAreaPadding,l=new BBox3(0,0,i.width,i.height).grow(n,a),c=r===ChartAxisDirection9.X?"vertical":"horizontal",{axesButtons:h,snap:d}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===r)){o??(o=new AxisButton(this.ctx,{...s,snapToGroup:d},g=>this.onAxisButtonClick(g,c),i));const p=calculateAxisLabelPadding(e);o.update(i,p)}else o?.destroy(),o=void 0;return{layout:e,context:s,bounds:l,button:o}}recordActionAfterNextUpdate(e,i=["annotations"]){const{defaults:o,ctx:{annotationManager:s,historyManager:a}}=this,r=i.map(n=>n==="defaults"?o:s);this.postUpdateFns.push(()=>{a.record(e,...r),s.fireChangedEvent()})}setColorAndDefault(e,i,o,s,a,r){this.state.transition("color",{colorPickerType:i,colorOpacity:o,color:s,opacity:a,isMultiColor:r}),this.defaults.setDefaultColor(e,i,o,s,a,r)}setFontSizeAndDefault(e,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(e,i),this.recordActionAfterNextUpdate(`Change ${e} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(e,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(e,i),this.recordActionAfterNextUpdate(`Change ${e} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(e,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(e,i),this.recordActionAfterNextUpdate(`Change ${e} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:e,annotations:i,seriesRect:o,ctx:{annotationManager:s}}=this,a=this.getAnnotationContext();if(!o||!a)return;s.updateData(e.toJson());const r=this.showAnnotations();this.toolbar.refreshButtonsEnabled(r),this.toolbar.toggleClearButtonEnabled(e.length>0&&r),i.update(e??[],void 0,n=>n.id).each((n,l)=>{if(!r){n.visible=!1,"setAxisLabelVisible"in n&&n.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in n&&n.setAxisLabelVisible(!0),this.injectDatumDependencies(l),updateAnnotation(n,l,a)});for(const n of this.postUpdateFns)n();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:e,xAxis:i,yAxis:o,snap:s}=this;if(e&&i&&o)return{seriesRect:e,xAxis:{...i.context,bounds:i.bounds,labelPadding:calculateAxisLabelPadding(i.layout),snapToGroup:s},yAxis:{...o.context,bounds:o.bounds,labelPadding:calculateAxisLabelPadding(i.layout),snapToGroup:s}}}onHover(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const s=e.sourceEvent.shiftKey,a=Vec219.from(e),r=invertCoords(a,o);i.transition("hover",{offset:a,point:r,shiftKey:s,context:o})}onClick(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const s=e.sourceEvent.shiftKey,a=invertCoords(Vec219.from(e),o),r=this.textInput.getValue(),n=this.textInput.getBBox();i.transition("click",{point:a,shiftKey:s,textInputValue:r,bbox:n})}onDoubleClick(e){const{state:i}=this;if(!this.getAnnotationContext())return;const s=Vec219.from(e);i.transition("dblclick",{offset:s})}onAxisButtonClick(e,i){this.cancel(),this.reset();const o=this.getAnnotationContext();if(!this.annotationData||!o)return;const{state:s}=this;this.pushAnnotationState(InteractionState2.Annotations);const a=i==="horizontal";if(s.transition(a?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!e)return;const r=invertCoords(e,o);validateDatumPoint(o,r)&&(s.transition("click",{point:r,shiftKey:!1}),this.update())}onResize(){const e=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:e,bbox:i})}hoverTouchPreHandler(e){e.device==="touch"&&this.onHover(e)}dragMoveTouchPreHandler(e){e.device==="touch"&&this.ctx.interactionManager.isState(InteractionState2.AnnotationsSelected)&&e.sourceEvent.preventDefault()}onDragStart(e){if(!this.ctx.interactionManager.isState(InteractionState2.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=Vec219.from(e),s=invertCoords(o,i),a=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:o,point:s,textInputValue:a,bbox:r})}onDrag(e){if(!this.ctx.interactionManager.isState(InteractionState2.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=Vec219.from(e),s=invertCoords(o,i),a=e.sourceEvent.shiftKey,r=this.textInput.getValue(),n=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:o,point:s,shiftKey:a,textInputValue:r,bbox:n})}onDragEnd(){this.state.transition("dragEnd")}onCancel(e){const{sourceEvent:i}=e??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const{key:s,shiftKey:a}=e,r=this.textInput.getValue(),n=this.textInput.getBBox();i.transition("textInput",{key:s,shiftKey:a,textInputValue:r,bbox:n,context:o})}onKeyDown(e){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const{sourceEvent:s}=e,{shiftKey:a,ctrlKey:r,metaKey:n}=s,l=r||n,c=r||a;i.transition("keyDown",{shiftKey:a,context:o});const h={x:0,y:0},d=Math.max(o?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(o?.yAxis.scale.bandwidth??0,c?10:1);switch(s.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-d;break;case"ArrowRight":h.x=d;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),s.stopPropagation(),s.preventDefault()),!!l)switch(s.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(e){const{shiftKey:i}=e.sourceEvent,o=this.getAnnotationContext();o&&(this.state.transition("keyUp",{shiftKey:i,context:o}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){let e=!1;for(const[i,o]of this.annotationData.entries())isEphemeralType(o)&&(this.annotationData.splice(i,1),e=!0);e&&this.recordActionAfterNextUpdate("Delete ephemeral annotations")}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(e){this.ctx.interactionManager.pushState(e),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(e){this.ctx.interactionManager.popState(e),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(InteractionState2.Annotations)||this.ctx.interactionManager.isState(InteractionState2.AnnotationsSelected)}update(e=ChartUpdateType.PRE_SCENE_RENDER){this.ctx.updateService.update(e)}};__decorateClass([Property33],_Annotations.prototype,"enabled",2),__decorateClass([Property33],_Annotations.prototype,"toolbar",2),__decorateClass([Property33],_Annotations.prototype,"optionsToolbar",2),__decorateClass([Property33],_Annotations.prototype,"axesButtons",2),__decorateClass([Property33],_Annotations.prototype,"snap",2);var Annotations=_Annotations,import_ag_charts_community89=require("ag-charts-community"),{FONT_SIZE_RATIO,ThemeSymbols}=import_ag_charts_community89._ModuleSupport,stroke={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},handle={fill:ThemeSymbols.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},font={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:FONT_SIZE_RATIO.LARGE},fontFamily:{$ref:"fontFamily"}},axisLabel={...font,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},text={...font,textAlign:"left"},lineText={...font,position:"top",alignment:"center",color:{$ref:"textColor"}},channelText={...font,position:"top",alignment:"center",color:{$ref:"textColor"}},measurerStatistics={...font,fontSize:{$ref:"fontSize"},color:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},measurer={...stroke,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...handle},text:{...lineText},statistics:{...measurerStatistics}},toolbar={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}]},padding:{$ref:"chartPadding"}},optionsToolbar={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}},annotationsTheme={enabled:!1,line:{...stroke,handle:{...handle},text:{...lineText}},"horizontal-line":{...stroke,handle:{...handle},axisLabel:{...axisLabel},text:{...lineText}},"vertical-line":{...stroke,handle:{...handle},axisLabel:{...axisLabel},text:{...lineText}},"disjoint-channel":{...stroke,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...handle},text:{...channelText}},"parallel-channel":{...stroke,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...handle},text:{...channelText}},"fibonacci-retracement":{...stroke,strokes:ThemeSymbols.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...handle},text:{...lineText,position:"center"},label:{...font,color:void 0,fontSize:{$rem:FONT_SIZE_RATIO.SMALLER}}},"fibonacci-retracement-trend-based":{...stroke,strokes:ThemeSymbols.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...handle},text:{...lineText,position:"center"},label:{...font,color:void 0,fontSize:{$rem:FONT_SIZE_RATIO.SMALLER}}},callout:{...stroke,...text,color:{$ref:"textColor"},handle:{...handle},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...text,fontWeight:700,handle:{...handle},fill:{$ref:"foregroundColor"}},note:{...text,color:ThemeSymbols.DEFAULT_TEXTBOX_COLOR,fill:ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...handle},background:{fill:ThemeSymbols.DEFAULT_TEXTBOX_FILL,stroke:ThemeSymbols.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...text,color:{$ref:"textColor"},handle:{...handle}},arrow:{...stroke,handle:{...handle},text:{...lineText}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...handle,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...handle,stroke:{$ref:"foregroundColor"}}},"date-range":{...measurer},"price-range":{...measurer},"date-price-range":{...measurer},"quick-date-price-range":{up:{...stroke,fill:ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...handle},statistics:{...measurerStatistics,color:"#fff",fill:ThemeSymbols.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...stroke,stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...handle,stroke:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...measurerStatistics,color:"#fff",fill:ThemeSymbols.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar,optionsToolbar},AnnotationsModule={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Annotations(t),themeTemplate:{annotations:annotationsTheme}},import_ag_charts_community91=require("ag-charts-community"),import_ag_charts_community90=require("ag-charts-community"),import_ag_charts_core44=require("ag-charts-core"),{BaseProperties:BaseProperties12,ObserveChanges:ObserveChanges2,ProxyProperty,Property:Property34,calculatePlacement}=import_ag_charts_community90._ModuleSupport,Image=class extends BaseProperties12{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=(0,import_ag_charts_core44.createElement)("img"),this.imageElement.onload=this.onImageLoad,this.node=new import_ag_charts_community90._ModuleSupport.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(t,e){this.containerWidth=t,this.containerHeight=e;const i={width:t,height:e},o=calculatePlacement(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...o}:{visible:!1}),o}};__decorateClass([Property34],Image.prototype,"top",2),__decorateClass([Property34],Image.prototype,"right",2),__decorateClass([Property34],Image.prototype,"bottom",2),__decorateClass([Property34],Image.prototype,"left",2),__decorateClass([Property34],Image.prototype,"width",2),__decorateClass([Property34],Image.prototype,"height",2),__decorateClass([Property34],Image.prototype,"opacity",2),__decorateClass([ProxyProperty("imageElement.src"),ObserveChanges2(t=>t.loadedSynchronously=t.complete)],Image.prototype,"url",2);var{ActionOnSet:ActionOnSet3,Property:Property35}=import_ag_charts_community91._ModuleSupport,Background2=class extends import_ag_charts_community91._ModuleSupport.Background{constructor(){super(...arguments),this.image=new Image}onLayoutComplete(t){if(super.onLayoutComplete(t),this.image){const{width:e,height:i}=t.chart;this.image.performLayout(e,i)}}onImageLoad(){this.ctx.updateService.update(import_ag_charts_community91._ModuleSupport.ChartUpdateType.SCENE_RENDER)}};__decorateClass([Property35,ActionOnSet3({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){t.node.remove(),t.onLoad=void 0}})],Background2.prototype,"image",2);var BackgroundModule={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:t=>new Background2(t)},import_ag_charts_community92=require("ag-charts-community"),import_ag_charts_core45=require("ag-charts-core"),{Range,TranslatableGroup,BBox:BBox4,Property:Property36,ZIndexMap:ZIndexMap4,ChartAxisDirection:ChartAxisDirection10,FillGradientDefaults,FillImageDefaults,FillPatternDefaults,getShapeFill,InteractionState:InteractionState3}=import_ag_charts_community92._ModuleSupport,BandHighlight=class extends import_ag_charts_community92._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.id=(0,import_ag_charts_core45.createId)(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.fill="#c16068",this.fillOpacity=1,this.fillGradientDefaults=new FillGradientDefaults,this.fillPatternDefaults=new FillPatternDefaults,this.fillImageDefaults=new FillImageDefaults,this.bounds=new BBox4(0,0,0,0),this.bandHighlightGroup=new TranslatableGroup({name:"bandHighlight",zIndex:ZIndexMap4.AXIS_BAND_HIGHLIGHT}),this.rangeNode=this.bandHighlightGroup.appendChild(new Range),this.activeAxisHighlight=void 0,this.axisCtx=t.parent,this.hideBand(),t.domManager.addEventListener("focusin",({target:a})=>{const r=a instanceof HTMLElement&&t.domManager.contains(a,"series-area");this.bandHighlightGroup.visible&&!r&&(this.hideBand(),this.ctx.updateService.update(import_ag_charts_community92._ModuleSupport.ChartUpdateType.PERFORM_LAYOUT))});const{widgets:{seriesWidget:e,seriesDragInterpreter:i},animationManager:o,eventsHub:s}=t;this.cleanup.register(t.scene.attachNode(this.bandHighlightGroup),e.addListener("mousemove",a=>this.onHoverLikeEvent(a)),e.addListener("mouseleave",()=>this.clearAllHighlight()),o.addListener("animation-start",()=>this.clearAllHighlight()),s.on("layout:complete",a=>this.layout(a)),s.on("series:focus-change",()=>this.onKeyPress()),s.on("zoom:pan-start",()=>this.clearAllHighlight()),s.on("zoom:change",()=>this.clearAllHighlight()),s.on("dom:resize",()=>this.clearAllHighlight()),s.on("axis:change",()=>this.axisChange())),i&&this.cleanup.register(i.events.on("drag-move",a=>this.onHoverLikeEvent(a)),i.events.on("click",a=>this.onClick(a)))}axisChange(){this.onHighlightChange()}isHover(t){return t.type==="mousemove"||t.type==="click"||t.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}onClick(t){t.device==="touch"&&this.onHoverLikeEvent(t)}clearAllHighlight(){this.ctx.interactionManager.isState(InteractionState3.Clickable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(InteractionState3.Default)&&this.onHighlightChange()}onHoverLikeEvent(t){const e=this.isHover(t)?InteractionState3.Clickable:InteractionState3.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&this.handleHoverHighlight(t)}handleHoverHighlight(t){if(!t)return;const{currentX:e,currentY:i}=t;this.onHighlightChange(this.axisCtx.pickBand({x:e,y:i}))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;const{position:o="left",axisId:s}=this.axisCtx,a=i.find(l=>l.id===s);if(!a)return;this.axisLayout=a,this.bounds=t.clone().grow(a.gridPadding,o);const{bandHighlightGroup:r,bounds:n}=this;r.translationX=Math.round(n.x),r.translationY=Math.round(n.y),this.updateBand()}updateBand(){const{rangeNode:t,stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,fill:a,fillOpacity:r,fillGradientDefaults:n,fillPatternDefaults:l,fillImageDefaults:c,lineDashOffset:h,axisLayout:d}=this;d&&(t.stroke=e,t.strokeWidth=i,t.strokeOpacity=o,t.lineDash=s,t.lineDashOffset=h,t.fill=getShapeFill(a,n,l,c),t.fillOpacity=r,t.startLine=!0,t.endLine=!0)}isVertical(){return this.axisCtx.direction===ChartAxisDirection10.X}onHighlightChange(t){this.enabled&&(this.activeAxisHighlight=t,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.updateService.update(import_ag_charts_community92._ModuleSupport.ChartUpdateType.SCENE_RENDER))}updateBandPosition(){const{rangeNode:t,bounds:e}=this,{band:i}=this.activeAxisHighlight??{};if(i==null){this.hideBand();return}let o=Math.min(...i),s=Math.max(...i);if(s-o<1){const a=(o+s)/2;o=a-.5,s=a+.5}this.isVertical()?(t.y1=0,t.y2=e.height,t.x1=o,t.x2=s,t.horizontal=!0):(t.y1=o,t.y2=s,t.x1=0,t.x2=e.width,t.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};__decorateClass([Property36],BandHighlight.prototype,"enabled",2),__decorateClass([Property36],BandHighlight.prototype,"stroke",2),__decorateClass([Property36],BandHighlight.prototype,"lineDash",2),__decorateClass([Property36],BandHighlight.prototype,"lineDashOffset",2),__decorateClass([Property36],BandHighlight.prototype,"strokeWidth",2),__decorateClass([Property36],BandHighlight.prototype,"strokeOpacity",2),__decorateClass([Property36],BandHighlight.prototype,"fill",2),__decorateClass([Property36],BandHighlight.prototype,"fillOpacity",2),__decorateClass([Property36],BandHighlight.prototype,"fillGradientDefaults",2),__decorateClass([Property36],BandHighlight.prototype,"fillPatternDefaults",2),__decorateClass([Property36],BandHighlight.prototype,"fillImageDefaults",2);var BandHighlightModule={type:"axis-option",optionsKey:"bandHighlight",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","unit-time","grouped-category"],moduleFactory:t=>new BandHighlight(t),themeTemplate:{bandHighlight:{enabled:!1,strokeWidth:0,lineDash:[],fill:{$foregroundBackgroundMix:.05}}}},import_ag_charts_community93=require("ag-charts-community"),import_ag_charts_core46=require("ag-charts-core"),{ActionOnSet:ActionOnSet4,LayoutElement:LayoutElement2,Menu:Menu3,Property:Property37}=import_ag_charts_community93._ModuleSupport,menuItems=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],ChartToolbar=class extends import_ag_charts_community93._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.menu=new Menu3(this.ctx,"chart-toolbar"),this.toolbar=t.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),t.layoutManager.registerElement(LayoutElement2.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(t){this.enabled&&(this.updateButton(),this.toolbar.layout(t.layoutBox))}onButtonPressed({event:t,buttonBounds:e,buttonWidget:i}){this.menu.setAnchor({x:e.x+e.width+6,y:e.y}),this.menu.show(i,{items:menuItems,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:t.sourceEvent,onPress:o=>{this.setChartType(o.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const t=this.getChartType(),e=menuItems.find(i=>i.value===t)?.icon;e!=null&&this.toolbar.updateButtons([{icon:e,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(t){const e={chartType:t};this.ctx.chartService.publicApi?.updateDelta(e).catch(i=>import_ag_charts_core46.Logger.error(i))}getChartType(){const t=this.ctx.chartService.publicApi?.getOptions()?.chartType;return t==null||!menuItems.some(e=>e.value===t)?"candlestick":t}};__decorateClass([Property37,ActionOnSet4({changeValue(t){this.toolbar?.setHidden(!t)}})],ChartToolbar.prototype,"enabled",2);var ChartToolbarModule={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new ChartToolbar(t)},import_ag_charts_community95=require("ag-charts-community"),import_ag_charts_community94=require("ag-charts-community"),import_ag_charts_core48=require("ag-charts-core"),import_ag_charts_core47=require("ag-charts-core");function showsFor(t,e){return t==="always"?!0:t==="series-area"?e==="series-area"||e==="series-node":t===e}function appendItem(t,e,i){let o=!0;if(e.type==="separator"){const s=i.at(-1);o=s!==void 0&&s.type!=="separator"}if(o&&(o=showsFor(e.showOn??"always",t)),o){const s=new ContextMenuItem(e);return i.push(s),s}}function appendBuiltinItem(t,e,i,o){e.isVisible(i)&&appendItem(t,e.builtins.items[i],o)}function expandBuiltin(t,e,i,o){const{builtins:s}=e;if((0,import_ag_charts_core47.isKeyOf)(i,s.lists))for(const a of s.lists[i])appendBuiltinItem(t,e,a,o);else appendBuiltinItem(t,e,i,o)}function expandItems(t,e,i,o){for(const s of i)if(typeof s=="string")expandBuiltin(t,e,s,o);else{const a=appendItem(t,s,o);s.items&&a&&s.items.length>0&&expandItems(t,e,s.items,a.items)}o.at(-1)?.type==="separator"&&o.pop()}var ContextMenuItem=class{constructor(t){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,t&&this.setOptions(t),this.items=[]}setField(t,e,i){e[t]=i}setOptions(t){let e;for(e in t)t[e]!==void 0&&this.setField(e,this,t[e])}},DEFAULT_CONTEXT_MENU_CLASS="ag-charts-context-menu",{Property:Property38,ContextMenuRegistry,callWithContext,getIconClassNames:getIconClassNames3}=import_ag_charts_community94._ModuleSupport,moduleId2="context-menu",ContextMenu=class extends import_ag_charts_community94._ModuleSupport.BaseModuleInstance{constructor(t){if(super(),this.ctx=t,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.collapsingSubMenus=0,this.menuWidget=new import_ag_charts_community94._Widget.MenuWidget,this.interactionManager=t.interactionManager,this.element=t.domManager.addChild("canvas-overlay",moduleId2),this.element.classList.add(DEFAULT_CONTEXT_MENU_CLASS),this.element.style.display="none",this.element.addEventListener("contextmenu",e=>e.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:e})=>{this.collapsingSubMenus>0||(e==null||e instanceof Node&&!this.element.contains(e))&&this.hide()}),this.cleanup.register(()=>this.element.remove(),()=>this.menuWidget.destroy(),t.eventsHub.on("dom:hidden",()=>this.hide()),this.menuWidget.addListener("collapse-widget",()=>this.onCollapse())),this.menuWidget.addClass(`${DEFAULT_CONTEXT_MENU_CLASS}__menu`),typeof MutationObserver<"u"){const e=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});e.observe(this.element,{childList:!0}),this.mutationObserver=e,this.cleanup.register(()=>e.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const e=t.chartService.title;let i="image";e?.enabled&&(i=e.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(o=>{import_ag_charts_core48.Logger.error("Unable to download chart",o)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",e=>this.onContext(e)))}expandItemsOptions(t){const e=[];return expandItems(t,this.ctx.contextMenuRegistry,this.items,e),e}onContext(t){if(!this.enabled)return;t.widgetEvent.sourceEvent.preventDefault(),this.showEvent=t.widgetEvent.sourceEvent,this.x=t.x,this.y=t.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,ContextMenuRegistry.check("series-node",t)?this.pickedNode=t.context.pickedNode:ContextMenuRegistry.check("legend-item",t)&&(this.pickedLegendItem=t.context.legendItem);const e=this.expandItemsOptions(t.showOn);e.length!==0&&this.show(t.widgetEvent,e)}show(t,e){const{sourceEvent:i}=t;this.interactionManager.pushState(import_ag_charts_community94._ModuleSupport.InteractionState.ContextMenu),this.element.style.display="block";const o=i.pointerType==="touch"?!1:void 0;o!==void 0&&this.ctx.chartService.overrideFocusVisible(o),this.createMenu(e),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.expand({sourceEvent:i,overrideFocusVisible:o})}hide(){this.menuWidget.collapse()}onCollapse(){this.interactionManager.popState(import_ag_charts_community94._ModuleSupport.InteractionState.ContextMenu),this.menuWidget.getElement().remove(),this.element.style.display="none"}onSubMenuExpand(t,e){const i=t.getBounds();t.setFocusOverride(!0),t.getElement().insertAdjacentElement("afterend",e.getElement()),e.getElement().style.position="absolute";const o=this.ctx.domManager.getBoundingClientRect(),s=t.getBoundingClientRect(),a=o.right-s.right,r=s.left-o.left,{offsetWidth:n,offsetHeight:l}=e.getElement();let c=i.y;if(o.height>l){const h=o.bottom-s.top;h=n)e.setBounds({x:i.x+i.width,y:c});else{const h=i.x-n,d=r+h;d>=0?e.setBounds({x:h,y:c}):e.setBounds({x:h-d,y:c})}}onSubMenuCollapse(t,e){t.setFocusOverride(void 0),this.collapsingSubMenus++,e.remove(),this.collapsingSubMenus--}createMenu(t){const{menuWidget:e}=this;e.clear(),e.setTabIndex(-1),this.createMenuItems(e,t)}createMenuItems(t,e){for(const i of e)switch(i.type){case"separator":{t.addSeparator().classList.add(`${DEFAULT_CONTEXT_MENU_CLASS}__divider`);break}case"action":{if(i.items.length===0){const o=new import_ag_charts_community94._Widget.MenuItemWidget;this.initButtonElement(o,i),t.addChild(o)}else{const{subMenuButton:o,subMenu:s}=t.addSubMenu();s.addClass(`${DEFAULT_CONTEXT_MENU_CLASS}__menu`),s.addListener("expand-widget",()=>this.onSubMenuExpand(o,s)),s.addListener("collapse-widget",()=>this.onSubMenuCollapse(o,s)),this.initButtonElement(o,i),this.createMenuItems(s,i.items)}break}default:throw new Error("unhandled case")}}createButtonOnClick(t,e){return ContextMenuRegistry.checkCallback("legend-item",t,e)?i=>{const o=i.sourceEvent;if(this.pickedLegendItem){const{seriesId:s,itemId:a,label:r}=this.pickedLegendItem,{chartService:n}=this.ctx;if(typeof a!="string"){import_ag_charts_core48.Logger.error(`unexpected itemId type: [${typeof a}] (expected [string])`);return}const c=[n.series.find(d=>d.id===s)?.properties,n],h={type:"contextmenu",seriesId:s,itemId:a,text:(0,import_ag_charts_core48.toPlainText)(r.text),event:o};callWithContext(c,e,h),this.hide()}else import_ag_charts_core48.Logger.error("legend item not found")}:ContextMenuRegistry.checkCallback("series-area",t,e)?()=>{const i=this.ctx.chartService,o={type:"seriesContextMenuAction",event:this.showEvent};callWithContext(i,e,o),this.hide()}:ContextMenuRegistry.checkCallback("series-node",t,e)?()=>{const{showEvent:i}=this,{chartService:o}=this.ctx,s=this.pickedNode,a=[s?.series.properties,o],r=s?.series.createNodeContextMenuActionEvent(i,s);r?callWithContext(a,e,r):import_ag_charts_core48.Logger.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,o={type:"contextMenuEvent",event:this.showEvent};callWithContext(i,e,o),this.hide()}}initTableCells(t){const e=(0,import_ag_charts_core48.createElement)("div"),i=(0,import_ag_charts_core48.createElement)("div"),o=(0,import_ag_charts_core48.createElement)("div");return e.classList.toggle(`${DEFAULT_CONTEXT_MENU_CLASS}__icon`,!0),i.classList.toggle(`${DEFAULT_CONTEXT_MENU_CLASS}__cell`,!0),o.classList.toggle(`${DEFAULT_CONTEXT_MENU_CLASS}__cell`,!0),e.ariaHidden="true",i.role="presentation",o.ariaHidden="true",t.append(e,i,o),{cellIcon:e,cellLabel:i,cellArrow:o}}initButtonElement(t,e){t.addClass(`${DEFAULT_CONTEXT_MENU_CLASS}__item`),t.setEnabled(e.enabled);const i=this.ctx.localeManager.t(e.label),o=`${DEFAULT_CONTEXT_MENU_CLASS}__cellpadding`,{cellIcon:s,cellLabel:a,cellArrow:r}=this.initTableCells(t.getElement());if(a.textContent=i,a.classList.add(o),e.iconUrl!=null){const c=(0,import_ag_charts_core48.createElement)("img");c.src=e.iconUrl,s.append(c),s.classList.add(o)}if(e.items.length>0){const c=(0,import_ag_charts_core48.createElement)("span",getIconClassNames3("chevron-right"));r.append(c),r.classList.add(o)}const{showOn:n,action:l}=e;l!=null&&t.addListener("click",this.createButtonOnClick(n,l)),e.items.length===0&&(t.addListener("mouseleave",()=>t.setFocusOverride(!1)),t.addListener("mouseenter",()=>t.setFocusOverride(void 0)))}reposition(){let{x:t,y:e}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:s}=this.element;t=(0,import_ag_charts_core48.clamp)(0,t,i.width-o),e=(0,import_ag_charts_core48.clamp)(0,e,i.height-s),this.element.style.left=`${t}px`,this.element.style.top=`calc(${e}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(moduleId2),this.ctx.domManager.removeChild("canvas-overlay",moduleId2)}};__decorateClass([Property38],ContextMenu.prototype,"enabled",2),__decorateClass([Property38],ContextMenu.prototype,"darkTheme",2),__decorateClass([Property38],ContextMenu.prototype,"items",2);var ContextMenuModule={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],optionsKey:"contextMenu",moduleFactory:t=>new ContextMenu(t),themeTemplate:{contextMenu:{enabled:!0,darkTheme:import_ag_charts_community95._ModuleSupport.ThemeSymbols.IS_DARK_THEME}}},import_ag_charts_community97=require("ag-charts-community"),import_ag_charts_core50=require("ag-charts-core");function readDatum(t){return typeof t?.datum=="object"?t.datum:null}var import_ag_charts_community96=require("ag-charts-community"),import_ag_charts_core49=require("ag-charts-core"),{FormatManager,BaseProperties:BaseProperties13,Property:Property39}=import_ag_charts_community96._ModuleSupport,DEFAULT_LABEL_CLASS="ag-charts-crosshair-label",CrosshairLabelProperties=class extends BaseProperties13{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0,this._cachedFormatter=void 0}formatValue(t,e,i,o){const{formatter:s,format:a}=this,{domain:r,boundSeries:n}=o;let l;if(s!=null){const c=o.type==="number"?o.fractionDigits:void 0,h=o.type==="date"?o.unit:void 0,d=o.type==="date"?o.step:void 0;l=t(s,{value:i,domain:r,fractionDigits:c,unit:h,step:d,boundSeries:n})}if(a!=null){let c=this._cachedFormatter;(c==null||c.type!==e||c.format!==a)&&(c={type:e,format:a,formatter:FormatManager.getFormatter(e,a)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l==null?void 0:String(l)}};__decorateClass([Property39],CrosshairLabelProperties.prototype,"enabled",2),__decorateClass([Property39],CrosshairLabelProperties.prototype,"xOffset",2),__decorateClass([Property39],CrosshairLabelProperties.prototype,"yOffset",2),__decorateClass([Property39],CrosshairLabelProperties.prototype,"formatter",2),__decorateClass([Property39],CrosshairLabelProperties.prototype,"format",2),__decorateClass([Property39],CrosshairLabelProperties.prototype,"renderer",2);var CrosshairLabel=class extends CrosshairLabelProperties{constructor(t,e,i){super(),this.domManager=t,this.id=(0,import_ag_charts_core49.createId)(this),this.element=t.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(DEFAULT_LABEL_CLASS),(0,import_ag_charts_core49.setAttribute)(this.element,"aria-hidden",!0),this.element.dataset.key=e,this.element.dataset.axisId=i}show(t){const{element:e}=this,i=t.x+this.xOffset,o=t.y+this.yOffset;e.style.top=`${Math.round(o)}px`,e.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:t,styles:e}){if(t!==void 0&&(this.element.innerHTML=t),e!==void 0){const i=this.element.children[0]??this.element;Object.assign(i.style,e)}}getBBox(){const{element:t}=this;return new import_ag_charts_community96._ModuleSupport.BBox(t.clientLeft,t.clientTop,t.clientWidth,t.clientHeight)}toggle(t){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!t)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(t,e){if(typeof t=="string")return{html:t,styles:{}};e=e??{};const{text:i=e.text??"",color:o=e.color,backgroundColor:s=e.backgroundColor,opacity:a=e.opacity??1}=t,r={opacity:a,"background-color":s?.toLowerCase(),color:o};return{html:`
+ ${i}
+
`,styles:r}}},{Group:Group5,TranslatableGroup:TranslatableGroup2,Line:Line4,BBox:BBox5,InteractionState:InteractionState4,Property:Property40,ZIndexMap:ZIndexMap5,ChartAxisDirection:ChartAxisDirection11}=import_ag_charts_community97._ModuleSupport,Crosshair=class extends import_ag_charts_community97._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.id=(0,import_ag_charts_core50.createId)(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new CrosshairLabelProperties,this.seriesRect=new BBox5(0,0,0,0),this.bounds=new BBox5(0,0,0,0),this.crosshairGroup=new TranslatableGroup2({name:"crosshairs",zIndex:ZIndexMap5.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new Group5({name:`${this.id}-crosshair-lines`,zIndex:ZIndexMap5.SERIES_CROSSHAIR})),this.lineGroupSelection=import_ag_charts_community97._ModuleSupport.Selection.select(this.lineGroup,Line4,!1),this.activeHighlight=void 0,this.axisCtx=t.parent,this.labels={},this.hideCrosshairs(),t.domManager.addEventListener("focusin",({target:i})=>{const o=i instanceof HTMLElement&&t.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!o&&(this.hideCrosshairs(),this.ctx.updateService.update(import_ag_charts_community97._ModuleSupport.ChartUpdateType.PERFORM_LAYOUT))});const{seriesDragInterpreter:e}=t.widgets;this.cleanup.register(t.scene.attachNode(this.crosshairGroup),t.widgets.seriesWidget.addListener("mousemove",i=>this.onMouseHoverLike(i)),t.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),t.eventsHub.on("series:focus-change",()=>this.onKeyPress()),t.eventsHub.on("zoom:pan-start",()=>this.onMouseOut()),t.eventsHub.on("zoom:change",()=>this.onMouseOut()),t.eventsHub.on("highlight:change",i=>this.onHighlightChange(i)),t.eventsHub.on("layout:complete",i=>this.layout(i)),()=>{for(const i of Object.values(this.labels))i.destroy()}),e&&this.cleanup.register(e.events.on("drag-move",i=>this.onMouseHoverLike(i)),e.events.on("click",i=>this.onClick(i)))}layout({series:{rect:t,visible:e},axes:i}){if(!e||!i||!this.enabled)return;this.seriesRect=t;const{position:o="left",axisId:s}=this.axisCtx,a=i.find(c=>c.id===s);if(!a)return;this.axisLayout=a,this.bounds=t.clone().grow(a.gridPadding+a.seriesAreaPadding,o);const{crosshairGroup:r,bounds:n}=this;r.translationX=Math.round(n.x),r.translationY=Math.round(n.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(t){this.lineGroupSelection.update(t,void 0,e=>e)}updateLabels(t){const{labels:e,ctx:i}=this;for(const o of t)this.label.enabled&&(e[o]??(e[o]=new CrosshairLabel(i.domManager,o,this.axisCtx.axisId))),e[o]&&this.updateLabel(e[o])}updateLabel(t){const{enabled:e,xOffset:i,yOffset:o,format:s,renderer:a}=this.label;t.enabled=e,t.xOffset=i,t.yOffset=o,t.format=s,t.renderer=a}updateLines(){const{lineGroupSelection:t,bounds:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,axisLayout:n}=this;if(!n)return;const l=this.isVertical();t.each(c=>{c.stroke=i,c.strokeWidth=o,c.strokeOpacity=s,c.lineDash=a,c.lineDashOffset=r,c.y1=0,c.y2=l?e.height:0,c.x1=0,c.x2=l?0:e.width})}isVertical(){return this.axisCtx.direction===ChartAxisDirection11.X}isHover(t){return t.type==="mousemove"||t.type==="click"||t.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(t){return(0,import_ag_charts_core50.toPlainText)(this.axisCtx.formatScaleValue(t,"crosshair",this.label))}onClick(t){t.device==="touch"&&this.onMouseHoverLike(t)}onMouseHoverLike(t){if(!this.enabled||this.snap)return;const e=this.isHover(t)?InteractionState4.Clickable:InteractionState4.AnnotationsMoveable;this.ctx.interactionManager.isState(e)&&(this.updatePositions(this.getData(t)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(import_ag_charts_community97._ModuleSupport.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(InteractionState4.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(import_ag_charts_community97._ModuleSupport.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(InteractionState4.Default)&&this.hideCrosshairs()}onHighlightChange(t){if(!this.enabled)return;const{crosshairGroup:e,axisCtx:i}=this,{datum:o,series:s}=t.currentHighlight??{},a=o&&(s?.axes.x?.id===i.axisId||s?.axes.y?.id===i.axisId);if(this.activeHighlight=a?t.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const r=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(r),e.visible=!0}}isInRange(t){return this.axisCtx.inRange(t)}updatePositions(t){const{seriesRect:e,lineGroupSelection:i}=this;i.each((o,s)=>{const a=t[s];if(!a){o.visible=!1,this.hideLabel(s);return}o.visible=!0;const{value:r,position:n}=a;let l=0,c=0;this.isVertical()?(l=n,o.x=Math.round(l)):(c=n,o.y=Math.round(c)),this.label.enabled?this.showLabel(l+e.x,c+e.y,r,s):this.hideLabel(s)})}getData(t){const{axisCtx:e}=this,i="pointer",{xKey:o="",yKey:s=""}=this.activeHighlight??{},{currentX:a,currentY:r}=t,n=readDatum(this.activeHighlight),l=this.isVertical(),c=l?a:r;let h=n?.[l?o:s]??"";return e.continuous&&(h=e.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(t){const{axisCtx:e}=this,{series:i,xKey:o="",aggregatedValue:s,cumulativeValue:a,midPoint:r}=t,n=readDatum(t),l=i.getKeyProperties(e.direction),c=(e.scale.bandwidth??0)/2,h=i.axes[e.direction]?.id===e.axisId,d=l.includes("yKey")&&h,u=l.includes("xKey")&&h,p=s??a;if(d&&p!==void 0){const y=e.scale.convert(p)+c;return this.isInRange(y)?{yKey:{value:p,position:y}}:{}}if(u){const y=(this.isVertical()?r?.x:r?.y)??0,f=e.continuous?e.scaleInvert(y):n?.[o];return this.isInRange(y)?{xKey:{value:f,position:y}}:{}}const g={};for(const y of l){const f=i.properties[y],x=n?.[f],b=e.scale.convert(x)+c;this.isInRange(b)&&(g[y]={value:x,position:b})}return g}getLabelHtml(t,e){const i=this.axisLayout?.label?.fractionDigits??0,o={text:this.formatValue(t)};return this.label.renderer?e.toLabelHtml(this.label.renderer({value:t,fractionDigits:i}),o):e.toLabelHtml(o)}showLabel(t,e,i,o){if(!this.axisLayout)return;const{bounds:s}=this,a=this.labels[o],r=this.getLabelHtml(i,a);a.setLabelHtml(r);const{width:n,height:l}=a.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===ChartAxisDirection11.X?(h-=4,a.show({x:t-n/2,y:c==="bottom"?s.y+s.height+h:s.y-l-h})):(h-=8,a.show({x:c==="right"?s.x+s.width+h:s.x-n-h,y:e-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const t of Object.keys(this.labels))this.hideLabel(t)}hideLabel(t){this.labels[t]?.toggle(!1)}};__decorateClass([Property40],Crosshair.prototype,"enabled",2),__decorateClass([Property40],Crosshair.prototype,"stroke",2),__decorateClass([Property40],Crosshair.prototype,"lineDash",2),__decorateClass([Property40],Crosshair.prototype,"lineDashOffset",2),__decorateClass([Property40],Crosshair.prototype,"strokeWidth",2),__decorateClass([Property40],Crosshair.prototype,"strokeOpacity",2),__decorateClass([Property40],Crosshair.prototype,"snap",2),__decorateClass([Property40],Crosshair.prototype,"label",2);var CrosshairModule={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","time","unit-time","ordinal-time","number","log"],moduleFactory:t=>new Crosshair(t),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}},import_ag_charts_community98=require("ag-charts-community"),{ActionOnSet:ActionOnSet5,Property:Property41}=import_ag_charts_community98._ModuleSupport,DataSource=class extends import_ag_charts_community98._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=t.dataService}updateCallback(t,e){this.dataService&&(t&&e!=null?this.dataService.updateCallback(e):this.dataService.clearCallback())}};__decorateClass([ActionOnSet5({newValue(t){this.updateCallback(t,this.getData)}}),Property41],DataSource.prototype,"enabled",2),__decorateClass([ActionOnSet5({newValue(t){this.updateCallback(this.enabled,t)}}),Property41],DataSource.prototype,"getData",2),__decorateClass([ActionOnSet5({newValue(t){this.dataService.requestThrottle=t}})],DataSource.prototype,"requestThrottle",2),__decorateClass([ActionOnSet5({newValue(t){this.dataService.dispatchThrottle=t}})],DataSource.prototype,"updateThrottle",2),__decorateClass([ActionOnSet5({newValue(t){this.dataService.dispatchOnlyLatest=!t}})],DataSource.prototype,"updateDuringInteraction",2);var DataSourceModule={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:t=>new DataSource(t),themeTemplate:{dataSource:{enabled:!1}}},import_ag_charts_community102=require("ag-charts-community"),import_ag_charts_community101=require("ag-charts-community"),import_ag_charts_core51=require("ag-charts-core"),import_ag_charts_community99=require("ag-charts-community"),{nearestSquared,nearestSquaredInContainer,partialAssign,mergeDefaults,BBox:BBox6}=import_ag_charts_community99._ModuleSupport,HierarchicalBBox=class{constructor(t){this.components=t,this.union=BBox6.merge(t)}containsPoint(t,e){if(!this.union.containsPoint(t,e))return!1;for(const i of this.components)if(i.containsPoint(t,e))return!0;return!1}},ErrorBarNode=class extends import_ag_charts_community99._ModuleSupport.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new import_ag_charts_community99._ModuleSupport.Path,this.capsPath=new import_ag_charts_community99._ModuleSupport.Path,this.bboxes=new HierarchicalBBox([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(t){this._datum=t}calculateCapLength(t,e){const{lengthRatio:i=1,length:o}=t,{lengthRatioMultiplier:s,lengthMax:a}=e,r=o??i*s;return Math.min(r,a)}getItemStylerParams(t,e,i,o){const{datum:s}=this;if(s==null||t.itemStyler==null)return;const{xLowerKey:a,xUpperKey:r,yLowerKey:n,yUpperKey:l}=t;return{...e,datum:s.datum,seriesId:s.series.id,xKey:s.xKey,yKey:s.yKey,xLowerKey:a,xUpperKey:r,yLowerKey:n,yUpperKey:l,highlighted:i,highlightState:o}}formatStyles(t,e,i,o,s){let{cap:a,...r}=t;const n=this.getItemStylerParams(e,t,o,s);if(n!=null&&e.itemStyler!=null){const l=i.callWithContext(e.itemStyler,n);r=mergeDefaults(l,r),a=mergeDefaults(l?.cap,l,a)}return{whiskerStyle:r,capsStyle:a}}applyStyling(t,e){partialAssign(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],t,e)}update(t,e,i,o,s){if(this.datum===void 0)return;const{whiskerStyle:a,capsStyle:r}=this.formatStyles(t,e,i,o,s),{xBar:n,yBar:l,capDefaults:c}=this.datum,h=this.whiskerPath;this.applyStyling(h,a),h.path.clear(!0),l!==void 0&&(h.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),h.path.lineTo(l.upperPoint.x,l.upperPoint.y)),n!==void 0&&(h.path.moveTo(n.lowerPoint.x,n.lowerPoint.y),h.path.lineTo(n.upperPoint.x,n.upperPoint.y)),h.path.closePath(),this.capLength=this.calculateCapLength(r??{},c);const d=this.capLength/2,u=this.capsPath;this.applyStyling(u,r),u.path.clear(!0),l!==void 0&&(u.path.moveTo(l.lowerPoint.x-d,l.lowerPoint.y),u.path.lineTo(l.lowerPoint.x+d,l.lowerPoint.y),u.path.moveTo(l.upperPoint.x-d,l.upperPoint.y),u.path.lineTo(l.upperPoint.x+d,l.upperPoint.y)),n!==void 0&&(u.path.moveTo(n.lowerPoint.x,n.lowerPoint.y-d),u.path.lineTo(n.lowerPoint.x,n.lowerPoint.y+d),u.path.moveTo(n.upperPoint.x,n.upperPoint.y-d),u.path.lineTo(n.upperPoint.x,n.upperPoint.y+d)),u.path.closePath()}updateBBoxes(){const{capLength:t,whiskerPath:e,capsPath:i}=this,{yBar:o,xBar:s}=this.datum??{},a=t/2,r=[];if(o!==void 0){const n=o.lowerPoint.y-o.upperPoint.y;r.push(new BBox6(o.lowerPoint.x,o.upperPoint.y,e.strokeWidth,n),new BBox6(o.lowerPoint.x-a,o.lowerPoint.y,t,i.strokeWidth),new BBox6(o.upperPoint.x-a,o.upperPoint.y,t,i.strokeWidth))}if(s!==void 0){const n=s.upperPoint.x-s.lowerPoint.x;r.push(new BBox6(s.lowerPoint.x,s.upperPoint.y,n,e.strokeWidth),new BBox6(s.lowerPoint.x,s.lowerPoint.y-a,i.strokeWidth,t),new BBox6(s.upperPoint.x,s.upperPoint.y-a,i.strokeWidth,t))}this.bboxes.components=r,this.bboxes.union=BBox6.merge(r)}containsPoint(t,e){return this.bboxes.containsPoint(t,e)}pickNode(t,e){return this.containsPoint(t,e)?this:void 0}nearestSquared(t,e,i){const{bboxes:o}=this;if(o.union.distanceSquared(t,e)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:s}=nearestSquared(t,e,o.components);return{nearest:this,distanceSquared:s}}},ErrorBarGroup=class extends import_ag_charts_community99._ModuleSupport.Group{nearestSquared(t,e){const{nearest:i,distanceSquared:o}=nearestSquaredInContainer(t,e,{children:this.children()});if(i!==void 0&&!Number.isNaN(o))return{datum:i.datum,distanceSquared:o}}},import_ag_charts_community100=require("ag-charts-community"),{BaseProperties:BaseProperties14,Property:Property42}=import_ag_charts_community100._ModuleSupport,ErrorBarCap=class extends BaseProperties14{};__decorateClass([Property42],ErrorBarCap.prototype,"visible",2),__decorateClass([Property42],ErrorBarCap.prototype,"stroke",2),__decorateClass([Property42],ErrorBarCap.prototype,"strokeWidth",2),__decorateClass([Property42],ErrorBarCap.prototype,"strokeOpacity",2),__decorateClass([Property42],ErrorBarCap.prototype,"lineDash",2),__decorateClass([Property42],ErrorBarCap.prototype,"lineDashOffset",2),__decorateClass([Property42],ErrorBarCap.prototype,"length",2),__decorateClass([Property42],ErrorBarCap.prototype,"lengthRatio",2);var ErrorBarProperties=class extends BaseProperties14{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new ErrorBarCap}};__decorateClass([Property42],ErrorBarProperties.prototype,"yLowerKey",2),__decorateClass([Property42],ErrorBarProperties.prototype,"yLowerName",2),__decorateClass([Property42],ErrorBarProperties.prototype,"yUpperKey",2),__decorateClass([Property42],ErrorBarProperties.prototype,"yUpperName",2),__decorateClass([Property42],ErrorBarProperties.prototype,"xLowerKey",2),__decorateClass([Property42],ErrorBarProperties.prototype,"xLowerName",2),__decorateClass([Property42],ErrorBarProperties.prototype,"xUpperKey",2),__decorateClass([Property42],ErrorBarProperties.prototype,"xUpperName",2),__decorateClass([Property42],ErrorBarProperties.prototype,"visible",2),__decorateClass([Property42],ErrorBarProperties.prototype,"stroke",2),__decorateClass([Property42],ErrorBarProperties.prototype,"strokeWidth",2),__decorateClass([Property42],ErrorBarProperties.prototype,"strokeOpacity",2),__decorateClass([Property42],ErrorBarProperties.prototype,"lineDash",2),__decorateClass([Property42],ErrorBarProperties.prototype,"lineDashOffset",2),__decorateClass([Property42],ErrorBarProperties.prototype,"itemStyler",2),__decorateClass([Property42],ErrorBarProperties.prototype,"cap",2);var{fixNumericExtent,groupAccumulativeValueProperty,mergeDefaults:mergeDefaults2,valueProperty:valueProperty2,ChartAxisDirection:ChartAxisDirection12}=import_ag_charts_community101._ModuleSupport;function toErrorBoundCartesianSeries(t){for(const e of import_ag_charts_community101.AgErrorBarSupportedSeriesTypes)if(e===t.series.type)return t.series;throw new Error(`AG Charts - unsupported series type '${t.series.type}', error bars supported series types: ${import_ag_charts_community101.AgErrorBarSupportedSeriesTypes.join(", ")}`)}var ErrorBars=class yt extends import_ag_charts_community101._ModuleSupport.BaseModuleInstance{constructor(e){super(),this.properties=new ErrorBarProperties;const i=toErrorBoundCartesianSeries(e),{annotationGroup:o,annotationSelections:s}=i;this.cartesianSeries=i,this.groupNode=new ErrorBarGroup({name:`${o.id}-errorBars`}),o.appendChild(this.groupNode),this.selection=import_ag_charts_community101._ModuleSupport.Selection.select(this.groupNode,()=>this.errorBarFactory()),s.add(this.selection),i.addEventListener("seriesVisibilityChange",a=>this.onToggleSeriesItem(a)),this.cleanup.register(i.events.on("data-processed",a=>this.onDataProcessed(a)),i.events.on("data-update",a=>this.onDataUpdate(a)),e.eventsHub.on("highlight:change",a=>this.onHighlightChange(a)),()=>this.groupNode.remove(),()=>s.delete(this.selection))}hasErrorBars(){const{xLowerKey:e,xUpperKey:i,yLowerKey:o,yUpperKey:s}=this.properties;return(0,import_ag_charts_core51.isDefined)(e)&&(0,import_ag_charts_core51.isDefined)(i)||(0,import_ag_charts_core51.isDefined)(o)&&(0,import_ag_charts_core51.isDefined)(s)}isStacked(){const e=this.cartesianSeries.seriesGrouping?.stackCount;return e==null?!1:e>0}getUnstackPropertyDefinition(e){const i=[],{xLowerKey:o,xUpperKey:s,yLowerKey:a,yUpperKey:r,xErrorsID:n,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=e;return a!=null&&r!=null&&i.push(valueProperty2(a,h,{id:`${l}-lower`}),valueProperty2(r,h,{id:`${l}-upper`})),o!=null&&s!=null&&i.push(valueProperty2(o,c,{id:`${n}-lower`}),valueProperty2(s,c,{id:`${n}-upper`})),i}getStackPropertyDefinition(e){const i=[],{cartesianSeries:o}=this,{xLowerKey:s,xUpperKey:a,yLowerKey:r,yUpperKey:n,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:d}=e,u=o.seriesGrouping?.groupIndex??o.id,p={invalidValue:null,missingValue:0,separateNegative:!0,...o.visible?{}:{forceValue:0}},g=(f,x,b,m)=>groupAccumulativeValueProperty(f,"normal",{id:`${x}-${b}`,groupId:`errorGroup-${u}-${b}`,...p},m),y=(f,x,b,m)=>{i.push(...g(f,b,"lower",m),...g(x,b,"upper",m))};return r!=null&&n!=null&&y(r,n,c,d),s!=null&&a!=null&&y(s,a,l,h),i}getPropertyDefinitions(e){return this.isStacked()?this.getStackPropertyDefinition(e):this.getUnstackPropertyDefinition(e)}onDataProcessed(e){this.dataModel=e.dataModel,this.processedData=e.processedData}getDomain(e){const{xLowerKey:i,xUpperKey:o,xErrorsID:s,yLowerKey:a,yUpperKey:r,yErrorsID:n}=this.getMaybeFlippedKeys();if(e===ChartAxisDirection12.X?(0,import_ag_charts_core51.isDefined)(i)&&(0,import_ag_charts_core51.isDefined)(o):(0,import_ag_charts_core51.isDefined)(a)&&(0,import_ag_charts_core51.isDefined)(r)){const{dataModel:c,processedData:h,cartesianSeries:d}=this;if(c!=null&&h!=null){const u={x:s,y:n}[e],p=c.getDomain(d,`${u}-lower`,"value",h),g=c.getDomain(d,`${u}-upper`,"value",h),y=[Math.min(...p,...g),Math.max(...p,...g)];return fixNumericExtent(y)}}return[]}onDataUpdate(e){this.dataModel=e.dataModel,this.processedData=e.processedData,(0,import_ag_charts_core51.isDefined)(e.dataModel)&&(0,import_ag_charts_core51.isDefined)(e.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const e=this.getNodeData(),i=this.cartesianSeries.axes[ChartAxisDirection12.X]?.scale,o=this.cartesianSeries.axes[ChartAxisDirection12.Y]?.scale;if(!(!i||!o||!e))for(let s=0;sthis.updateNode(i,o,s)))}updateNode(e,i,o){e.datum=i,e.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1,"none"),e.updateBBoxes()}pickNodeExact(e){const{x:i,y:o}=e,s=this.groupNode.pickNode(i,o);if(s!=null)return{datum:s.datum,distanceSquared:0}}pickNodeNearest(e){return this.groupNode.nearestSquared(e.x,e.y)}pickNodeMainAxisFirst(e,i){let o,s=[1/0,1/0];const a=[e.x,e.y];i===ChartAxisDirection12.Y&&a.reverse();for(const r of this.groupNode.children()){const n=r.getBBox(),l=[n.x+n.width/2,n.y+n.height/2];i===ChartAxisDirection12.Y&&l.reverse();const c=[];for(let h=0;hnew ErrorBars(t),themeTemplate:ERROR_BARS_THEME},import_ag_charts_community103=require("ag-charts-community"),{ZIndexMap:ZIndexMap6,ActionOnSet:ActionOnSet6,Property:Property43,ProxyPropertyOnWrite:ProxyPropertyOnWrite2}=import_ag_charts_community103._ModuleSupport,Foreground=class extends import_ag_charts_community103._ModuleSupport.Background{constructor(){super(...arguments),this.image=new Image,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new import_ag_charts_community103._ModuleSupport.Group({name:"foreground",zIndex:ZIndexMap6.FOREGROUND})}onLayoutComplete(t){super.onLayoutComplete(t);const{width:e,height:i}=t.chart;let o={x:0,y:0,width:e,height:i};this.image&&(o=this.image.performLayout(e,i)),this.text&&this.updateTextNode(o)}onImageLoad(){this.ctx.updateService.update(import_ag_charts_community103._ModuleSupport.ChartUpdateType.SCENE_RENDER)}updateTextNode(t){const{textNode:e}=this;e.fontWeight="bold",e.fontFamily="Impact, sans-serif",e.fontSize=19,e.opacity=.7,e.fill="#9b9b9b",e.textBaseline="top";const i=this.textNode.getBBox(),o=10;e.x=t.x+t.width/2-i.width/2,e.y=t.y+t.height+o}};__decorateClass([Property43,ActionOnSet6({newValue(t){this.node.appendChild(t.node),t.onLoad=()=>this.onImageLoad()},oldValue(t){t.node.remove(),t.onLoad=void 0}})],Foreground.prototype,"image",2),__decorateClass([Property43,ProxyPropertyOnWrite2("rectNode","fill")],Foreground.prototype,"fill",2),__decorateClass([Property43,ProxyPropertyOnWrite2("rectNode","fillOpacity")],Foreground.prototype,"fillOpacity",2);var ForegroundModule={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:t=>new Foreground(t)},import_ag_charts_community110=require("ag-charts-community"),import_ag_charts_core54=require("ag-charts-core"),import_ag_charts_community105=require("ag-charts-community"),import_ag_charts_core52=require("ag-charts-core"),import_ag_charts_community104=require("ag-charts-community"),{TranslatableGroup:TranslatableGroup3,SceneChangeDetection}=import_ag_charts_community104._ModuleSupport,MiniChartGroup=class extends TranslatableGroup3{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(t,e){const{cornerRadius:i,inset:o}=this,{x:s,y:a,width:r,height:n}=e,l=new Path2D;l.roundRect(s+o,a+o,r-2*o,n-2*o,i),t.clip(l)}};__decorateClass([SceneChangeDetection()],MiniChartGroup.prototype,"inset",2),__decorateClass([SceneChangeDetection()],MiniChartGroup.prototype,"cornerRadius",2);var{Property:Property44,ZIndexMap:ZIndexMap7,ActionOnSet:ActionOnSet7,CategoryAxis,Padding,Group:Group6,BBox:BBox7,ProxyProperty:ProxyProperty2,stackCartesianSeries}=import_ag_charts_community105._ModuleSupport,MiniChartPadding=class{constructor(){this.top=0,this.bottom=0}};__decorateClass([Property44],MiniChartPadding.prototype,"top",2),__decorateClass([Property44],MiniChartPadding.prototype,"bottom",2);var MiniChart=class extends import_ag_charts_community105._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.padding=new MiniChartPadding,this.root=new Group6({name:"root"}),this.seriesRoot=this.root.appendChild(new MiniChartGroup({name:"Series-root",zIndex:ZIndexMap7.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Group6({name:"Axes-Grids",zIndex:ZIndexMap7.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Group6({name:"Axes-Grids",zIndex:ZIndexMap7.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Group6({name:"Axes-Labels",zIndex:ZIndexMap7.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Group6({name:"Axes-Crosslines-Range",zIndex:ZIndexMap7.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Group6({name:"Axes-Crosslines-Line",zIndex:ZIndexMap7.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Group6({name:"Axes-Crosslines-Label",zIndex:ZIndexMap7.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=[],this.series=[]}destroy(){if(!this._destroyed){this.destroySeries(this.series);for(const t of this.axes)t.destroy();this.axes=[],this._destroyed=!0}}onSeriesChange(t,e){const i=e?.filter(o=>!t.includes(o))??[];this.destroySeries(i);for(const o of t)e?.includes(o)||(o.attachSeries(this.seriesRoot,this.seriesRoot,void 0),o.chart={},Object.defineProperty(o.chart,"mode",{get:()=>"standalone"}),Object.defineProperty(o.chart,"isMiniChart",{get:()=>!0}),Object.defineProperty(o.chart,"seriesRect",{get:()=>this.seriesRect}),o.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled"));this.seriesRect=void 0}destroySeries(t){if(t)for(const e of t)e.destroy(),e.detachSeries(this.seriesRoot,this.seriesRoot,void 0),e.chart=void 0}assignSeriesToAxes(){for(const t of this.axes)t.boundSeries=this.series.filter(e=>e.axes[t.direction]===t)}assignAxesToSeries(){const t={};for(const e of this.axes){const i=e.direction;(t[i]??(t[i]=[])).push(e)}for(const e of this.series)for(const i of e.directions){const o=t[i];if(!o){import_ag_charts_core52.Logger.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);continue}const s=e.getKeys(i),a=this.findMatchingAxis(o,s);if(!a){import_ag_charts_core52.Logger.warnOnce(`no matching axis for direction [${i}] and keys [${s}]; check series and axes configuration.`);continue}e.axes[i]=a}}findMatchingAxis(t,e){for(const i of t){if(!i.keys.length)return i;if(e){for(const o of e)if(i.keys.includes(o))return i}}}updateData(t){for(const e of this.series)e.setChartData(t);this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready";for(const e of this.series)e.resetAnimation("disabled")})}async processData(t){this.series.some(e=>e.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(async e=>(e.resetDatumCallbackCache(),e.processData(t))));for(const e of this.axes)e.processData()}computeAxisPadding(){const t=new Padding;if(!this.enabled)return t;for(const{position:e,thickness:i,line:o,label:s}of this.axes){if(e==null)continue;let a;i?a=i:a=(o.enabled?o.width:0)+(s.enabled?(0,import_ag_charts_core52.calcLineHeight)(s.fontSize??0)+s.spacing:0),t[e]=Math.ceil(a)}return t}async layout(t,e){var i;const{padding:o}=this,s=this.seriesRect!=null,a=new BBox7(0,0,t,e-(o.top+o.bottom)),r=this.seriesRect==null||this.seriesRect.width!==t||this.seriesRect.height!==e;this.seriesRect=a,this.seriesRoot.translationY=o.top,this.seriesRoot.setClipRectCanvasSpace(new BBox7(0,-o.top,t,e));for(const n of this.axes){const{position:l="left"}=n;switch(l){case"top":case"bottom":n.range=[0,a.width],n.gridLength=a.height;break;case"right":case"left":{const c=n instanceof CategoryAxis;n.range=c?[0,a.height]:[a.height,0],n.gridLength=a.width;break}}if(n.gridPadding=0,n.translation.x=0,n.translation.y=0,l==="right"?n.translation.x=t:l==="bottom"&&(n.translation.y=e),s||n.resetAnimation("initial"),n.crossLines)for(const c of n.crossLines)c instanceof import_ag_charts_community105._ModuleSupport.CartesianCrossLine&&(c.position=n.position??"top",(i=c.label).parallel??(i.parallel=n.label?.parallel));n.calculateLayout(),n.update()}r&&stackCartesianSeries(this.series),await Promise.all(this.series.map(async n=>n.update({seriesRect:a})))}};__decorateClass([Property44],MiniChart.prototype,"enabled",2),__decorateClass([ProxyProperty2(["seriesRoot","inset"])],MiniChart.prototype,"inset",2),__decorateClass([ProxyProperty2(["seriesRoot","cornerRadius"])],MiniChart.prototype,"cornerRadius",2),__decorateClass([ActionOnSet7({changeValue(t,e=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const o of e)t.includes(o)||(o.detachAxis(),o.destroy());for(const o of t)e?.includes(o)||o.attachAxis(i)}})],MiniChart.prototype,"axes",2),__decorateClass([ActionOnSet7({changeValue(t,e){this.onSeriesChange(t,e)}})],MiniChart.prototype,"series",2);var import_ag_charts_community106=require("ag-charts-community"),import_ag_charts_core53=require("ag-charts-core"),{SliderWidget}=import_ag_charts_community106._ModuleSupport,NavigatorDOMProxy=class{constructor(t,e){this.ctx=t,this.sliderHandlers=e,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=t,this.toolbar=t.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[t.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),t.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,o]of["min","pan","max"].entries()){const s=this.sliders[i];s.step=SliderWidget.STEP_HUNDRETH,s.keyboardStep=SliderWidget.STEP_ONE,s.orientation="horizontal",s.setPreventsDefault(!1),s.addListener("drag-start",a=>this.onDragStart(i,a,o)),s.addListener("drag-move",a=>this.onDrag(s,a,o)),s.addListener("drag-end",()=>this.updateSliderRatios()),s.addListener("contextmenu",a=>this.onContextMenu(s,a))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(t){this.toolbar.setHidden(!t)}updateZoom(){const{_min:t,_max:e}=this;if(!(t==null||e==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:t,max:e}})}updateBounds(t){this.toolbar.setBounds(t)}updateSliderBounds(t,e){this.sliders[t].setBounds(e)}updateMinMax(t,e){this._min=t,this._max=e,this.updateSliderRatios()}updateSliderRatios(){let{_min:t,_max:e}=this;t=Math.round(t*100)/100,e=Math.round(e*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:t,max:e});this.sliders[0].setValueRatio(t),this.sliders[1].setValueRatio(t,{ariaValueText:i}),this.sliders[2].setValueRatio(e)}toCanvasOffsets(t){return{offsetX:this.dragStartX+t.originDeltaX}}moveToFront(t){if(t===1)return;const e=this.sliders[t],i=this.sliders[2-t];this.toolbar.moveChild(i,e.domIndex-1)}onDragStart(t,e,i){const o=this.sliders[t],s=this.toolbar.cssLeft(),a=o.cssLeft();this.dragStartX=s+a+e.offsetX,this.moveToFront(t),e.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(e))}onDrag(t,e,i){e.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(e))}onContextMenu(t,e){const{offsetX:i,offsetY:o}=e,{x:s,y:a}=this.toolbar.getBounds(),{x:r,y:n}=t.getBounds(),l=i+s+r,c=o+a+n;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const t=this.sliders[1].getValueRatio(),e=this._max-this._min;this._min=(0,import_ag_charts_core53.clamp)(0,t,1-e),this._max=this._min+e,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}},import_ag_charts_community107=require("ag-charts-community"),{Property:Property45,SceneChangeDetection:SceneChangeDetection2,BBox:BBox8,ExtendedPath2D}=import_ag_charts_community107._ModuleSupport,RangeHandle=class extends import_ag_charts_community107._ModuleSupport.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new ExtendedPath2D}setCenter(t,e){this.dirtyPath=!0,(this.centerX!==t||this.centerY!==e)&&(this.centerX=t,this.centerY=e,this.markDirty("center"))}static align(t,e,i,o,s,a,r,n,l){const c=t.align(i+s*r)+l,h=c+t.align(i+s*r,s*(n-r))-2*l,d=t.align(o+a/2);t.setCenter(c,d),e.setCenter(h,d)}computeBBox(){const{centerX:t,centerY:e,width:i,height:o}=this,s=t-i/2,a=e-o/2;return new BBox8(s,a,i,o)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}updatePath(){const{centerX:t,centerY:e,path:i,gripPath:o,strokeWidth:s,cornerRadius:a,grip:r}=this,n=s/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),o.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(t-c+n,e-h+n,2*(c-n),2*(h-n),a);const d=3;if(r)for(let u=-.5;u<=.5;u+=1)for(let p=-1;p<=1;p+=1)o.arc(t+u*d,e+p*d,1,0,2*Math.PI),o.closePath()}renderFill(t,e){const{stroke:i}=this;super.renderFill(t,e),t.fillStyle=typeof i=="string"?i:"black",t.fill(this.gripPath.getPath2D())}};RangeHandle.className="RangeHandle",__decorateClass([Property45,SceneChangeDetection2()],RangeHandle.prototype,"width",2),__decorateClass([Property45,SceneChangeDetection2()],RangeHandle.prototype,"height",2),__decorateClass([Property45,SceneChangeDetection2()],RangeHandle.prototype,"cornerRadius",2),__decorateClass([Property45,SceneChangeDetection2()],RangeHandle.prototype,"grip",2);var import_ag_charts_community108=require("ag-charts-community"),{Path:Path6,BBox:BBox9,ExtendedPath2D:ExtendedPath2D2,clippedRoundRect,Property:Property46,SceneChangeDetection:SceneChangeDetection3}=import_ag_charts_community108._ModuleSupport,RangeMask=class extends Path6{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new ExtendedPath2D2}layout(t,e,i,o,s,a){s=Number.isNaN(s)?this.min:s,a=Number.isNaN(a)?this.max:a,(t!==this.x||e!==this.y||i!==this.width||this.height!==o||s!==this.min||a!==this.max)&&(this.x=t,this.y=e,this.width=i,this.height=o,this.min=s,this.max=a,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:t,y:e,width:i,height:o}=this;return new BBox9(t,e,i,o)}computeVisibleRangeBBox(){const{x:t,y:e,width:i,height:o,min:s,max:a}=this,r=t+i*s,n=t+i*a;return new BBox9(r,e,n-r,o)}updatePath(){const{path:t,visiblePath:e,x:i,y:o,width:s,height:a,min:r,max:n,strokeWidth:l,cornerRadius:c}=this,h=l/2;t.clear(),e.clear();const d=this.align(i)+h,u=this.align(o)+h,p=this.align(i,s)-2*h,g=this.align(o,a)-2*h,y=this.align(i+s*r)+h,f=y+this.align(i+s*r,s*(n-r))-2*h,x={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},b=(m,S,v)=>{if(v-S<1)return;const M=new BBox9(S,u,v-S,g);clippedRoundRect(m,d,u,p,g,x,M)};b(t,d,y),b(t,f,p+d),b(e,y,f)}renderStroke(t,e){super.renderStroke(t,e),super.renderStroke(t,this.visiblePath.getPath2D())}};RangeMask.className="RangeMask",__decorateClass([Property46,SceneChangeDetection3()],RangeMask.prototype,"cornerRadius",2);var import_ag_charts_community109=require("ag-charts-community"),RangeSelector=class extends import_ag_charts_community109._ModuleSupport.Group{constructor(t){super({name:"rangeSelectorGroup",zIndex:import_ag_charts_community109._ModuleSupport.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new import_ag_charts_community109._ModuleSupport.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(t)}layout(t,e,i,o,s,a){this.x=t,this.y=e,this.width=i,this.height=o,this.lOffset=s,this.rOffset=a,this.background.translationX=t,this.background.translationY=e,this.markDirty("RangeSelector")}updateBackground(t,e){t?.remove(),e!=null&&this.background.appendChild(e),this.markDirty("RangeSelector")}computeBBox(){const{x:t,y:e,width:i,height:o,lOffset:s,rOffset:a}=this;return new import_ag_charts_community109._ModuleSupport.BBox(t-s,e,i+(s+a),o)}},{BaseModuleInstance:BaseModuleInstance2,ObserveChanges:ObserveChanges3,Property:Property47}=import_ag_charts_community110._ModuleSupport,Navigator=class extends BaseModuleInstance2{constructor(t){super(),this.ctx=t,this.enabled=!1,this.mask=new RangeMask,this.minHandle=new RangeHandle,this.maxHandle=new RangeHandle,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(e,i)=>({x:e,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new RangeSelector([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(t.scene.attachNode(this.rangeSelector),t.eventsHub.on("locale:change",()=>this.updateZoom()),t.layoutManager.registerElement(import_ag_charts_community110._ModuleSupport.LayoutElement.Navigator,e=>this.onLayoutStart(e)),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)),t.eventsHub.on("zoom:change",e=>this.onZoomChange(e))),this.domProxy=new NavigatorDOMProxy(t,this),this.updateGroupVisibility(),this.miniChart=new MiniChart(t)}updateBackground(t,e){this.rangeSelector?.updateBackground(t,e)}updateGroupVisibility(){const{enabled:t}=this;this.rangeSelector==null||t===this.rangeSelector.visible||(this.rangeSelector.visible=t,this.domProxy.updateVisibility(t),t?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(t){if(this.enabled){const{layoutBox:e}=t,i=this.height+this.spacing;e.shrink(i,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:e,bottom:i}=this.miniChart.computeAxisPadding();t.layoutBox.shrink(e+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(t){const{x:e,width:i}=t.series.rect,{y:o,height:s}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:a,_max:r}=this.domProxy;this.layoutNodes(e,o,i,s,a,r),this.domProxy.updateBounds({x:e,y:o,width:i,height:s})}this.x=e,this.width=i,this.miniChart?.layout(i,s).catch(a=>import_ag_charts_core54.Logger.error(a))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(import_ag_charts_community110._ModuleSupport.InteractionState.ZoomDraggable)}onDragStart(t,{offsetX:e}){this.canDrag()&&(t==="pan"&&(this.panStart=(e-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(t,{offsetX:e}){if(!this.canDrag())return;const{panStart:i,x:o,width:s}=this,{minRange:a}=this.domProxy;let{_min:r,_max:n}=this.domProxy;const l=(e-o)/s;if(t==="min")r=(0,import_ag_charts_core54.clamp)(0,l,n-a);else if(t==="max")n=(0,import_ag_charts_core54.clamp)(r+a,l,1);else if(t==="pan"&&i!=null){const c=n-r;r=(0,import_ag_charts_core54.clamp)(0,l-i,1-c),n=r+c}this.domProxy._min=r,this.domProxy._max=n,this.updateZoom()}onZoomChange(t){const{x:e}=t;if(!e)return;const{x:i,y:o,width:s,height:a}=this,{min:r,max:n}=e;this.domProxy.updateMinMax(r,n),this.layoutNodes(i,o,s,a,r,n)}layoutNodes(t,e,i,o,s,a){const{rangeSelector:r,mask:n,minHandle:l,maxHandle:c}=this;n.layout(t,e,i,o,s,a),r.layout(t,e,i,o,l.width/2,c.width/2),RangeHandle.align(l,c,t,e,i,o,s,a,n.strokeWidth/2),s+(a-s)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3);for(const[h,d]of[l,this.maskVisibleRange,c].entries()){const u=d.getBBox(),p={x:u.x-t,y:u.y-e,height:u.height,width:u.width};this.domProxy.updateSliderBounds(h,p)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(t){return this.miniChart?.updateData(t)}async processData(t){if(this.miniChart)return this.miniChart?.processData(t)}};__decorateClass([ObserveChanges3((t,e,i)=>{t.updateBackground(i?.root,e?.root)})],Navigator.prototype,"miniChart",2),__decorateClass([Property47,ObserveChanges3((t,e)=>{t.ctx.zoomManager.setNavigatorEnabled(!!e),t.updateGroupVisibility()})],Navigator.prototype,"enabled",2),__decorateClass([Property47],Navigator.prototype,"height",2),__decorateClass([Property47,ObserveChanges3((t,e)=>{t.mask.cornerRadius=e})],Navigator.prototype,"cornerRadius",2),__decorateClass([Property47],Navigator.prototype,"spacing",2);var import_ag_charts_community156=require("ag-charts-community"),import_ag_charts_community155=require("ag-charts-community"),import_ag_charts_core65=require("ag-charts-core"),import_ag_charts_community116=require("ag-charts-community"),import_ag_charts_community113=require("ag-charts-community");function prepareBoxPlotFromTo(t){return{from:t?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function resetBoxPlotSelectionsScalingCenterFn(t){return(e,i)=>t?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}var import_ag_charts_community111=require("ag-charts-community"),{Path:Path7,Scalable,ExtendedPath2D:ExtendedPath2D3,SceneChangeDetection:SceneChangeDetection4,SceneArrayChangeDetection,BBox:BBox10,clippedRoundRect:baseClippedRoundRect}=import_ag_charts_community111._ModuleSupport,BoxPlotNode=class extends Scalable(Path7){constructor(){super(...arguments),this.wickPath=new ExtendedPath2D3,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:t,center:e,thickness:i,min:o,max:s}=this;return t?new BBox10(Math.min(o,s),e-i/2,Math.abs(s-o),i):new BBox10(e-i/2,Math.min(o,s),i,Math.abs(s-o))}computeDefaultGradientFillBBox(){const{horizontal:t,center:e,thickness:i,q1:o,q3:s}=this;return t?new BBox10(Math.min(o,s),e-i/2,Math.abs(s-o),i):new BBox10(e-i/2,Math.min(o,s),i,Math.abs(s-o))}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:t,crisp:e}=this;let{center:i,min:o,q1:s,median:a,q3:r,max:n}=this,l=i-t/2,c=i+t/2;if(e&&t>1){o=this.align(o),s=this.align(s),a=this.align(a),r=this.align(r),n=o+this.align(o,n-o);const h=this.align(t/2);i=this.align(i),l=i-h,c=i+h}return{center:i,x0:l,x1:c,min:o,max:n,q1:s,median:a,q3:r}}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,wickStroke:r,wickStrokeWidth:n,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:d,cornerRadius:u,capLengthRatio:p,horizontal:g}=this,{center:y,x0:f,x1:x,min:b,max:m,q1:S,median:v,q3:M}=this.alignedCoordinates(),D=this.layerManager?.canvas.pixelRatio??1,k=this.wickStrokeAlignment>0?D/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const T=r!=null&&r!==e||n!=null&&n!==i||l!=null&&l!==o||c!=null&&c!==s||h!=null&&h!==a?this.wickPath:t;if(Math.abs(x-f)<=3){moveTo(T,g,y,b),lineTo(T,g,y,m);return}const w=Math.min(b,m),R=Math.max(b,m),F=Math.min(S,M),O=Math.max(S,M),E=y-Math.abs((x-f)*p)/2,I=y+Math.abs((x-f)*p)/2;moveTo(T,g,E,w-k),lineTo(T,g,I,w-k),moveTo(T,g,y-k,w-k),lineTo(T,g,y-k,F+i/2),moveTo(T,g,y-k,R+k),lineTo(T,g,y-k,O-i/2),moveTo(T,g,E,R+k),lineTo(T,g,I,R+k);const C=i/2+d,L=i/2-d,A=O-F-2*L;if(A>0){const P=f+C,z=F+L,B=x-f-2*C,V={topLeft:u,topRight:u,bottomRight:u,bottomLeft:u};clippedRoundRect2(t,g,P,z,B,A,V,new BBox10(P,z,B,v-z)),clippedRoundRect2(t,g,P,z,B,A,V,new BBox10(P,v,B,z+A-v))}else{const P=(F+O)/2;moveTo(t,g,f,P),lineTo(t,g,x,P)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,wickStroke:n=i,wickStrokeWidth:l=o,wickStrokeOpacity:c=s,wickLineDash:h=a,wickLineDashOffset:d=r}=this;l!==0&&(t.globalAlpha*=c,typeof n=="string"&&(t.strokeStyle=n),t.lineWidth=l,h!=null&&t.setLineDash([...h]),t.lineDashOffset=d,t.stroke(e.getPath2D()))}};__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"horizontal",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"center",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"thickness",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"min",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"q1",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"median",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"q3",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"max",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"cornerRadius",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"crisp",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"strokeAlignment",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"wickStroke",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"wickStrokeWidth",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"wickStrokeOpacity",2),__decorateClass([SceneArrayChangeDetection()],BoxPlotNode.prototype,"wickLineDash",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"wickLineDashOffset",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"capLengthRatio",2),__decorateClass([SceneChangeDetection4()],BoxPlotNode.prototype,"wickStrokeAlignment",2);function moveTo(t,e,i,o){e?t.moveTo(o,i):t.moveTo(i,o)}function lineTo(t,e,i,o){e?t.lineTo(o,i):t.lineTo(i,o)}function clippedRoundRect2(t,e,i,o,s,a,r,n){e?baseClippedRoundRect(t,o,i,a,s,r,n==null?void 0:new BBox10(n.y,n.x,n.height,n.width)):baseClippedRoundRect(t,i,o,s,a,r,n)}var import_ag_charts_community112=require("ag-charts-community"),{BaseProperties:BaseProperties15,AbstractBarSeriesProperties,makeSeriesTooltip,Property:Property48,mergeDefaults:mergeDefaults3}=import_ag_charts_community112._ModuleSupport,BoxPlotSeriesCap=class extends BaseProperties15{constructor(){super(...arguments),this.lengthRatio=.5}};__decorateClass([Property48],BoxPlotSeriesCap.prototype,"lengthRatio",2);var BoxPlotSeriesWhisker=class extends BaseProperties15{};__decorateClass([Property48],BoxPlotSeriesWhisker.prototype,"stroke",2),__decorateClass([Property48],BoxPlotSeriesWhisker.prototype,"strokeWidth",2),__decorateClass([Property48],BoxPlotSeriesWhisker.prototype,"strokeOpacity",2),__decorateClass([Property48],BoxPlotSeriesWhisker.prototype,"lineDash",2),__decorateClass([Property48],BoxPlotSeriesWhisker.prototype,"lineDashOffset",2);var BoxPlotSeriesProperties=class extends AbstractBarSeriesProperties{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new BoxPlotSeriesCap,this.whisker=new BoxPlotSeriesWhisker,this.tooltip=makeSeriesTooltip()}toJson(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:o,lineDashOffset:s}=this,a=super.toJson();return a.whisker=mergeDefaults3(a.whisker,{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:o,lineDashOffset:s}),a}};__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"xKey",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"minKey",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"q1Key",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"medianKey",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"q3Key",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"maxKey",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"xName",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"yName",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"minName",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"q1Name",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"medianName",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"q3Name",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"maxName",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"fill",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"fillOpacity",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"stroke",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"lineDash",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"cornerRadius",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"styler",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"cap",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"whisker",2),__decorateClass([Property48],BoxPlotSeriesProperties.prototype,"tooltip",2);var{fixNumericExtent:fixNumericExtent2,keyProperty:keyProperty2,mergeDefaults:mergeDefaults4,SeriesNodePickMode,SMALLEST_KEY_INTERVAL,valueProperty:valueProperty3,diff,animationValidation,computeBarFocusBounds,createDatumId,HighlightState,ContinuousScale:ContinuousScale4,ChartAxisDirection:ChartAxisDirection13,motion,getItemStyles,applyShapeFillBBox,calculateSegments,toHighlightString}=import_ag_charts_community113._ModuleSupport,BoxPlotSeriesNodeEvent=class extends import_ag_charts_community113._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.xKey,this.minKey=o.properties.minKey,this.q1Key=o.properties.q1Key,this.medianKey=o.properties.medianKey,this.q3Key=o.properties.q3Key,this.maxKey=o.properties.maxKey}},BoxPlotSeries=class extends import_ag_charts_community113._ModuleSupport.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode.NEAREST_NODE,SeriesNodePickMode.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new BoxPlotSeriesProperties,this.NodeEvent=BoxPlotSeriesNodeEvent}async processData(t){if(!this.visible)return;const{xKey:e,minKey:i,q1Key:o,medianKey:s,q3Key:a,maxKey:r}=this.properties,n=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:d,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),p=[];n&&this.processedData&&p.push(diff(this.id,this.processedData)),n&&p.push(animationValidation());const{processedData:g}=await this.requestDataModel(t,this.data,{props:[keyProperty2(e,d,{id:"xValue"}),valueProperty3(i,u,{id:"minValue"}),valueProperty3(o,u,{id:"q1Value"}),valueProperty3(s,u,{id:"medianValue"}),valueProperty3(a,u,{id:"q3Value"}),valueProperty3(r,u,{id:"maxValue"}),...h?[SMALLEST_KEY_INTERVAL]:[],...p]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:s,def:a}=i.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[s];return a.type==="key"&&a.valueType==="category"?r:this.padBandExtent(r)}const o=this.domainForClippedRange(t,["minValue","maxValue"],"xValue");return fixNumericExtent2(o)}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection13.Y,["maxValue","minValue"],"xValue",e)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!(e&&i&&o&&s))return;const{xKey:a}=this.properties,r=[],n=e.resolveKeysById(this,"xValue",i),l=e.resolveColumnById(this,"minValue",i),c=e.resolveColumnById(this,"q1Value",i),h=e.resolveColumnById(this,"medianValue",i),d=e.resolveColumnById(this,"q3Value",i),u=e.resolveColumnById(this,"maxValue",i),{barWidth:p,groupIndex:g}=this.updateGroupScale(o),y=ContinuousScale4.is(o.scale)?p*-.5:0,{groupScale:f}=this,x=this.isVertical(),b=calculateSegments(this.properties.segmentation,o,s,this.chart.seriesRect,this.ctx.scene),m={itemId:a,nodeData:r,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:getItemStyles(this.getItemStyle.bind(this)),segments:b};if(!t)return m;const S=i.dataSources.get(this.id)?.data??[];for(const[v,M]of S.entries()){const D=n[v];if(D==null)continue;const k=l[v],_=c[v],T=h[v],w=d[v],R=u[v];if([k,_,T,w,R].some(P=>typeof P!="number")||k>_||_>T||T>w||w>R)continue;const F={xValue:o.scale.convert(D),minValue:s.scale.convert(k),q1Value:s.scale.convert(_),medianValue:s.scale.convert(T),q3Value:s.scale.convert(w),maxValue:s.scale.convert(R)},O=p;F.xValue+=f.convert(String(g))+y+O/2;const E=Math.abs(F.q3Value-F.q1Value),I=F.xValue,C=Math.min(F.q3Value,F.q1Value)+E/2,L={x:x?I:C,y:x?C:I};let A;x?A={x:L.x-O/2,y:F.minValue,width:O,height:F.maxValue-F.minValue}:A={x:F.minValue,y:L.y-O/2,width:F.maxValue-F.minValue,height:O},r.push({series:this,itemId:D,datum:M,datumIndex:v,xKey:a,bandwidth:O,scaledValues:F,midPoint:L,focusRect:A})}return m}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:o,strokeOpacity:s,lineDash:a,lineDashOffset:r}=this.getStyle(!1,!1,HighlightState.None);return{marker:{fill:import_ag_charts_community113._ModuleSupport.deepClone(t),fillOpacity:o,stroke:e,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:r}}}getLegendData(t){const{id:e,ctx:{legendManager:i},visible:o}=this,{xKey:s,yName:a,showInLegend:r,legendItemName:n}=this.properties;return!s||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:o&&i.getItemEnabled({seriesId:e,itemId:e}),label:{text:n??a??e},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!r}]}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:r,yName:n,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:y,maxKey:f,maxName:x,legendItemName:b,tooltip:m}=s,S=this.getCategoryAxis(),v=this.getValueAxis();if(!i||!o||!S||!v)return;const M=o.dataSources.get(this.id)?.data[t],D=i.resolveKeysById(this,"xValue",o)[t],k=i.resolveColumnById(this,"minValue",o)[t],_=i.resolveColumnById(this,"q1Value",o)[t],T=i.resolveColumnById(this,"medianValue",o)[t],w=i.resolveColumnById(this,"q3Value",o)[t],R=i.resolveColumnById(this,"maxValue",o)[t];if(D==null)return;const F=this.getItemStyle(t,!1),O=[{label:y,fallbackLabel:g,value:this.getAxisValueText(v,"tooltip",k,M,g,b)},{label:d,fallbackLabel:h,value:this.getAxisValueText(v,"tooltip",_,M,h,b)},{label:c,fallbackLabel:l,value:this.getAxisValueText(v,"tooltip",T,M,l,b)},{label:p,fallbackLabel:u,value:this.getAxisValueText(v,"tooltip",w,M,u,b)},{label:x,fallbackLabel:f,value:this.getAxisValueText(v,"tooltip",R,M,f,b)}];return this.formatTooltipWithContext(m,{heading:this.getAxisValueText(S,"tooltip",D,M,a,b),title:b??n,symbol:this.legendItemSymbol(),data:O},{seriesId:e,datum:M,title:n,xKey:a,xName:r,yName:n,medianKey:l,medianName:c,q1Key:h,q1Name:d,q3Key:u,q3Name:p,minKey:g,minName:y,maxKey:f,maxName:x,...F})}animateEmptyUpdateReady({datumSelection:t}){const e=this.isVertical(),{from:i,to:o}=prepareBoxPlotFromTo(e);motion.resetMotion([t],resetBoxPlotSelectionsScalingCenterFn(e)),motion.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[t],i,o,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(t){const e=t.nodeData??[];return t.datumSelection.update(e)}makeStylerParams(t,e){const{id:i}=this,{cornerRadius:o,cap:{lengthRatio:s},fill:a,fillOpacity:r,lineDash:n,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:d,maxKey:u,maxName:p,medianKey:g,medianName:y,minKey:f,minName:x,q1Key:b,q1Name:m,q3Key:S,q3Name:v,whisker:{lineDash:M,lineDashOffset:D,stroke:k,strokeOpacity:_,strokeWidth:T},xKey:w,xName:R,yName:F}=this.properties,O=toHighlightString(e??HighlightState.None);return{cap:{lengthRatio:s},cornerRadius:o,fill:a,fillOpacity:r,highlightState:O,highlighted:t,lineDash:n,lineDashOffset:l,maxKey:u,maxName:p??u,medianKey:g,medianName:y??g,minKey:f,minName:x??f,q1Key:b,q1Name:m??b,q3Key:S,q3Name:v??S,seriesId:i,stroke:c,strokeOpacity:h,strokeWidth:d,whisker:{lineDash:M??n,lineDashOffset:D??l,stroke:k??c,strokeOpacity:_??h,strokeWidth:T??d},xKey:w,xName:R??w,yName:F}}getStyle(t,e,i){const{cap:o,cornerRadius:s,fill:a,fillOpacity:r,lineDash:n,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:d,styler:u,whisker:p}=this.properties;let g={};if(!t&&u){const y=this.makeStylerParams(e,i);g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,y)??{},{pick:!1})??{}}return{cornerRadius:g.cornerRadius??s,fill:g.fill??a,fillOpacity:g.fillOpacity??r,lineDash:g.lineDash??n,lineDashOffset:g.lineDashOffset??l,opacity:1,stroke:g.stroke??c,strokeOpacity:g.strokeOpacity??h,strokeWidth:g.strokeWidth??d,cap:{lengthRatio:g.cap?.lengthRatio??o.lengthRatio},whisker:{lineDash:g.whisker?.lineDash??p.lineDash,lineDashOffset:g.whisker?.lineDashOffset??p.lineDashOffset,stroke:g.whisker?.stroke??p.stroke,strokeOpacity:g.whisker?.strokeOpacity??p.strokeOpacity,strokeWidth:g.whisker?.strokeWidth??p.strokeWidth}}}getItemStyle(t,e,i){const{properties:o}=this,{itemStyler:s}=o,a=this.getHighlightStyle(e,t,i);let r=mergeDefaults4(a,this.getStyle(t===void 0,e,i));if(s!=null&&t!=null){const u=this.cachedDatumCallback(createDatumId(t,e?"highlight":"node"),()=>{const p=this.makeItemStylerParams(t,e,r);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(s,p))});u&&(r=mergeDefaults4(u,r))}const{stroke:n,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=r;return r.whisker=mergeDefaults4(r.whisker,{stroke:n,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}),r}makeItemStylerParams(t,e,i){const{id:o}=this,{xKey:s,minKey:a,q1Key:r,medianKey:n,q3Key:l,maxKey:c}=this.properties,h=this.processedData?.dataSources.get(o)?.data[t],d=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(d,e,t),p=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:o,datum:h,xKey:s,minKey:a,q1Key:r,medianKey:n,q3Key:l,maxKey:c,highlighted:e,highlightState:u,...i,fill:p}}updateDatumStyles({datumSelection:t,isHighlight:e}){const i=this.ctx.highlightManager.getActiveHighlight();t.each((o,s)=>{const a=this.getHighlightState(i,e,s.datumIndex);s.style=this.getItemStyle(s.datumIndex,e,a)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i,properties:o}=this;if(!i)return;const s=this.isVertical(),a=this.ctx.highlightManager.getActiveHighlight(),r=this.getShapeFillBBox(),n=this.getStyle(!1,!1,HighlightState.None).strokeWidth/2,l=o.whisker.strokeWidth??o.strokeWidth;t.each((c,h)=>{const d=h.style??i.styles[this.getHighlightState(a,e,h.datumIndex)];applyShapeFillBBox(c,d.fill,r),c.fill=d.fill,c.fillOpacity=d.fillOpacity,c.stroke=d.stroke,c.strokeWidth=d.strokeWidth,c.strokeOpacity=d.strokeOpacity,c.lineDash=d.lineDash,c.lineDashOffset=d.lineDashOffset,c.wickStroke=d.whisker.stroke,c.wickStrokeWidth=d.whisker.strokeWidth,c.wickStrokeOpacity=d.whisker.strokeOpacity,c.wickLineDash=d.whisker.lineDash,c.wickLineDashOffset=d.whisker.lineDashOffset,c.cornerRadius=d.cornerRadius,c.crisp=!0,c.horizontal=!s,c.center=h.scaledValues.xValue,c.thickness=h.bandwidth,c.min=h.scaledValues.minValue,c.q1=h.scaledValues.q1Value,c.median=h.scaledValues.medianValue,c.q3=h.scaledValues.q3Value,c.max=h.scaledValues.maxValue,c.capLengthRatio=d.cap.lengthRatio,c.strokeAlignment=n,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}nodeFactory(){return new BoxPlotNode}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds(this,this.contextNodeData?.nodeData[t].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};BoxPlotSeries.className="BoxPlotSeries",BoxPlotSeries.type="box-plot";var import_ag_charts_community114=require("ag-charts-community"),import_ag_charts_core55=require("ag-charts-core"),{boxPlotSeriesThemeableOptionsDef,commonSeriesOptionsDefs}=import_ag_charts_community114._ModuleSupport,boxPlotSeriesOptionsDef={...commonSeriesOptionsDefs,...boxPlotSeriesThemeableOptionsDef,type:(0,import_ag_charts_core55.required)((0,import_ag_charts_core55.constant)("box-plot")),xKey:(0,import_ag_charts_core55.required)(import_ag_charts_core55.string),minKey:(0,import_ag_charts_core55.required)(import_ag_charts_core55.string),q1Key:(0,import_ag_charts_core55.required)(import_ag_charts_core55.string),medianKey:(0,import_ag_charts_core55.required)(import_ag_charts_core55.string),q3Key:(0,import_ag_charts_core55.required)(import_ag_charts_core55.string),maxKey:(0,import_ag_charts_core55.required)(import_ag_charts_core55.string),xName:import_ag_charts_core55.string,yName:import_ag_charts_core55.string,minName:import_ag_charts_core55.string,q1Name:import_ag_charts_core55.string,medianName:import_ag_charts_core55.string,q3Name:import_ag_charts_core55.string,maxName:import_ag_charts_core55.string,grouped:import_ag_charts_core55.boolean,legendItemName:import_ag_charts_core55.string,segmentation:import_ag_charts_core55.shapeSegmentation},import_ag_charts_community115=require("ag-charts-community"),{ThemeConstants:{CARTESIAN_AXIS_TYPE},multiSeriesHighlightStyle,FILL_GRADIENT_LINEAR_DEFAULTS,FILL_IMAGE_DEFAULTS,FILL_PATTERN_DEFAULTS,SAFE_FILL_OPERATION,SEGMENTATION_DEFAULTS}=import_ag_charts_community115._ModuleSupport,BOX_PLOT_SERIES_THEME={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[SAFE_FILL_OPERATION,{$ref:"chartBackgroundColor"},.7]}]},["gradient",FILL_GRADIENT_LINEAR_DEFAULTS],["image",FILL_IMAGE_DEFAULTS],["pattern",FILL_PATTERN_DEFAULTS]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:multiSeriesHighlightStyle(),segmentation:SEGMENTATION_DEFAULTS},axes:{[CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{snap:!1}},[CARTESIAN_AXIS_TYPE.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},BoxPlotModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:t=>new BoxPlotSeries(t),predictAxis:import_ag_charts_community116._ModuleSupport.predictCartesianTimeAxis,defaultAxes:import_ag_charts_community116._ModuleSupport.DIRECTION_SWAP_AXES,themeTemplate:BOX_PLOT_SERIES_THEME,groupable:!0},BoxPlotSeriesModule={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:boxPlotSeriesOptionsDef,create:t=>new BoxPlotSeries(t)},import_ag_charts_community126=require("ag-charts-community"),import_ag_charts_community123=require("ag-charts-community"),import_ag_charts_community118=require("ag-charts-community"),import_ag_charts_core56=require("ag-charts-core"),import_ag_charts_community117=require("ag-charts-community"),{AGGREGATION_SPAN,AGGREGATION_INDEX_X_MAX,AGGREGATION_INDEX_X_MIN,AGGREGATION_INDEX_Y_MAX,AGGREGATION_INDEX_Y_MIN,aggregationDomain,aggregationRangeFittingPoints,compactAggregationIndices,createAggregationIndices}=import_ag_charts_community117._ModuleSupport,AGGREGATION_THRESHOLD=1e3,OPEN=AGGREGATION_INDEX_X_MIN,HIGH=AGGREGATION_INDEX_Y_MAX,LOW=AGGREGATION_INDEX_Y_MIN,CLOSE=AGGREGATION_INDEX_X_MAX;function aggregateOhlcData(t,e,i,o,s,a){if(e.length64;)({indexData:c,valueData:h,maxRange:l}=compactAggregationIndices(c,h,l)),d.push({maxRange:l,indexData:c});return d.reverse(),d}var{fixNumericExtent:fixNumericExtent3,keyProperty:keyProperty3,createDatumId:createDatumId2,SeriesNodePickMode:SeriesNodePickMode2,ChartAxisDirection:ChartAxisDirection14,SMALLEST_KEY_INTERVAL:SMALLEST_KEY_INTERVAL2,valueProperty:valueProperty4,diff:diff2,animationValidation:animationValidation2,computeBarFocusBounds:computeBarFocusBounds2,visibleRangeIndices,BandScale,processedDataIsAnimatable,mergeDefaults:mergeDefaults5,simpleMemorize2,getItemStylesPerItemId}=import_ag_charts_community118._ModuleSupport,memoizedAggregateOhlcData=simpleMemorize2(aggregateOhlcData),OhlcSeriesNodeEvent=class extends import_ag_charts_community118._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.xKey,this.openKey=o.properties.openKey,this.closeKey=o.properties.closeKey,this.highKey=o.properties.highKey,this.lowKey=o.properties.lowKey}},OhlcSeriesBase=class extends import_ag_charts_community118._ModuleSupport.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode2.AXIS_ALIGNED,SeriesNodePickMode2.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=OhlcSeriesNodeEvent,this.dataAggregationFilters=void 0}async processData(t){if(!this.visible)return;const{xKey:e,openKey:i,closeKey:o,highKey:s,lowKey:a}=this.properties,r=!this.ctx.animationManager.isSkipped(),n=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:d}=this.getScaleInformation({xScale:n,yScale:l}),u=[];r&&(this.processedData&&u.push(diff2(this.id,this.processedData)),u.push(animationValidation2())),i&&u.push(valueProperty4(i,d,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:p,processedData:g}=await this.requestDataModel(t,this.data,{props:[keyProperty3(e,h,{id:"xValue"}),valueProperty4(o,d,{id:"closeValue"}),valueProperty4(s,d,{id:"highValue"}),valueProperty4(a,d,{id:"lowValue"}),...c?[SMALLEST_KEY_INTERVAL2]:[],...u]});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(t,e){if(e.type!=="ungrouped"||processedDataIsAnimatable(e))return;const i=this.axes[ChartAxisDirection14.X];if(i==null)return;const o=t.resolveKeysById(this,"xValue",e),s=t.resolveColumnById(this,"highValue",e),a=t.resolveColumnById(this,"lowValue",e),{index:r}=t.resolveProcessedDataDefById(this,"xValue"),n=e.domain.keys[r];return memoizedAggregateOhlcData(i.scale.type,o,s,a,n,e.reduced?.smallestKeyInterval)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];if(t!==this.getBarDirection()){const{index:s,def:a}=i.resolveProcessedDataDefById(this,"xValue"),r=e.domain.keys[s];return a.type==="key"&&a.valueType==="category"?r:this.padBandExtent(r)}const o=this.domainForClippedRange(t,["highValue","lowValue"],"xValue");return fixNumericExtent3(o)}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection14.Y,["highValue","lowValue"],"xValue",e)}getZoomRangeFittingItems(t,e,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],t,e,i)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["highValue","lowValue"],t,e,i)}createNodeData(){const{visible:t,dataModel:e,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!(e&&i&&o&&s))return;const a=[],{xKey:r,highKey:n,lowKey:l}=this.properties,c=i.dataSources.get(this.id)?.data??[],h=e.resolveKeysById(this,"xValue",i),d=e.resolveColumnById(this,"openValue",i),u=e.resolveColumnById(this,"closeValue",i),p=e.resolveColumnById(this,"highValue",i),g=e.resolveColumnById(this,"lowValue",i),{groupScale:y}=this,{barWidth:f,groupIndex:x}=this.updateGroupScale(o),b=y.convert(String(x)),m=f>=1?f:y.rawBandwidth,S=BandScale.is(o.scale),v={itemId:r,nodeData:a,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:getItemStylesPerItemId(this.getItemStyle.bind(this),"up","down")};if(!t)return v;const M=(O,E,I,C,L,A,P,z)=>{const B=c[O],V=S?P/2:0,W=o.scale.convert(E)+b+V,H=s.scale.convert(I),G=s.scale.convert(C),K=s.scale.convert(L),U=s.scale.convert(A),Y=C>I,$=Y?"up":"down",X=Math.min(K,U),Z=Math.max(K,U)-X,q={x:W,y:X+Z/2};a.push({series:this,itemId:$,datum:B,datumIndex:O,xKey:r,xValue:E,openValue:I,closeValue:C,highValue:L,lowValue:A,midPoint:q,aggregatedValue:C,isRising:Y,centerX:W,width:P,y:X,height:Z,yOpen:H,yClose:G,crisp:z})},{dataAggregationFilters:D}=this,k=o.scale,[_,T]=k.range,w=Math.abs(T-_),R=O=>k.convert(h[O])+b,F=D?.find(O=>O.maxRange>w);if(F==null){const O=i.invalidData?.get(this.id);let[E,I]=visibleRangeIndices(1,c.length,o.range,C=>{const L=S?0:-m/2,A=R(C)+L;return[A,A+m]});i.input.count<1e3&&(E=0,I=i.input.count);for(let C=E;C=A&&z>=P;if(!V){import_ag_charts_core56.Logger.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!W){import_ag_charts_core56.Logger.warnOnce(`invalid high value for key [${n}] in data element, high value cannot be lower than datum open or close values.`);continue}M(C,L,A,P,z,B,m,!0)}}else{const{maxRange:O,indexData:E}=F,[I,C]=visibleRangeIndices(1,O,o.range,L=>{const A=L*AGGREGATION_SPAN,P=E[A+OPEN],z=E[A+CLOSE];if(P===-1)return;const B=S?0:-m/2;return[R(P)+B,R(z)+B+m]});for(let L=I;L{const p=this.makeItemStylerParams(o,t,e,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",o],this.callWithContext(n,p))});u&&(h=mergeDefaults5(u,h))}return h}makeItemStylerParams(t,e,i,o){const{id:s,properties:a,processedData:r}=this,{xKey:n,openKey:l,closeKey:c,highKey:h,lowKey:d}=a,u=r.dataSources.get(s)?.data[e],p=this.ctx.highlightManager?.getActiveHighlight(),g=this.getHighlightStateString(p,i,e),y={seriesId:s,datum:u,itemId:t,xKey:n,openKey:l,closeKey:c,highKey:h,lowKey:d,highlighted:i,highlightState:g,...o};return"fill"in y&&"fill"in o&&(y.fill=this.filterItemStylerFillParams(o.fill)??o.fill),y}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:r,yName:n,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:y,legendItemName:f,tooltip:x}=s,b=this.getCategoryAxis(),m=this.getValueAxis();if(!i||!o||!b||!m)return;const S=o.dataSources.get(this.id)?.data[t],v=i.resolveKeysById(this,"xValue",o)[t],M=i.resolveColumnById(this,"openValue",o)[t],D=i.resolveColumnById(this,"highValue",o)[t],k=i.resolveColumnById(this,"lowValue",o)[t],_=i.resolveColumnById(this,"closeValue",o)[t];if(v==null)return;const T=_>=M?"up":"down",w=this.properties.item[T],R=this.getItemStyle(t,!1),F={fill:w.fill??w.stroke,fillOpacity:w.fillOpacity??w.strokeOpacity??1,stroke:w.stroke,strokeWidth:w.strokeWidth??1,strokeOpacity:w.strokeOpacity??1,lineDash:w.lineDash??[0],lineDashOffset:w.lineDashOffset??0};return this.formatTooltipWithContext(x,{heading:this.getAxisValueText(b,"tooltip",v,S,a,f),title:f,symbol:{marker:F},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(m,"tooltip",M,S,l,f)},{label:d,fallbackLabel:h,value:this.getAxisValueText(m,"tooltip",D,S,h,f)},{label:p,fallbackLabel:u,value:this.getAxisValueText(m,"tooltip",k,S,u,f)},{label:y,fallbackLabel:g,value:this.getAxisValueText(m,"tooltip",_,S,g,f)}]},{seriesId:e,datum:S,title:n,itemId:T,xKey:a,xName:r,yName:n,openKey:l,openName:c,highKey:h,highName:d,lowKey:u,lowName:p,closeKey:g,closeName:y,...R})}computeFocusBounds(t){const e=this.getNodeData()?.at(t.datumIndex);if(e==null)return;const{centerX:i,y:o,width:s,height:a}=e,r={x:i-s/2,y:o,width:s,height:a};return computeBarFocusBounds2(this,r)}},import_ag_charts_community120=require("ag-charts-community"),import_ag_charts_community119=require("ag-charts-community"),{Path:Path8,SceneChangeDetection:SceneChangeDetection5,BBox:BBox11}=import_ag_charts_community119._ModuleSupport,OhlcBaseNode=class extends Path8{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}computeBBox(){const{centerX:t,y:e,width:i,height:o}=this;return new BBox11(t-i/2,e,i,o)}isPointInPath(t,e){return this.getBBox().containsPoint(t,e)}distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:t,width:e,height:i,crisp:o}=this;let{centerX:s,yOpen:a,yClose:r}=this,n=s-e/2,l=s+e/2,c=t,h=t+i;if(o&&e>1){if(s=this.align(s),a<=r){const u=this.align(a,r-a);a=this.align(a),r=a+u}else{const u=this.align(r,a-r);r=this.align(r),a=r+u}const d=this.align(e/2);n=s-d,l=s+d,c=this.align(t),h=c+this.align(c,i)}return{centerX:s,x0:n,x1:l,y0:c,y1:h,yOpen:a,yClose:r}}executeStroke(t,e){const{width:i,strokeWidth:o}=this;i0?l/this.strokeAlignment/2%1:0;t.clear(),t.moveTo(e-c,s),t.lineTo(e-c,a),Math.abs(o-i)>1&&(t.moveTo(i,r-c),t.lineTo(e-c,r-c),t.moveTo(e-c,n-c),t.lineTo(o,n-c))}};__decorateClass([SceneChangeDetection5()],OhlcNode.prototype,"strokeAlignment",2);var{SceneArrayChangeDetection:SceneArrayChangeDetection2,SceneChangeDetection:SceneChangeDetection6,ExtendedPath2D:ExtendedPath2D4,BBox:BBox12}=import_ag_charts_community120._ModuleSupport,CandlestickNode=class extends OhlcBaseNode{constructor(){super(...arguments),this.wickPath=new ExtendedPath2D4,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}computeDefaultGradientFillBBox(){const{width:t,centerX:e,yOpen:i,yClose:o}=this,s=Math.min(i,o),r=Math.max(i,o)-s,n=e-t/2,l=e+t/2;return new BBox12(n,s,l-n,r)}updatePath(){const{path:t,stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,wickStroke:r,wickStrokeWidth:n,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h}=this,{centerX:d,x0:u,x1:p,y0:g,y1:y,yOpen:f,yClose:x}=this.alignedCoordinates(),b=this.layerManager?.canvas.pixelRatio??1,m=this.wickStrokeAlignment>0?b/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const v=r!=null&&r!==e||n!=null&&n!==i||l!=null&&l!==o||c!=null&&c!==s||h!=null&&h!==a?this.wickPath:t;if(Math.abs(p-u)<=3){v.moveTo(d-m,g),v.lineTo(d-m,y);return}const M=Math.min(f,x),D=Math.max(f,x),k=i/2;v.moveTo(d-m,g),v.lineTo(d-m,M+k),v.moveTo(d-m,y),v.lineTo(d-m,D-k);const _=D-M-2*k;if(_>0)t.rect(u+k,M+k,p-u-2*k,_);else{const T=(M+D)/2;t.moveTo(u,T),t.lineTo(p,T)}}drawPath(t){super.drawPath(t);const{wickPath:e}=this;if(e.isEmpty())return;const{stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,wickStroke:n=i,wickStrokeWidth:l=o,wickStrokeOpacity:c=s,wickLineDash:h=a,wickLineDashOffset:d=r}=this;l!==0&&(t.globalAlpha*=c,typeof n=="string"&&(t.strokeStyle=n),t.lineWidth=l,h!=null&&t.setLineDash([...h]),t.lineDashOffset=d,t.stroke(e.getPath2D()))}};__decorateClass([SceneChangeDetection6()],CandlestickNode.prototype,"wickStroke",2),__decorateClass([SceneChangeDetection6()],CandlestickNode.prototype,"wickStrokeWidth",2),__decorateClass([SceneChangeDetection6()],CandlestickNode.prototype,"wickStrokeOpacity",2),__decorateClass([SceneArrayChangeDetection2()],CandlestickNode.prototype,"wickLineDash",2),__decorateClass([SceneChangeDetection6()],CandlestickNode.prototype,"wickLineDashOffset",2),__decorateClass([SceneChangeDetection6()],CandlestickNode.prototype,"wickStrokeAlignment",2);var import_ag_charts_community122=require("ag-charts-community"),import_ag_charts_community121=require("ag-charts-community"),{BaseProperties:BaseProperties16,Property:Property49,AbstractBarSeriesProperties:AbstractBarSeriesProperties2,makeSeriesTooltip:makeSeriesTooltip2}=import_ag_charts_community121._ModuleSupport,OhlcSeriesItem=class extends BaseProperties16{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([Property49],OhlcSeriesItem.prototype,"stroke",2),__decorateClass([Property49],OhlcSeriesItem.prototype,"strokeWidth",2),__decorateClass([Property49],OhlcSeriesItem.prototype,"strokeOpacity",2),__decorateClass([Property49],OhlcSeriesItem.prototype,"lineDash",2),__decorateClass([Property49],OhlcSeriesItem.prototype,"lineDashOffset",2);var OhlcSeriesItems=class extends BaseProperties16{constructor(){super(...arguments),this.up=new OhlcSeriesItem,this.down=new OhlcSeriesItem}};__decorateClass([Property49],OhlcSeriesItems.prototype,"up",2),__decorateClass([Property49],OhlcSeriesItems.prototype,"down",2);var OhlcSeriesBaseProperties=class extends AbstractBarSeriesProperties2{};__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"xKey",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"openKey",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"closeKey",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"highKey",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"lowKey",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"xName",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"yName",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"openName",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"closeName",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"highName",2),__decorateClass([Property49],OhlcSeriesBaseProperties.prototype,"lowName",2);var OhlcSeriesProperties=class extends OhlcSeriesBaseProperties{constructor(){super(...arguments),this.tooltip=makeSeriesTooltip2(),this.item=new OhlcSeriesItems}getStyle(t){const{strokeWidth:e,strokeOpacity:i,stroke:o,lineDash:s,lineDashOffset:a}=this.item[t];return{stroke:o,strokeWidth:e,strokeOpacity:i,lineDash:s,lineDashOffset:a,opacity:1}}};__decorateClass([Property49],OhlcSeriesProperties.prototype,"tooltip",2),__decorateClass([Property49],OhlcSeriesProperties.prototype,"item",2),__decorateClass([Property49],OhlcSeriesProperties.prototype,"itemStyler",2);var{BaseProperties:BaseProperties17,makeSeriesTooltip:makeSeriesTooltip3,Property:Property50}=import_ag_charts_community122._ModuleSupport,CandlestickSeriesWick=class extends BaseProperties17{};__decorateClass([Property50],CandlestickSeriesWick.prototype,"stroke",2),__decorateClass([Property50],CandlestickSeriesWick.prototype,"strokeWidth",2),__decorateClass([Property50],CandlestickSeriesWick.prototype,"strokeOpacity",2),__decorateClass([Property50],CandlestickSeriesWick.prototype,"lineDash",2),__decorateClass([Property50],CandlestickSeriesWick.prototype,"lineDashOffset",2);var CandlestickSeriesItem=class extends BaseProperties17{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new CandlestickSeriesWick}};__decorateClass([Property50],CandlestickSeriesItem.prototype,"fill",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"fillOpacity",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"stroke",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"strokeWidth",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"strokeOpacity",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"lineDash",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"lineDashOffset",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"cornerRadius",2),__decorateClass([Property50],CandlestickSeriesItem.prototype,"wick",2);var CandlestickSeriesItems=class extends BaseProperties17{constructor(){super(...arguments),this.up=new CandlestickSeriesItem,this.down=new CandlestickSeriesItem}};__decorateClass([Property50],CandlestickSeriesItems.prototype,"up",2),__decorateClass([Property50],CandlestickSeriesItems.prototype,"down",2);var CandlestickSeriesProperties=class extends OhlcSeriesBaseProperties{constructor(){super(),this.item=new CandlestickSeriesItems,this.tooltip=makeSeriesTooltip3(),this.highlightStyle.deprecated=!1}getStyle(t){const{fill:e,fillOpacity:i,strokeWidth:o,strokeOpacity:s,stroke:a,lineDash:r,lineDashOffset:n,cornerRadius:l,wick:c}=this.item[t];return{fill:e,fillOpacity:i,stroke:a,strokeWidth:o,strokeOpacity:s,lineDash:r,lineDashOffset:n,cornerRadius:l,opacity:1,wick:c}}};__decorateClass([Property50],CandlestickSeriesProperties.prototype,"item",2),__decorateClass([Property50],CandlestickSeriesProperties.prototype,"tooltip",2),__decorateClass([Property50],CandlestickSeriesProperties.prototype,"itemStyler",2);var{isGradientFill,isPatternFill,isImageFill,applyShapeStyle}=import_ag_charts_community123._ModuleSupport,CandlestickSeries=class extends OhlcSeriesBase{constructor(){super(...arguments),this.properties=new CandlestickSeriesProperties}nodeFactory(){const t=new CandlestickNode;return t.lineCap="butt",t}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getItemStyle(o.datumIndex,e,void 0,o.itemId)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i,properties:o}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:r}=o.item;t.each((n,l)=>{const{centerX:c,width:h,y:d,height:u,yOpen:p,yClose:g,crisp:y}=l,f=l.isRising?a:r,x=l.style??i.styles[l.itemId][this.getHighlightState(s,e,l.datumIndex)];n.centerX=c,n.width=h,n.y=d,n.height=u,n.yOpen=p,n.yClose=g,n.crisp=y,applyShapeStyle(n,x,this.getShapeFillBBox());const b=x?.wick;n.wickStroke=b?.stroke,n.wickStrokeWidth=b?.strokeWidth,n.wickStrokeOpacity=b?.strokeOpacity,n.wickLineDash=b?.lineDash,n.wickLineDashOffset=b?.lineDashOffset,n.wickStrokeAlignment=f.wick.strokeWidth??f.strokeWidth})}legendItemSymbol(){const{up:t,down:e}=this.properties.item,i=isGradientFill(t.fill)?t.fill.colorStops.map(r=>typeof r=="string"?r:{color:r.color,stop:r.stop==null?void 0:r.stop*.5}):[{color:isPatternFill(t.fill)||isImageFill(t.fill)?t.stroke:t.fill,stop:0},{color:isPatternFill(t.fill)||isImageFill(t.fill)?t.stroke:t.fill,stop:.5}],o=isGradientFill(e.fill)?e.fill.colorStops.map(r=>typeof r=="string"?r:{color:r.color,stop:r.stop==null?void 0:r.stop*.5}):[{color:isPatternFill(e.fill)||isImageFill(e.fill)?e.stroke:e.fill,stop:.5}],s={type:"gradient",gradient:"linear",rotation:90,colorStops:[...i,...o],reverse:!1},a={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:t.stroke,stop:0},{color:t.stroke,stop:.5},{color:e.stroke,stop:.5}],reverse:!1};return{marker:{fill:s,fillOpacity:t.fillOpacity,stroke:a,strokeWidth:t.strokeWidth??1,strokeOpacity:t.strokeOpacity??1,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset}}}getLegendData(t){const{id:e,data:i,visible:o,ctx:{legendManager:s}}=this,{xKey:a,yName:r,showInLegend:n,legendItemName:l}=this.properties;return!i?.data.length||!a||t!=="category"?[]:[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:o&&s.getItemEnabled({seriesId:e,itemId:e}),label:{text:l??r??e},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!n}]}hasItemStylers(){return this.properties.itemStyler!=null}};CandlestickSeries.className="CandleStickSeries",CandlestickSeries.type="candlestick";var import_ag_charts_community124=require("ag-charts-community"),import_ag_charts_core57=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs2,candlestickSeriesThemeableOptionsDef}=import_ag_charts_community124._ModuleSupport,candlestickSeriesOptionsDef={...commonSeriesOptionsDefs2,...candlestickSeriesThemeableOptionsDef,type:(0,import_ag_charts_core57.required)((0,import_ag_charts_core57.constant)("candlestick")),xKey:(0,import_ag_charts_core57.required)(import_ag_charts_core57.string),openKey:(0,import_ag_charts_core57.required)(import_ag_charts_core57.string),highKey:(0,import_ag_charts_core57.required)(import_ag_charts_core57.string),lowKey:(0,import_ag_charts_core57.required)(import_ag_charts_core57.string),closeKey:(0,import_ag_charts_core57.required)(import_ag_charts_core57.string),xName:import_ag_charts_core57.string,yName:import_ag_charts_core57.string,openName:import_ag_charts_core57.string,highName:import_ag_charts_core57.string,lowName:import_ag_charts_core57.string,closeName:import_ag_charts_core57.string};candlestickSeriesOptionsDef.pickOutsideVisibleMinorAxis=(0,import_ag_charts_core57.undocumented)(import_ag_charts_core57.boolean),candlestickSeriesOptionsDef.focusPriority=(0,import_ag_charts_core57.undocumented)(import_ag_charts_core57.number);var import_ag_charts_community125=require("ag-charts-community"),{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE2},multiSeriesHighlightStyle:multiSeriesHighlightStyle2,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS,FILL_IMAGE_DEFAULTS:FILL_IMAGE_DEFAULTS2,FILL_PATTERN_KEYED_DEFAULTS}=import_ag_charts_community125._ModuleSupport;function itemTheme(t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},t==="up"?"transparent":{$palette:"fill"},{$palette:`${t}.fill`}]},["gradient",FILL_GRADIENT_LINEAR_KEYED_DEFAULTS(t)],["image",FILL_IMAGE_DEFAULTS2],["pattern",FILL_PATTERN_KEYED_DEFAULTS(t)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${t}.stroke`}]}}}var CANDLESTICK_SERIES_THEME={series:{item:{up:itemTheme("up"),down:itemTheme("down")},highlightStyle:{item:{strokeWidth:3}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:multiSeriesHighlightStyle2()},animation:{enabled:!1},axes:{[CARTESIAN_AXIS_TYPE2.NUMBER]:{crosshair:{snap:!1}},[CARTESIAN_AXIS_TYPE2.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE3,CARTESIAN_POSITION}=import_ag_charts_community126._ModuleSupport.ThemeConstants,CandlestickModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:t=>new CandlestickSeries(t),defaultAxes:[{type:CARTESIAN_AXIS_TYPE3.NUMBER,position:CARTESIAN_POSITION.LEFT},{type:CARTESIAN_AXIS_TYPE3.ORDINAL_TIME,position:CARTESIAN_POSITION.BOTTOM}],themeTemplate:CANDLESTICK_SERIES_THEME,groupable:!1},CandlestickSeriesModule={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:candlestickSeriesOptionsDef,create:t=>new CandlestickSeries(t)},import_ag_charts_community132=require("ag-charts-community"),import_ag_charts_community129=require("ag-charts-community"),import_ag_charts_core59=require("ag-charts-core"),import_ag_charts_core58=require("ag-charts-core");function generateLabelSecondaryLabelFontSizeCandidates(t,e){const{fontSize:i,minimumFontSize:o=i}=t,{fontSize:s,minimumFontSize:a=s}=e,r=i-o,n=s-a;let l=t.fontSize,c=e.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:s}];for(;l>o||c>a;){const d=r>0?(l-o)/r:-1,u=n>0?(c-a)/n:-1;d>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function formatStackedLabels(t,e,i,o,{padding:s},a){const{spacing:r=0}=e,n=2*s,l=2*s+r,c=(e.minimumFontSize??e.fontSize)+(o.minimumFontSize??o.fontSize);if(c>a(c+l,!1).height-l)return;const h=generateLabelSecondaryLabelFontSizeCandidates(e,o),d={fontFamily:e.fontFamily,fontStyle:e.fontStyle,fontWeight:e.fontWeight},u={fontFamily:o.fontFamily,fontStyle:o.fontStyle,fontWeight:o.fontWeight};let p,g;return(0,import_ag_charts_core58.findMaxValue)(0,h.length-1,y=>{const{labelFontSize:f,secondaryLabelFontSize:x}=h[y],b=y===0,m={...d,fontSize:f},S={...u,fontSize:x},v=(0,import_ag_charts_core58.cachedTextMeasurer)(m).lineHeight(),M=(0,import_ag_charts_core58.cachedTextMeasurer)(S).lineHeight(),D=a(v+M+l,b),k=D.width-n,_=D.height-l;if(v+M>_||((p==null||p.fontSize!==f)&&(p=wrapLabel(e,t,k,_,m,e.wrapping,b?e.overflowStrategy:"hide")),p==null||p.width>k||p.height>_)||((g==null||g.fontSize!==x)&&(g=wrapLabel(o,i,k,_,S,o.wrapping,b?o.overflowStrategy:"hide")),g==null))return;const T=p.height+g.height;if(!(g.width>k||T>_))return{width:Math.max(p.width,g.width),height:T+r,meta:D.meta,label:p,secondaryLabel:g}})}function formatSingleLabel(t,e,{padding:i},o){const s=2*i,a=Math.min(e.minimumFontSize??e.fontSize,e.fontSize),r={fontFamily:e.fontFamily,fontStyle:e.fontStyle,fontWeight:e.fontWeight};return(0,import_ag_charts_core58.findMaxValue)(a,e.fontSize,n=>{const l={...r,fontSize:n},c=(0,import_ag_charts_core58.cachedTextMeasurer)(l),h=n===a,d=e.lineHeight??c.lineHeight(),u=o(d+s,h),p=u.width-s,g=u.height-s;if(d>g||p<0)return;const y=(0,import_ag_charts_core58.wrapLines)(t,{maxWidth:p,maxHeight:g,font:l,textWrap:e.wrapping,overflow:(h?e.overflowStrategy:null)??"hide"});if(!y.length)return;const{width:f,height:x}=c.measureLines(y),b=y.join(`
+`);return[{width:f,height:x,text:b,fontSize:n,lineHeight:d},u.meta]})}function hasInvalidFontSize(t){return t?.minimumFontSize!=null&&t?.fontSize!=null&&t?.minimumFontSize>t?.fontSize}function formatLabels(t,e,i,o,s,a){const r=e.enabled?t:void 0,n=o.enabled?i:void 0;(hasInvalidFontSize(e)||hasInvalidFontSize(o))&&import_ag_charts_core58.Logger.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;r!=null&&n!=null&&(l=formatStackedLabels(r,e,n,o,s,a));let c;if(l==null&&r!=null&&(c=formatSingleLabel(r,e,s,a)),c!=null){const[d,u]=c;l={width:d.width,height:d.height,meta:u,label:d,secondaryLabel:void 0}}let h;if(l==null&&r==null&&n!=null&&(h=formatSingleLabel(n,o,s,a)),h!=null){const[d,u]=h;l={width:d.width,height:d.height,meta:u,label:void 0,secondaryLabel:d}}return l}function wrapLabel(t,e,i,o,s,a,r){const n=(0,import_ag_charts_core58.wrapLines)(e,{maxWidth:i,maxHeight:o,font:s,textWrap:a,overflow:r});if(!n.length)return;const l=(0,import_ag_charts_core58.cachedTextMeasurer)(s),c=t.lineHeight??l.lineHeight(),{width:h}=l.measureLines(n);return{width:h,lineHeight:c,text:n.join(`
+`),height:n.length*c,fontSize:s.fontSize}}var import_ag_charts_community128=require("ag-charts-community"),import_ag_charts_community127=require("ag-charts-community"),{Property:Property51}=import_ag_charts_community127._ModuleSupport,BaseAutoSizedLabel=class extends import_ag_charts_community127._ModuleSupport.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};__decorateClass([Property51],BaseAutoSizedLabel.prototype,"wrapping",2),__decorateClass([Property51],BaseAutoSizedLabel.prototype,"overflowStrategy",2),__decorateClass([Property51],BaseAutoSizedLabel.prototype,"lineHeight",2),__decorateClass([Property51],BaseAutoSizedLabel.prototype,"minimumFontSize",2);var AutoSizedLabel=class extends BaseAutoSizedLabel{constructor(){super(...arguments),this.spacing=0}};__decorateClass([Property51],AutoSizedLabel.prototype,"spacing",2);var AutoSizedSecondaryLabel=class extends BaseAutoSizedLabel{},{CartesianSeriesProperties,makeSeriesTooltip:makeSeriesTooltip4,Property:Property52}=import_ag_charts_community128._ModuleSupport,HeatmapSeriesProperties=class extends CartesianSeriesProperties{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new AutoSizedLabel,this.tooltip=makeSeriesTooltip4()}};__decorateClass([Property52],HeatmapSeriesProperties.prototype,"title",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"xKey",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"yKey",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"colorKey",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"xName",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"yName",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"colorName",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"colorRange",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"stroke",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"textAlign",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"verticalAlign",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"itemPadding",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"label",2),__decorateClass([Property52],HeatmapSeriesProperties.prototype,"tooltip",2);var{SeriesNodePickMode:SeriesNodePickMode3,computeBarFocusBounds:computeBarFocusBounds3,getMissCount,valueProperty:valueProperty5,ChartAxisDirection:ChartAxisDirection15,DEFAULT_CARTESIAN_DIRECTION_KEYS,DEFAULT_CARTESIAN_DIRECTION_NAMES,createDatumId:createDatumId3,ColorScale,Rect,PointerEvents,applyShapeStyle:applyShapeStyle2,mergeDefaults:mergeDefaults6,formatValue,addHitTestersToQuadtree,findQuadtreeMatch,updateLabelNode}=import_ag_charts_community129._ModuleSupport,HeatmapSeriesNodeEvent=class extends import_ag_charts_community129._ModuleSupport.CartesianSeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.colorKey=o.properties.colorKey}},textAlignFactors={left:-.5,center:0,right:-.5},verticalAlignFactors={top:-.5,middle:0,bottom:-.5},HeatmapSeries=class extends import_ag_charts_community129._ModuleSupport.CartesianSeries{constructor(t){super({moduleCtx:t,propertyKeys:{...DEFAULT_CARTESIAN_DIRECTION_KEYS,color:["colorKey"]},propertyNames:{...DEFAULT_CARTESIAN_DIRECTION_NAMES,color:["colorName"]},categoryKey:void 0,pickModes:[SeriesNodePickMode3.NEAREST_NODE,SeriesNodePickMode3.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new HeatmapSeriesProperties,this.NodeEvent=HeatmapSeriesNodeEvent,this.colorScale=new ColorScale}async processData(t){const e=this.axes[ChartAxisDirection15.X],i=this.axes[ChartAxisDirection15.Y];if(!e||!i||!this.data?.data.length)return;const{xKey:o,yKey:s,colorRange:a,colorKey:r}=this.properties,n=this.axes[ChartAxisDirection15.X]?.scale,l=this.axes[ChartAxisDirection15.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:n,yScale:l}),d=this.colorScale.type,{dataModel:u,processedData:p}=await this.requestDataModel(t,this.data,{props:[valueProperty5(o,c,{id:"xValue"}),valueProperty5(s,h,{id:"yValue"}),...r?[valueProperty5(r,d,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const g=u.resolveProcessedDataIndexById(this,"colorValue"),y=p.domain.values[g].filter(x=>x!=null),f=import_ag_charts_community129._ModuleSupport.extent(y);if(this.colorScale.domain=f??[],f?.length&&f[0]===f[1]){const x=Math.floor(a.length/2);this.colorScale.range=[a[x],a[x]]}else this.colorScale.range=a;this.colorScale.update()}}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=getMissCount(this,i.defs.values[o].missing),r=e.resolveProcessedDataIndexById(this,"colorValue"),n=i.domain.values[r].filter(c=>c!=null).length;return!(s===0||s===a||n===0)}xCoordinateRange(t,e){const i=this.axes[ChartAxisDirection15.X].scale,o=e*(i.bandwidth??0)/2,s=i.convert(t)+o,a=e*(i.bandwidth??10);return[s,s+a]}yCoordinateRange(t,e){const i=this.axes[ChartAxisDirection15.Y].scale,o=e*(i.bandwidth??0)/2,s=i.convert(t[0])+o,a=e*(i.bandwidth??10);return[s,s+a]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;return!e||!i?[]:t===ChartAxisDirection15.X?e.getDomain(this,"xValue","value",i):e.getDomain(this,"yValue","value",i)}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}createNodeData(){const{data:t,visible:e,axes:i,dataModel:o,processedData:s}=this,a=i[ChartAxisDirection15.X],r=i[ChartAxisDirection15.Y];if(!(t&&o&&s&&e&&a&&r))return;if(a.type!=="category"||r.type!=="category"){import_ag_charts_core59.Logger.warnOnce(`Heatmap series expected axes to have "category" type, but received "${a.type}" and "${r.type}" instead.`);return}const{xKey:n,xName:l,yKey:c,yName:h,colorKey:d,colorName:u,textAlign:p,verticalAlign:g,itemPadding:y,label:f}=this.properties,x=o.resolveColumnById(this,"xValue",s),b=o.resolveColumnById(this,"yValue",s),m=d?o.resolveColumnById(this,"colorValue",s):void 0,S=d?o.getDomain(this,"colorValue","value",s):[],v=a.scale,M=r.scale,D=(v.bandwidth??0)/2,k=(M.bandwidth??0)/2,_=[],T=[],w=v.bandwidth??10,R=M.bandwidth??10,F=(w-2*y)*textAlignFactors[p],O=(R-2*y)*verticalAlignFactors[g],E=()=>({width:w,height:R,meta:null}),I=s.dataSources.get(this.id)?.data??[];for(const[C,L]of I.entries()){const A=x[C],P=b[C],z=v.convert(A)+D,B=M.convert(P)+k,V=m?.[C],W=f.enabled&&V!=null?this.getLabelText(V,L,d,"color",S,f,{value:V,datum:L,colorKey:d,colorName:u,xKey:n,yKey:c,xName:l,yName:h}):void 0,H=formatLabels((0,import_ag_charts_core59.toPlainText)(W),this.properties.label,void 0,this.properties.label,{padding:y},E),G={x:z,y:B,size:0},K=this.getItemStyle({datumIndex:C,datum:L,colorValue:V},!1);if(_.push({series:this,itemId:c,datumIndex:C,yKey:c,xKey:n,xValue:A,yValue:P,colorValue:V,datum:L,point:G,width:w,height:R,midPoint:{x:z,y:B},missing:m!=null&&V==null,style:K}),H?.label!=null){const{text:U,fontSize:Y,lineHeight:$,height:X}=H.label,{fontStyle:Z,fontFamily:q,fontWeight:it,color:J}=this.properties.label,j=G.x+F*(w-2*y),tt=G.y+O*(R-2*y)-(H.height-X)*.5;T.push({series:this,itemId:c,datum:L,datumIndex:C,text:U,fontSize:Y,lineHeight:$,fontStyle:Z,fontFamily:q,fontWeight:it,color:J,textAlign:p,textBaseline:g,x:j,y:tt,style:K})}}return{itemId:this.properties.yKey??this.id,nodeData:_,labelData:T,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new Rect}update(t){return this.ctx.animationManager.skipCurrentBatch(),super.update(t)}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,o=e??[];return i.update(o)}getItemStyle({datumIndex:t,datum:e,colorValue:i},o){const{properties:s}=this,{itemStyler:a,stroke:r,strokeWidth:n,strokeOpacity:l}=s,c=this.getHighlightStyle(o,t),h=mergeDefaults6(c,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:r,strokeWidth:n,strokeOpacity:l,opacity:1});let d;return a!=null&&t!=null&&(d=this.cachedDatumCallback(createDatumId3(t,o?"highlight":"node"),()=>{const u=this.makeItemStylerParams(e,t,o,h);return this.callWithContext(a,u)})),d?mergeDefaults6(d,h):h}makeItemStylerParams(t,e,i,o){const{id:s,properties:a}=this,{xKey:r,yKey:n}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,e),h=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:t,xKey:r,yKey:n,highlighted:i,highlightState:c,...o,fill:h}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getItemStyle(o,e)})}updateDatumNodes({datumSelection:t}){const e=this.axes[ChartAxisDirection15.X],[i,o]=e?.visibleRange??[],a=!(i!==0||o!==1);t.each((r,n)=>{const{point:l,width:c,height:h,style:d}=n;applyShapeStyle2(r,d),r.crisp=a,r.x=Math.floor(l.x-c/2),r.y=Math.floor(l.y-h/2),r.width=Math.ceil(c),r.height=Math.ceil(h)})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t,{enabled:o}=this.properties.label,s=o?e:[];return i.update(s)}updateLabelNodes(t){const e=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((i,o)=>{i.pointerEvents=PointerEvents.None,i.text=o.text,i.fillOpacity=this.getHighlightStyle(!1,o.datumIndex)?.opacity??1,updateLabelNode(this,i,this.properties,this.properties.label,o,!1,e)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:a,colorScale:r,ctx:n}=this,{formatManager:l}=n,{xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:g,colorRange:y,title:f,legendItemName:x,tooltip:b}=a,m=s[ChartAxisDirection15.X],S=s[ChartAxisDirection15.Y];if(!i||!o||!m||!S)return;const v=o.dataSources.get(this.id)?.data[t],M=i.resolveColumnById(this,"xValue",o)[t],D=i.resolveColumnById(this,"yValue",o)[t],k=p!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",o)[t]:void 0;if(M==null)return;const _=[];let T;if(k==null)T=y[0];else{T=r.convert(k);const F=i.getDomain(this,"colorValue","value",o),O=l.format(this.callWithContext.bind(this),{type:"number",value:k,datum:v,seriesId:e,legendItemName:x,key:p,source:"tooltip",property:"color",domain:F,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0});_.push({label:g,fallbackLabel:p,value:O??formatValue(k)})}_.push({label:h,fallbackLabel:c,value:this.getAxisValueText(m,"tooltip",M,v,c,x)},{label:u,fallbackLabel:d,value:this.getAxisValueText(S,"tooltip",D,v,d,x)});const w=this.getItemStyle({datumIndex:t,datum:v,colorValue:k},!1);w.fill!=null&&(T=w.fill);const R=T==null?void 0:{marker:{shape:"square",fill:T,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(b,{title:f??x,symbol:R,data:_},{seriesId:e,datum:v,title:f,xKey:c,xName:h,yKey:d,yName:u,colorKey:p,colorName:g,...w})}getLegendData(t){return t!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t];if(e===void 0)return;const{width:i,height:o,midPoint:s}=e,a={x:s.x-i/2,y:s.y-o/2,width:i,height:o};return computeBarFocusBounds3(this,a)}initQuadTree(t){addHitTestersToQuadtree(t,this.datumNodesIter())}pickNodesExactShape(t){const e=findQuadtreeMatch(this,t);return e!=null&&e.distance<=0?[e.datum]:[]}pickNodeClosestDatum(t){return findQuadtreeMatch(this,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};HeatmapSeries.className="HeatmapSeries",HeatmapSeries.type="heatmap";var import_ag_charts_community130=require("ag-charts-community"),import_ag_charts_core60=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs3,heatmapSeriesThemeableOptionsDef,without}=import_ag_charts_community130._ModuleSupport,heatmapSeriesOptionsDef={...without(heatmapSeriesThemeableOptionsDef,["showInLegend"]),...without(commonSeriesOptionsDefs3,["showInLegend"]),type:(0,import_ag_charts_core60.required)((0,import_ag_charts_core60.constant)("heatmap")),xKey:(0,import_ag_charts_core60.required)(import_ag_charts_core60.string),yKey:(0,import_ag_charts_core60.required)(import_ag_charts_core60.string),colorKey:import_ag_charts_core60.string,xName:import_ag_charts_core60.string,yName:import_ag_charts_core60.string,colorName:import_ag_charts_core60.string,colorRange:(0,import_ag_charts_core60.arrayOf)(import_ag_charts_core60.color)},import_ag_charts_community131=require("ag-charts-community"),HEATMAP_SERIES_THEME={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},import_ag_charts_community131._ModuleSupport.SAFE_RANGE2_OPERATION]},label:{...import_ag_charts_community131._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:import_ag_charts_community131._ModuleSupport.singleSeriesHighlightStyle()},gradientLegend:{enabled:!0,...import_ag_charts_community131._ModuleSupport.LEGEND_CONTAINER_THEME}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE4,CARTESIAN_POSITION:CARTESIAN_POSITION2}}=import_ag_charts_community132._ModuleSupport,HeatmapModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:t=>new HeatmapSeries(t),defaultAxes:[{type:CARTESIAN_AXIS_TYPE4.CATEGORY,position:CARTESIAN_POSITION2.LEFT},{type:CARTESIAN_AXIS_TYPE4.CATEGORY,position:CARTESIAN_POSITION2.BOTTOM}],themeTemplate:HEATMAP_SERIES_THEME},HeatmapSeriesModule={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:heatmapSeriesOptionsDef,create:t=>new HeatmapSeries(t)},import_ag_charts_community135=require("ag-charts-community"),import_ag_charts_community133=require("ag-charts-community"),{applyShapeStyle:applyShapeStyle3}=import_ag_charts_community133._ModuleSupport,OhlcSeries=class extends OhlcSeriesBase{constructor(){super(...arguments),this.properties=new OhlcSeriesProperties}nodeFactory(){const t=new OhlcNode;return t.lineCap="square",t}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getItemStyle(o.datumIndex,e,void 0,o.itemId)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i,properties:o}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:r}=o.item;t.each((n,l)=>{const{centerX:c,width:h,y:d,height:u,yOpen:p,yClose:g,crisp:y}=l,f=l.isRising?a:r;n.centerX=c,n.width=h,n.y=d,n.height=u,n.yOpen=p,n.yClose=g,n.crisp=y;const x=l.style??i.styles[l.itemId][this.getHighlightState(s,e,l.datumIndex)];applyShapeStyle3(n,x),n.strokeAlignment=f.strokeWidth})}getLegendData(t){const{id:e,data:i,ctx:{legendManager:o},visible:s}=this,{xKey:a,yName:r,item:{up:n,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.data.length||!a||t!=="category")return[];const d={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:n.stroke,stop:0},{color:n.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:e,itemId:e,seriesId:e,enabled:s&&o.getItemEnabled({seriesId:e,itemId:e}),label:{text:h??r??e},symbol:{marker:{fill:d,fillOpacity:n.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};OhlcSeries.className="ohlc",OhlcSeries.type="ohlc";var import_ag_charts_community134=require("ag-charts-community"),import_ag_charts_core61=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs4,ohlcSeriesThemeableOptionsDef}=import_ag_charts_community134._ModuleSupport,ohlcSeriesOptionsDef={...commonSeriesOptionsDefs4,...ohlcSeriesThemeableOptionsDef,type:(0,import_ag_charts_core61.required)((0,import_ag_charts_core61.constant)("ohlc")),xKey:(0,import_ag_charts_core61.required)(import_ag_charts_core61.string),openKey:(0,import_ag_charts_core61.required)(import_ag_charts_core61.string),highKey:(0,import_ag_charts_core61.required)(import_ag_charts_core61.string),lowKey:(0,import_ag_charts_core61.required)(import_ag_charts_core61.string),closeKey:(0,import_ag_charts_core61.required)(import_ag_charts_core61.string),xName:import_ag_charts_core61.string,yName:import_ag_charts_core61.string,openName:import_ag_charts_core61.string,highName:import_ag_charts_core61.string,lowName:import_ag_charts_core61.string,closeName:import_ag_charts_core61.string};ohlcSeriesOptionsDef.pickOutsideVisibleMinorAxis=(0,import_ag_charts_core61.undocumented)(import_ag_charts_core61.boolean),ohlcSeriesOptionsDef.focusPriority=(0,import_ag_charts_core61.undocumented)(import_ag_charts_core61.number);var{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE5,CARTESIAN_POSITION:CARTESIAN_POSITION3},multiSeriesHighlightStyle:multiSeriesHighlightStyle3}=import_ag_charts_community135._ModuleSupport,OhlcModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:t=>new OhlcSeries(t),defaultAxes:[{type:CARTESIAN_AXIS_TYPE5.NUMBER,position:CARTESIAN_POSITION3.LEFT},{type:CARTESIAN_AXIS_TYPE5.ORDINAL_TIME,position:CARTESIAN_POSITION3.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:multiSeriesHighlightStyle3(!1)},axes:{[CARTESIAN_AXIS_TYPE5.NUMBER]:{crosshair:{snap:!1}},[CARTESIAN_AXIS_TYPE5.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},OhlcSeriesModule={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:ohlcSeriesOptionsDef,create:t=>new OhlcSeries(t)},import_ag_charts_community143=require("ag-charts-community"),import_ag_charts_community140=require("ag-charts-community"),import_ag_charts_community136=require("ag-charts-community"),{AGGREGATION_INDEX_Y_MAX:AGGREGATION_INDEX_Y_MAX2,AGGREGATION_INDEX_Y_MIN:AGGREGATION_INDEX_Y_MIN2,aggregationDomain:aggregationDomain2,aggregationIndexForXRatio,aggregationRangeFittingPoints:aggregationRangeFittingPoints2,aggregationXRatioForXValue,compactAggregationIndices:compactAggregationIndices2,createAggregationIndices:createAggregationIndices2}=import_ag_charts_community136._ModuleSupport,AGGREGATION_THRESHOLD2=1e3;function aggregationContainsTopIndex(t,e,i,o,s,a,r){const n=t[a];if(n==null)return!1;const l=aggregationXRatioForXValue(n,e,i,r),c=aggregationIndexForXRatio(l,s);return a===o[c+AGGREGATION_INDEX_Y_MAX2]}function aggregationContainsBottomIndex(t,e,i,o,s,a,r){const n=t[a];if(n==null)return!1;const l=aggregationXRatioForXValue(n,e,i,r),c=aggregationIndexForXRatio(l,s);return a===o[c+AGGREGATION_INDEX_Y_MIN2]}function aggregateRangeAreaData(t,e,i,o,s,a,r){if(e.length64;)({maxRange:c}=compactAggregationIndices2(h,d,c,{inPlace:!0})),u=u.filter(y=>aggregationContainsTopIndex(e,n,l,h,c,y,a)),p=p.filter(y=>aggregationContainsBottomIndex(e,n,l,h,c,y,a)),g.push({maxRange:c,topIndices:u,bottomIndices:p});return g.reverse(),g}var import_ag_charts_community137=require("ag-charts-community");function getYValueAtX({span:t},e){switch(t.type){case"linear":case"step":case"multi-line":{const i=(e-t.x0)/(t.x1-t.x0);return t.y0+i*(t.y1-t.y0)}case"cubic":{const{cp0x:i,cp0y:o,cp1x:s,cp1y:a,cp2x:r,cp2y:n,cp3x:l,cp3y:c}=t;let h=.5;const d=1e-6;for(let p=0;p<10;p++){const g=1-h,f=g*g*g*i+3*g*g*h*s+3*g*h*h*r+h*h*h*l-e;if(Math.abs(f)=a.x&&e<=r.x)return{span:s,index:o};if(el;return{intersection:o===c?null:{x:i,y:n},spanIndex:a.index,isInverted:c}}function findRangeAreaIntersections(t,e,i,o,s=!1){if(t.length===0||e.length===0)return[];const a=[];let r=s,n=0;for(let l=i;l<=o;l+=.5){const c=checkForIntersection(t,e,l,r,n);c.intersection&&a.push(c.intersection.x),n=c.spanIndex,r=c.isInverted}return a}function calculateIntersectionSegments(t,e,i,o,s={}){const a=Math.max(e.x,i.width-(e.x+e.width)),r=Math.max(e.y,i.height-(e.y+e.height)),n=[],l=(h,d)=>({x0:h,y0:-r,x1:d,y1:e.height+r});o&&n.push({clipRect:l(-a,t[0]??e.width+a),...s});const c=o?1:0;for(let h=c;h{plotInterpolatedLinePathStroke(l,c,e.removed),plotInterpolatedLinePathStroke(l,c,i.removed)},a=(l,c)=>{plotInterpolatedLinePathStroke(l,c,e.moved),plotInterpolatedLinePathStroke(l,c,i.moved)},r=(l,c)=>{plotInterpolatedLinePathStroke(l,c,e.added),plotInterpolatedLinePathStroke(l,c,i.added)},n=prepareLinePathPropertyAnimation(t,o);return{status:t,path:{addPhaseFn:r,updatePhaseFn:a,removePhaseFn:s},pathProperties:n}}function prepareRangeAreaPathAnimation(t,e,i){const o=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(o!==s||!isScaleValid(t.scales.x)||!isScaleValid(e.scales.x))return;let a="updated";e.visible&&!t.visible?a="removed":!e.visible&&t.visible&&(a="added");const r=pairUpSpans({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},CollapseMode.Split);if(r==null)return;const n=pairUpSpans({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},CollapseMode.Split);if(n==null)return;const l=pairUpSpans({scales:t.scales,data:t.highStrokeData.spans},{scales:e.scales,data:e.highStrokeData.spans},CollapseMode.Split);if(l==null)return;const c=pairUpSpans({scales:t.scales,data:t.lowStrokeData.spans},{scales:e.scales,data:e.lowStrokeData.spans},CollapseMode.Split);if(c==null)return;const h="fade",d=prepareAreaFillAnimationFns(a,r,n,h),u=prepareRangeAreaPathStrokeAnimationFns(a,l,c,h),p=(i?.changed??!0)||!areScalingEqual(t.scales.x,e.scales.x)||!areScalingEqual(t.scales.y,e.scales.y)||a!=="updated";return{status:a,fill:d,stroke:u,hasMotion:p}}var{valueProperty:valueProperty6,keyProperty:keyProperty4,ChartAxisDirection:ChartAxisDirection16,mergeDefaults:mergeDefaults7,updateLabelNode:updateLabelNode2,fixNumericExtent:fixNumericExtent4,buildResetPathFn,resetLabelFn,resetMarkerFn,resetMarkerPositionFn,pathSwipeInAnimation,resetMotion,markerSwipeScaleInAnimation,seriesLabelFadeInAnimation,animationValidation:animationValidation3,diff:diff3,updateClipPath,computeMarkerFocusBounds,plotAreaPathFill,plotLinePathStroke,interpolatePoints,pathFadeInAnimation,markerFadeInAnimation,fromToMotion,pathMotion,extent,applyShapeFillBBox:applyShapeFillBBox2,PointerEvents:PointerEvents2,Marker,BBox:BBox13,findMinMax:findMinMax2,applyShapeStyle:applyShapeStyle4,processedDataIsAnimatable:processedDataIsAnimatable2,simpleMemorize2:simpleMemorize22,markerEnabled,getMarkerStyles,calculateSegments:calculateSegments2,toHighlightString:toHighlightString2,HighlightState:HighlightState2}=import_ag_charts_community140._ModuleSupport,memoizedAggregateRangeAreaData=simpleMemorize22(aggregateRangeAreaData),RangeAreaSeriesNodeEvent=class extends import_ag_charts_community140._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.xKey,this.yLowKey=o.properties.yLowKey,this.yHighKey=o.properties.yHighKey}},BaseSeries=import_ag_charts_community140._ModuleSupport.CartesianSeries,RangeAreaSeries=class extends BaseSeries{constructor(t){super({moduleCtx:t,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[import_ag_charts_community140._ModuleSupport.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[ChartAxisDirection16.X]:["xKey"],[ChartAxisDirection16.Y]:["yLowKey","yHighKey"]},propertyNames:{[ChartAxisDirection16.X]:["xName"],[ChartAxisDirection16.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:buildResetPathFn({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:resetLabelFn,datum:(e,i)=>({...resetMarkerFn(e),...resetMarkerPositionFn(e,i)})},clipFocusBox:!1}),this.properties=new RangeAreaProperties,this.NodeEvent=RangeAreaSeriesNodeEvent,this.dataAggregationFilters=void 0}async processData(t){const{xKey:e,yLowKey:i,yHighKey:o}=this.properties,s=this.axes[ChartAxisDirection16.X]?.scale,a=this.axes[ChartAxisDirection16.Y]?.scale,{xScaleType:r,yScaleType:n}=this.getScaleInformation({xScale:s,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(diff3(this.id,this.processedData)),c&&l.push(animationValidation3());const{dataModel:h,processedData:d}=await this.requestDataModel(t,this.data,{props:[keyProperty4(e,r,{id:"xValue"}),valueProperty6(i,n,{id:"yLowValue"}),valueProperty6(o,n,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,d),this.animationState.transition("updateData")}aggregateData(t,e){if(e.type!=="ungrouped"||processedDataIsAnimatable2(e))return;const i=this.axes[ChartAxisDirection16.X];if(i==null)return;const o=t.resolveKeysById(this,"xValue",e),s=t.resolveColumnById(this,"yHighValue",e),a=t.resolveColumnById(this,"yLowValue",e),{index:r}=t.resolveProcessedDataDefById(this,"xValue"),n=e.domain.keys[r],l=t.resolveColumnNeedsValueOf(this,"xValue",e),c=t.resolveColumnNeedsValueOf(this,"yHighValue",e);return memoizedAggregateRangeAreaData(i.scale.type,o,s,a,n,l,c)}xCoordinateRange(t){const e=this.axes[ChartAxisDirection16.X].scale.convert(t);return[e,e]}yCoordinateRange(t){const e=this.axes[ChartAxisDirection16.Y].scale.convert(t[0]);return[e,e]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!(e&&i))return[];const{domain:{keys:[o]}}=e;if(t===ChartAxisDirection16.X){const s=i.resolveProcessedDataDefById(this,"xValue");return s?.def.type==="key"&&s.def.valueType==="category"?o:fixNumericExtent4(extent(o))}else{const s=this.domainForClippedRange(ChartAxisDirection16.Y,["yHighValue","yLowValue"],"xValue"),a=findMinMax2(s);return fixNumericExtent4(a)}}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection16.Y,["yHighValue","yLowValue"],"xValue",e)}createNodeData(){const{data:t,dataModel:e,processedData:i,axes:o}=this,s=o[ChartAxisDirection16.X],a=o[ChartAxisDirection16.Y];if(!(t&&s&&a&&e&&i&&this.chart?.seriesRect))return;const r=s.scale,n=a.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:d,interpolation:u,fill:p,fillOpacity:g,item:y}=this.properties,f=i.dataSources.get(this.id)?.data??[],x=(r.bandwidth??0)/2,b=e.resolveKeysById(this,"xValue",i),m=e.resolveColumnById(this,"yHighValue",i),S=e.resolveColumnById(this,"yLowValue",i),v=H=>r.convert(b[H])+x,M=[],D=[],k=[],_=(H,G,K)=>{const U=f[H],Y=b[H];if(Y==null)return;const $=k.at(-1);if(Number.isFinite(G)&&Number.isFinite(K)){const X=(tt,Q,ot)=>{const{size:et}=y[tt].marker;D.push({index:H,series:this,itemId:tt,datum:U,datumIndex:H,midPoint:{x:q,y:ot},yHighValue:G,yLowValue:K,xValue:Y,xKey:l,yLowKey:c,yHighKey:h,point:{x:q,y:ot,size:et},enabled:!0});const st=this.createLabelData({datumIndex:H,point:{x:q,y:ot},value:Q,yLowValue:K,yHighValue:G,itemId:tt,inverted:Z,datum:U,series:this});M.push(st)},Z=K>G,q=v(H),it=n.convert(G),J=n.convert(K);X("high",G,it),X("low",K,J);const j={high:{point:{x:q,y:it},xDatum:Y,yDatum:G},low:{point:{x:q,y:J},xDatum:Y,yDatum:K}};Array.isArray($)?$.push(j):$==null?k.push([j]):($.skip+=1,k.push([j]))}else d||(Array.isArray($)||$==null?k.push({skip:0}):$.skip+=1)},{dataAggregationFilters:T}=this,[w,R]=r.range,F=Math.abs(R-w),O=T?.find(H=>H.maxRange>F),E=O?.topIndices,I=O?.bottomIndices;let[C,L]=this.visibleRangeIndices("xValue",s.range,E);C=Math.max(C-1,0),L=Math.min(L+1,E?.length??b.length),i.input.count<1e3&&(C=0,L=i.input.count);for(let H=C;H{if(!Array.isArray(H))return[];const G=H.map(K=>K.high);return interpolatePoints(G,u)}),P=k.flatMap(H=>{if(!Array.isArray(H))return[];const G=H.map(K=>K.low);return interpolatePoints(G,u)}),z=calculateSegments2(this.properties.segmentation,s,a,this.chart.seriesRect,this.ctx.scene,!1);let B;if(this.properties.invertedStyle.enabled){const H=m[0]{const G=y[H],{stroke:K,strokeWidth:U,strokeOpacity:Y}=G,$={fill:p,fillOpacity:g,stroke:K,strokeWidth:U,strokeOpacity:Y};return getMarkerStyles(this,G,G.marker,$)};return{itemId:`${c}-${h}`,labelData:M,nodeData:D,fillData:{itemId:"high",spans:A,phantomSpans:P},highStrokeData:{itemId:"high",spans:A},lowStrokeData:{itemId:"low",spans:P},scales:this.calculateScaling(),visible:this.visible,styles:{low:V("low"),high:V("high")},segments:z,intersectionSegments:B}}createLabelData({datumIndex:t,point:e,value:i,itemId:o,inverted:s,datum:a,series:r}){const{xKey:n,yLowKey:l,yHighKey:c,xName:h,yName:d,yLowName:u,yHighName:p,legendItemName:g,label:y}=this.properties,{placement:f}=y,x=y.spacing+(typeof y.padding=="number"?y.padding:0);let b=o;s&&(b=o==="low"?"high":"low");const m=f==="outside"&&b==="high"||f==="inside"&&b==="low"?-1:1,S=this.getSeriesDomain(ChartAxisDirection16.Y);return{x:e.x,y:e.y+x*m,series:r,itemId:o,datum:a,datumIndex:t,text:this.getLabelText(i,a,o==="high"?c:l,"y",S,y,{value:i,datum:a,itemId:o,xKey:n,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:p,yName:d,legendItemName:g}),textAlign:"center",textBaseline:m===-1?"bottom":"top"}}isPathOrSelectionDirty(){const{low:t,high:e}=this.properties.item;return t.marker.isDirty()||e.marker.isDirty()}strokewidthChange(){const t=e=>{const i=this.properties.item[e].strokeWidth??0,o=this.properties.highlight.highlightedSeries.item?.[e]?.strokeWidth??i,s=this.properties.highlight.highlightedItem.item?.[e]?.strokeWidth??i;return i>s||o>s};return t("low")||t("high")}updatePathNodes(t){const{visible:e}=t,[i,o,s]=t.paths,a=this.contextNodeData?.segments,r=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightState(r,!1),l=this.getHighlightStyle(),{item:c,fill:h,fillOpacity:d,opacity:u}=mergeDefaults7(l,this.getStyle(!1,n));o.setProperties({datum:a,segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:PointerEvents2.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:u,visible:e}),s.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:PointerEvents2.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:u,visible:e});const p=this.getShapeFillBBox();applyShapeFillBBox2(i,h,p),applyShapeStyle4(i,{stroke:void 0,fill:h,fillOpacity:d,opacity:u},p);const g=this.contextNodeData?.intersectionSegments??a;i.setProperties({segments:g,pointerEvents:PointerEvents2.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:u,visible:e}),i.datum=g,updateClipPath(this,i),updateClipPath(this,o),updateClipPath(this,s)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(t,e){const[i]=t;i.path.clear(),plotAreaPathFill(i,e.fillData),i.markDirty("RangeArea")}updateStrokePath(t,e){const[,i,o]=t;i.path.clear(),o.path.clear(),plotLinePathStroke(i,e.lowStrokeData.spans),plotLinePathStroke(o,e.highStrokeData.spans),i.markDirty("RangeArea"),o.markDirty("RangeArea")}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,{processedData:o,axes:s,properties:a}=this,r=a.styler?this.getStylerMarkerOptions().item:a.item,{low:n,high:l}=r,c=markerEnabled(o.input.count,s[ChartAxisDirection16.X].scale,{enabled:n.marker.enabled||l.marker.enabled});(a.item.low.marker.isDirty()||a.item.high.marker.isDirty())&&(i.clear(),i.cleanup());let h;if(c)if(n.marker.enabled&&l.marker.enabled)h=e;else{h=[];for(const d of e)r[d.itemId].marker.enabled&&h.push(d)}else h=[];return i.update(h)}updateDatumStyles({datumSelection:t,isHighlight:e}){const i=this.ctx.highlightManager.getActiveHighlight();t.each((o,s)=>{const a=this.getHighlightState(i,e,s.datumIndex),r=this.getStyle(e,a),{fill:n,fillOpacity:l,item:c}=r,{stroke:h,strokeWidth:d,strokeOpacity:u}=c[s.itemId],{marker:p}=this.properties.item[s.itemId],g=this.makeItemStylerParams(s.itemId);s.style=this.getMarkerStyle(p,s,g,{isHighlight:e,highlightState:a,resolveMarkerSubPath:["item",s.itemId,"marker"]},r.item[s.itemId].marker,{fill:n,fillOpacity:l,stroke:h,strokeWidth:d,strokeOpacity:u})})}updateDatumNodes(t){const{contextNodeData:e}=this;if(!e)return;const{datumSelection:i,isHighlight:o}=t,s=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight();i.each((r,n)=>{const{itemId:l}=n,c=n.style??e.styles[l][this.getHighlightState(a,o,n.datumIndex)];this.applyMarkerStyle(c,r,n.point,s)}),o||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,o=>{o.pointerEvents=PointerEvents2.None})}updateLabelNodes(t){const e={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,s)=>{o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,updateLabelNode2(this,o,e,this.properties.label,s,!1,i)})}getHighlightData(t,e){const i=t.filter(o=>o.datum===e.datum);return i.length>0?i:void 0}getStyle(t,e){return this.getStylerCouple(t,e)[0]}getStylerMarkerOptions(){return this.getStylerCouple(!1)[1]}getStylerCouple(t,e){const{fill:i,fillOpacity:o,item:s,styler:a}=this.properties;let r={};if(a){const h=this.makeStylerParams(t,e);r=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(a,h)??{},{pick:!1})??{}}const n={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},l=h=>{const d=r.item?.[h],{lineDash:u,lineDashOffset:p,marker:g,stroke:y,strokeOpacity:f,strokeWidth:x}=s[h];return n.item[h].marker.enabled=d?.marker?.enabled??g.enabled,{marker:{fill:d?.marker?.fill??g.fill??i,fillOpacity:d?.marker?.fillOpacity??g.fillOpacity,shape:d?.marker?.shape??g.shape,size:d?.marker?.size??g.size,lineDash:d?.marker?.lineDash??g.lineDash,lineDashOffset:d?.marker?.lineDashOffset??g.lineDashOffset,stroke:d?.marker?.stroke??g.stroke??y,strokeOpacity:d?.marker?.strokeOpacity??g.strokeOpacity,strokeWidth:d?.marker?.strokeWidth??g.strokeWidth},lineDash:d?.lineDash??u,lineDashOffset:d?.lineDashOffset??p,stroke:d?.stroke??y,strokeOpacity:d?.strokeOpacity??f,strokeWidth:d?.strokeWidth??x}};return[{fill:r.fill??i,fillOpacity:r.fillOpacity??o,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:l("low"),high:l("high")}},n]}makeStylerParams(t,e){const{id:i}=this,{fill:o,fillOpacity:s,item:a,xKey:r,yHighKey:n,yLowKey:l}=this.properties,c=toHighlightString2(e??HighlightState2.None),h=d=>{const{lineDash:u,lineDashOffset:p,marker:g,stroke:y,strokeOpacity:f,strokeWidth:x}=a[d];return{marker:{fill:g.fill??o,fillOpacity:g.fillOpacity,size:g.size,shape:g.shape,stroke:g.stroke??y,strokeOpacity:g.strokeOpacity,strokeWidth:g.strokeWidth,lineDash:g.lineDash,lineDashOffset:g.lineDashOffset},lineDash:u,lineDashOffset:p,stroke:y,strokeOpacity:f,strokeWidth:x}};return{item:{low:h("low"),high:h("high")},fill:o,fillOpacity:s,highlightState:c,highlighted:t,seriesId:i,xKey:r,yLowKey:l,yHighKey:n}}makeItemStylerParams(t){const{xKey:e,yLowKey:i,yHighKey:o}=this.properties;return{xKey:e,yLowKey:i,yHighKey:o,itemId:t}}getTooltipContent(t,e){const i=e?.itemId??"high",{id:o,dataModel:s,processedData:a,axes:r,properties:n}=this,{xName:l,yName:c,yLowKey:h,yLowName:d,xKey:u,yHighKey:p,yHighName:g,tooltip:y,legendItemName:f}=n,x=r[ChartAxisDirection16.X],b=r[ChartAxisDirection16.Y];if(!s||!a||!x||!b)return;const m=a.dataSources.get(this.id)?.data[t],S=s.resolveKeysById(this,"xValue",a)[t],v=s.resolveColumnById(this,"yHighValue",a)[t],M=s.resolveColumnById(this,"yLowValue",a)[t];if(S==null)return;const D=this.getStyle(!1),k=this.makeItemStylerParams(i),_=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:t,datum:m},k,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},D.item[i].marker),T=`${this.getAxisValueText(b,"tooltip",M,m,h,f)} - ${this.getAxisValueText(b,"tooltip",v,m,p,f)}`;return this.formatTooltipWithContext(y,{heading:this.getAxisValueText(x,"tooltip",S,m,u,f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${d??h} - ${g??p}`,value:T}]},{seriesId:o,datum:m,title:c,itemId:i,xName:l,yName:c,yLowKey:h,yLowName:d,xKey:u,yHighKey:p,yHighName:g,legendItemName:f,..._})}legendItemSymbol(){const{fill:t,topLevel:e}=this.getStyle(!1),{stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,marker:r}=e;return{marker:{shape:r.shape,fill:r.fill??t,stroke:r.stroke??i,fillOpacity:r.fillOpacity,strokeOpacity:r.strokeOpacity,strokeWidth:r.strokeWidth,lineDash:r.lineDash,lineDashOffset:r.lineDashOffset},line:{stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:a}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yLowKey:o,yHighKey:s,yName:a,yLowName:r,yHighName:n,legendItemName:l,showInLegend:c}=this.properties,h=l??a??`${r??o} - ${n??s}`,d=`${o}-${s}`;return[{legendType:"category",id:e,itemId:d,seriesId:e,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new Marker}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:o,paths:s}=t,{animationManager:a}=this.ctx;this.updateAreaPaths(s,o),pathSwipeInAnimation(this,a,...s),resetMotion([e],resetMarkerPositionFn),markerSwipeScaleInAnimation(this,a,e),seriesLabelFadeInAnimation(this,"labels",a,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{datumSelection:i,labelSelection:o,contextData:s,paths:a,previousContextData:r}=t,[n,l,c]=a;if(n==null&&l==null&&c==null)return;this.resetDatumAnimation(t),this.resetLabelAnimation(t);const h=()=>{this.resetPathAnimation(t),this.updateAreaPaths(a,s)},d=()=>{e.skipCurrentBatch(),h()};if(s==null||r==null){h(),markerFadeInAnimation(this,e,"added",i),pathFadeInAnimation(this,"fill_path_properties",e,"add",n),pathFadeInAnimation(this,"low_stroke_path_properties",e,"add",l),pathFadeInAnimation(this,"high_stroke_path_properties",e,"add",c),seriesLabelFadeInAnimation(this,"labels",e,o);return}const u=prepareRangeAreaPathAnimation(s,r,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){d();return}else if(u.status==="no-op")return;fromToMotion(this.id,"fill_path_properties",e,[n],u.fill.pathProperties),fromToMotion(this.id,"low_stroke_path_properties",e,[l],u.stroke.pathProperties),fromToMotion(this.id,"high_stroke_path_properties",e,[c],u.stroke.pathProperties),u.status==="added"?this.updateAreaPaths(a,s):u.status==="removed"?this.updateAreaPaths(a,r):(pathMotion(this.id,"fill_path_update",e,[n],u.fill.path),pathMotion(this.id,"low_stroke_path_update",e,[l],u.stroke.path),pathMotion(this.id,"high_stroke_path_update",e,[c],u.stroke.path)),u.hasMotion&&(markerFadeInAnimation(this,e,void 0,i),seriesLabelFadeInAnimation(this,"labels",e,o)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,s)})}getFormattedMarkerStyle(t){const e=this.getStyle(!1),i=this.makeItemStylerParams(t.itemId);return this.getMarkerStyle(this.properties.item[t.itemId].marker,t,i,{isHighlight:!0,resolveMarkerSubPath:["item",t.itemId,"marker"]},void 0,e)}getMarkerStyle(t,e,i,o,s,a){return t.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(t,e,i,o,s,a)}computeFocusBounds(t){const e=computeMarkerFocusBounds(this,t),i=computeMarkerFocusBounds(this,{...t,datumIndex:t.datumIndex+1});if(e&&i)return BBox13.merge([e,i])}isDatumEnabled(t,e){return e%2===0&&super.isDatumEnabled(t,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};RangeAreaSeries.className="RangeAreaSeries",RangeAreaSeries.type="range-area";var import_ag_charts_community141=require("ag-charts-community"),import_ag_charts_core62=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs5,rangeAreaSeriesThemeableOptionsDef}=import_ag_charts_community141._ModuleSupport,rangeAreaSeriesOptionsDef={...commonSeriesOptionsDefs5,...rangeAreaSeriesThemeableOptionsDef,type:(0,import_ag_charts_core62.required)((0,import_ag_charts_core62.constant)("range-area")),xKey:(0,import_ag_charts_core62.required)(import_ag_charts_core62.string),yLowKey:(0,import_ag_charts_core62.required)(import_ag_charts_core62.string),yHighKey:(0,import_ag_charts_core62.required)(import_ag_charts_core62.string),xName:import_ag_charts_core62.string,yName:import_ag_charts_core62.string,yLowName:import_ag_charts_core62.string,yHighName:import_ag_charts_core62.string,legendItemName:import_ag_charts_core62.string,segmentation:import_ag_charts_core62.shapeSegmentation,invertedStyle:{enabled:import_ag_charts_core62.boolean,...import_ag_charts_core62.fillOptionsDef}};rangeAreaSeriesOptionsDef.pickOutsideVisibleMinorAxis=(0,import_ag_charts_core62.undocumented)(import_ag_charts_core62.boolean),rangeAreaSeriesOptionsDef.focusPriority=(0,import_ag_charts_core62.undocumented)(import_ag_charts_core62.number);var import_ag_charts_community142=require("ag-charts-community"),RANGE_AREA_ITEM={lineDash:{$path:"/series/$index/lineDash"},lineDashOffset:{$path:"/series/$index/lineDashOffset"},stroke:{$path:["/series/$index/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/strokeOpacity"},strokeWidth:{$path:["/series/$index/strokeWidth",1]},marker:{enabled:{$path:"/series/$index/marker/enabled"},fill:{$isUserOption:["/series/$index/marker/fill",{$if:[{$or:[{$isGradient:{$path:"/series/$index/marker/fill"}},{$isImage:{$path:"/series/$index/marker/fill"}},{$isPattern:{$path:"/series/$index/marker/fill"}}]},{$merge:[{$path:"/series/$index/marker/fill"},{$applySwitch:[{$path:"type"},void 0,["gradient",import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]]}]},fillOpacity:{$path:"/series/$index/marker/fillOpacity"},lineDash:{$path:"/series/$index/marker/lineDash"},lineDashOffset:{$path:"/series/$index/marker/lineDashOffset"},shape:{$path:"/series/$index/marker/shape"},size:{$path:["/series/$index/marker/size",6]},stroke:{$path:["/series/$index/marker/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/marker/strokeOpacity"},strokeWidth:{$path:["/series/$index/marker/strokeWidth",2]}}},RANGE_AREA_SERIES_THEME={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],["pattern",import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2},nodeClickRange:"nearest",item:{low:RANGE_AREA_ITEM,high:RANGE_AREA_ITEM},label:{...import_ag_charts_community142._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"outside",padding:{$isUserOption:["./spacing",0,10]},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:import_ag_charts_community142._ModuleSupport.multiSeriesHighlightStyle(),segmentation:import_ag_charts_community142._ModuleSupport.SEGMENTATION_DEFAULTS,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",import_ag_charts_community142._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],["image",import_ag_charts_community142._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community142._ModuleSupport.FILL_PATTERN_DEFAULTS]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{[import_ag_charts_community142._ModuleSupport.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE6,CARTESIAN_POSITION:CARTESIAN_POSITION4}}=import_ag_charts_community143._ModuleSupport,RangeAreaModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:t=>new RangeAreaSeries(t),predictAxis:import_ag_charts_community143._ModuleSupport.predictCartesianTimeAxis,defaultAxes:[{type:CARTESIAN_AXIS_TYPE6.NUMBER,position:CARTESIAN_POSITION4.LEFT},{type:CARTESIAN_AXIS_TYPE6.CATEGORY,position:CARTESIAN_POSITION4.BOTTOM}],themeTemplate:RANGE_AREA_SERIES_THEME},RangeAreaSeriesModule={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:rangeAreaSeriesOptionsDef,create:t=>new RangeAreaSeries(t)},import_ag_charts_community149=require("ag-charts-community"),import_ag_charts_community146=require("ag-charts-community"),import_ag_charts_community144=require("ag-charts-community"),{aggregationDomain:aggregationDomain3,aggregationRangeFittingPoints:aggregationRangeFittingPoints3,compactAggregationIndices:compactAggregationIndices3,createAggregationIndices:createAggregationIndices3}=import_ag_charts_community144._ModuleSupport,AGGREGATION_THRESHOLD3=1e3;function aggregateRangeBarData(t,e,i,o,s,a){if(e.length64;)({indexData:c,valueData:h,maxRange:l}=compactAggregationIndices3(c,h,l)),d.push({maxRange:l,indexData:c});return d.reverse(),d}var import_ag_charts_community145=require("ag-charts-community"),{AbstractBarSeriesProperties:AbstractBarSeriesProperties3,makeSeriesTooltip:makeSeriesTooltip6,Property:Property54,DropShadow:DropShadow2,Label:Label3}=import_ag_charts_community145._ModuleSupport,RangeBarSeriesLabel=class extends Label3{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};__decorateClass([Property54],RangeBarSeriesLabel.prototype,"placement",2),__decorateClass([Property54],RangeBarSeriesLabel.prototype,"spacing",2);var RangeBarProperties=class extends AbstractBarSeriesProperties3{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new DropShadow2().set({enabled:!1}),this.label=new RangeBarSeriesLabel,this.tooltip=makeSeriesTooltip6()}};__decorateClass([Property54],RangeBarProperties.prototype,"xKey",2),__decorateClass([Property54],RangeBarProperties.prototype,"yLowKey",2),__decorateClass([Property54],RangeBarProperties.prototype,"yHighKey",2),__decorateClass([Property54],RangeBarProperties.prototype,"xName",2),__decorateClass([Property54],RangeBarProperties.prototype,"yName",2),__decorateClass([Property54],RangeBarProperties.prototype,"yLowName",2),__decorateClass([Property54],RangeBarProperties.prototype,"yHighName",2),__decorateClass([Property54],RangeBarProperties.prototype,"fill",2),__decorateClass([Property54],RangeBarProperties.prototype,"fillOpacity",2),__decorateClass([Property54],RangeBarProperties.prototype,"stroke",2),__decorateClass([Property54],RangeBarProperties.prototype,"strokeWidth",2),__decorateClass([Property54],RangeBarProperties.prototype,"strokeOpacity",2),__decorateClass([Property54],RangeBarProperties.prototype,"lineDash",2),__decorateClass([Property54],RangeBarProperties.prototype,"lineDashOffset",2),__decorateClass([Property54],RangeBarProperties.prototype,"cornerRadius",2),__decorateClass([Property54],RangeBarProperties.prototype,"styler",2),__decorateClass([Property54],RangeBarProperties.prototype,"itemStyler",2),__decorateClass([Property54],RangeBarProperties.prototype,"shadow",2),__decorateClass([Property54],RangeBarProperties.prototype,"label",2),__decorateClass([Property54],RangeBarProperties.prototype,"tooltip",2);var{SeriesNodePickMode:SeriesNodePickMode4,valueProperty:valueProperty7,keyProperty:keyProperty5,ChartAxisDirection:ChartAxisDirection17,checkCrisp,updateLabelNode:updateLabelNode3,SMALLEST_KEY_INTERVAL:SMALLEST_KEY_INTERVAL3,LARGEST_KEY_INTERVAL,diff:diff4,prepareBarAnimationFunctions,midpointStartingBarPosition,resetBarSelectionsFn,fixNumericExtent:fixNumericExtent5,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation2,resetLabelFn:resetLabelFn2,animationValidation:animationValidation4,computeBarFocusBounds:computeBarFocusBounds4,visibleRangeIndices:visibleRangeIndices2,createDatumId:createDatumId4,ContinuousScale:ContinuousScale5,Rect:Rect2,PointerEvents:PointerEvents3,motion:motion2,applyShapeStyle:applyShapeStyle5,findMinMax:findMinMax3,areScalingEqual:areScalingEqual2,processedDataIsAnimatable:processedDataIsAnimatable3,AGGREGATION_SPAN:AGGREGATION_SPAN2,AGGREGATION_INDEX_X_MAX:AGGREGATION_INDEX_X_MAX2,AGGREGATION_INDEX_X_MIN:AGGREGATION_INDEX_X_MIN2,AGGREGATION_INDEX_Y_MAX:AGGREGATION_INDEX_Y_MAX3,AGGREGATION_INDEX_Y_MIN:AGGREGATION_INDEX_Y_MIN3,mergeDefaults:mergeDefaults8,simpleMemorize2:simpleMemorize23,getItemStyles:getItemStyles2,calculateSegments:calculateSegments3,toHighlightString:toHighlightString3,HighlightState:HighlightState3}=import_ag_charts_community146._ModuleSupport,memoizedAggregateRangeBarData=simpleMemorize23(aggregateRangeBarData),RangeBarSeriesNodeEvent=class extends import_ag_charts_community146._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.xKey,this.yLowKey=o.properties.yLowKey,this.yHighKey=o.properties.yHighKey}},RangeBarSeries=class extends import_ag_charts_community146._ModuleSupport.AbstractBarSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode4.AXIS_ALIGNED,SeriesNodePickMode4.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:resetBarSelectionsFn,label:resetLabelFn2}}),this.properties=new RangeBarProperties,this.dataAggregationFilters=void 0,this.NodeEvent=RangeBarSeriesNodeEvent}async processData(t){const{xKey:e,yLowKey:i,yHighKey:o}=this.properties,s=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:r,xScaleType:n,yScaleType:l}=this.getScaleInformation({xScale:s,yScale:a}),c=[];this.ctx.animationManager.isSkipped()||(this.processedData&&c.push(diff4(this.id,this.processedData)),c.push(animationValidation4()));const h=this.visible?{}:{forceValue:0},{dataModel:d,processedData:u}=await this.requestDataModel(t,this.data,{props:[keyProperty5(e,n,{id:"xValue"}),valueProperty7(i,l,{id:"yLowValue",invalidValue:null,...h}),valueProperty7(o,l,{id:"yHighValue",invalidValue:null,...h}),...r?[SMALLEST_KEY_INTERVAL3,LARGEST_KEY_INTERVAL]:[],...c],groupByKeys:!1});this.smallestDataInterval=u.reduced?.smallestKeyInterval,this.largestDataInterval=u.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(d,u),this.animationState.transition("updateData")}aggregateData(t,e){if(e.type!=="ungrouped"||processedDataIsAnimatable3(e))return;const i=this.axes[ChartAxisDirection17.X];if(i==null)return;const o=t.resolveKeysById(this,"xValue",e),s=t.resolveColumnById(this,"yHighValue",e),a=t.resolveColumnById(this,"yLowValue",e),{index:r}=t.resolveProcessedDataDefById(this,"xValue"),n=e.domain.keys[r];return memoizedAggregateRangeBarData(i.scale.type,o,s,a,n,e.reduced?.smallestKeyInterval)}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[o]}=e.domain;if(t===this.getCategoryDirection()){const s=i.resolveProcessedDataDefById(this,"xValue");return s?.def.type==="key"&&s?.def.valueType==="category"?o:this.padBandExtent(o)}else{const s=this.domainForClippedRange(t,["yHighValue","yLowValue"],"xValue"),a=findMinMax3(s);return fixNumericExtent5(a)}}getSeriesRange(t,e){return this.domainForVisibleRange(ChartAxisDirection17.Y,["yHighValue","yLowValue"],"xValue",e)}createNodeData(){const{data:t,dataModel:e,groupScale:i,processedData:o,visible:s}=this,a=this.getCategoryAxis(),r=this.getValueAxis();if(!(t&&a&&r&&e&&o?.dataSources&&this.chart?.seriesRect))return;const n=a.scale,l=r.scale,c=this.getBarDirection()===ChartAxisDirection17.X,{xKey:h,yLowKey:d,yHighKey:u,strokeWidth:p}=this.properties,g=`${d}-${u}`,y=calculateSegments3(this.properties.segmentation,a,r,this.chart.seriesRect,this.ctx.scene),f={itemId:g,nodeData:[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:getItemStyles2(this.getItemStyle.bind(this)),segments:y};if(!s)return f;const x=o.dataSources.get(this.id)?.data??[],b=e.resolveKeysById(this,"xValue",o),m=e.resolveColumnById(this,"yLowValue",o),S=e.resolveColumnById(this,"yHighValue",o),{barWidth:v,groupIndex:M}=this.updateGroupScale(a),D=ContinuousScale5.is(n)?v*-.5:0,k=i.convert(String(M)),_=checkCrisp(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval),T=C=>Math.round(n.convert(b[C]))+k+D,w=(C,L,A,P,z,B,V)=>{const W=x[C],H=b[C];if(H==null)return;const G=m[C],K=S[C];if(!Number.isFinite(G?.valueOf())||!Number.isFinite(K?.valueOf()))return;const[U,Y]=GC.maxRange>E);if(I!=null){const{maxRange:C,indexData:L}=I,[A,P]=visibleRangeIndices2(1,C,a.range,z=>{const B=z*AGGREGATION_SPAN2,V=L[B+AGGREGATION_INDEX_X_MIN2],W=L[B+AGGREGATION_INDEX_X_MAX2];if(V===-1)return;const H=Math.trunc((V+W)/2);return[T(H),T(W)+v]});for(let z=A;zthis.getDatumId(s))}getItemStyle(t,e,i){const{properties:o,dataModel:s,processedData:a}=this,{itemStyler:r}=o,n=this.getHighlightStyle(e,t,i);let l=mergeDefaults8(n,this.getStyle(t===void 0,e,i));if(r&&s!=null&&a!=null&&t!=null){const c=s.resolveKeysById(this,"xValue",a)[t],h=this.cachedDatumCallback(createDatumId4(this.getDatumId({xValue:c}),e?"highlight":"node"),()=>{const d=this.makeItemStylerParams(t,e,l);return this.callWithContext(r,d)});h&&(l=mergeDefaults8(h,l))}return l}makeItemStylerParams(t,e,i){const{id:o,properties:s,processedData:a}=this,{xKey:r,yHighKey:n,yLowKey:l}=s,c=a.dataSources.get(o)?.data[t],h=this.ctx.highlightManager?.getActiveHighlight(),d=this.getHighlightStateString(h,e,t),u=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:o,datum:c,xKey:r,yHighKey:n,yLowKey:l,highlighted:e,highlightState:d,...i,fill:u}}updateDatumStyles(t){const e=this.ctx.highlightManager.getActiveHighlight();t.datumSelection.each((i,o)=>{if(!t.datumSelection.isGarbage(i)){const s=this.getHighlightState(e,t.isHighlight,o.datumIndex);o.style=this.getItemStyle(o.datumIndex,t.isHighlight,s)}})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),s=this.getCategoryDirection()===ChartAxisDirection17.X,a=this.getShapeFillBBox();t.each((r,n)=>{const l=n.style??i.styles[this.getHighlightState(o,e,n.datumIndex)];applyShapeStyle5(r,l,a),r.cornerRadius=l.cornerRadius??0,r.visible=s?n.width>0:n.height>0,r.crisp=n.crisp})}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=PointerEvents3.None})}updateLabelNodes(t){const e={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,s)=>{o.fillOpacity=this.getHighlightStyle(!1,s?.datumIndex).opacity??1,updateLabelNode3(this,o,e,this.properties.label,s,!1,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:r,yName:n,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,tooltip:u,legendItemName:p}=s,g=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!o||!g||!y)return;const f=o.dataSources.get(this.id)?.data[t],x=i.resolveKeysById(this,"xValue",o)[t],b=i.resolveColumnById(this,"yHighValue",o)[t],m=i.resolveColumnById(this,"yLowValue",o)[t];if(x==null)return;const S=this.getItemStyle(t,!1),v=`${this.getAxisValueText(y,"tooltip",m,f,l,p)} - ${this.getAxisValueText(y,"tooltip",b,f,c,p)}`;return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(g,"tooltip",x,f,a,p),symbol:this.legendItemSymbol(),data:[{label:n,fallbackLabel:`${h??l} - ${d??c}`,value:v}]},{seriesId:e,datum:f,title:n,xKey:a,xName:r,yName:n,yLowKey:l,yHighKey:c,yLowName:h,yHighName:d,legendItemName:p,...S})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:o,strokeOpacity:s,lineDash:a,lineDashOffset:r}=this.getStyle(!1,!1,HighlightState3.None);return{marker:{fill:t,stroke:e,fillOpacity:o,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:r}}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{yName:o,yLowName:s,yHighName:a,yLowKey:r,yHighKey:n,legendItemName:l,showInLegend:c}=this.properties,h=l??o??`${s??r} - ${a??n}`,d=`${r}-${n}`;return[{legendType:"category",id:e,itemId:d,seriesId:e,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=prepareBarAnimationFunctions(midpointStartingBarPosition(this.isVertical(),"normal"),"unknown");motion2.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],i),seriesLabelFadeInAnimation2(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:o,previousContextData:s}=t,a=import_ag_charts_community146._ModuleSupport.calculateDataDiff(this.id,e,this.getDatumId.bind(this),o,s,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const r=s==null?"fade":"normal",n=prepareBarAnimationFunctions(midpointStartingBarPosition(this.isVertical(),r),"added");motion2.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],n,(l,c)=>this.getDatumId(c),a),(a?.changed||!areScalingEqual2(o.groupScale,s?.groupScale))&&seriesLabelFadeInAnimation2(this,"labels",this.ctx.animationManager,i)}getDatumId(t){return`${t.xValue}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds4(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};RangeBarSeries.className="RangeBarSeries",RangeBarSeries.type="range-bar";var import_ag_charts_community147=require("ag-charts-community"),import_ag_charts_core63=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs6,rangeBarSeriesThemeableOptionsDef}=import_ag_charts_community147._ModuleSupport,rangeBarSeriesOptionsDef={...commonSeriesOptionsDefs6,...rangeBarSeriesThemeableOptionsDef,type:(0,import_ag_charts_core63.required)((0,import_ag_charts_core63.constant)("range-bar")),xKey:(0,import_ag_charts_core63.required)(import_ag_charts_core63.string),yLowKey:(0,import_ag_charts_core63.required)(import_ag_charts_core63.string),yHighKey:(0,import_ag_charts_core63.required)(import_ag_charts_core63.string),xName:import_ag_charts_core63.string,yName:import_ag_charts_core63.string,yLowName:import_ag_charts_core63.string,yHighName:import_ag_charts_core63.string,legendItemName:import_ag_charts_core63.string,segmentation:import_ag_charts_core63.shapeSegmentation};rangeBarSeriesOptionsDef.pickOutsideVisibleMinorAxis=(0,import_ag_charts_core63.undocumented)(import_ag_charts_core63.boolean),rangeBarSeriesOptionsDef.focusPriority=(0,import_ag_charts_core63.undocumented)(import_ag_charts_core63.number);var import_ag_charts_community148=require("ag-charts-community"),RANGE_BAR_SERIES_THEME={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",import_ag_charts_community148._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],["image",import_ag_charts_community148._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community148._ModuleSupport.FILL_PATTERN_DEFAULTS]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...import_ag_charts_community148._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:import_ag_charts_community148._ModuleSupport.multiSeriesHighlightStyle(),segmentation:import_ag_charts_community148._ModuleSupport.SEGMENTATION_DEFAULTS},axes:{[import_ag_charts_community148._ModuleSupport.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},RangeBarModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:t=>new RangeBarSeries(t),predictAxis:import_ag_charts_community149._ModuleSupport.predictCartesianTimeAxis,defaultAxes:import_ag_charts_community149._ModuleSupport.DIRECTION_SWAP_AXES,themeTemplate:RANGE_BAR_SERIES_THEME,groupable:!0},RangeBarSeriesModule={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:rangeBarSeriesOptionsDef,create:t=>new RangeBarSeries(t)},import_ag_charts_community154=require("ag-charts-community"),import_ag_charts_community151=require("ag-charts-community"),import_ag_charts_community150=require("ag-charts-community"),{AbstractBarSeriesProperties:AbstractBarSeriesProperties4,BaseProperties:BaseProperties19,PropertiesArray:PropertiesArray4,makeSeriesTooltip:makeSeriesTooltip7,Property:Property55,DropShadow:DropShadow3,Label:Label4}=import_ag_charts_community150._ModuleSupport,WaterfallSeriesTotal=class extends BaseProperties19{};__decorateClass([Property55],WaterfallSeriesTotal.prototype,"totalType",2),__decorateClass([Property55],WaterfallSeriesTotal.prototype,"index",2),__decorateClass([Property55],WaterfallSeriesTotal.prototype,"axisLabel",2);var WaterfallSeriesItemTooltip=class extends BaseProperties19{};__decorateClass([Property55],WaterfallSeriesItemTooltip.prototype,"renderer",2);var WaterfallSeriesLabel=class extends Label4{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};__decorateClass([Property55],WaterfallSeriesLabel.prototype,"placement",2),__decorateClass([Property55],WaterfallSeriesLabel.prototype,"spacing",2);var WaterfallSeriesItem=class extends BaseProperties19{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new DropShadow3().set({enabled:!1}),this.label=new WaterfallSeriesLabel,this.tooltip=new WaterfallSeriesItemTooltip}};__decorateClass([Property55],WaterfallSeriesItem.prototype,"name",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"fill",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"stroke",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"fillOpacity",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"strokeOpacity",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"lineDash",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"lineDashOffset",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"strokeWidth",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"cornerRadius",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"itemStyler",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"shadow",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"label",2),__decorateClass([Property55],WaterfallSeriesItem.prototype,"tooltip",2);var WaterfallSeriesConnectorLine=class extends BaseProperties19{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};__decorateClass([Property55],WaterfallSeriesConnectorLine.prototype,"enabled",2),__decorateClass([Property55],WaterfallSeriesConnectorLine.prototype,"stroke",2),__decorateClass([Property55],WaterfallSeriesConnectorLine.prototype,"strokeOpacity",2),__decorateClass([Property55],WaterfallSeriesConnectorLine.prototype,"lineDash",2),__decorateClass([Property55],WaterfallSeriesConnectorLine.prototype,"lineDashOffset",2),__decorateClass([Property55],WaterfallSeriesConnectorLine.prototype,"strokeWidth",2);var WaterfallSeriesItems=class extends BaseProperties19{constructor(){super(...arguments),this.positive=new WaterfallSeriesItem,this.negative=new WaterfallSeriesItem,this.total=new WaterfallSeriesItem}};__decorateClass([Property55],WaterfallSeriesItems.prototype,"positive",2),__decorateClass([Property55],WaterfallSeriesItems.prototype,"negative",2),__decorateClass([Property55],WaterfallSeriesItems.prototype,"total",2);var WaterfallSeriesProperties=class extends AbstractBarSeriesProperties4{constructor(){super(...arguments),this.item=new WaterfallSeriesItems,this.totals=new PropertiesArray4(WaterfallSeriesTotal),this.line=new WaterfallSeriesConnectorLine,this.tooltip=makeSeriesTooltip7()}getStyle(t){const{fillOpacity:e,strokeWidth:i,strokeOpacity:o,fill:s,stroke:a,lineDash:r,lineDashOffset:n,cornerRadius:l}=this.item[t==="subtotal"?"total":t];return{fill:s,fillOpacity:e,stroke:a,strokeWidth:i,strokeOpacity:o,lineDash:r,lineDashOffset:n,cornerRadius:l,opacity:1}}};__decorateClass([Property55],WaterfallSeriesProperties.prototype,"xKey",2),__decorateClass([Property55],WaterfallSeriesProperties.prototype,"yKey",2),__decorateClass([Property55],WaterfallSeriesProperties.prototype,"xName",2),__decorateClass([Property55],WaterfallSeriesProperties.prototype,"yName",2),__decorateClass([Property55],WaterfallSeriesProperties.prototype,"item",2),__decorateClass([Property55],WaterfallSeriesProperties.prototype,"totals",2),__decorateClass([Property55],WaterfallSeriesProperties.prototype,"line",2),__decorateClass([Property55],WaterfallSeriesProperties.prototype,"tooltip",2);var{adjustLabelPlacement,SeriesNodePickMode:SeriesNodePickMode5,fixNumericExtent:fixNumericExtent6,valueProperty:valueProperty8,keyProperty:keyProperty6,accumulativeValueProperty,trailingAccumulatedValueProperty,ChartAxisDirection:ChartAxisDirection18,createDatumId:createDatumId5,checkCrisp:checkCrisp2,updateLabelNode:updateLabelNode4,prepareBarAnimationFunctions:prepareBarAnimationFunctions2,collapsedStartingBarPosition,resetBarSelectionsFn:resetBarSelectionsFn2,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation3,resetLabelFn:resetLabelFn3,animationValidation:animationValidation5,DEFAULT_CARTESIAN_DIRECTION_KEYS:DEFAULT_CARTESIAN_DIRECTION_KEYS2,DEFAULT_CARTESIAN_DIRECTION_NAMES:DEFAULT_CARTESIAN_DIRECTION_NAMES2,computeBarFocusBounds:computeBarFocusBounds5,isContinuous,Rect:Rect3,motion:motion3,applyShapeStyle:applyShapeStyle6,mergeDefaults:mergeDefaults9,getItemStylesPerItemId:getItemStylesPerItemId2,DataSet}=import_ag_charts_community151._ModuleSupport,WaterfallSeries=class extends import_ag_charts_community151._ModuleSupport.AbstractBarSeries{constructor(t){super({moduleCtx:t,propertyKeys:DEFAULT_CARTESIAN_DIRECTION_KEYS2,propertyNames:DEFAULT_CARTESIAN_DIRECTION_NAMES2,categoryKey:void 0,pickModes:[SeriesNodePickMode5.NEAREST_NODE,SeriesNodePickMode5.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:resetBarSelectionsFn2,label:resetLabelFn3}}),this.properties=new WaterfallSeriesProperties,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(t){const{xKey:e,yKey:i,totals:o}=this.properties,{data:s}=this;if(!this.visible)return;const a=b=>isContinuous(b)&&Number(b)>=0,r=b=>isContinuous(b)&&Number(b)>=0,n=b=>b==="total"||b==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=o.reduce((b,m)=>{const S=b.get(m.index);return S?S.push(m):b.set(m.index,[m]),b},new Map);for(const[b,m]of s?.data.entries()??[]){c.push(m);const S=h.get(b);if(S)for(const v of S)c.push({...v.toJson(),[e]:v.axisLabel})}const d=[];this.ctx.animationManager.isSkipped()||d.push(animationValidation5());const u=this.getCategoryAxis()?.scale,p=this.getValueAxis()?.scale,{isContinuousX:g,xScaleType:y,yScaleType:f}=this.getScaleInformation({xScale:u,yScale:p}),{processedData:x}=await this.requestDataModel(t,DataSet.wrap(c),{props:[keyProperty6(e,y,{id:"xValue"}),accumulativeValueProperty(i,f,{...l,id:"yCurrent"}),accumulativeValueProperty(i,f,{...l,missingValue:0,id:"yCurrentTotal"}),accumulativeValueProperty(i,f,{...l,id:"yCurrentPositive",validation:a}),accumulativeValueProperty(i,f,{...l,id:"yCurrentNegative",validation:r}),trailingAccumulatedValueProperty(i,f,{...l,id:"yPrevious"}),valueProperty8(i,f,{id:"yRaw"}),valueProperty8("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:n}),...g?[import_ag_charts_community151._ModuleSupport.SMALLEST_KEY_INTERVAL,import_ag_charts_community151._ModuleSupport.LARGEST_KEY_INTERVAL]:[],...d]});this.smallestDataInterval=x.reduced?.smallestKeyInterval,this.largestDataInterval=x.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i)return[];const{keys:[o],values:s}=e.domain;if(t===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category")return o;const r=t===ChartAxisDirection18.Y,n=this.getCategoryAxis().isReversed();return this.padBandExtent(o,n!==r)}else{const a=i.resolveProcessedDataIndexById(this,"yCurrent"),r=s[a],n=[Math.min(0,r[0]),Math.max(0,r[1])];return fixNumericExtent6(n)}}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}createNodeData(){const{data:t,dataModel:e,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!t||!o||!s||!e||!i)return;const{line:a}=this.properties,r=o.scale,n=s.scale,l=this.getBarDirection()===ChartAxisDirection18.X,c=this.getBandwidth(o)??10,h=o.isReversed(),d=s.isReversed();if(i.type!=="ungrouped")return;const u={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:getItemStylesPerItemId2(this.getItemStyle.bind(this),"total","subtotal","positive","negative")};if(!this.visible)return u;const p=[],g=e.resolveKeysById(this,"xValue",i),y=e.resolveColumnById(this,"yRaw",i),f=e.resolveColumnById(this,"totalTypeValue",i),x=e.resolveColumnById(this,"yCurrent",i),b=e.resolveColumnById(this,"yPrevious",i),m=e.resolveColumnById(this,"yCurrentTotal",i),S=this.getSeriesDomain(ChartAxisDirection18.Y),v=checkCrisp2(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function M(E,I,C){return E||I?{cumulativeValue:m[C],trailingValue:I?k:0}:{cumulativeValue:x[C],trailingValue:b[C]}}function D(E,I,C,L,A){return E?L:I?(L??0)-(A??0):C}let k=0;const{xKey:_,yKey:T,xName:w,yName:R}=this.properties,F=i.dataSources.get(this.id)?.data??[];for(const[E,I]of F.entries()){const C=f[E],L=this.isSubtotal(C),A=this.isTotal(C),P=A||L,z=g[E];if(z==null)continue;const B=Math.round(r.convert(z)),V=y[E],{cumulativeValue:W,trailingValue:H}=M(A,L,E);P&&(k=W??0);const G=Math.round(n.convert(W)),K=Math.round(n.convert(H)),U=D(A,L,V,W,H),Y=(U??0)>=0,$=this.getSeriesItemType(Y,C),{strokeWidth:X,label:Z}=this.getItemConfig($),q=Y?G:K,it=Y?K:G,J=Math.max(X,Math.abs(it-q)),j={x:l?Math.min(q,it):B,y:l?B:Math.min(q,it),width:l?J:c,height:l?c:J},tt={x:j.x+j.width/2,y:j.y+j.height/2},Q=P?G:K,ot=Math.floor(a.strokeWidth)%2/2,et=h?G:Q,st=h?Q:G;let rt,lt;l?(rt={x:et+ot,y:j.y},lt={x:st+ot,y:j.y+j.height}):(rt={x:j.x,y:et+ot},lt={x:j.x+j.width,y:st+ot});const dt={x:h?lt.x:rt.x,y:h?lt.y:rt.y,x2:h?rt.x:lt.x,y2:h?rt.y:lt.y,size:0};p.push(dt);const ct=$==="subtotal"?"total":$,ht=this.getLabelText(U,I,T,"y",S,Z,{itemId:ct,value:U,datum:I,xKey:_,yKey:T,xName:w,yName:R}),ut=Z.spacing+(typeof Z.padding=="number"?Z.padding:0),pt={index:E,series:this,itemId:$,datum:I,datumIndex:E,cumulativeValue:W??0,xValue:z,yValue:U,yKey:T,xKey:_,x:j.x,y:j.y,width:j.width,height:j.height,midPoint:tt,crisp:v,label:{text:ht,...adjustLabelPlacement({isUpward:(U??-1)>=0!==d,isVertical:!l,placement:Z.placement,spacing:ut,rect:j})}};u.nodeData.push(pt),u.labelData.push(pt)}const O=this.properties.line.enabled;return x!=null&&O&&(u.pointData=p),u}updateSeriesItemTypes(){const{dataModel:t,seriesItemTypes:e,processedData:i}=this;if(!t||!i)return;e.clear();const o=t.resolveProcessedDataIndexById(this,"yCurrentPositive"),s=t.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=t.resolveProcessedDataIndexById(this,"totalTypeValue"),r=i.domain.values[o]??[],n=i.domain.values[s]??[];r.length>0&&e.add("positive"),n.length>0&&e.add("negative");const l=i?.domain.values[a];if(l)for(const c of l)(c==="total"||c==="subtotal")&&e.add("total")}isSubtotal(t){return t==="subtotal"}isTotal(t){return t==="total"}nodeFactory(){return new Rect3}getSeriesItemType(t,e){return e??(t?"positive":"negative")}getItemConfig(t){switch(t){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,o=e??[];return i.update(o)}getItemStyle(t,e,i,o="total"){const{properties:s}=this,{datumIndex:a=0,datum:r}=t??{},n=o==="subtotal"?"total":o,l=s.item[n],c=this.getHighlightStyle(e,a,i),h=mergeDefaults9(c,s.getStyle(o)),{itemStyler:d}=l;let u=h;if(d!=null&&t!=null){const p=this.cachedDatumCallback(createDatumId5(a,e?"highlight":"node"),()=>{const g=this.makeItemStylerParams(o,a,r,e,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",n],this.callWithContext(d,g))});p&&(u=mergeDefaults9(p,u))}return u}makeItemStylerParams(t,e,i,o,s){const{id:a,properties:r}=this,{xKey:n,yKey:l}=r,c=this.ctx.highlightManager?.getActiveHighlight(),h=this.getHighlightStateString(c,o,e),d=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:a,itemId:t,datum:i,xKey:n,yKey:l,highlighted:o,highlightState:h,...s,fill:d}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getItemStyle(o,e,void 0,o.itemId)})}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),s=this.getCategoryDirection()===ChartAxisDirection18.X,a=this.getShapeFillBBox();t.each((r,n)=>{const l=n.style??i.styles[n.itemId][this.getHighlightState(o,e,n.datumIndex)];applyShapeStyle6(r,l,a),r.cornerRadius=l.cornerRadius??0,r.visible=s?n.width>0:n.height>0,r.crisp=n.crisp})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;if(e.length===0)return i.update([]);const o=e.filter(s=>{const{label:a}=this.getItemConfig(s.itemId);return a.enabled});return i.update(o)}updateLabelNodes(t){const e={itemId:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,s)=>{e.itemId=s.itemId,o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex)?.opacity??1;const a=this.getItemConfig(s.itemId).label;updateLabelNode4(this,o,e,a,s.label,!1,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:r,yKey:n,yName:l,tooltip:c,legendItemName:h}=s,d=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!o||!d||!u)return;const p=o.dataSources.get(this.id)?.data[t],g=i.resolveKeysById(this,"xValue",o)[t],y=i.resolveColumnById(this,"yRaw",o)[t],f=i.resolveColumnById(this,"yCurrentTotal",o),x=i.resolveColumnById(this,"totalTypeValue",o);if(g==null)return;const b=x[t],m=(y??0)>=0,S=this.getSeriesItemType(m,b);let v;if(this.isTotal(b))v=f[t];else if(this.isSubtotal(b)){v=f[t];for(let k=t-1;k>=0;k-=1)if(this.isSubtotal(x[k])){v=v-f[k];break}}else v=y;const M=this.contextNodeData?.nodeData?.[t],D=this.getItemStyle(M,!1,void 0,M?.itemId);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(d,"tooltip",g,p,a,h),symbol:this.legendItemSymbol(S),data:[{label:l,fallbackLabel:n,value:this.getAxisValueText(u,"tooltip",v,p,n,h)}]},{seriesId:e,datum:p,title:l,itemId:S,xKey:a,xName:r,yKey:n,yName:l,...D})}legendItemSymbol(t){const{fill:e,stroke:i,fillOpacity:o,strokeOpacity:s,strokeWidth:a,lineDash:r,lineDashOffset:n}=this.getItemConfig(t);return{marker:{fill:e,stroke:i,fillOpacity:o,strokeOpacity:s,strokeWidth:a,lineDash:r,lineDashOffset:n}}}getLegendData(t){if(t!=="category")return[];const{id:e,seriesItemTypes:i}=this,o=[],s=r=>r.charAt(0).toUpperCase()+r.substring(1),{showInLegend:a}=this.properties;for(const r of i){const{name:n}=this.getItemConfig(r);o.push({legendType:"category",id:e,itemId:r,seriesId:e,enabled:!0,label:{text:n??s(r)},symbol:this.legendItemSymbol(r),hideInLegend:!a,isFixed:!0})}return o}toggleSeriesItem(){}animateEmptyUpdateReady(t){const{datumSelection:e,labelSelection:i,contextData:o}=t,s=prepareBarAnimationFunctions2(collapsedStartingBarPosition(this.isVertical(),this.axes,"normal"),"unknown");motion3.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s),seriesLabelFadeInAnimation3(this,"labels",this.ctx.animationManager,i);const{pointData:a}=o;a&&(this.isVertical()?this.animateConnectorLinesVertical(t):this.animateConnectorLinesHorizontal(t))}animateConnectorLinesHorizontal(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:o}=i;this.updateLineNode(i);const s=this.getValueAxis(),a=s?.isReversed(),r=a?(h,d)=>hh>d,n=s?.scale.convert(0),l=e.reduce((h,d)=>(r(d.x,h)&&(h=d.x),h),a?1/0:0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:n,to:l,ease:import_ag_charts_community151._ModuleSupport.Motion.easeOut,collapsable:!1,onUpdate(h){o.clear(!0);for(const[d,u]of e.entries()){const p=c(h,n,l,n,u.x),g=c(h,n,l,n,u.x2);d!==0&&o.lineTo(p,u.y),o.moveTo(g,u.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateConnectorLinesVertical(t){const{pointData:e=[]}=t.contextData,[i]=t.paths,{path:o}=i;this.updateLineNode(i);const s=this.getValueAxis(),a=s?.isReversed(),r=a?(h,d)=>h>d:(h,d)=>h(r(d.y,h)&&(h=d.y),h),a?0:1/0),c=(h,d,u,p,g)=>(h-d)/(u-d)*(g-p)+p;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:n,to:l,ease:import_ag_charts_community151._ModuleSupport.Motion.easeOut,collapsable:!1,onUpdate(h){o.clear(!0);for(const[d,u]of e.entries()){const p=c(h,n,l,n,u.y),g=c(h,n,l,n,u.y2);d!==0&&o.lineTo(u.x,p),o.moveTo(u.x2,g)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(t)})}animateReadyResize(t){super.animateReadyResize(t),this.resetConnectorLinesPath(t)}updatePaths(t){this.resetConnectorLinesPath({contextData:t.contextData,paths:t.paths})}resetConnectorLinesPath({contextData:t,paths:e}){if(e.length===0)return;const[i]=e;this.updateLineNode(i);const{path:o}=i;o.clear(!0);const{pointData:s}=t;if(s){for(const[a,r]of s.entries())a!==0&&o.lineTo(r.x,r.y),o.moveTo(r.x2,r.y2);i.checkPathDirty()}}updateLineNode(t){const{stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a}=this.properties.line;t.setProperties({fill:void 0,stroke:e,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,lineJoin:"round",pointerEvents:import_ag_charts_community151._ModuleSupport.PointerEvents.None})}isLabelEnabled(){const{positive:t,negative:e,total:i}=this.properties.item;return t.label.enabled||e.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds5(this,this.contextNodeData?.nodeData[t])}hasItemStylers(){const{positive:t,negative:e,total:i}=this.properties.item;return t.itemStyler!=null||t.label.itemStyler!=null||e.itemStyler!=null||e.label.itemStyler!=null||i.itemStyler!=null||i.label.itemStyler!=null}};WaterfallSeries.className="WaterfallSeries",WaterfallSeries.type="waterfall";var import_ag_charts_community152=require("ag-charts-community"),import_ag_charts_core64=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs7,waterfallSeriesThemeableOptionsDef}=import_ag_charts_community152._ModuleSupport,waterfallSeriesOptionsDef={...waterfallSeriesThemeableOptionsDef,...commonSeriesOptionsDefs7,type:(0,import_ag_charts_core64.required)((0,import_ag_charts_core64.constant)("waterfall")),xKey:(0,import_ag_charts_core64.required)(import_ag_charts_core64.string),yKey:(0,import_ag_charts_core64.required)(import_ag_charts_core64.string),xName:import_ag_charts_core64.string,yName:import_ag_charts_core64.string,totals:(0,import_ag_charts_core64.arrayOfDefs)({totalType:(0,import_ag_charts_core64.required)((0,import_ag_charts_core64.union)("total","subtotal")),index:(0,import_ag_charts_core64.required)(import_ag_charts_core64.positiveNumber),axisLabel:(0,import_ag_charts_core64.required)(import_ag_charts_core64.string)},"a total definition options array")},import_ag_charts_community153=require("ag-charts-community"),{FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:FILL_GRADIENT_LINEAR_KEYED_DEFAULTS2,FILL_IMAGE_DEFAULTS:FILL_IMAGE_DEFAULTS3,FILL_PATTERN_KEYED_DEFAULTS:FILL_PATTERN_KEYED_DEFAULTS2}=import_ag_charts_community153._ModuleSupport;function itemTheme2(t,e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${e}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${t}.fill`}]},["gradient",FILL_GRADIENT_LINEAR_KEYED_DEFAULTS2(t)],["image",FILL_IMAGE_DEFAULTS3],["pattern",FILL_PATTERN_KEYED_DEFAULTS2(t)]]},stroke:{$palette:`${t}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...import_ag_charts_community153._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}var WATERFALL_SERIES_THEME={series:{item:{positive:itemTheme2("altUp",0),negative:itemTheme2("altDown",1),total:itemTheme2("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:import_ag_charts_community153._ModuleSupport.singleSeriesHighlightStyle()},legend:{enabled:!0,toggleSeries:!1}},WaterfallModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:t=>new WaterfallSeries(t),defaultAxes:import_ag_charts_community154._ModuleSupport.DIRECTION_SWAP_AXES,themeTemplate:WATERFALL_SERIES_THEME},WaterfallSeriesModule={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:waterfallSeriesOptionsDef,create:t=>new WaterfallSeries(t)},{NewAreaSeriesModule,NewBarSeriesModule,NewBubbleSeriesModule,NewHistogramSeriesModule,NewLineSeriesModule,NewScatterSeriesModule,numberFormatValidator,textOrSegments,without:without2}=import_ag_charts_community155._ModuleSupport,navigatorHandleOptionsDef={width:import_ag_charts_core65.positiveNumber,height:import_ag_charts_core65.positiveNumber,grip:import_ag_charts_core65.boolean,fill:import_ag_charts_core65.color,stroke:import_ag_charts_core65.color,strokeWidth:import_ag_charts_core65.positiveNumber,cornerRadius:import_ag_charts_core65.positiveNumber},commonIgnoredMiniChartProperties=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],barIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"errorBar","label","legendItemName","direction"],boxPlotIngnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],bubbleIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"title","label","labelKey","labelName","sizeName"],heatmapIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],histogramIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"label"],lineIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"errorBar","title","label"],rangeAreaIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"label","yLowName","yHighName"],rangeBarIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"direction","label","yLowName","yHighName"],scatterIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"errorBar","title","label","labelKey","labelName"],waterfallIgnoredMiniChartProperties=[...commonIgnoredMiniChartProperties,"direction"],navigatorOptionsDef={enabled:import_ag_charts_core65.boolean,height:import_ag_charts_core65.positiveNumber,spacing:import_ag_charts_core65.positiveNumber,cornerRadius:import_ag_charts_core65.number,mask:{fill:import_ag_charts_core65.color,fillOpacity:import_ag_charts_core65.ratio,stroke:import_ag_charts_core65.color,strokeWidth:import_ag_charts_core65.positiveNumber},minHandle:navigatorHandleOptionsDef,maxHandle:navigatorHandleOptionsDef,miniChart:{enabled:import_ag_charts_core65.boolean,padding:{top:import_ag_charts_core65.positiveNumber,bottom:import_ag_charts_core65.positiveNumber},label:{enabled:import_ag_charts_core65.boolean,avoidCollisions:import_ag_charts_core65.boolean,spacing:import_ag_charts_core65.positiveNumber,format:numberFormatValidator,formatter:(0,import_ag_charts_core65.callbackOf)(textOrSegments),interval:{minSpacing:import_ag_charts_core65.positiveNumber,maxSpacing:import_ag_charts_core65.positiveNumber,values:import_ag_charts_core65.array,step:import_ag_charts_core65.number},...import_ag_charts_core65.fontOptionsDef},series:(0,import_ag_charts_core65.arrayOfDefs)((0,import_ag_charts_core65.typeUnion)({area:without2(NewAreaSeriesModule.options,[...commonIgnoredMiniChartProperties,"type"]),bar:without2(NewBarSeriesModule.options,[...barIgnoredMiniChartProperties,"type"]),"box-plot":without2(BoxPlotSeriesModule.options,[...boxPlotIngnoredMiniChartProperties,"type"]),bubble:without2(NewBubbleSeriesModule.options,[...bubbleIgnoredMiniChartProperties,"type"]),candlestick:without2(CandlestickSeriesModule.options,[...commonIgnoredMiniChartProperties,"type"]),heatmap:without2(HeatmapSeriesModule.options,[...heatmapIgnoredMiniChartProperties,"type"]),histogram:without2(NewHistogramSeriesModule.options,[...histogramIgnoredMiniChartProperties,"type"]),line:without2(NewLineSeriesModule.options,[...lineIgnoredMiniChartProperties,"type"]),ohlc:without2(OhlcSeriesModule.options,[...commonIgnoredMiniChartProperties,"type"]),"range-area":without2(RangeAreaSeriesModule.options,[...rangeAreaIgnoredMiniChartProperties,"type"]),"range-bar":without2(RangeBarSeriesModule.options,[...rangeBarIgnoredMiniChartProperties,"type"]),scatter:without2(NewScatterSeriesModule.options,[...scatterIgnoredMiniChartProperties,"type"]),waterfall:without2(WaterfallSeriesModule.options,[...waterfallIgnoredMiniChartProperties,"type"])},"miniChart series options"))}},validMiniChartSeriesTypes=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],priceVolumePresetIgnoredMiniChartProperties=["itemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","highlight","lineDash","lineDashOffset","strokeWidth"];function miniChartSeriesTheme(t,e){return{$merge:[{$switch:[e,{},[["area","line","range-area"],{marker:{enabled:{$isUserOption:["/series/$index/marker/enabled",{$path:["/series/$index/marker/enabled",!1]},!1]}}}]]},{$omit:[{$switch:[e,commonIgnoredMiniChartProperties,["bar",barIgnoredMiniChartProperties],["box-plot",boxPlotIngnoredMiniChartProperties],["bubble",bubbleIgnoredMiniChartProperties],["heatmap",heatmapIgnoredMiniChartProperties],["histogram",histogramIgnoredMiniChartProperties],["line",[...lineIgnoredMiniChartProperties,...priceVolumePresetIgnoredMiniChartProperties]],["range-area",rangeAreaIgnoredMiniChartProperties],["range-bar",rangeBarIgnoredMiniChartProperties],["scatter",scatterIgnoredMiniChartProperties],["waterfall",waterfallIgnoredMiniChartProperties]]},t]}]}}var NAVIGATOR_THEME={enabled:!1,height:{$if:[{$path:"./miniChart/enabled"},40,18]},cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:import_ag_charts_community156._ModuleSupport.FONT_SIZE_RATIO.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0},series:{$apply:[miniChartSeriesTheme({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:validMiniChartSeriesTypes.map(t=>({$eq:[{$path:"/series/0/type"},t]}))},{$map:[miniChartSeriesTheme({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}},NavigatorModule={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Navigator(t),removable:!1,themeTemplate:{navigator:NAVIGATOR_THEME}},import_ag_charts_community158=require("ag-charts-community"),import_ag_charts_community157=require("ag-charts-community"),{ToolbarButtonProperties:ToolbarButtonProperties3,Property:Property56}=import_ag_charts_community157._ModuleSupport,RangesButtonProperties=class extends ToolbarButtonProperties3{};__decorateClass([Property56],RangesButtonProperties.prototype,"value",2);var{ChartAxisDirection:ChartAxisDirection19,LayoutElement:LayoutElement3,PropertiesArray:PropertiesArray5,Toolbar,Property:Property57}=import_ag_charts_community158._ModuleSupport,Ranges=class extends import_ag_charts_community158._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.buttons=new PropertiesArray5(RangesButtonProperties),this.verticalSpacing=10,this.container=t.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new Toolbar(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),t.layoutManager.registerElement(LayoutElement3.ToolbarBottom,this.onLayoutStart.bind(this)),t.eventsHub.on("zoom:change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.toolbar.getElement().remove(),this.toolbar.destroy()}onLayoutStart(t){const{buttons:e,ctx:i,enabled:o,toolbar:s,verticalSpacing:a}=this,{layoutBox:r}=t;if(!o||!i.zoomManager.isZoomEnabled()){s.setHidden(!0);return}s.setHidden(!1),s.updateButtons(e);const n=s.getBounds().height;s.setBounds({x:r.x,y:r.y+r.height-n,width:r.width,height:n}),r.shrink({bottom:n+a})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:t}}){const{zoomManager:e}=this.ctx,i=this.buttons.at(t);if(!i)return;const{value:o}=i;o==null?e.resetZoom("zoom-buttons"):typeof o=="number"?e.extendToEnd("zoom-buttons",ChartAxisDirection19.X,o):Array.isArray(o)?e.updateWith("zoom-buttons",ChartAxisDirection19.X,()=>o):typeof o=="function"&&e.updateWith("zoom-buttons",ChartAxisDirection19.X,o),this.toolbar.toggleActiveButtonByIndex(t)}};__decorateClass([Property57],Ranges.prototype,"enabled",2),__decorateClass([Property57],Ranges.prototype,"buttons",2);var DAY=1e3*60*60*24,MONTH=DAY*30,YEAR=DAY*365,RangesModule={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new Ranges(t),themeTemplate:{ranges:{enabled:!1,buttons:{$shallowSimple:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:MONTH},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*MONTH},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*MONTH},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(t,e)=>[new Date(`${new Date(e).getFullYear()}-01-01`).getTime(),void 0]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:YEAR},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:void 0}]}}}},import_ag_charts_community159=require("ag-charts-community"),_SharedToolbar=class mt extends import_ag_charts_community159._ModuleSupport.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(e){return this.sharedToolbar||this.createSharedToolbar(),e==="chartToolbar"&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(e)}createSharedToolbar(){this.sharedToolbar=new import_ag_charts_community159._ModuleSupport.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register(()=>{this.sharedToolbar&&(this.sharedToolbar.getElement().remove(),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(e){const i=this.sharedToolbar,o={layout:(s,a)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==e&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=e;const r=i.getBounds().width;i.setBounds({x:s.x,y:s.y,width:r}),s.shrink({left:r+i.horizontalSpacing+(a??0)})},addToolbarListener:(s,a)=>i.addToolbarListener(s,r=>{const n=this.getSectionIndex(e,r.button.index);if(n<0)return;const l={...r,button:this.sectionButtons[e][n]};a(l)}),updateButtons:s=>{this.sectionButtons[e]=s;const a=mt.SECTION_ORDER.flatMap(r=>this.sectionButtons[r]);i.updateButtons(a)},updateButtonByIndex:(s,a)=>{i.updateButtonByIndex(this.getIndex(e,s),a)},toggleActiveButtonByIndex:s=>{i.toggleActiveButtonByIndex(this.getIndex(e,s))},toggleButtonEnabledByIndex:(s,a)=>{i.toggleButtonEnabledByIndex(this.getIndex(e,s),a)},setHidden:s=>{s?this.activeSections.delete(e):this.activeSections.add(e);let a=0;for(const r of mt.SECTION_ORDER){if(r!==e){a+=this.sectionButtons[r].length;continue}for(const n of this.sectionButtons[e].keys())i.setButtonHiddenByIndex(a+n,s)}},destroy:()=>{o.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return o.setHidden(!1),o}getIndex(e,i){let o=0;for(const s of mt.SECTION_ORDER){if(s===e)return o+i;o+=this.sectionButtons[s].length}return-1}getSectionIndex(e,i){let o=0;for(const s of mt.SECTION_ORDER){if(s===e)return i>=o+this.sectionButtons[e].length?-1:i-o;o+=this.sectionButtons[s].length}return-1}};_SharedToolbar.SECTION_ORDER=["chartToolbar","annotations"];var SharedToolbar=_SharedToolbar,SharedToolbarModule={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new SharedToolbar(t)},import_ag_charts_community161=require("ag-charts-community"),import_ag_charts_community160=require("ag-charts-community"),import_ag_charts_core66=require("ag-charts-core"),{ZIndexMap:ZIndexMap8,LayoutElement:LayoutElement4,Property:Property58,BaseProperties:BaseProperties20,valueProperty:valueProperty9,Group:Group7,Label:Label5,Rect:Rect4,Text}=import_ag_charts_community160._ModuleSupport,chartConfigurations={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},itemIdMap={up:"positive",down:"negative"},neutralColorMap={hlc:"altNeutral"},StatusBarBackground=class extends BaseProperties20{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};__decorateClass([Property58],StatusBarBackground.prototype,"fill",2),__decorateClass([Property58],StatusBarBackground.prototype,"fillOpacity",2);var StatusBar=class extends import_ag_charts_community160._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Label5,this.positive=new Label5,this.negative=new Label5,this.neutral=new Label5,this.altNeutral=new Label5,this.background=new StatusBarBackground,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new Group7({name:"StatusBar",zIndex:ZIndexMap8.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new import_ag_charts_community160._ModuleSupport.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new Rect4),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new Text),value:this.labelGroup.appendChild(new Text),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=t.highlightManager,this.labelGroup.visible=!1,this.cleanup.register(t.scene.attachNode(this.layer),t.layoutManager.registerElement(LayoutElement4.Overlay,e=>this.startPerformLayout(e)),t.eventsHub.on("layout:complete",e=>this.onLayoutComplete(e)),t.eventsHub.on("highlight:change",()=>this.updateHighlight()))}async processData(t){if(!this.enabled||this.data==null)return;const e=[];for(const a of this.labels){const{id:r,key:n}=a,l=this[n];l==null?a.domain=void 0:e.push(valueProperty9(l,"number",{id:r}))}if(e.length===0)return;const i=import_ag_charts_community160._ModuleSupport.DataSet.wrap(this.data)??import_ag_charts_community160._ModuleSupport.DataSet.empty(),{processedData:o,dataModel:s}=await t.request(this.id,i,{props:e});for(const a of this.labels){const{id:r,key:n}=a;this[n]!=null&&(a.domain=s.getDomain(this,r,"value",o))}}startPerformLayout(t){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:e}=t,i=4,o=12,s=0,a=8;this.labelGroup.translationY=e.y+s;const r=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),n=(0,import_ag_charts_core66.calcLineHeight)(r),l=chartConfigurations[this.getChartType()]??0;let c=0,h,d="alphabetic";if(this.layoutStyle==="block")e.shrink(s+n+a,"top"),h=r+(n-r)/2;else{const{title:u}=this.ctx.chartService;if(d="top",h=s+u.padding,u.enabled){const p=u.node.getBBox();c=p.x+p.width+o}else c=u.padding}for(const{label:u,configuration:p,title:g,value:y,domain:f,formatter:x}of this.labels){if(f==null||!(l&p)){g.visible=!1,y.visible=!1;continue}const b=(0,import_ag_charts_core66.cachedTextMeasurer)(this.positive),m=(0,import_ag_charts_core66.cachedTextMeasurer)(this.negative),S=Math.max(b.textWidth(x.format(f[0])),b.textWidth(x.format(f[1])),m.textWidth(x.format(f[0])),m.textWidth(x.format(f[1])));g.visible=!0,y.visible=!0;const v=(0,import_ag_charts_core66.cachedTextMeasurer)(this.title).measureLines(u);g.setFont(this.title),g.fill=this.title.color,g.text=u,g.textBaseline=d,g.y=h,g.x=c,c+=v.width+i,y.textBaseline=d,y.y=h,y.x=c,c+=S+o}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-o,this.backgroundNode.height=n+s+a,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(t){this.labelGroup.translationX=t.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const t=this.highlightManager.getActiveHighlight(),e=t?.datum??this.data?.at(-1);if(e==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=t?.itemId;let o=i==null?void 0:itemIdMap[i];o==null&&this.openKey!=null&&this.closeKey!=null&&(e[this.openKey]new StatusBar(t),themeTemplate:{statusBar:{enabled:!1,layoutStyle:import_ag_charts_community161._ModuleSupport.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"chartBackgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}},import_ag_charts_community162=require("ag-charts-community"),import_ag_charts_core68=require("ag-charts-core"),import_ag_charts_core67=require("ag-charts-core"),UNIT_MIN=0,UNIT_MAX=1,UNIT_SIZE=UNIT_MAX-UNIT_MIN,DEFAULT_ANCHOR_POINT_X="end",DEFAULT_ANCHOR_POINT_Y="middle",ZOOM_VALID_CHECK_DEBOUNCE=300,constrain=(t,e=UNIT_MIN,i=UNIT_MAX)=>(0,import_ag_charts_core67.clamp)(e,t,i);function unitZoomState(){return{x:{min:UNIT_MIN,max:UNIT_MAX},y:{min:UNIT_MIN,max:UNIT_MAX}}}function dx(t){return t.x.max-t.x.min}function dy(t){return t.y.max-t.y.min}function isZoomRangeEqual(t,e){return(0,import_ag_charts_core67.isNumberEqual)(t.min,e.min)&&(0,import_ag_charts_core67.isNumberEqual)(t.max,e.max)}function isZoomEqual(t,e){return isZoomRangeEqual(t.x,e.x)&&isZoomRangeEqual(t.y,e.y)}function isMaxZoom(t){return isZoomEqual(t,unitZoomState())}function definedZoomState(t){return{x:{min:t?.x?.min??UNIT_MIN,max:t?.x?.max??UNIT_MAX},y:{min:t?.y?.min??UNIT_MIN,max:t?.y?.max??UNIT_MAX}}}function pointToRatio(t,e,i){if(!t)return{x:0,y:0};const o=constrain(e-t.x,0,t.x+t.width),s=constrain(i-t.y,0,t.y+t.height),a=1/t.width*o,r=1-1/t.height*s;return{x:constrain(a),y:constrain(r)}}function translateZoom(t,e,i){return{x:{min:t.x.min+e,max:t.x.max+e},y:{min:t.y.min+i,max:t.y.max+i}}}function scaleZoom(t,e,i){return{x:{min:t.x.min,max:t.x.min+dx(t)*e},y:{min:t.y.min,max:t.y.min+dy(t)*i}}}function scaleZoomCenter(t,e,i){const o=dx(t),s=dy(t),a=t.x.min+o/2,r=t.y.min+s/2;return{x:{min:a-o*e/2,max:a+o*e/2},y:{min:r-s*i/2,max:r+s*i/2}}}function scaleZoomAxisWithAnchor(t,e,i,o){const{min:s,max:a}=e,r=s+(a-s)/2,n=t.max-t.min;switch(i){case"start":return{min:s,max:e.min+n};case"end":return{min:e.max-n,max:a};case"middle":return{min:r-n/2,max:r+n/2};case"pointer":return scaleZoomAxisWithPoint(t,e,o??r);default:return{min:s,max:a}}}function scaleZoomAxisWithPoint(t,e,i){const o=t.max-t.min,s=e.max-e.min,a=i*(1-(s-o)),r=i-a,n=t.min+r,l=t.max+r;return{min:n,max:l}}function multiplyZoom(t,e,i){return{x:{min:t.x.min*e,max:t.x.max*e},y:{min:t.y.min*i,max:t.y.max*i}}}function constrainZoom(t){return{x:constrainAxis(t.x),y:constrainAxis(t.y)}}function constrainAxis(t){const e=t.max-t.min;let i=t.max>UNIT_MAX?UNIT_MAX-e:t.min,o=t.mino?.valueOf()),i.map(o=>o?.valueOf())):!(0,import_ag_charts_core68.arraysEqual)(e,i)}var ChartSync=class extends BaseProperties21{constructor(t){super(),this.moduleContext=t,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="key",this.domainSync=new import_ag_charts_core68.AsyncAwaitQueue}updateSiblings(t){const{syncManager:e}=this.moduleContext;for(const i of e.getGroupSiblings(t??this.groupId))debug("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(t,e=ChartUpdateType2.PROCESS_DOMAIN){debug("ChartSync.updateChart()",t.id,ChartUpdateType2[e],t),e===ChartUpdateType2.PROCESS_DOMAIN?t.ctx.updateService.update(e,{forceNodeDataRefresh:!0}):t.ctx.updateService.update(e)}enabledZoomSync(){const{eventsHub:t}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=t.on("zoom:change",this.onZoom.bind(this))}onZoom(){const{syncManager:t}=this.moduleContext;for(const e of t.getGroupSiblings(this.groupId)){if(!e.modulesManager.getModule("sync")?.zoom)continue;const i=e.modulesManager.getModule("zoom");if(!i)continue;const o=this.prepareZoomUpdate();debug("ChartsSyncManager.enabledZoomSync()",e.id,o),i.updateSyncZoom(o)}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.(),this.disableNodeInteractionSync=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this))}onHighlightChange(t){const{syncManager:e}=this.moduleContext;if(t.callerId.endsWith("-sync"))return;debug("ChartSync.onHighlightChange()",t);const i=t.currentHighlight?.series,[o]=syncedDirections(this.axes),s=o===ChartAxisDirection20.X?ChartAxisDirection20.Y:ChartAxisDirection20.X,[a,r]=i?getDirectionKeys(i,o,s):[],n=readDatum(t.currentHighlight);let l=a?.[0]?n?.[a[0]]:void 0,c=!1;if((0,import_ag_charts_core68.isDate)(l)&&(c=!0,l=l.getTime()),!t.currentHighlight?.datum){for(const d of e.getGroupSiblings(this.groupId))d.modulesManager.getModule("sync")?.nodeInteraction&&(d.ctx.highlightManager.updateHighlight(`${d.id}-sync`),d.ctx.tooltipManager.removeTooltip(`${d.id}-sync`));return}const h=e.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(o,s,h?r:[],c,l,t)}findMatchingHighlightNodes(t,e,i,o,s,a){const{syncManager:r}=this.moduleContext;debug("ChartSync.findMatchingHighlightNodes()",{mainDirection:t,secondaryKeys:i});for(const n of r.getGroupSiblings(this.groupId)){if(!n.modulesManager.getModule("sync")?.nodeInteraction)continue;let l=!1;for(const c of n.axes){if(!CartesianAxis.is(c)||c.direction!==t)continue;const h=n.series.filter(d=>{if(!d.visible)return!1;if(i.length>0){const[,u]=getDirectionKeys(d,t,e);return i.every(p=>u.includes(p))}return!0}).map(this.findMatchingNodes(c,t,o,s)).filter(import_ag_charts_core68.isDefined);if(h.length===1&&h[0]?.nodeDatum!==n.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(n,h[0].nodeDatum),l=!0;break}}l||(debug("ChartSync.findMatchingHighlightNodes() - no matching nodes",n.id,a),this.dispatchHighlightUpdate(n))}}findMatchingNodes(t,e,i,o){return s=>{const a=s.getKeys(t.direction);if(t.keys.length&&!t.keys.some(d=>a.includes(d)))return;const r=s.contextNodeData?.nodeData??[];if(!r?.length)return;const n=r[0],l=`${e}Key`;if(!isObjectWithStringProperty(n,l))return;const c=n[l],h=r.find(d=>{const u=d.datum[c];return i?u.getTime()===o:u===o});return h?{series:s,nodeDatum:h}:null}}dispatchHighlightUpdate(t,e){debug("ChartSync.dispatchHighlightUpdate()",t.id,e),t.ctx.highlightManager.updateHighlight(`${t.id}-sync`,e);const i=e?.series.tooltipEnabled??t.tooltip.enabled;if(e&&i){const o=t.seriesAreaBoundingBox,s=o.x+(e.midPoint?.x??e.point?.x??0),a=o.y+(e.midPoint?.y??e.point?.y??0),r=TooltipManager.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:a},e.series,e,void 0);t.ctx.tooltipManager.updateTooltip(`${t.id}-sync`,r,t.getTooltipContent(e.series,e.datumIndex,e,"tooltip"))}else t.ctx.tooltipManager.removeTooltip(`${t.id}-sync`);this.updateChart(t,ChartUpdateType2.SERIES_UPDATE)}async getSyncedDomain(t){if(!CartesianAxis.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{groupState:e,directionDomains:i,domainsByKey:o,positionDomains:s}=this.updateDomainState(t);return this.validateAxis(t,e),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(t,s):this.domainMode==="direction"||t.keys.length===0?this.calculateDerivedDomain(t,i):this.calculateKeyDerivedDomain(t,o)}updateDomainState(t){var e,i,o,s,a;const{syncManager:r}=this.moduleContext,n=r.getChart().id,l=t.id,c=r.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),d=h[e=t.direction]??(h[e]={derived:[],sources:{},dirty:!0}),u=(i=d.sources)[n]??(i[n]={});u[l]=t.dataDomain.domain,d.dirty=!0;const p=c.domainsByKey??(c.domainsByKey={});for(const x of t.keys??[]){const b=p[x]??(p[x]={derived:[],sources:{},dirty:!0}),m=(o=b.sources)[n]??(o[n]={});m[l]=t.dataDomain.domain,b.dirty=!0}const g=c.domainsByPosition??(c.domainsByPosition={}),y=g[s=t.position]??(g[s]={derived:[],sources:{},dirty:!0}),f=(a=y.sources)[n]??(a[n]={});return f[l]=t.dataDomain.domain,y.dirty=!0,{groupState:c,directionDomains:d,domainsByKey:p,positionDomains:y}}validateAxis(t,e){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";syncedDirections(this.axes).includes(t.direction)&&(i?this.validateMultiSeries(t,e):this.validateSingleSeries(t,e))}validateMultiSeries(t,e){const{min:i,max:o,nice:s,reverse:a}=t,r=new Set(t.boundSeries.flatMap(n=>n.getKeys(t.direction)));for(const n of e.members){const{axes:l,modulesManager:c}=n,h=syncedDirections(c.getModule("sync")?.axes),d=l.filter(p=>h.includes(p.direction)).filter(p=>p.boundSeries.some(g=>g.getKeys(p.direction).some(y=>r.has(y))));if(d.length===0)continue;const[u]=d;if(u.min!==i||u.max!==o||u.nice!==s||u.reverse!==a){import_ag_charts_core68.Logger.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),this.enabled=!1;return}}}validateSingleSeries(t,e){const i=e.members,[{axes:o}]=i,{direction:s,min:a,max:r,nice:n,reverse:l}=t;for(const c of o)if(s===c.direction&&(n!==c.nice||l!==c.reverse||a!==c.min&&((0,import_ag_charts_core68.isFiniteNumber)(a)||(0,import_ag_charts_core68.isFiniteNumber)(c.min))||r!==c.max&&((0,import_ag_charts_core68.isFiniteNumber)(r)||(0,import_ag_charts_core68.isFiniteNumber)(c.max)))){import_ag_charts_core68.Logger.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}}calculateDerivedDomain(t,e){if(!e.dirty)return e.derived;const i=e.derived;return e.derived=(0,import_ag_charts_core68.unique)(Object.values(e.sources).map(o=>Object.values(o)).flat(2)),ContinuousScale6.is(t.scale)&&(e.derived=findMinMax4(e.derived)),e.dirty=!1,domainChanged(t.scale,i,e.derived)&&(debug(t.id,"updated",t.keys,{before:i,after:e.derived}),this.updateSiblings()),e.derived}calculateKeyDerivedDomain(t,e){let i=[],o=[],s=!1;for(const a of t.keys??[]){const r=e[a],n=r.derived;if(i.push(...n),!r.dirty){o.push(...r.derived);continue}r.derived=(0,import_ag_charts_core68.unique)(Object.values(r.sources).map(l=>Object.values(l)).flat(2)),ContinuousScale6.is(t.scale)&&(r.derived=findMinMax4(r.derived)),o.push(...r.derived),r.dirty=!1,s||(s=!(0,import_ag_charts_core68.arraysEqual)(n,r.derived))}return ContinuousScale6.is(t.scale)&&(i=findMinMax4(i),o=findMinMax4(o)),s&&domainChanged(t.scale,i,o)&&(debug(t.id,"updated",t.keys,{before:i,after:o}),this.updateSiblings()),o}removeAxis(t){if(!CartesianAxis.is(t)||this.axes!=="xy"&&this.axes!==t.direction)return;const{syncManager:e}=this.moduleContext,i=e.getGroupState(this.groupId),o=e.getChart().id,s=t.id;delete i?.domains?.[t.direction]?.sources?.[o]?.[s];for(const a of t.keys??[])delete i?.domainsByKey?.[a]?.sources?.[o]?.[s];delete i?.domainsByPosition?.[t.position]?.sources?.[o]?.[s]}async waitForDomainsToBeReady(){const{syncManager:t}=this.moduleContext;let e=0;for(;t.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)debug("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.await(),e++;e>0&&debug("ChartSync.waitForDomainsToBeReady() - waited for",e,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const{zoomManager:t}=this.moduleContext,e=t.getZoom();return this.axes==="x"?delete e?.y:this.axes==="y"&&delete e?.x,definedZoomState(e)}onEnabledChange(){const{syncManager:t}=this.moduleContext;this.enabled?t.subscribe(this.groupId):t.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(t,e){if(!this.enabled||t===e)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(e),i.subscribe(t),this.updateSiblings(e),this.updateSiblings(t)}onAxesChange(){if(!this.enabled)return;const{syncManager:t}=this.moduleContext;this.updateChart(t.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:t}=this.moduleContext;t.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};ChartSync.className="Sync",__decorateClass([Property59,ObserveChanges4(t=>t.onEnabledChange())],ChartSync.prototype,"enabled",2),__decorateClass([Property59,ObserveChanges4((t,e,i)=>t.onGroupIdChange(e,i))],ChartSync.prototype,"groupId",2),__decorateClass([Property59,ObserveChanges4(t=>t.onAxesChange())],ChartSync.prototype,"axes",2),__decorateClass([Property59,ObserveChanges4(t=>t.onNodeInteractionChange())],ChartSync.prototype,"nodeInteraction",2),__decorateClass([Property59,ObserveChanges4(t=>t.onZoomChange())],ChartSync.prototype,"zoom",2),__decorateClass([Property59,ObserveChanges4(t=>t.onAxesChange())],ChartSync.prototype,"domainMode",2);var SyncModule={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:t=>new ChartSync(t),themeTemplate:{sync:{enabled:!1}}},import_ag_charts_community170=require("ag-charts-community"),import_ag_charts_core74=require("ag-charts-core"),import_ag_charts_community163=require("ag-charts-community"),{Property:Property60}=import_ag_charts_community163._ModuleSupport,VALID_COLOR="#2196f3",INVALID_COLOR="#8a8a8a",ZoomRect=class extends import_ag_charts_community163._ModuleSupport.Rect{constructor(){super(...arguments),this.fill=VALID_COLOR,this.fillOpacity=.2,this.zIndex=import_ag_charts_community163._ModuleSupport.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=VALID_COLOR}updateInvalid(){this.fill=INVALID_COLOR}};ZoomRect.className="ZoomRect",__decorateClass([Property60],ZoomRect.prototype,"fill",2),__decorateClass([Property60],ZoomRect.prototype,"fillOpacity",2);var import_ag_charts_community164=require("ag-charts-community"),ZoomAxisDragger=class{update(t,e,i,o,s,a){return this.oldZoom??(this.oldZoom=definedZoomState(e===import_ag_charts_community164._ModuleSupport.ChartAxisDirection.X?{...s,x:a}:{...s,y:a})),this.updateCoords(t.offsetX,t.offsetY),this.updateZoom(e,i,o)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(t,e){this.coords?(this.coords.x2=t,this.coords.y2=e):this.coords={x1:t,y1:e,x2:t,y2:e}}updateZoom(t,e,i){const{coords:o,oldZoom:s}=this;let a=definedZoomState(s);if(!o||!s)return t===import_ag_charts_community164._ModuleSupport.ChartAxisDirection.X?a.x:a.y;const r=pointToRatio(i,o.x1,o.y1),n=pointToRatio(i,o.x2,o.y2);if(t===import_ag_charts_community164._ModuleSupport.ChartAxisDirection.X){const c=(n.x-r.x)*dx(s);return a.x.max+=c,a.x=scaleZoomAxisWithAnchor(a.x,s.x,e,r.x),a=constrainZoom(a),a.x}const l=(n.y-r.y)*dy(s);return a.y.max-=l,a.y=scaleZoomAxisWithAnchor(a.y,s.y,e,r.y),a=constrainZoom(a),a.y}},ZoomContextMenu=class{constructor(t,e,i,o,s,a,r,n){this.eventsHub=t,this.contextMenuRegistry=e,this.zoomManager=i,this.getModuleProperties=o,this.canResetZoom=s,this.getRect=a,this.updateZoom=r,this.isZoomValid=n}registerActions(t){const{contextMenuRegistry:e}=this,i=t?"show":"hide";if(e.toggle("zoom-to-cursor",i),e.toggle("pan-to-cursor",i),e.toggle("reset-zoom",i),!t)return;e.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),e.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),e.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const o=r=>{const n=this.getRect();if(!n)return!0;const l=pointToRatio(n,r.x,r.y);return this.iterateFindNextZoomAtPoint(l)!=null},s=()=>!isZoomEqual(definedZoomState(this.zoomManager.getZoom()),unitZoomState()),a=this.eventsHub.on("context-menu:setup",r=>{e.builtins.items["zoom-to-cursor"].enabled=o(r),e.builtins.items["pan-to-cursor"].enabled=s(),e.builtins.items["reset-zoom"].enabled=this.canResetZoom()});return()=>{a(),e.toggle("zoom-to-cursor","hide"),e.toggle("pan-to-cursor","hide"),e.toggle("reset-zoom","hide")}}computeOrigin(t){const e=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!e||!t?.target||!(t instanceof MouseEvent))return;const o={x:0,y:0,width:e.width,height:e.height};return pointToRatio(o,t.offsetX,t.offsetY)}onZoomToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=this.iterateFindNextZoomAtPoint(e);i!=null&&this.updateZoom(i)}onPanToHere({event:t}){const e=this.computeOrigin(t);if(!e)return;const i=definedZoomState(this.zoomManager.getZoom()),o=dx(i),s=dy(i),a=e.x*o,r=e.y*s,n=UNIT_SIZE/2;let l={x:{min:e.x-n,max:e.x+n},y:{min:e.y-n,max:e.y+n}};l=scaleZoomCenter(l,o,s),l=translateZoom(l,i.x.min-e.x+a,i.y.min-e.y+r),this.updateZoom(constrainZoom(l))}onResetZoom(t){this.zoomManager.resetZoom("zoom")}iterateFindNextZoomAtPoint(t){const{scrollingStep:e}=this.getModuleProperties();for(let i=e;i<=1-e;i+=e){const o=this.getNextZoomAtPoint(t,i);if(this.isZoomValid(o))return o}}getNextZoomAtPoint(t,e){const{isScalingX:i,isScalingY:o}=this.getModuleProperties(),s=definedZoomState(this.zoomManager.getZoom()),a=t.x*dx(s),r=t.y*dy(s),n=UNIT_SIZE/2;let l={x:{min:t.x-n,max:t.x+n},y:{min:t.y-n,max:t.y+n}};return l=scaleZoomCenter(l,i?dx(s)*e:UNIT_SIZE,o?dy(s)*e:UNIT_SIZE),l=translateZoom(l,s.x.min-t.x+a,s.y.min-t.y+r),constrainZoom(l)}},import_ag_charts_community165=require("ag-charts-community"),import_ag_charts_core69=require("ag-charts-core"),{ChartAxisDirection:ChartAxisDirection21}=import_ag_charts_community165._ModuleSupport,ZoomDOMProxy=class{constructor(t){this.axesHandlers=t,this.axes=[],this.overlappingAxisIds=new Set}destroy(){for(const t of this.axes)t.div.destroy()}update(t,e,i,o){this.seriesRect=o;for(const c of this.axes)c.div.setHidden(!t&&!e);if(!t&&!e)return;const{X:s,Y:a}=ChartAxisDirection21,r=[...i.axisManager.getAxisContext(s),...i.axisManager.getAxisContext(a)],{removed:n,added:l}=this.diffAxisIds(r);n.length>0&&(this.axes=this.axes.filter(c=>n.includes(c.axisId)?(c.div.destroy(),this.overlappingAxisIds.delete(c.axisId),this.hoveredAxisId===c.axisId&&(this.hoveredAxisId=void 0),this.activeAxisId===c.axisId&&(this.activeAxisId=void 0),!1):!0));for(const c of l){const{axisId:h,direction:d}=c;this.axes.push(this.initAxis(i,h,this.axesHandlers,d))}for(const c of this.axes){const d=r.find(u=>u.axisId===c.axisId).getCanvasBounds();c.div.setHidden((0,import_ag_charts_core69.boxEmpty)(d)),d==null?c.bounds=void 0:(c.div.setBounds(d),c.bounds=new import_ag_charts_community165._ModuleSupport.BBox(d.x,d.y,d.width,d.height))}this.updateOverlappingAxisPointerEvents(t,e)}setAxisCursor(t){this.cursor=t;for(const e of this.axes)e.div.setCursor(this.getCursor(e.direction))}toggleAxisDraggingCursor(t,e){for(const i of this.axes)i.direction===t&&i.div.setCursor(e?this.getCursor(t):void 0)}updateOverlappingAxisPointerEvents(t,e){this.overlappingAxisIds.clear();const i=(t||e)&&this.seriesRect;for(const o of this.axes){if(!i){o.div.setPointerEvents(void 0);continue}!!o.bounds?.collidesBBox(this.seriesRect)?(this.overlappingAxisIds.add(o.axisId),o.div.setPointerEvents("none")):o.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.activeAxisId&&!this.overlappingAxisIds.has(this.activeAxisId)&&(this.activeAxisId=void 0)}pickAxisAtPoint(t,e){for(const i of this.axes)if(this.overlappingAxisIds.has(i.axisId)&&i.bounds?.containsPoint(t,e))return{axisId:i.axisId,direction:i.direction}}setHoveredAxis(t){this.overlappingAxisIds.has(t)&&(this.hoveredAxisId=t)}clearHoveredAxis(){this.activeAxisId||(this.hoveredAxisId=void 0)}beginDelegatedAxisDrag(t){return this.overlappingAxisIds.has(t)?(this.activeAxisId=t,this.hoveredAxisId=void 0,!0):!1}endDelegatedAxisDrag(t){this.activeAxisId===t&&(this.activeAxisId=void 0),this.hoveredAxisId=void 0}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getHoveredAxis(){if(!this.hoveredAxisId)return;const t=this.axes.find(e=>e.axisId===this.hoveredAxisId);return t?{axisId:t.axisId,direction:t.direction}:void 0}getCursor(t){return this.cursor?this.cursor:t===ChartAxisDirection21.X?"ew-resize":"ns-resize"}initAxis(t,e,i,o){const s="afterend",a=t.proxyInteractionService.createProxyElement({type:"region",domManagerId:e,where:s});return a.setCursor(this.getCursor(o)),a.addListener("drag-start",r=>{r.device==="touch"&&r.sourceEvent.preventDefault(),this.activeAxisId=e,i.onAxisDragStart(o)}),a.addListener("drag-move",r=>i.onAxisDragMove(e,o,r)),a.addListener("drag-end",()=>{this.activeAxisId=void 0,this.hoveredAxisId=void 0,i.onAxisDragEnd()}),a.addListener("dblclick",()=>i.onAxisDoubleClick(e,o)),a.addListener("wheel",r=>i.onAxisWheel(e,o,r)),{axisId:e,div:a,direction:o}}diffAxisIds(t){const e=this.axes.map(a=>a.axisId),i=t.map(a=>a.axisId),o=e.filter(a=>!i.includes(a)),s=t.filter(a=>!e.includes(a.axisId));return{removed:o,added:s}}},import_ag_charts_community166=require("ag-charts-community"),import_ag_charts_core70=require("ag-charts-core"),maxZoomCoords=16,decelerationValues={off:1,short:.01,long:.002},ZoomPanner=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:t}=this;return Math.max(typeof t=="number"?t:decelerationValues[t]??1,1e-4)}addListener(t,e){return this.onUpdate=e,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(t){this.updateCoords(t.currentX,t.currentY);const{x1:e=0,y1:i=0,x2:o=0,y2:s=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?e-o:0,deltaY:this.isPanningY()?i-s:0})}start(t){this.direction=t,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:t}=this;let e=0,i=0,o=0;if(t.length>0){const s=this.zoomCoordsHistoryIndex%maxZoomCoords;let a=s-1;a<0&&(a=t.length-1);let r=s;r>=t.length&&(r=0);const n=t[a],l=t[r];e=this.isPanningX()?n.x-l.x:0,i=this.isPanningY()?n.y-l.y:0,o=n.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,o>0&&this.decelerationValue<1){const s=e/o,a=i/o,r=Math.hypot(s,a),n=Math.atan2(a,s),l=performance.now();this.inertiaHandle=(0,import_ag_charts_core70.getWindow)().requestAnimationFrame(c=>{this.animateInertia(c,c,l,r,n)})}}recordCurrentZoomCoords(){const{coords:t,coordsHistory:e,zoomCoordsHistoryIndex:i}=this;if(!t)return;const{x2:o,y2:s}=t,a=Date.now();e[i%maxZoomCoords]={x:o,y:s,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(t,e,i,o,s){const a=1-this.decelerationValue,r=-o/Math.log(a),n=o*(a**(e-i)-1)/Math.log(a),l=o*(a**(t-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(s)*(l-n):0,deltaY:this.isPanningY()?-Math.sin(s)*(l-n):0}),!(l>=r-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,t,i,o,s)}))}updateCoords(t,e){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:t,y2:e}:this.coords={x1:t,y1:e,x2:t,y2:e}}isPanningX(){return this.direction==null||this.direction===import_ag_charts_community166._ModuleSupport.ChartAxisDirection.X}isPanningY(){return this.direction==null||this.direction===import_ag_charts_community166._ModuleSupport.ChartAxisDirection.Y}translateZooms(t,e,i,o){const s=pointToRatio(t,t.x+Math.abs(i),t.y+t.height-Math.abs(o)),a=Math.sign(i)*s.x,r=-Math.sign(o)*s.y,n={};for(const[l,{direction:c,zoom:h}]of(0,import_ag_charts_core70.entries)(e)){if(h&&h.min===UNIT_MIN&&h.max===UNIT_MAX)continue;let d=definedZoomState({[c]:h});d=constrainZoom(translateZoom(d,a*dx(d),r*dy(d))),n[l]={direction:c,zoom:d[c]}}return n}},import_ag_charts_community167=require("ag-charts-community"),import_ag_charts_core71=require("ag-charts-core"),DELTA_SCALE=200,ZoomScrollPanner=class{update(t,e,i,o){const s=t.deltaX*e*DELTA_SCALE;return this.translateZooms(i,o,s)}translateZooms(t,e,i){const o={},s=pointToRatio(t,t.x+Math.abs(i),0),a=i<0?-s.x:s.x;for(const[r,{direction:n,zoom:l}]of(0,import_ag_charts_core71.entries)(e)){if(n!==import_ag_charts_community167._ModuleSupport.ChartAxisDirection.X)continue;let c=definedZoomState({x:l});c=constrainZoom(translateZoom(c,a*dx(c),0)),o[r]={direction:n,zoom:c.x}}return o}},import_ag_charts_community168=require("ag-charts-community"),import_ag_charts_core72=require("ag-charts-core"),ZoomScroller=class{updateAxes(t,e,i,o){const s=t.sourceEvent,a={},{anchorPointX:r,anchorPointY:n,isScalingX:l,isScalingY:c,scrollingStep:h}=e,d=pointToRatio(i,s.offsetX??s.clientX,s.offsetY??s.clientY);for(const[u,{direction:p,zoom:g}]of(0,import_ag_charts_core72.entries)(o)){if(g==null)continue;let y={...g};const f=h*t.deltaY*(g.max-g.min);if(p===import_ag_charts_community168._ModuleSupport.ChartAxisDirection.X&&l)y.max+=f,y=scaleZoomAxisWithAnchor(y,g,r,d.x);else if(p===import_ag_charts_community168._ModuleSupport.ChartAxisDirection.Y&&c)y.max+=f,y=scaleZoomAxisWithAnchor(y,g,n,d.y);else continue;y.max0&&this.rect.height>0}updateCoords(t,e,i,o){if(!this.coords){this.coords={x1:t,y1:e,x2:t,y2:e};return}const{coords:s}=this;if(s.x2=t,s.y2=e,!o)return;const{isScalingX:a,isScalingY:r,keepAspectRatio:n}=i,l=this.getNormalisedDimensions();if(n&&a&&r){const c=o.width/o.height;s.y2n&&sUNIT_MIN;break;case"pan-end":o=t.x.maxUNIT_MIN;break;case"pan-right":o=t.x.maxi.find(b=>b.identifier===n[x].identifier)),c=n[0].normalX,h=n[1].normalX,d=l[0].clientX,u=l[1].clientX,p=n[0].normalY,g=n[1].normalY,y=s+r-l[0].clientY,f=s+r-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,d,u,p,g,y,f,o,s,a,r)}end(t){const e=Array.from(t.sourceEvent.targetTouches).map(i=>i.identifier);return!e.includes(this.touchStart.origins[0].identifier)||!e.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(t,e,i,o,s,a,r,n,l,c,h,d){const{initialZoom:u,previous:p}=this,g=twitchTolerantZoomPan2(t,e,i,o,p,"a1","a2",l,h,u.x),y=twitchTolerantZoomPan2(s,a,r,n,p,"b1","b2",c,d,u.y);return{x:g,y}}};function twitchTolerantZoomPan2(t,e,i,o,s,a,r,n,l,c){if(t==e){const h=clientToNormal(c,i,n,l),d=clientToNormal(c,o,n,l),u=(h+d)/2,p=(t-u)/N;return{min:c.min+p,max:c.max+p}}else{const h=s[a],d=s[r];return Math.abs(i-h)+Math.abs(o-d)<=1?(i=h,o=d):(s[a]=i,s[r]=o),solveTwoUnknowns(t,e,i,o,n,l)}}var{ActionOnSet:ActionOnSet9,ChartAxisDirection:ChartAxisDirection23,ChartUpdateType:ChartUpdateType3,Property:Property62,InteractionState:InteractionState5,ProxyProperty:ProxyProperty3}=import_ag_charts_community170._ModuleSupport,round=t=>(0,import_ag_charts_core74.roundTo)(t,10),CURSOR_ID="zoom-cursor",TOOLTIP_ID="zoom-tooltip",ZoomAutoScaling=class extends import_ag_charts_community170._ModuleSupport.BaseProperties{constructor(t){super(),this.onChange=t,this.enabled=!1,this.padding=0}};__decorateClass([Property62,ActionOnSet9({changeValue(t){this.onChange({enabled:t,padding:this.padding})}})],ZoomAutoScaling.prototype,"enabled",2),__decorateClass([Property62,ActionOnSet9({changeValue(t){this.onChange({enabled:this.enabled,padding:t})}})],ZoomAutoScaling.prototype,"padding",2);var Zoom=class extends import_ag_charts_community170._ModuleSupport.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!1,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=UNIT_SIZE/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=DEFAULT_ANCHOR_POINT_X,this.anchorPointY=DEFAULT_ANCHOR_POINT_Y,this.autoScaling=new ZoomAutoScaling(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.axisDraggingMode="zoom",this.canResetZoom=i=>(i??(i=this.getZoom()),!isZoomEqual(i,this.getResetZoom())),this.buttons=new ZoomToolbar(this.ctx,this.getModuleProperties.bind(this),this.canResetZoom,this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new ZoomAxisDragger,this.panner=new ZoomPanner,this.scroller=new ZoomScroller,this.scrollPanner=new ZoomScrollPanner,this.twoFingers=new ZoomTwoFingers,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=(0,import_ag_charts_core74.debounce)(()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0},100),this.previousZoomValid=!0,this.previousAxisZoomValid={[import_ag_charts_community170._ModuleSupport.ChartAxisDirection.X]:!0,[import_ag_charts_community170._ModuleSupport.ChartAxisDirection.Y]:!0},this.toggleAxisDraggingCursorsDebounced=(0,import_ag_charts_core74.debounce)(this.toggleAxisDraggingCursors.bind(this),ZOOM_VALID_CHECK_DEBOUNCE,{leading:!0,trailing:!0});const e=new ZoomRect;this.selector=new ZoomSelector(e,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new ZoomContextMenu(t.eventsHub,t.contextMenuRegistry,t.zoomManager,this.getModuleProperties.bind(this),this.canResetZoom,()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new ZoomDOMProxy({onAxisDragStart:i=>this.onAxisDragStart(i),onAxisDragMove:(i,o,s)=>this.onAxisDragMove(i,o,s),onAxisDragEnd:()=>this.onAxisDragEnd(),onAxisDoubleClick:i=>this.onAxisDoubleClick(i),onAxisWheel:(i,o,s)=>this.onAxisWheel(i,o,s)}),t.widgets.seriesDragInterpreter&&this.cleanup.register(t.widgets.seriesDragInterpreter.events.on("dblclick",i=>this.onSeriesAreaDoubleClick(i)),t.widgets.seriesDragInterpreter.events.on("drag-move",i=>this.onSeriesAreaDragMove(i)),t.widgets.seriesDragInterpreter.events.on("drag-start",i=>this.onSeriesAreaDragStart(i)),t.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(t.scene.attachNode(e),t.eventsHub.on("series-area:hover",i=>this.onSeriesAreaHoverEvent(i)),t.eventsHub.on("series-area:click",i=>this.onSeriesAreaClickEvent(i)),t.eventsHub.on("series:keynav-zoom",i=>this.onNavZoom(i)),t.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),t.widgets.seriesWidget.addListener("touchstart",(i,o)=>this.onTouchStart(i,o)),t.widgets.seriesWidget.addListener("touchmove",(i,o)=>this.onTouchMove(i,o)),t.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),t.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),t.updateService.addListener("process-data",i=>this.onProcessData(i)),t.eventsHub.on("layout:complete",i=>this.onLayoutComplete(i)),t.eventsHub.on("zoom:change",i=>this.onZoomChange(i)),t.eventsHub.on("zoom:pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.domProxy.destroy()}onEnabledChange(t){this.ctx.zoomManager.setZoomModuleEnabled(t),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(t))}isIgnoredTouch(t){return t?.device!=="touch"?!1:this.ctx.chartService.touch.dragAction!=="drag"?!0:this.enableSelecting?!1:this.enablePanning?isMaxZoom(this.getZoom()):!0}onSeriesAreaDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i}=this;!e||!i||t?.preventZoomDblClick||!this.isState(InteractionState5.ZoomClickable)||this.resetZoom()}onSeriesAreaHoverEvent(t){if(!this.shouldHandleAxisHover(t)){this.clearHoveredAxis();return}const e=this.domProxy.pickAxisAtPoint(t.x,t.y);e?(this.domProxy.setHoveredAxis(e.axisId),this.ctx.domManager.updateCursor(CURSOR_ID,this.domProxy.getCursor(e.direction))):this.clearHoveredAxis()}onSeriesAreaClickEvent(t){if(!this.shouldHandleAxisClick(t))return;const e=this.domProxy.pickAxisAtPoint(t.x,t.y);e&&t.sourceEvent?.type==="dblclick"&&this.onAxisDoubleClick(e.axisId)}shouldHandleAxisHover(t){const{enabled:e,enableAxisDragging:i,enableAxisScrolling:o,dragState:s}=this;return e&&(i||o)&&!t.consumed&&!this.activeAxis&&s===0&&this.domProxy.hasOverlappingAxes()}shouldHandleAxisClick(t){const{enabled:e,enableAxisDragging:i,enableAxisScrolling:o,enableDoubleClickToReset:s}=this;return e&&!this.activeAxis&&!t.consumed&&(i||o||s)}clearHoveredAxis(){this.activeAxis||(this.domProxy.clearHoveredAxis(),this.dragState===0&&this.ctx.domManager.updateCursor(CURSOR_ID))}tryBeginAxisDelegation(t){const e=this.domProxy.getHoveredAxis();if(!this.enabled||!this.enableAxisDragging||!e||!this.domProxy.beginDelegatedAxisDrag(e.axisId))return!1;this.activeAxis=e,this.onAxisDragStart(e.direction);const i=this.dragState===2?"grabbing":this.domProxy.getCursor(e.direction);return this.ctx.domManager.updateCursor(CURSOR_ID,i),t.device==="touch"&&t.sourceEvent.preventDefault(),!0}onSeriesAreaDragStart(t){const{enabled:e,enablePanning:i,enableSelecting:o,ctx:{domManager:s,zoomManager:a}}=this;if(!e||!this.isState(InteractionState5.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(t)||(this.panner.stopInteractions(),this.tryBeginAxisDelegation(t)))return;let r=0;const n=this.isPanningKeyPressed(t.sourceEvent);i&&(!o||n)?(s.updateCursor(CURSOR_ID,"grabbing"),r=2,this.panner.start()):o&&!n&&(r=3),(this.dragState=r)!==0&&a.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(t){const{dragState:e,enabled:i,paddedRect:o,panner:s,selector:a,ctx:{interactionManager:r,tooltipManager:n,updateService:l}}=this;if(this.activeAxis){this.onAxisDragMove(this.activeAxis.axisId,this.activeAxis.direction,t);return}if(!(!i||!o||!this.isState(InteractionState5.ZoomDraggable)||this.isIgnoredTouch(t))){switch(r.pushState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag),t.device==="touch"&&t.sourceEvent.preventDefault(),e){case 2:s.update(t);break;case 3:a.update(t,this.getModuleProperties(),o);break;case 0:return}n.updateTooltip(TOOLTIP_ID),l.update(ChartUpdateType3.PERFORM_LAYOUT,{skipAnimations:!0})}}onSeriesAreaDragEnd(){const{ctx:{interactionManager:t}}=this;if(this.activeAxis){this.handleAxisDragEnd();return}t.popState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag),!(!this.enabled||this.dragState===0)&&(this.handleRegularDragEnd(),this.resetDragState())}handleAxisDragEnd(){this.onAxisDragEnd(),this.domProxy.endDelegatedAxisDrag(this.activeAxis.axisId),this.activeAxis=void 0,this.clearHoveredAxis()}handleRegularDragEnd(){const{panner:t,selector:e}=this;switch(this.dragState){case 2:t.stop();break;case 3:if(e.didUpdate()){const i=e.stop(this.seriesRect,this.paddedRect,this.getZoom());this.updateZoom(i)}break}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(CURSOR_ID),this.ctx.tooltipManager.removeTooltip(TOOLTIP_ID)}onAxisDoubleClick(t){const{enabled:e,enableDoubleClickToReset:i,ctx:{zoomManager:o}}=this;!e||!i||!this.isState(InteractionState5.ZoomClickable)||(this.previousAxisZoomValid={[ChartAxisDirection23.X]:!0,[ChartAxisDirection23.Y]:!0},o.resetAxisZoom("zoom",t))}onAxisDragStart(t){const{axisDraggingMode:e,domProxy:i,enabled:o,enableAxisDragging:s,panner:a,ctx:{zoomManager:r}}=this;!o||!s||(a.stopInteractions(),e==="pan"?(i.setAxisCursor("grabbing"),this.dragState=2,this.panner.start(t),r.fireZoomPanStartEvent("zoom")):this.dragState=1)}onAxisDragMove(t,e,i){const{anchorPointX:o,anchorPointY:s,axisDragger:a,dragState:r,enabled:n,enableAxisDragging:l,seriesRect:c,shouldFlipXY:h,ctx:{interactionManager:d,tooltipManager:u,updateService:p,zoomManager:g}}=this;if(!n||!l||!c)return;d.pushState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const y=this.getZoom();if(r===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let f=e===ChartAxisDirection23.X?o:s;h&&(f=e===ChartAxisDirection23.X?s:o);const x=g.getAxisZoom(t),b=a.update(i,e,f,c,y,x);g.setAxisManuallyAdjusted("zoom",t),this.updateAxisZoom(t,e,b,{directional:!0})}u.updateTooltip(TOOLTIP_ID),p.update(ChartUpdateType3.PERFORM_LAYOUT,{skipAnimations:!0})}onAxisDragEnd(){const{axisDraggingMode:t,axisDragger:e,dragState:i,domProxy:o,enabled:s,enableAxisDragging:a,ctx:{domManager:r,interactionManager:n,tooltipManager:l}}=this;n.popState(import_ag_charts_community170._ModuleSupport.InteractionState.ZoomDrag),!(!s||!a||i===0)&&(this.dragState=0,t==="pan"&&(o.setAxisCursor("grab"),this.panner.stop()),e.stop(),r.updateCursor(CURSOR_ID),l.removeTooltip(TOOLTIP_ID))}onNavZoom(t){const{enabled:e,enableScrolling:i,scroller:o}=this;!this.ctx.interactionManager.isState(import_ag_charts_community170._ModuleSupport.InteractionState.Default)||!e||!i||(t.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(o.updateDelta(t.delta,this.getModuleProperties(),this.getZoom())))}onWheel(t){const{enabled:e,enablePanning:i,enableScrolling:o,paddedRect:s}=this;if(!e||!o||!s||!this.isState(InteractionState5.ZoomWheelable))return;const{deltaX:a,deltaY:r}=t.sourceEvent,n=a!=null&&r!=null&&Math.abs(a)>Math.abs(r);i&&n?this.onWheelPanning(t):this.onWheelScrolling(t)}onWheelPanning(t){const{scrollingStep:e,scrollPanner:i,seriesRect:o,ctx:{zoomManager:s}}=this;if(!o)return;t.sourceEvent.preventDefault();const a=i.update(t,e,o,s.getAxisZooms());for(const[r,{direction:n,zoom:l}]of(0,import_ag_charts_core74.entries)(a))this.updateAxisZoom(r,n,l)}onWheelScrolling(t){const e=this.getZoom(),i=t.deltaY>0&&isMaxZoom(e);this.handleWheelScrolling(t,i)}onAxisWheel(t,e,i){const{enableAxisScrolling:o,ctx:{zoomManager:s}}=this;if(!o||e!==ChartAxisDirection23.X&&e!==ChartAxisDirection23.Y)return;const a=e===ChartAxisDirection23.X,r=!a,n=this.getModuleProperties({isScalingX:a,isScalingY:r}),l=this.getZoom(),c=i.deltaY>0&&l[e].min===UNIT_MIN&&l[e].max===UNIT_MAX;s.setAxisManuallyAdjusted("zoom",t),this.handleWheelScrolling(i,c,n)}handleWheelScrolling(t,e,i=this.getModuleProperties()){const{enableIndependentAxes:o,scroller:s,seriesRect:a,ctx:{zoomManager:r}}=this;if(!a)return;let n=!0;if(o===!0){const l=s.updateAxes(t,i,a,r.getAxisZooms());for(const[c,{direction:h,zoom:d}]of(0,import_ag_charts_core74.entries)(l)){const u=h===ChartAxisDirection23.X?this.constrainZoom({x:d,y:{min:UNIT_MAX,max:UNIT_MAX}}).x:d;n&&(n=this.updateAxisZoom(c,h,u))}}else{const l=s.update(t,i,a,this.getZoom());if(l==null)return;n=this.updateUnifiedZoom(l,{directional:!0})}e||(e=t.deltaY<0&&!n),this.firstWheelEventDirection!=null&&this.firstWheelEventDirection!==t.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=e,this.firstWheelEventDirection=t.deltaY<0,e||t.sourceEvent.preventDefault()):this.wasFirstWheelEventZoomCapped===!1&&t.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onTouchStart(t,e){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(t,e,this.getZoom())&&(this.dragState=4)}onTouchMove(t,e){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(t,e);this.updateZoom(constrainZoom(i))}onTouchEnd(t){!this.enableTwoFingerZoom||this.dragState!==4||(t.sourceEvent.preventDefault(),this.twoFingers.end(t)&&(this.dragState=0))}onProcessData(t){this.shouldFlipXY=t.series.shouldFlipXY}onLayoutComplete(t){this.domProxy.update(this.enableAxisDragging,this.enableAxisScrolling,this.ctx,t.series.rect),this.enabled&&(this.seriesRect=t.series.rect,this.paddedRect=t.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursorsDebounced())}onZoomChange(t){t.callerId!=="zoom"&&this.panner.stopInteractions();const e=this.getZoom();this.buttons.toggleVisibleZoomed(isMaxZoom(e))}onZoomPanStart(t){t.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(t){const{panner:e,seriesRect:i,ctx:{tooltipManager:o,zoomManager:s}}=this;if(!i)return;const a=e.translateZooms(i,s.getAxisZooms(),t.deltaX,t.deltaY);for(const[r,{direction:n,zoom:l}]of(0,import_ag_charts_core74.entries)(a))this.updateAxisZoom(r,n,l);o.updateTooltip(TOOLTIP_ID)}isPanningKeyPressed(t){switch(this.panKey){case"alt":return t.altKey;case"ctrl":return t.ctrlKey;case"shift":return t.shiftKey;case"meta":return t.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}constrainZoom(t){const{minVisibleItems:e,ctx:{zoomManager:i}}=this;return e===0?t:i.constrainZoomToItemCount(t,e)??t}isZoomValid(t,e){const{minVisibleItems:i,ctx:{zoomManager:o}}=this;if(i===0)return this.previousZoomValid=!0,!0;const s=this.getZoom(),a=round(dx(t))=n)return this.previousAxisZoomValid[t]=!0,!0;if(!this.previousAxisZoomValid[t]&&i?.directional)return!1;const c=s.isVisibleItemsCountAtLeast(l,o);return this.previousAxisZoomValid[t]=i?.directional?c:!0,c}resetZoom(){this.previousZoomValid=!0,this.previousAxisZoomValid={[ChartAxisDirection23.X]:!0,[ChartAxisDirection23.Y]:!0},this.ctx.zoomManager.resetZoom("zoom")}updateSyncZoom(t){this.updateZoom(t)}updateZoom(t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(t):this.updateUnifiedZoom(t)}updateUnifiedZoom(t,e){return t=this.constrainZoom(t),this.isZoomValid(t,e)?(this.ctx.zoomManager.updateZoom("zoom",t),!0):(this.ctx.updateService.update(ChartUpdateType3.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(t){this.updatePrimaryAxisZoom(t,ChartAxisDirection23.X),this.updatePrimaryAxisZoom(t,ChartAxisDirection23.Y)}updatePrimaryAxisZoom(t,e){const i=this.ctx.zoomManager.getPrimaryAxisId(e);i!=null&&this.updateAxisZoom(i,e,t[e])}updateAxisZoom(t,e,i,o){const{enableIndependentAxes:s,ctx:{zoomManager:a}}=this;if(!i)return!1;const r=this.getZoom();return s!==!0?(r[e]=i,this.updateUnifiedZoom(r,o)):this.isAxisZoomValid(e,i,o)?(a.updateAxisZoom("zoom",t,i),!0):!1}updateAxisCursor(t){if(!this.domProxy)return;const{enableAxisDragging:e=this.enableAxisDragging,enableAxisScrolling:i=this.enableAxisScrolling,axisDraggingMode:o=this.axisDraggingMode}=t;e?this.domProxy.setAxisCursor(o==="pan"?"grab":void 0):i?this.domProxy.setAxisCursor("default"):this.domProxy.setAxisCursor(void 0)}toggleAxisDraggingCursors(){const{anchorPointX:t,anchorPointY:e,domProxy:i}=this,o=this.getZoom();let s=dx(o)!==UNIT_SIZE,a=dy(o)!==UNIT_SIZE;if(!s){const r=scaleZoom(o,.999,1);r.x=scaleZoomAxisWithAnchor(r.x,o.x,t),s=this.isZoomValid(r,{includeYVisibleRange:!0})}if(!a){const r=scaleZoom(o,1,.999);r.y=scaleZoomAxisWithAnchor(r.y,o.y,e),a=this.isZoomValid(r,{includeYVisibleRange:!0})}i.toggleAxisDraggingCursor(ChartAxisDirection23.X,s),i.toggleAxisDraggingCursor(ChartAxisDirection23.Y,a)}getZoom(){return definedZoomState(this.ctx.zoomManager.getZoom())}getResetZoom(){return definedZoomState(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(t){return{anchorPointX:t?.anchorPointX??this.getAnchorPointX(),anchorPointY:t?.anchorPointY??this.getAnchorPointY(),enabled:t?.enabled??this.enabled,independentAxes:t?.independentAxes??this.enableIndependentAxes===!0,isScalingX:t?.isScalingX??this.isScalingX(),isScalingY:t?.isScalingY??this.isScalingY(),keepAspectRatio:t?.keepAspectRatio??this.keepAspectRatio,scrollingStep:t?.scrollingStep??this.scrollingStep}}};__decorateClass([ActionOnSet9({newValue(t){this.onEnabledChange(t)}}),Property62],Zoom.prototype,"enabled",2),__decorateClass([ActionOnSet9({changeValue(t){this.updateAxisCursor({enableAxisDragging:t})}}),Property62],Zoom.prototype,"enableAxisDragging",2),__decorateClass([ActionOnSet9({changeValue(t){this.updateAxisCursor({enableAxisScrolling:t})}}),Property62],Zoom.prototype,"enableAxisScrolling",2),__decorateClass([Property62],Zoom.prototype,"enableDoubleClickToReset",2),__decorateClass([ActionOnSet9({changeValue(t){this.ctx.zoomManager.setIndependentAxes(!!t)}}),Property62],Zoom.prototype,"enableIndependentAxes",2),__decorateClass([Property62],Zoom.prototype,"enablePanning",2),__decorateClass([Property62],Zoom.prototype,"enableScrolling",2),__decorateClass([Property62],Zoom.prototype,"enableSelecting",2),__decorateClass([Property62],Zoom.prototype,"enableTwoFingerZoom",2),__decorateClass([Property62],Zoom.prototype,"panKey",2),__decorateClass([Property62],Zoom.prototype,"axes",2),__decorateClass([Property62],Zoom.prototype,"scrollingStep",2),__decorateClass([Property62],Zoom.prototype,"keepAspectRatio",2),__decorateClass([Property62],Zoom.prototype,"minVisibleItems",2),__decorateClass([Property62],Zoom.prototype,"anchorPointX",2),__decorateClass([Property62],Zoom.prototype,"anchorPointY",2),__decorateClass([Property62],Zoom.prototype,"autoScaling",2),__decorateClass([ActionOnSet9({changeValue(t){this.updateAxisCursor({axisDraggingMode:t})}}),Property62],Zoom.prototype,"axisDraggingMode",2),__decorateClass([Property62],Zoom.prototype,"buttons",2),__decorateClass([ProxyProperty3("panner.deceleration"),Property62],Zoom.prototype,"deceleration",2);var buttons={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]},ZoomModule={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:t=>new Zoom(t),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$eq:[{$path:"../axes"},"x"]},padding:.05}}}},import_ag_charts_community174=require("ag-charts-community"),import_ag_charts_community173=require("ag-charts-community"),import_ag_charts_core76=require("ag-charts-core"),import_ag_charts_community172=require("ag-charts-community"),import_ag_charts_core75=require("ag-charts-core"),import_ag_charts_community171=require("ag-charts-community");function formatWithContext(t,e,i){return import_ag_charts_community171._ModuleSupport.callWithContext(t.chartService,e,i)}var{AxisInterval:AxisInterval2,AxisLabel:AxisLabel2,ZIndexMap:ZIndexMap9,LinearScale:LinearScale3,BBox:BBox14,TranslatableGroup:TranslatableGroup4,Selection:Selection4,Text:Text2,createIdsGenerator,findMinMax:findMinMax5,findRangeExtent,estimateTickCount}=import_ag_charts_community172._ModuleSupport,_AxisTicks=class St{constructor(e,i){this.ctx=e,this.dataProvider=i,this.id=(0,import_ag_charts_core75.createId)(this),this.axisGroup=new TranslatableGroup4({name:`${this.id}-AxisTicks`,zIndex:ZIndexMap9.AXIS}),this.labelSelection=Selection4.select(this.axisGroup,Text2),this.interval=new AxisInterval2,this.label=new AxisLabel2,this.scale=new LinearScale3,this.placement="bottom",this.translationX=0,this.translationY=0,this.padding=0}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const{placement:e,translationX:i,translationY:o,horizontal:s,label:a}=this;function r(u){}let n,l;switch(e){case"top":case"top-right":case"top-left":n="bottom",l="center",a.mirrored=!1,a.parallel=!0;break;case"bottom":case"bottom-right":case"bottom-left":n="top",l="center",a.mirrored=!1,a.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":n="middle",l="left",a.mirrored=!0,a.parallel=!1;break;default:}const c=[],h=this.generateTicks(),{ticks:d}=h;return this.labelSelection.update(d,void 0,u=>u.tickId),this.axisGroup.setProperties({translationX:i,translationY:o}),this.labelSelection.each((u,p)=>{u.fontFamily=a.fontFamily,u.fontSize=a.fontSize,u.fontStyle=a.fontStyle,u.fontWeight=a.fontWeight,u.fill=a.color,u.textBaseline=n,u.textAlign=l,u.text=p.tickLabel,u.x=s?p.translation:0,u.y=s?0:p.translation,c.push(u.getBBox())}),c.length>0?BBox14.merge(c).translate(i,o):void 0}tickFormatter(e,i,o,s){const{ctx:a}=this,{formatManager:r}=a,n=this.dataProvider.data.flatMap(l=>l.series);return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:e,boundSeries:n,fractionDigits:s};return this.label.formatValue((d,u)=>formatWithContext(a,d,u),h,c)??r.format((d,u)=>formatWithContext(a,d,u),h)??r.defaultFormat(h)}}inRange(e,i=.001){const[o,s]=findMinMax5(this.scale.range);return e>=o-i&&e<=s+i}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:o,minTickCount:s,tickCount:a}=estimateTickCount(findRangeExtent(this.scale.range),1,e,i,St.DefaultTickCount,St.DefaultMinSpacing),r=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:a,minTickCount:s,maxTickCount:o});if(this.placement==="bottom"||this.placement==="top"){const n=(0,import_ag_charts_core75.cachedTextMeasurer)(this.label),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let d=-1/0*h;r.ticks=r.ticks.filter(u=>{if(Math.sign(u.translation-d)!==h)return!1;const{width:p}=(0,import_ag_charts_core75.isArray)(u.tickLabel)?(0,import_ag_charts_core75.measureTextSegments)(u.tickLabel,this.label):n.measureLines(u.tickLabel);return d=u.translation+p*h,!0})}return r}getTicksData(e){const i=[],o=e.nice?this.scale.niceDomain(e):this.scale.domain,s=this.scale.ticks(e,o)?.ticks??[],a=s.reduce((l,c)=>Math.max(l,(0,import_ag_charts_core75.countFractionDigits)(c)),0),r=createIdsGenerator(),n=this.tickFormatter(o,s,!1,a);for(let l=0;lthis.onChartHoverChange()),t.layoutManager.registerElement(LayoutElement5.Legend,e=>this.onStartLayout(e)),()=>this.legendGroup.remove())}isVertical(){const{placement:t}=expandLegendPosition(this.position);return t.startsWith("right")||t.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(t){t.appendChild(this.legendGroup)}onStartLayout(t){const[e]=this.data;if(!this.enabled||!e?.enabled||e.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(e),o=this.updateGradientRect(t.layoutBox,i),s=this.updateAxis(e,o)??new BBox15(0,0,0,0),a=BBox15.merge([o,s]),{strokeWidth:r,padding:n}=this.getContainerStyles();a.grow(n).grow(r);const{left:l,top:c}=this.getMeasurements(t.layoutBox,a);this.updateContainer(a),this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=c}normalizeColorArrays(t){let e=t.colorDomain.slice();const i=t.colorRange.slice();if(e.length===i.length)return{colorDomain:e,colorRange:i};e.length>i.length&&i.splice(e.length);const[o,s]=e,a=i.length;return e=i.map((r,n)=>n===0?o:n===a-1?s:o+(s-o)*n/(a-1)),{colorDomain:e,colorRange:i}}updateGradientRect(t,e){const{gradientRect:i,gradient:o}=this,{preferredLength:s,thickness:a}=o,r=new BBox15(0,0,0,0);let n;return this.isVertical()?(n=0,r.width=a,r.height=Math.min(t.height,s)):(n=90,r.width=Math.min(t.width,s),r.height=a),i.x=r.x,i.y=r.y,i.width=r.width,i.height=r.height,i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:e.map((l,c)=>({stop:c/(e.length-1),color:l})),rotation:n},r}updateAxis(t,e){const{axisTicks:i,gradient:o,scale:s}=this,{placement:a}=expandLegendPosition(this.position),r=this.isVertical(),n=this.reverseOrder!==r;i.placement=a;const l=o.thickness+(s.padding??0);return i.translationX=r?l:e.x,i.translationY=r?e.y:l,i.scale.domain=n?t.colorDomain.slice().reverse():t.colorDomain,i.scale.range=r?[e.x,e.height]:[e.y,e.width],i.calculateLayout()}updateContainer(t){const e=this.getContainerStyles();import_ag_charts_community173._ModuleSupport.applyShapeStyle(this.containerNode,e),this.containerNode.cornerRadius=e.cornerRadius,this.containerNode.x=t.x,this.containerNode.y=t.y,this.containerNode.width=t.width,this.containerNode.height=t.height}updateArrow(){const t=this.highlightManager.getActiveHighlight(),{arrow:e}=this;if(t?.colorValue==null){e.visible=!1;return}const{scale:i,label:o}=this.axisTicks,s=o.fontSize??0,a=i.convert(t.colorValue);let{x:r,y:n}=this.gradientRect,l=Math.PI;this.isVertical()?(r-=s/2,n+=a,l/=2):(r+=a,n-=s/2),e.visible=!0,e.fill=o.color,e.rotation=l,e.size=s,e.translationX=r,e.translationY=n}getMeasurements(t,e){function i(u){}let{x:o,y:s}=t;const{width:a,height:r}=e,{placement:n,floating:l,xOffset:c,yOffset:h}=expandLegendPosition(this.position),d=this.getContainerStyles();switch(o+=d.strokeWidth+d.padding.left,s+=d.strokeWidth+d.padding.top,n){case"left":s+=t.height/2-r/2;break;case"right":o+=t.width-a,s+=t.height/2-r/2;break;case"top":o+=t.width/2-a/2;break;case"bottom":o+=t.width/2-a/2,s+=t.height-r;break;case"right-top":case"top-right":o+=t.width-a;break;case"right-bottom":case"bottom-right":o+=t.width-a,s+=t.height-r;break;case"left-bottom":case"bottom-left":s+=t.height-r;break;case"left-top":case"top-left":break;default:}if(!l)switch(n){case"left":case"left-top":case"left-bottom":t.shrink(a+this.spacing,"left");break;case"right":case"right-top":case"right-bottom":t.shrink(a+this.spacing,"right");break;case"top":case"top-left":case"top-right":t.shrink(r+this.spacing,"top");break;case"bottom":case"bottom-left":case"bottom-right":t.shrink(r+this.spacing,"bottom");break;default:}return o+=c,s+=h,{top:s,left:o}}getContainerStyles(){const{stroke:t,strokeOpacity:e,strokeWidth:i}=this.border,{cornerRadius:o,fill:s,fillOpacity:a,padding:r}=this,n=typeof r=="number";return{cornerRadius:o,fill:s,fillOpacity:a,padding:{top:n?r:r.top??0,right:n?r:r.right??0,bottom:n?r:r.bottom??0,left:n?r:r.left??0},stroke:t,strokeOpacity:e,strokeWidth:this.border.enabled?i:0}}onChartHoverChange(){this.enabled&&this.updateArrow()}};GradientLegend.className="GradientLegend",__decorateClass([Property63],GradientLegend.prototype,"enabled",2),__decorateClass([Property63],GradientLegend.prototype,"position",2),__decorateClass([Property63],GradientLegend.prototype,"reverseOrder",2),__decorateClass([Property63],GradientLegend.prototype,"gradient",2),__decorateClass([Property63],GradientLegend.prototype,"spacing",2),__decorateClass([Property63],GradientLegend.prototype,"border",2),__decorateClass([Property63],GradientLegend.prototype,"cornerRadius",2),__decorateClass([Property63],GradientLegend.prototype,"fill",2),__decorateClass([Property63],GradientLegend.prototype,"fillOpacity",2),__decorateClass([Property63],GradientLegend.prototype,"padding",2),__decorateClass([Property63],GradientLegend.prototype,"scale",2);var GradientLegendModule={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],identifier:"gradient",moduleFactory:t=>new GradientLegend(t),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},minSpacing:5},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1,fill:{$applySwitch:[{$path:"type"},{$ref:"chartBackgroundColour"},["gradient",import_ag_charts_community174._ModuleSupport.FILL_GRADIENT_BLANK_DEFAULTS],["pattern",import_ag_charts_community174._ModuleSupport.FILL_PATTERN_BLANK_DEFAULTS],["image",import_ag_charts_community174._ModuleSupport.FILL_IMAGE_BLANK_DEFAULTS]]}},removable:"standalone-only"},import_ag_charts_core77=require("ag-charts-core");function injectWatermark(t,e){const i=t.addChild("canvas-overlay","watermark"),o=(0,import_ag_charts_core77.createElement)("span");o.innerText=e,i.addEventListener("animationend",()=>{t.removeChild("canvas-overlay","watermark"),t.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(o)}var import_ag_charts_community281=require("ag-charts-community"),import_ag_charts_community175=require("ag-charts-community"),{ordinalTimeAxisOptionsDefs,angleNumberAxisOptionsDefs,angleCategoryAxisOptionsDefs,radiusNumberAxisOptionsDefs,radiusCategoryAxisOptionsDefs}=import_ag_charts_community175._ModuleSupport,OrdinalTimeAxisModule2={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:ordinalTimeAxisOptionsDefs,create:t=>new OrdinalTimeAxis(t)},AngleNumberAxisModule2={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:angleNumberAxisOptionsDefs,create:t=>new AngleNumberAxis(t)},AngleCategoryAxisModule2={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:angleCategoryAxisOptionsDefs,create:t=>new AngleCategoryAxis(t)},RadiusNumberAxisModule2={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:radiusNumberAxisOptionsDefs,create:t=>new RadiusNumberAxis(t)},RadiusCategoryAxisModule2={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:radiusCategoryAxisOptionsDefs,create:t=>new RadiusCategoryAxis(t)},import_ag_charts_community177=require("ag-charts-community"),import_ag_charts_community176=require("ag-charts-community"),{Chart}=import_ag_charts_community176._ModuleSupport,StandaloneChart=class extends Chart{getChartType(){return"standalone"}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:o}=t,s=o.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=s,this.animationRect=s;for(const a of[e,i])a.translationX=Math.floor(s.x),a.translationY=Math.floor(s.y);e.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:!0,rect:s,paddedRect:o}})}getAriaLabel(){const t=this.series[0]?.type;if(t==null)return"";const e=this.getCaptionText();switch(t){case"radial-gauge":case"linear-gauge":{const i=[];e.length!==0&&i.push(e);for(const o of this.series)i.push(o.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:e});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:e})}}};StandaloneChart.className="StandaloneChart",StandaloneChart.type="standalone";var{isAgStandaloneChartOptions,standaloneChartOptionsDefs}=import_ag_charts_community177._ModuleSupport,StandaloneChartModule={type:"chart",name:"standalone",enterprise:!0,options:standaloneChartOptionsDefs,detect:isAgStandaloneChartOptions,create(t,e){return new StandaloneChart(t,e)}},import_ag_charts_community179=require("ag-charts-community"),import_ag_charts_community178=require("ag-charts-community"),{Chart:Chart2,MercatorScale,ChartAxisDirection:ChartAxisDirection24,Property:Property64}=import_ag_charts_community178._ModuleSupport;function isTopologySeries(t){return t.type==="map-shape"||t.type==="map-line"||t.type==="map-marker"||t.type==="map-shape-background"||t.type==="map-line-background"}var TopologyChart=class extends Chart2{constructor(t,e){super(t,e),this.ctx.zoomManager.updateAxes([ChartAxisDirection24.X,ChartAxisDirection24.Y])}getChartType(){return"topology"}async updateData(){await super.updateData();const t=this.getOptions();this.topology!==t.topology&&(this.topology=t.topology);const{topology:e}=this;for(const i of this.series)isTopologySeries(i)&&i.setChartTopology(e)}performLayout(t){const{seriesRoot:e,annotationRoot:i}=this,{layoutBox:o}=t,s=o.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=s,this.animationRect=s;const a=this.series.filter(isTopologySeries),r=a.reduce((c,h)=>{if(!h.visible)return c;const d=h.topologyBounds;return d==null?c:c==null?d:c.merge(d)},void 0);let n;if(r!=null){const{lon0:c,lat0:h,lon1:d,lat1:u}=r,p=[[c,h],[d,u]],g=MercatorScale.bounds(p),{width:y,height:f}=s,x=Math.min(y/g.width,f/g.height),b=g.width*x,m=g.height*x,S=(y-b)/2,v=(f-m)/2,M=S,D=v,k=S+b,_=v+m,T=this.ctx.zoomManager.getAxisZoom(ChartAxisDirection24.X),w=this.ctx.zoomManager.getAxisZoom(ChartAxisDirection24.Y),R=(k-M)/(T.max-T.min),F=M-R*T.min,O=(_-D)/(1-w.min-(1-w.max)),E=D-O*(1-w.max);n=new MercatorScale(p,[[F,E],[F+R,E+O]])}for(const c of a)c.scale=n;const l=this.series.some(c=>c.visible);e.visible=l;for(const c of[e,i])c.translationX=Math.floor(s.x),c.translationY=Math.floor(s.y),c.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(t,{series:{visible:l,rect:s,paddedRect:o}})}};TopologyChart.className="TopologyChart",TopologyChart.type="topology",__decorateClass([Property64],TopologyChart.prototype,"topology",2);var{isAgTopologyChartOptions,topologyChartOptionsDefs}=import_ag_charts_community179._ModuleSupport,TopologyChartModule={type:"chart",name:"topology",enterprise:!0,options:topologyChartOptionsDefs,detect:isAgTopologyChartOptions,create(t,e){return new TopologyChart(t,e)}},import_ag_charts_community181=require("ag-charts-community"),import_ag_charts_community180=require("ag-charts-community"),import_ag_charts_core78=require("ag-charts-core"),{annotationCalloutStylesDefs,annotationNoteStylesDefs,annotationTextStylesDef,annotationCommentStylesDefs,annotationMeasurerStylesDefs,annotationQuickMeasurerStylesDefs,annotationShapeStylesDefs,annotationChannelTextDefs,annotationCrossLineStyleDefs,annotationFibonacciStylesDefs,annotationLineStyleDefs,annotationLineTextDefs,annotationDisjointChannelStyleDefs,annotationParallelChannelStyleDefs}=import_ag_charts_community180._ModuleSupport,serializableDate=(0,import_ag_charts_core78.optionsDefs)({__type:(0,import_ag_charts_core78.required)((0,import_ag_charts_core78.constant)("date")),value:(0,import_ag_charts_core78.or)(import_ag_charts_core78.string,import_ag_charts_core78.number)},"a serializable date object"),xValue=(0,import_ag_charts_core78.or)(import_ag_charts_core78.string,import_ag_charts_core78.number,serializableDate),annotationValue=(0,import_ag_charts_core78.or)(xValue,(0,import_ag_charts_core78.optionsDefs)({value:xValue,groupPercentage:(0,import_ag_charts_core78.numberRange)(-1,2)})),channelAnnotationTextOptionsDef={...annotationChannelTextDefs,label:import_ag_charts_core78.string},lineAnnotationTextOptionsDef={...annotationLineTextDefs,label:import_ag_charts_core78.string},annotationPointOptionsDef={x:annotationValue,y:import_ag_charts_core78.number},annotationInitialStateOptionsDef=(0,import_ag_charts_core78.typeUnion)({line:{...annotationLineStyleDefs,start:annotationPointOptionsDef,end:annotationPointOptionsDef,text:lineAnnotationTextOptionsDef},"horizontal-line":{...annotationCrossLineStyleDefs,value:annotationValue,text:lineAnnotationTextOptionsDef},"vertical-line":{...annotationCrossLineStyleDefs,value:annotationValue,text:lineAnnotationTextOptionsDef},"disjoint-channel":{...annotationDisjointChannelStyleDefs,startHeight:import_ag_charts_core78.number,endHeight:import_ag_charts_core78.number,start:annotationPointOptionsDef,end:annotationPointOptionsDef,text:channelAnnotationTextOptionsDef},"parallel-channel":{...annotationParallelChannelStyleDefs,height:import_ag_charts_core78.number,start:annotationPointOptionsDef,end:annotationPointOptionsDef,text:channelAnnotationTextOptionsDef},"fibonacci-retracement":{...annotationFibonacciStylesDefs,start:annotationPointOptionsDef,end:annotationPointOptionsDef,text:lineAnnotationTextOptionsDef,reverse:import_ag_charts_core78.boolean},"fibonacci-retracement-trend-based":{...annotationFibonacciStylesDefs,start:annotationPointOptionsDef,end:annotationPointOptionsDef,endRetracement:annotationPointOptionsDef,text:lineAnnotationTextOptionsDef,reverse:import_ag_charts_core78.boolean},callout:{...annotationCalloutStylesDefs,start:annotationPointOptionsDef,end:annotationPointOptionsDef,text:import_ag_charts_core78.string},comment:{...annotationCommentStylesDefs,...annotationPointOptionsDef,text:import_ag_charts_core78.string},note:{...annotationNoteStylesDefs,...annotationPointOptionsDef,text:import_ag_charts_core78.string},text:{...annotationTextStylesDef,...annotationPointOptionsDef,text:import_ag_charts_core78.string},arrow:{...annotationLineStyleDefs,text:lineAnnotationTextOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef},"arrow-up":{...annotationShapeStylesDefs,...annotationPointOptionsDef},"arrow-down":{...annotationShapeStylesDefs,...annotationPointOptionsDef},"date-range":{...annotationMeasurerStylesDefs,extendAbove:import_ag_charts_core78.boolean,extendBelow:import_ag_charts_core78.boolean,text:lineAnnotationTextOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef},"price-range":{...annotationMeasurerStylesDefs,extendLeft:import_ag_charts_core78.boolean,extendRight:import_ag_charts_core78.boolean,text:lineAnnotationTextOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef},"date-price-range":{...annotationMeasurerStylesDefs,text:lineAnnotationTextOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef},"quick-date-price-range":{...annotationMeasurerStylesDefs,...annotationQuickMeasurerStylesDefs,text:lineAnnotationTextOptionsDef,start:annotationPointOptionsDef,end:annotationPointOptionsDef}},"an annotation initial state object"),initialStateOptionsDef={chartType:(0,import_ag_charts_core78.union)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:(0,import_ag_charts_core78.arrayOfDefs)(annotationInitialStateOptionsDef),legend:(0,import_ag_charts_core78.arrayOfDefs)({visible:import_ag_charts_core78.boolean,seriesId:import_ag_charts_core78.string,itemId:import_ag_charts_core78.string,legendItemName:import_ag_charts_core78.string},"legend state array"),zoom:{rangeX:{start:(0,import_ag_charts_core78.or)(import_ag_charts_core78.number,serializableDate),end:(0,import_ag_charts_core78.or)(import_ag_charts_core78.number,serializableDate)},rangeY:{start:(0,import_ag_charts_core78.or)(import_ag_charts_core78.number,serializableDate),end:(0,import_ag_charts_core78.or)(import_ag_charts_core78.number,serializableDate)},ratioX:{start:(0,import_ag_charts_core78.and)(import_ag_charts_core78.ratio,(0,import_ag_charts_core78.lessThan)("end")),end:(0,import_ag_charts_core78.and)(import_ag_charts_core78.ratio,(0,import_ag_charts_core78.greaterThan)("start"))},ratioY:{start:(0,import_ag_charts_core78.and)(import_ag_charts_core78.ratio,(0,import_ag_charts_core78.lessThan)("end")),end:(0,import_ag_charts_core78.and)(import_ag_charts_core78.ratio,(0,import_ag_charts_core78.greaterThan)("start"))},autoScaledAxes:(0,import_ag_charts_core78.arrayOf)((0,import_ag_charts_core78.constant)("y"))}},{annotationOptionsDef}=import_ag_charts_community181._ModuleSupport,AnnotationsModule2={type:"plugin",name:"annotations",chartType:"cartesian",options:annotationOptionsDef,create(){return null}},NavigatorModule2={type:"plugin",name:"navigator",chartType:"cartesian",options:navigatorOptionsDef,create(){return null}},InitialStateModule={type:"plugin",name:"initialState",options:initialStateOptionsDef,create(){return null}},import_ag_charts_community187=require("ag-charts-community"),import_ag_charts_community185=require("ag-charts-community"),import_ag_charts_core80=require("ag-charts-core"),import_ag_charts_community182=require("ag-charts-community"),import_ag_charts_core79=require("ag-charts-core");function computeNodeGraph(t,e,i){i||(e=removeCircularLinks(e));const o=new Map;for(const a of t)o.set(a.id,{datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let s=0;for(const[a,r]of o.entries())s=Math.max(s,computePathLength(o,e,r,a,-1,[])+computePathLength(o,e,r,a,1,[])+1);return{links:e,nodeGraph:o,maxPathLength:s}}function findCircularLinks(t,e,i,o){const s=o.indexOf(e);if(s!==-1){for(let r=s;r!e.has(i))}function computePathLength(t,e,i,o,s,a){if(a.includes(o))return 1/0;let r=s===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(r===-1){r=0;const n=s===-1?i.linksBefore:i.linksAfter;for(const l of e){const{fromNode:c,toNode:h}=l,d=s===-1?h.id:c.id,u=s===-1?c.id:h.id,p=o===d?t.get(u):void 0;p!=null&&(n.push({node:p,link:l}),a?.push(o),r=Math.max(r,computePathLength(t,e,p,u,s,a)+1),a?.pop())}s===-1?i.maxPathLengthBefore=r:i.maxPathLengthAfter=r}return r}var{Series,DataController,keyProperty:keyProperty7,valueProperty:valueProperty10,Selection:Selection5,Group:Group9,TransformableText}=import_ag_charts_community182._ModuleSupport,FlowProportionSeriesNodeEvent=class extends import_ag_charts_community182._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o);const{datumIndex:s}=i,a=o.contextNodeData?.nodeData.find(r=>r.datumIndex.type===s.type&&r.datumIndex.index===s.index);this.size=a?.size,this.label=a?.type===1?a?.label:void 0}},FlowProportionSeries=class extends Series{constructor(){super(...arguments),this.NodeEvent=FlowProportionSeriesNodeEvent,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Group9({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Group9({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new Group9({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new Group9({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new Group9({name:"linkGroup"})),this.highlightNodeGroup=this.highlightGroup.appendChild(new Group9({name:"nodeGroup"})),this.labelSelection=Selection5.select(this.labelGroup,TransformableText),this.linkSelection=Selection5.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=Selection5.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=Selection5.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=Selection5.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=Selection5.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=Selection5.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(t){const{data:e,nodes:i}=this;if(e==null)return;const{fromKey:o,toKey:s,sizeKey:a,idKey:r,labelKey:n}=this.properties,l=new DataController("standalone",t.suppressFieldDotNotation),c=i==null?null:l.request(this.id,import_ag_charts_community182._ModuleSupport.DataSet.wrap(i)??import_ag_charts_community182._ModuleSupport.DataSet.empty(),{props:[keyProperty7(r,void 0,{id:"idValue",includeProperty:!1}),...n==null?[]:[valueProperty10(n,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),h=t.request(this.id,e,{props:[valueProperty10(o,void 0,{id:"fromValue",includeProperty:!1}),valueProperty10(s,void 0,{id:"toValue",includeProperty:!1}),...a==null?[]:[valueProperty10(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[d,u]=await Promise.all([c??Promise.resolve(null),h]);this.nodesDataModel=d?.dataModel,this.nodesProcessedData=d?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const p=new Map;if(d==null){const g=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),y=u.dataModel.resolveColumnById(this,"toValue",u.processedData),f=b=>{const m=p.size,S=b;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:m},type:1,index:m,linksBefore:[],linksAfter:[],id:b,size:0,label:S,style:this.getNodeStyle({datumIndex:{type:1,index:m},datum:{},size:0,label:S},m,!1)}},x=u.processedData.dataSources.get(this.id)?.data;if(x)for(const[b]of x.entries()){const m=g[b],S=y[b];m==null||S==null||(p.has(m)||p.set(m,f(m)),p.has(S)||p.set(S,f(S)))}}else{const g=d.dataModel.resolveColumnById(this,"idValue",d.processedData),y=n==null?void 0:d.dataModel.resolveColumnById(this,"labelValue",d.processedData),f=d.processedData.dataSources.get(this.id)?.data;if(f)for(const[x,b]of f.entries()){const m=g[x],S=y?.[x],v={type:1,index:x};p.set(m,{series:this,itemId:void 0,datum:b,datumIndex:v,type:1,index:x,linksBefore:[],linksAfter:[],id:m,size:0,label:S,style:this.getNodeStyle({datumIndex:v,datum:b,size:0,label:S},x,!1)})}}this.processedNodes=p}getNodeGraph(t,e,{includeCircularReferences:i}){const{linksDataModel:o,linksProcessedData:s}=this;if(o==null||s==null){const{links:y,nodeGraph:f,maxPathLength:x}=computeNodeGraph(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:y,maxPathLength:x}}const{sizeKey:a}=this.properties,r=o.resolveColumnById(this,"fromValue",s),n=o.resolveColumnById(this,"toValue",s),l=a==null?void 0:o.resolveColumnById(this,"sizeValue",s),c=new Map;for(const y of this.processedNodes.values()){const f=t(y);c.set(y.id,f)}const h=[],d=s.dataSources.get(this.id)?.data;if(d)for(const[y,f]of d.entries()){const x=r[y],b=n[y],m=l==null?1:l[y],S=c.get(x),v=c.get(b);if(m<=0||S==null||v==null)continue;const M={type:0,index:y},D=e({series:this,itemId:void 0,datum:f,datumIndex:M,type:0,index:y,fromNode:S,toNode:v,size:m,style:this.getLinkStyle({datum:f,datumIndex:M},S.datumIndex,!1)});h.push(D)}const{links:u,nodeGraph:p,maxPathLength:g}=computeNodeGraph(c.values(),h,i);for(const y of p.values())y.datum.linksBefore=y.linksBefore.map(f=>f.link),y.datum.linksAfter=y.linksAfter.map(f=>f.link);return this.nodeCount=p.size,this.linkCount=u.length,{nodeGraph:p,links:u,maxPathLength:g}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(t){const{seriesRect:e}=t,i={seriesRectWidth:e?.width??0,seriesRectHeight:e?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const o=this.contextNodeData?.nodeData??[],s=this.contextNodeData?.labelData??[];let a=this.ctx.highlightManager?.getActiveHighlight();if(a?.series===this&&a.type==null){const{itemId:h}=a;a=h==null?void 0:o.find(d=>d.type===1&&d.id===h)}else a?.series!==this&&(a=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=a==null?1:this.properties.highlight.unhighlightedItem.opacity??1,this.labelSelection=this.updateLabelSelection({labelData:s,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:o.filter(h=>h.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:o.filter(h=>h.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,n,l,c;a?.type===1?(r=o.filter(h=>h.type===0&&(h.toNode===a||h.fromNode===a)),n=r.map(h=>h.fromNode===a?h.toNode:h.fromNode),n.push(a),l=[],c=[a]):a?.type===0?(r=[a],n=[a.fromNode,a.toNode],l=[a],c=[]):(r=[],n=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:n,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(t){}dataCount(){return Number.NaN}getSeriesDomain(t){return[]}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}legendItemSymbol(t,e,i={}){const{fills:o,strokes:s}=this.properties,{fill:a=o[e%o.length],fillOpacity:r=1,stroke:n=s[e%s.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:d=0}=i;return{marker:{fill:a,fillOpacity:r,stroke:n,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}}getLegendData(t){if(t!=="category")return[];const{showInLegend:e}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:o},s)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:o??i},symbol:this.legendItemSymbol(1,s),hideInLegend:!e,isFixed:!0}))}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.linkSelection.each((s,a)=>{const r=s.distanceSquared(t,e);r{const r=s.distanceSquared(t,e);rh.datum),c=n.indexOf(o)+e;c>=0&&c0?s=n.at(-1):s=Array.from(this.nodeSelection,d=>d.datum).at(-1)}else if(o?.type===1){const n=Array.from(this.nodeSelection,h=>h.datum),c=n.indexOf(o)+e;c>=0&&cd.datum)[0]}if(s==null)return;const a=s.type===1?Array.from(this.nodeSelection).find(n=>n.datum===s):Array.from(this.linkSelection).find(n=>n.datum===s);if(a==null)return;const r=this.computeFocusBounds(a.node);if(r!=null)return{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:r,clipFocusBox:!0}}getCategoryValue(t){}datumIndexForCategoryValue(t){}},import_ag_charts_community183=require("ag-charts-community"),{Path:Path9,SceneChangeDetection:SceneChangeDetection7}=import_ag_charts_community183._ModuleSupport;function bezierControlPoints({radius:t,startAngle:e,endAngle:i,tension:o}){const s=t*Math.cos(e),a=t*Math.sin(e),r=t*Math.cos(i),n=t*Math.sin(i),l=s*o,c=a*o,h=r*o,d=n*o;return{x:[s,l,h,r],y:[a,c,d,n]}}var ChordLink=class extends Path9{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(t,e,i,o,s,a,r,n){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-t)*h+t,(o-e)*h+e,(s-r)*h+r,(a-n)*h+n,r,n)}updatePath(){const{path:t,centerX:e,centerY:i,radius:o}=this;let{startAngle1:s,endAngle1:a,startAngle2:r,endAngle2:n}=this;s>r&&([s,r]=[r,s],[a,n]=[n,a]),t.clear();const l=e+o*Math.cos(s),c=i+o*Math.sin(s);t.moveTo(l,c),this.tensionedCurveTo(l,c,e,i,e,i,e+o*Math.cos(n),i+o*Math.sin(n)),t.arc(e,i,o,n,r,!0),this.tensionedCurveTo(e+o*Math.cos(r),i+o*Math.sin(r),e,i,e,i,e+o*Math.cos(a),i+o*Math.sin(a)),t.arc(e,i,o,a,s,!0),t.closePath()}};__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"centerX",2),__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"centerY",2),__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"radius",2),__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"startAngle1",2),__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"endAngle1",2),__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"startAngle2",2),__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"endAngle2",2),__decorateClass([SceneChangeDetection7()],ChordLink.prototype,"tension",2);var import_ag_charts_community184=require("ag-charts-community"),{FillGradientDefaults:FillGradientDefaults2,FillPatternDefaults:FillPatternDefaults2,FillImageDefaults:FillImageDefaults2,BaseProperties:BaseProperties24,makeSeriesTooltip:makeSeriesTooltip8,SeriesProperties,Property:Property65,Label:Label6}=import_ag_charts_community184._ModuleSupport,ChordSeriesLabelProperties=class extends Label6{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};__decorateClass([Property65],ChordSeriesLabelProperties.prototype,"spacing",2),__decorateClass([Property65],ChordSeriesLabelProperties.prototype,"maxWidth",2);var ChordSeriesLinkProperties=class extends BaseProperties24{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(t,e,i){const{fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,tension:l}=this,c=this.fill??t[i%t.length],h=this.stroke??e[i%t.length];return{fill:c,fillOpacity:o,stroke:h,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,tension:l}}};__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"fill",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"fillOpacity",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"stroke",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"strokeOpacity",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"strokeWidth",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"lineDash",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"lineDashOffset",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"tension",2),__decorateClass([Property65],ChordSeriesLinkProperties.prototype,"itemStyler",2);var ChordSeriesNodeProperties=class extends BaseProperties24{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(t,e,i){const{fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n}=this,l=this.fill??t[i%t.length],c=this.stroke??e[i%t.length];return{fill:l,fillOpacity:o,stroke:c,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n}}};__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"spacing",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"width",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"fill",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"fillOpacity",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"stroke",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"strokeOpacity",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"strokeWidth",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"lineDash",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"lineDashOffset",2),__decorateClass([Property65],ChordSeriesNodeProperties.prototype,"itemStyler",2);var ChordSeriesProperties=class extends SeriesProperties{constructor(){super(),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new FillGradientDefaults2,this.fillPatternDefaults=new FillPatternDefaults2,this.fillImageDefaults=new FillImageDefaults2,this.fills=[],this.strokes=[],this.label=new ChordSeriesLabelProperties,this.link=new ChordSeriesLinkProperties,this.node=new ChordSeriesNodeProperties,this.tooltip=makeSeriesTooltip8(),this.highlightStyle.deprecated=!1}};__decorateClass([Property65],ChordSeriesProperties.prototype,"fromKey",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"toKey",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"idKey",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"idName",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"labelKey",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"labelName",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"sizeKey",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"sizeName",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"nodes",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"fillImageDefaults",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"fills",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"strokes",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"label",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"link",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"node",2),__decorateClass([Property65],ChordSeriesProperties.prototype,"tooltip",2);var{SeriesNodePickMode:SeriesNodePickMode6,createDatumId:createDatumId6,angleBetween:angleBetween2,normalizeAngle360:normalizeAngle3604,isBetweenAngles,Sector:Sector3,evaluateBezier,applyShapeStyle:applyShapeStyle7,getShapeStyle,getLabelStyles,BBox:BBox16,mergeDefaults:mergeDefaults10}=import_ag_charts_community185._ModuleSupport,nodeMidAngle=t=>t.startAngle+angleBetween2(t.startAngle,t.endAngle)/2,ChordSeries=class extends FlowProportionSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode6.NEAREST_NODE,SeriesNodePickMode6.EXACT_SHAPE_MATCH]}),this.properties=new ChordSeriesProperties}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new ChordLink}nodeFactory(){return new Sector3}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:o}=this,{fromKey:s,toKey:a,sizeKey:r,labelKey:n,label:{spacing:l,maxWidth:c,fontSize:h},node:{width:d,spacing:u}}=o,p=e/2,g=i/2;let y=[];const{nodeGraph:f,links:x}=this.getNodeGraph(E=>({...E,centerX:p,centerY:g,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),E=>({...E,centerX:p,centerY:g,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let b=0;for(const[E,{datum:I,linksBefore:C,linksAfter:L}]of f.entries()){const A=C.reduce((P,{link:z})=>P+z.size,0)+L.reduce((P,{link:z})=>P+z.size,0);if(A===0)f.delete(E);else{const{label:P}=o;I.size=A,b+=I.size;const z=P.enabled?this.getLabelText(I.label,I.datum,n,"label",[],P,{datum:I.datum,value:I.label,fromKey:s,toKey:a,sizeKey:r,size:I.size}):void 0;I.label=(0,import_ag_charts_core80.toPlainText)(z)}}let m=0;if(this.isLabelEnabled()){const E=(0,import_ag_charts_core80.cachedTextMeasurer)(this.properties.label);let I=0;for(const{datum:C}of f.values()){const{id:L,label:A}=C;if(A==null)continue;const P=(0,import_ag_charts_core80.wrapText)(A,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:z}=E.measureLines(P);I=Math.max(z,I),y.push({id:L,text:P,centerX:p,centerY:g,angle:Number.NaN,radius:Number.NaN,size:C.size})}m=I+l}const S=f.size;let v=Math.min(e,i)/2-d-m,M=u/v;if(m!==0&&(S*M>=1.5*Math.PI||v<=0)&&(y=[],v=Math.min(e,i)/2-d,M=u/v),S*M>=2*Math.PI||v<=0){import_ag_charts_core80.Logger.warnOnce("There was insufficient space to display the Chord Series.");return}const D=v,k=v+d,_=Math.max((2*Math.PI-S*M)/b,0);let T=0;for(const{datum:E}of f.values()){E.innerRadius=D,E.outerRadius=k,E.startAngle=T,E.endAngle=T+E.size*_,T=E.endAngle+M;const I=(E.innerRadius+E.outerRadius)/2,C=nodeMidAngle(E);E.midPoint={x:E.centerX+I*Math.cos(C),y:E.centerY+I*Math.sin(C)}}const w=[];for(const{datum:E,linksBefore:I,linksAfter:C}of f.values()){const L=nodeMidAngle(E),A=[...I.map(z=>({link:z.link,distance:angleBetween2(nodeMidAngle(z.node.datum),L),after:!1})),...C.map(z=>({link:z.link,distance:angleBetween2(nodeMidAngle(z.node.datum),L),after:!0}))];let P=E.startAngle;for(const{link:z,after:B}of A.toSorted((V,W)=>V.distance-W.distance)){const V=z.size*_;B?(z.startAngle1=P,z.endAngle1=P+V):(z.startAngle2=P,z.endAngle2=P+V),P+=z.size*_}w.push(E)}const{tension:R}=this.properties.link;for(const E of x){E.radius=v;const I=bezierControlPoints({radius:v,startAngle:E.startAngle1,endAngle:E.endAngle2,tension:R}),C=bezierControlPoints({radius:v,startAngle:E.startAngle2,endAngle:E.endAngle1,tension:R}),L=evaluateBezier(...I.x,.5),A=evaluateBezier(...I.y,.5),P=evaluateBezier(...C.x,.5),z=evaluateBezier(...C.y,.5);E.midPoint={x:E.centerX+(L+P)/2,y:E.centerY+(A+z)/2},w.push(E)}for(const E of y){const I=f.get(E.id)?.datum;I!=null&&(E.radius=k+l,E.angle=normalizeAngle3604(I.startAngle+angleBetween2(I.startAngle,I.endAngle)/2))}y.sort((E,I)=>E.angle-I.angle);let F=1/0,O=-1/0;return y=y.filter(E=>{const I=(0,import_ag_charts_core80.calcLineHeight)(h),C=Math.atan2(I/2,E.radius),L=E.angle-C,A=E.angle+C;return isBetweenAngles(F,L,A)||isBetweenAngles(O,L,A)?!1:(F=Math.min(L,F),O=Math.max(A,O),!0)}),{itemId:t,nodeData:w,labelData:y}}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const e={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,{size:s,text:a,centerX:r,centerY:n,radius:l,angle:c})=>{e.size=s;const h=getLabelStyles(this,void 0,e,this.properties.label,!1,i),{fontStyle:d,fontWeight:u,fontSize:p,fontFamily:g,color:y}=h;o.visible=!0,o.translationX=r+l*Math.cos(c),o.translationY=n+l*Math.sin(c),o.text=a,o.fill=y,o.fontStyle=d,o.fontWeight=u,o.fontSize=p,o.fontFamily=g,o.textBaseline="middle",Math.cos(c)>=0?(o.textAlign="left",o.rotation=c):(o.textAlign="right",o.rotation=c-Math.PI),o.setBoxing(h)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId6(e.type,e.id))}getNodeStyle(t,e,i){const{properties:o}=this,{fills:s,strokes:a,fillGradientDefaults:r,fillPatternDefaults:n,fillImageDefaults:l}=o,{itemStyler:c}=o.node,h=this.getHighlightStyle(i,t.datumIndex),d=mergeDefaults10(h,o.node.getStyle(s,a,e));let u=getShapeStyle(d,r,n,l);if(c!=null&&t.datumIndex!=null){const p=this.cachedDatumCallback(createDatumId6(t.datumIndex.index,"node",i?"highlight":"node"),()=>{const g=this.makeItemStylerParams(t,i,u);return this.callWithContext(c,g)});p&&(u=getShapeStyle(mergeDefaults10(p,u),r,n,l))}return u.opacity=1,u}makeItemStylerParams({datum:t,datumIndex:e,size:i=0,label:o},s,a){const{id:r}=this,n=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(n,s,e),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:r,datum:t,highlighted:s,highlightState:l,...a,size:i,label:o,fill:c}}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getShapeFillBBox();e.each((s,a)=>{const{datumIndex:r}=a,n=this.getNodeStyle(a,r.index,i);applyShapeStyle7(s,n,o),s.centerX=a.centerX,s.centerY=a.centerY,s.innerRadius=a.innerRadius,s.outerRadius=a.outerRadius,s.startAngle=a.startAngle,s.endAngle=a.endAngle,s.inset=s.strokeWidth/2})}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId6(e.type,e.index,e.fromNode.id,e.toNode.id))}getLinkStyle({datumIndex:t,datum:e},i,o){const{id:s,properties:a}=this,{fills:r,strokes:n,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=a,{itemStyler:d}=a.link,u=this.getHighlightStyle(o,t),p=mergeDefaults10(u,a.link.getStyle(r,n,i.index));let g=getShapeStyle(p,l,c,h);if(d!=null&&t!=null){const y=this.ctx.highlightManager?.getActiveHighlight(),f=this.cachedDatumCallback(createDatumId6(t.index,"link",o?"highlight":"node"),()=>{const x=this.getHighlightStateString(y,o,i);return this.callWithContext(d,{seriesId:s,datum:e,highlighted:o,highlightState:x,...g})});f&&(g=getShapeStyle(mergeDefaults10(f,g),l,c,h))}return g.opacity=1,g}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getShapeFillBBox();e.each((s,a)=>{const r=a.fromNode.datumIndex,n=this.getLinkStyle(a,r,i);s.centerX=a.centerX,s.centerY=a.centerY,s.radius=a.radius,s.startAngle1=a.startAngle1,s.endAngle1=a.endAngle1,s.startAngle2=a.startAngle2,s.endAngle2=a.endAngle2,s.tension=n.tension,applyShapeStyle7(s,n,o)})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(t,e),o=(t-i)/2,s=(e-i)/2,a=new BBox16(o,s,t,e);return{series:a,axis:a}}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:o,properties:s,ctx:{formatManager:a}}=this,{fromKey:r,toKey:n,sizeKey:l,sizeName:c,tooltip:h}=s,d=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===t.type&&b.datumIndex.index===t.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,g=t.type===0?i?.dataSources.get(this.id)?.data[t.index]:o?.dataSources.get(this.id)?.data[t.index],y=d.size;let f;if(d.type===0){const b=d.fromNode.datumIndex;f=this.getLinkStyle({datumIndex:t,datum:g},b,!1)}else{const b=d.label;f=this.getNodeStyle({datumIndex:t,datum:g,size:y,label:b},t.index,!1)}const x=[];if(l!=null){const b=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:g,seriesId:e,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});x.push({label:c,fallbackLabel:l,value:b??String(y)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,f),data:x},{seriesId:e,datum:g,title:p,fromKey:r,toKey:n,sizeKey:l,sizeName:c,size:y,...f})}computeFocusBounds(t){return t}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};ChordSeries.className="ChordSeries",ChordSeries.type="chord";var import_ag_charts_community186=require("ag-charts-community"),import_ag_charts_core81=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs8,chordSeriesThemeableOptionsDef}=import_ag_charts_community186._ModuleSupport,chordSeriesOptionsDef={...chordSeriesThemeableOptionsDef,...commonSeriesOptionsDefs8,type:(0,import_ag_charts_core81.required)((0,import_ag_charts_core81.constant)("chord")),fromKey:(0,import_ag_charts_core81.required)(import_ag_charts_core81.string),toKey:(0,import_ag_charts_core81.required)(import_ag_charts_core81.string),sizeKey:import_ag_charts_core81.string,sizeName:import_ag_charts_core81.string};chordSeriesOptionsDef.fillGradientDefaults=(0,import_ag_charts_core81.undocumented)(import_ag_charts_core81.fillGradientDefaults),chordSeriesOptionsDef.fillPatternDefaults=(0,import_ag_charts_core81.undocumented)(import_ag_charts_core81.fillPatternDefaults),chordSeriesOptionsDef.fillImageDefaults=(0,import_ag_charts_core81.undocumented)(import_ag_charts_core81.fillImageDefaults);var ChordModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],solo:!0,identifier:"chord",moduleFactory:t=>new ChordSeries(t),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:import_ag_charts_community187._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:import_ag_charts_community187._ModuleSupport.FILL_PATTERN_DEFAULTS,fillImageDefaults:import_ag_charts_community187._ModuleSupport.FILL_IMAGE_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},highlight:import_ag_charts_community187._ModuleSupport.singleSeriesHighlightStyle(),label:{...import_ag_charts_community187._ModuleSupport.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},ChordSeriesModule={type:"series",name:"chord",chartType:"standalone",enterprise:!0,options:chordSeriesOptionsDef,create:t=>new ChordSeries(t)},import_ag_charts_community188=require("ag-charts-community"),{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE7,CARTESIAN_POSITION:CARTESIAN_POSITION5},ThemeSymbols:{DEFAULT_SHADOW_COLOUR}}=import_ag_charts_community188._ModuleSupport,isHorizontal={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},labelOptions={autoRotate:{$path:"/series/0/stageLabel/autoRotate"},autoRotateAngle:{$path:"/series/0/stageLabel/autoRotateAngle"},avoidCollisions:{$path:["/series/0/stageLabel/avoidCollisions",!0]},border:{$path:["/series/0/stageLabel/border"]},color:{$path:["/series/0/stageLabel/color",{$ref:"textColor"}]},cornerRadius:{$path:["/series/0/stageLabel/cornerRadius"]},enabled:{$if:[{$eq:[{$path:"/series/0/stageLabel/enabled"},void 0]},!0,{$path:"/series/0/stageLabel/enabled"}]},fill:{$path:["/series/0/stageLabel/fill"]},fillOpacity:{$path:["/series/0/stageLabel/fillOpacity"]},fontSize:{$path:["/series/0/stageLabel/fontSize",{$ref:"fontSize"}]},fontStyle:{$path:["/series/0/stageLabel/fontStyle",{$ref:"fontStyle"}]},fontWeight:{$path:["/series/0/stageLabel/fontWeight",{$ref:"fontWeight"}]},format:{$path:"/series/0/stageLabel/format"},formatter:{$path:"/series/0/stageLabel/formatter"},itemStyler:{$path:"/series/0/stageLabel/itemStyler"},minSpacing:{$path:"/series/0/stageLabel/minSpacing"},padding:{$path:["/series/0/stageLabel/padding"]},rotation:{$path:["/series/0/stageLabel/rotation",0]}},FUNNEL_SERIES_AXES=[{type:{$if:[isHorizontal,CARTESIAN_AXIS_TYPE7.NUMBER,CARTESIAN_AXIS_TYPE7.CATEGORY]},position:{$if:[isHorizontal,CARTESIAN_POSITION5.LEFT,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},CARTESIAN_POSITION5.RIGHT,CARTESIAN_POSITION5.LEFT]}]},label:{$if:[isHorizontal,void 0,labelOptions]}},{type:{$if:[isHorizontal,CARTESIAN_AXIS_TYPE7.CATEGORY,CARTESIAN_AXIS_TYPE7.NUMBER]},position:{$if:[isHorizontal,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},CARTESIAN_POSITION5.TOP,CARTESIAN_POSITION5.BOTTOM]},CARTESIAN_POSITION5.BOTTOM]},label:{$if:[isHorizontal,labelOptions,void 0]}}],FUNNEL_SERIES_THEME={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"fills"}]}],{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",import_ag_charts_community188._ModuleSupport.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],["pattern",import_ag_charts_community188._ModuleSupport.FILL_PATTERN_SINGLE_DEFAULTS],["image",import_ag_charts_community188._ModuleSupport.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...import_ag_charts_community188._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:DEFAULT_SHADOW_COLOUR,xOffset:3,yOffset:3,blur:5},highlight:import_ag_charts_community188._ModuleSupport.singleSeriesHighlightStyle()},axes:{[CARTESIAN_AXIS_TYPE7.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[CARTESIAN_AXIS_TYPE7.CATEGORY]:{line:{enabled:!1}}}},import_ag_charts_community193=require("ag-charts-community"),import_ag_charts_community191=require("ag-charts-community"),import_ag_charts_community189=require("ag-charts-community"),{lineDistanceSquared,BBox:BBox17,Path:Path10,SceneChangeDetection:SceneChangeDetection8}=import_ag_charts_community189._ModuleSupport,delta=1e-6;function pointsEq([t,e],[i,o]){return Math.abs(t-i)<=delta&&Math.abs(e-o)<=delta}var FunnelConnector=class extends Path10{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:t,y0:e,x1:i,y1:o,x2:s,y2:a,x3:r,y3:n}=this;return{x:(t+i+s+r)/4,y:(e+o+a+n)/4}}distanceSquared(t,e){if(this.containsPoint(t,e))return 0;const{x0:i,y0:o,x1:s,y1:a,x2:r,y2:n,x3:l,y3:c}=this;return Math.min(lineDistanceSquared(t,e,i,o,s,a,1/0),lineDistanceSquared(t,e,s,a,r,n,1/0),lineDistanceSquared(t,e,r,n,l,c,1/0),lineDistanceSquared(t,e,l,c,i,o,1/0))}computeBBox(){const{x0:t,y0:e,x1:i,y1:o,x2:s,y2:a,x3:r,y3:n}=this,l=Math.min(t,i,s,r),c=Math.max(t,i,s,r)-l,h=Math.min(e,o,a,n),d=Math.max(e,o,a,n)-h;return new BBox17(l,h,c,d)}updatePath(){const{path:t,x0:e,y0:i,x1:o,y1:s,x2:a,y2:r,x3:n,y3:l}=this,c=[[e,i],[o,s],[a,r],[n,l]];t.clear();let h,d;for(const u of c){if(h!=null&&pointsEq(h,u)||d!=null&&pointsEq(d,u))continue;const[p,g]=u;h==null?t.moveTo(p,g):t.lineTo(p,g),h??(h=u),d=u}t.closePath()}};__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"x0",2),__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"y0",2),__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"x1",2),__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"y1",2),__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"x2",2),__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"y2",2),__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"x3",2),__decorateClass([SceneChangeDetection8()],FunnelConnector.prototype,"y3",2);var import_ag_charts_community190=require("ag-charts-community"),{NODE_UPDATE_STATE_TO_PHASE_MAPPING}=import_ag_charts_community190._ModuleSupport;function connectorStartingPosition(t,e,i,o){const{x0:s,y0:a,x1:r,y1:n,x2:l,y2:c,x3:h,y3:d,opacity:u}=t;return i?{x0:(s+h)/2,y0:(a+d)/2,x1:(r+l)/2,y1:(n+c)/2,x2:(r+l)/2,y2:(n+c)/2,x3:(s+h)/2,y3:(a+d)/2,opacity:u}:{x0:(s+r)/2,y0:(a+n)/2,x1:(s+r)/2,y1:(a+n)/2,x2:(l+h)/2,y2:(c+d)/2,x3:(l+h)/2,y3:(c+d)/2,opacity:u}}function prepareConnectorAnimationFunctions(t,e){const i=a=>a==null;return{fromFn:(a,r,n)=>{n==="updated"&&i(r)?n="removed":n==="updated"&&i(a.previousDatum)&&(n="added");let l;n==="added"&&a.previousDatum==null&&e==="fade"?l={...resetConnectorSelectionsFn(a,r),opacity:0}:n==="unknown"||n==="added"?l=connectorStartingPosition(r,a.previousDatum,t,e):l={x0:a.x0,y0:a.y0,x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,x3:a.x3,y3:a.y3,opacity:a.opacity};const c=NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{...l,phase:c}},toFn:(a,r,n)=>{let l;return n==="removed"&&a.datum==null&&e==="fade"?l={...resetConnectorSelectionsFn(a,r),opacity:0}:n==="removed"||i(r)?l=connectorStartingPosition(r,a.previousDatum,t,e):l=resetConnectorSelectionsFn(a,r),l}}}function resetConnectorSelectionsFn(t,e){const{x0:i,y0:o,x1:s,y1:a,x2:r,y2:n,x3:l,y3:c,opacity:h}=e;return{x0:i,y0:o,x1:s,y1:a,x2:r,y2:n,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:SeriesNodePickMode7,SeriesZIndexMap,valueProperty:valueProperty11,keyProperty:keyProperty8,ChartAxisDirection:ChartAxisDirection25,updateLabelNode:updateLabelNode5,SMALLEST_KEY_INTERVAL:SMALLEST_KEY_INTERVAL4,LARGEST_KEY_INTERVAL:LARGEST_KEY_INTERVAL2,diff:diff5,fixNumericExtent:fixNumericExtent7,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation4,resetMotion:resetMotion2,resetLabelFn:resetLabelFn4,animationValidation:animationValidation6,computeBarFocusBounds:computeBarFocusBounds6,ContinuousScale:ContinuousScale7,Group:Group10,Selection:Selection6,PointerEvents:PointerEvents4,motion:motion4,checkCrisp:checkCrisp3,createDatumId:createDatumId7,applyShapeStyle:applyShapeStyle8}=import_ag_charts_community191._ModuleSupport,FunnelSeriesNodeEvent=class extends import_ag_charts_community191._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.xKey=o.properties.stageKey,this.yKey=o.properties.valueKey}},BaseFunnelSeries=class extends import_ag_charts_community191._ModuleSupport.AbstractBarSeries{constructor({moduleCtx:t,animationResetFns:e}){super({moduleCtx:t,pickModes:[SeriesNodePickMode7.AXIS_ALIGNED,SeriesNodePickMode7.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:e.datum,label:resetLabelFn4}}),this.NodeEvent=FunnelSeriesNodeEvent,this.connectorNodeGroup=this.contentGroup.appendChild(new Group10({name:`${this.id}-series-connectorNodes`,zIndex:SeriesZIndexMap.BACKGROUND})),this.connectorSelection=Selection6.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=PointerEvents4.None}get pickModeAxis(){return"main-category"}setZIndex(t){return super.setZIndex(t),this.connectorNodeGroup.zIndex=[SeriesZIndexMap.BACKGROUND,t],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new FunnelConnector}async processData(t){const{stageKey:e,valueKey:i}=this.properties,{visible:o,id:s}=this,a=(g,y,f)=>o&&this.ctx.legendManager.getItemEnabled({seriesId:s,itemId:f}),r=this.getCategoryAxis()?.scale,n=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:n}),d=[];this.ctx.animationManager.isSkipped()||(this.processedData&&d.push(diff5(this.id,this.processedData)),d.push(animationValidation6()));const u=this.visible?{}:{forceValue:0},{processedData:p}=await this.requestDataModel(t,this.data,{props:[keyProperty8(e,c,{id:"xValue"}),valueProperty11(i,h,{id:"yValue",...u,validation:a,invalidValue:0}),...l?[SMALLEST_KEY_INTERVAL4,LARGEST_KEY_INTERVAL2]:[],...d],groupByKeys:!1});this.smallestDataInterval=p.reduced?.smallestKeyInterval,this.largestDataInterval=p.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i,id:o,ctx:{legendManager:s}}=this;if(!e||!i)return[];const{keys:[a]}=e.domain;if(t===this.getCategoryDirection()){const r=i.resolveProcessedDataDefById(this,"xValue");return r?.def.type==="key"&&r?.def.valueType==="category"?this.hasData?a.filter((n,l)=>s.getItemEnabled({seriesId:o,itemId:l})):[]:this.padBandExtent(a)}else{const r=this.domainForClippedRange(t,["yValue"],"xValue"),n=Math.max(...r),l=[-n,n];return fixNumericExtent7(l)}}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:t,data:e,dataModel:i,groupScale:o,processedData:s,id:a,ctx:{legendManager:r}}=this,n=this.getCategoryAxis(),l=this.getValueAxis();if(!(t&&e&&n&&l&&i&&s?.type==="ungrouped"))return;const c=n.scale,h=l.scale,d=this.getBarDirection()===ChartAxisDirection25.X,{stageKey:u,valueKey:p}=this.properties,g=`${p}`,y={itemId:g,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible},f=this.visible;if(!f)return y;const x=i.resolveKeysById(this,"xValue",s),b=i.resolveColumnById(this,"yValue",s),{barWidth:m,groupIndex:S}=this.updateGroupScale(n),v=ContinuousScale7.is(c)?m*-.5:0,M=checkCrisp3(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let D;const k=s.dataSources.get(this.id)?.data??[];for(const[_,T]of k.entries()){const w=f&&r.getItemEnabled({seriesId:a,itemId:_}),R=x[_];if(R==null)continue;const F=Math.round(c.convert(R))+o.convert(String(S))+v,O=b[_],E=Math.round(h.convert(-O)),I=Math.round(h.convert(O)),C=this.getItemStyle({datum:T,datumIndex:_},!1),L=Math.max(C.strokeWidth??0,Math.abs(I-E)),A={x:d?Math.min(I,E):F,y:d?F:Math.min(I,E),width:d?L:m,height:d?m:L},P={x:A.x+A.width/2,y:A.y+A.height/2},z=this.createLabelData({datumIndex:_,rect:A,barAlongX:d,yDatum:O,datum:T,visible:w}),B={index:_,series:this,itemId:g,datum:T,datumIndex:_,xValue:R,yValue:O,xKey:u,yKey:p,x:A.x,y:A.y,width:A.width,height:A.height,midPoint:P,crisp:M,label:z,visible:w};if(y.nodeData.push(B),z!=null&&y.labelData.push(z),D!=null){const V=D.rect,W=D.nodeDatum,H=D.datumIndex;d?y.connectorData.push({datum:W,datumIndex:H,x0:V.x,y0:V.y+V.height,x1:V.x+V.width,y1:V.y+V.height,x2:A.x+A.width,y2:A.y,x3:A.x,y3:A.y,opacity:1}):y.connectorData.push({datum:W,datumIndex:H,x0:V.x+V.width,y0:V.y,x1:A.x,y1:A.y,x2:A.x,y2:A.y+A.height,x3:V.x+V.width,y3:V.y+V.height,opacity:1})}w&&(D={itemId:g,rect:A,nodeDatum:B,datumIndex:_})}return y}updateNodes(t,e){super.updateNodes(t,e);const{connectorSelection:i}=this,o=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:o}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t,o=e??[];return i.update(o,void 0,s=>this.getDatumId(s))}updateConnectorSelection(t){const{connectorData:e,connectorSelection:i}=t;return i.update(this.connectorEnabled()?e:[],void 0,o=>this.getDatumId(o.datum))}updateConnectorNodes(t){const e=this.getShapeFillBBox();t.connectorSelection.each((i,o)=>{const{fill:s,fillOpacity:a,stroke:r,strokeOpacity:n,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.connectorStyle(o.datumIndex);i.setProperties(resetConnectorSelectionsFn(i,o)),applyShapeStyle8(i,{fill:s,stroke:r,fillOpacity:a,strokeOpacity:n,strokeWidth:l,lineDash:c,lineDashOffset:h},e)})}updateLabelSelection(t){const e=this.properties.label.enabled?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=PointerEvents4.None})}updateLabelNodes(t){const e={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,s)=>{o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,updateLabelNode5(this,o,e,this.properties.label,s,!1,i)})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{stageKey:a,valueKey:r,tooltip:n,legendItemName:l}=s,c=this.getCategoryAxis(),h=this.getValueAxis();if(!i||!o||!c||!h)return;const d=o.dataSources.get(this.id)?.data[t],u=i.resolveKeysById(this,"xValue",o)[t],p=i.resolveColumnById(this,"yValue",o)[t];if(u!=null)return this.formatTooltipWithContext(n,{symbol:this.legendItemSymbol(t),data:[{label:this.getAxisValueText(c,"tooltip",u,d,a,l),value:this.getAxisValueText(h,"tooltip",p,d,r,l)}]},{seriesId:e,datum:d,title:a,stageKey:a,valueKey:r,...this.tooltipStyle(d,t)})}resetAllAnimation(t){super.resetAllAnimation(t),resetMotion2([this.connectorSelection],resetConnectorSelectionsFn)}animateEmptyUpdateReady({labelSelection:t}){const{connectorSelection:e}=this,i=this.isVertical(),s=prepareConnectorAnimationFunctions(i,"normal");motion4.fromToMotion(this.id,"connectors",this.ctx.animationManager,[e],s),seriesLabelFadeInAnimation4(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(t){const{labelSelection:e}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id),seriesLabelFadeInAnimation4(this,"labels",this.ctx.animationManager,e)}getDatumId(t){return createDatumId7(t.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return computeBarFocusBounds6(this,this.contextNodeData?.nodeData[t])}legendItemSymbol(t){const{strokeWidth:e,fillOpacity:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,fill:r,stroke:n}=this.properties.getStyle(t);return{marker:{fill:r,fillOpacity:i,stroke:n,strokeWidth:e,strokeOpacity:o,lineDash:s,lineDashOffset:a}}}getLegendData(t){const{id:e,processedData:i,dataModel:o,ctx:{legendManager:s},visible:a}=this;if(!o||!i||t!=="category")return[];const{showInLegend:r}=this.properties,n=o.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map((l,c)=>{const h=n[c];if(h!=null)return{legendType:"category",id:e,datum:l,itemId:c,seriesId:e,enabled:a&&s.getItemEnabled({seriesId:e,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!r}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}},import_ag_charts_community192=require("ag-charts-community"),{Label:Label7,AbstractBarSeriesProperties:AbstractBarSeriesProperties5,makeSeriesTooltip:makeSeriesTooltip9,AxisLabel:AxisLabel3,Property:Property66}=import_ag_charts_community192._ModuleSupport,ConeFunnelSeriesLabel=class extends Label7{constructor(){super(...arguments),this.spacing=0}};__decorateClass([Property66],ConeFunnelSeriesLabel.prototype,"placement",2),__decorateClass([Property66],ConeFunnelSeriesLabel.prototype,"spacing",2);var ConeFunnelSeriesStageLabel=class extends AxisLabel3{};__decorateClass([Property66],ConeFunnelSeriesStageLabel.prototype,"placement",2);var ConeFunnelProperties=class extends AbstractBarSeriesProperties5{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new ConeFunnelSeriesLabel,this.stageLabel=new ConeFunnelSeriesStageLabel,this.tooltip=makeSeriesTooltip9()}getStyle(t){const{fills:e,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n}=this;return{fill:e[t],fillOpacity:o,stroke:i[t],strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,opacity:1}}};__decorateClass([Property66],ConeFunnelProperties.prototype,"stageKey",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"valueKey",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"fills",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"fillOpacity",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"strokes",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"strokeWidth",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"strokeOpacity",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"lineDash",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"lineDashOffset",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"label",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"stageLabel",2),__decorateClass([Property66],ConeFunnelProperties.prototype,"tooltip",2);function resetLineSelectionsFn(t,{x:e,y:i,width:o,height:s,opacity:a}){return{x1:e,y1:i,x2:e+o,y2:i+s,opacity:a??1}}var{Line:Line5,ChartAxisDirection:ChartAxisDirection26}=import_ag_charts_community193._ModuleSupport,ConeFunnelSeries=class extends BaseFunnelSeries{constructor(t){super({moduleCtx:t,animationResetFns:{datum:resetLineSelectionsFn}}),this.properties=new ConeFunnelProperties}get hasData(){const{id:t,ctx:{legendManager:e}}=this,i=this.data?.data.reduce((o,s,a)=>o+(e.getItemEnabled({seriesId:t,itemId:a})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:t},e){return this.properties.getStyle(t)}connectorStyle(t){return this.properties.getStyle(t)}nodeFactory(){return new Line5}createLabelData({datumIndex:t,rect:e,barAlongX:i,yDatum:o,datum:s,visible:a}){const{stageKey:r,valueKey:n,label:l}=this.properties,{spacing:c,placement:h}=l;if(!l.enabled)return;let d,u,p,g;if(i)switch(d=e.x+e.width/2,p="center",h){case"before":u=e.y-c,g="bottom";break;case"after":u=e.y+e.height+c,g="top";break;default:u=e.y+e.height/2,g="middle"}else switch(u=e.y+e.height/2,g="middle",h){case"before":d=e.x-c,p="right";break;case"after":d=e.x+e.width+c,p="left";break;default:d=e.x+e.width/2,p="center"}const y=this.getSeriesDomain(ChartAxisDirection26.Y),f=this.getLabelText(o,s,n,"y",y,l,{itemId:n,value:o,datum:s,stageKey:r,valueKey:n});return{x:d,y:u,textAlign:p,textBaseline:g,text:f,itemId:n,datum:s,datumIndex:t,series:this,visible:a}}updateDatumNodes(t){const e=this.getHighlightStyle(t.isHighlight);t.datumSelection.each((i,o)=>{i.setProperties(resetLineSelectionsFn(i,o)),i.stroke=e?.stroke,i.strokeWidth=e?.strokeWidth??0,i.strokeOpacity=e?.strokeOpacity??1,i.lineDash=e?.lineDash,i.lineDashOffset=e?.lineDashOffset??0,i.opacity=e?.opacity??1})}tooltipStyle(t,e){const{fill:i,stroke:o,fillOpacity:s,strokeOpacity:a,strokeWidth:r,lineDash:n,lineDashOffset:l}=this.properties.getStyle(e);return{fill:i,fillOpacity:s,stroke:o,strokeOpacity:a,strokeWidth:r,lineDash:n,lineDashOffset:l}}hasItemStylers(){return this.properties.label.itemStyler!=null}};ConeFunnelSeries.className="ConeFunnelSeries",ConeFunnelSeries.type="cone-funnel";var import_ag_charts_community194=require("ag-charts-community"),import_ag_charts_core82=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs9,coneFunnelSeriesThemeableOptionsDef,without:without3}=import_ag_charts_community194._ModuleSupport,coneFunnelSeriesOptionsDef={...without3(commonSeriesOptionsDefs9,["showInLegend"]),...coneFunnelSeriesThemeableOptionsDef,type:(0,import_ag_charts_core82.required)((0,import_ag_charts_core82.constant)("cone-funnel")),stageKey:(0,import_ag_charts_core82.required)(import_ag_charts_core82.string),valueKey:(0,import_ag_charts_core82.required)(import_ag_charts_core82.string)},import_ag_charts_community195=require("ag-charts-community"),{ThemeConstants:{CARTESIAN_AXIS_TYPE:CARTESIAN_AXIS_TYPE8}}=import_ag_charts_community195._ModuleSupport,CONE_FUNNEL_SERIES_THEME={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},import_ag_charts_community195._ModuleSupport.SAFE_RANGE2_OPERATION]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",import_ag_charts_community195._ModuleSupport.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],["pattern",import_ag_charts_community195._ModuleSupport.FILL_PATTERN_SINGLE_DEFAULTS],["image",import_ag_charts_community195._ModuleSupport.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},import_ag_charts_community195._ModuleSupport.SAFE_RANGE2_OPERATION]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...import_ag_charts_community195._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:import_ag_charts_community195._ModuleSupport.singleSeriesHighlightStyle(!1)},seriesArea:{padding:{top:20,bottom:20}},axes:{[CARTESIAN_AXIS_TYPE8.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[CARTESIAN_AXIS_TYPE8.CATEGORY]:{line:{enabled:!1}}}},ConeFunnelModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:t=>new ConeFunnelSeries(t),solo:!0,defaultAxes:FUNNEL_SERIES_AXES,themeTemplate:CONE_FUNNEL_SERIES_THEME},ConeFunnelSeriesModule={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:coneFunnelSeriesOptionsDef,create:t=>new ConeFunnelSeries(t)},import_ag_charts_community197=require("ag-charts-community"),import_ag_charts_community196=require("ag-charts-community"),{Label:Label8,DropShadow:DropShadow4,AbstractBarSeriesProperties:AbstractBarSeriesProperties6,BaseProperties:BaseProperties25,makeSeriesTooltip:makeSeriesTooltip10,AxisLabel:AxisLabel4,Property:Property67}=import_ag_charts_community196._ModuleSupport,FunnelSeriesLabel=class extends Label8{},FunnelSeriesStageLabel=class extends AxisLabel4{};__decorateClass([Property67],FunnelSeriesStageLabel.prototype,"placement",2);var FunnelDropOff=class extends BaseProperties25{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:t,stroke:e,fillOpacity:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r}=this;return{fill:t,fillOpacity:i,stroke:e,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,opacity:1}}};__decorateClass([Property67],FunnelDropOff.prototype,"enabled",2),__decorateClass([Property67],FunnelDropOff.prototype,"fill",2),__decorateClass([Property67],FunnelDropOff.prototype,"fillOpacity",2),__decorateClass([Property67],FunnelDropOff.prototype,"stroke",2),__decorateClass([Property67],FunnelDropOff.prototype,"strokeWidth",2),__decorateClass([Property67],FunnelDropOff.prototype,"strokeOpacity",2),__decorateClass([Property67],FunnelDropOff.prototype,"lineDash",2),__decorateClass([Property67],FunnelDropOff.prototype,"lineDashOffset",2);var FunnelProperties=class extends AbstractBarSeriesProperties6{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new FunnelDropOff,this.shadow=new DropShadow4().set({enabled:!1}),this.label=new FunnelSeriesLabel,this.stageLabel=new FunnelSeriesStageLabel,this.tooltip=makeSeriesTooltip10()}getStyle(t){const{fills:e,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n}=this;return{fill:e[t],fillOpacity:o,stroke:i[t],strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,opacity:1}}};__decorateClass([Property67],FunnelProperties.prototype,"stageKey",2),__decorateClass([Property67],FunnelProperties.prototype,"valueKey",2),__decorateClass([Property67],FunnelProperties.prototype,"fills",2),__decorateClass([Property67],FunnelProperties.prototype,"fillOpacity",2),__decorateClass([Property67],FunnelProperties.prototype,"strokes",2),__decorateClass([Property67],FunnelProperties.prototype,"strokeWidth",2),__decorateClass([Property67],FunnelProperties.prototype,"strokeOpacity",2),__decorateClass([Property67],FunnelProperties.prototype,"lineDash",2),__decorateClass([Property67],FunnelProperties.prototype,"lineDashOffset",2),__decorateClass([Property67],FunnelProperties.prototype,"spacingRatio",2),__decorateClass([Property67],FunnelProperties.prototype,"itemStyler",2),__decorateClass([Property67],FunnelProperties.prototype,"dropOff",2),__decorateClass([Property67],FunnelProperties.prototype,"shadow",2),__decorateClass([Property67],FunnelProperties.prototype,"label",2),__decorateClass([Property67],FunnelProperties.prototype,"stageLabel",2),__decorateClass([Property67],FunnelProperties.prototype,"tooltip",2);var{ChartAxisDirection:ChartAxisDirection27,resetBarSelectionsFn:resetBarSelectionsFn3,prepareBarAnimationFunctions:prepareBarAnimationFunctions3,midpointStartingBarPosition:midpointStartingBarPosition2,createDatumId:createDatumId8,Rect:Rect6,motion:motion5,applyShapeStyle:applyShapeStyle9,mergeDefaults:mergeDefaults11}=import_ag_charts_community197._ModuleSupport,FunnelSeries=class extends BaseFunnelSeries{constructor(t){super({moduleCtx:t,animationResetFns:{datum:resetBarSelectionsFn3}}),this.properties=new FunnelProperties}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(t){return mergeDefaults11(this.properties.dropOff.getStyle(),this.properties.getStyle(t))}nodeFactory(){return new Rect6}createLabelData({datumIndex:t,rect:e,yDatum:i,datum:o,visible:s}){const{valueKey:a,stageKey:r,label:n}=this.properties;if(!n.enabled)return;const l=this.getSeriesDomain(ChartAxisDirection27.Y),c=this.getLabelText(i,o,a,"y",l,n,{itemId:a,value:i,datum:o,stageKey:r,valueKey:a});return{x:e.x+e.width/2,y:e.y+e.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:r,datum:o,datumIndex:t,series:this,visible:s}}getItemStyle({datum:t,datumIndex:e},i){const{id:o,properties:s}=this,{stageKey:a,valueKey:r,itemStyler:n}=s,l=this.getHighlightStyle(i,e);let h=mergeDefaults11(l,s.getStyle(e));if(n!=null){const d=this.ctx.highlightManager?.getActiveHighlight(),u=this.cachedDatumCallback(createDatumId8(e,i?"highlight":"node"),()=>{const p=this.getHighlightStateString(d,i,e);return this.callWithContext(n,{seriesId:o,datum:t,highlighted:i,highlightState:p,stageKey:a,valueKey:r,...h})});u&&(h=mergeDefaults11(u,h))}return h}updateDatumNodes({datumSelection:t,isHighlight:e}){const{contextNodeData:i}=this;if(!i)return;const{shadow:o}=this.properties,s=this.getCategoryDirection()===ChartAxisDirection27.X,a=this.getShapeFillBBox();t.each((r,n)=>{const l=this.getItemStyle(n,e);applyShapeStyle9(r,l,a),r.visible=s?n.width>0:n.height>0,r.crisp=n.crisp,r.fillShadow=o})}tooltipStyle(t,e){return this.getItemStyle({datum:t,datumIndex:e},!1)}animateEmptyUpdateReady(t){super.animateEmptyUpdateReady(t);const{datumSelection:e}=t,i=this.isVertical(),s=prepareBarAnimationFunctions3(midpointStartingBarPosition2(i,"normal"),"unknown");motion5.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t);const{datumSelection:e}=t,{processedData:i}=this,o=i?.reduced?.diff?.[this.id],s=prepareBarAnimationFunctions3(midpointStartingBarPosition2(this.isVertical(),"fade"),"added");motion5.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],s,(a,r)=>r.xValue,o)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};FunnelSeries.className="FunnelSeries",FunnelSeries.type="funnel";var import_ag_charts_community198=require("ag-charts-community"),import_ag_charts_core83=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs10,funnelSeriesThemeableOptionsDef,without:without4}=import_ag_charts_community198._ModuleSupport,funnelSeriesOptionsDef={...funnelSeriesThemeableOptionsDef,...without4(commonSeriesOptionsDefs10,["showInLegend"]),type:(0,import_ag_charts_core83.required)((0,import_ag_charts_core83.constant)("funnel")),stageKey:(0,import_ag_charts_core83.required)(import_ag_charts_core83.string),valueKey:(0,import_ag_charts_core83.required)(import_ag_charts_core83.string)},FunnelModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:t=>new FunnelSeries(t),solo:!0,defaultAxes:FUNNEL_SERIES_AXES,themeTemplate:FUNNEL_SERIES_THEME},FunnelSeriesModule={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:funnelSeriesOptionsDef,create:t=>new FunnelSeries(t)},import_ag_charts_community203=require("ag-charts-community"),import_ag_charts_community202=require("ag-charts-community"),import_ag_charts_core88=require("ag-charts-core"),DatumUnion=class{*[Symbol.iterator](){const{node:t,datum:e}=this;t&&e&&(yield{node:t,datum:e})}nodes(){return this.node?[this.node]:[]}update(t,e,i,o){const s=t.nodes();if(s.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,e.appendChild(this.node));const a=s[0],r=s.toReversed().find(n=>n.datum.datum.value>n.datum.datum.segmentStart)??s.at(-1);this.node.datum=this.datum=a.datum,o(this.node,a,r)}}},import_ag_charts_core84=require("ag-charts-core"),fadeInFns={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function formatLabel(t,e){if(t==null)return"";const{min:i,max:o}=e,s=i===0?0:Math.ceil(Math.log10(Math.abs(i))),a=o===0?0:Math.ceil(Math.log10(Math.abs(o))),r=Math.max(2-Math.max(s,a),0);return t.toFixed(r)}function getLabelText(t,e,i,o){if(i.text!=null)return i.text;const s=o??i.value;let a;return i?.formatter!=null&&(a=formatWithContext(e,i.formatter,{seriesId:t,datum:void 0,value:s})),a==null||(0,import_ag_charts_core84.isArray)(a)?a:String(a)}function lineMarker({path:t,x:e,y:i,size:o}){t.moveTo(e,i-o/2),t.lineTo(e,i+o/2)}var import_ag_charts_core85=require("ag-charts-core");function pickGaugeNearestDatum(t,e){const i=(0,import_ag_charts_core85.iterate)(t.datumUnion.nodes(),t.targetSelection.nodes());return t.pickNodeNearestDistantObject(e,i)}function pickGaugeFocus(t,e){const i=[{data:t.contextNodeData?.nodeData,selection:t.datumUnion},{data:t.contextNodeData?.targetData,selection:t.targetSelection}].filter(l=>l.data&&l.data.length>0),o=(0,import_ag_charts_core85.clamp)(0,e.otherIndex+e.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:s,selection:a}=i[o];if(s==null||s.length===0)return;const r=(0,import_ag_charts_core85.clamp)(0,e.datumIndex,s.length-1),n=s[r];for(const l of a)if(l.datum===n)return{bounds:l.node,clipFocusBox:!0,datum:n,datumIndex:r,otherIndex:o}}var import_ag_charts_community200=require("ag-charts-community"),import_ag_charts_community199=require("ag-charts-community"),import_ag_charts_core86=require("ag-charts-core"),{BaseProperties:BaseProperties26,Property:Property68}=import_ag_charts_community199._ModuleSupport,GaugeSegmentationIntervalProperties=class extends BaseProperties26{getSegments(t,e){const{values:i,step:o,count:s}=this,a=Math.min(...t.domain),r=Math.max(...t.domain);let n;if(i!=null){const l=i.filter(c=>c>a&&cc-h);n=[a,...l,r]}else if(o!=null){const l=[];for(let c=a;cc>a&&ch/l*(r-a)+a)}return n!=null&&n.length>e&&(import_ag_charts_core86.Logger.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),n=void 0),n??(n=[a,r]),n}};__decorateClass([Property68],GaugeSegmentationIntervalProperties.prototype,"values",2),__decorateClass([Property68],GaugeSegmentationIntervalProperties.prototype,"step",2),__decorateClass([Property68],GaugeSegmentationIntervalProperties.prototype,"count",2);var GaugeSegmentationProperties=class extends BaseProperties26{constructor(){super(...arguments),this.enabled=!1,this.interval=new GaugeSegmentationIntervalProperties,this.spacing=0}};__decorateClass([Property68],GaugeSegmentationProperties.prototype,"enabled",2),__decorateClass([Property68],GaugeSegmentationProperties.prototype,"interval",2),__decorateClass([Property68],GaugeSegmentationProperties.prototype,"spacing",2);var{BaseProperties:BaseProperties27,makeSeriesTooltip:makeSeriesTooltip11,SeriesProperties:SeriesProperties2,PropertiesArray:PropertiesArray7,Property:Property69,Label:Label9,AxisLabel:AxisLabel5,getColorStops}=import_ag_charts_community200._ModuleSupport,LinearGaugeDefaultTargetLabelProperties=class extends Label9{};__decorateClass([Property69],LinearGaugeDefaultTargetLabelProperties.prototype,"spacing",2);var LinearGaugeTargetProperties=class extends BaseProperties27{constructor(){super(...arguments),this.value=0,this.label=new LinearGaugeDefaultTargetLabelProperties}getStyle(t){const{fill:e=t.fill??"black",fillOpacity:i=t.fillOpacity??1,stroke:o=t.stroke??"black",strokeWidth:s=t.strokeWidth??0,strokeOpacity:a=t.strokeOpacity??1,lineDash:r=t.lineDash??[0],lineDashOffset:n=t.lineDashOffset??0}=this;return{fill:e,fillOpacity:i,stroke:o,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n}}};__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"text",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"value",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"shape",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"placement",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"spacing",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"size",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"rotation",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"fill",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"fillOpacity",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"stroke",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"strokeWidth",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"strokeOpacity",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"lineDash",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"lineDashOffset",2),__decorateClass([Property69],LinearGaugeTargetProperties.prototype,"label",2);var LinearGaugeBarProperties=class extends BaseProperties27{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new PropertiesArray7(import_ag_charts_community200._ModuleSupport.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(t,e,i){const{fill:o,fills:s,fillMode:a,fillOpacity:r,stroke:n,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:o??createLinearGradient(s,a,t,i,e),fillOpacity:r,stroke:n,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};__decorateClass([Property69],LinearGaugeBarProperties.prototype,"enabled",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"thickness",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"thicknessRatio",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"fills",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"fillMode",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"fill",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"fillOpacity",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"stroke",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"strokeWidth",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"strokeOpacity",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"lineDash",2),__decorateClass([Property69],LinearGaugeBarProperties.prototype,"lineDashOffset",2);var LinearGaugeScaleIntervalProperties=class extends BaseProperties27{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};__decorateClass([Property69],LinearGaugeScaleIntervalProperties.prototype,"values",2),__decorateClass([Property69],LinearGaugeScaleIntervalProperties.prototype,"step",2),__decorateClass([Property69],LinearGaugeScaleIntervalProperties.prototype,"minSpacing",2),__decorateClass([Property69],LinearGaugeScaleIntervalProperties.prototype,"maxSpacing",2);var LinearGaugeScaleLabelProperties=class extends AxisLabel5{constructor(){super(...arguments),this.placement=void 0}};__decorateClass([Property69],LinearGaugeScaleLabelProperties.prototype,"placement",2);var LinearGaugeScaleProperties=class extends BaseProperties27{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new PropertiesArray7(import_ag_charts_community200._ModuleSupport.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new LinearGaugeScaleIntervalProperties,this.label=new LinearGaugeScaleLabelProperties}getStyle(t,e,i,o){const{fill:s,fills:a,defaultFill:r,fillMode:n,fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:u,lineDashOffset:p}=this;return{fill:s??(t&&a.length===0?r:void 0)??createLinearGradient(a,n,e,o,i),fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:d,lineDash:u,lineDashOffset:p}}};__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"min",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"max",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"fills",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"fillMode",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"fill",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"fillOpacity",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"stroke",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"strokeWidth",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"strokeOpacity",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"lineDash",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"lineDashOffset",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"defaultFill",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"interval",2),__decorateClass([Property69],LinearGaugeScaleProperties.prototype,"label",2);var LinearGaugeLabelProperties=class extends AutoSizedLabel{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};__decorateClass([Property69],LinearGaugeLabelProperties.prototype,"text",2),__decorateClass([Property69],LinearGaugeLabelProperties.prototype,"placement",2),__decorateClass([Property69],LinearGaugeLabelProperties.prototype,"avoidCollisions",2);var LinearGaugeSeriesProperties=class extends SeriesProperties2{constructor(){super(...arguments),this.value=0,this.segmentation=new GaugeSegmentationProperties,this.defaultColorRange=[],this.targets=new PropertiesArray7(LinearGaugeTargetProperties),this.defaultTarget=new LinearGaugeTargetProperties,this.defaultScale=new LinearGaugeScaleProperties,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new LinearGaugeScaleProperties,this.bar=new LinearGaugeBarProperties,this.label=new LinearGaugeLabelProperties,this.tooltip=makeSeriesTooltip11()}};__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"value",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"segmentation",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"defaultColorRange",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"targets",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"defaultTarget",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"defaultScale",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"direction",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"thickness",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"cornerRadius",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"cornerMode",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"margin",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"scale",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"bar",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"label",2),__decorateClass([Property69],LinearGaugeSeriesProperties.prototype,"tooltip",2);function createLinearGradient(t,e,i,o,s){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:getColorStops(t,i,o.domain,e),rotation:s?90:0,bounds:"series"}}var import_ag_charts_community201=require("ag-charts-community"),import_ag_charts_core87=require("ag-charts-core"),{BBox:BBox18}=import_ag_charts_community201._ModuleSupport;function datumRect(t){const{x0:e,y0:i,x1:o,y1:s,horizontalInset:a,verticalInset:r}=t,n=Math.min(e,o)+a,l=Math.min(i,s)+r,c=Math.max(Math.abs(o-e)-2*a,0),h=Math.max(Math.abs(s-i)-2*r,0);return{x:n,y:l,width:c,height:h}}function clipBBoxVisibility(t,e){if(e==null)return!0;const i=datumRect(t),o=1e-6,s=i.x+o,a=i.y+o,r=i.x+i.width-o,n=i.y+i.height-o,l=e.x,c=e.x+e.width,h=e.y,d=e.y+e.height;return Math.max(s,l)<=Math.min(r,c)&&Math.max(a,h)<=Math.min(n,d)}function hasClipBBox(t){const{clipX0:e,clipX1:i,clipY0:o,clipY1:s}=t;return e!=null&&i!=null||o!=null&&s!=null}function computeClipBBox(t){if(!hasClipBBox(t))return;const{x0:e,y0:i,x1:o,y1:s}=t,{x:a,y:r,width:n,height:l}=datumRect(t);let{clipX0:c,clipX1:h,clipY0:d,clipY1:u}=t;(c==null||h==null)&&(c=e,h=o),(d==null||u==null)&&(d=i,u=s);const p=Math.min(c,h),g=Math.min(d,u),y=Math.abs(h-c),f=Math.abs(u-d);return c=Math.max(a,p),d=Math.max(r,g),h=Math.min(a+n,p+y),u=Math.min(r+l,g+f),new BBox18(Math.min(c,h),Math.min(d,u),Math.abs(h-c),Math.abs(u-d))}function prepareLinearGaugeSeriesAnimationFunctions(t,e){const i=t?"initial":"update";return{node:{fromFn(s,a){const r=s.previousDatum;let{x0:n,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=r??a;const{horizontalInset:y,verticalInset:f}=a,x=r!=null&&hasClipBBox(r),b=hasClipBBox(a);return x&&b||(!x&&b?({x0:n,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g}=a,t&&(e?p=a.clipX0:g=a.clipY0)):x&&!b?({x0:n,y0:l,x1:c,y1:h}=a,d=void 0,u=void 0,p=void 0,g=void 0):t&&(e?c=n:h=l)),{x0:n,y0:l,x1:c,y1:h,clipX0:d,clipY0:u,clipX1:p,clipY1:g,horizontalInset:y,verticalInset:f,phase:i}},toFn(s,a){const{x0:r,y0:n,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:y}=a;return{x0:r,y0:n,x1:l,y1:c,clipX0:h,clipY0:d,clipX1:u,clipY1:p,horizontalInset:g,verticalInset:y}},applyFn(s,a){s.setProperties(resetLinearGaugeSeriesResetRectFunction(s,a))}}}}function resetLinearGaugeSeriesResetRectFunction(t,e){const{x:i,y:o,width:s,height:a}=datumRect(e),r=computeClipBBox(e),n=clipBBoxVisibility(e,r);return{x:i,y:o,width:s,height:a,clipBBox:r,visible:n}}var horizontalTextAligns={Before:"right",Center:"center",After:"left"},verticalTextBaselines={Before:"top",Center:"middle",After:"bottom"},horizontalAlignFactors={Before:-1,Center:-.5,After:0},verticalAlignFactors2={Before:0,Center:-.5,After:-1};function formatLinearGaugeLabels(t,e,i,o,s,a){const{seriesRect:r,gaugeRect:n,barRect:l}=s,{padding:c,horizontal:h}=o;i.each((d,u)=>{const p=getLabelText(t.id,e,u,a?.label);let g,y;u.placement==="outside-start"?h?(g=n.x,y=r.height):(g=r.width,y=r.height-(n.y+n.height)):u.placement==="outside-end"?h?(g=r.width-(n.x+n.width),y=r.height):(g=r.width,y=n.y):u.avoidCollisions&&(g=n.width,y=n.height);let f;if(p==null)return;if(g!=null&&y!=null){const E=()=>({width:g,height:y,meta:null});f=formatSingleLabel((0,import_ag_charts_core87.toPlainText)(p),u,{padding:c},E)?.[0]}else{const E=(0,import_ag_charts_core87.cachedTextMeasurer)(u),{width:I,height:C}=(0,import_ag_charts_core87.isArray)(p)?(0,import_ag_charts_core87.measureTextSegments)(p,u):E.measureLines(p);f={text:p,fontSize:u.fontSize,lineHeight:u.lineHeight??E.lineHeight(),width:I,height:C}}if(f==null){d.visible=!1;return}const x=h?n.x:n.y+n.height,b=h?n.x+n.width:n.y,m=h?l.x:l.y+l.height,S=h?l.x+l.width:l.y,v=u.spacing*(h?1:-1);let M,D,k,_;switch(u.placement){case"outside-start":M=-1/0,D=1/0,k=x-v,_="Before";break;case"outside-end":M=-1/0,D=1/0,k=b+v,_="After";break;case"inside-start":M=x,D=S,k=x+v,_="After";break;case"inside-end":M=S,D=b,k=b-v,_="Before";break;case"inside-center":M=x,D=b,k=(x+b)/2,_="Center";break;case"bar-inside":M=m,D=S,k=(m+S)/2,_="Center";break;case"bar-inside-end":M=m,D=S,k=S-v,_="Before";break;case"bar-outside-end":M=S,D=b,k=S+v,_="After";break;case"bar-end":M=-1/0,D=1/0,k=S,_="Center";break}const T=h?k:n.x+n.width/2,w=h?n.y+n.height/2:k;let R,F;h?(R=T+horizontalAlignFactors[_]*f.width,F=R+f.width):(R=w+verticalAlignFactors2[_]*f.height,F=R+f.height);const O=Math.min(R,F)>=Math.min(M,D)&&Math.max(R,F)<=Math.max(M,D);if(u.avoidCollisions&&!O){d.visible=!1;return}d.visible=!0,d.text=f.text,d.fontSize=f.fontSize,d.lineHeight=f.lineHeight,d.textAlign=h?horizontalTextAligns[_]:"center",d.textBaseline=h?"middle":verticalTextBaselines[_],d.x=T,d.y=w})}var{fromToMotion:fromToMotion2,resetMotion:resetMotion3,SeriesNodePickMode:SeriesNodePickMode8,StateMachine:StateMachine12,createDatumId:createDatumId9,toRadians:toRadians4,BBox:BBox19,Group:Group11,PointerEvents:PointerEvents5,Selection:Selection7,Rect:Rect7,Text:Text3,TransformableText:TransformableText2,Marker:Marker3,LinearScale:LinearScale4,generateTicks:generateTicks2,NiceMode,easing,findRangeExtent:findRangeExtent2,tickFormat,mergeDefaults:mergeDefaults12,applyShapeStyle:applyShapeStyle10}=import_ag_charts_community202._ModuleSupport,horizontalTargetPlacementRotation={before:180,middle:0,after:0},verticalTargetPlacementRotation={before:90,middle:0,after:-90},LinearGaugeSeries=class extends import_ag_charts_community202._ModuleSupport.Series{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode8.EXACT_SHAPE_MATCH,SeriesNodePickMode8.NEAREST_NODE]}),this.properties=new LinearGaugeSeriesProperties,this.seriesRect=BBox19.NaN,this.gaugeRect=BBox19.NaN,this.scale=new LinearScale4,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new Group11({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Group11({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Group11({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Group11({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group11({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Group11({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Group11({name:"tickGroup"})),this.scaleSelection=Selection7.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Selection7.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Selection7.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Selection7.select(this.itemTargetLabelGroup,Text3),this.labelSelection=Selection7.select(this.itemLabelGroup,Text3),this.highlightTargetSelection=Selection7.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Selection7.select(this.tickGroup,TransformableText2),this.datumUnion=new DatumUnion,this.animationState=new StateMachine12("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=PointerEvents5.None,this.tickGroup.pointerEvents=PointerEvents5.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const t=new Rect7;return t.crisp=!0,t}markerFactory(){return new Marker3}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){return formatLabel(t,this.properties.scale)}getShapeFillBBox(){const{properties:t,originX:e,originY:i,horizontal:o,scale:s}=this,{thickness:a}=t,r=findRangeExtent2(s.range),n=new BBox19(e,i,o?r:a,o?a:r);return{axis:n,series:n}}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:o=e.text,value:s=e.value??0,shape:a=e.shape??"triangle",rotation:r=e.rotation??0,placement:n=e.placement??"middle",spacing:l=e.spacing??0,size:c=e.size??0}=i,{enabled:h=e.label.enabled,color:d=e.label.color??"black",fontStyle:u=e.label.fontStyle??"normal",fontWeight:p=e.label.fontWeight??"normal",fontSize:g=e.label.fontSize,fontFamily:y=e.label.fontFamily,spacing:f=e.label.spacing??0}=i.label;return{text:o,value:s,shape:a,placement:n,spacing:l,size:c,rotation:r,label:{enabled:h,color:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:y,spacing:f},style:i.getStyle(e)}})}getTargetPoint(t){const{properties:e,originX:i,originY:o,horizontal:s,scale:a,gaugeRect:r}=this,{thickness:n}=e,{value:l,placement:c,spacing:h,size:d}=t,u=a.convert(l);let p;switch(c){case"before":p=-(h+d/2);break;case"after":p=n+h+d/2;break;default:p=n/2;break}return{x:i+r.x+(s?u:p),y:o+r.y+(s?p:u)}}getTargetLabel(t){const{size:e,placement:i,label:o}=t,{spacing:s,color:a,fontStyle:r,fontWeight:n,fontSize:l,fontFamily:c}=o,h=void 0,d=e/2+s;let u,p,g=0,y=0;return this.horizontal?(u="center",i==="after"?(p="top",y=d):(p="bottom",y=-d)):(p="middle",i==="before"?(u="right",g=-d):(u="left",g=d)),{offsetX:g,offsetY:y,fill:a,textAlign:u,textBaseline:p,fontStyle:r,fontWeight:n,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(t,e){const{placement:i,avoidCollisions:o,spacing:s,text:a,color:r,fontSize:n,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:y=f=>this.formatLabel(f.value)}=t;return{placement:i,avoidCollisions:o,spacing:s,text:a,value:e,fill:r,fontSize:n,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:d,lineHeight:u,wrapping:p,overflowStrategy:g,formatter:y}}verticalLabelInset(){const{label:t}=this.properties,e=(0,import_ag_charts_core88.cachedTextMeasurer)(t),i=t.text?.split(`
+`),o=(t.lineHeight??e.lineHeight())*(i?.length??1);return t.spacing+o}horizontalLabelInset(){const{scale:t,properties:e}=this,{scale:i,label:o}=e,s=o.text?.split(`
+`),a=(0,import_ag_charts_core88.cachedTextMeasurer)(o),r=i.interval.values??t.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(s??r?.map(c=>getLabelText(this.id,this.ctx,this.labelDatum(o,c))??"")).reduce((c,h)=>{const{width:d}=(0,import_ag_charts_core88.isArray)(h)?(0,import_ag_charts_core88.measureTextSegments)(h,o):a.measureLines(h);return Math.max(c,d)},0);return o.spacing+l}tickFormatter(t,e){const{format:i,formatter:o}=this.properties.scale.label;let s;return i!=null&&(s=tickFormat(e,typeof i=="string"?i:void 0)),(a,r)=>{let n;return o&&(n??(n=formatWithContext(this.ctx,o,{value:a,index:r,domain:t,boundSeries:void 0}))),n??(n=s?.(a)),n??this.formatLabel(a)}}createNodeData(){const{id:t,properties:e,horizontal:i,scale:o,seriesRect:s}=this,{value:a,segmentation:r,thickness:n,cornerRadius:l,cornerMode:c,bar:h,scale:d,label:u,defaultColorRange:p}=e;o.domain=[d.min,d.max],o.range=i?[0,s.width]:[s.height,0];let g,y;i?(y=1,g=Math.PI/2):d.label.placement==="before"?(y=1,g=0):(y=-1,g=0);let f,x,b,m;i?(f=0,x=s.width,b=(s.height-n)/2,m=b+n,u.placement==="outside-start"?f+=this.horizontalLabelInset():u.placement==="outside-end"&&(x-=this.horizontalLabelInset())):(f=(s.width-n)/2,x=f+n,m=0,b=s.height,u.placement==="outside-start"?b-=this.verticalLabelInset():u.placement==="outside-end"&&(m+=this.verticalLabelInset())),this.gaugeRect=new BBox19(Math.min(f,x),Math.min(b,m),Math.abs(x-f),Math.abs(m-b));const S=0,v=0;o.domain=[d.min,d.max],o.range=i?[f,x]:[b,m];const{tickData:{ticks:M}}=generateTicks2({scale:o,label:this.properties.scale.label,interval:this.properties.scale.interval,tickFormatter:(X,Z)=>this.tickFormatter(X,Z),domain:o.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:NiceMode.Off,labelOffset:0,axisRotation:g,sideFlag:y}),D=!1,k=this.getTargets(),_=[],T=[],w=[],R=[],[F,O]=o.range,E=Math.abs(O-F),I=i?o.convert(a):x,C=i?m:o.convert(a),L=r.enabled?r.spacing/2:0,A=i?L:0,P=i?0:L,z=Math.min(h.thickness??Math.round(h.thicknessRatio*n),n),B=-(n-z)/2,V=i?0:B,W=i?B:0,H=c==="item",G=Math.ceil(E);let K=r.enabled?r.interval.getSegments(o,G):void 0;const U=h.getStyle(p,i,o),Y=d.getStyle(h.enabled,p,i,o);if(K==null&&H){const X=Math.min(...o.domain),Z=Math.max(...o.domain),q={value:a,segmentStart:X,segmentEnd:Z};if(h.enabled){const ot=Math.min(l,z/2,E/2)*(D?-1:1),et=i?ot:0,st=i?0:ot;_.push({series:this,itemId:"value",datum:q,datumIndex:{type:0},type:0,x0:S+f-et-V,y0:v+b-st-W,x1:S+I+et+V,y1:v+C+st+W,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:A,verticalInset:P,style:U})}const J=Math.min(l,n/2,E/2)*(D?-1:1),j=i?J:0,tt=i?0:J;R.push({series:this,itemId:"scale",datum:q,datumIndex:{type:0},type:0,x0:S+f-j,y0:v+b-tt,x1:S+x+j,y1:v+m+tt,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:A,verticalInset:P,style:Y})}else{K??(K=o.domain);const X=S+f-V,Z=v+b-W,q=S+I+V,it=v+C+W;for(let J=0;JcreateDatumId9(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i}=this,o=i.animationManager.isSkipped(),s=this.getShapeFillBBox();e.each((r,n)=>{const{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:d}=n;applyShapeStyle10(r,n.style,s),r.topLeftCornerRadius=l,r.topRightCornerRadius=c,r.bottomRightCornerRadius=h,r.bottomLeftCornerRadius=d,r.pointerEvents=this.properties.bar.enabled?import_ag_charts_community202._ModuleSupport.PointerEvents.All:import_ag_charts_community202._ModuleSupport.PointerEvents.None,(o||r.previousDatum==null)&&r.setProperties(resetLinearGaugeSeriesResetRectFunction(r,n))});const{horizontal:a}=this;this.datumUnion.update(e,this.itemGroup,import_ag_charts_community202._ModuleSupport.Rect,(r,n,l)=>{const c=Math.min(n.x,l.x),h=Math.max(n.x+n.width,l.x+l.width),d=Math.min(n.y,l.y),u=Math.max(n.y+n.height,l.y+l.height),p=h-c,g=u-d;r.pointerEvents=import_ag_charts_community202._ModuleSupport.PointerEvents.None,r.x=c,r.y=d,r.width=p,r.height=g,r.topLeftCornerRadius=a?n.topLeftCornerRadius:l.topLeftCornerRadius,r.topRightCornerRadius=l.topRightCornerRadius,r.bottomRightCornerRadius=a?l.bottomRightCornerRadius:n.bottomRightCornerRadius,r.bottomLeftCornerRadius=n.bottomLeftCornerRadius;const y=n.clipBBox,f=l.clipBBox??y;y&&f?r.clipBBox=BBox19.merge([y,f]).intersection(a?new BBox19(c,-1/0,p,1/0):new BBox19(-1/0,d,1/0,g)):r.clipBBox=void 0})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>createDatumId9(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,i=this.getShapeFillBBox();e.each((o,s)=>{const{topLeftCornerRadius:a,topRightCornerRadius:r,bottomRightCornerRadius:n,bottomLeftCornerRadius:l}=s;applyShapeStyle10(o,s.style,i),o.setProperties(resetLinearGaugeSeriesResetRectFunction(o,s)),o.topLeftCornerRadius=a,o.topRightCornerRadius=r,o.bottomRightCornerRadius=n,o.bottomLeftCornerRadius=l,o.setProperties(resetLinearGaugeSeriesResetRectFunction(o,s))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetNodes(t){const{targetSelection:e,isHighlight:i}=t;e.each((o,s)=>{const{x:a,y:r,shape:n,size:l,rotation:c}=s,h=this.getTargetStyle(i,s);applyShapeStyle10(o,h),o.size=l,o.shape=n==="line"?lineMarker:n,o.translationX=a,o.translationY=r,o.rotation=c})}getTargetStyle(t,{datumIndex:e,style:i}){const o=this.getHighlightStyle(t,e);return mergeDefaults12(o,{...i,opacity:1})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,o)=>{const{x:s,y:a,text:r}=o,{offsetX:n,offsetY:l,fill:c,fontStyle:h,fontWeight:d,fontSize:u,fontFamily:p,textAlign:g,textBaseline:y}=o.label;i.visible=!0,i.x=s+n,i.y=a+l,i.text=r,i.fill=c,i.fontStyle=h,i.fontWeight=d,i.fontSize=u,i.fontFamily=p,i.textAlign=g,i.textBaseline=y})}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.tickId)}updateTickNodes(t){const{gaugeRect:e,properties:i}=this,o=i.defaultScale,{enabled:s,color:a,fontFamily:r=o.label.fontFamily,fontSize:n=o.label.fontSize,fontStyle:l,fontWeight:c=o.label.fontWeight,spacing:h}=i.scale.label;let{placement:d}=i.scale.label;const u=toRadians4(i.scale.label.rotation??0);let p,g,y,f;this.horizontal?(d??(d="after"),p="center",g=d==="before"?"bottom":"top",f=this.originY+e.y+(d==="before"?-h:e.height+h)):(d??(d="before"),p=d==="before"?"end":"start",g="middle",y=this.originX+e.x+(d==="before"?-h:e.width+h)),t.tickSelection.each((x,b)=>{if(!s){x.visible=!1;return}const m=y??b.translation,S=f??b.translation;x.visible=!0,x.text=b.tickLabel,x.fill=a,x.fontFamily=r,x.fontSize=n,x.fontStyle=l,x.fontWeight=c,x.textBaseline=g,x.textAlign=p,x.x=m,x.y=S,x.rotationCenterX=m,x.rotationCenterY=S,x.rotation=u})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>"primary")}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((o,s)=>{o.fill=s.fill,o.fontStyle=s.fontStyle,o.fontWeight=s.fontWeight,o.fontFamily=s.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,horizontal:i,scale:o,seriesRect:s,gaugeRect:a}=this,{x:r,y:n,width:l,height:c}=a,h=t?.label??this.properties.value;let d;if(i){const g=o.convert(h);d=new BBox19(r,n,g-r,c)}else{const g=o.convert(h);d=new BBox19(r,g,l,c-g)}const u={seriesRect:s,gaugeRect:a,barRect:d},{margin:p}=this.properties;formatLinearGaugeLabels(this,this.ctx,e,{padding:p,horizontal:i},u,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),resetMotion3([this.datumSelection],resetLinearGaugeSeriesResetRectFunction),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i=0,o=0;if(this.labelSelection.each((s,a)=>{s.opacity=1,i=s.previousDatum?.value??t.from??a.value,o=a.value}),!this.labelsHaveExplicitText())if(i===o)this.formatLabelText({label:o});else{const s=`${this.id}_labels`;e.animate({id:s,groupId:"label",from:{label:i},to:{label:o},phase:t.phase??"update",ease:easing.easeOut,onUpdate:a=>this.formatLabelText(a),onStop:()=>this.formatLabelText({label:o})})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=prepareLinearGaugeSeriesAnimationFunctions(!0,this.horizontal);fromToMotion2(this.id,"node",t,[this.datumSelection],e,(i,o)=>o.itemId),fromToMotion2(this.id,"label",t,[this.labelSelection],fadeInFns,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e}=prepareLinearGaugeSeriesAnimationFunctions(!1,this.horizontal);fromToMotion2(this.id,"node",t,[this.datumSelection],e,(i,o)=>o.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}dataCount(){return Number.NaN}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:o}=i;if(t==null)return;let s,a,r;if(t.type===0?(s=i.value,a=i.label.text,r=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:s,text:a}=i.targets[t.index],r=this.ctx.localeManager.t("ariaLabelGaugeTarget")),s!=null)return this.formatTooltipWithContext(o,{data:[{label:a,fallbackLabel:r,value:this.formatLabel(s)}]},{seriesId:e,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(t){return pickGaugeNearestDatum(this,t)}pickFocus(t){return pickGaugeFocus(this,t)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(t){}datumIndexForCategoryValue(t){}hasItemStylers(){return this.properties.label.itemStyler!=null}};LinearGaugeSeries.className="LinearGaugeSeries",LinearGaugeSeries.type="linear-gauge";var LinearGaugeModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"linear-gauge",moduleFactory:t=>new LinearGaugeSeries(t),themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},import_ag_charts_community203._ModuleSupport.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",import_ag_charts_community203._ModuleSupport.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{...import_ag_charts_community203._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:import_ag_charts_community203._ModuleSupport.FONT_SIZE.SMALL,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}}},LinearGaugeSeriesModule={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,options:import_ag_charts_community203._ModuleSupport.linearGaugeSeriesOptionsDef,create:t=>new LinearGaugeSeries(t)},import_ag_charts_community212=require("ag-charts-community"),import_ag_charts_community204=require("ag-charts-community"),MAP_THEME_DEFAULTS={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1,...import_ag_charts_community204._ModuleSupport.LEGEND_CONTAINER_THEME}};function applyMapPalette(t){const e=import_ag_charts_community204._ModuleSupport.deepClone(t);return import_ag_charts_community204._ModuleSupport.jsonWalk(e,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),e}var import_ag_charts_community210=require("ag-charts-community"),import_ag_charts_core89=require("ag-charts-core"),import_ag_charts_community206=require("ag-charts-community"),delta2=1e-9;function lineSegmentDistanceToPointSquared(t,e,i,o){const[s,a]=t,[r,n]=e,l=r-s,c=n-a,h=l*l+c*c;let d,u;if(Math.abs(h)e){const h=(e-s)/l,d=[i+(r-i)*h,o+(n-o)*h],u=Math.atan2(n-o,r-i);return{point:d,angle:u}}s=c,i=r,o=n}}var import_ag_charts_community205=require("ag-charts-community"),{LonLatBBox}=import_ag_charts_community205._ModuleSupport;function polygonBbox(t,e){for(const i of t){const[o,s]=i;e=LonLatBBox.extend(e,o,s,o,s)}return e}function polygonCentroid(t){if(t.length===0)return;let e=0,i=0,o=0,[s,a]=t.at(-1);for(const[r,n]of t){const l=s*n-r*a;o+=l,e+=(s+r)*l,i+=(a+n)*l,s=r,a=n}return o*=3,[e/o,i/o]}function polygonDistance(t,e,i){let o=!1,s=1/0;for(const a of t){let r=a.at(-1),[n,l]=r;for(const c of a){const[h,d]=c;d>i!=l>i&&e<(n-h)*(i-d)/(l-d)+h&&(o=!o),s=Math.min(s,lineSegmentDistanceToPointSquared(r,c,e,i)),r=c,n=h,l=d}}return(o?-1:1)*Math.sqrt(s)}var{Path:Path11,ExtendedPath2D:ExtendedPath2D5,BBox:BBox20,SceneChangeDetection:SceneChangeDetection9,SceneObjectChangeDetection,objectsEqual}=import_ag_charts_community206._ModuleSupport,GeoGeometry=class extends Path11{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new ExtendedPath2D5}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:t}=this;this.strokePath.clear(),this.path.clear(),this.bbox=t==null?void 0:this.drawGeometry(t,void 0)}drawPath(t){super.drawPath(t),this.renderStroke(t,this.strokePath.getPath2D())}containsPoint(t,e){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(t,e)?!1:this.geometryDistance(i,t,e)<=0}distanceSquared(t,e){const{projectedGeometry:i}=this;if(i==null)return 1/0;const o=this.geometryDistance(i,t,e);return o>0?o*o:0}geometryDistance(t,e,i){const{renderMode:o,strokeWidth:s}=this,a=(o&1)!==0,r=(o&2)!==0,n=Math.max(s/2,1)+1;switch(t.type){case"GeometryCollection":return t.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,e,i)),1/0);case"MultiPolygon":return a?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(polygonDistance(c,e,i),0)),1/0):1/0;case"Polygon":return a?Math.max(polygonDistance(t.coordinates,e,i),0):1/0;case"MultiLineString":return r?t.coordinates.reduce((l,c)=>Math.min(l,Math.max(lineStringDistance(c,e,i)-n,0)),1/0):1/0;case"LineString":return r?Math.max(lineStringDistance(t.coordinates,e,i)-n,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(t,e){const{renderMode:i,path:o,strokePath:s}=this,a=(i&1)!==0,r=(i&2)!==0;switch(t.type){case"GeometryCollection":for(const n of t.geometries)e=this.drawGeometry(n,e);break;case"MultiPolygon":if(a)for(const n of t.coordinates)e=this.drawPolygon(o,n,e);break;case"Polygon":a&&(e=this.drawPolygon(o,t.coordinates,e));break;case"LineString":r&&(e=this.drawLineString(s,t.coordinates,e,!1));break;case"MultiLineString":if(r)for(const n of t.coordinates)e=this.drawLineString(s,n,e,!1);break;case"Point":case"MultiPoint":break}return e}drawPolygon(t,e,i){if(e.length<1)return i;i=this.drawLineString(t,e[0],i,!0);for(let o=1;o0&&(e=polygonBbox(i[0],e));break;case"Polygon":t.coordinates.length>0&&(e=polygonBbox(t.coordinates[0],e));break;case"MultiLineString":for(const i of t.coordinates)e=polygonBbox(i,e);break;case"LineString":e=polygonBbox(t.coordinates,e);break;case"MultiPoint":for(const i of t.coordinates){const[o,s]=i;e=LonLatBBox2.extend(e,o,s,o,s)}break;case"Point":{const[i,o]=t.coordinates;e=LonLatBBox2.extend(e,i,o,i,o);break}}return e}function largestPolygon(t){switch(t.type){case"GeometryCollection":{let e,i;for(const o of t.geometries){const s=largestPolygon(o);if(s==null)continue;const a=polygonBbox(s[0],void 0);if(a==null)continue;const r=Math.abs(a.lat1-a.lat0)*Math.abs(a.lon1-a.lon0);(e==null||r>e)&&(e=r,i=s)}return i}case"MultiPolygon":{let e,i;for(const o of t.coordinates){const s=polygonBbox(o[0],void 0);if(s==null)continue;const a=Math.abs(s.lat1-s.lat0)*Math.abs(s.lon1-s.lon0);(e==null||a>e)&&(e=a,i=o)}return i}case"Polygon":return t.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function largestLineString(t){switch(t.type){case"GeometryCollection":{let e,i;for(const o of t.geometries){const s=largestLineString(o);if(s==null)continue;const a=lineStringLength(s);a!=null&&(e==null||a>e)&&(e=a,i=s)}return i}case"MultiLineString":{let e=0,i;for(const o of t.coordinates){const s=lineStringLength(o);s>e&&(e=s,i=o)}return i}case"LineString":return t.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function containsType(t,e){if(t==null)return!1;switch(t.type){case"GeometryCollection":return t.geometries.some(i=>containsType(i,e));case"MultiPolygon":case"Polygon":return(e&1)!==0;case"MultiLineString":case"LineString":return(e&2)!==0;case"MultiPoint":case"Point":return(e&4)!==0}}function projectGeometry(t,e){switch(t.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:t.geometries.map(i=>projectGeometry(i,e))};case"Polygon":return{type:"Polygon",coordinates:projectPolygon(t.coordinates,e)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:projectMultiPolygon(t.coordinates,e)};case"MultiLineString":return{type:"MultiLineString",coordinates:projectPolygon(t.coordinates,e)};case"LineString":return{type:"LineString",coordinates:projectLineString(t.coordinates,e)};case"MultiPoint":return{type:"MultiPoint",coordinates:projectLineString(t.coordinates,e)};case"Point":return{type:"Point",coordinates:e.convert(t.coordinates)}}}function projectMultiPolygon(t,e){return t.map(i=>projectPolygon(i,e))}function projectPolygon(t,e){return t.map(i=>projectLineString(i,e))}function projectLineString(t,e){return t.map(i=>e.convert(i))}function prepareMapMarkerAnimationFunctions(){return{fromFn:(i,o,s)=>s==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,o,s)=>s==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function findFocusedGeoGeometry(t,e){const i=t.contextNodeData?.nodeData[e.datumIndex];if(i!==void 0){for(const o of t.datumSelection.nodes())if(o.datum===i)return o}}var import_ag_charts_community208=require("ag-charts-community"),TopologySeriesProperties=class extends import_ag_charts_community208._ModuleSupport.SeriesProperties{},TopologySeries=class extends import_ag_charts_community208._ModuleSupport.DataModelSeries{addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",t=>{this.onLegendItemClick(t)}),this.ctx.eventsHub.on("legend:item-double-click",t=>{this.onLegendItemDoubleClick(t)}))}getSeriesDomain(){return[Number.NaN,Number.NaN]}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}},import_ag_charts_community209=require("ag-charts-community"),{Property:Property70,SeriesProperties:SeriesProperties3,makeSeriesTooltip:makeSeriesTooltip12,Label:Label10}=import_ag_charts_community209._ModuleSupport,MapLineSeriesProperties=class extends SeriesProperties3{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new Label10,this.tooltip=makeSeriesTooltip12()}getStyle(){const{stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:o,lineDashOffset:s}=this;return{stroke:t,strokeOpacity:e,strokeWidth:i,lineDash:o,lineDashOffset:s}}};__decorateClass([Property70],MapLineSeriesProperties.prototype,"topology",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"title",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"legendItemName",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"idKey",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"topologyIdKey",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"idName",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"labelKey",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"labelName",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"sizeKey",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"sizeName",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"colorKey",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"colorName",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"sizeDomain",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"colorRange",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"maxStrokeWidth",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"stroke",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"lineDash",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"label",2),__decorateClass([Property70],MapLineSeriesProperties.prototype,"tooltip",2);var{getMissCount:getMissCount2,getLabelStyles:getLabelStyles2,createDatumId:createDatumId10,SeriesNodePickMode:SeriesNodePickMode9,valueProperty:valueProperty12,ColorScale:ColorScale2,LinearScale:LinearScale5,Selection:Selection8,Text:Text4,Transformable:Transformable2,mergeDefaults:mergeDefaults13}=import_ag_charts_community210._ModuleSupport,MapLineSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[SeriesNodePickMode9.EXACT_SHAPE_MATCH,SeriesNodePickMode9.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new MapLineSeriesProperties,this._chartTopology=void 0,this.colorScale=new ColorScale2,this.sizeScale=new LinearScale5,this.datumSelection=Selection8.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=Selection8.select(this.labelGroup,Text4),this.highlightDatumSelection=Selection8.select(this.highlightGroup,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new GeoGeometry;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t}async processData(t){if(this.data==null)return;const{data:e,topology:i,sizeScale:o,colorScale:s}=this,{topologyIdKey:a,idKey:r,sizeKey:n,colorKey:l,labelKey:c,sizeDomain:h,colorRange:d}=this.properties,u=new Map;for(const m of i?.features.values()??[]){const S=m.properties?.[a];S==null||!containsType(m.geometry,2)||u.set(S,m)}const p=this.sizeScale.type,g=this.colorScale.type,y=this.scale?.type,{dataModel:f,processedData:x}=await this.requestDataModel(t,e,{props:[valueProperty12(r,y,{id:"idValue",includeProperty:!1}),valueProperty12(r,y,{id:"featureValue",includeProperty:!1,processor:()=>m=>u.get(m)}),...c==null?[]:[valueProperty12(c,"category",{id:"labelValue"})],...n==null?[]:[valueProperty12(n,p,{id:"sizeValue"})],...l==null?[]:[valueProperty12(l,g,{id:"colorValue"})]]}),b=f.resolveColumnById(this,"featureValue",x);if(this.topologyBounds=b.reduce((m,S)=>{const v=S?.geometry;return v==null?m:geometryBbox(v,m)},void 0),n!=null){const m=f.resolveProcessedDataIndexById(this,"sizeValue"),S=x.domain.values[m]??[];o.domain=h??S}if(d!=null&&this.isColorScaleValid()){const m=f.resolveProcessedDataIndexById(this,"colorValue");s.domain=x.domain.values[m],s.range=d,s.update()}i==null&&import_ag_charts_core89.Logger.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=getMissCount2(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelDatum(t,e,i,o){if(e==null||i==null)return;const s=largestLineString(i);if(s==null)return;const{idKey:a,idName:r,sizeKey:n,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u,label:p}=this.properties;if(d==null||!p.enabled)return;const g=this.getLabelText(e,t,d,"label",[],p,{value:e,datum:t,idKey:a,idName:r,sizeKey:n,sizeName:l,colorKey:c,colorName:h,labelKey:d,labelName:u});if(g==null)return;const y=o.measureLines(String(g)),f=lineStringCenter(s);if(f==null)return;const[x,b]=f.point,{width:m,height:S}=y;return{point:{x,y:b,size:0},label:{width:m,height:S,text:g},anchor:void 0,placement:void 0}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:o,properties:s,scale:a}=this,{idKey:r,sizeKey:n,colorKey:l,labelKey:c,label:h,legendItemName:d}=s;if(e==null||i==null)return;const u=e.resolveColumnById(this,"idValue",i),p=e.resolveColumnById(this,"featureValue",i),g=c==null?void 0:e.resolveColumnById(this,"labelValue",i),y=n==null?void 0:e.resolveColumnById(this,"sizeValue",i),f=l==null?void 0:e.resolveColumnById(this,"colorValue",i),x=s.maxStrokeWidth??s.strokeWidth;o.range=[Math.min(s.strokeWidth,x),x];const b=(0,import_ag_charts_core89.cachedTextMeasurer)(h),m=new Map;for(const[_]of i.dataSources.get(this.id)?.data.entries()??[]){const T=u[_],w=p[_]?.geometry??void 0,R=w!=null&&a!=null?projectGeometry(w,a):void 0;T!=null&&R!=null&&m.set(T,R)}const S=[],v=[],M=[],D=i.dataSources.get(this.id)?.data??[];for(const[_,T]of D.entries()){const w=u[_],R=f?.[_],F=y?.[_],O=g?.[_],E=m.get(w);E==null&&M.push(w);const I=this.getLabelDatum(T,O,E,b);I!=null&&v.push(I),S.push({series:this,itemId:r,datum:T,datumIndex:_,idValue:w,labelValue:O,colorValue:R,sizeValue:F,projectedGeometry:E,legendItemName:d,style:this.getItemStyle({datumIndex:_,datum:T,colorValue:R,sizeValue:F},!1)})}const k=10;if(M.length>k){const _=M.length-k;M.length=k,M.push(`(+${_} more)`)}return M.length>0&&import_ag_charts_core89.Logger.warnOnce("some data items do not have matches in the provided topology",M),{itemId:t,nodeData:S,labelData:v}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,highlightDatumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let i=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:o}=this.properties,s=o!=null&&i?.datum==null&&o===i?.legendItemName;i!=null&&(i.series!==this&&!s||i.datum==null)&&(i=void 0);const a=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:i==null?[]:[i],datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!0}),this.updateDatumNodes({datumSelection:e,isHighlight:!0})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId10(e.idValue))}getItemStyle({datumIndex:t=0,datum:e,colorValue:i,sizeValue:o},s){const{properties:a,colorScale:r,sizeScale:n}=this,{colorRange:l,itemStyler:c}=a,h=this.getHighlightStyle(s,t),d=mergeDefaults13(h,a.getStyle());!s&&i!=null&&(d.stroke=this.isColorScaleValid()?r.convert(i):l?.[0]??a.stroke),o!=null&&(d.strokeWidth=n.convert(o,{clamp:!0}));let u;return c!=null&&(u=this.cachedDatumCallback(createDatumId10(t,s?"highlight":"node"),()=>{const p=this.makeItemStylerParams(e,t,s,d);return this.callWithContext(c,p)})),u?mergeDefaults13(d,u):d}makeItemStylerParams(t,e,i,o){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightStateString(a,i,e);return{seriesId:s,datum:t,highlighted:i,highlightState:r,...o}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getItemStyle(o,e)})}updateDatumNodes({datumSelection:t}){t.each((e,i)=>{const{projectedGeometry:o,style:s}=i;if(o==null){e.visible=!1,e.projectedGeometry=void 0;return}e.visible=!0,e.projectedGeometry=o,e.setProperties(s)})}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=import_ag_charts_community210._ModuleSupport.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{properties:e}=this,i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,{x:s,y:a,width:r,height:n,text:l},c)=>{const h=getLabelStyles2(this,void 0,e,e.label,!1,i),{color:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:y}=h;o.visible=!0,o.x=s+r/2,o.y=a+n/2,o.text=l,o.fill=d,o.fontStyle=u,o.fontWeight=p,o.fontSize=g,o.fontFamily=y,o.textAlign="center",o.textBaseline="middle",o.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,o.setBoxing(h)})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.datumSelection.each((s,a)=>{const r=s.distanceSquared(t,e);rnew MapLineSeries(t),themeTemplate:{...MAP_THEME_DEFAULTS,series:{stroke:applyMapPalette(import_ag_charts_community212._ModuleSupport.SAFE_STROKE_FILL_OPERATION),colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},applyMapPalette(import_ag_charts_community212._ModuleSupport.SAFE_RANGE2_OPERATION)]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{...import_ag_charts_community212._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:applyMapPalette(import_ag_charts_community212._ModuleSupport.multiSeriesHighlightStyle(!1))},tooltip:{range:"exact"}}},MapLineSeriesModule={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:mapLineSeriesOptionsDef,create:t=>new MapLineSeries(t)},import_ag_charts_community214=require("ag-charts-community"),import_ag_charts_core91=require("ag-charts-core"),import_ag_charts_community213=require("ag-charts-community"),{Property:Property71,SeriesProperties:SeriesProperties4,makeSeriesTooltip:makeSeriesTooltip13}=import_ag_charts_community213._ModuleSupport,MapLineBackgroundSeriesProperties=class extends SeriesProperties4{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=makeSeriesTooltip13()}};__decorateClass([Property71],MapLineBackgroundSeriesProperties.prototype,"topology",2),__decorateClass([Property71],MapLineBackgroundSeriesProperties.prototype,"stroke",2),__decorateClass([Property71],MapLineBackgroundSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property71],MapLineBackgroundSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property71],MapLineBackgroundSeriesProperties.prototype,"lineDash",2),__decorateClass([Property71],MapLineBackgroundSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property71],MapLineBackgroundSeriesProperties.prototype,"tooltip",2);var{createDatumId:createDatumId11,Group:Group12,Selection:Selection9,PointerEvents:PointerEvents6}=import_ag_charts_community214._ModuleSupport,MapLineBackgroundSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[]}),this.properties=new MapLineBackgroundSeriesProperties,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Group12({name:"itemGroup"})),this.datumSelection=Selection9.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=PointerEvents6.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0}nodeFactory(){const t=new GeoGeometry;return t.renderMode=2,t.lineJoin="round",t.lineCap="round",t.pointerEvents=PointerEvents6.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const o=i.geometry;return o==null?e:geometryBbox(o,e)},void 0),t==null&&import_ag_charts_core91.Logger.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i,properties:o}=this;if(e==null)return;const{stroke:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,strokeWidth:l}=o,c=[],h=[];for(const[d,u]of e.features.entries()){const{geometry:p}=u,g=p!=null&&i!=null?projectGeometry(p,i):void 0;g!=null&&c.push({series:this,itemId:d,datum:u,datumIndex:0,index:d,projectedGeometry:g,style:{stroke:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,strokeWidth:l}})}return{itemId:t,nodeData:c,labelData:h}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId11(e.index))}updateDatumNodes(t){const{datumSelection:e}=t;e.each((i,o)=>{const{projectedGeometry:s}=o;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,i.setProperties(o.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}computeFocusBounds(t){}hasItemStylers(){return!1}};MapLineBackgroundSeries.className="MapLineBackgroundSeries",MapLineBackgroundSeries.type="map-line-background";var import_ag_charts_community215=require("ag-charts-community"),import_ag_charts_core92=require("ag-charts-core"),{mapLineBackgroundSeriesThemeableOptionsDef}=import_ag_charts_community215._ModuleSupport,mapLineBackgroundSeriesOptionsDef={...mapLineBackgroundSeriesThemeableOptionsDef,type:(0,import_ag_charts_core92.required)((0,import_ag_charts_core92.constant)("map-line-background")),topology:import_ag_charts_core92.geoJson},MapLineBackgroundModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:t=>new MapLineBackgroundSeries(t),themeTemplate:{...MAP_THEME_DEFAULTS,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},MapLineBackgroundSeriesModule={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:mapLineBackgroundSeriesOptionsDef,create:t=>new MapLineBackgroundSeries(t)},import_ag_charts_community220=require("ag-charts-community"),import_ag_charts_core96=require("ag-charts-core"),import_ag_charts_community218=require("ag-charts-community"),import_ag_charts_core94=require("ag-charts-core"),__MINI_CHART_SERIES_OPTIONS=void 0,__VERIFY_MINI_CHART_SERIES_OPTIONS=void 0;__VERIFY_MINI_CHART_SERIES_OPTIONS=__MINI_CHART_SERIES_OPTIONS;var __THEME_OVERRIDES=void 0,__VERIFY_THEME_OVERRIDES=void 0;__VERIFY_THEME_OVERRIDES=__THEME_OVERRIDES;var __THEMEABLE_OPTIONS=void 0,__VERIFY_THEMEABLE_OPTIONS=void 0;__VERIFY_THEMEABLE_OPTIONS=__THEMEABLE_OPTIONS;var __AXIS_LABEL_OPTIONS=void 0,__VERIFY_AXIS_LABEL_OPTIONS=void 0;__VERIFY_AXIS_LABEL_OPTIONS=__AXIS_LABEL_OPTIONS;var import_ag_charts_core93=require("ag-charts-core");function polygonPointSearch(t,e,i){const o=polygonBbox(t[0],void 0);if(o==null)return;const s=(o.lon0+o.lon1)/2,a=(o.lat0+o.lat1)/2,r=Math.abs(o.lon1-o.lon0),n=Math.abs(o.lat1-o.lat0),l=polygonCentroid(t[0]),[c,h]=l,d=-polygonDistance(t,c,h);let u;const p=(v,M)=>{const k=Math.max(M-d,0);return v-.5*k},g=(v,M,D)=>{const{distance:k,maxDistance:_}=i(t,v,M,D),T=Math.hypot(c-v,h-M),w=Math.min(Math.max(c,v-D/2),v+D/2),R=Math.min(Math.max(h,M-D/2),M+D/2),F=Math.hypot(c-w,h-R),O=p(k,T),E=p(_,F);return{distance:k,maxDistance:_,value:O,maxValue:E,x:v,y:M,stride:D}},y=(v,M,D,k)=>{const _=g(M,D,k);_.maxDistance>=0&&v.push(_)},f=Math.min(r,n)/2;let x={value:g(s,a,f),next:null};for(;x!=null;){const v=x.value,{distance:M,value:D,maxValue:k,x:_,y:T,stride:w}=v;if(x=x.next,M>0&&(u==null||D>u.value)&&(u=v),u!=null&&k-u.value<=e)continue;const R=w/2,F=[];y(F,_-R,T-R,R),y(F,_+R,T-R,R),y(F,_-R,T+R,R),y(F,_+R,T+R,R),F.sort(labelPlacementCmp),x=(0,import_ag_charts_core93.insertListItemsSorted)(x,F,labelPlacementCmp)}if(u==null)return;const{distance:b,x:m,y:S}=u;return{x:m,y:S,distance:b}}var labelPlacementCmp=(t,e)=>e.maxValue-t.maxValue;function polygonMarkerCenter(t,e){const i=polygonPointSearch(t,e,(a,r,n,l)=>{const c=-polygonDistance(a,r,n),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:o,y:s}=i;return[o,s]}function markerPositions(t,e){let i;switch(t.type){case"GeometryCollection":return t.geometries.flatMap(o=>markerPositions(o,e));case"MultiPoint":return t.coordinates;case"Point":return[t.coordinates];case"MultiPolygon":{const o=largestPolygon(t);i=o==null?void 0:polygonMarkerCenter(o,e);break}case"Polygon":{const o=t.coordinates;i=o==null?void 0:polygonMarkerCenter(o,e);break}case"MultiLineString":{const o=largestLineString(t);i=o==null?void 0:lineStringCenter(o)?.point;break}case"LineString":{const o=t.coordinates;i=lineStringCenter(o)?.point;break}}return i==null?[]:[i]}var import_ag_charts_community216=require("ag-charts-community"),{BBox:BBox21}=import_ag_charts_community216._ModuleSupport;function getTopologyShapeFillBBox(t){if(!t)return;const{range:e}=t,i=e[0][0],o=e[0][1],s=e[1][0]-i,a=e[1][1]-o,r=new BBox21(i,o,s,a);return{series:r,axis:r}}var import_ag_charts_community217=require("ag-charts-community"),{Property:Property72,SeriesProperties:SeriesProperties5,makeSeriesTooltip:makeSeriesTooltip14,Label:Label11}=import_ag_charts_community217._ModuleSupport,MapMarkerSeriesLabel=class extends Label11{constructor(){super(...arguments),this.placement="bottom"}};__decorateClass([Property72],MapMarkerSeriesLabel.prototype,"placement",2);var MapMarkerSeriesProperties=class extends SeriesProperties5{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new MapMarkerSeriesLabel,this.tooltip=makeSeriesTooltip14()}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:o,stroke:s,strokeWidth:a,strokeOpacity:r,lineDash:n,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:o,opacity:1,stroke:s,strokeWidth:a,strokeOpacity:r,lineDash:n,lineDashOffset:l}}};__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"topology",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"title",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"legendItemName",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"idKey",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"topologyIdKey",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"idName",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"latitudeKey",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"latitudeName",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"longitudeKey",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"longitudeName",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"labelKey",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"labelName",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"sizeKey",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"sizeName",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"colorKey",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"colorName",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"colorRange",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"shape",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"size",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"maxSize",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"sizeDomain",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"fill",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"fillOpacity",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"stroke",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"lineDash",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"label",2),__decorateClass([Property72],MapMarkerSeriesProperties.prototype,"tooltip",2);var{fromToMotion:fromToMotion3,StateMachine:StateMachine13,getMissCount:getMissCount3,createDatumId:createDatumId12,SeriesNodePickMode:SeriesNodePickMode10,valueProperty:valueProperty13,computeMarkerFocusBounds:computeMarkerFocusBounds2,ColorScale:ColorScale3,LinearScale:LinearScale6,Group:Group13,Selection:Selection10,Text:Text5,Marker:Marker4,applyShapeStyle:applyShapeStyle11,getLabelStyles:getLabelStyles3,LonLatBBox:LonLatBBox3,mergeDefaults:mergeDefaults14}=import_ag_charts_community218._ModuleSupport,MapMarkerSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[SeriesNodePickMode10.EXACT_SHAPE_MATCH,SeriesNodePickMode10.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new MapMarkerSeriesProperties,this._chartTopology=void 0,this.colorScale=new ColorScale3,this.sizeScale=new LinearScale6,this.markerGroup=this.contentGroup.appendChild(new Group13({name:"markerGroup"})),this.labelSelection=Selection10.select(this.labelGroup,Text5,!1),this.markerSelection=Selection10.select(this.markerGroup,Marker4,!1),this.highlightMarkerSelection=Selection10.select(this.highlightGroup,Marker4),this.animationState=new StateMachine13("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const t=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||t)}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[3,t],this.highlightGroup.zIndex=[4,t],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(t){if(this.data==null)return;const{data:e,topology:i,sizeScale:o,colorScale:s}=this,{topologyIdKey:a,idKey:r,latitudeKey:n,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,sizeDomain:u,colorRange:p}=this.properties,g=new Map;for(const k of i?.features.values()??[]){const _=k.properties?.[a];_!=null&&g.set(_,k)}const y=this.sizeScale.type,f=this.colorScale.type,x=this.scale?.type,b=n!=null&&l!=null,{dataModel:m,processedData:S}=await this.requestDataModel(t,e,{props:[...r==null?[]:[valueProperty13(r,x,{id:"idValue",includeProperty:!1}),valueProperty13(r,x,{id:"featureValue",includeProperty:!1,processor:()=>k=>g.get(k)})],...b?[valueProperty13(n,x,{id:"latValue"}),valueProperty13(l,x,{id:"lonValue"})]:[],...d?[valueProperty13(d,"category",{id:"labelValue"})]:[],...c?[valueProperty13(c,y,{id:"sizeValue"})]:[],...h?[valueProperty13(h,f,{id:"colorValue"})]:[]]}),v=r==null?void 0:m.resolveColumnById(this,"featureValue",S),M=b?m.resolveColumnById(this,"latValue",S):void 0,D=b?m.resolveColumnById(this,"lonValue",S):void 0;if(this.topologyBounds=S.dataSources.get(this.id)?.data.reduce((k,_,T)=>{const R=v?.[T]?.geometry;if(R!=null&&(k=geometryBbox(R,k)),M!=null&&D!=null){const F=D[T],O=M[T];k=LonLatBBox3.extend(k,F,O,F,O)}return k},void 0),c!=null){const k=m.resolveProcessedDataIndexById(this,"sizeValue"),_=S.domain.values[k]??[];o.domain=u??_}if(p!=null&&this.isColorScaleValid()){const k=m.resolveProcessedDataIndexById(this,"colorValue");s.domain=S.domain.values[k],s.range=p,s.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=getMissCount3(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelDatum(t,e,i,o,s,a){if(e==null)return;const{idKey:r,idName:n,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:y,labelKey:f,labelName:x,label:b,shape:m}=this.properties;if(f==null||!b.enabled)return;const{placement:S}=b,v=this.getLabelText(e,t,f,"label",[],b,{value:e,datum:t,idKey:r,idName:n,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,sizeKey:u,sizeName:p,colorKey:g,colorName:y,labelKey:f,labelName:x});if(v==null)return;const{width:M,height:D}=a.measureLines(String(v)),k=Marker4.anchor(m);return{point:{x:i,y:o,size:s},label:{width:M,height:D,text:v},anchor:k,placement:S}}createNodeData(){const{id:t,dataModel:e,processedData:i,sizeScale:o,properties:s,scale:a}=this,{idKey:r,latitudeKey:n,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:d,label:u,legendItemName:p}=s;if(e==null||i==null||a==null)return;const g=n!=null&&l!=null,y=r==null?void 0:e.resolveColumnById(this,"idValue",i),f=r==null?void 0:e.resolveColumnById(this,"featureValue",i),x=g?e.resolveColumnById(this,"latValue",i):void 0,b=g?e.resolveColumnById(this,"lonValue",i):void 0,m=d==null?void 0:e.resolveColumnById(this,"labelValue",i),S=c==null?void 0:e.resolveColumnById(this,"sizeValue",i),v=h==null?void 0:e.resolveColumnById(this,"colorValue",i),M=s.maxSize??s.size;o.range=[Math.min(s.size,M),M];const D=(0,import_ag_charts_core94.cachedTextMeasurer)(u);let k;if(y!=null&&f!=null){k=new Map;for(const[O]of i.dataSources.get(this.id)?.data.entries()??[]){const E=y[O],I=f[O]?.geometry??void 0,C=I!=null&&a!=null?projectGeometry(I,a):void 0;E!=null&&C!=null&&k.set(E,C)}}const _=[],T=[],w=[],R=i.dataSources.get(this.id)?.data??[];for(const[O,E]of R.entries()){const I=y?.[O],C=b?.[O],L=x?.[O],A=v?.[O],P=S?.[O],z=m?.[O],B=P==null?s.size:o.convert(P,{clamp:!0}),V=I==null?void 0:k?.get(I);if(I!=null&&projectGeometry==null&&w.push(I),C!=null&&L!=null){const[W,H]=a.convert([C,L]),G=this.getLabelDatum(E,z,W,H,B,D);G&&T.push(G),_.push({series:this,itemId:n,datum:E,datumIndex:O,index:-1,idValue:I,lonValue:C,latValue:L,labelValue:z,sizeValue:P,colorValue:A,point:{x:W,y:H,size:B},midPoint:{x:W,y:H},legendItemName:p,style:this.getMarkerItemStyle({datumIndex:O,datum:E,colorValue:A,sizeValue:P},!1)})}else if(V!=null)for(const[W,[H,G]]of markerPositions(V,1).entries()){const K=this.getLabelDatum(E,z,H,G,B,D);K&&T.push(K),_.push({series:this,itemId:n,datum:E,datumIndex:O,index:W,idValue:I,lonValue:C,latValue:L,labelValue:z,sizeValue:P,colorValue:A,point:{x:H,y:G,size:B},midPoint:{x:H,y:G},legendItemName:p,style:this.getMarkerItemStyle({datumIndex:O,datum:E,colorValue:A,sizeValue:P},!1)})}}const F=10;if(w.length>F){const O=w.length-F;w.length=F,w.push(`(+${O} more)`)}return w.length>0&&import_ag_charts_core94.Logger.warnOnce("some data items do not have matches in the provided topology",w),{itemId:t,nodeData:_,labelData:T}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:t}){const e=this.checkResize(t),i=this.checkScaleChange(),{markerSelection:o,highlightMarkerSelection:s}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let a=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:r}=this.properties,n=r!=null&&a?.datum==null&&r===a?.legendItemName;a!=null&&(a.series!==this&&!n||a.datum==null)&&(a=void 0);const l=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:l,markerSelection:o}),this.updateMarkerNodes({markerSelection:o,isHighlight:!1,highlightedDatum:a}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:a==null?[]:[a],markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!0,highlightedDatum:a}),(i||e)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(t){this.labelSelection=this.labelSelection.update(t,e=>{e.pointerEvents=import_ag_charts_community218._ModuleSupport.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{properties:e}=this,i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,{x:s,y:a,width:r,height:n,text:l},c)=>{const h=getLabelStyles3(this,void 0,e,e.label,!1,i),{color:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:y}=h;o.visible=!0,o.x=s+r/2,o.y=a+n/2,o.text=l,o.fill=d,o.fontStyle=u,o.fontWeight=p,o.fontSize=g,o.fontFamily=y,o.textAlign="center",o.textBaseline="middle",o.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,o.setBoxing(h)})}updateMarkerSelection(t){const{markerData:e,markerSelection:i}=t;return i.update(e,void 0,o=>createDatumId12(o.index,o.idValue,o.lonValue,o.latValue))}getMarkerItemStyle({datumIndex:t,datum:e,colorValue:i,sizeValue:o},s){const{properties:a,colorScale:r,sizeScale:n}=this,{colorRange:l,itemStyler:c}=a,h=this.getHighlightStyle(s,t),d=mergeDefaults14(h,a.getStyle());!s&&i!=null&&(d.fill=this.isColorScaleValid()?r.convert(i):l?.[0]??d.fill),o!=null&&(d.size=n.convert(o,{clamp:!0}));let u=d;if(c!=null&&t!=null){const p=this.cachedDatumCallback(createDatumId12(t,s?"highlight":"node"),()=>{const g=this.makeItemStylerParams(e,t,s,u);return this.callWithContext(c,g)});p&&(u=mergeDefaults14(p,d))}return u}makeItemStylerParams(t,e,i,o){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightStateString(a,i,e),n=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:t,highlighted:i,highlightState:r,...o,fill:n}}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i,highlightedDatum:o}=t,s=getTopologyShapeFillBBox(this.scale);e.each((a,r)=>{const{datum:n,point:l}=r,c=this.getMarkerItemStyle(r,i);a.shape=c.shape,a.size=c.size,applyShapeStyle11(a,c,s),a.x=l.x,a.y=l.y,a.scalingCenterX=l.x,a.scalingCenterY=l.y,a.zIndex=!i&&o!=null&&n===o.datum?1:0})}isProcessedDataAnimatable(){return!0}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:t}=this.ctx,e=prepareMapMarkerAnimationFunctions();fromToMotion3(this.id,"markers",t,[this.markerSelection,this.highlightMarkerSelection],e)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(t){const{x:e,y:i}=t;let o=1/0,s;for(const a of this.contextNodeData?.nodeData??[]){const{x:r,y:n,size:l}=a.point,c=Math.max(Math.abs(r-e)-l,0),h=Math.max(Math.abs(n-i)-l,0),d=c*c+h*h;d=0?"N":"S"}, ${Math.abs(R).toFixed(4)}\xB0 ${R>=0?"W":"E"}`}const T=this.getMarkerItemStyle({datumIndex:t,datum:v,colorValue:D,sizeValue:M},!1);return this.formatTooltipWithContext(S,{heading:_,title:b??m,symbol:this.legendItemSymbol(t),data:k},{seriesId:e,datum:v,title:b,idKey:r,idName:n,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:d,colorKey:u,colorName:p,sizeKey:g,sizeName:y,labelKey:f,labelName:x,...T})}getFormattedMarkerStyle(t){const e=this.getMarkerItemStyle(t,!1);return{size:e.size,shape:e.shape}}computeFocusBounds(t){return computeMarkerFocusBounds2(this,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};MapMarkerSeries.className="MapMarkerSeries",MapMarkerSeries.type="map-marker";var import_ag_charts_community219=require("ag-charts-community"),import_ag_charts_core95=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs12,mapMarkerSeriesThemeableOptionsDef,without:without6}=import_ag_charts_community219._ModuleSupport,mapMarkerSeriesOptionsDef={...without6(commonSeriesOptionsDefs12,["highlightStyle","highlight"]),...mapMarkerSeriesThemeableOptionsDef,type:(0,import_ag_charts_core95.required)((0,import_ag_charts_core95.constant)("map-marker")),idKey:import_ag_charts_core95.string,latitudeKey:import_ag_charts_core95.string,longitudeKey:import_ag_charts_core95.string,sizeKey:import_ag_charts_core95.string,colorKey:import_ag_charts_core95.string,labelKey:import_ag_charts_core95.string,idName:import_ag_charts_core95.string,latitudeName:import_ag_charts_core95.string,longitudeName:import_ag_charts_core95.string,sizeName:import_ag_charts_core95.string,colorName:import_ag_charts_core95.string,labelName:import_ag_charts_core95.string,topology:import_ag_charts_core95.geoJson,topologyIdKey:import_ag_charts_core95.string,legendItemName:import_ag_charts_core95.string,title:import_ag_charts_core95.string},MapMarkerModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:t=>new MapMarkerSeries(t),themeTemplate:{...MAP_THEME_DEFAULTS,series:{shape:"circle",maxSize:30,fill:applyMapPalette({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",import_ag_charts_community220._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",import_ag_charts_community220._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community220._ModuleSupport.FILL_PATTERN_DEFAULTS]]}),stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},applyMapPalette(import_ag_charts_community220._ModuleSupport.SAFE_RANGE2_OPERATION)]},fillOpacity:.5,label:{...import_ag_charts_community220._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:applyMapPalette(import_ag_charts_community220._ModuleSupport.multiSeriesHighlightStyle())},tooltip:{range:"exact"}}},MapMarkerSeriesModule={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:mapMarkerSeriesOptionsDef,create:t=>new MapMarkerSeries(t),validate(t,e,i){const o=(0,import_ag_charts_core96.validate)(t,e,i),{cleared:s,invalid:a}=o;if(s?.idKey==null&&(s?.latitudeKey==null||s?.longitudeKey==null)){const r=l=>i?`${i}.${l}`:l,n=`Either \`${r("idKey")}\` or both \`${r("latitudeKey")}\` and \`${r("longitudeKey")}\` are required.`;a.push(new import_ag_charts_core96.ValidationError("required",n,null,i))}return o}},import_ag_charts_community224=require("ag-charts-community"),import_ag_charts_community222=require("ag-charts-community"),import_ag_charts_core97=require("ag-charts-core");function preferredLabelCenter(t,{aspectRatio:e,precision:i}){const o=polygonPointSearch(t,i,(l,c,h,d)=>{const u=maxWidthOfRectConstrainedByCenterAndAspectRatioToPolygon(l,c,h,e),p=u+2*d*e,g=u*Math.SQRT2,y=p*Math.SQRT2;return{distance:g,maxDistance:y}});if(o==null)return;const{x:s,y:a,distance:r}=o,n=r/Math.SQRT2;return{x:s,y:a,maxWidth:n}}function maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(t,e,i,o,s){const[a,r]=t,[n,l]=e,c=1/s,h=n-a,d=l-r,[u,p]=r<=l?t:e,[g,y]=a<=n?t:e,[f,x]=r<=l?e:t,[b,m]=a<=n?e:t;let S=1/0;if(h===0)for(let T=0;T<=1;T+=1){const R=(T===0?c:-c)*(a-i)+o;if(R>=p&&R<=x){const O=Math.abs(o-R)*2*s;S=Math.min(S,O)}}else{const T=d/h;for(let w=0;w<=1;w+=1){const R=w===0?c:-c,F=(T*a-r-R*i+o)/(T-R);if(F>=g&&F<=b){const O=Math.abs(i-F)*2;S=Math.min(S,O)}}}const v=s,M=Math.abs((u-i)/(p-o)),D=Math.abs((f-i)/(x-o));if(xo&&Mi&&ki!=c>i&&e<(l-d)*(i-u)/(c-u)+d&&(s=!s);const p=maxWidthOfRectConstrainedByCenterAndAspectRatioToLineSegment(n,h,e,i,o);a=Math.min(a,p),n=h,l=d,c=u}}return(s?1:-1)*a}function applyX(t,e,i){i>=e&&(t.maxX=Math.min(t.maxX,i-e)),i<=e&&(t.minX=Math.max(t.minX,i-e))}function xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(t,e,i,o,s,a){const r=s-a/2,n=s+a/2,[l,c]=e,[h,d]=i,u=h-l,p=d-c,[g,y]=l<=h?e:i,[f,x]=l<=h?i:e;if(u!==0){const b=p/u;for(let m=0;m<=1;m+=1){const v=((m===0?r:n)-c)/b+l;v>=g&&v<=f&&applyX(t,o,v)}}else Math.max(r,Math.min(c,d))<=Math.min(n,Math.max(c,d))&&applyX(t,o,l);return f=r&&x<=n?applyX(t,o,f):g>o&&y>=r&&y<=n&&applyX(t,o,g),t}function maxWidthInPolygonForRectOfHeight(t,e,i,o){const s={minX:-1/0,maxX:1/0};for(const n of t){let l=n.at(-1);for(const c of n)xExtentsOfRectConstrainedByCenterAndHeightToLineSegment(s,l,c,e,i,o),l=c}const{minX:a,maxX:r}=s;return Number.isFinite(a)&&Number.isFinite(r)?{x:e+(a+r)/2,width:r-a}:{x:e,width:0}}var import_ag_charts_community221=require("ag-charts-community"),{Property:Property73,SeriesProperties:SeriesProperties6,makeSeriesTooltip:makeSeriesTooltip15}=import_ag_charts_community221._ModuleSupport,MapShapeSeriesProperties=class extends SeriesProperties6{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.idName=void 0,this.topologyIdKey="name",this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.padding=0,this.label=new AutoSizedSecondaryLabel,this.tooltip=makeSeriesTooltip15()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,opacity:1}}};__decorateClass([Property73],MapShapeSeriesProperties.prototype,"topology",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"title",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"legendItemName",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"idKey",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"idName",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"topologyIdKey",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"labelKey",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"labelName",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"colorKey",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"colorName",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"colorRange",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"fill",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"fillOpacity",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"stroke",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"lineDash",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"padding",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"label",2),__decorateClass([Property73],MapShapeSeriesProperties.prototype,"tooltip",2);var{getMissCount:getMissCount4,createDatumId:createDatumId13,SeriesNodePickMode:SeriesNodePickMode11,valueProperty:valueProperty14,ColorScale:ColorScale4,Group:Group14,Selection:Selection11,Text:Text6,PointerEvents:PointerEvents7,applyShapeStyle:applyShapeStyle12,getLabelStyles:getLabelStyles4,mergeDefaults:mergeDefaults15}=import_ag_charts_community222._ModuleSupport,fixedScale=import_ag_charts_community222._ModuleSupport.MercatorScale.fixedScale(),MapShapeSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[SeriesNodePickMode11.EXACT_SHAPE_MATCH,SeriesNodePickMode11.NEAREST_NODE]}),this.properties=new MapShapeSeriesProperties,this._chartTopology=void 0,this.colorScale=new ColorScale4,this.itemGroup=this.contentGroup.appendChild(new Group14({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group14({name:"itemLabelGroup"})),this.datumSelection=Selection11.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Selection11.select(this.itemLabelGroup,Text6),this.highlightDatumSelection=Selection11.select(this.highlightGroup,()=>this.nodeFactory()),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=PointerEvents7.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[1,t],this.highlightGroup.zIndex=[2,t],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const t=new GeoGeometry;return t.renderMode=1,t.lineJoin="round",t}async processData(t){if(this.data==null)return;const{data:e,topology:i,colorScale:o}=this,{topologyIdKey:s,idKey:a,colorKey:r,labelKey:n,colorRange:l}=this.properties,c=new Map;for(const y of i?.features.values()??[]){const f=y.properties?.[s];f==null||!containsType(y.geometry,1)||c.set(f,y)}const h=this.colorScale.type,d=this.scale?.type,{dataModel:u,processedData:p}=await this.requestDataModel(t,e,{props:[valueProperty14(a,d,{id:"idValue",includeProperty:!1}),valueProperty14(a,d,{id:"featureValue",includeProperty:!1,processor:()=>y=>c.get(y)}),...n?[valueProperty14(n,"category",{id:"labelValue"})]:[],...r?[valueProperty14(r,h,{id:"colorValue"})]:[]]}),g=u.resolveColumnById(this,"featureValue",p);if(this.topologyBounds=g.reduce((y,f)=>{const x=f?.geometry;return x==null?y:geometryBbox(x,y)},void 0),l!=null&&this.isColorScaleValid()){const y=u.resolveProcessedDataIndexById(this,"colorValue");o.domain=p.domain.values[y],o.range=l,o.update()}i==null&&import_ag_charts_core97.Logger.warnOnce("no topology was provided for [MapShapeSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:t}=this.properties;if(!t)return!1;const{dataModel:e,processedData:i}=this;if(!e||!i)return!1;const o=e.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=getMissCount4(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelLayout(t,e,i,o,s){if(e==null||o==null)return;const{idKey:a,idName:r,colorKey:n,colorName:l,labelKey:c,labelName:h,padding:d,label:u}=this.properties;if(c==null||!u.enabled)return;const p=this.getLabelText(e,t,c,"label",[],u,{value:e,datum:t,idKey:a,idName:r,colorKey:n,colorName:l,labelKey:c,labelName:h});if(p==null)return;const g=(0,import_ag_charts_core97.isArray)(p)?(0,import_ag_charts_core97.measureTextSegments)(p,u):i.measureLines(String(p)),y=(g.width+2*d)/(g.height+2*d);if(s?.geometry===o&&s?.labelText===p&&s?.aspectRatio===y)return s;const f=projectGeometry(o,fixedScale),x=largestPolygon(f);if(x==null)return;const b=preferredLabelCenter(x,{aspectRatio:y,precision:.001});if(b==null)return;const{x:m,y:S,maxWidth:v}=b;return{geometry:o,labelText:p,aspectRatio:y,x:m,y:S,maxWidth:v,fixedPolygon:x}}getLabelDatum(t,e){const{scale:i}=this;if(i==null)return;const{padding:o,label:s}=this.properties,{labelText:a,aspectRatio:r,x:n,y:l,maxWidth:c,fixedPolygon:h}=t,d={width:Math.ceil(c*e),height:Math.ceil(c*e/r),meta:n},u=formatSingleLabel((0,import_ag_charts_core97.toPlainText)(a),s,{padding:o},(S,v)=>{if(!v)return d;const M=maxWidthInPolygonForRectOfHeight(h,n,l,S/e);return{width:M.width*e,height:S,meta:M.x}});if(u==null)return;const[{text:p,fontSize:g,lineHeight:y,width:f},x]=u,b=fM){const D=S.length-M;S.length=M,S.push(`(+${D} more)`)}return S.length>0&&import_ag_charts_core97.Logger.warnOnce("some data items do not have matches in the provided topology",S),{itemId:t,nodeData:b,labelData:m}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t,labelSelection:e,highlightDatumSelection:i}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let o=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:s}=this.properties,a=s!=null&&o?.datum==null&&s===o?.legendItemName;o!=null&&(o.series!==this&&!a||o.datum==null)&&(o=void 0);const r=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:e}),this.updateLabelNodes({labelSelection:e}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o==null?[]:[o],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId13(e.idValue))}getItemStyle({datumIndex:t,datum:e,colorValue:i},o){const{properties:s,colorScale:a}=this,{colorRange:r,itemStyler:n}=s,l=this.getHighlightStyle(o,t),c=mergeDefaults15(l,s.getStyle());!o&&i!=null&&(c.fill=this.isColorScaleValid()?a.convert(i):r?.[0]??c.fill);let h=c;if(n!=null&&t!=null){const d=this.cachedDatumCallback(createDatumId13(t,o?"highlight":"node"),()=>{const u=this.makeItemStylerParams(e,t,o,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(n,u))});d&&(h=mergeDefaults15(d,h))}return h}makeItemStylerParams(t,e,i,o){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightStateString(a,i,e),n=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:t,highlighted:i,highlightState:r,...o,fill:n}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getItemStyle(o,e)})}updateDatumNodes({datumSelection:t}){const e=getTopologyShapeFillBBox(this.scale);t.each((i,o)=>{const{projectedGeometry:s}=o;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,applyShapeStyle12(i,o.style,e)})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const{properties:e}=this,i=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((o,{x:s,y:a,text:r,fontSize:n,lineHeight:l},c)=>{const h=getLabelStyles4(this,void 0,e,e.label,!1,i),{color:d,fontStyle:u,fontWeight:p,fontFamily:g}=h;o.visible=!0,o.x=s,o.y=a,o.text=r,o.fill=d,o.fontStyle=u,o.fontWeight=p,o.fontSize=n,o.lineHeight=l,o.fontFamily=g,o.textAlign="center",o.textBaseline="middle",o.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,o.setBoxing(h)})}resetAnimation(){}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.datumSelection.each((s,a)=>{const r=s.distanceSquared(t,e);rnew MapShapeSeries(t),themeTemplate:{...MAP_THEME_DEFAULTS,series:{fill:applyMapPalette({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",import_ag_charts_community224._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],["image",import_ag_charts_community224._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community224._ModuleSupport.FILL_PATTERN_DEFAULTS]]}),stroke:{$ref:"chartBackgroundColor"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},applyMapPalette(import_ag_charts_community224._ModuleSupport.SAFE_RANGE2_OPERATION)]},fillOpacity:1,strokeWidth:1,lineDash:[0],lineDashOffset:0,padding:2,label:{...import_ag_charts_community224._ModuleSupport.LABEL_BOXING_DEFAULTS,color:{$ref:"chartBackgroundColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:"bold",overflowStrategy:"hide"},highlight:applyMapPalette(import_ag_charts_community224._ModuleSupport.multiSeriesHighlightStyle(!0))},tooltip:{range:"exact"}}},MapShapeSeriesModule={type:"series",name:"map-shape",chartType:"topology",enterprise:!0,options:mapShapeSeriesOptionsDef,create:t=>new MapShapeSeries(t)},import_ag_charts_community228=require("ag-charts-community"),import_ag_charts_community226=require("ag-charts-community"),import_ag_charts_core99=require("ag-charts-core"),import_ag_charts_community225=require("ag-charts-community"),{Property:Property74,SeriesProperties:SeriesProperties7,makeSeriesTooltip:makeSeriesTooltip16}=import_ag_charts_community225._ModuleSupport,MapShapeBackgroundSeriesProperties=class extends SeriesProperties7{constructor(){super(...arguments),this.topology=void 0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=makeSeriesTooltip16()}};__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"topology",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"fill",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"fillOpacity",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"stroke",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"lineDash",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property74],MapShapeBackgroundSeriesProperties.prototype,"tooltip",2);var{createDatumId:createDatumId14,Selection:Selection12,Group:Group15,PointerEvents:PointerEvents8}=import_ag_charts_community226._ModuleSupport,MapShapeBackgroundSeries=class extends TopologySeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[]}),this.properties=new MapShapeBackgroundSeriesProperties,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Group15({name:"itemGroup"})),this.datumSelection=Selection12.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=PointerEvents8.None}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}getNodeData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(t){this._chartTopology=t,this.topology===t&&(this.nodeDataRefresh=!0)}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[0,t,0],this.highlightGroup.zIndex=[0,t,1],!0}nodeFactory(){const t=new GeoGeometry;return t.renderMode=1,t.lineJoin="round",t.pointerEvents=PointerEvents8.None,t}processData(){const{topology:t}=this;this.topologyBounds=t?.features.reduce((e,i)=>{const o=i.geometry;return o==null?e:geometryBbox(o,e)},void 0),t==null&&import_ag_charts_core99.Logger.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:t,topology:e,scale:i,properties:o}=this;if(e==null)return;const{fill:s,fillOpacity:a,stroke:r,strokeWidth:n,strokeOpacity:l,lineDash:c,lineDashOffset:h}=o,d=[],u=[];for(const[p,g]of e.features.entries()){const{geometry:y}=g,f=y!=null&&i!=null?projectGeometry(y,i):void 0;f!=null&&d.push({series:this,itemId:p,datum:g,datumIndex:0,index:p,projectedGeometry:f,style:{fill:s,fillOpacity:a,stroke:r,strokeWidth:n,strokeOpacity:l,lineDash:c,lineDashOffset:h}})}return{itemId:t,nodeData:d,labelData:u}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:e=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:e,datumSelection:t}),this.updateDatumNodes({datumSelection:t})}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId14(e.index))}updateDatumNodes(t){const{datumSelection:e}=t;e.each((i,o)=>{const{projectedGeometry:s}=o;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,i.setProperties(o.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(t){}pickFocus(){}computeFocusBounds(t){}hasItemStylers(){return!1}};MapShapeBackgroundSeries.className="MapShapeBackgroundSeries",MapShapeBackgroundSeries.type="map-shape-background";var import_ag_charts_community227=require("ag-charts-community"),import_ag_charts_core100=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs14,mapShapeBackgroundSeriesThemeableOptionsDef}=import_ag_charts_community227._ModuleSupport,mapShapeBackgroundSeriesOptionsDef={...mapShapeBackgroundSeriesThemeableOptionsDef,...commonSeriesOptionsDefs14,type:(0,import_ag_charts_core100.required)((0,import_ag_charts_core100.constant)("map-shape-background")),topology:import_ag_charts_core100.geoJson},MapShapeBackgroundModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-shape-background",moduleFactory:t=>new MapShapeBackgroundSeries(t),themeTemplate:{...MAP_THEME_DEFAULTS,series:{fill:applyMapPalette({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",import_ag_charts_community228._ModuleSupport.FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS],["image",import_ag_charts_community228._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community228._ModuleSupport.FILL_PATTERN_HIERARCHY_DEFAULTS]]}),stroke:{$ref:"chartBackgroundColor"},strokeWidth:1}}},MapShapeBackgroundSeriesModule={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,options:mapShapeBackgroundSeriesOptionsDef,create:t=>new MapShapeBackgroundSeries(t)},import_ag_charts_community237=require("ag-charts-community"),import_ag_charts_community234=require("ag-charts-community"),import_ag_charts_community230=require("ag-charts-community"),import_ag_charts_core101=require("ag-charts-core"),import_ag_charts_community229=require("ag-charts-community"),{createDatumId:createDatumId15,mergeDefaults:mergeDefaults16,toHighlightString:toHighlightString4}=import_ag_charts_community229._ModuleSupport;function makeStylerParams(t,e,i){const{id:o}=t,{angleKey:s,cornerRadius:a,fill:r,fillOpacity:n,lineDash:l,lineDashOffset:c,radiusKey:h,stackGroup:d,stroke:u,strokeOpacity:p,strokeWidth:g}=t.properties,y=toHighlightString4(i??import_ag_charts_community229._ModuleSupport.HighlightState.None);return{angleKey:s,cornerRadius:a,fill:r,fillOpacity:n,highlightState:y,highlighted:e,lineDash:l,lineDashOffset:c,radiusKey:h,seriesId:o,stackGroup:d,stroke:u,strokeOpacity:p,strokeWidth:g}}function getStyle(t,e,i,o){const{styler:s}=t.properties;let a={};if(!e&&s){const r=makeStylerParams(t,i,o);a=t.ctx.optionsGraphService.resolvePartial(["series",`${t.declarationOrder}`],t.cachedCallWithContext(s,r)??{},{pick:!1})??{}}return{cornerRadius:a.cornerRadius??t.properties.cornerRadius,fill:a.fill??t.properties.fill,fillOpacity:a.fillOpacity??t.properties.fillOpacity,lineDash:a.lineDash??t.properties.lineDash,lineDashOffset:a.lineDashOffset??t.properties.lineDashOffset,stroke:a.stroke??t.properties.stroke,strokeOpacity:a.strokeOpacity??t.properties.strokeOpacity,strokeWidth:a.strokeWidth??t.properties.strokeWidth,opacity:1}}function makeItemStylerParams(t,e,i,o){const{id:s,properties:a}=t,{angleKey:r,radiusKey:n}=a,l=t.ctx.highlightManager?.getActiveHighlight(),c=t.getHighlightStateString(l,i,e.datumIndex),h=t.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:e.datum,highlighted:i,highlightState:c,angleKey:r,radiusKey:n,...o,fill:h}}function getItemStyle(t,e,i,o){const{properties:s}=t,{itemStyler:a}=s,r=t.getHighlightStyle(i,e?.datumIndex,o);let l=mergeDefaults16(r,getStyle(t,e===void 0,i,o));if(a!=null&&e!=null){const c=t.cachedDatumCallback(createDatumId15(t.getDatumId(e),i?"highlight":"node"),()=>{const h=makeItemStylerParams(t,e,i,l);return t.callWithContext(a,h)});c&&(l=mergeDefaults16(c,l))}return l}var{DEFAULT_POLAR_DIRECTION_KEYS,DEFAULT_POLAR_DIRECTION_NAMES,ChartAxisDirection:ChartAxisDirection28,PolarAxis,diff:diff6,fixNumericExtent:fixNumericExtent8,groupAccumulativeValueProperty:groupAccumulativeValueProperty2,keyProperty:keyProperty9,normaliseGroupTo,resetLabelFn:resetLabelFn5,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation5,seriesLabelFadeOutAnimation,valueProperty:valueProperty15,animationValidation:animationValidation7,createDatumId:createDatumId16,SeriesNodePickMode:SeriesNodePickMode12,normalizeAngle360:normalizeAngle3605,CategoryScale:CategoryScale3,motion:motion6,applyShapeStyle:applyShapeStyle13,isGradientFill:isGradientFill2,updateLabelNode:updateLabelNode6,getItemStyles:getItemStyles3}=import_ag_charts_community230._ModuleSupport,RadialColumnSeriesNodeEvent=class extends import_ag_charts_community230._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},RadialColumnSeriesBase=class extends import_ag_charts_community230._ModuleSupport.PolarSeries{constructor(t,{animationResetFns:e}){super({moduleCtx:t,categoryKey:"angleValue",propertyKeys:DEFAULT_POLAR_DIRECTION_KEYS,propertyNames:DEFAULT_POLAR_DIRECTION_NAMES,canHaveAxes:!0,pickModes:[SeriesNodePickMode12.NEAREST_NODE,SeriesNodePickMode12.EXACT_SHAPE_MATCH],animationResetFns:{...e,label:resetLabelFn5}}),this.NodeEvent=RadialColumnSeriesNodeEvent,this.groupScale=new CategoryScale3,this.circleCache={r:0,cx:0,cy:0}}get hasData(){return this.getHasData("radiusValue-raw")}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===ChartAxisDirection28.Angle)return e.getDomain(this,"angleValue","key",i);{const o=e.getDomain(this,"radiusValue-end","value",i),s=Number.isFinite(o[1]-o[0])?[Math.min(o[0],0),Math.max(o[1],0)]:[];return fixNumericExtent8(s)}}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:o}=this.properties,s=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),r=`${a}-trailing`,n=[];(0,import_ag_charts_core101.isDefined)(o)&&n.push(normaliseGroupTo([a,r],Math.abs(o))),s&&this.processedData&&n.push(diff6(this.id,this.processedData)),s&&n.push(animationValidation7());const l=this.visible?{}:{forceValue:0},c=this.axes[ChartAxisDirection28.Radius]?.scale.type,h=this.axes[ChartAxisDirection28.Angle]?.scale.type;await this.requestDataModel(t,this.data,{props:[keyProperty9(e,h,{id:"angleValue"}),valueProperty15(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...groupAccumulativeValueProperty2(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...groupAccumulativeValueProperty2(i,"trailing",{id:"radiusValue-start",invalidValue:null,groupId:r,separateNegative:!0,...l},c),...n],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,o=this.circleCache;return t!==o.r||e!==o.cx||i!==o.cy?(this.circleCache={r:t,cx:e,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[ChartAxisDirection28.Radius]?.isReversed()}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const t=this.axes[ChartAxisDirection28.Radius];return t instanceof PolarAxis?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e,groupScale:i}=this;if(!e||!t||t.type!=="grouped")return;const o=this.axes[ChartAxisDirection28.Angle],s=this.axes[ChartAxisDirection28.Radius],a=o?.scale,r=s?.scale;if(!a||!r)return;const n=e.resolveKeysById(this,"angleValue",t),l=e.resolveColumnById(this,"radiusValue-start",t),c=e.resolveColumnById(this,"radiusValue-end",t),h=e.resolveColumnById(this,"radiusValue-raw",t),d=e.resolveProcessedDataIndexById(this,"radiusValue-range");let u=0,p=0;o instanceof AngleCategoryAxis&&(u=o.groupPaddingInner,p=o.paddingInner);const y=(a.bandwidth??0)*(1-p),{index:f,visibleGroupCount:x}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:x}).map((A,P)=>String(P)),i.range=[-y/2,y/2],i.paddingInner=x>1?u:0;const b=this.isRadiusAxisReversed(),m=b?this.radius:this.getAxisInnerRadius(),S=b?this.getAxisInnerRadius():this.radius,v=S+m,{angleKey:M,radiusKey:D,angleName:k,radiusName:_,legendItemName:T,label:w}=this.properties,R=this.getSeriesDomain(ChartAxisDirection28.Radius),F=(A,P,z,B)=>{const V=this.getLabelText(P,A,D,"radius",R,w,{value:P,datum:A,angleKey:M,radiusKey:D,angleName:k,radiusName:_,legendItemName:T});if(V)return{x:z,y:B,text:V,textAlign:"center",textBaseline:"middle"}},O=[],E=getItemStyles3((A,P,z)=>getItemStyle(this,A,P,z)),I={itemId:D,nodeData:O,labelData:O,styles:E};if(!this.visible)return I;const{dataSources:C}=t,L=C.get(this.id)?.data??[];for(const{datumIndex:A,group:P}of e.forEachGroupDatum(this,t)){const z=L[A],B=n[A];if(B==null)return;const V=h[A],W=V>=0&&!Object.is(V,-0),H=l[A],G=c[A],K=P.aggregation[d][W?1:0]??0,U=W===b;if(H===void 0||G===void 0)return;let Y,$;if(L.length===1)Y=-.5*Math.PI,$=1.5*Math.PI;else{const st=a.convert(B);Y=normalizeAngle3605(st+i.convert(String(f))),$=normalizeAngle3605(Y+i.bandwidth)}const X=Y+i.bandwidth/2,Z=v-r.convert(H),q=v-r.convert(G),it=(Z+q)/2,J=v-r.convert(0),j=v-r.convert(K),tt=Math.cos(X)*it,Q=Math.sin(X)*it,ot=this.properties.label.enabled?F(z,V,tt,Q):void 0,et=this.getColumnWidth(Y,$);O.push({series:this,datum:z,datumIndex:A,point:{x:tt,y:Q,size:0},midPoint:{x:tt,y:Q},label:ot,angleValue:B,radiusValue:V,negative:U,innerRadius:Z,outerRadius:q,stackInnerRadius:J,stackOuterRadius:j,startAngle:Y,endAngle:$,midAngle:X,axisInnerRadius:m,axisOuterRadius:S,columnWidth:et,index:A})}return{itemId:D,nodeData:O,labelData:O,styles:E}}getColumnWidth(t,e){return Number.NaN}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(t,e){const{contextNodeData:i}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight();let s=[];const a=this.ctx.highlightManager?.getActiveHighlight();e?a?.datum&&a.series===this&&s.push(a):s=this.nodeData;const r=this.isRadiusAxisReversed(),n=r?this.radius:this.getAxisInnerRadius(),l=r?this.getAxisInnerRadius():this.radius,c=this.getShapeFillBBox(),h=this.hasItemStylers();t.update(s,void 0,d=>this.getDatumId(d)).each((d,u)=>{const{midPoint:p}=u;if(h){const b=this.getHighlightState(a,e,u.datumIndex);u.style=getItemStyle(this,u,e,b)}const g=u.style??i.styles[this.getHighlightState(o,e,u.datumIndex)],y=g.fill,x=isGradientFill2(y)&&y.bounds==="item"?{centerX:p?.x??0,centerY:p?.y??0}:{centerX:0,centerY:0,innerRadius:n,outerRadius:l};this.updateItemPath(d,u,e),applyShapeStyle13(d,g,c,x),d.cornerRadius=g.cornerRadius??0,d.lineJoin="round"})}updateLabels(){const t=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.update(this.nodeData).each((e,i)=>{updateLabelNode6(this,e,this.properties,this.properties.label,i.label,!1,t),e.fillOpacity=this.getHighlightStyle(!1,i.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getColumnTransitionFunctions();motion6.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),seriesLabelFadeInAnimation5(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getColumnTransitionFunctions();motion6.fromToMotion(this.id,"datums",e,[t],i),seriesLabelFadeOutAnimation(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:a}=this,{angleKey:r,angleName:n,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=a,u=s[ChartAxisDirection28.Angle],p=s[ChartAxisDirection28.Radius],g=this.nodeData?.[t];if(!i||!o||!u||!p||!g)return;const y=o.dataSources.get(this.id)?.data[t],f=i.resolveKeysById(this,"angleValue",o)[t],x=i.resolveColumnById(this,"radiusValue-raw",o)[t];if(f==null)return;const b=getItemStyle(this,g,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(u,"tooltip",f,y,r,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(p,"tooltip",x,y,l,void 0)}]},{seriesId:e,datum:y,title:n,angleKey:r,angleName:n,radiusKey:l,radiusName:c,legendItemName:h,...b})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:r}=getStyle(this,!1,!1,import_ag_charts_community230._ModuleSupport.HighlightState.None),n={fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:r};return import_ag_charts_community230._ModuleSupport.isGradientFill(n.fill)&&(n.fill={...n.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:n}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{radiusKey:o,radiusName:s,legendItemName:a,showInLegend:r}=this.properties;return[{legendType:"category",id:e,itemId:o,seriesId:e,enabled:i,label:{text:a??s??o},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}getDatumId(t){return createDatumId16(t.angleValue)}computeLabelsBBox(){return null}},import_ag_charts_community231=require("ag-charts-community"),{SeriesProperties:SeriesProperties8,makeSeriesTooltip:makeSeriesTooltip17,Property:Property75,Label:Label12}=import_ag_charts_community231._ModuleSupport,RadialColumnSeriesBaseProperties=class extends SeriesProperties8{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new Label12,this.tooltip=makeSeriesTooltip17()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,cornerRadius:n}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,cornerRadius:n,opacity:1}}};__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"angleKey",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"angleName",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"radiusKey",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"radiusName",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"legendItemName",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"fill",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"fillOpacity",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"stroke",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"strokeWidth",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"strokeOpacity",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"lineDash",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"lineDashOffset",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"cornerRadius",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"styler",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"itemStyler",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"rotation",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"stackGroup",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"normalizedTo",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"label",2),__decorateClass([Property75],RadialColumnSeriesBaseProperties.prototype,"tooltip",2);var import_ag_charts_community233=require("ag-charts-community"),import_ag_charts_community232=require("ag-charts-community"),{motion:motion7}=import_ag_charts_community232._ModuleSupport;function createAngleMotionCalculator(){const t={startAngle:new Map,endAngle:new Map},e=["startAngle","endAngle"],i=(r,n,l)=>{for(const c of e){const h=t[c];let d=(l==="removed"||l==="updated"?r:n)[c],u=(l==="removed"?r:n)[c];Number.isNaN(u)&&(u=r.previousDatum?.[c]??Number.NaN);const p=d-u;Math.abs(p)>Math.PI&&(d-=Math.sign(p)*2*Math.PI),h.set(n,{from:d,to:u})}},o=(r,n)=>({startAngle:t.startAngle.get(r)[n],endAngle:t.endAngle.get(r)[n]});return{calculate:i,from:r=>o(r,"from"),to:r=>o(r,"to")}}function fixRadialColumnAnimationStatus(t,e,i){if(i==="updated"){if(t.previousDatum==null||Number.isNaN(t.previousDatum.startAngle)||Number.isNaN(t.previousDatum.endAngle))return"added";if(Number.isNaN(e.startAngle)||Number.isNaN(e.endAngle))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function prepareRadialColumnAnimationFunctions(t){const e=createAngleMotionCalculator();return{toFn:(s,a,r)=>{const{startAngle:n,endAngle:l}=e.to(a);let c,h,d,u,p;return r==="removed"?(c=s.innerRadius,h=s.innerRadius,d=s.columnWidth,u=s.axisInnerRadius,p=s.axisOuterRadius):(c=Number.isNaN(a.innerRadius)?t:a.innerRadius,h=Number.isNaN(a.outerRadius)?t:a.outerRadius,d=Number.isNaN(a.columnWidth)?s.columnWidth:a.columnWidth,u=a.axisInnerRadius,p=a.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:n,endAngle:l}},fromFn:(s,a,r)=>{r=fixRadialColumnAnimationStatus(s,a,r),e.calculate(s,a,r);const{startAngle:n,endAngle:l}=e.from(a);let c,h,d,u,p;r==="removed"||r==="updated"?(c=s.innerRadius,h=s.outerRadius,d=s.columnWidth,u=s.axisInnerRadius,p=s.axisOuterRadius):(c=t,h=t,d=a.columnWidth,u=a.axisInnerRadius,p=a.axisOuterRadius);const g=motion7.NODE_UPDATE_STATE_TO_PHASE_MAPPING[r];return{innerRadius:c,outerRadius:h,columnWidth:d,axisInnerRadius:u,axisOuterRadius:p,startAngle:n,endAngle:l,phase:g}}}}function resetRadialColumnSelectionFn(t,{innerRadius:e,outerRadius:i,columnWidth:o,axisInnerRadius:s,axisOuterRadius:a,startAngle:r,endAngle:n}){return{innerRadius:e,outerRadius:i,columnWidth:o,axisInnerRadius:s,axisOuterRadius:a,startAngle:r,endAngle:n}}var{SectorBox,motion:motion8}=import_ag_charts_community233._ModuleSupport;function getRadii(t){const{negative:e,innerRadius:i,outerRadius:o,stackInnerRadius:s,stackOuterRadius:a}=t;return{innerRadius:e?a:s,outerRadius:e?s:a,clipInnerRadius:e?o:i,clipOuterRadius:e?i:o}}function prepareNightingaleAnimationFunctions(t){const e=createAngleMotionCalculator();return{toFn:(s,a,r)=>{const{startAngle:n,endAngle:l}=e.to(a);let c,h,d;if(r==="removed")c=t,h=t,d=new SectorBox(n,l,c,h);else{let u,p;({innerRadius:c,outerRadius:h,clipInnerRadius:u,clipOuterRadius:p}=getRadii(a)),Number.isNaN(c)&&(c=t),Number.isNaN(h)&&(h=t),Number.isNaN(u)&&(u=t),Number.isNaN(p)&&(p=t),d=new SectorBox(n,l,u,p)}return{innerRadius:c,outerRadius:h,startAngle:n,endAngle:l,clipSector:d}},fromFn:(s,a,r)=>{r=fixRadialColumnAnimationStatus(s,a,r),e.calculate(s,a,r);const{startAngle:n,endAngle:l}=e.from(a);let c,h,d;r==="removed"||r==="updated"?(c=s.innerRadius,h=s.outerRadius,d=s.clipSector):(c=t,h=t),d??(d=new SectorBox(n,l,c,h));const u=motion8.NODE_UPDATE_STATE_TO_PHASE_MAPPING[r];return{innerRadius:c,outerRadius:h,startAngle:n,endAngle:l,clipSector:d,phase:u}}}}function resetNightingaleSelectionFn(t,e){const{startAngle:i,endAngle:o}=e,{innerRadius:s,outerRadius:a,clipInnerRadius:r,clipOuterRadius:n}=getRadii(e),l=new SectorBox(i,o,r,n);return{innerRadius:s,outerRadius:a,startAngle:i,endAngle:o,clipSector:l}}var{Sector:Sector4,SectorBox:SectorBox2,PolarZIndexMap}=import_ag_charts_community234._ModuleSupport,NightingaleSeries=class extends RadialColumnSeriesBase{constructor(t){super(t,{animationResetFns:{item:resetNightingaleSelectionFn}}),this.properties=new RadialColumnSeriesBaseProperties}setZIndex(t){return super.setZIndex(t),this.contentGroup.zIndex=[0,PolarZIndexMap.FOREGROUND,t],this.highlightGroup.zIndex=[0,PolarZIndexMap.HIGHLIGHT,t],this.labelGroup.zIndex=[0,PolarZIndexMap.LABEL,t],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new Sector4}updateItemPath(t,e,i){const{negative:o}=e;if(t.centerX=0,t.centerY=0,t.startOuterCornerRadius=o?0:this.properties.cornerRadius,t.endOuterCornerRadius=o?0:this.properties.cornerRadius,t.startInnerCornerRadius=o?this.properties.cornerRadius:0,t.endInnerCornerRadius=o?this.properties.cornerRadius:0,i){const{startAngle:s,endAngle:a}=e,{innerRadius:r,outerRadius:n,clipInnerRadius:l,clipOuterRadius:c}=getRadii(e);t.innerRadius=r,t.outerRadius=n,t.startAngle=s,t.endAngle=a,t.clipSector=new SectorBox2(s,a,l,c)}}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return prepareNightingaleAnimationFunctions(t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};NightingaleSeries.className="NightingaleSeries",NightingaleSeries.type="nightingale";var import_ag_charts_community235=require("ag-charts-community"),import_ag_charts_core102=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs15,nightingaleSeriesThemeableOptionsDef}=import_ag_charts_community235._ModuleSupport,nightingaleSeriesOptionsDef={...commonSeriesOptionsDefs15,...nightingaleSeriesThemeableOptionsDef,type:(0,import_ag_charts_core102.required)((0,import_ag_charts_core102.constant)("nightingale")),angleKey:(0,import_ag_charts_core102.required)(import_ag_charts_core102.string),radiusKey:(0,import_ag_charts_core102.required)(import_ag_charts_core102.string),angleName:import_ag_charts_core102.string,radiusName:import_ag_charts_core102.string,legendItemName:import_ag_charts_core102.string,grouped:import_ag_charts_core102.boolean,stacked:import_ag_charts_core102.boolean,stackGroup:import_ag_charts_core102.string,normalizedTo:import_ag_charts_core102.number},import_ag_charts_community236=require("ag-charts-community"),{ThemeConstants:{POLAR_AXIS_TYPE,POLAR_AXIS_SHAPE},FILL_GRADIENT_RADIAL_SERIES_DEFAULTS,FILL_IMAGE_DEFAULTS:FILL_IMAGE_DEFAULTS4,FILL_PATTERN_DEFAULTS:FILL_PATTERN_DEFAULTS2}=import_ag_charts_community236._ModuleSupport,NIGHTINGALE_SERIES_THEME={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",FILL_GRADIENT_RADIAL_SERIES_DEFAULTS],["image",FILL_IMAGE_DEFAULTS4],["pattern",FILL_PATTERN_DEFAULTS2]]},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},strokeWidth:1,label:{...import_ag_charts_community236._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:import_ag_charts_community236._ModuleSupport.multiSeriesHighlightStyle()},axes:{[POLAR_AXIS_TYPE.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:POLAR_AXIS_SHAPE.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[POLAR_AXIS_TYPE.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:POLAR_AXIS_SHAPE.CIRCLE}}}},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE2}}=import_ag_charts_community237._ModuleSupport,NightingaleModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"nightingale",moduleFactory:t=>new NightingaleSeries(t),defaultAxes:[{type:POLAR_AXIS_TYPE2.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE2.RADIUS_NUMBER}],themeTemplate:NIGHTINGALE_SERIES_THEME,stackable:!0,groupable:!0,stackedByDefault:!0},NightingaleSeriesModule={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,options:nightingaleSeriesOptionsDef,create:t=>new NightingaleSeries(t)},import_ag_charts_community239=require("ag-charts-community"),import_ag_charts_core103=require("ag-charts-core"),import_ag_charts_community238=require("ag-charts-community"),{SeriesProperties:SeriesProperties9,makeSeriesTooltip:makeSeriesTooltip18,Property:Property76,Label:Label13,DropShadow:DropShadow5}=import_ag_charts_community238._ModuleSupport,PyramidSeriesLabel=class extends Label13{},PyramidSeriesStageLabel=class extends Label13{constructor(){super(...arguments),this.spacing=0}};__decorateClass([Property76],PyramidSeriesStageLabel.prototype,"spacing",2),__decorateClass([Property76],PyramidSeriesStageLabel.prototype,"placement",2);var PyramidProperties=class extends SeriesProperties9{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.direction="vertical",this.reverse=void 0,this.spacing=0,this.aspectRatio=void 0,this.shadow=new DropShadow5().set({enabled:!1}),this.label=new PyramidSeriesLabel,this.stageLabel=new PyramidSeriesStageLabel,this.tooltip=makeSeriesTooltip18()}getStyle(t=0){const{fills:e,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n}=this;return{fill:e[t%e.length],fillOpacity:o,stroke:i[t%i.length],strokeWidth:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,opacity:1}}};__decorateClass([Property76],PyramidProperties.prototype,"stageKey",2),__decorateClass([Property76],PyramidProperties.prototype,"valueKey",2),__decorateClass([Property76],PyramidProperties.prototype,"fills",2),__decorateClass([Property76],PyramidProperties.prototype,"fillOpacity",2),__decorateClass([Property76],PyramidProperties.prototype,"strokes",2),__decorateClass([Property76],PyramidProperties.prototype,"strokeWidth",2),__decorateClass([Property76],PyramidProperties.prototype,"strokeOpacity",2),__decorateClass([Property76],PyramidProperties.prototype,"lineDash",2),__decorateClass([Property76],PyramidProperties.prototype,"lineDashOffset",2),__decorateClass([Property76],PyramidProperties.prototype,"direction",2),__decorateClass([Property76],PyramidProperties.prototype,"reverse",2),__decorateClass([Property76],PyramidProperties.prototype,"spacing",2),__decorateClass([Property76],PyramidProperties.prototype,"aspectRatio",2),__decorateClass([Property76],PyramidProperties.prototype,"itemStyler",2),__decorateClass([Property76],PyramidProperties.prototype,"shadow",2),__decorateClass([Property76],PyramidProperties.prototype,"label",2),__decorateClass([Property76],PyramidProperties.prototype,"stageLabel",2),__decorateClass([Property76],PyramidProperties.prototype,"tooltip",2);function applyPyramidDatum(t,{x:e,y:i,top:o,right:s,bottom:a,left:r}){t.x0=e-o/2,t.x1=e+o/2,t.x2=e+a/2,t.x3=e-a/2,t.y0=i-r/2,t.y1=i-s/2,t.y2=i+s/2,t.y3=i+r/2}function preparePyramidAnimationFunctions(t){return{fromFn:(s,a)=>{const{x:r,y:n}=a;let{top:l,right:c,bottom:h,left:d}=a;return t==="vertical"?(l=0,h=0):(d=0,c=0),{x:r,y:n,top:l,right:c,bottom:h,left:d}},toFn:(s,a)=>{const{x:r,y:n,top:l,right:c,bottom:h,left:d}=a;return{x:r,y:n,top:l,right:c,bottom:h,left:d}},applyFn:applyPyramidDatum}}var{StateMachine:StateMachine14,valueProperty:valueProperty16,SeriesNodePickMode:SeriesNodePickMode13,createDatumId:createDatumId17,BBox:BBox22,Group:Group16,Selection:Selection13,Text:Text7,PointerEvents:PointerEvents9,applyShapeStyle:applyShapeStyle14,mergeDefaults:mergeDefaults17,fromToMotion:fromToMotion4,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation6,getLabelStyles:getLabelStyles5}=import_ag_charts_community239._ModuleSupport,PyramidSeries=class extends import_ag_charts_community239._ModuleSupport.DataModelSeries{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[SeriesNodePickMode13.EXACT_SHAPE_MATCH,SeriesNodePickMode13.NEAREST_NODE]}),this.properties=new PyramidProperties,this.itemGroup=this.contentGroup.appendChild(new Group16({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group16({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new Group16({name:"stageLabelGroup"})),this.datumSelection=Selection13.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Selection13.select(this.itemLabelGroup,Text7),this.stageLabelSelection=Selection13.select(this.stageLabelGroup,Text7),this.highlightDatumSelection=Selection13.select(this.highlightGroup,()=>this.nodeFactory()),this.animationState=new StateMachine14("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=PointerEvents9.None,this.stageLabelGroup.pointerEvents=PointerEvents9.None}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new FunnelConnector}getNodeData(){return this.contextNodeData?.nodeData}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}async processData(t){if(this.data==null)return;const{id:e,visible:i,ctx:{legendManager:o}}=this,{stageKey:s,valueKey:a}=this.properties,r="category",n="number",l=(h,d,u)=>i&&o.getItemEnabled({seriesId:e,itemId:u}),c=this.visible?{}:{forceValue:0};await this.requestDataModel(t,this.data,{props:[valueProperty16(s,r,{id:"xValue"}),valueProperty16(a,n,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:t,dataModel:e,processedData:i,properties:o,visible:s,ctx:{legendManager:a}}=this,{stageKey:r,valueKey:n,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:d,label:u,stageLabel:p}=o;if(e==null||i==null)return;const g=l==="horizontal",y=e.resolveColumnById(this,"xValue",i),f=e.resolveColumnById(this,"yValue",i),x=e.getDomain(this,"xValue","value",i),b=e.getDomain(this,"yValue","value",i),m=(0,import_ag_charts_core103.cachedTextMeasurer)(p);let S,v;g?(S="center",v=p.placement==="before"?"bottom":"top"):(S=p.placement==="after"?"left":"right",v="middle");const M=p.enabled?[]:void 0;let D=0,k=0,_=0;const T=i.dataSources.get(this.id)?.data??[];for(const[B,V]of T.entries()){const W=y[B],H=f[B],G=s&&a.getItemEnabled({seriesId:t,itemId:B});if(_+=H,M==null)continue;const K=this.getLabelText(W,V,r,"x",x,this.properties.stageLabel,{datum:V,value:H,stageKey:r,valueKey:n}),{width:U,height:Y}=(0,import_ag_charts_core103.isArray)(K)?(0,import_ag_charts_core103.measureTextSegments)(K,u):m.measureLines(K);D=Math.max(D,U),k=Math.max(k,Y),M.push({x:Number.NaN,y:Number.NaN,text:K,textAlign:S,textBaseline:v,visible:G})}const w=this._nodeDataDependencies?.seriesRectWidth??0,R=this._nodeDataDependencies?.seriesRectHeight??0,F=h*(i.input.count-1);let O;if(g){const B=k+p.spacing;O=new BBox22(0,p.placement==="before"?B:0,w,R-B)}else{const B=D+p.spacing;O=new BBox22(p.placement==="after"?0:B,0,w-B,R)}if(d!=null&&d!==0){const B=l==="horizontal"?1/d:d,V=Math.min(O.width,O.height*B),W=V/B;O=new BBox22(O.x+(O.width-V)/2,O.y+(O.height-W)/2,V,W)}let E,I;g?I=p.placement==="before"?O.y-p.spacing:O.y+O.height+p.spacing:E=p.placement==="after"?O.x+O.width+p.spacing:O.x-p.spacing;const C=O.width-(g?F:0),L=O.height-(g?0:F);if(C<0||L<0)return;const A=[],P=[];let z=0;for(const[B,V]of T.entries()){const W=y[B],H=f[B],G=s&&a.getItemEnabled({seriesId:t,itemId:B}),K=z+H,U=(z+K)/(2*_),Y=(K-z)/_,$=g?C*U+h*B:C*.5,X=g?L*.5:L*U+h*B,Z=O.x+$,q=O.y+X;if(M!=null){const et=M[B];et.x=E??Z,et.y=I??q}let it,J,j,tt;if(g){const et=C*Y;it=et,j=et;const st=($+et/2)*(L/O.width),rt=($-et/2)*(L/O.width);J=c?O.height-st:st,tt=c?O.height-rt:rt}else{const et=L*Y;J=et,tt=et;const st=(X-et/2)*(C/O.height),rt=(X+et/2)*(C/O.height);it=c?O.width-st:st,j=c?O.width-rt:rt}const Q=this.getLabelText(H,V,n,"y",b,u,{datum:V,value:H,stageKey:r,valueKey:n}),ot={x:Z,y:q,text:Q,textAlign:"center",textBaseline:"middle",visible:G};P.push(ot),A.push({series:this,itemId:n,datum:V,datumIndex:B,index:B,xValue:W,yValue:H,x:Z,y:q,top:it,right:J,bottom:j,left:tt,label:ot,enabled:G,midPoint:{x:Z,y:q},style:this.getItemStyle({datumIndex:B,datum:V},!1)}),z=K}return{itemId:t,nodeData:A,labelData:P,stageLabelData:M,bounds:O}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:t}){this.checkResize(t);const{datumSelection:e,labelSelection:i,stageLabelSelection:o,highlightDatumSelection:s}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let a=this.ctx.highlightManager?.getActiveHighlight();a!=null&&(a.series!==this||a.datum==null)&&(a=void 0);const r=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[],l=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:l,stageLabelSelection:o}),this.updateLabelNodes({labelSelection:o,labelProperties:this.properties.stageLabel}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:a==null?[]:[a],datumSelection:s}),this.updateDatumStyles({datumSelection:s,isHighlight:!0}),this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData)}getItemStyle({datumIndex:t,datum:e},i){const{properties:o}=this,{itemStyler:s}=o,a=this.getHighlightStyle(i,t);let n=mergeDefaults17(a,o.getStyle(t));if(s!=null&&t!=null){const l=this.cachedDatumCallback(createDatumId17(t,i?"highlight":"node"),()=>{const c=this.makeItemStylerParams(e,t,i,n);return this.callWithContext(s,c)});l&&(n=mergeDefaults17(l,n))}return n}makeItemStylerParams(t,e,i,o){const{id:s,properties:a}=this,{stageKey:r,valueKey:n}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,e),h=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:t,stageKey:r,valueKey:n,highlighted:i,highlightState:c,...o,fill:h}}updateDatumStyles({datumSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getItemStyle(o,e)})}updateDatumNodes({datumSelection:t}){const{properties:e}=this,{shadow:i}=e,o=this.contextNodeData?.bounds,s=o?{series:o,axis:o}:void 0;t.each((a,r)=>{applyShapeStyle14(a,r.style,s),applyPyramidDatum(a,r),a.fillShadow=i})}updateLabelSelection(t){return t.labelSelection.update(this.properties.label.enabled?t.labelData:[])}updateStageLabelSelection(t){return t.stageLabelSelection.update(t.stageLabelData)}updateLabelNodes(t){const e=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((i,o,s)=>{const{visible:a,x:r,y:n,text:l,textAlign:c,textBaseline:h}=o,d=getLabelStyles5(this,void 0,this.properties,t.labelProperties,!1,e),{color:u,fontSize:p,fontStyle:g,fontWeight:y,fontFamily:f}=d;i.visible=a,i.x=r,i.y=n,i.text=l,i.fill=u,i.fillOpacity=this.getHighlightStyle(!1,s).opacity??1,i.fontStyle=g,i.fontWeight=y,i.fontSize=p,i.fontFamily=f,i.textAlign=c,i.textBaseline=h,i.setBoxing(d)})}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0){for(const i of this.datumSelection)if(i.datum===e)return i.node}}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,properties:s}=this,{stageKey:a,valueKey:r,tooltip:n}=s;if(!i||!o)return;const l=o.dataSources.get(this.id)?.data[t],c=i.resolveColumnById(this,"xValue",o)[t],h=i.resolveColumnById(this,"yValue",o)[t];if(c==null)return;const d=this.getLabelText(c,l,a,"x",i.getDomain(this,"xValue","value",o),this.properties.stageLabel,{datum:l,value:c,stageKey:a,valueKey:r}),u=this.getLabelText(h,l,r,"y",i.getDomain(this,"yValue","value",o),this.properties.stageLabel,{datum:l,value:h,stageKey:a,valueKey:r}),p=this.getItemStyle({datumIndex:t,datum:l},!1);return this.formatTooltipWithContext(n,{symbol:this.legendItemSymbol(t),data:[{label:(0,import_ag_charts_core103.toPlainText)(d),value:(0,import_ag_charts_core103.toPlainText)(u)}]},{seriesId:e,datum:l,title:void 0,stageKey:a,valueKey:r,...p})}getSeriesDomain(){return[Number.NaN,Number.NaN]}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:t,y:e}){let i=1/0,o;return this.datumSelection.each((s,a)=>{const r=s.distanceSquared(t,e);rnew PyramidSeries(t),solo:!0,themeTemplate:PYRAMID_SERIES_THEME},PyramidSeriesModule={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,options:pyramidSeriesOptionsDef,create:t=>new PyramidSeries(t)},import_ag_charts_community248=require("ag-charts-community"),import_ag_charts_community242=require("ag-charts-community"),{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE3}}=import_ag_charts_community242._ModuleSupport,BASE_RADAR_SERIES_THEME={series:{stroke:{$palette:"stroke"},label:{...import_ag_charts_community242._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",import_ag_charts_community242._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",import_ag_charts_community242._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community242._ModuleSupport.FILL_PATTERN_DEFAULTS]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:import_ag_charts_community242._ModuleSupport.multiSeriesHighlightStyle(),tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{[POLAR_AXIS_TYPE3.ANGLE_CATEGORY]:{label:{spacing:10}}}},RADAR_LINE_SERIES_THEME=import_ag_charts_community242._ModuleSupport.mergeDefaults({series:{stroke:import_ag_charts_community242._ModuleSupport.SAFE_STROKE_FILL_OPERATION,strokeWidth:2}},BASE_RADAR_SERIES_THEME),RADAR_AREA_SERIES_THEME=import_ag_charts_community242._ModuleSupport.mergeDefaults({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",import_ag_charts_community242._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],["image",import_ag_charts_community242._ModuleSupport.FILL_IMAGE_DEFAULTS],["pattern",import_ag_charts_community242._ModuleSupport.FILL_PATTERN_DEFAULTS]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},BASE_RADAR_SERIES_THEME),import_ag_charts_community246=require("ag-charts-community"),import_ag_charts_community244=require("ag-charts-community"),import_ag_charts_core105=require("ag-charts-core"),import_ag_charts_community243=require("ag-charts-community"),{Label:Label14,SeriesMarker:SeriesMarker2,SeriesProperties:SeriesProperties10,makeSeriesTooltip:makeSeriesTooltip19,Property:Property77}=import_ag_charts_community243._ModuleSupport,RadarSeriesProperties=class extends SeriesProperties10{constructor(){super(...arguments),this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new SeriesMarker2,this.label=new Label14,this.tooltip=makeSeriesTooltip19(),this.connectMissingData=!1}};__decorateClass([Property77],RadarSeriesProperties.prototype,"angleKey",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"radiusKey",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"angleName",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"radiusName",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"legendItemName",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"stroke",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"lineDash",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"rotation",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"styler",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"marker",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"label",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"tooltip",2),__decorateClass([Property77],RadarSeriesProperties.prototype,"connectMissingData",2);var{DEFAULT_POLAR_DIRECTION_KEYS:DEFAULT_POLAR_DIRECTION_KEYS2,DEFAULT_POLAR_DIRECTION_NAMES:DEFAULT_POLAR_DIRECTION_NAMES2,ChartAxisDirection:ChartAxisDirection29,PolarAxis:PolarAxis2,SeriesNodePickMode:SeriesNodePickMode14,valueProperty:valueProperty17,fixNumericExtent:fixNumericExtent9,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation7,markerFadeInAnimation:markerFadeInAnimation2,resetMarkerFn:resetMarkerFn2,animationValidation:animationValidation8,computeMarkerFocusBounds:computeMarkerFocusBounds3,extent:extent2,BBox:BBox23,Group:Group17,Path:Path12,Selection:Selection14,Text:Text8,Marker:Marker5,updateLabelNode:updateLabelNode7,getMarkerStyles:getMarkerStyles2,mergeDefaults:mergeDefaults18}=import_ag_charts_community244._ModuleSupport,RadarSeriesNodeEvent=class extends import_ag_charts_community244._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},RadarSeries=class extends import_ag_charts_community244._ModuleSupport.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"angleValue",propertyKeys:DEFAULT_POLAR_DIRECTION_KEYS2,propertyNames:DEFAULT_POLAR_DIRECTION_NAMES2,pickModes:[SeriesNodePickMode14.NEAREST_NODE,SeriesNodePickMode14.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:resetMarkerFn2},clipFocusBox:!1}),this.NodeEvent=RadarSeriesNodeEvent,this.lineGroup=this.contentGroup.appendChild(new Group17({name:"radar-line"})),this.lineSelection=Selection14.select(this.lineGroup,Path12),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}get hasData(){return this.getHasData("angleValue")}nodeFactory(){return new Marker5}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===ChartAxisDirection29.Angle)return e.getDomain(this,"angleValue","value",i);{const o=e.getDomain(this,"radiusValue","value",i),s=extent2(o.length===0?o:[0].concat(o));return fixNumericExtent9(s)}}async processData(t){const{angleKey:e,radiusKey:i}=this.properties,o=[];this.ctx.animationManager.isSkipped()||o.push(animationValidation8());const s=this.axes[ChartAxisDirection29.Radius]?.scale.type,a=this.axes[ChartAxisDirection29.Angle]?.scale.type;await this.requestDataModel(t,this.data,{props:[valueProperty17(e,a,{id:"angleValue"}),valueProperty17(i,s,{id:"radiusValue",invalidValue:void 0}),...o]}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,o=this.circleCache;return t===o.r&&e===o.cx&&i===o.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}getAxisInnerRadius(){const t=this.axes[ChartAxisDirection29.Radius];return t instanceof PolarAxis2?this.radius*t.innerRadiusRatio:0}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}createNodeData(){const{processedData:t,dataModel:e}=this;if(!t||!e)return;const{angleKey:i,radiusKey:o,angleName:s,radiusName:a,legendItemName:r,marker:n,label:l}=this.properties,c=this.axes[ChartAxisDirection29.Angle]?.scale,h=this.axes[ChartAxisDirection29.Radius]?.scale;if(!c||!h)return;const d=e.resolveColumnById(this,"angleValue",t),u=e.resolveColumnById(this,"radiusValue",t),p=this.getAxisInnerRadius(),g=this.getSeriesDomain(ChartAxisDirection29.Radius),f=(t.dataSources.get(this.id)?.data??[]).map((x,b)=>{const m=d[b],S=u[b],v=c.convert(m),M=this.radius+p-h.convert(S),D=Math.cos(v),k=Math.sin(v),_=D*M,T=k*M;let w;if(l.enabled){const R=this.getLabelText(S,x,o,"radius",g,l,{value:S,datum:x,angleKey:i,radiusKey:o,angleName:s,radiusName:a,legendItemName:r});if(R){let F="right";(0,import_ag_charts_core105.isNumberEqual)(D,0)?F="center":D>0&&(F="left");let O="bottom";(0,import_ag_charts_core105.isNumberEqual)(k,0)?O="middle":k>0&&(O="top"),w={x:_+D*n.size,y:T+k*n.size,text:R,textAlign:F,textBaseline:O}}}return{series:this,datum:x,datumIndex:b,index:b,point:{x:_,y:T,size:n.size},midPoint:{x:_,y:T},label:w,angleValue:m,radiusValue:S,missing:!(0,import_ag_charts_core105.isFiniteNumber)(v)||!(0,import_ag_charts_core105.isFiniteNumber)(M)}});return{itemId:o,nodeData:f,labelData:f,styles:getMarkerStyles2(this,this.properties,n)}}update({seriesRect:t}){const e=this.checkResize(t),i=!this.ctx.animationManager.isSkipped(),{series:o}=this.ctx.highlightManager?.getActiveHighlight()??{};this.highlightGroup.visible=(i||this.visible)&&o===this,this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updatePathSelections(),this.updateMarkerSelection(),this.updateHighlightSelection(),this.updatePathNodes(),this.hasItemStylers()&&(this.updateDatumStyles(this.itemSelection,!1),this.updateDatumStyles(this.highlightSelection,!0)),this.updateMarkers(this.itemSelection,!1),this.updateMarkers(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePathSelections(){const t=this.visible?[!0]:[];this.lineSelection.update(t)}updateMarkerSelection(){const{marker:t,styler:e}=this.properties;t.isDirty()&&(this.itemSelection.clear(),this.itemSelection.cleanup(),this.itemSelection=Selection14.select(this.itemGroup,()=>this.nodeFactory(),!1));const i=e==null?t.enabled:this.getStyle(!1).marker.enabled,o=this.visible&&t.shape&&i?this.nodeData:[];this.itemSelection.update(o)}updateHighlightSelection(){const{marker:t,styler:e}=this.properties;t.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=Selection14.select(this.highlightGroup,()=>this.nodeFactory(),!1));const i=e==null?t.enabled:this.getStyle(!1).marker.enabled,o=this.ctx.highlightManager?.getActiveHighlight(),s=this.visible&&t.shape&&i&&o?.datum?[{...o}]:[];this.highlightSelection.update(s)}getMarkerFill(t){return t?.fill??this.getStyle(!1).marker.fill}getDatumStylerProperties(t){const{id:e,properties:i}=this,{angleKey:o,radiusKey:s}=i;return{seriesId:e,datum:t,angleKey:o,radiusKey:s}}updateDatumStyles(t,e){const i=this.ctx.highlightManager.getActiveHighlight();t.each((o,s)=>{const a=this.getHighlightState(i,e,s.datumIndex),r=this.getStyle(e,a),{stroke:n,strokeWidth:l,strokeOpacity:c}=r;s.style=this.getMarkerStyle(this.properties.marker,s,this.getDatumStylerProperties(s.datum),{isHighlight:e,highlightState:a},r.marker,{stroke:n,strokeWidth:l,strokeOpacity:c})})}updateMarkers(t,e){const i=this.getShapeFillBBox(),{contextNodeData:o}=this;if(!o)return;const s=this.ctx.highlightManager.getActiveHighlight();t.each((a,r)=>{const n=r.style??o.styles[this.getHighlightState(s,e,r.datumIndex)];this.applyMarkerStyle(n,a,r.point,i)})}updateLabels(){const{properties:t}=this,e=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.update(this.nodeData).each((i,o)=>{o.label&&(i.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1,updateLabelNode7(this,i,t,t.label,o.label,!1,e))})}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:a}=this,{angleKey:r,angleName:n,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d,marker:u}=a,p=s[ChartAxisDirection29.Angle],g=s[ChartAxisDirection29.Radius];if(!i||!o||!p||!g)return;const y=o.dataSources.get(this.id)?.data[t],f=i.resolveColumnById(this,"angleValue",o)[t],x=i.resolveColumnById(this,"radiusValue",o)[t];if(f==null)return;const b=this.getMarkerStyle(u,{datum:y,datumIndex:t},this.getDatumStylerProperties(y),{isHighlight:!1});return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",f,y,r,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",x,y,l,void 0)}]},{seriesId:e,datum:y,title:n,angleKey:r,radiusKey:l,angleName:n,radiusName:c,legendItemName:h,...b})}legendItemSymbol(){const{stroke:t,strokeWidth:e,strokeOpacity:i,lineDash:o,marker:s}=this.getStyle(!1);return{marker:{shape:s.shape,enabled:s.enabled||e<=0,fill:this.getMarkerFill()??s.stroke??t??"rgba(0, 0, 0, 0)",stroke:s.stroke??t??"rgba(0, 0, 0, 0)",fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},line:{stroke:t,strokeOpacity:i,strokeWidth:e,lineDash:o}}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:o}=this,{radiusKey:s,radiusName:a,legendItemName:r,showInLegend:n}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:o&&i.getItemEnabled({seriesId:e,itemId:s}),label:{text:r??a??s},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!n}]}pickNodeClosestDatum(t){const{nodeData:e,centerX:i,centerY:o}=this,{x:s,y:a}=t,r=this.radius;if(Math.hypot(s-i,a-o)>r+this.properties.marker.size)return;let l=1/0,c;for(const h of e){const{point:{x:d=Number.NaN,y:u=Number.NaN}={}}=h;if(Number.isNaN(d)||Number.isNaN(u))continue;const p=Math.hypot(t.x-d-i,t.y-u-o);pthis.animatePaths(o),onStop:()=>this.animatePaths(1)}),markerFadeInAnimation2(this,i,"added",t),seriesLabelFadeInAnimation7(this,"labels",i,e)}animateWaitingUpdateReady(t){super.animateWaitingUpdateReady(t),this.resetPaths()}animateReadyResize(t){super.animateReadyResize(t),this.resetPaths()}resetPaths(){const t=this.getLineNode();if(t){const{path:e}=t,i=this.getLinePoints(),o=this.getStyle(!1);t.fill=void 0,t.stroke=o.stroke,t.strokeWidth=o.strokeWidth,t.strokeOpacity=o.strokeOpacity,t.lineDash=o.lineDash,t.lineDashOffset=o.lineDashOffset,e.clear(!0);for(const{x:s,y:a,moveTo:r}of i)r?e.moveTo(s,a):e.lineTo(s,a);return t.checkPathDirty(),o}}getStylerResult(t,e,i){const{styler:o}=this.properties;if(o){const s=this.makeStylerParams(e,i),a=this.cachedCallWithContext(o,s)??{},r=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],a,{pick:!1});r&&(t=r)}return t}getFormattedMarkerStyle(t){const{angleKey:e,radiusKey:i}=this.properties;return this.getMarkerStyle(this.properties.marker,t,{angleKey:e,radiusKey:i},{isHighlight:!0})}computeFocusBounds(t){return computeMarkerFocusBounds3(this,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};RadarSeries.className="RadarSeries";var import_ag_charts_community245=require("ag-charts-community"),{Property:Property78}=import_ag_charts_community245._ModuleSupport,RadarAreaSeriesProperties=class extends RadarSeriesProperties{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};__decorateClass([Property78],RadarAreaSeriesProperties.prototype,"fill",2),__decorateClass([Property78],RadarAreaSeriesProperties.prototype,"fillOpacity",2);var{ChartAxisDirection:ChartAxisDirection30,Group:Group18,HighlightState:HighlightState4,Path:Path13,PointerEvents:PointerEvents10,Selection:Selection15,applyShapeStyle:applyShapeStyle15,toHighlightString:toHighlightString5}=import_ag_charts_community246._ModuleSupport,RadarAreaSeries=class extends RadarSeries{constructor(t){super(t),this.properties=new RadarAreaSeriesProperties,this.areaGroup=this.contentGroup.appendChild(new Group18({name:"radar-area"})),this.areaSelection=Selection15.select(this.areaGroup,Path13),this.resetInvalidToZero=!0,this.areaGroup.zIndex=-1}updatePathSelections(){const t=this.visible?[!0]:[];this.areaSelection.update(t),super.updatePathSelections()}getAreaNode(){return this.areaSelection.at(0)}getMarkerFill(t){if(t?.fill!=null)return t.fill;const e=this.getStyle(!1);return e.marker.fill??e.fill}updatePathNodes(){const t=this.getPathNodesStyle(),{fill:e,fillOpacity:i,strokeWidth:o,stroke:s,strokeOpacity:a,lineDash:r,lineDashOffset:n,opacity:l}=t,c=this.getLineNode();c&&c.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:PointerEvents10.None,opacity:l,stroke:s,strokeWidth:o,strokeOpacity:a,lineDash:r,lineDashOffset:n});const h=this.getAreaNode();h&&(applyShapeStyle15(h,{fill:e,fillOpacity:i,stroke:void 0},this.getShapeFillBBox()),h.setProperties({lineJoin:"round",pointerEvents:PointerEvents10.None,opacity:l}))}animatePaths(t){super.animatePaths(t);const e=this.getAreaNode();e&&this.animateSinglePath(e,this.getAreaPoints(),t)}getAreaPoints(){const t=this.getLinePoints(),e=r=>{const n=this.axes[r];return n instanceof import_ag_charts_community246._ModuleSupport.PolarAxis?n:void 0},i=e(ChartAxisDirection30.Radius),o=e(ChartAxisDirection30.Angle);if(!i?.isReversed())return t;const a=o?.getAxisLinePoints()?.points??[];return t.concat(...a)}resetPaths(){const t=super.resetPaths(),e=this.getAreaNode();if(e){const{path:i}=e,o=this.getAreaPoints(),s=t??this.getStyle(!1),a=this.getShapeFillBBox();applyShapeStyle15(e,{fill:s.fill,stroke:void 0,fillOpacity:s.fillOpacity,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},a),e.lineJoin=e.lineCap="round",i.clear(!0);for(const{x:r,y:n,moveTo:l,arc:c,radius:h=0,startAngle:d=0,endAngle:u=0}of o)c?i.arc(r,n,h,d,u):l?i.moveTo(r,n):i.lineTo(r,n);return i.closePath(),e.checkPathDirty(),s}}makeStylerParams(t,e){const{properties:i}=this,o=toHighlightString5(e??HighlightState4.None);return{marker:{fill:i.marker.fill,fillOpacity:i.marker.fillOpacity,size:i.marker.size,shape:i.marker.shape,stroke:i.marker.stroke,strokeOpacity:i.marker.strokeOpacity,strokeWidth:i.marker.strokeWidth,lineDash:i.marker.lineDash,lineDashOffset:i.marker.lineDashOffset},highlightState:o,highlighted:t,fill:i.fill,fillOpacity:i.fillOpacity,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset,seriesId:this.id,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,angleKey:i.angleKey,radiusKey:i.radiusKey}}getStyle(t,e){const{marker:i,fill:o,fillOpacity:s,lineDash:a,lineDashOffset:r,stroke:n,strokeOpacity:l,strokeWidth:c}=this.properties,{size:h,shape:d,fill:u="transparent",fillOpacity:p}=i,g=this.getStylerResult({},t,e);return g.marker??(g.marker={}),{fill:g.fill??o,fillOpacity:g.fillOpacity??s,lineDash:g.lineDash??a,lineDashOffset:g.lineDashOffset??r,stroke:g.stroke??n,strokeOpacity:g.strokeOpacity??l,strokeWidth:g.strokeWidth??c,marker:{enabled:g.marker.enabled??i.enabled,fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??p,shape:g.marker.shape??d,size:g.marker.size??h,lineDash:g.marker.lineDash??i.lineDash??a,lineDashOffset:g.marker.lineDashOffset??i.lineDashOffset??r,stroke:g.marker.stroke??i.stroke??n,strokeOpacity:g.marker.strokeOpacity??i.strokeOpacity??l,strokeWidth:g.marker.strokeWidth??i.strokeWidth??c}}}};RadarAreaSeries.className="RadarAreaSeries",RadarAreaSeries.type="radar-area";var import_ag_charts_community247=require("ag-charts-community"),import_ag_charts_core106=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs17,radarAreaSeriesThemeableOptionsDef}=import_ag_charts_community247._ModuleSupport,radarAreaSeriesOptionsDef={...commonSeriesOptionsDefs17,...radarAreaSeriesThemeableOptionsDef,type:(0,import_ag_charts_core106.required)((0,import_ag_charts_core106.constant)("radar-area")),angleKey:(0,import_ag_charts_core106.required)(import_ag_charts_core106.string),radiusKey:(0,import_ag_charts_core106.required)(import_ag_charts_core106.string),angleName:import_ag_charts_core106.string,radiusName:import_ag_charts_core106.string,legendItemName:import_ag_charts_core106.string},{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE4}}=import_ag_charts_community248._ModuleSupport,RadarAreaModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-area",moduleFactory:t=>new RadarAreaSeries(t),defaultAxes:[{type:POLAR_AXIS_TYPE4.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE4.RADIUS_NUMBER}],themeTemplate:RADAR_AREA_SERIES_THEME},RadarAreaSeriesModule={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,options:radarAreaSeriesOptionsDef,create:t=>new RadarAreaSeries(t)},import_ag_charts_community251=require("ag-charts-community"),import_ag_charts_community249=require("ag-charts-community"),{HighlightState:HighlightState5,PointerEvents:PointerEvents11,toHighlightString:toHighlightString6}=import_ag_charts_community249._ModuleSupport,RadarLineSeries=class extends RadarSeries{constructor(){super(...arguments),this.properties=new RadarSeriesProperties}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const t=this.getLineNode();if(!t)return;const e=this.getPathNodesStyle(),{strokeWidth:i,stroke:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,opacity:n}=e;t.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:PointerEvents11.None,opacity:n,stroke:o,strokeWidth:i,strokeOpacity:s,lineDash:a,lineDashOffset:r})}makeStylerParams(t,e){const{properties:i}=this,o=toHighlightString6(e??HighlightState5.None);return{marker:{fill:i.marker.fill,fillOpacity:i.marker.fillOpacity,size:i.marker.size,shape:i.marker.shape,stroke:i.marker.stroke,strokeOpacity:i.marker.strokeOpacity,strokeWidth:i.marker.strokeWidth,lineDash:i.marker.lineDash,lineDashOffset:i.marker.lineDashOffset},highlightState:o,highlighted:t,lineDash:i.lineDash,lineDashOffset:i.lineDashOffset,seriesId:this.id,stroke:i.stroke,strokeOpacity:i.strokeOpacity,strokeWidth:i.strokeWidth,angleKey:i.angleKey,radiusKey:i.radiusKey}}getStyle(t,e){const{marker:i,lineDash:o,lineDashOffset:s,stroke:a,strokeOpacity:r,strokeWidth:n}=this.properties,{size:l,shape:c,fill:h="transparent",fillOpacity:d}=i,u=this.getStylerResult({},t,e);return u.marker??(u.marker={}),{lineDash:u.lineDash??o,lineDashOffset:u.lineDashOffset??s,stroke:u.stroke??a,strokeOpacity:u.strokeOpacity??r,strokeWidth:u.strokeWidth??n,marker:{enabled:u.marker.enabled??i.enabled,fill:u.marker.fill??h,fillOpacity:u.marker.fillOpacity??d,shape:u.marker.shape??c,size:u.marker.size??l,lineDash:u.marker.lineDash??i.lineDash??o,lineDashOffset:u.marker.lineDashOffset??i.lineDashOffset??s,stroke:u.marker.stroke??i.stroke??a,strokeOpacity:u.marker.strokeOpacity??i.strokeOpacity??r,strokeWidth:u.marker.strokeWidth??i.strokeWidth??n}}}};RadarLineSeries.className="RadarLineSeries",RadarLineSeries.type="radar-line";var import_ag_charts_community250=require("ag-charts-community"),import_ag_charts_core107=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs18,radarLineSeriesThemeableOptionsDef}=import_ag_charts_community250._ModuleSupport,radarLineSeriesOptionsDef={...commonSeriesOptionsDefs18,...radarLineSeriesThemeableOptionsDef,type:(0,import_ag_charts_core107.required)((0,import_ag_charts_core107.constant)("radar-line")),angleKey:(0,import_ag_charts_core107.required)(import_ag_charts_core107.string),radiusKey:(0,import_ag_charts_core107.required)(import_ag_charts_core107.string),angleName:import_ag_charts_core107.string,radiusName:import_ag_charts_core107.string,legendItemName:import_ag_charts_core107.string},{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE5}=import_ag_charts_community251._ModuleSupport.ThemeConstants,RadarLineModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radar-line",moduleFactory:t=>new RadarLineSeries(t),defaultAxes:[{type:POLAR_AXIS_TYPE5.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE5.RADIUS_NUMBER}],themeTemplate:RADAR_LINE_SERIES_THEME},RadarLineSeriesModule={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,options:radarLineSeriesOptionsDef,create:t=>new RadarLineSeries(t)},import_ag_charts_community257=require("ag-charts-community"),import_ag_charts_community254=require("ag-charts-community"),import_ag_charts_core108=require("ag-charts-core"),import_ag_charts_community252=require("ag-charts-community"),{SeriesProperties:SeriesProperties11,makeSeriesTooltip:makeSeriesTooltip20,Property:Property79,Label:Label15}=import_ag_charts_community252._ModuleSupport,RadialBarSeriesProperties=class extends SeriesProperties11{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.label=new Label15,this.tooltip=makeSeriesTooltip20()}getStyle(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,cornerRadius:n}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r,cornerRadius:n,opacity:1}}};__decorateClass([Property79],RadialBarSeriesProperties.prototype,"angleKey",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"radiusKey",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"angleName",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"radiusName",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"legendItemName",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"fill",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"fillOpacity",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"stroke",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"lineDash",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"lineDashOffset",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"cornerRadius",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"styler",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"rotation",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"stackGroup",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"normalizedTo",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"label",2),__decorateClass([Property79],RadialBarSeriesProperties.prototype,"tooltip",2);var import_ag_charts_community253=require("ag-charts-community"),{SectorBox:SectorBox3,motion:motion9}=import_ag_charts_community253._ModuleSupport;function fixRadialBarAnimationStatus(t,e,i){if(i==="updated"){if(t.previousDatum==null||Number.isNaN(t.previousDatum.innerRadius)||Number.isNaN(t.previousDatum.outerRadius))return"added";if(Number.isNaN(e.innerRadius)||Number.isNaN(e.outerRadius))return"removed"}return i==="added"&&t.previousDatum!=null?"updated":i}function prepareRadialBarSeriesAnimationFunctions(t){return{toFn:(o,s,a)=>{let r,n,l,c,h;return a==="removed"?(r=t,n=t,l=s.innerRadius,c=s.outerRadius,h=new SectorBox3(r,n,l,c)):(r=s.startAngle,n=s.endAngle,l=Number.isNaN(s.innerRadius)?o.innerRadius:s.innerRadius,c=Number.isNaN(s.outerRadius)?o.outerRadius:s.outerRadius,h=s.clipSector),{startAngle:r,endAngle:n,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(o,s,a)=>{a=fixRadialBarAnimationStatus(o,s,a);let r,n,l,c,h;a==="removed"||a==="updated"?(r=o.startAngle,n=o.endAngle,l=o.innerRadius,c=o.outerRadius,h=o.clipSector):(r=t,n=t,l=s.innerRadius,c=s.outerRadius),h??(h=new SectorBox3(r,n,l,c));const d=motion9.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{startAngle:r,endAngle:n,innerRadius:l,outerRadius:c,clipSector:h,phase:d}}}}function resetRadialBarSelectionsFn(t,e){return{centerX:0,centerY:0,innerRadius:e.innerRadius,outerRadius:e.outerRadius,startAngle:e.startAngle,endAngle:e.endAngle,clipSector:e.clipSector}}var{DEFAULT_POLAR_DIRECTION_KEYS:DEFAULT_POLAR_DIRECTION_KEYS3,DEFAULT_POLAR_DIRECTION_NAMES:DEFAULT_POLAR_DIRECTION_NAMES3,ChartAxisDirection:ChartAxisDirection31,PolarAxis:PolarAxis3,diff:diff7,groupAccumulativeValueProperty:groupAccumulativeValueProperty3,keyProperty:keyProperty10,normaliseGroupTo:normaliseGroupTo2,valueProperty:valueProperty18,fixNumericExtent:fixNumericExtent10,resetLabelFn:resetLabelFn6,seriesLabelFadeInAnimation:seriesLabelFadeInAnimation8,seriesLabelFadeOutAnimation:seriesLabelFadeOutAnimation2,animationValidation:animationValidation9,angleBetween:angleBetween3,createDatumId:createDatumId18,CategoryScale:CategoryScale4,Sector:Sector5,SectorBox:SectorBox4,motion:motion10,isGradientFill:isGradientFill3,applyShapeStyle:applyShapeStyle16,updateLabelNode:updateLabelNode8,getItemStyles:getItemStyles4}=import_ag_charts_community254._ModuleSupport,RadialBarSeriesNodeEvent=class extends import_ag_charts_community254._ModuleSupport.SeriesNodeEvent{constructor(t,e,i,o){super(t,e,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},RadialBarSeries=class extends import_ag_charts_community254._ModuleSupport.PolarSeries{constructor(t){super({moduleCtx:t,categoryKey:"radiusValue",propertyKeys:DEFAULT_POLAR_DIRECTION_KEYS3,propertyNames:DEFAULT_POLAR_DIRECTION_NAMES3,canHaveAxes:!0,animationResetFns:{item:resetRadialBarSelectionsFn,label:resetLabelFn6}}),this.properties=new RadialBarSeriesProperties,this.NodeEvent=RadialBarSeriesNodeEvent,this.groupScale=new CategoryScale4,this.circleCache={r:0,cx:0,cy:0}}get hasData(){return this.getHasData("angleValue-raw")}nodeFactory(){return new Sector5}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];if(t===ChartAxisDirection31.Angle){const o=e.getDomain(this,"angleValue-end","value",i),s=[Math.min(o[0],0),Math.max(o[1],0)];return fixNumericExtent10(s)}else return e.getDomain(this,"radiusValue","key",i)}async processData(t){const{angleKey:e,radiusKey:i,normalizedTo:o}=this.properties,s=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),r=`${a}-trailing`,n=[];(0,import_ag_charts_core108.isDefined)(o)&&n.push(normaliseGroupTo2([a,r],Math.abs(o))),s&&(this.processedData&&n.push(diff7(this.id,this.processedData)),n.push(animationValidation9()));const l=this.visible?{}:{forceValue:0},c=this.axes[ChartAxisDirection31.Radius]?.scale.type,h=this.axes[ChartAxisDirection31.Angle]?.scale.type;await this.requestDataModel(t,this.data,{props:[keyProperty10(i,c,{id:"radiusValue"}),valueProperty18(e,h,{id:"angleValue-raw",invalidValue:null,...l}),...groupAccumulativeValueProperty3(e,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...groupAccumulativeValueProperty3(e,"trailing",{id:"angleValue-start",invalidValue:null,groupId:r,separateNegative:!0,...l},h),...n],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const t=this.radius,e=this.centerX,i=this.centerY,o=this.circleCache;return t===o.r&&e===o.cx&&i===o.cy?!1:(this.circleCache={r:t,cx:e,cy:i},!0)}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const t=this.axes[ChartAxisDirection31.Radius];return t instanceof PolarAxis3?this.radius*t.innerRadiusRatio:0}createNodeData(){const{processedData:t,dataModel:e}=this;if(!e||!t||t.type!=="grouped")return;const i=this.axes[ChartAxisDirection31.Angle],o=this.axes[ChartAxisDirection31.Radius],s=i?.scale,a=o?.scale;if(!s||!a)return;const r=e.resolveKeysById(this,"radiusValue",t),n=e.resolveColumnById(this,"angleValue-start",t),l=e.resolveColumnById(this,"angleValue-end",t),c=e.resolveColumnById(this,"angleValue-raw",t),h=e.resolveProcessedDataIndexById(this,"angleValue-range");let d=0;o instanceof RadiusCategoryAxis&&(d=o.groupPaddingInner);const{groupScale:u}=this,{index:p,visibleGroupCount:g}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);u.domain=Array.from({length:g}).map((L,A)=>String(A)),u.range=[0,Math.abs(a.bandwidth??0)],u.paddingInner=g>1?d:0;const y=u.bandwidth>=1?u.bandwidth:u.rawBandwidth,f=i.isReversed(),x=o.isReversed(),b=x?this.radius:this.getAxisInnerRadius(),S=(x?this.getAxisInnerRadius():this.radius)+b,v=this.getSeriesDomain(ChartAxisDirection31.Angle),{angleKey:M,radiusKey:D,angleName:k,radiusName:_,legendItemName:T,label:w}=this.properties,R=(L,A,P,z)=>{const B=this.getLabelText(A,L,M,"angle",v,w,{value:A,datum:L,angleKey:M,radiusKey:D,angleName:k,radiusName:_,legendItemName:T});if(B)return{x:P,y:z,text:B,textAlign:"center",textBaseline:"middle"}},F=[],O=getItemStyles4((L,A,P)=>getItemStyle(this,L,A,P)),E={itemId:D,nodeData:F,labelData:F,styles:O};if(!this.visible)return E;const{dataSources:I}=t,C=I.get(this.id)?.data??[];for(const{datumIndex:L,group:A}of e.forEachGroupDatum(this,t)){const P=C[L],z=r[L];if(z==null)return;const B=c[L],V=n[L],W=l[L],H=B>=0&&!Object.is(B,-0),G=A.aggregation[h][H?1:0],K=H===f;let U=s.convert(V,{clamp:!0}),Y=s.convert(W,{clamp:!0}),$=s.convert(0,{clamp:!0}),X=s.convert(G,{clamp:!0});K&&([$,X]=[X,$],[U,Y]=[Y,U]);const q=S-a.convert(z)+u.convert(String(p)),it=q+y,J=(q+it)/2,j=U+angleBetween3(U,Y)/2,tt=Math.cos(j)*J,Q=Math.sin(j)*J,ot=this.properties.label.enabled?R(P,B,tt,Q):void 0,et=new SectorBox4(U,Y,q,it);F.push({series:this,datum:P,datumIndex:L,point:{x:tt,y:Q,size:0},midPoint:{x:tt,y:Q},label:ot,angleValue:B,radiusValue:z,innerRadius:q,outerRadius:it,startAngle:$,endAngle:X,clipSector:et,reversed:K,index:L})}return E}update({seriesRect:t}){const e=this.checkResize(t);this.maybeRefreshNodeData(),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),this.updateSectorSelection(this.itemSelection,!1),this.updateSectorSelection(this.highlightSelection,!0),this.updateLabels(),e&&this.animationState.transition("resize"),this.animationState.transition("update")}updateSectorSelection(t,e){let i=[];const o=this.ctx.highlightManager?.getActiveHighlight();e?o?.datum&&o.series===this&&i.push(o):i=this.nodeData;const{contextNodeData:s}=this;if(!s)return;const a=this.ctx.highlightManager.getActiveHighlight(),r=this.getShapeFillBBox(),n=this.hasItemStylers();t.update(i,void 0,l=>this.getDatumId(l)).each((l,c)=>{const h=readDatum(c);if(h==null)return;if(n){const y=this.getHighlightState(o,e,c.datumIndex);c.style=getItemStyle(this,c,e,y)}const d=c.style??s.styles[this.getHighlightState(a,e,c.datumIndex)],u=d.cornerRadius,p=d.fill,g=import_ag_charts_community254._ModuleSupport.isGradientFill(p)&&p.bounds!=="item"?{centerX:0,centerY:0}:void 0;applyShapeStyle16(l,d,r,g),l.lineJoin="round",l.inset=l.stroke==null?0:l.strokeWidth/2,l.startInnerCornerRadius=h.reversed?u:0,l.startOuterCornerRadius=h.reversed?u:0,l.endInnerCornerRadius=h.reversed?0:u,l.endOuterCornerRadius=h.reversed?0:u,e&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.clipSector=c.clipSector,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius)})}updateLabels(){const{properties:t}=this,e=this.ctx.highlightManager?.getActiveHighlight();this.labelSelection.update(this.nodeData).each((i,o)=>{updateLabelNode8(this,i,t,t.label,o.label,!1,e),i.fillOpacity=this.getHighlightStyle(!1,o.datumIndex).opacity??1})}getBarTransitionFunctions(){const t=this.axes[ChartAxisDirection31.Angle]?.scale;let e=0;if(!t)return prepareRadialBarSeriesAnimationFunctions(e);const i=Math.min(t.domain[0],t.domain[1]),o=Math.max(t.domain[0],t.domain[1]);return i<=0&&o>=0&&(e=t.convert(0)),prepareRadialBarSeriesAnimationFunctions(e)}animateEmptyUpdateReady(){const{labelSelection:t}=this,e=this.getBarTransitionFunctions();motion10.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],e),seriesLabelFadeInAnimation8(this,"labels",this.ctx.animationManager,t)}animateClearingUpdateEmpty(){const{itemSelection:t}=this,{animationManager:e}=this.ctx,i=this.getBarTransitionFunctions();motion10.fromToMotion(this.id,"datums",e,[t],i),seriesLabelFadeOutAnimation2(this,"labels",e,this.labelSelection)}getTooltipContent(t){const{id:e,dataModel:i,processedData:o,axes:s,properties:a}=this,{angleKey:r,angleName:n,radiusKey:l,radiusName:c,legendItemName:h,tooltip:d}=a,u=s[ChartAxisDirection31.Angle],p=s[ChartAxisDirection31.Radius],g=this.nodeData?.[t];if(!i||!o||!u||!p||!g)return;const y=o.dataSources.get(this.id)?.data[t],f=i.resolveKeysById(this,"radiusValue",o)[t],x=i.resolveColumnById(this,"angleValue-raw",o)[t];if(f==null)return;const b=getItemStyle(this,g,!1);return this.formatTooltipWithContext(d,{heading:this.getAxisValueText(p,"tooltip",f,y,l,void 0),symbol:this.legendItemSymbol(),data:[{label:n,fallbackLabel:r,value:this.getAxisValueText(u,"tooltip",x,y,r,void 0)}]},{seriesId:e,datum:y,title:n,angleKey:r,angleName:n,radiusKey:l,radiusName:c,legendItemName:h,...b})}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.itemSelection.nodes())}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:r}=getStyle(this,!1,!1,import_ag_charts_community254._ModuleSupport.HighlightState.None),n={fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:r};return isGradientFill3(n.fill)&&(n.fill={...n.fill,gradient:"linear",rotation:0,reverse:!1}),{marker:n}}getLegendData(t){if(t!=="category")return[];const{id:e,visible:i}=this,{angleKey:o,angleName:s,legendItemName:a,showInLegend:r}=this.properties;return[{legendType:"category",id:e,itemId:o,seriesId:e,enabled:i,label:{text:a??s??o},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!r}]}getDatumId(t){return createDatumId18(t.radiusValue)}computeLabelsBBox(){return null}getStackId(){return`radialBar-stack-${this.seriesGrouping?.groupIndex??this.id}-xValues`}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};RadialBarSeries.className="RadialBarSeries",RadialBarSeries.type="radial-bar";var import_ag_charts_community255=require("ag-charts-community"),import_ag_charts_core109=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs19,radialBarSeriesThemeableOptionsDef}=import_ag_charts_community255._ModuleSupport,radialBarSeriesOptionsDef={...commonSeriesOptionsDefs19,...radialBarSeriesThemeableOptionsDef,type:(0,import_ag_charts_core109.required)((0,import_ag_charts_core109.constant)("radial-bar")),angleKey:(0,import_ag_charts_core109.required)(import_ag_charts_core109.string),radiusKey:(0,import_ag_charts_core109.required)(import_ag_charts_core109.string),angleName:import_ag_charts_core109.string,radiusName:import_ag_charts_core109.string,legendItemName:import_ag_charts_core109.string,grouped:import_ag_charts_core109.boolean,stacked:import_ag_charts_core109.boolean,stackGroup:import_ag_charts_core109.string,normalizedTo:import_ag_charts_core109.number},import_ag_charts_community256=require("ag-charts-community"),{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE6},FILL_GRADIENT_CONIC_SERIES_DEFAULTS,FILL_IMAGE_DEFAULTS:FILL_IMAGE_DEFAULTS5,FILL_PATTERN_DEFAULTS:FILL_PATTERN_DEFAULTS3}=import_ag_charts_community256._ModuleSupport,RADIAL_BAR_SERIES_THEME={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",FILL_GRADIENT_CONIC_SERIES_DEFAULTS],["image",FILL_IMAGE_DEFAULTS5],["pattern",FILL_PATTERN_DEFAULTS3]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...import_ag_charts_community256._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},highlight:import_ag_charts_community256._ModuleSupport.multiSeriesHighlightStyle()},axes:{[POLAR_AXIS_TYPE6.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE7}=import_ag_charts_community257._ModuleSupport.ThemeConstants,RadialBarModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-bar",moduleFactory:t=>new RadialBarSeries(t),defaultAxes:[{type:POLAR_AXIS_TYPE7.ANGLE_NUMBER},{type:POLAR_AXIS_TYPE7.RADIUS_CATEGORY}],themeTemplate:RADIAL_BAR_SERIES_THEME,stackable:!0,groupable:!0},RadialBarSeriesModule={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,options:radialBarSeriesOptionsDef,create:t=>new RadialBarSeries(t)},import_ag_charts_community262=require("ag-charts-community"),import_ag_charts_community259=require("ag-charts-community"),import_ag_charts_community258=require("ag-charts-community"),{Property:Property80}=import_ag_charts_community258._ModuleSupport,RadialColumnSeriesProperties=class extends RadialColumnSeriesBaseProperties{};__decorateClass([Property80],RadialColumnSeriesProperties.prototype,"columnWidthRatio",2),__decorateClass([Property80],RadialColumnSeriesProperties.prototype,"maxColumnWidthRatio",2);var{ChartAxisDirection:ChartAxisDirection32,PolarAxis:PolarAxis4,RadialColumnShape,getRadialColumnWidth}=import_ag_charts_community259._ModuleSupport,RadialColumnSeries=class extends RadialColumnSeriesBase{constructor(t){super(t,{animationResetFns:{item:resetRadialColumnSelectionFn}}),this.properties=new RadialColumnSeriesProperties}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new RadialColumnShape}getColumnTransitionFunctions(){const t=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return prepareRadialColumnAnimationFunctions(t)}isRadiusAxisCircle(){const t=this.axes[ChartAxisDirection32.Radius];return t instanceof PolarAxis4?t.shape==="circle":!1}updateItemPath(t,e,i){t.isBeveled=this.isRadiusAxisCircle(),t.isRadiusAxisReversed=this.isRadiusAxisReversed(),i&&(t.innerRadius=e.innerRadius,t.outerRadius=e.outerRadius,t.startAngle=e.startAngle,t.endAngle=e.endAngle,t.columnWidth=e.columnWidth,t.axisInnerRadius=e.axisInnerRadius,t.axisOuterRadius=e.axisOuterRadius)}getColumnWidth(t,e){const{columnWidthRatio:i=.5,maxColumnWidthRatio:o=.5}=this.properties;return getRadialColumnWidth(t,e,this.radius,i,o)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};RadialColumnSeries.className="RadialColumnSeries",RadialColumnSeries.type="radial-column";var import_ag_charts_community260=require("ag-charts-community"),import_ag_charts_core110=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs20,radialColumnSeriesThemeableOptionsDef}=import_ag_charts_community260._ModuleSupport,radialColumnSeriesOptionsDef={...commonSeriesOptionsDefs20,...radialColumnSeriesThemeableOptionsDef,type:(0,import_ag_charts_core110.required)((0,import_ag_charts_core110.constant)("radial-column")),angleKey:(0,import_ag_charts_core110.required)(import_ag_charts_core110.string),radiusKey:(0,import_ag_charts_core110.required)(import_ag_charts_core110.string),angleName:import_ag_charts_core110.string,radiusName:import_ag_charts_core110.string,legendItemName:import_ag_charts_core110.string,grouped:import_ag_charts_core110.boolean,stacked:import_ag_charts_core110.boolean,stackGroup:import_ag_charts_core110.string,normalizedTo:import_ag_charts_core110.number},import_ag_charts_community261=require("ag-charts-community"),{ThemeConstants:{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE8,POLAR_AXIS_SHAPE:POLAR_AXIS_SHAPE2},FILL_GRADIENT_RADIAL_SERIES_DEFAULTS:FILL_GRADIENT_RADIAL_SERIES_DEFAULTS2,FILL_IMAGE_DEFAULTS:FILL_IMAGE_DEFAULTS6,FILL_PATTERN_DEFAULTS:FILL_PATTERN_DEFAULTS4}=import_ag_charts_community261._ModuleSupport,RADIAL_COLUMN_SERIES_THEME={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",FILL_GRADIENT_RADIAL_SERIES_DEFAULTS2],["image",FILL_IMAGE_DEFAULTS6],["pattern",FILL_PATTERN_DEFAULTS4]]},stroke:{$palette:"stroke"},columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...import_ag_charts_community261._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:import_ag_charts_community261._ModuleSupport.multiSeriesHighlightStyle()},axes:{[POLAR_AXIS_TYPE8.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:POLAR_AXIS_SHAPE2.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[POLAR_AXIS_TYPE8.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:POLAR_AXIS_SHAPE2.CIRCLE},innerRadiusRatio:.5}}},{POLAR_AXIS_TYPE:POLAR_AXIS_TYPE9}=import_ag_charts_community262._ModuleSupport.ThemeConstants,RadialColumnModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radial-column",moduleFactory:t=>new RadialColumnSeries(t),defaultAxes:[{type:POLAR_AXIS_TYPE9.ANGLE_CATEGORY},{type:POLAR_AXIS_TYPE9.RADIUS_NUMBER}],themeTemplate:RADIAL_COLUMN_SERIES_THEME,stackable:!0,groupable:!0},RadialColumnSeriesModule={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,options:radialColumnSeriesOptionsDef,create:t=>new RadialColumnSeries(t)},import_ag_charts_community267=require("ag-charts-community"),import_ag_charts_community266=require("ag-charts-community"),import_ag_charts_core112=require("ag-charts-core"),import_ag_charts_community263=require("ag-charts-community"),{SvgPath,Rotatable,Translatable,Scalable:Scalable2}=import_ag_charts_community263._ModuleSupport,RadialGaugeNeedle=class extends Rotatable(Scalable2(Translatable(SvgPath))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};RadialGaugeNeedle.defaultPathData="M0.50245 0.53745C0.481767 0.53745 0.465 0.520683 0.465 0.5C0.465 0.479317 0.481767 0.46255 0.50245 0.46255L1 0.500012L0.50245 0.53745Z";var import_ag_charts_community264=require("ag-charts-community"),{getColorStops:getColorStops2,normalizeAngle360:normalizeAngle3606,normalizeAngle360Inclusive:normalizeAngle360Inclusive2,toDegrees}=import_ag_charts_community264._ModuleSupport,{BaseProperties:BaseProperties28,makeSeriesTooltip:makeSeriesTooltip21,SeriesProperties:SeriesProperties12,PropertiesArray:PropertiesArray8,AxisLabel:AxisLabel6,Property:Property81,Label:Label16}=import_ag_charts_community264._ModuleSupport,RadialGaugeDefaultTargetLabelProperties=class extends Label16{};__decorateClass([Property81],RadialGaugeDefaultTargetLabelProperties.prototype,"spacing",2);var RadialGaugeTargetProperties=class extends BaseProperties28{constructor(){super(...arguments),this.label=new RadialGaugeDefaultTargetLabelProperties}getStyle(){const{fill:t="black",fillOpacity:e=1,stroke:i="black",strokeWidth:o=0,strokeOpacity:s=1,lineDash:a=[0],lineDashOffset:r=0}=this;return{fill:t,fillOpacity:e,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:r}}};__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"text",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"value",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"shape",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"placement",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"spacing",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"size",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"rotation",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"fill",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"fillOpacity",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"stroke",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"strokeWidth",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"strokeOpacity",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"lineDash",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"lineDashOffset",2),__decorateClass([Property81],RadialGaugeTargetProperties.prototype,"label",2);var RadialGaugeBarProperties=class extends BaseProperties28{constructor(){super(...arguments),this.enabled=!0,this.fills=new PropertiesArray8(import_ag_charts_community264._ModuleSupport.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(t,e){const{enabled:i,fill:o,fills:s,fillMode:a,fillOpacity:r,stroke:n,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}=this;return{fill:i?o??createConicGradient(s,a,t,e):"none",fillOpacity:r,stroke:n,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:d}}};__decorateClass([Property81],RadialGaugeBarProperties.prototype,"enabled",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"fills",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"fillMode",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"fill",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"fillOpacity",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"stroke",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"strokeWidth",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"strokeOpacity",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"lineDash",2),__decorateClass([Property81],RadialGaugeBarProperties.prototype,"lineDashOffset",2);var RadialGaugeScaleIntervalProperties=class extends BaseProperties28{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};__decorateClass([Property81],RadialGaugeScaleIntervalProperties.prototype,"values",2),__decorateClass([Property81],RadialGaugeScaleIntervalProperties.prototype,"step",2),__decorateClass([Property81],RadialGaugeScaleIntervalProperties.prototype,"minSpacing",2),__decorateClass([Property81],RadialGaugeScaleIntervalProperties.prototype,"maxSpacing",2);var RadialGaugeScaleLabelProperties=class extends AxisLabel6{},RadialGaugeScaleProperties=class extends BaseProperties28{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new PropertiesArray8(import_ag_charts_community264._ModuleSupport.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new RadialGaugeScaleIntervalProperties,this.label=new RadialGaugeScaleLabelProperties}getStyle(t,e,i){const{fill:o,fills:s,defaultFill:a,fillMode:r,fillOpacity:n,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}=this;return{fill:o??(t&&s.length===0?a:void 0)??createConicGradient(s,r,e,i),fillOpacity:n,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:d,lineDashOffset:u}}};__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"min",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"max",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"fills",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"fillMode",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"fill",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"fillOpacity",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"stroke",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"strokeWidth",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"strokeOpacity",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"lineDash",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"lineDashOffset",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"defaultFill",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"interval",2),__decorateClass([Property81],RadialGaugeScaleProperties.prototype,"label",2);var RadialGaugeNeedleProperties=class extends BaseProperties28{constructor(){super(...arguments),this.enabled=!0,this.spacing=0,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"enabled",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"radiusRatio",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"spacing",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"fill",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"fillOpacity",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"stroke",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"strokeWidth",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"strokeOpacity",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"lineDash",2),__decorateClass([Property81],RadialGaugeNeedleProperties.prototype,"lineDashOffset",2);var RadialGaugeLabelProperties=class extends AutoSizedLabel{};__decorateClass([Property81],RadialGaugeLabelProperties.prototype,"text",2);var RadialGaugeSecondaryLabelProperties=class extends AutoSizedSecondaryLabel{};__decorateClass([Property81],RadialGaugeSecondaryLabelProperties.prototype,"text",2);var RadialGaugeSeriesProperties=class extends SeriesProperties12{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new GaugeSegmentationProperties,this.defaultColorRange=[],this.targets=new PropertiesArray8(RadialGaugeTargetProperties),this.defaultTarget=new RadialGaugeTargetProperties,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new RadialGaugeScaleProperties,this.bar=new RadialGaugeBarProperties,this.needle=new RadialGaugeNeedleProperties,this.label=new RadialGaugeLabelProperties,this.secondaryLabel=new RadialGaugeSecondaryLabelProperties,this.tooltip=makeSeriesTooltip21()}};__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"value",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"startAngle",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"endAngle",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"segmentation",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"defaultColorRange",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"targets",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"defaultTarget",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"outerRadiusRatio",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"innerRadiusRatio",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"outerRadius",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"innerRadius",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"cornerRadius",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"cornerMode",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"spacing",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"scale",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"bar",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"needle",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"label",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"secondaryLabel",2),__decorateClass([Property81],RadialGaugeSeriesProperties.prototype,"tooltip",2);function createConicGradient(t,e,i,o){const{domain:s,range:a}=o,[r,n]=a,l=normalizeAngle3606((r+n)/2+Math.PI),c=normalizeAngle360Inclusive2(n-r);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:getColorStops2(t,i,s,e).map(({color:d,stop:u})=>(u=Math.min(Math.max(u,0),1),u=(r+c*u-l)/(2*Math.PI),u=(u%1+1)%1,{stop:u,color:d})),bounds:"series",rotation:toDegrees(l)+90}}var import_ag_charts_community265=require("ag-charts-community"),import_ag_charts_core111=require("ag-charts-core"),{SectorBox:SectorBox5}=import_ag_charts_community265._ModuleSupport;function computeClipSector(t){const{startAngle:e,endAngle:i,clipStartAngle:o,clipEndAngle:s,innerRadius:a,outerRadius:r}=t;if(!(o==null||s==null))return new SectorBox5(Math.max(o,e),Math.min(s,i),a,r)}function clipSectorVisibility(t,e,i){return Math.max(t,i.startAngle)<=Math.min(e,i.endAngle)}function hasClipSector(t){return t.clipStartAngle!=null&&t.clipEndAngle!=null}function datumClipSector(t,e){const{clipStartAngle:i,clipEndAngle:o,innerRadius:s,outerRadius:a}=t;return new SectorBox5(i,e?i:o,s,a)}function prepareRadialGaugeSeriesAnimationFunctions(t,e){const i=t?"initial":"update";return{node:{fromFn(a,r){const n=a.previousDatum;let{startAngle:l,endAngle:c}=n??r;const h=n!=null&&hasClipSector(n)?datumClipSector(n,t):void 0,d=hasClipSector(r)?datumClipSector(r,t):void 0;let u;return h!=null&&d!=null?u=h:h==null&&d!=null?(u=d,l=r.startAngle,c=r.endAngle):h!=null&&d==null?(u=void 0,l=r.startAngle,c=r.endAngle):t&&(c=l),{startAngle:l,endAngle:c,clipSector:u,phase:i}},toFn(a,r){const{startAngle:n,endAngle:l}=r;let c;return hasClipSector(r)&&(c=datumClipSector(r,!1)),{startAngle:n,endAngle:l,clipSector:c}},applyFn(a,r){const{startAngle:n,endAngle:l}=r;let{clipSector:c}=r;c!=null&&(c=new SectorBox5(Math.max(n,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||clipSectorVisibility(n,l,c);a.startAngle=n,a.endAngle=l,a.clipSector=c,a.visible=h}},needle:{fromFn(a){let{angle:r}=a.previousDatum??a.datum;return t&&(r=e),{rotation:r,phase:i}},toFn(a,r){const{angle:n}=r;return{rotation:n}}}}}function resetRadialGaugeSeriesResetSectorFunction(t,e){const{startAngle:i,endAngle:o}=e,s=computeClipSector(e),a=s==null||clipSectorVisibility(i,o,s);return{startAngle:i,endAngle:o,clipSector:s,visible:a}}function resetRadialGaugeSeriesResetNeedleFunction(t,e){const{angle:i}=e;return{rotation:i}}var verticalAlignFactors3={top:0,middle:.5,bottom:1};function formatRadialGaugeLabels(t,e,i,o,s,a){const{padding:r,textAlign:n,verticalAlign:l}=o;let c,h;if(i.each((v,M)=>{M.label==="primary"?c=M:M.label==="secondary"&&(h=M)}),c==null)return;const d=getLabelText(t.id,e,c,a?.label);if(d==null)return;const u=h==null?void 0:getLabelText(t.id,e,h,a?.secondaryLabel),p={padding:r},g=n==="center"?2:1,y=l==="middle"?2:1,f=v=>({width:Math.sqrt(Math.max(s**2-(v/y)**2,0))*g,height:Math.min(v,y*s),meta:null});let x,b,m;if(h!=null&&u!=null){const v=formatStackedLabels((0,import_ag_charts_core111.toPlainText)(d),c,(0,import_ag_charts_core111.toPlainText)(u),h,p,f);x=v?.label,b=v?.secondaryLabel,m=v?.height??0}else{const v=formatSingleLabel((0,import_ag_charts_core111.toPlainText)(d),c,p,f);x=v?.[0],b=void 0,m=v?.[0].height??0}const S=m*verticalAlignFactors3[l];i.each((v,M)=>{let D;if(M.label==="primary"?D=x:M.label==="secondary"&&(D=b),D==null){v.visible=!1;return}v.visible=!0,v.text=D.text,v.fontSize=D.fontSize,v.lineHeight=D.lineHeight,v.textAlign=n,v.textBaseline="middle";const k=M.label==="primary"?D.height/2:m-D.height/2;v.y=M.centerY+k-S,v.x=M.centerX})}var{fromToMotion:fromToMotion5,resetMotion:resetMotion4,SeriesNodePickMode:SeriesNodePickMode15,StateMachine:StateMachine15,createDatumId:createDatumId19,normalizeAngle360:normalizeAngle3607,normalizeAngle360Inclusive:normalizeAngle360Inclusive3,isBetweenAngles:isBetweenAngles2,sectorBox,toRadians:toRadians5,BBox:BBox24,Group:Group19,PointerEvents:PointerEvents12,Selection:Selection16,Sector:Sector6,SectorBox:SectorBox6,Text:Text9,Marker:Marker6,tickFormat:tickFormat2,applyShapeStyle:applyShapeStyle17,mergeDefaults:mergeDefaults19}=import_ag_charts_community266._ModuleSupport,targetPlacementRotation={inside:90,middle:0,outside:-90},outsideLabelPlacements=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],insideLabelPlacements=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],RadialGaugeSeries=class extends import_ag_charts_community266._ModuleSupport.Series{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode15.EXACT_SHAPE_MATCH,SeriesNodePickMode15.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new RadialGaugeSeriesProperties,this.scale=new LinearAngleScale,this.scaleGroup=this.contentGroup.appendChild(new Group19({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new Group19({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new Group19({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new Group19({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new Group19({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Group19({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new Group19({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new Group19({name:"tickGroup"})),this.scaleSelection=Selection16.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Selection16.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=Selection16.select(this.itemNeedleGroup,RadialGaugeNeedle),this.targetSelection=Selection16.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Selection16.select(this.itemTargetLabelGroup,Text9),this.labelSelection=Selection16.select(this.itemLabelGroup,Text9),this.highlightTargetSelection=Selection16.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Selection16.select(this.tickGroup,import_ag_charts_community266._ModuleSupport.TransformableText),this.datumUnion=new DatumUnion,this.animationState=new StateMachine15("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=PointerEvents12.None,this.tickGroup.pointerEvents=PointerEvents12.None,this.itemNeedleGroup.pointerEvents=PointerEvents12.None,this.itemLabelGroup.pointerEvents=PointerEvents12.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new Sector6}markerFactory(){const t=new Marker6;return t.size=1,t}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(t){const{min:e,max:i}=this.properties.scale;return formatLabel(t,{min:e,max:i})}layoutScale(){const{scale:t,properties:e}=this,{seriesRectWidth:i,seriesRectHeight:o}=this.nodeDataDependencies,{scale:s,outerRadius:a}=this.properties,{min:r,max:n,label:l,interval:c}=s,h=toRadians5(e.startAngle-90),d=toRadians5(e.endAngle-90),p=normalizeAngle360Inclusive3(d-h)>Math.PI,g=p||isBetweenAngles2(1.5*Math.PI,h,d),y=p||isBetweenAngles2(0*Math.PI,h,d),f=p||isBetweenAngles2(.5*Math.PI,h,d),x=p||isBetweenAngles2(1*Math.PI,h,d);let b;x&&!y?b="right":!x&&y?b="left":b="center";let m;g&&!f?m="bottom":!g&&f?m="top":m="middle";const S=sectorBox({startAngle:h,endAngle:d,innerRadius:0,outerRadius:.5}),v=-(S.x+S.width/2)*2,M=-(S.y+S.height/2)*2,D=Math.min(i/S.width,o/S.height);t.domain=[r,n],t.range=[h,d],t.arcLength=D/2;const{maxSpacing:k,minSpacing:_}=c,{arcLength:T}=t,w=k?Math.floor(T/k):1,R=_?Math.floor(T/_):1/0,F=Math.floor(4/Math.PI*Math.abs(t.range[0]-t.range[1])),O=Math.max(w,Math.min(R,F)),E=c.values??t.ticks({nice:!1,interval:c.step,minTickCount:w,maxTickCount:R,tickCount:O})?.ticks??[],I=tickFormat2(E,typeof l.format=="string"?l.format:void 0),C=(0,import_ag_charts_core112.cachedTextMeasurer)(l),L=E.map((W,H)=>{let G;if(l.formatter&&(G=formatWithContext(this.ctx,l.formatter,{value:W,index:H,domain:t.domain,boundSeries:void 0})),G??(G=I?.(W)),G==null)return;const{width:K,height:U}=(0,import_ag_charts_core112.isArray)(G)?(0,import_ag_charts_core112.measureTextSegments)(G,l):C.measureLines(G);return{index:H,value:W,text:G,width:K,height:U}}).filter(W=>W!=null),A=L.reduce((W,H)=>Math.max(W,H.width),0),P=L.reduce((W,H)=>Math.max(W,H.height),0),z=l.enabled?Math.max(A,P)+l.spacing:0,B=Math.max(.5*D-z,0),V=a??B;return this.centerX=i/2+v*V,this.centerY=o/2+M*V,this.radius=V,this.textAlign=b,this.verticalAlign=m,L}getShapeFillBBox(){const{centerX:t,centerY:e,radius:i}=this,o=new BBox24(t-i,e-i,2*i,2*i);return{series:o,axis:o}}getTargets(){const{properties:t}=this,e=t.defaultTarget;return Array.from(t.targets).map(i=>{const{text:o=e.text,value:s=e.value??0,shape:a=e.shape??"triangle",rotation:r=e.rotation??0,placement:n=e.placement??"middle",spacing:l=e.spacing??0,size:c=e.size??0}=i,{enabled:h=e.label.enabled,color:d=e.label.color??"black",fontStyle:u=e.label.fontStyle??"normal",fontWeight:p=e.label.fontWeight??"normal",fontSize:g=e.label.fontSize,fontFamily:y=e.label.fontFamily,spacing:f=e.label.spacing??0}=i.label;return{text:o,value:s,shape:a,placement:n,spacing:l,size:c,rotation:r,label:{enabled:h,color:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:y,spacing:f},style:i.getStyle()}})}getTargetRadius(t){const{radius:e,properties:i}=this,{innerRadiusRatio:o,outerRadiusRatio:s}=i,{placement:a,spacing:r,size:n}=t,l=e*s,c=e*o;switch(a){case"inside":return Math.max(c-r-n/2,0);case"outside":return l+r+n/2;default:return(c+l)/2}}getTargetLabel(t){const{scale:e}=this,{value:i,size:o,placement:s,label:a}=t,{spacing:r,color:n,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d}=a,u=void 0,p=e.convert(i),g=Math.trunc(normalizeAngle3607(p)/(Math.PI/2)),y=o/2+r;let f,x,b,m;switch(s){case"outside":({textAlign:f,textBaseline:x}=outsideLabelPlacements[g]),b=y*Math.cos(p),m=y*Math.sin(p);break;case"inside":({textAlign:f,textBaseline:x}=insideLabelPlacements[g]),b=-y*Math.cos(p),m=-y*Math.sin(p);break;default:f="center",x="bottom",b=0,m=-y;break}return{offsetX:b,offsetY:m,fill:n,textAlign:f,textBaseline:x,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:d,lineHeight:u}}createNodeData(){const t=this.layoutScale(),{id:e,scale:i,properties:o,radius:s,centerX:a,centerY:r}=this,{value:n,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:d,cornerMode:u,needle:p,bar:g,scale:y,label:f,secondaryLabel:x}=o,{outerRadius:b=s*c,innerRadius:m=s*l,defaultColorRange:S}=o,v=this.getTargets(),M=[],D=[],k=[],_=[],T=[],w=u==="item",R=i.convert(i.domain[0]),F=i.convert(n),O=Math.ceil(normalizeAngle360Inclusive3(F-R)*s);let E=h.enabled?h.interval.getSegments(i,O):void 0;const I=g.getStyle(S,i),C=y.getStyle(g.enabled,S,i);if(E==null&&w){const L=Math.min(...i.domain),A=Math.max(...i.domain),P={value:n,segmentStart:L,segmentEnd:A},B=Math.min(d,(b-m)/2)/((m+b)/2);M.push({series:this,itemId:"value",datum:P,datumIndex:{type:0},type:0,centerX:a,centerY:r,outerRadius:b,innerRadius:m,startAngle:R-B,endAngle:F+B,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:I}),T.push({series:this,itemId:"scale",datum:P,datumIndex:{type:0},type:0,centerX:a,centerY:r,outerRadius:b,innerRadius:m,startAngle:i.range[0]-B,endAngle:i.range[1]+B,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:d,endCornerRadius:d,style:C})}else{E??(E=i.domain);for(let L=0;Lthis.formatLabel(K.value)}=f;_.push({label:"primary",centerX:a,centerY:r,text:L,value:n,fill:A,fontSize:P,minimumFontSize:z,fontStyle:B,fontWeight:V,fontFamily:W,lineHeight:H,formatter:G})}if(!p.enabled&&x.enabled){const{text:L,color:A,fontSize:P,minimumFontSize:z,fontStyle:B,fontWeight:V,fontFamily:W,lineHeight:H,formatter:G}=x;_.push({label:"secondary",centerX:a,centerY:r,text:L,value:n,fill:A,fontSize:P,minimumFontSize:z,fontStyle:B,fontWeight:V,fontFamily:W,lineHeight:H,formatter:G})}if(p.enabled){let L=p.radiusRatio==null?m:s*p.radiusRatio;L=Math.max(L-p.spacing,0);const A=i.convert(n);k.push({centerX:a,centerY:r,radius:L,angle:A,series:this})}for(let L=0;LMath.max(...i.domain))continue;const H=this.getTargetRadius(A),G=i.convert(P),K=toRadians5(A.rotation+targetPlacementRotation[A.placement]);D.push({series:this,itemId:`target-${L}`,midPoint:{x:H*Math.cos(G)+a,y:H*Math.sin(G)+r},datum:{value:P},datumIndex:{type:1,index:L},type:1,value:P,text:z,centerX:a,centerY:r,shape:V,radius:H,angle:G,rotation:K,size:B,label:this.getTargetLabel(A),style:W})}return{itemId:e,nodeData:M,needleData:k,targetData:D,labelData:_,scaleData:T,tickData:t}}updateSelections(t){(this.nodeDataRefresh||t)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(t){if(t!=null&&t.series===this&&t.type===1)return t}update({seriesRect:t}){const{datumSelection:e,labelSelection:i,needleSelection:o,targetSelection:s,targetLabelSelection:a,scaleSelection:r,highlightTargetSelection:n,tickSelection:l}=this,c=this.checkResize(t);this.updateSelections(c),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();const h=this.contextNodeData?.nodeData??[],d=this.contextNodeData?.labelData??[],u=this.contextNodeData?.needleData??[],p=this.contextNodeData?.targetData??[],g=this.contextNodeData?.scaleData??[],y=this.contextNodeData?.tickData??[],f=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:g,scaleSelection:r}),this.updateScaleNodes({scaleSelection:r}),this.needleSelection=this.updateNeedleSelection({needleData:u,needleSelection:o}),this.updateNeedleNodes({needleSelection:o}),this.targetSelection=this.updateTargetSelection({targetData:p,targetSelection:s}),this.updateTargetStyles({targetSelection:s,isHighlight:!1}),this.updateTargetNodes({targetSelection:s}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:p,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:e}),this.updateDatumNodes({datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:d,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:f==null?[]:[f],targetSelection:n}),this.updateTargetStyles({targetSelection:n,isHighlight:!0}),this.updateTargetNodes({targetSelection:n}),this.tickSelection=this.updateTickSelection({tickData:y,tickSelection:l}),this.updateTickNodes({tickSelection:l}),c&&this.animationState.transition("resize"),this.animationState.transition("update")}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId19(t.nodeData.length,e.itemId))}updateDatumNodes(t){const{datumSelection:e}=t,{ctx:i,properties:o}=this,{segmentation:s}=o,a=s.spacing??0,r=i.animationManager.isSkipped(),n=this.getShapeFillBBox();e.each((l,c)=>{const{centerX:h,centerY:d,innerRadius:u,outerRadius:p,startCornerRadius:g,endCornerRadius:y}=c;l.centerX=h,l.centerY=d,l.innerRadius=u,l.outerRadius=p,l.pointerEvents=this.properties.bar.enabled?import_ag_charts_community266._ModuleSupport.PointerEvents.All:import_ag_charts_community266._ModuleSupport.PointerEvents.None,applyShapeStyle17(l,c.style,n),l.startOuterCornerRadius=g,l.startInnerCornerRadius=g,l.endOuterCornerRadius=y,l.endInnerCornerRadius=y,l.radialEdgeInset=(a+l.strokeWidth)/2,l.concentricEdgeInset=l.strokeWidth/2,(r||l.previousDatum==null)&&l.setProperties(resetRadialGaugeSeriesResetSectorFunction(l,c))}),this.datumUnion.update(e,this.itemGroup,import_ag_charts_community266._ModuleSupport.Sector,(l,c,h)=>{l.clipSector??(l.clipSector=new SectorBox6(Number.NaN,Number.NaN,Number.NaN,Number.NaN)),l.centerX=c.centerX,l.centerY=c.centerY,l.outerRadius=l.clipSector.outerRadius=c.outerRadius,l.innerRadius=l.clipSector.innerRadius=c.innerRadius,l.startAngle=l.clipSector.startAngle=c.startAngle,l.startInnerCornerRadius=c.startInnerCornerRadius,l.startOuterCornerRadius=c.startOuterCornerRadius,l.endAngle=h.endAngle,l.clipSector.endAngle=h.clipSector?.endAngle??h.endAngle,l.endInnerCornerRadius=h.endInnerCornerRadius,l.endOuterCornerRadius=h.endOuterCornerRadius,l.pointerEvents=import_ag_charts_community266._ModuleSupport.PointerEvents.None})}updateScaleSelection(t){return t.scaleSelection.update(t.scaleData,void 0,e=>createDatumId19(t.scaleData.length,e.itemId))}updateScaleNodes(t){const{scaleSelection:e}=t,{segmentation:i}=this.properties,o=i.spacing??0,s=this.getShapeFillBBox();e.each((a,r)=>{const{centerX:n,centerY:l,innerRadius:c,outerRadius:h,startCornerRadius:d,endCornerRadius:u}=r;a.centerX=n,a.centerY=l,a.innerRadius=c,a.outerRadius=h,applyShapeStyle17(a,r.style,s),a.startOuterCornerRadius=d,a.startInnerCornerRadius=d,a.endOuterCornerRadius=u,a.endInnerCornerRadius=u,a.radialEdgeInset=(o+a.strokeWidth)/2,a.concentricEdgeInset=a.strokeWidth/2,a.setProperties(resetRadialGaugeSeriesResetSectorFunction(a,r))})}updateNeedleSelection(t){return t.needleSelection.update(t.needleData,void 0,()=>createDatumId19(0))}updateNeedleNodes(t){const{needleSelection:e}=t,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:r,lineDash:n,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();e.each((h,d)=>{const{centerX:u,centerY:p,radius:g}=d,y=g*2;h.d=RadialGaugeNeedle.defaultPathData,applyShapeStyle17(h,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:r/y,lineDash:n.map(f=>f/y),lineDashOffset:l/y}),h.translationX=u,h.translationY=p,h.scalingX=y,h.scalingY=y,c&&h.setProperties(resetRadialGaugeSeriesResetNeedleFunction(h,d))})}updateTargetSelection(t){return t.targetSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetStyles({targetSelection:t,isHighlight:e}){t.each((i,o)=>{o.style=this.getTargetStyle(e,o)})}updateTargetNodes({targetSelection:t}){t.each((e,i)=>{const{centerX:o,centerY:s,angle:a,radius:r,shape:n,size:l,rotation:c}=i;applyShapeStyle17(e,i.style),e.size=l,e.shape=n==="line"?lineMarker:n,e.translationX=o+r*Math.cos(a),e.translationY=s+r*Math.sin(a),e.rotation=a+c})}getTargetStyle(t,{datumIndex:e,style:i}){const o=this.getHighlightStyle(t,e);return mergeDefaults19(o,{...i,opacity:1})}updateTargetLabelSelection(t){return t.targetLabelSelection.update(t.targetData,void 0,e=>e.itemId)}updateTargetLabelNodes(t){const{targetLabelSelection:e}=t;e.each((i,o)=>{const{centerX:s,centerY:a,radius:r,angle:n,text:l}=o,{offsetX:c,offsetY:h,fill:d,fontStyle:u,fontWeight:p,fontSize:g,fontFamily:y,textAlign:f,textBaseline:x}=o.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=s+r*Math.cos(n)+c,i.y=a+r*Math.sin(n)+h,i.text=l,i.fill=d,i.fontStyle=u,i.fontWeight=p,i.fontSize=g,i.fontFamily=y,i.textAlign=f,i.textBaseline=x})}updateLabelSelection(t){return t.labelSelection.update(t.labelData,void 0,e=>e.label)}updateLabelNodes(t){const{labelSelection:e}=t,i=this.ctx.animationManager.isSkipped();e.each((o,s)=>{o.fill=s.fill,o.fontStyle=s.fontStyle,o.fontWeight=s.fontWeight,o.fontFamily=s.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}updateTickSelection(t){return t.tickSelection.update(t.tickData,void 0,e=>e.index)}updateTickNodes(t){const{scale:e,radius:i,centerX:o,centerY:s,properties:a}=this,{enabled:r,color:n,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:d,spacing:u}=a.scale.label,p=toRadians5(a.scale.label.rotation??0);t.tickSelection.each((g,y)=>{if(!r){g.visible=!1;return}g.visible=!0,g.text=y.text,g.fill=n,g.fontFamily=l,g.fontSize=c,g.fontStyle=h,g.fontWeight=d,g.textAlign="center",g.textBaseline="middle";const f=e.convert(y.value),{width:x,height:b}=y,m=Math.abs(i*Math.cos(f)),S=Math.abs(i*Math.sin(f)),v=Math.min(Math.max(Math.abs(i/Math.tan(f)),m-x/2),m+x/2),M=Math.min(Math.max(Math.abs(i*Math.tan(f)),S-b/2),S+b/2),D=Math.hypot(v,M),k=o+(D+u)*Math.cos(f),_=s+(D+u)*Math.sin(f);g.x=k,g.y=_,g.rotationCenterX=k,g.rotationCenterY=_,g.rotation=p})}labelsHaveExplicitText(){for(const{datum:t}of this.labelSelection)if(t.text==null)return!1;return!0}formatLabelText(t){const{labelSelection:e,radius:i,textAlign:o,verticalAlign:s}=this,{spacing:a,innerRadiusRatio:r}=this.properties;formatRadialGaugeLabels(this,this.ctx,e,{padding:a,textAlign:o,verticalAlign:s},i*r,t)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),resetMotion4([this.datumSelection],resetRadialGaugeSeriesResetSectorFunction),resetMotion4([this.needleSelection],resetRadialGaugeSeriesResetNeedleFunction),this.formatLabelText()}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}animateLabelText(t={}){const{animationManager:e}=this.ctx;let i,o,s,a;if(this.labelSelection.each((r,n)=>{r.opacity=1,n.label==="primary"?(i=r.previousDatum?.value??t.from??n.value,o=n.value):n.label==="secondary"&&(s=r.previousDatum?.value??t.from??n.value,a=n.value)}),!this.labelsHaveExplicitText())if(o==null||a==null)this.formatLabelText();else if(i===o&&s===a)this.formatLabelText({label:o,secondaryLabel:a});else{const r=`${this.id}_labels`;e.animate({id:r,groupId:"label",from:{label:i,secondaryLabel:s},to:{label:o,secondaryLabel:a},phase:t.phase??"update",onUpdate:n=>this.formatLabelText(n),onStop:()=>this.formatLabelText({label:o,secondaryLabel:a})})}}animateEmptyUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=prepareRadialGaugeSeriesAnimationFunctions(!0,this.scale.range[0]);fromToMotion5(this.id,"node",t,[this.datumSelection],e,(o,s)=>s.itemId),fromToMotion5(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),fromToMotion5(this.id,"label",t,[this.labelSelection],fadeInFns,(o,s)=>s.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:t}=this.ctx,{node:e,needle:i}=prepareRadialGaugeSeriesAnimationFunctions(!1,this.scale.range[0]);fromToMotion5(this.id,"node",t,[this.datumSelection],e,(o,s)=>s.itemId),fromToMotion5(this.id,"needle",t,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return[Number.NaN,Number.NaN]}getSeriesRange(t,e){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(t){const{id:e,properties:i}=this,{tooltip:o}=i;let s,a,r;if(t.type===0?(s=i.value,a=i.label.text,r=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:s,text:a}=i.targets[t.index],r=this.ctx.localeManager.t("ariaLabelGaugeTarget")),s!=null)return this.formatTooltipWithContext(o,{data:[{label:a,fallbackLabel:r,value:this.formatLabel(s)}]},{seriesId:e,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(t){return pickGaugeNearestDatum(this,t)}pickFocus(t){return pickGaugeFocus(this,t)}getCaptionText(){const{value:t}=this.properties,e=[];return e.push(this.formatLabel(t)),this.labelSelection.each((i,o)=>{const s=getLabelText(this.id,this.ctx,o);s!=null&&e.push((0,import_ag_charts_core112.toPlainText)(s))}),e.join(". ")}getCategoryValue(t){}datumIndexForCategoryValue(t){}hasItemStylers(){return this.properties.label.itemStyler!=null}};RadialGaugeSeries.className="RadialGaugeSeries",RadialGaugeSeries.type="radial-gauge";var{FONT_SIZE_RATIO:FONT_SIZE_RATIO2}=import_ag_charts_community267._ModuleSupport,RadialGaugeModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"radial-gauge",moduleFactory:t=>new RadialGaugeSeries(t),themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{outerRadiusRatio:1,innerRadiusRatio:.8,startAngle:270,endAngle:450,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},import_ag_charts_community267._ModuleSupport.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",import_ag_charts_community267._ModuleSupport.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:12}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:2},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"outside",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},needle:{enabled:!1,fill:{$ref:"foregroundColor"},spacing:10},label:{...import_ag_charts_community267._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...import_ag_charts_community267._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:FONT_SIZE_RATIO2.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}}}}},RadialGaugeSeriesModule={type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,options:import_ag_charts_community267._ModuleSupport.radialGaugeSeriesOptionsDef,create:t=>new RadialGaugeSeries(t)},import_ag_charts_community272=require("ag-charts-community"),import_ag_charts_community270=require("ag-charts-community"),import_ag_charts_core114=require("ag-charts-core"),import_ag_charts_community268=require("ag-charts-community"),import_ag_charts_core113=require("ag-charts-core"),{BBox:BBox25,Path:Path14,Vec2:Vec220,SceneChangeDetection:SceneChangeDetection10}=import_ag_charts_community268._ModuleSupport,SankeyLink=class extends Path14{constructor(){super(...arguments),this.x1=0,this.x2=0,this.y1=0,this.y2=0,this.height=0,this.inset=0,this.elbows=[]}computeBBox(){const t=Math.min(this.x1,this.x2),e=Math.max(this.x1,this.x2)-t,i=Math.min(this.y1,this.y2),o=Math.max(this.y1,this.y2)-i+this.height;return new BBox25(t,i,e,o)}updatePath(){const{path:t,inset:e}=this;t.clear();const i=this.height-2*this.inset,o=i/2;let s=this.x1+e,a=this.y1+e;t.moveTo(s,a);for(const l of this.elbows)this.updatePathSection(s,a,l.x,l.y,i,-o),s=l.x,a=l.y;const r=this.x2-e,n=this.y2+e;this.updatePathSection(s,a,r,n,i,-o),t.lineTo(r,n+i),s=r,a=n;for(const l of this.elbows.toReversed())this.updatePathSection(s,a,l.x,l.y,i,o),s=l.x,a=l.y;this.updatePathSection(s,a,this.x1+e,this.y1+e,i,o),t.closePath()}updatePathSection(t,e,i,o,s,a){const{path:r}=this,n=Vec220.from(t,e+a+s/2),l=Vec220.from(i,o+a+s/2);if(Math.abs(l.y-n.y)<2){r.lineTo(l.x,l.y);return}let c=Vec220.angle(Vec220.sub(l,n));c<0&&(c=2*Math.PI+c);const h=0,d=Math.PI/2,u=Math.PI,p=Math.PI*1.5,g=getArcValues(n,l,0),y=getArcValues(n,l,s);if(g.radius=p?(r.arc(n.x,e-g.radius,g.radius,d,d+y.angle,!0),r.arc(l.x,o+y.radius,y.radius,p+y.angle,p),r.lineTo(l.x,l.y)):c>h&&c<=d?(r.arc(n.x,e+y.radius,y.radius,p,p+y.angle),r.arc(l.x,o-g.radius,g.radius,d+g.angle,d,!0),r.lineTo(l.x,l.y)):c>d&&c<=u?(r.arc(n.x,e+y.radius,y.radius-s,p,p+y.angle,!0),r.arc(l.x,o-g.radius,g.radius+s,d+g.angle,d),r.lineTo(l.x,l.y)):(r.arc(n.x,e-g.radius,g.radius+s,d,d+g.angle),r.arc(l.x,o+y.radius,y.radius-s,p+y.angle,p,!0),r.lineTo(l.x,l.y))}};__decorateClass([SceneChangeDetection10()],SankeyLink.prototype,"x1",2),__decorateClass([SceneChangeDetection10()],SankeyLink.prototype,"x2",2),__decorateClass([SceneChangeDetection10()],SankeyLink.prototype,"y1",2),__decorateClass([SceneChangeDetection10()],SankeyLink.prototype,"y2",2),__decorateClass([SceneChangeDetection10()],SankeyLink.prototype,"height",2),__decorateClass([SceneChangeDetection10()],SankeyLink.prototype,"inset",2);function getArcValues(t,e,i){const o=Vec220.angle(Vec220.sub(e,t)),s=Vec220.distance(t,e),a=Vec220.add(t,Vec220.rotate(Vec220.from(s/2,0),o)),r=-1/Vec220.gradient(t,e),n=Vec220.intercept(a,r),l=lerpClamp(.1,.5,Math.PI/2-Math.abs(Vec220.gradient(t,e))),c=Vec220.intersectAtX(r,n,t.x),h=Math.max(i,Vec220.distance(t,c)*l);return{angle:Vec220.angle(Vec220.sub(c,t),Vec220.sub(c,a))/-(1.1-l),radius:h}}function lerpClamp(t,e,i){return(0,import_ag_charts_core113.clamp)(t,(e-t)*i+t,e)}var import_ag_charts_community269=require("ag-charts-community"),{BaseProperties:BaseProperties29,FillGradientDefaults:FillGradientDefaults3,FillPatternDefaults:FillPatternDefaults3,FillImageDefaults:FillImageDefaults3,makeSeriesTooltip:makeSeriesTooltip22,SeriesProperties:SeriesProperties13,Property:Property82,Label:Label17}=import_ag_charts_community269._ModuleSupport,SankeySeriesLabelProperties=class extends Label17{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};__decorateClass([Property82],SankeySeriesLabelProperties.prototype,"spacing",2),__decorateClass([Property82],SankeySeriesLabelProperties.prototype,"placement",2),__decorateClass([Property82],SankeySeriesLabelProperties.prototype,"edgePlacement",2);var SankeySeriesLinkProperties=class extends BaseProperties29{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"fill",2),__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"fillOpacity",2),__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"stroke",2),__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"strokeOpacity",2),__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"strokeWidth",2),__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"lineDash",2),__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"lineDashOffset",2),__decorateClass([Property82],SankeySeriesLinkProperties.prototype,"itemStyler",2);var SankeySeriesNodeProperties=class extends BaseProperties29{constructor(){super(...arguments),this.spacing=1,this.minSpacing=0,this.width=1,this.alignment="justify",this.verticalAlignment="center",this.sort="auto",this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}};__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"spacing",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"minSpacing",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"width",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"alignment",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"verticalAlignment",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"sort",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"fill",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"fillOpacity",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"stroke",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"strokeOpacity",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"strokeWidth",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"lineDash",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"lineDashOffset",2),__decorateClass([Property82],SankeySeriesNodeProperties.prototype,"itemStyler",2);var SankeySeriesProperties=class extends SeriesProperties13{constructor(){super(),this.nodes=void 0,this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.fillGradientDefaults=new FillGradientDefaults3,this.fillPatternDefaults=new FillPatternDefaults3,this.fillImageDefaults=new FillImageDefaults3,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new SankeySeriesLabelProperties,this.link=new SankeySeriesLinkProperties,this.node=new SankeySeriesNodeProperties,this.tooltip=makeSeriesTooltip22(),this.highlightStyle.deprecated=!1}getStyle(t,e,i,o){const{fillOpacity:s,strokeWidth:a,strokeOpacity:r,lineDash:n,lineDashOffset:l,fill:c=e[o%e.length],stroke:h=i[o%e.length]}=t?this.link:this.node;return{fill:c,fillOpacity:s,stroke:h,strokeWidth:a,strokeOpacity:r,lineDash:n,lineDashOffset:l}}};__decorateClass([Property82],SankeySeriesProperties.prototype,"nodes",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"fromKey",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"toKey",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"idKey",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"idName",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"labelKey",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"labelName",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"sizeKey",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"sizeName",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"fillGradientDefaults",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"fillPatternDefaults",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"fillImageDefaults",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"defaultColorRange",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"defaultPatternFills",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"fills",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"strokes",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"label",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"link",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"node",2),__decorateClass([Property82],SankeySeriesProperties.prototype,"tooltip",2);var{Transformable:Transformable3,applyShapeStyle:applyShapeStyle18,SeriesNodePickMode:SeriesNodePickMode16,createDatumId:createDatumId20,getShapeStyle:getShapeStyle2,getLabelStyles:getLabelStyles6,Rect:Rect8,BBox:BBox26,mergeDefaults:mergeDefaults20}=import_ag_charts_community270._ModuleSupport,SankeySeries=class extends FlowProportionSeries{constructor(t){super({moduleCtx:t,pickModes:[SeriesNodePickMode16.NEAREST_NODE,SeriesNodePickMode16.EXACT_SHAPE_MATCH]}),this.properties=new SankeySeriesProperties}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new SankeyLink}nodeFactory(){return new Rect8}createNodeData(){const{id:t,_nodeDataDependencies:{seriesRectWidth:e,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0}}=this,{fromKey:o,toKey:s,sizeKey:a,labelKey:r,label:{spacing:n,placement:l,edgePlacement:c},node:{width:h,alignment:d}}=this.properties,u=I=>({...I,x:Number.NaN,y:Number.NaN,width:h,height:Number.NaN}),p=I=>({...I,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}),{nodeGraph:g,links:y,maxPathLength:f}=this.getNodeGraph(u,p,{includeCircularReferences:!1}),x=g;if(x.size===0)return;const b=[];for(let I=0;IG+K.size,0),A.reduce((G,{link:K})=>G+K.size,0));if(L.length===0&&A.length===0||B===0){I.columnIndex=-1;continue}let V;switch(d){case"left":V=b[P];break;case"right":V=b[f-1-z];break;case"center":{if(L.length!==0)V=b[P];else if(A.length===0)V=b[0];else{const G=A.reduce((K,U)=>Math.min(K,U.node.maxPathLengthBefore),f)-1;V=b[G]}break}case"justify":{V=A.length===0?b[f-1]:b[P];break}}C.size=B;const{label:W}=this.properties,H=W.enabled?this.getLabelText(C.label,C.datum,r,"label",[],this.properties.label,{datum:C.datum,value:C.label,fromKey:o,toKey:s,sizeKey:a,size:B}):void 0;C.label=(0,import_ag_charts_core114.toPlainText)(H),V.nodes.push(I),V.size+=B,I.columnIndex=V.index}const m=(0,import_ag_charts_core114.cachedTextMeasurer)(this.properties.label);let S=0,v=0;if(this.isLabelEnabled()){if(l==null&&c==null)S=(e-h)*(1-f/(f+1)),v=S;else if(c==="outside"||c==null){const I=(C,L)=>{const A=L;if(A.datum.label==null||A.datum.label==="")return C;let P=(e-h)/(f-1)-n;l==="center"&&c==null&&(P/=2);const z=(0,import_ag_charts_core114.wrapText)(A.datum.label,{maxWidth:P,maxHeight:A.datum.height,font:this.properties.label,textWrap:"never"});let{width:B}=m.measureLines(z);return l==="center"&&c==null&&(B/=2),Math.max(C,B)};(l!=="right"||c==="outside")&&(S=h+b[0].nodes.reduce(I,0)),(l!=="left"||c==="outside")&&(v=h+b.at(-1).nodes.reduce(I,0))}}const M=(e-h-S-v)/(f-1);for(let I=0;II.columnIndex;P--){const z=L.link.size,B={ghost:!0,datum:{...I.datum,size:z,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:P-1,datum:{size:z}}}],linksAfter:[{node:{columnIndex:P+1,datum:{size:z}}}],link:L.link,columnIndex:I.columnIndex,size:I.datum.size,closestColumnDiff:C,fromNode:{y:A.datum.y},toNode:{y:0}};b[P].size+=z,b[P].nodes.push(B)}}}const D=b.toSorted((I,C)=>{const L=I.nodes.reduce((P,z)=>Math.max(P,z.datum.size),0);return C.nodes.reduce((P,z)=>Math.max(P,z.datum.size),0)-L}),k={};for(let I=0;I{if(A.node.columnIndex!==I.index-1)return L;const P=A.node.datum.size/b[A.node.columnIndex].size*k[A.node.columnIndex];return Math.max(L,P)},0),C.weight+=C.linksAfter.reduce((L,A)=>{if(A.node.columnIndex!==I.index+1)return L;const P=A.node.datum.size/b[A.node.columnIndex].size*k[A.node.columnIndex];return Math.max(L,P)},0)}I.nodes.sort((C,L)=>this.sortNodes(C,L))}const _=1,T=I=>b.reduce((C,{size:L,nodes:A})=>{const P=i-A.length*_,B=(1-(A.length-1)*I/P)/L;return Math.min(C,B)},1/0);let w=this.properties.node.spacing,R=T(w);for(;R<0&&w>this.properties.node.minSpacing;)w-=1,R=T(w);if(R<0){import_ag_charts_core114.Logger.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");return}for(const I of b){let C=0;for(const P of I.nodes){const z=i*P.datum.size*R;P.datum.height=Math.max(_,z),C+=z}const L=w*(I.nodes.length-1);let A=0;this.properties.node.verticalAlignment==="bottom"?A=i-C-L:this.properties.node.verticalAlignment==="center"&&(A=(i-C-L)/2);for(const P of I.nodes)P.datum.y=A,A+=i*P.datum.size*R+w,"ghost"in P&&P.ghost&&P.link.elbows.push({x:I.x,y:P.datum.y})}for(const{datum:I,linksBefore:C,linksAfter:L}of x.values()){let A=I.y;C.sort((z,B)=>this.sortNodes(z.node,B.node));for(const{link:z}of C)z.y2=A,A+=z.size*i*R;let P=I.y;L.sort((z,B)=>this.sortNodes(z.node,B.node,{invertColumnSort:!0}));for(const{link:z}of L)z.y1=P,P+=z.size*i*R}const F=[],O=[],{fontSize:E}=this.properties.label;for(const[I,C]of b.entries()){const L=I===0,A=I===b.length-1;let P=-1/0;C.nodes.sort((z,B)=>z.datum.y-B.datum.y);for(const z of C.nodes){if("ghost"in z&&z.ghost)continue;const{datum:B}=z;if(B.midPoint={x:B.x+B.width/2,y:B.y+B.height/2},F.push(B),B.label==null)continue;const V=B.y+B.height/2;let W;if(!L&&!A){const X=(0,import_ag_charts_core114.calcLineHeight)(E),Z=V-X,q=V+X;let it=e;for(const{datum:j}of x.values())j.x>B.x&&Math.max(j.y,Z)<=Math.min(j.y+j.height,q)&&(it=Math.min(it,j.x-n));const J=it-B.x-2*n;W=(0,import_ag_charts_core114.wrapText)(B.label,{maxWidth:J,maxHeight:B.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(W==null||W===""){const X=c==null&&(L||A)?n:n*2;W=(0,import_ag_charts_core114.wrapText)(B.label,{maxWidth:M-X,maxHeight:B.height,font:this.properties.label,textWrap:"never"})}if(W==="")continue;const{height:H}=m.measureLines(W),G=V-H/2,K=V+H/2;let U=B.x+B.width+n,Y="left",$=l;L&&c==null&&l==null&&($="left"),c==="outside"?(L&&($="left"),A&&($="right")):c==="inside"&&(L&&($="right"),A&&($="left")),$==="left"?(U=B.x-n,Y="right"):$==="center"&&(U=B.x+B.width/2,Y="center"),G>=P&&(O.push({x:U,y:V,textAlign:Y,text:W,size:B.size}),P=K)}}for(const I of y){const{fromNode:C,toNode:L,size:A}=I;I.height=Math.max(_,i*A*R),I.x1=C.x+h,I.x2=L.x,I.midPoint={x:(I.x1+I.x2)/2,y:(I.y1+I.y2)/2+I.height/2},F.push(I)}return{itemId:t,nodeData:F,labelData:O}}sortNodes(t,e,i){const{properties:o}=this;return o.node.sort==="ascending"?(t.datum.label??"").localeCompare(e.datum.label??""):o.node.sort==="descending"?(e.datum.label??"").localeCompare(t.datum.label??""):o.node.sort==="data"?0:t.columnIndexe.columnIndex?i?.invertColumnSort?-1:1:t.weight===e.weight?t.datum.size-e.datum.size:t.closestColumnDiffe.closestColumnDiff?-1:t.weight-e.weight}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e)}updateLabelNodes(t){const e=this.ctx.highlightManager?.getActiveHighlight();t.labelSelection.each((i,o)=>{const{x:s,y:a,textAlign:r,text:n}=o,c=getLabelStyles6(this,void 0,o,this.properties.label,!1,e),{color:h,fontStyle:d,fontWeight:u,fontSize:p,fontFamily:g}=c;i.visible=!0,i.x=s,i.y=a,i.text=n,i.fill=h,i.fontStyle=d,i.fontWeight=u,i.fontSize=p,i.fontFamily=g,i.textAlign=r,i.textBaseline="middle",i.setBoxing(c)})}updateNodeSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId20(e.type,e.id))}getNodeStyle(t,e,i){const{properties:o}=this,{fills:s,strokes:a,defaultColorRange:r,defaultPatternFills:n,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=o,{itemStyler:d}=o.node,u=r[e%r.length].map(b=>({color:b})),p=n[e%n.length],g=this.getHighlightStyle(i,t.datumIndex),y=mergeDefaults20(g,o.getStyle(!1,s,a,e)),f=o.node.fill!=null;let x=getShapeStyle2(y,f?l:{...l.toJson(),colorStops:u},f?c:{...c.toJson(),fill:p,stroke:p},h);if(d!=null&&t.datumIndex!=null){const b=this.cachedDatumCallback(createDatumId20(t.datumIndex.index,"node",i?"highlight":"node"),()=>{const m=this.makeItemStylerParams(t,i,x);return this.callWithContext(d,m)});b&&(x=mergeDefaults20(b,x,{...l.toJson(),colorStops:u},{...c.toJson(),fill:p,stroke:p},h))}return x.opacity=1,x}makeItemStylerParams({datum:t,datumIndex:e,size:i=0,label:o},s,a){const{id:r}=this,n=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(n,s,e),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:r,datum:t,highlighted:s,highlightState:l,...a,size:i,label:o,fill:c}}updateNodeNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getShapeFillBBox();e.each((s,a)=>{const{datumIndex:r}=a,n=this.getNodeStyle(a,r.index,i);s.x=a.x,s.y=a.y,s.width=Math.max(a.width,0),s.height=Math.max(a.height,0),applyShapeStyle18(s,n,o)})}getShapeFillBBox(){const t=this._nodeDataDependencies?.seriesRectWidth??0,e=this._nodeDataDependencies?.seriesRectHeight??0,i=new BBox26(0,0,t,e);return{series:i,axis:i}}updateLinkSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>createDatumId20(e.type,e.index,e.fromNode.id,e.toNode.id))}getLinkStyle({datumIndex:t,datum:e},i,o){const{id:s,properties:a}=this,{fills:r,strokes:n,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:h,fillPatternDefaults:d,fillImageDefaults:u}=a,{itemStyler:p}=a.link,g=l[i.index%l.length].map(S=>({color:S})),y=c[i.index%c.length],f=this.getHighlightStyle(o,t),x=mergeDefaults20(f,a.getStyle(!0,r,n,i.index)),b=a.link.fill!=null;let m=getShapeStyle2(x,b?h:{...h.toJson(),colorStops:g},b?d:{...d.toJson(),fill:y,stroke:y},u);if(p!=null&&t!=null){const S=this.cachedDatumCallback(createDatumId20(t.index,"link",o?"highlight":"node"),()=>{const v=this.ctx.highlightManager?.getActiveHighlight(),M=this.getHighlightStateString(v,o,t);return this.callWithContext(p,{seriesId:s,datum:e,highlighted:o,highlightState:M,...m})});S&&(m=mergeDefaults20(S,m,{...h.toJson(),colorStops:g},{...d.toJson(),fill:y,stroke:y},u))}return m.opacity=1,m}updateLinkNodes(t){const{datumSelection:e,isHighlight:i}=t,o=this.getShapeFillBBox();e.each((s,a)=>{const r=a.fromNode.datumIndex,n=this.getLinkStyle(a,r,i);s.x1=a.x1,s.y1=a.y1,s.x2=a.x2,s.y2=a.y2,s.height=a.height,s.elbows=a.elbows,applyShapeStyle18(s,n,o),s.inset=s.strokeWidth/2})}getTooltipContent(t){const{id:e,linksProcessedData:i,nodesProcessedData:o,properties:s,ctx:{formatManager:a}}=this,{fromKey:r,toKey:n,sizeKey:l,sizeName:c,tooltip:h}=s,d=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===t.type&&b.datumIndex.index===t.index);if(d==null)return;const u=d.type===0?d.fromNode.index:d.index,p=d.type===0?`${d.fromNode.label} - ${d.toNode.label}`:d.label,g=t.type===0?i?.dataSources.get(this.id)?.data[t.index]:o?.dataSources.get(this.id)?.data[t.index],y=d.size;let f;if(d.type===0){const b=d.fromNode.datumIndex;f=this.getLinkStyle({datumIndex:t,datum:g},b,!1)}else f=this.getNodeStyle({datumIndex:t,datum:g},t.index,!1);const x=[];if(l!=null){const b=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:g,seriesId:e,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});x.push({label:c,fallbackLabel:l,value:b??String(y)})}return this.formatTooltipWithContext(h,{title:p,symbol:this.legendItemSymbol(d.type,u,f),data:x},{seriesId:e,datum:g,title:p,fromKey:r,toKey:n,sizeKey:l,sizeName:c,size:y,...f})}computeFocusBounds(t){if(t instanceof Rect8){const{x:e,y:i,width:o,height:s}=t,a=new BBox26(e,i,o,s);return Transformable3.toCanvas(this.contentGroup,a)}return t}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};SankeySeries.className="SankeySeries",SankeySeries.type="sankey";var import_ag_charts_community271=require("ag-charts-community"),import_ag_charts_core115=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs21,sankeySeriesThemeableOptionsDef}=import_ag_charts_community271._ModuleSupport,sankeySeriesOptionsDef={...sankeySeriesThemeableOptionsDef,...commonSeriesOptionsDefs21,type:(0,import_ag_charts_core115.required)((0,import_ag_charts_core115.constant)("sankey")),fromKey:(0,import_ag_charts_core115.required)(import_ag_charts_core115.string),toKey:(0,import_ag_charts_core115.required)(import_ag_charts_core115.string),sizeKey:import_ag_charts_core115.string,sizeName:import_ag_charts_core115.string};sankeySeriesOptionsDef.fillGradientDefaults=(0,import_ag_charts_core115.undocumented)(import_ag_charts_core115.fillGradientDefaults),sankeySeriesOptionsDef.fillPatternDefaults=(0,import_ag_charts_core115.undocumented)(import_ag_charts_core115.fillPatternDefaults),sankeySeriesOptionsDef.fillImageDefaults=(0,import_ag_charts_core115.undocumented)(import_ag_charts_core115.fillImageDefaults),sankeySeriesOptionsDef.defaultColorRange=(0,import_ag_charts_core115.undocumented)((0,import_ag_charts_core115.arrayOf)((0,import_ag_charts_core115.arrayOf)(import_ag_charts_core115.color))),sankeySeriesOptionsDef.defaultPatternFills=(0,import_ag_charts_core115.undocumented)((0,import_ag_charts_core115.arrayOf)(import_ag_charts_core115.color));var SankeyModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],solo:!0,identifier:"sankey",moduleFactory:t=>new SankeySeries(t),themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:import_ag_charts_community272._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:import_ag_charts_community272._ModuleSupport.FILL_PATTERN_DEFAULTS,fillImageDefaults:import_ag_charts_community272._ModuleSupport.FILL_IMAGE_DEFAULTS,defaultColorRange:{$palette:"gradients"},defaultPatternFills:import_ag_charts_community272._ModuleSupport.SAFE_FILLS_OPERATION,highlightStyle:{series:{dimOpacity:.2}},highlight:{...import_ag_charts_community272._ModuleSupport.singleSeriesHighlightStyle()},label:{...import_ag_charts_community272._ModuleSupport.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:10},node:{spacing:{$if:[{$greaterThan:[{$path:"./minSpacing"},20]},{$path:"./minSpacing"},20]},minSpacing:0,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]}}},legend:{enabled:!1,toggleSeries:!1}}},SankeySeriesModule={type:"series",name:"sankey",chartType:"standalone",enterprise:!0,options:sankeySeriesOptionsDef,create:t=>new SankeySeries(t)},import_ag_charts_community276=require("ag-charts-community"),import_ag_charts_community274=require("ag-charts-community"),import_ag_charts_core116=require("ag-charts-core"),import_ag_charts_community273=require("ag-charts-community"),{HierarchySeriesProperties,HighlightStyle,makeSeriesTooltip:makeSeriesTooltip23,Property:Property83}=import_ag_charts_community273._ModuleSupport,SunburstSeriesTileHighlightStyle=class extends HighlightStyle{constructor(){super(!1),this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedLabel}};__decorateClass([Property83],SunburstSeriesTileHighlightStyle.prototype,"fill",2),__decorateClass([Property83],SunburstSeriesTileHighlightStyle.prototype,"fillOpacity",2),__decorateClass([Property83],SunburstSeriesTileHighlightStyle.prototype,"stroke",2),__decorateClass([Property83],SunburstSeriesTileHighlightStyle.prototype,"strokeWidth",2),__decorateClass([Property83],SunburstSeriesTileHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([Property83],SunburstSeriesTileHighlightStyle.prototype,"label",2),__decorateClass([Property83],SunburstSeriesTileHighlightStyle.prototype,"secondaryLabel",2);var SunburstSeriesProperties=class extends HierarchySeriesProperties{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlightStyle=new SunburstSeriesTileHighlightStyle,this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel,this.tooltip=makeSeriesTooltip23()}getStyle(t){const{fills:e,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a}=this;return{fill:e[t%e.length],fillOpacity:o,stroke:i[t%i.length],strokeWidth:s,strokeOpacity:a,opacity:1}}};__decorateClass([Property83],SunburstSeriesProperties.prototype,"sizeName",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"labelKey",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"secondaryLabelKey",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"fillOpacity",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"strokeWidth",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"strokeOpacity",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"cornerRadius",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"sectorSpacing",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"padding",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"highlightStyle",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"label",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"secondaryLabel",2),__decorateClass([Property83],SunburstSeriesProperties.prototype,"tooltip",2);var{fromToMotion:fromToMotion6,normalizeAngle360:normalizeAngle3608,createDatumId:createDatumId21,PointerEvents:PointerEvents13,Sector:Sector7,Group:Group20,ScalableGroup,Selection:Selection17,TransformableText:TransformableText3,BBox:BBox27,applyShapeStyle:applyShapeStyle19,mergeDefaults:mergeDefaults21,formatValue:formatValue2,getLabelStyles:getLabelStyles7}=import_ag_charts_community274._ModuleSupport,SunburstNode=class extends import_ag_charts_community274._ModuleSupport.HierarchyNode{constructor(){super(...arguments),this.label=void 0,this.secondaryLabel=void 0,this.contentHeight=0,this.bbox=void 0,this.startAngle=0,this.endAngle=0}};function setAngleData(t,e=0,i=2*Math.PI/t.sumSize){for(const o of t.children){const s=e+o.sumSize*i;o.startAngle=e,o.endAngle=s,setAngleData(o,e,i),e=s}}var SunburstSeries=class extends import_ag_charts_community274._ModuleSupport.HierarchySeries{constructor(t){super(t),this.NodeClass=SunburstNode,this.properties=new SunburstSeriesProperties,this.scalingGroup=this.contentGroup.appendChild(new ScalableGroup),this.sectorGroup=this.scalingGroup.appendChild(new Group20),this.sectorLabelGroup=this.scalingGroup.appendChild(new Group20),this.highlightSectorGroup=this.scalingGroup.appendChild(new Group20),this.datumSelection=Selection17.select(this.sectorGroup,Sector7),this.labelSelection=Selection17.select(this.sectorLabelGroup,Group20),this.highlightSelection=Selection17.select(this.highlightSectorGroup,Sector7),this.sectorLabelGroup.pointerEvents=PointerEvents13.None}processData(){super.processData(),setAngleData(this.rootNode)}updateSelections(){const t=this.ctx.highlightManager?.getActiveHighlight();if(this.highlightSelection.update(t==null?[]:[t],void 0,a=>this.getDatumId(a)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{chart:e}=this;if(e==null||e.seriesRect==null)return;const o=Array.from(this.rootNode),s=a=>{a.append([new TransformableText3({tag:0}),new TransformableText3({tag:1})])};this.datumSelection.update(o,void 0,a=>this.getDatumId(a)),this.labelSelection.update(o,s,a=>this.getDatumId(a))}getItemStyle(t,e){const{properties:i,colorScale:o}=this,{itemStyler:s}=i,a=t.datumIndex?.[0]??0,r=e?i.highlightStyle:void 0,n=mergeDefaults21(r,i.getStyle(a));!e&&t.colorValue!=null&&(n.fill=o.convert(t.colorValue));let l=n;if(s!=null&&t!=null){const c=this.cachedDatumCallback(createDatumId21(this.getDatumId(t),e?"highlight":"node"),()=>{const h=this.makeItemStylerParams(t,e,l);return this.callWithContext(s,h)});c&&(l=mergeDefaults21(c,l))}return l}makeItemStylerParams(t,e,i){const{id:o}=this,s=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(s,e,t.datumIndex),r=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:o,datum:t.datum,depth:t.depth??0,highlighted:e,highlightState:a,...i,fill:r}}updateNodes(){const{chart:t,data:e,maxDepth:i}=this;if(t==null||e==null)return;const{width:o,height:s}=t.seriesRect,{sectorSpacing:a=0,padding:r=0,cornerRadius:n,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g}=this.properties;this.contentGroup.translationX=o/2,this.contentGroup.translationY=s/2;const y=a*.5,f=Math.min(o,s)/2,x=f/(i+1),b=-Math.PI/2,m={series:new BBox27(-f,-f,2*f,2*f),axis:new BBox27(-f,-f,2*f,2*f)};this.rootNode?.walk(D=>{const{startAngle:k,endAngle:_}=D;if(D.depth!=null){const T=(k+_)/2+b,w=(D.depth+.5)*x;D.midPoint.x=Math.cos(T)*w,D.midPoint.y=Math.sin(T)*w}}),this.rootNode?.walk(D=>{const{datum:k,depth:_,startAngle:T,endAngle:w,parent:R,sumSize:F}=D;D.label=void 0,D.secondaryLabel=void 0,D.contentHeight=0;let O;if(k!=null&&_!=null&&d!=null){const Q=k[d];O=this.getLabelText(Q,k,d,"label",[],this.properties.label,{depth:_,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:Q})}O===""&&(O=void 0);let E;if(k!=null&&_!=null&&u!=null){const Q=k[u];E=this.getLabelText(Q,k,u,"secondaryLabel",[],this.properties.secondaryLabel,{depth:_,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:d,secondaryLabelKey:u,sizeKey:p,sizeName:g,value:Q})}if(E===""&&(E=void 0),_==null)return;const I=_*x+y,C=(_+1)*x-y,L=I>y?y/I:y,A=C>y?y/C:y,P=T+L,B=w+L-P,V=T+A,H=w+A-V,G=Q=>{if(_===0&&R?.sumSize===F)return{width:2*Math.sqrt(C**2-(Q*.5)**2),height:Q,meta:0};const et=Q,st=2*Math.sqrt(C**2-(I+et)**2),rt=B=ht?{width:lt,height:et,meta:1}:{width:ht,height:ct,meta:2}},K=formatLabels((0,import_ag_charts_core116.toPlainText)(O),this.properties.label,(0,import_ag_charts_core116.toPlainText)(E),this.properties.secondaryLabel,{padding:r},G);if(K==null)return;const{width:U,height:Y,meta:$,label:X,secondaryLabel:Z}=K,q=b+(T+w)/2,it=Math.sin(q)>=0,J=Math.cos(q)>=0,j=(it?3:12)&(J?6:9);let tt;switch($){case 0:tt=0;break;case 1:{const ot=C-(x-Y)*.58,et=Math.sqrt((C-r)**2-(U/2)**2);tt=Math.min(ot,et);break}case 2:if(_===0){const Q=Y/(2*Math.tan(B*.5))+U*.5,ot=Math.sqrt(C**2-(Y*.5)**2)-U*.5;tt=(Q+ot)*.5}else tt=(I+C)*.5;break}if(X!=null){const{fontStyle:Q="normal",fontFamily:ot,fontWeight:et="normal",color:st="black"}=this.properties.label;D.label={...X,fontStyle:Q,fontFamily:ot,fontWeight:et,color:st,labelPlacement:$,circleQuarter:j,radius:tt,theta:q}}if(Z!=null){const{fontStyle:Q="normal",fontFamily:ot,fontWeight:et="normal",color:st="black"}=this.properties.secondaryLabel;D.secondaryLabel={...Z,fontStyle:Q,fontFamily:ot,fontWeight:et,color:st,labelPlacement:$,circleQuarter:j,radius:tt,theta:q}}D.contentHeight=K.height});const S=(D,k,_)=>{const{depth:T,startAngle:w,endAngle:R}=D;if(T==null){k.visible=!1;return}k.visible=!0;const F=this.getItemStyle(D,_),O=F.fill,E=F.strokeWidth,I=import_ag_charts_community274._ModuleSupport.isGradientFill(O)&&O.bounds!=="item"?m:void 0;applyShapeStyle19(k,F,I),k.centerX=0,k.centerY=0,k.innerRadius=T*x,k.outerRadius=(T+1)*x,k.startAngle=w+b,k.endAngle=R+b,k.inset=y+E*.5,k.cornerRadius=n};this.datumSelection.each((D,k)=>{S(k,D,!1)}),this.highlightSelection.each((D,k)=>{S(k,D,!0)});const v=(D,k,_,T)=>{const{depth:w,contentHeight:R}=D,F=_===0,O=F?D.label:D.secondaryLabel;if(w==null||O==null){k.visible=!1;return}const{labelPlacement:E,circleQuarter:I,radius:C,theta:L}=O;let A;T&&(A=(F?this.properties.highlightStyle.label:this.properties.highlightStyle.secondaryLabel).color);const P={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:D.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},z=F?this.properties.label:this.properties.secondaryLabel,B=this.ctx.highlightManager?.getActiveHighlight(),V=getLabelStyles7(this,D,P,z,T,B);switch(k.text=O.text,k.fontSize=O.fontSize,k.lineHeight=O.lineHeight,k.fontStyle=O.fontStyle,k.fontFamily=O.fontFamily,k.fontWeight=O.fontWeight,k.fill=A??O.color,k.fillOpacity=this.getHighlightStyle(T,D.datumIndex)?.opacity??1,k.setBoxing(V),E){case 0:k.textAlign="center",k.textBaseline="top",k.translationX=0,k.translationY=(F?0:R-O.height)-R*.5,k.rotation=0;break;case 1:{const W=(I&3)!==0,H=F===!W?C:C-(R-O.height);k.textAlign="center",k.textBaseline=W?"bottom":"top",k.translationX=Math.cos(L)*H,k.translationY=Math.sin(L)*H,k.rotation=W?L-Math.PI*.5:L+Math.PI*.5;break}case 2:{const W=(I&6)!==0,H=F===!W?(R-O.height)*.5:(O.height-R)*.5;k.textAlign="center",k.textBaseline="middle",k.translationX=Math.cos(L)*C+Math.cos(L+Math.PI/2)*H,k.translationY=Math.sin(L)*C+Math.sin(L+Math.PI/2)*H,k.rotation=W?L:L+Math.PI;break}}k.visible=!0},M=this.ctx.highlightManager?.getActiveHighlight();for(const D of this.labelSelection.selectByClass(TransformableText3)){const k=D.closestDatum();v(k,D,D.tag,k===M)}}getTooltipContent(t){const{id:e,properties:i,ctx:o}=this,{labelKey:s,secondaryLabelKey:a,childrenKey:r,sizeKey:n,sizeName:l,colorKey:c,colorName:h,tooltip:d}=i,{formatManager:u}=o,p=t.reduce((M,D)=>M?.children[D],this.rootNode);if(p==null)return;const{datum:g,depth:y}=p;if(g==null||y==null)return;const f=[],x=n==null?void 0:g[n];if(x!=null){const M=[0,this.rootNode?.sumSize??0],D=u.format(this.callWithContext.bind(this),{type:"number",value:x,datum:g,seriesId:e,legendItemName:void 0,key:n,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:M,fractionDigits:void 0});f.push({label:l,fallbackLabel:n,value:D??formatValue2(x)})}const b=c==null?void 0:g[c];if(b!=null){const{colorDomain:M}=this,D=u.format(this.callWithContext.bind(this),{type:"number",value:b,datum:g,seriesId:e,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:M,fractionDigits:void 0});f.push({label:h,fallbackLabel:c,value:D??formatValue2(b)})}const m=this.getItemStyle({...p,colorValue:b??p.colorValue},!1),v={shape:"square",fill:m.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return import_ag_charts_community274._ModuleSupport.isGradientFill(v.fill)&&(v.fill={...v.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(d,{title:s==null?void 0:g[s],symbol:{marker:v},data:f},{seriesId:e,datum:g,title:void 0,depth:y,labelKey:s,secondaryLabelKey:a,childrenKey:r,sizeKey:n,sizeName:l,colorKey:c,colorName:h,...m})}createNodeData(){}pickNodeClosestDatum(t){return this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}animateEmptyUpdateReady(){fromToMotion6(this.id,"nodes",this.ctx.animationManager,[this.scalingGroup],{toFn(){return{scalingX:1,scalingY:1}},fromFn(){return{scalingX:0,scalingY:0}}})}computeFocusBounds(t){return t}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};SunburstSeries.className="SunburstSeries",SunburstSeries.type="sunburst";var import_ag_charts_community275=require("ag-charts-community"),import_ag_charts_core117=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs22,sunburstSeriesThemeableOptionsDef,without:without8}=import_ag_charts_community275._ModuleSupport,sunburstSeriesOptionsDef={...sunburstSeriesThemeableOptionsDef,...without8(commonSeriesOptionsDefs22,["highlightStyle","highlight","showInLegend"]),type:(0,import_ag_charts_core117.required)((0,import_ag_charts_core117.constant)("sunburst")),labelKey:import_ag_charts_core117.string,secondaryLabelKey:import_ag_charts_core117.string,childrenKey:import_ag_charts_core117.string,sizeKey:import_ag_charts_core117.string,colorKey:import_ag_charts_core117.string,sizeName:import_ag_charts_core117.string,colorName:import_ag_charts_core117.string},{BASE_FONT_SIZE,FONT_SIZE_RATIO:FONT_SIZE_RATIO3}=import_ag_charts_community276._ModuleSupport,SunburstModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"sunburst",moduleFactory:t=>new SunburstSeries(t),solo:!0,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",import_ag_charts_community276._ModuleSupport.FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS],["pattern",import_ag_charts_community276._ModuleSupport.FILL_PATTERN_DEFAULTS],["image",import_ag_charts_community276._ModuleSupport.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...import_ag_charts_community276._ModuleSupport.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:FONT_SIZE_RATIO3.LARGE},minimumFontSize:{$rem:9/BASE_FONT_SIZE},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...import_ag_charts_community276._ModuleSupport.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:FONT_SIZE_RATIO3.SMALLEST},minimumFontSize:{$rem:7/BASE_FONT_SIZE},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlightStyle:{label:{color:{$ref:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}},gradientLegend:{enabled:!0,...import_ag_charts_community276._ModuleSupport.LEGEND_CONTAINER_THEME}}},SunburstSeriesModule={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,options:sunburstSeriesOptionsDef,create:t=>new SunburstSeries(t)},import_ag_charts_community280=require("ag-charts-community"),import_ag_charts_community278=require("ag-charts-community"),import_ag_charts_core118=require("ag-charts-core"),import_ag_charts_community277=require("ag-charts-community"),{BaseProperties:BaseProperties30,HierarchySeriesProperties:HierarchySeriesProperties2,HighlightStyle:HighlightStyle2,makeSeriesTooltip:makeSeriesTooltip24,Property:Property84,Label:Label18}=import_ag_charts_community277._ModuleSupport,TreemapGroupLabel=class extends Label18{constructor(){super(...arguments),this.spacing=0}};__decorateClass([Property84],TreemapGroupLabel.prototype,"spacing",2);var TreemapSeriesGroup=class extends BaseProperties30{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.gap=0,this.padding=0,this.interactive=!0,this.label=new TreemapGroupLabel}};__decorateClass([Property84],TreemapSeriesGroup.prototype,"fill",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"fillOpacity",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"stroke",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"strokeWidth",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"strokeOpacity",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"cornerRadius",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"textAlign",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"gap",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"padding",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"interactive",2),__decorateClass([Property84],TreemapSeriesGroup.prototype,"label",2);var TreemapSeriesTile=class extends BaseProperties30{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.cornerRadius=0,this.textAlign="center",this.verticalAlign="middle",this.gap=0,this.padding=0,this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel}};__decorateClass([Property84],TreemapSeriesTile.prototype,"fill",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"fillOpacity",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"stroke",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"strokeWidth",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"strokeOpacity",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"cornerRadius",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"textAlign",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"verticalAlign",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"gap",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"padding",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"label",2),__decorateClass([Property84],TreemapSeriesTile.prototype,"secondaryLabel",2);var TreemapSeriesGroupHighlightStyle=class extends BaseProperties30{constructor(){super(...arguments),this.label=new AutoSizedLabel}};__decorateClass([Property84],TreemapSeriesGroupHighlightStyle.prototype,"fill",2),__decorateClass([Property84],TreemapSeriesGroupHighlightStyle.prototype,"fillOpacity",2),__decorateClass([Property84],TreemapSeriesGroupHighlightStyle.prototype,"stroke",2),__decorateClass([Property84],TreemapSeriesGroupHighlightStyle.prototype,"strokeWidth",2),__decorateClass([Property84],TreemapSeriesGroupHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([Property84],TreemapSeriesGroupHighlightStyle.prototype,"label",2);var TreemapSeriesTileHighlightStyle=class extends BaseProperties30{constructor(){super(...arguments),this.label=new AutoSizedLabel,this.secondaryLabel=new AutoSizedSecondaryLabel}};__decorateClass([Property84],TreemapSeriesTileHighlightStyle.prototype,"fill",2),__decorateClass([Property84],TreemapSeriesTileHighlightStyle.prototype,"fillOpacity",2),__decorateClass([Property84],TreemapSeriesTileHighlightStyle.prototype,"stroke",2),__decorateClass([Property84],TreemapSeriesTileHighlightStyle.prototype,"strokeWidth",2),__decorateClass([Property84],TreemapSeriesTileHighlightStyle.prototype,"strokeOpacity",2),__decorateClass([Property84],TreemapSeriesTileHighlightStyle.prototype,"label",2),__decorateClass([Property84],TreemapSeriesTileHighlightStyle.prototype,"secondaryLabel",2);var TreemapSeriesHighlightStyle=class extends HighlightStyle2{constructor(){super(!1),this.group=new TreemapSeriesGroupHighlightStyle,this.tile=new TreemapSeriesTileHighlightStyle}getStyle(t){return t?this.tile:this.group}};__decorateClass([Property84],TreemapSeriesHighlightStyle.prototype,"group",2),__decorateClass([Property84],TreemapSeriesHighlightStyle.prototype,"tile",2);var TreemapSeriesProperties=class extends HierarchySeriesProperties2{constructor(){super(...arguments),this.highlightStyle=new TreemapSeriesHighlightStyle,this.tooltip=makeSeriesTooltip24(),this.group=new TreemapSeriesGroup,this.tile=new TreemapSeriesTile,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(t,e,i,o){const{fillOpacity:s,strokeWidth:a,strokeOpacity:r,fill:n=t?e[o%e.length]:e[Math.min(o,e.length)],stroke:l=t?i[o%e.length]:i[Math.min(o,i.length)]}=t?this.tile:this.group;return{fill:n,fillOpacity:s,stroke:l,strokeWidth:a,strokeOpacity:r,opacity:1}}};__decorateClass([Property84],TreemapSeriesProperties.prototype,"sizeName",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"labelKey",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"secondaryLabelKey",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"itemStyler",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"highlightStyle",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"tooltip",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"group",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"tile",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"undocumentedGroupFills",2),__decorateClass([Property84],TreemapSeriesProperties.prototype,"undocumentedGroupStrokes",2);var{createDatumId:createDatumId22,Rect:Rect9,Group:Group21,BBox:BBox28,Selection:Selection18,Text:Text10,Transformable:Transformable4,applyShapeStyle:applyShapeStyle20,getLabelStyles:getLabelStyles8,mergeDefaults:mergeDefaults22,formatValue:formatValue3}=import_ag_charts_community278._ModuleSupport,TreemapNode=class extends import_ag_charts_community278._ModuleSupport.HierarchyNode{constructor(){super(...arguments),this.labelValue=void 0,this.secondaryLabelValue=void 0,this.label=void 0,this.secondaryLabel=void 0,this.bbox=void 0,this.padding=void 0}};function nodeSize(t){return t.children.length>0?t.sumSize-t.sizeValue:t.sizeValue}var textAlignFactors2={left:0,center:.5,right:1},verticalAlignFactors4={top:0,middle:.5,bottom:1},DistantGroup=class extends import_ag_charts_community278._ModuleSupport.Group{distanceSquared(t,e){return this.getBBox().distanceSquared(t,e)}},TreemapSeries=class extends import_ag_charts_community278._ModuleSupport.HierarchySeries{constructor(){super(...arguments),this.NodeClass=TreemapNode,this.properties=new TreemapSeriesProperties,this.rectGroup=this.contentGroup.appendChild(new Group21),this.datumSelection=Selection18.select(this.rectGroup,Rect9),this.labelSelection=Selection18.select(this.labelGroup,Group21),this.highlightSelection=Selection18.select(this.rectGroup,Rect9)}groupTitleHeight(t,e){const{labelValue:i}=t,{label:o}=this.properties.group,s=3;if(i!=null){if(o.fontSize>e.width/s||o.fontSize>e.height/s)return;{const{height:a}=(0,import_ag_charts_core118.cachedTextMeasurer)(o).measureLines(i);return Math.max(a,o.fontSize)}}}getNodePadding(t,e){if(t.parent==null)return{top:0,right:0,bottom:0,left:0};if(t.children.length===0){const{padding:r}=this.properties.tile;return{top:r,right:r,bottom:r,left:r}}const{label:{spacing:i},padding:o}=this.properties.group,s=this.groupTitleHeight(t,e),a=s==null?0:s+i;return{top:o+a,right:o,bottom:o,left:o}}sortChildren({children:t}){const e=Array.from(t,(o,s)=>s).filter(o=>nodeSize(t[o])>0).sort((o,s)=>nodeSize(t[s])-nodeSize(t[o]));return{sortedChildrenIndices:e,childAt:o=>{const s=e[o];return t[s]}}}squarify(t,e){const{datum:i,children:o}=t;if(e.width<=0||e.height<=0){t.bbox=void 0,t.padding=void 0,t.midPoint.x=Number.NaN,t.midPoint.y=Number.NaN;return}const s=i==null?{top:0,right:0,bottom:0,left:0}:this.getNodePadding(t,e);t.parent==null?(t.bbox=void 0,t.padding=void 0,t.midPoint.x=Number.NaN,t.midPoint.y=Number.NaN):(t.bbox=e,t.padding=s,t.midPoint.x=e.x+e.width/2,t.midPoint.y=e.y);const{sortedChildrenIndices:a,childAt:r}=this.sortChildren(t),n=a.every(v=>o[v].children.length===0),l=1,c=e.width-s.left-s.right,h=e.height-s.top-s.bottom;if(c<=0||h<=0)return;const d=a.length;let u=0,p=0,g=1/0,y=a.reduce((v,M)=>v+nodeSize(o[M]),0);const f=new BBox28(e.x+s.left,e.y+s.top,c,h),x=f.clone();let b=0;for(;b({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),a=s(t),r=s(e),n=["top","right","bottom","left"];for(const l of n)(0,import_ag_charts_core118.isNumberEqual)(a[l],r[l])||e.shrink(o,l)}createNodeData(){}getItemStyle(t,e,i){const{properties:o,colorScale:s}=this,{itemStyler:a}=o,r=t.datumIndex?.[0]??0,n=e?o.fills:o.undocumentedGroupFills,l=e?o.strokes:o.undocumentedGroupStrokes,c=e?r:t.depth??-1,h=i?o.highlightStyle.getStyle(e):void 0,d=mergeDefaults22(h,o.getStyle(e,n,l,c));!i&&e&&t.colorValue!=null&&(d.fill=s.convert(t.colorValue));let u=d;if(a!=null&&t!=null){const p=this.cachedDatumCallback(createDatumId22(this.getDatumId(t),i?"highlight":"node"),()=>{const g=this.makeItemStylerParams(t,i,u);return this.callWithContext(a,g)});p&&(u=mergeDefaults22(p,u))}return u}makeItemStylerParams(t,e,i){const{id:o}=this,s=this.ctx.highlightManager?.getActiveHighlight(),a=this.getHighlightStateString(s,e,t.datumIndex),r=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:o,datum:t.datum,depth:t.depth??-1,highlighted:e,highlightState:a,...i,fill:r}}updateSelections(){let t=this.ctx.highlightManager?.getActiveHighlight();if(t!=null&&!this.properties.group.interactive&&t.children.length!==0&&(t=void 0),this.highlightSelection.update(t==null?[]:[t],void 0,s=>this.getDatumId(s)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:e}=this.chart??{};if(!e)return;const i=Array.from(this.rootNode),o=s=>{s.append([new Text10({tag:0}),new Text10({tag:1})])};this.datumSelection.update(i,void 0,s=>this.getDatumId(s)),this.labelSelection.update(i,o,s=>this.getDatumId(s))}updateNodes(){const{rootNode:t,data:e}=this,{childrenKey:i,colorKey:o,colorName:s,labelKey:a,secondaryLabelKey:r,sizeKey:n,sizeName:l,highlightStyle:c,tile:h,group:d}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!e)return;this.rootNode?.walk(m=>{const{datum:S,depth:v,children:M}=m,D=M.length===0,k=D?h.label:d.label;let _;if(k.enabled&&S!=null&&v!=null&&a!=null){const w=S[a];_=this.getLabelText(w,S,a,"label",[],k,{depth:v,datum:S,childrenKey:i,colorKey:o,colorName:s,labelKey:a,secondaryLabelKey:r,sizeKey:n,sizeName:l,value:w})}_===""&&(_=void 0);let T;if(h.secondaryLabel.enabled&&D&&S!=null&&v!=null&&r!=null){const w=S[r];T=this.getLabelText(w,S,r,"secondaryLabel",[],h.secondaryLabel,{depth:v,datum:S,childrenKey:i,colorKey:o,colorName:s,labelKey:a,secondaryLabelKey:r,sizeKey:n,sizeName:l,value:w})}T===""&&(T=void 0),m.labelValue=(0,import_ag_charts_core118.toPlainText)(_),m.secondaryLabelValue=(0,import_ag_charts_core118.toPlainText)(T)});const{width:p,height:g}=u;this.squarify(t,new BBox28(0,0,p,g)),this.rootNode?.walk(m=>{const{bbox:S,children:v,labelValue:M,secondaryLabelValue:D}=m;if(m.label=void 0,m.secondaryLabel=void 0,S!=null)if(v.length===0){const k={width:S.width,height:S.height,meta:null},_=formatLabels(M,this.properties.tile.label,D,this.properties.tile.secondaryLabel,{padding:h.padding},()=>k);if(_==null)return;const{height:T,label:w,secondaryLabel:R}=_,{textAlign:F,verticalAlign:O,padding:E}=h,I=textAlignFactors2[F]??.5,C=S.x+E+(S.width-2*E)*I,L=verticalAlignFactors4[O]??.5,A=S.y+E+T*.5+(S.height-2*E-T)*L;if(w!=null){const{fontStyle:P="normal",fontFamily:z,fontWeight:B="normal",color:V="black"}=this.properties.tile.label;m.label={text:w.text,fontSize:w.fontSize,lineHeight:w.lineHeight,fontStyle:P,fontFamily:z,fontWeight:B,color:V,textAlign:F,verticalAlign:"middle",x:C,y:A-(T-w.height)*.5}}if(R!=null){const{fontStyle:P="normal",fontFamily:z,fontWeight:B="normal",color:V="black"}=this.properties.tile.secondaryLabel;m.secondaryLabel={text:R.text,fontSize:R.fontSize,lineHeight:R.fontSize,fontStyle:P,fontFamily:z,fontWeight:B,color:V,textAlign:F,verticalAlign:"middle",x:C,y:A+(T-R.height)*.5}}}else{if(M==null)return;{const{padding:k,textAlign:_}=d,T=this.groupTitleHeight(m,S);if(T==null)return;const w=S.width-2*k,R=(0,import_ag_charts_core118.wrapText)(M,{maxWidth:S.width-2*k,font:d.label,textWrap:"never"}),F=textAlignFactors2[_]??.5,{fontStyle:O="normal",fontFamily:E,fontWeight:I="normal",color:C="black"}=this.properties.group.label;m.label={text:R,fontSize:d.label.fontSize,lineHeight:(0,import_ag_charts_core118.calcLineHeight)(d.label.fontSize),fontStyle:O,fontFamily:E,fontWeight:I,color:C,textAlign:_,verticalAlign:"middle",x:S.x+k+w*F,y:S.y+k+T*.5}}}});const y={series:new BBox28(0,0,p,g),axis:new BBox28(0,0,p,g)},f=(m,S,v)=>{const{bbox:M}=m;if(M==null){S.visible=!1;return}const{depth:D=-1}=m,k=m.children.length===0,_=this.getItemStyle(m,k,v);S.crisp=!0,applyShapeStyle20(S,_,y),S.cornerRadius=k?h.cornerRadius:d.cornerRadius,S.zIndex=[0,D,v?1:0];const T=m.parent?.children.every(F=>F.children.length===0),w=m.parent==null?void 0:m.parent.bbox,R=m.parent==null?void 0:m.parent.padding;T===!0&&w!=null&&R!=null?(S.clipBBox=M,S.x=w.x+R.left,S.y=w.y+R.top,S.width=w.width-(R.left+R.right),S.height=w.height-(R.top+R.bottom)):(S.clipBBox=void 0,S.x=M.x,S.y=M.y,S.width=M.width,S.height=M.height),S.visible=!0};this.datumSelection.each((m,S)=>f(S,m,!1)),this.highlightSelection.each((m,S)=>{f(S,m,!0)});const x=(m,S,v,M)=>{const D=m.children.length===0,k=v===0?m.label:m.secondaryLabel;if(k==null){S.visible=!1;return}const _=v===0?h.label:h.secondaryLabel;let T;if(M){const{tile:O,group:E}=c;T=O.secondaryLabel.color,D?v===0&&(T=O.label.color):T=E.label.color}const w={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:m.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},R=this.ctx.highlightManager?.getActiveHighlight(),F=getLabelStyles8(this,m,w,_,M,R);S.text=k.text,S.fontSize=k.fontSize,S.lineHeight=k.lineHeight,S.fontStyle=k.fontStyle,S.fontFamily=k.fontFamily,S.fontWeight=k.fontWeight,S.fill=T??k.color,S.fillOpacity=this.getHighlightStyle(M,m.datumIndex)?.opacity??1,S.textAlign=k.textAlign,S.textBaseline=k.verticalAlign,S.x=k.x,S.y=k.y,S.setBoxing(F),S.visible=!0,S.zIndex=1},b=this.ctx.highlightManager?.getActiveHighlight();for(const m of this.labelSelection.selectByClass(Text10)){const S=m.closestDatum();x(S,m,m.tag,S===b)}}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);return e.sort((i,o)=>o.datumIndex.length-i.datumIndex.length),e}pickNodeClosestDatum(t){const e=this.pickNodesExactShape(t);return e.length!==0?{datum:e[0],distance:0}:this.pickNodeNearestDistantObject(t,this.datumSelection.nodes())}getTooltipContent(t){const{id:e,properties:i,ctx:o}=this,{formatManager:s}=o,{labelKey:a,secondaryLabelKey:r,childrenKey:n,sizeKey:l,sizeName:c,colorKey:h,colorName:d,tooltip:u}=i,p=t.reduce((_,T)=>_?.children[T],this.rootNode);if(p==null)return;const{datum:g,depth:y,children:f}=p;if(g==null||y==null)return;const x=f.length===0,b=[],m=l==null?void 0:g[l];if(m!=null){const _=[0,this.rootNode?.sumSize??0],T=s.format(this.callWithContext.bind(this),{type:"number",value:m,datum:g,seriesId:e,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:_,fractionDigits:void 0});b.push({label:c,fallbackLabel:l,value:T??formatValue3(m)})}const S=h==null?void 0:g[h];if(S!=null){const{colorDomain:_}=this,T=s.format(this.callWithContext.bind(this),{type:"number",value:S,datum:g,seriesId:e,legendItemName:void 0,key:h,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:_,fractionDigits:void 0});b.push({label:d,fallbackLabel:h,value:T??formatValue3(S)})}const v=this.getItemStyle({...p,colorValue:S??p.colorValue},x,!1),D={shape:"square",fill:v.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};import_ag_charts_community278._ModuleSupport.isGradientFill(D.fill)&&(D.fill={...D.fill,gradient:"linear",rotation:0,reverse:!1});const k=x?{marker:D}:void 0;return this.formatTooltipWithContext(u,{title:a==null?void 0:g[a],symbol:k,data:b},{seriesId:e,datum:g,title:void 0,depth:y,labelKey:a,secondaryLabelKey:r,childrenKey:n,sizeKey:l,sizeName:c,colorKey:h,colorName:d,...v})}computeFocusBounds(t){return Transformable4.toCanvas(this.contentGroup,t.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};TreemapSeries.className="TreemapSeries",TreemapSeries.type="treemap";var import_ag_charts_community279=require("ag-charts-community"),import_ag_charts_core119=require("ag-charts-core"),{commonSeriesOptionsDefs:commonSeriesOptionsDefs23,treemapSeriesThemeableOptionsDef,without:without9}=import_ag_charts_community279._ModuleSupport,treemapSeriesOptionsDef={...treemapSeriesThemeableOptionsDef,...without9(commonSeriesOptionsDefs23,["highlightStyle","highlight","showInLegend"]),type:(0,import_ag_charts_core119.required)((0,import_ag_charts_core119.constant)("treemap")),labelKey:import_ag_charts_core119.string,secondaryLabelKey:import_ag_charts_core119.string,childrenKey:import_ag_charts_core119.string,sizeKey:import_ag_charts_core119.string,colorKey:import_ag_charts_core119.string,sizeName:import_ag_charts_core119.string,colorName:import_ag_charts_core119.string};treemapSeriesOptionsDef.undocumentedGroupFills=(0,import_ag_charts_core119.undocumented)((0,import_ag_charts_core119.arrayOf)(import_ag_charts_core119.color)),treemapSeriesOptionsDef.undocumentedGroupStrokes=(0,import_ag_charts_core119.undocumented)((0,import_ag_charts_core119.arrayOf)(import_ag_charts_core119.color));var{FONT_SIZE_RATIO:FONT_SIZE_RATIO4}=import_ag_charts_community280._ModuleSupport,TreemapModule={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"treemap",moduleFactory:t=>new TreemapSeries(t),solo:!0,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",import_ag_charts_community280._ModuleSupport.FILL_GRADIENT_LINEAR_DEFAULTS],["pattern",import_ag_charts_community280._ModuleSupport.FILL_PATTERN_DEFAULTS],["image",import_ag_charts_community280._ModuleSupport.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...import_ag_charts_community280._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"textColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},spacing:4},fill:void 0,stroke:void 0,strokeWidth:1,padding:4,gap:2,textAlign:"left"},tile:{label:{...import_ag_charts_community280._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:FONT_SIZE_RATIO4.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...import_ag_charts_community280._ModuleSupport.LABEL_BOXING_DEFAULTS,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:FONT_SIZE_RATIO4.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"never",overflowStrategy:"ellipsis"},fill:void 0,stroke:void 0,strokeWidth:{$isUserOption:["../strokes/0",2,{$isUserOption:["./stroke",2,0]}]},padding:3,gap:1},highlightStyle:{group:{label:{color:{$ref:"textColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2},tile:{label:{color:{$ref:"chartBackgroundColor"}},secondaryLabel:{color:{$ref:"chartBackgroundColor"}},fill:"rgba(255,255,255, 0.33)",stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},gradientLegend:{enabled:!0,...import_ag_charts_community280._ModuleSupport.LEGEND_CONTAINER_THEME}}},TreemapSeriesModule={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,options:treemapSeriesOptionsDef,create:t=>new TreemapSeries(t)},ModuleRegistry=import_ag_charts_community281._ModuleSupport.ModuleRegistry,AllCartesianEnterpriseModules=[OrdinalTimeAxisModule2,BoxPlotSeriesModule,CandlestickSeriesModule,ConeFunnelSeriesModule,FunnelSeriesModule,HeatmapSeriesModule,OhlcSeriesModule,RangeAreaSeriesModule,RangeBarSeriesModule,WaterfallSeriesModule],AllPolarEnterpriseModules=[AngleNumberAxisModule2,AngleCategoryAxisModule2,RadiusNumberAxisModule2,RadiusCategoryAxisModule2,NightingaleSeriesModule,RadarAreaSeriesModule,RadarLineSeriesModule,RadialBarSeriesModule,RadialColumnSeriesModule],AllStandaloneEnterpriseModules=[StandaloneChartModule,PyramidSeriesModule,LinearGaugeSeriesModule,RadialGaugeSeriesModule,SunburstSeriesModule,TreemapSeriesModule,ChordSeriesModule,SankeySeriesModule],AllTopologyEnterpriseModules=[TopologyChartModule,MapLineSeriesModule,MapLineBackgroundSeriesModule,MapMarkerSeriesModule,MapShapeSeriesModule,MapShapeBackgroundSeriesModule],AllEnterpriseModules=[...AllCartesianEnterpriseModules,...AllPolarEnterpriseModules,...AllStandaloneEnterpriseModules,...AllTopologyEnterpriseModules,AnnotationsModule2,NavigatorModule2,InitialStateModule],styles_default=`.ag-watermark{position:absolute;bottom:20px;right:25px;font-weight:700;font-family:Impact,sans-serif;font-size:19px;opacity:.7;animation:1s ease-out 3s ag-watermark-fadeout;color:#9b9b9b;pointer-events:none;&:before{content:"";display:block;height:40px;width:170px;background-image:url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=);background-repeat:no-repeat;background-size:170px 40px}>span{padding-left:.7rem}}@keyframes ag-watermark-fadeout{0%{opacity:.5}to{opacity:0}}.ag-charts-dialog{display:flex;flex-direction:column;font-size:var(--ag-charts-chrome-font-size-large)}.ag-charts-dialog__tabs{display:flex;flex-direction:column}.ag-charts-dialog__header{border-bottom:1px solid var(--ag-charts-border-color);display:flex}.ag-charts-dialog__tab-list{display:flex;gap:calc(var(--ag-charts-spacing) * 2)}.ag-charts-dialog__drag-handle{align-items:center;color:inherit;cursor:grab;display:flex;padding:1px 6px;text-align:center}.ag-charts-dialog__drag-handle--dragging{cursor:grabbing}.ag-charts-dialog__tab-button{background:none;border:0;border-bottom:2px solid transparent;border-radius:0;color:var(--ag-charts-panel-subtle-text-color);margin-bottom:-1px;padding:var(--input-padding) calc(var(--input-padding) / 2)}.ag-charts-dialog__tab-button:hover{background:none}.ag-charts-dialog__tab-button--active{border-color:var(--ag-charts-accent-color);color:inherit}.ag-charts-dialog__drag-handle+.ag-charts-dialog__tab-button{margin-left:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-left:auto;padding:1px 6px}.ag-charts-dialog__close-button:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-dialog__tab-panel{display:none;flex-direction:column;gap:calc(var(--ag-charts-spacing) * 4);margin:0 calc(var(--ag-charts-spacing) * 4);padding:calc(var(--ag-charts-spacing) * 4) 0}.ag-charts-dialog__tab-panel--active{display:flex}.ag-charts-dialog__input-group-line{display:flex;gap:16px 18px;flex-wrap:wrap}.ag-charts-dialog__input-group{align-items:center;display:flex;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-dialog__input-group-label{color:var(--ag-charts-panel-subtle-text-color);margin-right:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-right:-1px}.ag-charts-dialog__button.ag-charts-dialog__button--active{background:var(--ag-charts-button-focus-background-color);border-color:var(--ag-charts-input-focus-border-color);color:var(--ag-charts-input-focus-text-color);z-index:var(--input-layer-active)}.ag-charts-dialog__button:first-child,.ag-charts-dialog__input-group-label+.ag-charts-dialog__button{border-bottom-left-radius:var(--ag-charts-input-border-radius);border-top-left-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-bottom-right-radius:var(--ag-charts-input-border-radius);border-top-right-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__color-picker-button{--color: #000;background:var(--color);border:none;color:transparent;height:26px;width:26px}.ag-charts-dialog__color-picker-button:hover{background:var(--color)}.ag-charts-dialog__color-picker-button--multi-color,.ag-charts-dialog__color-picker-button--multi-color:hover{background:linear-gradient(135deg,red 0%,#ff0 calc(100% * 1 / 6),#0f0 calc(100% * 2 / 6),#0ff 50%,#00f calc(100% * 4 / 6),#f0f calc(100% * 5 / 6),red 100%)}.ag-charts-color-picker{width:190px;padding:8px;cursor:default;--h: 0;--s: 0;--v: 0;--a: 0;--color: #000;--color-a: #000;--thumb-size: 18px;--inner-width: 172px;--track-height: 12px;--palette-height: 136px;--checker: url('data:image/svg+xml;utf8,');--multi-color: linear-gradient( 135deg, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-color-picker__content{display:flex;flex-direction:column}.ag-charts-color-picker__palette{position:relative;width:100%;height:var(--palette-height);margin-bottom:8px;background:linear-gradient(to bottom,#0000,#000),linear-gradient(to right,#fff,#fff0) hsl(var(--h),100%,50%);border-radius:calc(var(--ag-charts-border-radius) * 1.5);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__palette:after{content:"";position:absolute;display:block;top:calc(var(--thumb-size) * -.5 + (1 - var(--v)) * 100%);left:calc(var(--thumb-size) * -.5 + var(--s) * 100%);background:var(--color);width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__palette:focus-visible:after{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),0 0 0 2px #fff8,var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-row{display:flex;gap:8px;align-items:center;margin-bottom:4px;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input,.ag-charts-color-picker__alpha-input{-webkit-appearance:none;display:block;position:relative;padding:0;margin:0 calc(var(--inset) * -1);border:0;height:var(--thumb-size);width:auto;background:transparent;--inset: calc((var(--thumb-size) - var(--track-height)) / 2)}.ag-charts-color-picker__hue-input::-moz-range-thumb,.ag-charts-color-picker__alpha-input::-moz-range-thumb{appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038}.ag-charts-color-picker__hue-input::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{-webkit-appearance:none;width:var(--thumb-size);height:var(--thumb-size);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:var(--box-shadow);--box-shadow: inset 0 0 0 3px white, inset 0 0 1px 3px #0006, 0 0 5px #00000038;transform:translateZ(0)}.ag-charts-color-picker__hue-input::-moz-range-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__hue-input::-webkit-slider-thumb{background:hsl(var(--h),100%,50%)}.ag-charts-color-picker__alpha-input::-moz-range-thumb{background:transparent}.ag-charts-color-picker__alpha-input::-webkit-slider-thumb{background:transparent}.ag-charts-color-picker__alpha-input--opaque::-moz-range-thumb{background:var(--color)}.ag-charts-color-picker__alpha-input--opaque::-webkit-slider-thumb{background:var(--color)}.ag-charts-color-picker__hue-input:focus-visible::-moz-range-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-moz-range-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input:focus-visible::-webkit-slider-thumb,.ag-charts-color-picker__alpha-input:focus-visible::-webkit-slider-thumb{outline:var(--ag-charts-focus-border);box-shadow:var(--box-shadow),var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__hue-input::-moz-range-track,.ag-charts-color-picker__alpha-input::-moz-range-track{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__hue-input:before,.ag-charts-color-picker__alpha-input:before{position:absolute;content:"";display:block;top:calc(50% - var(--track-height) / 2);left:var(--inset);right:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button{width:36px;margin-left:var(--inset);height:var(--track-height);border-radius:calc(var(--ag-charts-border-radius) * 99);border:0;background:var(--multi-color);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__multi-color-button--hidden{display:none}.ag-charts-color-picker__multi-color-button--active{box-shadow:inset 0 0 0 1px #0003;outline-offset:1px;outline:2px solid #2196f3}.ag-charts-color-picker__hue-input{flex:1 0 0}.ag-charts-color-picker__hue-input::-moz-range-track{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__hue-input:before{background:linear-gradient(to right,red,red calc((100% - var(--track-height)) * 0 / 6 + var(--track-height) / 2),#ff0 calc((100% - var(--track-height)) * 1 / 6 + var(--track-height) / 2),#0f0 calc((100% - var(--track-height)) * 2 / 6 + var(--track-height) / 2),#0ff calc((100% - var(--track-height)) * 3 / 6 + var(--track-height) / 2),#00f calc((100% - var(--track-height)) * 4 / 6 + var(--track-height) / 2),#f0f calc((100% - var(--track-height)) * 5 / 6 + var(--track-height) / 2),red calc((100% - var(--track-height)) * 6 / 6 + var(--track-height) / 2))}.ag-charts-color-picker__alpha-input{margin-bottom:7px}.ag-charts-color-picker__alpha-input::-moz-range-track{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__alpha-input:before{background:linear-gradient(to right,transparent,var(--color)),var(--checker) top left / 4px 4px}.ag-charts-color-picker__color-field{display:flex;border:var(--ag-charts-border);background:var(--ag-charts-background-color);border-radius:var(--ag-charts-border-radius);overflow:hidden}.ag-charts-color-picker__color-field:has(:focus-visible){border-color:var(--ag-charts-accent-color);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-color-picker__color-label{width:16px;height:16px;margin:7px 0 7px 7px;color:transparent;background:linear-gradient(to right,var(--color-a),var(--color-a)),var(--checker) top left / 4px 4px;border-radius:calc(var(--ag-charts-border-radius) / 2);box-shadow:inset 0 0 0 1px #0003}.ag-charts-color-picker__color-label--multi-color{background:var(--multi-color)}.ag-charts-color-picker__color-input{flex:1;min-width:0;padding:7px 7px 7px 8px;border:0;margin:0;color:inherit;background:transparent;font-variant:tabular-nums}.ag-charts-color-picker__color-input:focus-visible{border:none;outline:none}.ag-charts-annotations__line-stroke-width-menu,.ag-charts-annotations__line-style-type-menu,.ag-charts-annotations__text-size-menu{border-top-left-radius:0;border-top-right-radius:0;.ag-charts-menu__row:first-child{border-radius:0}}.ag-charts-annotations__text-size-menu{--item-padding: 4px 8px;min-width:34px;text-align:center}.ag-charts-annotations__line-stroke-width-menu{--item-padding: 6px;column-gap:6px}.ag-charts-annotations__line-style-type-menu{--item-padding: 6px;column-gap:0}.ag-charts-annotations__stroke-width-button:before{background:var(--ag-charts-foreground-color);content:"";margin-right:var(--toolbar-button-padding);height:min(var(--stroke-width),20px);width:12px}.ag-charts-annotations__stroke-width-button[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-annotations__color-picker-button{--emblem: var(--color)}.ag-charts-annotations__color-picker-button--multi-color{--emblem: linear-gradient( to right, #f00 0% , #ff0 calc(100% * 1 / 6), #0f0 calc(100% * 2 / 6), #0ff 50% , #00f calc(100% * 4 / 6), #f0f calc(100% * 5 / 6), #f00 100% )}.ag-charts-annotations__color-picker-button:after{content:"";display:block;position:absolute;bottom:3px;left:5px;right:5px;height:4px;border-radius:99px;box-shadow:inset 0 0 0 1px color-mix(in srgb,var(--ag-charts-foreground-color) 10%,transparent);background:var(--emblem)}.ag-charts-annotations__color-picker-button[aria-disabled=true]:after{filter:grayscale(1);opacity:.5}.ag-charts-annotations__toolbar-menu{min-width:200px}.ag-charts-annotations__axis-button--hidden{display:none}.ag-charts-annotations__axis-button{background-color:var(--ag-charts-crosshair-label-background-color);border-radius:calc(var(--ag-charts-border-radius) / 2);border:none;box-sizing:border-box;color:var(--ag-charts-crosshair-label-text-color);cursor:pointer;font-family:var(--ag-charts-button-font-family);font-size:var(--ag-charts-button-font-size);font-weight:var(--ag-charts-button-font-weight);left:0;line-height:16px;overflow:hidden;padding:0;position:absolute;top:0;user-select:none;white-space:nowrap;z-index:var(--ag-charts-layer-annotations)}.ag-charts-annotations__axis-button:hover{opacity:.8;color:var(--ag-charts-background-color)}.ag-charts-dialog--annotation-settings{min-height:233px;width:289px}.ag-charts-dialog--annotation-settings .ag-charts-textarea{height:calc(10px * 2 + var(--textarea-line-height) * 1em * 3 + 2px);overflow-y:auto;resize:vertical}.ag-charts-context-menu{font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-context-menu__cover{position:fixed;left:0;top:0}.ag-charts-context-menu__menu{background:var(--ag-charts-menu-background-color);border-radius:var(--ag-charts-border-radius);border:var(--ag-charts-menu-border);box-shadow:var(--ag-charts-popup-shadow);color:var(--ag-charts-menu-text-color);display:flex;flex-direction:column;padding:.5em 0;transition:transform .1s ease;white-space:nowrap}.ag-charts-context-menu__menu:focus{outline:none}.ag-charts-context-menu__item{align-items:center;background:none;border:none;box-sizing:border-box;color:inherit;cursor:pointer;display:flex;font:inherit;justify-content:space-between;text-align:left;width:100%;-webkit-appearance:none;-moz-appearance:none}.ag-charts-context-menu__icon>img{width:var(--ag-charts-icon-size);height:var(--ag-charts-icon-size)}.ag-charts-context-menu__icon,.ag-charts-context-menu__cell{display:flex;align-items:center;flex-shrink:0}.ag-charts-context-menu__cell{flex-grow:1}.ag-charts-context-menu__cellpadding{padding:.5em 1em}.ag-charts-context-menu__icon{padding-right:0}.ag-charts-context-menu__item[data-focus-override=true],.ag-charts-context-menu__item:focus,.ag-charts-context-menu__item:active{background:var(--ag-charts-focus-color)}.ag-charts-context-menu__item[data-focus-override=false]{background:inherit}.ag-charts-context-menu__item[data-focus-visible-override=true]:focus,.ag-charts-context-menu__item:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:calc(var(--ag-charts-layer-ui-overlay) + 1)}.ag-charts-context-menu__item[data-focus-visible-override=false]{outline:inherit;box-shadow:inherit;z-index:inherit}.ag-charts-context-menu__item[aria-disabled=true]{border:none;color:color-mix(in srgb,var(--ag-charts-input-text-color) 50%,transparent)}.ag-charts-context-menu__item[aria-disabled=true]:focus{background:inherit;cursor:inherit}.ag-charts-context-menu__divider{padding:5px 0}.ag-charts-context-menu__divider:after{content:"";display:block;border-top:1px solid var(--ag-charts-border-color)}.ag-charts-crosshair-label{position:absolute;left:0;top:0;user-select:none;pointer-events:none;font-family:var(--ag-charts-font-family);font-size:var(--ag-charts-font-size);font-weight:var(--ag-charts-font-weight);overflow:hidden;white-space:nowrap;z-index:var(--ag-charts-layer-crosshair);box-sizing:border-box}.ag-charts-crosshair-label-content{padding:0 8px;border-radius:calc(var(--ag-charts-border-radius) / 2);line-height:calc(var(--ag-charts-font-size) + 8px);background-color:var(--ag-charts-crosshair-label-background-color);color:var(--ag-charts-crosshair-label-text-color)}.ag-charts-crosshair-label--hidden{visibility:hidden!important}.ag-charts-text-input{position:absolute}.ag-charts-text-input__textarea{--placeholder-text-color: var(--ag-charts-input-placeholder-text-color);display:block;height:100%;width:100%;border:0;background:none;line-height:1.38;outline:none;transform:translateY(.09em)}.ag-charts-text-input__textarea[placeholder]:empty:before{content:attr(placeholder);color:var(--placeholder-text-color);font-weight:400}.ag-charts-text-input__textarea[placeholder]:not(:empty):before{content:""}.ag-charts-chart-toolbar__menu{min-width:200px}.ag-charts-range-buttons .ag-charts-toolbar__button{padding:var(--toolbar-button-padding) calc(var(--toolbar-button-padding) * 1.5)}.ag-charts-zoom-buttons{align-items:center;display:flex;height:44px;justify-content:center;overflow:hidden;padding-bottom:10px;pointer-events:none;width:100%;.ag-charts-toolbar{--toolbar-size: 24px;--toolbar-button-padding: 1px;display:flex;font-size:var(--ag-charts-chrome-font-size);height:var(--toolbar-size);justify-content:center;opacity:1;pointer-events:auto;transition:opacity .2s ease-in-out,transform .4s ease-in-out;.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-left:var(--ag-charts-spacing);padding-right:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-left:0}.ag-charts-toolbar__button--gap{margin-left:var(--toolbar-gap)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{gap:var(--toolbar-gap);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}}
+`;import_ag_charts_community282._ModuleSupport.ModuleRegistry.registerMany(AllEnterpriseModules,import_ag_charts_community282.VERSION);function setupEnterpriseModules(){import_ag_charts_community282._ModuleSupport.moduleRegistry.register(AngleCategoryAxisModule,AngleNumberAxisModule,AnimationModule,AnnotationsModule,BackgroundModule,ForegroundModule,BoxPlotModule,CandlestickModule,ChordModule,ConeFunnelModule,FunnelModule,OhlcModule,ChartToolbarModule,ContextMenuModule,CrosshairModule,BandHighlightModule,DataSourceModule,ErrorBarsModule,LinearGaugeModule,MapLineModule,MapLineBackgroundModule,MapMarkerModule,MapShapeModule,MapShapeBackgroundModule,NavigatorModule,StatusBarModule,GradientLegendModule,HeatmapModule,NightingaleModule,OrdinalTimeAxisModule,RadarAreaModule,RadarLineModule,RadialBarModule,RadialColumnModule,RadiusCategoryAxisModule,RadialGaugeModule,RadiusNumberAxisModule,RangeBarModule,RangeAreaModule,RangesModule,PyramidModule,SankeyModule,SharedToolbarModule,SunburstModule,SyncModule,TreemapModule,WaterfallModule,ZoomModule),import_ag_charts_community282._ModuleSupport.enterpriseModule.isEnterprise=!0,import_ag_charts_community282._ModuleSupport.enterpriseModule.styles=styles_default,import_ag_charts_community282._ModuleSupport.enterpriseModule.licenseManager=t=>new LicenseManager(t.container?.ownerDocument??(typeof document>"u"?void 0:document)),import_ag_charts_community282._ModuleSupport.enterpriseModule.injectWatermark=injectWatermark}__reExport(main_exports,require("ag-charts-community"),module.exports),setupEnterpriseModules();var LicenseManager2={setLicenseKey(t){LicenseManager.setLicenseKey(t)}};function setupEnterpriseModules2(){setupEnterpriseModules(),(0,import_ag_charts_community283.setupCommunityModules)()}var AgChartsEnterpriseModule={VERSION:import_ag_charts_community283.VERSION,_Scene:import_ag_charts_community283._Scene,_Theme:import_ag_charts_community283._Theme,_Util:import_ag_charts_community283._Util,create:import_ag_charts_community283.AgCharts.create.bind(import_ag_charts_community283.AgCharts),createSparkline:import_ag_charts_community283.AgCharts.__createSparkline.bind(import_ag_charts_community283.AgCharts),setup:setupEnterpriseModules2,setGridContext:LicenseManager.setGridContext.bind(LicenseManager),setLicenseKey:LicenseManager.setLicenseKey.bind(LicenseManager),isEnterprise:!0};
diff --git a/yuthon_report/static/src/lib/ag-chart/dist/package/main.esm.min.mjs b/yuthon_report/static/src/lib/ag-chart/dist/package/main.esm.min.mjs
new file mode 100644
index 000000000..f13d08575
--- /dev/null
+++ b/yuthon_report/static/src/lib/ag-chart/dist/package/main.esm.min.mjs
@@ -0,0 +1,8 @@
+var Vk=Object.defineProperty,Wk=Object.getOwnPropertyDescriptor,d=(e,t,i,o)=>{for(var s=o>1?void 0:o?Wk(t,i):t,a=e.length-1,n;a>=0;a--)(n=e[a])&&(s=(o?n(t,i,s):n(s))||s);return o&&s&&Vk(t,i,s),s};import{AgCharts as Sr,VERSION as Gk,_Scene as Kk,_Theme as $k,_Util as jk,setupCommunityModules as Yk}from"ag-charts-community";var Uk=class{constructor(){this.ieCompatibility=!1}init(){this.ieCompatibility=this.md5("hello")!="5d41402abc4b2a76b9719d911017c592"}md5cycle(e,t){let i=e[0],o=e[1],s=e[2],a=e[3];i=this.ff(i,o,s,a,t[0],7,-680876936),a=this.ff(a,i,o,s,t[1],12,-389564586),s=this.ff(s,a,i,o,t[2],17,606105819),o=this.ff(o,s,a,i,t[3],22,-1044525330),i=this.ff(i,o,s,a,t[4],7,-176418897),a=this.ff(a,i,o,s,t[5],12,1200080426),s=this.ff(s,a,i,o,t[6],17,-1473231341),o=this.ff(o,s,a,i,t[7],22,-45705983),i=this.ff(i,o,s,a,t[8],7,1770035416),a=this.ff(a,i,o,s,t[9],12,-1958414417),s=this.ff(s,a,i,o,t[10],17,-42063),o=this.ff(o,s,a,i,t[11],22,-1990404162),i=this.ff(i,o,s,a,t[12],7,1804603682),a=this.ff(a,i,o,s,t[13],12,-40341101),s=this.ff(s,a,i,o,t[14],17,-1502002290),o=this.ff(o,s,a,i,t[15],22,1236535329),i=this.gg(i,o,s,a,t[1],5,-165796510),a=this.gg(a,i,o,s,t[6],9,-1069501632),s=this.gg(s,a,i,o,t[11],14,643717713),o=this.gg(o,s,a,i,t[0],20,-373897302),i=this.gg(i,o,s,a,t[5],5,-701558691),a=this.gg(a,i,o,s,t[10],9,38016083),s=this.gg(s,a,i,o,t[15],14,-660478335),o=this.gg(o,s,a,i,t[4],20,-405537848),i=this.gg(i,o,s,a,t[9],5,568446438),a=this.gg(a,i,o,s,t[14],9,-1019803690),s=this.gg(s,a,i,o,t[3],14,-187363961),o=this.gg(o,s,a,i,t[8],20,1163531501),i=this.gg(i,o,s,a,t[13],5,-1444681467),a=this.gg(a,i,o,s,t[2],9,-51403784),s=this.gg(s,a,i,o,t[7],14,1735328473),o=this.gg(o,s,a,i,t[12],20,-1926607734),i=this.hh(i,o,s,a,t[5],4,-378558),a=this.hh(a,i,o,s,t[8],11,-2022574463),s=this.hh(s,a,i,o,t[11],16,1839030562),o=this.hh(o,s,a,i,t[14],23,-35309556),i=this.hh(i,o,s,a,t[1],4,-1530992060),a=this.hh(a,i,o,s,t[4],11,1272893353),s=this.hh(s,a,i,o,t[7],16,-155497632),o=this.hh(o,s,a,i,t[10],23,-1094730640),i=this.hh(i,o,s,a,t[13],4,681279174),a=this.hh(a,i,o,s,t[0],11,-358537222),s=this.hh(s,a,i,o,t[3],16,-722521979),o=this.hh(o,s,a,i,t[6],23,76029189),i=this.hh(i,o,s,a,t[9],4,-640364487),a=this.hh(a,i,o,s,t[12],11,-421815835),s=this.hh(s,a,i,o,t[15],16,530742520),o=this.hh(o,s,a,i,t[2],23,-995338651),i=this.ii(i,o,s,a,t[0],6,-198630844),a=this.ii(a,i,o,s,t[7],10,1126891415),s=this.ii(s,a,i,o,t[14],15,-1416354905),o=this.ii(o,s,a,i,t[5],21,-57434055),i=this.ii(i,o,s,a,t[12],6,1700485571),a=this.ii(a,i,o,s,t[3],10,-1894986606),s=this.ii(s,a,i,o,t[10],15,-1051523),o=this.ii(o,s,a,i,t[1],21,-2054922799),i=this.ii(i,o,s,a,t[8],6,1873313359),a=this.ii(a,i,o,s,t[15],10,-30611744),s=this.ii(s,a,i,o,t[6],15,-1560198380),o=this.ii(o,s,a,i,t[13],21,1309151649),i=this.ii(i,o,s,a,t[4],6,-145523070),a=this.ii(a,i,o,s,t[11],10,-1120210379),s=this.ii(s,a,i,o,t[2],15,718787259),o=this.ii(o,s,a,i,t[9],21,-343485551),e[0]=this.add32(i,e[0]),e[1]=this.add32(o,e[1]),e[2]=this.add32(s,e[2]),e[3]=this.add32(a,e[3])}cmn(e,t,i,o,s,a){return t=this.add32(this.add32(t,e),this.add32(o,a)),this.add32(t<>>32-s,i)}ff(e,t,i,o,s,a,n){return this.cmn(t&i|~t&o,e,t,s,a,n)}gg(e,t,i,o,s,a,n){return this.cmn(t&o|i&~o,e,t,s,a,n)}hh(e,t,i,o,s,a,n){return this.cmn(t^i^o,e,t,s,a,n)}ii(e,t,i,o,s,a,n){return this.cmn(i^(t|~o),e,t,s,a,n)}md51(e){const t=e.length,i=[1732584193,-271733879,-1732584194,271733878];let o;for(o=64;o<=e.length;o+=64)this.md5cycle(i,this.md5blk(e.substring(o-64,o)));e=e.substring(o-64);const s=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];for(o=0;o>2]|=e.charCodeAt(o)<<(o%4<<3);if(s[o>>2]|=128<<(o%4<<3),o>55)for(this.md5cycle(i,s),o=0;o<16;o++)s[o]=0;return s[14]=t*8,this.md5cycle(i,s),i}md5blk(e){const t=[];for(let i=0;i<64;i+=4)t[i>>2]=e.charCodeAt(i)+(e.charCodeAt(i+1)<<8)+(e.charCodeAt(i+2)<<16)+(e.charCodeAt(i+3)<<24);return t}rhex(e){const t="0123456789abcdef".split("");let i="",o=0;for(;o<4;o++)i+=t[e>>o*8+4&15]+t[e>>o*8&15];return i}hex(e){for(let t=0;t>16)+(t>>16)+(i>>16)<<16|i&65535}};function mh(e){return e==null||e.length===0}var br={"01":"GRID","02":"CHARTS","0102":"BOTH"},ag="https://www.ag-grid.com/charts/licensing/",xh=class Ke{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new Uk,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(Ke.licenseKey,Ke.gridContext),i=`AG ${t.currentLicenseType==="BOTH"?"Grid and ":""}Charts Enterprise`;let o="";if(t.suppliedLicenseType==="BOTH"?o="AG Grid and AG Charts Enterprise":t.suppliedLicenseType==="GRID"?o="AG Grid Enterprise":t.suppliedLicenseType!==void 0&&(o="AG Charts Enterprise"),t.missing)(!this.isWebsiteUrl()||this.isForceWatermark())&&this.outputMissingLicenseKey(i);else if(t.expired){const s=Ke.getChartsReleaseDate(),a=Ke.formatDate(s);this.outputExpiredKey(t.expiry,a,o)}else t.valid?t.isTrial&&t.trialExpired&&this.outputExpiredTrialKey(t.expiry,i,o):this.outputInvalidLicenseKey(!!t.incorrectLicenseType,i,o)}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(Number.parseInt(Ke.decode(i),10))}static extractLicenseComponents(t){let i=t.replaceAll(/[\u200B-\u200D\uFEFF]/g,"");if(i=i.replaceAll(/\r?\n|\r/g,""),t.length<=32)return{md5:null,license:t,version:null,isTrial:null};const o=i.length-32,s=i.substring(o),a=i.substring(0,o),[n,r,l]=Ke.extractBracketedInformation(i);return{md5:s,license:a,version:n,isTrial:r,type:l}}getLicenseDetails(t,i=!1){const o="CHARTS";if(mh(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:o};const s=Ke.getChartsReleaseDate(),{md5:a,license:n,version:r,isTrial:l,type:c}=Ke.extractLicenseComponents(t);let h=a===this.md5.md5(n)&&!t.includes("For_Trialing_ag-Grid_Only"),p,u,g=null,y=!1,f;function x(){p=gg,r){case"legacy":case"2":{h=!1;break}case"3":mh(c)?h=!1:(f=c,c!==br["02"]&&c!==br["0102"]?(h=!1,y=!0):l&&x())}return h?{licenseKey:t,valid:h,expiry:Ke.formatDate(g),expired:u,version:r,isTrial:l,trialExpired:p,invalidLicenseTypeForCombo:i?f!=="BOTH":void 0,incorrectLicenseType:y,currentLicenseType:o,suppliedLicenseType:f}:{licenseKey:t,valid:h,incorrectLicenseType:y,currentLicenseType:o,suppliedLicenseType:f}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!mh(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??globalThis;if(!t)return"localhost";const i=t.location,{hostname:o=""}=i;return o}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??globalThis.window!=null?globalThis:void 0;if(!t)return!1;const{pathname:i}=t.location;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){const t=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)!==null}isLocalhost(){const t=this.getHostname();return/^(?:127\.0\.0\.1|localhost)$/.exec(t)!==null}isE2ETest(){const t=this.getHostname();return/^(?:172\.17\.0\.1|host\.docker\.internal)$/.exec(t)!==null}static formatDate(t){const i=["January","February","March","April","May","June","July","August","September","October","November","December"],o=t.getDate(),s=t.getMonth(),a=t.getFullYear();return o+" "+i[s]+" "+a}static getChartsReleaseDate(){return new Date(Number.parseInt(Ke.decode(Ke.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let o="",s,a,n,r,l,c,h,p=0;const u=t.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;p>4,a=(l&15)<<4|c>>2,n=(c&3)<<6|h,o=o+String.fromCodePoint(s),c!=64&&(o=o+String.fromCodePoint(a)),h!=64&&(o=o+String.fromCodePoint(n));return o=Ke.utf8_decode(o),o}static utf8_decode(t){t=t.replaceAll("rn","n");let i="";for(let o=0;o127&&s<2048?(i+=String.fromCodePoint(s>>6|192),i+=String.fromCodePoint(s&63|128)):(i+=String.fromCodePoint(s>>12|224),i+=String.fromCodePoint(s>>6&63|128),i+=String.fromCodePoint(s&63|128))}return i}static setGridContext(t=!1){Ke.gridContext=t}static setLicenseKey(t){this.licenseKey&&this.licenseKey!==t&&console.warn("License Key being set multiple times with different values. This can result in an incorrect license key being used."),Ke.licenseKey=t}static extractBracketedInformation(t){if(!t.includes("["))return["legacy",!1,void 0];const i=t.match(/\[(.*?)\]/g).map(r=>r.replace("[","").replace("]",""));if(!i||i.length===0)return["legacy",!1,void 0];const o=i.filter(r=>r==="TRIAL").length===1,s=i.find(r=>r.startsWith("v")),a=s?s.replace("v",""):"legacy",n=br[i.find(r=>br[r])];return[a,o,n]}centerPadAndOutput(t){const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",o=""){console.error(t.padEnd(this.totalMessageLength-o.length,i)+o)}outputInvalidLicenseKey(t,i,o){Ke.gridContext||(t?(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Incompatible License Key "),this.padAndOutput(`* Your license key is for ${o} only and does not cover you for ${i}.`," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${ag}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")):(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Invalid License Key "),this.padAndOutput("* Your license key is not valid."," ","*"),this.padAndOutput(`* To troubleshoot your license key visit ${ag}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,o){Ke.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${i} License `),this.centerPadAndOutput(" Trial Period Expired. "),this.padAndOutput(`* Your trial only license for ${o} expired on ${t}.`," ","*"),this.padAndOutput("* Please email info@ag-grid.com to purchase a license."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="Trial Period Expired"}outputMissingLicenseKey(t){Ke.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${t} License `),this.centerPadAndOutput(" License Key Not Found "),this.padAndOutput(`* All ${t} features are unlocked for trial.`," ","*"),this.padAndOutput("* If you want to hide the watermark please email info@ag-grid.com for a trial license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="For Trial Use Only"}outputExpiredKey(t,i,o){Ke.gridContext||(this.centerPadAndOutput(""),this.centerPadAndOutput(` ${o} License `),this.centerPadAndOutput(" Incompatible Software Version "),this.padAndOutput(`* Your license key works with versions of ${o} released before ${t}.`," ","*"),this.padAndOutput(`* The version you are trying to use was released on ${i}.`," ","*"),this.padAndOutput("* Please contact info@ag-grid.com to renew your license key."," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput("")),this.watermarkMessage="License Expired"}};xh.RELEASE_INFORMATION="MTc2MTcyODQ5OTU1NQ==",xh.gridContext=!1;var sa=xh;import{VERSION as Xk,_ModuleSupport as aa}from"ag-charts-community";import{_ModuleSupport as Zk}from"ag-charts-community";import{isNumberEqual as ng}from"ag-charts-core";function Sh(e,t,i){const o=(a,n,r,l)=>{let c=e[0];for(let h=a;r>0?h<=n:h>n;h+=r){const p=e[h];if(l(c,p))return!0;c=p}return!1},s=Math.floor(e.length/2);return o(t,s,t,i)?!0:o(e.length-t,s,-t,i)}import{_ModuleSupport as qk}from"ag-charts-community";var{AxisInterval:Qk,Property:Jk}=qk,bh=class extends Qk{};d([Jk],bh.prototype,"minSpacing",2);import{_ModuleSupport as vr}from"ag-charts-community";import{countFractionDigits as eD,isNumberEqual as na,wrapTextOrSegments as tD}from"ag-charts-core";import{_ModuleSupport as rg}from"ag-charts-community";import{isNumberEqual as lg}from"ag-charts-core";import{_ModuleSupport as iD}from"ag-charts-community";import{createId as oD}from"ag-charts-core";var{BaseProperties:cg,ChartAxisDirection:sD,Property:Ie,Group:vh,FONT_SIZE:aD}=iD,Si=class extends cg{constructor(){super(...arguments),this.fontSize=aD.LARGE,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};d([Ie],Si.prototype,"enabled",2),d([Ie],Si.prototype,"text",2),d([Ie],Si.prototype,"fontStyle",2),d([Ie],Si.prototype,"fontWeight",2),d([Ie],Si.prototype,"fontSize",2),d([Ie],Si.prototype,"fontFamily",2),d([Ie],Si.prototype,"padding",2),d([Ie],Si.prototype,"color",2),d([Ie],Si.prototype,"parallel",2);var vt=class extends cg{constructor(){super(...arguments),this.id=oD(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Si,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=sD.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new vh({name:this.id}),this.rangeGroup=new vh({name:this.id}),this.labelGroup=new vh({name:this.id}),this._isRange=void 0}assignCrossLineGroup(e,t){e!==this._isRange&&(e?this.rangeGroup.appendChild(t):this.lineGroup.appendChild(t)),this._isRange=e}setSectorNodeProps(e){e.fill=this.fill,e.fillOpacity=this.fillOpacity??1,e.stroke=this.stroke,e.strokeOpacity=this.strokeOpacity??1,e.strokeWidth=this.strokeWidth??1,e.lineDash=this.lineDash}setLabelNodeProps(e,t,i,o,s){const{label:a}=this;e.x=t,e.y=i,e.text=a.text,e.textAlign="center",e.textBaseline=o,e.rotation=s,e.rotationCenterX=t,e.rotationCenterY=i,e.fill=a.color,e.fontFamily=a.fontFamily,e.fontSize=a.fontSize,e.fontStyle=a.fontStyle,e.visible=!0}};d([Ie],vt.prototype,"enabled",2),d([Ie],vt.prototype,"type",2),d([Ie],vt.prototype,"range",2),d([Ie],vt.prototype,"value",2),d([Ie],vt.prototype,"defaultColorRange",2),d([Ie],vt.prototype,"fill",2),d([Ie],vt.prototype,"fillOpacity",2),d([Ie],vt.prototype,"stroke",2),d([Ie],vt.prototype,"strokeWidth",2),d([Ie],vt.prototype,"strokeOpacity",2),d([Ie],vt.prototype,"lineDash",2),d([Ie],vt.prototype,"shape",2),d([Ie],vt.prototype,"label",2);var{ChartAxisDirection:nD,getCrossLineValue:rD,validateCrossLineValue:lD,normalizeAngle360:kh,Group:cD,Path:hg,Sector:hD,RotatableText:dD,ContinuousScale:pD}=rg,Dh=class extends vt{constructor(){super(),this.direction=nD.Angle,this.polygonNode=new hg,this.sectorNode=new hD,this.lineNode=new hg,this.crossLineRange=new cD,this.labelNode=new dD,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!pD.is(this.scale))return!0;const[e,t]=this.scale.domain,i=rD(this);if(this.type==="range"){const[o,s]=i;return o>=e&&o<=t&&s>=o&&s<=t}else return i>=e&&i<=t}update(e){const{scale:t}=this;if(!t||!lD(this,t)||!this.visibilityCheck()){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updateLineNode(e),this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e)}updateLineNode(e){const{scale:t,type:i,value:o,lineNode:s}=this;if(!e||i!=="line"||!t){s.visible=!1;return}const a=t.convert(o);if(Number.isNaN(a)){s.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this;s.visible=!0,s.stroke=this.stroke,s.strokeOpacity=this.strokeOpacity??1,s.strokeWidth=this.strokeWidth??1,s.fill=void 0,s.lineDash=this.lineDash;const l=r*Math.cos(a),c=r*Math.sin(a),h=n*Math.cos(a),p=n*Math.sin(a);s.path.clear(!0),s.path.moveTo(h,p),s.path.lineTo(l,c),this.assignCrossLineGroup(!1,this.crossLineRange)}updatePolygonNode(e){const{polygonNode:t,range:i,scale:o,shape:s,type:a,ticks:n}=this;if(!e||a!=="range"||s!=="polygon"||!o||!i){t.visible=!1;return}const{axisInnerRadius:r,axisOuterRadius:l}=this,c=n.indexOf(i[0]),h=n.indexOf(i[1]),u=(c<=h?n.slice(c,h+1):n.slice(c).concat(n.slice(0,h+1))).map(y=>o.convert(y));t.visible=!0,this.setSectorNodeProps(t);const{path:g}=t;g.clear(!0);for(const[y,f]of u.entries()){const x=l*Math.cos(f),S=l*Math.sin(f);y===0?g.moveTo(x,S):g.lineTo(x,S)}if(r===0)g.lineTo(0,0);else{const y=u.slice().reverse();for(const f of y){const x=r*Math.cos(f),S=r*Math.sin(f);g.lineTo(x,S)}}t.path.closePath(),this.assignCrossLineGroup(!0,this.crossLineRange)}updateSectorNode(e){const{sectorNode:t,range:i,scale:o,shape:s,type:a}=this;if(!e||a!=="range"||s!=="circle"||!o||!i){t.visible=!1;return}const{axisInnerRadius:n,axisOuterRadius:r}=this,l=i.map(p=>o.convert(p)),c=o.step??0,h=o instanceof rg.BandScale?c/2:0;t.visible=!0,this.setSectorNodeProps(t),t.centerX=0,t.centerY=0,t.innerRadius=n,t.outerRadius=r,t.startAngle=l[0]-h,t.endAngle=l[1]+h,this.assignCrossLineGroup(!0,this.crossLineRange)}updateLabelNode(e){const{label:t,labelNode:i,range:o,scale:s,type:a,ticks:n}=this;if(!e||t.enabled===!1||!t.text||!s||a==="range"&&!o){i.visible=!1;return}i.visible=!0;const{axisInnerRadius:r,axisOuterRadius:l}=this;let c,h,p,u;if(a==="line"){const g=kh(s.convert(this.value)),y=1.5*Math.PI,f=lg(g,y)||g>y||gkh(s.convert(v)));let f=(g+y)/2;g>y&&(f-=Math.PI),f=kh(f);const x=(lg(f,0)||f>0)&&fl.value),r=n.reduce((l,c)=>Math.max(typeof c=="number"?eD(c):0,l),0);return{niceDomain:s,tickDomain:s,ticks:n,rawTickCount:void 0,fractionDigits:r,timeInterval:void 0,bbox:this.getBBox()}}update(){super.update(),this.updateRadiusLine(),this.updateGridLines(),this.updateTickLines()}normalizedAngles(){const e=Lo(-Math.PI/2+pn(this.startAngle)),t=this.endAngle==null?2*Math.PI:gD(pn(this.endAngle)-pn(this.startAngle)),i=e+t;return[e,i]}computeRange(){this.range=this.normalizedAngles()}updateSelections(){const e=this.tickData;this.gridLineGroupSelection.update(this.gridLength&&this.gridLine.enabled?e:[]),this.tickLineGroupSelection.update(this.tick.enabled?e:[]),this.tickLabelGroupSelection.update(this.label.enabled?e:[]),this.gridLineGroupSelection.cleanup(),this.tickLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup()}updatePosition(){super.updatePosition();const{translation:e,radiusLineGroup:t}=this,i=Math.floor(e.x),o=Math.floor(e.y);t.translationX=i,t.translationY=o}updateRadiusLine(){const e=this.radiusLine,{path:t}=e;t.clear(!0);const{points:i,closePath:o}=this.getAxisLinePoints();for(const{x:s,y:a,moveTo:n,arc:r,radius:l=0,startAngle:c=0,endAngle:h=0}of i)r?t.arc(s,a,l,c,h):n?t.moveTo(s,a):t.lineTo(s,a);o&&t.closePath(),e.visible=this.line.enabled,e.stroke=this.line.stroke,e.strokeWidth=this.line.width,e.fill=void 0}getAxisLinePoints(){const{scale:e,shape:t,gridLength:i}=this,[o,s]=this.range,a=na(s-o,2*Math.PI),n=[];if(t==="circle")a?n.push({x:i,y:0,moveTo:!0},{x:0,y:0,radius:i,startAngle:0,endAngle:2*Math.PI,arc:!0,moveTo:!1}):n.push({x:i*Math.cos(o),y:i*Math.sin(o),moveTo:!0},{x:0,y:0,radius:i,startAngle:Lo(o),endAngle:Lo(s),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>e.convert(l));if(r&&r.length>2)for(const[l,c]of r.entries()){const h=i*Math.cos(c),p=i*Math.sin(c),u=l===0;n.push({x:h,y:p,moveTo:u})}}return{points:n,closePath:a}}updateGridLines(){const{scale:e,gridLength:t,gridLine:{style:i,width:o},innerRadiusRatio:s}=this;if(!(i&&t>0))return;const a=t*s,n=i.length;this.gridLineGroupSelection.each((r,l,c)=>{const{value:h}=l,{stroke:p,lineDash:u}=i[c%n],g=e.convert(h);r.x1=a*Math.cos(g),r.y1=a*Math.sin(g),r.x2=t*Math.cos(g),r.y2=t*Math.sin(g),r.stroke=p,r.strokeWidth=o,r.lineDash=u,r.fill=void 0}),this.gridLineGroupSelection.cleanup()}updateLabels(){const{label:e,tickLabelGroupSelection:t}=this;t.each((i,o,s)=>{const a=this.labelData[s];if(!a||a.hidden){i.visible=!1;return}i.text=a.text,i.setFont(e),i.fill=e.color,i.x=a.x,i.y=a.y,i.setAlign(a),i.setBoxing(e),i.visible=!0,a.rotation?(i.rotation=a.rotation,i.rotationCenterX=a.x,i.rotationCenterY=a.y):i.rotation=0})}updateTickLines(){const{scale:e,gridLength:t,tick:i,tickLineGroupSelection:o}=this;o.each((s,a)=>{const{value:n}=a,r=e.convert(n),l=Math.cos(r),c=Math.sin(r);s.x1=t*l,s.y1=t*c,s.x2=(t+i.size)*l,s.y2=(t+i.size)*c,s.stroke=i.stroke,s.strokeWidth=i.width})}createLabelNodeData(e,t,i){const{label:o,gridLength:s,scale:a,tick:n}=this;if(!o.enabled)return[];const r=new fD,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,p=this.tickFormatter(this.scale.domain,this.tickData,!1,h),u=e.map((g,y)=>{const{value:f}=g,x=s+o.spacing+n.size,S=a.convert(f),v=Math.cos(S),m=Math.sin(S),b=x*v,k=x*m,{textAlign:A,textBaseline:M}=this.getLabelAlign(S),D=y===e.length-1&&f!==e[0]&&na(Lo(S),Lo(a.convert(e[0]))),L=this.getLabelRotation(S);let N=p(f,y);r.text=N,r.x=b,r.y=k,r.setFont(o),r.textAlign=A,r.textBaseline=M,r.rotation=L,L&&(r.rotationCenterX=b,r.rotationCenterY=k);let P=L?mD.toCanvas(r):r.getBBox();if(P&&t.hideWhenNecessary&&!L){const R=l-P.x,F=P.x+P.width-c,_=1;if(R>_||F>_){const T={maxWidth:P.width-Math.max(R,F),font:o,textWrap:"never"};N=tD(N,T),r.text=N,P=r.getBBox()}}return{text:N,x:b,y:k,textAlign:A,textBaseline:M,hidden:N===""||(g.hidden??D),rotation:L,box:P}});return o.avoidCollisions&&this.avoidLabelCollisions(u),u}computeLabelsBBox(e,t){this.labelData=this.createLabelNodeData(this.tickData,e,t);const i=this.labelData.map(({box:o})=>o).filter(o=>o!=null);return!this.label.enabled||i.length===0?null:xD.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof Ah?e.orientation:"fixed"}getLabelRotation(e){let t=pn(this.label.rotation??0);e=Lo(e);const i=this.getLabelOrientation();return i==="parallel"?(t+=e,e>=0&&e=Math.PI/2&&e<1.5*Math.PI&&(t+=Math.PI)),t}getLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let o,s;const a=this.getLabelOrientation(),n=na(t,0),r=na(i,0),l=na(t,1),c=na(i,-1),h=t>0&&!n,p=i>0&&!r;return a==="parallel"?(o="center",s=l&&r||p?"top":"bottom"):a==="perpendicular"?(o=c||h?"left":"right",s="middle"):(o="right",n?o="center":h&&(o="left"),s="bottom",r?s="middle":p&&(s="top")),{textAlign:o,textBaseline:s}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;for(const o of this.crossLines)o instanceof Dh&&(o.ticks=this.tickData.map(s=>s.value),o.shape=e,o.axisOuterRadius=t,o.axisInnerRadius=t*i);super.updateCrossLines()}};un.CrossLineConstructor=Dh,d([Mh],un.prototype,"startAngle",2),d([Mh],un.prototype,"endAngle",2);var{Property:Ih,CategoryScale:SD}=Zk,To=class extends un{constructor(e){super(e,new SD),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new bh}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:o,minSpacing:s}=this.interval,a={nice:this.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0},n=o??t.ticks(a,e)?.ticks??[];if(n.length<2||s==null)return n.map(p=>({value:p,visible:!0}));const r=n[0],l=t.convert(r),c=i*Math.cos(l),h=i*Math.sin(l);for(let p=1;pMath.PI)break;const y=i*Math.cos(g),f=i*Math.sin(g);if(Math.hypot(y-c,f-h)>s){const S=new Set([r]);return Sh(n,p,(v,m)=>{S.add(m)}),n.map(v=>{const m=S.has(v);return{value:v,visible:m}})}}return[{value:r,visible:!0}]}avoidLabelCollisions(e){const{minSpacing:t}=this.label;if(e.length<3)return;const i=(l,c)=>{if(l.hidden||c.hidden)return!1;if(t==null)return l.box.collidesBBox(c.box);const h=l.box.clone().grow(t/2),p=c.box.clone().grow(t/2);return h.collidesBBox(p)},o=e[0],s=e.at(-1),a=new Set([o]),n=ng(o.x,s.x)&&ng(o.y,s.y),r=Math.floor(e.length/2);for(let l=1;l<=r;l++){const c=n?e.slice(0,-1):e;if(!Sh(c,l,i)){Sh(c,l,(p,u)=>{a.add(u)});break}}for(const l of e)a.has(l)||(l.hidden=!0,l.box=void 0)}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:o,legendItemName:s,key:a,source:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:o,legendItemName:s,key:a,source:n,property:r,domain:l,boundSeries:c}}};To.className="AngleCategoryAxis",To.type="angle-category",d([Ih],To.prototype,"groupPaddingInner",2),d([Ih],To.prototype,"paddingInner",2),d([Ih],To.prototype,"interval",2);var bD={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-category",moduleFactory:e=>new To(e)};import{_ModuleSupport as vD}from"ag-charts-community";import{isNumberEqual as ug}from"ag-charts-core";import{_ModuleSupport as kD}from"ag-charts-community";import{isNumberEqual as DD}from"ag-charts-core";var{range:gg,isDenseInterval:MD,LinearScale:Lh}=kD,yg=class ig extends Lh{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[o,s]=i;let a=Lh.getTickStep(o,s,t);const n=Number.isNaN(t.maxTickCount)?1/0:t.maxTickCount,r=Math.abs(s-o)/a;let l=Math.pow(2,Math.ceil(Math.log(r)/Math.log(2)));return l>n&&(l/=2,a*=2),{count:l,step:a}}ticks(t,i=this.domain){const{arcLength:o}=this;if(!i||i.length<2||i.some(c=>!Number.isFinite(c))||o<=0)return{ticks:[],count:0};const{nice:s,interval:a}=t,[n,r]=i;if(a){const c=Math.abs(a),h=this.getPixelRange();if(!MD((r-n)/c,h))return gg(n,r,c)}let l;if(s&&this.hasNiceRange()){const c=super.niceDomain(t,i);l=ig.getNiceStepAndTickCount(t,c).step}else l=Lh.getTickStep(n,r,t);return gg(n,r,l)}hasNiceRange(){const t=this.range.slice().sort((o,s)=>o-s);return[Math.PI,2*Math.PI].some(o=>DD(o,t[1]-t[0]))}niceDomain(t,i=this.domain){const o=super.niceDomain(t,i);if(!this.hasNiceRange())return o;const s=o[0]>o[1],a=s?o[1]:o[0],{step:n,count:r}=ig.getNiceStepAndTickCount(t,o),l=1/n,c=n>=1?Math.ceil(a/n+r)*n:Math.ceil((a+r*n)*l)/l;return s?[c,a]:[a,c]}getPixelRange(){return this.arcLength}},{Property:Th,angleBetween:AD,normalisedExtentWithMetadata:ID,findMinMax:LD}=vD,ps=class extends un{constructor(e){super(e,new yg),this.shape="circle",this.interval=new bh}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&ep>=c&&p<=h).sort((p,u)=>p-u)}return l.map(c=>({value:c,visible:!0}))}avoidLabelCollisions(e){const{minSpacing:t}=this.label,i=(a,n)=>{if(a.hidden||n.hidden)return!1;if(t==null)return a.box.collidesBBox(n.box);const r=a.box.clone().grow(t/2),l=n.box.clone().grow(t/2);return r.collidesBBox(l)},o=e[0],s=e.at(-1);o!==s&&ug(o.x,s.x)&&ug(o.y,s.y)&&(s.hidden=!0);for(let a=1;a0&&(l.hidden=!0,l.box=void 0);return}}for(const[a,n]of e.entries())a>0&&(n.hidden=!0,n.box=void 0)}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:o,seriesId:s,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:o,seriesId:s,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i}}};ps.className="AngleNumberAxis",ps.type="angle-number",d([Th],ps.prototype,"min",2),d([Th],ps.prototype,"max",2),d([Th],ps.prototype,"interval",2);var TD={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"angle-number",moduleFactory:e=>new ps(e)};import{_ModuleSupport as fg}from"ag-charts-community";var{OrdinalTimeScale:CD,Property:ND,TimeAxisParentLevel:wD,lowestGranularityUnitForTicks:PD,lowestGranularityUnitForValue:OD,minimumTimeAxisDatumGranularity:_D,dateTruncationForDomain:RD,intervalUnit:mg,intervalStep:xg,intervalEpoch:Sg,intervalMilliseconds:bg}=fg,gn=class extends fg.DiscreteTimeAxis{constructor(e){super(e,new CD),this.parentLevel=new wD}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=_D(e,t,void 0,void 0)}tickFormatParams(e,t,i,o){o??(o=PD(t));const s=RD(e),a=mg(o),n=xg(o),r=Sg(o);return{type:"date",unit:a,step:n,epoch:r,truncateDate:s}}datumFormatParams(e,t,i,o,s){if(typeof e=="number"&&(e=new Date(e)),o==null){const{minimumTimeGranularity:x}=this,S=OD(e);x!=null&&bg(x)new gn(e)};import{_ModuleSupport as BD}from"ag-charts-community";import{_ModuleSupport as kr}from"ag-charts-community";import{isNumberEqual as zD}from"ag-charts-core";import{_ModuleSupport as vg}from"ag-charts-community";import{clamp as kg,isNumberEqual as FD}from"ag-charts-core";var{ChartAxisDirection:HD,Property:VD,validateCrossLineValue:WD,normalizeAngle360FromDegrees:GD,Group:KD,Path:$D,Sector:jD,RotatableText:YD}=vg,Dg=class extends Si{constructor(){super(...arguments),this.positionAngle=void 0}};d([VD],Dg.prototype,"positionAngle",2);var Ch=class extends vt{constructor(){super(),this.direction=HD.Radius,this.label=new Dg,this.polygonNode=new $D,this.sectorNode=new jD,this.crossLineRange=new KD,this.labelNode=new YD,this.outerRadius=0,this.innerRadius=0,this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.labelGroup.append(this.labelNode)}update(e){const{scale:t}=this;if(!t||!WD(this,t)){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.updateRadii();const{innerRadius:i,outerRadius:o}=this;e&&(e=i>=this.axisInnerRadius&&o<=this.axisOuterRadius),this.rangeGroup.visible=e,this.lineGroup.visible=e,this.labelGroup.visible=e,this.updatePolygonNode(e),this.updateSectorNode(e),this.updateLabelNode(e),this.assignCrossLineGroup(this.type==="range",this.crossLineRange)}updateRadii(){const{range:e,scale:t,type:i,axisInnerRadius:o,axisOuterRadius:s}=this;if(!t)return{innerRadius:0,outerRadius:0};const a=l=>s+o-l;let n,r;if(i==="line")n=a(t.convert(this.value)),r=n;else{const l=Math.abs(t?.bandwidth??0),c=e.map(h=>t.convert(h));n=a(Math.max(...c)),r=a(Math.min(...c))+l}this.outerRadius=n,this.innerRadius=r}drawPolygon(e,t,i){for(const[o,s]of t.entries()){const a=e*Math.cos(s),n=e*Math.sin(s);o===0?i.path.moveTo(a,n):i.path.lineTo(a,n)}i.path.closePath()}updatePolygonNode(e){const{gridAngles:t,polygonNode:i,scale:o,shape:s,type:a,innerRadius:n,outerRadius:r}=this;if(!e||s!=="polygon"||!o||!t){i.visible=!1;return}i.visible=!0;const l=this.getPadding();i.path.clear(!0),this.drawPolygon(r-l,t,i);const c=t.slice().reverse(),h=a==="line"?r-l:n+l;this.drawPolygon(h,c,i),this.setSectorNodeProps(i)}updateSectorNode(e){const{axisInnerRadius:t,axisOuterRadius:i,scale:o,sectorNode:s,shape:a,innerRadius:n,outerRadius:r}=this;if(!e||a!=="circle"||!o){s.visible=!1;return}s.visible=!0,s.startAngle=0,s.endAngle=2*Math.PI;const l=this.getPadding(),c=kg(t,n+l,i),h=kg(t,r-l,i);s.innerRadius=Math.min(c,h),s.outerRadius=Math.max(c,h),this.setSectorNodeProps(s)}updateLabelNode(e){const{innerRadius:t,label:i,labelNode:o,scale:s,shape:a,type:n}=this;if(!e||i.enabled===!1||!i.text||!s){o.visible=!1;return}const r=GD((i.positionAngle??0)-90),l=(FD(r,0)||r>0)&&rthis.tickFormatter(...v),domain:e,range:n,reverse:r,niceMode:t,visibleRange:o,defaultTickMinSpacing:l,labelOffset:a,sideFlag:s,axisRotation:0,sizeLimit:void 0,primaryTickCount:void 0}),{tickData:h}=c,{ticks:p,rawTicks:u,rawTickCount:g,tickDomain:y,fractionDigits:f,niceDomain:x=e}=h,S=p.map(v=>this.getTickLabelProps(v,c));return this.generatedTicks={ticks:p,labels:S},{ticks:u,tickDomain:y,niceDomain:x,rawTickCount:g,fractionDigits:f,timeInterval:void 0}}updateSelections(){const{generatedTicks:e}=this;if(!e)return;const{ticks:t,labels:i}=e;this.gridLineGroupSelection.update(this.gridLength?t:[]),this.tickLabelGroupSelection.update(i),this.gridPathSelection.update(this.gridLine.enabled?this.prepareGridPathTickData(t):[]),this.gridLineGroupSelection.cleanup(),this.tickLabelGroupSelection.cleanup(),this.gridPathSelection.cleanup()}updateLabels(){if(!this.label.enabled)return;const e=kr.resetAxisLabelSelectionFn();this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.color,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center",t.setFont(i),t.setBoxing(i),t.setProperties(e(t,i))})}updateGridLines(){const{gridLine:{style:e,width:t},shape:i,generatedTicks:o}=this;if(!e||!o)return;const s=e.length,a=(u,g)=>{const{stroke:y,lineDash:f}=e[g%s];u.stroke=y,u.strokeWidth=t,u.lineDash=f,u.fill=void 0},[n,r]=this.gridRange??[0,2*Math.PI],l=zD(r-n,2*Math.PI),p=i==="circle"?(u,g)=>{const{path:y}=u;y.clear(!0);const f=this.getTickRadius(g);l?(y.moveTo(f,0),y.arc(0,0,f,0,2*Math.PI)):(y.moveTo(f*Math.cos(n),f*Math.sin(n)),y.arc(0,0,f,Mg(n),Mg(r))),l&&y.closePath()}:(u,g)=>{const{path:y}=u,f=this.gridAngles;if(y.clear(!0),!f||f.length<3)return;const x=this.getTickRadius(g);for(const[S,v]of f.entries()){const m=x*Math.cos(v),b=x*Math.sin(v);S===0?y.moveTo(m,b):y.lineTo(m,b);for(const[k,A]of f.entries()){const M=x*Math.cos(A),D=x*Math.sin(A);k===0?y.moveTo(M,D):y.lineTo(M,D)}y.closePath()}y.closePath()};this.gridPathSelection.each((u,g,y)=>{a(u,y),p(u,g)})}updateTitle(){const e=n=>n.defaultValue,{title:t,range:i}=this,{formatter:o=e}=this.title;t.caption.enabled=t.enabled,t.caption.fontFamily=t.fontFamily,t.caption.fontSize=t.fontSize,t.caption.fontStyle=t.fontStyle,t.caption.fontWeight=t.fontWeight,t.caption.color=t.color,t.caption.wrapping=t.wrapping;let s=!1;const a=t.caption.node;t.enabled&&(s=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-qD.SMALL_PADDING,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(o,this.getTitleFormatterParams(this.scale.domain))),a.visible=s}updateCrossLines(){for(const e of this.crossLines)if(e instanceof Ch){const{shape:t,gridAngles:i,range:o,innerRadiusRatio:s}=this,a=o[0];e.shape=t,e.gridAngles=i,e.axisOuterRadius=a,e.axisInnerRadius=a*s}super.updateCrossLines()}createLabel(){return new wh}getTickLabelProps(e,t){const{label:i}=this,{rotation:o,textBaseline:s,textAlign:a}=t,n=this.scale.range,r=e.tickLabel??"",c=i.getSideFlag()*(this.getTickSize()+i.spacing+this.seriesAreaPadding),h=r!==""&&r!=null,p=o;return{...this.getLabelStyles({value:e.tick,formattedValue:e.tickLabel}),tickId:e.tickId,rotation:p,text:r,textAlign:a,textBaseline:s,visible:h,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:n}}};Dr.CrossLineConstructor=Ch,d([Nh],Dr.prototype,"positionAngle",2);var{ProxyPropertyOnWrite:Tg,Property:Ph,CategoryScale:Cg}=BD,Co=class extends Dr{constructor(e){super(e,new Cg),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,o=t.range[0],s=o*i;if(Cg.is(t)){const a=t.domain,n=a.length-1-a.indexOf(e.tick);return n===0?s:t.inset+t.step*(n-.5)+t.bandwidth/2}else{const a=(o-s)/t.domain.length;return o-e.translation+s-a/2}}tickFormatParams(){return{type:"category"}}datumFormatParams(e,t){const{datum:i,seriesId:o,legendItemName:s,key:a,source:n,property:r,domain:l,boundSeries:c}=t;return{type:"category",value:e,datum:i,seriesId:o,legendItemName:s,key:a,source:n,property:r,domain:l,boundSeries:c}}};Co.className="RadiusCategoryAxis",Co.type="radius-category",d([Ph],Co.prototype,"groupPaddingInner",2),d([Tg("scale","paddingInner"),Ph],Co.prototype,"paddingInner",2),d([Tg("scale","paddingOuter"),Ph],Co.prototype,"paddingOuter",2);var iM={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-category",moduleFactory:e=>new Co(e)};import{_ModuleSupport as oM}from"ag-charts-community";var{Property:Ng,normalisedExtentWithMetadata:sM,LinearScale:aM}=oM,ra=class extends Dr{constructor(e){super(e,new aM),this.shape="polygon"}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&eo!==i).sort((o,s)=>s.tick-o.tick)}getTickRadius(e){const{scale:t}=this,i=t.range[0],o=i*this.innerRadiusRatio;return i-e.translation+o}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:o,clipped:s}=sM(e,t,i);return{domain:o,clipped:s}}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:o,seriesId:s,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:o,seriesId:s,legendItemName:a,key:n,source:r,property:l,domain:c,boundSeries:h,fractionDigits:i}}};ra.className="RadiusNumberAxis",ra.type="radius-number",d([Ng],ra.prototype,"min",2),d([Ng],ra.prototype,"max",2);var nM={type:"axis",optionsKey:"axes[]",packageType:"enterprise",chartTypes:["polar"],identifier:"radius-number",moduleFactory:e=>new ra(e)};import{_ModuleSupport as wg}from"ag-charts-community";var{ObserveChanges:Oh,Property:_h}=wg,Mr=class extends wg.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.cleanup.register(()=>{e.animationManager.skip(!0)})}};d([Oh((e,t)=>{e.ctx.animationManager.skip(!t)}),_h],Mr.prototype,"enabled",2),d([Oh((e,t)=>{e.ctx.animationManager.defaultDuration=t}),_h],Mr.prototype,"duration",2),d([Oh((e,t)=>{e.ctx.animationManager.maxAnimatableItems=t??1/0}),_h],Mr.prototype,"maxAnimatableItems",2);var rM={type:"root",optionsKey:"animation",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new Mr(e),themeTemplate:{animation:{enabled:!0,maxAnimatableItems:1e3}}};import{_ModuleSupport as la}from"ag-charts-community";import{isValidDate as Rh}from"ag-charts-core";import{_ModuleSupport as Eh}from"ag-charts-community";import{attachListener as lM,setAttributes as cM}from"ag-charts-core";var hM='',{focusCursorAtEnd:dM}=Eh,Pg="text-input",Og="canvas-overlay",pM=class extends Eh.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(Og,Pg),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>e.domManager.removeChild(Og,Pg))}setKeyDownHandler(e){this.cleanup.register(lM(this.element,"keydown",e))}show(e){this.element.innerHTML=hM;const t=this.element.firstElementChild;cM(t,{role:"textbox","data-preventdefault":!1}),t.isContentEditable||(t.contentEditable="true"),t.setAttribute("placeholder",this.ctx.localeManager.t(e.placeholderText??"inputTextareaPlaceholder")),e.styles?.placeholderColor&&t.style.setProperty("--placeholder-text-color",e.styles?.placeholderColor),t.innerText=e.text??"",t.style.color=e.styles?.color??"inherit",t.style.fontFamily=e.styles?.fontFamily??"inherit",t.style.fontSize=e.styles?.fontSize?`${e.styles.fontSize}px`:"inherit",t.style.fontStyle=e.styles?.fontStyle??"inherit",t.style.fontWeight=typeof e.styles?.fontWeight=="number"?`${e.styles.fontWeight}`:e.styles?.fontWeight??"inherit",dM(t),t.addEventListener("input",()=>{this.updatePosition(),e.onChange?.(this.getValue(),this.getBBox())}),t.addEventListener("click",i=>{i.stopPropagation()}),e.layout&&(this.layout=e.layout,this.updatePosition()),e.onChange?.(this.getValue(),this.getBBox()),this.visible=!0}hide(){this.element.innerHTML="",this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1}isVisible(){return this.visible}updateColor(e){this.element.firstElementChild&&(this.element.firstElementChild.style.color=e)}updateFontSize(e){if(this.element.firstElementChild)return this.element.firstElementChild.style.fontSize=`${e}px`,this.updatePosition(),this.getBBox()}getValue(){if(this.element.firstElementChild)return this.element.firstElementChild.innerText.trim()}updatePosition(){const{element:e}=this,t=e.firstElementChild;if(!t)return;const i=this.ctx.domManager.getBoundingClientRect(),{width:o,getTextInputCoords:s,getTextPosition:a,alignment:n,textAlign:r}=this.layout;e.style.setProperty("width",o?`${o}px`:"unset");const l=t.getBoundingClientRect(),c=s(l.height);let h=c.x;n==="center"?h-=(o??l.width)/2:n==="right"&&(h-=o??l.width);const p=a();let u=c.y;p==="center"?u-=l.height/2:p==="bottom"&&(u-=l.height),e.style.setProperty("top",`${u}px`),e.style.setProperty("left",`${h}px`),e.style.setProperty("max-width",`${i.width-h}px`),e.style.setProperty("text-align",n),t.style.setProperty("text-align",r)}getBBox(){const{left:e,top:t,width:i,height:o}=this.element.getBoundingClientRect();return new Eh.BBox(e,t,i,o)}};import{_ModuleSupport as uM}from"ag-charts-community";var{BaseProperties:gM,Property:_g}=uM,Bh=class extends gM{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};d([_g],Bh.prototype,"enabled",2),d([_g],Bh.prototype,"axes",2);import{_ModuleSupport as yM}from"ag-charts-community";var zh=(e=>(e.Line="line",e.HorizontalLine="horizontal-line",e.VerticalLine="vertical-line",e.DisjointChannel="disjoint-channel",e.ParallelChannel="parallel-channel",e.FibonacciRetracement="fibonacci-retracement",e.FibonacciRetracementTrendBased="fibonacci-retracement-trend-based",e.Callout="callout",e.Comment="comment",e.Note="note",e.Text="text",e.Arrow="arrow",e.ArrowUp="arrow-up",e.ArrowDown="arrow-down",e.DateRange="date-range",e.PriceRange="price-range",e.DatePriceRange="date-price-range",e.QuickDatePriceRange="quick-date-price-range",e))(zh||{}),fM=Object.values(zh);function mM(e){for(const t of fM)if(t===e)return t}import{isObject as xM}from"ag-charts-core";import{_ModuleSupport as SM}from"ag-charts-community";import{isObject as bM}from"ag-charts-core";import{_ModuleSupport as vM}from"ag-charts-community";import{generateUUID as kM}from"ag-charts-core";var{BaseProperties:No,FONT_SIZE:DM,Property:se}=vM,yn=class extends No{};d([se],yn.prototype,"x",2),d([se],yn.prototype,"y",2);var MM=class extends gt(io(zg(No))){},Fh=class extends gt(io(Ri(Wh(ys(No))))){constructor(){super(...arguments),this.cornerRadius=2}};d([se],Fh.prototype,"enabled",2),d([se],Fh.prototype,"cornerRadius",2);var AM=class extends Ri(No){},IM=class extends gt(io(Ri(No))){},us=class extends ys(No){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};d([se],us.prototype,"label",2),d([se],us.prototype,"position",2),d([se],us.prototype,"alignment",2);var LM=class extends ys(No){},fn=class extends ys(No){constructor(){super(...arguments),this.label=""}};d([se],fn.prototype,"label",2),d([se],fn.prototype,"position",2),d([se],fn.prototype,"alignment",2);function gs(e){class t extends CM(zg(e)){constructor(){super(...arguments),this.id=kM()}}return t}function Hh(e){class t extends e{constructor(){super(...arguments),this.start=new yn,this.end=new yn}}return d([se],t.prototype,"start",2),d([se],t.prototype,"end",2),t}function Rg(e){class t extends e{}return d([se],t.prototype,"x",2),d([se],t.prototype,"y",2),t}function Eg(e){class t extends e{}return d([se],t.prototype,"value",2),t}function Vh(e){class t extends e{constructor(){super(...arguments),this.background=new AM}}return d([se],t.prototype,"background",2),t}function wo(e){class t extends e{constructor(){super(...arguments),this.handle=new IM}}return d([se],t.prototype,"handle",2),t}function Bg(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new Fh}}return d([se],t.prototype,"axisLabel",2),t}function Wh(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return d([se],t.prototype,"padding",2),d([se],t.prototype,"textAlign",2),d([se],t.prototype,"formatter",2),t}function TM(e){class t extends e{}return t}function Gh(e){class t extends e{}return d([se],t.prototype,"extendStart",2),d([se],t.prototype,"extendEnd",2),t}function CM(e){class t extends e{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return d([se],t.prototype,"locked",2),d([se],t.prototype,"readOnly",2),t}function Kh(e){class t extends e{setLocaleManager(o){this.localeManager??(this.localeManager=o)}}return t}function zg(e){class t extends e{}return d([se],t.prototype,"visible",2),t}function Ri(e){class t extends e{}return d([se],t.prototype,"fill",2),d([se],t.prototype,"fillOpacity",2),t}function gt(e){class t extends e{}return d([se],t.prototype,"stroke",2),d([se],t.prototype,"strokeOpacity",2),d([se],t.prototype,"strokeWidth",2),t}function io(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return d([se],t.prototype,"lineDash",2),d([se],t.prototype,"lineDashOffset",2),d([se],t.prototype,"lineStyle",2),t}function ys(e){class t extends e{constructor(){super(...arguments),this.fontSize=DM.SMALL,this.fontFamily="Verdana, sans-serif"}}return d([se],t.prototype,"fontStyle",2),d([se],t.prototype,"fontWeight",2),d([se],t.prototype,"fontSize",2),d([se],t.prototype,"fontFamily",2),d([se],t.prototype,"color",2),t}import{_ModuleSupport as NM}from"ag-charts-community";import{isDate as wM,isNumber as PM,isString as OM}from"ag-charts-core";function Fg(e){return PM(e)||OM(e)||wM(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function Fe(e){return Fg(e)?.value}function kt(e,t){if(e.start==null||e.end==null)return;const i=ke(e.start,t),o=ke(e.end,t);if(!(i==null||o==null))return{x1:i.x,y1:i.y,x2:o.x,y2:o.y}}function ke(e,t){const i=oo(e.x,t.xAxis),o=oo(e.y,t.yAxis);return{x:i,y:o}}function oo(e,t){if(e==null)return 0;const{value:i,groupPercentage:o}=Fg(e),{scale:s,snapToGroup:a}=t,n=s.bandwidth===0?s.step??0:s.bandwidth??0,r=a?n/2:n*o;return s.convert(i)+r}function Dt(e,t){const i=Ar(e.x,t.xAxis),o=Ar(e.y,t.yAxis);return{x:i,y:o}}function Ar(e,t){const{scale:i}=t;if(t.continuous&&i.step==null)return t.scaleInvert(e);const o=t.scaleInvertNearest(e),s=i.bandwidth===0?i.step:i.bandwidth??0,a=i.convert(o),n=a+s,r=a===n?0:(e-a)/(n-a);return{value:o,groupPercentage:r}}import{_ModuleSupport as _M}from"ag-charts-community";var{BaseProperties:RM}=_M,$h=class extends gs(Hh(wo(RM))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},{Property:EM}=NM,Hg=class extends Kh(Wh(ys($h))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;let t=this.text;return e&&(t=this.placeholderText??"",this.localeManager&&(t=this.localeManager.t(t))),{text:t,isPlaceholder:e}}getTextInputCoords(e,t){return ke(this.end,e)}getTextPosition(){return this.position}};d([EM],Hg.prototype,"text",2);var{Property:BM,Color:Vg}=SM,zM={top:6,right:12,bottom:9,left:12},bi=class extends Ri(gt(Hg)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return bM(e)&&e.type==="callout"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Vg.fromString(this.color??"#888888");return new Vg(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return e==null?{...zM}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),o=this.getPadding(),s=o.left??0,a=o.bottom??0;return{x:i.x+s,y:i.y-a}}};d([BM],bi.prototype,"type",2);import{_ModuleSupport as FM}from"ag-charts-community";import{isObject as HM}from"ag-charts-core";import{_ModuleSupport as VM}from"ag-charts-community";var{BaseProperties:WM,Property:GM}=VM,Ir=class extends gs(Rg(wo(Wh(ys(WM))))){constructor(){super(...arguments),this.text="",this.position="top",this.alignment="left",this.placement="inside",this.placeholderText="inputTextareaPlaceholder"}getDefaultColor(e){return this.color}getDefaultOpacity(e){}getPlaceholderColor(){}getPadding(){const{padding:e=0}=this;return{top:e,right:e,bottom:e,left:e}}getText(){const e=this.text.length==0;return{text:e?this.placeholderText??"":this.text,isPlaceholder:e}}getTextInputCoords(e,t){return ke(this,e)}getTextPosition(){return this.position}};d([GM],Ir.prototype,"text",2);var{Property:KM,Color:Wg}=FM,Lr={top:8,right:14,bottom:8,left:14},Ei=class extends Ri(gt(Ir)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return HM(e)&&e.type==="comment"}getDefaultColor(e){switch(e){case"fill-color":return this.fill;case"line-color":return this.stroke;case"text-color":default:return this.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.fillOpacity;case"line-color":return this.strokeOpacity;case"text-color":default:return}}getPlaceholderColor(){const{r:e,g:t,b:i}=Wg.fromString(this.color??"#888888");return new Wg(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return e==null?{top:Math.max(t*.4,Lr.top),bottom:Math.max(t*.4,Lr.bottom),left:Math.max(t*.8,Lr.left),right:Math.max(t*.8,Lr.right)}:{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const i=super.getTextInputCoords(e,t),o=this.getPadding();return{x:i.x+o.left,y:i.y-o.bottom}}};d([KM],Ei.prototype,"type",2);import{_ModuleSupport as $M}from"ag-charts-community";import{isObject as Tr}from"ag-charts-core";import{_ModuleSupport as jM}from"ag-charts-community";var{Vec2:fs}=jM;function mn(e,t){return e?"dashed":t??"solid"}function Gg(e,t){switch(t){case"solid":return[];case"dashed":return[e*4,e*2];case"dotted":return[0,e*2]}}function ca(e,t,i,o){const s=mn(e,i);return t??e??Gg(o??1,s)}function ha(e,t,i){const o=mn(t,i);return e??o==="dotted"?"round":void 0}function YM(e,t){const[i,o]=fs.from(e),s=t.height,a=fs.gradient(o,i,s),n=fs.intercept(o,a,s),r=[{x:i.x,y:s??0},{x:i.x,y:s==null?t.height:s-t.height}];if(a===1/0)return r;let l=[fs.intersectAtY(a,n,0,s),fs.intersectAtY(a,n,t.height,s),fs.intersectAtX(a,n,0,s),fs.intersectAtX(a,n,t.width,s)];return l=l.filter(c=>c.x>=t.x&&c.x<=t.width&&c.y>=t.y&&c.y<=t.height).sort((c,h)=>c.x===h.x?0:c.x{},this.text=new us}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ca(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return ha(this.lineCap,this.lineDash,this.lineStyle)}};d([Nt],da.prototype,"statistics",2),d([Nt],da.prototype,"text",2);function Xh(e){class t extends e{constructor(){super(...arguments),this.hasDateRange=!0}}return t}function Zh(e){class t extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}return t}var ei=class extends Xh(da){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return Tr(e)&&e.type==="date-range"}};d([Nt],ei.prototype,"type",2),d([Nt],ei.prototype,"extendAbove",2),d([Nt],ei.prototype,"extendBelow",2);var ti=class extends Zh(da){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return Tr(e)&&e.type==="price-range"}};d([Nt],ti.prototype,"type",2),d([Nt],ti.prototype,"extendLeft",2),d([Nt],ti.prototype,"extendRight",2);var so=class extends Xh(Zh(da)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return Tr(e)&&e.type==="date-price-range"}};d([Nt],so.prototype,"type",2);var Vt=class extends Xh(Zh(da)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new Uh,this.down=new Uh,this.direction="both"}static is(e){return Tr(e)&&e.type==="quick-date-price-range"}};d([Nt],Vt.prototype,"type",2),d([Nt],Vt.prototype,"up",2),d([Nt],Vt.prototype,"down",2);import{_ModuleSupport as XM}from"ag-charts-community";import{clamp as ZM,isObject as qM}from"ag-charts-core";import{_ModuleSupport as QM}from"ag-charts-community";import{cachedTextMeasurer as JM,calcLineHeight as Kg,wrapText as e0}from"ag-charts-core";var{BBox:t0}=QM,Cr=1.38;function Nr(e,t,i){return i?e0(t,{maxWidth:i,font:e,textWrap:"always",avoidOrphans:!1}):t}function i0(e,t){const{lineMetrics:i,width:o}=JM(e).measureLines(t),s=i.length*Kg(e.fontSize,Cr);return{width:o,height:s}}function qh(e,t,i,o){let s=o?.width??0,a=o?.height??0;if(!o){const n=e.width==null?t:Nr(e,t,e.width);({width:s,height:a}=i0(e,n))}return new t0(i.x,i.y,s,a)}function $g(e,t,i,o,{x:s,y:a},n){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:p,textAlign:u}=o,g=Kg(c,Cr);n??(n=o.position=="center"?"middle":o.position);const y=i?o.getPlaceholderColor():o.color;e.setProperties({x:s,y:a,visible:r,text:t,fill:y,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:p,textAlign:u,lineHeight:g,textBaseline:n})}var{BaseProperties:o0,Property:jg}=XM,s0=10,a0=11,Yg=20,n0=22,r0=10,Ug=Yg+r0,Xg=34,l0=class extends Ri(gt(o0)){},wt=class extends Ri(gt(Ir)){constructor(){super(...arguments),this.type="note",this.background=new l0,this.position="bottom",this.alignment="center",this.width=200}static is(e){return qM(e)&&e.type==="note"}getDefaultColor(e){switch(e){case"line-color":return this.fill;case"text-color":return this.color}}getDefaultOpacity(e){switch(e){case"line-color":return this.fillOpacity;case"text-color":return}}getPadding(){const e=this.padding??s0;return{top:e,right:e,bottom:e,left:e}}getTextInputCoords(e,t){const{width:i,text:o}=this,s=super.getTextInputCoords(e,t),a=this.getPadding().top,n=qh(this,o,s);n.x=ZM(i/2,n.x,e.seriesRect.width-i/2);const r=n.y-Ug-a*2,l=n.y+a0+a*2,c=Math.max(n.height,t);return r-c-Xg<0?(n.y=l,this.position="top"):(n.y=r+a,this.position="bottom"),{x:n.x,y:n.y}}isHoverable(){return!0}};d([jg],wt.prototype,"type",2),d([jg],wt.prototype,"background",2);import{_ModuleSupport as c0}from"ag-charts-community";var{BaseProperties:h0}=c0,d0=class extends gs(Rg(wo(h0))){getDefaultColor(e){}getDefaultOpacity(e){}},Qh=class Bk extends Ri(d0){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof Bk}getDefaultColor(t){return t==="fill-color"?this.fill:void 0}getDefaultOpacity(t){return t==="fill-color"?this.fillOpacity:void 0}};import{_ModuleSupport as p0}from"ag-charts-community";import{isObject as Zg}from"ag-charts-core";var{BaseProperties:qg,Property:wr}=p0,yt=class extends gs(Eg(wo(Bg(gt(io(qg)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new us}static is(e){return Zg(e)&&e.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ca(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return ha(this.lineCap,this.lineDash,this.lineStyle)}};d([wr],yt.prototype,"type",2),d([wr],yt.prototype,"text",2);var Bi=class extends gs(Eg(wo(Bg(gt(io(qg)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new us}static is(e){return Zg(e)&&e.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ca(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return ha(this.lineCap,this.lineDash,this.lineStyle)}};d([wr],Bi.prototype,"type",2),d([wr],Bi.prototype,"text",2);import{_ModuleSupport as u0}from"ag-charts-community";import{Logger as g0,isObject as y0}from"ag-charts-core";var{BaseProperties:f0,Property:Pr}=u0,ii=class extends gs(Vh(Hh(wo(Gh(gt(io(f0))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new fn,this.snapToAngle=45}static is(e){return y0(e)&&e.type==="disjoint-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.startHeight,e.end.y-=this.endHeight):g0.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ca(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return ha(this.lineCap,this.lineDash,this.lineStyle)}};d([Pr],ii.prototype,"type",2),d([Pr],ii.prototype,"startHeight",2),d([Pr],ii.prototype,"endHeight",2),d([Pr],ii.prototype,"text",2);import{_ModuleSupport as m0}from"ag-charts-community";import{isObject as x0}from"ag-charts-core";import{_ModuleSupport as S0}from"ag-charts-community";import{_ModuleSupport as b0}from"ag-charts-community";import{isObject as Qg}from"ag-charts-core";var{Property:Jh}=b0,Or=class extends Kh(TM(Gh(gt(io($h))))){constructor(){super(...arguments),this.text=new us}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return ca(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return ha(this.lineCap,this.lineDash,this.lineStyle)}};d([Jh],Or.prototype,"text",2);var ao=class extends Or{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return Qg(e)&&e.type==="arrow"}};d([Jh],ao.prototype,"type",2);var no=class extends Or{constructor(){super(...arguments),this.type="line"}static is(e){return Qg(e)&&e.type==="line"}};d([Jh],no.prototype,"type",2);var{Property:ms}=S0,ro=class extends Or{constructor(){super(...arguments),this.label=new LM,this.reverse=!1,this.showFill=!0,this.isMultiColor=!0,this.strokes=[],this.bands=10}getDefaultColor(e){switch(e){case"line-color":return this.rangeStroke??this.stroke;case"text-color":return this.text.color}}};d([ms],ro.prototype,"label",2),d([ms],ro.prototype,"reverse",2),d([ms],ro.prototype,"showFill",2),d([ms],ro.prototype,"isMultiColor",2),d([ms],ro.prototype,"strokes",2),d([ms],ro.prototype,"rangeStroke",2),d([ms],ro.prototype,"bands",2);var{Property:Jg}=m0,zi=class extends ro{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new yn}static is(e){return x0(e)&&e.type==="fibonacci-retracement-trend-based"}};d([Jg],zi.prototype,"type",2),d([Jg],zi.prototype,"endRetracement",2);import{_ModuleSupport as v0}from"ag-charts-community";import{isObject as k0}from"ag-charts-core";var{Property:D0}=v0,lo=class extends ro{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return k0(e)&&e.type==="fibonacci-retracement"}};d([D0],lo.prototype,"type",2);import{_ModuleSupport as M0}from"ag-charts-community";import{Logger as A0,isObject as I0}from"ag-charts-core";var{BaseProperties:L0,Property:_r}=M0,oi=class extends gs(Vh(Hh(wo(Gh(gt(io(L0))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new MM,this.text=new fn,this.snapToAngle=45}static is(e){return I0(e)&&e.type==="parallel-channel"}get bottom(){const e={start:{x:this.start.x,y:this.start.y},end:{x:this.end.x,y:this.end.y}};return typeof e.start.y=="number"&&typeof e.end.y=="number"?(e.start.y-=this.height,e.end.y-=this.height):A0.warnOnce(`Annotation [${this.type}] can only be used with a numeric y-axis.`),e}getDefaultColor(e){switch(e){case"fill-color":return this.background.fill;case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(e){switch(e){case"fill-color":return this.background.fillOpacity;case"line-color":return this.strokeOpacity}}getLineDash(){return ca(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return ha(this.lineCap,this.lineDash,this.lineStyle)}};d([_r],oi.prototype,"type",2),d([_r],oi.prototype,"height",2),d([_r],oi.prototype,"middle",2),d([_r],oi.prototype,"text",2);import{_ModuleSupport as T0}from"ag-charts-community";import{isObject as C0}from"ag-charts-core";var{Property:N0}=T0,co=class extends Ir{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return C0(e)&&e.type==="text"}};d([N0],co.prototype,"type",2);function Po(e){return Vt.is(e)}function Rr(e){return no.is(e)||yt.is(e)||Bi.is(e)||ao.is(e)||ey(e)}function ho(e){return ii.is(e)||oi.is(e)}function ey(e){return lo.is(e)||zi.is(e)}function Fi(e){return bi.is(e)||Ei.is(e)||wt.is(e)||co.is(e)}function xn(e){return ei.is(e)||ti.is(e)||so.is(e)||Vt.is(e)}function ed(e){return Fi(e)&&!wt.is(e)}function Oo(e){return Rr(e)||ho(e)||xn(e)&&!Vt.is(e)}function w0(e){return Rr(e)||ho(e)||xn(e)||bi.is(e)||wt.is(e)}function P0(e){return wt.is(e)}function O0(e){return ho(e)||xn(e)||bi.is(e)||Ei.is(e)||Qh.is(e)}function _0(e){return Fi(e)&&!wt.is(e)}function pa(e){return(Rr(e)||ho(e)||xn(e))&&!Po(e)&&xM(e.text)}function R0(e,t){"fontSize"in e&&(e.fontSize=t),pa(e)&&(e.text.fontSize=t)}function ty(e,t){const i=t?.strokeWidth??e.strokeWidth??1,o=t?.type??e.lineStyle,s=o??mn(e.lineDash,o),a=Gg(i,s);e.strokeWidth=i,e.computedLineDash=a,e.lineStyle=s,e.lineCap=s==="dotted"?"round":void 0}function Er(e,t,i,o,s,a){switch(t){case"fill-color":{"fill"in e&&(e.fill=o),"fillOpacity"in e&&(e.fillOpacity=s),"background"in e&&(e.background.fill=o,e.background.fillOpacity=s);break}case"line-color":{"axisLabel"in e&&(e.axisLabel.fill=o,e.axisLabel.fillOpacity=s,e.axisLabel.stroke=o,e.axisLabel.strokeOpacity=s),"fill"in e&&"fillOpacity"in e&&P0(e)?(e.fill=o,e.fillOpacity=s):("strokeOpacity"in e&&(e.strokeOpacity=s),"isMultiColor"in e&&"rangeStroke"in e?(e.isMultiColor=a,e.rangeStroke=o):"stroke"in e&&(e.stroke=o));break}case"text-color":{"color"in e&&(e.color=i),pa(e)&&(e.text.color=o);break}}}var{deepClone:si}=yM,E0=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(zh).map(e=>[e,new Map([["line-color",void 0],["fill-color",void 0],["text-color",void 0]])])),this.fontSizes=new Map([["callout",void 0],["comment",void 0],["text",void 0],["arrow",void 0],["line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineStyles=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextAlignments=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.lineTextPositions=new Map([["line",void 0],["horizontal-line",void 0],["vertical-line",void 0],["disjoint-channel",void 0],["parallel-channel",void 0],["arrow",void 0],["date-range",void 0],["price-range",void 0],["date-price-range",void 0]]),this.fibonacciOptions=new Map([["fibonacci-retracement",{bands:void 0,reverse:void 0,showFill:void 0}],["fibonacci-retracement-trend-based",{bands:void 0,reverse:void 0,showFill:void 0}]])}createMemento(){return{colors:si(this.colors),fontSizes:si(this.fontSizes),lineStyles:si(this.lineStyles),lineTextAlignments:si(this.lineTextAlignments),lineTextPositions:si(this.lineTextPositions),fibonacciOptions:si(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=si(i.colors),this.fontSizes=si(i.fontSizes),this.lineStyles=si(i.lineStyles),this.lineTextAlignments=si(i.lineTextAlignments),this.lineTextPositions=si(i.lineTextPositions),this.fibonacciOptions=si(i.fibonacciOptions)}setDefaultColor(e,t,i,o,s,a){this.colors.get(e)?.set(t,[i,o,s,a])}setDefaultFontSize(e,t){this.fontSizes.set(e,t)}setDefaultLineStyleType(e,t){const i=this.lineStyles.get(e);i?i.type=t:this.lineStyles.set(e,{type:t})}setDefaultLineStyleWidth(e,t){const i=this.lineStyles.get(e);i?i.strokeWidth=t:this.lineStyles.set(e,{strokeWidth:t})}setDefaultLineTextAlignment(e,t){this.lineTextAlignments.set(e,t)}setDefaultLineTextPosition(e,t){this.lineTextPositions.set(e,t)}setDefaultFibonacciOptions(e,t,i){if(e!="fibonacci-retracement"&&e!="fibonacci-retracement-trend-based")return;const o=this.fibonacciOptions.get(e);o[t]=i,this.fibonacciOptions.set(e,o)}applyDefaults(e){for(const[t,i]of this.colors)if(e.type===t)for(const[o,[s,a,n,r]=[]]of i)s&&a&&n!=null&&r!=null&&Er(e,o,s,a,n,r);for(const[t,i]of this.fontSizes)e.type!==t||i==null||R0(e,i);for(const[t,i]of this.lineStyles)e.type!==t||i==null||ty(e,i);for(const[t,i]of this.lineTextPositions)e.type!==t||i==null||(e.text.position=i);for(const[t,i]of this.lineTextAlignments)e.type!==t||i==null||(e.text.alignment=i);for(const[t,i]of this.fibonacciOptions)if(!(e.type!==t||i==null))for(const o of Object.keys(i)){const s=i[o];s!=null&&e.set({[o]:s})}}};import{_ModuleSupport as iy}from"ag-charts-community";import{CleanupRegistry as B0,EventEmitter as z0}from"ag-charts-core";import{_ModuleSupport as oy}from"ag-charts-community";import{attachListener as F0,clamp as Br,createElement as H0,getWindow as sy}from"ag-charts-core";var V0='
',{Color:td}=oy,ay=e=>{try{const t=td.fromString(e),[i,o,s]=t.toHSB();return[i,o,s,t.a]}catch{return}},ny=class extends oy.AnchoredPopover{constructor(e,t){super(e,"color-picker",t),this.hasChanged=!1,this.hideFns.push(()=>{this.i18nUpdater=void 0,this.hasChanged&&this.onChangeHide?.()}),this.cleanup.register(this.ctx.eventsHub.on("locale:change",()=>this.i18nUpdater?.()))}show(e){this.hasChanged=!1,this.onChangeHide=e.onChangeHide;const{element:t,initialFocus:i}=this.createColorPicker(e),o=this.showWithChildren([t],{initialFocus:i,...e});o.classList.add("ag-charts-color-picker"),o.setAttribute("role","dialog")}createColorPicker(e){const{localeManager:t}=this.ctx;let i=e.isMultiColor??!1,[o,s,a,n]=ay(e.color??"#f00")??[0,1,.5,1];n=e.opacity??n;const r=H0("div","ag-charts-color-picker__content");r.innerHTML=V0,r.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const l=r.querySelector(".ag-charts-color-picker__palette"),c=r.querySelector(".ag-charts-color-picker__hue-input"),h=r.querySelector(".ag-charts-color-picker__multi-color-button"),p=r.querySelector(".ag-charts-color-picker__alpha-input"),u=r.querySelector(".ag-charts-color-picker__color-input"),g=r.querySelector(".ag-charts-color-picker__color-label"),y=m=>{const b={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[m];l.ariaValueText=t.t(b,{s,v:a})};this.i18nUpdater=()=>{l.ariaRoleDescription=t.t("ariaRoleDescription2DSlider"),l.ariaLabel=t.t("ariaLabelColorPickerPalette"),c.ariaLabel=t.t("ariaLabelColorPickerHue"),h.ariaLabel=t.t("ariaLabelColorPickerMultiColor"),p.ariaLabel=t.t("ariaLabelColorPickerAlpha"),u.ariaLabel=t.t("ariaLabelColor"),y("s")},this.i18nUpdater(),h.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const f=(m=!0)=>{const k=td.fromHSB(o,s,a,n).toHexString();if(r.style.setProperty("--h",`${o}`),r.style.setProperty("--s",`${s}`),r.style.setProperty("--v",`${a}`),r.style.setProperty("--a",`${n}`),r.style.setProperty("--color",k.slice(0,7)),r.style.setProperty("--color-a",k),c.value=`${o}`,p.value=`${n}`,p.classList.toggle("ag-charts-color-picker__alpha-input--opaque",n===1),h.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),g.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==u&&(h.ariaChecked=i.toString(),u.value=i?t.t("ariaLabelColorPickerMultiColor"):k.toUpperCase()),m||e.color==null){const A=td.fromHSB(o,s,a,1).toHexString();e.onChange?.(k,A,n,i)}m&&(this.hasChanged=!0)};f(!1);const x=m=>m.preventDefault(),S=m=>m.stopPropagation(),v=m=>{m.preventDefault();const b=m.currentTarget;b.focus();const k=b.getBoundingClientRect(),A=({clientX:D,clientY:L})=>{i=!1,s=Math.min(Math.max((D-k.left)/k.width,0),1),a=1-Math.min(Math.max((L-k.top)/k.height,0),1),f(),y("s")};A(m);const M=F0(sy(),"pointermove",A);sy().addEventListener("pointerup",M,{once:!0})};return r.addEventListener("mousedown",S),r.addEventListener("touchstart",S),r.addEventListener("touchmove",S),r.addEventListener("keydown",m=>{switch(m.stopPropagation(),m.key){case"Enter":case"Escape":this.hide();break;default:return}m.preventDefault()}),l.addEventListener("pointerdown",v),l.addEventListener("touchstart",x,{passive:!1}),l.addEventListener("touchmove",x,{passive:!1}),l.addEventListener("keydown",m=>{if(m.key==="ArrowLeft")s=Br(0,s-.01,1),y("s");else if(m.key==="ArrowRight")s=Br(0,s+.01,1),y("s");else if(m.key==="ArrowUp")a=Br(0,a+.01,1),y("v");else if(m.key==="ArrowDown")a=Br(0,a-.01,1),y("v");else return;m.preventDefault(),f()}),l.addEventListener("focus",()=>{y("s")}),h.addEventListener("click",()=>{i=!i,f()}),c.addEventListener("input",m=>{i=!1,o=m.currentTarget.valueAsNumber??0,f()}),p.addEventListener("input",m=>{i=!1,n=m.currentTarget.valueAsNumber??0,f()}),u.addEventListener("input",m=>{i=!1;const b=ay(m.currentTarget.value);b!=null&&([o,s,a,n]=b,f())}),u.addEventListener("blur",()=>f()),u.addEventListener("keydown",m=>{m.key==="Enter"&&(m.currentTarget.blur(),f())}),{element:r,initialFocus:l}}};import{_ModuleSupport as ry}from"ag-charts-community";function ly(e){return!(e instanceof ry.LogScale)&&!(e instanceof ry.BandScale)}var W0=[{label:"toolbarAnnotationsTrendLine",icon:"trend-line-drawing",value:"line"},{label:"toolbarAnnotationsHorizontalLine",icon:"horizontal-line-drawing",value:"horizontal-line"},{label:"toolbarAnnotationsVerticalLine",icon:"vertical-line-drawing",value:"vertical-line"},{label:"toolbarAnnotationsParallelChannel",icon:"parallel-channel-drawing",value:"parallel-channel",visible:ly},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:ly}],G0=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],K0=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],$0=[{label:"toolbarAnnotationsText",icon:"text-annotation",value:"text"},{label:"toolbarAnnotationsComment",icon:"comment-annotation",value:"comment"},{label:"toolbarAnnotationsCallout",icon:"callout-annotation",value:"callout"},{label:"toolbarAnnotationsNote",icon:"note-annotation",value:"note"}],j0=[{label:"toolbarAnnotationsArrow",icon:"arrow-drawing",value:"arrow"},{label:"toolbarAnnotationsArrowUp",icon:"arrow-up-drawing",value:"arrow-up"},{label:"toolbarAnnotationsArrowDown",icon:"arrow-down-drawing",value:"arrow-down"}],Y0=[{label:"toolbarAnnotationsQuickDatePriceRange",icon:"measurer-drawing",value:"quick-date-price-range"},{label:"toolbarAnnotationsDateRange",icon:"date-range-drawing",value:"date-range"},{label:"toolbarAnnotationsPriceRange",icon:"price-range-drawing",value:"price-range"},{label:"toolbarAnnotationsDatePriceRange",icon:"date-price-range-drawing",value:"date-price-range"}],cy=[{strokeWidth:1,label:"1",value:1},{strokeWidth:2,label:"2",value:2},{strokeWidth:3,label:"3",value:3},{strokeWidth:4,label:"4",value:4},{strokeWidth:8,label:"8",value:8}],Sn=[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],hy=[{label:"10",value:10},{label:"12",value:12},{label:"14",value:14},{label:"16",value:16},{label:"18",value:18},{label:"22",value:22},{label:"28",value:28},{label:"36",value:36},{label:"46",value:46}],{Color:dy,FloatingToolbar:U0,Menu:id,PropertiesArray:X0,ToolbarButtonProperties:py,ToolbarButtonWidget:Z0,Property:xs}=iy,ua=class extends py{constructor(){super(...arguments),this.checkedOverrides=new py}};d([xs],ua.prototype,"value",2),d([xs],ua.prototype,"checkedOverrides",2),d([xs],ua.prototype,"color",2),d([xs],ua.prototype,"strokeWidth",2),d([xs],ua.prototype,"isMultiColor",2);var q0=class extends Z0{update(e){super.update(e),e.value==="line-stroke-width"&&this.updateLineStrokeWidth(e),(e.value==="fill-color"||e.value==="line-color"||e.value==="text-color")&&this.updateFillColor(e)}updateFillColor(e){const t=this.getElement();t.classList.add("ag-charts-annotations__color-picker-button"),t.classList.toggle("ag-charts-annotations__color-picker-button--multi-color",e.isMultiColor),t.style.setProperty("--color",e.color??null)}updateLineStrokeWidth(e){const t=this.getElement();t.classList.add("ag-charts-annotations__stroke-width-button"),t.style.setProperty("--stroke-width",`${e.strokeWidth}px`)}},Q0=class extends U0{createButtonWidget(){return new q0(this.localeManager)}},od=class extends iy.BaseProperties{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new X0(ua),this.cleanup=new B0,this.events=new z0,this.visibleButtons=[],this.toolbar=new Q0(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new ny(this.ctx),this.textSizeMenu=new id(this.ctx,"text-size"),this.lineStyleTypeMenu=new id(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new id(this.ctx,"annotations-line-stroke-width"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.toolbar.addToolbarListener("toolbar-moved",this.onToolbarMoved.bind(this)),e.widgets.seriesWidget.addListener("drag-start",this.onDragStart.bind(this)),e.widgets.seriesWidget.addListener("drag-end",this.onDragEnd.bind(this)),()=>{this.colorPicker.destroy(),this.toolbar.destroy()})}onDragStart(){this.toolbar.ignorePointerEvents()}onDragEnd(){this.toolbar.capturePointerEvents()}destroy(){this.cleanup.flush()}show(){this.enabled&&this.toolbar.show()}hide(){this.toolbar.hide()}updateButtons(e){if(!this.enabled)return;const t={"line-style-type":Oo(e),"line-stroke-width":Oo(e),"line-color":w0(e),"text-color":_0(e),"fill-color":O0(e),"text-size":ed(e),settings:pa(e),lock:!0,delete:!0};this.visibleButtons=this.buttons.filter(i=>t[i.value]),this.toolbar.clearButtons(),this.toolbar.updateButtons(this.visibleButtons),this.refreshButtons(e)}setAnchorScene(e){this.toolbar.hasBeenDragged()||this.toolbar.setAnchor(e.getAnchor())}hideOverlays(){this.toolbar.clearActiveButton(),this.colorPicker.hide({lastFocus:null}),this.textSizeMenu.hide(),this.lineStyleTypeMenu.hide(),this.lineStrokeWidthMenu.hide(),this.events.emit("hid-overlays",null)}clearActiveButton(){this.toolbar.clearActiveButton()}updateColors(e){this.updateColorPickerColor("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),"isMultiColor"in e&&e?.isMultiColor),this.updateColorPickerColor("text-color",e.getDefaultColor("text-color"),e.getDefaultOpacity("text-color"),"isMultiColor"in e&&e?.isMultiColor)}updateColorPickerColor(e,t,i,o){if(t!=null&&i!=null){const{r:s,g:a,b:n}=dy.fromString(t);t=dy.fromArray([s,a,n,i]).toHexString()}this.updateButtonByValue(e,{color:t,isMultiColor:o})}updateFontSize(e){this.updateButtonByValue("text-size",{label:e==null?void 0:String(e)})}updateLineStyleType(e){this.updateButtonByValue("line-style-type",{icon:e.icon})}updateStrokeWidth(e){this.updateButtonByValue("line-stroke-width",{label:e.label,strokeWidth:e.value})}onButtonPress({event:e,button:t,buttonWidget:i}){const o=this.getActiveDatum();if(o)switch(this.hideOverlays(),t.value){case"line-style-type":{const s=Oo(o)?mn(o.lineDash,o.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:Sn,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,onPress:a=>this.onLineStyleTypeMenuPress(a,o),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=Oo(o)?o.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:cy,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,onPress:a=>this.onLineStrokeWidthMenuPress(a,o),class:"ag-charts-annotations__line-stroke-width-menu"});break}case"line-color":case"fill-color":case"text-color":{this.toolbar.toggleActiveButtonByIndex(t.index),this.colorPicker.show({color:o?.getDefaultColor(t.value),opacity:o?.getDefaultOpacity(t.value),sourceEvent:e.sourceEvent,hasMultiColorOption:"isMultiColor"in o,isMultiColor:"isMultiColor"in o&&o?.isMultiColor,onChange:o==null?void 0:this.onColorPickerChange.bind(this,t.value,o),onChangeHide:(s=>{this.events.emit("saved-color",{type:o.type,colorPickerType:t.value,color:o.getDefaultColor(s)})}).bind(this,t.value)});break}case"text-size":{const s=Fi(o)?o.fontSize:void 0;this.textSizeMenu.show(i,{items:hy,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,onPress:a=>this.onTextSizeMenuPress(a,o),class:"ag-charts-annotations__text-size-menu"});break}case"delete":{this.events.emit("pressed-delete",null);break}case"lock":{o.locked=!o.locked,this.refreshButtons(o),this.events.emit("pressed-lock",{locked:o.locked});break}case"settings":{this.toolbar.toggleActiveButtonByIndex(t.index),this.events.emit("pressed-settings",e);break}}}onToolbarMoved(e){const{buttonBounds:t,popoverBounds:i}=e,o={x:i.x,y:i.y+i.height+4},s={y:i.y-4};this.colorPicker.setAnchor(o,s);for(const[a,n]of t.entries()){const r=this.visibleButtons.at(a);if(!r)continue;const l={x:n.x,y:n.y+n.height-1},c={y:n.y};switch(r.value){case"line-stroke-width":this.lineStrokeWidthMenu.setAnchor(l,c);break;case"line-style-type":this.lineStyleTypeMenu.setAnchor(l,c);break;case"text-size":this.textSizeMenu.setAnchor(l,c);break}}}onColorPickerChange(e,t,i,o,s,a){this.events.emit("updated-color",{type:t.type,colorPickerType:e,colorOpacity:i,color:o,opacity:s,isMultiColor:a}),this.updateColorPickerColor(e,i,s,a)}onTextSizeMenuPress(e,t){if(!ed(t))return;const i=e.value;this.events.emit("updated-font-size",{type:t.type,fontSize:i}),this.textSizeMenu.hide(),this.updateFontSize(i)}onLineStyleTypeMenuPress(e,t){if(!Oo(t))return;const i=e.value;this.events.emit("updated-line-style",{type:t.type,lineStyleType:i}),this.lineStyleTypeMenu.hide(),this.updateLineStyleType(e)}onLineStrokeWidthMenuPress(e,t){if(!Oo(t))return;const i=e.value;this.events.emit("updated-line-width",{type:t.type,strokeWidth:i}),this.lineStrokeWidthMenu.hide(),this.updateStrokeWidth(e)}refreshButtons(e){const t=e.locked??!1;for(const[i,o]of this.visibleButtons.entries())o&&(o.value==="lock"?(this.toolbar.toggleSwitchCheckedByIndex(i,t),this.updateButtonByIndex(i,t?o.checkedOverrides.toJson():o.toJson())):this.toolbar.toggleButtonEnabledByIndex(i,!t));ed(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!Oo(e))return;const t=e.strokeWidth??1,i=mn(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(Sn.find(o=>o.value===i)??Sn[0])}updateButtonByValue(e,t){const i=this.visibleButtons.findIndex(o=>o.value===e);i!==-1&&this.updateButtonByIndex(i,t)}updateButtonByIndex(e,t){const i=this.visibleButtons.at(e);i&&this.toolbar.updateButtonByIndex(e,{...i.toJson(),...t,value:t.value??i.value})}};d([xs],od.prototype,"enabled",2),d([xs],od.prototype,"buttons",2);import{_ModuleSupport as J0}from"ag-charts-community";var{StateMachine:uy,StateMachineProperty:sd,Vec2:gy,Debug:eA}=J0,we=class extends uy{constructor(e){const t=({context:i})=>{this.node?.drag(this.datum,this.offset,i,this.snapping),e.update()};super("idle",{idle:{dragStart:{target:"dragging",action:({offset:i,context:o})=>{this.hasMoved=!1,this.dragStart=i,this.offset=i,this.node?.dragStart(this.datum,i,o)}}},dragging:{keyDown:t,keyUp:t,drag:({offset:i,context:o})=>{this.hasMoved=gy.lengthSquared(gy.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,o,this.snapping),e.update()},dragEnd:{target:uy.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=eA.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};d([sd()],we.prototype,"snapping",2),d([sd()],we.prototype,"datum",2),d([sd()],we.prototype,"node",2);import{_ModuleSupport as tA}from"ag-charts-community";import{isObject as iA}from"ag-charts-core";var{Property:oA}=tA,_o=class extends Qh{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return iA(e)&&e.type==="arrow-down"}};d([oA],_o.prototype,"type",2);import{_ModuleSupport as sA}from"ag-charts-community";import{_ModuleSupport as aA}from"ag-charts-community";import{_ModuleSupport as zr}from"ag-charts-community";import{isObject as nA}from"ag-charts-core";import{_ModuleSupport as ad}from"ag-charts-community";import{_ModuleSupport as rA}from"ag-charts-community";var ga=class extends rA.Marker{isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}},yy=class zk extends ad.Group{constructor(){super(...arguments),this.active=!1,this.locked=!1,this.visible=!1,this.zIndex=1}drag(t){const{handle:i,locked:o}=this;return o?{point:{x:i.x,y:i.y},offset:{x:0,y:0}}:{point:t,offset:{x:t.x-i.x,y:t.y-i.y}}}toggleActive(t){this.active=t,t||(this.handle.strokeWidth=zk.INACTIVE_STROKE_WIDTH)}toggleHovered(t){this.glow.visible=!this.locked&&t,this.glow.dirtyPath=!0}toggleDragging(t){this.locked||(this.handle.visible=!t,this.glow.visible=this.glow.visible&&!t,this.handle.dirtyPath=!0,this.glow.dirtyPath=!0)}toggleLocked(t){this.locked=t}getCursor(){}containsPoint(t,i){return this.handle.containsPoint(t,i)}};yy.INACTIVE_STROKE_WIDTH=2;var Ro=yy,nd=class Fk extends Ro{constructor(){super(),this.handle=new ga({shape:"circle"}),this.glow=new ga({shape:"circle"}),this.append([this.handle]),this.handle.size=Fk.HANDLE_SIZE,this.handle.strokeWidth=Ro.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:Ro.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};nd.HANDLE_SIZE=7,nd.GLOW_SIZE=9;var Eo=nd,Fr=class Ft extends Ro{constructor(){super(),this.handle=new ad.Rect,this.glow=new ad.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=Ft.CORNER_RADIUS,this.handle.width=Ft.HANDLE_SIZE,this.handle.height=Ft.HANDLE_SIZE,this.handle.strokeWidth=Ro.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=Ft.CORNER_RADIUS,this.glow.width=Ft.GLOW_SIZE,this.glow.height=Ft.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){if(super.toggleLocked(t),t){const i=(Ft.HANDLE_SIZE-Eo.HANDLE_SIZE)/2;this.handle.cornerRadius=1,this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.x+=i,this.handle.y+=i,this.handle.width=Eo.HANDLE_SIZE,this.handle.height=Eo.HANDLE_SIZE,this.glow.width=Eo.GLOW_SIZE,this.glow.height=Eo.GLOW_SIZE}else this.handle.cornerRadius=Ft.CORNER_RADIUS,this.handle.width=Ft.HANDLE_SIZE,this.handle.height=Ft.HANDLE_SIZE,this.glow.width=Ft.GLOW_SIZE,this.glow.height=Ft.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles)}update(t){if(this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked){delete t.fill,delete t.strokeWidth;const i=(Ft.HANDLE_SIZE-Eo.HANDLE_SIZE)/2;t.x-=i,t.y-=i,this.cachedStyles.x-=i,this.cachedStyles.y-=i}this.handle.setProperties(t),this.glow.setProperties({...t,x:(t.x??this.glow.x)-2,y:(t.y??this.glow.y)-2,strokeWidth:0,fill:t.stroke})}drag(t){return this.locked?{point:t,offset:{x:0,y:0}}:this.gradient==="vertical"?{point:{x:t.x,y:this.handle.y},offset:{x:t.x-this.handle.x,y:0}}:{point:{x:this.handle.x,y:t.y},offset:{x:0,y:t.y-this.handle.y}}}getCursor(){if(!this.locked)return this.gradient==="vertical"?"col-resize":"row-resize"}};Fr.HANDLE_SIZE=12,Fr.GLOW_SIZE=16,Fr.CORNER_RADIUS=4;var ya=Fr,rd=class fr extends Ro{constructor(){super(),this.handle=new ga({shape:"circle"}),this.glow=new ga({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=fr.HANDLE_SIZE,this.handle.strokeWidth=Ro.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=fr.GLOW_SIZE,this.glow.strokeWidth=0,this.glow.fillOpacity=.2,this.glow.zIndex=1,this.glow.visible=!1}toggleLocked(t){super.toggleLocked(t),t?(this.handle.fill=this.handle.stroke,this.handle.strokeWidth=0,this.handle.size=Eo.HANDLE_SIZE,this.glow.size=Eo.GLOW_SIZE):(this.handle.size=fr.HANDLE_SIZE,this.glow.size=fr.GLOW_SIZE,this.cachedStyles&&this.handle.setProperties(this.cachedStyles))}update(t){this.cachedStyles={...t},this.active||delete t.strokeWidth,this.locked&&(delete t.fill,delete t.strokeWidth),this.handle.setProperties(t),this.glow.setProperties({...t,strokeWidth:0,fill:t.stroke})}getCursor(){return"pointer"}};rd.HANDLE_SIZE=11,rd.GLOW_SIZE=17;var De=rd,{ZIndexMap:lA}=zr,Ze=class extends zr.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=lA.CHART_ANNOTATION}static isCheck(e,t){return nA(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e,t,i){i!==!0&&this.toggleHandles(e||t)}computeBBoxWithoutHandles(){return zr.Transformable.toCanvas(this,zr.Group.computeChildrenBBox(this.excludeChildren({instance:Ro})))}updateNode(e,t,i){if(!i&&t){t.remove();return}return i&&t==null&&(t=new e,this.appendChild(t)),t}};import{_ModuleSupport as cA}from"ag-charts-community";import{_ModuleSupport as hA}from"ag-charts-community";import{entries as dA}from"ag-charts-core";var{ContinuousScale:pA,Vec2:ai,toRadians:uA}=hA;function bn(e,t,i=!1,o,s=1){if(!i)return Dt(e,t);const a=o?ke(o,t):ai.origin();return Dt(Hr(e,a,s),t)}function Hr(e,t,i){const o=ai.sub(e,t),s=uA(i),a=Math.round(ai.angle(o)/s)*s;return ai.rotate(o,a,t)}function Vr(e,t){const i={};for(const[o,s]of dA(e))i[o]=ke(s,t);return i}function po(e,t,i,o={overflowContinuous:0,translateVectors:void 0,invertYVectors:void 0,snap:void 0}){const{xAxis:s,yAxis:a}=i,n=Object.keys(e),r=[],l=[],c=new Set(o.translateVectors??n),h=new Set(o.invertYVectors??[]),p=new Set([...c,...h]),u=ai.multiply(t,ai.from(1,-1));for(const S of n)p.has(S)&&(e[S]=ai.add(e[S],h.has(S)?u:t),o.snap&&(e[S]=Hr(e[S],o.snap.vectors[S],o.snap.angle))),r.push(s.getRangeOverflow(e[S].x)),l.push(a.getRangeOverflow(e[S].y));const g=(S,v)=>Math.abs(S)-Math.abs(v),y=(S,v,m)=>o.overflowContinuous===0||!pA.is(S)?m.toSorted(g).at(-1)??0:n.length===p.size?m.toSorted(g).at(-o.overflowContinuous-1)??0:m.filter(k=>k!==0).length<=o.overflowContinuous?0:m.filter((k,A)=>k!==0&&Math.abs(k)<=Math.abs(v)&&p.has(n[A])).toSorted(g).at(-1)??0,f=ai.from(y(s.scale,t.x,r),y(a.scale,t.y,l));if(!ai.equal(f,ai.origin()))for(const S of n)p.has(S)&&(e[S]=ai.round(ai.sub(e[S],f),4));const x={};for(const S of n)x[S]=Dt(e[S],i);return x}var{Vec2:gA}=cA,fy=class extends Ze{constructor(){super(...arguments),this.handle=new De,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=ke(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...Vr({handle:e},i)}}drag(e,t,i){const{dragState:o}=this;if(!e.isWriteable()||!o)return;const{point:s}=po({point:o.handle},gA.sub(t,o.offset),i);e.x=s.x,e.y=s.y}translate(e,t,i){if(!e.isWriteable())return;const{point:o}=po({point:ke(e,i)},t,i);e.x=o.x,e.y=o.y}toggleHandles(e){this.handle.visible=!!e,this.handle.toggleHovered(this.activeHandle==="handle")}toggleActive(e){this.toggleHandles(e),this.handle.toggleActive(e)}stopDragging(){this.handle.toggleDragging(!1)}copy(e,t,i){const o=ke(e,i),s=Dt({x:o.x-30,y:o.y-30},i);return t.x=s.x,t.y=s.y,t}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{handle:i}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="handle",!0):!1}getNodeAtCoords(e,t){if(this.handle.containsPoint(e,t))return"handle"}updateHandle(e,t,i){const{x:o,y:s}=this.getHandleCoords(e,t,i),a=this.getHandleStyles(e);this.handle.update({...a,x:o,y:s}),this.handle.toggleLocked(e.locked??!1)}updateAnchor(e,t,i){const o=this.getHandleCoords(e,t);return{x:o.x+i.seriesRect.x,y:o.y+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i){return{x:t.x,y:t.y}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},my=class extends fy{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=ke(e,t);this.updateShape(e,i)}updateShape(e,t){this.updateShapeStyles(e),this.updateShapePath(e,t)}updateShapeStyles(e){const{shape:t}=this;t.fill=e.fill,t.fillOpacity=e.fillOpacity??1}updateShapePath(e,t){const{shape:i}=this;i.x=t.x,i.y=t.y,i.size=e.size}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}getNodeAtCoords(e,t){return this.shape.containsPoint(e,t)?"shape":super.getNodeAtCoords(e,t)}},xy=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function Sy(e){aA.drawMarkerUnitPolygon(e,xy)}Sy.anchor={x:.5,y:0};var Wr=class extends my{constructor(){super(),this.type="arrow-up",this.shape=new ga({shape:Sy}),this.append([this.shape])}static is(e){return Ze.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=De.HANDLE_SIZE/2,o=super.getHandleCoords(e,t);return o.y-=i,o}},yA=xy.map(([e,t])=>[e,1-t]);function by(e){sA.drawMarkerUnitPolygon(e,yA)}by.anchor={x:.5,y:1};var Gr=class extends my{constructor(){super(),this.type="arrow-down",this.shape=new ga({shape:by}),this.append([this.shape])}static is(e){return Ze.isCheck(e,"arrow-down")}updateAnchor(e,t,i){const o=super.updateAnchor(e,t,i);return o.y-=e.size,o}getHandleCoords(e,t){const i=De.HANDLE_SIZE/2,o=super.getHandleCoords(e,t);return o.y+=i,o}};import{_ModuleSupport as fA}from"ag-charts-community";var{StateMachine:Kr,StateMachineProperty:mA,Debug:xA}=fA,ld=class extends Kr{constructor(e){const t=({point:o})=>{const s=this.createDatum();s.set({x:o.x,y:o.y}),e.create(s)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},cancel:Kr.parent,reset:Kr.parent},"waiting-first-render":{render:{target:Kr.parent,action:i}}}),this.debug=xA.create(!0,"annotations")}};d([mA()],ld.prototype,"node",2);var SA=class extends ld{createDatum(){return new _o}},vy={type:"arrow-down",datum:_o,scene:Gr,isDatum:_o.is,translate:(e,t,i,o)=>{_o.is(t)&&Gr.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(_o.is(t)&&_o.is(i)&&Gr.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{_o.is(t)&&Gr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new SA({...e,create:t("arrow-down")}),dragState:e=>new we(e)};import{_ModuleSupport as bA}from"ag-charts-community";import{isObject as vA}from"ag-charts-core";var{Property:kA}=bA,Bo=class extends Qh{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return vA(e)&&e.type==="arrow-up"}};d([kA],Bo.prototype,"type",2);var DA=class extends ld{createDatum(){return new Bo}},ky={type:"arrow-up",datum:Bo,scene:Wr,isDatum:Bo.is,translate:(e,t,i,o)=>{Bo.is(t)&&Wr.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Bo.is(t)&&Bo.is(i)&&Wr.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Bo.is(t)&&Wr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new DA({...e,create:t("arrow-up")}),dragState:e=>new we(e)};import{_ModuleSupport as MA}from"ag-charts-community";import{_ModuleSupport as Dy}from"ag-charts-community";import{_ModuleSupport as AA}from"ag-charts-community";import{entries as IA}from"ag-charts-core";import{_ModuleSupport as LA}from"ag-charts-community";var{Vec2:TA,Vec4:My}=LA,Ay=class extends Ze{constructor(){super(...arguments),this.overflowContinuous=0}extendLine({x1:e,y1:t,x2:i,y2:o},s,a){const n={x1:e,y1:t,x2:i,y2:o};if(!s.extendStart&&!s.extendEnd)return n;const[r,l]=YM(n,a.yAxis.bounds),c=n.x2=n.y2,p=n.x2===n.x1;return s.extendEnd&&(p?n.y2=h?l.y:r.y:(n.x2=c?r.x:l.x,n.y2=c?r.y:l.y)),s.extendStart&&(p?n.y1=h?r.y:l.y:(n.x1=c?l.x:r.x,n.y1=c?l.y:r.y)),n}dragStart(e,t,i){this.dragState={offset:t,...Vr({start:e.start,end:e.end},i)}}drag(e,t,i,o){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,o):this.dragAll(e,t,i))}dragAll(e,t,i){const{dragState:o}=this;o&&this.translatePoints(e,o.start,o.end,TA.sub(t,o.offset),i)}translate(e,t,i){e.isWriteable()&&this.translatePoints(e,ke(e.start,i),ke(e.end,i),t,i)}copy(e,t,i){const o=kt(e,i);if(!o)return;const s=this.computeBBoxWithoutHandles(),a={x:-s.width/2,y:-s.height/2};return this.translatePoints(t,My.start(o),My.end(o),a,i),t}translatePoints(e,t,i,o,s){const a=this.getTranslatePointsVectors(t,i),n=po(a,o,s,{overflowContinuous:this.overflowContinuous});e.start.x=n.start.x,e.end.x=n.end.x,e.start.y=n.start.y,e.end.y=n.end.y}getTranslatePointsVectors(e,t){return{start:e,end:t}}},{Vec2:CA,Vec4:Iy}=AA,cd=class extends Ay{constructor(){super(...arguments),this.start=new De,this.end=new De,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=kt(e,t);i!=null&&(this.updateHandles(e,i),this.updateAnchor(e,i,t))}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of IA(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}dragHandle(e,t,i,o){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const n=s==="start"?"end":"start",r=o?{vectors:{[s]:ke(e[n],i)},angle:e.snapToAngle}:void 0,{[s]:l}=po({[s]:a[s]},CA.sub(t,a.offset),i,{overflowContinuous:0,snap:r});e[s].x=l.x,e[s].y=l.y}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}getAnchor(){return this.anchor}getCursor(){return"pointer"}containsPoint(e,t){const{start:i,end:o}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):o.containsPoint(e,t)?(this.activeHandle="end",!0):!1}getNodeAtCoords(e,t){if(this.start.containsPoint(e,t)||this.end.containsPoint(e,t))return"handle"}updateHandles(e,t,i){this.start.update({...this.getHandleStyles(e,"start"),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e,"end"),...this.getHandleCoords(e,t,"end",i)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}updateAnchor(e,t,i,o){this.anchor={x:t.x1+i.seriesRect.x,y:t.y1+i.seriesRect.y,position:this.anchor.position}}getHandleCoords(e,t,i,o){return i==="start"?Iy.start(t):Iy.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},{Vec4:Ly}=Dy,NA=class extends cd{constructor(){super(...arguments),this.label=new Dy.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualStartEndScene")}update(e,t){const i=kt(e,t);if(i==null)return;const o=this.getTextBBox(e,i);this.updateLabel(e,o,i),this.updateHandles(e,i,o),this.updateShape(e,o,i),this.updateAnchor(e,i,t,o)}containsPoint(e,t){return super.containsPoint(e,t)||this.label.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t){const{text:i}=e.getText();return qh(e,i,Ly.end(t),this.textInputBBox)}updateLabel(e,t,i){const{text:o,isPlaceholder:s}=e.getText();$g(this.label,o,s,e,this.getLabelCoords(e,t,i))}updateShape(e,t,i){}getLabelCoords(e,t,i){return Ly.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:wA,Path:PA}=MA,$r=class extends NA{constructor(){super(),this.type="callout",this.shape=new PA,this.append([this.shape,this.label,this.start,this.end])}static is(e){return Ze.isCheck(e,"callout")}drag(e,t,i,o){e.isWriteable()&&(this.activeHandle==="end"?this.dragHandle(e,t,i,o):this.dragAll(e,t,i))}getLabelCoords(e,t,i){const o=e.getPadding(),{bodyBounds:s={x:0,y:0,width:0,height:0}}=this.getDimensions(e,t,i)??{};return{x:s.x+o.left,y:s.y-o.bottom}}getHandleStyles(e,t){return t==="start"?{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}:{fill:void 0,strokeWidth:0}}updateAnchor(e,t,i,o){const{bodyBounds:s}=this.getDimensions(e,o,t)??{},a=s??o;this.anchor={x:a.x+i.seriesRect.x,y:a.y+i.seriesRect.y-a.height,position:this.anchor.position}}updateShape(e,t,i){const{shape:o}=this;o.fill=e.fill,o.fillOpacity=e.fillOpacity??1,o.stroke=e.stroke,o.strokeWidth=e.strokeWidth??1,o.strokeOpacity=e.strokeOpacity??1;const{tailPoint:s,bodyBounds:a}=this.getDimensions(e,t,i)??{};!s||!a||this.updatePath(s,a)}updatePath(e,t){const{x:i,y:o}=e,{x:s,y:a,width:n,height:r}=t,l=a-r,c=s+n,h=this.calculateCalloutPlacement({x:i,y:o},t),p=8,u=[{coordinates:{x0:s,x1:s+p,y0:l+p,y1:l,cx:h==="topLeft"?i:s+p,cy:h==="topLeft"?o:l+p},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:s+p,x1:c-p,y0:l,y1:l,cx:i,cy:o},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-p,x1:c,y0:l,y1:l+p,cx:h==="topRight"?i:c-p,cy:h==="topRight"?o:l+p},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+p,y1:a-p,cx:i,cy:o},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-p,y0:a-p,y1:a,cx:h==="bottomRight"?i:c-p,cy:h==="bottomRight"?o:a-p},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-p,x1:s+p,y0:a,y1:a,cx:i,cy:o},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:s+p,x1:s,y0:a,y1:a-p,cx:h==="bottomLeft"?i:s+p,cy:h==="bottomLeft"?o:a-p},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:s,x1:s,y0:a-p,y1:l+p,cx:i,cy:o},type:h==="left"?"calloutSide":"side"}],{path:g}=this.shape;g.clear(),g.moveTo(s,l+p);for(const{coordinates:y,type:f}of u)this.drawPath(g,y,p,f);g.closePath()}drawPath(e,{x0:t,y0:i,x1:o,y1:s,cx:a,cy:n},r,l){switch(l){case"calloutCorner":{e.lineTo(a,n),e.lineTo(o,s);break}case"corner":{wA(e,{x0:t,x1:o,y0:i,y1:s,cx:a,cy:n},r,!1);break}case"calloutSide":{if(t===o){const h=i>s?-1:1,p=Math.min(i,s)+Math.abs(i-s)/2;e.lineTo(t,p-6*h),e.lineTo(a,n),e.lineTo(t,p+6*h),e.lineTo(o,s)}else{const h=t>o?-1:1,p=Math.min(t,o)+Math.abs(o-t)/2;e.lineTo(p-6*h,i),e.lineTo(a,n),e.lineTo(p+6*h,i),e.lineTo(o,s)}break}case"side":default:{e.lineTo(o,s);break}}}calculateCalloutPlacement(e,t){const i=t.x+t.width,o=t.y-t.height;let s,a;return e.x>i?s="right":e.xt.y?a="bottom":e.y{const g=this.createDatum();g.set({start:u,end:u,visible:!0}),e.create(g)},i=()=>{const{node:u}=this;u?.toggleActive(!0),u?.toggleHandles({start:!0})},o=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},a=u=>{this.node?.setTextInputBBox(u),e.update()},n=({point:u})=>{const{datum:g,node:y}=this;g?.set({end:u}),y?.toggleActive(!0),y?.toggleHandles({end:!1}),e.update()},r=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:u,colorOpacity:g,color:y,opacity:f,isMultiColor:x})=>{const{datum:S}=this;S&&(u==="text-color"&&e.updateTextInputColor(y),Er(S,u,g,y,f,x),e.update())},c=u=>{const{datum:g,node:y}=this;!g||!y||!Fi(g)||(g.fontSize=u,e.updateTextInputFontSize(u),e.update())},h=()=>{e.delete()},p=({textInputValue:u,bbox:g})=>{const{datum:y}=this;if(g!=null&&u!=null&&u.length>0){if(!Fi(y))return;const f=Nr(y,u,g.width);y?.set({text:f}),e.update(),e.recordAction(`Create ${y?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:vi.parent,reset:vi.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:n,drag:n,click:{target:"edit",action:r},dragEnd:{target:"edit",action:r},reset:{target:vi.parent,action:h},cancel:{target:vi.parent,action:h}},edit:{onEnter:o,updateTextInputBBox:a,color:l,fontSize:c,textInput:[{guard:hd,target:vi.parent,action:h},{guard:dd,target:vi.parent,action:p}],click:{target:vi.parent,action:p},dragStart:{target:vi.parent,action:p},resize:{target:vi.parent,action:p},onExit:s,cancel:{target:vi.parent,action:h}}}),this.debug=_A.create(!0,"annotations")}};d([Ty()],pd.prototype,"datum",2),d([Ty()],pd.prototype,"node",2);var RA=class extends pd{createDatum(){return new bi}},Cy={type:"callout",datum:bi,scene:$r,isDatum:bi.is,translate:(e,t,i,o)=>{if(bi.is(t)&&$r.is(e))return e.translate(t,i,o)},copy:(e,t,i,o)=>{if(bi.is(t)&&bi.is(i)&&$r.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{bi.is(t)&&$r.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new RA({...e,create:t("callout")}),dragState:e=>new we(e)};import{_ModuleSupport as Ny}from"ag-charts-community";import{calcLineHeight as EA}from"ag-charts-core";import{_ModuleSupport as BA}from"ag-charts-community";var ud=class extends fy{constructor(){super(...arguments),this.label=new BA.Text({zIndex:1}),this.anchor={x:0,y:0,position:"above-left"}}setTextInputBBox(e){this.textInputBBox=e,this.markDirty("TextualPointScene")}update(e,t){const i=ke(e,t),o=this.getTextBBox(e,i,t);this.updateLabel(e,o),this.updateHandle(e,i,o),this.updateShape(e,o),this.anchor=this.updateAnchor(e,o,t)}copy(e,t,i){const o=ke(e,i),s=this.getTextBBox(e,o,i),a=e.getPadding(),n=a.left+a.right,r=a.top+a.bottom,l=(s.width+n)/2,c=s.height+r,h=Dt({x:o.x-l,y:o.y-c},i);return t.x=h.x,t.y=h.y,t}containsPoint(e,t){const{label:i}=this;return super.containsPoint(e,t)||i.visible&&i.containsPoint(e,t)}getNodeAtCoords(e,t){return this.label.visible&&this.label.containsPoint(e,t)?"text":super.getNodeAtCoords(e,t)}getTextBBox(e,t,i){const{text:o}=e.getText();return qh(e,o,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t){const{text:i,isPlaceholder:o}=e.getText();$g(this.label,i,o,e,this.getLabelCoords(e,t),this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:t.x+i.seriesRect.x,y:t.y+i.seriesRect.y-t.height,position:this.anchor.position}}getLabelCoords(e,t){return t}getTextBaseline(e){return e.position=="center"?"middle":e.position}getHandleCoords(e,t,i){return i}getHandleStyles(e){const t=super.getHandleStyles(e);return t.stroke=e.handle.stroke??e.color,t}},{drawCorner:gd}=Ny,jr=class extends ud{constructor(){super(),this.type="comment",this.shape=new Ny.Path,this.append([this.shape,this.label,this.handle])}static is(e){return Ze.isCheck(e,"comment")}updateShape(e,t){const{shape:i}=this;i.fill=e.fill,i.fillOpacity=e.fillOpacity??1,i.stroke=e.stroke??"transparent",i.strokeWidth=e.strokeWidth??1,i.strokeOpacity=e.strokeOpacity??1,this.updatePath(e,t)}getLabelCoords(e,t){const i=e.getPadding();return{x:t.x+i.left,y:t.y-i.bottom}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}updateAnchor(e,t,i){const o=super.updateAnchor(e,t,i),s=e.getPadding();return o.y-=s.bottom+s.top,o}updatePath(e,t){const i=e.getPadding(),{x:o,y:s}=t;let{width:a,height:n}=t;const{fontSize:r}=e,l=i.left+i.right,c=i.top+i.bottom;a=a+l,n=Math.max(n+c,r+c);const h=s-n,p=o+a,u=(EA(r,Cr)+c)/2,{path:g}=this.shape;g.clear(),g.moveTo(o,s),g.lineTo(o,h+u),gd(g,{x0:o,x1:o+u,y0:h+u,y1:h,cx:o+u,cy:h+u},u,!1),g.lineTo(p-u,h),gd(g,{x0:p-u,x1:p,y0:h,y1:h+u,cx:p-u,cy:h+u},u,!1),g.lineTo(p,s-u),gd(g,{x0:p,x1:p-u,y0:s-u,y1:s,cx:p-u,cy:s-u},u,!1),g.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}};import{_ModuleSupport as zA}from"ag-charts-community";var{StateMachine:uo,StateMachineProperty:wy,Debug:FA}=zA,vn=class extends uo{constructor(e){const t=({point:h})=>{const p=this.createDatum();p.set({x:h.x,y:h.y}),e.create(p)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()},o=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{e.hideTextInput(),this.datum&&(this.datum.visible=!0),e.deselect()},a=h=>{this.node?.setTextInputBBox(h),e.update()},n=({colorPickerType:h,colorOpacity:p,color:u,opacity:g,isMultiColor:y})=>{this.datum&&(h==="text-color"&&e.updateTextInputColor(u),Er(this.datum,h,p,u,g,y),e.update())},r=h=>{const{datum:p,node:u}=this;!p||!u||!Fi(p)||(p.fontSize=h,e.updateTextInputFontSize(h),e.update())},l=()=>{e.delete()},c=({textInputValue:h,bbox:p})=>{if(p!=null&&h!=null&&h.length>0){const{datum:u}=this;if(!Fi(u))return;const g=Nr(u,h,p.width);u?.set({text:g}),e.update(),e.recordAction(`Create ${u?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:uo.parent,reset:uo.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:o,updateTextInputBBox:a,color:n,fontSize:r,textInput:[{guard:hd,target:uo.parent,action:l},{guard:dd,target:uo.parent,action:c}],click:{target:uo.parent,action:c},dragStart:{target:uo.parent,action:c},resize:{target:uo.parent,action:c},onExit:s,cancel:{target:uo.parent,action:l}}}),this.debug=FA.create(!0,"annotations")}};d([wy()],vn.prototype,"datum",2),d([wy()],vn.prototype,"node",2);var HA=class extends vn{createDatum(){return new Ei}},Py={type:"comment",datum:Ei,scene:jr,isDatum:Ei.is,translate:(e,t,i,o)=>{Ei.is(t)&&jr.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Ei.is(t)&&Ei.is(i)&&jr.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Ei.is(t)&&jr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new HA({...e,create:t("comment")}),dragState:e=>new we(e)};import{_ModuleSupport as VA}from"ag-charts-community";import{_ModuleSupport as Yr}from"ag-charts-community";var{calculateLabelTranslation:WA}=Yr,Oy=class extends Yr.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new Yr.Text({zIndex:1}),this.rect=new Yr.Rect;const{label:e}=this;e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.textBaseline="middle",e.textAlign="center",this.append([this.rect,this.label])}update(e){this.updateLabel(e),this.updateRect(e),this.updatePosition(e)}updateLabel({value:e,styles:t,context:i}){const{fontWeight:o,fontSize:s,fontStyle:a,fontFamily:n,textAlign:r,color:l="white",formatter:c}=t,h=c?c({value:e}):i.formatScaleValue(e,"annotation-label");this.label.setProperties({fontWeight:o,fontSize:s,fontStyle:a,fontFamily:n,textAlign:r,fill:l,text:h})}updateRect({styles:e}){const{rect:t}=this,{cornerRadius:i,fill:o,fillOpacity:s,stroke:a,strokeOpacity:n}=e;t.fill=o,t.fillOpacity=s??1,t.stroke=a,t.strokeOpacity=n??1,t.cornerRadius=i??0}updatePosition({x:e,y:t,context:i,styles:{padding:o}}){const{label:s,rect:a}=this,n=s.getBBox()?.clone(),r=o??8,l=o??4,{xTranslation:c,yTranslation:h}=WA({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:n});n.grow(r,"horizontal"),n.grow(l,"vertical");const p=e+c,u=t+h;s.x=p,s.y=u,a.y=u-Math.round(n.height/2),a.x=p-Math.round(n.width/2),a.height=n.height,a.width=n.width}};Oy.className="AxisLabel";import{_ModuleSupport as Ur}from"ag-charts-community";var{Vec2:Hi}=Ur,Pt=class extends Ur.Line{constructor(){super(...arguments),this.growCollisionBox=9,this.clipMask=new Map}setProperties(e){return super.setProperties(e),this.updateCollisionBBox(),this}updateCollisionBBox(){const{growCollisionBox:e,strokeWidth:t,x1:i,y1:o,x2:s,y2:a}=this;let n=t+e;n%2===0&&(n+=1);const r=Hi.from(i,o-Math.floor(n/2)),l=Hi.from(s,a),c=Hi.distance(r,l);this.collisionBBox=new Ur.BBox(r.x,r.y,c,n)}isPointInPath(e,t){const{collisionBBox:i,x1:o,y1:s,x2:a,y2:n}=this;if(!i)return!1;const r=Hi.from(o,s),l=Hi.from(a,n),c=Hi.sub(Hi.from(e,t),r),h=Hi.sub(l,r),p=Hi.rotate(c,Hi.angle(c,h),r);return i.containsPoint(p.x,p.y)??!1}render(e){const{clipMask:t}=this,{ctx:i}=e;if(t.size===0){super.render(e);return}i.save();try{for(const o of this.clipMask.values()){const{x:s,y:a,radius:n}=o;i.beginPath(),i.rect(0,0,i.canvas.width,i.canvas.height),i.ellipse(s,a,n,n,0,Math.PI*2,0,!0),i.clip()}super.render(e)}finally{i.restore()}}setClipMask(e,t){const i=this.clipMask.get(e);Ur.jsonDiff(i,t)!=null&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}};import{_ModuleSupport as GA}from"ag-charts-community";var Ss=class extends GA.TransformableText{constructor(){super(...arguments),this.growCollisionBox={top:4,right:4,bottom:4,left:4}}isPointInPath(e,t){const i=this.fromParentPoint(e,t),o=this.computeBBoxWithoutTransforms();return o?o.grow(this.growCollisionBox).containsPoint(i.x,i.y):!1}};import{_ModuleSupport as KA}from"ag-charts-community";var{Vec2:ft}=KA;function fa(e,t,i,o,s,a,n){if(!a||!s||!o){t.setClipMask(e);return}const{alignment:r,position:l}=o,c=Ry(i,o.fontSize,n),{point:h,textBaseline:p}=Ey(c,l,r);By(s,a,o,h,c.angle,p);const{x:u,y:g,width:y,height:f}=s.getBBox(),x=ft.length(ft.from(y,f)),S={x:u+y/2,y:g+f/2,radius:x/2+ft.length(c.offset)};return l==="center"?t.setClipMask(e,S):t.setClipMask(e),{clipMask:S,numbers:c}}function _y(e,t,i,o,s,a,n){if(!n||!a)return;const{alignment:r,position:l}=o,[c,h]=t.y1<=i.y1?[t,i]:[i,t];let p=c;l==="bottom"?p=h:l==="inside"&&(p={x1:(c.x1+h.x1)/2,y1:(c.y1+h.y1)/2,x2:(c.x2+h.x2)/2,y2:(c.y2+h.y2)/2});const u=Ry(p,o.fontSize,s),{point:g,textBaseline:y}=Ey(u,l==="inside"?"center":l,r,e);By(a,n,o,g,u.angle,y)}function Ry(e,t,i){let[o,s]=ft.from(e);o.x>s.x&&([o,s]=[s,o]);const a=ft.normalized(ft.sub(s,o)),n=ft.angle(a),r=ft.multiply(a,De.HANDLE_SIZE/2+(t??14)/2),l=ft.multiply(a,(i??2)/2+(t??14)/3);return{left:o,right:s,normal:a,angle:n,inset:r,offset:l}}function Ey({left:e,right:t,normal:i,angle:o,inset:s,offset:a},n,r,l){let c;r==="right"?c=ft.sub(t,s):r==="center"?c=ft.add(e,ft.multiply(i,ft.distance(e,t)/2)):c=ft.add(e,s);let h="bottom";return n==="bottom"?(c=ft.rotate(a,o+Math.PI/2,c),h="top"):n==="center"&&!l?h="middle":c=ft.rotate(a,o-Math.PI/2,c),{point:c,textBaseline:h}}function By(e,t,i,o,s,a){e.setProperties({text:t,x:o.x,y:o.y,rotation:s,rotationCenterX:o.x,rotationCenterY:o.y,fill:i.color,fontFamily:i.fontFamily,fontSize:i.fontSize,fontStyle:i.fontStyle,fontWeight:i.fontWeight,textAlign:i.alignment,textBaseline:a})}var{ChartAxisDirection:$A,Vec2:bs,Vec4:yd}=VA,zo=class extends Ze{constructor(){super(),this.type="cross-line",this.line=new Pt,this.middle=new ya,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return Ze.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=yt.is(e);const o=this.isHorizontal?t.yAxis:t.xAxis,s=this.convertCrossLine(e,o);if(s==null){this.visible=!1;return}this.visible=e.visible??!0,this.visible&&(this.updateLine(e,s),this.updateHandle(e,s),this.updateText(e,s),this.updateAxisLabel(e,o,s))}updateLine(e,t){const{line:i}=this,{lineDashOffset:o,stroke:s,strokeWidth:a,strokeOpacity:n}=e,{x1:r,y1:l,x2:c,y2:h}=t;i.setProperties({x1:r,y1:l,x2:c,y2:h,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:o,stroke:s,strokeWidth:a,strokeOpacity:n,fillOpacity:0})}updateHandle(e,t){const{middle:i}=this,{locked:o,stroke:s,strokeWidth:a,strokeOpacity:n}=e,r={fill:e.handle.fill,stroke:e.handle.stroke??s,strokeOpacity:e.handle.strokeOpacity??n,strokeWidth:e.handle.strokeWidth??a},l=bs.sub(yd.center(t),bs.from(i.handle.width/2,i.handle.height/2));i.gradient=this.isHorizontal?"horizontal":"vertical",i.update({...r,...l}),i.toggleLocked(o??!1)}updateText(e,t){this.text=this.updateNode(Ss,this.text,!!e.text.label),fa(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new Oy;return e.attachLabel(t),t}updateAxisLabel(e,t,i){this.axisLabel??(this.axisLabel=this.createAxisLabel(t));const{axisLabel:o,seriesRect:s}=this,{direction:a,position:n}=t;if(e.axisLabel.enabled){o.visible=this.visible;const r=n==="left"||n==="top"?yd.start(i):yd.end(i),l=a===$A.X?r.x:r.y;if(!t.inRange(l)){o.visible=!1;return}const c=Fe(e.value);o.update({...bs.add(r,bs.required(s)),value:c,styles:e.axisLabel,context:t})}else o.visible=!1}setAxisLabelOpacity(e){this.axisLabel&&(this.axisLabel.opacity=e)}setAxisLabelVisible(e){this.axisLabel&&(this.axisLabel.visible=e)}toggleHandles(e){this.middle.visible=e,this.middle.toggleHovered(this.activeHandle==="middle")}destroy(){super.destroy(),this.axisLabel?.destroy()}toggleActive(e){this.toggleHandles(e),this.middle.toggleActive(e)}dragStart(e,t,i){const o=yt.is(e)?{x:t.x,y:oo(e.value,i.yAxis)}:{x:oo(e.value,i.xAxis),y:t.y};this.dragState={offset:t,middle:o}}drag(e,t,i){const{activeHandle:o,dragState:s}=this;!e.isWriteable()||!s||(o&&this[o].toggleDragging(!0),this.translatePoint(e,s.middle,bs.sub(t,s.offset),i))}translate(e,t,i){if(!e.isWriteable())return;const o=yt.is(e)?bs.from(0,oo(e.value,i.yAxis)):bs.from(oo(e.value,i.xAxis),0);this.translatePoint(e,o,t,i)}translatePoint(e,t,i,o){const s=yt.is(e);s?i.x=0:i.y=0;const{point:a}=po({point:t},i,o);e.value=s?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const o=yt.is(e),s=this.isHorizontal?i.yAxis:i.xAxis,a=this.convertCrossLine(e,s);if(!a)return;const n=o?-30:0,r=o?0:-30,l=Dt({x:a.x1+r,y:a.y1+n},i);return t.set({value:o?l.y:l.x}),t}getCursor(){return this.activeHandle==null?"pointer":this[this.activeHandle].getCursor()}containsPoint(e,t){const{middle:i,line:o,text:s}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="middle",!0):o.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.line.isPointInPath(e,t))return"line";if(this.middle.containsPoint(e,t))return"handle"}getAnchor(){const e=this.computeBBoxWithoutHandles();return this.isHorizontal?{x:e.x+e.width/2,y:e.y}:{x:e.x+e.width,y:e.y+e.height/2,position:"right"}}convertCrossLine(e,t){if(e.value==null)return;let i=0,o=0,s,a;const{bounds:n}=t,r=oo(e.value,t);return yt.is(e)?(s=n.width,o=r,a=r):(i=r,s=r,a=n.height),{x1:i,y1:o,x2:s,y2:a}}};import{_ModuleSupport as jA}from"ag-charts-community";var{StateMachine:Xr,StateMachineProperty:YA,Debug:UA}=jA,fd=class extends Xr{constructor(e,t){const i=({point:s})=>{const a=e==="horizontal",n=a?new yt:new Bi;n.set({value:a?s.y:s.x}),t.create(n),t.recordAction(`Create ${a?"horizontal-line":"vertical-line"} annotation`)},o=()=>{this.node?.toggleActive(!0),t.showAnnotationOptions(),t.update()};super("start",{start:{click:{target:"waiting-first-render",action:i},drag:{target:"waiting-first-render",action:i},reset:Xr.parent,cancel:Xr.parent},"waiting-first-render":{render:{target:Xr.parent,action:o}}}),this.debug=UA.create(!0,"annotations")}};d([YA()],fd.prototype,"node",2);var zy={type:"horizontal-line",datum:yt,scene:zo,isDatum:yt.is,translate:(e,t,i,o)=>{yt.is(t)&&zo.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(yt.is(t)&&yt.is(i)&&zo.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{yt.is(t)&&zo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new fd("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new we(e)},Fy={type:"vertical-line",datum:Bi,scene:zo,isDatum:Bi.is,translate:(e,t,i,o)=>{Bi.is(t)&&zo.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Bi.is(t)&&Bi.is(i)&&zo.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Bi.is(t)&&zo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new fd("vertical",{...e,create:t("vertical-line")}),dragState:e=>new we(e)};import{_ModuleSupport as XA}from"ag-charts-community";import{_ModuleSupport as Hy}from"ag-charts-community";import{_ModuleSupport as ZA}from"ag-charts-community";var{Vec4:qA}=ZA,Vy=class{static updateBackground(e,t,i,o){const{background:s}=this,{seriesRect:a}=o;s.path.clear(!0);const n=qA.from(0,0,a.width,a.height),r=this.getBackgroundPoints(e,t,i,n);for(let c=0;ct.x2,a=t.y1>t.y2,n=a?o.y2:o.y1,r=a?o.y1:o.y2,l=ni.from(t);return e.extendEnd&&t.y2===r&&l.push(ni.from(s?o.x1:o.x2,a?o.y1:o.y2)),e.extendEnd&&i.y2===n&&l.push(ni.from(s?o.x1:o.x2,a?o.y2:o.y1)),l.push(...ni.from(i).reverse()),e.extendStart&&i.y1===r&&l.push(ni.from(s?o.x2:o.x1,a?o.y1:o.y2)),e.extendStart&&t.y1===n&&l.push(ni.from(s?o.x2:o.x1,a?o.y2:o.y1)),l}};import{_ModuleSupport as QA}from"ag-charts-community";import{isNumber as ma}from"ag-charts-core";var{StateMachine:Ho,StateMachineProperty:md,Debug:JA}=QA,qr=class extends Ho{constructor(e){const t=({point:l})=>{const c=new ii;c.set({start:l,end:l,startHeight:0,endHeight:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topRight:!1,bottomLeft:!1,bottomRight:!1})},o=({offset:l,context:c})=>{const{datum:h,snapping:p}=this;h&&(h.set({end:bn(l,c,p,h.start,h.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,p=Fe(c?.end.y),u=Fe(c?.start.y),{y:g}=l;if(c==null||!ma(u)||!ma(p)||!ma(g))return;const y=p-(g??0),f=(u-p)*2+y,x={x:c?.start.x,y:u-f},S={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(S,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:y}),e.update())},n=({point:l})=>{const{datum:c,node:h}=this,p=Fe(c?.end.y),u=Fe(c?.start.y),{y:g}=l;if(c==null||!ma(u)||!ma(p)||!ma(g))return;const y=p-(g??0),f=(u-p)*2+y,x={x:c.start.x,y:u-y},S={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(S,{overflowContinuous:!0}))&&(c.set({startHeight:f,endHeight:y}),e.recordAction("Create disjoint-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Ho.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:Ho.parent,action:r},cancel:{target:Ho.parent,action:r}},height:{hover:a,click:{target:Ho.parent,action:n},drag:{target:Ho.parent,action:n},reset:{target:Ho.parent,action:r},cancel:{target:Ho.parent,action:r}}}),this.debug=JA.create(!0,"annotations"),this.snapping=!1}};d([md()],qr.prototype,"datum",2),d([md()],qr.prototype,"node",2),d([md()],qr.prototype,"snapping",2);var Gy={type:"disjoint-channel",datum:ii,scene:Zr,isDatum:ii.is,translate:(e,t,i,o)=>{ii.is(t)&&Zr.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(ii.is(t)&&ii.is(i)&&Zr.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{ii.is(t)&&Zr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new qr({...e,create:t("disjoint-channel")}),dragState:e=>new we(e)};import{_ModuleSupport as eI}from"ag-charts-community";import{entries as tI}from"ag-charts-core";import{_ModuleSupport as go}from"ag-charts-community";var xd=[0,23.6,38.2,50,61.8,78.6,100],iI=[161.8,261.8,361.8,423.6],oI=[...xd,...iI],sI={10:oI,6:xd,4:xd.filter(e=>e!==78.6&&e!==23.6)},aI=10;function nI(e,t){const{x2:i,y1:o,y2:s}=e,a=o-s;return t==null?{x1:i,x2:i,y1:s-a,y2:s}:{x1:t.x1,x2:t.x2,y1:t.y2-a,y2:t.y2}}function Ky({x1:e,y1:t,x2:i,y2:o},s,a,n,r=10){const l=t-o,c=a?-1:1;let h=n;const p=[];for(const[u,g]of sI[r].entries()){const y=n+l*(g/100)*c,f=s.yAxis.scaleInvert(y);p.push({id:u,x1:e,x2:i,y1:h,y2:y,tag:g==100?0:1,label:{x1:Math.min(e,i)-aI,x2:i,y1:y,y2:y,text:`${(g/100).toFixed(3)} (${f.toFixed(2)})`}}),h=y}return p}var{Vec2:rI,Vec4:$y}=go,jy=class extends Ze{constructor(){super(),this.trendLine=new Pt,this.rangeFillsGroup=new go.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=go.Selection.select(this.rangeFillsGroup,go.Range),this.rangeStrokesGroup=new go.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=go.Selection.select(this.rangeStrokesGroup,Pt),this.labelsGroup=new go.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=go.Selection.select(this.labelsGroup,Ss),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=kt(e,t);if(i==null){this.visible=!1;return}if(i=$y.round(i),this.visible=e.visible??!0,!this.visible)return;this.updateLine(e,i,this.trendLine),this.updateHandles(e,i),this.updateAnchor(e,i,t);const{reverse:o}=e,s=this.extendLine(i,e,t),a=o?s.y1:s.y2,n=o?s.y2:s.y1,r=Ky(s,t,e.reverse,a,e.bands);this.updateRanges(e,r,t);const l={...s,y1:n,y2:n};this.updateText(e,l)}extendLine({x1:e,y1:t,x2:i,y2:o},s,a){const n={x1:e,y1:t,x2:i,y2:o};if(!s.extendStart&&!s.extendEnd)return n;const{x:r,width:l}=a.xAxis.bounds;return s.extendEnd&&(n[e>i?"x1":"x2"]=r+l),s.extendStart&&(n[e>i?"x2":"x1"]=r),n}updateLine(e,t,i){if(!t||!i)return;const{lineDashOffset:o,strokeWidth:s,strokeOpacity:a,stroke:n}=e;i.setProperties({...t,lineCap:e.getLineCap(),lineDash:[3,4],lineDashOffset:o,strokeWidth:s,strokeOpacity:a,fillOpacity:0,stroke:n})}updateRangeStrokes(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:o,strokes:s,rangeStroke:a,isMultiColor:n}=e;this.rangeStrokesGroupSelection.each((r,{x1:l,x2:c,y2:h,tag:p},u)=>{const g=h,y=n?s[u%s.length]:a;r.setProperties({x1:l,x2:c,y1:g,y2:g,stroke:y,strokeOpacity:o,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:p})})}updateRanges(e,t,i){const o=s=>s.id;this.rangeFillsGroupSelection.update(t,void 0,o),this.rangeStrokesGroupSelection.update(t,void 0,o),this.labelsGroupSelection.update(t,void 0,o),this.updateRangeFills(e),this.updateRangeStrokes(e),this.updateRangeLabels(e,i)}updateRangeFills(e){const{lineDashOffset:t,strokeWidth:i,strokeOpacity:o,strokes:s,rangeStroke:a,showFill:n,isMultiColor:r}=e;this.rangeFillsGroupSelection.each((l,{x1:c,x2:h,y1:p,y2:u},g)=>{const y=r?s[g%s.length]:a;if(!n){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:p,y2:u,startLine:!1,endLine:!1,stroke:y,strokeOpacity:o,fill:y,fillOpacity:(o??1)*.15,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0})})}updateRangeLabels(e,{xAxis:t}){const{rangeStrokesGroupSelection:i}=this,{strokes:o,strokeWidth:s,rangeStroke:a,isMultiColor:n,label:{fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h,color:p}}=e,u={fontFamily:r,fontSize:l,fontStyle:c,fontWeight:h},g=this.checkWithinBounds(t,u,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((y,f,x)=>{const S=p??(n?o[x%o.length]:a),v=i.at(x);if(!v)return;const{text:m,...b}=f.label;if(g)y.setProperties({...u,text:m,x:b.x1,y:b.y1,textBaseline:"middle",textAlign:"end",fill:S}),fa(y.id,v,b);else{const k={...u,label:m,position:"center",alignment:"left",color:S};fa(y.id,v,b,k,y,m,s)}})}checkWithinBounds(e,t,i){if(!i)return!1;const{text:o,...s}=i.datum.label;i.setProperties({...t,text:o,x:s.x1,y:s.y1,textBaseline:"middle",textAlign:"end"});const{x:a}=i.getBBox();return a>=e.bounds.x&&a<=e.bounds.x+e.bounds.width}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:o,strokeWidth:s}=e;this.text=this.updateNode(Ss,this.text,!!o.label),fa(i.id,i,t,o,this.text,o.label,s)}updateAnchor(e,t,i,o){const s=$y.topCenter(t);rI.apply(this.anchor,go.Transformable.toCanvasPoint(this.trendLine,s.x,s.y))}containsPoint(e,t){const{trendLine:i,rangeStrokesGroupSelection:o,text:s}=this;let a=!1;return o.each(n=>a||(a=n.isPointInPath(e,t))),a||i.isPointInPath(e,t)||!!s?.containsPoint(e,t)}getNodeAtCoords(e,t){if(this.text?.containsPoint(e,t))return"text";if(this.trendLine.isPointInPath(e,t))return"line"}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}drag(e,t,i,o){e.isWriteable()&&(this.activeHandle?this.dragHandle(e,t,i,o):this.dragAll(e,t,i))}getAnchor(){return this.anchor}getCursor(){return"pointer"}};import{_ModuleSupport as lI}from"ag-charts-community";import{Logger as Yy}from"ag-charts-core";var{ContinuousScale:Uy}=lI;function Qr(e,t,i={overflowContinuous:!1},o){if(t.x==null||t.y==null)return o&&Yy.warnOnce(`${o}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:s,yAxis:a}=e,n=i.overflowContinuous&&Uy.is(s.scale),r=i.overflowContinuous&&Uy.is(a.scale),l=n||Xy(t.x,s),c=r||Xy(t.y,a);if(l&&c)return!0;if(o){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const p=Fe(t.x),u=Fe(t.y);Yy.warnOnce(`${o}is outside the ${h}, ignoring. - x: [${p}], y: ${u}]`)}return!1}function Xy(e,t){const{domain:i}=t.scale,o=Fe(e);return i&&o!=null&&t.continuous?o>=i[0]&&o<=i.at(-1):!0}var{Vec2:cI,Vec4:vs}=eI,Jr=class extends jy{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new Pt,this.start=new De,this.end=new De,this.endRetracement=new De,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return Ze.isCheck(e,"fibonacci-retracement-trend-based")}update(e,t){let{coords1:i,coords2:o}=this.getCoords(e,t);if(i==null||o==null){this.visible=!1;return}if(i=vs.round(i),o=vs.round(o),this.visible=e.visible??!0,!this.visible)return;(e.endRetracement.x==null||e.endRetracement.y==null)&&(o=void 0),this.updateLine(e,i,this.trendLine),this.updateLine(e,o,this.endRetracementLine),this.updateHandles(e,i,o),this.updateAnchor(e,o??i,t);const{reverse:s,bands:a}=e,n=nI(i,o),r=this.extendLine(n,e,t),l=r.y2,c=r.y1,h=o?Ky(r,t,s,l,a):[];this.updateRanges(e,h,t);const p={...r,y1:c,y2:c};this.updateText(e,p)}containsPoint(e,t){const{start:i,end:o,endRetracement:s,endRetracementLine:a}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):o.containsPoint(e,t)?(this.activeHandle="end",!0):s.containsPoint(e,t)?(this.activeHandle="endRetracement",!0):a.isPointInPath(e,t)||super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)||this.endRetracement.containsPoint(e,t)?"handle":this.endRetracementLine.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...Vr({start:e.start,end:e.end,endRetracement:e.endRetracement},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1),this.endRetracement.toggleDragging(!1)}dragAll(e,t,i){const{dragState:o}=this;o&&this.translatePoints({datum:e,start:o.start,end:o.end,endRetracement:o.endRetracement,translation:cI.sub(t,o.offset),context:i})}dragHandle(e,t,i,o){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const n=o?this.snapToAngle(e,t,i):Dt(this[s].drag(t).point,i);!n||!Qr(i,n)||(e[s].x=n.x,e[s].y=n.y)}snapToAngle(e,t,i){const{activeHandle:o}=this,s=["start","end","endRetracement"];if(!o)return;const a=(s.indexOf(o)+1)%s.length,n=s[a];this[o].toggleDragging(!0);const r=ke(e[n],i);return Dt(Hr(t,r,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:o,translation:s,context:a}){const n=po({start:t,end:i,endRetracement:o},s,a,{overflowContinuous:2});e.start.x=n.start.x,e.end.x=n.end.x,e.endRetracement.x=n.endRetracement.x,e.start.y=n.start.y,e.end.y=n.end.y,e.endRetracement.y=n.endRetracement.y}translate(e,t,i){this.translatePoints({datum:e,start:ke(e.start,i),end:ke(e.end,i),endRetracement:ke(e.endRetracement,i),translation:t,context:i})}copy(e,t,i){const{coords1:o,coords2:s}=this.getCoords(e,i);if(!o||!s)return;const a=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:vs.start(o),end:vs.end(o),endRetracement:vs.end(s),translation:{x:-a.width/2,y:-a.height/2},context:i}),t}getCoords(e,t){return{coords1:kt(e,t),coords2:kt({start:e.end,end:e.endRetracement},t)}}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e,this.endRetracement.visible=e;else for(const[t,i]of tI(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end"),this.endRetracement.toggleHovered(this.activeHandle==="endRetracement")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e),this.endRetracement.toggleActive(e)}updateHandles(e,t,i,o){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",o)}),i&&this.endRetracement.update({...this.getHandleStyles(e),...this.getHandleCoords(e,i,"endRetracement",o)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1),this.endRetracement.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,o){return i==="start"?vs.start(t):vs.end(t)}};import{_ModuleSupport as hI}from"ag-charts-community";var{StateMachine:Vo,StateMachineProperty:Sd,Debug:dI}=hI,el=class extends Vo{constructor(e){const t=({point:c})=>{const h=this.createDatum();h.set({start:c,end:c}),e.create(h)},i=()=>{const{node:c}=this;c?.toggleActive(!0),c?.toggleHandles({start:!0,end:!1,endRetracement:!1})},o=({offset:c,context:h})=>{const{datum:p,snapping:u}=this;p&&(p.set({end:bn(c,h,u,p.start,p.snapToAngle)}),e.update())},s=()=>{const{datum:c}=this;c&&(c.endRetracement.x=c.end.x,c.endRetracement.y=c.end.y,this.node?.toggleHandles({end:!0}),e.update())},a=({offset:c,context:h})=>{const{datum:p,snapping:u}=this;p&&(p.set({endRetracement:bn(c,h,u,p.end,p.snapToAngle)}),e.update())},n=()=>{this.node?.toggleHandles({endRetracement:!0}),e.update()},r=()=>e.delete(),l=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Vo.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,click:{target:"endRetracement",action:s},drag:o,dragEnd:{target:"endRetracement",action:s},reset:{target:Vo.parent,action:r},cancel:{target:Vo.parent,action:r},onExit:l},endRetracement:{hover:a,click:{target:Vo.parent,action:n},drag:{target:Vo.parent,action:n},reset:{target:Vo.parent,action:r},cancel:{target:Vo.parent,action:r}}}),this.debug=dI.create(!0,"annotations"),this.snapping=!1}createDatum(){return new zi}};d([Sd()],el.prototype,"datum",2),d([Sd()],el.prototype,"node",2),d([Sd()],el.prototype,"snapping",2);var Zy={type:"fibonacci-retracement-trend-based",datum:zi,scene:Jr,isDatum:zi.is,translate:(e,t,i,o)=>{zi.is(t)&&Jr.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(zi.is(t)&&zi.is(i)&&Jr.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{zi.is(t)&&Jr.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new el({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new we(e)};import{_ModuleSupport as pI}from"ag-charts-community";import{entries as uI}from"ag-charts-core";var{Vec2:gI,Vec4:qy}=pI,tl=class extends jy{constructor(){super(),this.type="fibonacci-retracement",this.start=new De,this.end=new De,this.append([this.start,this.end])}static is(e){return Ze.isCheck(e,"fibonacci-retracement")}containsPoint(e,t){const{start:i,end:o}=this;return this.activeHandle=void 0,i.containsPoint(e,t)?(this.activeHandle="start",!0):o.containsPoint(e,t)?(this.activeHandle="end",!0):super.containsPoint(e,t)}getNodeAtCoords(e,t){return this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":super.getNodeAtCoords(e,t)}dragStart(e,t,i){this.dragState={offset:t,...Vr({start:e.start,end:e.end},i)}}stopDragging(){this.start.toggleDragging(!1),this.end.toggleDragging(!1)}dragAll(e,t,i){const{dragState:o}=this;o&&this.translatePoints({datum:e,start:o.start,end:o.end,translation:gI.sub(t,o.offset),context:i})}dragHandle(e,t,i,o){const{activeHandle:s,dragState:a}=this;if(!s||!a)return;this[s].toggleDragging(!0);const n=o?this.snapToAngle(e,t,i):Dt(this[s].drag(t).point,i);!n||!Qr(i,n)||(e[s].x=n.x,e[s].y=n.y)}snapToAngle(e,t,i){const{activeHandle:o}=this,a=["start","end"].find(r=>r!==o);if(!o||!a)return;this[o].toggleDragging(!0);const n=ke(e[a],i);return Dt(Hr(t,n,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:o,context:s}){const a=po({start:t,end:i},o,s,{overflowContinuous:1});e.start.x=a.start.x,e.end.x=a.end.x,e.start.y=a.start.y,e.end.y=a.end.y}translate(e,t,i){this.translatePoints({datum:e,start:ke(e.start,i),end:ke(e.end,i),translation:t,context:i})}copy(e,t,i){const o=kt(e,i);if(!o)return;const s=this.computeBBoxWithoutHandles();return this.translatePoints({datum:t,start:{x:o.x1,y:o.y1},end:{x:o.x2,y:o.y2},translation:{x:-s.width/2,y:-s.height/2},context:i}),t}toggleHandles(e){if(typeof e=="boolean")this.start.visible=e,this.end.visible=e;else for(const[t,i]of uI(e))this[t].visible=i;this.start.toggleHovered(this.activeHandle==="start"),this.end.toggleHovered(this.activeHandle==="end")}toggleActive(e){this.toggleHandles(e),this.start.toggleActive(e),this.end.toggleActive(e)}updateHandles(e,t,i,o){this.start.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"start")}),this.end.update({...this.getHandleStyles(e),...this.getHandleCoords(e,t,"end",o)}),this.start.toggleLocked(e.locked??!1),this.end.toggleLocked(e.locked??!1)}getHandleCoords(e,t,i,o){return i==="start"?qy.start(t):qy.end(t)}};import{_ModuleSupport as yI}from"ag-charts-community";var{StateMachine:xa,StateMachineProperty:bd,Debug:fI}=yI,Sa=class extends xa{constructor(e){const t=({point:r})=>{const l=this.createDatum();l.set({start:r,end:r}),e.create(l)},i=()=>{const{node:r}=this;r?.toggleActive(!0),r?.toggleHandles({start:!0,end:!1})},o=({offset:r,context:l})=>{const{datum:c,snapping:h}=this;c&&(c.set({end:bn(r,l,h,c.start,c.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({end:!0}),e.update()},a=()=>e.delete(),n=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.datum?.type} annotation`)};super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:xa.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,click:{target:xa.parent,action:s},drag:o,dragEnd:{target:xa.parent,action:s},reset:{target:xa.parent,action:a},cancel:{target:xa.parent,action:a},onExit:n}}),this.debug=fI.create(!0,"annotations"),this.snapping=!1}};d([bd()],Sa.prototype,"datum",2),d([bd()],Sa.prototype,"node",2),d([bd()],Sa.prototype,"snapping",2);var mI=class extends Sa{createDatum(){return new ao}},xI=class extends Sa{createDatum(){return new no}},SI=class extends Sa{createDatum(){return new lo}},Qy={type:"fibonacci-retracement",datum:lo,scene:tl,isDatum:lo.is,translate:(e,t,i,o)=>{lo.is(t)&&tl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(lo.is(t)&&lo.is(i)&&tl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{lo.is(t)&&tl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new SI({...e,create:t("fibonacci-retracement")}),dragState:e=>new we(e)};import{_ModuleSupport as Jy}from"ag-charts-community";import{_ModuleSupport as vd}from"ag-charts-community";var{Vec2:kn}=vd,bI=class extends vd.Group{},il=class extends bI{constructor(){super(),this.type="arrow",this.path=new vd.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:o,angle:s,...a}=e,n=kn.from(i,o),r=3*Math.PI/4,l=this.armLength+(e.strokeWidth??0)*2,c=kn.rotate(kn.from(0,l),s+r,n),h=kn.rotate(kn.from(l,0),s-r,n);t.setProperties(a),t.fillOpacity=0,t.path.clear(),t.path.moveTo(c.x,c.y),t.path.lineTo(n.x,n.y),t.path.lineTo(h.x,h.y)}},{Vec2:ki,Vec4:ef}=Jy,Wo=class extends cd{constructor(){super(),this.type="line",this.line=new Pt,this.append([this.line,this.start,this.end])}static is(e){return Ze.isCheck(e,"line")}update(e,t){let i=kt(e,t);if(i==null){this.visible=!1;return}i=ef.round(i),this.visible=e.visible??!0,this.visible&&(this.updateLine(e,i,t),this.updateHandles(e,i),this.updateText(e,i),this.updateCaps(e,i),this.updateAnchor(e,i,t))}updateLine(e,t,i){const{line:o}=this,{lineDashOffset:s,stroke:a,strokeWidth:n,strokeOpacity:r}=e,l=this.extendLine(t,e,i);o.setProperties({...l,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:s,stroke:a,strokeWidth:n,strokeOpacity:r,fillOpacity:0})}updateText(e,t){this.text=this.updateNode(Ss,this.text,!!e.text.label),fa(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}updateCaps(e,t){if(!e.startCap&&this.startCap&&(this.startCap.remove(),this.startCap=void 0),!e.endCap&&this.endCap&&(this.endCap.remove(),this.endCap=void 0),!e.startCap&&!e.endCap)return;const{stroke:i,strokeWidth:o,strokeOpacity:s}=e,[a,n]=ki.from(t),r=ki.angle(ki.sub(n,a));e.startCap&&(this.startCap&&this.startCap.type!==e.startCap&&(this.startCap.remove(),this.startCap=void 0),this.startCap==null&&(this.startCap=new il,this.append([this.startCap])),this.startCap.update({x:a.x,y:a.y,angle:r-Math.PI,stroke:i,strokeWidth:o,strokeOpacity:s})),e.endCap&&(this.endCap&&this.endCap.type!==e.endCap&&(this.endCap.remove(),this.endCap=void 0),this.endCap==null&&(this.endCap=new il,this.append([this.endCap])),this.endCap.update({x:n.x,y:n.y,angle:r,stroke:i,strokeWidth:o,strokeOpacity:s}))}updateAnchor(e,t,i,o){const s=ef.topCenter(t);ki.apply(this.anchor,Jy.Transformable.toCanvasPoint(this.line,s.x,s.y))}containsPoint(e,t){const{line:i,text:o}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||!!o?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.line.isPointInPath(e,t)?"line":super.getNodeAtCoords(e,t)}getHandleCoords(e,t,i,o){const{startCap:s,endCap:a}=this;let[n,r]=ki.from(t);const l=ki.angle(ki.sub(r,n));return s&&(n=ki.rotate(ki.from(0,-De.HANDLE_SIZE/2),l,n)),a&&(r=ki.rotate(ki.from(0,De.HANDLE_SIZE/2),l,r)),i==="start"?n:r}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}},tf={type:"line",datum:no,scene:Wo,isDatum:no.is,translate:(e,t,i,o)=>{no.is(t)&&Wo.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(no.is(t)&&no.is(i)&&Wo.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{no.is(t)&&Wo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new xI({...e,create:t("line")}),dragState:e=>new we(e)},of={type:"arrow",datum:ao,scene:Wo,isDatum:ao.is,translate:(e,t,i,o)=>{ao.is(t)&&Wo.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(ao.is(t)&&ao.is(i)&&Wo.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{ao.is(t)&&Wo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new mI({...e,create:t("arrow")}),dragState:e=>new we(e)};import{_ModuleSupport as kd}from"ag-charts-community";import{isDate as sf,isNumber as ol}from"ag-charts-core";import{_ModuleSupport as Wt}from"ag-charts-community";import{_ModuleSupport as af}from"ag-charts-community";function nf(e,t=0,i=0){let o=t;for(const s of e)if(Array.isArray(s)){for(const a of s)rf(a,o);o+=af.Group.computeChildrenBBox(s).width+i}else rf(s,o),o+=s.getBBox().width+i}function vI(e,t=0,i=0){let o=t;for(const s of e)if(Array.isArray(s)){for(const a of s)lf(a,o);o+=af.Group.computeChildrenBBox(s).height+i}else lf(s,o),o+=s.getBBox().height+i}function rf(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function lf(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function cf(e,t){"x1"in e?(e.x1+=t,e.x2+=t):e.x+=t}function hf(e,t){"y1"in e?(e.y1+=t,e.y2+=t):e.y+=t}var{Vec4:Dd}=Wt,df=class extends Wt.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new Wt.Rect,this.dateRangeBarsText=new Wt.Text,this.dateRangeDivider=new Wt.Line,this.dateRangeValueText=new Wt.Text,this.priceRangeValueText=new Wt.Text,this.priceRangeDivider=new Wt.Line,this.priceRangePercentageText=new Wt.Text,this.volumeText=new Wt.Text,this.volumeFormatter=new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2}),this.append([this.background,this.dateRangeBarsText,this.dateRangeDivider,this.dateRangeValueText,this.priceRangeValueText,this.priceRangeDivider,this.priceRangePercentageText,this.volumeText])}update(e,t,i,o,s,a,n){this.verticalDirection=a;const r=this.updateStatistics(e,t,i,n),l=Wt.Group.computeChildrenBBox(r.flat()),c=10;l.grow(c),this.updateBackground(e,l,c),this.reposition(r,c,s),this.checkVisibility(e,s,o)}checkVisibility(e,t,i){const o=Dd.from(new Wt.BBox(0,0,t.seriesRect.width,t.seriesRect.height));Dd.collides(i,o)?this.visible=e.visible??!0:this.visible=!1}updateStatistics(e,t,i,o){const{dateRangeBarsText:s,dateRangeDivider:a,dateRangeValueText:n,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,p=8,u=6,g=e.statistics.fontSize+3,y=-2,f=this.getTextStyles(e),x={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:g},S=[s,a,n],v=[r,l,c],m=[];return t.priceRange&&(r.setProperties({...f,text:this.formatPriceRangeValue(t.priceRange.value,o)}),l.setProperties(x),c.setProperties({...f,text:this.formatPriceRangePercentage(t.priceRange.percentage,o)}),nf(v,i.x,p),m.push(v)),t.dateRange&&(s.setProperties({...f,text:this.formatDateRangeBars(t.dateRange.bars,o)}),a.setProperties(x),n.setProperties({...f,text:this.formatDateRangeValue(t.dateRange.value)}),nf(S,i.x,p),m.push(S)),t.volume==null?h.visible=!1:(h.setProperties({...f,x:i.x,text:this.formatVolume(t.volume,o),visible:!0}),m.push(h)),vI(m,i.y,u),l.y1+=y,l.y2+=y,a.y1+=y,a.y2+=y,m}updateBackground(e,t,i){const o=this.getBackgroundStyles(e);this.background.setProperties({...o,...t,x:t.x-t.width/2+i,y:t.y})}reposition(e,t,i){const{width:o,height:s}=i.seriesRect,a=Dd.from(this.background.getBBox());let n=0;a.x1<0&&(n=-a.x1),a.x2>o&&(n=o-a.x2);const r=Math.min(t,s-a.y2);for(const l of e)if(Array.isArray(l)){const c=Wt.Group.computeChildrenBBox(l).width;for(const h of l)cf(h,n-c/2),hf(h,r)}else cf(l,n-l.getBBox().width/2),hf(l,r);this.background.x+=n,this.background.y+=r}getTextStyles(e){return{fill:e.statistics.color,fontFamily:e.statistics.fontFamily,fontSize:e.statistics.fontSize,fontStyle:e.statistics.fontStyle,fontWeight:e.statistics.fontWeight,textBaseline:"top"}}getDividerStyles(e){return{stroke:e.statistics.divider.stroke,strokeOpacity:e.statistics.divider.strokeOpacity,strokeWidth:e.statistics.divider.strokeWidth}}getBackgroundStyles(e){return{fill:e.statistics.fill,stroke:e.statistics.stroke,strokeOpacity:e.statistics.strokeOpacity,strokeWidth:e.statistics.strokeWidth,cornerRadius:4}}formatDateRangeBars(e,t){return t?.t("measurerDateRangeBars",{value:e})??`${e}`}formatDateRangeValue(e){const t=[],i=e>=0?"":"-";e=Math.abs(e);const o=1e3*60,s=o*60,a=s*24,n=Math.floor(e/o),r=Math.floor(e/s),l=Math.floor(e/a),c=r%(a/s),h=n%(s/o);return l>=1&&t.push(`${l}d`),r>=1&&(e=o.x-h.x&&(l={x:o.x,y:r.clipMask.y,radius:this.text.getBBox().height/2+Vi.length(h)})}this.verticalLine.setClipMask(n,l)}updateCaps(e,t){const{horizontalEndCap:i,verticalEndCap:o}=this,{direction:s}=e,{x1:a,y1:n,x2:r,y2:l}=t,c=Vi.round(ks.center(t),0),{stroke:h,strokeWidth:p,strokeOpacity:u}=this.getLineStyles(e),g={stroke:h,strokeWidth:p,strokeOpacity:u};if(s!=="vertical"){const y=a<=r?0:Math.PI;let f=r;s==="horizontal"&&(f+=a<=r?-2:2),i.update({...g,x:f,y:c.y,angle:y})}if(s!=="horizontal"){const y=n<=l?Math.PI/2:Math.PI/-2;let f=l;s==="vertical"&&(f+=n<=l?-2:2),o.update({...g,x:c.x,y:f,angle:y})}}updateBoundingLines(e,t){const{verticalStartLine:i,verticalEndLine:o,horizontalStartLine:s,horizontalEndLine:a}=this,{direction:n}=e,{x1:r,y1:l,x2:c,y2:h}=t,p=this.getLineStyles(e);n==="horizontal"&&(i.setProperties({...p,x1:r,y1:l,x2:r,y2:h}),o.setProperties({...p,x1:c,y1:l,x2:c,y2:h})),n==="vertical"&&(s.setProperties({...p,x1:r,y1:l,x2:c,y2:l}),a.setProperties({...p,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const o=Vi.add(ks.bottomCenter(t),Vi.from(0,10)),s={volume:this.getVolume(e)};e.hasPriceRange&&(s.priceRange={percentage:this.getPriceRangePercentage(e),value:this.getPriceRangeValue(e)}),e.hasDateRange&&(s.dateRange={bars:this.getDateRangeBars(t,i),value:this.getDateRangeValue(e)}),this.statistics.update(e,s,o,t,i,this.verticalDirection,e.localeManager)}updateAnchor(e,t,i,o){const s=ks.topCenter(t);Vi.apply(this.anchor,kd.Transformable.toCanvasPoint(this.horizontalLine,s.x,s.y))}getBackgroundPoints(e,t,i,o){const[s,a]=Vi.from(t),[n,r]=Vi.from(i);return[s,a,r,n]}getLineStyles(e){const{lineDashOffset:t,stroke:i,strokeWidth:o,strokeOpacity:s}=e;return{lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,stroke:i,strokeWidth:o,strokeOpacity:s,fillOpacity:0}}getBackgroundStyles(e){const{background:t}=e;return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth}}containsPoint(e,t){const{horizontalLine:i,text:o,verticalLine:s,horizontalStartLine:a,horizontalEndLine:n,verticalStartLine:r,verticalEndLine:l}=this;return super.containsPoint(e,t)||i.isPointInPath(e,t)||s.isPointInPath(e,t)||a.visible&&a.isPointInPath(e,t)||n.visible&&n.isPointInPath(e,t)||r.visible&&r.isPointInPath(e,t)||l.visible&&l.isPointInPath(e,t)||!!o?.containsPoint(e,t)}getNodeAtCoords(e,t){return this.text?.containsPoint(e,t)?"text":this.start.containsPoint(e,t)||this.end.containsPoint(e,t)?"handle":"line"}getDateRangeBars(e,t){const{step:i}=t.xAxis.scale,o=e.x1<=e.x2?1:-1;return i?Math.round(ks.width(e)/i)*o:0}getDateRangeValue(e){const t=Fe(e.start.x),i=Fe(e.end.x);if(!sf(t)||!sf(i))throw new Error("Can not create a date range measurement of non-date x-axis.");return i.getTime()-t.getTime()}getPriceRangePercentage(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Fe(e.end.y),i=Fe(e.start.y);if(!ol(t)||!ol(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return(t-i)/i}getPriceRangeValue(e){if(e.start.y==null||e.end.y==null)throw new Error("Can not create a price range measurement of a non-numeric y-axis");const t=Fe(e.end.y),i=Fe(e.start.y);if(!ol(t)||!ol(i))throw new Error("Can not create a price range measurement of a non-numeric y-axis");return t-i}getVolume(e){return e.getVolume(e.start.x,e.end.x)}},sl=class extends Gt{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return Ze.isCheck(e,"quick-measurer")}createStatisticsScene(){return new kI}getDirectionStyles(e){return this.verticalDirection==="down"?e.down:e.up}getLineStyles(e){const t=this.getDirectionStyles(e);return{...super.getLineStyles(e),stroke:t.stroke,strokeWidth:t.strokeWidth,strokeOpacity:t.strokeOpacity}}getBackgroundStyles(e){const t=this.getDirectionStyles(e);return{fill:t.fill,fillOpacity:t.fillOpacity}}getHandleStyles(e){const t=this.getDirectionStyles(e);return{fill:t.handle.fill,stroke:t.handle.stroke??t.stroke,strokeOpacity:t.handle.strokeOpacity??t.strokeOpacity,strokeWidth:t.handle.strokeWidth??t.strokeWidth}}};import{_ModuleSupport as DI}from"ag-charts-community";var{StateMachine:ba,StateMachineProperty:pf,Debug:MI}=DI,va=class extends ba{constructor(e){const t=({point:n})=>{const r=this.createDatum();r.set({start:n,end:n}),e.create(r)},i=({point:n})=>{const{datum:r,node:l}=this;r?.set({end:n}),l?.toggleActive(!0),l?.toggleHandles({end:!1}),e.update()},o=()=>{this.node?.toggleHandles({end:!0})},s=()=>e.delete(),a=()=>{e.showAnnotationOptions(),e.recordAction(`Create ${this.node?.type} annotation`)};super("start",{start:{reset:ba.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:ba.parent,action:o},dragEnd:{target:ba.parent,action:o},reset:{target:ba.parent,action:s},cancel:{target:ba.parent,action:s},onExit:a}}),this.debug=MI.create(!0,"annotations")}};d([pf()],va.prototype,"datum",2),d([pf()],va.prototype,"node",2);var AI=class extends va{createDatum(){return new ei}},II=class extends va{createDatum(){return new ti}},LI=class extends va{createDatum(){return new so}},TI=class extends va{createDatum(){return new Vt}},uf={type:"date-range",datum:ei,scene:Gt,isDatum:ei.is,translate:(e,t,i,o)=>{ei.is(t)&&Gt.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(ei.is(t)&&ei.is(i)&&Gt.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{ei.is(t)&&Gt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new AI({...e,create:t("date-range")}),dragState:e=>new we(e)},gf={type:"price-range",datum:ti,scene:Gt,isDatum:ti.is,translate:(e,t,i,o)=>{ti.is(t)&&Gt.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(ti.is(t)&&ti.is(i)&&Gt.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{ti.is(t)&&Gt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new II({...e,create:t("date-range")}),dragState:e=>new we(e)},yf={type:"date-price-range",datum:so,scene:Gt,isDatum:so.is,translate:(e,t,i,o)=>{so.is(t)&&Gt.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(so.is(t)&&so.is(i)&&Gt.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{so.is(t)&&Gt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new LI({...e,create:t("date-range")}),dragState:e=>new we(e)},ff={type:"quick-date-price-range",datum:Vt,scene:sl,isDatum:Vt.is,translate:(e,t,i,o)=>{Vt.is(t)&&sl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Vt.is(t)&&Vt.is(i)&&sl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Vt.is(t)&&sl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new TI({...e,create:t("quick-date-price-range")}),dragState:e=>new we(e)};import{_ModuleSupport as Dn}from"ag-charts-community";import{calcLineHeight as CI,clamp as NI,wrapText as wI}from"ag-charts-core";var{ZIndexMap:mf}=Dn,al=class extends ud{constructor(){super(),this.type="note",this.shape=new Dn.Rect,this.iconBackground=new Dn.TranslatableSvgPath("M22 1.83333C22 0.820811 21.1792 0 20.1667 0H1.83333C0.820811 0 0 0.82081 0 1.83333V13.9868C0 14.9994 0.820811 15.8202 1.83333 15.8202L5.88971 15.8202C6.44575 15.8202 6.97175 16.0725 7.31971 16.5062L9.57006 19.3112C10.304 20.2259 11.6962 20.2259 12.4301 19.3112L14.6804 16.5062C15.0284 16.0725 15.5544 15.8202 16.1104 15.8202L20.1667 15.8202C21.1792 15.8202 22 14.9994 22 13.9868V1.83333Z"),this.iconLines=new Dn.TranslatableSvgPath("M17.1114 5.75C17.1114 6.16421 16.7756 6.5 16.3614 6.5H5.63916C5.22495 6.5 4.88916 6.16421 4.88916 5.75V5.75C4.88916 5.33579 5.22495 5 5.63916 5H16.3614C16.7756 5 17.1114 5.33579 17.1114 5.75V5.75ZM17.1114 9.25C17.1114 9.66421 16.7756 10 16.3614 10H5.63916C5.22495 10 4.88916 9.66421 4.88916 9.25V9.25C4.88916 8.83579 5.22495 8.5 5.63916 8.5H16.3614C16.7756 8.5 17.1114 8.83579 17.1114 9.25V9.25Z"),this.active=!1,this.shape.visible=!1,this.label.visible=!1,this.iconBackground.fillShadow=new Dn.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return Ze.isCheck(e,"note")}update(e,t){this.updateIcon(e,t),super.update(e,t)}getTextBBox(e,t,i){const o=super.getTextBBox(e,t,i);o.x-=e.width/2,o.x=NI(0,o.x,i.seriesRect.width-e.width);const s=e.getPadding().top,a=o.y-Ug-s*2,n=o.y+De.HANDLE_SIZE+s*2;return a-o.height-Xg<0?(o.y=n,e.position="top"):(o.y=a+s,e.position="bottom"),o}updateLabel(e,t){const i=e.visible===!1?!1:this.label.visible;super.updateLabel(e,t),this.label.visible=i,this.label.text=wI(e.text,{maxWidth:200,font:e,textWrap:"always",avoidOrphans:!1})}updateShape(e,t){const{shape:i}=this;i.fill=e.background.fill,i.fillOpacity=e.background.fillOpacity??1,i.stroke=e.background.stroke,i.strokeOpacity=e.background.strokeOpacity??1,i.strokeWidth=e.background.strokeWidth??1,i.cornerRadius=4;const o=e.getPadding().top,s=e.position==="top";i.x=t.x-o,i.width=e.width+o*2,i.height=t.height+o*2,i.y=t.y+(s?0:-t.height)-o}updateIcon(e,t){const{active:i,iconBackground:o,iconLines:s}=this,{x:a,y:n}=ke(e,t);o.translationX=a-n0/2,o.translationY=n-Yg,s.translationX=o.translationX,s.translationY=o.translationY,o.fill=e.fill,o.fillOpacity=e.fillOpacity??1,o.stroke=e.stroke,o.strokeOpacity=e.strokeOpacity??1,o.strokeWidth=e.strokeWidth??1,s.fill=e.stroke,i?o.fillShadow.color=e.fill??"rgba(0, 0, 0, 0.22)":o.fillShadow.color="rgba(0, 0, 0, 0.22)"}updateAnchor(e,t,i){const o=e.getPadding().top,s=e.position==="top",a=s?1:-1;return{x:t.x+i.seriesRect.x+e.width/2,y:t.y+i.seriesRect.y+a*(t.height+o),position:s?"below":"above"}}getLabelCoords(e,t){const i=e.position==="top",o=e.getPadding().top+CI(e.fontSize,Cr)/2;return{x:t.x,y:t.y+(i?o/2:0)}}getTextBaseline(e){return e.position==="top"?"middle":e.position}getHandleCoords(e,t,i){return{x:t.x,y:t.y+De.HANDLE_SIZE/2+4}}getHandleStyles(e){return{fill:e.handle.fill,stroke:e.handle.stroke??e.fill,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}toggleHovered(e,t,i){super.toggleHovered(e,t,i);const o=e||t&&!i;this.label.visible=o,this.shape.visible=o,this.zIndex=o?mf.CHART_ANNOTATION_FOCUSED:mf.CHART_ANNOTATION}toggleActive(e){super.toggleActive(e),this.label.visible=e,this.shape.visible=e,this.active=e}containsPoint(e,t){return this.shape.visible&&this.shape.containsPoint(e,t)||this.iconBackground.containsPoint(e,t)?!0:super.containsPoint(e,t)}},PI=class extends vn{createDatum(){return new wt}},xf={type:"note",datum:wt,scene:al,isDatum:wt.is,translate:(e,t,i,o)=>{wt.is(t)&&al.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(wt.is(t)&&wt.is(i)&&al.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{wt.is(t)&&al.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new PI({...e,create:t("note")}),dragState:e=>new we(e)};import{_ModuleSupport as OI}from"ag-charts-community";var{Vec2:ri,Vec4:Wi}=OI,nl=class extends Wy{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new De,topMiddle:new ya,topRight:new De,bottomLeft:new De,bottomMiddle:new ya,bottomRight:new De},this.middleLine=new Pt,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return Ze.isCheck(e,"parallel-channel")}dragHandle(e,t,i,o){const{activeHandle:s,handles:a}=this;if(s==null)return;const{offset:n}=a[s].drag(t);a[s].toggleDragging(!0),(s==="topMiddle"||s==="bottomMiddle")&&(n.x=0);let r=[],l=o;switch(s){case"topLeft":case"bottomLeft":r=["topLeft","bottomLeft"];break;case"topMiddle":r=["topLeft","topRight"],n.y-=ya.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],n.y-=ya.HANDLE_SIZE/2,l=!1;break}const c=kt(e,i),h=kt(e.bottom,i);if(!c||!h)return;const p={topLeft:Wi.start(c),topRight:Wi.end(c),bottomLeft:Wi.start(h),bottomRight:Wi.end(h)},u={vectors:{topLeft:p.topRight,bottomLeft:p.bottomRight,topRight:p.topLeft,bottomRight:p.bottomLeft},angle:e.snapToAngle},g=po(p,n,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?u:void 0});e.start.x=g.topLeft.x,e.start.y=g.topLeft.y,e.end.x=g.topRight.x,e.end.y=g.topRight.y,e.height=g.topLeft.y-g.bottomLeft.y}getTranslatePointsVectors(e,t){const{bottomLeft:i,topLeft:o}=this.handles,s=i.getBBox().y-o.getBBox().y,a=ri.add(e,ri.from(0,s)),n=ri.add(t,ri.from(0,s));return{start:e,end:t,bottomStart:a,bottomEnd:n}}containsPoint(e,t){return super.containsPoint(e,t)||this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)}getNodeAtCoords(e,t){return this.middleLine.visible&&this.middleLine.strokeWidth>0&&this.middleLine.containsPoint(e,t)?"line":super.getNodeAtCoords(e,t)}updateLines(e,t,i,o,s,a){const{topLine:n,middleLine:r,bottomLine:l}=this,{lineDashOffset:c,stroke:h,strokeOpacity:p,strokeWidth:u}=e,g=e.getLineDash(),y={lineCap:e.getLineCap(),lineDash:g,lineDashOffset:c,stroke:h,strokeOpacity:p,strokeWidth:u};n.setProperties({...t,...y}),l.setProperties({...i,...y});const f=this.extendLine({x1:s.x1,y1:a.y1+(s.y1-a.y1)/2,x2:s.x2,y2:a.y2+(s.y2-a.y2)/2},e,o);r.setProperties({...f,lineDash:e.middle.lineDash??g,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??p,strokeWidth:e.middle.strokeWidth??u,visible:e.middle.visible??!0})}updateHandles(e,t,i){const{handles:{topLeft:o,topMiddle:s,topRight:a,bottomLeft:n,bottomMiddle:r,bottomRight:l}}=this,c={fill:e.handle.fill,stroke:e.handle.stroke??e.stroke,strokeOpacity:e.handle.strokeOpacity??e.strokeOpacity,strokeWidth:e.handle.strokeWidth??e.strokeWidth};o.update({...c,...Wi.start(t)}),a.update({...c,...Wi.end(t)}),n.update({...c,...Wi.start(i)}),l.update({...c,...Wi.end(i)}),s.update({...c,...ri.sub(Wi.center(t),ri.from(s.handle.width/2,s.handle.height/2))}),r.update({...c,...ri.sub(Wi.center(i),ri.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(Ss,this.text,!!e.text.label),_y(!0,t,i,e.text,e.strokeWidth,this.text,e.text.label)}getBackgroundPoints(e,t,i,o){const s=t.x1>t.x2,a=t.y1>t.y2,n=t.x1!==i.x1&&t.y1!==i.y1,r=t.x2!==i.x2&&t.y2!==i.y2,l=ri.from(t);return e.extendEnd&&r&&l.push(ri.from(s?o.x1:o.x2,a?o.y1:o.y2)),l.push(...ri.from(i).reverse()),e.extendStart&&n&&l.push(ri.from(s?o.x2:o.x1,a?o.y2:o.y1)),l}};import{_ModuleSupport as _I}from"ag-charts-community";import{isNumber as ka}from"ag-charts-core";var{StateMachine:Go,StateMachineProperty:Md,Debug:RI}=_I,rl=class extends Go{constructor(e){const t=({point:l})=>{const c=new oi;c.set({start:l,end:l,height:0}),e.create(c)},i=()=>{const{node:l}=this;l?.toggleActive(!0),l?.toggleHandles({topLeft:!0,topMiddle:!1,topRight:!1,bottomLeft:!1,bottomMiddle:!1,bottomRight:!1})},o=({offset:l,context:c})=>{const{datum:h,snapping:p}=this;h&&(h.set({end:bn(l,c,p,h.start,h.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,p=Fe(c?.end.y),u=Fe(c?.start.y),{y:g}=l;if(c==null||!ka(u)||!ka(p)||!ka(g))return;const y=p-(g??0),f=u-y;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:y}),e.update())},n=({point:l})=>{const{datum:c,node:h}=this,p=Fe(c?.end.y),u=Fe(c?.start.y),{y:g}=l;if(c==null||!ka(u)||!ka(p)||!ka(g))return;const y=p-(g??0),f=u-y;h?.toggleHandles(!0),!(!e.validatePoint({x:c.start.x,y:f},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:y}),e.recordAction("Create parallel-channel annotation"),e.showAnnotationOptions(),e.update())},r=()=>e.delete();super("start",{start:{click:{target:"waiting-first-render",action:t},drag:{target:"waiting-first-render",action:t},reset:Go.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,drag:o,click:{target:"height",action:s},dragEnd:{target:"height",action:s},reset:{target:Go.parent,action:r},cancel:{target:Go.parent,action:r}},height:{hover:a,click:{target:Go.parent,action:n},drag:{target:Go.parent,action:n},reset:{target:Go.parent,action:r},cancel:{target:Go.parent,action:r}}}),this.debug=RI.create(!0,"annotations"),this.snapping=!1}};d([Md()],rl.prototype,"datum",2),d([Md()],rl.prototype,"node",2),d([Md()],rl.prototype,"snapping",2);var Sf={type:"parallel-channel",datum:oi,scene:nl,isDatum:oi.is,translate:(e,t,i,o)=>{oi.is(t)&&nl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(oi.is(t)&&oi.is(i)&&nl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{oi.is(t)&&nl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new rl({...e,create:t("parallel-channel")}),dragState:e=>new we(e)},ll=class extends ud{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return Ze.isCheck(e,"text")}getHandleCoords(e,t){const i=De.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},EI=class extends vn{createDatum(){return new co}},bf={type:"text",datum:co,scene:ll,isDatum:co.is,translate:(e,t,i,o)=>{co.is(t)&&ll.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(co.is(t)&&co.is(i)&&ll.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{co.is(t)&&ll.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new EI({...e,create:t("text")}),dragState:e=>new we(e)},Kt={[tf.type]:tf,[zy.type]:zy,[Fy.type]:Fy,[Sf.type]:Sf,[Gy.type]:Gy,[Qy.type]:Qy,[Zy.type]:Zy,[Cy.type]:Cy,[Py.type]:Py,[xf.type]:xf,[bf.type]:bf,[of.type]:of,[ky.type]:ky,[vy.type]:vy,[uf.type]:uf,[gf.type]:gf,[yf.type]:yf,[ff.type]:ff};function Ds(e){for(const{isDatum:t}of Object.values(Kt))if(t(e))return e}import{_ModuleSupport as BI}from"ag-charts-community";var{ActionOnSet:zI,ParallelStateMachine:FI,StateMachine:Ad,StateMachineProperty:Gi,Debug:HI}=BI,cl=class extends FI{constructor(e){super(new VI(t=>{this.snapping=t}),new WI(()=>{this.node=this.active==null?void 0:e.node(this.active)}),new Ko(e,t=>{this.active=t,this.datum=this.active==null?void 0:e.datum(this.active),this.node=this.active==null?void 0:e.node(this.active)})),this.snapping=!1}getActive(){return this.active}isActive(e){return e===this.active}};d([Gi()],cl.prototype,"snapping",2),d([Gi()],cl.prototype,"datum",2),d([Gi()],cl.prototype,"node",2);var VI=class extends Ad{constructor(e){super("idle",{idle:{hover:({shiftKey:t})=>e(t),keyDown:({shiftKey:t})=>e(t),keyUp:({shiftKey:t})=>e(t),click:({shiftKey:t})=>e(t),drag:({shiftKey:t})=>e(t)},dragging:{},translating:{},"text-input":{}})}},WI=class extends Ad{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},Ko=class extends Ad{constructor(e,t){const i=m=>b=>{e.create(m,b),this.active=e.selectLast()},o=()=>{this.active!=null&&e.delete(this.active),this.active=void 0,e.select()},s={createDatum:i},a={...e,delete:o,showTextInput:()=>{this.active!=null&&e.showTextInput(this.active)},deselect:()=>{const m=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,m)},showAnnotationOptions:()=>{this.active!=null&&e.showAnnotationOptions(this.active)}},n=Object.fromEntries(Object.entries(Kt).map(([m,b])=>[m,b.createState(a,s)])),r=Object.fromEntries(Object.entries(Kt).map(([m,b])=>[m,b.dragState(e,s)])),l=({colorPickerType:m,colorOpacity:b,color:k,opacity:A,isMultiColor:M})=>{this.datum&&(m==="text-color"&&e.updateTextInputColor(k),Er(this.datum,m,b,k,A,M),e.update())},c=m=>{const{datum:b,node:k}=this;!b||!k||(Fi(b)?(b.fontSize=m,e.updateTextInputFontSize(m)):pa(b)&&(b.text.fontSize=m),e.update())},h=m=>{const{datum:b,node:k}=this;!b||!k||!Oo(b)||(ty(b,m),e.update())},p=m=>{const{node:b}=this;!b||!("setTextInputBBox"in b)||(b.setTextInputBBox(m),e.update())},u=({textInputValue:m,bbox:b})=>{const{datum:k}=this;if(b!=null&&m!=null&&m.length>0){if(!Fi(k))return;const A=Nr(k,m,b.width);k.set({text:A}),e.update(),e.recordAction(`Change ${k.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${k?.type} annotation`)},g=()=>{e.updateTextInputBBox(void 0)},y=()=>this.active!=null,f=()=>this.copied!=null,x=()=>{const{active:m,datum:b}=this;return m==null||!b?!1:pa(b)&&b.isWriteable()},S=()=>this.active!=null&&!Po(this.datum),v=()=>this.hovered!=null;super("idle",{idle:{onEnter:()=>{e.select(this.active,this.active),this.hoverCoords&&(this.hovered=e.hoverAtCoords(this.hoverCoords,this.active,this.hovered))},hover:({offset:m})=>{this.hovered=e.hoverAtCoords(m,this.active,this.hovered),this.hoverCoords=m},translate:{guard:y,target:"translating",action:({translation:m})=>{e.startInteracting(),e.translate(this.active,m),e.update()}},copy:{guard:S,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:S,action:()=>{this.copied=e.copy(this.active),o()}},paste:{guard:f,action:()=>{e.paste(this.copied)}},selectLast:()=>{const m=this.active;this.active=e.selectLast(),e.select(this.active,m)},click:[{guard:()=>{const{active:m,hovered:b,datum:k}=this;return m==null||b!==m||!k?!1:Fi(k)&&k.isWriteable()},target:"text-input"},{action:()=>{const m=this.active;this.active=this.hovered,e.select(this.active,m)}}],dblclick:{guard:x,action:({offset:m})=>{const b=e.getNodeAtCoords(m,this.active)==="text"?"text":"line";e.showAnnotationSettings(this.active,void 0,b)}},dragStart:[{guard:v,target:"dragging",action:()=>{const m=this.active;this.active=this.hovered,e.select(this.active,m),e.startInteracting()}},{action:()=>{const m=this.active;this.active=this.hovered,e.select(this.active,m)}}],color:{guard:y,action:l},fontSize:{guard:y,action:c},lineProps:{guard:y,action:m=>{const b=Ds(this.datum);b?.set(m),e.update(),e.recordAction(`Change ${b?.type} ${Object.entries(m).map(([k,A])=>`${k} to ${A}`).join(", ")}`)}},lineStyle:{guard:y,action:h},lineText:{guard:y,action:m=>{const b=Ds(this.datum);pa(b)&&(ho(b)&&m.position==="center"&&(m.position="inside"),b.text.set(m),e.update())}},updateTextInputBBox:{guard:y,action:p},toolbarPressSettings:{guard:x,action:m=>{e.showAnnotationSettings(this.active,m)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(this.active,this.active),e.resetToIdle()},delete:()=>{this.active!=null&&(e.delete(this.active),!Po(this.datum)&&e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...n},dragging:{onEnter:(m,b)=>{if(this.active==null)return;const k=e.getAnnotationType(this.active);k&&(this.transitionRoot(k),this.transitionRoot("dragStart",b))},...r},translating:{onEnter:()=>{},translate:{guard:y,target:"translating",action:({translation:m})=>{e.startInteracting(),e.translate(this.active,m),e.update()}},translateEnd:{guard:y,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const m=Ds(this.datum);!m||!("getTextInputCoords"in m)||(e.startInteracting(),e.showTextInput(this.active),m.visible=!1,e.update())},updateTextInputBBox:{guard:y,action:p},resize:{target:"idle",action:u},click:{target:"idle",action:u},drag:{target:"idle",action:u},textInput:[{guard:hd,target:"idle",action:g},{guard:dd,target:"idle",action:u}],color:{guard:y,action:l},fontSize:{guard:y,action:c},cancel:{target:"idle",action:g},onExit:()=>{e.stopInteracting(),e.hideTextInput();const m=this.active;if(this.active=this.hovered=void 0,e.select(this.active,m),m==null)return;const b=e.datum(m),k=e.node(m);!b||!k||(b.visible=!0)}}}),this.setActive=t,this.debug=HI.create(!0,"annotations"),this.snapping=!1}};d([zI({changeValue(e){this.setActive(e)}}),Gi()],Ko.prototype,"active",2),d([Gi()],Ko.prototype,"hovered",2),d([Gi()],Ko.prototype,"hoverCoords",2),d([Gi()],Ko.prototype,"copied",2),d([Gi()],Ko.prototype,"snapping",2),d([Gi()],Ko.prototype,"datum",2),d([Gi()],Ko.prototype,"node",2);import{_ModuleSupport as vf}from"ag-charts-community";import{CleanupRegistry as GI,EventEmitter as KI}from"ag-charts-core";var{ActionOnSet:$I,LayoutElement:jI,Menu:YI,PropertiesArray:UI,ToolbarButtonProperties:XI,Property:hl,ChartAxisDirection:ZI}=vf,kf=class extends XI{};d([hl],kf.prototype,"value",2);var dl=class extends vf.BaseProperties{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new UI(kf),this.events=new KI,this.annotationMenu=new YI(this.ctx,"annotations"),this.cleanup=new GI,this.toolbar=e.sharedToolbar.getSharedToolbar("annotations");const t=this.onKeyDown.bind(this);this.toolbar.addListener("keydown",t),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onToolbarButtonPress.bind(this)),e.layoutManager.registerElement(jI.ToolbarLeft,this.onLayoutStart.bind(this)),()=>{this.toolbar.removeListener("keydown",t),this.toolbar.destroy()})}destroy(){this.cleanup.flush()}toggleClearButtonEnabled(e){const t=this.buttons.findIndex(i=>i.value==="clear");this.toolbar.toggleButtonEnabledByIndex(t,e)}resetButtonIcons(){for(const[e,t]of this.buttons.entries())switch(t.value){case"line-menu":this.updateButtonByIndex(e,{icon:"trend-line-drawing",value:"line-menu"});break;case"fibonacci-menu":this.updateButtonByIndex(e,{icon:"fibonacci-retracement-drawing",value:"fibonacci-menu"});break;case"text-menu":this.updateButtonByIndex(e,{icon:"text-annotation",value:"text-menu"});break;case"shape-menu":this.updateButtonByIndex(e,{icon:"arrow-drawing",value:"shape-menu"});break;case"measurer-menu":this.updateButtonByIndex(e,{icon:"measurer-drawing",value:"measurer-menu"});break}}hideOverlays(){this.annotationMenu.hide()}clearActiveButton(){this.toolbar.clearActiveButton()}onLayoutStart(e){this.enabled&&(this.toolbar.updateButtons(this.buttons),this.toolbar.layout(e.layoutBox,this.padding))}refreshButtonsEnabled(e){for(const[t,i]of this.buttons.entries())i&&this.toolbar.toggleButtonEnabledByIndex(t,e)}onToolbarButtonPress({event:e,button:t,buttonBounds:i,buttonWidget:o}){const s=this.ctx.axisManager.getAxisContext(ZI.Y)[0].scale;switch(t.value){case"clear":this.events.emit("pressed-clear",null);break;case"line-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsLineAnnotations",W0.filter(a=>a.visible?a.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsFibonacciAnnotations",G0);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsTextAnnotations",$0);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsShapeAnnotations",j0);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsMeasurerAnnotations",Y0);break}}onToolbarButtonPressShowMenu(e,t,i,o,s,a){this.events.emit("pressed-show-menu",null);const n=this.buttons.findIndex(r=>r.value===o);this.toolbar.toggleActiveButtonByIndex(n),this.annotationMenu.setAnchor({x:t.x+t.width+6,y:t.y}),this.annotationMenu.show(i,{items:a,ariaLabel:this.ctx.localeManager.t(s),class:"ag-charts-annotations__toolbar-menu",sourceEvent:e.sourceEvent,onPress:this.onButtonPressMenuCreateAnnotation.bind(this,o)})}onButtonPressMenuCreateAnnotation(e,t){const i=this.buttons.findIndex(o=>o.value===e);this.updateButtonByIndex(i,{icon:t.icon}),this.events.emit("pressed-create-annotation",{annotation:t.value}),this.annotationMenu.hide()}onKeyDown({sourceEvent:e}){e.key==="Escape"&&this.events.emit("cancel-create-annotation",null)}updateButtonByIndex(e,t){const i=this.buttons.at(e);i&&(i.set({...i.toJson(),...t,value:t.value??i.value}),this.toolbar.updateButtonByIndex(e,{...i.toJson()}))}};d([hl,$I({changeValue(e){this.toolbar?.setHidden(!e)}})],dl.prototype,"enabled",2),d([hl],dl.prototype,"padding",2),d([hl],dl.prototype,"buttons",2);import{_ModuleSupport as qI,_Widget as QI}from"ag-charts-community";var{BaseModuleInstance:JI,InteractionState:Mn,Property:e2,ChartAxisDirection:t2,getIconClassNames:i2}=qI,An="ag-charts-annotations__axis-button",Df=class extends JI{constructor(e,t,i,o){super(),this.ctx=e,this.axisCtx=t,this.onButtonClick=i,this.seriesRect=o,this.enabled=!0,this.snap=!1,this.padding=0,this.button=this.setup(),this.toggleVisibility(!1),this.updateButtonElement(),this.snap=!!t.scale.bandwidth,e.domManager.addEventListener("focusin",({target:s})=>{const a=s instanceof HTMLElement?s:void 0;!(a&&e.domManager.contains(a,"series-area"))&&a!==this.button.getElement()&&this.hide()}),this.cleanup.register(e.widgets.seriesWidget.addListener("drag-move",s=>this.onMouseDrag(s)),e.widgets.seriesWidget.addListener("mousemove",s=>this.onMouseMove(s)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseLeave()),e.widgets.seriesDragInterpreter?.events.on("click",s=>this.onClick(s)),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.hide()),e.eventsHub.on("zoom:change",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new QI.ButtonWidget;return e.addClass(An),e.setTabIndex(-1),e.setAriaLabel(this.ctx.localeManager.t("ariaLabelAddHorizontalLine")),this.ctx.widgets.seriesWidget.getElement().appendChild(e.getElement()),e}destroyElements(){this.ctx.domManager.removeChild("canvas-overlay",An)}onMouseMove(e){this.ctx.interactionManager.isState(Mn.Clickable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(Mn.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(Mn.Clickable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(Mn.Clickable)&&e.device==="touch"&&this.show(e)}show(e){const{sourceEvent:t,currentX:i,currentY:o}=e;if(!(this.enabled&&this.ctx.widgets.seriesWidget.getElement().contains(t.target))){this.hide();return}this.toggleVisibility(!0);const s=this.getButtonCoordinates({x:i,y:o});this.coords={x:s.x+this.button.clientWidth/2,y:s.y+this.button.clientHeight/2},this.updatePosition(s)}hide(){this.toggleVisibility(!1)}onKeyPress(){this.snap&&this.ctx.interactionManager.isState(Mn.Default)||this.hide()}getButtonCoordinates({x:e,y:t}){const{axisCtx:{direction:i,position:o},seriesRect:s,snap:a,axisCtx:n,padding:r}=this,{clientWidth:l,clientHeight:c}=this.button,[h,p]=[0,s.height],[u,g]=[0,s.width];if(a&&(e=oo(Ar(e-s.x,n),n)+s.x,t=oo(Ar(t-s.y,n),n)+s.y),i===t2.X){const f=c-Math.max(0,r-5);e=e-l/2,t=o==="top"?h-c+f:p-f}else{const f=l-Math.max(0,r-9);e=o==="left"?u-l+f:g-f,t=t-c/2}return{x:e,y:t}}toggleVisibility(e){const{button:t}=this;if(t==null)return;const i=this.enabled&&e;this.toggleClass("-hidden",!i)}toggleClass(e,t){this.button.toggleClass(`${An}-${e}`,t)}updatePosition({x:e,y:t}){this.button.getElement().style.transform=`translate(${Math.round(e)}px, ${Math.round(t)}px)`}updateButtonElement(){const{button:e}=this;e.addListener("click",()=>this.onButtonClick(this.coords)),e.addListener("touchend",()=>this.onButtonClick(this.coords)),e.addListener("drag-start",()=>{}),e.setInnerHTML(``)}};d([e2],Df.prototype,"enabled",2);import{_ModuleSupport as o2}from"ag-charts-community";import{EventEmitter as s2}from"ag-charts-core";import{_ModuleSupport as a2}from"ag-charts-community";import{createElement as yo,createElementId as Id,entries as Mf,getWindow as n2,setAttribute as Af,setAttributes as Ld}from"ag-charts-core";var{Color:If,DraggablePopover:r2,NativeWidget:Td,Vec2:He,createButton:pl,createCheckbox:l2,createSelect:c2,createTextArea:h2,initRovingTabIndex:Lf,getIconClassNames:d2,mapValues:Cd}=a2,Tf=class og extends r2{constructor(t,i){super(t,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new ny(this.ctx,{detached:!0}),this.cleanup.register(t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)))}showWithChildren(t,i){const o=super.showWithChildren(t,i);return o.classList.add("ag-charts-dialog"),o.setAttribute("role","dialog"),o.addEventListener("mousedown",s=>{s.target.classList?.contains("ag-charts-dialog__color-picker-button")||this.colorPicker.hide()}),o.addEventListener("keydown",this.onKeyDown.bind(this)),n2().requestAnimationFrame(()=>this.reposition()),this.colorPicker.attachTo(this),o}updatePosition(t){super.updatePosition(t);const{anchor:i,fallbackAnchor:o}=this.getColorPickerAnchors()??{};i&&this.colorPicker.setAnchor(i,o)}createTabs(t,i,o){const s=yo("div","ag-charts-dialog__tabs"),a=Cd(o,()=>Id()),n=Cd(o,()=>Id());for(const[g,y]of Mf(o))Ld(y.panel,{id:n[g],role:"tabpanel","aria-labelledby":a[g]});const r=g=>{for(const[y,f]of Mf(o))f.panel.classList.toggle("ag-charts-dialog__tab-panel--active",y===g),h[y].classList.toggle("ag-charts-dialog__tab-button--active",y===g),Af(h[y],"aria-selected",y===g),y===g&&f.onShow?.()},l=new Td(yo("div","ag-charts-dialog__header"));l.addListener("drag-start",g=>{const{sourceEvent:y}=g;y.target instanceof Element&&y.target.classList.contains("ag-charts-dialog__header")&&this.onDragStart(g)}),l.addListener("drag-move",g=>this.onDragMove(g)),l.addListener("drag-end",()=>this.onDragEnd());const c=new u2;this.setDragHandle(c);const h=Cd(o,(g,y)=>pl({label:this.ctx.localeManager.t(g.label),onPress:()=>r(y)},{id:a[y],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":n[y]})),p=yo("div","ag-charts-dialog__tab-list");Ld(p,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),p.append(...Object.values(h));const u=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),p,u),s.append(l.getElement(),...Object.values(o).map(g=>g.panel)),r(i),Lf({orientation:"horizontal",buttons:Object.values(h)}),{tabs:s,initialFocus:h[i]}}createTabPanel(){return yo("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return yo("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:i,value:o,onChange:s}){const a=this.createInputGroup(t);Ld(a,{role:"radiogroup",tabindex:-1,"aria-label":this.ctx.localeManager.t(t)});const n="ag-charts-dialog__button--active",r=[];for(const l of i){const{icon:c,altText:h}=l,p=this.ctx.localeManager.t(h),u=pl({icon:c,altText:p,onPress:()=>{for(const g of Array.from(a.children))g.classList.remove(n),g.ariaChecked="false";u.classList.add(n),u.ariaChecked="true",s(l.value)}},{"aria-checked":l.value===o,class:"ag-charts-dialog__button",role:"radio",title:p});l.value===o&&u.classList.add(n),a.appendChild(u),r.push(u)}return Lf({orientation:"horizontal",buttons:r}),a}createSelect({altText:t,label:i,options:o,value:s,onChange:a}){const n=this.createInputGroup(i),r=this.ctx.localeManager.t(t),l=c2({value:s,options:o,onChange:a},{class:"ag-charts-dialog__select","aria-label":r,title:r});return n.append(l),n}createTextArea({placeholder:t,value:i,onChange:o}){const s=t?this.ctx.localeManager.t(t):void 0;return h2({value:i,onChange:o},{placeholder:s})}createCheckbox({label:t,checked:i,onChange:o}){const s=Id(),a=this.createInputGroup(t,{for:s}),n=l2({checked:i,onChange:o},{class:"ag-charts-dialog__checkbox",role:"switch",id:s});return a.append(n),a}createColorPicker({color:t,opacity:i,label:o,altText:s,onChange:a,onChangeHide:n,isMultiColor:r,hasMultiColorOption:l}){const c=this.createInputGroup(o),h=this.ctx.localeManager.t(s),p=pl({label:h,onPress:u=>{const{anchor:g,fallbackAnchor:y}=this.getColorPickerAnchors(p)??{};this.colorPicker.show({anchor:g,fallbackAnchor:y,color:t,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:u,onChange:(f,x,S,v)=>{p.style.setProperty("--color",f),p.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",v),a(f,x,S,v)},onChangeHide:n})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)p.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const u=If.fromString(t),g=new If(u.r,u.g,u.b,i);p.style.setProperty("--color",g.toHexString())}return c.append(p),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return pl({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,i){const o=yo("div","ag-charts-dialog__input-group"),s=yo("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(t),Af(s,"for",i?.for),o.appendChild(s),o}onLayoutComplete(t){this.seriesRect=t.series.paddedRect,this.reposition()}onKeyDown(t){t.altKey||t.ctrlKey||t.metaKey||t.isComposing||t.key!=="Escape"||this.hide()}reposition(){const{seriesRect:t,ctx:i}=this,o=i.domManager.getBoundingClientRect(),s=this.getPopoverElement();if(!t||!s)return;const a=He.from(0,t.y),n=He.from(o.width,t.height),r=He.from(s),l=He.from(.5,1);let c;if(t.width>1e3){const h=He.sub(He.add(a,He.multiply(n,l)),He.multiply(r,l));c=He.sub(h,He.from(0,og.offset))}else{const h=He.sub(He.add(a,n),r);c=He.sub(h,og.offset)}this.updatePosition(c)}getColorPickerAnchors(t){if(t&&(this.colorPickerAnchorElement=t),!this.colorPickerAnchorElement)return;const i=this.colorPickerAnchorElement.getBoundingClientRect(),o=this.ctx.domManager.getBoundingClientRect(),s=He.sub(He.from(i.x,i.y),He.from(o.left,o.top)),a=He.add(s,He.from(0,i.height+5)),n=He.sub(s,He.from(0,5));return{anchor:a,fallbackAnchor:n}}};Tf.offset=60;var p2=Tf,u2=class extends Td{constructor(){super(yo("div","ag-charts-dialog__drag-handle"));const e=new Td(yo("span",d2("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},{focusCursorAtEnd:g2}=o2,y2=class extends p2{constructor(e){super(e,"settings"),this.events=new s2,this.hideFns.push(()=>this.events.emit("hidden",null))}show(e,t){const i=this.createLinearLineTab(e,t),o=this.createLinearTextTab(e,t);let s="dialogHeaderLine";ho(e)?s="dialogHeaderChannel":ey(e)?s="dialogHeaderFibonacciRange":e.type==="date-range"?s="dialogHeaderDateRange":e.type==="price-range"?s="dialogHeaderPriceRange":e.type==="date-price-range"&&(s="dialogHeaderDatePriceRange");const{tabs:a,initialFocus:n}=this.createTabs("ariaLabelSettingsTabBar",t.initialSelectedTab,{line:{label:s,panel:i},text:{label:"dialogHeaderText",panel:o.panel,onShow:o.onShow}});t.initialFocus=n,this.showWithChildren([a],t).classList.add("ag-charts-dialog--annotation-settings")}createLinearLineTab(e,t){const i=this.createTabPanel(),o=this.createInputGroupLine(),s=this.createInputGroupLine(),a="isMultiColor"in e,n=this.createColorPickerInput("line-color",e.getDefaultColor("line-color"),e.getDefaultOpacity("line-color"),a?e.isMultiColor:!1,a,t.onChangeLineColor,t.onChangeHideLineColor),r=this.createStrokeWidthSelect(e.strokeWidth??2,t.onChangeLineStyleWidth),l=this.createLineStyleRadioGroup(e.lineStyle??"solid",t.onChangeLineStyleType);if(o.append(n),"background"in e){const c=this.createColorPickerInput("fill-color",e.getDefaultColor("fill-color"),e.getDefaultOpacity("fill-color"),!1,!1,t.onChangeFillColor,t.onChangeHideFillColor);o.append(c),s.append(r)}else"showFill"in e?(o.append(this.createCheckbox({label:"dialogInputShowFill",checked:e.showFill??!0,onChange:c=>t.onChangeLine({showFill:c})})),s.append(r)):o.append(r);return s.append(l),i.append(o,s),"bands"in e&&i.append(this.createFibonacciRatioSelect(e.bands??10,c=>t.onChangeLine({bands:c}))),"extendStart"in e&&"extendEnd"in e&&i.append(this.createCheckbox({label:ho(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:c=>t.onChangeLine({extendStart:c})}),this.createCheckbox({label:ho(e)?"dialogInputExtendChannelEnd":"dialogInputExtendLineEnd",checked:e.extendEnd??!1,onChange:c=>t.onChangeLine({extendEnd:c})})),"extendAbove"in e&&"extendBelow"in e&&i.append(this.createCheckbox({label:"dialogInputExtendAbove",checked:e.extendAbove??!1,onChange:c=>t.onChangeLine({extendAbove:c})}),this.createCheckbox({label:"dialogInputExtendBelow",checked:e.extendBelow??!1,onChange:c=>t.onChangeLine({extendBelow:c})})),"extendLeft"in e&&"extendRight"in e&&i.append(this.createCheckbox({label:"dialogInputExtendLeft",checked:e.extendLeft??!1,onChange:c=>t.onChangeLine({extendLeft:c})}),this.createCheckbox({label:"dialogInputExtendRight",checked:e.extendRight??!1,onChange:c=>t.onChangeLine({extendRight:c})})),"reverse"in e&&"showFill"in e&&i.append(this.createCheckbox({label:"dialogInputReverse",checked:e.reverse??!1,onChange:c=>t.onChangeLine({reverse:c})})),i}createLinearTextTab(e,t){const i=this.createTabPanel(),o=this.createTextArea({placeholder:"inputTextareaPlaceholder",value:e.text.label,onChange:h=>t.onChangeText({label:h})}),s=this.createFontSizeSelect(e.text.fontSize,t.onChangeTextFontSize),a=this.createColorPickerInput("text-color",e.text.color,1,!1,!1,t.onChangeTextColor,t.onChangeHideTextColor),n=e.text.position==="inside"?"center":e.text.position,r=this.createPositionRadioGroup(n??"top",h=>t.onChangeText({position:h})),l=this.createAlignmentRadioGroup(e.text.alignment??"center",h=>t.onChangeText({alignment:h})),c=this.createInputGroupLine();return c.append(s,a,r,l),i.append(o,c),{panel:i,onShow:()=>g2(o)}}createColorPickerInput(e,t,i,o,s,a,n){const r=e==="fill-color"?"dialogInputFillColorPicker":"dialogInputColorPicker",l=e==="fill-color"?"dialogInputFillColorPickerAltText":"dialogInputColorPickerAltText";return this.createColorPicker({label:r,altText:l,color:t,opacity:i,isMultiColor:o,hasMultiColorOption:s,onChange:a,onChangeHide:n})}createStrokeWidthSelect(e,t){return this.createSelect({label:"dialogInputStrokeWidth",altText:"dialogInputStrokeWidthAltText",options:cy.map(({label:i,value:o})=>({label:i,value:`${o}`})),value:String(e),onChange:i=>t(Number(i))})}createFibonacciRatioSelect(e,t){return this.createSelect({label:"dialogInputFibonacciBands",altText:"dialogInputFibonacciBandsAltText",options:K0.map(({label:i,value:o})=>({label:i,value:`${o}`})),value:String(e),onChange:i=>t(Number(i))})}createLineStyleRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputLineStyle",options:[{icon:"line-style-solid",altText:"iconAltTextLineStyleSolid",value:"solid"},{icon:"line-style-dashed",altText:"iconAltTextLineStyleDashed",value:"dashed"},{icon:"line-style-dotted",altText:"iconAltTextLineStyleDotted",value:"dotted"}],value:e,onChange:t})}createFontSizeSelect(e,t){return this.createSelect({label:"dialogInputFontSize",altText:"dialogInputFontSizeAltText",options:hy.map(({label:i,value:o})=>({label:i,value:String(o)})),value:String(e),onChange:i=>t(Number(i))})}createPositionRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputPosition",options:[{icon:"position-top",altText:"iconAltTextPositionTop",value:"top"},{icon:"position-center",altText:"iconAltTextPositionCenter",value:"center"},{icon:"position-bottom",altText:"iconAltTextPositionBottom",value:"bottom"}],value:e,onChange:t})}createAlignmentRadioGroup(e,t){return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:"iconAltTextAlignLeft",value:"left"},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:"iconAltTextAlignRight",value:"right"}],value:e,onChange:t})}};function Nd(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}function f2(e,t,i){for(const{update:o}of Object.values(Kt))o(e,t,i)}var{ChartUpdateType:m2,InteractionState:Ot,PropertiesArray:x2,Property:In,ChartAxisDirection:S2,keyProperty:b2,valueProperty:v2,Vec2:Ms,Selection:k2,BBox:D2}=la,Da=class Hk extends la.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.enabled=!0,this.toolbar=new dl(this.ctx),this.optionsToolbar=new od(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return Ds(this.annotationData.at(i))}),this.axesButtons=new Bh,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new x2(Hk.createAnnotationDatum),this.defaults=new E0,this.container=new la.Group({name:"static-annotations"}),this.annotations=new k2(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new y2(this.ctx),this.textInput=new pM(this.ctx),this.postUpdateFns=[],this.state=this.setupStateMachine(),this.setupListeners(),this.setupDOM(),this.ctx.historyManager.addMementoOriginator(t.annotationManager),this.ctx.historyManager.addMementoOriginator(this.defaults),this.textInput.setKeyDownHandler(this.onTextInput.bind(this)),this.cleanup.register(()=>{this.clear(),this.xAxis?.button?.destroy(),this.yAxis?.button?.destroy()})}setupStateMachine(){const{ctx:t}=this;return new cl({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(Ot.Annotations),this.hideOverlays(),this.optionsToolbar.hide(),this.deleteEphemeralAnnotations(),this.update()},hoverAtCoords:(i,o,s)=>{let a;return this.annotations.each((n,r,l)=>{if(!r.isHoverable())return;const c=n.containsPoint(i.x,i.y);c&&(a??(a=l)),n.toggleHovered(c,o===l,r.readOnly)}),a!=null?t.tooltipManager.suppressTooltip("annotations"):this.isAnnotationState()||t.tooltipManager.unsuppressTooltip("annotations"),(a==null||!this.annotationData.at(a)?.readOnly)&&this.ctx.domManager.updateCursor("annotations",a==null?void 0:this.annotations.at(a)?.getCursor()),a!==s&&this.update(),a},getNodeAtCoords:(i,o)=>{const s=this.annotations.at(o);if(s)return s.getNodeAtCoords(i.x,i.y)},translate:(i,o)=>{const s=this.annotations.at(i),a=Ds(this.annotationData.at(i));if(!(!s||!a))return this.translateNode(s,a,o)},copy:i=>{const o=this.annotations.at(i),s=Ds(this.annotationData.at(i));if(!(!o||!s))return this.createAnnotationDatumCopy(o,s)},paste:i=>{this.createAnnotation(i.type,i,!1),this.postUpdateFns.push(()=>{this.state.transitionAsync("selectLast"),this.state.transitionAsync("copy")})},select:(i,o)=>{const{annotations:s,optionsToolbar:a,toolbar:n}=this;this.hideOverlays(),n.clearActiveButton(),n.resetButtonIcons();const r=i==null?null:s.at(i),l=o==null?null:s.at(o),c=i==null?null:this.annotationData.at(i);l===r&&r!=null||(l?.toggleActive(!1),a.hide(),r&&!c?.readOnly?(this.pushAnnotationState(Ot.AnnotationsSelected),r.toggleActive(!0),Po(c)||(a.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{a.show(),a.setAnchorScene(r)}))):(this.popAnnotationState(Ot.AnnotationsSelected),this.popAnnotationState(Ot.Annotations)),Po(c)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Ot.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Ot.Annotations)},stopInteracting:()=>{this.popAnnotationState(Ot.Annotations)},create:(i,o)=>{this.createAnnotation(i,o)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{const i=this.annotationData.filter(o=>{if(o.readOnly===!0)return o});this.annotationData.splice(0,this.annotationData.length);for(const o of i)this.annotationData.push(o)},validatePoint:(i,o)=>{const s=this.getAnnotationContext();return s?Qr(s,i,o):!0},getAnnotationType:i=>mM(this.annotationData[i].type),datum:i=>this.annotationData.at(i),node:i=>this.annotations.at(i),recordAction:i=>{this.recordActionAfterNextUpdate(i)},update:()=>{this.postUpdateFns.push(()=>{const i=this.state.getActive(),o=i==null?null:this.annotations.at(i);o!=null&&this.optionsToolbar.setAnchorScene(o)}),this.update()},showTextInput:i=>{const o=Ds(this.annotationData.at(i));if(!this.annotations.at(i)||!o||!("getTextInputCoords"in o)||!("getTextPosition"in o))return;const a={color:o.color,fontFamily:o.fontFamily,fontSize:o.fontSize,fontStyle:o.fontStyle,fontWeight:o.fontWeight,placeholderColor:o.getPlaceholderColor()},n=this.getAnnotationContext(),r=c=>Ms.add(o.getTextInputCoords(n,c),Ms.required(this.seriesRect)),l=()=>o.getTextPosition();this.textInput.show({styles:a,layout:{getTextInputCoords:r,getTextPosition:l,alignment:o.alignment,textAlign:o.textAlign,width:o.width},text:o.text,placeholderText:o.placeholderText,onChange:(c,h)=>{this.state.transition("updateTextInputBBox",h)}}),this.ctx.domManager.updateCursor("annotations")},hideTextInput:()=>{this.textInput.hide()},updateTextInputColor:i=>{this.textInput.updateColor(i)},updateTextInputFontSize:i=>{const o=this.textInput.updateFontSize(i);this.state.transition("updateTextInputBBox",o)},updateTextInputBBox:i=>{this.state.transition("updateTextInputBBox",i)},showAnnotationOptions:i=>{const o=this.annotations.at(i);!o||Po(this.annotationData.at(i))||(this.optionsToolbar.updateButtons(this.annotationData.at(i)),this.optionsToolbar.show(),this.optionsToolbar.setAnchorScene(o))},showAnnotationSettings:(i,o,s="line")=>{const a=this.annotationData.at(i);if(!Rr(a)&&!ho(a)&&!xn(a)||Po(a))return;const n=c=>(h,p,u,g)=>{this.setColorAndDefault(a.type,c,h,p,u,g),this.optionsToolbar.updateColorPickerColor(c,p,u,g)},r=c=>()=>{this.recordActionAfterNextUpdate(`Change ${a.type} ${c} to ${a.getDefaultColor(c)}`,["annotations","defaults"]),this.update()},l={initialSelectedTab:s,ariaLabel:this.ctx.localeManager.t("ariaLabelAnnotationSettingsDialog"),sourceEvent:o,onChangeLine:c=>{this.state.transition("lineProps",c),c.bands!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"bands",c.bands),c.reverse!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"reverse",c.reverse),c.showFill!=null&&this.defaults.setDefaultFibonacciOptions(a.type,"showFill",c.showFill)},onChangeText:c=>{this.state.transition("lineText",c),c.alignment&&this.defaults.setDefaultLineTextAlignment(a.type,c.alignment),c.position&&this.defaults.setDefaultLineTextPosition(a.type,c.position),this.recordActionAfterNextUpdate(`Change ${a.type} text ${Object.keys(c).map(h=>`${h} to ${c[h]}`).join(", ")}`)},onChangeFillColor:n("fill-color"),onChangeHideFillColor:r("fill-color"),onChangeLineColor:n("line-color"),onChangeHideLineColor:r("line-color"),onChangeLineStyleType:c=>{this.setLineStyleTypeAndDefault(a.type,c),this.optionsToolbar.updateLineStyleType(Sn.find(h=>h.value===c)??Sn[0])},onChangeLineStyleWidth:c=>{this.setLineStyleWidthAndDefault(a.type,c),this.optionsToolbar.updateStrokeWidth({strokeWidth:c,value:c,label:String(c)})},onChangeTextColor:n("text-color"),onChangeHideTextColor:r("text-color"),onChangeTextFontSize:c=>{this.setFontSizeAndDefault(a.type,c)}};this.settingsDialog.show(a,l)}})}setupListeners(){const{ctx:t,optionsToolbar:i,settingsDialog:o,toolbar:s}=this,{seriesWidget:a,seriesDragInterpreter:n,chartWidget:r}=t.widgets;n&&this.cleanup.register(n.events.on("click",this.hoverTouchPreHandler.bind(this)),n.events.on("drag-start",this.hoverTouchPreHandler.bind(this)),n.events.on("drag-move",this.dragMoveTouchPreHandler.bind(this)),n.events.on("mousemove",this.onHover.bind(this)),n.events.on("click",this.onClick.bind(this)),n.events.on("dblclick",this.onDoubleClick.bind(this)),n.events.on("drag-start",this.onDragStart.bind(this)),n.events.on("drag-move",this.onDrag.bind(this)),n.events.on("drag-end",this.onDragEnd.bind(this))),this.cleanup.register(a.addListener("keydown",this.onKeyDown.bind(this)),a.addListener("keyup",this.onKeyUp.bind(this)),r.addListener("click",this.onCancel.bind(this)),t.eventsHub.on("annotations:restore",this.onRestoreAnnotations.bind(this)),t.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),t.updateService.addListener("pre-scene-render",this.onPreRender.bind(this)),t.eventsHub.on("zoom:change",()=>this.onResize()),t.eventsHub.on("dom:resize",()=>this.onResize()),s.events.on("cancel-create-annotation",()=>{this.cancel(),this.reset(),this.update()}),s.events.on("pressed-create-annotation",({annotation:l})=>{this.cancel(),this.pushAnnotationState(Ot.Annotations),this.state.transition(l),this.update()}),s.events.on("pressed-clear",()=>{this.clear(),this.recordActionAfterNextUpdate("Clear all")}),s.events.on("pressed-show-menu",()=>{this.cancel(),this.reset()}),s.events.on("pressed-unrelated",()=>{this.reset()}),i.events.on("pressed-delete",()=>{this.cancel(),this.delete(),this.reset()}),i.events.on("pressed-settings",({sourceEvent:l})=>{this.state.transition("toolbarPressSettings",l)}),i.events.on("pressed-lock",({locked:l})=>{this.recordActionAfterNextUpdate(l?"Locked":"Unlocked"),this.update()}),i.events.on("hid-overlays",()=>{this.settingsDialog.hide()}),i.events.on("saved-color",({type:l,colorPickerType:c,color:h})=>{this.recordActionAfterNextUpdate(`Change ${l} ${c} to ${h}`,["annotations","defaults"])}),i.events.on("updated-color",({type:l,colorPickerType:c,colorOpacity:h,color:p,opacity:u,isMultiColor:g})=>{this.setColorAndDefault(l,c,h,p,u,g)}),i.events.on("updated-font-size",({type:l,fontSize:c})=>{this.setFontSizeAndDefault(l,c)}),i.events.on("updated-line-style",({type:l,lineStyleType:c})=>{this.setLineStyleTypeAndDefault(l,c)}),i.events.on("updated-line-width",({type:l,strokeWidth:c})=>{this.setLineStyleWidthAndDefault(l,c)}),o.events.on("hidden",()=>{this.optionsToolbar.clearActiveButton()}))}setupDOM(){const{ctx:t,toolbar:i,optionsToolbar:o}=this;this.cleanup.register(t.annotationManager.attachNode(this.container),()=>{t.domManager.removeStyles(An),i.destroy(),o.destroy()})}async processData(t){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[b2(this.xKey,void 0,{id:"date"}),v2(this.volumeKey,"number",{id:"volume"})],o=la.DataSet.wrap(this.data)??la.DataSet.empty(),{dataModel:s,processedData:a}=await t.request("annotations",o,{props:i});this.dataModel=s,this.processedData=a}createAnnotationScene(t){if(t.type in Kt)return new Kt[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys(Kt)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in Kt)return new Kt[t.type].datum().set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys(Kt)}], ignoring.`)}createAnnotation(t,i,o=!0){if(this.annotationData.push(i),o){const s=this.ctx.annotationManager.getAnnotationTypeStyles(t);s&&i.set(s),this.defaults.applyDefaults(i)}this.injectDatumDependencies(i),this.update()}injectDatumDependencies(t){"setLocaleManager"in t&&t.setLocaleManager(this.ctx.localeManager),"getVolume"in t&&(t.getVolume=this.getDatumRangeVolume.bind(this))}getDatumRangeVolume(t,i){const{dataModel:o,processedData:s}=this;let a=Fe(t),n=Fe(i);if(!Rh(a)||!Rh(n)||!o||!s||this.volumeKey==null)return;a>n&&([a,n]=[n,a]);const r=o.resolveKeysById({id:"annotations"},"date",s),l=o.resolveColumnById({id:"annotations"},"volume",s);let c=0;for(let h=0;h=a&&p<=n&&(c+=l[h])}return c}translateNode(t,i,o){const s=this.getAnnotationConfig(i),a=this.getAnnotationContext();a&&s.translate(t,i,o,a)}createAnnotationDatumCopy(t,i){const o=this.getAnnotationConfig(i),s=new o.datum;s.set(i.toJson());const a=this.getAnnotationContext();if(a)return o.copy(t,i,s,a)}getAnnotationConfig(t){if(t.type in Kt)return Kt[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys(Kt)}], ignoring.`)}onRestoreAnnotations(t){this.enabled&&(this.clear(),this.annotationData.set(t.annotations),this.postUpdateFns.push(()=>{this.ctx.annotationManager.fireChangedEvent()}),this.update())}onLayoutComplete(t){const i=t.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i);for(const o of t.axes??[])o.direction===la.ChartAxisDirection.X?this.xAxis=this.getAxis(o,i,this.xAxis?.button):this.yAxis=this.getAxis(o,i,this.yAxis?.button);this.showAnnotations()?this.animateAnnotations({from:0,to:1,phase:"trailing"}):this.animateAnnotations({from:1,to:0,phase:"remove"})}showAnnotations(){if(!this.yAxis||!this.xAxis)return!1;const t=this.ctx.chartService.series.some(s=>s.hasData),o=this.yAxis.context.seriesIds().some(s=>this.ctx.chartService.series.find(n=>n.id===s)?.visible);return t&&o}animateAnnotations({from:t,to:i,phase:o}){const{annotations:s}=this;this.ctx.animationManager?.animate({from:t,to:i,id:"chart-annotations",phase:o,groupId:"opacity",onUpdate(a){s.each(n=>{n.opacity=a,"setAxisLabelOpacity"in n&&n.setAxisLabelOpacity(a)})},onStop(){s.each(a=>{a.opacity=i,"setAxisLabelOpacity"in a&&a.setAxisLabelOpacity(i)})}})}onPreRender(){this.updateAnnotations(),this.state.transition("render")}getAxis(t,i,o){const s=this.ctx.axisManager.getAxisContext(t.direction)[0],{position:a="bottom",direction:n}=s,r=t.gridPadding+t.seriesAreaPadding,l=new D2(0,0,i.width,i.height).grow(r,a),c=n===S2.X?"vertical":"horizontal",{axesButtons:h,snap:p}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===n)){o??(o=new Df(this.ctx,{...s,snapToGroup:p},y=>this.onAxisButtonClick(y,c),i));const g=Nd(t);o.update(i,g)}else o?.destroy(),o=void 0;return{layout:t,context:s,bounds:l,button:o}}recordActionAfterNextUpdate(t,i=["annotations"]){const{defaults:o,ctx:{annotationManager:s,historyManager:a}}=this,n=i.map(r=>r==="defaults"?o:s);this.postUpdateFns.push(()=>{a.record(t,...n),s.fireChangedEvent()})}setColorAndDefault(t,i,o,s,a,n){this.state.transition("color",{colorPickerType:i,colorOpacity:o,color:s,opacity:a,isMultiColor:n}),this.defaults.setDefaultColor(t,i,o,s,a,n)}setFontSizeAndDefault(t,i){this.state.transition("fontSize",i),this.defaults.setDefaultFontSize(t,i),this.recordActionAfterNextUpdate(`Change ${t} font size to ${i}`,["annotations","defaults"])}setLineStyleTypeAndDefault(t,i){this.state.transition("lineStyle",{type:i}),this.defaults.setDefaultLineStyleType(t,i),this.recordActionAfterNextUpdate(`Change ${t} line style to ${i}`,["annotations","defaults"])}setLineStyleWidthAndDefault(t,i){this.state.transition("lineStyle",{strokeWidth:i}),this.defaults.setDefaultLineStyleWidth(t,i),this.recordActionAfterNextUpdate(`Change ${t} stroke width to ${i}`,["annotations","defaults"])}updateAnnotations(){const{annotationData:t,annotations:i,seriesRect:o,ctx:{annotationManager:s}}=this,a=this.getAnnotationContext();if(!o||!a)return;s.updateData(t.toJson());const n=this.showAnnotations();this.toolbar.refreshButtonsEnabled(n),this.toolbar.toggleClearButtonEnabled(t.length>0&&n),i.update(t??[],void 0,r=>r.id).each((r,l)=>{if(!n){r.visible=!1,"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!1);return}"setAxisLabelVisible"in r&&r.setAxisLabelVisible(!0),this.injectDatumDependencies(l),f2(r,l,a)});for(const r of this.postUpdateFns)r();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:t,xAxis:i,yAxis:o,snap:s}=this;if(t&&i&&o)return{seriesRect:t,xAxis:{...i.context,bounds:i.bounds,labelPadding:Nd(i.layout),snapToGroup:s},yAxis:{...o.context,bounds:o.bounds,labelPadding:Nd(i.layout),snapToGroup:s}}}onHover(t){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const s=t.sourceEvent.shiftKey,a=Ms.from(t),n=Dt(a,o);i.transition("hover",{offset:a,point:n,shiftKey:s,context:o})}onClick(t){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const s=t.sourceEvent.shiftKey,a=Dt(Ms.from(t),o),n=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("click",{point:a,shiftKey:s,textInputValue:n,bbox:r})}onDoubleClick(t){const{state:i}=this;if(!this.getAnnotationContext())return;const s=Ms.from(t);i.transition("dblclick",{offset:s})}onAxisButtonClick(t,i){this.cancel(),this.reset();const o=this.getAnnotationContext();if(!this.annotationData||!o)return;const{state:s}=this;this.pushAnnotationState(Ot.Annotations);const a=i==="horizontal";if(s.transition(a?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const n=Dt(t,o);Qr(o,n)&&(s.transition("click",{point:n,shiftKey:!1}),this.update())}onResize(){const t=this.textInput.getValue(),i=this.textInput.getBBox();this.state.transition("resize",{textInputValue:t,bbox:i})}hoverTouchPreHandler(t){t.device==="touch"&&this.onHover(t)}dragMoveTouchPreHandler(t){t.device==="touch"&&this.ctx.interactionManager.isState(Ot.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(Ot.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=Ms.from(t),s=Dt(o,i),a=this.textInput.getValue(),n=this.textInput.getBBox();this.state.transition("dragStart",{context:i,offset:o,point:s,textInputValue:a,bbox:n})}onDrag(t){if(!this.ctx.interactionManager.isState(Ot.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=Ms.from(t),s=Dt(o,i),a=t.sourceEvent.shiftKey,n=this.textInput.getValue(),r=this.textInput.getBBox();this.state.transition("drag",{context:i,offset:o,point:s,shiftKey:a,textInputValue:n,bbox:r})}onDragEnd(){this.state.transition("dragEnd")}onCancel(t){const{sourceEvent:i}=t??{};i?.currentTarget===i?.target&&(this.cancel(),this.reset())}onDelete(){this.textInput.isVisible()||(this.cancel(),this.delete(),this.reset(),this.update())}onTextInput(t){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const{key:s,shiftKey:a}=t,n=this.textInput.getValue(),r=this.textInput.getBBox();i.transition("textInput",{key:s,shiftKey:a,textInputValue:n,bbox:r,context:o})}onKeyDown(t){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const{sourceEvent:s}=t,{shiftKey:a,ctrlKey:n,metaKey:r}=s,l=n||r,c=n||a;i.transition("keyDown",{shiftKey:a,context:o});const h={x:0,y:0},p=Math.max(o?.xAxis.scale.bandwidth??0,c?10:1),u=Math.max(o?.yAxis.scale.bandwidth??0,c?10:1);switch(s.key){case"ArrowDown":h.y=u;break;case"ArrowUp":h.y=-u;break;case"ArrowLeft":h.x=-p;break;case"ArrowRight":h.x=p;break;case"Escape":this.onCancel();return;case"Backspace":case"Delete":this.onDelete();return}if((h.x||h.y)&&(i.transition("translate",{translation:h}),s.stopPropagation(),s.preventDefault()),!!l)switch(s.key){case"c":i.transition("copy");return;case"x":i.transition("cut"),this.recordActionAfterNextUpdate("Cut annotation");return;case"v":i.transition("paste"),this.recordActionAfterNextUpdate("Paste annotation");return}}onKeyUp(t){const{shiftKey:i}=t.sourceEvent,o=this.getAnnotationContext();o&&(this.state.transition("keyUp",{shiftKey:i,context:o}),this.state.transition("translateEnd"))}clear(){this.cancel(),this.deleteAll(),this.reset()}reset(){this.state.transition("reset")}cancel(){this.state.transition("cancel")}delete(){this.state.transition("delete")}deleteAll(){this.state.transition("deleteAll")}deleteEphemeralAnnotations(){let t=!1;for(const[i,o]of this.annotationData.entries())Po(o)&&(this.annotationData.splice(i,1),t=!0);t&&this.recordActionAfterNextUpdate("Delete ephemeral annotations")}hideOverlays(){this.settingsDialog.hide(),this.toolbar.hideOverlays(),this.optionsToolbar.hideOverlays()}pushAnnotationState(t){this.ctx.interactionManager.pushState(t),this.ctx.tooltipManager.suppressTooltip("annotations")}popAnnotationState(t){this.ctx.interactionManager.popState(t),this.ctx.tooltipManager.unsuppressTooltip("annotations")}isAnnotationState(){return this.ctx.interactionManager.isState(Ot.Annotations)||this.ctx.interactionManager.isState(Ot.AnnotationsSelected)}update(t=m2.PRE_SCENE_RENDER){this.ctx.updateService.update(t)}};d([In],Da.prototype,"enabled",2),d([In],Da.prototype,"toolbar",2),d([In],Da.prototype,"optionsToolbar",2),d([In],Da.prototype,"axesButtons",2),d([In],Da.prototype,"snap",2);var M2=Da;import{_ModuleSupport as A2}from"ag-charts-community";var{FONT_SIZE_RATIO:wd,ThemeSymbols:at}=A2,li={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},nt={fill:at.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},As={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:wd.LARGE},fontFamily:{$ref:"fontFamily"}},Cf={...As,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},ul={...As,textAlign:"left"},Is={...As,position:"top",alignment:"center",color:{$ref:"textColor"}},Nf={...As,position:"top",alignment:"center",color:{$ref:"textColor"}},Pd={...As,fontSize:{$ref:"fontSize"},color:at.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:at.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:at.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:at.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},Od={...li,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...nt},text:{...Is},statistics:{...Pd}},I2={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}]},padding:{$ref:"chartPadding"}},L2={buttons:{$shallowSimple:[{icon:"text-annotation",tooltip:"toolbarAnnotationsTextColor",value:"text-color"},{icon:"line-color",tooltip:"toolbarAnnotationsLineColor",value:"line-color"},{icon:"fill-color",tooltip:"toolbarAnnotationsFillColor",value:"fill-color"},{tooltip:"toolbarAnnotationsTextSize",value:"text-size"},{tooltip:"toolbarAnnotationsLineStrokeWidth",value:"line-stroke-width"},{icon:"line-style-solid",tooltip:"toolbarAnnotationsLineStyle",value:"line-style-type"},{icon:"settings",tooltip:"toolbarAnnotationsSettings",value:"settings"},{icon:"unlocked",tooltip:"toolbarAnnotationsLock",ariaLabel:"toolbarAnnotationsLock",checkedOverrides:{icon:"locked",tooltip:"toolbarAnnotationsUnlock"},value:"lock"},{icon:"delete",tooltip:"toolbarAnnotationsDelete",value:"delete"}]}},T2={enabled:!1,line:{...li,handle:{...nt},text:{...Is}},"horizontal-line":{...li,handle:{...nt},axisLabel:{...Cf},text:{...Is}},"vertical-line":{...li,handle:{...nt},axisLabel:{...Cf},text:{...Is}},"disjoint-channel":{...li,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...nt},text:{...Nf}},"parallel-channel":{...li,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...nt},text:{...Nf}},"fibonacci-retracement":{...li,strokes:at.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...nt},text:{...Is,position:"center"},label:{...As,color:void 0,fontSize:{$rem:wd.SMALLER}}},"fibonacci-retracement-trend-based":{...li,strokes:at.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...nt},text:{...Is,position:"center"},label:{...As,color:void 0,fontSize:{$rem:wd.SMALLER}}},callout:{...li,...ul,color:{$ref:"textColor"},handle:{...nt},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...ul,fontWeight:700,handle:{...nt},fill:{$ref:"foregroundColor"}},note:{...ul,color:at.DEFAULT_TEXTBOX_COLOR,fill:at.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...nt},background:{fill:at.DEFAULT_TEXTBOX_FILL,stroke:at.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...ul,color:{$ref:"textColor"},handle:{...nt}},arrow:{...li,handle:{...nt},text:{...Is}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...nt,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...nt,stroke:{$ref:"foregroundColor"}}},"date-range":{...Od},"price-range":{...Od},"date-price-range":{...Od},"quick-date-price-range":{up:{...li,fill:at.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...nt},statistics:{...Pd,color:"#fff",fill:at.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...li,stroke:at.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:at.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...nt,stroke:at.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...Pd,color:"#fff",fill:at.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:I2,optionsToolbar:L2},C2={type:"root",optionsKey:"annotations",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new M2(e),themeTemplate:{annotations:T2}};import{_ModuleSupport as _d}from"ag-charts-community";import{_ModuleSupport as wf}from"ag-charts-community";import{createElement as N2}from"ag-charts-core";var{BaseProperties:w2,ObserveChanges:P2,ProxyProperty:O2,Property:Ls,calculatePlacement:_2}=wf,Ki=class extends w2{constructor(){super(),this.opacity=1,this.loadedSynchronously=!0,this.containerWidth=0,this.containerHeight=0,this.onLoad=void 0,this.onImageLoad=()=>{this.loadedSynchronously||(this.node.visible=!1,this.performLayout(this.containerWidth,this.containerHeight),this.onLoad?.())},this.imageElement=N2("img"),this.imageElement.onload=this.onImageLoad,this.node=new wf.Image(this.imageElement)}get complete(){return this.imageElement.width>0&&this.imageElement.height>0}performLayout(e,t){this.containerWidth=e,this.containerHeight=t;const i={width:e,height:t},o=_2(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...o}:{visible:!1}),o}};d([Ls],Ki.prototype,"top",2),d([Ls],Ki.prototype,"right",2),d([Ls],Ki.prototype,"bottom",2),d([Ls],Ki.prototype,"left",2),d([Ls],Ki.prototype,"width",2),d([Ls],Ki.prototype,"height",2),d([Ls],Ki.prototype,"opacity",2),d([O2("imageElement.src"),P2(e=>e.loadedSynchronously=e.complete)],Ki.prototype,"url",2);var{ActionOnSet:R2,Property:E2}=_d,Pf=class extends _d.Background{constructor(){super(...arguments),this.image=new Ki}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.updateService.update(_d.ChartUpdateType.SCENE_RENDER)}};d([E2,R2({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],Pf.prototype,"image",2);var B2={type:"root",optionsKey:"background",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new Pf(e)};import{_ModuleSupport as gl}from"ag-charts-community";import{createId as z2}from"ag-charts-core";var{Range:F2,TranslatableGroup:H2,BBox:V2,Property:Di,ZIndexMap:W2,ChartAxisDirection:G2,FillGradientDefaults:K2,FillImageDefaults:$2,FillPatternDefaults:j2,getShapeFill:Y2,InteractionState:yl}=gl,ci=class extends gl.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=z2(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.fill="#c16068",this.fillOpacity=1,this.fillGradientDefaults=new K2,this.fillPatternDefaults=new j2,this.fillImageDefaults=new $2,this.bounds=new V2(0,0,0,0),this.bandHighlightGroup=new H2({name:"bandHighlight",zIndex:W2.AXIS_BAND_HIGHLIGHT}),this.rangeNode=this.bandHighlightGroup.appendChild(new F2),this.activeAxisHighlight=void 0,this.axisCtx=e.parent,this.hideBand(),e.domManager.addEventListener("focusin",({target:a})=>{const n=a instanceof HTMLElement&&e.domManager.contains(a,"series-area");this.bandHighlightGroup.visible&&!n&&(this.hideBand(),this.ctx.updateService.update(gl.ChartUpdateType.PERFORM_LAYOUT))});const{widgets:{seriesWidget:t,seriesDragInterpreter:i},animationManager:o,eventsHub:s}=e;this.cleanup.register(e.scene.attachNode(this.bandHighlightGroup),t.addListener("mousemove",a=>this.onHoverLikeEvent(a)),t.addListener("mouseleave",()=>this.clearAllHighlight()),o.addListener("animation-start",()=>this.clearAllHighlight()),s.on("layout:complete",a=>this.layout(a)),s.on("series:focus-change",()=>this.onKeyPress()),s.on("zoom:pan-start",()=>this.clearAllHighlight()),s.on("zoom:change",()=>this.clearAllHighlight()),s.on("dom:resize",()=>this.clearAllHighlight()),s.on("axis:change",()=>this.axisChange())),i&&this.cleanup.register(i.events.on("drag-move",a=>this.onHoverLikeEvent(a)),i.events.on("click",a=>this.onClick(a)))}axisChange(){this.onHighlightChange()}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}onClick(e){e.device==="touch"&&this.onHoverLikeEvent(e)}clearAllHighlight(){this.ctx.interactionManager.isState(yl.Clickable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(yl.Default)&&this.onHighlightChange()}onHoverLikeEvent(e){const t=this.isHover(e)?yl.Clickable:yl.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&this.handleHoverHighlight(e)}handleHoverHighlight(e){if(!e)return;const{currentX:t,currentY:i}=e;this.onHighlightChange(this.axisCtx.pickBand({x:t,y:i}))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;const{position:o="left",axisId:s}=this.axisCtx,a=i.find(l=>l.id===s);if(!a)return;this.axisLayout=a,this.bounds=e.clone().grow(a.gridPadding,o);const{bandHighlightGroup:n,bounds:r}=this;n.translationX=Math.round(r.x),n.translationY=Math.round(r.y),this.updateBand()}updateBand(){const{rangeNode:e,stroke:t,strokeWidth:i,strokeOpacity:o,lineDash:s,fill:a,fillOpacity:n,fillGradientDefaults:r,fillPatternDefaults:l,fillImageDefaults:c,lineDashOffset:h,axisLayout:p}=this;p&&(e.stroke=t,e.strokeWidth=i,e.strokeOpacity=o,e.lineDash=s,e.lineDashOffset=h,e.fill=Y2(a,r,l,c),e.fillOpacity=n,e.startLine=!0,e.endLine=!0)}isVertical(){return this.axisCtx.direction===G2.X}onHighlightChange(e){this.enabled&&(this.activeAxisHighlight=e,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.updateService.update(gl.ChartUpdateType.SCENE_RENDER))}updateBandPosition(){const{rangeNode:e,bounds:t}=this,{band:i}=this.activeAxisHighlight??{};if(i==null){this.hideBand();return}let o=Math.min(...i),s=Math.max(...i);if(s-o<1){const a=(o+s)/2;o=a-.5,s=a+.5}this.isVertical()?(e.y1=0,e.y2=t.height,e.x1=o,e.x2=s,e.horizontal=!0):(e.y1=o,e.y2=s,e.x1=0,e.x2=t.width,e.horizontal=!1)}showBand(){this.updateBandPosition(),this.bandHighlightGroup.visible=!0}hideBand(){this.bandHighlightGroup.visible=!1}};d([Di],ci.prototype,"enabled",2),d([Di],ci.prototype,"stroke",2),d([Di],ci.prototype,"lineDash",2),d([Di],ci.prototype,"lineDashOffset",2),d([Di],ci.prototype,"strokeWidth",2),d([Di],ci.prototype,"strokeOpacity",2),d([Di],ci.prototype,"fill",2),d([Di],ci.prototype,"fillOpacity",2),d([Di],ci.prototype,"fillGradientDefaults",2),d([Di],ci.prototype,"fillPatternDefaults",2),d([Di],ci.prototype,"fillImageDefaults",2);var U2={type:"axis-option",optionsKey:"bandHighlight",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","ordinal-time","unit-time","grouped-category"],moduleFactory:e=>new ci(e),themeTemplate:{bandHighlight:{enabled:!1,strokeWidth:0,lineDash:[],fill:{$foregroundBackgroundMix:.05}}}};import{_ModuleSupport as Of}from"ag-charts-community";import{Logger as X2}from"ag-charts-core";var{ActionOnSet:Z2,LayoutElement:q2,Menu:Q2,Property:J2}=Of,Rd=[{label:"toolbarSeriesTypeOHLC",icon:"ohlc-series",value:"ohlc"},{label:"toolbarSeriesTypeCandles",icon:"candlestick-series",value:"candlestick"},{label:"toolbarSeriesTypeHollowCandles",icon:"hollow-candlestick-series",value:"hollow-candlestick"},{label:"toolbarSeriesTypeLine",icon:"line-series",value:"line"},{label:"toolbarSeriesTypeStepLine",icon:"step-line-series",value:"step-line"},{label:"toolbarSeriesTypeHLC",icon:"hlc-series",value:"hlc"},{label:"toolbarSeriesTypeHighLow",icon:"high-low-series",value:"high-low"}],_f=class extends Of.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menu=new Q2(this.ctx,"chart-toolbar"),this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(q2.ToolbarLeft,this.onLayoutStart.bind(this)),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t,buttonWidget:i}){this.menu.setAnchor({x:t.x+t.width+6,y:t.y}),this.menu.show(i,{items:Rd,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:o=>{this.setChartType(o.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton()}}),this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=Rd.find(i=>i.value===e)?.icon;t!=null&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.toolbar.clearActiveButton(),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(i=>X2.error(i))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return e==null||!Rd.some(t=>t.value===e)?"candlestick":e}};d([J2,Z2({changeValue(e){this.toolbar?.setHidden(!e)}})],_f.prototype,"enabled",2);var eL={type:"root",optionsKey:"chartToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new _f(e)};import{_ModuleSupport as tL}from"ag-charts-community";import{_ModuleSupport as fl,_Widget as Rf}from"ag-charts-community";import{Logger as ml,clamp as Ef,createElement as Ln,toPlainText as iL}from"ag-charts-core";import{isKeyOf as oL}from"ag-charts-core";function sL(e,t){return e==="always"?!0:e==="series-area"?t==="series-area"||t==="series-node":e===t}function Bf(e,t,i){let o=!0;if(t.type==="separator"){const s=i.at(-1);o=s!==void 0&&s.type!=="separator"}if(o&&(o=sL(t.showOn??"always",e)),o){const s=new nL(t);return i.push(s),s}}function zf(e,t,i,o){t.isVisible(i)&&Bf(e,t.builtins.items[i],o)}function aL(e,t,i,o){const{builtins:s}=t;if(oL(i,s.lists))for(const a of s.lists[i])zf(e,t,a,o);else zf(e,t,i,o)}function Ff(e,t,i,o){for(const s of i)if(typeof s=="string")aL(e,t,s,o);else{const a=Bf(e,s,o);s.items&&a&&s.items.length>0&&Ff(e,t,s.items,a.items)}o.at(-1)?.type==="separator"&&o.pop()}var nL=class{constructor(e){this.type="action",this.showOn="always",this.label="",this.iconUrl=void 0,this.enabled=!0,this.items=[],this.action=void 0,e&&this.setOptions(e),this.items=[]}setField(e,t,i){t[e]=i}setOptions(e){let t;for(t in e)e[t]!==void 0&&this.setField(t,this,e[t])}},fo="ag-charts-context-menu",{Property:Ed,ContextMenuRegistry:Tn,callWithContext:xl,getIconClassNames:rL}=fl,Bd="context-menu",Sl=class extends fl.BaseModuleInstance{constructor(e){if(super(),this.ctx=e,this.enabled=!0,this.darkTheme=!1,this.items=["defaults"],this.pickedNode=void 0,this.showEvent=void 0,this.x=0,this.y=0,this.collapsingSubMenus=0,this.menuWidget=new Rf.MenuWidget,this.interactionManager=e.interactionManager,this.element=e.domManager.addChild("canvas-overlay",Bd),this.element.classList.add(fo),this.element.style.display="none",this.element.addEventListener("contextmenu",t=>t.preventDefault()),this.element.addEventListener("focusout",({relatedTarget:t})=>{this.collapsingSubMenus>0||(t==null||t instanceof Node&&!this.element.contains(t))&&this.hide()}),this.cleanup.register(()=>this.element.remove(),()=>this.menuWidget.destroy(),e.eventsHub.on("dom:hidden",()=>this.hide()),this.menuWidget.addListener("collapse-widget",()=>this.onCollapse())),this.menuWidget.addClass(`${fo}__menu`),typeof MutationObserver<"u"){const t=new MutationObserver(()=>{this.element.contains(this.menuWidget.getElement())&&this.reposition()});t.observe(this.element,{childList:!0}),this.mutationObserver=t,this.cleanup.register(()=>t.disconnect())}this.ctx.contextMenuRegistry.builtins.items.download.action=()=>{const t=e.chartService.title;let i="image";t?.enabled&&(i=t.node.getPlainText().replace(/\.+/,"")),this.ctx.chartService.publicApi?.download({fileName:i}).catch(o=>{ml.error("Unable to download chart",o)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",t=>this.onContext(t)))}expandItemsOptions(e){const t=[];return Ff(e,this.ctx.contextMenuRegistry,this.items,t),t}onContext(e){if(!this.enabled)return;e.widgetEvent.sourceEvent.preventDefault(),this.showEvent=e.widgetEvent.sourceEvent,this.x=e.x,this.y=e.y,this.pickedNode=void 0,this.pickedLegendItem=void 0,Tn.check("series-node",e)?this.pickedNode=e.context.pickedNode:Tn.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e.showOn);t.length!==0&&this.show(e.widgetEvent,t)}show(e,t){const{sourceEvent:i}=e;this.interactionManager.pushState(fl.InteractionState.ContextMenu),this.element.style.display="block";const o=i.pointerType==="touch"?!1:void 0;o!==void 0&&this.ctx.chartService.overrideFocusVisible(o),this.createMenu(t),this.element.appendChild(this.menuWidget.getElement()),this.menuWidget.expand({sourceEvent:i,overrideFocusVisible:o})}hide(){this.menuWidget.collapse()}onCollapse(){this.interactionManager.popState(fl.InteractionState.ContextMenu),this.menuWidget.getElement().remove(),this.element.style.display="none"}onSubMenuExpand(e,t){const i=e.getBounds();e.setFocusOverride(!0),e.getElement().insertAdjacentElement("afterend",t.getElement()),t.getElement().style.position="absolute";const o=this.ctx.domManager.getBoundingClientRect(),s=e.getBoundingClientRect(),a=o.right-s.right,n=s.left-o.left,{offsetWidth:r,offsetHeight:l}=t.getElement();let c=i.y;if(o.height>l){const h=o.bottom-s.top;h=r)t.setBounds({x:i.x+i.width,y:c});else{const h=i.x-r,p=n+h;p>=0?t.setBounds({x:h,y:c}):t.setBounds({x:h-p,y:c})}}onSubMenuCollapse(e,t){e.setFocusOverride(void 0),this.collapsingSubMenus++,t.remove(),this.collapsingSubMenus--}createMenu(e){const{menuWidget:t}=this;t.clear(),t.setTabIndex(-1),this.createMenuItems(t,e)}createMenuItems(e,t){for(const i of t)switch(i.type){case"separator":{e.addSeparator().classList.add(`${fo}__divider`);break}case"action":{if(i.items.length===0){const o=new Rf.MenuItemWidget;this.initButtonElement(o,i),e.addChild(o)}else{const{subMenuButton:o,subMenu:s}=e.addSubMenu();s.addClass(`${fo}__menu`),s.addListener("expand-widget",()=>this.onSubMenuExpand(o,s)),s.addListener("collapse-widget",()=>this.onSubMenuCollapse(o,s)),this.initButtonElement(o,i),this.createMenuItems(s,i.items)}break}default:throw new Error("unhandled case")}}createButtonOnClick(e,t){return Tn.checkCallback("legend-item",e,t)?i=>{const o=i.sourceEvent;if(this.pickedLegendItem){const{seriesId:s,itemId:a,label:n}=this.pickedLegendItem,{chartService:r}=this.ctx;if(typeof a!="string"){ml.error(`unexpected itemId type: [${typeof a}] (expected [string])`);return}const c=[r.series.find(p=>p.id===s)?.properties,r],h={type:"contextmenu",seriesId:s,itemId:a,text:iL(n.text),event:o};xl(c,t,h),this.hide()}else ml.error("legend item not found")}:Tn.checkCallback("series-area",e,t)?()=>{const i=this.ctx.chartService,o={type:"seriesContextMenuAction",event:this.showEvent};xl(i,t,o),this.hide()}:Tn.checkCallback("series-node",e,t)?()=>{const{showEvent:i}=this,{chartService:o}=this.ctx,s=this.pickedNode,a=[s?.series.properties,o],n=s?.series.createNodeContextMenuActionEvent(i,s);n?xl(a,t,n):ml.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,o={type:"contextMenuEvent",event:this.showEvent};xl(i,t,o),this.hide()}}initTableCells(e){const t=Ln("div"),i=Ln("div"),o=Ln("div");return t.classList.toggle(`${fo}__icon`,!0),i.classList.toggle(`${fo}__cell`,!0),o.classList.toggle(`${fo}__cell`,!0),t.ariaHidden="true",i.role="presentation",o.ariaHidden="true",e.append(t,i,o),{cellIcon:t,cellLabel:i,cellArrow:o}}initButtonElement(e,t){e.addClass(`${fo}__item`),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),o=`${fo}__cellpadding`,{cellIcon:s,cellLabel:a,cellArrow:n}=this.initTableCells(e.getElement());if(a.textContent=i,a.classList.add(o),t.iconUrl!=null){const c=Ln("img");c.src=t.iconUrl,s.append(c),s.classList.add(o)}if(t.items.length>0){const c=Ln("span",rL("chevron-right"));n.append(c),n.classList.add(o)}const{showOn:r,action:l}=t;l!=null&&e.addListener("click",this.createButtonOnClick(r,l)),t.items.length===0&&(e.addListener("mouseleave",()=>e.setFocusOverride(!1)),e.addListener("mouseenter",()=>e.setFocusOverride(void 0)))}reposition(){let{x:e,y:t}=this;this.element.style.top="unset",this.element.style.bottom="unset";const i=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:o,offsetHeight:s}=this.element;e=Ef(0,e,i.width-o),t=Ef(0,t,i.height-s),this.element.style.left=`${e}px`,this.element.style.top=`calc(${t}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(Bd),this.ctx.domManager.removeChild("canvas-overlay",Bd)}};d([Ed],Sl.prototype,"enabled",2),d([Ed],Sl.prototype,"darkTheme",2),d([Ed],Sl.prototype,"items",2);var lL={type:"root",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],optionsKey:"contextMenu",moduleFactory:e=>new Sl(e),themeTemplate:{contextMenu:{enabled:!0,darkTheme:tL.ThemeSymbols.IS_DARK_THEME}}};import{_ModuleSupport as Ma}from"ag-charts-community";import{createId as cL,toPlainText as hL}from"ag-charts-core";function Cn(e){return typeof e?.datum=="object"?e.datum:null}import{_ModuleSupport as Hf}from"ag-charts-community";import{createId as dL,setAttribute as pL}from"ag-charts-core";var{FormatManager:uL,BaseProperties:gL,Property:Aa}=Hf,yL="ag-charts-crosshair-label",$o=class extends gL{constructor(){super(...arguments),this.enabled=!0,this.xOffset=0,this.yOffset=0,this.format=void 0,this.renderer=void 0,this._cachedFormatter=void 0}formatValue(e,t,i,o){const{formatter:s,format:a}=this,{domain:n,boundSeries:r}=o;let l;if(s!=null){const c=o.type==="number"?o.fractionDigits:void 0,h=o.type==="date"?o.unit:void 0,p=o.type==="date"?o.step:void 0;l=e(s,{value:i,domain:n,fractionDigits:c,unit:h,step:p,boundSeries:r})}if(a!=null){let c=this._cachedFormatter;(c==null||c.type!==t||c.format!==a)&&(c={type:t,format:a,formatter:uL.getFormatter(t,a)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l==null?void 0:String(l)}};d([Aa],$o.prototype,"enabled",2),d([Aa],$o.prototype,"xOffset",2),d([Aa],$o.prototype,"yOffset",2),d([Aa],$o.prototype,"formatter",2),d([Aa],$o.prototype,"format",2),d([Aa],$o.prototype,"renderer",2);var fL=class extends $o{constructor(e,t,i){super(),this.domManager=e,this.id=dL(this),this.element=e.addChild("canvas-overlay",`crosshair-label-${this.id}`),this.element.classList.add(yL),pL(this.element,"aria-hidden",!0),this.element.dataset.key=t,this.element.dataset.axisId=i}show(e){const{element:t}=this,i=e.x+this.xOffset,o=e.y+this.yOffset;t.style.top=`${Math.round(o)}px`,t.style.left=`${Math.round(i)}px`,this.toggle(!0)}setLabelHtml({html:e,styles:t}){if(e!==void 0&&(this.element.innerHTML=e),t!==void 0){const i=this.element.children[0]??this.element;Object.assign(i.style,t)}}getBBox(){const{element:e}=this;return new Hf.BBox(e.clientLeft,e.clientTop,e.clientWidth,e.clientHeight)}toggle(e){this.element.classList.toggle("ag-charts-crosshair-label--hidden",!e)}destroy(){this.domManager.removeChild("canvas-overlay",`crosshair-label-${this.id}`)}toLabelHtml(e,t){if(typeof e=="string")return{html:e,styles:{}};t=t??{};const{text:i=t.text??"",color:o=t.color,backgroundColor:s=t.backgroundColor,opacity:a=t.opacity??1}=e,n={opacity:a,"background-color":s?.toLowerCase(),color:o};return{html:`
+ ${i}
+
`,styles:n}}},{Group:mL,TranslatableGroup:xL,Line:SL,BBox:Vf,InteractionState:bl,Property:jo,ZIndexMap:Wf,ChartAxisDirection:Gf}=Ma,mo=class extends Ma.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.id=cL(this),this.enabled=!1,this.stroke="rgb(195, 195, 195)",this.lineDash=[6,3],this.lineDashOffset=0,this.strokeWidth=1,this.strokeOpacity=1,this.snap=!0,this.label=new $o,this.seriesRect=new Vf(0,0,0,0),this.bounds=new Vf(0,0,0,0),this.crosshairGroup=new xL({name:"crosshairs",zIndex:Wf.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new mL({name:`${this.id}-crosshair-lines`,zIndex:Wf.SERIES_CROSSHAIR})),this.lineGroupSelection=Ma.Selection.select(this.lineGroup,SL,!1),this.activeHighlight=void 0,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:i})=>{const o=i instanceof HTMLElement&&e.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!o&&(this.hideCrosshairs(),this.ctx.updateService.update(Ma.ChartUpdateType.PERFORM_LAYOUT))});const{seriesDragInterpreter:t}=e.widgets;this.cleanup.register(e.scene.attachNode(this.crosshairGroup),e.widgets.seriesWidget.addListener("mousemove",i=>this.onMouseHoverLike(i)),e.widgets.seriesWidget.addListener("mouseleave",()=>this.onMouseOut()),e.eventsHub.on("series:focus-change",()=>this.onKeyPress()),e.eventsHub.on("zoom:pan-start",()=>this.onMouseOut()),e.eventsHub.on("zoom:change",()=>this.onMouseOut()),e.eventsHub.on("highlight:change",i=>this.onHighlightChange(i)),e.eventsHub.on("layout:complete",i=>this.layout(i)),()=>{for(const i of Object.values(this.labels))i.destroy()}),t&&this.cleanup.register(t.events.on("drag-move",i=>this.onMouseHoverLike(i)),t.events.on("click",i=>this.onClick(i)))}layout({series:{rect:e,visible:t},axes:i}){if(!t||!i||!this.enabled)return;this.seriesRect=e;const{position:o="left",axisId:s}=this.axisCtx,a=i.find(c=>c.id===s);if(!a)return;this.axisLayout=a,this.bounds=e.clone().grow(a.gridPadding+a.seriesAreaPadding,o);const{crosshairGroup:n,bounds:r}=this;n.translationX=Math.round(r.x),n.translationY=Math.round(r.y);const l=["pointer",...this.axisCtx.seriesKeyProperties()];this.updateSelections(l),this.updateLines(),this.updateLabels(l)}updateSelections(e){this.lineGroupSelection.update(e,void 0,t=>t)}updateLabels(e){const{labels:t,ctx:i}=this;for(const o of e)this.label.enabled&&(t[o]??(t[o]=new fL(i.domManager,o,this.axisCtx.axisId))),t[o]&&this.updateLabel(t[o])}updateLabel(e){const{enabled:t,xOffset:i,yOffset:o,format:s,renderer:a}=this.label;e.enabled=t,e.xOffset=i,e.yOffset=o,e.format=s,e.renderer=a}updateLines(){const{lineGroupSelection:e,bounds:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,axisLayout:r}=this;if(!r)return;const l=this.isVertical();e.each(c=>{c.stroke=i,c.strokeWidth=o,c.strokeOpacity=s,c.lineDash=a,c.lineDashOffset=n,c.y1=0,c.y2=l?t.height:0,c.x1=0,c.x2=l?0:t.width})}isVertical(){return this.axisCtx.direction===Gf.X}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){return hL(this.axisCtx.formatScaleValue(e,"crosshair",this.label))}onClick(e){e.device==="touch"&&this.onMouseHoverLike(e)}onMouseHoverLike(e){if(!this.enabled||this.snap)return;const t=this.isHover(e)?bl.Clickable:bl.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.updateService.update(Ma.ChartUpdateType.SCENE_RENDER))}onMouseOut(){this.ctx.interactionManager.isState(bl.Clickable)&&(this.hideCrosshairs(),this.ctx.updateService.update(Ma.ChartUpdateType.SCENE_RENDER))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(bl.Default)&&this.hideCrosshairs()}onHighlightChange(e){if(!this.enabled)return;const{crosshairGroup:t,axisCtx:i}=this,{datum:o,series:s}=e.currentHighlight??{},a=o&&(s?.axes.x?.id===i.axisId||s?.axes.y?.id===i.axisId);if(this.activeHighlight=a?e.currentHighlight:void 0,!this.activeHighlight)this.hideCrosshairs();else if(this.snap){const n=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(n),t.visible=!0}}isInRange(e){return this.axisCtx.inRange(e)}updatePositions(e){const{seriesRect:t,lineGroupSelection:i}=this;i.each((o,s)=>{const a=e[s];if(!a){o.visible=!1,this.hideLabel(s);return}o.visible=!0;const{value:n,position:r}=a;let l=0,c=0;this.isVertical()?(l=r,o.x=Math.round(l)):(c=r,o.y=Math.round(c)),this.label.enabled?this.showLabel(l+t.x,c+t.y,n,s):this.hideLabel(s)})}getData(e){const{axisCtx:t}=this,i="pointer",{xKey:o="",yKey:s=""}=this.activeHighlight??{},{currentX:a,currentY:n}=e,r=Cn(this.activeHighlight),l=this.isVertical(),c=l?a:n;let h=r?.[l?o:s]??"";return t.continuous&&(h=t.scaleInvert(c)),{[i]:{position:c,value:h}}}getActiveHighlightData(e){const{axisCtx:t}=this,{series:i,xKey:o="",aggregatedValue:s,cumulativeValue:a,midPoint:n}=e,r=Cn(e),l=i.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=i.axes[t.direction]?.id===t.axisId,p=l.includes("yKey")&&h,u=l.includes("xKey")&&h,g=s??a;if(p&&g!==void 0){const f=t.scale.convert(g)+c;return this.isInRange(f)?{yKey:{value:g,position:f}}:{}}if(u){const f=(this.isVertical()?n?.x:n?.y)??0,x=t.continuous?t.scaleInvert(f):r?.[o];return this.isInRange(f)?{xKey:{value:x,position:f}}:{}}const y={};for(const f of l){const x=i.properties[f],S=r?.[x],v=t.scale.convert(S)+c;this.isInRange(v)&&(y[f]={value:S,position:v})}return y}getLabelHtml(e,t){const i=this.axisLayout?.label?.fractionDigits??0,o={text:this.formatValue(e)};return this.label.renderer?t.toLabelHtml(this.label.renderer({value:e,fractionDigits:i}),o):t.toLabelHtml(o)}showLabel(e,t,i,o){if(!this.axisLayout)return;const{bounds:s}=this,a=this.labels[o],n=this.getLabelHtml(i,a);a.setLabelHtml(n);const{width:r,height:l}=a.getBBox(),c=this.axisCtx.position;let h=this.axisLayout.label.spacing+this.axisLayout.tickSize;this.axisCtx.direction===Gf.X?(h-=4,a.show({x:e-r/2,y:c==="bottom"?s.y+s.height+h:s.y-l-h})):(h-=8,a.show({x:c==="right"?s.x+s.width+h:s.x-r-h,y:t-l/2}))}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};d([jo],mo.prototype,"enabled",2),d([jo],mo.prototype,"stroke",2),d([jo],mo.prototype,"lineDash",2),d([jo],mo.prototype,"lineDashOffset",2),d([jo],mo.prototype,"strokeWidth",2),d([jo],mo.prototype,"strokeOpacity",2),d([jo],mo.prototype,"snap",2),d([jo],mo.prototype,"label",2);var bL={type:"axis-option",optionsKey:"crosshair",packageType:"enterprise",chartTypes:["cartesian"],axisTypes:["category","time","unit-time","ordinal-time","number","log"],moduleFactory:e=>new mo(e),themeTemplate:{crosshair:{snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}}}};import{_ModuleSupport as Kf}from"ag-charts-community";var{ActionOnSet:Nn,Property:$f}=Kf,Ia=class extends Kf.BaseModuleInstance{constructor(e){super(),this.enabled=!1,this.getData=()=>Promise.resolve(),this.dataService=e.dataService}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};d([Nn({newValue(e){this.updateCallback(e,this.getData)}}),$f],Ia.prototype,"enabled",2),d([Nn({newValue(e){this.updateCallback(this.enabled,e)}}),$f],Ia.prototype,"getData",2),d([Nn({newValue(e){this.dataService.requestThrottle=e}})],Ia.prototype,"requestThrottle",2),d([Nn({newValue(e){this.dataService.dispatchThrottle=e}})],Ia.prototype,"updateThrottle",2),d([Nn({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],Ia.prototype,"updateDuringInteraction",2);var vL={type:"root",optionsKey:"dataSource",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new Ia(e),themeTemplate:{dataSource:{enabled:!1}}};import{AgErrorBarSupportedSeriesTypes as kL}from"ag-charts-community";import{AgErrorBarSupportedSeriesTypes as jf,_ModuleSupport as zd}from"ag-charts-community";import{Logger as DL,isDefined as _t}from"ag-charts-core";import{_ModuleSupport as wn}from"ag-charts-community";var{nearestSquared:ML,nearestSquaredInContainer:AL,partialAssign:IL,mergeDefaults:Yf,BBox:Yo}=wn,LL=class{constructor(e){this.components=e,this.union=Yo.merge(e)}containsPoint(e,t){if(!this.union.containsPoint(e,t))return!1;for(const i of this.components)if(i.containsPoint(e,t))return!0;return!1}},TL=class extends wn.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new wn.Path,this.capsPath=new wn.Path,this.bboxes=new LL([]),this.append([this.whiskerPath,this.capsPath])}get datum(){return this._datum}set datum(e){this._datum=e}calculateCapLength(e,t){const{lengthRatio:i=1,length:o}=e,{lengthRatioMultiplier:s,lengthMax:a}=t,n=o??i*s;return Math.min(n,a)}getItemStylerParams(e,t,i,o){const{datum:s}=this;if(s==null||e.itemStyler==null)return;const{xLowerKey:a,xUpperKey:n,yLowerKey:r,yUpperKey:l}=e;return{...t,datum:s.datum,seriesId:s.series.id,xKey:s.xKey,yKey:s.yKey,xLowerKey:a,xUpperKey:n,yLowerKey:r,yUpperKey:l,highlighted:i,highlightState:o}}formatStyles(e,t,i,o,s){let{cap:a,...n}=e;const r=this.getItemStylerParams(t,e,o,s);if(r!=null&&t.itemStyler!=null){const l=i.callWithContext(t.itemStyler,r);n=Yf(l,n),a=Yf(l?.cap,l,a)}return{whiskerStyle:n,capsStyle:a}}applyStyling(e,t){IL(["visible","stroke","strokeWidth","strokeOpacity","lineDash","lineDashOffset"],e,t)}update(e,t,i,o,s){if(this.datum===void 0)return;const{whiskerStyle:a,capsStyle:n}=this.formatStyles(e,t,i,o,s),{xBar:r,yBar:l,capDefaults:c}=this.datum,h=this.whiskerPath;this.applyStyling(h,a),h.path.clear(!0),l!==void 0&&(h.path.moveTo(l.lowerPoint.x,l.lowerPoint.y),h.path.lineTo(l.upperPoint.x,l.upperPoint.y)),r!==void 0&&(h.path.moveTo(r.lowerPoint.x,r.lowerPoint.y),h.path.lineTo(r.upperPoint.x,r.upperPoint.y)),h.path.closePath(),this.capLength=this.calculateCapLength(n??{},c);const p=this.capLength/2,u=this.capsPath;this.applyStyling(u,n),u.path.clear(!0),l!==void 0&&(u.path.moveTo(l.lowerPoint.x-p,l.lowerPoint.y),u.path.lineTo(l.lowerPoint.x+p,l.lowerPoint.y),u.path.moveTo(l.upperPoint.x-p,l.upperPoint.y),u.path.lineTo(l.upperPoint.x+p,l.upperPoint.y)),r!==void 0&&(u.path.moveTo(r.lowerPoint.x,r.lowerPoint.y-p),u.path.lineTo(r.lowerPoint.x,r.lowerPoint.y+p),u.path.moveTo(r.upperPoint.x,r.upperPoint.y-p),u.path.lineTo(r.upperPoint.x,r.upperPoint.y+p)),u.path.closePath()}updateBBoxes(){const{capLength:e,whiskerPath:t,capsPath:i}=this,{yBar:o,xBar:s}=this.datum??{},a=e/2,n=[];if(o!==void 0){const r=o.lowerPoint.y-o.upperPoint.y;n.push(new Yo(o.lowerPoint.x,o.upperPoint.y,t.strokeWidth,r),new Yo(o.lowerPoint.x-a,o.lowerPoint.y,e,i.strokeWidth),new Yo(o.upperPoint.x-a,o.upperPoint.y,e,i.strokeWidth))}if(s!==void 0){const r=s.upperPoint.x-s.lowerPoint.x;n.push(new Yo(s.lowerPoint.x,s.upperPoint.y,r,t.strokeWidth),new Yo(s.lowerPoint.x,s.lowerPoint.y-a,i.strokeWidth,e),new Yo(s.upperPoint.x,s.upperPoint.y-a,i.strokeWidth,e))}this.bboxes.components=n,this.bboxes.union=Yo.merge(n)}containsPoint(e,t){return this.bboxes.containsPoint(e,t)}pickNode(e,t){return this.containsPoint(e,t)?this:void 0}nearestSquared(e,t,i){const{bboxes:o}=this;if(o.union.distanceSquared(e,t)>i)return{nearest:void 0,distanceSquared:1/0};const{distanceSquared:s}=ML(e,t,o.components);return{nearest:this,distanceSquared:s}}},CL=class extends wn.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:o}=AL(e,t,{children:this.children()});if(i!==void 0&&!Number.isNaN(o))return{datum:i.datum,distanceSquared:o}}};import{_ModuleSupport as NL}from"ag-charts-community";var{BaseProperties:Uf,Property:Se}=NL,xo=class extends Uf{};d([Se],xo.prototype,"visible",2),d([Se],xo.prototype,"stroke",2),d([Se],xo.prototype,"strokeWidth",2),d([Se],xo.prototype,"strokeOpacity",2),d([Se],xo.prototype,"lineDash",2),d([Se],xo.prototype,"lineDashOffset",2),d([Se],xo.prototype,"length",2),d([Se],xo.prototype,"lengthRatio",2);var rt=class extends Uf{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new xo}};d([Se],rt.prototype,"yLowerKey",2),d([Se],rt.prototype,"yLowerName",2),d([Se],rt.prototype,"yUpperKey",2),d([Se],rt.prototype,"yUpperName",2),d([Se],rt.prototype,"xLowerKey",2),d([Se],rt.prototype,"xLowerName",2),d([Se],rt.prototype,"xUpperKey",2),d([Se],rt.prototype,"xUpperName",2),d([Se],rt.prototype,"visible",2),d([Se],rt.prototype,"stroke",2),d([Se],rt.prototype,"strokeWidth",2),d([Se],rt.prototype,"strokeOpacity",2),d([Se],rt.prototype,"lineDash",2),d([Se],rt.prototype,"lineDashOffset",2),d([Se],rt.prototype,"itemStyler",2),d([Se],rt.prototype,"cap",2);var{fixNumericExtent:wL,groupAccumulativeValueProperty:PL,mergeDefaults:OL,valueProperty:vl,ChartAxisDirection:Pn}=zd;function _L(e){for(const t of jf)if(t===e.series.type)return e.series;throw new Error(`AG Charts - unsupported series type '${e.series.type}', error bars supported series types: ${jf.join(", ")}`)}var RL=class mr extends zd.BaseModuleInstance{constructor(t){super(),this.properties=new rt;const i=_L(t),{annotationGroup:o,annotationSelections:s}=i;this.cartesianSeries=i,this.groupNode=new CL({name:`${o.id}-errorBars`}),o.appendChild(this.groupNode),this.selection=zd.Selection.select(this.groupNode,()=>this.errorBarFactory()),s.add(this.selection),i.addEventListener("seriesVisibilityChange",a=>this.onToggleSeriesItem(a)),this.cleanup.register(i.events.on("data-processed",a=>this.onDataProcessed(a)),i.events.on("data-update",a=>this.onDataUpdate(a)),t.eventsHub.on("highlight:change",a=>this.onHighlightChange(a)),()=>this.groupNode.remove(),()=>s.delete(this.selection))}hasErrorBars(){const{xLowerKey:t,xUpperKey:i,yLowerKey:o,yUpperKey:s}=this.properties;return _t(t)&&_t(i)||_t(o)&&_t(s)}isStacked(){const t=this.cartesianSeries.seriesGrouping?.stackCount;return t==null?!1:t>0}getUnstackPropertyDefinition(t){const i=[],{xLowerKey:o,xUpperKey:s,yLowerKey:a,yUpperKey:n,xErrorsID:r,yErrorsID:l}=this.getMaybeFlippedKeys(),{xScaleType:c,yScaleType:h}=t;return a!=null&&n!=null&&i.push(vl(a,h,{id:`${l}-lower`}),vl(n,h,{id:`${l}-upper`})),o!=null&&s!=null&&i.push(vl(o,c,{id:`${r}-lower`}),vl(s,c,{id:`${r}-upper`})),i}getStackPropertyDefinition(t){const i=[],{cartesianSeries:o}=this,{xLowerKey:s,xUpperKey:a,yLowerKey:n,yUpperKey:r,xErrorsID:l,yErrorsID:c}=this.getMaybeFlippedKeys(),{xScaleType:h,yScaleType:p}=t,u=o.seriesGrouping?.groupIndex??o.id,g={invalidValue:null,missingValue:0,separateNegative:!0,...o.visible?{}:{forceValue:0}},y=(x,S,v,m)=>PL(x,"normal",{id:`${S}-${v}`,groupId:`errorGroup-${u}-${v}`,...g},m),f=(x,S,v,m)=>{i.push(...y(x,v,"lower",m),...y(S,v,"upper",m))};return n!=null&&r!=null&&f(n,r,c,p),s!=null&&a!=null&&f(s,a,l,h),i}getPropertyDefinitions(t){return this.isStacked()?this.getStackPropertyDefinition(t):this.getUnstackPropertyDefinition(t)}onDataProcessed(t){this.dataModel=t.dataModel,this.processedData=t.processedData}getDomain(t){const{xLowerKey:i,xUpperKey:o,xErrorsID:s,yLowerKey:a,yUpperKey:n,yErrorsID:r}=this.getMaybeFlippedKeys();if(t===Pn.X?_t(i)&&_t(o):_t(a)&&_t(n)){const{dataModel:c,processedData:h,cartesianSeries:p}=this;if(c!=null&&h!=null){const u={x:s,y:r}[t],g=c.getDomain(p,`${u}-lower`,"value",h),y=c.getDomain(p,`${u}-upper`,"value",h),f=[Math.min(...g,...y),Math.max(...g,...y)];return wL(f)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,_t(t.dataModel)&&_t(t.processedData)&&(this.createNodeData(),this.update())}getNodeData(){return this.hasErrorBars()?this.cartesianSeries.contextNodeData?.nodeData:void 0}createNodeData(){const t=this.getNodeData(),i=this.cartesianSeries.axes[Pn.X]?.scale,o=this.cartesianSeries.axes[Pn.Y]?.scale;if(!(!i||!o||!t))for(let s=0;sthis.updateNode(i,o,s)))}updateNode(t,i,o){t.datum=i,t.update(this.getDefaultStyle(),this.properties,this.cartesianSeries,!1,"none"),t.updateBBoxes()}pickNodeExact(t){const{x:i,y:o}=t,s=this.groupNode.pickNode(i,o);if(s!=null)return{datum:s.datum,distanceSquared:0}}pickNodeNearest(t){return this.groupNode.nearestSquared(t.x,t.y)}pickNodeMainAxisFirst(t,i){let o,s=[1/0,1/0];const a=[t.x,t.y];i===Pn.Y&&a.reverse();for(const n of this.groupNode.children()){const r=n.getBBox(),l=[r.x+r.width/2,r.y+r.height/2];i===Pn.Y&&l.reverse();const c=[];for(let h=0;hnew RL(e),themeTemplate:EL};import{_ModuleSupport as kl}from"ag-charts-community";var{ZIndexMap:zL,ActionOnSet:FL,Property:Fd,ProxyPropertyOnWrite:Xf}=kl,Dl=class extends kl.Background{constructor(){super(...arguments),this.image=new Ki,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new kl.Group({name:"foreground",zIndex:zL.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart;let o={x:0,y:0,width:t,height:i};this.image&&(o=this.image.performLayout(t,i)),this.text&&this.updateTextNode(o)}onImageLoad(){this.ctx.updateService.update(kl.ChartUpdateType.SCENE_RENDER)}updateTextNode(e){const{textNode:t}=this;t.fontWeight="bold",t.fontFamily="Impact, sans-serif",t.fontSize=19,t.opacity=.7,t.fill="#9b9b9b",t.textBaseline="top";const i=this.textNode.getBBox(),o=10;t.x=e.x+e.width/2-i.width/2,t.y=e.y+e.height+o}};d([Fd,FL({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],Dl.prototype,"image",2),d([Fd,Xf("rectNode","fill")],Dl.prototype,"fill",2),d([Fd,Xf("rectNode","fillOpacity")],Dl.prototype,"fillOpacity",2);var HL={type:"root",optionsKey:"foreground",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],moduleFactory:e=>new Dl(e)};import{_ModuleSupport as Hd}from"ag-charts-community";import{Logger as VL,clamp as Vd}from"ag-charts-core";import{_ModuleSupport as Wd}from"ag-charts-community";import{Logger as Zf,calcLineHeight as WL}from"ag-charts-core";import{_ModuleSupport as GL}from"ag-charts-community";var{TranslatableGroup:KL,SceneChangeDetection:qf}=GL,Gd=class extends KL{constructor(){super(...arguments),this.inset=0,this.cornerRadius=0}applyClip(e,t){const{cornerRadius:i,inset:o}=this,{x:s,y:a,width:n,height:r}=t,l=new Path2D;l.roundRect(s+o,a+o,n-2*o,r-2*o,i),e.clip(l)}};d([qf()],Gd.prototype,"inset",2),d([qf()],Gd.prototype,"cornerRadius",2);var{Property:Kd,ZIndexMap:Ts,ActionOnSet:Qf,CategoryAxis:$L,Padding:jL,Group:Cs,BBox:Jf,ProxyProperty:em,stackCartesianSeries:YL}=Wd,$d=class{constructor(){this.top=0,this.bottom=0}};d([Kd],$d.prototype,"top",2),d([Kd],$d.prototype,"bottom",2);var La=class extends Wd.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new $d,this.root=new Cs({name:"root"}),this.seriesRoot=this.root.appendChild(new Gd({name:"Series-root",zIndex:Ts.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Cs({name:"Axes-Grids",zIndex:Ts.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Cs({name:"Axes-Grids",zIndex:Ts.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Cs({name:"Axes-Labels",zIndex:Ts.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Cs({name:"Axes-Crosslines-Range",zIndex:Ts.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Cs({name:"Axes-Crosslines-Line",zIndex:Ts.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Cs({name:"Axes-Crosslines-Label",zIndex:Ts.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=[],this.series=[]}destroy(){if(!this._destroyed){this.destroySeries(this.series);for(const e of this.axes)e.destroy();this.axes=[],this._destroyed=!0}}onSeriesChange(e,t){const i=t?.filter(o=>!e.includes(o))??[];this.destroySeries(i);for(const o of e)t?.includes(o)||(o.attachSeries(this.seriesRoot,this.seriesRoot,void 0),o.chart={},Object.defineProperty(o.chart,"mode",{get:()=>"standalone"}),Object.defineProperty(o.chart,"isMiniChart",{get:()=>!0}),Object.defineProperty(o.chart,"seriesRect",{get:()=>this.seriesRect}),o.resetAnimation(this.miniChartAnimationPhase==="initial"?"initial":"disabled"));this.seriesRect=void 0}destroySeries(e){if(e)for(const t of e)t.destroy(),t.detachSeries(this.seriesRoot,this.seriesRoot,void 0),t.chart=void 0}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(t=>t.axes[e.direction]===e)}assignAxesToSeries(){const e={};for(const t of this.axes){const i=t.direction;(e[i]??(e[i]=[])).push(t)}for(const t of this.series)for(const i of t.directions){const o=e[i];if(!o){Zf.warnOnce(`no available axis for direction [${i}]; check series and axes configuration.`);continue}const s=t.getKeys(i),a=this.findMatchingAxis(o,s);if(!a){Zf.warnOnce(`no matching axis for direction [${i}] and keys [${s}]; check series and axes configuration.`);continue}t.axes[i]=a}}findMatchingAxis(e,t){for(const i of e){if(!i.keys.length)return i;if(t){for(const o of t)if(i.keys.includes(o))return i}}}updateData(e){for(const t of this.series)t.setChartData(e);this.miniChartAnimationPhase==="initial"&&this.ctx.animationManager.onBatchStop(()=>{this.miniChartAnimationPhase="ready";for(const t of this.series)t.resetAnimation("disabled")})}async processData(e){this.series.some(t=>t.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes()),await Promise.all(this.series.map(async t=>(t.resetDatumCallbackCache(),t.processData(e))));for(const t of this.axes)t.processData()}computeAxisPadding(){const e=new jL;if(!this.enabled)return e;for(const{position:t,thickness:i,line:o,label:s}of this.axes){if(t==null)continue;let a;i?a=i:a=(o.enabled?o.width:0)+(s.enabled?WL(s.fontSize??0)+s.spacing:0),e[t]=Math.ceil(a)}return e}async layout(e,t){var i;const{padding:o}=this,s=this.seriesRect!=null,a=new Jf(0,0,e,t-(o.top+o.bottom)),n=this.seriesRect==null||this.seriesRect.width!==e||this.seriesRect.height!==t;this.seriesRect=a,this.seriesRoot.translationY=o.top,this.seriesRoot.setClipRectCanvasSpace(new Jf(0,-o.top,e,t));for(const r of this.axes){const{position:l="left"}=r;switch(l){case"top":case"bottom":r.range=[0,a.width],r.gridLength=a.height;break;case"right":case"left":{const c=r instanceof $L;r.range=c?[0,a.height]:[a.height,0],r.gridLength=a.width;break}}if(r.gridPadding=0,r.translation.x=0,r.translation.y=0,l==="right"?r.translation.x=e:l==="bottom"&&(r.translation.y=t),s||r.resetAnimation("initial"),r.crossLines)for(const c of r.crossLines)c instanceof Wd.CartesianCrossLine&&(c.position=r.position??"top",(i=c.label).parallel??(i.parallel=r.label?.parallel));r.calculateLayout(),r.update()}n&&YL(this.series),await Promise.all(this.series.map(async r=>r.update({seriesRect:a})))}};d([Kd],La.prototype,"enabled",2),d([em(["seriesRoot","inset"])],La.prototype,"inset",2),d([em(["seriesRoot","cornerRadius"])],La.prototype,"cornerRadius",2),d([Qf({changeValue(e,t=[]){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const o of t)e.includes(o)||(o.detachAxis(),o.destroy());for(const o of e)t?.includes(o)||o.attachAxis(i)}})],La.prototype,"axes",2),d([Qf({changeValue(e,t){this.onSeriesChange(e,t)}})],La.prototype,"series",2);import{_ModuleSupport as UL}from"ag-charts-community";import{clamp as XL}from"ag-charts-core";var{SliderWidget:tm}=UL,ZL=class{constructor(e,t){this.ctx=e,this.sliderHandlers=t,this._min=0,this._max=1,this.minRange=.001,this.dragStartX=0,this.ctx=e,this.toolbar=e.proxyInteractionService.createProxyContainer({type:"toolbar",domManagerId:"navigator-toolbar",classList:["ag-charts-proxy-navigator-toolbar"],orientation:"vertical",ariaLabel:{id:"ariaLabelNavigator"}}),this.sliders=[e.proxyInteractionService.createProxyElement({type:"slider",domIndex:1,ariaLabel:{id:"ariaLabelNavigatorMinimum"},parent:this.toolbar,cursor:"ew-resize"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:-1/0,ariaLabel:{id:"ariaLabelNavigatorRange"},parent:this.toolbar,cursor:"grab"}),e.proxyInteractionService.createProxyElement({type:"slider",domIndex:2,ariaLabel:{id:"ariaLabelNavigatorMaximum"},parent:this.toolbar,cursor:"ew-resize"})];for(const[i,o]of["min","pan","max"].entries()){const s=this.sliders[i];s.step=tm.STEP_HUNDRETH,s.keyboardStep=tm.STEP_ONE,s.orientation="horizontal",s.setPreventsDefault(!1),s.addListener("drag-start",a=>this.onDragStart(i,a,o)),s.addListener("drag-move",a=>this.onDrag(s,a,o)),s.addListener("drag-end",()=>this.updateSliderRatios()),s.addListener("contextmenu",a=>this.onContextMenu(s,a))}this.sliders[0].addListener("change",()=>this.onMinSliderChange()),this.sliders[1].addListener("change",()=>this.onPanSliderChange()),this.sliders[2].addListener("change",()=>this.onMaxSliderChange()),this.updateSliderRatios(),this.updateVisibility(!1)}destroy(){this.toolbar.destroy()}updateVisibility(e){this.toolbar.setHidden(!e)}updateZoom(){const{_min:e,_max:t}=this;if(!(e==null||t==null))return this.ctx.zoomManager.updateZoom("navigator",{x:{min:e,max:t}})}updateBounds(e){this.toolbar.setBounds(e)}updateSliderBounds(e,t){this.sliders[e].setBounds(t)}updateMinMax(e,t){this._min=e,this._max=t,this.updateSliderRatios()}updateSliderRatios(){let{_min:e,_max:t}=this;e=Math.round(e*100)/100,t=Math.round(t*100)/100;const i=this.ctx.localeManager.t("ariaValuePanRange",{min:e,max:t});this.sliders[0].setValueRatio(e),this.sliders[1].setValueRatio(e,{ariaValueText:i}),this.sliders[2].setValueRatio(t)}toCanvasOffsets(e){return{offsetX:this.dragStartX+e.originDeltaX}}moveToFront(e){if(e===1)return;const t=this.sliders[e],i=this.sliders[2-e];this.toolbar.moveChild(i,t.domIndex-1)}onDragStart(e,t,i){const o=this.sliders[e],s=this.toolbar.cssLeft(),a=o.cssLeft();this.dragStartX=s+a+t.offsetX,this.moveToFront(e),t.sourceEvent.preventDefault(),this.sliderHandlers.onDragStart(i,this.toCanvasOffsets(t))}onDrag(e,t,i){t.sourceEvent.preventDefault(),this.sliderHandlers.onDrag(i,this.toCanvasOffsets(t))}onContextMenu(e,t){const{offsetX:i,offsetY:o}=t,{x:s,y:a}=this.toolbar.getBounds(),{x:n,y:r}=e.getBounds(),l=i+s+n,c=o+a+r;this.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:t,canvasX:l,canvasY:c},void 0)}onPanSliderChange(){const e=this.sliders[1].getValueRatio(),t=this._max-this._min;this._min=XL(0,e,1-t),this._max=this._min+t,this.updateZoom()}onMinSliderChange(){this._min=this.sliders[0].clampValueRatio(0,this._max-this.minRange),this.updateZoom()}onMaxSliderChange(){this._max=this.sliders[2].clampValueRatio(this._min+this.minRange,1),this.updateZoom()}};import{_ModuleSupport as im}from"ag-charts-community";var{Property:Ml,SceneChangeDetection:Al,BBox:qL,ExtendedPath2D:QL}=im,Uo=class extends im.Path{constructor(){super(...arguments),this.zIndex=3,this.centerX=0,this.centerY=0,this.width=8,this.height=16,this.cornerRadius=4,this.grip=!0,this.gripPath=new QL}setCenter(e,t){this.dirtyPath=!0,(this.centerX!==e||this.centerY!==t)&&(this.centerX=e,this.centerY=t,this.markDirty("center"))}static align(e,t,i,o,s,a,n,r,l){const c=e.align(i+s*n)+l,h=c+e.align(i+s*n,s*(r-n))-2*l,p=e.align(o+a/2);e.setCenter(c,p),t.setCenter(h,p)}computeBBox(){const{centerX:e,centerY:t,width:i,height:o}=this,s=e-i/2,a=t-o/2;return new qL(s,a,i,o)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}updatePath(){const{centerX:e,centerY:t,path:i,gripPath:o,strokeWidth:s,cornerRadius:a,grip:n}=this,r=s/2,l=this.layerManager?.canvas?.pixelRatio??1;i.clear(),o.clear();const c=Math.floor(this.width/2*l)/l,h=Math.floor(this.height/2*l)/l;i.roundRect(e-c+r,t-h+r,2*(c-r),2*(h-r),a);const p=3;if(n)for(let u=-.5;u<=.5;u+=1)for(let g=-1;g<=1;g+=1)o.arc(e+u*p,t+g*p,1,0,2*Math.PI),o.closePath()}renderFill(e,t){const{stroke:i}=this;super.renderFill(e,t),e.fillStyle=typeof i=="string"?i:"black",e.fill(this.gripPath.getPath2D())}};Uo.className="RangeHandle",d([Ml,Al()],Uo.prototype,"width",2),d([Ml,Al()],Uo.prototype,"height",2),d([Ml,Al()],Uo.prototype,"cornerRadius",2),d([Ml,Al()],Uo.prototype,"grip",2);import{_ModuleSupport as JL}from"ag-charts-community";var{Path:eT,BBox:jd,ExtendedPath2D:tT,clippedRoundRect:iT,Property:oT,SceneChangeDetection:sT}=JL,Yd=class extends eT{constructor(){super(...arguments),this.cornerRadius=4,this.zIndex=2,this.x=0,this.y=0,this.width=200,this.height=30,this.min=0,this.max=1,this.visiblePath=new tT}layout(e,t,i,o,s,a){s=Number.isNaN(s)?this.min:s,a=Number.isNaN(a)?this.max:a,(e!==this.x||t!==this.y||i!==this.width||this.height!==o||s!==this.min||a!==this.max)&&(this.x=e,this.y=t,this.width=i,this.height=o,this.min=s,this.max=a,this.dirtyPath=!0,this.markDirty("RangeMask.layout"))}computeBBox(){const{x:e,y:t,width:i,height:o}=this;return new jd(e,t,i,o)}computeVisibleRangeBBox(){const{x:e,y:t,width:i,height:o,min:s,max:a}=this,n=e+i*s,r=e+i*a;return new jd(n,t,r-n,o)}updatePath(){const{path:e,visiblePath:t,x:i,y:o,width:s,height:a,min:n,max:r,strokeWidth:l,cornerRadius:c}=this,h=l/2;e.clear(),t.clear();const p=this.align(i)+h,u=this.align(o)+h,g=this.align(i,s)-2*h,y=this.align(o,a)-2*h,f=this.align(i+s*n)+h,x=f+this.align(i+s*n,s*(r-n))-2*h,S={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},v=(m,b,k)=>{if(k-b<1)return;const A=new jd(b,u,k-b,y);iT(m,p,u,g,y,S,A)};v(e,p,f),v(e,x,g+p),v(t,f,x)}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};Yd.className="RangeMask",d([oT,sT()],Yd.prototype,"cornerRadius",2);import{_ModuleSupport as Il}from"ag-charts-community";var aT=class extends Il.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:Il.ZIndexMap.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new Il.TranslatableGroup({name:"navigator-background",zIndex:1})),this.append(e)}layout(e,t,i,o,s,a){this.x=e,this.y=t,this.width=i,this.height=o,this.lOffset=s,this.rOffset=a,this.background.translationX=e,this.background.translationY=t,this.markDirty("RangeSelector")}updateBackground(e,t){e?.remove(),t!=null&&this.background.appendChild(t),this.markDirty("RangeSelector")}computeBBox(){const{x:e,y:t,width:i,height:o,lOffset:s,rOffset:a}=this;return new Il.BBox(e-s,t,i+(s+a),o)}},{BaseModuleInstance:nT,ObserveChanges:Ud,Property:Ll}=Hd,Ta=class extends nT{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new Yd,this.minHandle=new Uo,this.maxHandle=new Uo,this.maskVisibleRange={id:"navigator-mask-visible-range",getBBox:()=>this.mask.computeVisibleRangeBBox(),toCanvasBBox:()=>this.mask.computeVisibleRangeBBox(),fromCanvasPoint:(t,i)=>({x:t,y:i})},this.height=30,this.cornerRadius=0,this.spacing=10,this.x=0,this.y=0,this.width=0,this.rangeSelector=new aT([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(e.scene.attachNode(this.rangeSelector),e.eventsHub.on("locale:change",()=>this.updateZoom()),e.layoutManager.registerElement(Hd.LayoutElement.Navigator,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change",t=>this.onZoomChange(t))),this.domProxy=new ZL(e,this),this.updateGroupVisibility(),this.miniChart=new La(e)}updateBackground(e,t){this.rangeSelector?.updateBackground(e,t)}updateGroupVisibility(){const{enabled:e}=this;this.rangeSelector==null||e===this.rangeSelector.visible||(this.rangeSelector.visible=e,this.domProxy.updateVisibility(e),e?this.updateZoom():this.ctx.zoomManager.updateZoom("navigator"))}onLayoutStart(e){if(this.enabled){const{layoutBox:t}=e,i=this.height+this.spacing;t.shrink(i,"bottom"),this.y=t.y+t.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.layoutBox.shrink(t+i,"bottom"),this.y-=i,this.miniChart.inset=this.mask.strokeWidth/2,this.miniChart.cornerRadius=this.mask.cornerRadius}}onLayoutComplete(e){const{x:t,width:i}=e.series.rect,{y:o,height:s}=this;if(this.domProxy.updateVisibility(this.enabled),this.enabled){const{_min:a,_max:n}=this.domProxy;this.layoutNodes(t,o,i,s,a,n),this.domProxy.updateBounds({x:t,y:o,width:i,height:s})}this.x=t,this.width=i,this.miniChart?.layout(i,s).catch(a=>VL.error(a))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(Hd.InteractionState.ZoomDraggable)}onDragStart(e,{offsetX:t}){this.canDrag()&&(e==="pan"&&(this.panStart=(t-this.x)/this.width-this.domProxy._min),this.ctx.zoomManager.fireZoomPanStartEvent("navigator"))}onDrag(e,{offsetX:t}){if(!this.canDrag())return;const{panStart:i,x:o,width:s}=this,{minRange:a}=this.domProxy;let{_min:n,_max:r}=this.domProxy;const l=(t-o)/s;if(e==="min")n=Vd(0,l,r-a);else if(e==="max")r=Vd(n+a,l,1);else if(e==="pan"&&i!=null){const c=r-n;n=Vd(0,l-i,1-c),r=n+c}this.domProxy._min=n,this.domProxy._max=r,this.updateZoom()}onZoomChange(e){const{x:t}=e;if(!t)return;const{x:i,y:o,width:s,height:a}=this,{min:n,max:r}=t;this.domProxy.updateMinMax(n,r),this.layoutNodes(i,o,s,a,n,r)}layoutNodes(e,t,i,o,s,a){const{rangeSelector:n,mask:r,minHandle:l,maxHandle:c}=this;r.layout(e,t,i,o,s,a),n.layout(e,t,i,o,l.width/2,c.width/2),Uo.align(l,c,e,t,i,o,s,a,r.strokeWidth/2),s+(a-s)/2<.5?(l.zIndex=3,c.zIndex=4):(l.zIndex=4,c.zIndex=3);for(const[h,p]of[l,this.maskVisibleRange,c].entries()){const u=p.getBBox(),g={x:u.x-e,y:u.y-t,height:u.height,width:u.width};this.domProxy.updateSliderBounds(h,g)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}updateData(e){return this.miniChart?.updateData(e)}async processData(e){if(this.miniChart)return this.miniChart?.processData(e)}};d([Ud((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],Ta.prototype,"miniChart",2),d([Ll,Ud((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],Ta.prototype,"enabled",2),d([Ll],Ta.prototype,"height",2),d([Ll,Ud((e,t)=>{e.mask.cornerRadius=t})],Ta.prototype,"cornerRadius",2),d([Ll],Ta.prototype,"spacing",2);import{_ModuleSupport as rT}from"ag-charts-community";import{_ModuleSupport as lT}from"ag-charts-community";import{array as cT,arrayOfDefs as hT,boolean as On,callbackOf as dT,color as Tl,fontOptionsDef as pT,number as om,positiveNumber as hi,ratio as uT,typeUnion as gT}from"ag-charts-core";import{_ModuleSupport as sm}from"ag-charts-community";import{_ModuleSupport as Cl}from"ag-charts-community";function yT(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function fT(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as mT}from"ag-charts-community";var{Path:xT,Scalable:ST,ExtendedPath2D:bT,SceneChangeDetection:lt,SceneArrayChangeDetection:vT,BBox:Ns,clippedRoundRect:am}=mT,je=class extends ST(xT){constructor(){super(...arguments),this.wickPath=new bT,this.horizontal=!1,this.center=0,this.thickness=0,this.min=0,this.q1=0,this.median=0,this.q3=0,this.max=0,this.cornerRadius=0,this.crisp=!1,this.strokeAlignment=0,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.capLengthRatio=1,this.wickStrokeAlignment=0}computeBBox(){const{horizontal:e,center:t,thickness:i,min:o,max:s}=this;return e?new Ns(Math.min(o,s),t-i/2,Math.abs(s-o),i):new Ns(t-i/2,Math.min(o,s),i,Math.abs(s-o))}computeDefaultGradientFillBBox(){const{horizontal:e,center:t,thickness:i,q1:o,q3:s}=this;return e?new Ns(Math.min(o,s),t-i/2,Math.abs(s-o),i):new Ns(t-i/2,Math.min(o,s),i,Math.abs(s-o))}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return this.horizontal?{x:(this.min+this.max)/2,y:this.center}:{x:this.center,y:(this.min+this.max)/2}}alignedCoordinates(){const{thickness:e,crisp:t}=this;let{center:i,min:o,q1:s,median:a,q3:n,max:r}=this,l=i-e/2,c=i+e/2;if(t&&e>1){o=this.align(o),s=this.align(s),a=this.align(a),n=this.align(n),r=o+this.align(o,r-o);const h=this.align(e/2);i=this.align(i),l=i-h,c=i+h}return{center:i,x0:l,x1:c,min:o,max:r,q1:s,median:a,q3:n}}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,wickStroke:n,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h,strokeAlignment:p,cornerRadius:u,capLengthRatio:g,horizontal:y}=this,{center:f,x0:x,x1:S,min:v,max:m,q1:b,median:k,q3:A}=this.alignedCoordinates(),M=this.layerManager?.canvas.pixelRatio??1,D=this.wickStrokeAlignment>0?M/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const N=n!=null&&n!==t||r!=null&&r!==i||l!=null&&l!==o||c!=null&&c!==s||h!=null&&h!==a?this.wickPath:e;if(Math.abs(S-x)<=3){Ca(N,y,f,v),Na(N,y,f,m);return}const P=Math.min(v,m),R=Math.max(v,m),F=Math.min(b,A),_=Math.max(b,A),E=f-Math.abs((S-x)*g)/2,T=f+Math.abs((S-x)*g)/2;Ca(N,y,E,P-D),Na(N,y,T,P-D),Ca(N,y,f-D,P-D),Na(N,y,f-D,F+i/2),Ca(N,y,f-D,R+D),Na(N,y,f-D,_-i/2),Ca(N,y,E,R+D),Na(N,y,T,R+D);const w=i/2+p,C=i/2-p,I=_-F-2*C;if(I>0){const O=x+w,z=F+C,B=S-x-2*w,H={topLeft:u,topRight:u,bottomRight:u,bottomLeft:u};nm(e,y,O,z,B,I,H,new Ns(O,z,B,k-z)),nm(e,y,O,z,B,I,H,new Ns(O,k,B,z+I-k))}else{const O=(F+_)/2;Ca(e,y,x,O),Na(e,y,S,O)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,wickStroke:r=i,wickStrokeWidth:l=o,wickStrokeOpacity:c=s,wickLineDash:h=a,wickLineDashOffset:p=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=p,e.stroke(t.getPath2D()))}};d([lt()],je.prototype,"horizontal",2),d([lt()],je.prototype,"center",2),d([lt()],je.prototype,"thickness",2),d([lt()],je.prototype,"min",2),d([lt()],je.prototype,"q1",2),d([lt()],je.prototype,"median",2),d([lt()],je.prototype,"q3",2),d([lt()],je.prototype,"max",2),d([lt()],je.prototype,"cornerRadius",2),d([lt()],je.prototype,"crisp",2),d([lt()],je.prototype,"strokeAlignment",2),d([lt()],je.prototype,"wickStroke",2),d([lt()],je.prototype,"wickStrokeWidth",2),d([lt()],je.prototype,"wickStrokeOpacity",2),d([vT()],je.prototype,"wickLineDash",2),d([lt()],je.prototype,"wickLineDashOffset",2),d([lt()],je.prototype,"capLengthRatio",2),d([lt()],je.prototype,"wickStrokeAlignment",2);function Ca(e,t,i,o){t?e.moveTo(o,i):e.moveTo(i,o)}function Na(e,t,i,o){t?e.lineTo(o,i):e.lineTo(i,o)}function nm(e,t,i,o,s,a,n,r){t?am(e,o,i,a,s,n,r==null?void 0:new Ns(r.y,r.x,r.height,r.width)):am(e,i,o,s,a,n,r)}import{_ModuleSupport as kT}from"ag-charts-community";var{BaseProperties:rm,AbstractBarSeriesProperties:DT,makeSeriesTooltip:MT,Property:de,mergeDefaults:AT}=kT,lm=class extends rm{constructor(){super(...arguments),this.lengthRatio=.5}};d([de],lm.prototype,"lengthRatio",2);var wa=class extends rm{};d([de],wa.prototype,"stroke",2),d([de],wa.prototype,"strokeWidth",2),d([de],wa.prototype,"strokeOpacity",2),d([de],wa.prototype,"lineDash",2),d([de],wa.prototype,"lineDashOffset",2);var fe=class extends DT{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.cap=new lm,this.whisker=new wa,this.tooltip=MT()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:s}=this,a=super.toJson();return a.whisker=AT(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:s}),a}};d([de],fe.prototype,"xKey",2),d([de],fe.prototype,"minKey",2),d([de],fe.prototype,"q1Key",2),d([de],fe.prototype,"medianKey",2),d([de],fe.prototype,"q3Key",2),d([de],fe.prototype,"maxKey",2),d([de],fe.prototype,"xName",2),d([de],fe.prototype,"yName",2),d([de],fe.prototype,"minName",2),d([de],fe.prototype,"q1Name",2),d([de],fe.prototype,"medianName",2),d([de],fe.prototype,"q3Name",2),d([de],fe.prototype,"maxName",2),d([de],fe.prototype,"fill",2),d([de],fe.prototype,"fillOpacity",2),d([de],fe.prototype,"stroke",2),d([de],fe.prototype,"strokeWidth",2),d([de],fe.prototype,"strokeOpacity",2),d([de],fe.prototype,"lineDash",2),d([de],fe.prototype,"lineDashOffset",2),d([de],fe.prototype,"cornerRadius",2),d([de],fe.prototype,"styler",2),d([de],fe.prototype,"itemStyler",2),d([de],fe.prototype,"cap",2),d([de],fe.prototype,"whisker",2),d([de],fe.prototype,"tooltip",2);var{fixNumericExtent:IT,keyProperty:LT,mergeDefaults:Xd,SeriesNodePickMode:cm,SMALLEST_KEY_INTERVAL:TT,valueProperty:_n,diff:CT,animationValidation:NT,computeBarFocusBounds:wT,createDatumId:PT,HighlightState:Zd,ContinuousScale:OT,ChartAxisDirection:_T,motion:hm,getItemStyles:RT,applyShapeFillBBox:ET,calculateSegments:BT,toHighlightString:zT}=Cl,FT=class extends Cl.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.xKey=o.properties.xKey,this.minKey=o.properties.minKey,this.q1Key=o.properties.q1Key,this.medianKey=o.properties.medianKey,this.q3Key=o.properties.q3Key,this.maxKey=o.properties.maxKey}},Nl=class extends Cl.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[cm.NEAREST_NODE,cm.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["medianKey","q1Key","q3Key","minKey","maxKey"]},propertyNames:{x:["xName"],y:["medianName","q1Name","q3Name","minName","maxName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.properties=new fe,this.NodeEvent=FT}async processData(e){if(!this.visible)return;const{xKey:t,minKey:i,q1Key:o,medianKey:s,q3Key:a,maxKey:n}=this.properties,r=!this.ctx.animationManager.isSkipped(),l=this.getCategoryAxis()?.scale,c=this.getValueAxis()?.scale,{isContinuousX:h,xScaleType:p,yScaleType:u}=this.getScaleInformation({xScale:l,yScale:c}),g=[];r&&this.processedData&&g.push(CT(this.id,this.processedData)),r&&g.push(NT());const{processedData:y}=await this.requestDataModel(e,this.data,{props:[LT(t,p,{id:"xValue"}),_n(i,u,{id:"minValue"}),_n(o,u,{id:"q1Value"}),_n(s,u,{id:"medianValue"}),_n(a,u,{id:"q3Value"}),_n(n,u,{id:"maxValue"}),...h?[TT]:[],...g]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:s,def:a}=i.resolveProcessedDataDefById(this,"xValue"),n=t.domain.keys[s];return a.type==="key"&&a.valueType==="category"?n:this.padBandExtent(n)}const o=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return IT(o)}getSeriesRange(e,t){return this.domainForVisibleRange(_T.Y,["maxValue","minValue"],"xValue",t)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!(t&&i&&o&&s))return;const{xKey:a}=this.properties,n=[],r=t.resolveKeysById(this,"xValue",i),l=t.resolveColumnById(this,"minValue",i),c=t.resolveColumnById(this,"q1Value",i),h=t.resolveColumnById(this,"medianValue",i),p=t.resolveColumnById(this,"q3Value",i),u=t.resolveColumnById(this,"maxValue",i),{barWidth:g,groupIndex:y}=this.updateGroupScale(o),f=OT.is(o.scale)?g*-.5:0,{groupScale:x}=this,S=this.isVertical(),v=BT(this.properties.segmentation,o,s,this.chart.seriesRect,this.ctx.scene),m={itemId:a,nodeData:n,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:RT(this.getItemStyle.bind(this)),segments:v};if(!e)return m;const b=i.dataSources.get(this.id)?.data??[];for(const[k,A]of b.entries()){const M=r[k];if(M==null)continue;const D=l[k],L=c[k],N=h[k],P=p[k],R=u[k];if([D,L,N,P,R].some(O=>typeof O!="number")||D>L||L>N||N>P||P>R)continue;const F={xValue:o.scale.convert(M),minValue:s.scale.convert(D),q1Value:s.scale.convert(L),medianValue:s.scale.convert(N),q3Value:s.scale.convert(P),maxValue:s.scale.convert(R)},_=g;F.xValue+=x.convert(String(y))+f+_/2;const E=Math.abs(F.q3Value-F.q1Value),T=F.xValue,w=Math.min(F.q3Value,F.q1Value)+E/2,C={x:S?T:w,y:S?w:T};let I;S?I={x:C.x-_/2,y:F.minValue,width:_,height:F.maxValue-F.minValue}:I={x:F.minValue,y:C.y-_/2,width:F.maxValue-F.minValue,height:_},n.push({series:this,itemId:M,datum:A,datumIndex:k,xKey:a,bandwidth:_,scaledValues:F,midPoint:C,focusRect:I})}return m}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:o,strokeOpacity:s,lineDash:a,lineDashOffset:n}=this.getStyle(!1,!1,Zd.None);return{marker:{fill:Cl.deepClone(e),fillOpacity:o,stroke:t,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:n}}}getLegendData(e){const{id:t,ctx:{legendManager:i},visible:o}=this,{xKey:s,yName:a,showInLegend:n,legendItemName:r}=this.properties;return!s||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:o&&i.getItemEnabled({seriesId:t,itemId:t}),label:{text:r??a??t},symbol:this.legendItemSymbol(),legendItemName:r,hideInLegend:!n}]}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:p,q3Key:u,q3Name:g,minKey:y,minName:f,maxKey:x,maxName:S,legendItemName:v,tooltip:m}=s,b=this.getCategoryAxis(),k=this.getValueAxis();if(!i||!o||!b||!k)return;const A=o.dataSources.get(this.id)?.data[e],M=i.resolveKeysById(this,"xValue",o)[e],D=i.resolveColumnById(this,"minValue",o)[e],L=i.resolveColumnById(this,"q1Value",o)[e],N=i.resolveColumnById(this,"medianValue",o)[e],P=i.resolveColumnById(this,"q3Value",o)[e],R=i.resolveColumnById(this,"maxValue",o)[e];if(M==null)return;const F=this.getItemStyle(e,!1),_=[{label:f,fallbackLabel:y,value:this.getAxisValueText(k,"tooltip",D,A,y,v)},{label:p,fallbackLabel:h,value:this.getAxisValueText(k,"tooltip",L,A,h,v)},{label:c,fallbackLabel:l,value:this.getAxisValueText(k,"tooltip",N,A,l,v)},{label:g,fallbackLabel:u,value:this.getAxisValueText(k,"tooltip",P,A,u,v)},{label:S,fallbackLabel:x,value:this.getAxisValueText(k,"tooltip",R,A,x,v)}];return this.formatTooltipWithContext(m,{heading:this.getAxisValueText(b,"tooltip",M,A,a,v),title:v??r,symbol:this.legendItemSymbol(),data:_},{seriesId:t,datum:A,title:r,xKey:a,xName:n,yName:r,medianKey:l,medianName:c,q1Key:h,q1Name:p,q3Key:u,q3Name:g,minKey:y,minName:f,maxKey:x,maxName:S,...F})}animateEmptyUpdateReady({datumSelection:e}){const t=this.isVertical(),{from:i,to:o}=yT(t);hm.resetMotion([e],fT(t)),hm.staticFromToMotion(this.id,"datums",this.ctx.animationManager,[e],i,o,{phase:"initial"})}isLabelEnabled(){return!1}updateDatumSelection(e){const t=e.nodeData??[];return e.datumSelection.update(t)}makeStylerParams(e,t){const{id:i}=this,{cornerRadius:o,cap:{lengthRatio:s},fill:a,fillOpacity:n,lineDash:r,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:p,maxKey:u,maxName:g,medianKey:y,medianName:f,minKey:x,minName:S,q1Key:v,q1Name:m,q3Key:b,q3Name:k,whisker:{lineDash:A,lineDashOffset:M,stroke:D,strokeOpacity:L,strokeWidth:N},xKey:P,xName:R,yName:F}=this.properties,_=zT(t??Zd.None);return{cap:{lengthRatio:s},cornerRadius:o,fill:a,fillOpacity:n,highlightState:_,highlighted:e,lineDash:r,lineDashOffset:l,maxKey:u,maxName:g??u,medianKey:y,medianName:f??y,minKey:x,minName:S??x,q1Key:v,q1Name:m??v,q3Key:b,q3Name:k??b,seriesId:i,stroke:c,strokeOpacity:h,strokeWidth:p,whisker:{lineDash:A??r,lineDashOffset:M??l,stroke:D??c,strokeOpacity:L??h,strokeWidth:N??p},xKey:P,xName:R??P,yName:F}}getStyle(e,t,i){const{cap:o,cornerRadius:s,fill:a,fillOpacity:n,lineDash:r,lineDashOffset:l,stroke:c,strokeOpacity:h,strokeWidth:p,styler:u,whisker:g}=this.properties;let y={};if(!e&&u){const f=this.makeStylerParams(t,i);y=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,f)??{},{pick:!1})??{}}return{cornerRadius:y.cornerRadius??s,fill:y.fill??a,fillOpacity:y.fillOpacity??n,lineDash:y.lineDash??r,lineDashOffset:y.lineDashOffset??l,opacity:1,stroke:y.stroke??c,strokeOpacity:y.strokeOpacity??h,strokeWidth:y.strokeWidth??p,cap:{lengthRatio:y.cap?.lengthRatio??o.lengthRatio},whisker:{lineDash:y.whisker?.lineDash??g.lineDash,lineDashOffset:y.whisker?.lineDashOffset??g.lineDashOffset,stroke:y.whisker?.stroke??g.stroke,strokeOpacity:y.whisker?.strokeOpacity??g.strokeOpacity,strokeWidth:y.whisker?.strokeWidth??g.strokeWidth}}}getItemStyle(e,t,i){const{properties:o}=this,{itemStyler:s}=o,a=this.getHighlightStyle(t,e,i);let n=Xd(a,this.getStyle(e===void 0,t,i));if(s!=null&&e!=null){const u=this.cachedDatumCallback(PT(e,t?"highlight":"node"),()=>{const g=this.makeItemStylerParams(e,t,n);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(s,g))});u&&(n=Xd(u,n))}const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}=n;return n.whisker=Xd(n.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}),n}makeItemStylerParams(e,t,i){const{id:o}=this,{xKey:s,minKey:a,q1Key:n,medianKey:r,q3Key:l,maxKey:c}=this.properties,h=this.processedData?.dataSources.get(o)?.data[e],p=this.ctx.highlightManager?.getActiveHighlight(),u=this.getHighlightStateString(p,t,e),g=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:o,datum:h,xKey:s,minKey:a,q1Key:n,medianKey:r,q3Key:l,maxKey:c,highlighted:t,highlightState:u,...i,fill:g}}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((o,s)=>{const a=this.getHighlightState(i,t,s.datumIndex);s.style=this.getItemStyle(s.datumIndex,t,a)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:o}=this;if(!i)return;const s=this.isVertical(),a=this.ctx.highlightManager.getActiveHighlight(),n=this.getShapeFillBBox(),r=this.getStyle(!1,!1,Zd.None).strokeWidth/2,l=o.whisker.strokeWidth??o.strokeWidth;e.each((c,h)=>{const p=h.style??i.styles[this.getHighlightState(a,t,h.datumIndex)];ET(c,p.fill,n),c.fill=p.fill,c.fillOpacity=p.fillOpacity,c.stroke=p.stroke,c.strokeWidth=p.strokeWidth,c.strokeOpacity=p.strokeOpacity,c.lineDash=p.lineDash,c.lineDashOffset=p.lineDashOffset,c.wickStroke=p.whisker.stroke,c.wickStrokeWidth=p.whisker.strokeWidth,c.wickStrokeOpacity=p.whisker.strokeOpacity,c.wickLineDash=p.whisker.lineDash,c.wickLineDashOffset=p.whisker.lineDashOffset,c.cornerRadius=p.cornerRadius,c.crisp=!0,c.horizontal=!s,c.center=h.scaledValues.xValue,c.thickness=h.bandwidth,c.min=h.scaledValues.minValue,c.q1=h.scaledValues.q1Value,c.median=h.scaledValues.medianValue,c.q3=h.scaledValues.q3Value,c.max=h.scaledValues.maxValue,c.capLengthRatio=p.cap.lengthRatio,c.strokeAlignment=r,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new je}computeFocusBounds({datumIndex:e}){return wT(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};Nl.className="BoxPlotSeries",Nl.type="box-plot";import{_ModuleSupport as HT}from"ag-charts-community";import{boolean as VT,constant as WT,required as ws,shapeSegmentation as GT,string as Rt}from"ag-charts-core";var{boxPlotSeriesThemeableOptionsDef:KT,commonSeriesOptionsDefs:$T}=HT,jT={...$T,...KT,type:ws(WT("box-plot")),xKey:ws(Rt),minKey:ws(Rt),q1Key:ws(Rt),medianKey:ws(Rt),q3Key:ws(Rt),maxKey:ws(Rt),xName:Rt,yName:Rt,minName:Rt,q1Name:Rt,medianName:Rt,q3Name:Rt,maxName:Rt,grouped:VT,legendItemName:Rt,segmentation:GT};import{_ModuleSupport as YT}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:dm},multiSeriesHighlightStyle:UT,FILL_GRADIENT_LINEAR_DEFAULTS:XT,FILL_IMAGE_DEFAULTS:ZT,FILL_PATTERN_DEFAULTS:qT,SAFE_FILL_OPERATION:QT,SEGMENTATION_DEFAULTS:JT}=YT,eC={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[QT,{$ref:"chartBackgroundColor"},.7]}]},["gradient",XT],["image",ZT],["pattern",qT]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:UT(),segmentation:JT},axes:{[dm.NUMBER]:{crosshair:{snap:!1}},[dm.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},tC={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"box-plot",moduleFactory:e=>new Nl(e),predictAxis:sm.predictCartesianTimeAxis,defaultAxes:sm.DIRECTION_SWAP_AXES,themeTemplate:eC,groupable:!0},pm={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,options:jT,create:e=>new Nl(e)};import{_ModuleSupport as iC}from"ag-charts-community";import{_ModuleSupport as oC}from"ag-charts-community";import{_ModuleSupport as qd}from"ag-charts-community";import{Logger as um}from"ag-charts-core";import{_ModuleSupport as sC}from"ag-charts-community";var{AGGREGATION_SPAN:gm,AGGREGATION_INDEX_X_MAX:aC,AGGREGATION_INDEX_X_MIN:nC,AGGREGATION_INDEX_Y_MAX:rC,AGGREGATION_INDEX_Y_MIN:lC,aggregationDomain:cC,aggregationRangeFittingPoints:hC,compactAggregationIndices:dC,createAggregationIndices:pC}=sC,uC=1e3,ym=nC,gC=rC,yC=lC,fm=aC;function fC(e,t,i,o,s,a){if(t.length64;)({indexData:c,valueData:h,maxRange:l}=dC(c,h,l)),p.push({maxRange:l,indexData:c});return p.reverse(),p}var{fixNumericExtent:mC,keyProperty:xC,createDatumId:mm,SeriesNodePickMode:xm,ChartAxisDirection:Sm,SMALLEST_KEY_INTERVAL:SC,valueProperty:wl,diff:bC,animationValidation:vC,computeBarFocusBounds:kC,visibleRangeIndices:bm,BandScale:DC,processedDataIsAnimatable:MC,mergeDefaults:vm,simpleMemorize2:AC,getItemStylesPerItemId:IC}=qd,LC=AC(fC),TC=class extends qd.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.xKey=o.properties.xKey,this.openKey=o.properties.openKey,this.closeKey=o.properties.closeKey,this.highKey=o.properties.highKey,this.lowKey=o.properties.lowKey}},km=class extends qd.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[xm.AXIS_ALIGNED,xm.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=TC,this.dataAggregationFilters=void 0}async processData(e){if(!this.visible)return;const{xKey:t,openKey:i,closeKey:o,highKey:s,lowKey:a}=this.properties,n=!this.ctx.animationManager.isSkipped(),r=this.getCategoryAxis()?.scale,l=this.getValueAxis()?.scale,{isContinuousX:c,xScaleType:h,yScaleType:p}=this.getScaleInformation({xScale:r,yScale:l}),u=[];n&&(this.processedData&&u.push(bC(this.id,this.processedData)),u.push(vC())),i&&u.push(wl(i,p,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const{dataModel:g,processedData:y}=await this.requestDataModel(e,this.data,{props:[xC(t,h,{id:"xValue"}),wl(o,p,{id:"closeValue"}),wl(s,p,{id:"highValue"}),wl(a,p,{id:"lowValue"}),...c?[SC]:[],...u]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.dataAggregationFilters=this.aggregateData(g,y),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||MC(t))return;const i=this.axes[Sm.X];if(i==null)return;const o=e.resolveKeysById(this,"xValue",t),s=e.resolveColumnById(this,"highValue",t),a=e.resolveColumnById(this,"lowValue",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n];return LC(i.scale.type,o,s,a,r,t.reduced?.smallestKeyInterval)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];if(e!==this.getBarDirection()){const{index:s,def:a}=i.resolveProcessedDataDefById(this,"xValue"),n=t.domain.keys[s];return a.type==="key"&&a.valueType==="category"?n:this.padBandExtent(n)}const o=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return mC(o)}getSeriesRange(e,t){return this.domainForVisibleRange(Sm.Y,["highValue","lowValue"],"xValue",t)}getZoomRangeFittingItems(e,t,i){return this.zoomFittingVisibleItems("xValue",["highValue","lowValue"],e,t,i)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["highValue","lowValue"],e,t,i)}createNodeData(){const{visible:e,dataModel:t,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!(t&&i&&o&&s))return;const a=[],{xKey:n,highKey:r,lowKey:l}=this.properties,c=i.dataSources.get(this.id)?.data??[],h=t.resolveKeysById(this,"xValue",i),p=t.resolveColumnById(this,"openValue",i),u=t.resolveColumnById(this,"closeValue",i),g=t.resolveColumnById(this,"highValue",i),y=t.resolveColumnById(this,"lowValue",i),{groupScale:f}=this,{barWidth:x,groupIndex:S}=this.updateGroupScale(o),v=f.convert(String(S)),m=x>=1?x:f.rawBandwidth,b=DC.is(o.scale),k={itemId:n,nodeData:a,labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:IC(this.getItemStyle.bind(this),"up","down")};if(!e)return k;const A=(_,E,T,w,C,I,O,z)=>{const B=c[_],H=b?O/2:0,W=o.scale.convert(E)+v+H,V=s.scale.convert(T),G=s.scale.convert(w),K=s.scale.convert(C),Q=s.scale.convert(I),X=w>T,Y=X?"up":"down",J=Math.min(K,Q),ie=Math.max(K,Q)-J,U={x:W,y:J+ie/2};a.push({series:this,itemId:Y,datum:B,datumIndex:_,xKey:n,xValue:E,openValue:T,closeValue:w,highValue:C,lowValue:I,midPoint:U,aggregatedValue:w,isRising:X,centerX:W,width:O,y:J,height:ie,yOpen:V,yClose:G,crisp:z})},{dataAggregationFilters:M}=this,D=o.scale,[L,N]=D.range,P=Math.abs(N-L),R=_=>D.convert(h[_])+v,F=M?.find(_=>_.maxRange>P);if(F==null){const _=i.invalidData?.get(this.id);let[E,T]=bm(1,c.length,o.range,w=>{const C=b?0:-m/2,I=R(w)+C;return[I,I+m]});i.input.count<1e3&&(E=0,T=i.input.count);for(let w=E;w=I&&z>=O;if(!H){um.warnOnce(`invalid low value for key [${l}] in data element, low value cannot be higher than datum open or close values`);continue}if(!W){um.warnOnce(`invalid high value for key [${r}] in data element, high value cannot be lower than datum open or close values.`);continue}A(w,C,I,O,z,B,m,!0)}}else{const{maxRange:_,indexData:E}=F,[T,w]=bm(1,_,o.range,C=>{const I=C*gm,O=E[I+ym],z=E[I+fm];if(O===-1)return;const B=b?0:-m/2;return[R(O)+B,R(z)+B+m]});for(let C=T;C{const g=this.makeItemStylerParams(o,e,t,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",o],this.callWithContext(r,g))});u&&(h=vm(u,h))}return h}makeItemStylerParams(e,t,i,o){const{id:s,properties:a,processedData:n}=this,{xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:p}=a,u=n.dataSources.get(s)?.data[t],g=this.ctx.highlightManager?.getActiveHighlight(),y=this.getHighlightStateString(g,i,t),f={seriesId:s,datum:u,itemId:e,xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:p,highlighted:i,highlightState:y,...o};return"fill"in f&&"fill"in o&&(f.fill=this.filterItemStylerFillParams(o.fill)??o.fill),f}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:n,yName:r,openKey:l,openName:c,highKey:h,highName:p,lowKey:u,lowName:g,closeKey:y,closeName:f,legendItemName:x,tooltip:S}=s,v=this.getCategoryAxis(),m=this.getValueAxis();if(!i||!o||!v||!m)return;const b=o.dataSources.get(this.id)?.data[e],k=i.resolveKeysById(this,"xValue",o)[e],A=i.resolveColumnById(this,"openValue",o)[e],M=i.resolveColumnById(this,"highValue",o)[e],D=i.resolveColumnById(this,"lowValue",o)[e],L=i.resolveColumnById(this,"closeValue",o)[e];if(k==null)return;const N=L>=A?"up":"down",P=this.properties.item[N],R=this.getItemStyle(e,!1),F={fill:P.fill??P.stroke,fillOpacity:P.fillOpacity??P.strokeOpacity??1,stroke:P.stroke,strokeWidth:P.strokeWidth??1,strokeOpacity:P.strokeOpacity??1,lineDash:P.lineDash??[0],lineDashOffset:P.lineDashOffset??0};return this.formatTooltipWithContext(S,{heading:this.getAxisValueText(v,"tooltip",k,b,a,x),title:x,symbol:{marker:F},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(m,"tooltip",A,b,l,x)},{label:p,fallbackLabel:h,value:this.getAxisValueText(m,"tooltip",M,b,h,x)},{label:g,fallbackLabel:u,value:this.getAxisValueText(m,"tooltip",D,b,u,x)},{label:f,fallbackLabel:y,value:this.getAxisValueText(m,"tooltip",L,b,y,x)}]},{seriesId:t,datum:b,title:r,itemId:N,xKey:a,xName:n,yName:r,openKey:l,openName:c,highKey:h,highName:p,lowKey:u,lowName:g,closeKey:y,closeName:f,...R})}computeFocusBounds(e){const t=this.getNodeData()?.at(e.datumIndex);if(t==null)return;const{centerX:i,y:o,width:s,height:a}=t,n={x:i-s/2,y:o,width:s,height:a};return kC(this,n)}};import{_ModuleSupport as CC}from"ag-charts-community";import{_ModuleSupport as NC}from"ag-charts-community";var{Path:wC,SceneChangeDetection:Xo,BBox:PC}=NC,So=class extends wC{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}computeBBox(){const{centerX:e,y:t,width:i,height:o}=this;return new PC(e-i/2,t,i,o)}isPointInPath(e,t){return this.getBBox().containsPoint(e,t)}distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}get midPoint(){return{x:this.centerX,y:this.y+this.height/2}}alignedCoordinates(){const{y:e,width:t,height:i,crisp:o}=this;let{centerX:s,yOpen:a,yClose:n}=this,r=s-t/2,l=s+t/2,c=e,h=e+i;if(o&&t>1){if(s=this.align(s),a<=n){const u=this.align(a,n-a);a=this.align(a),n=a+u}else{const u=this.align(n,a-n);n=this.align(n),a=n+u}const p=this.align(t/2);r=s-p,l=s+p,c=this.align(e),h=c+this.align(c,i)}return{centerX:s,x0:r,x1:l,y0:c,y1:h,yOpen:a,yClose:n}}executeStroke(e,t){const{width:i,strokeWidth:o}=this;i0?l/this.strokeAlignment/2%1:0;e.clear(),e.moveTo(t-c,s),e.lineTo(t-c,a),Math.abs(o-i)>1&&(e.moveTo(i,n-c),e.lineTo(t-c,n-c),e.moveTo(t-c,r-c),e.lineTo(o,r-c))}};d([Xo()],Dm.prototype,"strokeAlignment",2);var{SceneArrayChangeDetection:OC,SceneChangeDetection:Rn,ExtendedPath2D:_C,BBox:RC}=CC,Ps=class extends So{constructor(){super(...arguments),this.wickPath=new _C,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}computeDefaultGradientFillBBox(){const{width:e,centerX:t,yOpen:i,yClose:o}=this,s=Math.min(i,o),n=Math.max(i,o)-s,r=t-e/2,l=t+e/2;return new RC(r,s,l-r,n)}updatePath(){const{path:e,stroke:t,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,wickStroke:n,wickStrokeWidth:r,wickStrokeOpacity:l,wickLineDash:c,wickLineDashOffset:h}=this,{centerX:p,x0:u,x1:g,y0:y,y1:f,yOpen:x,yClose:S}=this.alignedCoordinates(),v=this.layerManager?.canvas.pixelRatio??1,m=this.wickStrokeAlignment>0?v/this.wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const k=n!=null&&n!==t||r!=null&&r!==i||l!=null&&l!==o||c!=null&&c!==s||h!=null&&h!==a?this.wickPath:e;if(Math.abs(g-u)<=3){k.moveTo(p-m,y),k.lineTo(p-m,f);return}const A=Math.min(x,S),M=Math.max(x,S),D=i/2;k.moveTo(p-m,y),k.lineTo(p-m,A+D),k.moveTo(p-m,f),k.lineTo(p-m,M-D);const L=M-A-2*D;if(L>0)e.rect(u+D,A+D,g-u-2*D,L);else{const N=(A+M)/2;e.moveTo(u,N),e.lineTo(g,N)}}drawPath(e){super.drawPath(e);const{wickPath:t}=this;if(t.isEmpty())return;const{stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,wickStroke:r=i,wickStrokeWidth:l=o,wickStrokeOpacity:c=s,wickLineDash:h=a,wickLineDashOffset:p=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=p,e.stroke(t.getPath2D()))}};d([Rn()],Ps.prototype,"wickStroke",2),d([Rn()],Ps.prototype,"wickStrokeWidth",2),d([Rn()],Ps.prototype,"wickStrokeOpacity",2),d([OC()],Ps.prototype,"wickLineDash",2),d([Rn()],Ps.prototype,"wickLineDashOffset",2),d([Rn()],Ps.prototype,"wickStrokeAlignment",2);import{_ModuleSupport as EC}from"ag-charts-community";import{_ModuleSupport as BC}from"ag-charts-community";var{BaseProperties:Mm,Property:Pe,AbstractBarSeriesProperties:zC,makeSeriesTooltip:FC}=BC,Os=class extends Mm{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};d([Pe],Os.prototype,"stroke",2),d([Pe],Os.prototype,"strokeWidth",2),d([Pe],Os.prototype,"strokeOpacity",2),d([Pe],Os.prototype,"lineDash",2),d([Pe],Os.prototype,"lineDashOffset",2);var Qd=class extends Mm{constructor(){super(...arguments),this.up=new Os,this.down=new Os}};d([Pe],Qd.prototype,"up",2),d([Pe],Qd.prototype,"down",2);var $t=class extends zC{};d([Pe],$t.prototype,"xKey",2),d([Pe],$t.prototype,"openKey",2),d([Pe],$t.prototype,"closeKey",2),d([Pe],$t.prototype,"highKey",2),d([Pe],$t.prototype,"lowKey",2),d([Pe],$t.prototype,"xName",2),d([Pe],$t.prototype,"yName",2),d([Pe],$t.prototype,"openName",2),d([Pe],$t.prototype,"closeName",2),d([Pe],$t.prototype,"highName",2),d([Pe],$t.prototype,"lowName",2);var Pl=class extends $t{constructor(){super(...arguments),this.tooltip=FC(),this.item=new Qd}getStyle(e){const{strokeWidth:t,strokeOpacity:i,stroke:o,lineDash:s,lineDashOffset:a}=this.item[e];return{stroke:o,strokeWidth:t,strokeOpacity:i,lineDash:s,lineDashOffset:a,opacity:1}}};d([Pe],Pl.prototype,"tooltip",2),d([Pe],Pl.prototype,"item",2),d([Pe],Pl.prototype,"itemStyler",2);var{BaseProperties:Jd,makeSeriesTooltip:HC,Property:Ye}=EC,Pa=class extends Jd{};d([Ye],Pa.prototype,"stroke",2),d([Ye],Pa.prototype,"strokeWidth",2),d([Ye],Pa.prototype,"strokeOpacity",2),d([Ye],Pa.prototype,"lineDash",2),d([Ye],Pa.prototype,"lineDashOffset",2);var Mi=class extends Jd{constructor(){super(...arguments),this.fill="#c16068",this.fillOpacity=1,this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.wick=new Pa}};d([Ye],Mi.prototype,"fill",2),d([Ye],Mi.prototype,"fillOpacity",2),d([Ye],Mi.prototype,"stroke",2),d([Ye],Mi.prototype,"strokeWidth",2),d([Ye],Mi.prototype,"strokeOpacity",2),d([Ye],Mi.prototype,"lineDash",2),d([Ye],Mi.prototype,"lineDashOffset",2),d([Ye],Mi.prototype,"cornerRadius",2),d([Ye],Mi.prototype,"wick",2);var ep=class extends Jd{constructor(){super(...arguments),this.up=new Mi,this.down=new Mi}};d([Ye],ep.prototype,"up",2),d([Ye],ep.prototype,"down",2);var Ol=class extends $t{constructor(){super(),this.item=new ep,this.tooltip=HC(),this.highlightStyle.deprecated=!1}getStyle(e){const{fill:t,fillOpacity:i,strokeWidth:o,strokeOpacity:s,stroke:a,lineDash:n,lineDashOffset:r,cornerRadius:l,wick:c}=this.item[e];return{fill:t,fillOpacity:i,stroke:a,strokeWidth:o,strokeOpacity:s,lineDash:n,lineDashOffset:r,cornerRadius:l,opacity:1,wick:c}}};d([Ye],Ol.prototype,"item",2),d([Ye],Ol.prototype,"tooltip",2),d([Ye],Ol.prototype,"itemStyler",2);var{isGradientFill:Am,isPatternFill:tp,isImageFill:ip,applyShapeStyle:VC}=oC,_l=class extends km{constructor(){super(...arguments),this.properties=new Ol}nodeFactory(){const e=new Ps;return e.lineCap="butt",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o.datumIndex,t,void 0,o.itemId)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:o}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:n}=o.item;e.each((r,l)=>{const{centerX:c,width:h,y:p,height:u,yOpen:g,yClose:y,crisp:f}=l,x=l.isRising?a:n,S=l.style??i.styles[l.itemId][this.getHighlightState(s,t,l.datumIndex)];r.centerX=c,r.width=h,r.y=p,r.height=u,r.yOpen=g,r.yClose=y,r.crisp=f,VC(r,S,this.getShapeFillBBox());const v=S?.wick;r.wickStroke=v?.stroke,r.wickStrokeWidth=v?.strokeWidth,r.wickStrokeOpacity=v?.strokeOpacity,r.wickLineDash=v?.lineDash,r.wickLineDashOffset=v?.lineDashOffset,r.wickStrokeAlignment=x.wick.strokeWidth??x.strokeWidth})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=Am(e.fill)?e.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:tp(e.fill)||ip(e.fill)?e.stroke:e.fill,stop:0},{color:tp(e.fill)||ip(e.fill)?e.stroke:e.fill,stop:.5}],o=Am(t.fill)?t.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:tp(t.fill)||ip(t.fill)?t.stroke:t.fill,stop:.5}],s={type:"gradient",gradient:"linear",rotation:90,colorStops:[...i,...o],reverse:!1},a={type:"gradient",gradient:"linear",rotation:90,colorStops:[{color:e.stroke,stop:0},{color:e.stroke,stop:.5},{color:t.stroke,stop:.5}],reverse:!1};return{marker:{fill:s,fillOpacity:e.fillOpacity,stroke:a,strokeWidth:e.strokeWidth??1,strokeOpacity:e.strokeOpacity??1,lineDash:e.lineDash,lineDashOffset:e.lineDashOffset}}}getLegendData(e){const{id:t,data:i,visible:o,ctx:{legendManager:s}}=this,{xKey:a,yName:n,showInLegend:r,legendItemName:l}=this.properties;return!i?.data.length||!a||e!=="category"?[]:[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:o&&s.getItemEnabled({seriesId:t,itemId:t}),label:{text:l??n??t},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!r}]}hasItemStylers(){return this.properties.itemStyler!=null}};_l.className="CandleStickSeries",_l.type="candlestick";import{_ModuleSupport as WC}from"ag-charts-community";import{boolean as GC,constant as KC,number as $C,required as Oa,string as Ai,undocumented as Im}from"ag-charts-core";var{commonSeriesOptionsDefs:jC,candlestickSeriesThemeableOptionsDef:YC}=WC,op={...jC,...YC,type:Oa(KC("candlestick")),xKey:Oa(Ai),openKey:Oa(Ai),highKey:Oa(Ai),lowKey:Oa(Ai),closeKey:Oa(Ai),xName:Ai,yName:Ai,openName:Ai,highName:Ai,lowName:Ai,closeName:Ai};op.pickOutsideVisibleMinorAxis=Im(GC),op.focusPriority=Im($C);import{_ModuleSupport as UC}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:Lm},multiSeriesHighlightStyle:XC,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:ZC,FILL_IMAGE_DEFAULTS:qC,FILL_PATTERN_KEYED_DEFAULTS:QC}=UC;function Tm(e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},e==="up"?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},["gradient",ZC(e)],["image",qC],["pattern",QC(e)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]}}}var JC={series:{item:{up:Tm("up"),down:Tm("down")},highlightStyle:{item:{strokeWidth:3}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:XC()},animation:{enabled:!1},axes:{[Lm.NUMBER]:{crosshair:{snap:!1}},[Lm.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{CARTESIAN_AXIS_TYPE:Cm,CARTESIAN_POSITION:Nm}=iC.ThemeConstants,eN={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"candlestick",moduleFactory:e=>new _l(e),defaultAxes:[{type:Cm.NUMBER,position:Nm.LEFT},{type:Cm.ORDINAL_TIME,position:Nm.BOTTOM}],themeTemplate:JC,groupable:!1},wm={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,options:op,create:e=>new _l(e)};import{_ModuleSupport as tN}from"ag-charts-community";import{_ModuleSupport as Rl}from"ag-charts-community";import{Logger as iN,toPlainText as oN}from"ag-charts-core";import{Logger as sN,cachedTextMeasurer as El,findMaxValue as Pm,wrapLines as Om}from"ag-charts-core";function aN(e,t){const{fontSize:i,minimumFontSize:o=i}=e,{fontSize:s,minimumFontSize:a=s}=t,n=i-o,r=s-a;let l=e.fontSize,c=t.fontSize;const h=[{labelFontSize:i,secondaryLabelFontSize:s}];for(;l>o||c>a;){const p=n>0?(l-o)/n:-1,u=r>0?(c-a)/r:-1;p>u?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function _m(e,t,i,o,{padding:s},a){const{spacing:n=0}=t,r=2*s,l=2*s+n,c=(t.minimumFontSize??t.fontSize)+(o.minimumFontSize??o.fontSize);if(c>a(c+l,!1).height-l)return;const h=aN(t,o),p={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},u={fontFamily:o.fontFamily,fontStyle:o.fontStyle,fontWeight:o.fontWeight};let g,y;return Pm(0,h.length-1,f=>{const{labelFontSize:x,secondaryLabelFontSize:S}=h[f],v=f===0,m={...p,fontSize:x},b={...u,fontSize:S},k=El(m).lineHeight(),A=El(b).lineHeight(),M=a(k+A+l,v),D=M.width-r,L=M.height-l;if(k+A>L||((g==null||g.fontSize!==x)&&(g=Em(t,e,D,L,m,t.wrapping,v?t.overflowStrategy:"hide")),g==null||g.width>D||g.height>L)||((y==null||y.fontSize!==S)&&(y=Em(o,i,D,L,b,o.wrapping,v?o.overflowStrategy:"hide")),y==null))return;const N=g.height+y.height;if(!(y.width>D||N>L))return{width:Math.max(g.width,y.width),height:N+n,meta:M.meta,label:g,secondaryLabel:y}})}function En(e,t,{padding:i},o){const s=2*i,a=Math.min(t.minimumFontSize??t.fontSize,t.fontSize),n={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight};return Pm(a,t.fontSize,r=>{const l={...n,fontSize:r},c=El(l),h=r===a,p=t.lineHeight??c.lineHeight(),u=o(p+s,h),g=u.width-s,y=u.height-s;if(p>y||g<0)return;const f=Om(e,{maxWidth:g,maxHeight:y,font:l,textWrap:t.wrapping,overflow:(h?t.overflowStrategy:null)??"hide"});if(!f.length)return;const{width:x,height:S}=c.measureLines(f),v=f.join(`
+`);return[{width:x,height:S,text:v,fontSize:r,lineHeight:p},u.meta]})}function Rm(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function sp(e,t,i,o,s,a){const n=t.enabled?e:void 0,r=o.enabled?i:void 0;(Rm(t)||Rm(o))&&sN.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;n!=null&&r!=null&&(l=_m(n,t,r,o,s,a));let c;if(l==null&&n!=null&&(c=En(n,t,s,a)),c!=null){const[p,u]=c;l={width:p.width,height:p.height,meta:u,label:p,secondaryLabel:void 0}}let h;if(l==null&&n==null&&r!=null&&(h=En(r,o,s,a)),h!=null){const[p,u]=h;l={width:p.width,height:p.height,meta:u,label:void 0,secondaryLabel:p}}return l}function Em(e,t,i,o,s,a,n){const r=Om(t,{maxWidth:i,maxHeight:o,font:s,textWrap:a,overflow:n});if(!r.length)return;const l=El(s),c=e.lineHeight??l.lineHeight(),{width:h}=l.measureLines(r);return{width:h,lineHeight:c,text:r.join(`
+`),height:r.length*c,fontSize:s.fontSize}}import{_ModuleSupport as nN}from"ag-charts-community";import{_ModuleSupport as Bm}from"ag-charts-community";var{Property:Bn}=Bm,_a=class extends Bm.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};d([Bn],_a.prototype,"wrapping",2),d([Bn],_a.prototype,"overflowStrategy",2),d([Bn],_a.prototype,"lineHeight",2),d([Bn],_a.prototype,"minimumFontSize",2);var $i=class extends _a{constructor(){super(...arguments),this.spacing=0}};d([Bn],$i.prototype,"spacing",2);var zn=class extends _a{},{CartesianSeriesProperties:rN,makeSeriesTooltip:lN,Property:ct}=nN,qe=class extends rN{constructor(){super(...arguments),this.colorRange=["black","black"],this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.textAlign="center",this.verticalAlign="middle",this.itemPadding=0,this.label=new $i,this.tooltip=lN()}};d([ct],qe.prototype,"title",2),d([ct],qe.prototype,"xKey",2),d([ct],qe.prototype,"yKey",2),d([ct],qe.prototype,"colorKey",2),d([ct],qe.prototype,"xName",2),d([ct],qe.prototype,"yName",2),d([ct],qe.prototype,"colorName",2),d([ct],qe.prototype,"colorRange",2),d([ct],qe.prototype,"stroke",2),d([ct],qe.prototype,"strokeOpacity",2),d([ct],qe.prototype,"strokeWidth",2),d([ct],qe.prototype,"textAlign",2),d([ct],qe.prototype,"verticalAlign",2),d([ct],qe.prototype,"itemPadding",2),d([ct],qe.prototype,"itemStyler",2),d([ct],qe.prototype,"label",2),d([ct],qe.prototype,"tooltip",2);var{SeriesNodePickMode:zm,computeBarFocusBounds:cN,getMissCount:hN,valueProperty:ap,ChartAxisDirection:di,DEFAULT_CARTESIAN_DIRECTION_KEYS:dN,DEFAULT_CARTESIAN_DIRECTION_NAMES:pN,createDatumId:uN,ColorScale:gN,Rect:yN,PointerEvents:fN,applyShapeStyle:mN,mergeDefaults:Fm,formatValue:xN,addHitTestersToQuadtree:SN,findQuadtreeMatch:Hm,updateLabelNode:bN}=Rl,vN=class extends Rl.CartesianSeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.colorKey=o.properties.colorKey}},kN={left:-.5,center:0,right:-.5},DN={top:-.5,middle:0,bottom:-.5},Bl=class extends Rl.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...dN,color:["colorKey"]},propertyNames:{...pN,color:["colorName"]},categoryKey:void 0,pickModes:[zm.NEAREST_NODE,zm.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new qe,this.NodeEvent=vN,this.colorScale=new gN}async processData(e){const t=this.axes[di.X],i=this.axes[di.Y];if(!t||!i||!this.data?.data.length)return;const{xKey:o,yKey:s,colorRange:a,colorKey:n}=this.properties,r=this.axes[di.X]?.scale,l=this.axes[di.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),p=this.colorScale.type,{dataModel:u,processedData:g}=await this.requestDataModel(e,this.data,{props:[ap(o,c,{id:"xValue"}),ap(s,h,{id:"yValue"}),...n?[ap(n,p,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const y=u.resolveProcessedDataIndexById(this,"colorValue"),f=g.domain.values[y].filter(S=>S!=null),x=Rl.extent(f);if(this.colorScale.domain=x??[],x?.length&&x[0]===x[1]){const S=Math.floor(a.length/2);this.colorScale.range=[a[S],a[S]]}else this.colorScale.range=a;this.colorScale.update()}}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const o=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=hN(this,i.defs.values[o].missing),n=t.resolveProcessedDataIndexById(this,"colorValue"),r=i.domain.values[n].filter(c=>c!=null).length;return!(s===0||s===a||r===0)}xCoordinateRange(e,t){const i=this.axes[di.X].scale,o=t*(i.bandwidth??0)/2,s=i.convert(e)+o,a=t*(i.bandwidth??10);return[s,s+a]}yCoordinateRange(e,t){const i=this.axes[di.Y].scale,o=t*(i.bandwidth??0)/2,s=i.convert(e[0])+o,a=t*(i.bandwidth??10);return[s,s+a]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;return!t||!i?[]:e===di.X?t.getDomain(this,"xValue","value",i):t.getDomain(this,"yValue","value",i)}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{data:e,visible:t,axes:i,dataModel:o,processedData:s}=this,a=i[di.X],n=i[di.Y];if(!(e&&o&&s&&t&&a&&n))return;if(a.type!=="category"||n.type!=="category"){iN.warnOnce(`Heatmap series expected axes to have "category" type, but received "${a.type}" and "${n.type}" instead.`);return}const{xKey:r,xName:l,yKey:c,yName:h,colorKey:p,colorName:u,textAlign:g,verticalAlign:y,itemPadding:f,label:x}=this.properties,S=o.resolveColumnById(this,"xValue",s),v=o.resolveColumnById(this,"yValue",s),m=p?o.resolveColumnById(this,"colorValue",s):void 0,b=p?o.getDomain(this,"colorValue","value",s):[],k=a.scale,A=n.scale,M=(k.bandwidth??0)/2,D=(A.bandwidth??0)/2,L=[],N=[],P=k.bandwidth??10,R=A.bandwidth??10,F=(P-2*f)*kN[g],_=(R-2*f)*DN[y],E=()=>({width:P,height:R,meta:null}),T=s.dataSources.get(this.id)?.data??[];for(const[w,C]of T.entries()){const I=S[w],O=v[w],z=k.convert(I)+M,B=A.convert(O)+D,H=m?.[w],W=x.enabled&&H!=null?this.getLabelText(H,C,p,"color",b,x,{value:H,datum:C,colorKey:p,colorName:u,xKey:r,yKey:c,xName:l,yName:h}):void 0,V=sp(oN(W),this.properties.label,void 0,this.properties.label,{padding:f},E),G={x:z,y:B,size:0},K=this.getItemStyle({datumIndex:w,datum:C,colorValue:H},!1);if(L.push({series:this,itemId:c,datumIndex:w,yKey:c,xKey:r,xValue:I,yValue:O,colorValue:H,datum:C,point:G,width:P,height:R,midPoint:{x:z,y:B},missing:m!=null&&H==null,style:K}),V?.label!=null){const{text:Q,fontSize:X,lineHeight:Y,height:J}=V.label,{fontStyle:ie,fontFamily:U,fontWeight:he,color:ne}=this.properties.label,Z=G.x+F*(P-2*f),le=G.y+_*(R-2*f)-(V.height-J)*.5;N.push({series:this,itemId:c,datum:C,datumIndex:w,text:Q,fontSize:X,lineHeight:Y,fontStyle:ie,fontFamily:U,fontWeight:he,color:ne,textAlign:g,textBaseline:y,x:Z,y:le,style:K})}}return{itemId:this.properties.yKey??this.id,nodeData:L,labelData:N,scales:this.calculateScaling(),visible:this.visible}}nodeFactory(){return new yN}update(e){return this.ctx.animationManager.skipCurrentBatch(),super.update(e)}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,o=t??[];return i.update(o)}getItemStyle({datumIndex:e,datum:t,colorValue:i},o){const{properties:s}=this,{itemStyler:a,stroke:n,strokeWidth:r,strokeOpacity:l}=s,c=this.getHighlightStyle(o,e),h=Fm(c,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:n,strokeWidth:r,strokeOpacity:l,opacity:1});let p;return a!=null&&e!=null&&(p=this.cachedDatumCallback(uN(e,o?"highlight":"node"),()=>{const u=this.makeItemStylerParams(t,e,o,h);return this.callWithContext(a,u)})),p?Fm(p,h):h}makeItemStylerParams(e,t,i,o){const{id:s,properties:a}=this,{xKey:n,yKey:r}=a,l=this.ctx.highlightManager?.getActiveHighlight(),c=this.getHighlightStateString(l,i,t),h=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:e,xKey:n,yKey:r,highlighted:i,highlightState:c,...o,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o,t)})}updateDatumNodes({datumSelection:e}){const t=this.axes[di.X],[i,o]=t?.visibleRange??[],a=!(i!==0||o!==1);e.each((n,r)=>{const{point:l,width:c,height:h,style:p}=r;mN(n,p),n.crisp=a,n.x=Math.floor(l.x-c/2),n.y=Math.floor(l.y-h/2),n.width=Math.ceil(c),n.height=Math.ceil(h)})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:o}=this.properties.label,s=o?t:[];return i.update(s)}updateLabelNodes(e){const t=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((i,o)=>{i.pointerEvents=fN.None,i.text=o.text,i.fillOpacity=this.getHighlightStyle(!1,o.datumIndex)?.opacity??1,bN(this,i,this.properties,this.properties.label,o,!1,t)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,axes:s,properties:a,colorScale:n,ctx:r}=this,{formatManager:l}=r,{xKey:c,xName:h,yKey:p,yName:u,colorKey:g,colorName:y,colorRange:f,title:x,legendItemName:S,tooltip:v}=a,m=s[di.X],b=s[di.Y];if(!i||!o||!m||!b)return;const k=o.dataSources.get(this.id)?.data[e],A=i.resolveColumnById(this,"xValue",o)[e],M=i.resolveColumnById(this,"yValue",o)[e],D=g!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",o)[e]:void 0;if(A==null)return;const L=[];let N;if(D==null)N=f[0];else{N=n.convert(D);const F=i.getDomain(this,"colorValue","value",o),_=l.format(this.callWithContext.bind(this),{type:"number",value:D,datum:k,seriesId:t,legendItemName:S,key:g,source:"tooltip",property:"color",domain:F,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0});L.push({label:y,fallbackLabel:g,value:_??xN(D)})}L.push({label:h,fallbackLabel:c,value:this.getAxisValueText(m,"tooltip",A,k,c,S)},{label:u,fallbackLabel:p,value:this.getAxisValueText(b,"tooltip",M,k,p,S)});const P=this.getItemStyle({datumIndex:e,datum:k,colorValue:D},!1);P.fill!=null&&(N=P.fill);const R=N==null?void 0:{marker:{shape:"square",fill:N,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(v,{title:x??S,symbol:R,data:L},{seriesId:t,datum:k,title:x,xKey:c,xName:h,yKey:p,yName:u,colorKey:g,colorName:y,...P})}getLegendData(e){return e!=="gradient"||!this.isColorScaleValid()||!this.dataModel?[]:[{legendType:"gradient",enabled:this.visible,seriesId:this.id,series:this.getFormatterContext("color"),colorDomain:this.colorScale.domain,colorRange:this.colorScale.range}]}isLabelEnabled(){return this.properties.label.enabled&&!!this.properties.colorKey}getBandScalePadding(){return{inner:0,outer:0}}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e];if(t===void 0)return;const{width:i,height:o,midPoint:s}=t,a={x:s.x-i/2,y:s.y-o/2,width:i,height:o};return cN(this,a)}initQuadTree(e){SN(e,this.datumNodesIter())}pickNodesExactShape(e){const t=Hm(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return Hm(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Bl.className="HeatmapSeries",Bl.type="heatmap";import{_ModuleSupport as MN}from"ag-charts-community";import{arrayOf as AN,color as IN,constant as LN,required as np,string as Ra}from"ag-charts-core";var{commonSeriesOptionsDefs:TN,heatmapSeriesThemeableOptionsDef:CN,without:Vm}=MN,NN={...Vm(CN,["showInLegend"]),...Vm(TN,["showInLegend"]),type:np(LN("heatmap")),xKey:np(Ra),yKey:np(Ra),colorKey:Ra,xName:Ra,yName:Ra,colorName:Ra,colorRange:AN(IN)};import{_ModuleSupport as zl}from"ag-charts-community";var wN={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},colorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},zl.SAFE_RANGE2_OPERATION]},label:{...zl.LABEL_BOXING_DEFAULTS,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:zl.singleSeriesHighlightStyle()},gradientLegend:{enabled:!0,...zl.LEGEND_CONTAINER_THEME}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:Wm,CARTESIAN_POSITION:Gm}}=tN,PN={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"heatmap",moduleFactory:e=>new Bl(e),defaultAxes:[{type:Wm.CATEGORY,position:Gm.LEFT},{type:Wm.CATEGORY,position:Gm.BOTTOM}],themeTemplate:wN},Km={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,options:NN,create:e=>new Bl(e)};import{_ModuleSupport as ON}from"ag-charts-community";import{_ModuleSupport as _N}from"ag-charts-community";var{applyShapeStyle:RN}=_N,Fl=class extends km{constructor(){super(...arguments),this.properties=new Pl}nodeFactory(){const e=new Dm;return e.lineCap="square",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o.datumIndex,t,void 0,o.itemId)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i,properties:o}=this;if(!i)return;const s=this.ctx.highlightManager.getActiveHighlight(),{up:a,down:n}=o.item;e.each((r,l)=>{const{centerX:c,width:h,y:p,height:u,yOpen:g,yClose:y,crisp:f}=l,x=l.isRising?a:n;r.centerX=c,r.width=h,r.y=p,r.height=u,r.yOpen=g,r.yClose=y,r.crisp=f;const S=l.style??i.styles[l.itemId][this.getHighlightState(s,t,l.datumIndex)];RN(r,S),r.strokeAlignment=x.strokeWidth})}getLegendData(e){const{id:t,data:i,ctx:{legendManager:o},visible:s}=this,{xKey:a,yName:n,item:{up:r,down:l},showInLegend:c,legendItemName:h}=this.properties;if(!i?.data.length||!a||e!=="category")return[];const p={type:"gradient",gradient:"linear",colorSpace:"rgb",colorStops:[{color:r.stroke,stop:0},{color:r.stroke,stop:.5},{color:l.stroke,stop:.5}],rotation:90};return[{legendType:"category",id:t,itemId:t,seriesId:t,enabled:s&&o.getItemEnabled({seriesId:t,itemId:t}),label:{text:h??n??t},symbol:{marker:{fill:p,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};Fl.className="ohlc",Fl.type="ohlc";import{_ModuleSupport as EN}from"ag-charts-community";import{boolean as BN,constant as zN,number as FN,required as Ea,string as Ii,undocumented as $m}from"ag-charts-core";var{commonSeriesOptionsDefs:HN,ohlcSeriesThemeableOptionsDef:VN}=EN,rp={...HN,...VN,type:Ea(zN("ohlc")),xKey:Ea(Ii),openKey:Ea(Ii),highKey:Ea(Ii),lowKey:Ea(Ii),closeKey:Ea(Ii),xName:Ii,yName:Ii,openName:Ii,highName:Ii,lowName:Ii,closeName:Ii};rp.pickOutsideVisibleMinorAxis=$m(BN),rp.focusPriority=$m(FN);var{ThemeConstants:{CARTESIAN_AXIS_TYPE:Hl,CARTESIAN_POSITION:jm},multiSeriesHighlightStyle:WN}=ON,GN={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"ohlc",moduleFactory:e=>new Fl(e),defaultAxes:[{type:Hl.NUMBER,position:jm.LEFT},{type:Hl.ORDINAL_TIME,position:jm.BOTTOM}],themeTemplate:{animation:{enabled:!1},series:{item:{up:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"up.stroke"}]}},down:{stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:"down.stroke"}]}}},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:WN(!1)},axes:{[Hl.NUMBER]:{crosshair:{snap:!1}},[Hl.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},groupable:!1},Ym={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,options:rp,create:e=>new Fl(e)};import{_ModuleSupport as Um}from"ag-charts-community";import{_ModuleSupport as Vl}from"ag-charts-community";import{_ModuleSupport as KN}from"ag-charts-community";var{AGGREGATION_INDEX_Y_MAX:$N,AGGREGATION_INDEX_Y_MIN:jN,aggregationDomain:YN,aggregationIndexForXRatio:Xm,aggregationRangeFittingPoints:UN,aggregationXRatioForXValue:Zm,compactAggregationIndices:XN,createAggregationIndices:ZN}=KN,qN=1e3;function qm(e,t,i,o,s,a,n){const r=e[a];if(r==null)return!1;const l=Zm(r,t,i,n),c=Xm(l,s);return a===o[c+$N]}function Qm(e,t,i,o,s,a,n){const r=e[a];if(r==null)return!1;const l=Zm(r,t,i,n),c=Xm(l,s);return a===o[c+jN]}function QN(e,t,i,o,s,a,n){if(t.length64;)({maxRange:c}=XN(h,p,c,{inPlace:!0})),u=u.filter(f=>qm(t,r,l,h,c,f,a)),g=g.filter(f=>Qm(t,r,l,h,c,f,a)),y.push({maxRange:c,topIndices:u,bottomIndices:g});return y.reverse(),y}import{_ModuleSupport as JN}from"ag-charts-community";function Jm({span:e},t){switch(e.type){case"linear":case"step":case"multi-line":{const i=(t-e.x0)/(e.x1-e.x0);return e.y0+i*(e.y1-e.y0)}case"cubic":{const{cp0x:i,cp0y:o,cp1x:s,cp1y:a,cp2x:n,cp2y:r,cp3x:l,cp3y:c}=e;let h=.5;const p=1e-6;for(let g=0;g<10;g++){const y=1-h,x=y*y*y*i+3*y*y*h*s+3*y*h*h*n+h*h*h*l-t;if(Math.abs(x)=a.x&&t<=n.x)return{span:s,index:o};if(tl;return{intersection:o===c?null:{x:i,y:r},spanIndex:a.index,isInverted:c}}function tw(e,t,i,o,s=!1){if(e.length===0||t.length===0)return[];const a=[];let n=s,r=0;for(let l=i;l<=o;l+=.5){const c=ew(e,t,l,n,r);c.intersection&&a.push(c.intersection.x),r=c.spanIndex,n=c.isInverted}return a}function iw(e,t,i,o,s={}){const a=Math.max(t.x,i.width-(t.x+t.width)),n=Math.max(t.y,i.height-(t.y+t.height)),r=[],l=(h,p)=>({x0:h,y0:-n,x1:p,y1:t.height+n});o&&r.push({clipRect:l(-a,e[0]??t.width+a),...s});const c=o?1:0;for(let h=c;h{Ba(l,c,t.removed),Ba(l,c,i.removed)},a=(l,c)=>{Ba(l,c,t.moved),Ba(l,c,i.moved)},n=(l,c)=>{Ba(l,c,t.added),Ba(l,c,i.added)},r=pw(e,o);return{status:e,path:{addPhaseFn:n,updatePhaseFn:a,removePhaseFn:s},pathProperties:r}}function gw(e,t,i){const o=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(o!==s||!tx(e.scales.x)||!tx(t.scales.x))return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const n=Kl({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},Gl.Split);if(n==null)return;const r=Kl({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},Gl.Split);if(r==null)return;const l=Kl({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},Gl.Split);if(l==null)return;const c=Kl({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},Gl.Split);if(c==null)return;const h="fade",p=dw(a,n,r,h),u=uw(a,l,c,h),g=(i?.changed??!0)||!ix(e.scales.x,t.scales.x)||!ix(e.scales.y,t.scales.y)||a!=="updated";return{status:a,fill:p,stroke:u,hasMotion:g}}var{valueProperty:ox,keyProperty:yw,ChartAxisDirection:Qe,mergeDefaults:fw,updateLabelNode:mw,fixNumericExtent:sx,buildResetPathFn:xw,resetLabelFn:Sw,resetMarkerFn:bw,resetMarkerPositionFn:ax,pathSwipeInAnimation:vw,resetMotion:kw,markerSwipeScaleInAnimation:Dw,seriesLabelFadeInAnimation:dp,animationValidation:Mw,diff:Aw,updateClipPath:pp,computeMarkerFocusBounds:nx,plotAreaPathFill:Iw,plotLinePathStroke:rx,interpolatePoints:lx,pathFadeInAnimation:up,markerFadeInAnimation:cx,fromToMotion:gp,pathMotion:yp,extent:Lw,applyShapeFillBBox:Tw,PointerEvents:$l,Marker:Cw,BBox:Nw,findMinMax:ww,applyShapeStyle:Pw,processedDataIsAnimatable:Ow,simpleMemorize2:_w,markerEnabled:Rw,getMarkerStyles:Ew,calculateSegments:Bw,toHighlightString:zw,HighlightState:Fw}=Vl,Hw=_w(QN),Vw=class extends Vl.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.xKey=o.properties.xKey,this.yLowKey=o.properties.yLowKey,this.yHighKey=o.properties.yHighKey}},Ww=Vl.CartesianSeries,jl=class extends Ww{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[Vl.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[Qe.X]:["xKey"],[Qe.Y]:["yLowKey","yHighKey"]},propertyNames:{[Qe.X]:["xName"],[Qe.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:xw({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:Sw,datum:(t,i)=>({...bw(t),...ax(t,i)})},clipFocusBox:!1}),this.properties=new be,this.NodeEvent=Vw,this.dataAggregationFilters=void 0}async processData(e){const{xKey:t,yLowKey:i,yHighKey:o}=this.properties,s=this.axes[Qe.X]?.scale,a=this.axes[Qe.Y]?.scale,{xScaleType:n,yScaleType:r}=this.getScaleInformation({xScale:s,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();!this.ctx.animationManager.isSkipped()&&this.processedData&&l.push(Aw(this.id,this.processedData)),c&&l.push(Mw());const{dataModel:h,processedData:p}=await this.requestDataModel(e,this.data,{props:[yw(t,n,{id:"xValue"}),ox(i,r,{id:"yLowValue"}),ox(o,r,{id:"yHighValue"}),...l]});this.dataAggregationFilters=this.aggregateData(h,p),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||Ow(t))return;const i=this.axes[Qe.X];if(i==null)return;const o=e.resolveKeysById(this,"xValue",t),s=e.resolveColumnById(this,"yHighValue",t),a=e.resolveColumnById(this,"yLowValue",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n],l=e.resolveColumnNeedsValueOf(this,"xValue",t),c=e.resolveColumnNeedsValueOf(this,"yHighValue",t);return Hw(i.scale.type,o,s,a,r,l,c)}xCoordinateRange(e){const t=this.axes[Qe.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[Qe.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return[];const{domain:{keys:[o]}}=t;if(e===Qe.X){const s=i.resolveProcessedDataDefById(this,"xValue");return s?.def.type==="key"&&s.def.valueType==="category"?o:sx(Lw(o))}else{const s=this.domainForClippedRange(Qe.Y,["yHighValue","yLowValue"],"xValue"),a=ww(s);return sx(a)}}getSeriesRange(e,t){return this.domainForVisibleRange(Qe.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeData(){const{data:e,dataModel:t,processedData:i,axes:o}=this,s=o[Qe.X],a=o[Qe.Y];if(!(e&&s&&a&&t&&i&&this.chart?.seriesRect))return;const n=s.scale,r=a.scale,{xKey:l,yLowKey:c,yHighKey:h,connectMissingData:p,interpolation:u,fill:g,fillOpacity:y,item:f}=this.properties,x=i.dataSources.get(this.id)?.data??[],S=(n.bandwidth??0)/2,v=t.resolveKeysById(this,"xValue",i),m=t.resolveColumnById(this,"yHighValue",i),b=t.resolveColumnById(this,"yLowValue",i),k=V=>n.convert(v[V])+S,A=[],M=[],D=[],L=(V,G,K)=>{const Q=x[V],X=v[V];if(X==null)return;const Y=D.at(-1);if(Number.isFinite(G)&&Number.isFinite(K)){const J=(le,oe,ge)=>{const{size:ce}=f[le].marker;M.push({index:V,series:this,itemId:le,datum:Q,datumIndex:V,midPoint:{x:U,y:ge},yHighValue:G,yLowValue:K,xValue:X,xKey:l,yLowKey:c,yHighKey:h,point:{x:U,y:ge,size:ce},enabled:!0});const me=this.createLabelData({datumIndex:V,point:{x:U,y:ge},value:oe,yLowValue:K,yHighValue:G,itemId:le,inverted:ie,datum:Q,series:this});A.push(me)},ie=K>G,U=k(V),he=r.convert(G),ne=r.convert(K);J("high",G,he),J("low",K,ne);const Z={high:{point:{x:U,y:he},xDatum:X,yDatum:G},low:{point:{x:U,y:ne},xDatum:X,yDatum:K}};Array.isArray(Y)?Y.push(Z):Y==null?D.push([Z]):(Y.skip+=1,D.push([Z]))}else p||(Array.isArray(Y)||Y==null?D.push({skip:0}):Y.skip+=1)},{dataAggregationFilters:N}=this,[P,R]=n.range,F=Math.abs(R-P),_=N?.find(V=>V.maxRange>F),E=_?.topIndices,T=_?.bottomIndices;let[w,C]=this.visibleRangeIndices("xValue",s.range,E);w=Math.max(w-1,0),C=Math.min(C+1,E?.length??v.length),i.input.count<1e3&&(w=0,C=i.input.count);for(let V=w;V{if(!Array.isArray(V))return[];const G=V.map(K=>K.high);return lx(G,u)}),O=D.flatMap(V=>{if(!Array.isArray(V))return[];const G=V.map(K=>K.low);return lx(G,u)}),z=Bw(this.properties.segmentation,s,a,this.chart.seriesRect,this.ctx.scene,!1);let B;if(this.properties.invertedStyle.enabled){const V=m[0]{const G=f[V],{stroke:K,strokeWidth:Q,strokeOpacity:X}=G,Y={fill:g,fillOpacity:y,stroke:K,strokeWidth:Q,strokeOpacity:X};return Ew(this,G,G.marker,Y)};return{itemId:`${c}-${h}`,labelData:A,nodeData:M,fillData:{itemId:"high",spans:I,phantomSpans:O},highStrokeData:{itemId:"high",spans:I},lowStrokeData:{itemId:"low",spans:O},scales:this.calculateScaling(),visible:this.visible,styles:{low:H("low"),high:H("high")},segments:z,intersectionSegments:B}}createLabelData({datumIndex:e,point:t,value:i,itemId:o,inverted:s,datum:a,series:n}){const{xKey:r,yLowKey:l,yHighKey:c,xName:h,yName:p,yLowName:u,yHighName:g,legendItemName:y,label:f}=this.properties,{placement:x}=f,S=f.spacing+(typeof f.padding=="number"?f.padding:0);let v=o;s&&(v=o==="low"?"high":"low");const m=x==="outside"&&v==="high"||x==="inside"&&v==="low"?-1:1,b=this.getSeriesDomain(Qe.Y);return{x:t.x,y:t.y+S*m,series:n,itemId:o,datum:a,datumIndex:e,text:this.getLabelText(i,a,o==="high"?c:l,"y",b,f,{value:i,datum:a,itemId:o,xKey:r,yLowKey:l,yHighKey:c,xName:h,yLowName:u,yHighName:g,yName:p,legendItemName:y}),textAlign:"center",textBaseline:m===-1?"bottom":"top"}}isPathOrSelectionDirty(){const{low:e,high:t}=this.properties.item;return e.marker.isDirty()||t.marker.isDirty()}strokewidthChange(){const e=t=>{const i=this.properties.item[t].strokeWidth??0,o=this.properties.highlight.highlightedSeries.item?.[t]?.strokeWidth??i,s=this.properties.highlight.highlightedItem.item?.[t]?.strokeWidth??i;return i>s||o>s};return e("low")||e("high")}updatePathNodes(e){const{visible:t}=e,[i,o,s]=e.paths,a=this.contextNodeData?.segments,n=this.ctx.highlightManager?.getActiveHighlight(),r=this.getHighlightState(n,!1),l=this.getHighlightStyle(),{item:c,fill:h,fillOpacity:p,opacity:u}=fw(l,this.getStyle(!1,r));o.setProperties({datum:a,segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:$l.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:u,visible:t}),s.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:$l.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:u,visible:t});const g=this.getShapeFillBBox();Tw(i,h,g),Pw(i,{stroke:void 0,fill:h,fillOpacity:p,opacity:u},g);const y=this.contextNodeData?.intersectionSegments??a;i.setProperties({segments:y,pointerEvents:$l.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:u,visible:t}),i.datum=y,pp(this,i),pp(this,o),pp(this,s)}updatePaths(e){this.updateAreaPaths(e.paths,e.contextData)}updateAreaPaths(e,t){for(const i of e)i.visible=t.visible;if(t.visible)this.updateFillPath(e,t),this.updateStrokePath(e,t);else for(const i of e)i.path.clear(),i.markDirty("RangeArea")}updateFillPath(e,t){const[i]=e;i.path.clear(),Iw(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i,o]=e;i.path.clear(),o.path.clear(),rx(i,t.lowStrokeData.spans),rx(o,t.highStrokeData.spans),i.markDirty("RangeArea"),o.markDirty("RangeArea")}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,{processedData:o,axes:s,properties:a}=this,n=a.styler?this.getStylerMarkerOptions().item:a.item,{low:r,high:l}=n,c=Rw(o.input.count,s[Qe.X].scale,{enabled:r.marker.enabled||l.marker.enabled});(a.item.low.marker.isDirty()||a.item.high.marker.isDirty())&&(i.clear(),i.cleanup());let h;if(c)if(r.marker.enabled&&l.marker.enabled)h=t;else{h=[];for(const p of t)n[p.itemId].marker.enabled&&h.push(p)}else h=[];return i.update(h)}updateDatumStyles({datumSelection:e,isHighlight:t}){const i=this.ctx.highlightManager.getActiveHighlight();e.each((o,s)=>{const a=this.getHighlightState(i,t,s.datumIndex),n=this.getStyle(t,a),{fill:r,fillOpacity:l,item:c}=n,{stroke:h,strokeWidth:p,strokeOpacity:u}=c[s.itemId],{marker:g}=this.properties.item[s.itemId],y=this.makeItemStylerParams(s.itemId);s.style=this.getMarkerStyle(g,s,y,{isHighlight:t,highlightState:a,resolveMarkerSubPath:["item",s.itemId,"marker"]},n.item[s.itemId].marker,{fill:r,fillOpacity:l,stroke:h,strokeWidth:p,strokeOpacity:u})})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:o}=e,s=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight();i.each((n,r)=>{const{itemId:l}=r,c=r.style??t.styles[l][this.getHighlightState(a,o,r.datumIndex)];this.applyMarkerStyle(c,n,r.point,s)}),o||(this.properties.item.low.marker.markClean(),this.properties.item.high.marker.markClean())}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,o=>{o.pointerEvents=$l.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,s)=>{o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,mw(this,o,t,this.properties.label,s,!1,i)})}getHighlightData(e,t){const i=e.filter(o=>o.datum===t.datum);return i.length>0?i:void 0}getStyle(e,t){return this.getStylerCouple(e,t)[0]}getStylerMarkerOptions(){return this.getStylerCouple(!1)[1]}getStylerCouple(e,t){const{fill:i,fillOpacity:o,item:s,styler:a}=this.properties;let n={};if(a){const h=this.makeStylerParams(e,t);n=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(a,h)??{},{pick:!1})??{}}const r={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},l=h=>{const p=n.item?.[h],{lineDash:u,lineDashOffset:g,marker:y,stroke:f,strokeOpacity:x,strokeWidth:S}=s[h];return r.item[h].marker.enabled=p?.marker?.enabled??y.enabled,{marker:{fill:p?.marker?.fill??y.fill??i,fillOpacity:p?.marker?.fillOpacity??y.fillOpacity,shape:p?.marker?.shape??y.shape,size:p?.marker?.size??y.size,lineDash:p?.marker?.lineDash??y.lineDash,lineDashOffset:p?.marker?.lineDashOffset??y.lineDashOffset,stroke:p?.marker?.stroke??y.stroke??f,strokeOpacity:p?.marker?.strokeOpacity??y.strokeOpacity,strokeWidth:p?.marker?.strokeWidth??y.strokeWidth},lineDash:p?.lineDash??u,lineDashOffset:p?.lineDashOffset??g,stroke:p?.stroke??f,strokeOpacity:p?.strokeOpacity??x,strokeWidth:p?.strokeWidth??S}};return[{fill:n.fill??i,fillOpacity:n.fillOpacity??o,opacity:1,topLevel:{lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,marker:this.properties.marker,stroke:this.properties.stroke,strokeOpacity:this.properties.strokeOpacity,strokeWidth:this.properties.strokeWidth},item:{low:l("low"),high:l("high")}},r]}makeStylerParams(e,t){const{id:i}=this,{fill:o,fillOpacity:s,item:a,xKey:n,yHighKey:r,yLowKey:l}=this.properties,c=zw(t??Fw.None),h=p=>{const{lineDash:u,lineDashOffset:g,marker:y,stroke:f,strokeOpacity:x,strokeWidth:S}=a[p];return{marker:{fill:y.fill??o,fillOpacity:y.fillOpacity,size:y.size,shape:y.shape,stroke:y.stroke??f,strokeOpacity:y.strokeOpacity,strokeWidth:y.strokeWidth,lineDash:y.lineDash,lineDashOffset:y.lineDashOffset},lineDash:u,lineDashOffset:g,stroke:f,strokeOpacity:x,strokeWidth:S}};return{item:{low:h("low"),high:h("high")},fill:o,fillOpacity:s,highlightState:c,highlighted:e,seriesId:i,xKey:n,yLowKey:l,yHighKey:r}}makeItemStylerParams(e){const{xKey:t,yLowKey:i,yHighKey:o}=this.properties;return{xKey:t,yLowKey:i,yHighKey:o,itemId:e}}getTooltipContent(e,t){const i=t?.itemId??"high",{id:o,dataModel:s,processedData:a,axes:n,properties:r}=this,{xName:l,yName:c,yLowKey:h,yLowName:p,xKey:u,yHighKey:g,yHighName:y,tooltip:f,legendItemName:x}=r,S=n[Qe.X],v=n[Qe.Y];if(!s||!a||!S||!v)return;const m=a.dataSources.get(this.id)?.data[e],b=s.resolveKeysById(this,"xValue",a)[e],k=s.resolveColumnById(this,"yHighValue",a)[e],A=s.resolveColumnById(this,"yLowValue",a)[e];if(b==null)return;const M=this.getStyle(!1),D=this.makeItemStylerParams(i),L=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:e,datum:m},D,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},M.item[i].marker),N=`${this.getAxisValueText(v,"tooltip",A,m,h,x)} - ${this.getAxisValueText(v,"tooltip",k,m,g,x)}`;return this.formatTooltipWithContext(f,{heading:this.getAxisValueText(S,"tooltip",b,m,u,x),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${p??h} - ${y??g}`,value:N}]},{seriesId:o,datum:m,title:c,itemId:i,xName:l,yName:c,yLowKey:h,yLowName:p,xKey:u,yHighKey:g,yHighName:y,legendItemName:x,...L})}legendItemSymbol(){const{fill:e,topLevel:t}=this.getStyle(!1),{stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,marker:n}=t;return{marker:{shape:n.shape,fill:n.fill??e,stroke:n.stroke??i,fillOpacity:n.fillOpacity,strokeOpacity:n.strokeOpacity,strokeWidth:n.strokeWidth,lineDash:n.lineDash,lineDashOffset:n.lineDashOffset},line:{stroke:i,strokeOpacity:s,strokeWidth:o,lineDash:a}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yLowKey:o,yHighKey:s,yName:a,yLowName:n,yHighName:r,legendItemName:l,showInLegend:c}=this.properties,h=l??a??`${n??o} - ${r??s}`,p=`${o}-${s}`;return[{legendType:"category",id:t,itemId:p,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}nodeFactory(){return new Cw}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:o,paths:s}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(s,o),vw(this,a,...s),kw([t],ax),Dw(this,a,t),dp(this,"labels",a,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{datumSelection:i,labelSelection:o,contextData:s,paths:a,previousContextData:n}=e,[r,l,c]=a;if(r==null&&l==null&&c==null)return;this.resetDatumAnimation(e),this.resetLabelAnimation(e);const h=()=>{this.resetPathAnimation(e),this.updateAreaPaths(a,s)},p=()=>{t.skipCurrentBatch(),h()};if(s==null||n==null){h(),cx(this,t,"added",i),up(this,"fill_path_properties",t,"add",r),up(this,"low_stroke_path_properties",t,"add",l),up(this,"high_stroke_path_properties",t,"add",c),dp(this,"labels",t,o);return}const u=gw(s,n,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){p();return}else if(u.status==="no-op")return;gp(this.id,"fill_path_properties",t,[r],u.fill.pathProperties),gp(this.id,"low_stroke_path_properties",t,[l],u.stroke.pathProperties),gp(this.id,"high_stroke_path_properties",t,[c],u.stroke.pathProperties),u.status==="added"?this.updateAreaPaths(a,s):u.status==="removed"?this.updateAreaPaths(a,n):(yp(this.id,"fill_path_update",t,[r],u.fill.path),yp(this.id,"low_stroke_path_update",t,[l],u.stroke.path),yp(this.id,"high_stroke_path_update",t,[c],u.stroke.path)),u.hasMotion&&(cx(this,t,void 0,i),dp(this,"labels",t,o)),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(a,s)})}getFormattedMarkerStyle(e){const t=this.getStyle(!1),i=this.makeItemStylerParams(e.itemId);return this.getMarkerStyle(this.properties.item[e.itemId].marker,e,i,{isHighlight:!0,resolveMarkerSubPath:["item",e.itemId,"marker"]},void 0,t)}getMarkerStyle(e,t,i,o,s,a){return e.itemStyler=this.properties.marker.itemStyler,super.getMarkerStyle(e,t,i,o,s,a)}computeFocusBounds(e){const t=nx(this,e),i=nx(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return Nw.merge([t,i])}isDatumEnabled(e,t){return t%2===0&&super.isDatumEnabled(e,t)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};jl.className="RangeAreaSeries",jl.type="range-area";import{_ModuleSupport as Gw}from"ag-charts-community";import{boolean as hx,constant as Kw,fillOptionsDef as $w,number as jw,required as Yl,shapeSegmentation as Yw,string as qo,undocumented as dx}from"ag-charts-core";var{commonSeriesOptionsDefs:Uw,rangeAreaSeriesThemeableOptionsDef:Xw}=Gw,fp={...Uw,...Xw,type:Yl(Kw("range-area")),xKey:Yl(qo),yLowKey:Yl(qo),yHighKey:Yl(qo),xName:qo,yName:qo,yLowName:qo,yHighName:qo,legendItemName:qo,segmentation:Yw,invertedStyle:{enabled:hx,...$w}};fp.pickOutsideVisibleMinorAxis=dx(hx),fp.focusPriority=dx(jw);import{_ModuleSupport as Je}from"ag-charts-community";var px={lineDash:{$path:"/series/$index/lineDash"},lineDashOffset:{$path:"/series/$index/lineDashOffset"},stroke:{$path:["/series/$index/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/strokeOpacity"},strokeWidth:{$path:["/series/$index/strokeWidth",1]},marker:{enabled:{$path:"/series/$index/marker/enabled"},fill:{$isUserOption:["/series/$index/marker/fill",{$if:[{$or:[{$isGradient:{$path:"/series/$index/marker/fill"}},{$isImage:{$path:"/series/$index/marker/fill"}},{$isPattern:{$path:"/series/$index/marker/fill"}}]},{$merge:[{$path:"/series/$index/marker/fill"},{$applySwitch:[{$path:"type"},void 0,["gradient",Je.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",Je.FILL_IMAGE_DEFAULTS],["pattern",Je.FILL_PATTERN_DEFAULTS]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Je.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",Je.FILL_IMAGE_DEFAULTS],["pattern",Je.FILL_PATTERN_DEFAULTS]]}]},fillOpacity:{$path:"/series/$index/marker/fillOpacity"},lineDash:{$path:"/series/$index/marker/lineDash"},lineDashOffset:{$path:"/series/$index/marker/lineDashOffset"},shape:{$path:"/series/$index/marker/shape"},size:{$path:["/series/$index/marker/size",6]},stroke:{$path:["/series/$index/marker/stroke",{$palette:"stroke"}]},strokeOpacity:{$path:"/series/$index/marker/strokeOpacity"},strokeWidth:{$path:["/series/$index/marker/strokeWidth",2]}}},Zw={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Je.FILL_GRADIENT_LINEAR_DEFAULTS],["pattern",Je.FILL_PATTERN_DEFAULTS]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Je.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",Je.FILL_IMAGE_DEFAULTS],["pattern",Je.FILL_PATTERN_DEFAULTS]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2},nodeClickRange:"nearest",item:{low:px,high:px},label:{...Je.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"outside",padding:{$isUserOption:["./spacing",0,10]},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},interpolation:{type:"linear"},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:Je.multiSeriesHighlightStyle(),segmentation:Je.SEGMENTATION_DEFAULTS,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Je.FILL_GRADIENT_LINEAR_DEFAULTS],["image",Je.FILL_IMAGE_DEFAULTS],["pattern",Je.FILL_PATTERN_DEFAULTS]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{[Je.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},{ThemeConstants:{CARTESIAN_AXIS_TYPE:ux,CARTESIAN_POSITION:gx}}=Um,qw={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-area",moduleFactory:e=>new jl(e),predictAxis:Um.predictCartesianTimeAxis,defaultAxes:[{type:ux.NUMBER,position:gx.LEFT},{type:ux.CATEGORY,position:gx.BOTTOM}],themeTemplate:Zw},yx={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,options:fp,create:e=>new jl(e)};import{_ModuleSupport as fx}from"ag-charts-community";import{_ModuleSupport as Ul}from"ag-charts-community";import{_ModuleSupport as Qw}from"ag-charts-community";var{aggregationDomain:Jw,aggregationRangeFittingPoints:eP,compactAggregationIndices:tP,createAggregationIndices:iP}=Qw,oP=1e3;function sP(e,t,i,o,s,a){if(t.length64;)({indexData:c,valueData:h,maxRange:l}=tP(c,h,l)),p.push({maxRange:l,indexData:c});return p.reverse(),p}import{_ModuleSupport as aP}from"ag-charts-community";var{AbstractBarSeriesProperties:nP,makeSeriesTooltip:rP,Property:Le,DropShadow:lP,Label:cP}=aP,mp=class extends cP{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};d([Le],mp.prototype,"placement",2),d([Le],mp.prototype,"spacing",2);var Oe=class extends nP{constructor(){super(...arguments),this.fill="#99CCFF",this.fillOpacity=1,this.stroke="#99CCFF",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.shadow=new lP().set({enabled:!1}),this.label=new mp,this.tooltip=rP()}};d([Le],Oe.prototype,"xKey",2),d([Le],Oe.prototype,"yLowKey",2),d([Le],Oe.prototype,"yHighKey",2),d([Le],Oe.prototype,"xName",2),d([Le],Oe.prototype,"yName",2),d([Le],Oe.prototype,"yLowName",2),d([Le],Oe.prototype,"yHighName",2),d([Le],Oe.prototype,"fill",2),d([Le],Oe.prototype,"fillOpacity",2),d([Le],Oe.prototype,"stroke",2),d([Le],Oe.prototype,"strokeWidth",2),d([Le],Oe.prototype,"strokeOpacity",2),d([Le],Oe.prototype,"lineDash",2),d([Le],Oe.prototype,"lineDashOffset",2),d([Le],Oe.prototype,"cornerRadius",2),d([Le],Oe.prototype,"styler",2),d([Le],Oe.prototype,"itemStyler",2),d([Le],Oe.prototype,"shadow",2),d([Le],Oe.prototype,"label",2),d([Le],Oe.prototype,"tooltip",2);var{SeriesNodePickMode:mx,valueProperty:xx,keyProperty:hP,ChartAxisDirection:Fn,checkCrisp:dP,updateLabelNode:pP,SMALLEST_KEY_INTERVAL:uP,LARGEST_KEY_INTERVAL:gP,diff:yP,prepareBarAnimationFunctions:Sx,midpointStartingBarPosition:bx,resetBarSelectionsFn:fP,fixNumericExtent:mP,seriesLabelFadeInAnimation:vx,resetLabelFn:xP,animationValidation:SP,computeBarFocusBounds:bP,visibleRangeIndices:vP,createDatumId:kP,ContinuousScale:DP,Rect:MP,PointerEvents:AP,motion:kx,applyShapeStyle:IP,findMinMax:LP,areScalingEqual:TP,processedDataIsAnimatable:CP,AGGREGATION_SPAN:Dx,AGGREGATION_INDEX_X_MAX:Mx,AGGREGATION_INDEX_X_MIN:Ax,AGGREGATION_INDEX_Y_MAX:NP,AGGREGATION_INDEX_Y_MIN:wP,mergeDefaults:Ix,simpleMemorize2:PP,getItemStyles:OP,calculateSegments:_P,toHighlightString:RP,HighlightState:Lx}=Ul,EP=PP(sP),BP=class extends Ul.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.xKey=o.properties.xKey,this.yLowKey=o.properties.yLowKey,this.yHighKey=o.properties.yHighKey}},Xl=class extends Ul.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[mx.AXIS_ALIGNED,mx.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:fP,label:xP}}),this.properties=new Oe,this.dataAggregationFilters=void 0,this.NodeEvent=BP}async processData(e){const{xKey:t,yLowKey:i,yHighKey:o}=this.properties,s=this.getCategoryAxis()?.scale,a=this.getValueAxis()?.scale,{isContinuousX:n,xScaleType:r,yScaleType:l}=this.getScaleInformation({xScale:s,yScale:a}),c=[];this.ctx.animationManager.isSkipped()||(this.processedData&&c.push(yP(this.id,this.processedData)),c.push(SP()));const h=this.visible?{}:{forceValue:0},{dataModel:p,processedData:u}=await this.requestDataModel(e,this.data,{props:[hP(t,r,{id:"xValue"}),xx(i,l,{id:"yLowValue",invalidValue:null,...h}),xx(o,l,{id:"yHighValue",invalidValue:null,...h}),...n?[uP,gP]:[],...c],groupByKeys:!1});this.smallestDataInterval=u.reduced?.smallestKeyInterval,this.largestDataInterval=u.reduced?.largestKeyInterval,this.dataAggregationFilters=this.aggregateData(p,u),this.animationState.transition("updateData")}aggregateData(e,t){if(t.type!=="ungrouped"||CP(t))return;const i=this.axes[Fn.X];if(i==null)return;const o=e.resolveKeysById(this,"xValue",t),s=e.resolveColumnById(this,"yHighValue",t),a=e.resolveColumnById(this,"yLowValue",t),{index:n}=e.resolveProcessedDataDefById(this,"xValue"),r=t.domain.keys[n];return EP(i.scale.type,o,s,a,r,t.reduced?.smallestKeyInterval)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[o]}=t.domain;if(e===this.getCategoryDirection()){const s=i.resolveProcessedDataDefById(this,"xValue");return s?.def.type==="key"&&s?.def.valueType==="category"?o:this.padBandExtent(o)}else{const s=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),a=LP(s);return mP(a)}}getSeriesRange(e,t){return this.domainForVisibleRange(Fn.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeData(){const{data:e,dataModel:t,groupScale:i,processedData:o,visible:s}=this,a=this.getCategoryAxis(),n=this.getValueAxis();if(!(e&&a&&n&&t&&o?.dataSources&&this.chart?.seriesRect))return;const r=a.scale,l=n.scale,c=this.getBarDirection()===Fn.X,{xKey:h,yLowKey:p,yHighKey:u,strokeWidth:g}=this.properties,y=`${p}-${u}`,f=_P(this.properties.segmentation,a,n,this.chart.seriesRect,this.ctx.scene),x={itemId:y,nodeData:[],labelData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:OP(this.getItemStyle.bind(this)),segments:f};if(!s)return x;const S=o.dataSources.get(this.id)?.data??[],v=t.resolveKeysById(this,"xValue",o),m=t.resolveColumnById(this,"yLowValue",o),b=t.resolveColumnById(this,"yHighValue",o),{barWidth:k,groupIndex:A}=this.updateGroupScale(a),M=DP.is(r)?k*-.5:0,D=i.convert(String(A)),L=dP(a?.scale,a?.visibleRange,this.smallestDataInterval,this.largestDataInterval),N=w=>Math.round(r.convert(v[w]))+D+M,P=(w,C,I,O,z,B,H)=>{const W=S[w],V=v[w];if(V==null)return;const G=m[w],K=b[w];if(!Number.isFinite(G?.valueOf())||!Number.isFinite(K?.valueOf()))return;const[Q,X]=Gw.maxRange>E);if(T!=null){const{maxRange:w,indexData:C}=T,[I,O]=vP(1,w,a.range,z=>{const B=z*Dx,H=C[B+Ax],W=C[B+Mx];if(H===-1)return;const V=Math.trunc((H+W)/2);return[N(V),N(W)+k]});for(let z=I;zthis.getDatumId(s))}getItemStyle(e,t,i){const{properties:o,dataModel:s,processedData:a}=this,{itemStyler:n}=o,r=this.getHighlightStyle(t,e,i);let l=Ix(r,this.getStyle(e===void 0,t,i));if(n&&s!=null&&a!=null&&e!=null){const c=s.resolveKeysById(this,"xValue",a)[e],h=this.cachedDatumCallback(kP(this.getDatumId({xValue:c}),t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(e,t,l);return this.callWithContext(n,p)});h&&(l=Ix(h,l))}return l}makeItemStylerParams(e,t,i){const{id:o,properties:s,processedData:a}=this,{xKey:n,yHighKey:r,yLowKey:l}=s,c=a.dataSources.get(o)?.data[e],h=this.ctx.highlightManager?.getActiveHighlight(),p=this.getHighlightStateString(h,t,e),u=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:o,datum:c,xKey:n,yHighKey:r,yLowKey:l,highlighted:t,highlightState:p,...i,fill:u}}updateDatumStyles(e){const t=this.ctx.highlightManager.getActiveHighlight();e.datumSelection.each((i,o)=>{if(!e.datumSelection.isGarbage(i)){const s=this.getHighlightState(t,e.isHighlight,o.datumIndex);o.style=this.getItemStyle(o.datumIndex,e.isHighlight,s)}})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),s=this.getCategoryDirection()===Fn.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=r.style??i.styles[this.getHighlightState(o,t,r.datumIndex)];IP(n,l,a),n.cornerRadius=l.cornerRadius??0,n.visible=s?r.width>0:r.height>0,n.crisp=r.crisp})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=AP.None})}updateLabelNodes(e){const t={xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xKey,yName:this.properties.yName,yLowKey:this.properties.yLowKey,yLowName:this.properties.yLowName??this.properties.yLowKey,yHighKey:this.properties.yHighKey,yHighName:this.properties.yHighName??this.properties.yHighKey,legendItemName:this.properties.legendItemName},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,s)=>{o.fillOpacity=this.getHighlightStyle(!1,s?.datumIndex).opacity??1,pP(this,o,t,this.properties.label,s,!1,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:n,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:p,tooltip:u,legendItemName:g}=s,y=this.getCategoryAxis(),f=this.getValueAxis();if(!i||!o||!y||!f)return;const x=o.dataSources.get(this.id)?.data[e],S=i.resolveKeysById(this,"xValue",o)[e],v=i.resolveColumnById(this,"yHighValue",o)[e],m=i.resolveColumnById(this,"yLowValue",o)[e];if(S==null)return;const b=this.getItemStyle(e,!1),k=`${this.getAxisValueText(f,"tooltip",m,x,l,g)} - ${this.getAxisValueText(f,"tooltip",v,x,c,g)}`;return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(y,"tooltip",S,x,a,g),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${p??c}`,value:k}]},{seriesId:t,datum:x,title:r,xKey:a,xName:n,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:p,legendItemName:g,...b})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:o,strokeOpacity:s,lineDash:a,lineDashOffset:n}=this.getStyle(!1,!1,Lx.None);return{marker:{fill:e,stroke:t,fillOpacity:o,strokeOpacity:s,strokeWidth:i,lineDash:a,lineDashOffset:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,visible:i}=this,{yName:o,yLowName:s,yHighName:a,yLowKey:n,yHighKey:r,legendItemName:l,showInLegend:c}=this.properties,h=l??o??`${s??n} - ${a??r}`,p=`${n}-${r}`;return[{legendType:"category",id:t,itemId:p,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Sx(bx(this.isVertical(),"normal"),"unknown");kx.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),vx(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:o,previousContextData:s}=e,a=Ul.calculateDataDiff(this.id,t,this.getDatumId.bind(this),o,s,this.processedData,this.processedDataUpdated);this.ctx.animationManager.stopByAnimationGroupId(this.id);const n=s==null?"fade":"normal",r=Sx(bx(this.isVertical(),n),"added");kx.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(l,c)=>this.getDatumId(c),a),(a?.changed||!TP(o.groupScale,s?.groupScale))&&vx(this,"labels",this.ctx.animationManager,i)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return bP(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Xl.className="RangeBarSeries",Xl.type="range-bar";import{_ModuleSupport as zP}from"ag-charts-community";import{boolean as FP,constant as HP,number as VP,required as Zl,shapeSegmentation as WP,string as Qo,undocumented as Tx}from"ag-charts-core";var{commonSeriesOptionsDefs:GP,rangeBarSeriesThemeableOptionsDef:KP}=zP,xp={...GP,...KP,type:Zl(HP("range-bar")),xKey:Zl(Qo),yLowKey:Zl(Qo),yHighKey:Zl(Qo),xName:Qo,yName:Qo,yLowName:Qo,yHighName:Qo,legendItemName:Qo,segmentation:WP};xp.pickOutsideVisibleMinorAxis=Tx(FP),xp.focusPriority=Tx(VP);import{_ModuleSupport as _s}from"ag-charts-community";var $P={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",_s.FILL_GRADIENT_LINEAR_DEFAULTS],["image",_s.FILL_IMAGE_DEFAULTS],["pattern",_s.FILL_PATTERN_DEFAULTS]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{..._s.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:_s.multiSeriesHighlightStyle(),segmentation:_s.SEGMENTATION_DEFAULTS},axes:{[_s.ThemeConstants.CARTESIAN_AXIS_TYPE.NUMBER]:{crosshair:{enabled:!0}}}},jP={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"range-bar",moduleFactory:e=>new Xl(e),predictAxis:fx.predictCartesianTimeAxis,defaultAxes:fx.DIRECTION_SWAP_AXES,themeTemplate:$P,groupable:!0},Cx={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,options:xp,create:e=>new Xl(e)};import{_ModuleSupport as YP}from"ag-charts-community";import{_ModuleSupport as Rs}from"ag-charts-community";import{_ModuleSupport as UP}from"ag-charts-community";var{AbstractBarSeriesProperties:XP,BaseProperties:Hn,PropertiesArray:ZP,makeSeriesTooltip:qP,Property:re,DropShadow:QP,Label:JP}=UP,ql=class extends Hn{};d([re],ql.prototype,"totalType",2),d([re],ql.prototype,"index",2),d([re],ql.prototype,"axisLabel",2);var Nx=class extends Hn{};d([re],Nx.prototype,"renderer",2);var Sp=class extends JP{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};d([re],Sp.prototype,"placement",2),d([re],Sp.prototype,"spacing",2);var mt=class extends Hn{constructor(){super(...arguments),this.fill="#c16068",this.stroke="#c16068",this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=1,this.cornerRadius=0,this.shadow=new QP().set({enabled:!1}),this.label=new Sp,this.tooltip=new Nx}};d([re],mt.prototype,"name",2),d([re],mt.prototype,"fill",2),d([re],mt.prototype,"stroke",2),d([re],mt.prototype,"fillOpacity",2),d([re],mt.prototype,"strokeOpacity",2),d([re],mt.prototype,"lineDash",2),d([re],mt.prototype,"lineDashOffset",2),d([re],mt.prototype,"strokeWidth",2),d([re],mt.prototype,"cornerRadius",2),d([re],mt.prototype,"itemStyler",2),d([re],mt.prototype,"shadow",2),d([re],mt.prototype,"label",2),d([re],mt.prototype,"tooltip",2);var Es=class extends Hn{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};d([re],Es.prototype,"enabled",2),d([re],Es.prototype,"stroke",2),d([re],Es.prototype,"strokeOpacity",2),d([re],Es.prototype,"lineDash",2),d([re],Es.prototype,"lineDashOffset",2),d([re],Es.prototype,"strokeWidth",2);var Ql=class extends Hn{constructor(){super(...arguments),this.positive=new mt,this.negative=new mt,this.total=new mt}};d([re],Ql.prototype,"positive",2),d([re],Ql.prototype,"negative",2),d([re],Ql.prototype,"total",2);var bo=class extends XP{constructor(){super(...arguments),this.item=new Ql,this.totals=new ZP(ql),this.line=new Es,this.tooltip=qP()}getStyle(e){const{fillOpacity:t,strokeWidth:i,strokeOpacity:o,fill:s,stroke:a,lineDash:n,lineDashOffset:r,cornerRadius:l}=this.item[e==="subtotal"?"total":e];return{fill:s,fillOpacity:t,stroke:a,strokeWidth:i,strokeOpacity:o,lineDash:n,lineDashOffset:r,cornerRadius:l,opacity:1}}};d([re],bo.prototype,"xKey",2),d([re],bo.prototype,"yKey",2),d([re],bo.prototype,"xName",2),d([re],bo.prototype,"yName",2),d([re],bo.prototype,"item",2),d([re],bo.prototype,"totals",2),d([re],bo.prototype,"line",2),d([re],bo.prototype,"tooltip",2);var{adjustLabelPlacement:eO,SeriesNodePickMode:wx,fixNumericExtent:tO,valueProperty:Px,keyProperty:iO,accumulativeValueProperty:Jl,trailingAccumulatedValueProperty:oO,ChartAxisDirection:ec,createDatumId:sO,checkCrisp:aO,updateLabelNode:nO,prepareBarAnimationFunctions:rO,collapsedStartingBarPosition:lO,resetBarSelectionsFn:cO,seriesLabelFadeInAnimation:hO,resetLabelFn:dO,animationValidation:pO,DEFAULT_CARTESIAN_DIRECTION_KEYS:uO,DEFAULT_CARTESIAN_DIRECTION_NAMES:gO,computeBarFocusBounds:yO,isContinuous:Ox,Rect:fO,motion:mO,applyShapeStyle:xO,mergeDefaults:_x,getItemStylesPerItemId:SO,DataSet:bO}=Rs,tc=class extends Rs.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:uO,propertyNames:gO,categoryKey:void 0,pickModes:[wx.NEAREST_NODE,wx.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:cO,label:dO}}),this.properties=new bo,this.seriesItemTypes=new Set(["positive","negative","total"])}async processData(e){const{xKey:t,yKey:i,totals:o}=this.properties,{data:s}=this;if(!this.visible)return;const a=v=>Ox(v)&&Number(v)>=0,n=v=>Ox(v)&&Number(v)>=0,r=v=>v==="total"||v==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=o.reduce((v,m)=>{const b=v.get(m.index);return b?b.push(m):v.set(m.index,[m]),v},new Map);for(const[v,m]of s?.data.entries()??[]){c.push(m);const b=h.get(v);if(b)for(const k of b)c.push({...k.toJson(),[t]:k.axisLabel})}const p=[];this.ctx.animationManager.isSkipped()||p.push(pO());const u=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:f,yScaleType:x}=this.getScaleInformation({xScale:u,yScale:g}),{processedData:S}=await this.requestDataModel(e,bO.wrap(c),{props:[iO(t,f,{id:"xValue"}),Jl(i,x,{...l,id:"yCurrent"}),Jl(i,x,{...l,missingValue:0,id:"yCurrentTotal"}),Jl(i,x,{...l,id:"yCurrentPositive",validation:a}),Jl(i,x,{...l,id:"yCurrentNegative",validation:n}),oO(i,x,{...l,id:"yPrevious"}),Px(i,x,{id:"yRaw"}),Px("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...y?[Rs.SMALLEST_KEY_INTERVAL,Rs.LARGEST_KEY_INTERVAL]:[],...p]});this.smallestDataInterval=S.reduced?.smallestKeyInterval,this.largestDataInterval=S.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return[];const{keys:[o],values:s}=t.domain;if(e===this.getCategoryDirection()){const a=i.resolveProcessedDataDefById(this,"xValue");if(a?.def.type==="key"&&a?.def.valueType==="category")return o;const n=e===ec.Y,r=this.getCategoryAxis().isReversed();return this.padBandExtent(o,r!==n)}else{const a=i.resolveProcessedDataIndexById(this,"yCurrent"),n=s[a],r=[Math.min(0,n[0]),Math.max(0,n[1])];return tO(r)}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{data:e,dataModel:t,processedData:i}=this,o=this.getCategoryAxis(),s=this.getValueAxis();if(!e||!o||!s||!t||!i)return;const{line:a}=this.properties,n=o.scale,r=s.scale,l=this.getBarDirection()===ec.X,c=this.getBandwidth(o)??10,h=o.isReversed(),p=s.isReversed();if(i.type!=="ungrouped")return;const u={itemId:this.properties.yKey,nodeData:[],labelData:[],pointData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible,styles:SO(this.getItemStyle.bind(this),"total","subtotal","positive","negative")};if(!this.visible)return u;const g=[],y=t.resolveKeysById(this,"xValue",i),f=t.resolveColumnById(this,"yRaw",i),x=t.resolveColumnById(this,"totalTypeValue",i),S=t.resolveColumnById(this,"yCurrent",i),v=t.resolveColumnById(this,"yPrevious",i),m=t.resolveColumnById(this,"yCurrentTotal",i),b=this.getSeriesDomain(ec.Y),k=aO(o?.scale,o?.visibleRange,this.smallestDataInterval,this.largestDataInterval);function A(E,T,w){return E||T?{cumulativeValue:m[w],trailingValue:T?D:0}:{cumulativeValue:S[w],trailingValue:v[w]}}function M(E,T,w,C,I){return E?C:T?(C??0)-(I??0):w}let D=0;const{xKey:L,yKey:N,xName:P,yName:R}=this.properties,F=i.dataSources.get(this.id)?.data??[];for(const[E,T]of F.entries()){const w=x[E],C=this.isSubtotal(w),I=this.isTotal(w),O=I||C,z=y[E];if(z==null)continue;const B=Math.round(n.convert(z)),H=f[E],{cumulativeValue:W,trailingValue:V}=A(I,C,E);O&&(D=W??0);const G=Math.round(r.convert(W)),K=Math.round(r.convert(V)),Q=M(I,C,H,W,V),X=(Q??0)>=0,Y=this.getSeriesItemType(X,w),{strokeWidth:J,label:ie}=this.getItemConfig(Y),U=X?G:K,he=X?K:G,ne=Math.max(J,Math.abs(he-U)),Z={x:l?Math.min(U,he):B,y:l?B:Math.min(U,he),width:l?ne:c,height:l?c:ne},le={x:Z.x+Z.width/2,y:Z.y+Z.height/2},oe=O?G:K,ge=Math.floor(a.strokeWidth)%2/2,ce=h?G:oe,me=h?oe:G;let $e,Ht;l?($e={x:ce+ge,y:Z.y},Ht={x:me+ge,y:Z.y+Z.height}):($e={x:Z.x,y:ce+ge},Ht={x:Z.x+Z.width,y:me+ge});const ds={x:h?Ht.x:$e.x,y:h?Ht.y:$e.y,x2:h?$e.x:Ht.x,y2:h?$e.y:Ht.y,size:0};g.push(ds);const xi=Y==="subtotal"?"total":Y,_i=this.getLabelText(Q,T,N,"y",b,ie,{itemId:xi,value:Q,datum:T,xKey:L,yKey:N,xName:P,yName:R}),hn=ie.spacing+(typeof ie.padding=="number"?ie.padding:0),dn={index:E,series:this,itemId:Y,datum:T,datumIndex:E,cumulativeValue:W??0,xValue:z,yValue:Q,yKey:N,xKey:L,x:Z.x,y:Z.y,width:Z.width,height:Z.height,midPoint:le,crisp:k,label:{text:_i,...eO({isUpward:(Q??-1)>=0!==p,isVertical:!l,placement:ie.placement,spacing:hn,rect:Z})}};u.nodeData.push(dn),u.labelData.push(dn)}const _=this.properties.line.enabled;return S!=null&&_&&(u.pointData=g),u}updateSeriesItemTypes(){const{dataModel:e,seriesItemTypes:t,processedData:i}=this;if(!e||!i)return;t.clear();const o=e.resolveProcessedDataIndexById(this,"yCurrentPositive"),s=e.resolveProcessedDataIndexById(this,"yCurrentNegative"),a=e.resolveProcessedDataIndexById(this,"totalTypeValue"),n=i.domain.values[o]??[],r=i.domain.values[s]??[];n.length>0&&t.add("positive"),r.length>0&&t.add("negative");const l=i?.domain.values[a];if(l)for(const c of l)(c==="total"||c==="subtotal")&&t.add("total")}isSubtotal(e){return e==="subtotal"}isTotal(e){return e==="total"}nodeFactory(){return new fO}getSeriesItemType(e,t){return t??(e?"positive":"negative")}getItemConfig(e){switch(e){case"positive":return this.properties.item.positive;case"negative":return this.properties.item.negative;case"subtotal":case"total":return this.properties.item.total}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,o=t??[];return i.update(o)}getItemStyle(e,t,i,o="total"){const{properties:s}=this,{datumIndex:a=0,datum:n}=e??{},r=o==="subtotal"?"total":o,l=s.item[r],c=this.getHighlightStyle(t,a,i),h=_x(c,s.getStyle(o)),{itemStyler:p}=l;let u=h;if(p!=null&&e!=null){const g=this.cachedDatumCallback(sO(a,t?"highlight":"node"),()=>{const y=this.makeItemStylerParams(o,a,n,t,u);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",r],this.callWithContext(p,y))});g&&(u=_x(g,u))}return u}makeItemStylerParams(e,t,i,o,s){const{id:a,properties:n}=this,{xKey:r,yKey:l}=n,c=this.ctx.highlightManager?.getActiveHighlight(),h=this.getHighlightStateString(c,o,t),p=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:a,itemId:e,datum:i,xKey:r,yKey:l,highlighted:o,highlightState:h,...s,fill:p}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o,t,void 0,o.itemId)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),s=this.getCategoryDirection()===ec.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=r.style??i.styles[r.itemId][this.getHighlightState(o,t,r.datumIndex)];xO(n,l,a),n.cornerRadius=l.cornerRadius??0,n.visible=s?r.width>0:r.height>0,n.crisp=r.crisp})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;if(t.length===0)return i.update([]);const o=t.filter(s=>{const{label:a}=this.getItemConfig(s.itemId);return a.enabled});return i.update(o)}updateLabelNodes(e){const t={itemId:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,s)=>{t.itemId=s.itemId,o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex)?.opacity??1;const a=this.getItemConfig(s.itemId).label;nO(this,o,t,a,s.label,!1,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,properties:s}=this,{xKey:a,xName:n,yKey:r,yName:l,tooltip:c,legendItemName:h}=s,p=this.getCategoryAxis(),u=this.getValueAxis();if(!i||!o||!p||!u)return;const g=o.dataSources.get(this.id)?.data[e],y=i.resolveKeysById(this,"xValue",o)[e],f=i.resolveColumnById(this,"yRaw",o)[e],x=i.resolveColumnById(this,"yCurrentTotal",o),S=i.resolveColumnById(this,"totalTypeValue",o);if(y==null)return;const v=S[e],m=(f??0)>=0,b=this.getSeriesItemType(m,v);let k;if(this.isTotal(v))k=x[e];else if(this.isSubtotal(v)){k=x[e];for(let D=e-1;D>=0;D-=1)if(this.isSubtotal(S[D])){k=k-x[D];break}}else k=f;const A=this.contextNodeData?.nodeData?.[e],M=this.getItemStyle(A,!1,void 0,A?.itemId);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(p,"tooltip",y,g,a,h),symbol:this.legendItemSymbol(b),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(u,"tooltip",k,g,r,h)}]},{seriesId:t,datum:g,title:l,itemId:b,xKey:a,xName:n,yKey:r,yName:l,...M})}legendItemSymbol(e){const{fill:t,stroke:i,fillOpacity:o,strokeOpacity:s,strokeWidth:a,lineDash:n,lineDashOffset:r}=this.getItemConfig(e);return{marker:{fill:t,stroke:i,fillOpacity:o,strokeOpacity:s,strokeWidth:a,lineDash:n,lineDashOffset:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,seriesItemTypes:i}=this,o=[],s=n=>n.charAt(0).toUpperCase()+n.substring(1),{showInLegend:a}=this.properties;for(const n of i){const{name:r}=this.getItemConfig(n);o.push({legendType:"category",id:t,itemId:n,seriesId:t,enabled:!0,label:{text:r??s(n)},symbol:this.legendItemSymbol(n),hideInLegend:!a,isFixed:!0})}return o}toggleSeriesItem(){}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:o}=e,s=rO(lO(this.isVertical(),this.axes,"normal"),"unknown");mO.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s),hO(this,"labels",this.ctx.animationManager,i);const{pointData:a}=o;a&&(this.isVertical()?this.animateConnectorLinesVertical(e):this.animateConnectorLinesHorizontal(e))}animateConnectorLinesHorizontal(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:o}=i;this.updateLineNode(i);const s=this.getValueAxis(),a=s?.isReversed(),n=a?(h,p)=>hh>p,r=s?.scale.convert(0),l=t.reduce((h,p)=>(n(p.x,h)&&(h=p.x),h),a?1/0:0),c=(h,p,u,g,y)=>(h-p)/(u-p)*(y-g)+g;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Rs.Motion.easeOut,collapsable:!1,onUpdate(h){o.clear(!0);for(const[p,u]of t.entries()){const g=c(h,r,l,r,u.x),y=c(h,r,l,r,u.x2);p!==0&&o.lineTo(g,u.y),o.moveTo(y,u.y2)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateConnectorLinesVertical(e){const{pointData:t=[]}=e.contextData,[i]=e.paths,{path:o}=i;this.updateLineNode(i);const s=this.getValueAxis(),a=s?.isReversed(),n=a?(h,p)=>h>p:(h,p)=>h(n(p.y,h)&&(h=p.y),h),a?0:1/0),c=(h,p,u,g,y)=>(h-p)/(u-p)*(y-g)+g;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:Rs.Motion.easeOut,collapsable:!1,onUpdate(h){o.clear(!0);for(const[p,u]of t.entries()){const g=c(h,r,l,r,u.y),y=c(h,r,l,r,u.y2);p!==0&&o.lineTo(u.x,g),o.moveTo(u.x2,y)}i.checkPathDirty()},onStop:()=>this.resetConnectorLinesPath(e)})}animateReadyResize(e){super.animateReadyResize(e),this.resetConnectorLinesPath(e)}updatePaths(e){this.resetConnectorLinesPath({contextData:e.contextData,paths:e.paths})}resetConnectorLinesPath({contextData:e,paths:t}){if(t.length===0)return;const[i]=t;this.updateLineNode(i);const{path:o}=i;o.clear(!0);const{pointData:s}=e;if(s){for(const[a,n]of s.entries())a!==0&&o.lineTo(n.x,n.y),o.moveTo(n.x2,n.y2);i.checkPathDirty()}}updateLineNode(e){const{stroke:t,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a}=this.properties.line;e.setProperties({fill:void 0,stroke:t,strokeWidth:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,lineJoin:"round",pointerEvents:Rs.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}onDataChange(){}computeFocusBounds({datumIndex:e}){return yO(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){const{positive:e,negative:t,total:i}=this.properties.item;return e.itemStyler!=null||e.label.itemStyler!=null||t.itemStyler!=null||t.label.itemStyler!=null||i.itemStyler!=null||i.label.itemStyler!=null}};tc.className="WaterfallSeries",tc.type="waterfall";import{_ModuleSupport as vO}from"ag-charts-community";import{arrayOfDefs as kO,constant as DO,positiveNumber as MO,required as za,string as Vn,union as AO}from"ag-charts-core";var{commonSeriesOptionsDefs:IO,waterfallSeriesThemeableOptionsDef:LO}=vO,TO={...LO,...IO,type:za(DO("waterfall")),xKey:za(Vn),yKey:za(Vn),xName:Vn,yName:Vn,totals:kO({totalType:za(AO("total","subtotal")),index:za(MO),axisLabel:za(Vn)},"a total definition options array")};import{_ModuleSupport as bp}from"ag-charts-community";var{FILL_GRADIENT_LINEAR_KEYED_DEFAULTS:CO,FILL_IMAGE_DEFAULTS:NO,FILL_PATTERN_KEYED_DEFAULTS:wO}=bp;function vp(e,t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},["gradient",CO(e)],["image",NO],["pattern",wO(e)]]},stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...bp.LABEL_BOXING_DEFAULTS,enabled:!1,fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},formatter:void 0,placement:"outside-end",padding:{$isUserOption:["./spacing",0,6]}}}}var PO={series:{item:{positive:vp("altUp",0),negative:vp("altDown",1),total:vp("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:bp.singleSeriesHighlightStyle()},legend:{enabled:!0,toggleSeries:!1}},OO={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"waterfall",solo:!0,moduleFactory:e=>new tc(e),defaultAxes:YP.DIRECTION_SWAP_AXES,themeTemplate:PO},Rx={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,options:TO,create:e=>new tc(e)},{NewAreaSeriesModule:_O,NewBarSeriesModule:RO,NewBubbleSeriesModule:EO,NewHistogramSeriesModule:BO,NewLineSeriesModule:zO,NewScatterSeriesModule:FO,numberFormatValidator:HO,textOrSegments:VO,without:jt}=lT,Ex={width:hi,height:hi,grip:On,fill:Tl,stroke:Tl,strokeWidth:hi,cornerRadius:hi},Et=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],Bx=[...Et,"errorBar","label","legendItemName","direction"],zx=[...Et,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],Fx=[...Et,"title","label","labelKey","labelName","sizeName"],Hx=[...Et,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],Vx=[...Et,"label"],Wx=[...Et,"errorBar","title","label"],Gx=[...Et,"label","yLowName","yHighName"],Kx=[...Et,"direction","label","yLowName","yHighName"],$x=[...Et,"errorBar","title","label","labelKey","labelName"],jx=[...Et,"direction"],WO={enabled:On,height:hi,spacing:hi,cornerRadius:om,mask:{fill:Tl,fillOpacity:uT,stroke:Tl,strokeWidth:hi},minHandle:Ex,maxHandle:Ex,miniChart:{enabled:On,padding:{top:hi,bottom:hi},label:{enabled:On,avoidCollisions:On,spacing:hi,format:HO,formatter:dT(VO),interval:{minSpacing:hi,maxSpacing:hi,values:cT,step:om},...pT},series:hT(gT({area:jt(_O.options,[...Et,"type"]),bar:jt(RO.options,[...Bx,"type"]),"box-plot":jt(pm.options,[...zx,"type"]),bubble:jt(EO.options,[...Fx,"type"]),candlestick:jt(wm.options,[...Et,"type"]),heatmap:jt(Km.options,[...Hx,"type"]),histogram:jt(BO.options,[...Vx,"type"]),line:jt(zO.options,[...Wx,"type"]),ohlc:jt(Ym.options,[...Et,"type"]),"range-area":jt(yx.options,[...Gx,"type"]),"range-bar":jt(Cx.options,[...Kx,"type"]),scatter:jt(FO.options,[...$x,"type"]),waterfall:jt(Rx.options,[...jx,"type"])},"miniChart series options"))}},GO=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],KO=["itemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","highlight","lineDash","lineDashOffset","strokeWidth"];function Yx(e,t){return{$merge:[{$switch:[t,{},[["area","line","range-area"],{marker:{enabled:{$isUserOption:["/series/$index/marker/enabled",{$path:["/series/$index/marker/enabled",!1]},!1]}}}]]},{$omit:[{$switch:[t,Et,["bar",Bx],["box-plot",zx],["bubble",Fx],["heatmap",Hx],["histogram",Vx],["line",[...Wx,...KO]],["range-area",Gx],["range-bar",Kx],["scatter",$x],["waterfall",jx]]},e]}]}}var $O={enabled:!1,height:{$if:[{$path:"./miniChart/enabled"},40,18]},cornerRadius:4,mask:{fill:{$ref:"foregroundColor"},fillOpacity:.1,stroke:{$ref:"borderColor"},strokeWidth:1},minHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},maxHandle:{fill:{$ref:"chartBackgroundColor"},stroke:{$ref:"borderColor"},strokeWidth:1,width:12,height:24,cornerRadius:4},miniChart:{enabled:!1,label:{color:{$ref:"textColor"},fontSize:{$rem:rT.FONT_SIZE_RATIO.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0},series:{$apply:[Yx({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:GO.map(e=>({$eq:[{$path:"/series/0/type"},e]}))},{$map:[Yx({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}},jO={type:"root",optionsKey:"navigator",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Ta(e),removable:!1,themeTemplate:{navigator:$O}};import{_ModuleSupport as Ux}from"ag-charts-community";import{_ModuleSupport as YO}from"ag-charts-community";var{ToolbarButtonProperties:UO,Property:XO}=YO,Xx=class extends UO{};d([XO],Xx.prototype,"value",2);var{ChartAxisDirection:kp,LayoutElement:ZO,PropertiesArray:qO,Toolbar:QO,Property:Zx}=Ux,Dp=class extends Ux.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new qO(Xx),this.verticalSpacing=10,this.container=e.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.toolbar=new QO(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.toolbar.addClass("ag-charts-range-buttons"),this.container.append(this.toolbar.getElement()),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),e.layoutManager.registerElement(ZO.ToolbarBottom,this.onLayoutStart.bind(this)),e.eventsHub.on("zoom:change",this.onZoomChanged.bind(this)),this.teardown.bind(this))}teardown(){this.toolbar.getElement().remove(),this.toolbar.destroy()}onLayoutStart(e){const{buttons:t,ctx:i,enabled:o,toolbar:s,verticalSpacing:a}=this,{layoutBox:n}=e;if(!o||!i.zoomManager.isZoomEnabled()){s.setHidden(!0);return}s.setHidden(!1),s.updateButtons(t);const r=s.getBounds().height;s.setBounds({x:n.x,y:n.y+n.height-r,width:n.width,height:r}),n.shrink({bottom:r+a})}onZoomChanged(){this.toolbar.clearActiveButton()}onButtonPress({button:{index:e}}){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:o}=i;o==null?t.resetZoom("zoom-buttons"):typeof o=="number"?t.extendToEnd("zoom-buttons",kp.X,o):Array.isArray(o)?t.updateWith("zoom-buttons",kp.X,()=>o):typeof o=="function"&&t.updateWith("zoom-buttons",kp.X,o),this.toolbar.toggleActiveButtonByIndex(e)}};d([Zx],Dp.prototype,"enabled",2),d([Zx],Dp.prototype,"buttons",2);var qx=1e3*60*60*24,Mp=qx*30,JO=qx*365,e1={type:"root",optionsKey:"ranges",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Dp(e),themeTemplate:{ranges:{enabled:!1,buttons:{$shallowSimple:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:Mp},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*Mp},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*Mp},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),void 0]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:JO},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:void 0}]}}}};import{_ModuleSupport as Qx}from"ag-charts-community";var Jx=class xr extends Qx.BaseModuleInstance{constructor(t){super(),this.ctx=t,this.activeSections=new Set,this.sectionButtons={annotations:[],chartToolbar:[]},this.container=this.ctx.domManager.addChild("canvas-overlay","shared-toolbar"),this.container.role="presentation"}getSharedToolbar(t){return this.sharedToolbar||this.createSharedToolbar(),t==="chartToolbar"&&this.sharedToolbar&&this.sharedToolbar.setAriaLabelId("ariaLabelFinancialCharts"),this.toolbarWithSection(t)}createSharedToolbar(){this.sharedToolbar=new Qx.Toolbar(this.ctx,"ariaLabelAnnotationsToolbar","vertical"),this.sharedToolbar.addClass("ag-charts-shared-toolbar"),this.container.append(this.sharedToolbar.getElement()),this.cleanup.register(()=>{this.sharedToolbar&&(this.sharedToolbar.getElement().remove(),this.sharedToolbar.destroy(),this.sharedToolbar=void 0)})}toolbarWithSection(t){const i=this.sharedToolbar,o={layout:(s,a)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const n=i.getBounds().width;i.setBounds({x:s.x,y:s.y,width:n}),s.shrink({left:n+i.horizontalSpacing+(a??0)})},addToolbarListener:(s,a)=>i.addToolbarListener(s,n=>{const r=this.getSectionIndex(t,n.button.index);if(r<0)return;const l={...n,button:this.sectionButtons[t][r]};a(l)}),updateButtons:s=>{this.sectionButtons[t]=s;const a=xr.SECTION_ORDER.flatMap(n=>this.sectionButtons[n]);i.updateButtons(a)},updateButtonByIndex:(s,a)=>{i.updateButtonByIndex(this.getIndex(t,s),a)},toggleActiveButtonByIndex:s=>{i.toggleActiveButtonByIndex(this.getIndex(t,s))},toggleButtonEnabledByIndex:(s,a)=>{i.toggleButtonEnabledByIndex(this.getIndex(t,s),a)},setHidden:s=>{s?this.activeSections.delete(t):this.activeSections.add(t);let a=0;for(const n of xr.SECTION_ORDER){if(n!==t){a+=this.sectionButtons[n].length;continue}for(const r of this.sectionButtons[t].keys())i.setButtonHiddenByIndex(a+r,s)}},destroy:()=>{o.setHidden(!0),this.activeSections.size===0&&this.destroy()},clearActiveButton:i.clearActiveButton.bind(i),addListener:i.addListener.bind(i),removeListener:i.removeListener.bind(i)};return o.setHidden(!1),o}getIndex(t,i){let o=0;for(const s of xr.SECTION_ORDER){if(s===t)return o+i;o+=this.sectionButtons[s].length}return-1}getSectionIndex(t,i){let o=0;for(const s of xr.SECTION_ORDER){if(s===t)return i>=o+this.sectionButtons[t].length?-1:i-o;o+=this.sectionButtons[s].length}return-1}};Jx.SECTION_ORDER=["chartToolbar","annotations"];var t1=Jx,i1={type:"context",contextKey:"sharedToolbar",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new t1(e)};import{_ModuleSupport as o1}from"ag-charts-community";import{_ModuleSupport as Wn}from"ag-charts-community";import{cachedTextMeasurer as Ap,calcLineHeight as s1}from"ag-charts-core";var{ZIndexMap:a1,LayoutElement:n1,Property:Mt,BaseProperties:r1,valueProperty:l1,Group:c1,Label:Gn,Rect:h1,Text:et}=Wn,eS={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},d1={up:"positive",down:"negative"},p1={hlc:"altNeutral"},Ip=class extends r1{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};d([Mt],Ip.prototype,"fill",2),d([Mt],Ip.prototype,"fillOpacity",2);var Bt=class extends Wn.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.openKey=void 0,this.highKey=void 0,this.lowKey=void 0,this.closeKey=void 0,this.volumeKey=void 0,this.title=new Gn,this.positive=new Gn,this.negative=new Gn,this.neutral=new Gn,this.altNeutral=new Gn,this.background=new Ip,this.layoutStyle="block",this.id="status-bar",this.data=void 0,this.layer=new c1({name:"StatusBar",zIndex:a1.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new Wn.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new h1),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),id:"openValue",key:"openKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:16,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"H",configuration:256,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),style:"neutral",id:"highValue",key:"highKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:8,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"L",configuration:512,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),style:"neutral",id:"lowValue",key:"lowKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:4,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"C",configuration:128,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),id:"closeValue",key:"closeKey",style:"neutral",domain:void 0,formatter:new Intl.NumberFormat("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})},{label:"",configuration:64,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),style:"neutral",id:"closeValue",key:"closeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})},{label:"Vol",configuration:32,title:this.labelGroup.appendChild(new et),value:this.labelGroup.appendChild(new et),id:"volumeValue",key:"volumeKey",domain:void 0,formatter:new Intl.NumberFormat("en-US",{notation:"compact",minimumFractionDigits:2,maximumFractionDigits:2})}],this.highlightManager=e.highlightManager,this.labelGroup.visible=!1,this.cleanup.register(e.scene.attachNode(this.layer),e.layoutManager.registerElement(n1.Overlay,t=>this.startPerformLayout(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("highlight:change",()=>this.updateHighlight()))}async processData(e){if(!this.enabled||this.data==null)return;const t=[];for(const a of this.labels){const{id:n,key:r}=a,l=this[r];l==null?a.domain=void 0:t.push(l1(l,"number",{id:n}))}if(t.length===0)return;const i=Wn.DataSet.wrap(this.data)??Wn.DataSet.empty(),{processedData:o,dataModel:s}=await e.request(this.id,i,{props:t});for(const a of this.labels){const{id:n,key:r}=a;this[r]!=null&&(a.domain=s.getDomain(this,n,"value",o))}}startPerformLayout(e){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled)return;const{layoutBox:t}=e,i=4,o=12,s=0,a=8;this.labelGroup.translationY=t.y+s;const n=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),r=s1(n),l=eS[this.getChartType()]??0;let c=0,h,p="alphabetic";if(this.layoutStyle==="block")t.shrink(s+r+a,"top"),h=n+(r-n)/2;else{const{title:u}=this.ctx.chartService;if(p="top",h=s+u.padding,u.enabled){const g=u.node.getBBox();c=g.x+g.width+o}else c=u.padding}for(const{label:u,configuration:g,title:y,value:f,domain:x,formatter:S}of this.labels){if(x==null||!(l&g)){y.visible=!1,f.visible=!1;continue}const v=Ap(this.positive),m=Ap(this.negative),b=Math.max(v.textWidth(S.format(x[0])),v.textWidth(S.format(x[1])),m.textWidth(S.format(x[0])),m.textWidth(S.format(x[1])));y.visible=!0,f.visible=!0;const k=Ap(this.title).measureLines(u);y.setFont(this.title),y.fill=this.title.color,y.text=u,y.textBaseline=p,y.y=h,y.x=c,c+=k.width+i,f.textBaseline=p,f.y=h,f.x=c,c+=b+o}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=c-o,this.backgroundNode.height=r+s+a,this.backgroundNode.fill=this.background.fill,this.backgroundNode.fillOpacity=this.background.fillOpacity}onLayoutComplete(e){this.labelGroup.translationX=e.series.rect.x,this.updateHighlight()}updateHighlight(){if(!this.enabled)return;const e=this.highlightManager.getActiveHighlight(),t=e?.datum??this.data?.at(-1);if(t==null){this.labelGroup.visible=!1;return}this.labelGroup.visible=!0;const i=e?.itemId;let o=i==null?void 0:d1[i];o==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]new Bt(e),themeTemplate:{statusBar:{enabled:!1,layoutStyle:o1.ThemeSymbols.DEFAULT_CAPTION_LAYOUT_STYLE,title:{color:{$ref:"textColor"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},positive:{color:{$palette:"up.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},negative:{color:{$palette:"down.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},neutral:{color:{$palette:"neutral.stroke"},fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}},background:{fill:{$ref:"chartBackgroundColor"},fillOpacity:.5},altNeutral:{color:"gray",fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"}}}}};import{_ModuleSupport as tS}from"ag-charts-community";import{AsyncAwaitQueue as g1,Logger as iS,arraysEqual as Lp,isDate as y1,isDefined as f1,isFiniteNumber as ic,unique as oS}from"ag-charts-core";import{clamp as m1,isNumberEqual as sS}from"ag-charts-core";var ui=0,tt=1,Bs=tt-ui,aS="end",nS="middle",rS=300,oc=(e,t=ui,i=tt)=>m1(t,e,i);function Tp(){return{x:{min:ui,max:tt},y:{min:ui,max:tt}}}function it(e){return e.x.max-e.x.min}function Yt(e){return e.y.max-e.y.min}function lS(e,t){return sS(e.min,t.min)&&sS(e.max,t.max)}function Kn(e,t){return lS(e.x,t.x)&&lS(e.y,t.y)}function sc(e){return Kn(e,Tp())}function ht(e){return{x:{min:e?.x?.min??ui,max:e?.x?.max??tt},y:{min:e?.y?.min??ui,max:e?.y?.max??tt}}}function vo(e,t,i){if(!e)return{x:0,y:0};const o=oc(t-e.x,0,e.x+e.width),s=oc(i-e.y,0,e.y+e.height),a=1/e.width*o,n=1-1/e.height*s;return{x:oc(a),y:oc(n)}}function zs(e,t,i){return{x:{min:e.x.min+t,max:e.x.max+t},y:{min:e.y.min+i,max:e.y.max+i}}}function ac(e,t,i){return{x:{min:e.x.min,max:e.x.min+it(e)*t},y:{min:e.y.min,max:e.y.min+Yt(e)*i}}}function cS(e,t,i){const o=it(e),s=Yt(e),a=e.x.min+o/2,n=e.y.min+s/2;return{x:{min:a-o*t/2,max:a+o*t/2},y:{min:n-s*i/2,max:n+s*i/2}}}function Ut(e,t,i,o){const{min:s,max:a}=t,n=s+(a-s)/2,r=e.max-e.min;switch(i){case"start":return{min:s,max:t.min+r};case"end":return{min:t.max-r,max:a};case"middle":return{min:n-r/2,max:n+r/2};case"pointer":return x1(e,t,o??n);default:return{min:s,max:a}}}function x1(e,t,i){const o=e.max-e.min,s=t.max-t.min,a=i*(1-(s-o)),n=i-a,r=e.min+n,l=e.max+n;return{min:r,max:l}}function S1(e,t,i){return{x:{min:e.x.min*t,max:e.x.max*t},y:{min:e.y.min*i,max:e.y.max*i}}}function gi(e){return{x:nc(e.x),y:nc(e.y)}}function nc(e){const t=e.max-e.min;let i=e.max>tt?tt-t:e.min,o=e.mino?.valueOf()),i.map(o=>o?.valueOf())):!Lp(t,i)}var Jo=class extends b1{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="key",this.domainSync=new g1}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))Li("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=rc.PROCESS_DOMAIN){Li("ChartSync.updateChart()",e.id,rc[t],e),t===rc.PROCESS_DOMAIN?e.ctx.updateService.update(t,{forceNodeDataRefresh:!0}):e.ctx.updateService.update(t)}enabledZoomSync(){const{eventsHub:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.on("zoom:change",this.onZoom.bind(this))}onZoom(){const{syncManager:e}=this.moduleContext;for(const t of e.getGroupSiblings(this.groupId)){if(!t.modulesManager.getModule("sync")?.zoom)continue;const i=t.modulesManager.getModule("zoom");if(!i)continue;const o=this.prepareZoomUpdate();Li("ChartsSyncManager.enabledZoomSync()",t.id,o),i.updateSyncZoom(o)}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.(),this.disableNodeInteractionSync=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this))}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;Li("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[o]=wp(this.axes),s=o===Fs.X?Fs.Y:Fs.X,[a,n]=i?hS(i,o,s):[],r=Cn(e.currentHighlight);let l=a?.[0]?r?.[a[0]]:void 0,c=!1;if(y1(l)&&(c=!0,l=l.getTime()),!e.currentHighlight?.datum){for(const p of t.getGroupSiblings(this.groupId))p.modulesManager.getModule("sync")?.nodeInteraction&&(p.ctx.highlightManager.updateHighlight(`${p.id}-sync`),p.ctx.tooltipManager.removeTooltip(`${p.id}-sync`));return}const h=t.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(o,s,h?n:[],c,l,e)}findMatchingHighlightNodes(e,t,i,o,s,a){const{syncManager:n}=this.moduleContext;Li("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const r of n.getGroupSiblings(this.groupId)){if(!r.modulesManager.getModule("sync")?.nodeInteraction)continue;let l=!1;for(const c of r.axes){if(!Cp.is(c)||c.direction!==e)continue;const h=r.series.filter(p=>{if(!p.visible)return!1;if(i.length>0){const[,u]=hS(p,e,t);return i.every(g=>u.includes(g))}return!0}).map(this.findMatchingNodes(c,e,o,s)).filter(f1);if(h.length===1&&h[0]?.nodeDatum!==r.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(r,h[0].nodeDatum),l=!0;break}}l||(Li("ChartSync.findMatchingHighlightNodes() - no matching nodes",r.id,a),this.dispatchHighlightUpdate(r))}}findMatchingNodes(e,t,i,o){return s=>{const a=s.getKeys(e.direction);if(e.keys.length&&!e.keys.some(p=>a.includes(p)))return;const n=s.contextNodeData?.nodeData??[];if(!n?.length)return;const r=n[0],l=`${t}Key`;if(!M1(r,l))return;const c=r[l],h=n.find(p=>{const u=p.datum[c];return i?u.getTime()===o:u===o});return h?{series:s,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){Li("ChartSync.dispatchHighlightUpdate()",e.id,t),e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t);const i=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&i){const o=e.seriesAreaBoundingBox,s=o.x+(t.midPoint?.x??t.point?.x??0),a=o.y+(t.midPoint?.y??t.point?.y??0),n=D1.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:a},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,n,e.getTooltipContent(t.series,t.datumIndex,t,"tooltip"))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`);this.updateChart(e,rc.SERIES_UPDATE)}async getSyncedDomain(e){if(!Cp.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,domainsByKey:o,positionDomains:s}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(e,s):this.domainMode==="direction"||e.keys.length===0?this.calculateDerivedDomain(e,i):this.calculateKeyDerivedDomain(e,o)}updateDomainState(e){var t,i,o,s,a;const{syncManager:n}=this.moduleContext,r=n.getChart().id,l=e.id,c=n.getGroupState(this.groupId);if(!c)throw new Error("AG Charts - no GroupState for groupId: "+this.groupId);const h=c.domains??(c.domains={}),p=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0}),u=(i=p.sources)[r]??(i[r]={});u[l]=e.dataDomain.domain,p.dirty=!0;const g=c.domainsByKey??(c.domainsByKey={});for(const S of e.keys??[]){const v=g[S]??(g[S]={derived:[],sources:{},dirty:!0}),m=(o=v.sources)[r]??(o[r]={});m[l]=e.dataDomain.domain,v.dirty=!0}const y=c.domainsByPosition??(c.domainsByPosition={}),f=y[s=e.position]??(y[s]={derived:[],sources:{},dirty:!0}),x=(a=f.sources)[r]??(a[r]={});return x[l]=e.dataDomain.domain,f.dirty=!0,{groupState:c,directionDomains:p,domainsByKey:g,positionDomains:f}}validateAxis(e,t){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";wp(this.axes).includes(e.direction)&&(i?this.validateMultiSeries(e,t):this.validateSingleSeries(e,t))}validateMultiSeries(e,t){const{min:i,max:o,nice:s,reverse:a}=e,n=new Set(e.boundSeries.flatMap(r=>r.getKeys(e.direction)));for(const r of t.members){const{axes:l,modulesManager:c}=r,h=wp(c.getModule("sync")?.axes),p=l.filter(g=>h.includes(g.direction)).filter(g=>g.boundSeries.some(y=>y.getKeys(g.direction).some(f=>n.has(f))));if(p.length===0)continue;const[u]=p;if(u.min!==i||u.max!==o||u.nice!==s||u.reverse!==a){iS.warnOnce("To allow synchronization, ensure that all synchronized axes with matching keys have matching min, max, nice, and reverse properties."),this.enabled=!1;return}}}validateSingleSeries(e,t){const i=t.members,[{axes:o}]=i,{direction:s,min:a,max:n,nice:r,reverse:l}=e;for(const c of o)if(s===c.direction&&(r!==c.nice||l!==c.reverse||a!==c.min&&(ic(a)||ic(c.min))||n!==c.max&&(ic(n)||ic(c.max)))){iS.warnOnce("To allow synchronization, ensure that all charts have matching min, max, nice, and reverse properties on the synchronized axes."),this.enabled=!1;return}}calculateDerivedDomain(e,t){if(!t.dirty)return t.derived;const i=t.derived;return t.derived=oS(Object.values(t.sources).map(o=>Object.values(o)).flat(2)),Np.is(e.scale)&&(t.derived=lc(t.derived)),t.dirty=!1,dS(e.scale,i,t.derived)&&(Li(e.id,"updated",e.keys,{before:i,after:t.derived}),this.updateSiblings()),t.derived}calculateKeyDerivedDomain(e,t){let i=[],o=[],s=!1;for(const a of e.keys??[]){const n=t[a],r=n.derived;if(i.push(...r),!n.dirty){o.push(...n.derived);continue}n.derived=oS(Object.values(n.sources).map(l=>Object.values(l)).flat(2)),Np.is(e.scale)&&(n.derived=lc(n.derived)),o.push(...n.derived),n.dirty=!1,s||(s=!Lp(r,n.derived))}return Np.is(e.scale)&&(i=lc(i),o=lc(o)),s&&dS(e.scale,i,o)&&(Li(e.id,"updated",e.keys,{before:i,after:o}),this.updateSiblings()),o}removeAxis(e){if(!Cp.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{syncManager:t}=this.moduleContext,i=t.getGroupState(this.groupId),o=t.getChart().id,s=e.id;delete i?.domains?.[e.direction]?.sources?.[o]?.[s];for(const a of e.keys??[])delete i?.domainsByKey?.[a]?.sources?.[o]?.[s];delete i?.domainsByPosition?.[e.position]?.sources?.[o]?.[s]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)Li("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.await(),t++;t>0&&Li("ChartSync.waitForDomainsToBeReady() - waited for",t,"iterations"),this.domainSync.notify()}prepareZoomUpdate(){const{zoomManager:e}=this.moduleContext,t=e.getZoom();return this.axes==="x"?delete t?.y:this.axes==="y"&&delete t?.x,ht(t)}onEnabledChange(){const{syncManager:e}=this.moduleContext;this.enabled?e.subscribe(this.groupId):e.unsubscribe(this.groupId),this.updateSiblings(),this.onNodeInteractionChange(),this.onZoomChange()}onGroupIdChange(e,t){if(!this.enabled||e===t)return;const{syncManager:i}=this.moduleContext;i.unsubscribe(t),i.subscribe(e),this.updateSiblings(t),this.updateSiblings(e)}onAxesChange(){if(!this.enabled)return;const{syncManager:e}=this.moduleContext;this.updateChart(e.getChart())}onNodeInteractionChange(){this.enabled&&this.nodeInteraction?this.enabledNodeInteractionSync():this.disableNodeInteractionSync?.()}onZoomChange(){this.enabled&&this.zoom?this.enabledZoomSync():this.disableZoomSync?.()}destroy(){const{syncManager:e}=this.moduleContext;e.unsubscribe(this.groupId),this.updateSiblings(),this.disableZoomSync?.()}};Jo.className="Sync",d([Ha,Fa(e=>e.onEnabledChange())],Jo.prototype,"enabled",2),d([Ha,Fa((e,t,i)=>e.onGroupIdChange(t,i))],Jo.prototype,"groupId",2),d([Ha,Fa(e=>e.onAxesChange())],Jo.prototype,"axes",2),d([Ha,Fa(e=>e.onNodeInteractionChange())],Jo.prototype,"nodeInteraction",2),d([Ha,Fa(e=>e.onZoomChange())],Jo.prototype,"zoom",2),d([Ha,Fa(e=>e.onAxesChange())],Jo.prototype,"domainMode",2);var A1={type:"root",optionsKey:"sync",packageType:"enterprise",chartTypes:["cartesian"],moduleFactory:e=>new Jo(e),themeTemplate:{sync:{enabled:!1}}};import{_ModuleSupport as ji}from"ag-charts-community";import{debounce as pS,entries as Pp,roundTo as I1}from"ag-charts-core";import{_ModuleSupport as Op}from"ag-charts-community";var{Property:uS}=Op,gS="#2196f3",L1="#8a8a8a",cc=class extends Op.Rect{constructor(){super(...arguments),this.fill=gS,this.fillOpacity=.2,this.zIndex=Op.ZIndexMap.ZOOM_SELECTION}updateValid(){this.fill=gS}updateInvalid(){this.fill=L1}};cc.className="ZoomRect",d([uS],cc.prototype,"fill",2),d([uS],cc.prototype,"fillOpacity",2);import{_ModuleSupport as _p}from"ag-charts-community";var T1=class{update(e,t,i,o,s,a){return this.oldZoom??(this.oldZoom=ht(t===_p.ChartAxisDirection.X?{...s,x:a}:{...s,y:a})),this.updateCoords(e.offsetX,e.offsetY),this.updateZoom(t,i,o)}stop(){this.coords=void 0,this.oldZoom=void 0}updateCoords(e,t){this.coords?(this.coords.x2=e,this.coords.y2=t):this.coords={x1:e,y1:t,x2:e,y2:t}}updateZoom(e,t,i){const{coords:o,oldZoom:s}=this;let a=ht(s);if(!o||!s)return e===_p.ChartAxisDirection.X?a.x:a.y;const n=vo(i,o.x1,o.y1),r=vo(i,o.x2,o.y2);if(e===_p.ChartAxisDirection.X){const c=(r.x-n.x)*it(s);return a.x.max+=c,a.x=Ut(a.x,s.x,t,n.x),a=gi(a),a.x}const l=(r.y-n.y)*Yt(s);return a.y.max-=l,a.y=Ut(a.y,s.y,t,n.y),a=gi(a),a.y}},C1=class{constructor(e,t,i,o,s,a,n,r){this.eventsHub=e,this.contextMenuRegistry=t,this.zoomManager=i,this.getModuleProperties=o,this.canResetZoom=s,this.getRect=a,this.updateZoom=n,this.isZoomValid=r}registerActions(e){const{contextMenuRegistry:t}=this,i=e?"show":"hide";if(t.toggle("zoom-to-cursor",i),t.toggle("pan-to-cursor",i),t.toggle("reset-zoom",i),!e)return;t.builtins.items["zoom-to-cursor"].action=this.onZoomToHere.bind(this),t.builtins.items["pan-to-cursor"].action=this.onPanToHere.bind(this),t.builtins.items["reset-zoom"].action=this.onResetZoom.bind(this);const o=n=>{const r=this.getRect();if(!r)return!0;const l=vo(r,n.x,n.y);return this.iterateFindNextZoomAtPoint(l)!=null},s=()=>!Kn(ht(this.zoomManager.getZoom()),Tp()),a=this.eventsHub.on("context-menu:setup",n=>{t.builtins.items["zoom-to-cursor"].enabled=o(n),t.builtins.items["pan-to-cursor"].enabled=s(),t.builtins.items["reset-zoom"].enabled=this.canResetZoom()});return()=>{a(),t.toggle("zoom-to-cursor","hide"),t.toggle("pan-to-cursor","hide"),t.toggle("reset-zoom","hide")}}computeOrigin(e){const t=this.getRect(),{enabled:i}=this.getModuleProperties();if(!i||!t||!e?.target||!(e instanceof MouseEvent))return;const o={x:0,y:0,width:t.width,height:t.height};return vo(o,e.offsetX,e.offsetY)}onZoomToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=this.iterateFindNextZoomAtPoint(t);i!=null&&this.updateZoom(i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=ht(this.zoomManager.getZoom()),o=it(i),s=Yt(i),a=t.x*o,n=t.y*s,r=Bs/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};l=cS(l,o,s),l=zs(l,i.x.min-t.x+a,i.y.min-t.y+n),this.updateZoom(gi(l))}onResetZoom(e){this.zoomManager.resetZoom("zoom")}iterateFindNextZoomAtPoint(e){const{scrollingStep:t}=this.getModuleProperties();for(let i=t;i<=1-t;i+=t){const o=this.getNextZoomAtPoint(e,i);if(this.isZoomValid(o))return o}}getNextZoomAtPoint(e,t){const{isScalingX:i,isScalingY:o}=this.getModuleProperties(),s=ht(this.zoomManager.getZoom()),a=e.x*it(s),n=e.y*Yt(s),r=Bs/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};return l=cS(l,i?it(s)*t:Bs,o?Yt(s)*t:Bs),l=zs(l,s.x.min-e.x+a,s.y.min-e.y+n),gi(l)}};import{_ModuleSupport as yS}from"ag-charts-community";import{boxEmpty as N1}from"ag-charts-core";var{ChartAxisDirection:fS}=yS,w1=class{constructor(e){this.axesHandlers=e,this.axes=[],this.overlappingAxisIds=new Set}destroy(){for(const e of this.axes)e.div.destroy()}update(e,t,i,o){this.seriesRect=o;for(const c of this.axes)c.div.setHidden(!e&&!t);if(!e&&!t)return;const{X:s,Y:a}=fS,n=[...i.axisManager.getAxisContext(s),...i.axisManager.getAxisContext(a)],{removed:r,added:l}=this.diffAxisIds(n);r.length>0&&(this.axes=this.axes.filter(c=>r.includes(c.axisId)?(c.div.destroy(),this.overlappingAxisIds.delete(c.axisId),this.hoveredAxisId===c.axisId&&(this.hoveredAxisId=void 0),this.activeAxisId===c.axisId&&(this.activeAxisId=void 0),!1):!0));for(const c of l){const{axisId:h,direction:p}=c;this.axes.push(this.initAxis(i,h,this.axesHandlers,p))}for(const c of this.axes){const p=n.find(u=>u.axisId===c.axisId).getCanvasBounds();c.div.setHidden(N1(p)),p==null?c.bounds=void 0:(c.div.setBounds(p),c.bounds=new yS.BBox(p.x,p.y,p.width,p.height))}this.updateOverlappingAxisPointerEvents(e,t)}setAxisCursor(e){this.cursor=e;for(const t of this.axes)t.div.setCursor(this.getCursor(t.direction))}toggleAxisDraggingCursor(e,t){for(const i of this.axes)i.direction===e&&i.div.setCursor(t?this.getCursor(e):void 0)}updateOverlappingAxisPointerEvents(e,t){this.overlappingAxisIds.clear();const i=(e||t)&&this.seriesRect;for(const o of this.axes){if(!i){o.div.setPointerEvents(void 0);continue}!!o.bounds?.collidesBBox(this.seriesRect)?(this.overlappingAxisIds.add(o.axisId),o.div.setPointerEvents("none")):o.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.activeAxisId&&!this.overlappingAxisIds.has(this.activeAxisId)&&(this.activeAxisId=void 0)}pickAxisAtPoint(e,t){for(const i of this.axes)if(this.overlappingAxisIds.has(i.axisId)&&i.bounds?.containsPoint(e,t))return{axisId:i.axisId,direction:i.direction}}setHoveredAxis(e){this.overlappingAxisIds.has(e)&&(this.hoveredAxisId=e)}clearHoveredAxis(){this.activeAxisId||(this.hoveredAxisId=void 0)}beginDelegatedAxisDrag(e){return this.overlappingAxisIds.has(e)?(this.activeAxisId=e,this.hoveredAxisId=void 0,!0):!1}endDelegatedAxisDrag(e){this.activeAxisId===e&&(this.activeAxisId=void 0),this.hoveredAxisId=void 0}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getHoveredAxis(){if(!this.hoveredAxisId)return;const e=this.axes.find(t=>t.axisId===this.hoveredAxisId);return e?{axisId:e.axisId,direction:e.direction}:void 0}getCursor(e){return this.cursor?this.cursor:e===fS.X?"ew-resize":"ns-resize"}initAxis(e,t,i,o){const s="afterend",a=e.proxyInteractionService.createProxyElement({type:"region",domManagerId:t,where:s});return a.setCursor(this.getCursor(o)),a.addListener("drag-start",n=>{n.device==="touch"&&n.sourceEvent.preventDefault(),this.activeAxisId=t,i.onAxisDragStart(o)}),a.addListener("drag-move",n=>i.onAxisDragMove(t,o,n)),a.addListener("drag-end",()=>{this.activeAxisId=void 0,this.hoveredAxisId=void 0,i.onAxisDragEnd()}),a.addListener("dblclick",()=>i.onAxisDoubleClick(t,o)),a.addListener("wheel",n=>i.onAxisWheel(t,o,n)),{axisId:t,div:a,direction:o}}diffAxisIds(e){const t=this.axes.map(a=>a.axisId),i=e.map(a=>a.axisId),o=t.filter(a=>!i.includes(a)),s=e.filter(a=>!t.includes(a.axisId));return{removed:o,added:s}}};import{_ModuleSupport as mS}from"ag-charts-community";import{entries as P1,getWindow as O1}from"ag-charts-core";var xS=16,_1={off:1,short:.01,long:.002},R1=class{constructor(){this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:_1[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(cancelAnimationFrame(this.inertiaHandle),this.inertiaHandle=void 0)}update(e){this.updateCoords(e.currentX,e.currentY);const{x1:t=0,y1:i=0,x2:o=0,y2:s=0}=this.coords??{};this.onUpdate?.({type:"update",deltaX:this.isPanningX()?t-o:0,deltaY:this.isPanningY()?i-s:0})}start(e){this.direction=e,this.coordsMonitorTimeout=setInterval(this.recordCurrentZoomCoords.bind(this),16)}stop(){const{coordsHistory:e}=this;let t=0,i=0,o=0;if(e.length>0){const s=this.zoomCoordsHistoryIndex%xS;let a=s-1;a<0&&(a=e.length-1);let n=s;n>=e.length&&(n=0);const r=e[a],l=e[n];t=this.isPanningX()?r.x-l.x:0,i=this.isPanningY()?r.y-l.y:0,o=r.t-l.t}if(this.coords=void 0,this.direction=void 0,clearInterval(this.coordsMonitorTimeout),this.coordsMonitorTimeout=void 0,this.zoomCoordsHistoryIndex=0,this.coordsHistory.length=0,o>0&&this.decelerationValue<1){const s=t/o,a=i/o,n=Math.hypot(s,a),r=Math.atan2(a,s),l=performance.now();this.inertiaHandle=O1().requestAnimationFrame(c=>{this.animateInertia(c,c,l,n,r)})}}recordCurrentZoomCoords(){const{coords:e,coordsHistory:t,zoomCoordsHistoryIndex:i}=this;if(!e)return;const{x2:o,y2:s}=e,a=Date.now();t[i%xS]={x:o,y:s,t:a},this.zoomCoordsHistoryIndex+=1}animateInertia(e,t,i,o,s){const a=1-this.decelerationValue,n=-o/Math.log(a),r=o*(a**(t-i)-1)/Math.log(a),l=o*(a**(e-i)-1)/Math.log(a);this.onUpdate?.({type:"update",deltaX:this.isPanningX()?-Math.cos(s)*(l-r):0,deltaY:this.isPanningY()?-Math.sin(s)*(l-r):0}),!(l>=n-1)&&(this.inertiaHandle=requestAnimationFrame(c=>{this.animateInertia(c,e,i,o,s)}))}updateCoords(e,t){this.coords?this.coords={x1:this.coords.x2,y1:this.coords.y2,x2:e,y2:t}:this.coords={x1:e,y1:t,x2:e,y2:t}}isPanningX(){return this.direction==null||this.direction===mS.ChartAxisDirection.X}isPanningY(){return this.direction==null||this.direction===mS.ChartAxisDirection.Y}translateZooms(e,t,i,o){const s=vo(e,e.x+Math.abs(i),e.y+e.height-Math.abs(o)),a=Math.sign(i)*s.x,n=-Math.sign(o)*s.y,r={};for(const[l,{direction:c,zoom:h}]of P1(t)){if(h&&h.min===ui&&h.max===tt)continue;let p=ht({[c]:h});p=gi(zs(p,a*it(p),n*Yt(p))),r[l]={direction:c,zoom:p[c]}}return r}};import{_ModuleSupport as E1}from"ag-charts-community";import{entries as B1}from"ag-charts-core";var z1=200,F1=class{update(e,t,i,o){const s=e.deltaX*t*z1;return this.translateZooms(i,o,s)}translateZooms(e,t,i){const o={},s=vo(e,e.x+Math.abs(i),0),a=i<0?-s.x:s.x;for(const[n,{direction:r,zoom:l}]of B1(t)){if(r!==E1.ChartAxisDirection.X)continue;let c=ht({x:l});c=gi(zs(c,a*it(c),0)),o[n]={direction:r,zoom:c.x}}return o}};import{_ModuleSupport as SS}from"ag-charts-community";import{entries as H1}from"ag-charts-core";var V1=class{updateAxes(e,t,i,o){const s=e.sourceEvent,a={},{anchorPointX:n,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=t,p=vo(i,s.offsetX??s.clientX,s.offsetY??s.clientY);for(const[u,{direction:g,zoom:y}]of H1(o)){if(y==null)continue;let f={...y};const x=h*e.deltaY*(y.max-y.min);if(g===SS.ChartAxisDirection.X&&l)f.max+=x,f=Ut(f,y,n,p.x);else if(g===SS.ChartAxisDirection.Y&&c)f.max+=x,f=Ut(f,y,r,p.y);else continue;f.max0&&this.rect.height>0}updateCoords(e,t,i,o){if(!this.coords){this.coords={x1:e,y1:t,x2:e,y2:t};return}const{coords:s}=this;if(s.x2=e,s.y2=t,!o)return;const{isScalingX:a,isScalingY:n,keepAspectRatio:r}=i,l=this.getNormalisedDimensions();if(r&&a&&n){const c=o.width/o.height;s.y2r&&sui;break;case"pan-end":o=e.x.maxui;break;case"pan-right":o=e.x.maxi.find(v=>v.identifier===r[S].identifier)),c=r[0].normalX,h=r[1].normalX,p=l[0].clientX,u=l[1].clientX,g=r[0].normalY,y=r[1].normalY,f=s+n-l[0].clientY,x=s+n-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,p,u,g,y,f,x,o,s,a,n)}end(e){const t=Array.from(e.sourceEvent.targetTouches).map(i=>i.identifier);return!t.includes(this.touchStart.origins[0].identifier)||!t.includes(this.touchStart.origins[1].identifier)}twitchTolerantZoomPan4(e,t,i,o,s,a,n,r,l,c,h,p){const{initialZoom:u,previous:g}=this,y=kS(e,t,i,o,g,"a1","a2",l,h,u.x),f=kS(s,a,n,r,g,"b1","b2",c,p,u.y);return{x:y,y:f}}};function kS(e,t,i,o,s,a,n,r,l,c){if(e==t){const h=hc(c,i,r,l),p=hc(c,o,r,l),u=(h+p)/2,g=(e-u)/Vs;return{min:c.min+g,max:c.max+g}}else{const h=s[a],p=s[n];return Math.abs(i-h)+Math.abs(o-p)<=1?(i=h,o=p):(s[a]=i,s[n]=o),e_(e,t,i,o,r,l)}}var{ActionOnSet:Ws,ChartAxisDirection:zt,ChartUpdateType:Ep,Property:Te,InteractionState:$n,ProxyProperty:i_}=ji,dc=e=>I1(e,10),Wa="zoom-cursor",jn="zoom-tooltip",Bp=class extends ji.BaseProperties{constructor(e){super(),this.onChange=e,this.enabled=!1,this.padding=0}};d([Te,Ws({changeValue(e){this.onChange({enabled:e,padding:this.padding})}})],Bp.prototype,"enabled",2),d([Te,Ws({changeValue(e){this.onChange({enabled:this.enabled,padding:e})}})],Bp.prototype,"padding",2);var _e=class extends ji.BaseModuleInstance{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!1,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingStep=Bs/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=aS,this.anchorPointY=nS,this.autoScaling=new Bp(i=>{this.ctx.zoomManager.setAutoScaleYAxis(i.enabled,i.padding)}),this.axisDraggingMode="zoom",this.canResetZoom=i=>(i??(i=this.getZoom()),!Kn(i,this.getResetZoom())),this.buttons=new Va(this.ctx,this.getModuleProperties.bind(this),this.canResetZoom,this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.axisDragger=new T1,this.panner=new R1,this.scroller=new V1,this.scrollPanner=new F1,this.twoFingers=new t_,this.deceleration="short",this.dragState=0,this.isState=i=>this.ctx.interactionManager.isState(i),this.destroyContextMenuActions=void 0,this.isFirstWheelEvent=!0,this.debouncedWheelReset=pS(()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0},100),this.previousZoomValid=!0,this.previousAxisZoomValid={[ji.ChartAxisDirection.X]:!0,[ji.ChartAxisDirection.Y]:!0},this.toggleAxisDraggingCursorsDebounced=pS(this.toggleAxisDraggingCursors.bind(this),rS,{leading:!0,trailing:!0});const t=new cc;this.selector=new W1(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new C1(e.eventsHub,e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),this.canResetZoom,()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this)),this.domProxy=new w1({onAxisDragStart:i=>this.onAxisDragStart(i),onAxisDragMove:(i,o,s)=>this.onAxisDragMove(i,o,s),onAxisDragEnd:()=>this.onAxisDragEnd(),onAxisDoubleClick:i=>this.onAxisDoubleClick(i),onAxisWheel:(i,o,s)=>this.onAxisWheel(i,o,s)}),e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",i=>this.onSeriesAreaDoubleClick(i)),e.widgets.seriesDragInterpreter.events.on("drag-move",i=>this.onSeriesAreaDragMove(i)),e.widgets.seriesDragInterpreter.events.on("drag-start",i=>this.onSeriesAreaDragStart(i)),e.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(e.scene.attachNode(t),e.eventsHub.on("series-area:hover",i=>this.onSeriesAreaHoverEvent(i)),e.eventsHub.on("series-area:click",i=>this.onSeriesAreaClickEvent(i)),e.eventsHub.on("series:keynav-zoom",i=>this.onNavZoom(i)),e.widgets.seriesWidget.addListener("wheel",i=>this.onWheel(i)),e.widgets.seriesWidget.addListener("touchstart",(i,o)=>this.onTouchStart(i,o)),e.widgets.seriesWidget.addListener("touchmove",(i,o)=>this.onTouchMove(i,o)),e.widgets.seriesWidget.addListener("touchend",i=>this.onTouchEnd(i)),e.widgets.seriesWidget.addListener("touchcancel",i=>this.onTouchEnd(i)),e.updateService.addListener("process-data",i=>this.onProcessData(i)),e.eventsHub.on("layout:complete",i=>this.onLayoutComplete(i)),e.eventsHub.on("zoom:change",i=>this.onZoomChange(i)),e.eventsHub.on("zoom:pan-start",i=>this.onZoomPanStart(i)),this.panner.addListener("update",i=>this.onPanUpdate(i)),()=>this.teardown())}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.domProxy.destroy()}onEnabledChange(e){this.ctx.zoomManager.setZoomModuleEnabled(e),this.contextMenu&&(this.destroyContextMenuActions?.(),this.destroyContextMenuActions=this.contextMenu.registerActions(e))}isIgnoredTouch(e){return e?.device!=="touch"?!1:this.ctx.chartService.touch.dragAction!=="drag"?!0:this.enableSelecting?!1:this.enablePanning?sc(this.getZoom()):!0}onSeriesAreaDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this;!t||!i||e?.preventZoomDblClick||!this.isState($n.ZoomClickable)||this.resetZoom()}onSeriesAreaHoverEvent(e){if(!this.shouldHandleAxisHover(e)){this.clearHoveredAxis();return}const t=this.domProxy.pickAxisAtPoint(e.x,e.y);t?(this.domProxy.setHoveredAxis(t.axisId),this.ctx.domManager.updateCursor(Wa,this.domProxy.getCursor(t.direction))):this.clearHoveredAxis()}onSeriesAreaClickEvent(e){if(!this.shouldHandleAxisClick(e))return;const t=this.domProxy.pickAxisAtPoint(e.x,e.y);t&&e.sourceEvent?.type==="dblclick"&&this.onAxisDoubleClick(t.axisId)}shouldHandleAxisHover(e){const{enabled:t,enableAxisDragging:i,enableAxisScrolling:o,dragState:s}=this;return t&&(i||o)&&!e.consumed&&!this.activeAxis&&s===0&&this.domProxy.hasOverlappingAxes()}shouldHandleAxisClick(e){const{enabled:t,enableAxisDragging:i,enableAxisScrolling:o,enableDoubleClickToReset:s}=this;return t&&!this.activeAxis&&!e.consumed&&(i||o||s)}clearHoveredAxis(){this.activeAxis||(this.domProxy.clearHoveredAxis(),this.dragState===0&&this.ctx.domManager.updateCursor(Wa))}tryBeginAxisDelegation(e){const t=this.domProxy.getHoveredAxis();if(!this.enabled||!this.enableAxisDragging||!t||!this.domProxy.beginDelegatedAxisDrag(t.axisId))return!1;this.activeAxis=t,this.onAxisDragStart(t.direction);const i=this.dragState===2?"grabbing":this.domProxy.getCursor(t.direction);return this.ctx.domManager.updateCursor(Wa,i),e.device==="touch"&&e.sourceEvent.preventDefault(),!0}onSeriesAreaDragStart(e){const{enabled:t,enablePanning:i,enableSelecting:o,ctx:{domManager:s,zoomManager:a}}=this;if(!t||!this.isState($n.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e)||(this.panner.stopInteractions(),this.tryBeginAxisDelegation(e)))return;let n=0;const r=this.isPanningKeyPressed(e.sourceEvent);i&&(!o||r)?(s.updateCursor(Wa,"grabbing"),n=2,this.panner.start()):o&&!r&&(n=3),(this.dragState=n)!==0&&a.fireZoomPanStartEvent("zoom")}onSeriesAreaDragMove(e){const{dragState:t,enabled:i,paddedRect:o,panner:s,selector:a,ctx:{interactionManager:n,tooltipManager:r,updateService:l}}=this;if(this.activeAxis){this.onAxisDragMove(this.activeAxis.axisId,this.activeAxis.direction,e);return}if(!(!i||!o||!this.isState($n.ZoomDraggable)||this.isIgnoredTouch(e))){switch(n.pushState(ji.InteractionState.ZoomDrag),e.device==="touch"&&e.sourceEvent.preventDefault(),t){case 2:s.update(e);break;case 3:a.update(e,this.getModuleProperties(),o);break;case 0:return}r.updateTooltip(jn),l.update(Ep.PERFORM_LAYOUT,{skipAnimations:!0})}}onSeriesAreaDragEnd(){const{ctx:{interactionManager:e}}=this;if(this.activeAxis){this.handleAxisDragEnd();return}e.popState(ji.InteractionState.ZoomDrag),!(!this.enabled||this.dragState===0)&&(this.handleRegularDragEnd(),this.resetDragState())}handleAxisDragEnd(){this.onAxisDragEnd(),this.domProxy.endDelegatedAxisDrag(this.activeAxis.axisId),this.activeAxis=void 0,this.clearHoveredAxis()}handleRegularDragEnd(){const{panner:e,selector:t}=this;switch(this.dragState){case 2:e.stop();break;case 3:if(t.didUpdate()){const i=t.stop(this.seriesRect,this.paddedRect,this.getZoom());this.updateZoom(i)}break}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(Wa),this.ctx.tooltipManager.removeTooltip(jn)}onAxisDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,ctx:{zoomManager:o}}=this;!t||!i||!this.isState($n.ZoomClickable)||(this.previousAxisZoomValid={[zt.X]:!0,[zt.Y]:!0},o.resetAxisZoom("zoom",e))}onAxisDragStart(e){const{axisDraggingMode:t,domProxy:i,enabled:o,enableAxisDragging:s,panner:a,ctx:{zoomManager:n}}=this;!o||!s||(a.stopInteractions(),t==="pan"?(i.setAxisCursor("grabbing"),this.dragState=2,this.panner.start(e),n.fireZoomPanStartEvent("zoom")):this.dragState=1)}onAxisDragMove(e,t,i){const{anchorPointX:o,anchorPointY:s,axisDragger:a,dragState:n,enabled:r,enableAxisDragging:l,seriesRect:c,shouldFlipXY:h,ctx:{interactionManager:p,tooltipManager:u,updateService:g,zoomManager:y}}=this;if(!r||!l||!c)return;p.pushState(ji.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const f=this.getZoom();if(n===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let x=t===zt.X?o:s;h&&(x=t===zt.X?s:o);const S=y.getAxisZoom(e),v=a.update(i,t,x,c,f,S);y.setAxisManuallyAdjusted("zoom",e),this.updateAxisZoom(e,t,v,{directional:!0})}u.updateTooltip(jn),g.update(Ep.PERFORM_LAYOUT,{skipAnimations:!0})}onAxisDragEnd(){const{axisDraggingMode:e,axisDragger:t,dragState:i,domProxy:o,enabled:s,enableAxisDragging:a,ctx:{domManager:n,interactionManager:r,tooltipManager:l}}=this;r.popState(ji.InteractionState.ZoomDrag),!(!s||!a||i===0)&&(this.dragState=0,e==="pan"&&(o.setAxisCursor("grab"),this.panner.stop()),t.stop(),n.updateCursor(Wa),l.removeTooltip(jn))}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:o}=this;!this.ctx.interactionManager.isState(ji.InteractionState.Default)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(o.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:o,paddedRect:s}=this;if(!t||!o||!s||!this.isState($n.ZoomWheelable))return;const{deltaX:a,deltaY:n}=e.sourceEvent,r=a!=null&&n!=null&&Math.abs(a)>Math.abs(n);i&&r?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:o,ctx:{zoomManager:s}}=this;if(!o)return;e.sourceEvent.preventDefault();const a=i.update(e,t,o,s.getAxisZooms());for(const[n,{direction:r,zoom:l}]of Pp(a))this.updateAxisZoom(n,r,l)}onWheelScrolling(e){const t=this.getZoom(),i=e.deltaY>0&&sc(t);this.handleWheelScrolling(e,i)}onAxisWheel(e,t,i){const{enableAxisScrolling:o,ctx:{zoomManager:s}}=this;if(!o||t!==zt.X&&t!==zt.Y)return;const a=t===zt.X,n=!a,r=this.getModuleProperties({isScalingX:a,isScalingY:n}),l=this.getZoom(),c=i.deltaY>0&&l[t].min===ui&&l[t].max===tt;s.setAxisManuallyAdjusted("zoom",e),this.handleWheelScrolling(i,c,r)}handleWheelScrolling(e,t,i=this.getModuleProperties()){const{enableIndependentAxes:o,scroller:s,seriesRect:a,ctx:{zoomManager:n}}=this;if(!a)return;let r=!0;if(o===!0){const l=s.updateAxes(e,i,a,n.getAxisZooms());for(const[c,{direction:h,zoom:p}]of Pp(l)){const u=h===zt.X?this.constrainZoom({x:p,y:{min:tt,max:tt}}).x:p;r&&(r=this.updateAxisZoom(c,h,u))}}else{const l=s.update(e,i,a,this.getZoom());if(l==null)return;r=this.updateUnifiedZoom(l,{directional:!0})}t||(t=e.deltaY<0&&!r),this.firstWheelEventDirection!=null&&this.firstWheelEventDirection!==e.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=t,this.firstWheelEventDirection=e.deltaY<0,t||e.sourceEvent.preventDefault()):this.wasFirstWheelEventZoomCapped===!1&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}onTouchStart(e,t){!this.enableTwoFingerZoom||this.dragState!==0||this.twoFingers.start(e,t,this.getZoom())&&(this.dragState=4)}onTouchMove(e,t){if(!this.enableTwoFingerZoom||this.dragState!==4)return;const i=this.twoFingers.update(e,t);this.updateZoom(gi(i))}onTouchEnd(e){!this.enableTwoFingerZoom||this.dragState!==4||(e.sourceEvent.preventDefault(),this.twoFingers.end(e)&&(this.dragState=0))}onProcessData(e){this.shouldFlipXY=e.series.shouldFlipXY}onLayoutComplete(e){this.domProxy.update(this.enableAxisDragging,this.enableAxisScrolling,this.ctx,e.series.rect),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect,this.enableAxisDragging&&this.toggleAxisDraggingCursorsDebounced())}onZoomChange(e){e.callerId!=="zoom"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(sc(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:o,zoomManager:s}}=this;if(!i)return;const a=t.translateZooms(i,s.getAxisZooms(),e.deltaX,e.deltaY);for(const[n,{direction:r,zoom:l}]of Pp(a))this.updateAxisZoom(n,r,l);o.updateTooltip(jn)}isPanningKeyPressed(e){switch(this.panKey){case"alt":return e.altKey;case"ctrl":return e.ctrlKey;case"shift":return e.shiftKey;case"meta":return e.metaKey}}isScalingX(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="y":this.axes==="x"}isScalingY(){return this.axes==="xy"?!0:this.shouldFlipXY?this.axes==="x":this.axes==="y"}getAnchorPointX(){return this.shouldFlipXY?this.anchorPointY:this.anchorPointX}getAnchorPointY(){return this.shouldFlipXY?this.anchorPointX:this.anchorPointY}constrainZoom(e){const{minVisibleItems:t,ctx:{zoomManager:i}}=this;return t===0?e:i.constrainZoomToItemCount(e,t)??e}isZoomValid(e,t){const{minVisibleItems:i,ctx:{zoomManager:o}}=this;if(i===0)return this.previousZoomValid=!0,!0;const s=this.getZoom(),a=dc(it(e))=r)return this.previousAxisZoomValid[e]=!0,!0;if(!this.previousAxisZoomValid[e]&&i?.directional)return!1;const c=s.isVisibleItemsCountAtLeast(l,o);return this.previousAxisZoomValid[e]=i?.directional?c:!0,c}resetZoom(){this.previousZoomValid=!0,this.previousAxisZoomValid={[zt.X]:!0,[zt.Y]:!0},this.ctx.zoomManager.resetZoom("zoom")}updateSyncZoom(e){this.updateZoom(e)}updateZoom(e){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e):this.updateUnifiedZoom(e)}updateUnifiedZoom(e,t){return e=this.constrainZoom(e),this.isZoomValid(e,t)?(this.ctx.zoomManager.updateZoom("zoom",e),!0):(this.ctx.updateService.update(Ep.SCENE_RENDER,{skipAnimations:!0}),!1)}updatePrimaryAxisZooms(e){this.updatePrimaryAxisZoom(e,zt.X),this.updatePrimaryAxisZoom(e,zt.Y)}updatePrimaryAxisZoom(e,t){const i=this.ctx.zoomManager.getPrimaryAxisId(t);i!=null&&this.updateAxisZoom(i,t,e[t])}updateAxisZoom(e,t,i,o){const{enableIndependentAxes:s,ctx:{zoomManager:a}}=this;if(!i)return!1;const n=this.getZoom();return s!==!0?(n[t]=i,this.updateUnifiedZoom(n,o)):this.isAxisZoomValid(t,i,o)?(a.updateAxisZoom("zoom",e,i),!0):!1}updateAxisCursor(e){if(!this.domProxy)return;const{enableAxisDragging:t=this.enableAxisDragging,enableAxisScrolling:i=this.enableAxisScrolling,axisDraggingMode:o=this.axisDraggingMode}=e;t?this.domProxy.setAxisCursor(o==="pan"?"grab":void 0):i?this.domProxy.setAxisCursor("default"):this.domProxy.setAxisCursor(void 0)}toggleAxisDraggingCursors(){const{anchorPointX:e,anchorPointY:t,domProxy:i}=this,o=this.getZoom();let s=it(o)!==Bs,a=Yt(o)!==Bs;if(!s){const n=ac(o,.999,1);n.x=Ut(n.x,o.x,e),s=this.isZoomValid(n,{includeYVisibleRange:!0})}if(!a){const n=ac(o,1,.999);n.y=Ut(n.y,o.y,t),a=this.isZoomValid(n,{includeYVisibleRange:!0})}i.toggleAxisDraggingCursor(zt.X,s),i.toggleAxisDraggingCursor(zt.Y,a)}getZoom(){return ht(this.ctx.zoomManager.getZoom())}getResetZoom(){return ht(this.ctx.zoomManager.getRestoredZoom())}getModuleProperties(e){return{anchorPointX:e?.anchorPointX??this.getAnchorPointX(),anchorPointY:e?.anchorPointY??this.getAnchorPointY(),enabled:e?.enabled??this.enabled,independentAxes:e?.independentAxes??this.enableIndependentAxes===!0,isScalingX:e?.isScalingX??this.isScalingX(),isScalingY:e?.isScalingY??this.isScalingY(),keepAspectRatio:e?.keepAspectRatio??this.keepAspectRatio,scrollingStep:e?.scrollingStep??this.scrollingStep}}};d([Ws({newValue(e){this.onEnabledChange(e)}}),Te],_e.prototype,"enabled",2),d([Ws({changeValue(e){this.updateAxisCursor({enableAxisDragging:e})}}),Te],_e.prototype,"enableAxisDragging",2),d([Ws({changeValue(e){this.updateAxisCursor({enableAxisScrolling:e})}}),Te],_e.prototype,"enableAxisScrolling",2),d([Te],_e.prototype,"enableDoubleClickToReset",2),d([Ws({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),Te],_e.prototype,"enableIndependentAxes",2),d([Te],_e.prototype,"enablePanning",2),d([Te],_e.prototype,"enableScrolling",2),d([Te],_e.prototype,"enableSelecting",2),d([Te],_e.prototype,"enableTwoFingerZoom",2),d([Te],_e.prototype,"panKey",2),d([Te],_e.prototype,"axes",2),d([Te],_e.prototype,"scrollingStep",2),d([Te],_e.prototype,"keepAspectRatio",2),d([Te],_e.prototype,"minVisibleItems",2),d([Te],_e.prototype,"anchorPointX",2),d([Te],_e.prototype,"anchorPointY",2),d([Te],_e.prototype,"autoScaling",2),d([Ws({changeValue(e){this.updateAxisCursor({axisDraggingMode:e})}}),Te],_e.prototype,"axisDraggingMode",2),d([Te],_e.prototype,"buttons",2),d([i_("panner.deceleration"),Te],_e.prototype,"deceleration",2);var o_={enabled:!0,visible:"hover",buttons:[{icon:"zoom-out",value:"zoom-out",section:"scale"},{icon:"zoom-in",value:"zoom-in",section:"scale"},{icon:"pan-left",value:"pan-left",section:"pan"},{icon:"pan-right",value:"pan-right",section:"pan"},{icon:"reset",value:"reset",section:"reset"}]},s_={type:"root",optionsKey:"zoom",packageType:"enterprise",chartTypes:["cartesian","topology"],moduleFactory:e=>new _e(e),themeTemplate:{zoom:{anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:o_,enabled:!1,enableAxisDragging:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$eq:[{$path:"../axes"},"x"]},padding:.05}}}};import{_ModuleSupport as zp}from"ag-charts-community";import{_ModuleSupport as Yn}from"ag-charts-community";import{CleanupRegistry as a_,createId as n_}from"ag-charts-core";import{_ModuleSupport as r_}from"ag-charts-community";import{cachedTextMeasurer as l_,countFractionDigits as c_,createId as h_,isArray as d_,measureTextSegments as p_,toPlainText as u_}from"ag-charts-core";import{_ModuleSupport as g_}from"ag-charts-community";function Un(e,t,i){return g_.callWithContext(e.chartService,t,i)}var{AxisInterval:y_,AxisLabel:f_,ZIndexMap:m_,LinearScale:x_,BBox:S_,TranslatableGroup:b_,Selection:v_,Text:k_,createIdsGenerator:D_,findMinMax:M_,findRangeExtent:A_,estimateTickCount:I_}=r_,Fp=class sg{constructor(t,i){this.ctx=t,this.dataProvider=i,this.id=h_(this),this.axisGroup=new b_({name:`${this.id}-AxisTicks`,zIndex:m_.AXIS}),this.labelSelection=v_.select(this.axisGroup,k_),this.interval=new y_,this.label=new f_,this.scale=new x_,this.placement="bottom",this.translationX=0,this.translationY=0,this.padding=0}get horizontal(){return this.placement.startsWith("top")||this.placement.startsWith("bottom")}attachAxis(t){t.appendChild(this.axisGroup)}calculateLayout(){const{placement:t,translationX:i,translationY:o,horizontal:s,label:a}=this;function n(u){}let r,l;switch(t){case"top":case"top-right":case"top-left":r="bottom",l="center",a.mirrored=!1,a.parallel=!0;break;case"bottom":case"bottom-right":case"bottom-left":r="top",l="center",a.mirrored=!1,a.parallel=!0;break;case"right":case"right-top":case"right-bottom":case"left":case"left-top":case"left-bottom":r="middle",l="left",a.mirrored=!0,a.parallel=!1;break;default:}const c=[],h=this.generateTicks(),{ticks:p}=h;return this.labelSelection.update(p,void 0,u=>u.tickId),this.axisGroup.setProperties({translationX:i,translationY:o}),this.labelSelection.each((u,g)=>{u.fontFamily=a.fontFamily,u.fontSize=a.fontSize,u.fontStyle=a.fontStyle,u.fontWeight=a.fontWeight,u.fill=a.color,u.textBaseline=r,u.textAlign=l,u.text=g.tickLabel,u.x=s?g.translation:0,u.y=s?0:g.translation,c.push(u.getBBox())}),c.length>0?S_.merge(c).translate(i,o):void 0}tickFormatter(t,i,o,s){const{ctx:a}=this,{formatManager:n}=a,r=this.dataProvider.data.flatMap(l=>l.series);return(l,c)=>{const h={type:"number",value:l,datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"gradient-legend",property:"color",domain:t,boundSeries:r,fractionDigits:s};return this.label.formatValue((p,u)=>Un(a,p,u),h,c)??n.format((p,u)=>Un(a,p,u),h)??n.defaultFormat(h)}}inRange(t,i=.001){const[o,s]=M_(this.scale.range);return t>=o-i&&t<=s+i}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:o,minTickCount:s,tickCount:a}=I_(A_(this.scale.range),1,t,i,sg.DefaultTickCount,sg.DefaultMinSpacing),n=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:a,minTickCount:s,maxTickCount:o});if(this.placement==="bottom"||this.placement==="top"){const r=l_(this.label),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let p=-1/0*h;n.ticks=n.ticks.filter(u=>{if(Math.sign(u.translation-p)!==h)return!1;const{width:g}=d_(u.tickLabel)?p_(u.tickLabel,this.label):r.measureLines(u.tickLabel);return p=u.translation+g*h,!0})}return n}getTicksData(t){const i=[],o=t.nice?this.scale.niceDomain(t):this.scale.domain,s=this.scale.ticks(t,o)?.ticks??[],a=s.reduce((l,c)=>Math.max(l,c_(c)),0),n=D_(),r=this.tickFormatter(o,s,!1,a);for(let l=0;lthis.onChartHoverChange()),e.layoutManager.registerElement(N_.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){const{placement:e}=Wp(this.position);return e.startsWith("right")||e.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout(e){const[t]=this.data;if(!this.enabled||!t?.enabled||t.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t),o=this.updateGradientRect(e.layoutBox,i),s=this.updateAxis(t,o)??new Vp(0,0,0,0),a=Vp.merge([o,s]),{strokeWidth:n,padding:r}=this.getContainerStyles();a.grow(r).grow(n);const{left:l,top:c}=this.getMeasurements(e.layoutBox,a);this.updateContainer(a),this.updateArrow(),this.legendGroup.visible=!0,this.legendGroup.translationX=l,this.legendGroup.translationY=c}normalizeColorArrays(e){let t=e.colorDomain.slice();const i=e.colorRange.slice();if(t.length===i.length)return{colorDomain:t,colorRange:i};t.length>i.length&&i.splice(t.length);const[o,s]=t,a=i.length;return t=i.map((n,r)=>r===0?o:r===a-1?s:o+(s-o)*r/(a-1)),{colorDomain:t,colorRange:i}}updateGradientRect(e,t){const{gradientRect:i,gradient:o}=this,{preferredLength:s,thickness:a}=o,n=new Vp(0,0,0,0);let r;return this.isVertical()?(r=0,n.width=a,n.height=Math.min(e.height,s)):(r=90,n.width=Math.min(e.width,s),n.height=a),i.x=n.x,i.y=n.y,i.width=n.width,i.height=n.height,i.fill={type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:t.map((l,c)=>({stop:c/(t.length-1),color:l})),rotation:r},n}updateAxis(e,t){const{axisTicks:i,gradient:o,scale:s}=this,{placement:a}=Wp(this.position),n=this.isVertical(),r=this.reverseOrder!==n;i.placement=a;const l=o.thickness+(s.padding??0);return i.translationX=n?l:t.x,i.translationY=n?t.y:l,i.scale.domain=r?e.colorDomain.slice().reverse():e.colorDomain,i.scale.range=n?[t.x,t.height]:[t.y,t.width],i.calculateLayout()}updateContainer(e){const t=this.getContainerStyles();Yn.applyShapeStyle(this.containerNode,t),this.containerNode.cornerRadius=t.cornerRadius,this.containerNode.x=e.x,this.containerNode.y=e.y,this.containerNode.width=e.width,this.containerNode.height=e.height}updateArrow(){const e=this.highlightManager.getActiveHighlight(),{arrow:t}=this;if(e?.colorValue==null){t.visible=!1;return}const{scale:i,label:o}=this.axisTicks,s=o.fontSize??0,a=i.convert(e.colorValue);let{x:n,y:r}=this.gradientRect,l=Math.PI;this.isVertical()?(n-=s/2,r+=a,l/=2):(n+=a,r-=s/2),t.visible=!0,t.fill=o.color,t.rotation=l,t.size=s,t.translationX=n,t.translationY=r}getMeasurements(e,t){function i(u){}let{x:o,y:s}=e;const{width:a,height:n}=t,{placement:r,floating:l,xOffset:c,yOffset:h}=Wp(this.position),p=this.getContainerStyles();switch(o+=p.strokeWidth+p.padding.left,s+=p.strokeWidth+p.padding.top,r){case"left":s+=e.height/2-n/2;break;case"right":o+=e.width-a,s+=e.height/2-n/2;break;case"top":o+=e.width/2-a/2;break;case"bottom":o+=e.width/2-a/2,s+=e.height-n;break;case"right-top":case"top-right":o+=e.width-a;break;case"right-bottom":case"bottom-right":o+=e.width-a,s+=e.height-n;break;case"left-bottom":case"bottom-left":s+=e.height-n;break;case"left-top":case"top-left":break;default:}if(!l)switch(r){case"left":case"left-top":case"left-bottom":e.shrink(a+this.spacing,"left");break;case"right":case"right-top":case"right-bottom":e.shrink(a+this.spacing,"right");break;case"top":case"top-left":case"top-right":e.shrink(n+this.spacing,"top");break;case"bottom":case"bottom-left":case"bottom-right":e.shrink(n+this.spacing,"bottom");break;default:}return o+=c,s+=h,{top:s,left:o}}getContainerStyles(){const{stroke:e,strokeOpacity:t,strokeWidth:i}=this.border,{cornerRadius:o,fill:s,fillOpacity:a,padding:n}=this,r=typeof n=="number";return{cornerRadius:o,fill:s,fillOpacity:a,padding:{top:r?n:n.top??0,right:r?n:n.right??0,bottom:r?n:n.bottom??0,left:r?n:n.left??0},stroke:e,strokeOpacity:t,strokeWidth:this.border.enabled?i:0}}onChartHoverChange(){this.enabled&&this.updateArrow()}};Zt.className="GradientLegend",d([Xt],Zt.prototype,"enabled",2),d([Xt],Zt.prototype,"position",2),d([Xt],Zt.prototype,"reverseOrder",2),d([Xt],Zt.prototype,"gradient",2),d([Xt],Zt.prototype,"spacing",2),d([Xt],Zt.prototype,"border",2),d([Xt],Zt.prototype,"cornerRadius",2),d([Xt],Zt.prototype,"fill",2),d([Xt],Zt.prototype,"fillOpacity",2),d([Xt],Zt.prototype,"padding",2),d([Xt],Zt.prototype,"scale",2);var __={type:"legend",optionsKey:"gradientLegend",packageType:"enterprise",chartTypes:["cartesian","polar","topology","standalone"],identifier:"gradient",moduleFactory:e=>new Zt(e),themeTemplate:{enabled:!1,position:"bottom",spacing:20,scale:{padding:13,label:{color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},minSpacing:5},interval:{minSpacing:15}},gradient:{preferredLength:100,thickness:16},reverseOrder:!1,fill:{$applySwitch:[{$path:"type"},{$ref:"chartBackgroundColour"},["gradient",zp.FILL_GRADIENT_BLANK_DEFAULTS],["pattern",zp.FILL_PATTERN_BLANK_DEFAULTS],["image",zp.FILL_IMAGE_BLANK_DEFAULTS]]}},removable:"standalone-only"};import{createElement as R_}from"ag-charts-core";function E_(e,t){const i=e.addChild("canvas-overlay","watermark"),o=R_("span");o.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(o)}import{_ModuleSupport as B_}from"ag-charts-community";import{_ModuleSupport as z_}from"ag-charts-community";var{ordinalTimeAxisOptionsDefs:F_,angleNumberAxisOptionsDefs:H_,angleCategoryAxisOptionsDefs:V_,radiusNumberAxisOptionsDefs:W_,radiusCategoryAxisOptionsDefs:G_}=z_,K_={type:"axis",name:"ordinal-time",chartType:"cartesian",enterprise:!0,options:F_,create:e=>new gn(e)},$_={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,options:H_,create:e=>new ps(e)},j_={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,options:V_,create:e=>new To(e)},Y_={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,options:W_,create:e=>new ra(e)},U_={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,options:G_,create:e=>new Co(e)};import{_ModuleSupport as X_}from"ag-charts-community";import{_ModuleSupport as Z_}from"ag-charts-community";var{Chart:q_}=Z_,Kp=class extends q_{getChartType(){return"standalone"}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:o}=e,s=o.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=s,this.animationRect=s;for(const a of[t,i])a.translationX=Math.floor(s.x),a.translationY=Math.floor(s.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:s,paddedRect:o}})}getAriaLabel(){const e=this.series[0]?.type;if(e==null)return"";const t=this.getCaptionText();switch(e){case"radial-gauge":case"linear-gauge":{const i=[];t.length!==0&&i.push(t);for(const o of this.series)i.push(o.getCaptionText());return this.ctx.localeManager.t("ariaAnnounceGaugeChart",{caption:i.join(". ")})}case"treemap":case"sunburst":return this.ctx.localeManager.t("ariaAnnounceHierarchyChart",{caption:t});default:return this.ctx.localeManager.t("ariaAnnounceStandaloneChart",{caption:t})}}};Kp.className="StandaloneChart",Kp.type="standalone";var{isAgStandaloneChartOptions:Q_,standaloneChartOptionsDefs:J_}=X_,eR={type:"chart",name:"standalone",enterprise:!0,options:J_,detect:Q_,create(e,t){return new Kp(e,t)}};import{_ModuleSupport as tR}from"ag-charts-community";import{_ModuleSupport as iR}from"ag-charts-community";var{Chart:oR,MercatorScale:MS,ChartAxisDirection:uc,Property:sR}=iR;function AS(e){return e.type==="map-shape"||e.type==="map-line"||e.type==="map-marker"||e.type==="map-shape-background"||e.type==="map-line-background"}var gc=class extends oR{constructor(e,t){super(e,t),this.ctx.zoomManager.updateAxes([uc.X,uc.Y])}getChartType(){return"topology"}async updateData(){await super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;for(const i of this.series)AS(i)&&i.setChartTopology(t)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,{layoutBox:o}=e,s=o.clone().shrink(this.modulesManager.getModule("seriesArea").getPadding());this.seriesRect=s,this.animationRect=s;const a=this.series.filter(AS),n=a.reduce((c,h)=>{if(!h.visible)return c;const p=h.topologyBounds;return p==null?c:c==null?p:c.merge(p)},void 0);let r;if(n!=null){const{lon0:c,lat0:h,lon1:p,lat1:u}=n,g=[[c,h],[p,u]],y=MS.bounds(g),{width:f,height:x}=s,S=Math.min(f/y.width,x/y.height),v=y.width*S,m=y.height*S,b=(f-v)/2,k=(x-m)/2,A=b,M=k,D=b+v,L=k+m,N=this.ctx.zoomManager.getAxisZoom(uc.X),P=this.ctx.zoomManager.getAxisZoom(uc.Y),R=(D-A)/(N.max-N.min),F=A-R*N.min,_=(L-M)/(1-P.min-(1-P.max)),E=M-_*(1-P.max);r=new MS(g,[[F,E],[F+R,E+_]])}for(const c of a)c.scale=r;const l=this.series.some(c=>c.visible);t.visible=l;for(const c of[t,i])c.translationX=Math.floor(s.x),c.translationY=Math.floor(s.y),c.setClipRect(s.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:l,rect:s,paddedRect:o}})}};gc.className="TopologyChart",gc.type="topology",d([sR],gc.prototype,"topology",2);var{isAgTopologyChartOptions:aR,topologyChartOptionsDefs:nR}=tR,rR={type:"chart",name:"topology",enterprise:!0,options:nR,detect:aR,create(e,t){return new gc(e,t)}};import{_ModuleSupport as lR}from"ag-charts-community";import{_ModuleSupport as cR}from"ag-charts-community";import{and as yc,arrayOf as hR,arrayOfDefs as IS,boolean as Gs,constant as LS,greaterThan as TS,lessThan as CS,number as Yi,numberRange as dR,optionsDefs as NS,or as Ks,ratio as fc,required as pR,string as Ti,typeUnion as uR,union as gR}from"ag-charts-core";var{annotationCalloutStylesDefs:yR,annotationNoteStylesDefs:fR,annotationTextStylesDef:mR,annotationCommentStylesDefs:xR,annotationMeasurerStylesDefs:mc,annotationQuickMeasurerStylesDefs:SR,annotationShapeStylesDefs:wS,annotationChannelTextDefs:bR,annotationCrossLineStyleDefs:PS,annotationFibonacciStylesDefs:OS,annotationLineStyleDefs:_S,annotationLineTextDefs:vR,annotationDisjointChannelStyleDefs:kR,annotationParallelChannelStyleDefs:DR}=cR,Xn=NS({__type:pR(LS("date")),value:Ks(Ti,Yi)},"a serializable date object"),RS=Ks(Ti,Yi,Xn),$p=Ks(RS,NS({value:RS,groupPercentage:dR(-1,2)})),ES={...bR,label:Ti},Ui={...vR,label:Ti},ye={x:$p,y:Yi},MR=uR({line:{..._S,start:ye,end:ye,text:Ui},"horizontal-line":{...PS,value:$p,text:Ui},"vertical-line":{...PS,value:$p,text:Ui},"disjoint-channel":{...kR,startHeight:Yi,endHeight:Yi,start:ye,end:ye,text:ES},"parallel-channel":{...DR,height:Yi,start:ye,end:ye,text:ES},"fibonacci-retracement":{...OS,start:ye,end:ye,text:Ui,reverse:Gs},"fibonacci-retracement-trend-based":{...OS,start:ye,end:ye,endRetracement:ye,text:Ui,reverse:Gs},callout:{...yR,start:ye,end:ye,text:Ti},comment:{...xR,...ye,text:Ti},note:{...fR,...ye,text:Ti},text:{...mR,...ye,text:Ti},arrow:{..._S,text:Ui,start:ye,end:ye},"arrow-up":{...wS,...ye},"arrow-down":{...wS,...ye},"date-range":{...mc,extendAbove:Gs,extendBelow:Gs,text:Ui,start:ye,end:ye},"price-range":{...mc,extendLeft:Gs,extendRight:Gs,text:Ui,start:ye,end:ye},"date-price-range":{...mc,text:Ui,start:ye,end:ye},"quick-date-price-range":{...mc,...SR,text:Ui,start:ye,end:ye}},"an annotation initial state object"),AR={chartType:gR("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),annotations:IS(MR),legend:IS({visible:Gs,seriesId:Ti,itemId:Ti,legendItemName:Ti},"legend state array"),zoom:{rangeX:{start:Ks(Yi,Xn),end:Ks(Yi,Xn)},rangeY:{start:Ks(Yi,Xn),end:Ks(Yi,Xn)},ratioX:{start:yc(fc,CS("end")),end:yc(fc,TS("start"))},ratioY:{start:yc(fc,CS("end")),end:yc(fc,TS("start"))},autoScaledAxes:hR(LS("y"))}},{annotationOptionsDef:IR}=lR,LR={type:"plugin",name:"annotations",chartType:"cartesian",options:IR,create(){return null}},TR={type:"plugin",name:"navigator",chartType:"cartesian",options:WO,create(){return null}},CR={type:"plugin",name:"initialState",options:AR,create(){return null}};import{_ModuleSupport as Zn}from"ag-charts-community";import{_ModuleSupport as NR}from"ag-charts-community";import{Logger as wR,cachedTextMeasurer as PR,calcLineHeight as OR,toPlainText as _R,wrapText as RR}from"ag-charts-core";import{_ModuleSupport as xc}from"ag-charts-community";import{Logger as ER}from"ag-charts-core";function BS(e,t,i){i||(t=BR(t));const o=new Map;for(const a of e)o.set(a.id,{datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1});let s=0;for(const[a,n]of o.entries())s=Math.max(s,jp(o,t,n,a,-1,[])+jp(o,t,n,a,1,[])+1);return{links:t,nodeGraph:o,maxPathLength:s}}function zS(e,t,i,o){const s=o.indexOf(t);if(s!==-1){for(let n=s;n!t.has(i))}function jp(e,t,i,o,s,a){if(a.includes(o))return 1/0;let n=s===-1?i.maxPathLengthBefore:i.maxPathLengthAfter;if(n===-1){n=0;const r=s===-1?i.linksBefore:i.linksAfter;for(const l of t){const{fromNode:c,toNode:h}=l,p=s===-1?h.id:c.id,u=s===-1?c.id:h.id,g=o===p?e.get(u):void 0;g!=null&&(r.push({node:g,link:l}),a?.push(o),n=Math.max(n,jp(e,t,g,u,s,a)+1),a?.pop())}s===-1?i.maxPathLengthBefore=n:i.maxPathLengthAfter=n}return n}var{Series:zR,DataController:FR,keyProperty:HR,valueProperty:Sc,Selection:$s,Group:Ga,TransformableText:VR}=xc,WR=class extends xc.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o);const{datumIndex:s}=i,a=o.contextNodeData?.nodeData.find(n=>n.datumIndex.type===s.type&&n.datumIndex.index===s.index);this.size=a?.size,this.label=a?.type===1?a?.label:void 0}},FS=class extends zR{constructor(){super(...arguments),this.NodeEvent=WR,this.nodeCount=0,this.linkCount=0,this.linksDataModel=void 0,this.linksProcessedData=void 0,this.nodesDataModel=void 0,this.nodesProcessedData=void 0,this.processedNodes=new Map,this.linkGroup=this.contentGroup.appendChild(new Ga({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new Ga({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new Ga({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new Ga({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new Ga({name:"linkGroup"})),this.highlightNodeGroup=this.highlightGroup.appendChild(new Ga({name:"nodeGroup"})),this.labelSelection=$s.select(this.labelGroup,VR),this.linkSelection=$s.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=$s.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=$s.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=$s.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=$s.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=$s.select(this.highlightNodeGroup,()=>this.nodeFactory())}get nodes(){return this.properties.nodes}async processData(e){const{data:t,nodes:i}=this;if(t==null)return;const{fromKey:o,toKey:s,sizeKey:a,idKey:n,labelKey:r}=this.properties,l=new FR("standalone",e.suppressFieldDotNotation),c=i==null?null:l.request(this.id,xc.DataSet.wrap(i)??xc.DataSet.empty(),{props:[HR(n,void 0,{id:"idValue",includeProperty:!1}),...r==null?[]:[Sc(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),h=e.request(this.id,t,{props:[Sc(o,void 0,{id:"fromValue",includeProperty:!1}),Sc(s,void 0,{id:"toValue",includeProperty:!1}),...a==null?[]:[Sc(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[p,u]=await Promise.all([c??Promise.resolve(null),h]);this.nodesDataModel=p?.dataModel,this.nodesProcessedData=p?.processedData,this.linksDataModel=u?.dataModel,this.linksProcessedData=u?.processedData;const g=new Map;if(p==null){const y=u.dataModel.resolveColumnById(this,"fromValue",u.processedData),f=u.dataModel.resolveColumnById(this,"toValue",u.processedData),x=v=>{const m=g.size,b=v;return{series:this,itemId:void 0,datum:{},datumIndex:{type:1,index:m},type:1,index:m,linksBefore:[],linksAfter:[],id:v,size:0,label:b,style:this.getNodeStyle({datumIndex:{type:1,index:m},datum:{},size:0,label:b},m,!1)}},S=u.processedData.dataSources.get(this.id)?.data;if(S)for(const[v]of S.entries()){const m=y[v],b=f[v];m==null||b==null||(g.has(m)||g.set(m,x(m)),g.has(b)||g.set(b,x(b)))}}else{const y=p.dataModel.resolveColumnById(this,"idValue",p.processedData),f=r==null?void 0:p.dataModel.resolveColumnById(this,"labelValue",p.processedData),x=p.processedData.dataSources.get(this.id)?.data;if(x)for(const[S,v]of x.entries()){const m=y[S],b=f?.[S],k={type:1,index:S};g.set(m,{series:this,itemId:void 0,datum:v,datumIndex:k,type:1,index:S,linksBefore:[],linksAfter:[],id:m,size:0,label:b,style:this.getNodeStyle({datumIndex:k,datum:v,size:0,label:b},S,!1)})}}this.processedNodes=g}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:o,linksProcessedData:s}=this;if(o==null||s==null){const{links:f,nodeGraph:x,maxPathLength:S}=BS(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:x,links:f,maxPathLength:S}}const{sizeKey:a}=this.properties,n=o.resolveColumnById(this,"fromValue",s),r=o.resolveColumnById(this,"toValue",s),l=a==null?void 0:o.resolveColumnById(this,"sizeValue",s),c=new Map;for(const f of this.processedNodes.values()){const x=e(f);c.set(f.id,x)}const h=[],p=s.dataSources.get(this.id)?.data;if(p)for(const[f,x]of p.entries()){const S=n[f],v=r[f],m=l==null?1:l[f],b=c.get(S),k=c.get(v);if(m<=0||b==null||k==null)continue;const A={type:0,index:f},M=t({series:this,itemId:void 0,datum:x,datumIndex:A,type:0,index:f,fromNode:b,toNode:k,size:m,style:this.getLinkStyle({datum:x,datumIndex:A},b.datumIndex,!1)});h.push(M)}const{links:u,nodeGraph:g,maxPathLength:y}=BS(c.values(),h,i);for(const f of g.values())f.datum.linksBefore=f.linksBefore.map(x=>x.link),f.datum.linksAfter=f.linksAfter.map(x=>x.link);return this.nodeCount=g.size,this.linkCount=u.length,{nodeGraph:g,links:u,maxPathLength:y}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(e){const{seriesRect:t}=e,i={seriesRectWidth:t?.width??0,seriesRectHeight:t?.height??0};(this._nodeDataDependencies==null||this._nodeDataDependencies.seriesRectWidth!==i.seriesRectWidth||this._nodeDataDependencies.seriesRectHeight!==i.seriesRectHeight)&&(this._nodeDataDependencies=i),this.updateSelections();const o=this.contextNodeData?.nodeData??[],s=this.contextNodeData?.labelData??[];let a=this.ctx.highlightManager?.getActiveHighlight();if(a?.series===this&&a.type==null){const{itemId:h}=a;a=h==null?void 0:o.find(p=>p.type===1&&p.id===h)}else a?.series!==this&&(a=void 0);this.contentGroup.visible=this.visible,this.contentGroup.opacity=a==null?1:this.properties.highlight.unhighlightedItem.opacity??1,this.labelSelection=this.updateLabelSelection({labelData:s,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:o.filter(h=>h.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:o.filter(h=>h.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let n,r,l,c;a?.type===1?(n=o.filter(h=>h.type===0&&(h.toNode===a||h.fromNode===a)),r=n.map(h=>h.fromNode===a?h.toNode:h.fromNode),r.push(a),l=[],c=[a]):a?.type===0?(n=[a],r=[a.fromNode,a.toNode],l=[a],c=[]):(n=[],r=[],l=[],c=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:n,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:r,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:l,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:c,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}resetAnimation(e){}dataCount(){return Number.NaN}getSeriesDomain(e){return[]}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}legendItemSymbol(e,t,i={}){const{fills:o,strokes:s}=this.properties,{fill:a=o[t%o.length],fillOpacity:n=1,stroke:r=s[t%s.length],strokeWidth:l=0,strokeOpacity:c=1,lineDash:h=[0],lineDashOffset:p=0}=i;return{marker:{fill:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}}}getLegendData(e){if(e!=="category")return[];const{showInLegend:t}=this.properties;return Array.from(this.processedNodes.values(),({id:i,label:o},s)=>({legendType:"category",id:this.id,itemId:i,seriesId:this.id,enabled:!0,label:{text:o??i},symbol:this.legendItemSymbol(1,s),hideInLegend:!t,isFixed:!0}))}pickNodeClosestDatum({x:e,y:t}){let i=1/0,o;return this.linkSelection.each((s,a)=>{const n=s.distanceSquared(e,t);n{const n=s.distanceSquared(e,t);nh.datum),c=r.indexOf(o)+t;c>=0&&c0?s=r.at(-1):s=Array.from(this.nodeSelection,p=>p.datum).at(-1)}else if(o?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(o)+t;c>=0&&cp.datum)[0]}if(s==null)return;const a=s.type===1?Array.from(this.nodeSelection).find(r=>r.datum===s):Array.from(this.linkSelection).find(r=>r.datum===s);if(a==null)return;const n=this.computeFocusBounds(a.node);if(n!=null)return{datum:a.datum,datumIndex:this.contextNodeData?.nodeData.indexOf(a.datum)??0,otherIndex:0,bounds:n,clipFocusBox:!0}}getCategoryValue(e){}datumIndexForCategoryValue(e){}};import{_ModuleSupport as GR}from"ag-charts-community";var{Path:KR,SceneChangeDetection:es}=GR;function HS({radius:e,startAngle:t,endAngle:i,tension:o}){const s=e*Math.cos(t),a=e*Math.sin(t),n=e*Math.cos(i),r=e*Math.sin(i),l=s*o,c=a*o,h=n*o,p=r*o;return{x:[s,l,h,n],y:[a,c,p,r]}}var ko=class extends KR{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=0,this.startAngle1=0,this.endAngle1=0,this.startAngle2=0,this.endAngle2=0,this.tension=1}tensionedCurveTo(e,t,i,o,s,a,n,r){const{path:l,tension:c}=this,h=1-c;l.cubicCurveTo((i-e)*h+e,(o-t)*h+t,(s-n)*h+n,(a-r)*h+r,n,r)}updatePath(){const{path:e,centerX:t,centerY:i,radius:o}=this;let{startAngle1:s,endAngle1:a,startAngle2:n,endAngle2:r}=this;s>n&&([s,n]=[n,s],[a,r]=[r,a]),e.clear();const l=t+o*Math.cos(s),c=i+o*Math.sin(s);e.moveTo(l,c),this.tensionedCurveTo(l,c,t,i,t,i,t+o*Math.cos(r),i+o*Math.sin(r)),e.arc(t,i,o,r,n,!0),this.tensionedCurveTo(t+o*Math.cos(n),i+o*Math.sin(n),t,i,t,i,t+o*Math.cos(a),i+o*Math.sin(a)),e.arc(t,i,o,a,s,!0),e.closePath()}};d([es()],ko.prototype,"centerX",2),d([es()],ko.prototype,"centerY",2),d([es()],ko.prototype,"radius",2),d([es()],ko.prototype,"startAngle1",2),d([es()],ko.prototype,"endAngle1",2),d([es()],ko.prototype,"startAngle2",2),d([es()],ko.prototype,"endAngle2",2),d([es()],ko.prototype,"tension",2);import{_ModuleSupport as $R}from"ag-charts-community";var{FillGradientDefaults:jR,FillPatternDefaults:YR,FillImageDefaults:UR,BaseProperties:VS,makeSeriesTooltip:XR,SeriesProperties:ZR,Property:ae,Label:qR}=$R,Yp=class extends qR{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};d([ae],Yp.prototype,"spacing",2),d([ae],Yp.prototype,"maxWidth",2);var Xi=class extends VS{constructor(){super(...arguments),this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0,this.tension=0}getStyle(e,t,i){const{fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,tension:l}=this,c=this.fill??e[i%e.length],h=this.stroke??t[i%e.length];return{fill:c,fillOpacity:o,stroke:h,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,tension:l}}};d([ae],Xi.prototype,"fill",2),d([ae],Xi.prototype,"fillOpacity",2),d([ae],Xi.prototype,"stroke",2),d([ae],Xi.prototype,"strokeOpacity",2),d([ae],Xi.prototype,"strokeWidth",2),d([ae],Xi.prototype,"lineDash",2),d([ae],Xi.prototype,"lineDashOffset",2),d([ae],Xi.prototype,"tension",2),d([ae],Xi.prototype,"itemStyler",2);var Ci=class extends VS{constructor(){super(...arguments),this.spacing=1,this.width=1,this.fill=void 0,this.fillOpacity=1,this.stroke=void 0,this.strokeOpacity=1,this.strokeWidth=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this,l=this.fill??e[i%e.length],c=this.stroke??t[i%e.length];return{fill:l,fillOpacity:o,stroke:c,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r}}};d([ae],Ci.prototype,"spacing",2),d([ae],Ci.prototype,"width",2),d([ae],Ci.prototype,"fill",2),d([ae],Ci.prototype,"fillOpacity",2),d([ae],Ci.prototype,"stroke",2),d([ae],Ci.prototype,"strokeOpacity",2),d([ae],Ci.prototype,"strokeWidth",2),d([ae],Ci.prototype,"lineDash",2),d([ae],Ci.prototype,"lineDashOffset",2),d([ae],Ci.prototype,"itemStyler",2);var Ue=class extends ZR{constructor(){super(),this.idKey="",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.sizeKey=void 0,this.sizeName=void 0,this.nodes=void 0,this.fillGradientDefaults=new jR,this.fillPatternDefaults=new YR,this.fillImageDefaults=new UR,this.fills=[],this.strokes=[],this.label=new Yp,this.link=new Xi,this.node=new Ci,this.tooltip=XR(),this.highlightStyle.deprecated=!1}};d([ae],Ue.prototype,"fromKey",2),d([ae],Ue.prototype,"toKey",2),d([ae],Ue.prototype,"idKey",2),d([ae],Ue.prototype,"idName",2),d([ae],Ue.prototype,"labelKey",2),d([ae],Ue.prototype,"labelName",2),d([ae],Ue.prototype,"sizeKey",2),d([ae],Ue.prototype,"sizeName",2),d([ae],Ue.prototype,"nodes",2),d([ae],Ue.prototype,"fillGradientDefaults",2),d([ae],Ue.prototype,"fillPatternDefaults",2),d([ae],Ue.prototype,"fillImageDefaults",2),d([ae],Ue.prototype,"fills",2),d([ae],Ue.prototype,"strokes",2),d([ae],Ue.prototype,"label",2),d([ae],Ue.prototype,"link",2),d([ae],Ue.prototype,"node",2),d([ae],Ue.prototype,"tooltip",2);var{SeriesNodePickMode:WS,createDatumId:bc,angleBetween:vc,normalizeAngle360:QR,isBetweenAngles:GS,Sector:JR,evaluateBezier:kc,applyShapeStyle:KS,getShapeStyle:Dc,getLabelStyles:eE,BBox:tE,mergeDefaults:Mc}=NR,Ac=e=>e.startAngle+vc(e.startAngle,e.endAngle)/2,Ic=class extends FS{constructor(e){super({moduleCtx:e,pickModes:[WS.NEAREST_NODE,WS.EXACT_SHAPE_MATCH]}),this.properties=new Ue}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new ko}nodeFactory(){return new JR}createNodeData(){const{id:e,_nodeDataDependencies:{seriesRectWidth:t,seriesRectHeight:i}={seriesRectWidth:0,seriesRectHeight:0},properties:o}=this,{fromKey:s,toKey:a,sizeKey:n,labelKey:r,label:{spacing:l,maxWidth:c,fontSize:h},node:{width:p,spacing:u}}=o,g=t/2,y=i/2;let f=[];const{nodeGraph:x,links:S}=this.getNodeGraph(E=>({...E,centerX:g,centerY:y,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),E=>({...E,centerX:g,centerY:y,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let v=0;for(const[E,{datum:T,linksBefore:w,linksAfter:C}]of x.entries()){const I=w.reduce((O,{link:z})=>O+z.size,0)+C.reduce((O,{link:z})=>O+z.size,0);if(I===0)x.delete(E);else{const{label:O}=o;T.size=I,v+=T.size;const z=O.enabled?this.getLabelText(T.label,T.datum,r,"label",[],O,{datum:T.datum,value:T.label,fromKey:s,toKey:a,sizeKey:n,size:T.size}):void 0;T.label=_R(z)}}let m=0;if(this.isLabelEnabled()){const E=PR(this.properties.label);let T=0;for(const{datum:w}of x.values()){const{id:C,label:I}=w;if(I==null)continue;const O=RR(I,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:z}=E.measureLines(O);T=Math.max(z,T),f.push({id:C,text:O,centerX:g,centerY:y,angle:Number.NaN,radius:Number.NaN,size:w.size})}m=T+l}const b=x.size;let k=Math.min(t,i)/2-p-m,A=u/k;if(m!==0&&(b*A>=1.5*Math.PI||k<=0)&&(f=[],k=Math.min(t,i)/2-p,A=u/k),b*A>=2*Math.PI||k<=0){wR.warnOnce("There was insufficient space to display the Chord Series.");return}const M=k,D=k+p,L=Math.max((2*Math.PI-b*A)/v,0);let N=0;for(const{datum:E}of x.values()){E.innerRadius=M,E.outerRadius=D,E.startAngle=N,E.endAngle=N+E.size*L,N=E.endAngle+A;const T=(E.innerRadius+E.outerRadius)/2,w=Ac(E);E.midPoint={x:E.centerX+T*Math.cos(w),y:E.centerY+T*Math.sin(w)}}const P=[];for(const{datum:E,linksBefore:T,linksAfter:w}of x.values()){const C=Ac(E),I=[...T.map(z=>({link:z.link,distance:vc(Ac(z.node.datum),C),after:!1})),...w.map(z=>({link:z.link,distance:vc(Ac(z.node.datum),C),after:!0}))];let O=E.startAngle;for(const{link:z,after:B}of I.toSorted((H,W)=>H.distance-W.distance)){const H=z.size*L;B?(z.startAngle1=O,z.endAngle1=O+H):(z.startAngle2=O,z.endAngle2=O+H),O+=z.size*L}P.push(E)}const{tension:R}=this.properties.link;for(const E of S){E.radius=k;const T=HS({radius:k,startAngle:E.startAngle1,endAngle:E.endAngle2,tension:R}),w=HS({radius:k,startAngle:E.startAngle2,endAngle:E.endAngle1,tension:R}),C=kc(...T.x,.5),I=kc(...T.y,.5),O=kc(...w.x,.5),z=kc(...w.y,.5);E.midPoint={x:E.centerX+(C+O)/2,y:E.centerY+(I+z)/2},P.push(E)}for(const E of f){const T=x.get(E.id)?.datum;T!=null&&(E.radius=D+l,E.angle=QR(T.startAngle+vc(T.startAngle,T.endAngle)/2))}f.sort((E,T)=>E.angle-T.angle);let F=1/0,_=-1/0;return f=f.filter(E=>{const T=OR(h),w=Math.atan2(T/2,E.radius),C=E.angle-w,I=E.angle+w;return GS(F,C,I)||GS(_,C,I)?!1:(F=Math.min(C,F),_=Math.max(I,_),!0)}),{itemId:e,nodeData:P,labelData:f}}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes(e){const t={toKey:this.properties.toKey,fromKey:this.properties.fromKey,sizeKey:this.properties.sizeKey,size:Number.NaN},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,{size:s,text:a,centerX:n,centerY:r,radius:l,angle:c})=>{t.size=s;const h=eE(this,void 0,t,this.properties.label,!1,i),{fontStyle:p,fontWeight:u,fontSize:g,fontFamily:y,color:f}=h;o.visible=!0,o.translationX=n+l*Math.cos(c),o.translationY=r+l*Math.sin(c),o.text=a,o.fill=f,o.fontStyle=p,o.fontWeight=u,o.fontSize=g,o.fontFamily=y,o.textBaseline="middle",Math.cos(c)>=0?(o.textAlign="left",o.rotation=c):(o.textAlign="right",o.rotation=c-Math.PI),o.setBoxing(h)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>bc(t.type,t.id))}getNodeStyle(e,t,i){const{properties:o}=this,{fills:s,strokes:a,fillGradientDefaults:n,fillPatternDefaults:r,fillImageDefaults:l}=o,{itemStyler:c}=o.node,h=this.getHighlightStyle(i,e.datumIndex),p=Mc(h,o.node.getStyle(s,a,t));let u=Dc(p,n,r,l);if(c!=null&&e.datumIndex!=null){const g=this.cachedDatumCallback(bc(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const y=this.makeItemStylerParams(e,i,u);return this.callWithContext(c,y)});g&&(u=Dc(Mc(g,u),n,r,l))}return u.opacity=1,u}makeItemStylerParams({datum:e,datumIndex:t,size:i=0,label:o},s,a){const{id:n}=this,r=this.ctx.highlightManager?.getActiveHighlight(),l=this.getHighlightStateString(r,s,t),c=this.filterItemStylerFillParams(a.fill)??a.fill;return{seriesId:n,datum:e,highlighted:s,highlightState:l,...a,size:i,label:o,fill:c}}updateNodeNodes(e){const{datumSelection:t,isHighlight:i}=e,o=this.getShapeFillBBox();t.each((s,a)=>{const{datumIndex:n}=a,r=this.getNodeStyle(a,n.index,i);KS(s,r,o),s.centerX=a.centerX,s.centerY=a.centerY,s.innerRadius=a.innerRadius,s.outerRadius=a.outerRadius,s.startAngle=a.startAngle,s.endAngle=a.endAngle,s.inset=s.strokeWidth/2})}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>bc(t.type,t.index,t.fromNode.id,t.toNode.id))}getLinkStyle({datumIndex:e,datum:t},i,o){const{id:s,properties:a}=this,{fills:n,strokes:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=a,{itemStyler:p}=a.link,u=this.getHighlightStyle(o,e),g=Mc(u,a.link.getStyle(n,r,i.index));let y=Dc(g,l,c,h);if(p!=null&&e!=null){const f=this.ctx.highlightManager?.getActiveHighlight(),x=this.cachedDatumCallback(bc(e.index,"link",o?"highlight":"node"),()=>{const S=this.getHighlightStateString(f,o,i);return this.callWithContext(p,{seriesId:s,datum:t,highlighted:o,highlightState:S,...y})});x&&(y=Dc(Mc(x,y),l,c,h))}return y.opacity=1,y}updateLinkNodes(e){const{datumSelection:t,isHighlight:i}=e,o=this.getShapeFillBBox();t.each((s,a)=>{const n=a.fromNode.datumIndex,r=this.getLinkStyle(a,n,i);s.centerX=a.centerX,s.centerY=a.centerY,s.radius=a.radius,s.startAngle1=a.startAngle1,s.endAngle1=a.endAngle1,s.startAngle2=a.startAngle2,s.endAngle2=a.endAngle2,s.tension=r.tension,KS(s,r,o)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=Math.min(e,t),o=(e-i)/2,s=(t-i)/2,a=new tE(o,s,e,t);return{series:a,axis:a}}getTooltipContent(e){const{id:t,linksProcessedData:i,nodesProcessedData:o,properties:s,ctx:{formatManager:a}}=this,{fromKey:n,toKey:r,sizeKey:l,sizeName:c,tooltip:h}=s,p=this.contextNodeData?.nodeData.find(v=>v.datumIndex.type===e.type&&v.datumIndex.index===e.index);if(p==null)return;const u=p.type===0?p.fromNode.index:p.index,g=p.type===0?`${p.fromNode.label} - ${p.toNode.label}`:p.label,y=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:o?.dataSources.get(this.id)?.data[e.index],f=p.size;let x;if(p.type===0){const v=p.fromNode.datumIndex;x=this.getLinkStyle({datumIndex:e,datum:y},v,!1)}else{const v=p.label;x=this.getNodeStyle({datumIndex:e,datum:y,size:f,label:v},e.index,!1)}const S=[];if(l!=null){const v=a.format(this.callWithContext.bind(this),{type:"number",value:f,datum:y,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0});S.push({label:c,fallbackLabel:l,value:v??String(f)})}return this.formatTooltipWithContext(h,{title:g,symbol:this.legendItemSymbol(p.type,u,x),data:S},{seriesId:t,datum:y,title:g,fromKey:n,toKey:r,sizeKey:l,sizeName:c,size:f,...x})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};Ic.className="ChordSeries",Ic.type="chord";import{_ModuleSupport as iE}from"ag-charts-community";import{constant as oE,fillGradientDefaults as sE,fillImageDefaults as aE,fillPatternDefaults as nE,required as Up,string as Lc,undocumented as Xp}from"ag-charts-core";var{commonSeriesOptionsDefs:rE,chordSeriesThemeableOptionsDef:lE}=iE,Tc={...lE,...rE,type:Up(oE("chord")),fromKey:Up(Lc),toKey:Up(Lc),sizeKey:Lc,sizeName:Lc};Tc.fillGradientDefaults=Xp(sE),Tc.fillPatternDefaults=Xp(nE),Tc.fillImageDefaults=Xp(aE);var cE={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],solo:!0,identifier:"chord",moduleFactory:e=>new Ic(e),themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:Zn.FILL_GRADIENT_LINEAR_DEFAULTS,fillPatternDefaults:Zn.FILL_PATTERN_DEFAULTS,fillImageDefaults:Zn.FILL_IMAGE_DEFAULTS,highlightStyle:{series:{dimOpacity:.2}},highlight:Zn.singleSeriesHighlightStyle(),label:{...Zn.LABEL_BOXING_DEFAULTS,fontFamily:{$ref:"fontFamily"},fontSize:{$ref:"fontSize"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:5,maxWidth:100},node:{spacing:8,width:10,strokeWidth:{$isUserOption:["./stroke",2,0]}},link:{fillOpacity:.5,strokeWidth:{$isUserOption:["./stroke",2,0]},tension:.4}},legend:{enabled:!1,toggleSeries:!1}}},hE={type:"series",name:"chord",chartType:"standalone",enterprise:!0,options:Tc,create:e=>new Ic(e)};import{_ModuleSupport as Ka}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:$a,CARTESIAN_POSITION:ja},ThemeSymbols:{DEFAULT_SHADOW_COLOUR:dE}}=Ka,Ya={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},$S={autoRotate:{$path:"/series/0/stageLabel/autoRotate"},autoRotateAngle:{$path:"/series/0/stageLabel/autoRotateAngle"},avoidCollisions:{$path:["/series/0/stageLabel/avoidCollisions",!0]},border:{$path:["/series/0/stageLabel/border"]},color:{$path:["/series/0/stageLabel/color",{$ref:"textColor"}]},cornerRadius:{$path:["/series/0/stageLabel/cornerRadius"]},enabled:{$if:[{$eq:[{$path:"/series/0/stageLabel/enabled"},void 0]},!0,{$path:"/series/0/stageLabel/enabled"}]},fill:{$path:["/series/0/stageLabel/fill"]},fillOpacity:{$path:["/series/0/stageLabel/fillOpacity"]},fontSize:{$path:["/series/0/stageLabel/fontSize",{$ref:"fontSize"}]},fontStyle:{$path:["/series/0/stageLabel/fontStyle",{$ref:"fontStyle"}]},fontWeight:{$path:["/series/0/stageLabel/fontWeight",{$ref:"fontWeight"}]},format:{$path:"/series/0/stageLabel/format"},formatter:{$path:"/series/0/stageLabel/formatter"},itemStyler:{$path:"/series/0/stageLabel/itemStyler"},minSpacing:{$path:"/series/0/stageLabel/minSpacing"},padding:{$path:["/series/0/stageLabel/padding"]},rotation:{$path:["/series/0/stageLabel/rotation",0]}},jS=[{type:{$if:[Ya,$a.NUMBER,$a.CATEGORY]},position:{$if:[Ya,ja.LEFT,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},ja.RIGHT,ja.LEFT]}]},label:{$if:[Ya,void 0,$S]}},{type:{$if:[Ya,$a.CATEGORY,$a.NUMBER]},position:{$if:[Ya,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},ja.TOP,ja.BOTTOM]},ja.BOTTOM]},label:{$if:[Ya,$S,void 0]}}],pE={series:{direction:"vertical",strokeWidth:{$isUserOption:["./strokes/0",2,0]},spacingRatio:.25,fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"fills"}]}],{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",Ka.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],["pattern",Ka.FILL_PATTERN_SINGLE_DEFAULTS],["image",Ka.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...Ka.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},dropOff:{enabled:!0,fillOpacity:.2,strokeWidth:{$isUserOption:["./stroke",2,0]}},shadow:{enabled:!1,color:dE,xOffset:3,yOffset:3,blur:5},highlight:Ka.singleSeriesHighlightStyle()},axes:{[$a.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[$a.CATEGORY]:{line:{enabled:!1}}}};import{_ModuleSupport as uE}from"ag-charts-community";import{_ModuleSupport as Zp}from"ag-charts-community";import{_ModuleSupport as gE}from"ag-charts-community";var{lineDistanceSquared:Cc,BBox:yE,Path:fE,SceneChangeDetection:ts}=gE,YS=1e-6;function US([e,t],[i,o]){return Math.abs(e-i)<=YS&&Math.abs(t-o)<=YS}var Zi=class extends fE{constructor(){super(...arguments),this.x0=0,this.y0=0,this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.x3=0,this.y3=0}get midPoint(){const{x0:e,y0:t,x1:i,y1:o,x2:s,y2:a,x3:n,y3:r}=this;return{x:(e+i+s+n)/4,y:(t+o+a+r)/4}}distanceSquared(e,t){if(this.containsPoint(e,t))return 0;const{x0:i,y0:o,x1:s,y1:a,x2:n,y2:r,x3:l,y3:c}=this;return Math.min(Cc(e,t,i,o,s,a,1/0),Cc(e,t,s,a,n,r,1/0),Cc(e,t,n,r,l,c,1/0),Cc(e,t,l,c,i,o,1/0))}computeBBox(){const{x0:e,y0:t,x1:i,y1:o,x2:s,y2:a,x3:n,y3:r}=this,l=Math.min(e,i,s,n),c=Math.max(e,i,s,n)-l,h=Math.min(t,o,a,r),p=Math.max(t,o,a,r)-h;return new yE(l,h,c,p)}updatePath(){const{path:e,x0:t,y0:i,x1:o,y1:s,x2:a,y2:n,x3:r,y3:l}=this,c=[[t,i],[o,s],[a,n],[r,l]];e.clear();let h,p;for(const u of c){if(h!=null&&US(h,u)||p!=null&&US(p,u))continue;const[g,y]=u;h==null?e.moveTo(g,y):e.lineTo(g,y),h??(h=u),p=u}e.closePath()}};d([ts()],Zi.prototype,"x0",2),d([ts()],Zi.prototype,"y0",2),d([ts()],Zi.prototype,"x1",2),d([ts()],Zi.prototype,"y1",2),d([ts()],Zi.prototype,"x2",2),d([ts()],Zi.prototype,"y2",2),d([ts()],Zi.prototype,"x3",2),d([ts()],Zi.prototype,"y3",2);import{_ModuleSupport as mE}from"ag-charts-community";var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:xE}=mE;function XS(e,t,i,o){const{x0:s,y0:a,x1:n,y1:r,x2:l,y2:c,x3:h,y3:p,opacity:u}=e;return i?{x0:(s+h)/2,y0:(a+p)/2,x1:(n+l)/2,y1:(r+c)/2,x2:(n+l)/2,y2:(r+c)/2,x3:(s+h)/2,y3:(a+p)/2,opacity:u}:{x0:(s+n)/2,y0:(a+r)/2,x1:(s+n)/2,y1:(a+r)/2,x2:(l+h)/2,y2:(c+p)/2,x3:(l+h)/2,y3:(c+p)/2,opacity:u}}function SE(e,t){const i=a=>a==null;return{fromFn:(a,n,r)=>{r==="updated"&&i(n)?r="removed":r==="updated"&&i(a.previousDatum)&&(r="added");let l;r==="added"&&a.previousDatum==null&&t==="fade"?l={...qn(a,n),opacity:0}:r==="unknown"||r==="added"?l=XS(n,a.previousDatum,e,t):l={x0:a.x0,y0:a.y0,x1:a.x1,y1:a.y1,x2:a.x2,y2:a.y2,x3:a.x3,y3:a.y3,opacity:a.opacity};const c=xE[r];return{...l,phase:c}},toFn:(a,n,r)=>{let l;return r==="removed"&&a.datum==null&&t==="fade"?l={...qn(a,n),opacity:0}:r==="removed"||i(n)?l=XS(n,a.previousDatum,e,t):l=qn(a,n),l}}}function qn(e,t){const{x0:i,y0:o,x1:s,y1:a,x2:n,y2:r,x3:l,y3:c,opacity:h}=t;return{x0:i,y0:o,x1:s,y1:a,x2:n,y2:r,x3:l,y3:c,opacity:h}}var{SeriesNodePickMode:ZS,SeriesZIndexMap:qS,valueProperty:bE,keyProperty:vE,ChartAxisDirection:kE,updateLabelNode:DE,SMALLEST_KEY_INTERVAL:ME,LARGEST_KEY_INTERVAL:AE,diff:IE,fixNumericExtent:LE,seriesLabelFadeInAnimation:QS,resetMotion:TE,resetLabelFn:CE,animationValidation:NE,computeBarFocusBounds:wE,ContinuousScale:PE,Group:OE,Selection:_E,PointerEvents:JS,motion:RE,checkCrisp:EE,createDatumId:BE,applyShapeStyle:zE}=Zp,FE=class extends Zp.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.xKey=o.properties.stageKey,this.yKey=o.properties.valueKey}},eb=class extends Zp.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[ZS.AXIS_ALIGNED,ZS.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:CE}}),this.NodeEvent=FE,this.connectorNodeGroup=this.contentGroup.appendChild(new OE({name:`${this.id}-series-connectorNodes`,zIndex:qS.BACKGROUND})),this.connectorSelection=_E.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=JS.None}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[qS.BACKGROUND,e],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new Zi}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:o,id:s}=this,a=(y,f,x)=>o&&this.ctx.legendManager.getItemEnabled({seriesId:s,itemId:x}),n=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:n,yScale:r}),p=[];this.ctx.animationManager.isSkipped()||(this.processedData&&p.push(IE(this.id,this.processedData)),p.push(NE()));const u=this.visible?{}:{forceValue:0},{processedData:g}=await this.requestDataModel(e,this.data,{props:[vE(t,c,{id:"xValue"}),bE(i,h,{id:"yValue",...u,validation:a,invalidValue:0}),...l?[ME,AE]:[],...p],groupByKeys:!1});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:o,ctx:{legendManager:s}}=this;if(!t||!i)return[];const{keys:[a]}=t.domain;if(e===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");return n?.def.type==="key"&&n?.def.valueType==="category"?this.hasData?a.filter((r,l)=>s.getItemEnabled({seriesId:o,itemId:l})):[]:this.padBandExtent(a)}else{const n=this.domainForClippedRange(e,["yValue"],"xValue"),r=Math.max(...n),l=[-r,r];return LE(l)}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,groupScale:o,processedData:s,id:a,ctx:{legendManager:n}}=this,r=this.getCategoryAxis(),l=this.getValueAxis();if(!(e&&t&&r&&l&&i&&s?.type==="ungrouped"))return;const c=r.scale,h=l.scale,p=this.getBarDirection()===kE.X,{stageKey:u,valueKey:g}=this.properties,y=`${g}`,f={itemId:y,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.groupScale),visible:this.visible},x=this.visible;if(!x)return f;const S=i.resolveKeysById(this,"xValue",s),v=i.resolveColumnById(this,"yValue",s),{barWidth:m,groupIndex:b}=this.updateGroupScale(r),k=PE.is(c)?m*-.5:0,A=EE(r?.scale,r?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let M;const D=s.dataSources.get(this.id)?.data??[];for(const[L,N]of D.entries()){const P=x&&n.getItemEnabled({seriesId:a,itemId:L}),R=S[L];if(R==null)continue;const F=Math.round(c.convert(R))+o.convert(String(b))+k,_=v[L],E=Math.round(h.convert(-_)),T=Math.round(h.convert(_)),w=this.getItemStyle({datum:N,datumIndex:L},!1),C=Math.max(w.strokeWidth??0,Math.abs(T-E)),I={x:p?Math.min(T,E):F,y:p?F:Math.min(T,E),width:p?C:m,height:p?m:C},O={x:I.x+I.width/2,y:I.y+I.height/2},z=this.createLabelData({datumIndex:L,rect:I,barAlongX:p,yDatum:_,datum:N,visible:P}),B={index:L,series:this,itemId:y,datum:N,datumIndex:L,xValue:R,yValue:_,xKey:u,yKey:g,x:I.x,y:I.y,width:I.width,height:I.height,midPoint:O,crisp:A,label:z,visible:P};if(f.nodeData.push(B),z!=null&&f.labelData.push(z),M!=null){const H=M.rect,W=M.nodeDatum,V=M.datumIndex;p?f.connectorData.push({datum:W,datumIndex:V,x0:H.x,y0:H.y+H.height,x1:H.x+H.width,y1:H.y+H.height,x2:I.x+I.width,y2:I.y,x3:I.x,y3:I.y,opacity:1}):f.connectorData.push({datum:W,datumIndex:V,x0:H.x+H.width,y0:H.y,x1:I.x,y1:I.y,x2:I.x,y2:I.y+I.height,x3:H.x+H.width,y3:H.y+H.height,opacity:1})}P&&(M={itemId:y,rect:I,nodeDatum:B,datumIndex:L})}return f}updateNodes(e,t){super.updateNodes(e,t);const{connectorSelection:i}=this,o=this.contextNodeData?.connectorData??[];this.connectorSelection=this.updateConnectorSelection({connectorSelection:i,connectorData:o}),this.updateConnectorNodes({connectorSelection:i})}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,o=t??[];return i.update(o,void 0,s=>this.getDatumId(s))}updateConnectorSelection(e){const{connectorData:t,connectorSelection:i}=e;return i.update(this.connectorEnabled()?t:[],void 0,o=>this.getDatumId(o.datum))}updateConnectorNodes(e){const t=this.getShapeFillBBox();e.connectorSelection.each((i,o)=>{const{fill:s,fillOpacity:a,stroke:n,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h}=this.connectorStyle(o.datumIndex);i.setProperties(qn(i,o)),zE(i,{fill:s,stroke:n,fillOpacity:a,strokeOpacity:r,strokeWidth:l,lineDash:c,lineDashOffset:h},t)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=JS.None})}updateLabelNodes(e){const t={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,s)=>{o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,DE(this,o,t,this.properties.label,s,!1,i)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,properties:s}=this,{stageKey:a,valueKey:n,tooltip:r,legendItemName:l}=s,c=this.getCategoryAxis(),h=this.getValueAxis();if(!i||!o||!c||!h)return;const p=o.dataSources.get(this.id)?.data[e],u=i.resolveKeysById(this,"xValue",o)[e],g=i.resolveColumnById(this,"yValue",o)[e];if(u!=null)return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(c,"tooltip",u,p,a,l),value:this.getAxisValueText(h,"tooltip",g,p,n,l)}]},{seriesId:t,datum:p,title:a,stageKey:a,valueKey:n,...this.tooltipStyle(p,e)})}resetAllAnimation(e){super.resetAllAnimation(e),TE([this.connectorSelection],qn)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),s=SE(i,"normal");RE.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],s),QS(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),QS(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return BE(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return wE(this,this.contextNodeData?.nodeData[e])}legendItemSymbol(e){const{strokeWidth:t,fillOpacity:i,strokeOpacity:o,lineDash:s,lineDashOffset:a,fill:n,stroke:r}=this.properties.getStyle(e);return{marker:{fill:n,fillOpacity:i,stroke:r,strokeWidth:t,strokeOpacity:o,lineDash:s,lineDashOffset:a}}}getLegendData(e){const{id:t,processedData:i,dataModel:o,ctx:{legendManager:s},visible:a}=this;if(!o||!i||e!=="category")return[];const{showInLegend:n}=this.properties,r=o.resolveKeysById(this,"xValue",i);return(i.dataSources.get(this.id)?.data??[]).map((l,c)=>{const h=r[c];if(h!=null)return{legendType:"category",id:t,datum:l,itemId:c,seriesId:t,enabled:a&&s.getItemEnabled({seriesId:t,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),skipAnimations:!0,hideInLegend:!n}}).filter(l=>l!=null)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};import{_ModuleSupport as HE}from"ag-charts-community";var{Label:VE,AbstractBarSeriesProperties:WE,makeSeriesTooltip:GE,AxisLabel:KE,Property:At}=HE,qp=class extends VE{constructor(){super(...arguments),this.spacing=0}};d([At],qp.prototype,"placement",2),d([At],qp.prototype,"spacing",2);var tb=class extends KE{};d([At],tb.prototype,"placement",2);var qt=class extends WE{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new qp,this.stageLabel=new tb,this.tooltip=GE()}getStyle(e){const{fills:t,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:o,stroke:i[e],strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};d([At],qt.prototype,"stageKey",2),d([At],qt.prototype,"valueKey",2),d([At],qt.prototype,"fills",2),d([At],qt.prototype,"fillOpacity",2),d([At],qt.prototype,"strokes",2),d([At],qt.prototype,"strokeWidth",2),d([At],qt.prototype,"strokeOpacity",2),d([At],qt.prototype,"lineDash",2),d([At],qt.prototype,"lineDashOffset",2),d([At],qt.prototype,"label",2),d([At],qt.prototype,"stageLabel",2),d([At],qt.prototype,"tooltip",2);function ib(e,{x:t,y:i,width:o,height:s,opacity:a}){return{x1:t,y1:i,x2:t+o,y2:i+s,opacity:a??1}}var{Line:$E,ChartAxisDirection:jE}=uE,Nc=class extends eb{constructor(e){super({moduleCtx:e,animationResetFns:{datum:ib}}),this.properties=new qt}get hasData(){const{id:e,ctx:{legendManager:t}}=this,i=this.data?.data.reduce((o,s,a)=>o+(t.getItemEnabled({seriesId:e,itemId:a})?1:0),0);return i!=null&&i>1}getBandScalePadding(){return{inner:1,outer:0}}connectorEnabled(){return!0}getItemStyle({datumIndex:e},t){return this.properties.getStyle(e)}connectorStyle(e){return this.properties.getStyle(e)}nodeFactory(){return new $E}createLabelData({datumIndex:e,rect:t,barAlongX:i,yDatum:o,datum:s,visible:a}){const{stageKey:n,valueKey:r,label:l}=this.properties,{spacing:c,placement:h}=l;if(!l.enabled)return;let p,u,g,y;if(i)switch(p=t.x+t.width/2,g="center",h){case"before":u=t.y-c,y="bottom";break;case"after":u=t.y+t.height+c,y="top";break;default:u=t.y+t.height/2,y="middle"}else switch(u=t.y+t.height/2,y="middle",h){case"before":p=t.x-c,g="right";break;case"after":p=t.x+t.width+c,g="left";break;default:p=t.x+t.width/2,g="center"}const f=this.getSeriesDomain(jE.Y),x=this.getLabelText(o,s,r,"y",f,l,{itemId:r,value:o,datum:s,stageKey:n,valueKey:r});return{x:p,y:u,textAlign:g,textBaseline:y,text:x,itemId:r,datum:s,datumIndex:e,series:this,visible:a}}updateDatumNodes(e){const t=this.getHighlightStyle(e.isHighlight);e.datumSelection.each((i,o)=>{i.setProperties(ib(i,o)),i.stroke=t?.stroke,i.strokeWidth=t?.strokeWidth??0,i.strokeOpacity=t?.strokeOpacity??1,i.lineDash=t?.lineDash,i.lineDashOffset=t?.lineDashOffset??0,i.opacity=t?.opacity??1})}tooltipStyle(e,t){const{fill:i,stroke:o,fillOpacity:s,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}=this.properties.getStyle(t);return{fill:i,fillOpacity:s,stroke:o,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}}hasItemStylers(){return this.properties.label.itemStyler!=null}};Nc.className="ConeFunnelSeries",Nc.type="cone-funnel";import{_ModuleSupport as YE}from"ag-charts-community";import{constant as UE,required as Qp,string as ob}from"ag-charts-core";var{commonSeriesOptionsDefs:XE,coneFunnelSeriesThemeableOptionsDef:ZE,without:qE}=YE,QE={...qE(XE,["showInLegend"]),...ZE,type:Qp(UE("cone-funnel")),stageKey:Qp(ob),valueKey:Qp(ob)};import{_ModuleSupport as is}from"ag-charts-community";var{ThemeConstants:{CARTESIAN_AXIS_TYPE:sb}}=is,JE={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},is.SAFE_RANGE2_OPERATION]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",is.FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS],["pattern",is.FILL_PATTERN_SINGLE_DEFAULTS],["image",is.FILL_IMAGE_DEFAULTS]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},is.SAFE_RANGE2_OPERATION]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...is.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},placement:"before",spacing:4},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:is.singleSeriesHighlightStyle(!1)},seriesArea:{padding:{top:20,bottom:20}},axes:{[sb.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[sb.CATEGORY]:{line:{enabled:!1}}}},eB={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"cone-funnel",moduleFactory:e=>new Nc(e),solo:!0,defaultAxes:jS,themeTemplate:JE},tB={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,options:QE,create:e=>new Nc(e)};import{_ModuleSupport as iB}from"ag-charts-community";import{_ModuleSupport as oB}from"ag-charts-community";var{Label:sB,DropShadow:aB,AbstractBarSeriesProperties:nB,BaseProperties:rB,makeSeriesTooltip:lB,AxisLabel:cB,Property:xe}=oB,hB=class extends sB{},ab=class extends cB{};d([xe],ab.prototype,"placement",2);var Do=class extends rB{constructor(){super(...arguments),this.enabled=!0,this.fill=void 0,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{fill:e,stroke:t,fillOpacity:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n}=this;return{fill:e,fillOpacity:i,stroke:t,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,opacity:1}}};d([xe],Do.prototype,"enabled",2),d([xe],Do.prototype,"fill",2),d([xe],Do.prototype,"fillOpacity",2),d([xe],Do.prototype,"stroke",2),d([xe],Do.prototype,"strokeWidth",2),d([xe],Do.prototype,"strokeOpacity",2),d([xe],Do.prototype,"lineDash",2),d([xe],Do.prototype,"lineDashOffset",2);var dt=class extends nB{constructor(){super(...arguments),this.fills=[],this.fillOpacity=1,this.strokes=[],this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.spacingRatio=0,this.dropOff=new Do,this.shadow=new aB().set({enabled:!1}),this.label=new hB,this.stageLabel=new ab,this.tooltip=lB()}getStyle(e){const{fills:t,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e],fillOpacity:o,stroke:i[e],strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};d([xe],dt.prototype,"stageKey",2),d([xe],dt.prototype,"valueKey",2),d([xe],dt.prototype,"fills",2),d([xe],dt.prototype,"fillOpacity",2),d([xe],dt.prototype,"strokes",2),d([xe],dt.prototype,"strokeWidth",2),d([xe],dt.prototype,"strokeOpacity",2),d([xe],dt.prototype,"lineDash",2),d([xe],dt.prototype,"lineDashOffset",2),d([xe],dt.prototype,"spacingRatio",2),d([xe],dt.prototype,"itemStyler",2),d([xe],dt.prototype,"dropOff",2),d([xe],dt.prototype,"shadow",2),d([xe],dt.prototype,"label",2),d([xe],dt.prototype,"stageLabel",2),d([xe],dt.prototype,"tooltip",2);var{ChartAxisDirection:nb,resetBarSelectionsFn:dB,prepareBarAnimationFunctions:rb,midpointStartingBarPosition:lb,createDatumId:pB,Rect:uB,motion:cb,applyShapeStyle:gB,mergeDefaults:Jp}=iB,wc=class extends eb{constructor(e){super({moduleCtx:e,animationResetFns:{datum:dB}}),this.properties=new dt}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(e){return Jp(this.properties.dropOff.getStyle(),this.properties.getStyle(e))}nodeFactory(){return new uB}createLabelData({datumIndex:e,rect:t,yDatum:i,datum:o,visible:s}){const{valueKey:a,stageKey:n,label:r}=this.properties;if(!r.enabled)return;const l=this.getSeriesDomain(nb.Y),c=this.getLabelText(i,o,a,"y",l,r,{itemId:a,value:i,datum:o,stageKey:n,valueKey:a});return{x:t.x+t.width/2,y:t.y+t.height/2,textAlign:"center",textBaseline:"middle",text:c,itemId:n,datum:o,datumIndex:e,series:this,visible:s}}getItemStyle({datum:e,datumIndex:t},i){const{id:o,properties:s}=this,{stageKey:a,valueKey:n,itemStyler:r}=s,l=this.getHighlightStyle(i,t);let h=Jp(l,s.getStyle(t));if(r!=null){const p=this.ctx.highlightManager?.getActiveHighlight(),u=this.cachedDatumCallback(pB(t,i?"highlight":"node"),()=>{const g=this.getHighlightStateString(p,i,t);return this.callWithContext(r,{seriesId:o,datum:e,highlighted:i,highlightState:g,stageKey:a,valueKey:n,...h})});u&&(h=Jp(u,h))}return h}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const{shadow:o}=this.properties,s=this.getCategoryDirection()===nb.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=this.getItemStyle(r,t);gB(n,l,a),n.visible=s?r.width>0:r.height>0,n.crisp=r.crisp,n.fillShadow=o})}tooltipStyle(e,t){return this.getItemStyle({datum:e,datumIndex:t},!1)}animateEmptyUpdateReady(e){super.animateEmptyUpdateReady(e);const{datumSelection:t}=e,i=this.isVertical(),s=rb(lb(i,"normal"),"unknown");cb.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s)}animateWaitingUpdateReady(e){super.animateWaitingUpdateReady(e);const{datumSelection:t}=e,{processedData:i}=this,o=i?.reduced?.diff?.[this.id],s=rb(lb(this.isVertical(),"fade"),"added");cb.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s,(a,n)=>n.xValue,o)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};wc.className="FunnelSeries",wc.type="funnel";import{_ModuleSupport as yB}from"ag-charts-community";import{constant as fB,required as eu,string as hb}from"ag-charts-core";var{commonSeriesOptionsDefs:mB,funnelSeriesThemeableOptionsDef:xB,without:SB}=yB,bB={...xB,...SB(mB,["showInLegend"]),type:eu(fB("funnel")),stageKey:eu(hb),valueKey:eu(hb)},vB={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["cartesian"],identifier:"funnel",moduleFactory:e=>new wc(e),solo:!0,defaultAxes:jS,themeTemplate:pE},kB={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,options:bB,create:e=>new wc(e)};import{_ModuleSupport as Qn}from"ag-charts-community";import{_ModuleSupport as Ua}from"ag-charts-community";import{cachedTextMeasurer as db,isArray as DB,measureTextSegments as MB}from"ag-charts-core";var pb=class{*[Symbol.iterator](){const{node:e,datum:t}=this;e&&t&&(yield{node:e,datum:t})}nodes(){return this.node?[this.node]:[]}update(e,t,i,o){const s=e.nodes();if(s.length===0)this.node?.remove(),this.node=void 0;else{this.node===void 0&&(this.node=new i,this.node.fillOpacity=0,this.node.strokeOpacity=0,t.appendChild(this.node));const a=s[0],n=s.toReversed().find(r=>r.datum.datum.value>r.datum.datum.segmentStart)??s.at(-1);this.node.datum=this.datum=a.datum,o(this.node,a,n)}}};import{isArray as AB}from"ag-charts-core";var ub={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function gb(e,t){if(e==null)return"";const{min:i,max:o}=t,s=i===0?0:Math.ceil(Math.log10(Math.abs(i))),a=o===0?0:Math.ceil(Math.log10(Math.abs(o))),n=Math.max(2-Math.max(s,a),0);return e.toFixed(n)}function Jn(e,t,i,o){if(i.text!=null)return i.text;const s=o??i.value;let a;return i?.formatter!=null&&(a=Un(t,i.formatter,{seriesId:e,datum:void 0,value:s})),a==null||AB(a)?a:String(a)}function yb({path:e,x:t,y:i,size:o}){e.moveTo(t,i-o/2),e.lineTo(t,i+o/2)}import{clamp as fb,iterate as IB}from"ag-charts-core";function mb(e,t){const i=IB(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function xb(e,t){const i=[{data:e.contextNodeData?.nodeData,selection:e.datumUnion},{data:e.contextNodeData?.targetData,selection:e.targetSelection}].filter(l=>l.data&&l.data.length>0),o=fb(0,t.otherIndex+t.otherIndexDelta,i.length-1);if(i.length===0)return;const{data:s,selection:a}=i[o];if(s==null||s.length===0)return;const n=fb(0,t.datumIndex,s.length-1),r=s[n];for(const l of a)if(l.datum===r)return{bounds:l.node,clipFocusBox:!0,datum:r,datumIndex:n,otherIndex:o}}import{_ModuleSupport as tu}from"ag-charts-community";import{_ModuleSupport as LB}from"ag-charts-community";import{Logger as TB}from"ag-charts-core";var{BaseProperties:Sb,Property:Xa}=LB,Pc=class extends Sb{getSegments(e,t){const{values:i,step:o,count:s}=this,a=Math.min(...e.domain),n=Math.max(...e.domain);let r;if(i!=null){const l=i.filter(c=>c>a&&cc-h);r=[a,...l,n]}else if(o!=null){const l=[];for(let c=a;cc>a&&ch/l*(n-a)+a)}return r!=null&&r.length>t&&(TB.warnOnce("the configured segmentation results in more than 1 item per pixel, ignoring. Supply a segmentation configuration that results in larger segments or omit this configuration"),r=void 0),r??(r=[a,n]),r}};d([Xa],Pc.prototype,"values",2),d([Xa],Pc.prototype,"step",2),d([Xa],Pc.prototype,"count",2);var er=class extends Sb{constructor(){super(...arguments),this.enabled=!1,this.interval=new Pc,this.spacing=0}};d([Xa],er.prototype,"enabled",2),d([Xa],er.prototype,"interval",2),d([Xa],er.prototype,"spacing",2);var{BaseProperties:Oc,makeSeriesTooltip:CB,SeriesProperties:NB,PropertiesArray:iu,Property:j,Label:wB,AxisLabel:PB,getColorStops:OB}=tu,bb=class extends wB{};d([j],bb.prototype,"spacing",2);var pt=class extends Oc{constructor(){super(...arguments),this.value=0,this.label=new bb}getStyle(e){const{fill:t=e.fill??"black",fillOpacity:i=e.fillOpacity??1,stroke:o=e.stroke??"black",strokeWidth:s=e.strokeWidth??0,strokeOpacity:a=e.strokeOpacity??1,lineDash:n=e.lineDash??[0],lineDashOffset:r=e.lineDashOffset??0}=this;return{fill:t,fillOpacity:i,stroke:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r}}};d([j],pt.prototype,"text",2),d([j],pt.prototype,"value",2),d([j],pt.prototype,"shape",2),d([j],pt.prototype,"placement",2),d([j],pt.prototype,"spacing",2),d([j],pt.prototype,"size",2),d([j],pt.prototype,"rotation",2),d([j],pt.prototype,"fill",2),d([j],pt.prototype,"fillOpacity",2),d([j],pt.prototype,"stroke",2),d([j],pt.prototype,"strokeWidth",2),d([j],pt.prototype,"strokeOpacity",2),d([j],pt.prototype,"lineDash",2),d([j],pt.prototype,"lineDashOffset",2),d([j],pt.prototype,"label",2);var Qt=class extends Oc{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new iu(tu.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(e,t,i){const{fill:o,fills:s,fillMode:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}=this;return{fill:o??kb(s,a,e,i,t),fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:p}}};d([j],Qt.prototype,"enabled",2),d([j],Qt.prototype,"thickness",2),d([j],Qt.prototype,"thicknessRatio",2),d([j],Qt.prototype,"fills",2),d([j],Qt.prototype,"fillMode",2),d([j],Qt.prototype,"fill",2),d([j],Qt.prototype,"fillOpacity",2),d([j],Qt.prototype,"stroke",2),d([j],Qt.prototype,"strokeWidth",2),d([j],Qt.prototype,"strokeOpacity",2),d([j],Qt.prototype,"lineDash",2),d([j],Qt.prototype,"lineDashOffset",2);var tr=class extends Oc{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};d([j],tr.prototype,"values",2),d([j],tr.prototype,"step",2),d([j],tr.prototype,"minSpacing",2),d([j],tr.prototype,"maxSpacing",2);var vb=class extends PB{constructor(){super(...arguments),this.placement=void 0}};d([j],vb.prototype,"placement",2);var xt=class extends Oc{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new iu(tu.StopProperties),this.fillMode="continuous",this.fillOpacity=1,this.stroke="black",this.strokeWidth=0,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.defaultFill="black",this.interval=new tr,this.label=new vb}getStyle(e,t,i,o){const{fill:s,fills:a,defaultFill:n,fillMode:r,fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:p,lineDash:u,lineDashOffset:g}=this;return{fill:s??(e&&a.length===0?n:void 0)??kb(a,r,t,o,i),fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:p,lineDash:u,lineDashOffset:g}}};d([j],xt.prototype,"min",2),d([j],xt.prototype,"max",2),d([j],xt.prototype,"fills",2),d([j],xt.prototype,"fillMode",2),d([j],xt.prototype,"fill",2),d([j],xt.prototype,"fillOpacity",2),d([j],xt.prototype,"stroke",2),d([j],xt.prototype,"strokeWidth",2),d([j],xt.prototype,"strokeOpacity",2),d([j],xt.prototype,"lineDash",2),d([j],xt.prototype,"lineDashOffset",2),d([j],xt.prototype,"defaultFill",2),d([j],xt.prototype,"interval",2),d([j],xt.prototype,"label",2);var _c=class extends $i{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};d([j],_c.prototype,"text",2),d([j],_c.prototype,"placement",2),d([j],_c.prototype,"avoidCollisions",2);var St=class extends NB{constructor(){super(...arguments),this.value=0,this.segmentation=new er,this.defaultColorRange=[],this.targets=new iu(pt),this.defaultTarget=new pt,this.defaultScale=new xt,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new xt,this.bar=new Qt,this.label=new _c,this.tooltip=CB()}};d([j],St.prototype,"value",2),d([j],St.prototype,"segmentation",2),d([j],St.prototype,"defaultColorRange",2),d([j],St.prototype,"targets",2),d([j],St.prototype,"defaultTarget",2),d([j],St.prototype,"defaultScale",2),d([j],St.prototype,"direction",2),d([j],St.prototype,"thickness",2),d([j],St.prototype,"cornerRadius",2),d([j],St.prototype,"cornerMode",2),d([j],St.prototype,"margin",2),d([j],St.prototype,"scale",2),d([j],St.prototype,"bar",2),d([j],St.prototype,"label",2),d([j],St.prototype,"tooltip",2);function kb(e,t,i,o,s){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:OB(e,i,o.domain,t),rotation:s?90:0,bounds:"series"}}import{_ModuleSupport as _B}from"ag-charts-community";import{cachedTextMeasurer as RB,isArray as EB,measureTextSegments as BB,toPlainText as zB}from"ag-charts-core";var{BBox:FB}=_B;function ou(e){const{x0:t,y0:i,x1:o,y1:s,horizontalInset:a,verticalInset:n}=e,r=Math.min(t,o)+a,l=Math.min(i,s)+n,c=Math.max(Math.abs(o-t)-2*a,0),h=Math.max(Math.abs(s-i)-2*n,0);return{x:r,y:l,width:c,height:h}}function HB(e,t){if(t==null)return!0;const i=ou(e),o=1e-6,s=i.x+o,a=i.y+o,n=i.x+i.width-o,r=i.y+i.height-o,l=t.x,c=t.x+t.width,h=t.y,p=t.y+t.height;return Math.max(s,l)<=Math.min(n,c)&&Math.max(a,h)<=Math.min(r,p)}function su(e){const{clipX0:t,clipX1:i,clipY0:o,clipY1:s}=e;return t!=null&&i!=null||o!=null&&s!=null}function VB(e){if(!su(e))return;const{x0:t,y0:i,x1:o,y1:s}=e,{x:a,y:n,width:r,height:l}=ou(e);let{clipX0:c,clipX1:h,clipY0:p,clipY1:u}=e;(c==null||h==null)&&(c=t,h=o),(p==null||u==null)&&(p=i,u=s);const g=Math.min(c,h),y=Math.min(p,u),f=Math.abs(h-c),x=Math.abs(u-p);return c=Math.max(a,g),p=Math.max(n,y),h=Math.min(a+r,g+f),u=Math.min(n+l,y+x),new FB(Math.min(c,h),Math.min(p,u),Math.abs(h-c),Math.abs(u-p))}function Db(e,t){const i=e?"initial":"update";return{node:{fromFn(s,a){const n=s.previousDatum;let{x0:r,y0:l,x1:c,y1:h,clipX0:p,clipY0:u,clipX1:g,clipY1:y}=n??a;const{horizontalInset:f,verticalInset:x}=a,S=n!=null&&su(n),v=su(a);return S&&v||(!S&&v?({x0:r,y0:l,x1:c,y1:h,clipX0:p,clipY0:u,clipX1:g,clipY1:y}=a,e&&(t?g=a.clipX0:y=a.clipY0)):S&&!v?({x0:r,y0:l,x1:c,y1:h}=a,p=void 0,u=void 0,g=void 0,y=void 0):e&&(t?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:p,clipY0:u,clipX1:g,clipY1:y,horizontalInset:f,verticalInset:x,phase:i}},toFn(s,a){const{x0:n,y0:r,x1:l,y1:c,clipX0:h,clipY0:p,clipX1:u,clipY1:g,horizontalInset:y,verticalInset:f}=a;return{x0:n,y0:r,x1:l,y1:c,clipX0:h,clipY0:p,clipX1:u,clipY1:g,horizontalInset:y,verticalInset:f}},applyFn(s,a){s.setProperties(ir(s,a))}}}}function ir(e,t){const{x:i,y:o,width:s,height:a}=ou(t),n=VB(t),r=HB(t,n);return{x:i,y:o,width:s,height:a,clipBBox:n,visible:r}}var WB={Before:"right",Center:"center",After:"left"},GB={Before:"top",Center:"middle",After:"bottom"},KB={Before:-1,Center:-.5,After:0},$B={Before:0,Center:-.5,After:-1};function jB(e,t,i,o,s,a){const{seriesRect:n,gaugeRect:r,barRect:l}=s,{padding:c,horizontal:h}=o;i.each((p,u)=>{const g=Jn(e.id,t,u,a?.label);let y,f;u.placement==="outside-start"?h?(y=r.x,f=n.height):(y=n.width,f=n.height-(r.y+r.height)):u.placement==="outside-end"?h?(y=n.width-(r.x+r.width),f=n.height):(y=n.width,f=r.y):u.avoidCollisions&&(y=r.width,f=r.height);let x;if(g==null)return;if(y!=null&&f!=null){const E=()=>({width:y,height:f,meta:null});x=En(zB(g),u,{padding:c},E)?.[0]}else{const E=RB(u),{width:T,height:w}=EB(g)?BB(g,u):E.measureLines(g);x={text:g,fontSize:u.fontSize,lineHeight:u.lineHeight??E.lineHeight(),width:T,height:w}}if(x==null){p.visible=!1;return}const S=h?r.x:r.y+r.height,v=h?r.x+r.width:r.y,m=h?l.x:l.y+l.height,b=h?l.x+l.width:l.y,k=u.spacing*(h?1:-1);let A,M,D,L;switch(u.placement){case"outside-start":A=-1/0,M=1/0,D=S-k,L="Before";break;case"outside-end":A=-1/0,M=1/0,D=v+k,L="After";break;case"inside-start":A=S,M=b,D=S+k,L="After";break;case"inside-end":A=b,M=v,D=v-k,L="Before";break;case"inside-center":A=S,M=v,D=(S+v)/2,L="Center";break;case"bar-inside":A=m,M=b,D=(m+b)/2,L="Center";break;case"bar-inside-end":A=m,M=b,D=b-k,L="Before";break;case"bar-outside-end":A=b,M=v,D=b+k,L="After";break;case"bar-end":A=-1/0,M=1/0,D=b,L="Center";break}const N=h?D:r.x+r.width/2,P=h?r.y+r.height/2:D;let R,F;h?(R=N+KB[L]*x.width,F=R+x.width):(R=P+$B[L]*x.height,F=R+x.height);const _=Math.min(R,F)>=Math.min(A,M)&&Math.max(R,F)<=Math.max(A,M);if(u.avoidCollisions&&!_){p.visible=!1;return}p.visible=!0,p.text=x.text,p.fontSize=x.fontSize,p.lineHeight=x.lineHeight,p.textAlign=h?WB[L]:"center",p.textBaseline=h?"middle":GB[L],p.x=N,p.y=P})}var{fromToMotion:au,resetMotion:YB,SeriesNodePickMode:Mb,StateMachine:UB,createDatumId:Ab,toRadians:Ib,BBox:qi,Group:js,PointerEvents:Lb,Selection:Ys,Rect:XB,Text:Tb,TransformableText:ZB,Marker:qB,LinearScale:QB,generateTicks:JB,NiceMode:ez,easing:tz,findRangeExtent:iz,tickFormat:oz,mergeDefaults:sz,applyShapeStyle:nu}=Ua,az={before:180,middle:0,after:0},nz={before:90,middle:0,after:-90},Rc=class extends Ua.Series{constructor(e){super({moduleCtx:e,pickModes:[Mb.EXACT_SHAPE_MATCH,Mb.NEAREST_NODE]}),this.properties=new St,this.seriesRect=qi.NaN,this.gaugeRect=qi.NaN,this.scale=new QB,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new js({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new js({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new js({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new js({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new js({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new js({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new js({name:"tickGroup"})),this.scaleSelection=Ys.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Ys.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=Ys.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Ys.select(this.itemTargetLabelGroup,Tb),this.labelSelection=Ys.select(this.itemLabelGroup,Tb),this.highlightTargetSelection=Ys.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Ys.select(this.tickGroup,ZB),this.datumUnion=new pb,this.animationState=new UB("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.animateReadyResize(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateWaitingUpdateReady()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty"},reset:"empty",skip:"ready"}}),this.scaleGroup.pointerEvents=Lb.None,this.tickGroup.pointerEvents=Lb.None}get range(){return this.horizontal?[0,this.gaugeRect.width]:[0,this.gaugeRect.height]}get horizontal(){return this.properties.direction==="horizontal"}get hasData(){return!0}nodeFactory(){const e=new XB;return e.crisp=!0,e}markerFactory(){return new qB}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return gb(e,this.properties.scale)}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:o,scale:s}=this,{thickness:a}=e,n=iz(s.range),r=new qi(t,i,o?n:a,o?a:n);return{axis:r,series:r}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return Array.from(e.targets).map(i=>{const{text:o=t.text,value:s=t.value??0,shape:a=t.shape??"triangle",rotation:n=t.rotation??0,placement:r=t.placement??"middle",spacing:l=t.spacing??0,size:c=t.size??0}=i,{enabled:h=t.label.enabled,color:p=t.label.color??"black",fontStyle:u=t.label.fontStyle??"normal",fontWeight:g=t.label.fontWeight??"normal",fontSize:y=t.label.fontSize,fontFamily:f=t.label.fontFamily,spacing:x=t.label.spacing??0}=i.label;return{text:o,value:s,shape:a,placement:r,spacing:l,size:c,rotation:n,label:{enabled:h,color:p,fontStyle:u,fontWeight:g,fontSize:y,fontFamily:f,spacing:x},style:i.getStyle(t)}})}getTargetPoint(e){const{properties:t,originX:i,originY:o,horizontal:s,scale:a,gaugeRect:n}=this,{thickness:r}=t,{value:l,placement:c,spacing:h,size:p}=e,u=a.convert(l);let g;switch(c){case"before":g=-(h+p/2);break;case"after":g=r+h+p/2;break;default:g=r/2;break}return{x:i+n.x+(s?u:g),y:o+n.y+(s?g:u)}}getTargetLabel(e){const{size:t,placement:i,label:o}=e,{spacing:s,color:a,fontStyle:n,fontWeight:r,fontSize:l,fontFamily:c}=o,h=void 0,p=t/2+s;let u,g,y=0,f=0;return this.horizontal?(u="center",i==="after"?(g="top",f=p):(g="bottom",f=-p)):(g="middle",i==="before"?(u="right",y=-p):(u="left",y=p)),{offsetX:y,offsetY:f,fill:a,textAlign:u,textBaseline:g,fontStyle:n,fontWeight:r,fontSize:l,fontFamily:c,lineHeight:h}}labelDatum(e,t){const{placement:i,avoidCollisions:o,spacing:s,text:a,color:n,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:p,lineHeight:u,wrapping:g,overflowStrategy:y,formatter:f=x=>this.formatLabel(x.value)}=e;return{placement:i,avoidCollisions:o,spacing:s,text:a,value:t,fill:n,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:p,lineHeight:u,wrapping:g,overflowStrategy:y,formatter:f}}verticalLabelInset(){const{label:e}=this.properties,t=db(e),i=e.text?.split(`
+`),o=(e.lineHeight??t.lineHeight())*(i?.length??1);return e.spacing+o}horizontalLabelInset(){const{scale:e,properties:t}=this,{scale:i,label:o}=t,s=o.text?.split(`
+`),a=db(o),n=i.interval.values??e.ticks({nice:!1,interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(s??n?.map(c=>Jn(this.id,this.ctx,this.labelDatum(o,c))??"")).reduce((c,h)=>{const{width:p}=DB(h)?MB(h,o):a.measureLines(h);return Math.max(c,p)},0);return o.spacing+l}tickFormatter(e,t){const{format:i,formatter:o}=this.properties.scale.label;let s;return i!=null&&(s=oz(t,typeof i=="string"?i:void 0)),(a,n)=>{let r;return o&&(r??(r=Un(this.ctx,o,{value:a,index:n,domain:e,boundSeries:void 0}))),r??(r=s?.(a)),r??this.formatLabel(a)}}createNodeData(){const{id:e,properties:t,horizontal:i,scale:o,seriesRect:s}=this,{value:a,segmentation:n,thickness:r,cornerRadius:l,cornerMode:c,bar:h,scale:p,label:u,defaultColorRange:g}=t;o.domain=[p.min,p.max],o.range=i?[0,s.width]:[s.height,0];let y,f;i?(f=1,y=Math.PI/2):p.label.placement==="before"?(f=1,y=0):(f=-1,y=0);let x,S,v,m;i?(x=0,S=s.width,v=(s.height-r)/2,m=v+r,u.placement==="outside-start"?x+=this.horizontalLabelInset():u.placement==="outside-end"&&(S-=this.horizontalLabelInset())):(x=(s.width-r)/2,S=x+r,m=0,v=s.height,u.placement==="outside-start"?v-=this.verticalLabelInset():u.placement==="outside-end"&&(m+=this.verticalLabelInset())),this.gaugeRect=new qi(Math.min(x,S),Math.min(v,m),Math.abs(S-x),Math.abs(m-v));const b=0,k=0;o.domain=[p.min,p.max],o.range=i?[x,S]:[v,m];const{tickData:{ticks:A}}=JB({scale:o,label:this.properties.scale.label,interval:this.properties.scale.interval,tickFormatter:(J,ie)=>this.tickFormatter(J,ie),domain:o.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:ez.Off,labelOffset:0,axisRotation:y,sideFlag:f}),M=!1,D=this.getTargets(),L=[],N=[],P=[],R=[],[F,_]=o.range,E=Math.abs(_-F),T=i?o.convert(a):S,w=i?m:o.convert(a),C=n.enabled?n.spacing/2:0,I=i?C:0,O=i?0:C,z=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),B=-(r-z)/2,H=i?0:B,W=i?B:0,V=c==="item",G=Math.ceil(E);let K=n.enabled?n.interval.getSegments(o,G):void 0;const Q=h.getStyle(g,i,o),X=p.getStyle(h.enabled,g,i,o);if(K==null&&V){const J=Math.min(...o.domain),ie=Math.max(...o.domain),U={value:a,segmentStart:J,segmentEnd:ie};if(h.enabled){const ge=Math.min(l,z/2,E/2)*(M?-1:1),ce=i?ge:0,me=i?0:ge;L.push({series:this,itemId:"value",datum:U,datumIndex:{type:0},type:0,x0:b+x-ce-H,y0:k+v-me-W,x1:b+T+ce+H,y1:k+w+me+W,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:I,verticalInset:O,style:Q})}const ne=Math.min(l,r/2,E/2)*(M?-1:1),Z=i?ne:0,le=i?0:ne;R.push({series:this,itemId:"scale",datum:U,datumIndex:{type:0},type:0,x0:b+x-Z,y0:k+v-le,x1:b+S+Z,y1:k+m+le,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:I,verticalInset:O,style:X})}else{K??(K=o.domain);const J=b+x-H,ie=k+v-W,U=b+T+H,he=k+w+W;for(let ne=0;neAb(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i}=this,o=i.animationManager.isSkipped(),s=this.getShapeFillBBox();t.each((n,r)=>{const{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:p}=r;nu(n,r.style,s),n.topLeftCornerRadius=l,n.topRightCornerRadius=c,n.bottomRightCornerRadius=h,n.bottomLeftCornerRadius=p,n.pointerEvents=this.properties.bar.enabled?Ua.PointerEvents.All:Ua.PointerEvents.None,(o||n.previousDatum==null)&&n.setProperties(ir(n,r))});const{horizontal:a}=this;this.datumUnion.update(t,this.itemGroup,Ua.Rect,(n,r,l)=>{const c=Math.min(r.x,l.x),h=Math.max(r.x+r.width,l.x+l.width),p=Math.min(r.y,l.y),u=Math.max(r.y+r.height,l.y+l.height),g=h-c,y=u-p;n.pointerEvents=Ua.PointerEvents.None,n.x=c,n.y=p,n.width=g,n.height=y,n.topLeftCornerRadius=a?r.topLeftCornerRadius:l.topLeftCornerRadius,n.topRightCornerRadius=l.topRightCornerRadius,n.bottomRightCornerRadius=a?l.bottomRightCornerRadius:r.bottomRightCornerRadius,n.bottomLeftCornerRadius=r.bottomLeftCornerRadius;const f=r.clipBBox,x=l.clipBBox??f;f&&x?n.clipBBox=qi.merge([f,x]).intersection(a?new qi(c,-1/0,g,1/0):new qi(-1/0,p,1/0,y)):n.clipBBox=void 0})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>Ab(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,i=this.getShapeFillBBox();t.each((o,s)=>{const{topLeftCornerRadius:a,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:l}=s;nu(o,s.style,i),o.setProperties(ir(o,s)),o.topLeftCornerRadius=a,o.topRightCornerRadius=n,o.bottomRightCornerRadius=r,o.bottomLeftCornerRadius=l,o.setProperties(ir(o,s))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetNodes(e){const{targetSelection:t,isHighlight:i}=e;t.each((o,s)=>{const{x:a,y:n,shape:r,size:l,rotation:c}=s,h=this.getTargetStyle(i,s);nu(o,h),o.size=l,o.shape=r==="line"?yb:r,o.translationX=a,o.translationY=n,o.rotation=c})}getTargetStyle(e,{datumIndex:t,style:i}){const o=this.getHighlightStyle(e,t);return sz(o,{...i,opacity:1})}updateTargetLabelSelection(e){return e.targetLabelSelection.update(e.targetData)}updateTargetLabelNodes(e){const{targetLabelSelection:t}=e;t.each((i,o)=>{const{x:s,y:a,text:n}=o,{offsetX:r,offsetY:l,fill:c,fontStyle:h,fontWeight:p,fontSize:u,fontFamily:g,textAlign:y,textBaseline:f}=o.label;i.visible=!0,i.x=s+r,i.y=a+l,i.text=n,i.fill=c,i.fontStyle=h,i.fontWeight=p,i.fontSize=u,i.fontFamily=g,i.textAlign=y,i.textBaseline=f})}updateTickSelection(e){return e.tickSelection.update(e.tickData,void 0,t=>t.tickId)}updateTickNodes(e){const{gaugeRect:t,properties:i}=this,o=i.defaultScale,{enabled:s,color:a,fontFamily:n=o.label.fontFamily,fontSize:r=o.label.fontSize,fontStyle:l,fontWeight:c=o.label.fontWeight,spacing:h}=i.scale.label;let{placement:p}=i.scale.label;const u=Ib(i.scale.label.rotation??0);let g,y,f,x;this.horizontal?(p??(p="after"),g="center",y=p==="before"?"bottom":"top",x=this.originY+t.y+(p==="before"?-h:t.height+h)):(p??(p="before"),g=p==="before"?"end":"start",y="middle",f=this.originX+t.x+(p==="before"?-h:t.width+h)),e.tickSelection.each((S,v)=>{if(!s){S.visible=!1;return}const m=f??v.translation,b=x??v.translation;S.visible=!0,S.text=v.tickLabel,S.fill=a,S.fontFamily=n,S.fontSize=r,S.fontStyle=l,S.fontWeight=c,S.textBaseline=y,S.textAlign=g,S.x=m,S.y=b,S.rotationCenterX=m,S.rotationCenterY=b,S.rotation=u})}updateLabelSelection(e){return e.labelSelection.update(e.labelData,void 0,t=>"primary")}updateLabelNodes(e){const{labelSelection:t}=e,i=this.ctx.animationManager.isSkipped();t.each((o,s)=>{o.fill=s.fill,o.fontStyle=s.fontStyle,o.fontWeight=s.fontWeight,o.fontFamily=s.fontFamily}),(i||this.labelsHaveExplicitText())&&this.formatLabelText()}labelsHaveExplicitText(){for(const{datum:e}of this.labelSelection)if(e.text==null)return!1;return!0}formatLabelText(e){const{labelSelection:t,horizontal:i,scale:o,seriesRect:s,gaugeRect:a}=this,{x:n,y:r,width:l,height:c}=a,h=e?.label??this.properties.value;let p;if(i){const y=o.convert(h);p=new qi(n,r,y-n,c)}else{const y=o.convert(h);p=new qi(n,y,l,c-y)}const u={seriesRect:s,gaugeRect:a,barRect:p},{margin:g}=this.properties;jB(this,this.ctx,t,{padding:g,horizontal:i},u,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),YB([this.datumSelection],ir),this.formatLabelText()}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}animateLabelText(e={}){const{animationManager:t}=this.ctx;let i=0,o=0;if(this.labelSelection.each((s,a)=>{s.opacity=1,i=s.previousDatum?.value??e.from??a.value,o=a.value}),!this.labelsHaveExplicitText())if(i===o)this.formatLabelText({label:o});else{const s=`${this.id}_labels`;t.animate({id:s,groupId:"label",from:{label:i},to:{label:o},phase:e.phase??"update",ease:tz.easeOut,onUpdate:a=>this.formatLabelText(a),onStop:()=>this.formatLabelText({label:o})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Db(!0,this.horizontal);au(this.id,"node",e,[this.datumSelection],t,(i,o)=>o.itemId),au(this.id,"label",e,[this.labelSelection],ub,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=Db(!1,this.horizontal);au(this.id,"node",e,[this.datumSelection],t,(i,o)=>o.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return[0,1]}dataCount(){return Number.NaN}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:o}=i;if(e==null)return;let s,a,n;if(e.type===0?(s=i.value,a=i.label.text,n=this.ctx.localeManager.t("ariaLabelGaugeValue")):({value:s,text:a}=i.targets[e.index],n=this.ctx.localeManager.t("ariaLabelGaugeTarget")),s!=null)return this.formatTooltipWithContext(o,{data:[{label:a,fallbackLabel:n,value:this.formatLabel(s)}]},{seriesId:t,title:void 0,datum:void 0,value:s})}pickNodeClosestDatum(e){return mb(this,e)}pickFocus(e){return xb(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};Rc.className="LinearGaugeSeries",Rc.type="linear-gauge";var rz={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["standalone"],identifier:"linear-gauge",moduleFactory:e=>new Rc(e),themeTemplate:{minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},Qn.SAFE_RANGE2_OPERATION]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",Qn.SAFE_STROKE_FILL_OPERATION,{$palette:"hierarchyColors"}]},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{spacing:11}},bar:{strokeWidth:{$isUserOption:["./stroke",2,0]}},segmentation:{enabled:!1,interval:{},spacing:1},defaultTarget:{fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},size:10,shape:"triangle",placement:"after",spacing:5,label:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},spacing:5}},defaultScale:{label:{fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},label:{...Qn.LABEL_BOXING_DEFAULTS,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:Qn.FONT_SIZE.SMALL,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}}},lz={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,options:Qn.linearGaugeSeriesOptionsDef,create:e=>new Rc(e)};import{_ModuleSupport as Ec}from"ag-charts-community";import{_ModuleSupport as ru}from"ag-charts-community";var or={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1},gradientLegend:{enabled:!1,...ru.LEGEND_CONTAINER_THEME}};function Qi(e){const t=ru.deepClone(e);return ru.jsonWalk(t,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),t}import{_ModuleSupport as Cb}from"ag-charts-community";import{Logger as Nb,cachedTextMeasurer as cz}from"ag-charts-core";import{_ModuleSupport as hz}from"ag-charts-community";var dz=1e-9;function wb(e,t,i,o){const[s,a]=e,[n,r]=t,l=n-s,c=r-a,h=l*l+c*c;let p,u;if(Math.abs(h)t){const h=(t-s)/l,p=[i+(n-i)*h,o+(r-o)*h],u=Math.atan2(r-o,n-i);return{point:p,angle:u}}s=c,i=n,o=r}}import{_ModuleSupport as pz}from"ag-charts-community";var{LonLatBBox:uz}=pz;function Us(e,t){for(const i of e){const[o,s]=i;t=uz.extend(t,o,s,o,s)}return t}function gz(e){if(e.length===0)return;let t=0,i=0,o=0,[s,a]=e.at(-1);for(const[n,r]of e){const l=s*r-n*a;o+=l,t+=(s+n)*l,i+=(a+r)*l,s=n,a=r}return o*=3,[t/o,i/o]}function zc(e,t,i){let o=!1,s=1/0;for(const a of e){let n=a.at(-1),[r,l]=n;for(const c of a){const[h,p]=c;p>i!=l>i&&t<(r-h)*(i-p)/(l-p)+h&&(o=!o),s=Math.min(s,wb(n,c,t,i)),n=c,r=h,l=p}}return(o?-1:1)*Math.sqrt(s)}var{Path:yz,ExtendedPath2D:fz,BBox:mz,SceneChangeDetection:xz,SceneObjectChangeDetection:Sz,objectsEqual:bz}=hz,Za=class extends yz{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new fz}computeBBox(){return(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1),this.bbox?.clone()}updatePath(){const{projectedGeometry:e}=this;this.strokePath.clear(),this.path.clear(),this.bbox=e==null?void 0:this.drawGeometry(e,void 0)}drawPath(e){super.drawPath(e),this.renderStroke(e,this.strokePath.getPath2D())}containsPoint(e,t){const{projectedGeometry:i}=this;return i==null||!this.getBBox().containsPoint(e,t)?!1:this.geometryDistance(i,e,t)<=0}distanceSquared(e,t){const{projectedGeometry:i}=this;if(i==null)return 1/0;const o=this.geometryDistance(i,e,t);return o>0?o*o:0}geometryDistance(e,t,i){const{renderMode:o,strokeWidth:s}=this,a=(o&1)!==0,n=(o&2)!==0,r=Math.max(s/2,1)+1;switch(e.type){case"GeometryCollection":return e.geometries.reduce((l,c)=>Math.min(l,this.geometryDistance(c,t,i)),1/0);case"MultiPolygon":return a?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(zc(c,t,i),0)),1/0):1/0;case"Polygon":return a?Math.max(zc(e.coordinates,t,i),0):1/0;case"MultiLineString":return n?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(Pb(c,t,i)-r,0)),1/0):1/0;case"LineString":return n?Math.max(Pb(e.coordinates,t,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}drawGeometry(e,t){const{renderMode:i,path:o,strokePath:s}=this,a=(i&1)!==0,n=(i&2)!==0;switch(e.type){case"GeometryCollection":for(const r of e.geometries)t=this.drawGeometry(r,t);break;case"MultiPolygon":if(a)for(const r of e.coordinates)t=this.drawPolygon(o,r,t);break;case"Polygon":a&&(t=this.drawPolygon(o,e.coordinates,t));break;case"LineString":n&&(t=this.drawLineString(s,e.coordinates,t,!1));break;case"MultiLineString":if(n)for(const r of e.coordinates)t=this.drawLineString(s,r,t,!1);break;case"Point":case"MultiPoint":break}return t}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let o=1;o0&&(t=Us(i[0],t));break;case"Polygon":e.coordinates.length>0&&(t=Us(e.coordinates[0],t));break;case"MultiLineString":for(const i of e.coordinates)t=Us(i,t);break;case"LineString":t=Us(e.coordinates,t);break;case"MultiPoint":for(const i of e.coordinates){const[o,s]=i;t=cu.extend(t,o,s,o,s)}break;case"Point":{const[i,o]=e.coordinates;t=cu.extend(t,i,o,i,o);break}}return t}function Fc(e){switch(e.type){case"GeometryCollection":{let t,i;for(const o of e.geometries){const s=Fc(o);if(s==null)continue;const a=Us(s[0],void 0);if(a==null)continue;const n=Math.abs(a.lat1-a.lat0)*Math.abs(a.lon1-a.lon0);(t==null||n>t)&&(t=n,i=s)}return i}case"MultiPolygon":{let t,i;for(const o of e.coordinates){const s=Us(o[0],void 0);if(s==null)continue;const a=Math.abs(s.lat1-s.lat0)*Math.abs(s.lon1-s.lon0);(t==null||a>t)&&(t=a,i=o)}return i}case"Polygon":return e.coordinates;case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function Hc(e){switch(e.type){case"GeometryCollection":{let t,i;for(const o of e.geometries){const s=Hc(o);if(s==null)continue;const a=lu(s);a!=null&&(t==null||a>t)&&(t=a,i=s)}return i}case"MultiLineString":{let t=0,i;for(const o of e.coordinates){const s=lu(o);s>t&&(t=s,i=o)}return i}case"LineString":return e.coordinates;case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function hu(e,t){if(e==null)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(i=>hu(i,t));case"MultiPolygon":case"Polygon":return(t&1)!==0;case"MultiLineString":case"LineString":return(t&2)!==0;case"MultiPoint":case"Point":return(t&4)!==0}}function os(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(i=>os(i,t))};case"Polygon":return{type:"Polygon",coordinates:du(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:kz(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:du(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:pu(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:pu(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function kz(e,t){return e.map(i=>du(i,t))}function du(e,t){return e.map(i=>pu(i,t))}function pu(e,t){return e.map(i=>t.convert(i))}function Dz(){return{fromFn:(i,o,s)=>s==="removed"?{scalingX:1,scalingY:1}:i.previousDatum==null?{scalingX:0,scalingY:0}:{scalingX:i.scalingX,scalingY:i.scalingY},toFn:(i,o,s)=>s==="removed"?{scalingX:0,scalingY:0}:{scalingX:1,scalingY:1}}}function Ob(e,t){const i=e.contextNodeData?.nodeData[t.datumIndex];if(i!==void 0){for(const o of e.datumSelection.nodes())if(o.datum===i)return o}}import{_ModuleSupport as _b}from"ag-charts-community";var oX=class extends _b.SeriesProperties{},sr=class extends _b.DataModelSeries{addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>{this.onLegendItemClick(e)}),this.ctx.eventsHub.on("legend:item-double-click",e=>{this.onLegendItemDoubleClick(e)}))}getSeriesDomain(){return[Number.NaN,Number.NaN]}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}};import{_ModuleSupport as Mz}from"ag-charts-community";var{Property:Me,SeriesProperties:Az,makeSeriesTooltip:Iz,Label:Lz}=Mz,ve=class extends Az{constructor(){super(...arguments),this.topology=void 0,this.idKey="",this.topologyIdKey="name",this.idName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.maxStrokeWidth=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.label=new Lz,this.tooltip=Iz()}getStyle(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:o,lineDashOffset:s}=this;return{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:o,lineDashOffset:s}}};d([Me],ve.prototype,"topology",2),d([Me],ve.prototype,"title",2),d([Me],ve.prototype,"legendItemName",2),d([Me],ve.prototype,"idKey",2),d([Me],ve.prototype,"topologyIdKey",2),d([Me],ve.prototype,"idName",2),d([Me],ve.prototype,"labelKey",2),d([Me],ve.prototype,"labelName",2),d([Me],ve.prototype,"sizeKey",2),d([Me],ve.prototype,"sizeName",2),d([Me],ve.prototype,"colorKey",2),d([Me],ve.prototype,"colorName",2),d([Me],ve.prototype,"sizeDomain",2),d([Me],ve.prototype,"colorRange",2),d([Me],ve.prototype,"maxStrokeWidth",2),d([Me],ve.prototype,"stroke",2),d([Me],ve.prototype,"strokeOpacity",2),d([Me],ve.prototype,"strokeWidth",2),d([Me],ve.prototype,"lineDash",2),d([Me],ve.prototype,"lineDashOffset",2),d([Me],ve.prototype,"itemStyler",2),d([Me],ve.prototype,"label",2),d([Me],ve.prototype,"tooltip",2);var{getMissCount:Tz,getLabelStyles:Cz,createDatumId:Rb,SeriesNodePickMode:Eb,valueProperty:ar,ColorScale:Nz,LinearScale:wz,Selection:uu,Text:Pz,Transformable:Oz,mergeDefaults:Bb}=Cb,Vc=class extends sr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[Eb.EXACT_SHAPE_MATCH,Eb.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new ve,this._chartTopology=void 0,this.colorScale=new Nz,this.sizeScale=new wz,this.datumSelection=uu.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=uu.select(this.labelGroup,Pz),this.highlightDatumSelection=uu.select(this.highlightGroup,()=>this.nodeFactory()),this._previousDatumMidPoint=void 0}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){return super.hasData&&this.topology!=null}renderToOffscreenCanvas(){return!0}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[1,e],this.highlightGroup.zIndex=[2,e],!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new Za;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:o,colorScale:s}=this,{topologyIdKey:a,idKey:n,sizeKey:r,colorKey:l,labelKey:c,sizeDomain:h,colorRange:p}=this.properties,u=new Map;for(const m of i?.features.values()??[]){const b=m.properties?.[a];b==null||!hu(m.geometry,2)||u.set(b,m)}const g=this.sizeScale.type,y=this.colorScale.type,f=this.scale?.type,{dataModel:x,processedData:S}=await this.requestDataModel(e,t,{props:[ar(n,f,{id:"idValue",includeProperty:!1}),ar(n,f,{id:"featureValue",includeProperty:!1,processor:()=>m=>u.get(m)}),...c==null?[]:[ar(c,"category",{id:"labelValue"})],...r==null?[]:[ar(r,g,{id:"sizeValue"})],...l==null?[]:[ar(l,y,{id:"colorValue"})]]}),v=x.resolveColumnById(this,"featureValue",S);if(this.topologyBounds=v.reduce((m,b)=>{const k=b?.geometry;return k==null?m:qa(k,m)},void 0),r!=null){const m=x.resolveProcessedDataIndexById(this,"sizeValue"),b=S.domain.values[m]??[];o.domain=h??b}if(p!=null&&this.isColorScaleValid()){const m=x.resolveProcessedDataIndexById(this,"colorValue");s.domain=S.domain.values[m],s.range=p,s.update()}i==null&&Nb.warnOnce("no topology was provided for [MapLineSeries]; nothing will be rendered.")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const o=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=Tz(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelDatum(e,t,i,o){if(t==null||i==null)return;const s=Hc(i);if(s==null)return;const{idKey:a,idName:n,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:p,labelName:u,label:g}=this.properties;if(p==null||!g.enabled)return;const y=this.getLabelText(t,e,p,"label",[],g,{value:t,datum:e,idKey:a,idName:n,sizeKey:r,sizeName:l,colorKey:c,colorName:h,labelKey:p,labelName:u});if(y==null)return;const f=o.measureLines(String(y)),x=Bc(s);if(x==null)return;const[S,v]=x.point,{width:m,height:b}=f;return{point:{x:S,y:v,size:0},label:{width:m,height:b,text:y},anchor:void 0,placement:void 0}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:o,properties:s,scale:a}=this,{idKey:n,sizeKey:r,colorKey:l,labelKey:c,label:h,legendItemName:p}=s;if(t==null||i==null)return;const u=t.resolveColumnById(this,"idValue",i),g=t.resolveColumnById(this,"featureValue",i),y=c==null?void 0:t.resolveColumnById(this,"labelValue",i),f=r==null?void 0:t.resolveColumnById(this,"sizeValue",i),x=l==null?void 0:t.resolveColumnById(this,"colorValue",i),S=s.maxStrokeWidth??s.strokeWidth;o.range=[Math.min(s.strokeWidth,S),S];const v=cz(h),m=new Map;for(const[L]of i.dataSources.get(this.id)?.data.entries()??[]){const N=u[L],P=g[L]?.geometry??void 0,R=P!=null&&a!=null?os(P,a):void 0;N!=null&&R!=null&&m.set(N,R)}const b=[],k=[],A=[],M=i.dataSources.get(this.id)?.data??[];for(const[L,N]of M.entries()){const P=u[L],R=x?.[L],F=f?.[L],_=y?.[L],E=m.get(P);E==null&&A.push(P);const T=this.getLabelDatum(N,_,E,v);T!=null&&k.push(T),b.push({series:this,itemId:n,datum:N,datumIndex:L,idValue:P,labelValue:_,colorValue:R,sizeValue:F,projectedGeometry:E,legendItemName:p,style:this.getItemStyle({datumIndex:L,datum:N,colorValue:R,sizeValue:F},!1)})}const D=10;if(A.length>D){const L=A.length-D;A.length=D,A.push(`(+${L} more)`)}return A.length>0&&Nb.warnOnce("some data items do not have matches in the provided topology",A),{itemId:e,nodeData:b,labelData:k}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e,highlightDatumSelection:t}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let i=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:o}=this.properties,s=o!=null&&i?.datum==null&&o===i?.legendItemName;i!=null&&(i.series!==this&&!s||i.datum==null)&&(i=void 0);const a=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:i==null?[]:[i],datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!0}),this.updateDatumNodes({datumSelection:t,isHighlight:!0})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Rb(t.idValue))}getItemStyle({datumIndex:e=0,datum:t,colorValue:i,sizeValue:o},s){const{properties:a,colorScale:n,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,h=this.getHighlightStyle(s,e),p=Bb(h,a.getStyle());!s&&i!=null&&(p.stroke=this.isColorScaleValid()?n.convert(i):l?.[0]??a.stroke),o!=null&&(p.strokeWidth=r.convert(o,{clamp:!0}));let u;return c!=null&&(u=this.cachedDatumCallback(Rb(e,s?"highlight":"node"),()=>{const g=this.makeItemStylerParams(t,e,s,p);return this.callWithContext(c,g)})),u?Bb(p,u):p}makeItemStylerParams(e,t,i,o){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t);return{seriesId:s,datum:e,highlighted:i,highlightState:n,...o}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o,t)})}updateDatumNodes({datumSelection:e}){e.each((t,i)=>{const{projectedGeometry:o,style:s}=i;if(o==null){t.visible=!1,t.projectedGeometry=void 0;return}t.visible=!0,t.projectedGeometry=o,t.setProperties(s)})}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=Cb.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{properties:t}=this,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,{x:s,y:a,width:n,height:r,text:l},c)=>{const h=Cz(this,void 0,t,t.label,!1,i),{color:p,fontStyle:u,fontWeight:g,fontSize:y,fontFamily:f}=h;o.visible=!0,o.x=s+n/2,o.y=a+r/2,o.text=l,o.fill=p,o.fontStyle=u,o.fontWeight=g,o.fontSize=y,o.fontFamily=f,o.textAlign="center",o.textBaseline="middle",o.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,o.setBoxing(h)})}resetAnimation(){}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,o;return this.datumSelection.each((s,a)=>{const n=s.distanceSquared(e,t);nnew Vc(e),themeTemplate:{...or,series:{stroke:Qi(Ec.SAFE_STROKE_FILL_OPERATION),colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Qi(Ec.SAFE_RANGE2_OPERATION)]},strokeWidth:1,maxStrokeWidth:3,lineDash:[0],lineDashOffset:0,label:{...Ec.LABEL_BOXING_DEFAULTS,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Qi(Ec.multiSeriesHighlightStyle(!1))},tooltip:{range:"exact"}}},jz={type:"series",name:"map-line",chartType:"topology",enterprise:!0,options:Fb,create:e=>new Vc(e)};import{_ModuleSupport as Yz}from"ag-charts-community";import{Logger as Uz}from"ag-charts-core";import{_ModuleSupport as Xz}from"ag-charts-community";var{Property:Xs,SeriesProperties:Zz,makeSeriesTooltip:qz}=Xz,ss=class extends Zz{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=qz()}};d([Xs],ss.prototype,"topology",2),d([Xs],ss.prototype,"stroke",2),d([Xs],ss.prototype,"strokeOpacity",2),d([Xs],ss.prototype,"strokeWidth",2),d([Xs],ss.prototype,"lineDash",2),d([Xs],ss.prototype,"lineDashOffset",2),d([Xs],ss.prototype,"tooltip",2);var{createDatumId:Qz,Group:Jz,Selection:eF,PointerEvents:Hb}=Yz,Wc=class extends sr{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new ss,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new Jz({name:"itemGroup"})),this.datumSelection=eF.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=Hb.None}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get focusable(){return!1}setOptionsData(){}setChartData(){}get hasData(){return!1}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,e,0],this.highlightGroup.zIndex=[0,e,1],!0}nodeFactory(){const e=new Za;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=Hb.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const o=i.geometry;return o==null?t:qa(o,t)},void 0),e==null&&Uz.warnOnce("no topology was provided for [MapShapeBackgroundSeries]; nothing will be rendered.")}createNodeData(){const{id:e,topology:t,scale:i,properties:o}=this;if(t==null)return;const{stroke:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,strokeWidth:l}=o,c=[],h=[];for(const[p,u]of t.features.entries()){const{geometry:g}=u,y=g!=null&&i!=null?os(g,i):void 0;y!=null&&c.push({series:this,itemId:p,datum:u,datumIndex:0,index:p,projectedGeometry:y,style:{stroke:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,strokeWidth:l}})}return{itemId:e,nodeData:c,labelData:h}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update(){const{datumSelection:e}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const{nodeData:t=[]}=this.contextNodeData??{};this.datumSelection=this.updateDatumSelection({nodeData:t,datumSelection:e}),this.updateDatumNodes({datumSelection:e})}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Qz(t.index))}updateDatumNodes(e){const{datumSelection:t}=e;t.each((i,o)=>{const{projectedGeometry:s}=o;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,i.setProperties(o.style)})}resetAnimation(){}getLegendData(){return[]}getTooltipContent(e){}computeFocusBounds(e){}hasItemStylers(){return!1}};Wc.className="MapLineBackgroundSeries",Wc.type="map-line-background";import{_ModuleSupport as tF}from"ag-charts-community";import{constant as iF,geoJson as oF,required as sF}from"ag-charts-core";var{mapLineBackgroundSeriesThemeableOptionsDef:aF}=tF,nF={...aF,type:sF(iF("map-line-background")),topology:oF},rF={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-line-background",moduleFactory:e=>new Wc(e),themeTemplate:{...or,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}}},lF={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,options:nF,create:e=>new Wc(e)};import{_ModuleSupport as Qa}from"ag-charts-community";import{ValidationError as cF,validate as hF}from"ag-charts-core";import{_ModuleSupport as Vb}from"ag-charts-community";import{Logger as dF,cachedTextMeasurer as pF}from"ag-charts-core";var uF=void 0,gF=void 0;gF=uF;var yF=void 0,fF=void 0;fF=yF;var mF=void 0,xF=void 0;xF=mF;var SF=void 0,bF=void 0;bF=SF;import{insertListItemsSorted as vF}from"ag-charts-core";function Wb(e,t,i){const o=Us(e[0],void 0);if(o==null)return;const s=(o.lon0+o.lon1)/2,a=(o.lat0+o.lat1)/2,n=Math.abs(o.lon1-o.lon0),r=Math.abs(o.lat1-o.lat0),l=gz(e[0]),[c,h]=l,p=-zc(e,c,h);let u;const g=(k,A)=>{const D=Math.max(A-p,0);return k-.5*D},y=(k,A,M)=>{const{distance:D,maxDistance:L}=i(e,k,A,M),N=Math.hypot(c-k,h-A),P=Math.min(Math.max(c,k-M/2),k+M/2),R=Math.min(Math.max(h,A-M/2),A+M/2),F=Math.hypot(c-P,h-R),_=g(D,N),E=g(L,F);return{distance:D,maxDistance:L,value:_,maxValue:E,x:k,y:A,stride:M}},f=(k,A,M,D)=>{const L=y(A,M,D);L.maxDistance>=0&&k.push(L)},x=Math.min(n,r)/2;let S={value:y(s,a,x),next:null};for(;S!=null;){const k=S.value,{distance:A,value:M,maxValue:D,x:L,y:N,stride:P}=k;if(S=S.next,A>0&&(u==null||M>u.value)&&(u=k),u!=null&&D-u.value<=t)continue;const R=P/2,F=[];f(F,L-R,N-R,R),f(F,L+R,N-R,R),f(F,L-R,N+R,R),f(F,L+R,N+R,R),F.sort(Gb),S=vF(S,F,Gb)}if(u==null)return;const{distance:v,x:m,y:b}=u;return{x:m,y:b,distance:v}}var Gb=(e,t)=>t.maxValue-e.maxValue;function gu(e,t){const i=Wb(e,t,(a,n,r,l)=>{const c=-zc(a,n,r),h=c+l*Math.SQRT2;return{distance:c,maxDistance:h}});if(i==null)return;const{x:o,y:s}=i;return[o,s]}function Kb(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(o=>Kb(o,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const o=Fc(e);i=o==null?void 0:gu(o,t);break}case"Polygon":{const o=e.coordinates;i=o==null?void 0:gu(o,t);break}case"MultiLineString":{const o=Hc(e);i=o==null?void 0:Bc(o)?.point;break}case"LineString":{const o=e.coordinates;i=Bc(o)?.point;break}}return i==null?[]:[i]}import{_ModuleSupport as kF}from"ag-charts-community";var{BBox:DF}=kF;function $b(e){if(!e)return;const{range:t}=e,i=t[0][0],o=t[0][1],s=t[1][0]-i,a=t[1][1]-o,n=new DF(i,o,s,a);return{series:n,axis:n}}import{_ModuleSupport as MF}from"ag-charts-community";var{Property:pe,SeriesProperties:AF,makeSeriesTooltip:IF,Label:LF}=MF,jb=class extends LF{constructor(){super(...arguments),this.placement="bottom"}};d([pe],jb.prototype,"placement",2);var ue=class extends AF{constructor(){super(...arguments),this.topology=void 0,this.idKey=void 0,this.topologyIdKey="name",this.idName=void 0,this.latitudeKey=void 0,this.latitudeName=void 0,this.longitudeKey=void 0,this.longitudeName=void 0,this.labelKey=void 0,this.labelName=void 0,this.colorRange=void 0,this.shape="circle",this.size=6,this.fill="black",this.fillOpacity=1,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.label=new jb,this.tooltip=IF()}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:o,stroke:s,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:o,opacity:1,stroke:s,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}}};d([pe],ue.prototype,"topology",2),d([pe],ue.prototype,"title",2),d([pe],ue.prototype,"legendItemName",2),d([pe],ue.prototype,"idKey",2),d([pe],ue.prototype,"topologyIdKey",2),d([pe],ue.prototype,"idName",2),d([pe],ue.prototype,"latitudeKey",2),d([pe],ue.prototype,"latitudeName",2),d([pe],ue.prototype,"longitudeKey",2),d([pe],ue.prototype,"longitudeName",2),d([pe],ue.prototype,"labelKey",2),d([pe],ue.prototype,"labelName",2),d([pe],ue.prototype,"sizeKey",2),d([pe],ue.prototype,"sizeName",2),d([pe],ue.prototype,"colorKey",2),d([pe],ue.prototype,"colorName",2),d([pe],ue.prototype,"colorRange",2),d([pe],ue.prototype,"shape",2),d([pe],ue.prototype,"size",2),d([pe],ue.prototype,"maxSize",2),d([pe],ue.prototype,"sizeDomain",2),d([pe],ue.prototype,"fill",2),d([pe],ue.prototype,"fillOpacity",2),d([pe],ue.prototype,"stroke",2),d([pe],ue.prototype,"strokeWidth",2),d([pe],ue.prototype,"strokeOpacity",2),d([pe],ue.prototype,"lineDash",2),d([pe],ue.prototype,"lineDashOffset",2),d([pe],ue.prototype,"itemStyler",2),d([pe],ue.prototype,"label",2),d([pe],ue.prototype,"tooltip",2);var{fromToMotion:TF,StateMachine:CF,getMissCount:NF,createDatumId:Yb,SeriesNodePickMode:Ub,valueProperty:Zs,computeMarkerFocusBounds:wF,ColorScale:PF,LinearScale:OF,Group:_F,Selection:yu,Text:RF,Marker:fu,applyShapeStyle:EF,getLabelStyles:BF,LonLatBBox:zF,mergeDefaults:Xb}=Vb,Gc=class extends sr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[Ub.EXACT_SHAPE_MATCH,Ub.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new ue,this._chartTopology=void 0,this.colorScale=new PF,this.sizeScale=new OF,this.markerGroup=this.contentGroup.appendChild(new _F({name:"markerGroup"})),this.labelSelection=yu.select(this.labelGroup,RF,!1),this.markerSelection=yu.select(this.markerGroup,fu,!1),this.highlightMarkerSelection=yu.select(this.highlightGroup,fu),this.animationState=new CF("empty",{empty:{update:{target:"ready",action:()=>this.animateMarkers()},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",resize:()=>this.resetAllAnimation(),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:()=>this.animateMarkers()},resize:{target:"ready",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:()=>this.resetAllAnimation()},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getNodeData(){return this.contextNodeData?.nodeData}get topology(){return this.properties.topology??this._chartTopology}get hasData(){const e=this.properties.latitudeKey!=null&&this.properties.longitudeKey!=null;return super.hasData&&(this.topology!=null||e)}renderToOffscreenCanvas(){return!0}setChartTopology(e){this._chartTopology=e,this.topology===e&&(this.nodeDataRefresh=!0)}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[3,e],this.highlightGroup.zIndex=[4,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(e){if(this.data==null)return;const{data:t,topology:i,sizeScale:o,colorScale:s}=this,{topologyIdKey:a,idKey:n,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:p,sizeDomain:u,colorRange:g}=this.properties,y=new Map;for(const D of i?.features.values()??[]){const L=D.properties?.[a];L!=null&&y.set(L,D)}const f=this.sizeScale.type,x=this.colorScale.type,S=this.scale?.type,v=r!=null&&l!=null,{dataModel:m,processedData:b}=await this.requestDataModel(e,t,{props:[...n==null?[]:[Zs(n,S,{id:"idValue",includeProperty:!1}),Zs(n,S,{id:"featureValue",includeProperty:!1,processor:()=>D=>y.get(D)})],...v?[Zs(r,S,{id:"latValue"}),Zs(l,S,{id:"lonValue"})]:[],...p?[Zs(p,"category",{id:"labelValue"})]:[],...c?[Zs(c,f,{id:"sizeValue"})]:[],...h?[Zs(h,x,{id:"colorValue"})]:[]]}),k=n==null?void 0:m.resolveColumnById(this,"featureValue",b),A=v?m.resolveColumnById(this,"latValue",b):void 0,M=v?m.resolveColumnById(this,"lonValue",b):void 0;if(this.topologyBounds=b.dataSources.get(this.id)?.data.reduce((D,L,N)=>{const R=k?.[N]?.geometry;if(R!=null&&(D=qa(R,D)),A!=null&&M!=null){const F=M[N],_=A[N];D=zF.extend(D,F,_,F,_)}return D},void 0),c!=null){const D=m.resolveProcessedDataIndexById(this,"sizeValue"),L=b.domain.values[D]??[];o.domain=u??L}if(g!=null&&this.isColorScaleValid()){const D=m.resolveProcessedDataIndexById(this,"colorValue");s.domain=b.domain.values[D],s.range=g,s.update()}this.animationState.transition("updateData")}isColorScaleValid(){const{colorKey:e}=this.properties;if(!e)return!1;const{dataModel:t,processedData:i}=this;if(!t||!i)return!1;const o=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=NF(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelDatum(e,t,i,o,s,a){if(t==null)return;const{idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:p,sizeKey:u,sizeName:g,colorKey:y,colorName:f,labelKey:x,labelName:S,label:v,shape:m}=this.properties;if(x==null||!v.enabled)return;const{placement:b}=v,k=this.getLabelText(t,e,x,"label",[],v,{value:t,datum:e,idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:p,sizeKey:u,sizeName:g,colorKey:y,colorName:f,labelKey:x,labelName:S});if(k==null)return;const{width:A,height:M}=a.measureLines(String(k)),D=fu.anchor(m);return{point:{x:i,y:o,size:s},label:{width:A,height:M,text:k},anchor:D,placement:b}}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:o,properties:s,scale:a}=this,{idKey:n,latitudeKey:r,longitudeKey:l,sizeKey:c,colorKey:h,labelKey:p,label:u,legendItemName:g}=s;if(t==null||i==null||a==null)return;const y=r!=null&&l!=null,f=n==null?void 0:t.resolveColumnById(this,"idValue",i),x=n==null?void 0:t.resolveColumnById(this,"featureValue",i),S=y?t.resolveColumnById(this,"latValue",i):void 0,v=y?t.resolveColumnById(this,"lonValue",i):void 0,m=p==null?void 0:t.resolveColumnById(this,"labelValue",i),b=c==null?void 0:t.resolveColumnById(this,"sizeValue",i),k=h==null?void 0:t.resolveColumnById(this,"colorValue",i),A=s.maxSize??s.size;o.range=[Math.min(s.size,A),A];const M=pF(u);let D;if(f!=null&&x!=null){D=new Map;for(const[_]of i.dataSources.get(this.id)?.data.entries()??[]){const E=f[_],T=x[_]?.geometry??void 0,w=T!=null&&a!=null?os(T,a):void 0;E!=null&&w!=null&&D.set(E,w)}}const L=[],N=[],P=[],R=i.dataSources.get(this.id)?.data??[];for(const[_,E]of R.entries()){const T=f?.[_],w=v?.[_],C=S?.[_],I=k?.[_],O=b?.[_],z=m?.[_],B=O==null?s.size:o.convert(O,{clamp:!0}),H=T==null?void 0:D?.get(T);if(T!=null&&os==null&&P.push(T),w!=null&&C!=null){const[W,V]=a.convert([w,C]),G=this.getLabelDatum(E,z,W,V,B,M);G&&N.push(G),L.push({series:this,itemId:r,datum:E,datumIndex:_,index:-1,idValue:T,lonValue:w,latValue:C,labelValue:z,sizeValue:O,colorValue:I,point:{x:W,y:V,size:B},midPoint:{x:W,y:V},legendItemName:g,style:this.getMarkerItemStyle({datumIndex:_,datum:E,colorValue:I,sizeValue:O},!1)})}else if(H!=null)for(const[W,[V,G]]of Kb(H,1).entries()){const K=this.getLabelDatum(E,z,V,G,B,M);K&&N.push(K),L.push({series:this,itemId:r,datum:E,datumIndex:_,index:W,idValue:T,lonValue:w,latValue:C,labelValue:z,sizeValue:O,colorValue:I,point:{x:V,y:G,size:B},midPoint:{x:V,y:G},legendItemName:g,style:this.getMarkerItemStyle({datumIndex:_,datum:E,colorValue:I,sizeValue:O},!1)})}}const F=10;if(P.length>F){const _=P.length-F;P.length=F,P.push(`(+${_} more)`)}return P.length>0&&dF.warnOnce("some data items do not have matches in the provided topology",P),{itemId:e,nodeData:L,labelData:N}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}checkScaleChange(){return this.previousScale===this.scale?!1:(this.previousScale=this.scale,!0)}update({seriesRect:e}){const t=this.checkResize(e),i=this.checkScaleChange(),{markerSelection:o,highlightMarkerSelection:s}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;let a=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:n}=this.properties,r=n!=null&&a?.datum==null&&n===a?.legendItemName;a!=null&&(a.series!==this&&!r||a.datum==null)&&(a=void 0);const l=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:l,markerSelection:o}),this.updateMarkerNodes({markerSelection:o,isHighlight:!1,highlightedDatum:a}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:a==null?[]:[a],markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!0,highlightedDatum:a}),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=Vb.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{properties:t}=this,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,{x:s,y:a,width:n,height:r,text:l},c)=>{const h=BF(this,void 0,t,t.label,!1,i),{color:p,fontStyle:u,fontWeight:g,fontSize:y,fontFamily:f}=h;o.visible=!0,o.x=s+n/2,o.y=a+r/2,o.text=l,o.fill=p,o.fontStyle=u,o.fontWeight=g,o.fontSize=y,o.fontFamily=f,o.textAlign="center",o.textBaseline="middle",o.fillOpacity=this.getHighlightStyle(!1,c).opacity??1,o.setBoxing(h)})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,o=>Yb(o.index,o.idValue,o.lonValue,o.latValue))}getMarkerItemStyle({datumIndex:e,datum:t,colorValue:i,sizeValue:o},s){const{properties:a,colorScale:n,sizeScale:r}=this,{colorRange:l,itemStyler:c}=a,h=this.getHighlightStyle(s,e),p=Xb(h,a.getStyle());!s&&i!=null&&(p.fill=this.isColorScaleValid()?n.convert(i):l?.[0]??p.fill),o!=null&&(p.size=r.convert(o,{clamp:!0}));let u=p;if(c!=null&&e!=null){const g=this.cachedDatumCallback(Yb(e,s?"highlight":"node"),()=>{const y=this.makeItemStylerParams(t,e,s,u);return this.callWithContext(c,y)});g&&(u=Xb(g,p))}return u}makeItemStylerParams(e,t,i,o){const{id:s}=this,a=this.ctx.highlightManager?.getActiveHighlight(),n=this.getHighlightStateString(a,i,t),r=this.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:e,highlighted:i,highlightState:n,...o,fill:r}}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:o}=e,s=$b(this.scale);t.each((a,n)=>{const{datum:r,point:l}=n,c=this.getMarkerItemStyle(n,i);a.shape=c.shape,a.size=c.size,EF(a,c,s),a.x=l.x,a.y=l.y,a.scalingCenterX=l.x,a.scalingCenterY=l.y,a.zIndex=!i&&o!=null&&r===o.datum?1:0})}isProcessedDataAnimatable(){return!0}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.ctx.animationManager.skipCurrentBatch(),this.labelSelection.cleanup(),this.markerSelection.cleanup(),this.highlightMarkerSelection.cleanup()}animateMarkers(){const{animationManager:e}=this.ctx,t=Dz();TF(this.id,"markers",e,[this.markerSelection,this.highlightMarkerSelection],t)}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}pickNodeClosestDatum(e){const{x:t,y:i}=e;let o=1/0,s;for(const a of this.contextNodeData?.nodeData??[]){const{x:n,y:r,size:l}=a.point,c=Math.max(Math.abs(n-t)-l,0),h=Math.max(Math.abs(r-i)-l,0),p=c*c+h*h;p=0?"N":"S"}, ${Math.abs(R).toFixed(4)}\xB0 ${R>=0?"W":"E"}`}const N=this.getMarkerItemStyle({datumIndex:e,datum:k,colorValue:M,sizeValue:A},!1);return this.formatTooltipWithContext(b,{heading:L,title:v??m,symbol:this.legendItemSymbol(e),data:D},{seriesId:t,datum:k,title:v,idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:p,colorKey:u,colorName:g,sizeKey:y,sizeName:f,labelKey:x,labelName:S,...N})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return wF(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Gc.className="MapMarkerSeries",Gc.type="map-marker";import{_ModuleSupport as FF}from"ag-charts-community";import{constant as HF,geoJson as VF,required as WF,string as It}from"ag-charts-core";var{commonSeriesOptionsDefs:GF,mapMarkerSeriesThemeableOptionsDef:KF,without:$F}=FF,jF={...$F(GF,["highlightStyle","highlight"]),...KF,type:WF(HF("map-marker")),idKey:It,latitudeKey:It,longitudeKey:It,sizeKey:It,colorKey:It,labelKey:It,idName:It,latitudeName:It,longitudeName:It,sizeName:It,colorName:It,labelName:It,topology:VF,topologyIdKey:It,legendItemName:It,title:It},YF={type:"series",optionsKey:"series[]",packageType:"enterprise",chartTypes:["topology"],identifier:"map-marker",moduleFactory:e=>new Gc(e),themeTemplate:{...or,series:{shape:"circle",maxSize:30,fill:Qi({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",Qa.FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS],["image",Qa.FILL_IMAGE_DEFAULTS],["pattern",Qa.FILL_PATTERN_DEFAULTS]]}),stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},Qi(Qa.SAFE_RANGE2_OPERATION)]},fillOpacity:.5,label:{...Qa.LABEL_BOXING_DEFAULTS,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:Qi(Qa.multiSeriesHighlightStyle())},tooltip:{range:"exact"}}},UF={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,options:jF,create:e=>new Gc(e),validate(e,t,i){const o=hF(e,t,i),{cleared:s,invalid:a}=o;if(s?.idKey==null&&(s?.latitudeKey==null||s?.longitudeKey==null)){const n=l=>i?`${i}.${l}`:l,r=`Either \`${n("idKey")}\` or both \`${n("latitudeKey")}\` and \`${n("longitudeKey")}\` are required.`;a.push(new cF("required",r,null,i))}return o}};import{_ModuleSupport as Ja}from"ag-charts-community";import{_ModuleSupport as Zb}from"ag-charts-community";import{Logger as qb,cachedTextMeasurer as XF,isArray as ZF,measureTextSegments as qF,toPlainText as QF}from"ag-charts-core";function JF(e,{aspectRatio:t,precision:i}){const o=Wb(e,i,(l,c,h,p)=>{const u=tH(l,c,h,t),g=u+2*p*t,y=u*Math.SQRT2,f=g*Math.SQRT2;return{distance:y,maxDistance:f}});if(o==null)return;const{x:s,y:a,distance:n}=o,r=n/Math.SQRT2;return{x:s,y:a,maxWidth:r}}function eH(e,t,i,o,s){const[a,n]=e,[r,l]=t,c=1/s,h=r-a,p=l-n,[u,g]=n<=l?e:t,[y,f]=a<=r?e:t,[x,S]=n<=l?t:e,[v,m]=a<=r?t:e;let b=1/0;if(h===0)for(let N=0;N<=1;N+=1){const R=(N===0?c:-c)*(a-i)+o;if(R>=g&&R<=S){const _=Math.abs(o-R)*2*s;b=Math.min(b,_)}}else{const N=p/h;for(let P=0;P<=1;P+=1){const R=P===0?c:-c,F=(N*a-n-R*i+o)/(N-R);if(F>=y&&F<=v){const _=Math.abs(i-F)*2;b=Math.min(b,_)}}}const k=s,A=Math.abs((u-i)/(g-o)),M=Math.abs((x-i)/(S-o));if(So&&Ai&&D