var hA=Object.defineProperty,dA=Object.getOwnPropertyDescriptor,d=(e,t,i,o)=>{for(var s=o>1?void 0:o?dA(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&&hA(t,i,s),s};import{ModuleRegistry as Am,enterpriseRegistry as En}from"ag-charts-core";import{_ModuleSupport as uA}from"ag-charts-community";import{ActionOnSet as pA,ChartUpdateType as gA,Property as mA}from"ag-charts-core";import{_ModuleSupport as yA}from"ag-charts-community";import{BaseProperties as fA,ObserveChanges as xA,Property as Cs,ProxyProperty as SA,calculatePlacement as bA,createElement as vA}from"ag-charts-core";var Hi=class extends fA{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=vA("img"),this.imageElement.onload=this.onImageLoad,this.node=new yA.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=bA(this.imageElement.width,this.imageElement.height,i,this);return this.node.setProperties(this.complete?{visible:!0,opacity:this.opacity,...o}:{visible:!1}),o}};d([Cs],Hi.prototype,"top",2),d([Cs],Hi.prototype,"right",2),d([Cs],Hi.prototype,"bottom",2),d([Cs],Hi.prototype,"left",2),d([Cs],Hi.prototype,"width",2),d([Cs],Hi.prototype,"height",2),d([Cs],Hi.prototype,"opacity",2),d([SA("imageElement.src"),xA(e=>e.loadedSynchronously=e.complete)],Hi.prototype,"url",2);var Oh=class extends uA.Background{constructor(){super(...arguments),this.image=new Hi}onLayoutComplete(e){if(super.onLayoutComplete(e),this.image){const{width:t,height:i}=e.chart;this.image.performLayout(t,i)}}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:gA.SCENE_RENDER})}};d([mA,pA({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],Oh.prototype,"image",2);import{_ModuleSupport as Nm}from"ag-charts-community";import{ActionOnSet as MA,ChartUpdateType as DA,Property as Eh,ProxyPropertyOnWrite as Lm,ZIndexMap as kA}from"ag-charts-core";var Pn=class extends Nm.Background{constructor(){super(...arguments),this.image=new Hi,this.fill="transparent",this.fillOpacity=void 0}createNode(){return new Nm.Group({name:"foreground",zIndex:kA.FOREGROUND})}onLayoutComplete(e){super.onLayoutComplete(e);const{width:t,height:i}=e.chart,o=this.image.performLayout(t,i);this.text&&this.updateTextNode(o)}onImageLoad(){this.ctx.eventsHub.emit("chart:request-update",{type:DA.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{width:i}=t.getBBox(),o=10;t.x=e.x+e.width/2-i/2,t.y=e.y+e.height+o}};d([Eh,MA({newValue(e){this.node.appendChild(e.node),e.onLoad=()=>this.onImageLoad()},oldValue(e){e.node.remove(),e.onLoad=void 0}})],Pn.prototype,"image",2),d([Eh,Lm("rectNode","fill")],Pn.prototype,"fill",2),d([Eh,Lm("rectNode","fillOpacity")],Pn.prototype,"fillOpacity",2);var IA=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 Ph(e){return e==null||e.length===0}var AA="data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",$r={"01":"GRID","02":"CHARTS","0102":"BOTH"},Tm="https://www.ag-grid.com/charts/licensing/",Ur=class xe{constructor(t){this.watermarkMessage=void 0,this.totalMessageLength=124,this.document=t,this.md5=new IA,this.md5.init()}validateLicense(){const t=this.getLicenseDetails(xe.licenseKey,xe.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=xe.getChartsReleaseDate(),a=xe.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);xe.licenseOutputLogged=!0}static extractExpiry(t){const i=t.substring(t.lastIndexOf("_")+1,t.length);return new Date(Number.parseInt(xe.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]=xe.extractBracketedInformation(i);return{md5:s,license:a,version:n,isTrial:r,type:l}}getLicenseDetails(t,i=!1){const o="CHARTS";if(Ph(t))return{licenseKey:t,valid:!1,missing:!0,currentLicenseType:o};const s=xe.getChartsReleaseDate(),{md5:a,license:n,version:r,isTrial:l,type:c}=xe.extractLicenseComponents(t);let h=a===this.md5.md5(n)&&!t.includes("For_Trialing_ag-Grid_Only"),u,p,g=null,m=!1,y;function x(){u=gg,r){case"legacy":case"2":{h=!1;break}case"3":Ph(c)?h=!1:(y=c,c!==$r["02"]&&c!==$r["0102"]?(h=!1,m=!0):l&&x())}return h?{licenseKey:t,valid:h,expiry:xe.formatDate(g),expired:p,version:r,isTrial:l,trialExpired:u,invalidLicenseTypeForCombo:i?y!=="BOTH":void 0,incorrectLicenseType:m,currentLicenseType:o,suppliedLicenseType:y}:{licenseKey:t,valid:h,incorrectLicenseType:m,currentLicenseType:o,suppliedLicenseType:y}}isDisplayWatermark(){return this.isForceWatermark()||!this.isLocalhost()&&!this.isE2ETest()&&!this.isWebsiteUrl()&&!Ph(this.watermarkMessage)}getWatermarkMessage(){return this.watermarkMessage??""}getWatermarkForegroundConfig(){const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}getWatermarkForegroundConfigForBrowser(){if(!this.isDisplayWatermark())return;const t=this.getWatermarkMessage();if(t)return this.buildWatermarkConfig(t)}buildWatermarkConfig(t){return{text:t,image:{url:AA,width:170,height:25,right:25,bottom:50,opacity:.7}}}getHostname(){if(!this.document)return"localhost";const t=this.document.defaultView??globalThis;if(!t)return"localhost";try{return(t.location?.hostname??"")||"localhost"}catch{return"localhost"}}isForceWatermark(){if(!this.document)return!1;const t=this.document?.defaultView??globalThis.window!=null?globalThis:void 0;if(!t)return!1;const i=t.location?.pathname;return i?i.includes("forceWatermark"):!1}isWebsiteUrl(){const t=this.getHostname();return/^((?:[\w-]+\.)?ag-grid\.com)$/.exec(t)!==null||/^((?:[\w-]+\.)?bryntum\.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(xe.decode(xe.RELEASE_INFORMATION),10))}static decode(t){const i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";let o="",s,a,n,r,l,c,h,u=0;const p=t.replaceAll(/[^A-Za-z0-9+/=]/g,"");for(;u>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=xe.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){xe.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."),this.licenseKey!==t&&(xe.licenseOutputLogged=!1),xe.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=$r[i.find(r=>$r[r])];return[a,o,n]}centerPadAndOutput(t){if(xe.licenseOutputLogged)return;const i=this.totalMessageLength-t.length;console.error(t.padStart(i/2+t.length,"*").padEnd(this.totalMessageLength,"*"))}padAndOutput(t,i="*",o=""){xe.licenseOutputLogged||console.error(t.padEnd(this.totalMessageLength-o.length,i)+o)}outputInvalidLicenseKey(t,i,o){xe.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 ${Tm}.`," ","*"),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 ${Tm}.`," ","*"),this.centerPadAndOutput(""),this.centerPadAndOutput(""))),this.watermarkMessage="Invalid License"}outputExpiredTrialKey(t,i,o){xe.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){xe.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){xe.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"}};Ur.RELEASE_INFORMATION="MTc3NTU0ODM5NDIwNA==",Ur.gridContext=!1,Ur.licenseOutputLogged=!1;var Os=Ur;import{createElement as NA}from"ag-charts-core";function wm(e,t){const i=e.addChild("canvas-overlay","watermark"),o=NA("span");o.innerText=t,i.addEventListener("animationend",()=>{e.removeChild("canvas-overlay","watermark"),e.removeStyles("watermark")}),i.classList.add("ag-watermark"),i.appendChild(o)}var Cm=`.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-inline-start:calc(var(--ag-charts-spacing) * -2)}.ag-charts-button.ag-charts-dialog__close-button{background:none;border:0;margin-inline-start: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-inline-end:5px}.ag-charts-dialog__input-group-label[for]{cursor:pointer}.ag-charts-dialog__button{border-radius:0;margin-inline-end:-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-start-start-radius:var(--ag-charts-input-border-radius);border-end-start-radius:var(--ag-charts-input-border-radius)}.ag-charts-dialog__button:last-child{border-start-end-radius:var(--ag-charts-input-border-radius);border-end-end-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;direction:ltr;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;margin-inline-start: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-inline-end: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-color:var(--ag-charts-border-color);border-radius:var(--ag-charts-border-radius);border-style:solid;border-width:var(--ag-charts-menu-border-width);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:start;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-inline-end: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-wrapper[dir=rtl] .ag-charts-context-menu__item .ag-charts-icon-chevron-right{transform:scaleX(-1)}.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{--toolbar-size: var(--ag-charts-ranges-min-size);--toolbar-border-radius: var(--ag-charts-ranges__button-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__button-fill);--toolbar-button-border-color: var(--ag-charts-ranges__button-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__button-stroke-width);--toolbar-button-gap: var(--ag-charts-ranges-gap);--toolbar-button-text-color: var(--ag-charts-ranges__button-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__button-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__button-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__button-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__button-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__button-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__button-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__button-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__button-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__button-text-color--hover)}.ag-charts-range-buttons--dropdown{--toolbar-border-radius: var(--ag-charts-ranges__dropdown-corner-radius);--toolbar-button-background-color: var(--ag-charts-ranges__dropdown-fill);--toolbar-button-border-color: var(--ag-charts-ranges__dropdown-stroke);--toolbar-button-border-width: var(--ag-charts-ranges__dropdown-stroke-width);--toolbar-button-text-color: var(--ag-charts-ranges__dropdown-text-color);--toolbar-button-background-color--active: var(--ag-charts-ranges__dropdown-fill--active);--toolbar-button-border-color--active: var(--ag-charts-ranges__dropdown-stroke--active);--toolbar-button-text-color--active: var(--ag-charts-ranges__dropdown-text-color--active);--toolbar-button-background-color--disabled: var(--ag-charts-ranges__dropdown-fill--disabled);--toolbar-button-border-color--disabled: var(--ag-charts-ranges__dropdown-stroke--disabled);--toolbar-button-text-color--disabled: var(--ag-charts-ranges__dropdown-text-color--disabled);--toolbar-button-background-color--hover: var(--ag-charts-ranges__dropdown-fill--hover);--toolbar-button-border-color--hover: var(--ag-charts-ranges__dropdown-stroke--hover);--toolbar-button-text-color--hover: var(--ag-charts-ranges__dropdown-text-color--hover)}.ag-charts-range-buttons .ag-charts-toolbar__button{font-size:var(--ag-charts-ranges__button-font-size);font-family:var(--ag-charts-ranges__button-font-family);font-weight:var(--ag-charts-ranges__button-font-weight);padding-top:var(--ag-charts-ranges__button-padding-top);padding-right:var(--ag-charts-ranges__button-padding-right);padding-bottom:var(--ag-charts-ranges__button-padding-bottom);padding-left:var(--ag-charts-ranges__button-padding-left)}.ag-charts-range-buttons--dropdown .ag-charts-toolbar__button{flex:1;justify-content:space-between;font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left);.ag-charts-toolbar__icon{margin-top:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);margin-bottom:calc(var(--ag-charts-ranges__dropdown-font-size) - 15px);height:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px);width:calc(var(--ag-charts-ranges__dropdown-font-size) + 8px)}}.ag-charts-range-buttons--gapped{.ag-charts-toolbar__button{border-radius:var(--toolbar-border-radius);border-width:var(--toolbar-button-border-width)}.ag-charts-toolbar__button--active,.ag-charts-toolbar__button--active:hover{+.ag-charts-toolbar__button{border-inline-start-color:var(--toolbar-button-border-color)}}}.ag-charts-range-buttons-menu{background:var(--ag-charts-ranges__dropdown-fill);border-color:var(--ag-charts-ranges__dropdown-stroke);border-radius:var(--ag-charts-ranges__dropdown-corner-radius);border-width:var(--ag-charts-ranges__dropdown-stroke-width);color:var(--ag-charts-ranges__dropdown-text-color);.ag-charts-menu__row{font-size:var(--ag-charts-ranges__dropdown-font-size);font-family:var(--ag-charts-ranges__dropdown-font-family);font-weight:var(--ag-charts-ranges__dropdown-font-weight);padding-top:var(--ag-charts-ranges__dropdown-padding-top);padding-right:var(--ag-charts-ranges__dropdown-padding-right);padding-bottom:var(--ag-charts-ranges__dropdown-padding-bottom);padding-left:var(--ag-charts-ranges__dropdown-padding-left)}.ag-charts-menu__row:focus{background:var(--ag-charts-ranges__dropdown-fill--hover)}.ag-charts-menu__row[aria-disabled=true]{background:var(--ag-charts-ranges__dropdown-fill--disabled);color:var(--ag-charts-ranges__dropdown-text-color--disabled)}}.ag-charts-zoom-buttons{direction:ltr;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-end-start-radius:var(--ag-charts-border-radius);border-start-start-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__button--last{border-end-end-radius:var(--ag-charts-border-radius);border-start-end-radius:var(--ag-charts-border-radius)}.ag-charts-toolbar__label{padding-inline-start:var(--ag-charts-spacing);padding-inline-end:var(--ag-charts-spacing)}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{padding-inline-start:0}.ag-charts-toolbar__button--group-first{margin-inline-start:calc(var(--ag-charts-spacing) * 2)}&.ag-charts-zoom-buttons__toolbar--hidden{opacity:0;transition:opacity .4s ease-in-out,transform .4s ease-in-out}}}.ag-charts-shared-toolbar{--toolbar-button-gap: calc(var(--ag-charts-spacing) * 2);.ag-charts-toolbar__button{border-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--active+.ag-charts-toolbar__button{border-inline-start-color:var(--ag-charts-border-color)}} `,LA=void 0,TA=void 0;TA=LA;var wA=void 0,CA=void 0;CA=wA;var Om=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(Om||{}),Em=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e.TOP_RIGHT="top-right",e.BOTTOM_RIGHT="bottom-right",e.BOTTOM_LEFT="bottom-left",e.TOP_LEFT="top-left",e.CENTER="center",e))(Em||{}),OA=void 0,EA=void 0;EA=OA;var PA=void 0,RA=void 0;RA=PA;export*from"ag-charts-community";import{VERSION as _A,_ModuleSupport as zA}from"ag-charts-community";import{_ModuleSupport as BA}from"ag-charts-community";import{Property as Rh,isNumberEqual as Pm}from"ag-charts-core";function _h(e,t,i){const o=Math.floor(e.length/2);return Rm(e,t,o,t,i)||Rm(e,e.length-t,o,-t,i)}function Rm(e,t,i,o,s){let a=e[0];for(let n=t;o>0?n<=i:n>i;n+=o){const r=e[n];if(s(a,r))return!0;a=r}return!1}import{_ModuleSupport as VA}from"ag-charts-community";import{Property as FA}from"ag-charts-core";var{AxisInterval:HA}=VA,zh=class extends HA{};d([FA],zh.prototype,"minSpacing",2);import{_ModuleSupport as Yr}from"ag-charts-community";import{ChartAxisDirection as KA,Property as Bh,countFractionDigits as WA,isNumberEqual as Aa,normalizeAngle360 as Ho,normalizeAngle360Inclusive as GA,toRadians as Rn,wrapTextOrSegments as jA}from"ag-charts-core";import{_ModuleSupport as _m}from"ag-charts-community";import{ChartAxisDirection as $A,isNumberEqual as zm,normalizeAngle360 as Vh}from"ag-charts-core";import{_ModuleSupport as UA}from"ag-charts-community";import{BaseProperties as YA,ChartAxisDirection as XA,Property as nt,createId as ZA}from"ag-charts-core";var{Group:Fh,LabelStyle:QA}=UA,Na=class extends QA{constructor(){super(...arguments),this.padding=5}};d([nt],Na.prototype,"enabled",2),d([nt],Na.prototype,"padding",2),d([nt],Na.prototype,"text",2),d([nt],Na.prototype,"parallel",2);var ft=class extends YA{constructor(){super(...arguments),this.id=ZA(this),this.defaultColorRange=[],this.shape="polygon",this.label=new Na,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.gridPadding=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction=XA.Angle,this.axisInnerRadius=0,this.axisOuterRadius=0,this.lineGroup=new Fh({name:this.id}),this.rangeGroup=new Fh({name:this.id}),this.labelGroup=new Fh({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.setFont(a),e.setBoxing(a),e.visible=!0}};ft.className="PolarCrossLine",d([nt],ft.prototype,"enabled",2),d([nt],ft.prototype,"type",2),d([nt],ft.prototype,"range",2),d([nt],ft.prototype,"value",2),d([nt],ft.prototype,"defaultColorRange",2),d([nt],ft.prototype,"fill",2),d([nt],ft.prototype,"fillOpacity",2),d([nt],ft.prototype,"stroke",2),d([nt],ft.prototype,"strokeWidth",2),d([nt],ft.prototype,"strokeOpacity",2),d([nt],ft.prototype,"lineDash",2),d([nt],ft.prototype,"shape",2),d([nt],ft.prototype,"label",2);var{getCrossLineValue:qA,validateCrossLineValue:JA,Group:e0,Path:Bm,Sector:t0,RotatableText:i0,ContinuousScale:o0}=_m,Hh=class extends ft{constructor(){super(),this.direction=$A.Angle,this.polygonNode=new Bm,this.sectorNode=new t0,this.lineNode=new Bm,this.crossLineRange=new e0,this.labelNode=new i0,this.ticks=[],this.crossLineRange.append(this.polygonNode),this.crossLineRange.append(this.sectorNode),this.crossLineRange.append(this.lineNode),this.labelGroup.append(this.labelNode)}visibilityCheck(){if(!o0.is(this.scale))return!0;const[e,t]=this.scale.domain,i=qA(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||!JA(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),u=n*Math.sin(a);s.path.clear(!0),s.path.moveTo(h,u),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]),p=(c<=h?n.slice(c,h+1):n.slice(c).concat(n.slice(0,h+1))).map(m=>o.convert(m));t.visible=!0,this.setSectorNodeProps(t);const{path:g}=t;g.clear(!0);for(const[m,y]of p.entries()){const x=l*Math.cos(y),f=l*Math.sin(y);m===0?g.moveTo(x,f):g.lineTo(x,f)}if(r===0)g.lineTo(0,0);else{const m=p.slice().reverse();for(const y of m){const x=r*Math.cos(y),f=r*Math.sin(y);g.lineTo(x,f)}}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(u=>o.convert(u)),c=o.step??0,h=o instanceof _m.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,u,p;if(a==="line"){const g=Vh(s.convert(this.value)),m=1.5*Math.PI,y=zm(g,m)||g>m||gVh(s.convert(b)));let y=(g+m)/2;g>m&&(y-=Math.PI),y=Vh(y);const x=(zm(y,0)||y>0)&&yl.value),r=n.reduce((l,c)=>Math.max(typeof c=="number"?WA(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=Ho(-Math.PI/2+Rn(this.startAngle)),t=this.endAngle==null?2*Math.PI:GA(Rn(this.endAngle)-Rn(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=Aa(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:Ho(o),endAngle:Ho(s),arc:!0,moveTo:!1});else if(t==="polygon"){const r=e.ticks({nice:[this.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),u=i*Math.sin(c),p=l===0;n.push({x:h,y:u,moveTo:p})}}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:u,lineDash:p}=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=u,r.strokeWidth=o,r.lineDash=p,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 a0,l=i.x-this.translation.x,c=i.x+i.width-this.translation.x,{fractionDigits:h}=this.layout.label,u=this.tickFormatter(this.scale.domain,this.tickData,!1,h),p=e.map((g,m)=>{const{value:y}=g,x=s+o.spacing+n.size,f=a.convert(y),b=Math.cos(f),S=Math.sin(f),v=x*b,M=x*S,{textAlign:D,textBaseline:I}=this.getLabelAlign(f),A=m===e.length-1&&y!==e[0]&&Aa(Ho(f),Ho(a.convert(e[0]))),k=this.getLabelRotation(f);let N=u(y,m);r.text=N,r.x=v,r.y=M,r.setFont(o),r.textAlign=D,r.textBaseline=I,r.rotation=k,k&&(r.rotationCenterX=v,r.rotationCenterY=M);let L=k?n0.toCanvas(r):r.getBBox();if(L&&t.hideWhenNecessary&&!k){const T=l-L.x,P=L.x+L.width-c,R=1;if(T>R||P>R){const O={maxWidth:L.width-Math.max(T,P),font:o,textWrap:"never"};N=jA(N,O),r.text=N,L=r.getBBox()}}return{text:N,x:v,y:M,textAlign:D,textBaseline:I,hidden:N===""||(g.hidden??A),rotation:k,box:L}});return o.avoidCollisions&&this.avoidLabelCollisions(p),p}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:r0.merge(i)}getLabelOrientation(){const{label:e}=this;return e instanceof Kh?e.orientation:"fixed"}getLabelRotation(e){let t=Rn(this.label.rotation??0);e=Ho(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=Aa(t,0),r=Aa(i,0),l=Aa(t,1),c=Aa(i,-1),h=t>0&&!n,u=i>0&&!r;return a==="parallel"?(o="center",s=l&&r||u?"top":"bottom"):a==="perpendicular"?(o=c||h?"left":"right",s="middle"):(o="right",n?o="center":h&&(o="left"),s="bottom",r?s="middle":u&&(s="top")),{textAlign:o,textBaseline:s}}updateCrossLines(){const{shape:e,gridLength:t,innerRadiusRatio:i}=this;for(const o of this.crossLines)o instanceof Hh&&(o.ticks=this.tickData.map(s=>s.value),o.shape=e,o.axisOuterRadius=t,o.axisInnerRadius=t*i);super.updateCrossLines()}};_n.CrossLineConstructor=Hh,d([Bh],_n.prototype,"startAngle",2),d([Bh],_n.prototype,"endAngle",2);var{CategoryScale:l0}=BA,Es=class extends _n{constructor(e){super(e,new l0),this.groupPaddingInner=0,this.paddingInner=0,this.interval=new zh}hasDefinedDomain(){return!1}generateAngleTicks(e){const{scale:t,gridLength:i}=this,{values:o,minSpacing:s}=this.interval,a={nice:[this.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(u=>({value:u,visible:!0}));const r=n[0],l=t.convert(r),c=i*Math.cos(l),h=i*Math.sin(l);for(let u=1;uMath.PI)break;const m=i*Math.cos(g),y=i*Math.sin(g);if(Math.hypot(m-c,y-h)>s){const f=new Set([r]);return _h(n,u,(b,S)=>{f.add(S)}),n.map(b=>{const S=f.has(b);return{value:b,visible:S}})}}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),u=c.box.clone().grow(t/2);return h.collidesBBox(u)},o=e[0],s=e.at(-1),a=new Set([o]),n=Pm(o.x,s.x)&&Pm(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(!_h(c,l,i)){_h(c,l,(u,p)=>{a.add(p)});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}}};Es.className="AngleCategoryAxis",Es.type="angle-category",d([Rh],Es.prototype,"groupPaddingInner",2),d([Rh],Es.prototype,"paddingInner",2),d([Rh],Es.prototype,"interval",2);var Hm={type:"axis",name:"angle-category",chartType:"polar",enterprise:!0,version:_A,options:zA.angleCategoryAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0}},create:e=>new Es(e)};import{VERSION as c0,_ModuleSupport as h0}from"ag-charts-community";import"ag-charts-community";import{Property as zn,angleBetween as d0,findMinMax as u0,isNumberEqual as Km,normalisedExtentWithMetadata as p0}from"ag-charts-core";import{_ModuleSupport as g0}from"ag-charts-community";import{isDenseInterval as m0,isNumberEqual as y0,range as Wm}from"ag-charts-core";var{LinearScale:Wh}=g0,Gm=class vm extends Wh{constructor(){super(...arguments),this.arcLength=0}static getNiceStepAndTickCount(t,i){const[o,s]=i;let a=Wh.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(h=>!Number.isFinite(h))||o<=0)return{ticks:[],count:0};const{nice:s,interval:a}=t,[n,r]=i;if(a){const h=Math.abs(a),u=this.getPixelRange();if(!m0((r-n)/h,u)){const p=Wm(n,r,h);return{ticks:p.ticks,count:p.count}}}let l;if(s&&this.hasNiceRange()){const h=super.niceDomain(t,i);l=vm.getNiceStepAndTickCount(t,h).step}else l=Wh.getTickStep(n,r,t);const c=Wm(n,r,l);return{ticks:c.ticks,count:c.count}}hasNiceRange(){const t=this.range.slice().sort((o,s)=>o-s);return[Math.PI,2*Math.PI].some(o=>y0(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}=vm.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}},Ko=class extends _n{constructor(e){super(e,new Gm),this.shape="circle",this.interval=new zh}hasDefinedDomain(){const{min:e,max:t}=this;return e!=null&&t!=null&&eu>=c&&u<=h).sort((u,p)=>u-p)}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&&Km(o.x,s.x)&&Km(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",visibleDomain:void 0,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,visibleDomain:void 0}}};Ko.className="AngleNumberAxis",Ko.type="angle-number",d([zn],Ko.prototype,"min",2),d([zn],Ko.prototype,"max",2),d([zn],Ko.prototype,"preferredMin",2),d([zn],Ko.prototype,"preferredMax",2),d([zn],Ko.prototype,"interval",2);var jm={type:"axis",name:"angle-number",chartType:"polar",enterprise:!0,version:c0,options:h0.angleNumberAxisOptionsDefs,themeTemplate:{label:{spacing:5},gridLine:{enabled:!1}},create:e=>new Ko(e)};import{VERSION as f0,_ModuleSupport as x0}from"ag-charts-community";import{_ModuleSupport as $m}from"ag-charts-community";import{Property as S0,dateTruncationForDomain as b0,intervalEpoch as Um,intervalMilliseconds as Ym,intervalStep as Xm,intervalUnit as Zm,lowestGranularityUnitForTicks as v0,lowestGranularityUnitForValue as M0}from"ag-charts-core";var{OrdinalTimeScale:D0,ApproximateOrdinalTimeScale:k0,APPROXIMATE_THRESHOLD:I0,TimeAxisParentLevel:A0,minimumTimeAxisDatumGranularity:N0}=$m,Xr=class extends $m.DiscreteTimeAxis{constructor(e){const t=new D0;super(e,t),this.parentLevel=new A0,this.accurateScale=t,this.approximateScale=new k0,this.approximateScale.setSourceScale(t),Object.defineProperty(this,"scale",{get:()=>this.getActiveScale(),configurable:!0})}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}getActiveScale(){const e=this.accurateScale.bandCount(this.visibleRange);return(this.accurateScale.getUniformityCache(this.visibleRange)?.isUniform??!1)&&e>=I0?this.approximateScale:this.accurateScale}processData(){super.processData();const{boundSeries:e,direction:t}=this;this.minimumTimeGranularity=N0(e,t,void 0,void 0)}tickFormatParams(e,t,i,o){o??(o=v0(t));const s=b0(e),a=Zm(o),n=Xm(o),r=Um(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,f=M0(e);x!=null&&Ym(x)new Xr(e)};import{VERSION as L0,_ModuleSupport as T0}from"ag-charts-community";import{_ModuleSupport as w0}from"ag-charts-community";import{Property as jh,ProxyPropertyOnWrite as Qm}from"ag-charts-core";import{_ModuleSupport as Zr}from"ag-charts-community";import{ChartAxisDirection as C0,Property as $h,ZIndexMap as O0,isNumberEqual as E0,normalizeAngle360 as qm,toRadians as P0}from"ag-charts-core";import{_ModuleSupport as Jm}from"ag-charts-community";import{ChartAxisDirection as R0,Property as _0,clamp as ey,isNumberEqual as z0,normalizeAngle360FromDegrees as B0}from"ag-charts-core";var{validateCrossLineValue:V0,Group:F0,Path:H0,Sector:K0,RotatableText:W0}=Jm,ty=class extends Na{constructor(){super(...arguments),this.positionAngle=void 0}};d([_0],ty.prototype,"positionAngle",2);var Uh=class extends ft{constructor(){super(),this.direction=R0.Radius,this.label=new ty,this.polygonNode=new H0,this.sectorNode=new K0,this.crossLineRange=new F0,this.labelNode=new W0,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||!V0(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=ey(t,n+l,i),h=ey(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=B0((i.positionAngle??0)-90),l=(z0(r,0)||r>0)&&rthis.tickFormatter(...b),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:u,rawTicks:p,rawTickCount:g,tickDomain:m,fractionDigits:y,niceDomain:x=e}=h,f=u.map(b=>this.getTickLabelProps(b,c));return this.generatedTicks={ticks:u,labels:f},{ticks:p,tickDomain:m,niceDomain:x,rawTickCount:g,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=Zr.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=(p,g)=>{const{stroke:m,lineDash:y}=e[g%s];p.stroke=m,p.strokeWidth=t,p.lineDash=y,p.fill=void 0},[n,r]=this.gridRange??[0,2*Math.PI],l=E0(r-n,2*Math.PI),u=i==="circle"?(p,g)=>{const{path:m}=p;m.clear(!0);const y=this.getTickRadius(g);l?(m.moveTo(y,0),m.arc(0,0,y,0,2*Math.PI)):(m.moveTo(y*Math.cos(n),y*Math.sin(n)),m.arc(0,0,y,qm(n),qm(r))),l&&m.closePath()}:(p,g)=>{const{path:m}=p,y=this.gridAngles;if(m.clear(!0),!y||y.length<3)return;const x=this.getTickRadius(g);for(const[f,b]of y.entries()){const S=x*Math.cos(b),v=x*Math.sin(b);f===0?m.moveTo(S,v):m.lineTo(S,v);for(const[M,D]of y.entries()){const I=x*Math.cos(D),A=x*Math.sin(D);M===0?m.moveTo(I,A):m.lineTo(I,A)}m.closePath()}m.closePath()};this.gridPathSelection.each((p,g,m)=>{a(p,m),u(p,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,t.caption.truncate=t.truncate,t.caption.maxWidth=t.maxWidth,t.caption.maxHeight=t.maxHeight;let s=!1;const a=t.caption.node;if(t.enabled){const n=Math.abs(i[1]-i[0]);s=!0,a.rotation=Math.PI/2,a.x=Math.floor((i[0]+i[1])/2),a.y=-t.spacing,a.textAlign="center",a.textBaseline="bottom",a.text=this.cachedCallWithContext(o,this.getTitleFormatterParams(this.scale.domain)),t.caption.text=a.text,t.caption.computeTextWrap(n,1/0)}a.visible=s}updateCrossLines(){for(const e of this.crossLines)if(e instanceof Uh){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 Yh}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!=="";return{...this.getLabelStyles({value:e.tick,formattedValue:e.tickLabel}),tickId:e.tickId,rotation:o,text:r,textAlign:a,textBaseline:s,visible:h,x:c,y:e.translation,rotationCenterX:c,rotationCenterY:e.translation,range:n}}};Qr.CrossLineConstructor=Uh,d([$h],Qr.prototype,"positionAngle",2);var{CategoryScale:ay}=w0,Ps=class extends Qr{constructor(e){super(e,new ay),this.shape="circle",this.groupPaddingInner=0,this.paddingInner=0,this.paddingOuter=0}hasDefinedDomain(){return!1}normaliseDataDomain(e){return{domain:e.domain,clipped:!1}}prepareGridPathTickData(e){return e.slice().reverse()}getTickRadius(e){const{scale:t,innerRadiusRatio:i}=this,o=t.range[0],s=o*i;if(ay.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}}};Ps.className="RadiusCategoryAxis",Ps.type="radius-category",d([jh],Ps.prototype,"groupPaddingInner",2),d([Qm("scale","paddingInner"),jh],Ps.prototype,"paddingInner",2),d([Qm("scale","paddingOuter"),jh],Ps.prototype,"paddingOuter",2);var ny={type:"axis",name:"radius-category",chartType:"polar",enterprise:!0,version:L0,options:T0.radiusCategoryAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},label:{minSpacing:5}},create:e=>new Ps(e)};import{VERSION as Y0,_ModuleSupport as X0}from"ag-charts-community";import{_ModuleSupport as Z0}from"ag-charts-community";import{Property as qr,normalisedExtentWithMetadata as Q0}from"ag-charts-core";var{LinearScale:q0}=Z0,Rs=class extends Qr{constructor(e){super(e,new q0),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,preferredMin:o,preferredMax:s}=this,{extent:a,clipped:n}=Q0(e.domain,t,i,o,s,void 0,e.sortMetadata?.sortOrder);return{domain:a,clipped:n}}getDomainExtentsNice(){return[this.min==null&&this.nice,this.max==null&&this.nice]}tickFormatParams(e,t,i){return{type:"number",visibleDomain:void 0,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,visibleDomain:void 0}}};Rs.className="RadiusNumberAxis",Rs.type="radius-number",d([qr],Rs.prototype,"min",2),d([qr],Rs.prototype,"max",2),d([qr],Rs.prototype,"preferredMin",2),d([qr],Rs.prototype,"preferredMax",2);var ry={type:"axis",name:"radius-number",chartType:"polar",enterprise:!0,version:Y0,options:X0.radiusNumberAxisOptionsDefs,themeTemplate:{positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0},label:{minSpacing:5}},create:e=>new Rs(e)};import{VERSION as J0}from"ag-charts-community";import{boolean as eN,positiveNumber as ly,undocumented as tN}from"ag-charts-core";import"ag-charts-community";import{AbstractModuleInstance as iN,ObserveChanges as Xh,Property as Zh}from"ag-charts-core";var Jr=class extends iN{constructor(e){super(),this.ctx=e,this.enabled=!0,e.animationManager.skip(!1),this.cleanup.register(()=>e.animationManager.skip(!0))}};d([Xh((e,t)=>{e.ctx.animationManager.skip(!t)}),Zh],Jr.prototype,"enabled",2),d([Xh((e,t)=>{t!=null&&(e.ctx.animationManager.defaultDuration=t)}),Zh],Jr.prototype,"duration",2),d([Xh((e,t)=>{e.ctx.animationManager.maxAnimatableItems=t??1/0}),Zh],Jr.prototype,"maxAnimatableItems",2);var Bn={type:"plugin",name:"animation",enterprise:!0,version:J0,options:{enabled:eN,duration:ly},themeTemplate:{enabled:{$if:[{$path:["../flashOnUpdate/enabled",!1]},!1,!0]}},create:e=>new Jr(e)};Bn.options.maxAnimatableItems=tN(ly);import{VERSION as oN,_ModuleSupport as sN}from"ag-charts-community";import"ag-charts-core";import{_ModuleSupport as aN}from"ag-charts-community";import{AbstractModuleInstance as nN}from"ag-charts-core";var cy=class Wr extends nN{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 aN.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=0)=>{if(this.firstLayoutSection!=null&&this.firstLayoutSection!==t&&this.activeSections.has(this.firstLayoutSection))return;this.firstLayoutSection=t;const n=i.getBounds().width,{isRtl:r}=this.ctx.domManager;i.setBounds({x:r?s.x+s.width-n:s.x,y:s.y,width:n}),s.shrink(n+i.horizontalSpacing+a,r?"right":"left")},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=Wr.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 Wr.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 Wr.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 Wr.SECTION_ORDER){if(s===t)return i>=o+this.sectionButtons[t].length?-1:i-o;o+=this.sectionButtons[s].length}return-1}};cy.SECTION_ORDER=["chartToolbar","annotations"];var hy=cy;import{_ModuleSupport as el}from"ag-charts-community";import{AbstractModuleInstance as rN,ChartAxisDirection as Qh,ChartUpdateType as lN,ObserveChanges as cN,PropertiesArray as hN,Property as Vn,Vec2 as _s,isValidDate as qh}from"ag-charts-core";import{_ModuleSupport as dN}from"ag-charts-community";import{CleanupRegistry as uN,attachListener as pN,ceilTo as gN,focusCursorAtEnd as mN,setAttributes as yN}from"ag-charts-core";var fN='
',dy="text-input",uy="canvas-overlay",xN=class{constructor(e){this.ctx=e,this.cleanup=new uN,this.layout={getTextInputCoords:()=>({x:0,y:0}),getTextPosition:()=>"center",alignment:"center",textAlign:"center"},this.visible=!1,this.element=e.domManager.addChild(uy,dy),this.element.classList.add("ag-charts-text-input"),this.cleanup.register(()=>e.domManager.removeChild(uy,dy))}setKeyDownHandler(e){this.cleanup.register(pN(this.element,"keydown",e))}show(e){this.element.innerHTML=fN;const t=this.element.firstElementChild;yN(t,{role:"textbox","data-preventdefault":!1}),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",mN(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 u=a();let p=c.y;u==="center"?p-=l.height/2:u==="bottom"&&(p-=l.height),e.style.setProperty("top",`${p}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 dN.BBox(e,t,gN(i,2),o)}destroy(){this.cleanup.flush()}};import{BaseProperties as SN,Property as py}from"ag-charts-core";var Jh=class extends SN{constructor(){super(...arguments),this.enabled=!1,this.axes="y"}};d([py],Jh.prototype,"enabled",2),d([py],Jh.prototype,"axes",2);import"ag-charts-community";import{deepClone as pi}from"ag-charts-core";var ed=(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))(ed||{}),bN=Object.values(ed);function vN(e){for(const t of bN)if(t===e)return t}import{isObject as MN}from"ag-charts-core";import{Color as gy,Property as DN,isObject as kN}from"ag-charts-core";import"ag-charts-community";import{BaseProperties as Wo,FONT_SIZE as IN,Property as Y,generateUUID as AN}from"ag-charts-core";var Fn=class extends Wo{};d([Y],Fn.prototype,"x",2),d([Y],Fn.prototype,"y",2);var NN=class extends xt(mo(xy(Wo))){},td=class extends xt(mo(Ki(sd(Vs(Wo))))){constructor(){super(...arguments),this.cornerRadius=2}};d([Y],td.prototype,"enabled",2),d([Y],td.prototype,"cornerRadius",2);var LN=class extends Ki(Wo){},TN=class extends xt(mo(Ki(Wo))){},zs=class extends Vs(Wo){constructor(){super(...arguments),this.label="",this.position="top",this.alignment="left"}};d([Y],zs.prototype,"label",2),d([Y],zs.prototype,"position",2),d([Y],zs.prototype,"alignment",2);var wN=class extends Vs(Wo){},Hn=class extends Vs(Wo){constructor(){super(...arguments),this.label=""}};d([Y],Hn.prototype,"label",2),d([Y],Hn.prototype,"position",2),d([Y],Hn.prototype,"alignment",2);function Bs(e){class t extends ON(xy(e)){constructor(){super(...arguments),this.id=AN()}}return t}function id(e){class t extends e{constructor(){super(...arguments),this.start=new Fn,this.end=new Fn}}return d([Y],t.prototype,"start",2),d([Y],t.prototype,"end",2),t}function my(e){class t extends e{}return d([Y],t.prototype,"x",2),d([Y],t.prototype,"y",2),t}function yy(e){class t extends e{}return d([Y],t.prototype,"value",2),t}function od(e){class t extends e{constructor(){super(...arguments),this.background=new LN}}return d([Y],t.prototype,"background",2),t}function Go(e){class t extends e{constructor(){super(...arguments),this.handle=new TN}}return d([Y],t.prototype,"handle",2),t}function fy(e){class t extends e{constructor(){super(...arguments),this.axisLabel=new td}}return d([Y],t.prototype,"axisLabel",2),t}function sd(e){class t extends e{constructor(){super(...arguments),this.padding=void 0,this.textAlign="center",this.formatter=void 0}}return d([Y],t.prototype,"padding",2),d([Y],t.prototype,"textAlign",2),d([Y],t.prototype,"formatter",2),t}function CN(e){class t extends e{}return t}function ad(e){class t extends e{}return d([Y],t.prototype,"extendStart",2),d([Y],t.prototype,"extendEnd",2),t}function ON(e){class t extends e{isWriteable(){return!this.locked&&!this.readOnly}isHoverable(){return!this.readOnly}}return d([Y],t.prototype,"locked",2),d([Y],t.prototype,"readOnly",2),t}function nd(e){class t extends e{setLocaleManager(o){this.localeManager??(this.localeManager=o)}}return t}function xy(e){class t extends e{}return d([Y],t.prototype,"visible",2),t}function Ki(e){class t extends e{}return d([Y],t.prototype,"fill",2),d([Y],t.prototype,"fillOpacity",2),t}function xt(e){class t extends e{}return d([Y],t.prototype,"stroke",2),d([Y],t.prototype,"strokeOpacity",2),d([Y],t.prototype,"strokeWidth",2),t}function mo(e){class t extends e{constructor(){super(...arguments),this.lineCap=void 0,this.computedLineDash=void 0}}return d([Y],t.prototype,"lineDash",2),d([Y],t.prototype,"lineDashOffset",2),d([Y],t.prototype,"lineStyle",2),t}function Vs(e){class t extends e{constructor(){super(...arguments),this.fontSize=IN.SMALL,this.fontFamily="Verdana, sans-serif"}}return d([Y],t.prototype,"fontStyle",2),d([Y],t.prototype,"fontWeight",2),d([Y],t.prototype,"fontSize",2),d([Y],t.prototype,"fontFamily",2),d([Y],t.prototype,"color",2),t}import{Property as EN}from"ag-charts-core";import{isDate as PN,isNumber as RN,isString as _N}from"ag-charts-core";function Sy(e){return RN(e)||_N(e)||PN(e)?{value:e,groupPercentage:0}:e??{value:void 0,groupPercentage:0}}function Ke(e){return Sy(e)?.value}function At(e,t){if(e.start==null||e.end==null)return;const i=Se(e.start,t),o=Se(e.end,t);if(!(i==null||o==null))return{x1:i.x,y1:i.y,x2:o.x,y2:o.y}}function Se(e,t){const i=yo(e.x,t.xAxis),o=yo(e.y,t.yAxis);return{x:i,y:o}}function yo(e,t){if(e==null)return 0;const{value:i,groupPercentage:o}=Sy(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 Nt(e,t){const i=tl(e.x,t.xAxis),o=tl(e.y,t.yAxis);return{x:i,y:o}}function tl(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{BaseProperties as zN}from"ag-charts-core";var rd=class extends Bs(id(Go(zN))){constructor(){super(...arguments),this.snapToAngle=45}getDefaultColor(e){}getDefaultOpacity(e){}},by=class extends nd(sd(Vs(rd))){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 Se(this.end,e)}getTextPosition(){return this.position}};d([EN],by.prototype,"text",2);var BN={top:6,right:12,bottom:9,left:12},Ti=class extends Ki(xt(by)){constructor(){super(...arguments),this.type="callout",this.position="bottom",this.alignment="left"}static is(e){return kN(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}=gy.fromString(this.color??"#888888");return new gy(e,t,i,.66).toString()}getPadding(){const{padding:e}=this;return e==null?{...BN}:{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([DN],Ti.prototype,"type",2);import{Color as vy,Property as VN,isObject as FN}from"ag-charts-core";import{BaseProperties as HN,Property as KN}from"ag-charts-core";var il=class extends Bs(my(Go(sd(Vs(HN))))){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 Se(this,e)}getTextPosition(){return this.position}};d([KN],il.prototype,"text",2);var ol={top:8,right:14,bottom:8,left:14},Wi=class extends Ki(xt(il)){constructor(){super(...arguments),this.type="comment",this.position="bottom",this.alignment="left"}static is(e){return FN(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}=vy.fromString(this.color??"#888888");return new vy(e,t,i,.66).toString()}getPadding(){const{padding:e,fontSize:t}=this;return e==null?{top:Math.max(t*.4,ol.top),bottom:Math.max(t*.4,ol.bottom),left:Math.max(t*.8,ol.left),right:Math.max(t*.8,ol.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([VN],Wi.prototype,"type",2);import"ag-charts-community";import{BaseProperties as ld,Property as zt,isObject as sl}from"ag-charts-core";import{Vec2 as Fs}from"ag-charts-core";function Kn(e,t){return e?"dashed":t??"solid"}function My(e,t){switch(t){case"solid":return[];case"dashed":return[e*4,e*2];case"dotted":return[0,e*2]}}function La(e,t,i,o){const s=Kn(e,i);return t??e??My(o??1,s)}function Ta(e,t,i){const o=Kn(t,i);return e??o==="dotted"?"round":void 0}function WN(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 zs}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 La(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ta(this.lineCap,this.lineDash,this.lineStyle)}};d([zt],wa.prototype,"statistics",2),d([zt],wa.prototype,"text",2);function dd(e){class t extends e{constructor(){super(...arguments),this.hasDateRange=!0}}return t}function ud(e){class t extends e{constructor(){super(...arguments),this.hasPriceRange=!0}}return t}var gi=class extends dd(wa){constructor(){super(...arguments),this.type="date-range",this.direction="horizontal"}static is(e){return sl(e)&&e.type==="date-range"}};d([zt],gi.prototype,"type",2),d([zt],gi.prototype,"extendAbove",2),d([zt],gi.prototype,"extendBelow",2);var mi=class extends ud(wa){constructor(){super(...arguments),this.type="price-range",this.direction="vertical"}static is(e){return sl(e)&&e.type==="price-range"}};d([zt],mi.prototype,"type",2),d([zt],mi.prototype,"extendLeft",2),d([zt],mi.prototype,"extendRight",2);var fo=class extends dd(ud(wa)){constructor(){super(...arguments),this.type="date-price-range",this.direction="both"}static is(e){return sl(e)&&e.type==="date-price-range"}};d([zt],fo.prototype,"type",2);var Zt=class extends dd(ud(wa)){constructor(){super(...arguments),this.type="quick-date-price-range",this.up=new hd,this.down=new hd,this.direction="both"}static is(e){return sl(e)&&e.type==="quick-date-price-range"}};d([zt],Zt.prototype,"type",2),d([zt],Zt.prototype,"up",2),d([zt],Zt.prototype,"down",2);import{BaseProperties as jN,Property as Dy,clamp as $N,isObject as UN}from"ag-charts-core";import{_ModuleSupport as YN}from"ag-charts-community";import{cachedTextMeasurer as XN,calcLineHeight as ky,wrapText as ZN}from"ag-charts-core";var{BBox:QN}=YN,al=1.38;function nl(e,t,i){return i?ZN(t,{maxWidth:i,font:e,textWrap:"always",avoidOrphans:!1}):t}function qN(e,t){const{lineMetrics:i,width:o}=XN(e).measureLines(t),s=i.length*ky(e.fontSize,al);return{width:o,height:s}}function pd(e,t,i,o){let s=o?.width??0,a=o?.height??0;if(!o){const n=e.width==null?t:nl(e,t,e.width);({width:s,height:a}=qN(e,n))}return new QN(i.x,i.y,s,a)}function Iy(e,t,i,o,{x:s,y:a},n){const{visible:r=!0,fontFamily:l,fontSize:c=14,fontStyle:h,fontWeight:u,textAlign:p}=o,g=ky(c,al);n??(n=o.position=="center"?"middle":o.position);const m=i?o.getPlaceholderColor():o.color;e.setProperties({x:s,y:a,visible:r,text:t,fill:m,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:u,textAlign:p,lineHeight:g,textBaseline:n})}var JN=10,eL=11,Ay=20,tL=22,iL=10,Ny=Ay+iL,Ly=34,oL=class extends Ki(xt(jN)){},Bt=class extends Ki(xt(il)){constructor(){super(...arguments),this.type="note",this.background=new oL,this.position="bottom",this.alignment="center",this.width=200}static is(e){return UN(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??JN;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=pd(this,o,s);n.x=$N(i/2,n.x,e.seriesRect.width-i/2);const r=n.y-Ny-a*2,l=n.y+eL+a*2,c=Math.max(n.height,t);return r-c-Ly<0?(n.y=l,this.position="top"):(n.y=r+a,this.position="bottom"),{x:n.x,y:n.y}}isHoverable(){return!0}};d([Dy],Bt.prototype,"type",2),d([Dy],Bt.prototype,"background",2);import{BaseProperties as sL}from"ag-charts-core";var aL=class extends Bs(my(Go(sL))){getDefaultColor(e){}getDefaultOpacity(e){}},gd=class aA extends Ki(aL){constructor(){super(...arguments),this.size=32}static is(t){return t instanceof aA}getDefaultColor(t){return t==="fill-color"?this.fill:void 0}getDefaultOpacity(t){return t==="fill-color"?this.fillOpacity:void 0}};import"ag-charts-community";import{BaseProperties as Ty,Property as rl,isObject as wy}from"ag-charts-core";var St=class extends Bs(yy(Go(fy(xt(mo(Ty)))))){constructor(){super(...arguments),this.direction="horizontal",this.type="horizontal-line",this.text=new zs}static is(e){return wy(e)&&e.type==="horizontal-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return La(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ta(this.lineCap,this.lineDash,this.lineStyle)}};d([rl],St.prototype,"type",2),d([rl],St.prototype,"text",2);var Gi=class extends Bs(yy(Go(fy(xt(mo(Ty)))))){constructor(){super(...arguments),this.direction="vertical",this.type="vertical-line",this.text=new zs}static is(e){return wy(e)&&e.type==="vertical-line"}getDefaultColor(){return this.stroke}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return La(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ta(this.lineCap,this.lineDash,this.lineStyle)}};d([rl],Gi.prototype,"type",2),d([rl],Gi.prototype,"text",2);import"ag-charts-community";import{BaseProperties as nL,Logger as rL,Property as ll,isObject as lL}from"ag-charts-core";var yi=class extends Bs(od(id(Go(ad(xt(mo(nL))))))){constructor(){super(...arguments),this.type="disjoint-channel",this.text=new Hn,this.snapToAngle=45}static is(e){return lL(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):rL.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 La(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ta(this.lineCap,this.lineDash,this.lineStyle)}};d([ll],yi.prototype,"type",2),d([ll],yi.prototype,"startHeight",2),d([ll],yi.prototype,"endHeight",2),d([ll],yi.prototype,"text",2);import{Property as Cy,isObject as cL}from"ag-charts-core";import{Property as Hs}from"ag-charts-core";import"ag-charts-community";import{Property as md,isObject as Oy}from"ag-charts-core";var cl=class extends nd(CN(ad(xt(mo(rd))))){constructor(){super(...arguments),this.text=new zs}getDefaultColor(e){switch(e){case"line-color":return this.stroke;case"text-color":return this.text.color}}getDefaultOpacity(){return this.strokeOpacity}getLineDash(){return La(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ta(this.lineCap,this.lineDash,this.lineStyle)}};d([md],cl.prototype,"text",2);var xo=class extends cl{constructor(){super(...arguments),this.type="arrow",this.endCap="arrow"}static is(e){return Oy(e)&&e.type==="arrow"}};d([md],xo.prototype,"type",2);var So=class extends cl{constructor(){super(...arguments),this.type="line"}static is(e){return Oy(e)&&e.type==="line"}};d([md],So.prototype,"type",2);var bo=class extends cl{constructor(){super(...arguments),this.label=new wN,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([Hs],bo.prototype,"label",2),d([Hs],bo.prototype,"reverse",2),d([Hs],bo.prototype,"showFill",2),d([Hs],bo.prototype,"isMultiColor",2),d([Hs],bo.prototype,"strokes",2),d([Hs],bo.prototype,"rangeStroke",2),d([Hs],bo.prototype,"bands",2);var ji=class extends bo{constructor(){super(...arguments),this.type="fibonacci-retracement-trend-based",this.endRetracement=new Fn}static is(e){return cL(e)&&e.type==="fibonacci-retracement-trend-based"}};d([Cy],ji.prototype,"type",2),d([Cy],ji.prototype,"endRetracement",2);import{Property as hL,isObject as dL}from"ag-charts-core";var vo=class extends bo{constructor(){super(...arguments),this.type="fibonacci-retracement"}static is(e){return dL(e)&&e.type==="fibonacci-retracement"}};d([hL],vo.prototype,"type",2);import"ag-charts-community";import{BaseProperties as uL,Logger as pL,Property as hl,isObject as gL}from"ag-charts-core";var fi=class extends Bs(od(id(Go(ad(xt(mo(uL))))))){constructor(){super(...arguments),this.type="parallel-channel",this.middle=new NN,this.text=new Hn,this.snapToAngle=45}static is(e){return gL(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):pL.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 La(this.lineDash,this.computedLineDash,this.lineStyle,this.strokeWidth)}getLineCap(){return Ta(this.lineCap,this.lineDash,this.lineStyle)}};d([hl],fi.prototype,"type",2),d([hl],fi.prototype,"height",2),d([hl],fi.prototype,"middle",2),d([hl],fi.prototype,"text",2);import{Property as mL,isObject as yL}from"ag-charts-core";var Mo=class extends il{constructor(){super(...arguments),this.type="text",this.position="bottom"}static is(e){return yL(e)&&e.type==="text"}};d([mL],Mo.prototype,"type",2);function jo(e){return Zt.is(e)}function dl(e){return So.is(e)||St.is(e)||Gi.is(e)||xo.is(e)||Ey(e)}function Do(e){return yi.is(e)||fi.is(e)}function Ey(e){return vo.is(e)||ji.is(e)}function $i(e){return Ti.is(e)||Wi.is(e)||Bt.is(e)||Mo.is(e)}function Wn(e){return gi.is(e)||mi.is(e)||fo.is(e)||Zt.is(e)}function yd(e){return $i(e)&&!Bt.is(e)}function $o(e){return dl(e)||Do(e)||Wn(e)&&!Zt.is(e)}function fL(e){return dl(e)||Do(e)||Wn(e)||Ti.is(e)||Bt.is(e)}function xL(e){return Bt.is(e)}function SL(e){return Do(e)||Wn(e)||Ti.is(e)||Wi.is(e)||gd.is(e)}function bL(e){return $i(e)&&!Bt.is(e)}function Ca(e){return(dl(e)||Do(e)||Wn(e))&&!jo(e)&&MN(e.text)}function vL(e,t){"fontSize"in e&&(e.fontSize=t),Ca(e)&&(e.text.fontSize=t)}function Py(e,t){const i=t?.strokeWidth??e.strokeWidth??1,o=t?.type??e.lineStyle,s=o??Kn(e.lineDash,o),a=My(i,s);e.strokeWidth=i,e.computedLineDash=a,e.lineStyle=s,e.lineCap=s==="dotted"?"round":void 0}function ul(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&&xL(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),Ca(e)&&(e.text.color=o);break}}}var ML=class{constructor(){this.mementoOriginatorKey="annotation-defaults",this.colors=new Map(Object.values(ed).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:pi(this.colors),fontSizes:pi(this.fontSizes),lineStyles:pi(this.lineStyles),lineTextAlignments:pi(this.lineTextAlignments),lineTextPositions:pi(this.lineTextPositions),fibonacciOptions:pi(this.fibonacciOptions)}}guardMemento(e){return!0}restoreMemento(e,t,i){this.colors=pi(i.colors),this.fontSizes=pi(i.fontSizes),this.lineStyles=pi(i.lineStyles),this.lineTextAlignments=pi(i.lineTextAlignments),this.lineTextPositions=pi(i.lineTextPositions),this.fibonacciOptions=pi(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&&ul(e,o,s,a,n,r);for(const[t,i]of this.fontSizes)e.type!==t||i==null||vL(e,i);for(const[t,i]of this.lineStyles)e.type!==t||i==null||Py(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 DL}from"ag-charts-community";import{BaseProperties as kL,CleanupRegistry as IL,Color as Ry,EventEmitter as AL,PropertiesArray as NL,Property as Ks}from"ag-charts-core";import{_ModuleSupport as LL}from"ag-charts-community";import{Color as fd,clamp as pl}from"ag-charts-core";var TL='
',_y=e=>{try{const t=fd.fromString(e),[i,o,s]=t.toHSB();return[i,o,s,t.a]}catch{return}},zy=class extends LL.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]=_y(e.color??"#f00")??[0,1,.5,1];n=e.opacity??n;const r=this.ctx.agDocument,l=r.createElement("div","ag-charts-color-picker__content");l.innerHTML=TL,l.ariaLabel=this.ctx.localeManager.t("ariaLabelColorPicker");const c=l.querySelector(".ag-charts-color-picker__palette"),h=l.querySelector(".ag-charts-color-picker__hue-input"),u=l.querySelector(".ag-charts-color-picker__multi-color-button"),p=l.querySelector(".ag-charts-color-picker__alpha-input"),g=l.querySelector(".ag-charts-color-picker__color-input"),m=l.querySelector(".ag-charts-color-picker__color-label"),y=v=>{const M={s:"ariaValueColorPalette",v:"ariaValueColorPaletteFirstV"}[v];c.ariaValueText=t.t(M,{s,v:a})};this.i18nUpdater=()=>{c.ariaRoleDescription=t.t("ariaRoleDescription2DSlider"),c.ariaLabel=t.t("ariaLabelColorPickerPalette"),h.ariaLabel=t.t("ariaLabelColorPickerHue"),u.ariaLabel=t.t("ariaLabelColorPickerMultiColor"),p.ariaLabel=t.t("ariaLabelColorPickerAlpha"),g.ariaLabel=t.t("ariaLabelColor"),y("s")},this.i18nUpdater(),u.classList.toggle("ag-charts-color-picker__multi-color-button--hidden",!e.hasMultiColorOption);const x=(v=!0)=>{const D=fd.fromHSB(o,s,a,n).toHexString();if(l.style.setProperty("--h",`${o}`),l.style.setProperty("--s",`${s}`),l.style.setProperty("--v",`${a}`),l.style.setProperty("--a",`${n}`),l.style.setProperty("--color",D.slice(0,7)),l.style.setProperty("--color-a",D),h.value=`${o}`,p.value=`${n}`,p.classList.toggle("ag-charts-color-picker__alpha-input--opaque",n===1),u.classList.toggle("ag-charts-color-picker__multi-color-button--active",i),m.classList.toggle("ag-charts-color-picker__color-label--multi-color",i),document.activeElement!==g&&(u.ariaChecked=i.toString(),g.value=i?t.t("ariaLabelColorPickerMultiColor"):D.toUpperCase()),v||e.color==null){const I=fd.fromHSB(o,s,a,1).toHexString();e.onChange?.(D,I,n,i)}v&&(this.hasChanged=!0)};x(!1);const f=v=>v.preventDefault(),b=v=>v.stopPropagation(),S=v=>{v.preventDefault();const M=v.currentTarget;M.focus();const D=M.getBoundingClientRect(),I=({clientX:k,clientY:N})=>{i=!1,s=Math.min(Math.max((k-D.left)/D.width,0),1),a=1-Math.min(Math.max((N-D.top)/D.height,0),1),x(),y("s")};I(v);const A=r.attachListener("pointermove",I);r.attachListener("pointerup",()=>A(),{once:!0})};return l.addEventListener("mousedown",b),l.addEventListener("touchstart",b),l.addEventListener("touchmove",b),l.addEventListener("keydown",v=>{switch(v.stopPropagation(),v.key){case"Enter":case"Escape":this.hide();break;default:return}v.preventDefault()}),c.addEventListener("pointerdown",S),c.addEventListener("touchstart",f,{passive:!1}),c.addEventListener("touchmove",f,{passive:!1}),c.addEventListener("keydown",v=>{if(v.key==="ArrowLeft")s=pl(0,s-.01,1),y("s");else if(v.key==="ArrowRight")s=pl(0,s+.01,1),y("s");else if(v.key==="ArrowUp")a=pl(0,a+.01,1),y("v");else if(v.key==="ArrowDown")a=pl(0,a-.01,1),y("v");else return;v.preventDefault(),x()}),c.addEventListener("focus",()=>{y("s")}),u.addEventListener("click",()=>{i=!i,x()}),h.addEventListener("input",v=>{i=!1,o=v.currentTarget.valueAsNumber??0,x()}),p.addEventListener("input",v=>{i=!1,n=v.currentTarget.valueAsNumber??0,x()}),g.addEventListener("input",v=>{i=!1;const M=_y(v.currentTarget.value);M!=null&&([o,s,a,n]=M,x())}),g.addEventListener("blur",()=>x()),g.addEventListener("keydown",v=>{v.key==="Enter"&&(v.currentTarget.blur(),x())}),{element:l,initialFocus:c}}};import{BaseProperties as wL,Property as Gn}from"ag-charts-core";var Ui=class extends wL{};d([Gn],Ui.prototype,"icon",2),d([Gn],Ui.prototype,"iconPosition",2),d([Gn],Ui.prototype,"label",2),d([Gn],Ui.prototype,"ariaLabel",2),d([Gn],Ui.prototype,"tooltip",2);import{_ModuleSupport as By}from"ag-charts-community";function Vy(e){return!(e instanceof By.LogScale)&&!(e instanceof By.BandScale)}var CL=[{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:Vy},{label:"toolbarAnnotationsDisjointChannel",icon:"disjoint-channel-drawing",value:"disjoint-channel",visible:Vy}],OL=[{label:"toolbarAnnotationsFibonacciRetracement",icon:"fibonacci-retracement-drawing",value:"fibonacci-retracement"},{label:"toolbarAnnotationsFibonacciRetracementTrendBased",icon:"fibonacci-retracement-trend-based-drawing",value:"fibonacci-retracement-trend-based"}],EL=[{label:"Fibonacci - Extended",value:10},{label:"Fibonacci - 6 Band",value:6},{label:"Fibonacci - 4 Band",value:4}],PL=[{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"}],RL=[{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"}],_L=[{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"}],Fy=[{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}],jn=[{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}],{FloatingToolbar:zL,Menu:xd,ToolbarButtonWidget:BL}=DL,Oa=class extends Ui{constructor(){super(...arguments),this.checkedOverrides=new Ui}};d([Ks],Oa.prototype,"value",2),d([Ks],Oa.prototype,"checkedOverrides",2),d([Ks],Oa.prototype,"color",2),d([Ks],Oa.prototype,"strokeWidth",2),d([Ks],Oa.prototype,"isMultiColor",2);var VL=class extends BL{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`)}},FL=class extends zL{createButtonWidget(){return new VL(this.localeManager)}},Sd=class extends kL{constructor(e,t){super(),this.ctx=e,this.getActiveDatum=t,this.enabled=!0,this.buttons=new NL(Oa),this.cleanup=new IL,this.events=new AL,this.visibleButtons=[],this.toolbar=new FL(this.ctx,"ariaLabelAnnotationOptionsToolbar","annotation-options"),this.colorPicker=new zy(this.ctx),this.textSizeMenu=new xd(this.ctx,"text-size"),this.lineStyleTypeMenu=new xd(this.ctx,"annotations-line-style-type"),this.lineStrokeWidthMenu=new xd(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":$o(e),"line-stroke-width":$o(e),"line-color":fL(e),"text-color":bL(e),"fill-color":SL(e),"text-size":yd(e),settings:Ca(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}=Ry.fromString(t);t=Ry.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=$o(o)?Kn(o.lineDash,o.lineStyle):void 0;this.lineStyleTypeMenu.show(i,{items:jn,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStyle"),value:s,minWidth:this.lineStyleTypeMenuMinWidth,onPress:a=>this.onLineStyleTypeMenuPress(a,o),class:"ag-charts-annotations__line-style-type-menu"});break}case"line-stroke-width":{const s=$o(o)?o.strokeWidth:void 0;this.lineStrokeWidthMenu.show(i,{items:Fy,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsLineStrokeWidth"),value:s,minWidth:this.lineStrokeWidthMenuMinWidth,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=$i(o)?o.fontSize:void 0;this.textSizeMenu.show(i,{items:Hy,ariaLabel:this.ctx.localeManager.t("toolbarAnnotationsTextSize"),value:s,minWidth:this.textSizeMenuMinWidth,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.lineStrokeWidthMenuMinWidth=n.width+1,this.lineStrokeWidthMenu.setAnchor(l,c);break}case"line-style-type":{this.lineStyleTypeMenuMinWidth=n.width+1,this.lineStyleTypeMenu.setAnchor(l,c);break}case"text-size":{this.textSizeMenuMinWidth=n.width+1,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(!yd(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(!$o(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(!$o(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));yd(e)&&this.updateFontSize(e.fontSize),this.updateColors(e),this.updateLineStyles(e)}updateLineStyles(e){if(!$o(e))return;const t=e.strokeWidth??1,i=Kn(e.lineDash,e.lineStyle);this.updateStrokeWidth({strokeWidth:t,value:t,label:String(t)}),this.updateLineStyleType(jn.find(o=>o.value===i)??jn[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([Ks],Sd.prototype,"enabled",2),d([Ks],Sd.prototype,"buttons",2);import{Debug as HL,StateMachine as Ky,StateMachineProperty as bd,Vec2 as Wy}from"ag-charts-core";var ze=class extends Ky{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=Wy.lengthSquared(Wy.sub(i,this.dragStart))>0,this.offset=i,this.node?.drag(this.datum,i,o,this.snapping),e.update()},dragEnd:{target:Ky.parent,action:()=>{this.node?.stopDragging(),this.hasMoved&&e.recordAction("Move annotation"),e.update()}}}}),this.debug=HL.create(!0,"annotations"),this.hasMoved=!1,this.snapping=!1}};d([bd()],ze.prototype,"snapping",2),d([bd()],ze.prototype,"datum",2),d([bd()],ze.prototype,"node",2);import{Property as KL,isObject as WL}from"ag-charts-core";var Uo=class extends gd{constructor(){super(...arguments),this.type="arrow-down"}static is(e){return WL(e)&&e.type==="arrow-down"}};d([KL],Uo.prototype,"type",2);import{_ModuleSupport as GL}from"ag-charts-community";import{_ModuleSupport as jL}from"ag-charts-community";import{_ModuleSupport as vd}from"ag-charts-community";import{ZIndexMap as $L,isObject as UL}from"ag-charts-core";import{_ModuleSupport as Md}from"ag-charts-community";import{_ModuleSupport as YL}from"ag-charts-community";var Ea=class extends YL.Marker{isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}},Gy=class nA extends Md.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=nA.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)}};Gy.INACTIVE_STROKE_WIDTH=2;var Yo=Gy,Dd=class rA extends Yo{constructor(){super(),this.handle=new Ea({shape:"circle"}),this.glow=new Ea({shape:"circle"}),this.append([this.handle]),this.handle.size=rA.HANDLE_SIZE,this.handle.strokeWidth=Yo.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2}update(t){this.handle.setProperties({...t,strokeWidth:Yo.INACTIVE_STROKE_WIDTH})}drag(t){return{point:t,offset:{x:0,y:0}}}};Dd.HANDLE_SIZE=7,Dd.GLOW_SIZE=9;var Xo=Dd,gl=class Ut extends Yo{constructor(){super(),this.handle=new Md.Rect,this.glow=new Md.Rect,this.gradient="horizontal",this.append([this.glow,this.handle]),this.handle.cornerRadius=Ut.CORNER_RADIUS,this.handle.width=Ut.HANDLE_SIZE,this.handle.height=Ut.HANDLE_SIZE,this.handle.strokeWidth=Yo.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.cornerRadius=Ut.CORNER_RADIUS,this.glow.width=Ut.GLOW_SIZE,this.glow.height=Ut.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=(Ut.HANDLE_SIZE-Xo.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=Xo.HANDLE_SIZE,this.handle.height=Xo.HANDLE_SIZE,this.glow.width=Xo.GLOW_SIZE,this.glow.height=Xo.GLOW_SIZE}else this.handle.cornerRadius=Ut.CORNER_RADIUS,this.handle.width=Ut.HANDLE_SIZE,this.handle.height=Ut.HANDLE_SIZE,this.glow.width=Ut.GLOW_SIZE,this.glow.height=Ut.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=(Ut.HANDLE_SIZE-Xo.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"}};gl.HANDLE_SIZE=12,gl.GLOW_SIZE=16,gl.CORNER_RADIUS=4;var Pa=gl,kd=class Gr extends Yo{constructor(){super(),this.handle=new Ea({shape:"circle"}),this.glow=new Ea({shape:"circle"}),this.append([this.glow,this.handle]),this.handle.size=Gr.HANDLE_SIZE,this.handle.strokeWidth=Yo.INACTIVE_STROKE_WIDTH,this.handle.zIndex=2,this.glow.size=Gr.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=Xo.HANDLE_SIZE,this.glow.size=Xo.GLOW_SIZE):(this.handle.size=Gr.HANDLE_SIZE,this.glow.size=Gr.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"}};kd.HANDLE_SIZE=11,kd.GLOW_SIZE=17;var be=kd,et=class extends vd.Group{constructor(){super(...arguments),this.name="AnnotationScene",this.zIndex=$L.CHART_ANNOTATION}static isCheck(e,t){return UL(e)&&Object.hasOwn(e,"type")&&e.type===t}toggleHovered(e,t,i){i!==!0&&this.toggleHandles(e||t)}computeBBoxWithoutHandles(){return vd.Transformable.toCanvas(this,vd.Group.computeChildrenBBox(this.excludeChildren({instance:Yo})))}updateNode(e,t,i){if(!i&&t){t.remove();return}return i&&t==null&&(t=new e,this.appendChild(t)),t}};import{Vec2 as XL}from"ag-charts-core";import{_ModuleSupport as ZL}from"ag-charts-community";import{Vec2 as xi,entries as QL,toRadians as qL}from"ag-charts-core";var{ContinuousScale:JL}=ZL;function $n(e,t,i=!1,o,s=1){if(!i)return Nt(e,t);const a=o?Se(o,t):xi.origin();return Nt(ml(e,a,s),t)}function ml(e,t,i){const o=xi.sub(e,t),s=qL(i),a=Math.round(xi.angle(o)/s)*s;return xi.rotate(o,a,t)}function yl(e,t){const i={};for(const[o,s]of QL(e))i[o]=Se(s,t);return i}function ko(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??[]),u=new Set([...c,...h]),p=xi.multiply(t,xi.from(1,-1));for(const f of n)u.has(f)&&(e[f]=xi.add(e[f],h.has(f)?p:t),o.snap&&(e[f]=ml(e[f],o.snap.vectors[f],o.snap.angle))),r.push(s.getRangeOverflow(e[f].x)),l.push(a.getRangeOverflow(e[f].y));const g=(f,b)=>Math.abs(f)-Math.abs(b),m=(f,b,S)=>o.overflowContinuous===0||!JL.is(f)?S.toSorted(g).at(-1)??0:n.length===u.size?S.toSorted(g).at(-o.overflowContinuous-1)??0:S.filter(M=>M!==0).length<=o.overflowContinuous?0:S.filter((M,D)=>M!==0&&Math.abs(M)<=Math.abs(b)&&u.has(n[D])).toSorted(g).at(-1)??0,y=xi.from(m(s.scale,t.x,r),m(a.scale,t.y,l));if(!xi.equal(y,xi.origin()))for(const f of n)u.has(f)&&(e[f]=xi.round(xi.sub(e[f],y),4));const x={};for(const f of n)x[f]=Nt(e[f],i);return x}var jy=class extends et{constructor(){super(...arguments),this.handle=new be,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=Se(e,t);this.updateHandle(e,i),this.anchor=this.updateAnchor(e,i,t)}dragStart(e,t,i){this.dragState={offset:t,...yl({handle:e},i)}}drag(e,t,i){const{dragState:o}=this;if(!e.isWriteable()||!o)return;const{point:s}=ko({point:o.handle},XL.sub(t,o.offset),i);e.x=s.x,e.y=s.y}translate(e,t,i){if(!e.isWriteable())return;const{point:o}=ko({point:Se(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=Se(e,i),s=Nt({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}}},$y=class extends jy{constructor(){super(),this.append([this.handle])}update(e,t){super.update(e,t);const i=Se(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)}},Uy=[[.5,0],[1,.5],[.75,.5],[.75,1],[.25,1],[.25,.5],[0,.5]];function Yy(e){jL.drawMarkerUnitPolygon(e,Uy)}Yy.anchor={x:.5,y:0};var fl=class extends $y{constructor(){super(),this.type="arrow-up",this.shape=new Ea({shape:Yy}),this.append([this.shape])}static is(e){return et.isCheck(e,"arrow-up")}getHandleCoords(e,t){const i=be.HANDLE_SIZE/2,o=super.getHandleCoords(e,t);return o.y-=i,o}},eT=Uy.map(([e,t])=>[e,1-t]);function Xy(e){GL.drawMarkerUnitPolygon(e,eT)}Xy.anchor={x:.5,y:1};var xl=class extends $y{constructor(){super(),this.type="arrow-down",this.shape=new Ea({shape:Xy}),this.append([this.shape])}static is(e){return et.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=be.HANDLE_SIZE/2,o=super.getHandleCoords(e,t);return o.y+=i,o}};import{Debug as tT,StateMachine as Sl,StateMachineProperty as iT}from"ag-charts-core";var Id=class extends Sl{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:Sl.parent,reset:Sl.parent},"waiting-first-render":{render:{target:Sl.parent,action:i}}}),this.debug=tT.create(!0,"annotations")}};d([iT()],Id.prototype,"node",2);var oT=class extends Id{createDatum(){return new Uo}},Zy={type:"arrow-down",datum:Uo,scene:xl,isDatum:Uo.is,translate:(e,t,i,o)=>{Uo.is(t)&&xl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Uo.is(t)&&Uo.is(i)&&xl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Uo.is(t)&&xl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new oT({...e,create:t("arrow-down")}),dragState:e=>new ze(e)};import{Property as sT,isObject as aT}from"ag-charts-core";var Zo=class extends gd{constructor(){super(...arguments),this.type="arrow-up"}static is(e){return aT(e)&&e.type==="arrow-up"}};d([sT],Zo.prototype,"type",2);var nT=class extends Id{createDatum(){return new Zo}},Qy={type:"arrow-up",datum:Zo,scene:fl,isDatum:Zo.is,translate:(e,t,i,o)=>{Zo.is(t)&&fl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Zo.is(t)&&Zo.is(i)&&fl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Zo.is(t)&&fl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new nT({...e,create:t("arrow-up")}),dragState:e=>new ze(e)};import{_ModuleSupport as rT}from"ag-charts-community";import{_ModuleSupport as lT}from"ag-charts-community";import{Vec4 as qy}from"ag-charts-core";import{Vec2 as cT,Vec4 as Jy,entries as hT}from"ag-charts-core";import{Vec2 as dT,Vec4 as ef}from"ag-charts-core";var tf=class extends et{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]=WN(n,a.yAxis.bounds),c=n.x2=n.y2,u=n.x2===n.x1;return s.extendEnd&&(u?n.y2=h?l.y:r.y:(n.x2=c?r.x:l.x,n.y2=c?r.y:l.y)),s.extendStart&&(u?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,...yl({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,dT.sub(t,o.offset),i)}translate(e,t,i){e.isWriteable()&&this.translatePoints(e,Se(e.start,i),Se(e.end,i),t,i)}copy(e,t,i){const o=At(e,i);if(!o)return;const s=this.computeBBoxWithoutHandles(),a={x:-s.width/2,y:-s.height/2};return this.translatePoints(t,ef.start(o),ef.end(o),a,i),t}translatePoints(e,t,i,o,s){const a=this.getTranslatePointsVectors(t,i),n=ko(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}}},Ad=class extends tf{constructor(){super(...arguments),this.start=new be,this.end=new be,this.anchor={x:0,y:0,position:"above"}}update(e,t){const i=At(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 hT(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]:Se(e[n],i)},angle:e.snapToAngle}:void 0,{[s]:l}=ko({[s]:a[s]},cT.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"?Jy.start(t):Jy.end(t)}getHandleStyles(e,t){return{fill:e.handle.fill,stroke:e.handle.stroke,strokeOpacity:e.handle.strokeOpacity,strokeWidth:e.handle.strokeWidth}}},uT=class extends Ad{constructor(){super(...arguments),this.label=new lT.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=At(e,t);if(i==null)return;const o=this.getTextBBox(e,i);this.updateLabel(e,o,i,t),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 pd(e,i,qy.end(t),this.textInputBBox)}updateLabel(e,t,i,o){const{text:s,isPlaceholder:a}=e.getText(),n=this.getLabelCoords(e,t,i);o.isRtl&&(n.x+=t.width),Iy(this.label,s,a,e,n)}updateShape(e,t,i){}getLabelCoords(e,t,i){return qy.end(i)}getHandleStyles(e,t){return{...super.getHandleStyles(e,t),stroke:e.handle.stroke??e.color}}},{drawCorner:pT,Path:gT}=rT,bl=class extends uT{constructor(){super(),this.type="callout",this.shape=new gT,this.append([this.shape,this.label,this.start,this.end])}static is(e){return et.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),u=8,p=[{coordinates:{x0:s,x1:s+u,y0:l+u,y1:l,cx:h==="topLeft"?i:s+u,cy:h==="topLeft"?o:l+u},type:h==="topLeft"?"calloutCorner":"corner"},{coordinates:{x0:s+u,x1:c-u,y0:l,y1:l,cx:i,cy:o},type:h==="top"?"calloutSide":"side"},{coordinates:{x0:c-u,x1:c,y0:l,y1:l+u,cx:h==="topRight"?i:c-u,cy:h==="topRight"?o:l+u},type:h==="topRight"?"calloutCorner":"corner"},{coordinates:{x0:c,x1:c,y0:l+u,y1:a-u,cx:i,cy:o},type:h==="right"?"calloutSide":"side"},{coordinates:{x0:c,x1:c-u,y0:a-u,y1:a,cx:h==="bottomRight"?i:c-u,cy:h==="bottomRight"?o:a-u},type:h==="bottomRight"?"calloutCorner":"corner"},{coordinates:{x0:c-u,x1:s+u,y0:a,y1:a,cx:i,cy:o},type:h==="bottom"?"calloutSide":"side"},{coordinates:{x0:s+u,x1:s,y0:a,y1:a-u,cx:h==="bottomLeft"?i:s+u,cy:h==="bottomLeft"?o:a-u},type:h==="bottomLeft"?"calloutCorner":"corner"},{coordinates:{x0:s,x1:s,y0:a-u,y1:l+u,cx:i,cy:o},type:h==="left"?"calloutSide":"side"}],{path:g}=this.shape;g.clear(),g.moveTo(s,l+u);for(const{coordinates:m,type:y}of p)this.drawPath(g,m,u,y);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":{pT(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,u=Math.min(i,s)+Math.abs(i-s)/2;e.lineTo(t,u-6*h),e.lineTo(a,n),e.lineTo(t,u+6*h),e.lineTo(o,s)}else{const h=t>o?-1:1,u=Math.min(t,o)+Math.abs(o-t)/2;e.lineTo(u-6*h,i),e.lineTo(a,n),e.lineTo(u+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:p,end:p,visible:!0}),e.create(g)},i=()=>{const{node:p}=this;p?.toggleActive(!0),p?.toggleHandles({start:!0})},o=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{e.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),e.deselect()},a=p=>{this.node?.setTextInputBBox(p),e.update()},n=({point:p})=>{const{datum:g,node:m}=this;g?.set({end:p}),m?.toggleActive(!0),m?.toggleHandles({end:!1}),e.update()},r=()=>{e.showAnnotationOptions(),this.node?.toggleHandles({end:!0})},l=({colorPickerType:p,colorOpacity:g,color:m,opacity:y,isMultiColor:x})=>{const{datum:f}=this;f&&(p==="text-color"&&e.updateTextInputColor(m),ul(f,p,g,m,y,x),e.update())},c=p=>{const{datum:g,node:m}=this;!g||!m||!$i(g)||(g.fontSize=p,e.updateTextInputFontSize(p),e.update())},h=()=>{e.delete()},u=({textInputValue:p,bbox:g})=>{const{datum:m}=this;if(g!=null&&p!=null&&p.length>0){if(!$i(m))return;const y=nl(m,p,g.width);m?.set({text:y}),e.update(),e.recordAction(`Create ${m?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:wi.parent,reset:wi.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:wi.parent,action:h},cancel:{target:wi.parent,action:h}},edit:{onEnter:o,updateTextInputBBox:a,color:l,fontSize:c,textInput:[{guard:Nd,target:wi.parent,action:h},{guard:Ld,target:wi.parent,action:u}],click:{target:wi.parent,action:u},dragStart:{target:wi.parent,action:u},resize:{target:wi.parent,action:u},onExit:s,cancel:{target:wi.parent,action:h}}}),this.debug=mT.create(!0,"annotations")}};d([of()],Td.prototype,"datum",2),d([of()],Td.prototype,"node",2);var yT=class extends Td{createDatum(){return new Ti}},sf={type:"callout",datum:Ti,scene:bl,isDatum:Ti.is,translate:(e,t,i,o)=>{if(Ti.is(t)&&bl.is(e))return e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Ti.is(t)&&Ti.is(i)&&bl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Ti.is(t)&&bl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new yT({...e,create:t("callout")}),dragState:e=>new ze(e)};import{_ModuleSupport as af}from"ag-charts-community";import{calcLineHeight as fT}from"ag-charts-core";import{_ModuleSupport as xT}from"ag-charts-community";var wd=class extends jy{constructor(){super(...arguments),this.label=new xT.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=Se(e,t),o=this.getTextBBox(e,i,t);this.updateLabel(e,o,t),this.updateHandle(e,i,o),this.updateShape(e,o),this.anchor=this.updateAnchor(e,o,t)}copy(e,t,i){const o=Se(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=Nt({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 pd(e,o,{x:t.x,y:t.y},this.textInputBBox)}updateLabel(e,t,i){const{text:o,isPlaceholder:s}=e.getText(),a=this.getLabelCoords(e,t);i.isRtl&&(a.x+=t.width),Iy(this.label,o,s,e,a,this.getTextBaseline(e))}updateShape(e,t){}updateAnchor(e,t,i){return{x:i.isRtl?t.x-t.width+i.seriesRect.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:Cd}=af,vl=class extends wd{constructor(){super(),this.type="comment",this.shape=new af.Path,this.append([this.shape,this.label,this.handle])}static is(e){return et.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,u=o+a,p=(fT(r,al)+c)/2,{path:g}=this.shape;g.clear(),g.moveTo(o,s),g.lineTo(o,h+p),Cd(g,{x0:o,x1:o+p,y0:h+p,y1:h,cx:o+p,cy:h+p},p,!1),g.lineTo(u-p,h),Cd(g,{x0:u-p,x1:u,y0:h,y1:h+p,cx:u-p,cy:h+p},p,!1),g.lineTo(u,s-p),Cd(g,{x0:u,x1:u-p,y0:s-p,y1:s,cx:u-p,cy:s-p},p,!1),g.closePath()}containsPoint(e,t){return super.containsPoint(e,t)||this.shape.containsPoint(e,t)}};import"ag-charts-community";import{Debug as ST,StateMachine as Io,StateMachineProperty as nf}from"ag-charts-core";var Un=class extends Io{constructor(e){const t=({point:h})=>{const u=this.createDatum();u.set({x:h.x,y:h.y}),e.create(u)},i=()=>{this.node?.toggleActive(!0),e.showAnnotationOptions(),e.update()},o=()=>{e.showTextInput(),this.datum&&(this.datum.visible=!1)},s=()=>{e.hideTextInput(),this.node?.setTextInputBBox(),this.datum&&(this.datum.visible=!0),e.deselect()},a=h=>{this.node?.setTextInputBBox(h),e.update()},n=({colorPickerType:h,colorOpacity:u,color:p,opacity:g,isMultiColor:m})=>{this.datum&&(h==="text-color"&&e.updateTextInputColor(p),ul(this.datum,h,u,p,g,m),e.update())},r=h=>{const{datum:u,node:p}=this;!u||!p||!$i(u)||(u.fontSize=h,e.updateTextInputFontSize(h),e.update())},l=()=>{e.delete()},c=({textInputValue:h,bbox:u})=>{if(u!=null&&h!=null&&h.length>0){const{datum:p}=this;if(!$i(p))return;const g=nl(p,h,u.width);p?.set({text:g}),e.update(),e.recordAction(`Create ${p?.type} annotation`)}else e.delete()};super("start",{start:{click:{target:"waiting-first-render",action:t},dragStart:{target:"waiting-first-render",action:t},cancel:Io.parent,reset:Io.parent},"waiting-first-render":{render:{target:"edit",action:i}},edit:{onEnter:o,updateTextInputBBox:a,color:n,fontSize:r,textInput:[{guard:Nd,target:Io.parent,action:l},{guard:Ld,target:Io.parent,action:c}],click:{target:Io.parent,action:c},dragStart:{target:Io.parent,action:c},resize:{target:Io.parent,action:c},onExit:s,cancel:{target:Io.parent,action:l}}}),this.debug=ST.create(!0,"annotations")}};d([nf()],Un.prototype,"datum",2),d([nf()],Un.prototype,"node",2);var bT=class extends Un{createDatum(){return new Wi}},rf={type:"comment",datum:Wi,scene:vl,isDatum:Wi.is,translate:(e,t,i,o)=>{Wi.is(t)&&vl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Wi.is(t)&&Wi.is(i)&&vl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Wi.is(t)&&vl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new bT({...e,create:t("comment")}),dragState:e=>new ze(e)};import"ag-charts-community";import{ChartAxisDirection as vT,Vec2 as Ws,Vec4 as Od}from"ag-charts-core";import{_ModuleSupport as Ml}from"ag-charts-community";var{calculateLabelTranslation:MT}=Ml,lf=class extends Ml.Group{constructor(){super({name:"AnnotationAxisLabelGroup"}),this.label=new Ml.Text({zIndex:1}),this.rect=new Ml.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}=MT({yDirection:!0,padding:i.labelPadding,position:i.position??"left",bbox:n});n.grow(r,"horizontal"),n.grow(l,"vertical");const u=e+c,p=t+h;s.x=u,s.y=p,a.y=p-Math.round(n.height/2),a.x=u-Math.round(n.width/2),a.height=n.height,a.width=n.width}};lf.className="AxisLabel";import{_ModuleSupport as cf}from"ag-charts-community";import{Vec2 as Yi,jsonDiff as DT}from"ag-charts-core";var Vt=class extends cf.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=Yi.from(i,o-Math.floor(n/2)),l=Yi.from(s,a),c=Yi.distance(r,l);this.collisionBBox=new cf.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=Yi.from(o,s),l=Yi.from(a,n),c=Yi.sub(Yi.from(e,t),r),h=Yi.sub(l,r),u=Yi.rotate(c,Yi.angle(c,h),r);return i.containsPoint(u.x,u.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);DT(i,t)!=null&&this.markDirty("CollidableLine"),t?this.clipMask.set(e,t):this.clipMask.delete(e)}};import{_ModuleSupport as kT}from"ag-charts-community";var Gs=class extends kT.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{Vec2 as bt}from"ag-charts-core";function Ra(e,t,i,o,s,a,n){if(!a||!s||!o){t.setClipMask(e);return}const{alignment:r,position:l}=o,c=df(i,o.fontSize,n),{point:h,textBaseline:u}=uf(c,l,r);pf(s,a,o,h,c.angle,u);const{x:p,y:g,width:m,height:y}=s.getBBox(),x=bt.length(bt.from(m,y)),f={x:p+m/2,y:g+y/2,radius:x/2+bt.length(c.offset)};return l==="center"?t.setClipMask(e,f):t.setClipMask(e),{clipMask:f,numbers:c}}function hf(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 u=c;l==="bottom"?u=h:l==="inside"&&(u={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 p=df(u,o.fontSize,s),{point:g,textBaseline:m}=uf(p,l==="inside"?"center":l,r,e);pf(a,n,o,g,p.angle,m)}function df(e,t,i){let[o,s]=bt.from(e);o.x>s.x&&([o,s]=[s,o]);const a=bt.normalized(bt.sub(s,o)),n=bt.angle(a),r=bt.multiply(a,be.HANDLE_SIZE/2+(t??14)/2),l=bt.multiply(a,(i??2)/2+(t??14)/3);return{left:o,right:s,normal:a,angle:n,inset:r,offset:l}}function uf({left:e,right:t,normal:i,angle:o,inset:s,offset:a},n,r,l){let c;r==="right"?c=bt.sub(t,s):r==="center"?c=bt.add(e,bt.multiply(i,bt.distance(e,t)/2)):c=bt.add(e,s);let h="bottom";return n==="bottom"?(c=bt.rotate(a,o+Math.PI/2,c),h="top"):n==="center"&&!l?h="middle":c=bt.rotate(a,o-Math.PI/2,c),{point:c,textBaseline:h}}function pf(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 Qo=class extends et{constructor(){super(),this.type="cross-line",this.line=new Vt,this.middle=new Pa,this.isHorizontal=!1,this.append([this.line,this.middle])}static is(e){return et.isCheck(e,"cross-line")}update(e,t){const{seriesRect:i}=t;this.seriesRect=i,this.isHorizontal=St.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=Ws.sub(Od.center(t),Ws.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(Gs,this.text,!!e.text.label),Ra(this.line.id,this.line,t,e.text,this.text,e.text.label,e.strokeWidth)}createAxisLabel(e){const t=new lf;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"?Od.start(i):Od.end(i),l=a===vT.X?r.x:r.y;if(!t.inRange(l)){o.visible=!1;return}const c=Ke(e.value);o.update({...Ws.add(r,Ws.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=St.is(e)?{x:t.x,y:yo(e.value,i.yAxis)}:{x:yo(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,Ws.sub(t,s.offset),i))}translate(e,t,i){if(!e.isWriteable())return;const o=St.is(e)?Ws.from(0,yo(e.value,i.yAxis)):Ws.from(yo(e.value,i.xAxis),0);this.translatePoint(e,o,t,i)}translatePoint(e,t,i,o){const s=St.is(e);s?i.x=0:i.y=0;const{point:a}=ko({point:t},i,o);e.value=s?a.y:a.x}stopDragging(){this.middle.toggleDragging(!1)}copy(e,t,i){const o=St.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=Nt({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=yo(e.value,t);return St.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"ag-charts-community";import{Debug as IT,StateMachine as Dl,StateMachineProperty as AT}from"ag-charts-core";var Ed=class extends Dl{constructor(e,t){const i=({point:s})=>{const a=e==="horizontal",n=a?new St:new Gi;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:Dl.parent,cancel:Dl.parent},"waiting-first-render":{render:{target:Dl.parent,action:o}}}),this.debug=IT.create(!0,"annotations")}};d([AT()],Ed.prototype,"node",2);var gf={type:"horizontal-line",datum:St,scene:Qo,isDatum:St.is,translate:(e,t,i,o)=>{St.is(t)&&Qo.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(St.is(t)&&St.is(i)&&Qo.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{St.is(t)&&Qo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ed("horizontal",{...e,create:t("horizontal-line")}),dragState:e=>new ze(e)},mf={type:"vertical-line",datum:Gi,scene:Qo,isDatum:Gi.is,translate:(e,t,i,o)=>{Gi.is(t)&&Qo.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Gi.is(t)&&Gi.is(i)&&Qo.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Gi.is(t)&&Qo.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ed("vertical",{...e,create:t("vertical-line")}),dragState:e=>new ze(e)};import{Vec2 as Si,Vec4 as qo}from"ag-charts-core";import{_ModuleSupport as yf}from"ag-charts-community";import{Vec4 as NT}from"ag-charts-core";var ff=class{static updateBackground(e,t,i,o){const{background:s}=this,{seriesRect:a}=o;s.path.clear(!0);const n=NT.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=Si.from(t);return e.extendEnd&&t.y2===r&&l.push(Si.from(s?o.x1:o.x2,a?o.y1:o.y2)),e.extendEnd&&i.y2===n&&l.push(Si.from(s?o.x1:o.x2,a?o.y2:o.y1)),l.push(...Si.from(i).reverse()),e.extendStart&&i.y1===r&&l.push(Si.from(s?o.x2:o.x1,a?o.y1:o.y2)),e.extendStart&&t.y1===n&&l.push(Si.from(s?o.x2:o.x1,a?o.y2:o.y1)),l}};import{Debug as LT,StateMachine as Jo,StateMachineProperty as Pd,isNumber as _a}from"ag-charts-core";var Il=class extends Jo{constructor(e){const t=({point:l})=>{const c=new yi;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:u}=this;h&&(h.set({end:$n(l,c,u,h.start,h.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,u=Ke(c?.end.y),p=Ke(c?.start.y),{y:g}=l;if(c==null||!_a(p)||!_a(u)||!_a(g))return;const m=u-(g??0),y=(p-u)*2+m,x={x:c?.start.x,y:p-y},f={x:c?.end.x,y:l.y};h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(f,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:m}),e.update())},n=({point:l})=>{const{datum:c,node:h}=this,u=Ke(c?.end.y),p=Ke(c?.start.y),{y:g}=l;if(c==null||!_a(p)||!_a(u)||!_a(g))return;const m=u-(g??0),y=(p-u)*2+m,x={x:c.start.x,y:p-m},f={x:c.end.x,y:l.y};h?.toggleHandles(!0),!(!e.validatePoint(x,{overflowContinuous:!0})||!e.validatePoint(f,{overflowContinuous:!0}))&&(c.set({startHeight:y,endHeight:m}),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:Jo.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:Jo.parent,action:r},cancel:{target:Jo.parent,action:r}},height:{hover:a,click:{target:Jo.parent,action:n},drag:{target:Jo.parent,action:n},reset:{target:Jo.parent,action:r},cancel:{target:Jo.parent,action:r}}}),this.debug=LT.create(!0,"annotations"),this.snapping=!1}};d([Pd()],Il.prototype,"datum",2),d([Pd()],Il.prototype,"node",2),d([Pd()],Il.prototype,"snapping",2);var Sf={type:"disjoint-channel",datum:yi,scene:kl,isDatum:yi.is,translate:(e,t,i,o)=>{yi.is(t)&&kl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(yi.is(t)&&yi.is(i)&&kl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{yi.is(t)&&kl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Il({...e,create:t("disjoint-channel")}),dragState:e=>new ze(e)};import{Vec2 as TT,Vec4 as js,entries as wT}from"ag-charts-core";import{_ModuleSupport as es}from"ag-charts-community";import{Vec2 as CT,Vec4 as bf}from"ag-charts-core";var Rd=[0,23.6,38.2,50,61.8,78.6,100],OT=[161.8,261.8,361.8,423.6],ET=[...Rd,...OT],PT={10:ET,6:Rd,4:Rd.filter(e=>e!==78.6&&e!==23.6)},vf=10;function RT(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 Mf({x1:e,y1:t,x2:i,y2:o},s,a,n,r=10){const l=t-o,c=a?-1:1,h=[],{yAxis:u,isRtl:p}=s;let g=n;for(const[m,y]of PT[r].entries()){const x=n+l*(y/100)*c,f=u.scaleInvert(x);h.push({id:m,x1:e,x2:i,y1:g,y2:x,tag:y==100?0:1,label:{x1:p?Math.max(e,i)+vf:Math.min(e,i)-vf,x2:i,y1:x,y2:x,text:p?`(${f.toFixed(2)}) ${(y/100).toFixed(3)}`:`${(y/100).toFixed(3)} (${f.toFixed(2)})`}}),g=x}return h}var Df=class extends et{constructor(){super(),this.trendLine=new Vt,this.rangeFillsGroup=new es.Group({name:`${this.id}-range-fills`}),this.rangeFillsGroupSelection=es.Selection.select(this.rangeFillsGroup,es.Range),this.rangeStrokesGroup=new es.Group({name:`${this.id}-range-strokes`}),this.rangeStrokesGroupSelection=es.Selection.select(this.rangeStrokesGroup,Vt),this.labelsGroup=new es.Group({name:`${this.id}-ranges-labels`}),this.labelsGroupSelection=es.Selection.select(this.labelsGroup,Gs),this.anchor={x:0,y:0,position:"above"},this.append([this.trendLine,this.rangeFillsGroup,this.rangeStrokesGroup,this.labelsGroup])}update(e,t){let i=At(e,t);if(i==null){this.visible=!1;return}if(i=bf.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=Mf(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:u},p)=>{const g=h,m=n?s[p%s.length]:a;r.setProperties({x1:l,x2:c,y1:g,y2:g,stroke:m,strokeOpacity:o,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,tag:u})})}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:u,y2:p},g)=>{const m=r?s[g%s.length]:a;if(!n){l.visible=!1;return}l.setProperties({x1:c,x2:h,y1:u,y2:p,startLine:!1,endLine:!1,stroke:m,strokeOpacity:o,fill:m,fillOpacity:(o??1)*.15,strokeWidth:i,lineCap:e.getLineCap(),lineDash:e.getLineDash(),lineDashOffset:t,visible:!0})})}updateRangeLabels(e,{xAxis:t,isRtl:i}){const{rangeStrokesGroupSelection:o}=this,{strokes:s,strokeWidth:a,rangeStroke:n,isMultiColor:r,label:{fontFamily:l,fontSize:c,fontStyle:h,fontWeight:u,color:p}}=e,g={fontFamily:l,fontSize:c,fontStyle:h,fontWeight:u},m=this.checkWithinBounds(t,g,i,this.labelsGroupSelection.at(0));this.labelsGroupSelection.each((y,x,f)=>{const b=p??(r?s[f%s.length]:n),S=o.at(f);if(!S)return;const{text:v,...M}=x.label;if(m)y.setProperties({...g,text:v,x:M.x1,y:M.y1,textBaseline:"middle",textAlign:i?"left":"end",fill:b}),Ra(y.id,S,M);else{const D={...g,label:v,position:"center",alignment:i?"right":"left",color:b};Ra(y.id,S,M,D,y,v,a)}})}checkWithinBounds(e,t,i,o){if(!o)return!1;const{text:s,...a}=o.datum.label;o.setProperties({...t,text:s,x:a.x1,y:a.y1,textBaseline:"middle",textAlign:i?"left":"end"});const n=o.getBBox(),r=n.x,l=n.x+n.width,c=e.bounds.x,h=e.bounds.x+e.bounds.width;return r>=c&&l<=h}updateText(e,t){const i=this.rangeStrokesGroupSelection.selectByTag(0)[0];if(!i)return;const{text:o,strokeWidth:s}=e;this.text=this.updateNode(Gs,this.text,!!o.label),Ra(i.id,i,t,o,this.text,o.label,s)}updateAnchor(e,t,i,o){const s=bf.topCenter(t);CT.apply(this.anchor,es.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 _T}from"ag-charts-community";import{Logger as kf}from"ag-charts-core";var{ContinuousScale:If}=_T;function Al(e,t,i={overflowContinuous:!1},o){if(t.x==null||t.y==null)return o&&kf.warnOnce(`${o}requires both an [x] and [y] property, ignoring.`),!1;const{xAxis:s,yAxis:a}=e,n=i.overflowContinuous&&If.is(s.scale),r=i.overflowContinuous&&If.is(a.scale),l=n||Af(t.x,s),c=r||Af(t.y,a);if(l&&c)return!0;if(o){let h="x & y domains";l&&(h="y domain"),c&&(h="x domain");const u=Ke(t.x),p=Ke(t.y);kf.warnOnce(`${o}is outside the ${h}, ignoring. - x: [${u}], y: ${p}]`)}return!1}function Af(e,t){const{domain:i}=t.scale,o=Ke(e);return i&&o!=null&&t.continuous?o>=i[0]&&o<=i.at(-1):!0}var Nl=class extends Df{constructor(){super(),this.type="fibonacci-retracement-trend-based",this.endRetracementLine=new Vt,this.start=new be,this.end=new be,this.endRetracement=new be,this.append([this.endRetracementLine,this.start,this.end,this.endRetracement])}static is(e){return et.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=js.round(i),o=js.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=RT(i,o),r=this.extendLine(n,e,t),l=r.y2,c=r.y1,h=o?Mf(r,t,s,l,a):[];this.updateRanges(e,h,t);const u={...r,y1:c,y2:c};this.updateText(e,u)}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,...yl({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:TT.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):Nt(this[s].drag(t).point,i);!n||!Al(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=Se(e[n],i);return Nt(ml(t,r,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,endRetracement:o,translation:s,context:a}){const n=ko({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:Se(e.start,i),end:Se(e.end,i),endRetracement:Se(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:js.start(o),end:js.end(o),endRetracement:js.end(s),translation:{x:-a.width/2,y:-a.height/2},context:i}),t}getCoords(e,t){return{coords1:At(e,t),coords2:At({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 wT(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"?js.start(t):js.end(t)}};import{Debug as zT,StateMachine as ts,StateMachineProperty as _d}from"ag-charts-core";var Ll=class extends ts{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:u,snapping:p}=this;u&&(u.set({end:$n(c,h,p,u.start,u.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:u,snapping:p}=this;u&&(u.set({endRetracement:$n(c,h,p,u.end,u.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:ts.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:ts.parent,action:r},cancel:{target:ts.parent,action:r},onExit:l},endRetracement:{hover:a,click:{target:ts.parent,action:n},drag:{target:ts.parent,action:n},reset:{target:ts.parent,action:r},cancel:{target:ts.parent,action:r}}}),this.debug=zT.create(!0,"annotations"),this.snapping=!1}createDatum(){return new ji}};d([_d()],Ll.prototype,"datum",2),d([_d()],Ll.prototype,"node",2),d([_d()],Ll.prototype,"snapping",2);var Nf={type:"fibonacci-retracement-trend-based",datum:ji,scene:Nl,isDatum:ji.is,translate:(e,t,i,o)=>{ji.is(t)&&Nl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(ji.is(t)&&ji.is(i)&&Nl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{ji.is(t)&&Nl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new Ll({...e,create:t("fibonacci-retracement-trend-based")}),dragState:e=>new ze(e)};import{Vec2 as BT,Vec4 as Lf,entries as VT}from"ag-charts-core";var Tl=class extends Df{constructor(){super(),this.type="fibonacci-retracement",this.start=new be,this.end=new be,this.append([this.start,this.end])}static is(e){return et.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,...yl({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:BT.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):Nt(this[s].drag(t).point,i);!n||!Al(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=Se(e[a],i);return Nt(ml(t,n,e.snapToAngle),i)}translatePoints({datum:e,start:t,end:i,translation:o,context:s}){const a=ko({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:Se(e.start,i),end:Se(e.end,i),translation:t,context:i})}copy(e,t,i){const o=At(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 VT(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"?Lf.start(t):Lf.end(t)}};import{Debug as FT,StateMachine as za,StateMachineProperty as zd}from"ag-charts-core";var Ba=class extends za{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:$n(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:za.parent},"waiting-first-render":{render:{target:"end",action:i}},end:{hover:o,click:{target:za.parent,action:s},drag:o,dragEnd:{target:za.parent,action:s},reset:{target:za.parent,action:a},cancel:{target:za.parent,action:a},onExit:n}}),this.debug=FT.create(!0,"annotations"),this.snapping=!1}};d([zd()],Ba.prototype,"datum",2),d([zd()],Ba.prototype,"node",2),d([zd()],Ba.prototype,"snapping",2);var HT=class extends Ba{createDatum(){return new xo}},KT=class extends Ba{createDatum(){return new So}},WT=class extends Ba{createDatum(){return new vo}},Tf={type:"fibonacci-retracement",datum:vo,scene:Tl,isDatum:vo.is,translate:(e,t,i,o)=>{vo.is(t)&&Tl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(vo.is(t)&&vo.is(i)&&Tl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{vo.is(t)&&Tl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new WT({...e,create:t("fibonacci-retracement")}),dragState:e=>new ze(e)};import{_ModuleSupport as GT}from"ag-charts-community";import{Vec2 as Ci,Vec4 as wf}from"ag-charts-core";import{_ModuleSupport as Cf}from"ag-charts-community";import{Vec2 as Yn}from"ag-charts-core";var jT=class extends Cf.Group{},wl=class extends jT{constructor(){super(),this.type="arrow",this.path=new Cf.Path,this.armLength=6,this.append([this.path])}update(e){const{path:t}=this,{x:i,y:o,angle:s,...a}=e,n=Yn.from(i,o),r=3*Math.PI/4,l=this.armLength+(e.strokeWidth??0)*2,c=Yn.rotate(Yn.from(0,l),s+r,n),h=Yn.rotate(Yn.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)}},{Transformable:$T}=GT,is=class extends Ad{constructor(){super(),this.type="line",this.line=new Vt,this.append([this.line,this.start,this.end])}static is(e){return et.isCheck(e,"line")}update(e,t){let i=At(e,t);if(i==null){this.visible=!1;return}i=wf.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(Gs,this.text,!!e.text.label),Ra(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]=Ci.from(t),r=Ci.angle(Ci.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 wl,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 wl,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=wf.topCenter(t);Ci.apply(this.anchor,$T.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]=Ci.from(t);const l=Ci.angle(Ci.sub(r,n));return s&&(n=Ci.rotate(Ci.from(0,-be.HANDLE_SIZE/2),l,n)),a&&(r=Ci.rotate(Ci.from(0,be.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}}},Of={type:"line",datum:So,scene:is,isDatum:So.is,translate:(e,t,i,o)=>{So.is(t)&&is.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(So.is(t)&&So.is(i)&&is.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{So.is(t)&&is.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new KT({...e,create:t("line")}),dragState:e=>new ze(e)},Ef={type:"arrow",datum:xo,scene:is,isDatum:xo.is,translate:(e,t,i,o)=>{xo.is(t)&&is.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(xo.is(t)&&xo.is(i)&&is.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{xo.is(t)&&is.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new HT({...e,create:t("arrow")}),dragState:e=>new ze(e)};import{_ModuleSupport as Pf}from"ag-charts-community";import{Vec2 as Xi,Vec4 as $s,isDate as Rf,isNumber as Cl}from"ag-charts-core";import{_ModuleSupport as Oi}from"ag-charts-community";import{Vec4 as Bd}from"ag-charts-core";import{_ModuleSupport as _f}from"ag-charts-community";function zf(e,t=0,i=0){let o=t;for(const s of e)if(Array.isArray(s)){for(const a of s)Bf(a,o);o+=_f.Group.computeChildrenBBox(s).width+i}else Bf(s,o),o+=s.getBBox().width+i}function UT(e,t=0,i=0){let o=t;for(const s of e)if(Array.isArray(s)){for(const a of s)Vf(a,o);o+=_f.Group.computeChildrenBBox(s).height+i}else Vf(s,o),o+=s.getBBox().height+i}function Bf(e,t){"x1"in e?(e.x2=t+(e.x2-e.x1),e.x1=t):e.x=t}function Vf(e,t){"y1"in e?(e.y2=t+(e.y2-e.y1),e.y1=t):e.y=t}function Ff(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 Kf=class extends Oi.Group{constructor(){super(),this.name="MeasurerStatisticsScene",this.background=new Oi.Rect,this.dateRangeBarsText=new Oi.Text,this.dateRangeDivider=new Oi.Line,this.dateRangeValueText=new Oi.Text,this.priceRangeValueText=new Oi.Text,this.priceRangeDivider=new Oi.Line,this.priceRangePercentageText=new Oi.Text,this.volumeText=new Oi.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=Oi.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=Bd.from(t.seriesRect);this.visible=Bd.collides(i,o)&&(e.visible??!0)}updateStatistics(e,t,i,o){const{dateRangeBarsText:s,dateRangeDivider:a,dateRangeValueText:n,priceRangeValueText:r,priceRangeDivider:l,priceRangePercentageText:c,volumeText:h}=this,u=8,p=6,g=e.statistics.fontSize+3,m=-2,y=this.getTextStyles(e),x={...this.getDividerStyles(e),x1:0,y1:0,x2:0,y2:g},f=[s,a,n],b=[r,l,c],S=[];return t.priceRange&&(r.setProperties({...y,text:this.formatPriceRangeValue(t.priceRange.value,o)}),l.setProperties(x),c.setProperties({...y,text:this.formatPriceRangePercentage(t.priceRange.percentage,o)}),zf(b,i.x,u),S.push(b)),t.dateRange&&(s.setProperties({...y,text:this.formatDateRangeBars(t.dateRange.bars,o)}),a.setProperties(x),n.setProperties({...y,text:this.formatDateRangeValue(t.dateRange.value)}),zf(f,i.x,u),S.push(f)),t.volume==null?h.visible=!1:(h.setProperties({...y,x:i.x,text:this.formatVolume(t.volume,o),visible:!0}),S.push(h)),UT(S,i.y,p),l.y1+=m,l.y2+=m,a.y1+=m,a.y2+=m,S}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=Bd.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=Oi.Group.computeChildrenBBox(l).width;for(const h of l)Ff(h,n-c/2),Hf(h,r)}else Ff(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,textAlign:"left",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+Xi.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=Xi.round($s.center(t),0),{stroke:h,strokeWidth:u,strokeOpacity:p}=this.getLineStyles(e),g={stroke:h,strokeWidth:u,strokeOpacity:p};if(s!=="vertical"){const m=a<=r?0:Math.PI;let y=r;s==="horizontal"&&(y+=a<=r?-2:2),i.update({...g,x:y,y:c.y,angle:m})}if(s!=="horizontal"){const m=n<=l?Math.PI/2:Math.PI/-2;let y=l;s==="vertical"&&(y+=n<=l?-2:2),o.update({...g,x:c.x,y,angle:m})}}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,u=this.getLineStyles(e);n==="horizontal"&&(i.setProperties({...u,x1:r,y1:l,x2:r,y2:h}),o.setProperties({...u,x1:c,y1:l,x2:c,y2:h})),n==="vertical"&&(s.setProperties({...u,x1:r,y1:l,x2:c,y2:l}),a.setProperties({...u,x1:r,y1:h,x2:c,y2:h}))}updateStatistics(e,t,i){const o=Xi.add($s.bottomCenter(t),Xi.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=$s.topCenter(t);Xi.apply(this.anchor,Pf.Transformable.toCanvasPoint(this.horizontalLine,s.x,s.y))}getBackgroundPoints(e,t,i,o){const[s,a]=Xi.from(t),[n,r]=Xi.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($s.width(e)/i)*o:0}getDateRangeValue(e){const t=Ke(e.start.x),i=Ke(e.end.x);if(!Rf(t)||!Rf(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=Ke(e.end.y),i=Ke(e.start.y);if(!Cl(t)||!Cl(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=Ke(e.end.y),i=Ke(e.start.y);if(!Cl(t)||!Cl(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)}},Ol=class extends Qt{constructor(){super(...arguments),this.type="quick-measurer"}static is(e){return et.isCheck(e,"quick-measurer")}createStatisticsScene(){return new YT}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{Debug as XT,StateMachine as Va,StateMachineProperty as Wf}from"ag-charts-core";var Fa=class extends Va{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:Va.parent,click:{target:"end",action:t},drag:{target:"end",action:t}},end:{hover:i,drag:i,click:{target:Va.parent,action:o},dragEnd:{target:Va.parent,action:o},reset:{target:Va.parent,action:s},cancel:{target:Va.parent,action:s},onExit:a}}),this.debug=XT.create(!0,"annotations")}};d([Wf()],Fa.prototype,"datum",2),d([Wf()],Fa.prototype,"node",2);var ZT=class extends Fa{createDatum(){return new gi}},QT=class extends Fa{createDatum(){return new mi}},qT=class extends Fa{createDatum(){return new fo}},JT=class extends Fa{createDatum(){return new Zt}},Gf={type:"date-range",datum:gi,scene:Qt,isDatum:gi.is,translate:(e,t,i,o)=>{gi.is(t)&&Qt.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(gi.is(t)&&gi.is(i)&&Qt.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{gi.is(t)&&Qt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ZT({...e,create:t("date-range")}),dragState:e=>new ze(e)},jf={type:"price-range",datum:mi,scene:Qt,isDatum:mi.is,translate:(e,t,i,o)=>{mi.is(t)&&Qt.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(mi.is(t)&&mi.is(i)&&Qt.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{mi.is(t)&&Qt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new QT({...e,create:t("date-range")}),dragState:e=>new ze(e)},$f={type:"date-price-range",datum:fo,scene:Qt,isDatum:fo.is,translate:(e,t,i,o)=>{fo.is(t)&&Qt.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(fo.is(t)&&fo.is(i)&&Qt.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{fo.is(t)&&Qt.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new qT({...e,create:t("date-range")}),dragState:e=>new ze(e)},Uf={type:"quick-date-price-range",datum:Zt,scene:Ol,isDatum:Zt.is,translate:(e,t,i,o)=>{Zt.is(t)&&Ol.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Zt.is(t)&&Zt.is(i)&&Ol.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Zt.is(t)&&Ol.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new JT({...e,create:t("quick-date-price-range")}),dragState:e=>new ze(e)};import{_ModuleSupport as El}from"ag-charts-community";import{ZIndexMap as Yf,calcLineHeight as ew,clamp as tw,wrapText as iw}from"ag-charts-core";var Pl=class extends wd{constructor(){super(),this.type="note",this.shape=new El.Rect,this.iconBackground=new El.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 El.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 El.DropShadow,this.append([this.shape,this.label,this.iconBackground,this.iconLines,this.handle])}static is(e){return et.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=tw(0,o.x,i.seriesRect.width-e.width);const s=e.getPadding().top,a=o.y-Ny-s*2,n=o.y+be.HANDLE_SIZE+s*2;return a-o.height-Ly<0?(o.y=n,e.position="top"):(o.y=a+s,e.position="bottom"),o}updateLabel(e,t,i){const o=e.visible===!1?!1:this.label.visible;super.updateLabel(e,t,i),i.isRtl&&(this.label.x+=e.width-t.width),this.label.visible=o,this.label.text=iw(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}=Se(e,t);o.translationX=a-tL/2,o.translationY=n-Ay,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+ew(e.fontSize,al)/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+be.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?Yf.CHART_ANNOTATION_FOCUSED:Yf.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)}},ow=class extends Un{createDatum(){return new Bt}},Xf={type:"note",datum:Bt,scene:Pl,isDatum:Bt.is,translate:(e,t,i,o)=>{Bt.is(t)&&Pl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Bt.is(t)&&Bt.is(i)&&Pl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Bt.is(t)&&Pl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new ow({...e,create:t("note")}),dragState:e=>new ze(e)};import{Vec2 as bi,Vec4 as Zi}from"ag-charts-core";var Rl=class extends xf{constructor(){super(),this.type="parallel-channel",this.handles={topLeft:new be,topMiddle:new Pa,topRight:new be,bottomLeft:new be,bottomMiddle:new Pa,bottomRight:new be},this.middleLine=new Vt,this.append([this.background,this.topLine,this.middleLine,this.bottomLine,...Object.values(this.handles)])}static is(e){return et.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-=Pa.HANDLE_SIZE/2,l=!1;break;case"topRight":case"bottomRight":r=["topRight","bottomRight"];break;case"bottomMiddle":r=["bottomLeft","bottomRight"],n.y-=Pa.HANDLE_SIZE/2,l=!1;break}const c=At(e,i),h=At(e.bottom,i);if(!c||!h)return;const u={topLeft:Zi.start(c),topRight:Zi.end(c),bottomLeft:Zi.start(h),bottomRight:Zi.end(h)},p={vectors:{topLeft:u.topRight,bottomLeft:u.bottomRight,topRight:u.topLeft,bottomRight:u.bottomLeft},angle:e.snapToAngle},g=ko(u,n,i,{overflowContinuous:this.overflowContinuous,translateVectors:r,snap:l?p: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=bi.add(e,bi.from(0,s)),n=bi.add(t,bi.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:u,strokeWidth:p}=e,g=e.getLineDash(),m={lineCap:e.getLineCap(),lineDash:g,lineDashOffset:c,stroke:h,strokeOpacity:u,strokeWidth:p};n.setProperties({...t,...m}),l.setProperties({...i,...m});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},e,o);r.setProperties({...y,lineDash:e.middle.lineDash??g,lineDashOffset:e.middle.lineDashOffset??c,stroke:e.middle.stroke??h,strokeOpacity:e.middle.strokeOpacity??u,strokeWidth:e.middle.strokeWidth??p,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,...Zi.start(t)}),a.update({...c,...Zi.end(t)}),n.update({...c,...Zi.start(i)}),l.update({...c,...Zi.end(i)}),s.update({...c,...bi.sub(Zi.center(t),bi.from(s.handle.width/2,s.handle.height/2))}),r.update({...c,...bi.sub(Zi.center(i),bi.from(r.handle.width/2,r.handle.height/2))})}updateText(e,t,i){this.text=this.updateNode(Gs,this.text,!!e.text.label),hf(!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=bi.from(t);return e.extendEnd&&r&&l.push(bi.from(s?o.x1:o.x2,a?o.y1:o.y2)),l.push(...bi.from(i).reverse()),e.extendStart&&n&&l.push(bi.from(s?o.x2:o.x1,a?o.y2:o.y1)),l}};import{Debug as sw,StateMachine as os,StateMachineProperty as Vd,isNumber as Ha}from"ag-charts-core";var _l=class extends os{constructor(e){const t=({point:l})=>{const c=new fi;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:u}=this;h&&(h.set({end:$n(l,c,u,h.start,h.snapToAngle)}),e.update())},s=()=>{this.node?.toggleHandles({topRight:!0}),e.update()},a=({point:l})=>{const{datum:c,node:h}=this,u=Ke(c?.end.y),p=Ke(c?.start.y),{y:g}=l;if(c==null||!Ha(p)||!Ha(u)||!Ha(g))return;const m=u-(g??0),y=p-m;h?.toggleHandles({bottomLeft:!0,bottomRight:!0}),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:m}),e.update())},n=({point:l})=>{const{datum:c,node:h}=this,u=Ke(c?.end.y),p=Ke(c?.start.y),{y:g}=l;if(c==null||!Ha(p)||!Ha(u)||!Ha(g))return;const m=u-(g??0),y=p-m;h?.toggleHandles(!0),!(!e.validatePoint({x:c.start.x,y},{overflowContinuous:!0})||!e.validatePoint({x:c.end.x,y:l.y},{overflowContinuous:!0}))&&(c.set({height:m}),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:os.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:os.parent,action:r},cancel:{target:os.parent,action:r}},height:{hover:a,click:{target:os.parent,action:n},drag:{target:os.parent,action:n},reset:{target:os.parent,action:r},cancel:{target:os.parent,action:r}}}),this.debug=sw.create(!0,"annotations"),this.snapping=!1}};d([Vd()],_l.prototype,"datum",2),d([Vd()],_l.prototype,"node",2),d([Vd()],_l.prototype,"snapping",2);var Zf={type:"parallel-channel",datum:fi,scene:Rl,isDatum:fi.is,translate:(e,t,i,o)=>{fi.is(t)&&Rl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(fi.is(t)&&fi.is(i)&&Rl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{fi.is(t)&&Rl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new _l({...e,create:t("parallel-channel")}),dragState:e=>new ze(e)},zl=class extends wd{constructor(){super(),this.type="text",this.append([this.label,this.handle])}static is(e){return et.isCheck(e,"text")}getHandleCoords(e,t){const i=be.HANDLE_SIZE/2;return{x:t.x+i,y:t.y+2+i}}},aw=class extends Un{createDatum(){return new Mo}},Qf={type:"text",datum:Mo,scene:zl,isDatum:Mo.is,translate:(e,t,i,o)=>{Mo.is(t)&&zl.is(e)&&e.translate(t,i,o)},copy:(e,t,i,o)=>{if(Mo.is(t)&&Mo.is(i)&&zl.is(e))return e.copy(t,i,o)},update:(e,t,i)=>{Mo.is(t)&&zl.is(e)&&e.update(t,i)},createState:(e,{createDatum:t})=>new aw({...e,create:t("text")}),dragState:e=>new ze(e)},qt={[Of.type]:Of,[gf.type]:gf,[mf.type]:mf,[Zf.type]:Zf,[Sf.type]:Sf,[Tf.type]:Tf,[Nf.type]:Nf,[sf.type]:sf,[rf.type]:rf,[Xf.type]:Xf,[Qf.type]:Qf,[Ef.type]:Ef,[Qy.type]:Qy,[Zy.type]:Zy,[Gf.type]:Gf,[jf.type]:jf,[$f.type]:$f,[Uf.type]:Uf};function Us(e){for(const{isDatum:t}of Object.values(qt))if(t(e))return e}import"ag-charts-community";import{ActionOnSet as nw,Debug as rw,ParallelStateMachine as lw,StateMachine as Fd,StateMachineProperty as Qi}from"ag-charts-core";var Bl=class extends lw{constructor(e){super(new cw(t=>{this.snapping=t}),new hw(()=>{this.node=this.active==null?void 0:e.node(this.active)}),new ss(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([Qi()],Bl.prototype,"snapping",2),d([Qi()],Bl.prototype,"datum",2),d([Qi()],Bl.prototype,"node",2);var cw=class extends Fd{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":{}})}},hw=class extends Fd{constructor(e){super("idle",{idle:{onEnter:e,render:e},dragging:{onEnter:e,render:e},translating:{onEnter:e,render:e},"text-input":{render:e}})}},ss=class extends Fd{constructor(e,t){const i=S=>v=>{e.create(S,v),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 S=this.active;this.active=void 0,this.hovered=void 0,e.select(this.active,S)},showAnnotationOptions:()=>{this.active!=null&&e.showAnnotationOptions(this.active)}},n=Object.fromEntries(Object.entries(qt).map(([S,v])=>[S,v.createState(a,s)])),r=Object.fromEntries(Object.entries(qt).map(([S,v])=>[S,v.dragState(e,s)])),l=({colorPickerType:S,colorOpacity:v,color:M,opacity:D,isMultiColor:I})=>{this.datum&&(S==="text-color"&&e.updateTextInputColor(M),ul(this.datum,S,v,M,D,I),e.update())},c=S=>{const{datum:v,node:M}=this;!v||!M||($i(v)?(v.fontSize=S,e.updateTextInputFontSize(S)):Ca(v)&&(v.text.fontSize=S),e.update())},h=S=>{const{datum:v,node:M}=this;!v||!M||!$o(v)||(Py(v,S),e.update())},u=S=>{const{node:v}=this;!v||!("setTextInputBBox"in v)||(v.setTextInputBBox(S),e.update())},p=({textInputValue:S,bbox:v})=>{const{datum:M}=this;if(v!=null&&S!=null&&S.length>0){if(!$i(M))return;const D=nl(M,S,v.width);M.set({text:D}),e.update(),e.recordAction(`Change ${M.type} annotation text`)}else e.delete(this.active),e.recordAction(`Delete ${M?.type} annotation`)},g=()=>{e.updateTextInputBBox(void 0)},m=()=>this.active!=null,y=()=>this.copied!=null,x=()=>{const{active:S,datum:v}=this;return S==null||!v?!1:Ca(v)&&v.isWriteable()},f=()=>this.active!=null&&!jo(this.datum),b=()=>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:S})=>{this.hovered=e.hoverAtCoords(S,this.active,this.hovered),this.hoverCoords=S},translate:{guard:m,target:"translating",action:({translation:S})=>{e.startInteracting(),e.translate(this.active,S),e.update()}},copy:{guard:f,action:()=>{this.copied=e.copy(this.active)}},cut:{guard:f,action:()=>{this.copied=e.copy(this.active),o()}},paste:{guard:y,action:()=>{e.paste(this.copied)}},selectLast:()=>{const S=this.active;this.active=e.selectLast(),e.select(this.active,S)},click:[{guard:()=>{const{active:S,hovered:v,datum:M}=this;return S==null||v!==S||!M?!1:$i(M)&&M.isWriteable()},target:"text-input"},{action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S)}}],dblclick:{guard:x,action:({offset:S})=>{const v=e.getNodeAtCoords(S,this.active)==="text"?"text":"line";e.showAnnotationSettings(this.active,void 0,v)}},dragStart:[{guard:b,target:"dragging",action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S),e.startInteracting()}},{action:()=>{const S=this.active;this.active=this.hovered,e.select(this.active,S)}}],color:{guard:m,action:l},fontSize:{guard:m,action:c},lineProps:{guard:m,action:S=>{const v=Us(this.datum);v?.set(S),e.update(),e.recordAction(`Change ${v?.type} ${Object.entries(S).map(([M,D])=>`${M} to ${D}`).join(", ")}`)}},lineStyle:{guard:m,action:h},lineText:{guard:m,action:S=>{const v=Us(this.datum);Ca(v)&&(Do(v)&&S.position==="center"&&(S.position="inside"),v.text.set(S),e.update())}},updateTextInputBBox:{guard:m,action:u},toolbarPressSettings:{guard:x,action:S=>{e.showAnnotationSettings(this.active,S)}},reset:()=>{this.active!=null&&this.node?.toggleActive(!1),this.hovered=void 0,this.active=void 0,e.select(),e.resetToIdle()},delete:()=>{this.active!=null&&(e.delete(this.active),!jo(this.datum)&&e.recordAction(`Delete ${this.datum?.type} annotation`))},deleteAll:()=>{e.deleteAll()},...n},dragging:{onEnter:(S,v)=>{if(this.active==null)return;const M=e.getAnnotationType(this.active);M&&(this.transitionRoot(M),this.transitionRoot("dragStart",v))},...r},translating:{onEnter:()=>{},translate:{guard:m,target:"translating",action:({translation:S})=>{e.startInteracting(),e.translate(this.active,S),e.update()}},translateEnd:{guard:m,target:"idle"},onExit:()=>{e.stopInteracting(),e.update(),e.recordAction("Translate annotation")}},"text-input":{onEnter:()=>{if(this.active==null)return;const S=Us(this.datum);!S||!("getTextInputCoords"in S)||(e.startInteracting(),e.showTextInput(this.active),S.visible=!1,e.update())},updateTextInputBBox:{guard:m,action:u},resize:{target:"idle",action:p},click:{target:"idle",action:p},drag:{target:"idle",action:p},textInput:[{guard:Nd,target:"idle",action:g},{guard:Ld,target:"idle",action:p}],color:{guard:m,action:l},fontSize:{guard:m,action:c},cancel:{target:"idle",action:g},onExit:()=>{e.stopInteracting(),e.hideTextInput();const S=this.active;if(this.active=this.hovered=void 0,e.select(this.active,S),S==null)return;const v=e.datum(S),M=e.node(S);!v||!M||("setTextInputBBox"in M&&M.setTextInputBBox(),v.visible=!0)}}}),this.setActive=t,this.debug=rw.create(!0,"annotations"),this.snapping=!1}};d([nw({changeValue(e){this.setActive(e)}}),Qi()],ss.prototype,"active",2),d([Qi()],ss.prototype,"hovered",2),d([Qi()],ss.prototype,"hoverCoords",2),d([Qi()],ss.prototype,"copied",2),d([Qi()],ss.prototype,"snapping",2),d([Qi()],ss.prototype,"datum",2),d([Qi()],ss.prototype,"node",2);import{_ModuleSupport as dw}from"ag-charts-community";import{ActionOnSet as uw,BaseProperties as pw,ChartAxisDirection as gw,CleanupRegistry as mw,EventEmitter as yw,PropertiesArray as fw,Property as Vl}from"ag-charts-core";var{LayoutElement:xw,Menu:Sw}=dw,qf=class extends Ui{};d([Vl],qf.prototype,"value",2);var Fl=class extends pw{constructor(e){super(),this.ctx=e,this.enabled=!0,this.padding=20,this.buttons=new fw(qf),this.events=new yw,this.annotationMenu=new Sw(this.ctx,"annotations"),this.cleanup=new mw,this.menuMargin=6,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(xw.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(gw.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",CL.filter(a=>a.visible?a.visible(s):!0));break;case"fibonacci-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsFibonacciAnnotations",OL);break;case"text-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsTextAnnotations",PL);break;case"shape-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsShapeAnnotations",RL);break;case"measurer-menu":this.onToolbarButtonPressShowMenu(e,i,o,t.value,"toolbarAnnotationsMeasurerAnnotations",_L);break}}onToolbarButtonPressShowMenu(e,t,i,o,s,a){this.events.emit("pressed-show-menu",null);const n=this.buttons.findIndex(l=>l.value===o);this.toolbar.toggleActiveButtonByIndex(n);const r=this.ctx.domManager.isRtl?t.x-this.menuMargin:t.x+t.width+this.menuMargin;this.annotationMenu.setAnchor({x:r,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([Vl,uw({changeValue(e){this.toolbar?.setHidden(!e)}})],Fl.prototype,"enabled",2),d([Vl],Fl.prototype,"padding",2),d([Vl],Fl.prototype,"buttons",2);import{_ModuleSupport as bw,_Widget as vw}from"ag-charts-community";import{AbstractModuleInstance as Mw,ChartAxisDirection as Dw,Property as kw,getIconClassNames as Iw}from"ag-charts-core";var{InteractionState:Xn}=bw,Zn="ag-charts-annotations__axis-button",Jf=class extends Mw{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-complete",()=>this.hide()),()=>this.destroyElements(),()=>this.button.destroy())}update(e,t){this.seriesRect=e,this.padding=t}setup(){const e=new vw.ButtonWidget;return e.addClass(Zn),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",Zn)}onMouseMove(e){this.ctx.interactionManager.isState(Xn.Hoverable)&&this.show(e)}onMouseDrag(e){this.ctx.interactionManager.isState(Xn.AnnotationsMoveable)&&this.show(e)}onMouseLeave(){this.ctx.interactionManager.isState(Xn.Hoverable)&&this.hide()}onClick(e){this.ctx.interactionManager.isState(Xn.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(Xn.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,u]=[0,s.height],[p,g]=[0,s.width];if(a&&(e=yo(tl(e-s.x,n),n)+s.x,t=yo(tl(t-s.y,n),n)+s.y),i===Dw.X){const y=c-Math.max(0,r-5);e=e-l/2,t=o==="top"?h-c+y:u-y}else{const y=l-Math.max(0,r-9);e=o==="left"?p-l+y:g-y,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(`${Zn}-${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([kw],Jf.prototype,"enabled",2);import"ag-charts-community";import{EventEmitter as Aw,focusCursorAtEnd as Nw}from"ag-charts-core";import{_ModuleSupport as Lw}from"ag-charts-community";import{Color as ex,Vec2 as We,createButton as Hl,createCheckbox as Tw,createElement as Ao,createElementId as Hd,createSelect as ww,createTextArea as Cw,entries as tx,getIconClassNames as Ow,initRovingTabIndex as ix,mapValues as Kd,setAttribute as ox,setAttributes as Wd}from"ag-charts-core";var{DraggablePopover:Ew,NativeWidget:Gd}=Lw,sx=class Mm extends Ew{constructor(t,i){super(t,i),this.dragHandleDraggingClass="ag-charts-dialog__drag-handle--dragging",this.colorPicker=new zy(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)),this.ctx.agDocument.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=Ao("div","ag-charts-dialog__tabs"),a=Kd(o,()=>Hd()),n=Kd(o,()=>Hd());for(const[g,m]of tx(o))Wd(m.panel,{id:n[g],role:"tabpanel","aria-labelledby":a[g]});const r=g=>{for(const[m,y]of tx(o))y.panel.classList.toggle("ag-charts-dialog__tab-panel--active",m===g),h[m].classList.toggle("ag-charts-dialog__tab-button--active",m===g),ox(h[m],"aria-selected",m===g),m===g&&y.onShow?.()},l=new Gd(Ao("div","ag-charts-dialog__header"));l.addListener("drag-start",g=>{const{sourceEvent:m}=g;m.target instanceof Element&&m.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 Rw;this.setDragHandle(c);const h=Kd(o,(g,m)=>Hl({label:this.ctx.localeManager.t(g.label),onPress:()=>r(m)},{id:a[m],class:"ag-charts-dialog__tab-button",role:"tab","aria-controls":n[m]})),u=Ao("div","ag-charts-dialog__tab-list");Wd(u,{role:"tablist","aria-label":this.ctx.localeManager.t(t)}),u.append(...Object.values(h));const p=this.createHeaderCloseButton();return l.getElement().append(c.getElement(),u,p),s.append(l.getElement(),...Object.values(o).map(g=>g.panel)),r(i),ix({orientation:"horizontal",buttons:Object.values(h)}),{tabs:s,initialFocus:h[i]}}createTabPanel(){return Ao("div","ag-charts-dialog__tab-panel")}createInputGroupLine(){return Ao("div","ag-charts-dialog__input-group-line")}createRadioGroup({label:t,options:i,value:o,onChange:s}){const a=this.createInputGroup(t);Wd(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,u=this.ctx.localeManager.t(h),p=Hl({icon:c,altText:u,onPress:()=>{for(const g of Array.from(a.children))g.classList.remove(n),g.ariaChecked="false";p.classList.add(n),p.ariaChecked="true",s(l.value)}},{"aria-checked":l.value===o,class:"ag-charts-dialog__button",role:"radio",title:u});l.value===o&&p.classList.add(n),a.appendChild(p),r.push(p)}return ix({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=ww({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 Cw({value:i,onChange:o},{placeholder:s})}createCheckbox({label:t,checked:i,onChange:o}){const s=Hd(),a=this.createInputGroup(t,{for:s}),n=Tw({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),u=Hl({label:h,onPress:p=>{const{anchor:g,fallbackAnchor:m}=this.getColorPickerAnchors(u)??{};this.colorPicker.show({anchor:g,fallbackAnchor:m,color:t,opacity:i,isMultiColor:r,hasMultiColorOption:l,sourceEvent:p,onChange:(y,x,f,b)=>{u.style.setProperty("--color",y),u.classList.toggle("ag-charts-dialog__color-picker-button--multi-color",b),a(y,x,f,b)},onChangeHide:n})}},{"aria-label":h,tabindex:0,class:"ag-charts-dialog__color-picker-button",title:h});if(r)u.classList.toggle("ag-charts-dialog__color-picker-button--multi-color");else if(t){const p=ex.fromString(t),g=new ex(p.r,p.g,p.b,i);u.style.setProperty("--color",g.toHexString())}return c.append(u),this.hideFns.push(()=>{this.colorPicker.hide()}),c}createHeaderCloseButton(){return Hl({icon:"close",altText:this.ctx.localeManager.t("iconAltTextClose"),onPress:()=>this.hide()},{class:"ag-charts-dialog__close-button"})}createInputGroup(t,i){const o=Ao("div","ag-charts-dialog__input-group"),s=Ao("label","ag-charts-dialog__input-group-label");return s.innerText=this.ctx.localeManager.t(t),ox(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=this.getPopoverElement();if(!t||!o)return;const s=i.domManager.getBoundingClientRect(),a=We.from(0,t.y),n=We.from(s.width,t.height),r=We.from(o),l=We.from(.5,1);let c;if(t.width>1e3){const h=We.sub(We.add(a,We.multiply(n,l)),We.multiply(r,l));c=We.sub(h,We.from(0,Mm.offset))}else{const h=We.sub(We.add(a,n),r);c=We.sub(h,Mm.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=We.sub(We.from(i.x,i.y),We.from(o.left,o.top)),a=We.add(s,We.from(0,i.height+5)),n=We.sub(s,We.from(0,5));return{anchor:a,fallbackAnchor:n}}};sx.offset=60;var Pw=sx,Rw=class extends Gd{constructor(){super(Ao("div","ag-charts-dialog__drag-handle"));const e=new Gd(Ao("span",Ow("drag-handle")));e.setAriaHidden(!0),this.addChild(e)}},_w=class extends Pw{constructor(e){super(e,"settings"),this.events=new Aw,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";Do(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:Do(e)?"dialogInputExtendChannelStart":"dialogInputExtendLineStart",checked:e.extendStart??!1,onChange:c=>t.onChangeLine({extendStart:c})}),this.createCheckbox({label:Do(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:()=>Nw(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:Fy.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:EL.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){const i=[["iconAltTextAlignLeft","left"],["iconAltTextAlignRight","right"]];this.ctx.domManager.isRtl&&i.reverse();const[[o,s],[a,n]]=i;return this.createRadioGroup({label:"dialogInputAlign",options:[{icon:"align-left",altText:o,value:s},{icon:"align-center",altText:"iconAltTextAlignCenter",value:"center"},{icon:"align-right",altText:a,value:n}],value:e,onChange:t})}};function jd(e){return e.gridPadding+e.seriesAreaPadding+e.tickSize+e.label.spacing}function zw(e,t,i){for(const{update:o}of Object.values(qt))o(e,t,i)}var{InteractionState:Ft,keyProperty:Bw,valueProperty:Vw,Selection:Fw,BBox:Hw}=el,Ka=class lA extends rN{constructor(t){super(),this.ctx=t,this.toolbar=new Fl(this.ctx),this.optionsToolbar=new Sd(this.ctx,()=>{const i=this.state.getActive();if(i!=null)return Us(this.annotationData.at(i))}),this.axesButtons=new Jh,this.enabled=!0,this.snap=!1,this.data=void 0,this.xKey=void 0,this.volumeKey=void 0,this.annotationData=new hN(lA.createAnnotationDatum),this.defaults=new ML,this.container=new el.Group({name:"static-annotations"}),this.annotations=new Fw(this.container,this.createAnnotationScene.bind(this)),this.settingsDialog=new _w(this.ctx),this.textInput=new xN(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(),this.textInput.destroy()})}setupStateMachine(){const{ctx:t}=this;return new Bl({resetToIdle:()=>{t.domManager.updateCursor("annotations"),this.popAnnotationState(Ft.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)=>this.annotations.at(o)?.getNodeAtCoords(i.x,i.y),translate:(i,o)=>{const s=this.annotations.at(i),a=Us(this.annotationData.at(i));if(!(!s||!a))return this.translateNode(s,a,o)},copy:i=>{const o=this.annotations.at(i),s=Us(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}=this;this.hideOverlays(),this.textInput.isVisible()||(this.toolbar.clearActiveButton(),this.toolbar.resetButtonIcons());const n=i==null?null:s.at(i),r=o==null?null:s.at(o),l=i==null?null:this.annotationData.at(i);r===n&&n!=null||(r?.toggleActive(!1),a.hide(),n&&!l?.readOnly?(this.pushAnnotationState(Ft.AnnotationsSelected),n.toggleActive(!0),jo(l)||(a.updateButtons(this.annotationData.at(i)),this.postUpdateFns.push(()=>{a.show(),a.setAnchorScene(n)}))):(this.popAnnotationState(Ft.AnnotationsSelected),this.popAnnotationState(Ft.Annotations)),jo(l)||this.deleteEphemeralAnnotations(),this.update())},selectLast:()=>(this.pushAnnotationState(Ft.AnnotationsSelected),this.annotationData.length-1),startInteracting:()=>{this.pushAnnotationState(Ft.Annotations)},stopInteracting:()=>{this.popAnnotationState(Ft.Annotations)},create:(i,o)=>{this.createAnnotation(i,o)},delete:i=>{this.annotationData.splice(i,1)},deleteAll:()=>{const i=this.annotationData.filter(o=>o.readOnly?o:!1);this.annotationData.splice(0,this.annotationData.length,...i)},validatePoint:(i,o)=>{const s=this.getAnnotationContext();return s?Al(s,i,o):!0},getAnnotationType:i=>vN(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=Us(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=>_s.add(o.getTextInputCoords(n,c),_s.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||jo(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(!dl(a)&&!Do(a)&&!Wn(a)||jo(a))return;const n=c=>(h,u,p,g)=>{this.setColorAndDefault(a.type,c,h,u,p,g),this.optionsToolbar.updateColorPickerColor(c,u,p,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(jn.find(h=>h.value===c)??jn[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-complete",()=>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(Ft.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:u,opacity:p,isMultiColor:g})=>{this.setColorAndDefault(l,c,h,u,p,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(Zn),i.destroy(),o.destroy()})}async processData(t){if(!this.enabled||this.data==null||this.xKey==null||this.volumeKey==null)return;const i=[Bw(this.xKey,void 0,{id:"date"}),Vw(this.volumeKey,"number",{id:"volume"})],o=el.DataSet.wrap(this.data)??el.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 qt)return new qt[t.type].scene;throw new Error(`AG Charts - Cannot create annotation scene of type [${t.type}], expected one of [${Object.keys(qt)}], ignoring.`)}static createAnnotationDatum(t){if(t.type in qt)return new qt[t.type].datum().set(t);throw new Error(`AG Charts - Cannot create annotation datum of unknown type [${t.type}], expected one of [${Object.keys(qt)}], 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=Ke(t),n=Ke(i);if(!qh(a)||!qh(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&&u<=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 qt)return qt[t.type];throw new Error(`AG Charts - Cannot get annotation config of unknown type [${t.type}], expected one of [${Object.keys(qt)}], ignoring.`)}onRestoreAnnotations(t){if(!this.enabled)return;const{annotations:i}=t;if(this.annotationData.length===i.length&&i.every((s,a)=>{const n=this.annotationData.at(a);return n!=null&&n.type===s.type}))for(let s=0;s{this.ctx.annotationManager.fireChangedEvent()}),this.update()}onLayoutComplete(t){if(!this.enabled)return;const i=t.series.paddedRect;this.seriesRect=i,this.container.setClipRect(i),this.xAxis=this.getAxis(t.axes[Qh.X],i,this.xAxis?.button),this.yAxis=this.getAxis(t.axes[Qh.Y],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.enabled&&(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 Hw(0,0,i.width,i.height).grow(r,a),c=n===Qh.X?"vertical":"horizontal",{axesButtons:h,snap:u}=this;if(this.enabled&&h.enabled&&(h.axes==="xy"||h.axes===n)){o??(o=new Jf(this.ctx,{...s,snapToGroup:u},m=>this.onAxisButtonClick(m,c),i));const g=jd(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),zw(r,l,a)});for(const r of this.postUpdateFns)r();this.postUpdateFns=[]}getAnnotationContext(){const{seriesRect:t,xAxis:i,yAxis:o,snap:s,ctx:a}=this;if(!(!t||!i||!o))return{seriesRect:t,isRtl:a.domManager.isRtl,xAxis:{...i.context,bounds:i.bounds,labelPadding:jd(i.layout),snapToGroup:s},yAxis:{...o.context,bounds:o.bounds,labelPadding:jd(i.layout),snapToGroup:s}}}onHover(t){const{state:i}=this,o=this.getAnnotationContext();if(!o)return;const s=t.sourceEvent.shiftKey,a=_s.from(t),n=Nt(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=Nt(_s.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=_s.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(Ft.Annotations);const a=i==="horizontal";if(s.transition(a?"horizontal-line":"vertical-line"),this.optionsToolbar.hide(),!t)return;const n=Nt(t,o);Al(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(Ft.AnnotationsSelected)&&t.sourceEvent.preventDefault()}onDragStart(t){if(!this.ctx.interactionManager.isState(Ft.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=_s.from(t),s=Nt(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(Ft.AnnotationsDraggable))return;const i=this.getAnnotationContext();if(!i)return;const o=_s.from(t),s=Nt(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},u=Math.max(o?.xAxis.scale.bandwidth??0,c?10:1),p=Math.max(o?.yAxis.scale.bandwidth??0,c?10:1);switch(s.key){case"ArrowDown":h.y=p;break;case"ArrowUp":h.y=-p;break;case"ArrowLeft":h.x=-u;break;case"ArrowRight":h.x=u;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())jo(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(Ft.Annotations)||this.ctx.interactionManager.isState(Ft.AnnotationsSelected)}update(t=lN.PRE_SCENE_RENDER){this.ctx.eventsHub.emit("chart:request-update",{type:t})}};d([Vn],Ka.prototype,"toolbar",2),d([Vn],Ka.prototype,"optionsToolbar",2),d([Vn],Ka.prototype,"axesButtons",2),d([Vn,cN((e,t)=>{const i=t??!0;e.toolbar.enabled=i,e.optionsToolbar.enabled=i,e.axesButtons.enabled=i})],Ka.prototype,"enabled",2),d([Vn],Ka.prototype,"snap",2);var Kw=Ka;import"ag-charts-community";import*as rt from"ag-charts-core";import{FONT_SIZE_RATIO as $d}from"ag-charts-core";var vi={stroke:{$ref:"foregroundColor"},strokeOpacity:1,strokeWidth:2},lt={fill:rt.DEFAULT_ANNOTATION_HANDLE_FILL,strokeOpacity:1,strokeWidth:2},Ys={color:{$ref:"chartBackgroundColor"},fontSize:{$rem:$d.LARGE},fontFamily:{$ref:"fontFamily"}},ax={...Ys,enabled:!0,fill:{$ref:"foregroundColor"},fontSize:{$ref:"fontSize"}},Kl={...Ys,textAlign:"start"},Xs={...Ys,position:"top",alignment:"center",color:{$ref:"textColor"}},nx={...Ys,position:"top",alignment:"center",color:{$ref:"textColor"}},Ud={...Ys,fontSize:{$ref:"fontSize"},color:rt.DEFAULT_ANNOTATION_STATISTICS_COLOR,fill:rt.DEFAULT_ANNOTATION_STATISTICS_FILL,stroke:rt.DEFAULT_ANNOTATION_STATISTICS_STROKE,strokeWidth:1,divider:{stroke:rt.DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE,strokeWidth:1,strokeOpacity:.5}},Yd={...vi,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...lt},text:{...Xs},statistics:{...Ud}},Ww={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"}},Gw={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"}]}},jw={enabled:!1,line:{...vi,handle:{...lt},text:{...Xs}},"horizontal-line":{...vi,handle:{...lt},axisLabel:{...ax},text:{...Xs}},"vertical-line":{...vi,handle:{...lt},axisLabel:{...ax},text:{...Xs}},"disjoint-channel":{...vi,background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...lt},text:{...nx}},"parallel-channel":{...vi,middle:{lineDash:[6,5],strokeWidth:1},background:{fill:{$ref:"foregroundColor"},fillOpacity:.075},handle:{...lt},text:{...nx}},"fibonacci-retracement":{...vi,strokes:rt.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...lt},text:{...Xs,position:"center"},label:{...Ys,color:void 0,fontSize:{$rem:$d.SMALLER}}},"fibonacci-retracement-trend-based":{...vi,strokes:rt.DEFAULT_FIBONACCI_STROKES,rangeStroke:{$ref:"foregroundColor"},handle:{...lt},text:{...Xs,position:"center"},label:{...Ys,color:void 0,fontSize:{$rem:$d.SMALLER}}},callout:{...vi,...Kl,color:{$ref:"textColor"},handle:{...lt},fill:{$ref:"foregroundColor"},fillOpacity:.075},comment:{...Kl,fontWeight:700,handle:{...lt},fill:{$ref:"foregroundColor"}},note:{...Kl,color:rt.DEFAULT_TEXTBOX_COLOR,fill:rt.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...lt},background:{fill:rt.DEFAULT_TEXTBOX_FILL,stroke:rt.DEFAULT_TEXTBOX_STROKE,strokeWidth:1}},text:{...Kl,color:{$ref:"textColor"},handle:{...lt}},arrow:{...vi,handle:{...lt},text:{...Xs}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...lt,stroke:{$ref:"foregroundColor"}}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...lt,stroke:{$ref:"foregroundColor"}}},"date-range":{...Yd},"price-range":{...Yd},"date-price-range":{...Yd},"quick-date-price-range":{up:{...vi,fill:rt.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,fillOpacity:.2,handle:{...lt},statistics:{...Ud,color:"#fff",fill:rt.DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...vi,stroke:rt.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE,fill:rt.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,fillOpacity:.2,handle:{...lt,stroke:rt.DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE},statistics:{...Ud,color:"#fff",fill:rt.DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{},toolbar:Ww,optionsToolbar:Gw},Xd={type:"plugin",name:"annotations",chartType:"cartesian",enterprise:!0,version:oN,options:sN.annotationOptionsDef,themeTemplate:jw,create:e=>new Kw(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new hy(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}};import{VERSION as $w}from"ag-charts-community";import{_ModuleSupport as Uw}from"ag-charts-community";import{AbstractModuleInstance as Yw,ChartAxisDirection as Xw,ChartUpdateType as rx,Property as Ei,ZIndexMap as Zw,createId as Qw}from"ag-charts-core";var{Range:qw,TranslatableGroup:Jw,BBox:eC,FillGradientDefaults:tC,FillImageDefaults:iC,FillPatternDefaults:oC,getShapeFill:sC,InteractionState:Wl}=Uw,Jt=class extends Yw{constructor(e){super(),this.ctx=e,this.id=Qw(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 tC,this.fillPatternDefaults=new oC,this.fillImageDefaults=new iC,this.bounds=new eC(0,0,0,0),this.bandHighlightGroup=new Jw({name:"bandHighlight",zIndex:Zw.AXIS_BAND_HIGHLIGHT}),this.rangeNode=this.bandHighlightGroup.appendChild(new qw),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.eventsHub.emit("chart:request-update",{type:rx.SCENE_RENDER}))});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-complete",()=>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(Wl.Hoverable)&&this.onHighlightChange()}onKeyPress(){this.ctx.interactionManager.isState(Wl.Default)&&this.onHighlightChange()}onHoverLikeEvent(e){const t=this.isHover(e)?Wl.Hoverable:Wl.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[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:u}=this;u&&(e.stroke=t,e.strokeWidth=i,e.strokeOpacity=o,e.lineDash=s,e.lineDashOffset=h,e.fill=sC(a,r,l,c),e.fillOpacity=n,e.startLine=!0,e.endLine=!0)}isVertical(){return this.axisCtx.direction===Xw.X}onHighlightChange(e){this.enabled&&(this.activeAxisHighlight=e,this.activeAxisHighlight?this.showBand():this.hideBand(),this.ctx.eventsHub.emit("chart:request-update",{type:rx.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}};Jt.className="BandHighlight",d([Ei],Jt.prototype,"enabled",2),d([Ei],Jt.prototype,"stroke",2),d([Ei],Jt.prototype,"lineDash",2),d([Ei],Jt.prototype,"lineDashOffset",2),d([Ei],Jt.prototype,"strokeWidth",2),d([Ei],Jt.prototype,"strokeOpacity",2),d([Ei],Jt.prototype,"fill",2),d([Ei],Jt.prototype,"fillOpacity",2),d([Ei],Jt.prototype,"fillGradientDefaults",2),d([Ei],Jt.prototype,"fillPatternDefaults",2),d([Ei],Jt.prototype,"fillImageDefaults",2);var Zd={type:"axis:plugin",name:"bandHighlight",chartType:"cartesian",axisTypes:["category","ordinal-time","unit-time","grouped-category"],enterprise:!0,version:$w,themeTemplate:{enabled:!1,strokeWidth:0,lineDash:[],fill:{$foregroundBackgroundMix:.05}},create:e=>new Jt(e)};import{VERSION as aC}from"ag-charts-community";import{boolean as nC}from"ag-charts-core";import{_ModuleSupport as rC}from"ag-charts-community";import{AbstractModuleInstance as lC,ActionOnSet as cC,Logger as hC,Property as dC}from"ag-charts-core";var{LayoutElement:uC,Menu:pC}=rC,Qd=[{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"}],lx=class extends lC{constructor(e){super(),this.ctx=e,this.enabled=!1,this.menuMargin=6,this.menu=new pC(this.ctx,"chart-toolbar"),this.menuShowing=!1,this.toolbar=e.sharedToolbar.getSharedToolbar("chartToolbar"),this.cleanup.register(this.toolbar.addToolbarListener("button-pressed",this.onButtonPressed.bind(this)),e.layoutManager.registerElement(uC.ToolbarLeft,this.onLayoutStart.bind(this)),e.eventsHub.on("series-area:click",()=>this.hidePopover()),()=>this.toolbar.destroy())}onLayoutStart(e){this.enabled&&(this.updateButton(),this.toolbar.layout(e.layoutBox))}onButtonPressed({event:e,buttonBounds:t,buttonWidget:i}){const o=this.ctx.domManager.isRtl?t.x-this.menuMargin:t.x+t.width+this.menuMargin;this.menu.setAnchor({x:o,y:t.y}),this.menu.show(i,{items:Qd,menuItemRole:"menuitemradio",ariaLabel:this.ctx.localeManager.t("toolbarSeriesTypeDropdown"),class:"ag-charts-chart-toolbar__menu",value:this.getChartType(),sourceEvent:e.sourceEvent,onPress:s=>{this.setChartType(s.value),this.hidePopover()},onHide:()=>{this.toolbar.clearActiveButton(),this.menuShowing=!1}}),this.menuShowing=!0,this.toolbar.toggleActiveButtonByIndex(0)}updateButton(){const e=this.getChartType(),t=Qd.find(i=>i.value===e)?.icon;t!=null&&this.toolbar.updateButtons([{icon:t,tooltip:"toolbarSeriesTypeDropdown",value:"menu"}])}hidePopover(){this.menuShowing&&(this.menuShowing=!1,this.toolbar.clearActiveButton()),this.menu.hide()}setChartType(e){const t={chartType:e};this.ctx.chartService.publicApi?.updateDelta(t).catch(i=>hC.error(i))}getChartType(){const e=this.ctx.chartService.publicApi?.getOptions()?.chartType;return e==null||!Qd.some(t=>t.value===e)?"candlestick":e}};d([dC,cC({changeValue(e){this.toolbar?.setHidden(!e)}})],lx.prototype,"enabled",2);var Gl={type:"plugin",name:"chartToolbar",chartType:"cartesian",enterprise:!0,version:aC,options:{enabled:nC},create:e=>new lx(e),patchContext:e=>{e.sharedToolbar||(e.sharedToolbar=new hy(e),e.cleanup.register(()=>e.sharedToolbar.destroy()))}};import{VERSION as gC}from"ag-charts-community";import{IS_DARK_THEME as mC,boolean as cx,callbackOf as yC,contextMenuItemsArray as hx,undocumented as fC}from"ag-charts-core";import{_ModuleSupport as qd,_Widget as dx}from"ag-charts-community";import{AbstractModuleInstance as xC,Logger as Jd,Property as jl,callWithContext as $l,clamp as ux,createElement as Qn,getIconClassNames as SC,toPlainText as px}from"ag-charts-core";import{isKeyOf as gx}from"ag-charts-core";function eu(e,t){return e==="always"?!0:e==="series-area"?t==="series-area"||t==="series-node":e===t}function mx(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=eu(t.showOn??"always",e)),o){const s=new MC(t);return i.push(s),s}}function yx(e,t,i,o){t.isVisible(i)&&mx(e,t.builtins.items[i],o)}function bC(e,t,i,o){const{builtins:s}=t;if(gx(i,s.lists))for(const a of s.lists[i])yx(e,t,a,o);else yx(e,t,i,o)}function vC(e,t,i){const o=[],{builtins:s}=i;for(const a of t)if(typeof a=="string"&&gx(a,s.lists))for(const n of s.lists[a])o.push(n);else o.push(a);return o.filter(a=>{if(typeof a=="string"){const n=i.builtins.items[a].showOn??"always";return i.isVisible(a)&&eu(n,e)}else return eu(a.showOn??"always",e)})}function fx(e,t,i,o){for(const s of i)if(typeof s=="string")bC(e,t,s,o);else{const a=mx(e,s,o);s.items&&a&&s.items.length>0&&fx(e,t,s.items,a.items)}o.at(-1)?.type==="separator"&&o.pop()}var MC=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])}},No="ag-charts-context-menu",{getItemId:DC,ContextMenuRegistry:qn}=qd,tu="context-menu",kC=["angleKey","calloutLabelKey","colorKey","labelKey","radiusKey","sectorLabelKey","sizeKey","xKey","yKey"],Jn=class extends xC{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 dx.MenuWidget,this.interactionManager=e.interactionManager,this.element=e.domManager.addChild("canvas-overlay",tu),this.element.classList.add(No),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(`${No}__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=>{Jd.error("Unable to download chart",o)})},this.cleanup.register(this.ctx.eventsHub.on("context-menu:complete",t=>this.onContext(t)))}makeGetItemsParams(e){const{showOn:t}=e,{context:i}=this.ctx.chartService,o=vC(t,this.items,this.ctx.contextMenuRegistry);switch(t){case"always":case"series-area":return{showOn:t,context:i,defaultItems:o};case"series-node":{if(this.pickedNode==null)throw new Error("this.pickedNode is null");const c={showOn:t,context:i,seriesId:this.pickedNode.series.id,itemId:DC(this.pickedNode,this.pickedNode.series.data?.dataIdKey),datum:this.pickedNode.datum,defaultItems:o};for(const h of kC)this.pickedNode[h]!==void 0&&(c[h]=this.pickedNode[h]);return c}case"legend-item":if(this.pickedLegendItem==null)throw new Error("this.pickedLegendItem is null");const{itemId:s,seriesId:a,label:n,enabled:r}=this.pickedLegendItem,l=px(n.text);return{showOn:t,context:i,itemId:s,seriesId:a,text:l,visible:r,defaultItems:o};default:return t}}expandItemsOptions(e){const t=[];let i;if(this.getItems){const o=this.makeGetItemsParams(e);i=this.getItems(o)}return i??(i=this.items),fx(e.showOn,this.ctx.contextMenuRegistry,i,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,qn.check("series-node",e)?this.pickedNode=e.context.pickedNode:qn.check("legend-item",e)&&(this.pickedLegendItem=e.context.legendItem);const t=this.expandItemsOptions(e);t.length!==0&&this.show(e.widgetEvent,t)}show(e,t){const{sourceEvent:i}=e;this.interactionManager.pushState(qd.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(qd.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{isRtl:o}=this.ctx.domManager,s=this.ctx.domManager.getBoundingClientRect(),a=e.getBoundingClientRect(),n=s.right-a.right,r=a.left-s.left,{offsetWidth:l,offsetHeight:c}=t.getElement();let h=i.y;if(s.height>c){const g=s.bottom-a.top;g=l){const g=u==="right"?i.x+i.width:i.x-l;t.setBounds({x:g,y:h})}else{const g=u==="right"?i.x-l:i.x+i.width,m=(u==="right"?r:n)-l;m>=0?t.setBounds({x:g,y:h}):t.setBounds({x:g+(u==="right"?-m:m),y:h})}}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(`${No}__divider`);break}case"action":{if(i.items.length===0){const o=new dx.MenuItemWidget;this.initButtonElement(o,i),e.addChild(o)}else{const{subMenuButton:o,subMenu:s}=e.addSubMenu();s.addClass(`${No}__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 qn.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,c=[r.series.find(u=>u.id===s)?.properties,r],h={type:"contextmenu",seriesId:s,itemId:a,text:px(n.text),event:o};$l(c,t,h),this.hide()}else Jd.error("legend item not found")}:qn.checkCallback("series-area",e,t)?()=>{const i=this.ctx.chartService,o={type:"seriesContextMenuAction",event:this.showEvent};$l(i,t,o),this.hide()}:qn.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?$l(a,t,n):Jd.error("series node not found"),this.hide()}:()=>{const i=this.ctx.chartService,o={type:"contextMenuEvent",event:this.showEvent};$l(i,t,o),this.hide()}}initTableCells(e){const t=Qn("div"),i=Qn("div"),o=Qn("div");return t.classList.toggle(`${No}__icon`,!0),i.classList.toggle(`${No}__cell`,!0),o.classList.toggle(`${No}__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(`${No}__item`),e.setEnabled(t.enabled);const i=this.ctx.localeManager.t(t.label),o=`${No}__cellpadding`,{cellIcon:s,cellLabel:a,cellArrow:n}=this.initTableCells(e.getElement());if(a.textContent=i,a.classList.add(o),t.iconUrl!=null){const c=Qn("img");c.src=t.iconUrl,s.append(c),s.classList.add(o)}if(t.items.length>0){const c=Qn("span",SC("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(){const{isRtl:e}=this.ctx.domManager;let{x:t,y:i}=this;this.element.style.top="unset",this.element.style.bottom="unset";const o=this.ctx.domManager.getBoundingClientRect(),{offsetWidth:s,offsetHeight:a}=this.element;t=ux(0,e?t-s:t,o.width-s),i=ux(0,i,o.height-a),this.element.style.left=`${t}px`,this.element.style.top=`calc(${i}px - 0.5em)`}destroy(){super.destroy(),this.mutationObserver?.disconnect(),this.ctx.domManager.removeStyles(tu),this.ctx.domManager.removeChild("canvas-overlay",tu)}};d([jl],Jn.prototype,"enabled",2),d([jl],Jn.prototype,"darkTheme",2),d([jl],Jn.prototype,"items",2),d([jl],Jn.prototype,"getItems",2);var er={type:"plugin",name:"contextMenu",enterprise:!0,version:gC,options:{enabled:cx,items:hx,getItems:yC(hx,"a menu items array")},themeTemplate:{enabled:!0,darkTheme:mC},create:e=>new Jn(e)};er.options.darkTheme=fC(cx);import{VERSION as IC}from"ag-charts-community";import{_ModuleSupport as xx}from"ag-charts-community";import{AbstractModuleInstance as AC,ChartAxisDirection as Sx,ChartUpdateType as Ul,Property as as,ZIndexMap as bx,createId as NC,toPlainText as LC}from"ag-charts-core";function tr(e){return typeof e?.datum=="object"?e.datum:null}import{_ModuleSupport as TC}from"ag-charts-community";import{BaseProperties as wC,Property as Wa,createId as CC}from"ag-charts-core";var{FormatManager:OC}=TC,EC="ag-charts-crosshair-label",ns=class extends wC{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,u=o.type==="date"?o.step:void 0;l=e(s,{value:i,domain:n,fractionDigits:c,unit:h,step:u,boundSeries:r})}if(a!=null){let c=this._cachedFormatter;(c?.type!==t||c?.format!==a)&&(c={type:t,format:a,formatter:OC.getFormatter(t,a)},this._cachedFormatter=c),l??(l=c.formatter?.(i))}return l==null?void 0:String(l)}};d([Wa],ns.prototype,"enabled",2),d([Wa],ns.prototype,"xOffset",2),d([Wa],ns.prototype,"yOffset",2),d([Wa],ns.prototype,"formatter",2),d([Wa],ns.prototype,"format",2),d([Wa],ns.prototype,"renderer",2);var vx=class extends ns{constructor(e,t,i){super(),this.domManager=e,this.id=CC(this),this.elementProxy=e.addDeferredProxyChild("canvas-overlay",`crosshair-label-${this.id}`),this.elementProxy.toggleClass(EC,!0),this.elementProxy.setAttr("aria-hidden","true"),this.elementProxy.setAttr("data-key",t),this.elementProxy.setAttr("data-axis-id",i)}show(e){const t=Math.round(e.x+this.xOffset),i=Math.round(e.y+this.yOffset);this.elementProxy.setProperty("left",`${t}px`),this.elementProxy.setProperty("top",`${i}px`);const o=e.translateX||e.translateY?`${e.translateX??"0"} ${e.translateY??"0"}`:"";this.elementProxy.setProperty("translate",o),this.toggle(!0)}setLabelHtml({html:e,styles:t}){e!==void 0&&this.elementProxy.setInnerHTML(e),t!==void 0&&this.elementProxy.setContentStyles(t)}toggle(e){this.elementProxy.toggleClass("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}}};vx.className="CrosshairLabel";var{Group:PC,TranslatableGroup:RC,Line:_C,BBox:Mx,InteractionState:rs}=xx,qi=class extends AC{constructor(e){super(),this.ctx=e,this.id=NC(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 ns,this.seriesRect=new Mx(0,0,0,0),this.bounds=new Mx(0,0,0,0),this.crosshairGroup=new RC({name:"crosshairs",zIndex:bx.SERIES_CROSSHAIR}),this.lineGroup=this.crosshairGroup.appendChild(new PC({name:`${this.id}-crosshair-lines`,zIndex:bx.SERIES_CROSSHAIR})),this.lineGroupSelection=xx.Selection.select(this.lineGroup,_C,!1),this.activeHighlight=void 0,this.activeHighlightInViewport=!1,this.axisCtx=e.parent,this.labels={},this.hideCrosshairs(),e.domManager.addEventListener("focusin",({target:i})=>{if(this.checkInteractionState())return;const o=i instanceof HTMLElement&&e.domManager.contains(i,"series-area");this.crosshairGroup.visible&&!o&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:Ul.SCENE_RENDER}))});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-complete",()=>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)))}checkInteractionState(){return this.ctx.interactionManager.isState(rs.Frozen)}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[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.snap&&this.activeHighlight)&&(this.updateLines(),this.updateLabels(l),!(this.snap&&!this.activeHighlightInViewport)&&this.refreshPositions())}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 vx(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===Sx.X}isHover(e){return e.type==="mousemove"||e.type==="click"||e.device==="touch"&&this.ctx.chartService.touch.dragAction==="hover"}formatValue(e){return LC(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)?rs.Hoverable|rs.Frozen:rs.AnnotationsMoveable;this.ctx.interactionManager.isState(t)&&(this.updatePositions(this.getData(e)),this.crosshairGroup.visible=!0,this.ctx.eventsHub.emit("chart:request-update",{type:Ul.SCENE_RENDER}))}onMouseOut(){const e=this.snap?rs.Hoverable:rs.Hoverable|rs.Frozen;this.ctx.interactionManager.isState(e)&&(this.hideCrosshairs(),this.ctx.eventsHub.emit("chart:request-update",{type:Ul.SCENE_RENDER}))}onKeyPress(){this.enabled&&!this.snap&&this.ctx.interactionManager.isState(rs.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.activeHighlightInViewport=e.highlightInViewport,!this.activeHighlight)this.hideCrosshairs();else if(this.snap)if(e.highlightInViewport){const n=this.getActiveHighlightData(this.activeHighlight);this.updatePositions(n),t.visible=!0}else this.hideCrosshairs();this.ctx.eventsHub.emit("chart:request-update",{type:Ul.SCENE_RENDER})}isInRange(e){return this.axisCtx.inRange(e)}refreshPositions(){this.activeHighlight&&this.updatePositions(this.getActiveHighlightData(this.activeHighlight))}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=tr(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=tr(e),l=i.getKeyProperties(t.direction),c=(t.scale.bandwidth??0)/2,h=i.axes[t.direction]?.id===t.axisId,u=l.includes("yKey")&&h,p=l.includes("xKey")&&h,g=s??a;if(u&&g!==void 0){const y=t.scale.convert(g)+c;return this.isInRange(y)?{yKey:{value:g,position:y}}:{}}if(p){const y=(this.isVertical()?n?.x:n?.y)??0,x=t.continuous?t.scaleInvert(y):r?.[o];return this.isInRange(y)?{xKey:{value:x,position:y}}:{}}const m={};for(const y of l){const x=i.properties[y],f=r?.[x],b=t.scale.convert(f)+c;this.isInRange(b)&&(m[y]={value:f,position:b})}return m}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 r=this.axisCtx.position;let l=this.axisLayout.label.spacing+this.axisLayout.tickSize;if(this.axisCtx.direction===Sx.X){l-=4;const c=r==="bottom";a.show({x:e,y:c?s.y+s.height+l:s.y-l,translateX:"-50%",translateY:c?"0":"-100%"})}else{l-=8;const c=r==="right";a.show({x:c?s.x+s.width+l:s.x-l,y:t,translateX:c?"0":"-100%",translateY:"-50%"})}}hideCrosshairs(){this.crosshairGroup.visible=!1;for(const e of Object.keys(this.labels))this.hideLabel(e)}hideLabel(e){this.labels[e]?.toggle(!1)}};qi.className="Crosshair",d([as],qi.prototype,"enabled",2),d([as],qi.prototype,"stroke",2),d([as],qi.prototype,"lineDash",2),d([as],qi.prototype,"lineDashOffset",2),d([as],qi.prototype,"strokeWidth",2),d([as],qi.prototype,"strokeOpacity",2),d([as],qi.prototype,"snap",2),d([as],qi.prototype,"label",2);var iu={type:"axis:plugin",name:"crosshair",chartType:"cartesian",enterprise:!0,version:IC,themeTemplate:{enabled:{$if:[{$or:[{$eq:[{$path:"../type"},"number"]},{$eq:[{$path:"../type"},"log"]},{$eq:[{$path:"../type"},"time"]},{$eq:[{$path:"../type"},"unit-time"]},{$eq:[{$path:"../type"},"ordinal-time"]}]},!0,!1]},snap:!0,stroke:{$ref:"subtleTextColor"},strokeWidth:1,strokeOpacity:1,lineDash:[5,6],lineDashOffset:0,label:{enabled:!0}},create:e=>new qi(e)};import{VERSION as zC}from"ag-charts-community";import{boolean as BC,callback as VC,positiveNumber as Dx,undocumented as ou}from"ag-charts-core";import"ag-charts-community";import{AbstractModuleInstance as FC,ActionOnSet as ir,Property as kx}from"ag-charts-core";var Ga=class extends FC{constructor(e){super(),this.enabled=!0,this.getData=()=>Promise.resolve(),this.dataService=e.dataService;let t=!1;this.cleanup.register(e.eventsHub.on("data:load",()=>{t=!0}),e.eventsHub.on("layout:complete",()=>{t&&e.zoomManager.updateZoom({source:"data-update",sourceDetail:"dataSource"})}))}updateCallback(e,t){this.dataService&&(e&&t!=null?this.dataService.updateCallback(t):this.dataService.clearCallback())}};d([ir({newValue(e){this.updateCallback(e,this.getData)}}),kx],Ga.prototype,"enabled",2),d([ir({newValue(e){this.updateCallback(this.enabled,e)}}),kx],Ga.prototype,"getData",2),d([ir({newValue(e){this.dataService.requestThrottle=e}})],Ga.prototype,"requestThrottle",2),d([ir({newValue(e){this.dataService.dispatchThrottle=e}})],Ga.prototype,"updateThrottle",2),d([ir({newValue(e){this.dataService.dispatchOnlyLatest=!e}})],Ga.prototype,"updateDuringInteraction",2);var Yl={type:"plugin",name:"dataSource",enterprise:!0,version:zC,options:{getData:VC,requestThrottle:ou(Dx),updateThrottle:ou(Dx),updateDuringInteraction:ou(BC)},create:e=>new Ga(e)};import{VERSION as HC}from"ag-charts-community";import{errorBarOptionsDefs as KC}from"ag-charts-core";import{_ModuleSupport as Ix}from"ag-charts-community";import{AbstractModuleInstance as WC,ChartAxisDirection as or,Logger as GC,isDefined as Ht,mergeDefaults as jC}from"ag-charts-core";import{_ModuleSupport as sr}from"ag-charts-community";import{mergeDefaults as Ax,nearestSquared as $C,nearestSquaredInContainer as UC,partialAssign as YC}from"ag-charts-core";var{BBox:ls}=sr,XC=class{constructor(e){this.components=e,this.union=ls.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}},ZC=class extends sr.Group{constructor(){super(),this.capLength=Number.NaN,this._datum=void 0,this.whiskerPath=new sr.Path,this.capsPath=new sr.Path,this.bboxes=new XC([]),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=Ax(l,n),a=Ax(l?.cap,l,a)}return{whiskerStyle:n,capsStyle:a}}applyStyling(e,t){YC(["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 u=this.capLength/2,p=this.capsPath;this.applyStyling(p,n),p.path.clear(!0),l!==void 0&&(p.path.moveTo(l.lowerPoint.x-u,l.lowerPoint.y),p.path.lineTo(l.lowerPoint.x+u,l.lowerPoint.y),p.path.moveTo(l.upperPoint.x-u,l.upperPoint.y),p.path.lineTo(l.upperPoint.x+u,l.upperPoint.y)),r!==void 0&&(p.path.moveTo(r.lowerPoint.x,r.lowerPoint.y-u),p.path.lineTo(r.lowerPoint.x,r.lowerPoint.y+u),p.path.moveTo(r.upperPoint.x,r.upperPoint.y-u),p.path.lineTo(r.upperPoint.x,r.upperPoint.y+u)),p.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 ls(o.lowerPoint.x,o.upperPoint.y,t.strokeWidth,r),new ls(o.lowerPoint.x-a,o.lowerPoint.y,e,i.strokeWidth),new ls(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 ls(s.lowerPoint.x,s.upperPoint.y,r,t.strokeWidth),new ls(s.lowerPoint.x,s.lowerPoint.y-a,i.strokeWidth,e),new ls(s.upperPoint.x,s.upperPoint.y-a,i.strokeWidth,e))}this.bboxes.components=n,this.bboxes.union=ls.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}=$C(e,t,o.components);return{nearest:this,distanceSquared:s}}},QC=class extends sr.Group{nearestSquared(e,t){const{nearest:i,distanceSquared:o}=UC(e,t,{children:this.children()});if(i!==void 0&&!Number.isNaN(o))return{datum:i.datum,distanceSquared:o}}};import"ag-charts-community";import{BaseProperties as Nx,Property as pe}from"ag-charts-core";var Lo=class extends Nx{};d([pe],Lo.prototype,"visible",2),d([pe],Lo.prototype,"stroke",2),d([pe],Lo.prototype,"strokeWidth",2),d([pe],Lo.prototype,"strokeOpacity",2),d([pe],Lo.prototype,"lineDash",2),d([pe],Lo.prototype,"lineDashOffset",2),d([pe],Lo.prototype,"length",2),d([pe],Lo.prototype,"lengthRatio",2);var ct=class extends Nx{constructor(){super(...arguments),this.visible=!0,this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.cap=new Lo}};d([pe],ct.prototype,"yLowerKey",2),d([pe],ct.prototype,"yLowerName",2),d([pe],ct.prototype,"yUpperKey",2),d([pe],ct.prototype,"yUpperName",2),d([pe],ct.prototype,"xLowerKey",2),d([pe],ct.prototype,"xLowerName",2),d([pe],ct.prototype,"xUpperKey",2),d([pe],ct.prototype,"xUpperName",2),d([pe],ct.prototype,"visible",2),d([pe],ct.prototype,"stroke",2),d([pe],ct.prototype,"strokeWidth",2),d([pe],ct.prototype,"strokeOpacity",2),d([pe],ct.prototype,"lineDash",2),d([pe],ct.prototype,"lineDashOffset",2),d([pe],ct.prototype,"itemStyler",2),d([pe],ct.prototype,"cap",2);var{fixNumericExtent:qC,groupAccumulativeValueProperty:JC,valueProperty:Xl}=Ix,e2=class jr extends WC{constructor(t){super(),this.properties=new ct;const i=t.series,{annotationGroup:o,annotationSelections:s}=i;this.cartesianSeries=i,this.groupNode=new QC({name:`${o.id}-errorBars`}),o.appendChild(this.groupNode),this.selection=Ix.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 Ht(t)&&Ht(i)||Ht(o)&&Ht(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(Xl(a,h,{id:`${l}-lower`}),Xl(n,h,{id:`${l}-upper`})),o!=null&&s!=null&&i.push(Xl(o,c,{id:`${r}-lower`}),Xl(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:u}=t,p=o.seriesGrouping?.groupIndex??o.id,g={invalidValue:null,missingValue:0,separateNegative:!0,...o.visible?{}:{forceValue:0}},m=(x,f,b,S)=>JC(x,"normal",{id:`${f}-${b}`,groupId:`errorGroup-${p}-${b}`,...g},S),y=(x,f,b,S)=>{i.push(...m(x,b,"lower",S),...m(f,b,"upper",S))};return n!=null&&r!=null&&y(n,r,c,u),s!=null&&a!=null&&y(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===or.X?Ht(i)&&Ht(o):Ht(a)&&Ht(n)){const{dataModel:c,processedData:h,cartesianSeries:u}=this;if(c!=null&&h!=null){const p={x:s,y:r}[t],g=c.getDomain(u,`${p}-lower`,"value",h).domain,m=c.getDomain(u,`${p}-upper`,"value",h).domain,y=[Math.min(...g,...m),Math.max(...g,...m)];return qC(y)}}return[]}onDataUpdate(t){this.dataModel=t.dataModel,this.processedData=t.processedData,Ht(t.dataModel)&&Ht(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[or.X]?.scale,o=this.cartesianSeries.axes[or.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===or.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===or.Y&&l.reverse();const c=[];for(let h=0;hnew e2(e)};import{VERSION as t2}from"ag-charts-community";import{boolean as i2,color as o2,positiveNumber as Lx,ratio as s2,strictUnion as a2}from"ag-charts-core";import{_ModuleSupport as au}from"ag-charts-community";import{BaseProperties as n2,ChartAxisDirection as Zl,CleanupRegistry as r2,Logger as l2,Property as ja,ZIndexMap as c2,createId as h2,easeOut as d2}from"ag-charts-core";var{Group:u2,Rect:Tx,Selection:p2,TranslatableGroup:g2}=au,wx=2,Cx=1,m2=2,y2=1e-6,Ox={remove:0,update:1,add:2};function f2(e,t,i,o){for(const s of t)!e.has(s)&&!o?.has(s)&&e.set(s,i)}function x2(e,t){const i=new Map;for(const o of e.flatMap(s=>Object.values(s))){const s=t?o.moved:void 0;f2(i,o.updated,"update",s);for(const a of o.removed)i.set(a,"remove");for(const a of o.added)i.set(a,"add")}return i}function S2(e){for(const t of[Zl.X,Zl.Y])for(const i of e.axisManager.getAxisContext(t))if(au.BandScale.is(i.scale))return i}function b2(e,t){return t>0&&e>0&&t/e{const h=Ox[l.phase]-Ox[c.phase];return h==0?l.bounds[o]-c.bounds[o]:h}),n=[a[0]];let r=n[0];for(let l=1;lnew Tx({name:"flash-on-update-band"})),this.cleanup.register(this.ctx.scene.attachNode(this.flashGroup),this.ctx.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),this.ctx.eventsHub.on("datamodel:diff",t=>this.onDataModelDiff(t)),this.ctx.updateService.addListener("pre-scene-render",t=>this.onPreSceneRender(t)))}destroy(){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.cleanup.flush()}onLayoutComplete({chart:e,series:t}){this.enabled&&(this.chartFlashRect.x=0,this.chartFlashRect.y=0,this.chartFlashRect.width=e.width,this.chartFlashRect.height=e.height,this.seriesRect=t.rect.clone(),this.bandGroup.translationX=Math.round(this.seriesRect.x),this.bandGroup.translationY=Math.round(this.seriesRect.y),this.bandGroup.setClipRect(this.seriesRect),this.axisCtx=S2(this.ctx))}resolveDomainValue(e){const t=this.axisCtx?.scale.domain;if(!t?.length||!Array.isArray(t[0]))return e;for(const i of t)if(String(i)===e)return i;return e}onDataModelDiff({diff:e}){this.enabled&&(this.pendingDiffs.push(e),this.item==="category"&&this.cachePreviousBounds(e))}onPreSceneRender({apiUpdate:e}){const t=this.pendingDiffs.length>0;if(!this.enabled||!e){this.pendingDiffs.length=0;return}if(!t)return;const i=this.pendingDiffs.some(n=>Object.values(n).some(r=>r.changed)),o=this.ctx.animationManager.isSkipped(),s=i?x2(this.pendingDiffs,o):void 0;if(this.pendingDiffs.length=0,!i)return;this.stopFlash();const a=s!=null&&s.size>0;this.item==="category"&&a?this.flashCategoryBands(s):this.flashChart()}flashChart(){!this.chartFlashRect.width||!this.chartFlashRect.height||(this.chartFlashRect.fill=this.fill,this.chartFlashRect.fillOpacity=0,this.animate([this.chartFlashRect],"update"))}cacheBounds(e){const t=this.measureBandBounds(e);t&&(this.previousBoundsCache??(this.previousBoundsCache=new Map),this.previousBoundsCache.set(e,t))}cachePreviousBounds(e){let t=!1;for(const i of Object.values(e)){(i.added.size>0||i.removed.size>0)&&(t=!0);for(const o of[...i.removed,...i.updated,...i.moved])this.cacheBounds(o)}if(t)for(const i of this.axisCtx?.scale.domain??[])this.previousBoundsCache?.has(String(i))||this.cacheBounds(String(i))}measureBandBounds(e){if(!this.axisCtx||!this.seriesRect)return;const t=this.axisCtx.measureBand(this.resolveDomainValue(e))?.band;if(!t)return;const[i,o]=t,s=Math.max(o-i,Cx);return this.axisCtx.direction===Zl.X?{x:i,y:0,width:s,height:this.seriesRect.height}:{x:0,y:i,width:this.seriesRect.width,height:s}}flashCategoryBands(e){const t=this.ctx.animationManager.isSkipped();if(t)for(const[o,s]of e)s==="remove"&&e.delete(o);if(!t&&this.hasScaleChange(e)){const o=this.axisCtx?.scale.domain??[];for(const s of o){const a=String(s);e.has(a)||e.set(a,"update")}}const i=this.createBandFlashData(e);i&&(this.updateSelection(i,t),this.animateBands())}hasScaleChange(e){for(const t of e.values())if(t==="add"||t==="remove")return!0;return!1}createBandFlashData(e){if(!this.axisCtx||!this.seriesRect){l2.warnOnce("flashOnUpdate item 'category' requires a cartesian category based axis such as 'category', 'ordinal-time', 'unit-time'");return}const{direction:t}=this.axisCtx,i=this.axisCtx.scale,o=t===Zl.X,s=o?this.seriesRect.width:this.seriesRect.height,a=this.measureBandsBatch(i,e,o);if(this.previousBoundsCache=void 0,a.length!==0)return v2(a,o,s)}measureBandsBatch(e,t,i){const o=e.bandwidth??0,a=((e.step??0)-o)/2,[n,r]=e.range,l=Math.min(n,r),c=Math.max(n,r),h=(i?this.seriesRect?.height:this.seriesRect?.width)??0,u=[];for(const[p,g]of t){if(g==="remove"){const v=this.previousBoundsCache?.get(p);v&&u.push({firstKey:p,lastKey:p,bounds:v,phase:g});continue}const m=e.convert(this.resolveDomainValue(p)),y=Math.max(m-a,l),x=Math.min(m+o+a,c),f=Math.max(x-y,Cx),b=i?{x:y,y:0,width:f,height:h}:{x:0,y,width:h,height:f},S=this.previousBoundsCache?.get(p);u.push({firstKey:p,lastKey:p,bounds:b,prevBounds:S,phase:g})}return u}updateSelection(e,t){this.bandSelection.update(e),this.bandSelection.each((i,o)=>{const s=t?o.bounds:o.prevBounds??o.bounds;i.fill=this.fill,i.fillOpacity=0,i.x=s.x,i.y=s.y,i.width=s.width,i.height=s.height})}animateBands(){const e=Array.from(this.bandSelection.nodes());if(this.ctx.animationManager.isSkipped()){this.animate(e,"update");return}const t=[],i=[],o=[];for(const s of e)s.datum.phase==="remove"?t.push(s):s.datum.phase==="add"?o.push(s):i.push(s);this.animate(t,"remove"),this.animate(i,"update"),this.animate(o,"add")}stopFlash(){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animate(e,t){if(e.length===0)return;const{animationManager:i}=this.ctx,o=this.getCustomTiming(t),s=o?.duration,a=o?.ease;i.animate({id:`${this.id}_${t}`,groupId:this.id,forceAnimation:!0,phase:t,duration:s,ease:a,from:{fillOpacity:this.fillOpacity},to:{fillOpacity:0},onUpdate:({fillOpacity:n},r)=>{if(!r)for(const l of e)l.fillOpacity=n},onStop:()=>{for(const n of e)n.fillOpacity=0}}),t==="update"&&!i.isSkipped()&&i.animate({id:`${this.id}_${t}_position`,groupId:this.id,forceAnimation:!0,phase:t,ease:d2,from:{t:0},to:{t:1},onUpdate:({t:n},r)=>{if(!r)for(const l of e){const c=l.datum?.prevBounds;if(c){const h=l.datum.bounds;l.x=c.x+(h.x-c.x)*n,l.y=c.y+(h.y-c.y)*n,l.width=c.width+(h.width-c.width)*n,l.height=c.height+(h.height-c.height)*n}}}})}getCustomTiming(e){const{flashDuration:t,fadeOutDuration:i}=this;if(t==null&&i==null)return;const{animationManager:o}=this.ctx,{defaultDuration:s}=o,a=t??0,r=a+(i??0);if(r<=0)return;let l;if(o.isSkipped())l=Math.min(r,wx*s)/s;else{const h=au.PHASE_METADATA[e].animationDuration;l=Math.min(r/s,wx)*h}const c=a/r;return{duration:l,ease:c>=1?()=>0:h=>h<=c?0:(h-c)/(1-c)}}};cs.className="FlashOnUpdate",d([ja],cs.prototype,"enabled",2),d([ja],cs.prototype,"item",2),d([ja],cs.prototype,"fill",2),d([ja],cs.prototype,"fillOpacity",2),d([ja],cs.prototype,"flashDuration",2),d([ja],cs.prototype,"fadeOutDuration",2);var Px={type:"plugin",name:"flashOnUpdate",enterprise:!0,version:t2,options:{enabled:i2,item:a2()("chart","category"),fill:o2,fillOpacity:s2,flashDuration:Lx,fadeOutDuration:Lx},themeTemplate:{enabled:!1,item:"chart",fill:"#cfeeff",fillOpacity:1,flashDuration:100,fadeOutDuration:900},create:e=>new cs(e)};import{VERSION as M2}from"ag-charts-community";import{_ModuleSupport as Rx}from"ag-charts-community";import{AbstractModuleInstance as D2,Logger as k2,ObserveChanges as nu,Property as Ql,clamp as ru}from"ag-charts-core";import{_ModuleSupport as ql}from"ag-charts-community";import{AbstractModuleInstance as I2,ActionOnSet as _x,Logger as A2,Padding as N2,Property as lu,ProxyProperty as zx,ZIndexMap as Zs,calcLineHeight as L2}from"ag-charts-core";import{_ModuleSupport as T2}from"ag-charts-community";import{SceneChangeDetection as Bx}from"ag-charts-core";var{TranslatableGroup:w2}=T2,cu=class extends w2{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;e.beginPath(),e.roundRect(s+o,a+o,n-2*o,r-2*o,i),e.clip()}};d([Bx()],cu.prototype,"inset",2),d([Bx()],cu.prototype,"cornerRadius",2);var{CategoryAxis:C2,Group:Qs,BBox:Vx,stackCartesianSeries:O2}=ql,hu=class{constructor(){this.top=0,this.bottom=0}};d([lu],hu.prototype,"top",2),d([lu],hu.prototype,"bottom",2);var $a=class extends I2{constructor(e){super(),this.ctx=e,this.enabled=!1,this.padding=new hu,this.root=new Qs({name:"root"}),this.seriesRoot=this.root.appendChild(new cu({name:"Series-root",zIndex:Zs.SERIES_LAYER,renderToOffscreenCanvas:!0})),this.axisGridGroup=this.root.appendChild(new Qs({name:"Axes-Grids",zIndex:Zs.AXIS_GRID})),this.axisGroup=this.root.appendChild(new Qs({name:"Axes-Grids",zIndex:Zs.AXIS_GRID})),this.axisLabelGroup=this.root.appendChild(new Qs({name:"Axes-Labels",zIndex:Zs.SERIES_LABEL})),this.axisCrosslineRangeGroup=this.root.appendChild(new Qs({name:"Axes-Crosslines-Range",zIndex:Zs.SERIES_CROSSLINE_RANGE})),this.axisCrosslineLineGroup=this.root.appendChild(new Qs({name:"Axes-Crosslines-Line",zIndex:Zs.SERIES_CROSSLINE_LINE})),this.axisCrosslineLabelGroup=this.root.appendChild(new Qs({name:"Axes-Crosslines-Label",zIndex:Zs.SERIES_LABEL})),this.data=[],this._destroyed=!1,this.miniChartAnimationPhase="initial",this.seriesRect=void 0,this.axes=new ql.ChartAxes,this.series=[],this.cleanup.register(this.ctx.eventsHub.on("data:update",t=>this.updateData(t)))}destroy(){this._destroyed||(super.destroy(),this.destroySeries(this.series),this.axes.destroy(),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,"flashOnUpdateEnabled",{get:()=>!1}),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=t.getKeyAxis(i)??i,s=this.axes.findById(o);if(!s){A2.warnOnce(`no matching axis for direction [${i}] and id [${o}]; check series and axes configuration.`);return}t.axes[i]=s}}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 N2;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?L2(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 Vx(0,0,e,t-(o.top+o.bottom)),n=this.seriesRect?.width!==e||this.seriesRect?.height!==t;this.seriesRect=a,this.seriesRoot.translationY=o.top,this.seriesRoot.setClipRectCanvasSpace(new Vx(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 C2;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 ql.CartesianCrossLine&&(c.position=r.position??"top",(i=c.label).parallel??(i.parallel=r.label?.parallel));r.calculateLayout(),r.update()}n&&O2(this.series),await Promise.all(this.series.map(async r=>r.update({seriesRect:a})))}};d([lu],$a.prototype,"enabled",2),d([zx(["seriesRoot","inset"])],$a.prototype,"inset",2),d([zx(["seriesRoot","cornerRadius"])],$a.prototype,"cornerRadius",2),d([_x({changeValue(e,t=new ql.ChartAxes){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)}})],$a.prototype,"axes",2),d([_x({changeValue(e,t){this.onSeriesChange(e,t)}})],$a.prototype,"series",2);import{_ModuleSupport as E2}from"ag-charts-community";import{clamp as P2}from"ag-charts-core";var{SliderWidget:Fx}=E2,R2=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=Fx.STEP_HUNDRETH,s.keyboardStep=Fx.STEP_ONE,s.orientation="horizontal",s.setPreventsDefault(!1),s.addListener("focus",()=>this.clearFocusOverride(s)),s.addListener("keydown",()=>this.clearFocusOverride(s)),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;e==null||t==null||this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"navigatorDOM"},{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)}clearFocusOverride(e){e.setFocusOverride(void 0)}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(),o.focus(),o.setFocusOverride(!1),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=P2(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 Hx}from"ag-charts-community";import{Property as Jl,SceneChangeDetection as ec}from"ag-charts-core";var{BBox:_2,ExtendedPath2D:z2}=Hx,hs=class extends Hx.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 z2}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,u=e.align(o+a/2);e.setCenter(c,u),t.setCenter(h,u)}computeBBox(){const{centerX:e,centerY:t,width:i,height:o}=this,s=e-i/2,a=t-o/2;return new _2(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 u=3;if(n)for(let p=-.5;p<=.5;p+=1)for(let g=-1;g<=1;g+=1)o.arc(e+p*u,t+g*u,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())}};hs.className="RangeHandle",d([Jl,ec()],hs.prototype,"width",2),d([Jl,ec()],hs.prototype,"height",2),d([Jl,ec()],hs.prototype,"cornerRadius",2),d([Jl,ec()],hs.prototype,"grip",2);import{_ModuleSupport as B2}from"ag-charts-community";import{Property as V2,SceneChangeDetection as F2}from"ag-charts-core";var{Path:H2,BBox:du,ExtendedPath2D:K2,clippedRoundRect:W2}=B2,uu=class extends H2{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 K2}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 du(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 du(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 u=this.align(i)+h,p=this.align(o)+h,g=this.align(i,s)-2*h,m=this.align(o,a)-2*h,y=this.align(i+s*n)+h,x=y+this.align(i+s*n,s*(r-n))-2*h,f={topLeft:c,topRight:c,bottomRight:c,bottomLeft:c},b=(S,v,M)=>{if(M-v<1)return;const D=new du(v,p,M-v,m);W2(S,u,p,g,m,f,D)};b(e,u,y),b(e,x,g+u),b(t,y,x)}renderStroke(e,t){super.renderStroke(e,t),super.renderStroke(e,this.visiblePath.getPath2D())}};uu.className="RangeMask",d([V2,F2()],uu.prototype,"cornerRadius",2);import{_ModuleSupport as pu}from"ag-charts-community";import{ZIndexMap as G2}from"ag-charts-core";var j2=class extends pu.Group{constructor(e){super({name:"rangeSelectorGroup",zIndex:G2.NAVIGATOR}),this.x=0,this.y=0,this.width=200,this.height=30,this.lOffset=0,this.rOffset=0,this.background=this.appendChild(new pu.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 pu.BBox(e-s,t,i+(s+a),o)}},Ua=class extends D2{constructor(e){super(),this.ctx=e,this.enabled=!1,this.mask=new uu,this.minHandle=new hs,this.maxHandle=new hs,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 j2([this.mask,this.minHandle,this.maxHandle]),this.cleanup.register(e.scene.attachNode(this.rangeSelector),e.eventsHub.on("locale:change",()=>this.updateZoom()),e.layoutManager.registerElement(Rx.LayoutElement.Navigator,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",t=>this.onZoomChange(t))),this.domProxy=new R2(e,this),this.updateGroupVisibility(),this.miniChart=new $a(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({source:"chart-update",sourceDetail:"navigator"},{x:{min:0,max:1}}))}onLayoutStart({layoutBox:e}){if(this.enabled){const t=this.height+this.spacing;e.shrink(t,"bottom"),this.y=e.y+e.height+this.spacing}else this.y=0;if(this.enabled&&this.miniChart){const{top:t,bottom:i}=this.miniChart.computeAxisPadding();e.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=>k2.error(a))}canDrag(){return this.enabled&&this.ctx.interactionManager.isState(Rx.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=ru(0,l,r-a);else if(e==="max")r=ru(n+a,l,1);else if(e==="pan"&&i!=null){const c=r-n;n=ru(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),hs.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,u]of[l,this.maskVisibleRange,c].entries()){const p=u.getBBox(),g={x:p.x-e,y:p.y-t,height:p.height,width:p.width};this.domProxy.updateSliderBounds(h,g)}}updateZoom(){this.enabled&&this.domProxy.updateZoom()}async processData(e){return this.miniChart?.processData(e)}};d([nu((e,t,i)=>{e.updateBackground(i?.root,t?.root)})],Ua.prototype,"miniChart",2),d([Ql,nu((e,t)=>{e.ctx.zoomManager.setNavigatorEnabled(!!t),e.updateGroupVisibility()})],Ua.prototype,"enabled",2),d([Ql],Ua.prototype,"height",2),d([Ql,nu((e,t)=>{e.mask.cornerRadius=t})],Ua.prototype,"cornerRadius",2),d([Ql],Ua.prototype,"spacing",2);import{AreaSeriesModule as $2,BarSeriesModule as U2,BubbleSeriesModule as Y2,HistogramSeriesModule as X2,LineSeriesModule as Z2,ScatterSeriesModule as Q2}from"ag-charts-community";import{array as q2,arrayOfDefs as J2,boolean as ar,callbackOf as eO,color as tc,fontOptionsDef as tO,number as Kx,numberFormatValidator as iO,positiveNumber as Mi,ratio as oO,textOrSegments as sO,typeUnion as aO,without as ei}from"ag-charts-core";import{CartesianChartModule as nO,VERSION as rO,_ModuleSupport as lO}from"ag-charts-community";import{ChartAxisDirection as ic,DIRECTION_SWAP_AXES as cO}from"ag-charts-core";import{_ModuleSupport as ds}from"ag-charts-community";import{ChartAxisDirection as hO,deepClone as dO,mergeDefaults as gu}from"ag-charts-core";function uO(e){return{from:e?{scalingX:1,scalingY:0}:{scalingX:0,scalingY:1},to:{scalingX:1,scalingY:1}}}function pO(e){return(t,i)=>e?{scalingCenterY:i.scaledValues.medianValue}:{scalingCenterX:i.scaledValues.medianValue}}import{_ModuleSupport as gO}from"ag-charts-community";import{SceneArrayChangeDetection as mO,SceneChangeDetection as ht}from"ag-charts-core";var{Path:yO,Scalable:fO,ExtendedPath2D:xO,BBox:qs,clippedRoundRect:Wx}=gO,Ye=class extends fO(yO){constructor(){super(...arguments),this.wickPath=new xO,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 qs(Math.min(o,s),t-i/2,Math.abs(s-o),i):new qs(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 qs(Math.min(o,s),t-i/2,Math.abs(s-o),i):new qs(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:u,cornerRadius:p,capLengthRatio:g,horizontal:m}=this,{center:y,x0:x,x1:f,min:b,max:S,q1:v,median:M,q3:D}=this.alignedCoordinates(),I=this.layerManager?.canvas.pixelRatio??1,A=this.wickStrokeAlignment>0?I/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(f-x)<=3){Ya(N,m,y,b),Xa(N,m,y,S);return}const L=Math.min(b,S),T=Math.max(b,S),P=Math.min(v,D),R=Math.max(v,D),w=y-Math.abs((f-x)*g)/2,O=y+Math.abs((f-x)*g)/2;Ya(N,m,w,L-A),Xa(N,m,O,L-A),Ya(N,m,y-A,L-A),Xa(N,m,y-A,P+i/2),Ya(N,m,y-A,T+A),Xa(N,m,y-A,R-i/2),Ya(N,m,w,T+A),Xa(N,m,O,T+A);const B=i/2+u,E=i/2-u,C=R-P-2*E;if(C>0){const _=x+B,z=P+E,K=f-x-2*B,F={topLeft:p,topRight:p,bottomRight:p,bottomLeft:p};Gx(e,m,_,z,K,C,F,new qs(_,z,K,M-z)),Gx(e,m,_,z,K,C,F,new qs(_,M,K,z+C-M))}else{const _=(P+R)/2;Ya(e,m,x,_),Xa(e,m,f,_)}}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:u=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=u,e.stroke(t.getPath2D()))}};d([ht()],Ye.prototype,"horizontal",2),d([ht()],Ye.prototype,"center",2),d([ht()],Ye.prototype,"thickness",2),d([ht()],Ye.prototype,"min",2),d([ht()],Ye.prototype,"q1",2),d([ht()],Ye.prototype,"median",2),d([ht()],Ye.prototype,"q3",2),d([ht()],Ye.prototype,"max",2),d([ht()],Ye.prototype,"cornerRadius",2),d([ht()],Ye.prototype,"crisp",2),d([ht()],Ye.prototype,"strokeAlignment",2),d([ht()],Ye.prototype,"wickStroke",2),d([ht()],Ye.prototype,"wickStrokeWidth",2),d([ht()],Ye.prototype,"wickStrokeOpacity",2),d([mO()],Ye.prototype,"wickLineDash",2),d([ht()],Ye.prototype,"wickLineDashOffset",2),d([ht()],Ye.prototype,"capLengthRatio",2),d([ht()],Ye.prototype,"wickStrokeAlignment",2);function Ya(e,t,i,o){t?e.moveTo(o,i):e.moveTo(i,o)}function Xa(e,t,i,o){t?e.lineTo(o,i):e.lineTo(i,o)}function Gx(e,t,i,o,s,a,n,r){t?Wx(e,o,i,a,s,n,r==null?void 0:new qs(r.y,r.x,r.height,r.width)):Wx(e,i,o,s,a,n,r)}import{_ModuleSupport as SO}from"ag-charts-community";import{BaseProperties as jx,Property as te,mergeDefaults as bO}from"ag-charts-core";var{AbstractBarSeriesProperties:vO,makeSeriesTooltip:MO}=SO,$x=class extends jx{constructor(){super(...arguments),this.lengthRatio=.5}};d([te],$x.prototype,"lengthRatio",2);var Za=class extends jx{};d([te],Za.prototype,"stroke",2),d([te],Za.prototype,"strokeWidth",2),d([te],Za.prototype,"strokeOpacity",2),d([te],Za.prototype,"lineDash",2),d([te],Za.prototype,"lineDashOffset",2);var re=class extends vO{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 $x,this.whisker=new Za,this.tooltip=MO()}toJson(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:s}=this,a=super.toJson();return a.whisker=bO(a.whisker,{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:o,lineDashOffset:s}),a}};d([te],re.prototype,"xKey",2),d([te],re.prototype,"minKey",2),d([te],re.prototype,"q1Key",2),d([te],re.prototype,"medianKey",2),d([te],re.prototype,"q3Key",2),d([te],re.prototype,"maxKey",2),d([te],re.prototype,"xName",2),d([te],re.prototype,"yName",2),d([te],re.prototype,"minName",2),d([te],re.prototype,"q1Name",2),d([te],re.prototype,"medianName",2),d([te],re.prototype,"q3Name",2),d([te],re.prototype,"maxName",2),d([te],re.prototype,"fill",2),d([te],re.prototype,"fillOpacity",2),d([te],re.prototype,"stroke",2),d([te],re.prototype,"strokeWidth",2),d([te],re.prototype,"strokeOpacity",2),d([te],re.prototype,"lineDash",2),d([te],re.prototype,"lineDashOffset",2),d([te],re.prototype,"cornerRadius",2),d([te],re.prototype,"styler",2),d([te],re.prototype,"itemStyler",2),d([te],re.prototype,"cap",2),d([te],re.prototype,"whisker",2),d([te],re.prototype,"tooltip",2);var{fixNumericExtent:DO,keyProperty:kO,SeriesNodePickMode:Ux,SMALLEST_KEY_INTERVAL:IO,valueProperty:nr,diff:AO,animationValidation:NO,computeBarFocusBounds:LO,createDatumId:Yx,HighlightState:mu,motion:Xx,getItemStyles:TO,calculateSegments:wO,toHighlightString:CO,processedDataIsAnimatable:OO,upsertNodeDatum:EO}=ds,PO=class extends ds.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}},yu=class extends ds.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[Ux.NEAREST_NODE,Ux.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 re,this.NodeEvent=PO}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:u,yScaleType:p}=this.getScaleInformation({xScale:l,yScale:c}),g=[];this.needsDataModelDiff()&&this.processedData&&g.push(AO(this.id,this.processedData)),r&&g.push(NO());const m=this.properties.allowNullKeys??!1,{processedData:y}=await this.requestDataModel(e,this.data,{props:[kO(t,u,{id:"xValue",allowNullKey:m}),nr(i,p,{id:"minValue"}),nr(o,p,{id:"q1Value"}),nr(s,p,{id:"medianValue"}),nr(a,p,{id:"q3Value"}),nr(n,p,{id:"maxValue"}),...h?[IO]:[],...g]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{index:s,def:a}=i.resolveProcessedDataDefById(this,"xValue"),n=t.domain.keys[s];if(a.type==="key"&&a.valueType==="category"){const r=i.getKeySortMetadata(this,"xValue",t);return{domain:n,sortMetadata:r}}return{domain:this.padBandExtent(n)}}const o=this.domainForClippedRange(e,["minValue","maxValue"],"xValue");return{domain:DO(o)}}getSeriesRange(e,t){return this.domainForVisibleRange(hO.Y,["maxValue","minValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:o,contextNodeData:s}=this;if(!i||!o)return;const a=s?.nodeData!=null&&o.changeDescription!=null,n=!this.ctx.animationManager.isSkipped(),{groupOffset:r,barOffset:l,barWidth:c}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:o.dataSources.get(this.id)?.data??[],xValues:i.resolveKeysById(this,"xValue",o),minValues:i.resolveColumnById(this,"minValue",o),q1Values:i.resolveColumnById(this,"q1Value",o),medianValues:i.resolveColumnById(this,"medianValue",o),q3Values:i.resolveColumnById(this,"q3Value",o),maxValues:i.resolveColumnById(this,"maxValue",o),xScale:e.scale,yScale:t.scale,groupOffset:r,barOffset:l,barWidth:c,isVertical:this.isVertical(),xKey:this.properties.xKey,animationEnabled:n,canIncrementallyUpdate:a,nodes:a?s.nodeData:[],nodeIndex:0}}validateBoxPlotValues(e,t,i,o,s){return[e,t,i,o,s].every(a=>typeof a=="number")&&e<=t&&t<=i&&i<=o&&o<=s}computeScaledValues(e,t,i){const o=e.xScale.convert(e.xValues[i]);return Number.isFinite(o)?(t.xValue=o+e.groupOffset+e.barOffset+e.barWidth/2,t.minValue=e.yScale.convert(e.minValues[i]),t.q1Value=e.yScale.convert(e.q1Values[i]),t.medianValue=e.yScale.convert(e.medianValues[i]),t.q3Value=e.yScale.convert(e.q3Values[i]),t.maxValue=e.yScale.convert(e.maxValues[i]),!0):!1}createSkeletonNodeDatum(e,t){return{series:this,datum:t.datum,datumIndex:t.datumIndex,xKey:e.xKey,bandwidth:e.barWidth,scaledValues:{xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},midPoint:{x:0,y:0},focusRect:{x:0,y:0,width:0,height:0}}}updateNodeDatum(e,t,i){const{isVertical:o,barWidth:s}=e,a=i.scaledValues,n=t;n.datum=i.datum,n.datumIndex=i.datumIndex,n.bandwidth=s;const r=n.scaledValues;r.xValue=a.xValue,r.minValue=a.minValue,r.q1Value=a.q1Value,r.medianValue=a.medianValue,r.q3Value=a.q3Value,r.maxValue=a.maxValue;const l=Math.abs(a.q3Value-a.q1Value),c=a.xValue,h=Math.min(a.q3Value,a.q1Value)+l/2,u=o?c:h,p=o?h:c;n.midPoint?(n.midPoint.x=u,n.midPoint.y=p):n.midPoint={x:u,y:p};const g=n.focusRect;o?(g.x=u-s/2,g.y=a.minValue,g.width=s,g.height=a.maxValue-a.minValue):(g.x=a.minValue,g.y=p-s/2,g.width=a.maxValue-a.minValue,g.height=s)}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}initializeResult(e){return{itemId:this.properties.xKey,nodeData:e.nodes,labelData:[],scales:this.calculateScaling(),visible:this.visible,groupScale:void 0,styles:void 0,segments:void 0}}populateNodeData(e){const t={xValue:0,minValue:0,q1Value:0,medianValue:0,q3Value:0,maxValue:0},i={datumIndex:0,datum:void 0,scaledValues:t};for(let o=0;othis.createNodeDatum(u,p),(u,p,g)=>this.updateNodeDatum(u,p,g)))}}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndexYx(i.datumIndex)):e.datumSelection.update(t)}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,cap:{lengthRatio:o},fill:s,fillOpacity:a,lineDash:n,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,maxKey:u,maxName:p,medianKey:g,medianName:m,minKey:y,minName:x,q1Key:f,q1Name:b,q3Key:S,q3Name:v,whisker:{lineDash:M,lineDashOffset:D,stroke:I,strokeOpacity:A,strokeWidth:k},xKey:N,xName:L,yName:T}=this.properties,P=CO(e??mu.None);return{cap:{lengthRatio:o},cornerRadius:i,fill:s,fillOpacity:a,highlightState:P,lineDash:n,lineDashOffset:r,maxKey:u,maxName:p??u,medianKey:g,medianName:m??g,minKey:y,minName:x??y,q1Key:f,q1Name:b??f,q3Key:S,q3Name:v??S,seriesId:t,stroke:l,strokeOpacity:c,strokeWidth:h,whisker:{lineDash:M??n,lineDashOffset:D??r,stroke:I??l,strokeOpacity:A??c,strokeWidth:k??h},xKey:N,xName:L??N,yName:T}}getStyle(e,t){const{cap:i,cornerRadius:o,fill:s,fillOpacity:a,lineDash:n,lineDashOffset:r,stroke:l,strokeOpacity:c,strokeWidth:h,styler:u,whisker:p}=this.properties;let g={};if(!e&&u){const m=this.makeStylerParams(t);g=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(u,m)??{},{pick:!1})??{}}return{cornerRadius:g.cornerRadius??o,fill:g.fill??s,fillOpacity:g.fillOpacity??a,lineDash:g.lineDash??n,lineDashOffset:g.lineDashOffset??r,opacity:1,stroke:g.stroke??l,strokeOpacity:g.strokeOpacity??c,strokeWidth:g.strokeWidth??h,cap:{lengthRatio:g.cap?.lengthRatio??i.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(e,t,i){const{properties:o}=this,{itemStyler:s}=o,a=this.getHighlightStyle(t,e,i);let n=gu(a,this.getStyle(e===void 0,i));if(s!=null&&e!=null){const p=this.cachedDatumCallback(Yx(e,t?"highlight":"node"),()=>{const g=this.makeItemStylerParams(e,t,n);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(s,g))});p&&(n=gu(p,n))}const{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}=n;return n.whisker=gu(n.whisker,{stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}),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],u=this.ctx.highlightManager?.getActiveHighlight(),p=this.getHighlightStateString(u,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,highlightState:p,...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,mu.None).strokeWidth/2,l=o.whisker.strokeWidth??o.strokeWidth;e.each((c,h)=>{const u=h.style??i.styles[this.getHighlightState(a,t,h.datumIndex)];c.setFillProperties(u.fill,n);const p=u.opacity??1,g=u.whisker?.strokeOpacity??u.strokeOpacity;c.fill=u.fill,c.fillOpacity=u.fillOpacity*p,c.stroke=u.stroke,c.strokeWidth=u.strokeWidth,c.strokeOpacity=u.strokeOpacity*p,c.lineDash=u.lineDash,c.lineDashOffset=u.lineDashOffset,c.wickStroke=u.whisker.stroke,c.wickStrokeWidth=u.whisker.strokeWidth,c.wickStrokeOpacity=g*p,c.wickLineDash=u.whisker.lineDash,c.wickLineDashOffset=u.whisker.lineDashOffset,c.cornerRadius=u.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=u.cap.lengthRatio,c.strokeAlignment=r,c.wickStrokeAlignment=l})}updateLabelNodes(){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}nodeFactory(){return new Ye}computeFocusBounds({datumIndex:e}){return LO(this,this.contextNodeData?.nodeData[e].focusRect)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null}};yu.className="BoxPlotSeries",yu.type="box-plot";import{_ModuleSupport as RO}from"ag-charts-community";import{boolean as _O,commonSeriesOptionsDefs as zO,constant as BO,positiveNumberNonZero as VO,ratio as FO,required as Js,shapeSegmentation as HO,string as vt}from"ag-charts-core";var{boxPlotSeriesThemeableOptionsDef:KO}=RO,WO={...zO,...KO,type:Js(BO("box-plot")),xKey:Js(vt),minKey:Js(vt),q1Key:Js(vt),medianKey:Js(vt),q3Key:Js(vt),maxKey:Js(vt),xKeyAxis:vt,yKeyAxis:vt,xName:vt,yName:vt,minName:vt,q1Name:vt,medianName:vt,q3Name:vt,maxName:vt,grouped:_O,legendItemName:vt,segmentation:HO,width:VO,widthRatio:FO};import{CARTESIAN_AXIS_TYPE as Zx,FILL_GRADIENT_LINEAR_DEFAULTS as GO,FILL_IMAGE_DEFAULTS as jO,FILL_PATTERN_DEFAULTS as $O,SAFE_FILL_OPERATION as UO,SEGMENTATION_DEFAULTS as YO}from"ag-charts-core";var XO={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fill"},{$mix:[UO,{$ref:"chartBackgroundColor"},.7]}]},["gradient",GO],["image",jO],["pattern",$O]]},stroke:{$palette:"stroke"},strokeWidth:2,fillOpacity:1,strokeOpacity:1,lineDash:void 0,lineDashOffset:0,highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.5},unhighlightedSeries:{opacity:.1}},segmentation:YO},axes:{[Zx.NUMBER]:{crosshair:{snap:!1}},[Zx.CATEGORY]:{groupPaddingInner:.2,crosshair:{enabled:!1,snap:!1}}}},{predictCartesianNonPrimitiveAxis:ZO}=lO,fu={type:"series",name:"box-plot",chartType:"cartesian",enterprise:!0,groupable:!0,version:rO,dependencies:[nO],options:WO,matchingKeys:["xKey","lowKey","q1Key","medianKey","q3Key","highKey","outlierKey","normalizedTo"],predictAxis:ZO,defaultAxes:cO,axisKeys:{[ic.X]:"xKeyAxis",[ic.Y]:"yKeyAxis"},axisKeysFlipped:{[ic.X]:"yKeyAxis",[ic.Y]:"xKeyAxis"},themeTemplate:XO,create:e=>new yu(e)};import{CartesianChartModule as QO,VERSION as qO,_ModuleSupport as JO}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as Qx,CARTESIAN_POSITION as qx,ChartAxisDirection as Jx}from"ag-charts-core";import"ag-charts-community";import{isGradientFill as eS,isImageFill as xu,isPatternFill as Su}from"ag-charts-core";import{_ModuleSupport as ea}from"ag-charts-community";import{AGGREGATION_INDEX_X_MAX as eE,AGGREGATION_INDEX_X_MIN as tE,AGGREGATION_INDEX_Y_MAX as iE,AGGREGATION_INDEX_Y_MIN as oE,AGGREGATION_SPAN as sE,ChartAxisDirection as bu,DebugMetrics as aE,Logger as tS,mergeDefaults as iS}from"ag-charts-core";import"ag-charts-community";import{aggregationDomain as vu,computeExtremesAggregation as oS,computeExtremesAggregationPartial as nE,simpleMemorize2 as rE}from"ag-charts-core";function lE(e,t,i,o,s,a,n,r){const[l,c]=vu(e,s);return oS([l,c],t,i,o,{smallestKeyInterval:a,xNeedsValueOf:n,yNeedsValueOf:r})}var cE=rE(lE);function hE(e,t,i,o,s){const a=t.resolveKeysById(o,"xValue",i),n=t.resolveColumnById(o,"highValue",i),r=t.resolveColumnById(o,"lowValue",i),l=t.getDomain(o,"xValue","key",i),c=t.resolveColumnNeedsValueOf(o,"xValue",i),h=t.resolveColumnNeedsValueOf(o,"highValue",i)??t.resolveColumnNeedsValueOf(o,"lowValue",i);if(s){const[u,p]=vu(e,l);return oS([u,p],a,n,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:s})}return cE(e,a,n,r,l,i.reduced?.smallestKeyInterval,c,h)}function dE(e,t,i,o,s,a){const n=t.resolveKeysById(o,"xValue",i),r=t.resolveColumnById(o,"highValue",i),l=t.resolveColumnById(o,"lowValue",i),c=t.getDomain(o,"xValue","key",i),h=t.resolveColumnNeedsValueOf(o,"xValue",i),u=t.resolveColumnNeedsValueOf(o,"highValue",i)??t.resolveColumnNeedsValueOf(o,"lowValue",i),[p,g]=vu(e,c);return nE([p,g],n,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:s,xNeedsValueOf:h,yNeedsValueOf:u,existingFilters:a})}import{_ModuleSupport as uE}from"ag-charts-community";import{DeclaredSceneChangeDetection as us}from"ag-charts-core";var{Path:pE,BBox:gE}=uE,To=class extends pE{constructor(){super(...arguments),this.centerX=0,this.y=0,this.width=0,this.height=0,this.yOpen=0,this.yClose=0,this.crisp=!1}setStaticProperties(e,t,i,o,s,a,n){this.__centerX=e,this.__width=t,this.__y=i,this.__height=o,this.__yOpen=s,this.__yClose=a,this.__crisp=n,this.dirtyPath=!0,this.markDirty()}computeBBox(){const{__centerX:e,__y:t,__width:i,__height:o}=this;return new gE(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 p=this.align(a,n-a);a=this.align(a),n=a+p}else{const p=this.align(n,a-n);n=this.align(n),a=n+p}const u=this.align(t/2);r=s-u,l=s+u,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([us()],sS.prototype,"strokeAlignment",2);var mE=tE,yE=iE,fE=oE,aS=eE,nS=sE,{AggregationManager:xE,fixNumericExtent:SE,keyProperty:bE,createDatumId:Mu,SeriesNodePickMode:rS,SMALLEST_KEY_INTERVAL:vE,valueProperty:oc,diff:ME,animationValidation:DE,computeBarFocusBounds:kE,visibleRangeIndices:lS,BandScale:IE,processedDataIsAnimatable:Du,getItemStylesPerItemId:AE}=ea,NE=class extends ea.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}};function LE(e){for(const t of e){const i=t.nodes();t.batchedUpdate(function(){for(const s of i){const a=s.datum;a!=null&&s.setStaticProperties(a.centerX,a.width,a.y,a.height,a.yOpen,a.yClose,a.crisp)}t.cleanup()})}}var cS=class extends ea.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[rS.AXIS_ALIGNED,rS.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["lowKey","highKey","openKey","closeKey"]},propertyNames:{x:["xName"],y:["lowName","highName","openName","closeName"]},categoryKey:"xValue",pathsPerSeries:[]}),this.NodeEvent=NE,this.aggregationManager=new xE}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:u}=this.getScaleInformation({xScale:r,yScale:l}),p=[];this.needsDataModelDiff()&&this.processedData&&p.push(ME(this.id,this.processedData)),n&&p.push(DE()),i&&p.push(oc(i,u,{id:"openValue",invalidValue:void 0,missingValue:void 0}));const g=this.properties.allowNullKeys??!1,{dataModel:m,processedData:y}=await this.requestDataModel(e,this.data,{props:[bE(t,h,{id:"xValue",allowNullKey:g}),oc(o,u,{id:"closeValue"}),oc(s,u,{id:"highValue"}),oc(a,u,{id:"lowValue"}),...c?[vE]:[],...p]});this.smallestDataInterval=y.reduced?.smallestKeyInterval,this.aggregateData(m,y),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||Du(t))return;const i=this.axes[bu.X];if(i==null)return;const o=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>dE(i.scale.type,e,t,this,o,a),computeFull:a=>hE(i.scale.type,e,t,this,a),targetRange:o});const s=this.aggregationManager.filters;s&&s.length>0&&aE.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes[bu.X];if(!e)return-1;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};if(e!==this.getBarDirection()){const{def:s}=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return s.type==="key"&&s.valueType==="category"?a:{domain:this.padBandExtent(a.domain)}}const o=this.domainForClippedRange(e,["highValue","lowValue"],"xValue");return{domain:SE(o)}}getSeriesRange(e,t){return this.domainForVisibleRange(bu.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)}buildDatumContext(e,t){const{dataModel:i,processedData:o}=this;if(!i||!o)return;const s=o.dataSources.get(this.id)?.data??[];if(s.length===0)return;const a=e.scale,n=t.scale,r=IE.is(a),[l,c]=a.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const u=this.aggregationManager.getFilterForRange(h),p=u==null,g=this.contextNodeData?.nodeData!=null&&(o.changeDescription!=null||!Du(o)||u!=null),{groupOffset:m,barOffset:y,barWidth:x}=this.getBarDimensions();return{rawData:s,xValues:i.resolveKeysById(this,"xValue",o),openValues:i.resolveColumnById(this,"openValue",o),closeValues:i.resolveColumnById(this,"closeValue",o),highValues:i.resolveColumnById(this,"highValue",o),lowValues:i.resolveColumnById(this,"lowValue",o),xScale:a,yScale:n,xAxis:e,yAxis:t,groupOffset:m,barOffset:y,barWidth:x,applyWidthOffset:r,crisp:p,xKey:this.properties.xKey,openKey:this.properties.openKey,closeKey:this.properties.closeKey,highKey:this.properties.highKey,lowKey:this.properties.lowKey,dataAggregationFilter:u,range:h,nodeDatumStateScratch:{datum:void 0,xValue:void 0,openValue:0,closeValue:0,highValue:0,lowValue:0,isRising:!0,itemType:"up"},canIncrementallyUpdate:g,nodeIndex:0,nodeData:g?this.contextNodeData.nodeData:[]}}prepareOhlcNodeDatumState(e,t){const i=e.xValues[t];if(i===void 0&&!this.properties.allowNullKeys)return;const o=e.openValues[t],s=e.closeValues[t],a=e.highValues[t],n=e.lowValues[t],r=n!=null&&n<=o&&n<=s,l=a!=null&&a>=o&&a>=s;if(!r){tS.warnOnce(`invalid low value for key [${e.lowKey}] in data element, low value cannot be higher than datum open or close values`);return}if(!l){tS.warnOnce(`invalid high value for key [${e.highKey}] in data element, high value cannot be lower than datum open or close values.`);return}const c=e.rawData[t],h=s>o,u=h?"up":"down",p=e.nodeDatumStateScratch;return p.datum=c,p.xValue=i,p.openValue=o,p.closeValue=s,p.highValue=a,p.lowValue=n,p.isRising=h,p.itemType=u,p}createSkeletonNodeDatum(e,t,i,o,s,a){const n=e.applyWidthOffset?s/2:0,r=o+n,l=e.yScale.convert(t.openValue),c=e.yScale.convert(t.closeValue),h=e.yScale.convert(t.highValue),u=e.yScale.convert(t.lowValue),p=Math.min(h,u),g=Math.max(h,u)-p;return{series:this,itemType:t.itemType,datum:t.datum,datumIndex:i,xKey:e.xKey,xValue:t.xValue,openValue:t.openValue,closeValue:t.closeValue,highValue:t.highValue,lowValue:t.lowValue,midPoint:{x:r,y:p+g/2},aggregatedValue:t.closeValue,isRising:t.isRising,centerX:r,width:s,y:p,height:g,yOpen:l,yClose:c,crisp:a}}updateNodeDatum(e,t,i,o,s,a,n){const r=t,l=e.applyWidthOffset?a/2:0,c=s+l,h=e.yScale.convert(i.openValue),u=e.yScale.convert(i.closeValue),p=e.yScale.convert(i.highValue),g=e.yScale.convert(i.lowValue),m=Math.min(p,g),y=Math.max(p,g)-m;r.datum=i.datum,r.datumIndex=o,r.itemType=i.itemType,r.xValue=i.xValue,r.openValue=i.openValue,r.closeValue=i.closeValue,r.highValue=i.highValue,r.lowValue=i.lowValue,r.aggregatedValue=i.closeValue,r.isRising=i.isRising,r.centerX=c,r.width=a,r.y=m,r.height=y,r.yOpen=h,r.yClose=u,r.crisp=n;const x=r.midPoint;x.x=c,x.y=m+y/2}upsertNodeDatum(e,t,i,o,s){const a=this.prepareOhlcNodeDatumState(e,t);if(!a)return;if(e.canIncrementallyUpdate&&e.nodeIndex{const r=o.xScale.convert(o.xValues[n]);return Number.isFinite(r)?r+o.groupOffset+(o.applyWidthOffset?o.barOffset:0):Number.NaN};if(o.dataAggregationFilter==null){const n=this.processedData.invalidData?.get(this.id);let[r,l]=lS(1,o.rawData.length,o.xAxis.range,c=>{const h=o.applyWidthOffset?0:-o.barWidth/2,u=a(c)+h;return[u,u+o.barWidth]});this.processedData.input.count<1e3&&(r=0,l=this.processedData.input.count);for(let c=r;c{const p=u*nS,g=r[p+aS],m=l[u];if(m===-1)return;const y=o.applyWidthOffset?0:-o.barWidth/2;return[a(m)+y,a(g)+y+o.barWidth]});for(let u=c;ub.openValue,b.itemType=b.isRising?"up":"down";const S=a(f),v=Math.abs(a(m)-a(g))+o.barWidth;if(o.canIncrementallyUpdate&&o.nodeIndexMu(i.xValue)):e.datumSelection.update(t)}updateLabelNodes(e){}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}getItemStyle(e,t,i,o="up"){const{properties:s,dataModel:a,processedData:n}=this,{itemStyler:r}=s,l=this.getHighlightStyle(t,e,i);let h=iS(l,s.getStyle(o));if(r&&a!=null&&n!=null&&e!=null){const u=a.resolveKeysById(this,"xValue",n)[e],p=this.cachedDatumCallback(Mu(Mu(u),t?"highlight":"node"),()=>{const g=this.makeItemStylerParams(o,e,t,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",o],this.callWithContext(r,g))});p&&(h=iS(p,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:u}=a,p=n.dataSources.get(s)?.data[t],g=this.ctx.highlightManager?.getActiveHighlight(),m=this.getHighlightStateString(g,i,t),y={seriesId:s,datum:p,itemType:e,xKey:r,openKey:l,closeKey:c,highKey:h,lowKey:u,highlightState:m,...o};return"fill"in y&&"fill"in o&&(y.fill=this.filterItemStylerFillParams(o.fill)??o.fill),y}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:u,lowKey:p,lowName:g,closeKey:m,closeName:y,legendItemName:x,tooltip:f}=s,b=this.getCategoryAxis(),S=this.getValueAxis();if(!i||!o||!b||!S)return;const v=o.dataSources.get(this.id)?.data[e],M=i.resolveKeysById(this,"xValue",o)[e],D=i.resolveColumnById(this,"openValue",o)[e],I=i.resolveColumnById(this,"highValue",o)[e],A=i.resolveColumnById(this,"lowValue",o)[e],k=i.resolveColumnById(this,"closeValue",o)[e],N=this.properties.allowNullKeys??!1;if(M===void 0&&!N)return;const L=k>=D?"up":"down",T=this.properties.item[L],P=this.getItemStyle(e,!1),R={fill:T.fill??T.stroke,fillOpacity:T.fillOpacity??T.strokeOpacity??1,stroke:T.stroke,strokeWidth:T.strokeWidth??1,strokeOpacity:T.strokeOpacity??1,lineDash:T.lineDash??[0],lineDashOffset:T.lineDashOffset??0};return this.formatTooltipWithContext(f,{heading:this.getAxisValueText(b,"tooltip",M,v,a,x),title:x,symbol:{marker:R},data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(S,"tooltip",D,v,l,x),missing:ea.isTooltipValueMissing(D)},{label:u,fallbackLabel:h,value:this.getAxisValueText(S,"tooltip",I,v,h,x),missing:ea.isTooltipValueMissing(I)},{label:g,fallbackLabel:p,value:this.getAxisValueText(S,"tooltip",A,v,p,x),missing:ea.isTooltipValueMissing(A)},{label:y,fallbackLabel:m,value:this.getAxisValueText(S,"tooltip",k,v,m,x),missing:ea.isTooltipValueMissing(k)}]},{seriesId:t,datum:v,title:r,itemType:L,xKey:a,xName:n,yName:r,openKey:l,openName:c,highKey:h,highName:u,lowKey:p,lowName:g,closeKey:m,closeName:y,...P})}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 kE(this,n)}};import{_ModuleSupport as TE}from"ag-charts-community";import{DeclaredSceneChangeDetection as rr,SceneArrayChangeDetection as wE}from"ag-charts-core";var{ExtendedPath2D:CE,BBox:OE}=TE,ta=class extends To{constructor(){super(...arguments),this.wickPath=new CE,this.wickStroke=void 0,this.wickStrokeWidth=void 0,this.wickStrokeOpacity=void 0,this.wickStrokeAlignment=0}setWickProperties(e,t,i,o,s){this.__wickStroke=e,this.__wickStrokeWidth=t,this.__wickStrokeOpacity=i,this.wickLineDash=o,this.__wickLineDashOffset=s,this.dirtyPath=!0,this.markDirty()}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 OE(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:u,x0:p,x1:g,y0:m,y1:y,yOpen:x,yClose:f}=this.alignedCoordinates(),b=this.layerManager?.canvas.pixelRatio??1,S=this.__wickStrokeAlignment>0?b/this.__wickStrokeAlignment/2%1:0;this.path.clear(),this.wickPath.clear();const M=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-p)<=3){M.moveTo(u-S,m),M.lineTo(u-S,y);return}const D=Math.min(x,f),I=Math.max(x,f),A=i/2;M.moveTo(u-S,m),M.lineTo(u-S,D+A),M.moveTo(u-S,y),M.lineTo(u-S,I-A);const k=I-D-2*A;if(k>0)e.rect(p+A,D+A,g-p-2*A,k);else{const N=(D+I)/2;e.moveTo(p,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:u=n}=this;l!==0&&(e.globalAlpha*=c,typeof r=="string"&&(e.strokeStyle=r),e.lineWidth=l,h!=null&&e.setLineDash([...h]),e.lineDashOffset=u,e.stroke(t.getPath2D()))}};d([rr()],ta.prototype,"wickStroke",2),d([rr()],ta.prototype,"wickStrokeWidth",2),d([rr()],ta.prototype,"wickStrokeOpacity",2),d([wE()],ta.prototype,"wickLineDash",2),d([rr()],ta.prototype,"wickLineDashOffset",2),d([rr()],ta.prototype,"wickStrokeAlignment",2);import{_ModuleSupport as EE}from"ag-charts-community";import{BaseProperties as ku,Property as Xe}from"ag-charts-core";import{_ModuleSupport as PE}from"ag-charts-community";import{BaseProperties as hS,Property as Be}from"ag-charts-core";var{AbstractBarSeriesProperties:RE,makeSeriesTooltip:_E}=PE,ia=class extends hS{constructor(){super(...arguments),this.stroke="#333",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}};d([Be],ia.prototype,"stroke",2),d([Be],ia.prototype,"strokeWidth",2),d([Be],ia.prototype,"strokeOpacity",2),d([Be],ia.prototype,"lineDash",2),d([Be],ia.prototype,"lineDashOffset",2);var Iu=class extends hS{constructor(){super(...arguments),this.up=new ia,this.down=new ia}};d([Be],Iu.prototype,"up",2),d([Be],Iu.prototype,"down",2);var ti=class extends RE{};d([Be],ti.prototype,"xKey",2),d([Be],ti.prototype,"openKey",2),d([Be],ti.prototype,"closeKey",2),d([Be],ti.prototype,"highKey",2),d([Be],ti.prototype,"lowKey",2),d([Be],ti.prototype,"xName",2),d([Be],ti.prototype,"yName",2),d([Be],ti.prototype,"openName",2),d([Be],ti.prototype,"closeName",2),d([Be],ti.prototype,"highName",2),d([Be],ti.prototype,"lowName",2);var sc=class extends ti{constructor(){super(...arguments),this.tooltip=_E(),this.item=new Iu}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([Be],sc.prototype,"tooltip",2),d([Be],sc.prototype,"item",2),d([Be],sc.prototype,"itemStyler",2);var{makeSeriesTooltip:zE}=EE,Qa=class extends ku{};d([Xe],Qa.prototype,"stroke",2),d([Xe],Qa.prototype,"strokeWidth",2),d([Xe],Qa.prototype,"strokeOpacity",2),d([Xe],Qa.prototype,"lineDash",2),d([Xe],Qa.prototype,"lineDashOffset",2);var Pi=class extends ku{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 Qa}};d([Xe],Pi.prototype,"fill",2),d([Xe],Pi.prototype,"fillOpacity",2),d([Xe],Pi.prototype,"stroke",2),d([Xe],Pi.prototype,"strokeWidth",2),d([Xe],Pi.prototype,"strokeOpacity",2),d([Xe],Pi.prototype,"lineDash",2),d([Xe],Pi.prototype,"lineDashOffset",2),d([Xe],Pi.prototype,"cornerRadius",2),d([Xe],Pi.prototype,"wick",2);var Au=class extends ku{constructor(){super(...arguments),this.up=new Pi,this.down=new Pi}};d([Xe],Au.prototype,"up",2),d([Xe],Au.prototype,"down",2);var ac=class extends ti{constructor(){super(...arguments),this.item=new Au,this.tooltip=zE()}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([Xe],ac.prototype,"item",2),d([Xe],ac.prototype,"tooltip",2),d([Xe],ac.prototype,"itemStyler",2);var Nu=class extends cS{constructor(){super(...arguments),this.properties=new ac}nodeFactory(){const e=new ta;return e.lineCap="butt",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o.datumIndex,t,void 0,o.itemType)})}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,r=this.getShapeFillBBox(),l=this;e.each(function(h,u){const{centerX:p,width:g,y:m,height:y,yOpen:x,yClose:f,crisp:b}=u,S=u.isRising?a:n,v=l.getHighlightState(s,t,u.datumIndex),M=u.style??i.styles[u.itemType][v];h.setStaticProperties(p,g,m,y,x,f,b),h.setStyleProperties(M,r);const D=M?.wick;h.setWickProperties(D?.stroke,D?.strokeWidth,D?.strokeOpacity,D?.lineDash,D?.lineDashOffset),h.wickStrokeAlignment=S.wick.strokeWidth??S.strokeWidth})}legendItemSymbol(){const{up:e,down:t}=this.properties.item,i=eS(e.fill)?e.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:Su(e.fill)||xu(e.fill)?e.stroke:e.fill,stop:0},{color:Su(e.fill)||xu(e.fill)?e.stroke:e.fill,stop:.5}],o=eS(t.fill)?t.fill.colorStops.map(n=>typeof n=="string"?n:{color:n.color,stop:n.stop==null?void 0:n.stop*.5}):[{color:Su(t.fill)||xu(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}};Nu.className="CandleStickSeries",Nu.type="candlestick";import{_ModuleSupport as BE}from"ag-charts-community";import{boolean as VE,commonSeriesOptionsDefs as FE,constant as HE,number as KE,required as qa,string as ii,undocumented as dS}from"ag-charts-core";var{candlestickSeriesThemeableOptionsDef:WE}=BE,Lu={...FE,...WE,type:qa(HE("candlestick")),xKey:qa(ii),openKey:qa(ii),highKey:qa(ii),lowKey:qa(ii),closeKey:qa(ii),xName:ii,yName:ii,openName:ii,highName:ii,lowName:ii,closeName:ii,xKeyAxis:ii,yKeyAxis:ii};Lu.pickOutsideVisibleMinorAxis=dS(VE),Lu.focusPriority=dS(KE);import"ag-charts-community";import{CARTESIAN_AXIS_TYPE as uS,FILL_GRADIENT_LINEAR_KEYED_DEFAULTS as GE,FILL_IMAGE_DEFAULTS as jE,FILL_PATTERN_KEYED_DEFAULTS as $E,MULTI_SERIES_HIGHLIGHT_STYLE as UE}from"ag-charts-core";function pS(e){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},e==="up"?"transparent":{$palette:"fill"},{$palette:`${e}.fill`}]},["gradient",GE(e)],["image",jE],["pattern",$E(e)]]},stroke:{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$palette:"stroke"},{$palette:`${e}.stroke`}]}}}var YE={series:{item:{up:pS("up"),down:pS("down")},tooltip:{range:{$path:["/tooltip/range","nearest"]}},highlight:UE},animation:{enabled:!1},axes:{[uS.NUMBER]:{crosshair:{snap:!1}},[uS.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},{predictCartesianFinancialAxis:XE}=JO,nc={type:"series",name:"candlestick",chartType:"cartesian",enterprise:!0,groupable:!1,version:qO,dependencies:[QO],options:Lu,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:XE,defaultAxes:{y:{type:Qx.NUMBER,position:qx.LEFT},x:{type:Qx.ORDINAL_TIME,position:qx.BOTTOM}},axisKeys:{[Jx.X]:"xKeyAxis",[Jx.Y]:"yKeyAxis"},themeTemplate:YE,create:e=>new Nu(e)};import{CartesianChartModule as ZE,VERSION as QE}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as gS,CARTESIAN_POSITION as mS,ChartAxisDirection as yS}from"ag-charts-core";import{_ModuleSupport as Tu}from"ag-charts-community";import{ChartAxisDirection as Ji,Logger as qE,extent as JE,formatValue as eP,mergeDefaults as fS,toPlainText as tP}from"ag-charts-core";import{Logger as iP,cachedTextMeasurer as rc,findMaxValue as xS,wrapLines as SS}from"ag-charts-core";function oP(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 u=n>0?(l-o)/n:-1,p=r>0?(c-a)/r:-1;u>p?l--:c--,h.push({labelFontSize:l,secondaryLabelFontSize:c})}return h.reverse(),h}function bS(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=oP(t,o),u={fontFamily:t.fontFamily,fontStyle:t.fontStyle,fontWeight:t.fontWeight},p={fontFamily:o.fontFamily,fontStyle:o.fontStyle,fontWeight:o.fontWeight};let g,m;return xS(0,h.length-1,y=>{const{labelFontSize:x,secondaryLabelFontSize:f}=h[y],b=y===0,S={...u,fontSize:x},v={...p,fontSize:f},M=rc(S).lineHeight(),D=rc(v).lineHeight(),I=a(M+D+l,b),A=I.width-r,k=I.height-l;if(M+D>k||(g?.fontSize!==x&&(g=MS(t,e,A,k,S,t.wrapping,b?t.overflowStrategy:"hide")),g==null||g.width>A||g.height>k)||(m?.fontSize!==f&&(m=MS(o,i,A,k,v,o.wrapping,b?o.overflowStrategy:"hide")),m==null))return;const N=g.height+m.height;if(!(m.width>A||N>k))return{width:Math.max(g.width,m.width),height:N+n,meta:I.meta,label:g,secondaryLabel:m}})}function lr(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 xS(a,t.fontSize,r=>{const l={...n,fontSize:r},c=rc(l),h=r===a,u=t.lineHeight??c.lineHeight(),p=o(u+s,h),g=p.width-s,m=p.height-s;if(u>m||g<0)return;const y=SS(e,{maxWidth:g,maxHeight:m,font:l,textWrap:t.wrapping,overflow:(h?t.overflowStrategy:null)??"hide"});if(!y.length)return;const{width:x,height:f}=c.measureLines(y),b=y.join(` `);return[{width:x,height:f,text:b,fontSize:r,lineHeight:u},p.meta]})}function vS(e){return e?.minimumFontSize!=null&&e?.fontSize!=null&&e?.minimumFontSize>e?.fontSize}function wu(e,t,i,o,s,a){const n=t.enabled?e:void 0,r=o.enabled?i:void 0;(vS(t)||vS(o))&&iP.warnOnce("minimumFontSize should be set to a value less than or equal to the font size");let l;n!=null&&r!=null&&(l=bS(n,t,r,o,s,a));let c;if(l==null&&n!=null&&(c=lr(n,t,s,a)),c!=null){const[u,p]=c;l={width:u.width,height:u.height,meta:p,label:u,secondaryLabel:void 0}}let h;if(l==null&&n==null&&r!=null&&(h=lr(r,o,s,a)),h!=null){const[u,p]=h;l={width:u.width,height:u.height,meta:p,label:void 0,secondaryLabel:u}}return l}function MS(e,t,i,o,s,a,n){const r=SS(t,{maxWidth:i,maxHeight:o,font:s,textWrap:a,overflow:n});if(!r.length)return;const l=rc(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 sP}from"ag-charts-community";import{Property as dt}from"ag-charts-core";import{_ModuleSupport as aP}from"ag-charts-community";import{Property as cr}from"ag-charts-core";var Ja=class extends aP.Label{constructor(){super(...arguments),this.wrapping="on-space",this.overflowStrategy="ellipsis"}};d([cr],Ja.prototype,"wrapping",2),d([cr],Ja.prototype,"overflowStrategy",2),d([cr],Ja.prototype,"lineHeight",2),d([cr],Ja.prototype,"minimumFontSize",2);var en=class extends Ja{constructor(){super(...arguments),this.spacing=0}};d([cr],en.prototype,"spacing",2);var lc=class extends Ja{},{CartesianSeriesProperties:nP,makeSeriesTooltip:rP}=sP,tt=class extends nP{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 en,this.tooltip=rP()}};d([dt],tt.prototype,"title",2),d([dt],tt.prototype,"xKey",2),d([dt],tt.prototype,"yKey",2),d([dt],tt.prototype,"colorKey",2),d([dt],tt.prototype,"xName",2),d([dt],tt.prototype,"yName",2),d([dt],tt.prototype,"colorName",2),d([dt],tt.prototype,"colorRange",2),d([dt],tt.prototype,"stroke",2),d([dt],tt.prototype,"strokeOpacity",2),d([dt],tt.prototype,"strokeWidth",2),d([dt],tt.prototype,"textAlign",2),d([dt],tt.prototype,"verticalAlign",2),d([dt],tt.prototype,"itemPadding",2),d([dt],tt.prototype,"itemStyler",2),d([dt],tt.prototype,"label",2),d([dt],tt.prototype,"tooltip",2);var{SeriesNodePickMode:DS,computeBarFocusBounds:lP,getMissCount:cP,valueProperty:Cu,DEFAULT_CARTESIAN_DIRECTION_KEYS:hP,DEFAULT_CARTESIAN_DIRECTION_NAMES:dP,createDatumId:uP,ColorScale:pP,Rect:gP,PointerEvents:mP,addHitTestersToQuadtree:yP,findQuadtreeMatch:kS,updateLabelNode:fP,upsertNodeDatum:xP}=Tu,SP=class extends Tu.CartesianSeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.colorKey=o.properties.colorKey}},bP={left:-.5,center:0,right:-.5},vP={top:-.5,middle:0,bottom:-.5},Ou=class extends Tu.CartesianSeries{constructor(e){super({moduleCtx:e,propertyKeys:{...hP,color:["colorKey"]},propertyNames:{...dP,color:["colorName"]},categoryKey:void 0,pickModes:[DS.NEAREST_NODE,DS.EXACT_SHAPE_MATCH],pathsPerSeries:[]}),this.properties=new tt,this.NodeEvent=SP,this.colorScale=new pP}async processData(e){const t=this.axes[Ji.X],i=this.axes[Ji.Y];if(!t||!i)return;const{xKey:o,yKey:s,colorRange:a,colorKey:n}=this.properties,r=this.axes[Ji.X]?.scale,l=this.axes[Ji.Y]?.scale,{xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:r,yScale:l}),u=this.colorScale.type,p=this.properties.allowNullKeys??!1,{dataModel:g,processedData:m}=await this.requestDataModel(e,this.data,{props:[Cu(o,c,{id:"xValue",allowNullKey:p}),Cu(s,h,{id:"yValue",allowNullKey:p}),...n?[Cu(n,u,{id:"colorValue",invalidValue:void 0})]:[]]});if(this.isColorScaleValid()){const y=g.resolveProcessedDataIndexById(this,"colorValue"),x=m.domain.values[y].filter(b=>b!=null),f=JE(x);if(this.colorScale.domain=f??[],f?.length&&f[0]===f[1]){const b=Math.floor(a.length/2);this.colorScale.range=[a[b],a[b]]}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=cP(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[Ji.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[Ji.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?{domain:[]}:e===Ji.X?{domain:t.getDomain(this,"xValue","value",i).domain}:{domain:t.getDomain(this,"yValue","value",i).domain}}getSeriesRange(){return[Number.NaN,Number.NaN]}validateCreateNodeDataPreconditions(){const e=super.validateCreateNodeDataPreconditions();if(!e)return;const{xAxis:t,yAxis:i}=e;if(t.type!=="category"||i.type!=="category"){qE.warnOnce(`Heatmap series expected axes to have "category" type, but received "${t.type}" and "${i.type}" instead.`);return}return e}populateNodeData(e){for(const[t,i]of e.rawData.entries()){const o=xP(e,{datumIndex:t,datum:i},(s,a)=>this.createNodeDatum(s,a.datumIndex,a.datum),(s,a,n)=>this.updateNodeDatum(s,a,n.datumIndex,n.datum));if(o){const s=this.createLabelDatum(e,t,i,o);s&&e.labels.push(s)}}}initializeResult(e){return{itemId:this.properties.yKey??this.id,nodeData:e.nodes,labelData:e.labels,scales:this.calculateScaling(),visible:this.visible}}createNodeDatumContext(e,t){const{dataModel:i,processedData:o,contextNodeData:s}=this;if(!i||!o)return;const{xKey:a,xName:n,yKey:r,yName:l,colorKey:c,colorName:h,textAlign:u,verticalAlign:p,itemPadding:g}=this.properties,m=e.scale,y=t.scale,x=i.resolveColumnById(this,"xValue",o),f=i.resolveColumnById(this,"yValue",o),b=c?i.resolveColumnById(this,"colorValue",o):void 0,S=c?i.getDomain(this,"colorValue","value",o).domain:[],v=m.bandwidth??10,M=y.bandwidth??10,D=o.dataSources.get(this.id)?.data??[],I=s?.nodeData!=null&&o.changeDescription!=null;return{xAxis:e,yAxis:t,xScale:m,yScale:y,rawData:D,xValues:x,xKey:a,yKey:r,xName:n,yName:l,animationEnabled:!this.ctx.animationManager.isSkipped(),canIncrementallyUpdate:I,nodes:I?s.nodeData:[],nodeIndex:0,xOffset:(m.bandwidth??0)/2,yOffset:(y.bandwidth??0)/2,width:v,height:M,textAlignFactor:(v-2*g)*bP[u],verticalAlignFactor:(M-2*g)*vP[p],yValues:f,colorKey:c,colorName:h,colorValues:b,colorDomain:S,itemPadding:g,labels:[],labelIndex:0}}createSkeletonNodeDatum(e,t,i){const{xKey:o,yKey:s,width:a,height:n,colorValues:r}=e,l=e.xValues[t],c=e.yValues[t],h=r?.[t];return{series:this,datumIndex:t,yKey:s,xKey:o,xValue:l,yValue:c,colorValue:h,datum:i,point:{x:0,y:0,size:0},width:a,height:n,midPoint:{x:0,y:0},missing:r!=null&&h==null,style:{}}}updateNodeDatum(e,t,i,o){const{xScale:s,yScale:a,xOffset:n,yOffset:r,width:l,height:c,xKey:h,yKey:u,colorValues:p}=e,g=t,m=e.xValues[i],y=e.yValues[i],x=s.convert(m)+n,f=a.convert(y)+r;if(!Number.isFinite(x)||!Number.isFinite(f))return;const b=p?.[i];g.datumIndex=i,g.datum=o,g.yKey=u,g.xKey=h,g.xValue=m,g.yValue=y,g.colorValue=b,g.width=l,g.height=c,g.missing=p!=null&&b==null;const S=g.point;S.x=x,S.y=f,S.size=0,g.midPoint.x=x,g.midPoint.y=f,g.style=this.getItemStyle({datumIndex:i,datum:o,colorValue:b},!1)}createNodeDatum(e,t,i){const{xScale:o,yScale:s,xOffset:a,yOffset:n}=e,r=e.xValues[t],l=e.yValues[t],c=o.convert(r)+a,h=s.convert(l)+n;if(!Number.isFinite(c)||!Number.isFinite(h))return;const u=this.createSkeletonNodeDatum(e,t,i);return this.updateNodeDatum(e,u,t,i),u}createLabelDatum(e,t,i,o){const{label:s}=this.properties,{width:a,height:n,textAlignFactor:r,verticalAlignFactor:l,itemPadding:c,colorKey:h,colorName:u,colorDomain:p,xKey:g,yKey:m,xName:y,yName:x}=e,f=e.colorValues?.[t],b=s.enabled&&f!=null?this.getLabelText(f,i,h,"color",p,s,{value:f,datum:i,colorKey:h,colorName:u,xKey:g,yKey:m,xName:y,yName:x}):void 0,S=()=>({width:a,height:n,meta:null}),v=wu(tP(b),this.properties.label,void 0,this.properties.label,{padding:c},S);if(v?.label==null)return;const{text:M,fontSize:D,lineHeight:I,height:A}=v.label,{fontStyle:k,fontFamily:N,fontWeight:L,color:T}=this.properties.label,{textAlign:P,verticalAlign:R}=this.properties,w=o.point.x+r*(a-2*c),O=o.point.y+l*(n-2*c)-(v.height-A)*.5;return{series:this,datum:i,datumIndex:t,text:M,fontSize:D,lineHeight:I,fontStyle:k,fontFamily:N,fontWeight:L,color:T,textAlign:P,textBaseline:R,x:w,y:O,style:o.style}}nodeFactory(){return new gP}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,s){const{properties:a}=this,{itemStyler:n,stroke:r,strokeWidth:l,strokeOpacity:c}=a,h=this.getHighlightStyle(o,e,s),u=fS(h,{fill:this.isColorScaleValid()&&i!=null?this.colorScale.convert(i):"transparent",fillOpacity:1,stroke:r,strokeWidth:l,strokeOpacity:c,opacity:1});let p;return n!=null&&e!=null&&(p=this.cachedDatumCallback(uP(e,o?"highlight":"node"),()=>{const g=this.makeItemStylerParams(t,e,o,u);return this.callWithContext(n,g)})),p?fS(p,u):u}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,highlightState:c,...o,fill:h}}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,t,a)})}updateDatumNodes({datumSelection:e}){const t=this.axes[Ji.X],[i,o]=t?.visibleRange??[],a=!(i!==0||o!==1);e.each((n,r)=>{const{point:l,width:c,height:h,style:u}=r;n.setStyleProperties(u),n.crisp=a,n.x=l.x-c/2,n.y=l.y-h/2,n.width=c,n.height=h})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e,{enabled:o}=this.properties.label,s=o?t:[];return i.update(s)}updateLabelNodes(e){const{isHighlight:t=!1}=e,i=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((o,s)=>{o.pointerEvents=mP.None,o.text=s.text,o.fillOpacity=this.getHighlightStyle(t,s.datumIndex)?.opacity??1,fP(this,o,this.properties,this.properties.label,s,t,i)})}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:u,yName:p,colorKey:g,colorName:m,colorRange:y,title:x,legendItemName:f,tooltip:b}=a,S=s[Ji.X],v=s[Ji.Y];if(!i||!o||!S||!v)return;const M=o.dataSources.get(this.id)?.data[e],D=i.resolveColumnById(this,"xValue",o)[e],I=i.resolveColumnById(this,"yValue",o)[e],A=g!=null&&this.isColorScaleValid()?i.resolveColumnById(this,"colorValue",o)[e]:void 0,k=this.properties.allowNullKeys??!1;if(D===void 0&&!k)return;const N=[];let L;if(A==null)L=y[0];else{L=n.convert(A);const R=i.getDomain(this,"colorValue","value",o).domain,w=l.format(this.callWithContext.bind(this),{type:"number",value:A,datum:M,seriesId:t,legendItemName:f,key:g,source:"tooltip",property:"color",domain:R,boundSeries:this.getFormatterContext("color"),fractionDigits:void 0,visibleDomain:void 0});N.push({label:m,fallbackLabel:g,value:w??eP(A)})}N.push({label:h,fallbackLabel:c,value:this.getAxisValueText(S,"tooltip",D,M,c,f)},{label:p,fallbackLabel:u,value:this.getAxisValueText(v,"tooltip",I,M,u,f)});const T=this.getItemStyle({datumIndex:e,datum:M,colorValue:A},!1);T.fill!=null&&(L=T.fill);const P=L==null?void 0:{marker:{shape:"square",fill:L,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}};return this.formatTooltipWithContext(b,{title:x??f,symbol:P,data:N},{seriesId:t,datum:M,title:x,xKey:c,xName:h,yKey:u,yName:p,colorKey:g,colorName:m,...T})}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 lP(this,a)}initQuadTree(e){yP(e,this.datumNodesIter())}pickNodesExactShape(e){const t=kS(this,e);return t!=null&&t.distance<=0?[t.datum]:[]}pickNodeClosestDatum(e){return kS(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null||this.isColorScaleValid()}};Ou.className="HeatmapSeries",Ou.type="heatmap";import{_ModuleSupport as MP}from"ag-charts-community";import{arrayOf as DP,color as kP,commonSeriesOptionsDefs as IP,constant as AP,required as Eu,string as ps,without as IS}from"ag-charts-core";var{heatmapSeriesThemeableOptionsDef:NP}=MP,LP={...IS(NP,["showInLegend"]),...IS(IP,["showInLegend"]),type:Eu(AP("heatmap")),xKey:Eu(ps),yKey:Eu(ps),xKeyAxis:ps,yKeyAxis:ps,colorKey:ps,xName:ps,yName:ps,colorName:ps,colorRange:DP(kP)};import{LABEL_BOXING_DEFAULTS as TP,SAFE_RANGE2_OPERATION as wP}from"ag-charts-core";var AS={series:{stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$path:["/0",{$palette:"stroke"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./stroke",2,void 0]},label:{...TP,enabled:!1,color:{$ref:"textColor"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},wrapping:"on-space",overflowStrategy:"ellipsis"},itemPadding:3,highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.6}}},gradientLegend:{enabled:!0}};AS.series.colorRange={$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"divergingColors"},wP]};var Pu={type:"series",name:"heatmap",chartType:"cartesian",enterprise:!0,version:QE,dependencies:[ZE],options:LP,defaultAxes:{y:{type:gS.CATEGORY,position:mS.LEFT},x:{type:gS.CATEGORY,position:mS.BOTTOM}},axisKeys:{[yS.X]:"xKeyAxis",[yS.Y]:"yKeyAxis"},themeTemplate:AS,create:e=>new Ou(e)};import{CartesianChartModule as CP,VERSION as OP,_ModuleSupport as EP}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as cc,CARTESIAN_POSITION as NS,ChartAxisDirection as LS,MULTI_SERIES_HIGHLIGHT_STYLE as PP}from"ag-charts-core";import"ag-charts-community";var Ru=class extends cS{constructor(){super(...arguments),this.properties=new sc}nodeFactory(){const e=new sS;return e.lineCap="square",e}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o.datumIndex,t,void 0,o.itemType)})}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,r=this;e.each(function(c,h){const{centerX:u,width:p,y:g,height:m,yOpen:y,yClose:x,crisp:f}=h,b=h.isRising?a:n;c.setStaticProperties(u,p,g,m,y,x,f);const S=h.style??i.styles[h.itemType][r.getHighlightState(s,t,h.datumIndex)];c.setStyleProperties(S),c.strokeAlignment=b.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 u={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:u,fillOpacity:r.strokeOpacity,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0}},legendItemName:h,hideInLegend:!c}]}hasItemStylers(){return this.properties.itemStyler!=null}};Ru.className="ohlc",Ru.type="ohlc";import{_ModuleSupport as RP}from"ag-charts-community";import{boolean as _P,commonSeriesOptionsDefs as zP,constant as BP,number as VP,required as tn,string as oi,undocumented as TS}from"ag-charts-core";var{ohlcSeriesThemeableOptionsDef:FP}=RP,_u={...zP,...FP,type:tn(BP("ohlc")),xKey:tn(oi),openKey:tn(oi),highKey:tn(oi),lowKey:tn(oi),closeKey:tn(oi),xKeyAxis:oi,yKeyAxis:oi,xName:oi,yName:oi,openName:oi,highName:oi,lowName:oi,closeName:oi};_u.pickOutsideVisibleMinorAxis=TS(_P),_u.focusPriority=TS(VP);var{predictCartesianFinancialAxis:HP}=EP,KP={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:PP},axes:{[cc.NUMBER]:{crosshair:{snap:!1}},[cc.ORDINAL_TIME]:{groupPaddingInner:0,crosshair:{enabled:!0}}}},hc={type:"series",name:"ohlc",chartType:"cartesian",enterprise:!0,version:OP,dependencies:[CP],options:_u,matchingKeys:["xKey","lowKey","highKey","openKey","closeKey","normalizedTo"],predictAxis:HP,defaultAxes:{y:{type:cc.NUMBER,position:NS.LEFT},x:{type:cc.ORDINAL_TIME,position:NS.BOTTOM}},axisKeys:{[LS.X]:"xKeyAxis",[LS.Y]:"yKeyAxis"},themeTemplate:KP,create:e=>new Ru(e)};import{CartesianChartModule as WP,VERSION as GP,_ModuleSupport as jP}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as wS,CARTESIAN_POSITION as CS,ChartAxisDirection as OS}from"ag-charts-core";import{_ModuleSupport as on}from"ag-charts-community";import{AGGREGATION_INDEX_UNSET as ES,AGGREGATION_INDEX_Y_MAX as $P,AGGREGATION_INDEX_Y_MIN as UP,AGGREGATION_SPAN as YP,ChartAxisDirection as Ge,DebugMetrics as XP,extent as ZP,findMinMax as QP,mergeDefaults as qP}from"ag-charts-core";import"ag-charts-community";import{aggregationDomain as zu,computeExtremesAggregation as PS,computeExtremesAggregationPartial as JP,simpleMemorize2 as eR}from"ag-charts-core";function tR(e,t,i,o,s,a,n,r){const[l,c]=zu(e,s);return PS([l,c],t,i,o,{smallestKeyInterval:a,xNeedsValueOf:n,yNeedsValueOf:r})}var iR=eR(tR);function oR(e,t,i,o,s){const a=t.resolveKeysById(o,"xValue",i),n=t.resolveColumnById(o,"yHighValue",i),r=t.resolveColumnById(o,"yLowValue",i),l=t.getDomain(o,"xValue","key",i),c=t.resolveColumnNeedsValueOf(o,"xValue",i),h=t.resolveColumnNeedsValueOf(o,"yHighValue",i)??t.resolveColumnNeedsValueOf(o,"yLowValue",i);if(s){const[u,p]=zu(e,l);return PS([u,p],a,n,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:s})}return iR(e,a,n,r,l,i.reduced?.smallestKeyInterval,c,h)}function sR(e,t,i,o,s,a){const n=t.resolveKeysById(o,"xValue",i),r=t.resolveColumnById(o,"yHighValue",i),l=t.resolveColumnById(o,"yLowValue",i),c=t.getDomain(o,"xValue","key",i),h=t.resolveColumnNeedsValueOf(o,"xValue",i),u=t.resolveColumnNeedsValueOf(o,"yHighValue",i)??t.resolveColumnNeedsValueOf(o,"yLowValue",i),[p,g]=zu(e,c);return JP([p,g],n,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:s,xNeedsValueOf:h,yNeedsValueOf:u,existingFilters:a})}import"ag-charts-community";import{spanRange as aR}from"ag-charts-core";function RS({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 u=1e-6;for(let g=0;g<10;g++){const m=1-h,x=m*m*m*i+3*m*m*h*s+3*m*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 rR(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=nR(e,t,l,n,r);c.intersection&&a.push(c.intersection.x),r=c.spanIndex,n=c.isInverted}return a}function lR(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,u)=>({x0:h,y0:-n,x1:u,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{sn(l,c,t.removed),sn(l,c,i.removed)},a=(l,c)=>{sn(l,c,t.moved),sn(l,c,i.moved)},n=(l,c)=>{sn(l,c,t.added),sn(l,c,i.added)},r=xR(e,o);return{status:e,path:{addPhaseFn:n,updatePhaseFn:a,removePhaseFn:s},pathProperties:r}}function bR(e,t,i){const o=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(o!==s||!BS(e.scales.x)||!BS(t.scales.x))return;let a="updated";t.visible&&!e.visible?a="removed":!t.visible&&e.visible&&(a="added");const n=pc({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},uc.Split);if(n==null)return;const r=pc({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},uc.Split);if(r==null)return;const l=pc({scales:e.scales,data:e.highStrokeData.spans},{scales:t.scales,data:t.highStrokeData.spans},uc.Split);if(l==null)return;const c=pc({scales:e.scales,data:e.lowStrokeData.spans},{scales:t.scales,data:t.lowStrokeData.spans},uc.Split);if(c==null)return;const h="fade",u=fR(a,n,r,h),p=SR(a,l,c,h),g=(i?.changed??!0)||!zS(e.scales.x,t.scales.x)||!zS(e.scales.y,t.scales.y)||a!=="updated";return{status:a,fill:u,stroke:p,hasMotion:g}}var vR=$P,MR=UP,DR=YP,{valueProperty:VS,keyProperty:kR,updateLabelNode:IR,fixNumericExtent:FS,buildResetPathFn:AR,resetLabelFn:NR,resetMarkerFn:LR,resetMarkerPositionFn:HS,pathSwipeInAnimation:TR,resetMotion:wR,markerSwipeScaleInAnimation:CR,seriesLabelFadeInAnimation:Hu,animationValidation:OR,diff:ER,updateClipPath:Ku,computeMarkerFocusBounds:KS,plotAreaPathFill:PR,plotLinePathStroke:WS,interpolatePoints:GS,pathFadeInAnimation:Wu,markerFadeInAnimation:jS,fromToMotion:Gu,pathMotion:ju,PointerEvents:gc,Marker:RR,BBox:_R,processedDataIsAnimatable:$u,markerEnabled:zR,getMarkerStyles:BR,calculateSegments:VR,toHighlightString:FR,HighlightState:HR,AggregationManager:KR,resetMarkerSelectionsDirect:WR,createDatumId:GR,visibleRangeIndices:$S}=on,jR=class extends on.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}},Uu=class extends on.CartesianSeries{constructor(e){super({moduleCtx:e,pathsPerSeries:["fill","lowStroke","highStroke"],pickModes:[on.SeriesNodePickMode.AXIS_ALIGNED],propertyKeys:{[Ge.X]:["xKey"],[Ge.Y]:["yLowKey","yHighKey"]},propertyNames:{[Ge.X]:["xName"],[Ge.Y]:["yLowName","yHighName","yName"]},categoryKey:"xValue",animationResetFns:{path:AR({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:NR,datum:(t,i)=>({...LR(t),...HS(t,i)})},clipFocusBox:!1}),this.properties=new ge,this.NodeEvent=jR,this.aggregationManager=new KR}renderToOffscreenCanvas(){return(this.contextNodeData?.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}async processData(e){const{xKey:t,yLowKey:i,yHighKey:o}=this.properties,s=this.axes[Ge.X]?.scale,a=this.axes[Ge.Y]?.scale,{xScaleType:n,yScaleType:r}=this.getScaleInformation({xScale:s,yScale:a}),l=[],c=!this.ctx.animationManager.isSkipped();this.needsDataModelDiff()&&this.processedData&&l.push(ER(this.id,this.processedData)),c&&l.push(OR());const h=this.properties.allowNullKeys??!1,{dataModel:u,processedData:p}=await this.requestDataModel(e,this.data,{props:[kR(t,n,{id:"xValue",allowNullKey:h}),VS(i,r,{id:"yLowValue"}),VS(o,r,{id:"yHighValue"}),...l]});this.aggregateData(u,p),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||$u(t))return;const i=this.axes[Ge.X];if(i==null)return;const o=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>sR(i.scale.type,e,t,this,o,a),computeFull:a=>oR(i.scale.type,e,t,this,a),targetRange:o});const s=this.aggregationManager.filters;s&&s.length>0&&XP.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes[Ge.X];if(e?.scale?.range){const[t,i]=e.scale.range;return Math.abs(i-t)}return this.ctx.scene?.canvas?.width??800}createNodeDatumContext(e,t){const{dataModel:i,processedData:o}=this;if(!i||!o)return;const s=o.dataSources.get(this.id)?.data??[],a=e.scale,n=t.scale,r=e.range,[l,c]=a.range,h=Math.abs(c-l);this.aggregationManager.ensureLevelForRange(h);const u=this.aggregationManager.getFilterForRange(h),p=this.contextNodeData?.nodeData,g=!this.ctx.animationManager.isSkipped(),m=p!=null&&(o.changeDescription!=null||!$u(o)||u!=null);return{xAxis:e,yAxis:t,rawData:s,xValues:i.resolveKeysById(this,"xValue",o),yHighValues:i.resolveColumnById(this,"yHighValue",o),yLowValues:i.resolveColumnById(this,"yLowValue",o),xScale:a,yScale:n,xAxisRange:r,xOffset:(a.bandwidth??0)/2,dataAggregationFilter:u,range:h,labelsEnabled:this.properties.label.enabled,animationEnabled:g,canIncrementallyUpdate:m,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,item:this.properties.item,yDomain:this.getSeriesDomain(Ge.Y).domain,connectMissingData:this.properties.connectMissingData,interpolation:this.properties.interpolation,nodes:m?p:[],labelData:[],spanPoints:[],nodeIndex:0}}xCoordinateRange(e){const t=this.axes[Ge.X].scale.convert(e);return[t,t]}yCoordinateRange(e){const t=this.axes[Ge.Y].scale.convert(e[0]);return[t,t]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!(t&&i))return{domain:[]};const{domain:{keys:[o]}}=t;if(e===Ge.X){const s=i.resolveProcessedDataDefById(this,"xValue");if(s?.def.type==="key"&&s.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",t);return{domain:o,sortMetadata:a}}return{domain:FS(ZP(o))}}else{const s=this.domainForClippedRange(Ge.Y,["yHighValue","yLowValue"],"xValue"),a=QP(s);return{domain:FS(a)}}}getSeriesRange(e,t){return this.domainForVisibleRange(Ge.Y,["yHighValue","yLowValue"],"xValue",t)}handleDatumPoint(e,t,i,o,s){if(t.xValue=e.xValues[i],t.xValue===void 0&&!this.properties.allowNullKeys)return;t.datum=e.rawData[i],t.yHighValue=o??e.yHighValues[i],t.yLowValue=s??e.yLowValues[i];const a=e.spanPoints.at(-1);if(Number.isFinite(t.yHighValue)&&Number.isFinite(t.yLowValue)){if(t.inverted=t.yLowValue>t.yHighValue,t.x=e.xScale.convert(t.xValue)+e.xOffset,!Number.isFinite(t.x))return;t.yHighCoordinate=e.yScale.convert(t.yHighValue),t.yLowCoordinate=e.yScale.convert(t.yLowValue),this.upsertMarkerDatum(e,t,i,"high",t.yHighValue,t.yHighCoordinate),this.upsertMarkerDatum(e,t,i,"low",t.yLowValue,t.yLowCoordinate);const n={high:{point:{x:t.x,y:t.yHighCoordinate},xDatum:t.xValue,yDatum:t.yHighValue},low:{point:{x:t.x,y:t.yLowCoordinate},xDatum:t.xValue,yDatum:t.yLowValue}};Array.isArray(a)?a.push(n):a==null?e.spanPoints.push([n]):(a.skip+=1,e.spanPoints.push([n]))}else e.connectMissingData||(Array.isArray(a)||a==null?e.spanPoints.push({skip:0}):a.skip+=1)}upsertMarkerDatum(e,t,i,o,s,a){const{size:n}=e.item[o].marker;if(e.canIncrementallyUpdate&&e.nodeIndexe.xScale.convert(e.xValues[s])+e.xOffset;if(t.input.count<1e3||e.dataAggregationFilter==null){let[s,a]=$S(1,e.xValues.length,e.xAxisRange,n=>{const r=o(n);return[r,r]});t.input.count<1e3&&(s=0,a=t.input.count),s=Math.max(s-1,0),a=Math.min(a+1,e.xValues.length);for(let n=s;n{const h=n[c];if(h!==ES)return[o(h),o(h)]});for(let c=r;c{if(!Array.isArray(l))return[];const c=l.map(h=>h.high);return GS(c,e.interpolation)}),a=e.spanPoints.flatMap(l=>{if(!Array.isArray(l))return[];const c=l.map(h=>h.low);return GS(c,e.interpolation)}),n=VR(this.properties.segmentation,i,o,this.chart.seriesRect,this.ctx.scene,!1);let r;if(this.properties.invertedStyle.enabled){const l=e.yHighValues[0]{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:u,opacity:p}=qP(l,this.getStyle(r));o.setProperties({datum:a,segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:gc.None,stroke:c.low.stroke,strokeWidth:c.low.strokeWidth,strokeOpacity:c.low.strokeOpacity,lineDash:c.low.lineDash,lineDashOffset:c.low.lineDashOffset,opacity:p,visible:t}),s.setProperties({segments:a,fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:gc.None,stroke:c.high.stroke,strokeWidth:c.high.strokeWidth,strokeOpacity:c.high.strokeOpacity,lineDash:c.high.lineDash,lineDashOffset:c.high.lineDashOffset,opacity:p,visible:t});const g=this.getShapeFillBBox();i.setFillProperties(h,g),i.setStyleProperties({stroke:void 0,fill:h,fillOpacity:u,opacity:p},g);const m=this.contextNodeData?.intersectionSegments??a;i.setProperties({segments:m,pointerEvents:gc.None,lineJoin:"round",fillShadow:this.properties.shadow,opacity:p,visible:t}),i.datum=m,Ku(this,i),Ku(this,o),Ku(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(),PR(i,t.fillData),i.markDirty("RangeArea")}updateStrokePath(e,t){const[,i,o]=e;i.path.clear(),o.path.clear(),WS(i,t.lowStrokeData.spans),WS(o,t.highStrokeData.spans),i.markDirty("RangeArea"),o.markDirty("RangeArea")}resetDatumAnimation(e){WR([e.datumSelection])}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=zR(o.input.count,s[Ge.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 u of t)n[u.itemType].marker.enabled&&h.push(u)}else h=[];return $u(this.processedData)?i.update(h,void 0,u=>GR(u.xValue,u.itemType)):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(a),{fill:r,fillOpacity:l,item:c}=n,{stroke:h,strokeWidth:u,strokeOpacity:p}=c[s.itemType],{marker:g}=this.properties.item[s.itemType],m=this.makeItemStylerParams(s.itemType);s.style=this.getMarkerStyle(g,s,m,{isHighlight:t,highlightState:a,resolveMarkerSubPath:["item",s.itemType,"marker"]},n.item[s.itemType].marker,{fill:r,fillOpacity:l,stroke:h,strokeWidth:u,strokeOpacity:p})})}updateDatumNodes(e){const{contextNodeData:t}=this;if(!t)return;const{datumSelection:i,isHighlight:o}=e,s=this.getShapeFillBBox(),a=this.ctx.highlightManager.getActiveHighlight(),n=this.getDrawingMode(o,e.drawingMode);i.each((r,l)=>{const{itemType:c}=l,h=l.style??t.styles[c][this.getHighlightState(a,o,l.datumIndex)];this.applyMarkerStyle(h,r,l.point,s),r.drawingMode=n}),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=gc.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(),{isHighlight:o=!1,labelSelection:s}=e;s.each((a,n)=>{a.fillOpacity=this.getHighlightStyle(o,n.datumIndex).opacity??1,IR(this,a,t,this.properties.label,n,o,i)})}getHighlightLabelData(e,t){return e?.length?e.filter(i=>i.datum===t.datum):[]}getHighlightData(e,t){const i=e.filter(o=>o.datum===t.datum).map(o=>({...o}));return i.length>0?i:void 0}getStyle(e){return this.getStylerCouple(e)[0]}getStylerMarkerOptions(){return this.getStylerCouple()[1]}getStylerCouple(e){const{fill:t,fillOpacity:i,item:o,styler:s}=this.properties;let a={};if(s){const c=this.makeStylerParams(e);a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(s,c)??{},{pick:!1})??{}}const n={item:{low:{marker:{enabled:!1}},high:{marker:{enabled:!1}}}},r=c=>{const h=a.item?.[c],{lineDash:u,lineDashOffset:p,marker:g,stroke:m,strokeOpacity:y,strokeWidth:x}=o[c];return n.item[c].marker.enabled=h?.marker?.enabled??g.enabled,{marker:{fill:h?.marker?.fill??g.fill??t,fillOpacity:h?.marker?.fillOpacity??g.fillOpacity,shape:h?.marker?.shape??g.shape,size:h?.marker?.size??g.size,lineDash:h?.marker?.lineDash??g.lineDash,lineDashOffset:h?.marker?.lineDashOffset??g.lineDashOffset,stroke:h?.marker?.stroke??g.stroke??m,strokeOpacity:h?.marker?.strokeOpacity??g.strokeOpacity,strokeWidth:h?.marker?.strokeWidth??g.strokeWidth},lineDash:h?.lineDash??u,lineDashOffset:h?.lineDashOffset??p,stroke:h?.stroke??m,strokeOpacity:h?.strokeOpacity??y,strokeWidth:h?.strokeWidth??x}};return[{fill:a.fill??t,fillOpacity:a.fillOpacity??i,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:r("low"),high:r("high")}},n]}makeStylerParams(e){const{id:t}=this,{fill:i,fillOpacity:o,item:s,xKey:a,yHighKey:n,yLowKey:r}=this.properties,l=FR(e??HR.None),c=h=>{const{lineDash:u,lineDashOffset:p,marker:g,stroke:m,strokeOpacity:y,strokeWidth:x}=s[h];return{marker:{fill:g.fill??i,fillOpacity:g.fillOpacity,size:g.size,shape:g.shape,stroke:g.stroke??m,strokeOpacity:g.strokeOpacity,strokeWidth:g.strokeWidth,lineDash:g.lineDash,lineDashOffset:g.lineDashOffset},lineDash:u,lineDashOffset:p,stroke:m,strokeOpacity:y,strokeWidth:x}};return{item:{low:c("low"),high:c("high")},fill:i,fillOpacity:o,highlightState:l,seriesId:t,xKey:a,yLowKey:r,yHighKey:n}}makeItemStylerParams(e){const{xKey:t,yLowKey:i,yHighKey:o}=this.properties;return{xKey:t,yLowKey:i,yHighKey:o,itemType:e}}getTooltipContent(e,t){const i=t?.itemType??"high",{id:o,dataModel:s,processedData:a,axes:n,properties:r}=this,{xName:l,yName:c,yLowKey:h,yLowName:u,xKey:p,yHighKey:g,yHighName:m,tooltip:y,legendItemName:x}=r,f=n[Ge.X],b=n[Ge.Y];if(!s||!a||!f||!b)return;const S=a.dataSources.get(this.id)?.data[e],v=s.resolveKeysById(this,"xValue",a)[e],M=s.resolveColumnById(this,"yHighValue",a)[e],D=s.resolveColumnById(this,"yLowValue",a)[e],I=this.properties.allowNullKeys??!1;if(v===void 0&&!I)return;const A=this.getStyle(),k=this.makeItemStylerParams(i),N=this.getMarkerStyle(this.properties.item[i].marker,{datumIndex:e,datum:S},k,{isHighlight:!1,resolveMarkerSubPath:["item",i,"marker"]},A.item[i].marker),L=`${this.getAxisValueText(b,"tooltip",D,S,h,x)} - ${this.getAxisValueText(b,"tooltip",M,S,g,x)}`;return this.formatTooltipWithContext(y,{heading:this.getAxisValueText(f,"tooltip",v,S,p,x),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:`${u??h} - ${m??g}`,value:L,missing:on.isTooltipValueMissing(M)&&on.isTooltipValueMissing(D)}]},{seriesId:o,datum:S,title:c,itemType:i,xName:l,yName:c,yLowKey:h,yLowName:u,xKey:p,yHighKey:g,yHighName:m,legendItemName:x,...N})}legendItemSymbol(){const{fill:e,topLevel:t}=this.getStyle(),{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:{enabled:!0,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}`,u=`${o}-${s}`;return[{legendType:"category",id:t,itemId:u,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new RR}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:o,paths:s}=e,{animationManager:a}=this.ctx;this.updateAreaPaths(s,o),TR(this,a,...s),wR([t],HS),CR(this,a,{...this.getAnimationDrawingModes(),phase:"initial"},t),Hu(this,"labels",a,i,this.highlightLabelSelection)}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)},u=()=>{t.skipCurrentBatch(),h()};if(s==null||n==null){h(),jS(this,t,"added",this.getAnimationDrawingModes(),i),Wu(this,"fill_path_properties",t,"add",r),Wu(this,"low_stroke_path_properties",t,"add",l),Wu(this,"high_stroke_path_properties",t,"add",c),Hu(this,"labels",t,o,this.highlightLabelSelection);return}const p=bR(s,n,this.processedData?.reduced?.diff?.[this.id]);if(p===void 0){u();return}else if(p.status==="no-op")return;Gu(this.id,"fill_path_properties",t,[r],p.fill.pathProperties),Gu(this.id,"low_stroke_path_properties",t,[l],p.stroke.pathProperties),Gu(this.id,"high_stroke_path_properties",t,[c],p.stroke.pathProperties),p.status==="added"?this.updateAreaPaths(a,s):p.status==="removed"?this.updateAreaPaths(a,n):(ju(this.id,"fill_path_update",t,[r],p.fill.path),ju(this.id,"low_stroke_path_update",t,[l],p.stroke.path),ju(this.id,"high_stroke_path_update",t,[c],p.stroke.path)),p.hasMotion&&(jS(this,t,void 0,this.getAnimationDrawingModes(),i),Hu(this,"labels",t,o,this.highlightLabelSelection)),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(),i=this.makeItemStylerParams(e.itemType);return this.getMarkerStyle(this.properties.item[e.itemType].marker,e,i,{isHighlight:!0,resolveMarkerSubPath:["item",e.itemType,"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=KS(this,e),i=KS(this,{...e,datumIndex:e.datumIndex+1});if(t&&i)return _R.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}};Uu.className="RangeAreaSeries",Uu.type="range-area";import{_ModuleSupport as $R}from"ag-charts-community";import{boolean as US,commonSeriesOptionsDefs as UR,constant as YR,fillOptionsDef as XR,number as ZR,required as mc,shapeSegmentation as QR,string as eo,undocumented as YS}from"ag-charts-core";var{rangeAreaSeriesThemeableOptionsDef:qR}=$R,Yu={...UR,...qR,type:mc(YR("range-area")),xKey:mc(eo),yLowKey:mc(eo),yHighKey:mc(eo),xKeyAxis:eo,yKeyAxis:eo,xName:eo,yName:eo,yLowName:eo,yHighName:eo,legendItemName:eo,segmentation:QR,invertedStyle:{enabled:US,...XR}};Yu.pickOutsideVisibleMinorAxis=YS(US),Yu.focusPriority=YS(ZR);import"ag-charts-community";import{CARTESIAN_AXIS_TYPE as JR,FILL_GRADIENT_LINEAR_DEFAULTS as XS,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as Xu,FILL_IMAGE_DEFAULTS as yc,FILL_PATTERN_DEFAULTS as hr,LABEL_BOXING_DEFAULTS as e1,MARKER_SERIES_HIGHLIGHT_STYLE as t1,SEGMENTATION_DEFAULTS as i1}from"ag-charts-core";var ZS={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",Xu],["image",yc],["pattern",hr]]}]},{$isUserOption:["/series/$index/marker/fill",{$path:"/series/$index/marker/fill"},{$palette:"fill"}]}]},{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Xu],["image",yc],["pattern",hr]]}]},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]}}},o1={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",XS],["pattern",hr]]},fillOpacity:.7,stroke:{$palette:"stroke"},strokeWidth:1,marker:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Xu],["image",yc],["pattern",hr]]},shape:"circle",stroke:{$palette:"stroke"},size:6,strokeWidth:2},nodeClickRange:"nearest",item:{low:ZS,high:ZS},label:{...e1,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:t1,segmentation:i1,invertedStyle:{enabled:!1,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",XS],["image",yc],["pattern",hr]]},fillOpacity:{$path:"../fillOpacity"}}},axes:{[JR.NUMBER]:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:s1}=jP,fc={type:"series",name:"range-area",chartType:"cartesian",enterprise:!0,version:GP,dependencies:[WP],options:Yu,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:s1,defaultAxes:{y:{type:wS.NUMBER,position:CS.LEFT},x:{type:wS.CATEGORY,position:CS.BOTTOM}},axisKeys:{[OS.X]:"xKeyAxis",[OS.Y]:"yKeyAxis"},themeTemplate:o1,create:e=>new Uu(e)};import{CartesianChartModule as a1,VERSION as n1,_ModuleSupport as r1}from"ag-charts-community";import{ChartAxisDirection as xc,DIRECTION_SWAP_AXES as l1}from"ag-charts-core";import{_ModuleSupport as an}from"ag-charts-community";import{AGGREGATION_INDEX_X_MAX as QS,AGGREGATION_INDEX_X_MIN as c1,AGGREGATION_INDEX_Y_MAX as h1,AGGREGATION_INDEX_Y_MIN as d1,AGGREGATION_SPAN as qS,ChartAxisDirection as nn,DebugMetrics as u1,areScalingEqual as p1,findMinMax as g1,mergeDefaults as JS}from"ag-charts-core";import"ag-charts-community";import{aggregationDomain as Zu,computeExtremesAggregation as eb,computeExtremesAggregationPartial as m1,simpleMemorize2 as y1}from"ag-charts-core";function f1(e,t,i,o,s,a,n,r){const[l,c]=Zu(e,s);return eb([l,c],t,i,o,{smallestKeyInterval:a,xNeedsValueOf:n,yNeedsValueOf:r})}var x1=y1(f1);function S1(e,t,i,o,s){const a=t.resolveKeysById(o,"xValue",i),n=t.resolveColumnById(o,"yHighValue",i),r=t.resolveColumnById(o,"yLowValue",i),l=t.getDomain(o,"xValue","key",i),c=t.resolveColumnNeedsValueOf(o,"xValue",i),h=t.resolveColumnNeedsValueOf(o,"yHighValue",i)??t.resolveColumnNeedsValueOf(o,"yLowValue",i);if(s){const[u,p]=Zu(e,l);return eb([u,p],a,n,r,{smallestKeyInterval:i.reduced?.smallestKeyInterval,xNeedsValueOf:c,yNeedsValueOf:h,existingFilters:s})}return x1(e,a,n,r,l,i.reduced?.smallestKeyInterval,c,h)}function b1(e,t,i,o,s,a){const n=t.resolveKeysById(o,"xValue",i),r=t.resolveColumnById(o,"yHighValue",i),l=t.resolveColumnById(o,"yLowValue",i),c=t.getDomain(o,"xValue","key",i),h=t.resolveColumnNeedsValueOf(o,"xValue",i),u=t.resolveColumnNeedsValueOf(o,"yHighValue",i)??t.resolveColumnNeedsValueOf(o,"yLowValue",i),[p,g]=Zu(e,c);return m1([p,g],n,r,l,{smallestKeyInterval:i.reduced?.smallestKeyInterval,targetRange:s,xNeedsValueOf:h,yNeedsValueOf:u,existingFilters:a})}import{_ModuleSupport as v1}from"ag-charts-community";import{Property as Te}from"ag-charts-core";var{AbstractBarSeriesProperties:M1,makeSeriesTooltip:D1,DropShadow:k1,Label:I1}=v1,Qu=class extends I1{constructor(){super(...arguments),this.placement="inside",this.spacing=0}};d([Te],Qu.prototype,"placement",2),d([Te],Qu.prototype,"spacing",2);var Ve=class extends M1{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 k1().set({enabled:!1}),this.label=new Qu,this.tooltip=D1()}};d([Te],Ve.prototype,"xKey",2),d([Te],Ve.prototype,"yLowKey",2),d([Te],Ve.prototype,"yHighKey",2),d([Te],Ve.prototype,"xName",2),d([Te],Ve.prototype,"yName",2),d([Te],Ve.prototype,"yLowName",2),d([Te],Ve.prototype,"yHighName",2),d([Te],Ve.prototype,"fill",2),d([Te],Ve.prototype,"fillOpacity",2),d([Te],Ve.prototype,"stroke",2),d([Te],Ve.prototype,"strokeWidth",2),d([Te],Ve.prototype,"strokeOpacity",2),d([Te],Ve.prototype,"lineDash",2),d([Te],Ve.prototype,"lineDashOffset",2),d([Te],Ve.prototype,"cornerRadius",2),d([Te],Ve.prototype,"styler",2),d([Te],Ve.prototype,"itemStyler",2),d([Te],Ve.prototype,"shadow",2),d([Te],Ve.prototype,"label",2),d([Te],Ve.prototype,"tooltip",2);var{SeriesNodePickMode:tb,valueProperty:ib,keyProperty:A1,checkCrisp:N1,updateLabelNode:L1,SMALLEST_KEY_INTERVAL:T1,LARGEST_KEY_INTERVAL:w1,diff:C1,prepareBarAnimationFunctions:ob,midpointStartingBarPosition:sb,resetBarSelectionsFn:O1,resetBarSelectionsDirect:E1,fixNumericExtent:P1,seriesLabelFadeInAnimation:ab,resetLabelFn:R1,animationValidation:_1,computeBarFocusBounds:z1,visibleRangeIndices:B1,createDatumId:V1,Rect:F1,PointerEvents:H1,motion:nb,processedDataIsAnimatable:qu,getItemStyles:K1,calculateSegments:W1,toHighlightString:G1,HighlightState:rb,AggregationManager:j1,upsertNodeDatum:Ju}=an,$1=class extends an.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}},ep=class extends an.AbstractBarSeries{constructor(e){super({moduleCtx:e,pickModes:[tb.AXIS_ALIGNED,tb.EXACT_SHAPE_MATCH],propertyKeys:{x:["xKey"],y:["yLowKey","yHighKey"]},propertyNames:{x:["xName"],y:["yLowName","yHighName","yName"]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:O1,label:R1}}),this.properties=new Ve,this.aggregationManager=new j1,this.NodeEvent=$1}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.needsDataModelDiff()&&this.processedData&&c.push(C1(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||c.push(_1());const h=this.visible?{}:{forceValue:Number.NaN},u=this.properties.allowNullKeys??!1,{dataModel:p,processedData:g}=await this.requestDataModel(e,this.data,{props:[A1(t,r,{id:"xValue",allowNullKey:u}),ib(i,l,{id:"yLowValue",invalidValue:null,...h}),ib(o,l,{id:"yHighValue",invalidValue:null,...h}),...n?[T1,w1]:[],...c],groupByKeys:!1});this.smallestDataInterval=g.reduced?.smallestKeyInterval,this.largestDataInterval=g.reduced?.largestKeyInterval,this.aggregateData(p,g),this.animationState.transition("updateData")}aggregateData(e,t){if(this.aggregationManager.markStale(t.input.count),t.type!=="ungrouped"||qu(t))return;const i=this.axes[nn.X];if(i==null)return;const o=this.estimateTargetRange();this.aggregationManager.aggregate({computePartial:a=>b1(i.scale.type,e,t,this,o,a),computeFull:a=>S1(i.scale.type,e,t,this,a),targetRange:o});const s=this.aggregationManager.filters;s&&s.length>0&&u1.record(`${this.type}:aggregation`,s.map(a=>a.maxRange))}estimateTargetRange(){const e=this.axes[nn.X];if(e?.scale==null)return 0;const[t,i]=e.scale.range;return Math.abs(i-t)}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};const{keys:[o]}=t.domain;if(e===this.getCategoryDirection()){const s=i.resolveProcessedDataDefById(this,"xValue");if(s?.def.type==="key"&&s?.def.valueType==="category"){const a=i.getKeySortMetadata(this,"xValue",t);return{domain:o,sortMetadata:a}}return{domain:this.padBandExtent(o)}}else{const s=this.domainForClippedRange(e,["yHighValue","yLowValue"],"xValue"),a=g1(s);return{domain:P1(a)}}}getSeriesRange(e,t){return this.domainForVisibleRange(nn.Y,["yHighValue","yLowValue"],"xValue",t)}createNodeDatumContext(e,t){const{dataModel:i,processedData:o}=this;if(!i||!o)return;const s=o.dataSources?.get(this.id)?.data;if(s==null)return;const a=e.scale,n=t.scale,r=this.getBarDirection()===nn.X,l=N1(e?.scale,e?.visibleRange,this.smallestDataInterval,this.largestDataInterval),[c,h]=a.range,u=Math.abs(h-c);this.aggregationManager.ensureLevelForRange(u);const p=this.aggregationManager.getFilterForRange(u),g=!this.ctx.animationManager.isSkipped(),m=this.contextNodeData?.nodeData!=null&&(o.changeDescription!=null||!qu(o)||p!=null),{groupOffset:y,barOffset:x,barWidth:f}=this.getBarDimensions();return{xAxis:e,yAxis:t,rawData:s,xValues:i.resolveKeysById(this,"xValue",o),yLowValues:i.resolveColumnById(this,"yLowValue",o),yHighValues:i.resolveColumnById(this,"yHighValue",o),xScale:a,yScale:n,groupOffset:y,barOffset:x,barWidth:f,barAlongX:r,crisp:l,dataAggregationFilter:p,animationEnabled:g,xKey:this.properties.xKey,yLowKey:this.properties.yLowKey,yHighKey:this.properties.yHighKey,labelEnabled:this.properties.label.enabled,labelPlacement:this.properties.label.placement,labelPadding:(this.properties.label.spacing+(typeof this.properties.label.padding=="number"?this.properties.label.padding:0))*(this.properties.label.placement==="outside"?1:-1),canIncrementallyUpdate:m,nodes:m?this.contextNodeData.nodeData:[],nodeIndex:0}}prepareNodeDatumState(e,t,i){const o=e.rawData[i],s=e.xValues[i];if(s===void 0&&!this.properties.allowNullKeys)return;const a=e.yLowValues[i],n=e.yHighValues[i];if(!Number.isFinite(a?.valueOf())||!Number.isFinite(n?.valueOf()))return;const[r,l]=a{const p=u*qS,g=r[p+QS],m=l[u];if(m!==-1)return[t(m),t(g)+e.barWidth]});for(let u=c;uthis.createNodeDatum(S,v,o,s),(S,v,M)=>this.updateNodeDatum(S,v,M,s)))}}createNodeDataSimple(e,t,i,o,s,a){const n=a.invalidData?.get(this.id);let[r,l]=this.visibleRangeIndices("xValue",e.xAxis.range);a.input.count<1e3&&(r=0,l=a.input.count);for(let c=r;cthis.createNodeDatum(h,u,o,s),(h,u,p)=>this.updateNodeDatum(h,u,p,s)))}createNodeDataGrouped(e,t,i,o,s){const a=this.processedData;for(const{datumIndex:n,groupIndex:r}of this.dataModel.forEachGroupDatum(this,a))i.datumIndex=n,i.groupedDataIndex=r,i.x=t(n),i.width=e.barWidth,i.yLow=e.yLowValues[n],i.yHigh=e.yHighValues[n],i.crisp=e.crisp,Ju(e,i,(l,c)=>this.createNodeDatum(l,c,o,s),(l,c,h)=>this.updateNodeDatum(l,c,h,s))}populateNodeData(e){const{processedData:t}=this;if(!t)return;const{yLowKey:i,yHighKey:o,strokeWidth:s}=this.properties,a=`${i}-${o}`,n=l=>{const c=e.xScale.convert(e.xValues[l]);return Number.isFinite(c)?Math.round(c)+e.groupOffset+e.barOffset:Number.NaN},r={nodeDatumScratch:{datum:void 0,xValue:void 0,yLowValue:0,yHighValue:0,rawLowValue:void 0,rawHighValue:void 0},labelParamsScratch:{labels:[],datumIndex:0,rectX:0,rectY:0,rectWidth:0,rectHeight:0,yLowValue:0,yHighValue:0,datum:void 0},datumIndex:0,groupedDataIndex:0,x:0,width:0,yLow:0,yHigh:0,crisp:!1};e.dataAggregationFilter!=null?this.createNodeDataWithAggregation(e,n,r,a,s,e.dataAggregationFilter):t.type==="ungrouped"?this.createNodeDataSimple(e,n,r,a,s,t):this.createNodeDataGrouped(e,n,r,a,s)}finalizeNodeData(e){e.canIncrementallyUpdate&&e.nodeIndex0&&(i.length=0);return}const{xKey:o,yLowKey:s,yHighKey:a,xName:n,yLowName:r,yHighName:l,yName:c,legendItemName:h,label:u}=this.properties,p=e.barAlongX,g=e.labelPlacement,m=e.labelPadding,y=t.rectX,x=t.rectY,f=t.rectWidth,b=t.rectHeight,S=y+(p?-m:f/2),v=x+(p?b/2:b+m);let M;g==="outside"?M=p?"right":"center":M=p?"left":"center";let D;g==="outside"?D=p?"middle":"top":D=p?"middle":"bottom";const I=y+(p?f+m:f/2),A=x+(p?b/2:-m);let k;g==="outside"?k=p?"left":"center":k=p?"right":"center";let N;g==="outside"?N=p?"middle":"bottom":N=p?"middle":"top";const L=t.datum,T=t.yLowValue,P=t.yHighValue,R=t.datumIndex,w={datum:L,xKey:o,yLowKey:s,yHighKey:a,xName:n,yLowName:r,yHighName:l,yName:c,legendItemName:h},O=this.getSeriesDomain(nn.Y).domain,B=this.getLabelText(T,L,s,"y",O,u,{itemType:"low",value:T,...w}),E=this.getLabelText(P,L,a,"y",O,u,{itemType:"high",value:P,...w});if(i.length>0&&i[0].itemType==="low"){const C=i[0];C.datumIndex=R,C.x=S,C.y=v,C.textAlign=M,C.textBaseline=D,C.text=B,C.datum=L}else i[0]={datumIndex:R,x:S,y:v,textAlign:M,textBaseline:D,text:B,itemType:"low",datum:L,series:this};if(i.length>1&&i[1].itemType==="high"){const C=i[1];C.datumIndex=R,C.x=I,C.y=A,C.textAlign=k,C.textBaseline=N,C.text=E,C.datum=L}else i[1]={datumIndex:R,x:I,y:A,textAlign:k,textBaseline:N,text:E,itemType:"high",datum:L,series:this};i.length=2}nodeFactory(){return new F1}getStyle(e,t){const{cornerRadius:i,fill:o,fillOpacity:s,lineDash:a,lineDashOffset:n,stroke:r,strokeOpacity:l,strokeWidth:c,styler:h}=this.properties;let u={};if(!e&&h){const p=this.makeStylerParams(t);u=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.cachedCallWithContext(h,p)??{},{pick:!1})??{}}return{cornerRadius:u.cornerRadius??i,fill:u.fill??o,fillOpacity:u.fillOpacity??s,lineDash:u.lineDash??a,lineDashOffset:u.lineDashOffset??n,opacity:1,stroke:u.stroke??r,strokeOpacity:u.strokeOpacity??l,strokeWidth:u.strokeWidth??c}}makeStylerParams(e){const{id:t}=this,{cornerRadius:i,fill:o,fillOpacity:s,lineDash:a,lineDashOffset:n,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:u,yHighKey:p}=this.properties,g=G1(e??rb.None);return{cornerRadius:i,fill:o,fillOpacity:s,highlightState:g,lineDash:a,lineDashOffset:n,seriesId:t,stroke:r,strokeOpacity:l,strokeWidth:c,xKey:h,yLowKey:u,yHighKey:p}}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e,o=t??[];return qu(this.processedData)?i.update(o,void 0,s=>this.getDatumId(s)):i.update(o)}getItemStyle(e,t,i){const{properties:o,dataModel:s,processedData:a}=this,{itemStyler:n}=o,r=this.getHighlightStyle(t,e,i);let l=JS(r,this.getStyle(e===void 0,i));if(n&&s!=null&&a!=null&&e!=null){const c=s.resolveKeysById(this,"xValue",a)[e],h=this.cachedDatumCallback(V1(this.getDatumId({xValue:c}),t?"highlight":"node"),()=>{const u=this.makeItemStylerParams(e,t,l);return this.callWithContext(n,u)});h&&(l=JS(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(),u=this.getHighlightStateString(h,t,e),p=this.filterItemStylerFillParams(i.fill)??i.fill;return{seriesId:o,datum:c,xKey:n,yHighKey:r,yLowKey:l,highlightState:u,...i,fill:p}}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()===nn.X,a=this.getShapeFillBBox(),n=this;e.each(function(l,c){const h=c.style??i.styles[n.getHighlightState(o,t,c.datumIndex)];l.setStyleProperties(h,a),l.setStaticProperties("overlay",h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,h.cornerRadius??0,s?c.width>0:c.height>0,c.crisp,void 0)})}updateLabelSelection(e){const t=this.properties.label.enabled?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=H1.None})}updateLabelNodes(e){const{isHighlight:t=!1}=e,i={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},o=this.ctx.highlightManager?.getActiveHighlight();e.labelSelection.each((s,a)=>{s.fillOpacity=this.getHighlightStyle(t,a?.datumIndex).opacity??1,L1(this,s,i,this.properties.label,a,t,o)})}getHighlightLabelData(e,t){return t.labels?.length?t.labels:super.getHighlightLabelData(e,t)}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:u,tooltip:p,legendItemName:g}=s,m=this.getCategoryAxis(),y=this.getValueAxis();if(!i||!o||!m||!y)return;const x=o.dataSources.get(this.id)?.data[e],f=i.resolveKeysById(this,"xValue",o)[e],b=i.resolveColumnById(this,"yHighValue",o)[e],S=i.resolveColumnById(this,"yLowValue",o)[e],v=this.properties.allowNullKeys??!1;if(f===void 0&&!v)return;const M=this.getItemStyle(e,!1),D=`${this.getAxisValueText(y,"tooltip",S,x,l,g)} - ${this.getAxisValueText(y,"tooltip",b,x,c,g)}`;return this.formatTooltipWithContext(p,{heading:this.getAxisValueText(m,"tooltip",f,x,a,g),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:`${h??l} - ${u??c}`,value:D,missing:an.isTooltipValueMissing(b)&&an.isTooltipValueMissing(S)}]},{seriesId:t,datum:x,title:r,xKey:a,xName:n,yName:r,yLowKey:l,yHighKey:c,yLowName:h,yHighName:u,legendItemName:g,...M})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:o,strokeOpacity:s,lineDash:a,lineDashOffset:n}=this.getStyle(!1,rb.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}`,u=`${n}-${r}`;return[{legendType:"category",id:t,itemId:u,seriesId:t,enabled:i,label:{text:`${h}`},symbol:this.legendItemSymbol(),legendItemName:l,hideInLegend:!c}]}resetDatumAnimation(e){E1([e.datumSelection])}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=ob(sb(this.isVertical(),"normal"),"unknown");nb.fromToMotion(this.id,"datums",this.ctx.animationManager,[e],i),ab(this,"labels",this.ctx.animationManager,t,this.highlightLabelSelection)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:o,previousContextData:s}=e,a=an.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=ob(sb(this.isVertical(),n),"added");nb.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],r,(l,c)=>this.getDatumId(c),a),(a?.changed||!p1(o.groupScale,s?.groupScale))&&ab(this,"labels",this.ctx.animationManager,i,this.highlightLabelSelection)}getDatumId(e){return`${e.xValue}`}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return z1(this,this.contextNodeData?.nodeData[e])}hasItemStylers(){return this.properties.styler!=null||this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};ep.className="RangeBarSeries",ep.type="range-bar";import{_ModuleSupport as U1}from"ag-charts-community";import{boolean as Y1,commonSeriesOptionsDefs as X1,constant as Z1,number as Q1,positiveNumberNonZero as q1,ratio as J1,required as Sc,shapeSegmentation as e_,string as to,undocumented as lb}from"ag-charts-core";var{rangeBarSeriesThemeableOptionsDef:t_}=U1,tp={...X1,...t_,type:Sc(Z1("range-bar")),xKey:Sc(to),yLowKey:Sc(to),yHighKey:Sc(to),xKeyAxis:to,yKeyAxis:to,xName:to,yName:to,yLowName:to,yHighName:to,legendItemName:to,segmentation:e_,width:q1,widthRatio:J1};tp.pickOutsideVisibleMinorAxis=lb(Y1),tp.focusPriority=lb(Q1);import"ag-charts-community";import{CARTESIAN_AXIS_TYPE as i_,FILL_GRADIENT_LINEAR_DEFAULTS as o_,FILL_IMAGE_DEFAULTS as s_,FILL_PATTERN_DEFAULTS as a_,LABEL_BOXING_DEFAULTS as n_,MULTI_SERIES_HIGHLIGHT_STYLE as r_,SEGMENTATION_DEFAULTS as l_}from"ag-charts-core";var c_={series:{direction:"vertical",fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",o_],["image",s_],["pattern",a_]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...n_,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},placement:"inside",padding:{$isUserOption:["./spacing",0,6]}},highlight:r_,segmentation:l_},axes:{[i_.NUMBER]:{crosshair:{enabled:!0}}}},{predictCartesianNonPrimitiveAxis:h_}=r1,bc={type:"series",name:"range-bar",chartType:"cartesian",enterprise:!0,groupable:!0,version:n1,dependencies:[a1],options:tp,matchingKeys:["xKey","yLowKey","yHighKey","normalizedTo"],predictAxis:h_,defaultAxes:l1,axisKeys:{[xc.X]:"xKeyAxis",[xc.Y]:"yKeyAxis"},axisKeysFlipped:{[xc.X]:"yKeyAxis",[xc.Y]:"xKeyAxis"},themeTemplate:c_,create:e=>new ep(e)};import{CartesianChartModule as d_,VERSION as u_}from"ag-charts-community";import{ChartAxisDirection as vc,DIRECTION_SWAP_AXES as p_}from"ag-charts-core";import{_ModuleSupport as rn}from"ag-charts-community";import{ChartAxisDirection as Mc,easeOut as cb,isContinuous as hb,mergeDefaults as db}from"ag-charts-core";import{_ModuleSupport as g_}from"ag-charts-community";import{BaseProperties as dr,PropertiesArray as m_,Property as q}from"ag-charts-core";var{AbstractBarSeriesProperties:y_,makeSeriesTooltip:f_,DropShadow:x_,Label:S_}=g_,Dc=class extends dr{};d([q],Dc.prototype,"totalType",2),d([q],Dc.prototype,"index",2),d([q],Dc.prototype,"axisLabel",2);var ub=class extends dr{};d([q],ub.prototype,"renderer",2);var ip=class extends S_{constructor(){super(...arguments),this.placement="outside-end",this.spacing=0}};d([q],ip.prototype,"placement",2),d([q],ip.prototype,"spacing",2);var Mt=class extends dr{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 x_().set({enabled:!1}),this.label=new ip,this.tooltip=new ub}};d([q],Mt.prototype,"name",2),d([q],Mt.prototype,"fill",2),d([q],Mt.prototype,"stroke",2),d([q],Mt.prototype,"fillOpacity",2),d([q],Mt.prototype,"strokeOpacity",2),d([q],Mt.prototype,"lineDash",2),d([q],Mt.prototype,"lineDashOffset",2),d([q],Mt.prototype,"strokeWidth",2),d([q],Mt.prototype,"cornerRadius",2),d([q],Mt.prototype,"itemStyler",2),d([q],Mt.prototype,"shadow",2),d([q],Mt.prototype,"label",2),d([q],Mt.prototype,"tooltip",2);var oa=class extends dr{constructor(){super(...arguments),this.enabled=!0,this.stroke="black",this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.strokeWidth=2}};d([q],oa.prototype,"enabled",2),d([q],oa.prototype,"stroke",2),d([q],oa.prototype,"strokeOpacity",2),d([q],oa.prototype,"lineDash",2),d([q],oa.prototype,"lineDashOffset",2),d([q],oa.prototype,"strokeWidth",2);var kc=class extends dr{constructor(){super(...arguments),this.positive=new Mt,this.negative=new Mt,this.total=new Mt}};d([q],kc.prototype,"positive",2),d([q],kc.prototype,"negative",2),d([q],kc.prototype,"total",2);var wo=class extends y_{constructor(){super(...arguments),this.item=new kc,this.totals=new m_(Dc),this.line=new oa,this.tooltip=f_()}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([q],wo.prototype,"xKey",2),d([q],wo.prototype,"yKey",2),d([q],wo.prototype,"xName",2),d([q],wo.prototype,"yName",2),d([q],wo.prototype,"item",2),d([q],wo.prototype,"totals",2),d([q],wo.prototype,"line",2),d([q],wo.prototype,"tooltip",2);var{adjustLabelPlacement:b_,SeriesNodePickMode:pb,fixNumericExtent:v_,valueProperty:gb,keyProperty:M_,accumulativeValueProperty:Ic,trailingAccumulatedValueProperty:D_,createDatumId:op,checkCrisp:k_,updateLabelNode:I_,prepareBarAnimationFunctions:A_,collapsedStartingBarPosition:N_,resetBarSelectionsDirect:L_,resetBarSelectionsFn:T_,seriesLabelFadeInAnimation:w_,resetLabelFn:C_,animationValidation:O_,DEFAULT_CARTESIAN_DIRECTION_KEYS:E_,DEFAULT_CARTESIAN_DIRECTION_NAMES:P_,computeBarFocusBounds:R_,Rect:__,motion:z_,getItemStylesPerItemId:B_,DataSet:V_,processedDataIsAnimatable:F_,upsertNodeDatum:H_}=rn,sp=class extends rn.AbstractBarSeries{constructor(e){super({moduleCtx:e,propertyKeys:E_,propertyNames:P_,categoryKey:void 0,pickModes:[pb.NEAREST_NODE,pb.EXACT_SHAPE_MATCH],pathsPerSeries:["connector"],pathsZIndexSubOrderOffset:[-1,-1],animationResetFns:{datum:T_,label:C_}}),this.properties=new wo,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=S=>hb(S)&&Number(S)>=0,n=S=>hb(S)&&Number(S)>=0,r=S=>S==="total"||S==="subtotal",l={missingValue:void 0,invalidValue:void 0},c=[],h=o.reduce((S,v)=>{const M=S.get(v.index);return M?M.push(v):S.set(v.index,[v]),S},new Map);for(const[S,v]of s?.data.entries()??[]){c.push(v);const M=h.get(S);if(M)for(const D of M)c.push({...D.toJson(),[t]:D.axisLabel})}const u=[];this.ctx.animationManager.isSkipped()||u.push(O_());const p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:m,xScaleType:y,yScaleType:x}=this.getScaleInformation({xScale:p,yScale:g}),f=this.properties.allowNullKeys??!1,{processedData:b}=await this.requestDataModel(e,V_.wrap(c),{props:[M_(t,y,{id:"xValue",allowNullKey:f}),Ic(i,x,{...l,id:"yCurrent"}),Ic(i,x,{...l,missingValue:0,id:"yCurrentTotal"}),Ic(i,x,{...l,id:"yCurrentPositive",validation:a}),Ic(i,x,{...l,id:"yCurrentNegative",validation:n}),D_(i,x,{...l,id:"yPrevious"}),gb(i,x,{id:"yRaw"}),gb("totalType","category",{id:"totalTypeValue",missingValue:void 0,validation:r}),...m?[rn.SMALLEST_KEY_INTERVAL,rn.LARGEST_KEY_INTERVAL]:[],...u]});this.smallestDataInterval=b.reduced?.smallestKeyInterval,this.largestDataInterval=b.reduced?.largestKeyInterval,this.updateSeriesItemTypes(),this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i)return{domain:[]};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"){const l=i.getKeySortMetadata(this,"xValue",t);return{domain:o,sortMetadata:l}}const n=e===Mc.Y,r=this.getCategoryAxis().isReversed();return{domain: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{domain:v_(r)}}}getSeriesRange(){return[Number.NaN,Number.NaN]}populateNodeData(e){let t=0;const i={datumIndex:0,datum:void 0,xDatum:void 0,value:void 0,cumulativeValue:void 0,trailingValue:void 0,datumType:void 0};for(const[o,s]of e.rawData.entries()){const a=e.totalTypeValues[o],n=this.isSubtotal(a),r=this.isTotal(a),l=r||n,c=e.xValues[o];if(c===void 0&&!this.properties.allowNullKeys)continue;const h=e.yRawValues[o],{cumulativeValue:u,trailingValue:p}=this.computeWaterfallValues(e,o,r,n,t);l&&(t=u??0);const g=this.computeDisplayValue(r,n,h,u,p);i.datumIndex=o,i.datum=s,i.xDatum=c,i.value=g,i.cumulativeValue=u,i.trailingValue=p,i.datumType=a;const m=H_(e,i,(y,x)=>this.createNodeDatum(y,x),(y,x,f)=>this.updateNodeDatum(y,x,f));if(m){const y=this.createPointDatum(e,m,u,p,l);e.pointData.push(y)}}}finalizeNodeData(e){e.nodeIndex=0,p=this.getSeriesItemType(u,h);return{index:a,series:this,itemType:p,datum:n,datumIndex:a,cumulativeValue:c??0,xValue:r,yValue:l,yKey:o,xKey:i,x:0,y:0,width:0,height:0,midPoint:{x:0,y:0},crisp:s,label:{text:"",x:0,y:0,textAlign:"center",textBaseline:"middle"}}}updateNodeDatum(e,t,i){const{xScale:o,yScale:s,barAlongX:a,barWidth:n,valueAxisReversed:r,xKey:l,yKey:c,xName:h,yName:u,yDomain:p,crisp:g}=e,{datumIndex:m,datum:y,xDatum:x,value:f,cumulativeValue:b,trailingValue:S,datumType:v}=i,M=t,D=Math.round(o.convert(x));if(!Number.isFinite(D))return;const I=(f??0)>=0,A=this.getSeriesItemType(I,v),{strokeWidth:k,label:N}=this.getItemConfig(A),L=Math.round(s.convert(b)),T=Math.round(s.convert(S)),P=I?L:T,R=I?T:L,w=Math.max(k,Math.abs(R-P)),O=a?Math.min(P,R):D,B=a?D:Math.min(P,R),E=a?w:n,C=a?n:w;if(M.index=m,M.itemType=A,M.datum=y,M.datumIndex=m,M.cumulativeValue=b??0,M.xValue=x,M.yValue=f,M.x=O,M.y=B,M.width=E,M.height=C,M.crisp=g,M.midPoint?(M.midPoint.x=O+E/2,M.midPoint.y=B+C/2):M.midPoint={x:O+E/2,y:B+C/2},N.enabled){const _=A==="subtotal"?"total":A,z=this.getLabelText(f,y,c,"y",p,N,{itemType:_,value:f,datum:y,xKey:l,yKey:c,xName:h,yName:u}),K=N.spacing+(typeof N.padding=="number"?N.padding:0),F=b_({isUpward:(f??-1)>=0!==r,isVertical:!a,placement:N.placement,spacing:K,rect:{x:O,y:B,width:E,height:C}});M.label.text=z,M.label.x=F.x,M.label.y=F.y,M.label.textAlign=F.textAlign,M.label.textBaseline=F.textBaseline}else M.label.text=""}createNodeDatum(e,t){const i=this.createSkeletonNodeDatum(e,t);return this.updateNodeDatum(e,i,t),i}createPointDatum(e,t,i,o,s){const{yScale:a,barAlongX:n,categoryAxisReversed:r,lineStrokeWidth:l}=e,c=Math.round(a.convert(i)),h=Math.round(a.convert(o)),u=s?c:h,p=Math.floor(l)%2/2,g=r?c:u,m=r?u:c,y={x:t.x,y:t.y,width:t.width,height:t.height};let x,f;return n?(x={x:g+p,y:y.y},f={x:m+p,y:y.y+y.height}):(x={x:y.x,y:g+p},f={x:y.x+y.width,y:m+p}),{x:r?f.x:x.x,y:r?f.y:x.y,x2:r?x.x:f.x,y2:r?x.y:f.y,size:0}}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 __}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 F_(this.processedData)?i.update(o,void 0,s=>op(s.datumIndex)):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=db(c,s.getStyle(o)),{itemStyler:u}=l;let p=h;if(u!=null&&e!=null){const g=this.cachedDatumCallback(op(a,t?"highlight":"node"),()=>{const m=this.makeItemStylerParams(o,a,n,t,p);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`,"item",r],this.callWithContext(u,m))});g&&(p=db(g,p))}return p}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),u=this.filterItemStylerFillParams(s.fill)??s.fill;return{seriesId:a,itemType:e,datum:i,xKey:r,yKey:l,highlightState:h,...s,fill:u}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o,t,void 0,o.itemType)})}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const o=this.ctx.highlightManager.getActiveHighlight(),s=this.getCategoryDirection()===Mc.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=r.style??i.styles[r.itemType][this.getHighlightState(o,t,r.datumIndex)];n.setStyleProperties(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.itemType);return a.enabled});return i.update(o)}updateLabelNodes({labelSelection:e,isHighlight:t}){const i={itemType:"positive",xKey:this.properties.xKey,xName:this.properties.xName??this.properties.xName,yKey:this.properties.yKey,yName:this.properties.yName??this.properties.yName},o=this.ctx.highlightManager?.getActiveHighlight();e.each((s,a)=>{i.itemType=a.itemType;const n=this.getHighlightStyle(t,a.datumIndex)?.opacity??1;s.visible=!0,s.fillOpacity=n;const r=this.getItemConfig(a.itemType).label;I_(this,s,i,r,a.label,t,o)})}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,u=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!o||!u||!p)return;const g=o.dataSources.get(this.id)?.data[e],m=i.resolveKeysById(this,"xValue",o)[e],y=i.resolveColumnById(this,"yRaw",o)[e],x=i.resolveColumnById(this,"yCurrentTotal",o),f=i.resolveColumnById(this,"totalTypeValue",o),b=this.properties.allowNullKeys??!1;if(m===void 0&&!b)return;const S=f[e],v=(y??0)>=0,M=this.getSeriesItemType(v,S);let D;if(this.isTotal(S))D=x[e];else if(this.isSubtotal(S)){D=x[e];for(let k=e-1;k>=0;k-=1)if(this.isSubtotal(f[k])){D=D-x[k];break}}else D=y;const I=this.contextNodeData?.nodeData?.[e],A=this.getItemStyle(I,!1,void 0,I?.itemType);return this.formatTooltipWithContext(c,{heading:this.getAxisValueText(u,"tooltip",m,g,a,h),symbol:this.legendItemSymbol(M),data:[{label:l,fallbackLabel:r,value:this.getAxisValueText(p,"tooltip",D,g,r,h),missing:rn.isTooltipValueMissing(D)}]},{seriesId:t,datum:g,title:l,itemType:M,xKey:a,xName:n,yKey:r,yName:l,...A})}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:op(n),seriesId:t,enabled:!0,label:{text:r??s(n)},symbol:this.legendItemSymbol(n),hideInLegend:!a,isFixed:!0})}return o}toggleSeriesItem(){}resetDatumAnimation(e){L_([e.datumSelection])}animateEmptyUpdateReady(e){const{datumSelection:t,labelSelection:i,contextData:o}=e,s=A_(N_(this.isVertical(),this.axes,"normal"),"unknown");z_.fromToMotion(this.id,"datums",this.ctx.animationManager,[t],s),w_(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,u)=>hh>u,r=s?.scale.convert(0),l=t.reduce((h,u)=>(n(u.x,h)&&(h=u.x),h),a?1/0:0),c=(h,u,p,g,m)=>(h-u)/(p-u)*(m-g)+g;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:cb,collapsable:!1,onUpdate(h){o.clear(!0);for(const[u,p]of t.entries()){const g=c(h,r,l,r,p.x),m=c(h,r,l,r,p.x2);u!==0&&o.lineTo(g,p.y),o.moveTo(m,p.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,u)=>h>u:(h,u)=>h(n(u.y,h)&&(h=u.y),h),a?0:1/0),c=(h,u,p,g,m)=>(h-u)/(p-u)*(m-g)+g;this.ctx.animationManager.animate({id:`${this.id}_connectors`,groupId:this.id,phase:"initial",from:r,to:l,ease:cb,collapsable:!1,onUpdate(h){o.clear(!0);for(const[u,p]of t.entries()){const g=c(h,r,l,r,p.y),m=c(h,r,l,r,p.y2);u!==0&&o.lineTo(p.x,g),o.moveTo(p.x2,m)}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:rn.PointerEvents.None})}isLabelEnabled(){const{positive:e,negative:t,total:i}=this.properties.item;return e.label.enabled||t.label.enabled||i.label.enabled}computeFocusBounds({datumIndex:e}){return R_(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}};sp.className="WaterfallSeries",sp.type="waterfall";import{_ModuleSupport as K_}from"ag-charts-community";import{arrayOfDefs as W_,commonSeriesOptionsDefs as G_,constant as j_,positiveNumber as $_,positiveNumberNonZero as U_,required as ln,string as sa,union as Y_}from"ag-charts-core";var{waterfallSeriesThemeableOptionsDef:X_}=K_,Z_={...X_,...G_,type:ln(j_("waterfall")),xKey:ln(sa),yKey:ln(sa),xKeyAxis:sa,yKeyAxis:sa,xName:sa,yName:sa,totals:W_({totalType:ln(Y_("total","subtotal")),index:ln($_),axisLabel:ln(sa)},"a total definition options array"),width:U_};import"ag-charts-community";import{FILL_GRADIENT_LINEAR_KEYED_DEFAULTS as Q_,FILL_IMAGE_DEFAULTS as q_,FILL_PATTERN_KEYED_DEFAULTS as J_,LABEL_BOXING_DEFAULTS as ez,SINGLE_SERIES_HIGHLIGHT_STYLE as tz}from"ag-charts-core";function ap(e,t){return{fill:{$applySwitch:[{$path:"type"},{$if:[{$eq:[{$palette:"type"},"user-indexed"]},{$path:[`/${t}`,{$palette:"fill"},{$palette:"fills"}]},{$palette:`${e}.fill`}]},["gradient",Q_(e)],["image",q_],["pattern",J_(e)]]},stroke:{$palette:`${e}.stroke`},strokeWidth:{$isUserOption:["./stroke",2,0]},label:{...ez,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 iz={series:{item:{positive:ap("altUp",0),negative:ap("altDown",1),total:ap("neutral",2)},line:{stroke:{$palette:"neutral.stroke"},strokeOpacity:1,lineDash:[0],lineDashOffset:0,strokeWidth:2},highlight:tz},legend:{enabled:!0,toggleSeries:!1}},np={type:"series",name:"waterfall",chartType:"cartesian",enterprise:!0,solo:!0,version:u_,dependencies:[d_],options:Z_,defaultAxes:p_,axisKeys:{[vc.X]:"xKeyAxis",[vc.Y]:"yKeyAxis"},axisKeysFlipped:{[vc.X]:"yKeyAxis",[vc.Y]:"xKeyAxis"},themeTemplate:iz,create:e=>new sp(e)},mb={width:Mi,height:Mi,grip:ar,fill:tc,stroke:tc,strokeWidth:Mi,cornerRadius:Mi},Kt=["cursor","highlightStyle","listeners","nodeClickRange","showInLegend","showInMiniChart","tooltip","visible","xName","yName"],yb=[...Kt,"errorBar","label","legendItemName"],fb=[...Kt,"direction","legendItemName","minName","q1Name","medianName","q3Name","maxName"],xb=[...Kt,"title","label","labelKey","labelName","sizeName"],Sb=[...Kt,"title","label","colorName","textAlign","verticalAlign","itemPadding","colorRange"],bb=[...Kt,"label"],vb=[...Kt,"errorBar","title","label"],Mb=[...Kt,"label","yLowName","yHighName"],Db=[...Kt,"direction","label","yLowName","yHighName"],kb=[...Kt,"errorBar","title","label","labelKey","labelName"],Ib=[...Kt,"direction"],oz={enabled:ar,height:Mi,spacing:Mi,cornerRadius:Kx,mask:{fill:tc,fillOpacity:oO,stroke:tc,strokeWidth:Mi},minHandle:mb,maxHandle:mb,miniChart:{enabled:ar,padding:{top:Mi,bottom:Mi},label:{enabled:ar,avoidCollisions:ar,spacing:Mi,format:iO,formatter:eO(sO),interval:{minSpacing:Mi,maxSpacing:Mi,values:q2,step:Kx},...tO},series:J2(aO({area:ei($2.options,[...Kt,"type"]),bar:ei(U2.options,[...yb,"type"]),"box-plot":ei(fu.options,[...fb,"type"]),bubble:ei(Y2.options,[...xb,"type"]),candlestick:ei(nc.options,[...Kt,"type"]),heatmap:ei(Pu.options,[...Sb,"type"]),histogram:ei(X2.options,[...bb,"type"]),line:ei(Z2.options,[...vb,"type"]),ohlc:ei(hc.options,[...Kt,"type"]),"range-area":ei(fc.options,[...Mb,"type"]),"range-bar":ei(bc.options,[...Db,"type"]),scatter:ei(Q2.options,[...kb,"type"]),waterfall:ei(np.options,[...Ib,"type"])},"miniChart series options"))}};import"ag-charts-community";import{FONT_SIZE_RATIO as sz}from"ag-charts-core";var az=["area","bar","bubble","candlestick","heatmap","histogram","line","ohlc","range-area","range-bar","scatter","waterfall"],nz=["itemStyler","simpleItemStyler","direction","fill","fillGradientDefaults","fillPatternDefaults","fillImageDefaults","fillOpacity","shadow","focusPriority","highlight","lineDash","lineDashOffset","strokeWidth"];function Ab(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,Kt,["bar",yb],["box-plot",fb],["bubble",xb],["heatmap",Sb],["histogram",bb],["line",[...vb,...nz]],["range-area",Mb],["range-bar",Db],["scatter",kb],["waterfall",Ib]]},e]}]}}var rz={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:sz.SMALLER},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:5},padding:{top:0,bottom:0},series:{$apply:[Ab({$path:"/series/$index"},{$path:["/navigator/miniChart/series/$index/type",{$path:["type",{$path:"/series/$index/type"}]}]}),{$if:[{$or:az.map(e=>({$eq:[{$path:"/series/0/type"},e]}))},{$map:[Ab({$value:"$1"},{$path:"/series/$index/type"}),{$path:"/series"}]},void 0]}]}}},rp={type:"plugin",name:"navigator",chartType:"cartesian",enterprise:!0,version:M2,options:oz,themeTemplate:rz,create:e=>new Ua(e)};import{VERSION as lz}from"ag-charts-community";import{VERSION as cz}from"ag-charts-community";import{VERSION as hz}from"ag-charts-community";import{_ModuleSupport as dz}from"ag-charts-community";import{AbstractModuleInstance as uz,ChartAxisDirection as Nb,boxEmpty as pz}from"ag-charts-core";var gz=class extends uz{constructor(e){super(),this.ctx=e,this.enabled=new Map,this.enableDoubleClick=new Map,this.enableDragging=new Map,this.enableScrolling=new Map,this.axes=[],this.overlappingAxisIds=new Set,e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",t=>this.onSeriesAreaDoubleClick(t)),e.widgets.seriesDragInterpreter.events.on("drag-start",t=>this.onSeriesAreaDragStart(t)),e.widgets.seriesDragInterpreter.events.on("drag-move",t=>this.onSeriesAreaDragMove(t)),e.widgets.seriesDragInterpreter.events.on("drag-end",t=>this.onSeriesAreaDragEnd(t))),this.cleanup.register(e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("axis-dom-proxy:update",t=>this.onUpdate(t)),e.eventsHub.on("series-area:hover",t=>this.onSeriesAreaHover(t)),e.eventsHub.on("series-area:click",t=>this.onSeriesAreaClick(t)),()=>this.teardown())}teardown(){for(const e of this.axes)e.div.destroy()}onLayoutComplete(e){this.seriesRect=e.series.rect}onUpdate(e){const{enabled:t,enableDoubleClick:i,enableDragging:o,enableScrolling:s,source:a}=e;this.enabled.set(a,t),this.enableDoubleClick.set(a,i),this.enableDragging.set(a,o),this.enableScrolling.set(a,s);const n=this.isEnabled()&&(this.isEnabledDoubleClick()||this.isEnabledDragging()||this.isEnabledScrolling());for(const r of this.axes)r.div.setHidden(!n);n&&(this.processAxisDiff(),this.updateOverlappingAxisPointerEvents())}processAxisDiff(){const{ctx:{axisManager:e}}=this,t=[...e.getAxisContext(Nb.X),...e.getAxisContext(Nb.Y)],{removed:i,added:o}=this.diffAxisIds(t);i.length>0&&(this.axes=this.axes.filter(s=>i.includes(s.axisId)?(s.div.destroy(),this.overlappingAxisIds.delete(s.axisId),this.hoveredAxisId===s.axisId&&(this.hoveredAxisId=void 0),this.draggingAxisId===s.axisId&&(this.draggingAxisId=void 0),!1):!0));for(const s of o){const{axisId:a,direction:n}=s,r=this.createAxisDOMProxy(a,n);this.axes.push(r)}for(const s of this.axes){const n=t.find(r=>r.axisId===s.axisId).getCanvasBounds();s.div.setHidden(pz(n)),n==null?s.bounds=void 0:(s.div.setBounds(n),s.bounds=new dz.BBox(n.x,n.y,n.width,n.height))}}onSeriesAreaHover(e){if(e.consumed){this.hoveredAxisId&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:e}));return}if(!this.hasOverlappingAxes())return;const t=this.pickAxisAtPoint(e);t?(this.hoveredAxisId=t.axisId,this.ctx.eventsHub.emit("axis-dom-proxy:mouseenter",{axisId:t.axisId,direction:t.direction,event:e})):(this.hoveredAxisId&&this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:e}),this.hoveredAxisId=void 0)}onSeriesAreaClick(e){if(e.sourceEvent.type!=="dblclick"||e.consumed||!this.hasOverlappingAxes())return;const t=this.getAxis(this.hoveredAxisId);t&&this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{event:e,axisId:t.axisId,direction:t.direction})}onSeriesAreaDoubleClick(e){if(!this.isEnabled()||!this.isEnabledDoubleClick()||!this.hasOverlappingAxes())return;const t=this.getAxis(this.hoveredAxisId);t&&this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{event:e,axisId:t.axisId,direction:t.direction})}onSeriesAreaDragStart(e){if(!this.isEnabled()||!this.isEnabledDragging())return;const t=this.getAxis(this.hoveredAxisId);t&&this.overlappingAxisIds.has(t.axisId)&&(this.draggingAxisId=t.axisId,this.ctx.eventsHub.emit("axis-dom-proxy:drag-start",{axisId:t.axisId,direction:t.direction,event:e}),e.device==="touch"&&e.sourceEvent.preventDefault())}onSeriesAreaDragMove(e){if(!this.isEnabled()||!this.isEnabledDragging()||!this.draggingAxisId||!this.overlappingAxisIds.has(this.draggingAxisId))return;const t=this.getAxis(this.draggingAxisId);t&&this.ctx.eventsHub.emit("axis-dom-proxy:drag-move",{axisId:t.axisId,direction:t.direction,event:e})}onSeriesAreaDragEnd(e){if(!this.draggingAxisId||!this.overlappingAxisIds.has(this.draggingAxisId))return;const t=this.getAxis(this.draggingAxisId);t&&(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:drag-end",{axisId:t.axisId,direction:t.direction,event:e}))}pickAxisAtPoint(e){for(const t of this.axes)if(this.overlappingAxisIds.has(t.axisId)&&t.bounds?.containsPoint(e.canvasX,e.canvasY))return{axisId:t.axisId,direction:t.direction}}hasOverlappingAxes(){return this.overlappingAxisIds.size>0}getAxis(e){if(!e)return;const t=this.axes.find(i=>i.axisId===e);return t?{axisId:t.axisId,direction:t.direction}:void 0}updateOverlappingAxisPointerEvents(){this.overlappingAxisIds.clear();const e=(this.isEnabledDragging()||this.isEnabledScrolling())&&this.seriesRect;for(const t of this.axes){if(!e){t.div.setPointerEvents(void 0);continue}!!t.bounds?.clone().shrink(1).collidesBBox(this.seriesRect)?(this.overlappingAxisIds.add(t.axisId),t.div.setPointerEvents("none")):t.div.setPointerEvents(void 0)}this.cleanupAxisState()}cleanupAxisState(){this.hoveredAxisId&&!this.overlappingAxisIds.has(this.hoveredAxisId)&&(this.hoveredAxisId=void 0),this.draggingAxisId&&!this.overlappingAxisIds.has(this.draggingAxisId)&&(this.draggingAxisId=void 0)}createAxisDOMProxy(e,t){const{ctx:{proxyInteractionService:i}}=this,o="afterend",s=i.createProxyElement({type:"region",domManagerId:e,where:o});return s.addListener("drag-start",a=>{!this.isEnabled()||!this.isEnabledDragging()||(a.device==="touch"&&a.sourceEvent.preventDefault(),this.draggingAxisId=e,this.ctx.eventsHub.emit("axis-dom-proxy:drag-start",{axisId:e,direction:t,event:a}))}),s.addListener("drag-move",a=>{!this.isEnabled()||!this.isEnabledDragging()||this.ctx.eventsHub.emit("axis-dom-proxy:drag-move",{axisId:e,direction:t,event:a})}),s.addListener("drag-end",a=>{!this.isEnabled()||!this.isEnabledDragging()||(this.draggingAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:drag-end",{axisId:e,direction:t,event:a}))}),s.addListener("dblclick",a=>{!this.isEnabled()||!this.isEnabledDoubleClick()||this.ctx.eventsHub.emit("axis-dom-proxy:dblclick",{axisId:e,direction:t,event:a})}),s.addListener("mouseenter",a=>{this.isEnabled()&&(this.hoveredAxisId=e,this.ctx.eventsHub.emit("axis-dom-proxy:mouseenter",{axisId:e,direction:t,event:a}))}),s.addListener("mouseleave",a=>{this.isEnabled()&&(this.hoveredAxisId=void 0,this.ctx.eventsHub.emit("axis-dom-proxy:mouseleave",{event:a}))}),s.addListener("wheel",a=>{!this.isEnabled()||!this.isEnabledScrolling()||this.ctx.eventsHub.emit("axis-dom-proxy:wheel",{axisId:e,direction:t,event:a})}),{axisId:e,div:s,direction:t}}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}}isEnabled(){return this.isBooleanMap(this.enabled)}isEnabledDoubleClick(){return this.isBooleanMap(this.enableDoubleClick)}isEnabledDragging(){return this.isBooleanMap(this.enableDragging)}isEnabledScrolling(){return this.isBooleanMap(this.enableScrolling)}isBooleanMap(e){for(const t of e.values())if(t)return!0;return!1}},mz={type:"plugin",name:"axis-dom-proxy",version:hz,create:e=>new gz(e)};import{AbstractModuleInstance as yz,ChartAxisDirection as Lb}from"ag-charts-core";import{debounce as fz}from"ag-charts-core";var xz=class{constructor(){this.isFirstWheelEvent=!0,this.debouncedWheelReset=fz(()=>{this.isFirstWheelEvent=!0,this.wasFirstWheelEventZoomCapped=void 0},100)}onWheel(e,t){if(e.sourceEvent.cancelable===!1)return;const i=t();if(i==="abort")return;const o=i==="capped";this.firstWheelEventDirection!=null&&this.firstWheelEventDirection!==e.deltaY<0&&(this.isFirstWheelEvent=!0),this.isFirstWheelEvent?(this.wasFirstWheelEventZoomCapped=o,this.firstWheelEventDirection=e.deltaY<0,o||e.sourceEvent.preventDefault()):this.wasFirstWheelEventZoomCapped===!1&&e.sourceEvent.preventDefault(),this.isFirstWheelEvent=!1,this.debouncedWheelReset()}},Tb=["zoom","scrollbar"],Sz=class extends yz{constructor(e){super(),this.ctx=e,this.wheelSequencer=new xz,this.cleanup.register(e.eventsHub.on("axis-dom-proxy:mouseenter",t=>this.onAxisMouseEnter(t)),e.eventsHub.on("axis-dom-proxy:mouseleave",t=>this.onAxisMouseLeave(t)),e.eventsHub.on("axis-dom-proxy:drag-start",t=>this.onAxisDragStart(t)),e.eventsHub.on("axis-dom-proxy:drag-move",t=>this.onAxisDragMove(t)),e.eventsHub.on("axis-dom-proxy:drag-end",t=>this.onAxisDragEnd(t)),e.eventsHub.on("axis-dom-proxy:dblclick",t=>this.onAxisDoubleClick(t)),e.eventsHub.on("axis-dom-proxy:wheel",t=>this.onAxisWheel(t)),e.eventsHub.on("scrollbar:wheel",t=>this.onScrollbarWheel(t)),e.widgets.seriesWidget.addListener("wheel",t=>this.onSeriesAreaWheel(t)))}onAxisMouseEnter(e){this.processEvent("axis-mouseenter",e)}onAxisMouseLeave(e){this.processEvent("axis-mouseleave",e)}onAxisDragStart(e){this.processEvent("axis-drag-start",e)}onAxisDragMove(e){this.processEvent("axis-drag-move",e)}onAxisDragEnd(e){this.processEvent("axis-drag-end",e)}onAxisDoubleClick(e){this.processEvent("axis-dblclick",e)}onSeriesAreaWheel(e){this.wheelSequencer.onWheel(e,()=>this.handleWheelSequencer("wheel",{event:e}))}onAxisWheel({event:e,direction:t}){this.wheelSequencer.onWheel(e,()=>this.handleWheelSequencer("axis-wheel",{event:e,direction:t}))}onScrollbarWheel({event:e,orientation:t}){this.wheelSequencer.onWheel(e,()=>this.handleWheelSequencer("scrollbar-wheel",{event:e,direction:t==="horizontal"?Lb.X:Lb.Y}))}handleWheelSequencer(e,t){let i=!1,o="abort";for(const s of Tb){const a={...t,abort(){o="abort"},capped(){o="capped"},uncapped(){o="uncapped"},stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${s}:${e}`,a),i)return o}return"abort"}processEvent(e,t){let i=!1;for(const o of Tb){const s={...t,stopProcessing(){i=!0}};if(this.ctx.eventsHub.emit(`zoom-interaction:${o}:${e}`,s),i)return}}},wb={type:"plugin",name:"zoom-base",version:cz,dependencies:[mz],create:e=>new Sz(e)};import{_ModuleSupport as bz}from"ag-charts-community";import{AbstractModuleInstance as vz,ChartAxisDirection as Ac,ChartUpdateType as Mz,Property as ki,UNIT_MAX as Dz,UNIT_MIN as kz,ZIndexMap as Iz,clamp as cn,definedZoomState as Az}from"ag-charts-core";import"ag-charts-community";import{definedZoomState as Nz,entries as Lz}from"ag-charts-core";import"ag-charts-community";import{UNIT_MAX as ur,UNIT_MIN as Nc,clamp as Tz,definedZoomState as wz,isNumberEqual as Cb,jsonDiff as Cz}from"ag-charts-core";var aa=ur-Nc,Ob="end",Eb="middle",Oz=300,Lc=(e,t=Nc,i=ur)=>Tz(t,e,i);function Ze(e){return e.x.max-e.x.min}function Wt(e){return e.y.max-e.y.min}function Pb(e,t){return Cb(e.min,t.min)&&Cb(e.max,t.max)}function Rb(e,t){return Pb(e.x,t.x)&&Pb(e.y,t.y)}function hn(e){return Rb(e,wz())}function Co(e,t,i){if(!e)return{x:0,y:0};const o=Lc(t-e.x,0,e.x+e.width),s=Lc(i-e.y,0,e.y+e.height),a=1/e.width*o,n=1-1/e.height*s;return{x:Lc(a),y:Lc(n)}}function na(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 Tc(e,t,i){return{x:{min:e.x.min,max:e.x.min+Ze(e)*t},y:{min:e.y.min,max:e.y.min+Wt(e)*i}}}function _b(e,t,i){const o=Ze(e),s=Wt(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 si(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 Ez(e,t,o??n);default:return{min:s,max:a}}}function Ez(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 Pz(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 Ii(e){return{x:pr(e.x),y:pr(e.y)}}function pr(e){const t=e.max-e.min;let i=e.max>ur?ur-t:e.min,o=e.min{this.timer=void 0,this.run(_z)},e))}clearTimer(){this.timer!=null&&(clearTimeout(this.timer),this.timer=void 0)}isActive(){return this.timer!=null}},Bz=class{constructor(){this.min=0,this.span=1,this.thumbSpan=1}update(e,t,i=this.thumbSpan){const o=gr(0,t-e,1);this.span=o,this.thumbSpan=gr(0,i,1),this.min=this.clampMin(e,o)}clampMin(e,t=this.span){return gr(0,e,1-t)}getThumbBounds(e=this.min,t=this.thumbSpan){const i=this.clampMin(e,t);return{start:i,end:i+t}}isWithinThumb(e){const{start:t,end:i}=this.getThumbBounds();return e>=t&&e<=i}getJumpRange(e){if(!this.canScroll())return;let t=this.clampMin(e-this.thumbSpan/2,this.thumbSpan);return t=this.clampMin(t),{min:t,max:t+this.span}}getStepRange(e){if(!this.canScroll())return;const t=gr(0,e,1),{start:i,end:o}=this.getThumbBounds();if(t>=i&&t<=o)return;const s=t0&&this.span<1}},Vz=class{constructor(e,t,i,o){this.ctx=e,this.orientation=t,this.onChange=i,this.onHoverChange=o,this.dragStartRatio=0,this.interactionMode="none",this.state=new Bz,this.repeater=new zz(n=>this.applyStepToward(n)),this.container=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`scrollbar-${t}`,classList:["ag-charts-proxy-scrollbar",`ag-charts-proxy-scrollbar-${t}`],ariaLabel:void 0,role:"presentation"});const s=t==="horizontal"?"ariaLabelScrollbarHorizontal":"ariaLabelScrollbarVertical";this.slider=e.proxyInteractionService.createProxyElement({type:"slider",domIndex:0,tabIndex:0,ariaLabel:{id:s},role:"slider",parent:this.container,classList:["ag-charts-proxy-scrollbar-slider"]});const a=this.slider.getElement();a.ariaValueMin="0",a.ariaValueMax="100",this.slider.step=Fb.STEP_HUNDRETH,this.slider.keyboardStep=Fb.STEP_ONE,this.slider.orientation=t,this.slider.setPreventsDefault(!1),this.slider.addListener("change",()=>this.onSliderChange()),this.slider.addListener("keydown",n=>this.onSliderKeyDown(n)),this.slider.addListener("drag-start",n=>this.onDragStart(n)),this.slider.addListener("drag-move",n=>this.onDragMove(n)),this.slider.addListener("drag-end",n=>this.onDragEnd(n)),this.slider.addListener("mouseenter",n=>this.handleHoverEvent(n)),this.slider.addListener("mousemove",n=>this.handleHoverEvent(n)),this.slider.addListener("mouseleave",()=>this.onMouseLeave()),this.slider.addListener("wheel",n=>e.eventsHub.emit("scrollbar:wheel",{event:n,orientation:t})),this.thumbFocus=e.proxyInteractionService.createProxyElement({type:"region",parent:this.container,classList:["ag-charts-proxy-scrollbar-thumb-focus"],role:"presentation"}),this.thumbFocus.setAriaHidden(!0),this.thumbFocus.setPointerEvents("none")}destroy(){this.interactionBounds=void 0,this.repeater.stop(),this.container.destroy()}updateBounds(e){this.interactionBounds=void 0,this.container.setBounds(e),this.slider.setBounds({x:0,y:0,width:e.width,height:e.height})}updateVisibility(e){this.container.setHidden(!e)}updateMinMax(e,t,i=this.state.thumbSpan,o){this.state.update(e,t,i);const s=this.ctx.localeManager.t("ariaValuePanRange",{min:Math.round(e*100)/100,max:Math.round(t*100)/100}),a=this.slider.getElement();a.ariaValueText=s,(!o?.skipSliderUpdate||Math.abs(this.slider.getValueRatio()-e)>1e-9)&&this.slider.setValueRatio(e,{ariaValueText:s})}updateThumbBounds(e,t,i){const o=Math.max(0,i??0);this.thumbFocus.getElement().style.borderRadius=`${o}px`,this.thumbFocus.setBounds({x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height})}update(e,t,i){this.onChange(e,t),this.updateMinMax(e,t,void 0,i)}onSliderChange(){const e=this.state.clampMin(this.slider.getValueRatio()),t=e+this.state.span;this.update(e,t,{skipSliderUpdate:!0})}onSliderKeyDown(e){const{code:t}=e.sourceEvent,i=this.orientation==="vertical",o=i&&t==="ArrowUp"||!i&&t==="ArrowLeft",s=i&&t==="ArrowDown"||!i&&t==="ArrowRight";if(!o&&!s)return;e.sourceEvent.preventDefault();const a=this.slider.getElement();a.step=this.slider.keyboardStep?.attributeValue??"1",o?a.stepDown():s&&a.stepUp(),this.onSliderChange()}onDragMove(e){if(e.sourceEvent.preventDefault(),this.interactionMode==="drag"){const{isHorizontal:s,size:a,start:n}=this.getInteractionBounds()??{};if(n==null||a==null)return;const r=(s?e.originDeltaX:e.originDeltaY)/a,l=this.state.clampMin(this.dragStartRatio+r),c=l+this.state.span;this.update(l,c);return}if(this.interactionMode!=="step")return;const t=this.getPointerInfo(e);if(t==null||!Number.isFinite(t.ratio))return;const{ratio:i,inCrossBounds:o}=t;if(!o){this.repeater.stop();return}this.repeater.updateTarget(i)}onDragEnd(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0,this.setInteraction("none"),this.onHoverChange(!1)}onDragStart(e){e.sourceEvent.preventDefault(),this.interactionBounds=void 0;const t=this.getClickInfo(e);if(t?.inBounds){if(t.inThumb){this.dragStartRatio=this.slider.getValueRatio(),this.setInteraction("drag");return}if(e.sourceEvent.shiftKey){this.jumpTo(t.ratio),this.setInteraction("none");return}this.beginStepRepeat(t.ratio)}}onMouseLeave(){this.onHoverChange(!1)}getClickInfo(e){const t=this.getPointerRatio(e);return t==null?void 0:t>=0&&t<=1?{ratio:t,inBounds:!0,inThumb:this.isWithinThumb(t)}:{ratio:0,inBounds:!1,inThumb:!1}}getPointerRatio(e){return this.getPointerInfo(e)?.ratio}getPointerInfo(e){if(e.device==="keyboard")return;const{isHorizontal:t,size:i,start:o,crossStart:s,crossSize:a}=this.getInteractionBounds(),n=t?e.clientX:e.clientY,r=t?e.clientY:e.clientX,l=(n-o)/i,c=r>=s&&r<=s+a;return{ratio:l,inCrossBounds:c}}jumpTo(e){const t=this.state.getJumpRange(e);t&&this.update(t.min,t.max)}applyStepToward(e){const t=this.state.getStepRange(e);return t?(this.update(t.min,t.max),!1):!0}beginStepRepeat(e){this.setInteraction("step"),this.repeater.start(e)}setInteraction(e){this.interactionMode=e,e!=="step"&&this.repeater.stop()}getInteractionBounds(){if(this.interactionBounds)return this.interactionBounds;const{width:e,height:t,left:i,top:o}=this.container.getBoundingClientRect(),s=this.orientation==="horizontal",a=s?e:t,n=s?i:o,r=s?o:i,l=s?t:e;return this.interactionBounds={isHorizontal:s,size:a,start:n,crossStart:r,crossSize:l},this.interactionBounds}isWithinThumb(e){return this.state.isWithinThumb(e)}handleHoverEvent(e){if(this.interactionMode==="drag")return;const t=this.getPointerInfo(e);if(!t){this.onHoverChange(!1);return}const i=this.isWithinThumb(t.ratio);this.onHoverChange(i)}};import{ChangeDetectableProperties as lp,Property as me,SceneChangeDetection as ut}from"ag-charts-core";var ai=class extends lp{constructor(){super(...arguments),this.enabled=!1,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.opacity=1}};d([me,ut()],ai.prototype,"enabled",2),d([me,ut()],ai.prototype,"fill",2),d([me,ut()],ai.prototype,"fillOpacity",2),d([me,ut()],ai.prototype,"stroke",2),d([me,ut()],ai.prototype,"strokeWidth",2),d([me,ut()],ai.prototype,"strokeOpacity",2),d([me],ai.prototype,"lineDash",2),d([me],ai.prototype,"lineDashOffset",2),d([me],ai.prototype,"cornerRadius",2),d([me],ai.prototype,"opacity",2);var cp=class extends lp{};d([me,ut()],cp.prototype,"fill",2),d([me,ut()],cp.prototype,"stroke",2);var wc=class extends ai{constructor(){super(...arguments),this.minSize=20,this.hoverStyle=new cp}};d([me,ut()],wc.prototype,"minSize",2),d([me],wc.prototype,"hoverStyle",2);var io=class extends lp{constructor(){super(...arguments),this.enabled=!1,this.thickness=12,this.spacing=4,this.tickSpacing=0,this.placement="outer",this.visible="auto",this.track=new ai,this.thumb=new wc}};d([me,ut()],io.prototype,"enabled",2),d([me,ut()],io.prototype,"thickness",2),d([me,ut()],io.prototype,"spacing",2),d([me,ut()],io.prototype,"tickSpacing",2),d([me,ut()],io.prototype,"placement",2),d([me,ut()],io.prototype,"visible",2),d([me],io.prototype,"track",2),d([me],io.prototype,"thumb",2);var Kb=class extends io{};d([me,ut()],Kb.prototype,"position",2);var Wb=class extends io{};d([me,ut()],Wb.prototype,"position",2);var{BBox:dn,Group:Fz,Rect:Gb,LayoutElement:Hz,InteractionState:Kz}=bz,Wz=.1,Gz="pan",ni=class extends vz{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisScrolling=!1,this.enableSeriesAreaScrolling=!1,this.track=new ai,this.thumb=new wc,this.horizontal=new Kb,this.vertical=new Wb,this.scrollPanner=new Vb,this.state={horizontal:this.createOrientationState("horizontal"),vertical:this.createOrientationState("vertical")},this.cleanup.register(e.scene.attachNode(this.state.horizontal.group),e.scene.attachNode(this.state.vertical.group),e.layoutManager.registerElement(Hz.Scrollbar,t=>this.onLayoutStart(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("zoom:change-complete",()=>this.updateThumbs()),e.eventsHub.on("zoom-interaction:scrollbar:wheel",t=>this.onWheel(t)),e.eventsHub.on("zoom-interaction:scrollbar:axis-wheel",t=>this.onAxisWheel(t)),e.eventsHub.on("zoom-interaction:scrollbar:scrollbar-wheel",t=>this.onScrollbarWheel(t)))}createOrientationState(e){const t=new Fz({name:`scrollbar-${e}`,zIndex:Iz.NAVIGATOR}),i=new Gb,o=new Gb;t.append(i),t.append(o);const s=new Vz(this.ctx,e,(n,r)=>this.handleUserChange(e,n,r),n=>this.handleHoverChange(e,n)),a=this.resolveProperties(e);return{orientation:e,group:t,track:i,thumb:o,dom:s,properties:a,position:this.getDefaultPosition(e),positionHasAxis:!1,hovered:!1}}resolveProperties(e){return e==="horizontal"?this.horizontal:this.vertical}getDefaultPosition(e){return e==="horizontal"?"bottom":"left"}resolveAxis(e,t){const i=e==="horizontal"?Ac.X:Ac.Y,o=this.ctx.axisManager.getAxisContext(i);if(o.length===0)return{position:this.getDefaultPosition(e),positionHasAxis:!1};if(t==null){const a=o[0];return{axis:a,position:a.position??this.getDefaultPosition(e),positionHasAxis:!0}}const s=o.find(a=>a.position===t);return s?{axis:s,position:t,positionHasAxis:!0}:{axis:o[0],position:t,positionHasAxis:!1}}onLayoutStart({scrollbars:e,layoutBox:t}){for(const i of["horizontal","vertical"]){const o=this.state[i],s=this.resolveProperties(i),{min:a,max:n}=this.getZoomRange(o.orientation),r=cn(0,n-a,1),{axis:{axisId:l}={},position:c,positionHasAxis:h}=this.resolveAxis(i,s.position);o.properties=s,o.axisId=l,o.position=c,o.positionHasAxis=h;const u=this.updateVisibility(o,r);if(!u||l==null)continue;const{thickness:p,spacing:g,placement:m,tickSpacing:y}=s;h?e[l]={enabled:u,thickness:p,spacing:g,tickSpacing:y,placement:m}:t.shrink(g+p,c),this.updateStyles(o)}}onLayoutComplete(e){this.ctx.eventsHub.emit("axis-dom-proxy:update",{source:"scrollbar",enabled:this.enabled,enableDoubleClick:!1,enableDragging:!1,enableScrolling:this.enableAxisScrolling}),this.seriesRect=e.series.rect;for(const t of["horizontal","vertical"]){const i=this.state[t],{properties:{enabled:o,visible:s}}=i;if(!o||s==="never")continue;const a=this.getLayoutRect(i,t,e);i.layoutRect=a,a&&(this.updateTrack(i,a),this.updateThumb(i,a))}}getLayoutRect(e,t,i){const{properties:{thickness:o,spacing:s},position:a,positionHasAxis:n}=e,r=e.axisId?i.axes[e.axisId]:void 0;if(!r)return;const{x:l,y:c,width:h,height:u}=i.series.rect,p=t==="horizontal";if(!n)if(p){const x=a==="bottom"?c+u+s:c-s-o;return new dn(l,x,h,o)}else{const x=a==="right"?l+h+s:l-s-o;return new dn(x,c,o,u)}const{scrollbar:g,translation:m}=r;if(!g?.enabled)return;const y=p?m.y+g.offset:m.x+g.offset;return p?new dn(l,y,h,o):new dn(y,c,o,u)}updateStyles({track:e,thumb:t,properties:i,hovered:o}){e.setStyleProperties(i.track),e.cornerRadius=i.track.cornerRadius??0,e.opacity=i.track.opacity??1,t.setStyleProperties(i.thumb),t.cornerRadius=i.thumb.cornerRadius??0,t.opacity=i.thumb.opacity??1;const s=i.thumb.hoverStyle;t.fill=o?s?.fill??i.thumb.fill:i.thumb.fill,t.stroke=o?s?.stroke??i.thumb.stroke:i.thumb.stroke}updateTrack(e,t){e.track.x=t.x,e.track.y=t.y,e.track.width=t.width,e.track.height=t.height,e.dom.updateBounds(t)}updateThumb(e,t){const{min:i,max:o}=this.getZoomRange(e.orientation),s=cn(0,o-i,1);if(!this.updateVisibility(e,s)||t.width<=0||t.height<=0)return;const n=e.properties.thumb.minSize??0;let r;if(e.orientation==="horizontal"){const l=Math.min(Math.max(n,t.width*s),t.width),c=cn(t.x,t.x+t.width*i,t.x+t.width-l);e.thumb.x=c,e.thumb.y=t.y,e.thumb.width=l,e.thumb.height=t.height,r=cn(0,l/t.width,1)}else{const l=Math.min(Math.max(n,t.height*s),t.height),c=cn(t.y,t.y+t.height*i,t.y+t.height-l);e.thumb.x=t.x,e.thumb.y=c,e.thumb.width=t.width,e.thumb.height=l,r=cn(0,l/t.height,1)}e.dom.updateThumbBounds(e.thumb,t,e.properties.thumb.cornerRadius),e.dom.updateMinMax(i,o,r)}updateThumbs(){if(this.seriesRect)for(const e of["horizontal","vertical"]){const t=this.state[e],i=t.layoutRect;if(!i||!t.properties.enabled||t.properties.visible==="never")continue;const o=e==="horizontal"?new dn(this.seriesRect.x,i.y,this.seriesRect.width,t.properties.thickness):new dn(i.x,this.seriesRect.y,t.properties.thickness,this.seriesRect.height);this.updateThumb(t,o)}}updateVisibility(e,t){const i=e.properties.enabled&&e.axisId!=null&&e.properties.visible!=="never"&&(e.properties.visible==="always"||t<1);return e.group.visible=i,e.track.visible=i,e.thumb.visible=i,e.dom.updateVisibility(i),i}getZoomRange(e){const t=this.ctx.zoomManager.getZoom(),i=e==="horizontal",o=i?t?.x:t?.y;return!i&&o!=null?{min:1-(o.max??1),max:1-(o.min??0)}:{min:o?.min??0,max:o?.max??1}}handleUserChange(e,t,i){if(!this.ctx.interactionManager.isState(Kz.ZoomDraggable))return;const o=e==="horizontal";o||([t,i]=[1-i,1-t]);const s=o?{x:{min:t,max:i}}:{y:{min:t,max:i}};this.ctx.zoomManager.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},s)}handleHoverChange(e,t){const i=this.state[e],o=t&&i.group.visible;i.hovered!==o&&(i.hovered=o,this.updateStyles(i),this.ctx.eventsHub.emit("chart:request-update",{type:Mz.SCENE_RENDER}))}onWheel(e){if(this.enableSeriesAreaScrolling)return this.handleWheel(e)}onAxisWheel(e){if(this.enableAxisScrolling)return this.handleWheel(e)}onScrollbarWheel(e){return this.handleWheel(e)}handleWheel(e){const{seriesRect:t,ctx:{zoomManager:i}}=this,{event:o}=e,s=Math.abs(o.deltaX)>Math.abs(o.deltaY);if(s&&!this.horizontal.enabled||!s&&!this.vertical.enabled)return;e.stopProcessing();const a=s?Ac.X:Ac.Y,n=this.ctx.zoomManager.getPrimaryAxisId(a);if(!t||!n){e.abort();return}const r=this.scrollPanner.update(o,Wz,Gz,t,i.getAxisZooms()),l={[a]:{min:r[n].min,max:r[n].max}};i.updateZoom({source:"user-interaction",sourceDetail:"scrollbar"},l);const c=this.getZoom();o.deltaY>0&&c.y.min===kz||o.deltaY<0&&c.y.max===Dz?e.capped():e.uncapped()}getZoom(){return Az(this.ctx.zoomManager.getZoom())}destroy(){super.destroy(),this.state.horizontal.dom.destroy(),this.state.vertical.dom.destroy()}};d([ki],ni.prototype,"enabled",2),d([ki],ni.prototype,"enableAxisScrolling",2),d([ki],ni.prototype,"enableSeriesAreaScrolling",2),d([ki],ni.prototype,"thickness",2),d([ki],ni.prototype,"spacing",2),d([ki],ni.prototype,"tickSpacing",2),d([ki],ni.prototype,"placement",2),d([ki],ni.prototype,"visible",2),d([ki],ni.prototype,"track",2),d([ki],ni.prototype,"thumb",2),d([ki],ni.prototype,"horizontal",2),d([ki],ni.prototype,"vertical",2);import{boolean as Cc,fillOptionsDef as jb,lineDashOptionsDef as jz,positiveNumber as ms,ratio as $z,strokeOptionsDef as $b,union as un}from"ag-charts-core";var hp={...jb,...$b,...jz,cornerRadius:ms,opacity:$z},Ub={...hp,minSize:ms,hoverStyle:{fill:jb.fill,stroke:$b.stroke}},Yb={enabled:Cc,thickness:ms,spacing:ms,tickSpacing:ms,visible:un("auto","always","never"),placement:un("outer","inner"),track:hp,thumb:Ub},Uz={...Yb,position:un("top","bottom")},Yz={...Yb,position:un("left","right")},Xz={enabled:Cc,enableAxisScrolling:Cc,enableSeriesAreaScrolling:Cc,thickness:ms,spacing:ms,tickSpacing:ms,visible:un("auto","always","never"),placement:un("outer","inner"),track:hp,thumb:Ub,horizontal:Uz,vertical:Yz},Xb={enabled:{$path:"../enabled"},thickness:{$path:"../thickness"},spacing:{$path:"../spacing"},tickSpacing:{$path:"../tickSpacing"},placement:{$path:"../placement"},visible:{$path:"../visible"},track:{fill:{$path:"../../track/fill"},stroke:{$path:"../../track/stroke"},fillOpacity:{$path:"../../track/fillOpacity"},strokeWidth:{$path:"../../track/strokeWidth"},lineDash:{$path:"../../track/lineDash"},lineDashOffset:{$path:"../../track/lineDashOffset"},opacity:{$path:"../../track/opacity"},cornerRadius:{$path:"../../track/cornerRadius"}},thumb:{fill:{$path:"../../thumb/fill"},stroke:{$path:"../../thumb/stroke"},fillOpacity:{$path:"../../thumb/fillOpacity"},strokeWidth:{$path:"../../thumb/strokeWidth"},lineDash:{$path:"../../thumb/lineDash"},lineDashOffset:{$path:"../../thumb/lineDashOffset"},opacity:{$path:"../../thumb/opacity"},cornerRadius:{$path:"../../thumb/cornerRadius"},minSize:{$path:"../../thumb/minSize"},hoverStyle:{fill:{$path:"../../../thumb/hoverStyle/fill"},stroke:{$path:"../../../thumb/hoverStyle/stroke"}}}},Zz={enabled:!1,enableAxisScrolling:!1,enableSeriesAreaScrolling:!1,thickness:12,spacing:16,tickSpacing:0,placement:"outer",visible:"auto",track:{fill:{$foregroundBackgroundMix:.03},stroke:{$foregroundBackgroundMix:.177},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6},thumb:{fill:{$foregroundBackgroundMix:.125},stroke:{$foregroundBackgroundMix:.364},strokeWidth:1,lineDash:[0],lineDashOffset:0,opacity:1,cornerRadius:6,minSize:20,hoverStyle:{fill:{$mix:[{$path:"../fill"},{$ref:"foregroundColor"},.075]},stroke:{$mix:[{$path:"../stroke"},{$ref:"foregroundColor"},.075]}}},vertical:Xb,horizontal:Xb},Zb={type:"plugin",name:"scrollbar",chartType:"cartesian",enterprise:!0,version:lz,dependencies:[wb],options:Xz,themeTemplate:Zz,create:e=>new ni(e)};import{VERSION as Qz}from"ag-charts-community";import"ag-charts-core";import{_ModuleSupport as Qb}from"ag-charts-community";import{ActionOnSet as qz,BaseProperties as Jz,ChartAxisDirection as dp,CleanupRegistry as eB,Color as qb,PropertiesArray as tB,Property as we,clamp as iB,intervalAgo as oB,isTimeInterval as sB,isTimeIntervalUnit as aB,isValidDate as nB}from"ag-charts-core";import{BaseProperties as Jb,Property as je}from"ag-charts-core";var up=class extends Ui{};d([je],up.prototype,"enabled",2),d([je],up.prototype,"value",2);var oo=class extends Jb{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1,this.stroke="black",this.textColor="black"}};d([je],oo.prototype,"fill",2),d([je],oo.prototype,"fillOpacity",2),d([je],oo.prototype,"stroke",2),d([je],oo.prototype,"textColor",2);var Lt=class extends Jb{constructor(){super(...arguments),this.active=new oo,this.disabled=new oo,this.hover=new oo,this.cornerRadius=0,this.fill="black",this.fillOpacity=1,this.fontSize=12,this.fontFamily="sans-serif",this.fontWeight="normal",this.stroke="black",this.strokeWidth=1,this.textColor="black",this.padding=0}};d([je],Lt.prototype,"active",2),d([je],Lt.prototype,"disabled",2),d([je],Lt.prototype,"hover",2),d([je],Lt.prototype,"cornerRadius",2),d([je],Lt.prototype,"fill",2),d([je],Lt.prototype,"fillOpacity",2),d([je],Lt.prototype,"fontSize",2),d([je],Lt.prototype,"fontFamily",2),d([je],Lt.prototype,"fontWeight",2),d([je],Lt.prototype,"stroke",2),d([je],Lt.prototype,"strokeWidth",2),d([je],Lt.prototype,"textColor",2),d([je],Lt.prototype,"padding",2);var ev=class extends Lt{constructor(){super(...arguments),this.visible="auto"}};d([je],ev.prototype,"visible",2);var{userInteraction:rB,LayoutElement:lB,Toolbar:tv}=Qb,pp="toolbarRangeSelectRange",ve=class extends Jz{constructor(e){super(),this.ctx=e,this.enabled=!1,this.buttons=new tB(up),this.button=new Lt,this.dropdown=new ev,this.active=new oo,this.disabled=new oo,this.hover=new oo,this.enableOutOfRange=!1,this.gap=0,this.cornerRadius=0,this.fill="black",this.fillOpacity=1,this.fontSize=12,this.fontFamily="sans-serif",this.fontWeight="normal",this.stroke="black",this.strokeWidth=1,this.textColor="black",this.padding=0,this.position="top-right",this.spacing=0,this.minSize=0,this.cleanup=new eB,this.dropdownLabel=pp,this.cleanup.register(e.layoutManager.registerElement(lB.ToolbarBottom,this.onLayoutStart.bind(this)),e.eventsHub.on("layout:complete",this.onLayoutComplete.bind(this)),e.widgets.chartWidget.addListener("click",this.onChartWidgetClick.bind(this)),e.eventsHub.on("zoom:change-complete",this.onZoomChanged.bind(this)),this.teardown.bind(this))}destroy(){this.cleanup.flush()}setup(){this.container==null&&(this.container=this.ctx.domManager.addChild("canvas-overlay","range-buttons"),this.container.role="presentation",this.buttonsToolbar=new tv(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.buttonsToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--buttons"),this.container.append(this.buttonsToolbar.getElement()),this.dropdownToolbar=new tv(this.ctx,"ariaLabelRangesToolbar","horizontal"),this.dropdownToolbar.addClass("ag-charts-range-buttons","ag-charts-range-buttons--dropdown"),this.container.append(this.dropdownToolbar.getElement()),this.dropdownMenu=new Qb.Menu(this.ctx,"ranges-dropdown"),this.cleanup.register(this.buttonsToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this)),this.dropdownToolbar.addToolbarListener("button-pressed",this.onButtonPress.bind(this))))}teardown(){this.buttonsToolbar?.getElement().remove(),this.buttonsToolbar?.destroy(),this.dropdownToolbar?.getElement().remove(),this.dropdownToolbar?.destroy()}onLayoutStart({layoutBox:e}){const{dropdown:t,enabled:i,position:o,spacing:s}=this;if(!i){this.buttonsToolbar?.setHidden(!0),this.dropdownToolbar?.setHidden(!0);return}this.setup();const{buttonsToolbar:a,dropdownToolbar:n}=this;if(!a||!n)return;a.updateButtons(this.buttons),n.updateButtons([this.getDropdownButtonOptions(this.dropdownLabel)]),this.updateCSSVariables(),t.visible==="always"?this.swapDropdownIn():this.swapDropdownOut();const{height:r}=this.isDropdown?n.getBounds():a.getBounds(),l={x:e.x,y:e.y};o==="top"||o==="top-left"||o==="top-right"?e.shrink({top:r+s}):(l.y=e.y+e.height-r,e.shrink({bottom:r+s})),a.setBounds(l),n.setBounds(l)}onLayoutComplete({series:{rect:e},layoutBox:t}){const{buttons:i,buttonsToolbar:o,ctx:s,dropdown:a,dropdownMenu:n,dropdownToolbar:r,enabled:l}=this;if(!l||!o||!r||!n)return;let c;if(a.visible==="auto"&&(c=o.getBounds(),c.width>e.width?this.swapDropdownIn():this.swapDropdownOut()),this.isDropdown)c=r.getBounds(),this.dropdownMinWidth??(this.dropdownMinWidth=c.width),c.width=Math.max(c.width,this.dropdownMinWidth),c=this.updateToolbarBounds(r,e,t,c);else{c=this.updateToolbarBounds(o,e,t,c);let p=0;for(const g of i)o.toggleButtonEnabledByIndex(p,this.getButtonEnabled(g)),p++}const h={x:s.domManager.isRtl?c.x+c.width:c.x,y:c.y+c.height+1},u={x:c.x+c.width,y:c.y-1};n.setAnchor(h,u)}onChartWidgetClick(){this.dropdownMenu?.hide()}updateToolbarBounds(e,t,i,o){const{position:s}=this,a=o??e.getBounds();return s==="top-right"||s==="bottom-right"?a.x=i.x+i.width-a.width:(s==="top"||s==="bottom")&&(a.x=i.x+i.width/2-a.width/2),a.x=iB(t.x,a.x,t.x+t.width-a.width),e.setBounds({x:a.x,y:a.y,width:a.width}),a}updateCSSVariables(){this.gap>0?this.buttonsToolbar?.addClass("ag-charts-range-buttons--gapped"):this.buttonsToolbar?.removeClass("ag-charts-range-buttons--gapped");const e=["paddingTop","paddingRight","paddingBottom","paddingLeft","strokeWidth"];this.ctx.domManager.setModuleCSSVariables("ranges",void 0,void 0,{gap:this.gap,minSize:this.minSize},["gap","minSize"]),this.ctx.domManager.setModuleCSSVariables("ranges","button",void 0,this.getComponentVariables(this.button),e),this.ctx.domManager.setModuleCSSVariables("ranges","button","active",this.getComponentStateVariables(this.button,"active"),e),this.ctx.domManager.setModuleCSSVariables("ranges","button","disabled",this.getComponentStateVariables(this.button,"disabled"),e),this.ctx.domManager.setModuleCSSVariables("ranges","button","hover",this.getComponentStateVariables(this.button,"hover"),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown",void 0,this.getComponentVariables(this.dropdown),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","active",this.getComponentStateVariables(this.dropdown,"active"),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","disabled",this.getComponentStateVariables(this.dropdown,"disabled"),e),this.ctx.domManager.setModuleCSSVariables("ranges","dropdown","hover",this.getComponentStateVariables(this.dropdown,"hover"),e)}getComponentVariables(e){return{cornerRadius:e.cornerRadius,fill:this.getComponentFill(e.fill,e.fillOpacity),fontSize:e.fontSize,fontFamily:e.fontFamily,fontWeight:e.fontWeight,stroke:e.stroke,strokeWidth:e.strokeWidth,textColor:e.textColor,paddingTop:typeof e.padding=="number"?e.padding:e.padding.top??0,paddingRight:typeof e.padding=="number"?e.padding:e.padding.right??0,paddingBottom:typeof e.padding=="number"?e.padding:e.padding.bottom??0,paddingLeft:typeof e.padding=="number"?e.padding:e.padding.left??0}}getComponentStateVariables(e,t){return{fill:this.getComponentFill(e[t].fill,e[t].fillOpacity),fillOpacity:e[t].fillOpacity,stroke:e[t].stroke,textColor:e[t].textColor}}getComponentFill(e,t){if(t>=1)return e;const i=qb.fromString(e);return new qb(i.r,i.g,i.b,t).toString()}onZoomChanged(){this.buttonsToolbar?.clearActiveButton(),this.isDropdown&&this.resetDropdownButton()}onButtonPress({button:{index:e}}){this.isDropdown?this.showDropdownMenu():this.updateZoomWithButtonIndex(e)}swapDropdownIn(){this.isDropdown||(this.isDropdown=!0,this.buttonsToolbar?.setHidden(!0),this.dropdownToolbar?.setHidden(!1))}swapDropdownOut(){this.isDropdown!==!1&&(this.isDropdown=!1,this.buttonsToolbar?.setHidden(!1),this.dropdownToolbar?.setHidden(!0),this.buttonsToolbar?.clearActiveButton(),this.dropdownMenu?.hide())}resetDropdownButton(){this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(pp))}getDropdownButtonOptions(e){return this.dropdownLabel=e,{label:e,value:1/0,icon:"chevron-filled-down",iconPosition:"after"}}showDropdownMenu(){const e=this.dropdownToolbar?.getButtonWidget(0);if(!this.dropdownToolbar||!this.dropdownMenu||!e)return;this.dropdownToolbar.toggleActiveButtonByIndex(0);const t=this.buttons.map((i,o)=>({ariaLabel:i.ariaLabel,enabled:this.getButtonEnabled(i),label:i.label??`${o}`,value:`${o}`,icon:i.icon}));this.dropdownMenu.show(e,{class:"ag-charts-range-buttons-menu",items:t,minWidth:this.dropdownMinWidth,onPress:i=>{const o=Number(i.value);this.updateZoomWithButtonIndex(o),this.dropdownToolbar?.updateButtonByIndex(0,this.getDropdownButtonOptions(i.label??pp))},onHide:()=>{this.dropdownToolbar?.clearActiveButton()}})}updateZoomWithButtonIndex(e){const{zoomManager:t}=this.ctx,i=this.buttons.at(e);if(!i)return;const{value:o}=i,s=rB(`zoom-range-button-${e}`),a=this.getUpdateWithFn(o);a.valid===!1||a.fn==null?t.resetZoom(s):t.updateWith(s,dp.X,a.fn),this.buttonsToolbar?.toggleActiveButtonByIndex(e)}getUpdateWithFn(e){if(e==null)return{valid:!0};if(typeof e=="number")return{fn:(t,i)=>[Number(i)-e,void 0],valid:!0};if(Array.isArray(e))return{fn:()=>e,valid:!0};if(typeof e=="function")return{fn:e,valid:!0};if(sB(e)||aB(e)){const[,t]=this.ctx.axisManager.getAxisContext(dp.X).at(0)?.scale.getDomainMinMax()??[];if(nB(t)){const i=oB(e,t);return{fn:o=>[i??o,void 0],valid:!0}}return{valid:!1}}return{valid:!0}}getButtonEnabled(e){const{enableOutOfRange:t,ctx:{zoomManager:i}}=this;let o=e.enabled??t;if(e.enabled==null&&t===!1){const s=this.getUpdateWithFn(e.value);if(s.valid===!1)return!1;o=s.fn==null?!0:i.isValidUpdateWith(dp.X,s.fn,"range-check")}return o}};d([qz({newValue(e){e||(this.isDropdown=void 0)}}),we],ve.prototype,"enabled",2),d([we],ve.prototype,"buttons",2),d([we],ve.prototype,"button",2),d([we],ve.prototype,"dropdown",2),d([we],ve.prototype,"active",2),d([we],ve.prototype,"disabled",2),d([we],ve.prototype,"hover",2),d([we],ve.prototype,"enableOutOfRange",2),d([we],ve.prototype,"gap",2),d([we],ve.prototype,"cornerRadius",2),d([we],ve.prototype,"fill",2),d([we],ve.prototype,"fillOpacity",2),d([we],ve.prototype,"fontSize",2),d([we],ve.prototype,"fontFamily",2),d([we],ve.prototype,"fontWeight",2),d([we],ve.prototype,"stroke",2),d([we],ve.prototype,"strokeWidth",2),d([we],ve.prototype,"textColor",2),d([we],ve.prototype,"padding",2),d([we],ve.prototype,"position",2),d([we],ve.prototype,"spacing",2),d([we],ve.prototype,"minSize",2);import"ag-charts-community";import{and as cB,arrayLength as hB,arrayOf as dB,arrayOfDefs as uB,boolean as gp,callback as pB,color as iv,date as gB,fillCssOptionsDef as ov,fontOptionsDef as mB,number as sv,or as av,padding as yB,positiveNumber as Oc,strokeOptionsDef as nv,timeInterval as fB,timeIntervalUnit as xB,toolbarButtonOptionsDefs as SB,undocumented as bB,union as rv}from"ag-charts-core";var mp={...ov,stroke:nv.stroke,textColor:iv},yp={...ov,...nv,...mB,textColor:iv,cornerRadius:Oc,padding:yB,active:mp,disabled:mp,hover:mp},vB={...yp,visible:rv("auto","always","never")},MB={...yp},lv={enabled:gp,enableOutOfRange:gp,position:rv("top-left","top","top-right","bottom-left","bottom","bottom-right"),button:MB,dropdown:vB,gap:Oc,spacing:Oc,...yp,buttons:uB({...SB,enabled:gp,value:av(sv,cB(dB(av(sv,gB)),hB(2,2)),fB,xB,pB)},"range button options array")};lv.minSize=bB(Oc);import{FONT_SIZE_RATIO as DB}from"ag-charts-core";var cv=1e3*60*60*24,fp=cv*30,kB=cv*365,IB={cornerRadius:{$ref:"borderRadius"},fill:{$ref:"chromeBackgroundColor"},fillOpacity:1,fontSize:{$rem:[DB.SMALL,"chromeFontSize"]},fontFamily:{$ref:"chromeFontFamily"},fontWeight:{$ref:"chromeFontWeight"},padding:{$shallow:{top:6,right:9,bottom:6,left:9}},stroke:{$ref:"borderColor"},strokeWidth:{$if:[{$ref:"buttonBorder"},1,0]},textColor:{$ref:"chromeTextColor"}},Ec={fill:{$path:"../fill"},fillOpacity:{$path:"../fillOpacity"},stroke:{$path:"../stroke"},textColor:{$path:"../textColor"}},hv={...Ec,cornerRadius:{$path:"../cornerRadius"},fill:{$path:"../fill"},fillOpacity:{$path:"../fillOpacity"},fontSize:{$path:"../fontSize"},fontFamily:{$path:"../fontFamily"},fontWeight:{$path:"../fontWeight"},padding:{$path:"../padding"},stroke:{$path:"../stroke"},strokeWidth:{$path:"../strokeWidth"},textColor:{$path:"../textColor"}},pn=e=>({fill:{$path:`../../${e}/fill`},fillOpacity:{$path:`../../${e}/fillOpacity`},stroke:{$path:`../../${e}/stroke`},strokeWidth:{$path:`../../${e}/strokeWidth`},textColor:{$path:`../../${e}/textColor`}}),AB={enabled:!1,enableOutOfRange:!1,position:"top-right",gap:0,spacing:10,minSize:0,...IB,active:{...Ec,fill:{$ref:"focusColor"},stroke:{$ref:"accentColor"},textColor:{$ref:"accentColor"}},disabled:{...Ec,fill:{$mix:[{$ref:"chromeBackgroundColor"},{$ref:"foregroundColor"},.06]},textColor:{$mix:[{$ref:"chromeBackgroundColor"},{$ref:"chromeTextColor"},.5]}},hover:{...Ec,fill:{$ref:"focusColor"}},button:{active:{...pn("active")},disabled:{...pn("disabled")},hover:{...pn("hover")},...hv},dropdown:{visible:"auto",active:{...pn("active")},disabled:{...pn("disabled")},hover:{...pn("hover")},...hv},buttons:{$shallowSimple:[{label:"toolbarRange1Month",ariaLabel:"toolbarRange1MonthAria",value:fp},{label:"toolbarRange3Months",ariaLabel:"toolbarRange3MonthsAria",value:3*fp},{label:"toolbarRange6Months",ariaLabel:"toolbarRange6MonthsAria",value:6*fp},{label:"toolbarRangeYearToDate",ariaLabel:"toolbarRangeYearToDateAria",value:(e,t)=>[new Date(`${new Date(t).getFullYear()}-01-01`).getTime(),void 0]},{label:"toolbarRange1Year",ariaLabel:"toolbarRange1YearAria",value:kB},{label:"toolbarRangeAll",ariaLabel:"toolbarRangeAllAria",value:()=>[void 0,void 0]}]}},xp={type:"plugin",name:"ranges",chartType:"cartesian",enterprise:!0,version:Qz,options:lv,themeTemplate:AB,create:e=>new ve(e)};import{VERSION as NB}from"ag-charts-community";import{DEFAULT_CAPTION_LAYOUT_STYLE as LB}from"ag-charts-core";import{_ModuleSupport as dv}from"ag-charts-community";import{AbstractModuleInstance as TB,BaseProperties as wB,ChartAxisDirection as CB,Property as Tt,ZIndexMap as OB,cachedTextMeasurer as Sp,calcLineHeight as EB}from"ag-charts-core";var{LayoutElement:PB,Group:RB,Label:mr,Rect:_B,Text:it}=dv,uv={ohlc:62,candlestick:62,"hollow-candlestick":62,line:96,"step-line":96,hlc:184,"high-low":800},zB={up:"positive",down:"negative"},BB={hlc:"altNeutral"},bp=class extends wB{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};d([Tt],bp.prototype,"fill",2),d([Tt],bp.prototype,"fillOpacity",2);var Gt=class extends TB{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 mr,this.positive=new mr,this.negative=new mr,this.neutral=new mr,this.altNeutral=new mr,this.background=new bp,this.layoutStyle="block",this.id="status-bar",this.layer=new RB({name:"StatusBar",zIndex:OB.STATUS_BAR}),this.labelGroup=this.layer.appendChild(new dv.TranslatableGroup),this.backgroundNode=this.labelGroup.appendChild(new _B),this.labels=[{label:"O",configuration:2,title:this.labelGroup.appendChild(new it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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 it),value:this.labelGroup.appendChild(new it),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(PB.Overlay,t=>this.startPerformLayout(t)),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)),e.eventsHub.on("highlight:change",()=>this.updateHighlight()),e.eventsHub.on("data:update",t=>{this.chartData=t}))}updateDomainsFromSeries(){if(!this.enabled)return;const e=this.ctx.chartService.series;if(e.length===0)return;let t,i;for(const o of e){const a=o.getDomain(CB.Y)?.domain;!Array.isArray(a)||a.length<2||(o.type==="bar"?i=[a[0],a.at(-1)]:t=[a[0],a.at(-1)])}for(const o of this.labels){if(this[o.key]==null){o.domain=void 0;continue}o.domain=o.key==="volumeKey"?i:t}}startPerformLayout({layoutBox:e}){if(this.labelGroup.translationX=0,this.labelGroup.translationY=0,!this.enabled){this.labelGroup.visible=!1;return}this.updateDomainsFromSeries();const t=4,i=12,o=0,s=8;this.labelGroup.translationY=e.y+o;const a=Math.max(this.title.fontSize,this.positive.fontSize,this.negative.fontSize),n=EB(a),r=uv[this.getChartType()]??0;let l=0,c,h="alphabetic";if(this.layoutStyle==="block")e.shrink(o+n+s,"top"),c=a+(n-a)/2;else{const{title:u}=this.ctx.chartService;if(h="top",c=o+u.padding,u.enabled){const p=u.node.getBBox();l=p.x+p.width+i}else l=u.padding}for(const{label:u,configuration:p,title:g,value:m,domain:y,formatter:x}of this.labels){if(y==null||!(r&p)){g.visible=!1,m.visible=!1;continue}const f=Sp(this.positive),b=Sp(this.negative),S=Math.max(f.textWidth(x.format(y[0])),f.textWidth(x.format(y[1])),b.textWidth(x.format(y[0])),b.textWidth(x.format(y[1])));g.visible=!0,m.visible=!0;const v=Sp(this.title).measureLines(u);g.setFont(this.title),g.fill=this.title.color,g.text=u,g.textAlign="left",g.textBaseline=h,g.y=c,g.x=l,l+=v.width+t,m.textAlign="left",m.textBaseline=h,m.y=c,m.x=l,l+=S+i}this.backgroundNode.x=0,this.backgroundNode.y=0,this.backgroundNode.width=l-i,this.backgroundNode.height=n+o+s,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.chartData?.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:zB[i];o==null&&this.openKey!=null&&this.closeKey!=null&&(t[this.openKey]new Gt(e)};import{VERSION as VB}from"ag-charts-community";import{boolean as Mp,string as FB,union as HB}from"ag-charts-core";import{_ModuleSupport as KB}from"ag-charts-community";import{AsyncAwaitQueue as WB,BaseProperties as GB,ChartAxisDirection as ra,ChartUpdateType as Pc,Debug as jB,Logger as pv,ObserveChanges as gn,Property as mn,arraysEqual as gv,definedZoomState as $B,findMinMax as mv,isDate as UB,isDefined as YB,isFiniteNumber as Rc,isObjectWithStringProperty as XB,unique as ZB}from"ag-charts-core";var{CartesianAxis:Dp,ContinuousScale:yv,TimeScale:QB,UnitTimeScale:qB,TooltipManager:JB}=KB,so=jB.create("sync");function fv(e,t,i){const o=e.getKeys(t),s=e.getKeys(i);return e.shouldFlipXY?.()?[s,o]:[o,s]}function kp(e="x"){switch(e){case"x":return[ra.X];case"y":return[ra.Y];case"xy":return[ra.X,ra.Y]}}function eV(e,t,i){return QB.is(e)||qB.is(e)?!gv(t.map(o=>o?.valueOf()),i.map(o=>o?.valueOf())):!gv(t,i)}var ys=class extends GB{constructor(e){super(),this.moduleContext=e,this.enabled=!1,this.axes="x",this.nodeInteraction=!0,this.zoom=!0,this.domainMode="id",this.domainSync=new WB}updateSiblings(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(e??this.groupId))so("ChartSync.updateSiblings()",i.id,i),this.updateChart(i)}updateChart(e,t=Pc.PROCESS_DOMAIN){so("ChartSync.updateChart()",e.id,Pc[t],e),t===Pc.PROCESS_DOMAIN?e.ctx.eventsHub.emit("chart:request-update",{type:t,opts:{forceNodeDataRefresh:!0}}):e.ctx.eventsHub.emit("chart:request-update",{type:t})}enabledZoomSync(){const{eventsHub:e}=this.moduleContext;this.disableZoomSync?.(),this.disableZoomSync=e.on("zoom:change-complete",t=>this.onZoom(t))}onZoom(e){const{syncManager:t}=this.moduleContext;for(const i of t.getGroupSiblings(this.groupId)){if(!i.modulesManager.getModule("sync")?.zoom)continue;const s=i.modulesManager.getModule("zoom");if(!s)continue;const a=this.prepareZoomUpdate();e.source!=="sync"&&(so("ChartsSyncManager.enabledZoomSync()",i.id,a),s.updateSyncZoom(a))}}enabledNodeInteractionSync(){this.disableNodeInteractionSync?.();const e=this.moduleContext.eventsHub.on("highlight:change",this.onHighlightChange.bind(this)),t=this.moduleContext.eventsHub.on("active:load-memento",this.onActiveLoadMemento.bind(this));this.disableNodeInteractionSync=()=>{e(),t()}}onHighlightChange(e){const{syncManager:t}=this.moduleContext;if(e.callerId.endsWith("-sync"))return;so("ChartSync.onHighlightChange()",e);const i=e.currentHighlight?.series,[o]=kp(this.axes),s=o===ra.X?ra.Y:ra.X,[a,n]=i?fv(i,o,s):[],r=tr(e.currentHighlight);let l=a?.[0]?r?.[a[0]]:void 0,c=!1;if(UB(l)&&(c=!0,l=l.getTime()),!e.currentHighlight?.datum){for(const u of t.getGroupSiblings(this.groupId))u.modulesManager.getModule("sync")?.nodeInteraction&&(u.ctx.highlightManager.updateHighlight(`${u.id}-sync`,void 0,!0),u.ctx.tooltipManager.removeTooltip(`${u.id}-sync`,void 0,!0));return}const h=t.getGroupSyncMode(this.groupId)==="multi-series";this.findMatchingHighlightNodes(o,s,h?n:[],c,l,e)}onActiveLoadMemento(e){const{activeItem:t,chartId:i}=e;if(t===void 0){this.moduleContext.highlightManager.updateHighlight(`${i}-sync`,void 0,!1),this.moduleContext.tooltipManager.removeTooltip(`${i}-sync`,void 0,!1);for(const o of this.moduleContext.syncManager.getGroupSiblings(this.groupId))o.onSyncActiveClear()}}findMatchingHighlightNodes(e,t,i,o,s,a){const{syncManager:n}=this.moduleContext;so("ChartSync.findMatchingHighlightNodes()",{mainDirection:e,secondaryKeys:i});for(const r of n.getGroupSiblings(this.groupId)){if(!r.modulesManager.getModule("sync")?.nodeInteraction)continue;let c=!1;for(const h of r.axes){if(!Dp.is(h)||h.direction!==e)continue;const u=r.series.filter(p=>{if(!p.visible)return!1;if(i.length>0){const[,g]=fv(p,e,t);return i.every(m=>g.includes(m))}return!0}).map(this.findMatchingNodes(h,e,o,s)).filter(YB);if(u.length===1&&u[0]?.nodeDatum!==r.ctx.highlightManager.getActiveHighlight()){this.dispatchHighlightUpdate(r,u[0].nodeDatum),c=!0;break}}c||(so("ChartSync.findMatchingHighlightNodes() - no matching nodes",r.id,a),this.dispatchHighlightUpdate(r))}}findMatchingNodes(e,t,i,o){return s=>{if(s.getKeyAxis(e.direction)!==e.id)return;const n=s.contextNodeData?.nodeData??[];if(!n?.length)return;const r=n[0],l=`${t}Key`;if(!XB(r,l))return;const c=r[l],h=n.find(u=>{const p=u.datum[c];return i?p.getTime()===o:p===o});return h?{series:s,nodeDatum:h}:null}}dispatchHighlightUpdate(e,t){so("ChartSync.dispatchHighlightUpdate()",e.id,t);const i=t==null;e.ctx.highlightManager.updateHighlight(`${e.id}-sync`,t,i);const o=t?.series.tooltipEnabled??e.tooltip.enabled;if(t&&o){const s=e.seriesAreaBoundingBox,a=s.x+(t.midPoint?.x??t.point?.x??0),n=s.y+(t.midPoint?.y??t.point?.y??0),r=JB.makeTooltipMeta({type:"pointermove",canvasX:a,canvasY:n},t.series,t,void 0);e.ctx.tooltipManager.updateTooltip(`${e.id}-sync`,r,e.getTooltipContent(t.series,t.datumIndex,t,"tooltip"))}else e.ctx.tooltipManager.removeTooltip(`${e.id}-sync`,void 0,!0);this.updateChart(e,Pc.SERIES_UPDATE)}async getSyncedDomain(e){if(!Dp.is(e)||this.axes!=="xy"&&this.axes!==e.direction)return;const{groupState:t,directionDomains:i,idDomains:o,positionDomains:s}=this.updateDomainState(e);return this.validateAxis(e,t),await this.waitForDomainsToBeReady(),this.domainMode==="position"?this.calculateDerivedDomain(e,s):this.domainMode==="direction"?this.calculateDerivedDomain(e,i):this.calculateDerivedDomain(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={}),u=h[t=e.direction]??(h[t]={derived:[],sources:{},dirty:!0}),p=(i=u.sources)[r]??(i[r]={});p[l]=e.dataDomain.domain,u.dirty=!0;const g=c.domainsById??(c.domainsById={}),m=g[l]??(g[l]={derived:[],sources:{},dirty:!0}),y=(o=m.sources)[r]??(o[r]={});y[l]=e.dataDomain.domain,m.dirty=!0;const x=c.domainsByPosition??(c.domainsByPosition={}),f=x[s=e.position]??(x[s]={derived:[],sources:{},dirty:!0}),b=(a=f.sources)[r]??(a[r]={});return b[l]=e.dataDomain.domain,f.dirty=!0,{groupState:c,directionDomains:u,idDomains:m,positionDomains:f}}validateAxis(e,t){const i=this.moduleContext.syncManager.getGroupSyncMode(this.groupId)==="multi-series";kp(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=c.getModule("sync"),u=kp(h?.axes),p=l.filter(m=>u.includes(m.direction)).filter(m=>m.boundSeries.some(y=>y.getKeys(m.direction).some(x=>n.has(x))));if(p.length===0)continue;const[g]=p;if(g.min!==i||g.max!==o||g.nice!==s||g.reverse!==a){pv.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&&(Rc(a)||Rc(c.min))||n!==c.max&&(Rc(n)||Rc(c.max)))){pv.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;let i=t.derived;const o=Object.values(t.sources).map(a=>Object.values(a));let s;return yv.is(e.scale)?s=o.flat(2):s=o.flat().toSorted((a,n)=>a.length>n.length?-1:1).flat(),t.derived=ZB(s),yv.is(e.scale)&&(i=mv(i),t.derived=mv(t.derived)),t.dirty=!1,eV(e.scale,i,t.derived)&&(so(e.id,"updated",{before:i,after:t.derived}),this.updateSiblings()),t.derived}removeAxis(e){if(!Dp.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],delete i?.domainsByPosition?.[e.position]?.sources?.[o]?.[s],delete i?.domainsById?.[s]?.sources?.[o]?.[s]}async waitForDomainsToBeReady(){const{syncManager:e}=this.moduleContext;let t=0;for(;e.getGroupMembers(this.groupId).some(i=>i.syncStatus==="init");)so("ChartSync.waitForDomainsToBeReady() - waiting for all domains to be calculated",this.groupId),await this.domainSync.waitForCompletion(),t++;t>0&&so("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,$B(t)}onEnabledChange(){const{syncManager:e,highlightManager:t}=this.moduleContext;this.enabled?(e.subscribe(this.groupId),t.unhighlightDelay=0):(e.unsubscribe(this.groupId),t.unhighlightDelay=100),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?.()}};ys.className="Sync",d([mn,gn(e=>e.onEnabledChange())],ys.prototype,"enabled",2),d([mn,gn((e,t,i)=>e.onGroupIdChange(t,i))],ys.prototype,"groupId",2),d([mn,gn(e=>e.onAxesChange())],ys.prototype,"axes",2),d([mn,gn(e=>e.onNodeInteractionChange())],ys.prototype,"nodeInteraction",2),d([mn,gn(e=>e.onZoomChange())],ys.prototype,"zoom",2),d([mn,gn(e=>e.onAxesChange())],ys.prototype,"domainMode",2);var Ip={type:"plugin",name:"sync",chartType:"cartesian",enterprise:!0,version:VB,options:{enabled:Mp,groupId:FB,axes:HB("x","y","xy"),nodeInteraction:Mp,zoom:Mp},themeTemplate:{enabled:!1},create:e=>new ys(e)};import{VERSION as tV}from"ag-charts-community";import{arrayOfDefs as iV,boolean as ri,or as oV,positiveNumber as sV,ratio as Ap,strictUnion as aV,string as nV,toolbarButtonOptionsDefs as rV,undocumented as Np,union as fs}from"ag-charts-core";import{_ModuleSupport as Oo}from"ag-charts-community";import{AbstractModuleInstance as lV,ActionOnSet as xv,ChartAxisDirection as wt,ChartUpdateType as _c,Property as Ce,ProxyProperty as cV,UNIT_MAX as zc,UNIT_MIN as Sv,definedZoomState as bv,entries as hV,isNumberEqual as vv,roundTo as dV}from"ag-charts-core";import{_ModuleSupport as uV}from"ag-charts-community";import{ZIndexMap as pV}from"ag-charts-core";var Mv="#2196f3",gV="#8a8a8a",Dv=class extends uV.Rect{constructor(){super(),this.fill=Mv,this.fillOpacity=.2,this.zIndex=pV.ZOOM_SELECTION}updateValid(){this.fill=Mv}updateInvalid(){this.fill=gV}};Dv.className="ZoomRect";import"ag-charts-community";import{BaseProperties as mV,ChartAxisDirection as jt,Property as kv,isFiniteNumber as Iv,objectsEqual as yV,strictObjectKeys as fV}from"ag-charts-core";var Lp=class extends mV{constructor(){super(),this.enabled=!1,this.padding=0}};d([kv],Lp.prototype,"enabled",2),d([kv],Lp.prototype,"padding",2);var xV=class{constructor(e,t,i,o,s){this.properties=e,this.zoomManager=t,this.deps=i,this.manuallyAdjusted=!1,s.register(o.on("zoom:save-memento",a=>this.onSaveMemento(a)),o.on("zoom:load-memento",a=>this.onLoadMemento(a)),o.on("zoom:change-request",a=>this.onChangeRequest(a)))}get enabled(){return this.deps.enabled&&this.properties.enabled&&!this.manuallyAdjusted}onManualAdjustment(e){e===jt.Y&&(this.manuallyAdjusted=!0)}onChangeRequest(e){const t=this.hasYAxisChange(e);if(e.sourceDetail==="scrollbar"&&t&&(this.manuallyAdjusted=!0),e.isReset&&t&&(this.manuallyAdjusted=!1),this.enabled){const i=this.autoScaleYZoom(e.state);i&&e.constrainChanges(i)}}hasYAxisChange(e){for(const t of e.changedAxes)if(e.state[t]?.direction===jt.Y)return!0;return!1}onSaveMemento(e){e.memento.autoScaledAxes=this.enabled?["y"]:void 0}onLoadMemento(e){const{zoom:t,memento:i,navigatorModule:o,zoomModule:s}=e;if(!o||s){let a=i?.autoScaledAxes?.includes("y");if(i?.rangeY)a??(a=!1),t.y=this.zoomManager.rangeToRatioDirection(jt.Y,i.rangeY)??{min:0,max:1};else if(i?.ratioY)a??(a=!1),t.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{a??(a=!0);const n=a?this.getAutoScaleYZoom(t.x):void 0;t.y=n??{min:0,max:1}}a!=null&&(this.manuallyAdjusted=!a)}}getAutoScaleYZoom(e){if(!this.enabled)return;const{padding:t}=this.properties;let i;return this.deps.enableIndependentAxes?i=this.primaryAxisZoom(jt.Y,e,{padding:t}):i=this.combinedAxisZoom(jt.Y,e,{padding:t}),e.min===0&&e.max===1?i==null?void 0:{min:0,max:1}:i}autoScaleYZoom(e){const t=this.zoomManager.getZoom();if(t&&e){const o=this.zoomManager.getAxisZooms();for(const s of[jt.X,jt.Y])for(const a of fV(e))if(o[a]?.direction===s){t[s]=e[a];break}}if(t?.x==null)return;const i=this.getAutoScaleYZoom(t.x);if(!(i==null||yV(t.y,i)))return this.zoomManager.toCoreZoomState({x:t.x,y:i})}zoomBounds(e,t,i,o){const s=e.scale,a=s.range;s.range=[0,1];const n=t.scale,r=n.range;n.range=[0,1];let l=1,c=!1,h=0,u=!1;for(const m of t.boundSeries){if(!m.visible)continue;const{connectsToYAxis:y}=m,x=m.getRange(jt.Y,[i.min,i.max]);for(const f of x){const b=n.convert(f);Number.isFinite(b)&&(bh&&(h=b,u=!y||f>0))}}if(Iv(t.min)&&(l=0),Iv(t.max)&&(h=1),s.range=a,n.range=r,l>=h)return;const p=(c?o:0)+(u?o:0),g=Math.min((h-l)*(1+p),1);if(!(g<=0)){if(c&&u){const m=(h+l)/2;l=m-g/2,h=m+g/2}else!c&&u?h=l+g:c&&!u&&(l=h-g);return l<0?(h+=-l,l=0):h>1&&(l-=h-1,h=1),{min:l,max:h}}}primaryAxisZoom(e,t,{padding:i=0}={}){const o=e===jt.X?jt.Y:jt.X,s=this.zoomManager.getPrimaryAxis(o),a=this.zoomManager.getPrimaryAxis(e);if(!(s==null||a==null))return this.zoomBounds(s,a,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const o=this.zoomManager.getAxes(),s=e===jt.X?jt.Y:jt.X,a=new Map;for(const c of o)if(c.direction===s)for(const h of c.boundSeries)a.set(h,c);let n=1,r=0;for(const c of o)if(c.direction===e)for(const h of c.boundSeries){const u=a.get(h);if(u==null)continue;const p=this.zoomBounds(u,c,t,i);if(p==null)return;n=Math.min(n,p.min),r=Math.max(r,p.max)}const l=1e-6;if(n1-l&&(r=1),!(n>r))return{min:n,max:r}}};import{ChartAxisDirection as Tp,definedZoomState as Av}from"ag-charts-core";var SV=class{update(e,t,i,o,s,a){return this.oldZoom??(this.oldZoom=Av(t===Tp.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=Av(s);if(!o||!s)return e===Tp.X?a.x:a.y;const n=Co(i,o.x1,o.y1),r=Co(i,o.x2,o.y2);if(e===Tp.X){const c=(r.x-n.x)*Ze(s);return a.x.max+=c,a.x=si(a.x,s.x,t,n.x),a=Ii(a),a.x}const l=(r.y-n.y)*Wt(s);return a.y.max-=l,a.y=si(a.y,s.y,t,n.y),a=Ii(a),a.y}};import{_ModuleSupport as bV}from"ag-charts-community";import{definedZoomState as wp}from"ag-charts-core";var{userInteraction:Cp}=bV,vV=class{constructor(e,t,i,o,s,a,n){this.eventsHub=e,this.contextMenuRegistry=t,this.zoomManager=i,this.getModuleProperties=o,this.getRect=s,this.updateZoom=a,this.isZoomValid=n}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=Co(r,n.x,n.y);return this.iterateFindNextZoomAtPoint(l)!=null},s=()=>!hn(wp(this.zoomManager.getZoom())),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=zb(this.zoomManager)});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 Co(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(Cp("contextmenu-zoom-to-cursor"),i)}onPanToHere({event:e}){const t=this.computeOrigin(e);if(!t)return;const i=wp(this.zoomManager.getZoom()),o=Ze(i),s=Wt(i),a=t.x*o,n=t.y*s,r=aa/2;let l={x:{min:t.x-r,max:t.x+r},y:{min:t.y-r,max:t.y+r}};l=_b(l,o,s),l=na(l,i.x.min-t.x+a,i.y.min-t.y+n),this.updateZoom(Cp("contextmenu-pan-to-cursor"),Ii(l))}onResetZoom(e){this.zoomManager.resetZoom(Cp("contextmenu-reset"))}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=wp(this.zoomManager.getZoom()),a=e.x*Ze(s),n=e.y*Wt(s),r=aa/2;let l={x:{min:e.x-r,max:e.x+r},y:{min:e.y-r,max:e.y+r}};return l=_b(l,i?Ze(s)*t:aa,o?Wt(s)*t:aa),l=na(l,s.x.min-e.x+a,s.y.min-e.y+n),Ii(l)}};import{_ModuleSupport as MV}from"ag-charts-community";import{BaseProperties as DV,ChartAxisDirection as Nv,Logger as kV,Property as Lv,clamp as Tv,definedZoomState as IV}from"ag-charts-core";var{userInteraction:AV}=MV;function NV(e){return e.x.min===0&&e.x.max===1&&e.y.min===0&&e.y.max===1}function LV(e,t){return e.stickToEnd&&t.x.max===1}function wv(e,t,i){const{domainMin:o,domainMax:s}=t,a=s-o;return{axisId:e,visibleMin:o+a*i.min,visibleMax:o+a*i.max}}function Cv(e,t){const{domainMin:i,domainMax:o}=e,{visibleMin:s,visibleMax:a}=t,n=o-i;return{direction:"x",min:Tv(0,(s-i)/n,1),max:Tv(0,(a-i)/n,1)}}var Op=class extends DV{constructor(){super(...arguments),this.strategy="preserveDomain",this.stickToEnd=!1}};d([Lv],Op.prototype,"strategy",2),d([Lv],Op.prototype,"stickToEnd",2);var TV=class{constructor(e,t,i,o){this.onConstrainChangesCallback=e,this.properties=t,this.ctx=i;const s=()=>{i.eventsHub.off("layout:complete",s),o.register(i.eventsHub.on("data:load",a=>this.onDataLoad(a)),i.eventsHub.on("data:update",a=>this.onDataUpdate(a)))};o.register(i.eventsHub.on("layout:complete",s),i.eventsHub.on("zoom:change-request",a=>this.onZoomChangeRequest(a)))}destroy(){}onDataLoad(e){this.performUpdateStrategy()}onDataUpdate(e){this.performUpdateStrategy()}onZoomChangeRequest(e){e.sourceDetail==="internal-requiredWidth"&&(this.desiredChanges=void 0);const t=this.popDesiredChanges();t&&(e.constrainChanges(t),this.onConstrainChangesCallback(e))}computeDomainMinMax(e){const t=this.ctx.axisManager.getAxisIdContext(e);if(!t?.continuous||t.scale.domain.length===0)return;const[i,o]=t.scale.getDomainMinMax();if(typeof i=="number"&&typeof o=="number")return{domainMin:i,domainMax:o};if(i instanceof Date&&o instanceof Date)return{domainMin:i.getTime(),domainMax:o.getTime()};kV.error(`Unexpected range types: start (${typeof i}), end (${typeof o})`)}popDesiredChanges(){const{desiredChanges:e}=this;if(e)switch(this.desiredChanges=void 0,e.type){case"domain":{const i={};for(const o of e.domains){const s=this.computeDomainMinMax(o.axisId);s&&(i[o.axisId]=Cv(s,o))}return i}case"stickToEnd":{const{axisId:i,difference:o}=e,s=this.computeDomainMinMax(i);if(s){const a={axisId:i,visibleMin:s.domainMax-o,visibleMax:s.domainMax};return{[i]:Cv(s,a)}}break}default:return(i=>i)(e)}}performUpdateStrategy(){const e=IV(this.ctx.zoomManager.getZoom());if(!NV(e)){if(LV(this.properties,e))return this.performStickToEnd();switch(this.properties.strategy){case"reset":return this.ctx.zoomManager.resetZoom(AV("onDataChange-reset"));case"preserveRatios":return;case"preserveDomain":return this.performPreserveDomain();default:return(i=>i)(this.properties.strategy)}}}performPreserveDomain(){this.desiredChanges={type:"domain",domains:[]};const e=this.ctx.zoomManager.getAxes().filter(t=>t.direction===Nv.X);for(const{id:t}of e){const i=this.computeDomainMinMax(t);if(i){const o=this.ctx.zoomManager.getAxisZoom(t),s=wv(t,i,o);this.desiredChanges.domains.push(s)}}}performStickToEnd(){const e=this.ctx.zoomManager.getPrimaryAxisId(Nv.X);if(!e)return;const t=this.computeDomainMinMax(e);if(!t)return;const i=this.ctx.zoomManager.getAxisZoom(e);if(!i)return;const{visibleMin:o,visibleMax:s}=wv(e,t,i),a=s-o;this.desiredChanges={type:"stickToEnd",axisId:e,difference:a}}};import"ag-charts-community";import{ChartAxisDirection as Ov,UNIT_MAX as wV,UNIT_MIN as CV,definedZoomState as OV,entries as EV}from"ag-charts-core";var Ev=16,PV={off:1,short:.01,long:.002},RV=class{constructor(e){this.ctx=e,this.deceleration=1,this.zoomCoordsHistoryIndex=0,this.coordsHistory=[]}get decelerationValue(){const{deceleration:e}=this;return Math.max(typeof e=="number"?e:PV[e]??1,1e-4)}addListener(e,t){return this.onUpdate=t,()=>{this.onUpdate=void 0}}stopInteractions(){this.inertiaHandle!=null&&(this.ctx.agDocument.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%Ev;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=this.ctx.agDocument.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%Ev]={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=this.ctx.agDocument.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===Ov.X}isPanningY(){return this.direction==null||this.direction===Ov.Y}translateZooms(e,t,i,o){const s=Co(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,c]of EV(t)){if(c==null||c.min===CV&&c.max===wV)continue;const{direction:h}=c;let u=OV({[h]:c});u=Ii(na(u,a*Ze(u),n*Wt(u)));const{min:p,max:g}=u[h];r[l]={direction:h,min:p,max:g}}return r}};import"ag-charts-community";import{ChartAxisDirection as Pv,definedZoomState as Rv,entries as _V}from"ag-charts-core";var zV=class{updateAxes(e,t,i,o){const s=e.sourceEvent,a={},{anchorPointX:n,anchorPointY:r,isScalingX:l,isScalingY:c,scrollingStep:h}=t,u=Co(i,s.offsetX??s.clientX,s.offsetY??s.clientY);for(const[p,g]of _V(o)){if(g==null)continue;const{direction:m,min:y,max:x}=g;let f={min:y,max:x};const b=h*e.deltaY*(x-y);if(m===Pv.X&&l)f.max+=b,f=si(f,g,n,u.x);else if(m===Pv.Y&&c)f.max+=b,f=si(f,g,r,u.y);else continue;if(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&&sBv;break;case"pan-end":o=e.x.maxBv;break;case"pan-right":o=e.x.maxi.find(b=>b.identifier===r[f].identifier)),c=r[0].normalX,h=r[1].normalX,u=l[0].clientX,p=l[1].clientX,g=r[0].normalY,m=r[1].normalY,y=s+n-l[0].clientY,x=s+n-l[1].clientY;return this.twitchTolerantZoomPan4(c,h,u,p,g,m,y,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,u){const{initialZoom:p,previous:g}=this,m=Hv(e,t,i,o,g,"a1","a2",l,h,p.x),y=Hv(s,a,n,r,g,"b1","b2",c,u,p.y);return{x:m,y}}};function Hv(e,t,i,o,s,a,n,r,l,c){if(e==t){const h=Bc(c,i,r,l),u=Bc(c,o,r,l),p=(h+u)/2,g=(e-p)/ca;return{min:c.min+g,max:c.max+g}}else{const h=s[a],u=s[n];return Math.abs(i-h)+Math.abs(o-u)<=1?(i=h,o=u):(s[a]=i,s[n]=o),XV(e,t,i,o,r,l)}}var{userInteraction:xs,InteractionState:fr}=Oo,Vc=e=>dV(e,10),Ss="zoom-cursor",xr="zoom-tooltip",Me=class extends lV{constructor(e){super(),this.ctx=e,this.enabled=!1,this.enableAxisDragging=!0,this.enableAxisScrolling=!0,this.enableDoubleClickToReset=!0,this.enablePanning=!0,this.enableScrolling=!0,this.enableSelecting=!1,this.enableTwoFingerZoom=!0,this.panKey="alt",this.axes="x",this.scrollingMode="zoom",this.scrollingStep=aa/10,this.keepAspectRatio=!1,this.minVisibleItems=2,this.anchorPointX=Ob,this.anchorPointY=Eb,this.autoScaling=new Lp,this.axisDraggingMode="zoom",this.buttons=new yn(this.ctx,this.getModuleProperties.bind(this),this.updateZoom.bind(this),this.updateAxisZoom.bind(this),this.resetZoom.bind(this),this.isZoomValid.bind(this)),this.onDataChange=new Op,this.axisDragger=new SV,this.panner=new RV(this.ctx),this.scroller=new zV,this.scrollPanner=new Vb,this.twoFingers=new ZV,this.deceleration="short",this.dragState=0,this.isState=o=>this.ctx.interactionManager.isState(o),this.destroyContextMenuActions=void 0,this.previousZoomValid=!0,this.previousAxisZoomValid={[wt.X]:!0,[wt.Y]:!0};const t=new Dv;this.selector=new BV(t,this.getZoom.bind(this),this.isZoomValid.bind(this)),this.contextMenu=new vV(e.eventsHub,e.contextMenuRegistry,e.zoomManager,this.getModuleProperties.bind(this),()=>this.paddedRect,this.updateZoom.bind(this),this.isZoomValid.bind(this));const i=o=>{if(this.minVisibleItems>0){const s=o.stateAsDefinedZoom();o.constrainZoom(this.constrainZoom(s))}};this.dataChangeHandler=new TV(i,this.onDataChange,this.ctx,this.cleanup),e.widgets.seriesDragInterpreter&&this.cleanup.register(e.widgets.seriesDragInterpreter.events.on("dblclick",o=>this.onSeriesAreaDoubleClick(o)),e.widgets.seriesDragInterpreter.events.on("drag-start",o=>this.onSeriesAreaDragStart(o)),e.widgets.seriesDragInterpreter.events.on("drag-move",o=>this.onSeriesAreaDragMove(o)),e.widgets.seriesDragInterpreter.events.on("drag-end",()=>this.onSeriesAreaDragEnd())),this.cleanup.register(e.scene.attachNode(t),e.eventsHub.on("series:keynav-zoom",o=>this.onNavZoom(o)),e.eventsHub.on("series:keynav-panx",o=>this.onNavPanX(o)),e.eventsHub.on("zoom-interaction:zoom:wheel",o=>this.onWheel(o)),e.eventsHub.on("zoom-interaction:zoom:axis-mouseenter",o=>this.onAxisMouseEnter(o)),e.eventsHub.on("zoom-interaction:zoom:axis-mouseleave",()=>this.onAxisMouseLeave()),e.eventsHub.on("zoom-interaction:zoom:axis-drag-start",o=>this.onAxisDragStart(o.direction)),e.eventsHub.on("zoom-interaction:zoom:axis-drag-move",o=>this.onAxisDragMove(o.axisId,o.direction,o.event)),e.eventsHub.on("zoom-interaction:zoom:axis-drag-end",()=>this.onAxisDragEnd()),e.eventsHub.on("zoom-interaction:zoom:axis-dblclick",o=>this.onAxisDoubleClick(o.axisId)),e.eventsHub.on("zoom-interaction:zoom:axis-wheel",o=>this.onAxisWheel(o)),e.widgets.seriesWidget.addListener("touchstart",(o,s)=>this.onTouchStart(o,s)),e.widgets.seriesWidget.addListener("touchmove",(o,s)=>this.onTouchMove(o,s)),e.widgets.seriesWidget.addListener("touchend",o=>this.onTouchEnd(o)),e.widgets.seriesWidget.addListener("touchcancel",o=>this.onTouchEnd(o)),e.updateService.addListener("process-data",o=>this.onProcessData(o)),e.eventsHub.on("layout:complete",o=>this.onLayoutComplete(o)),e.eventsHub.on("zoom:change-request",o=>this.onZoomChangeRequested(o)),e.eventsHub.on("zoom:pan-start",o=>this.onZoomPanStart(o)),this.panner.addListener("update",o=>this.onPanUpdate(o)),()=>this.teardown()),this.autoScaler=new xV(this.autoScaling,e.zoomManager,this,e.eventsHub,this.cleanup)}teardown(){this.ctx.zoomManager.setZoomModuleEnabled(!1),this.buttons.destroy(),this.destroyContextMenuActions?.(),this.dataChangeHandler.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?hn(this.getZoom()):!0}onSeriesAreaDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i}=this;!t||!i||e?.preventZoomDblClick||!this.isState(fr.ZoomClickable)||this.resetZoom("zoom-seriesarea-dblclick")}onSeriesAreaDragStart(e){const{enabled:t,enablePanning:i,enableSelecting:o,ctx:{domManager:s,zoomManager:a}}=this;if(!t||!this.isState(fr.ZoomDraggable)||this.dragState!==0||this.isIgnoredTouch(e)||(this.panner.stopInteractions(),this.hoveredAxisId))return;let n=0;const r=this.isPanningKeyPressed(e.sourceEvent);i&&(!o||r)?(s.updateCursor(Ss,"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,eventsHub:l}}=this;if(!this.hoveredAxisId&&!(!i||!o||!this.isState(fr.ZoomDraggable)||this.isIgnoredTouch(e))){switch(n.pushState(Oo.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}n.isState(Oo.InteractionState.Frozen)||r.updateTooltip(xr),l.emit("chart:request-update",{type:_c.PERFORM_LAYOUT,opts:{skipAnimations:!0}})}}onSeriesAreaDragEnd(){const{ctx:{interactionManager:e}}=this;this.hoveredAxisId||(e.popState(Oo.InteractionState.ZoomDrag),!(!this.enabled||this.dragState===0)&&(this.handleRegularDragEnd(),this.resetDragState()))}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());i?this.updateZoom(xs("zoom-seriesarea-selector"),i):this.ctx.eventsHub.emit("chart:request-update",{type:_c.SCENE_RENDER})}break}}resetDragState(){this.dragState=0,this.ctx.domManager.updateCursor(Ss),this.ctx.tooltipManager.removeTooltip(xr)}onAxisMouseEnter(e){const{anchorPointX:t,anchorPointY:i,axisDraggingMode:o,enabled:s,enableAxisDragging:a}=this;if(this.hoveredAxisId=e.axisId,!s||!a){this.ctx.domManager.updateCursor(Ss);return}const n=this.getZoom();let r,l=!1;if(e.direction===wt.X){if(r="ew-resize",l=!vv(Ze(n),aa),!l){const c=Tc(n,.999,1);c.x=si(c.x,n.x,t),l=this.isZoomValid(c,{includeYVisibleRange:!0})}}else if(r="ns-resize",l=!vv(Wt(n),aa),!l){const c=Tc(n,1,.999);c.y=si(c.y,n.y,i),l=this.isZoomValid(c,{includeYVisibleRange:!0})}o==="pan"&&(r="grab"),l?(e.stopProcessing(),this.ctx.domManager.updateCursor(Ss,r)):this.ctx.domManager.updateCursor(Ss)}onAxisMouseLeave(){this.hoveredAxisId=void 0,this.ctx.domManager.updateCursor(Ss),!this.enabled||this.enableAxisDragging}onAxisDoubleClick(e){const{enabled:t,enableDoubleClickToReset:i,ctx:{zoomManager:o}}=this;!t||!i||!this.isState(fr.ZoomClickable)||(this.previousAxisZoomValid={[wt.X]:!0,[wt.Y]:!0},o.resetAxisZoom({source:"user-interaction",sourceDetail:"zoom-axis-dblclick"},e))}onAxisDragStart(e){const{axisDraggingMode:t,enabled:i,enableAxisDragging:o,panner:s,ctx:{zoomManager:a}}=this;!i||!o||(s.stopInteractions(),t==="pan"?(this.ctx.domManager.updateCursor(Ss,"grabbing"),this.dragState=2,this.panner.start(e),a.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:u,tooltipManager:p,eventsHub:g,zoomManager:m}}=this;if(!r||!l||!c)return;u.pushState(Oo.InteractionState.ZoomDrag),i.device==="touch"&&i.sourceEvent.preventDefault();const y=this.getZoom();if(n===2)this.panner.update({currentX:i.offsetX,currentY:i.offsetY});else{let x=t===wt.X?o:s;h&&(x=t===wt.X?s:o);const f=m.getAxisZoom(e),b=a.update(i,t,x,c,y,f);this.autoScaler.onManualAdjustment(t),this.updateAxisZoom(xs("zoom-axis-drag"),e,t,b,{directional:!0})}p.updateTooltip(xr),g.emit("chart:request-update",{type:_c.PERFORM_LAYOUT,opts:{skipAnimations:!0}})}onAxisDragEnd(){const{axisDraggingMode:e,axisDragger:t,dragState:i,enabled:o,enableAxisDragging:s,ctx:{domManager:a,interactionManager:n,tooltipManager:r}}=this;n.popState(Oo.InteractionState.ZoomDrag),!(!o||!s||i===0)&&(this.dragState=0,e==="pan"&&this.panner.stop(),t.stop(),a.updateCursor(Ss),r.removeTooltip(xr))}onNavZoom(e){const{enabled:t,enableScrolling:i,scroller:o}=this;!this.ctx.interactionManager.isState(Oo.InteractionState.Focusable)||!t||!i||(e.widgetEvent.sourceEvent.preventDefault(),this.updateZoom(xs(`keyboard(${e.delta})`),o.updateDelta(e.delta,this.getModuleProperties(),this.getZoom())))}onNavPanX(e){const{enabled:t}=this;if(!this.ctx.interactionManager.isState(Oo.InteractionState.Focusable)||!t)return;e.widgetEvent.sourceEvent.preventDefault();const o=e.reverse?{[-1]:1,1:-1,home:"end",end:"home"}[e.delta]:e.delta,s=this.getZoom(),a=Ze(s);if(o==="home")s.x.min=0,s.x.max=a;else if(o==="end")s.x.min=1-a,s.x.max=1;else{const n=o*a;s.x.min+=n,s.x.max+=n,s.x=pr(s.x)}this.updateZoom(xs(`keyboard-page(${e.delta})`),s)}onWheel(e){const{enabled:t,enablePanning:i,enableScrolling:o,paddedRect:s,scrollingMode:a}=this;if(!t||!o||!s||!this.isState(fr.ZoomWheelable))return;e.stopProcessing();const{deltaX:n,deltaY:r}=e.event,l=n!=null&&r!=null&&Math.abs(n)>Math.abs(r);i&&(a==="pan"||l)?this.onWheelPanning(e):this.onWheelScrolling(e)}onWheelPanning(e){const{scrollingStep:t,scrollPanner:i,seriesRect:o,scrollingMode:s,ctx:{zoomManager:a}}=this;if(!o){e.abort();return}const{event:n}=e,r=this.getZoom(),l=n.deltaY>0&&r.y.min===Sv||n.deltaY<0&&r.y.max===zc,c=i.update(n,t,s,o,a.getAxisZooms());this.updateChanges(xs("zoom-seriesarea-wheel"),c),l?e.capped():e.uncapped()}onWheelScrolling(e){const t=this.getZoom(),i=e.event.deltaY>0&&hn(t);this.handleWheelScrolling(e,i)}onAxisWheel(e){if(!this.enabled||!this.enableAxisScrolling)return;e.stopProcessing();const{event:t,direction:i}=e;if(i!==wt.X&&i!==wt.Y)return;const o=i===wt.X,s=!o,a=this.getModuleProperties({isScalingX:o,isScalingY:s}),n=this.getZoom(),r=t.deltaY>0&&n[i].min===Sv&&n[i].max===zc;this.autoScaler.onManualAdjustment(i),this.handleWheelScrolling(e,r,a)}handleWheelScrolling(e,t,i=this.getModuleProperties()){const{enableIndependentAxes:o,scroller:s,seriesRect:a,ctx:{zoomManager:n}}=this;if(!a){e.abort();return}const{event:r}=e;let l=!0;const c=xs("zoom-axis-wheel");if(o===!0){const h=s.updateAxes(r,i,a,n.getAxisZooms());for(const[u,{direction:p,min:g,max:m}]of hV(h)){const y=p===wt.X?this.constrainZoom({x:{min:g,max:m},y:{min:zc,max:zc}}).x:{min:g,max:m};l&&(l=this.updateAxisZoom(c,u,p,y))}}else{const h=s.update(r,i,a,this.getZoom());if(h==null)return"abort";l=this.updateUnifiedZoom(c,h,{directional:!0})}t||r.deltaY<0&&!l?e.capped():e.uncapped()}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(xs("zoom-seriesarea-twofingers"),Ii(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.ctx.eventsHub.emit("axis-dom-proxy:update",{source:"zoom",enabled:this.enabled,enableDoubleClick:this.enableDoubleClickToReset,enableDragging:this.enableAxisDragging,enableScrolling:this.enableAxisScrolling}),this.enabled&&(this.seriesRect=e.series.rect,this.paddedRect=e.series.paddedRect)}onZoomChangeRequested(e){e.sourceDetail!=="zoom-seriesarea-panner"&&this.panner.stopInteractions();const t=this.getZoom();this.buttons.toggleVisibleZoomed(hn(t))}onZoomPanStart(e){e.callerId==="zoom"&&this.panner.stopInteractions()}onPanUpdate(e){const{panner:t,seriesRect:i,ctx:{tooltipManager:o,zoomManager:s,interactionManager:a}}=this;if(!i)return;const n=t.translateZooms(i,s.getAxisZooms(),e.deltaX,e.deltaY);this.updateChanges(xs("zoom-seriesarea-panner"),n),a.isState(Oo.InteractionState.Frozen)||o.updateTooltip(xr)}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){return this.ctx.zoomManager.constrainZoomToItemCount(e,this.minVisibleItems,this.autoScaler.enabled)}isZoomValid(e,t){const{minVisibleItems:i,ctx:{zoomManager:o}}=this;if(i===0)return this.previousZoomValid=!0,!0;const s=this.getZoom(),a=Vc(Ze(e))=r)return this.previousAxisZoomValid[e]=!0,!0;if(!this.previousAxisZoomValid[e]&&i?.directional)return!1;const c={includeYVisibleRange:!1,autoScaleYAxis:this.autoScaler.enabled},h=s.isVisibleItemsCountAtLeast(l,o,c);return this.previousAxisZoomValid[e]=i?.directional?h:!0,h}resetZoom(e){this.previousZoomValid=!0,this.previousAxisZoomValid={[wt.X]:!0,[wt.Y]:!0},this.ctx.zoomManager.resetZoom({source:"user-interaction",sourceDetail:e})}updateSyncZoom(e){this.updateZoom({source:"sync",sourceDetail:"internal-updateSyncZoom"},e)}updateChanges(e,t){const i=this.ctx.zoomManager.toZoomState(t)??{},o=bv(this.ctx.zoomManager.getZoom());this.updateZoom(e,{x:i.x??o.x,y:i.y??o.y})}updateZoom(e,t){this.enableIndependentAxes?this.updatePrimaryAxisZooms(e,t):this.updateUnifiedZoom(e,t)}updateUnifiedZoom(e,t,i){return t=this.constrainZoom(t),this.isZoomValid(t,i)?(this.ctx.zoomManager.updateZoom(e,t),!0):(this.ctx.eventsHub.emit("chart:request-update",{type:_c.SCENE_RENDER,opts:{skipAnimations:!0}}),!1)}updatePrimaryAxisZooms(e,t){this.updatePrimaryAxisZoom(e,t,wt.X),this.updatePrimaryAxisZoom(e,t,wt.Y)}updatePrimaryAxisZoom(e,t,i){const o=this.ctx.zoomManager.getPrimaryAxisId(i);o!=null&&this.updateAxisZoom(e,o,i,t[i])}updateAxisZoom(e,t,i,o,s){const{enableIndependentAxes:a,ctx:{zoomManager:n}}=this;if(!o)return!1;const r=this.getZoom();if(a!==!0)return r[i]=o,this.updateUnifiedZoom(e,r,s);if(!this.isAxisZoomValid(i,o,s))return!1;const{source:l,sourceDetail:c}=e;return n.updateChanges({source:l,sourceDetail:c,changes:{[t]:o},isReset:!1}),!0}getZoom(){return bv(this.ctx.zoomManager.getZoom())}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([xv({newValue(e){this.onEnabledChange(e)}}),Ce],Me.prototype,"enabled",2),d([Ce],Me.prototype,"enableAxisDragging",2),d([Ce],Me.prototype,"enableAxisScrolling",2),d([Ce],Me.prototype,"enableDoubleClickToReset",2),d([xv({changeValue(e){this.ctx.zoomManager.setIndependentAxes(!!e)}}),Ce],Me.prototype,"enableIndependentAxes",2),d([Ce],Me.prototype,"enablePanning",2),d([Ce],Me.prototype,"enableScrolling",2),d([Ce],Me.prototype,"enableSelecting",2),d([Ce],Me.prototype,"enableTwoFingerZoom",2),d([Ce],Me.prototype,"panKey",2),d([Ce],Me.prototype,"axes",2),d([Ce],Me.prototype,"scrollingMode",2),d([Ce],Me.prototype,"scrollingStep",2),d([Ce],Me.prototype,"keepAspectRatio",2),d([Ce],Me.prototype,"minVisibleItems",2),d([Ce],Me.prototype,"anchorPointX",2),d([Ce],Me.prototype,"anchorPointY",2),d([Ce],Me.prototype,"autoScaling",2),d([Ce],Me.prototype,"axisDraggingMode",2),d([Ce],Me.prototype,"buttons",2),d([Ce],Me.prototype,"onDataChange",2),d([cV("panner.deceleration"),Ce],Me.prototype,"deceleration",2);var Fc=fs("pointer","start","middle","end"),fn={type:"plugin",name:"zoom",enterprise:!0,version:tV,dependencies:[wb],options:{enabled:ri,enableAxisDragging:ri,enableAxisScrolling:ri,enableDoubleClickToReset:ri,enablePanning:ri,enableScrolling:ri,enableSelecting:ri,enableTwoFingerZoom:ri,keepAspectRatio:ri,anchorPointX:Fc,anchorPointY:Fc,axisDraggingMode:fs("pan","zoom"),axes:fs("x","y","xy"),deceleration:oV(fs("off","short","long"),Ap),minVisibleItems:sV,panKey:fs("alt","ctrl","meta","shift"),scrollingMode:fs("pan","zoom"),scrollingStep:Ap,autoScaling:{enabled:ri,padding:Ap},onDataChange:{strategy:aV()("reset","preserveDomain","preserveRatios"),stickToEnd:ri},buttons:{enabled:ri,buttons:iV({...rV,value:fs("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:nV},"zoom button options array"),visible:fs("always","zoomed","hover")}},themeTemplate:{enabled:!1,enableAxisDragging:!0,enableAxisScrolling:!0,enableDoubleClickToReset:!0,enablePanning:!0,enableScrolling:!0,enableSelecting:!1,enableTwoFingerZoom:!0,deceleration:"short",minVisibleItems:2,panKey:"alt",scrollingStep:.1,autoScaling:{enabled:{$and:[{$eq:[{$path:"../axes"},"x"]},{$not:{$eq:[{$path:"/series/0/direction"},"horizontal"]}}]},padding:.05},onDataChange:{strategy:"preserveDomain",stickToEnd:!1},anchorPointX:"end",anchorPointY:"middle",axes:"x",buttons:{enabled:{$path:"../enabled"},visible:"hover",buttons:{$shallowSimple:[{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"}]}}},create:e=>new Me(e)};fn.options.enableIndependentAxes=Np(ri),fn.options.buttons.anchorPointX=Np(Fc),fn.options.buttons.anchorPointY=Np(Fc);import{VERSION as QV}from"ag-charts-community";import{FILL_GRADIENT_BLANK_DEFAULTS as qV,FILL_IMAGE_BLANK_DEFAULTS as JV,FILL_PATTERN_BLANK_DEFAULTS as eF,LEGEND_CONTAINER_THEME as tF,and as Kv,array as iF,boolean as Wv,borderOptionsDef as oF,callback as sF,colorUnion as aF,fontOptionsDef as nF,greaterThan as rF,legendPositionValidator as lF,lessThan as cF,number as Gv,numberFormatValidator as hF,padding as dF,positiveNumber as ha,ratio as uF}from"ag-charts-core";import{_ModuleSupport as pF}from"ag-charts-community";import{BaseProperties as Rp,Border as gF,CleanupRegistry as mF,Property as li,ProxyProperty as _p,ZIndexMap as yF,createId as fF,expandLegendPosition as zp}from"ag-charts-core";import{_ModuleSupport as xF}from"ag-charts-community";import{ZIndexMap as SF,cachedTextMeasurer as bF,countFractionDigits as vF,createId as MF,createIdsGenerator as DF,estimateTickCount as kF,findMinMax as IF,findRangeExtent as AF,isArray as NF,measureTextSegments as LF,toPlainText as TF,toTextString as wF}from"ag-charts-core";import{callWithContext as CF}from"ag-charts-core";function Sr(e,t,i){return CF(e.chartService,t,i)}var{AxisInterval:OF,AxisLabel:EF,LinearScale:PF,BBox:RF,TranslatableGroup:_F,Selection:zF,Text:BF}=xF,Hc=class Dm{constructor(t,i){this.ctx=t,this.dataProvider=i,this.id=MF(this),this.axisGroup=new _F({name:`${this.id}-AxisTicks`,zIndex:SF.AXIS}),this.labelSelection=zF.select(this.axisGroup,BF),this.interval=new OF,this.label=new EF,this.scale=new PF,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(p){}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:u}=h;return this.labelSelection.update(u,void 0,p=>p.tickId),this.axisGroup.setProperties({translationX:i,translationY:o}),this.labelSelection.each((p,g)=>{p.fontFamily=a.fontFamily,p.fontSize=a.fontSize,p.fontStyle=a.fontStyle,p.fontWeight=a.fontWeight,p.fill=a.color,p.textBaseline=r,p.textAlign=l,p.text=g.tickLabel,p.x=s?g.translation:0,p.y=s?0:g.translation,c.push(p.getBBox())}),c.length>0?RF.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,visibleDomain:void 0};return this.label.formatValue((u,p)=>Sr(a,u,p),h,c)??n.format((u,p)=>Sr(a,u,p),h)??n.defaultFormat(h)}}inRange(t,i=.001){const[o,s]=IF(this.scale.range);return t>=o-i&&t<=s+i}generateTicks(){const{minSpacing:t,maxSpacing:i}=this.interval,{maxTickCount:o,minTickCount:s,tickCount:a}=kF(AF(this.scale.range),1,t,i,Dm.DefaultTickCount,Dm.DefaultMinSpacing),n=this.getTicksData({nice:[!0,!0],interval:this.interval.step,tickCount:a,minTickCount:s,maxTickCount:o});if(this.placement==="bottom"||this.placement==="top"){const r=bF(this.label),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let u=-1/0*h;n.ticks=n.ticks.filter(p=>{if(Math.sign(p.translation-u)!==h)return!1;const{width:g}=NF(p.tickLabel)?LF(p.tickLabel,this.label):r.measureLines(wF(p.tickLabel));return u=p.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,vF(c)),0),n=DF(),r=this.tickFormatter(o,s,!1,a);for(let l=0;lthis.onChartHoverChange()),e.layoutManager.registerElement(FF.Legend,t=>this.onStartLayout(t)),()=>this.legendGroup.remove())}isVertical(){const{placement:e}=zp(this.position);return e.startsWith("right")||e.startsWith("left")}destroy(){this.cleanup.flush()}attachLegend(e){e.appendChild(this.legendGroup)}onStartLayout({layoutBox:e}){const[t]=this.data;if(!this.enabled||!t?.enabled||t.legendType!=="gradient"){this.legendGroup.visible=!1;return}const{colorRange:i}=this.normalizeColorArrays(t),{strokeWidth:o,padding:s}=this.getContainerStyles(),a=this.updateGradientRect(e,i),n=this.updateAxis(t,a)??new Bp(0,0,0,0),r=Bp.merge([a,n]);r.grow(s).grow(o);const{left:l,top:c}=this.getMeasurements(e,r);this.updateContainer(r),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 Bp(0,0,0,0),r=Math.max(t.length-1,1);let l;return this.isVertical()?(l=0,n.width=a,n.height=Math.min(e.height,s)):(l=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((c,h)=>({stop:h/r,color:c})),rotation:l},n}updateAxis(e,t){const{axisTicks:i,gradient:o,scale:s}=this,{placement:a}=zp(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();this.containerNode.setStyleProperties(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||e.series?.isHighlightEnabled()===!1){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){const i=p=>{};let{x:o,y:s}=e;const{width:a,height:n}=t,{placement:r,floating:l,xOffset:c,yOffset:h}=zp(this.position),u=this.getContainerStyles();switch(o+=u.strokeWidth+u.padding.left,s+=u.strokeWidth+u.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:i(r)}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:i(r)}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()}};ci.className="GradientLegend",d([li],ci.prototype,"enabled",2),d([li],ci.prototype,"position",2),d([li],ci.prototype,"reverseOrder",2),d([li],ci.prototype,"gradient",2),d([li],ci.prototype,"spacing",2),d([li],ci.prototype,"border",2),d([li],ci.prototype,"cornerRadius",2),d([li],ci.prototype,"fill",2),d([li],ci.prototype,"fillOpacity",2),d([li],ci.prototype,"padding",2),d([li],ci.prototype,"scale",2);var Wc={type:"plugin",name:"gradientLegend",enterprise:!0,version:QV,options:{enabled:Wv,position:lF,spacing:ha,reverseOrder:Wv,border:oF,cornerRadius:Gv,padding:dF,fill:aF,fillOpacity:uF,gradient:{preferredLength:ha,thickness:ha},scale:{label:{...nF,minSpacing:ha,format:hF,formatter:sF},padding:ha,interval:{step:Gv,values:iF,minSpacing:Kv(ha,cF("maxSpacing")),maxSpacing:Kv(ha,rF("minSpacing"))}}},themeTemplate:{...tF,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",qV],["pattern",eF],["image",JV]]}},create:e=>{const t=new ci(e);return t.attachLegend(e.scene),t}};import{VERSION as GF}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as jF,FILL_IMAGE_DEFAULTS as $F,FILL_PATTERN_DEFAULTS as UF,LABEL_BOXING_DEFAULTS as YF,SINGLE_SERIES_HIGHLIGHT_STYLE as XF}from"ag-charts-core";import{VERSION as ZF,_ModuleSupport as QF}from"ag-charts-community";import{_ModuleSupport as qF}from"ag-charts-community";import{_ModuleSupport as JF}from"ag-charts-community";import{Logger as $v}from"ag-charts-core";var{DataSet:eH}=JF,tH=class extends eH{constructor(e,t,i){super(e,t),this.childrenKey=i}commitPendingTransactions(){const e=super.commitPendingTransactions();return e&&this.dataIdKey&&(this.removeNestedDuplicatesFromRoot(),this.idToIndexCache=void 0),e}removeNestedDuplicatesFromRoot(){const e=new Set;for(const i of this.data)this.collectNestedIds(i,e);if(e.size===0)return;let t=0;for(;t0&&$v.warnOnce(`dataIdKey '${this.dataIdKey}' was not found on any data item.`)}return this.idToIndexCache}indexItemRecursively(e,t){const i=this.getIdValue(e);i!==void 0&&(this.idToIndexCache.has(i)||this.idToIndexCache.set(i,t));const o=e?.[this.childrenKey];if(Array.isArray(o))for(const s of o)this.indexItemRecursively(s,t)}collectUpdatedOriginalIndicesById(e,t){const i=this.getIdToIndexMap();for(const[o,s]of e){const a=i.get(o);if(a!==void 0&&!t.removedOriginalIndices.has(a)){const n=this.data[a];this.getIdValue(n)===o?(t.updatedOriginalIndices.add(a),t.pendingReplacements??(t.pendingReplacements=new Map),t.pendingReplacements.set(o,s)):this.replaceNestedItem(n,o,s)&&t.updatedOriginalIndices.add(a),e.delete(o)}}}applyRemovalsById(e,t){const i=new Set;for(const o of e){const s=this.getIdValue(o);s===void 0?$v.warnOnce(`applyTransaction() remove item is missing '${this.dataIdKey}' field; ignoring.`):i.add(s)}if(i.size!==0&&(this.removeFromGroupsByIdForHierarchy(t.prependsList,i),i.size>0&&this.removeFromGroupsByIdForHierarchy(t.insertionsList,i),t.trackedInsertions.length>0&&this.removeFromTrackedInsertionsById(e,t),i.size>0&&this.removeFromGroupsByIdForHierarchy(t.appendsList,i),i.size>0)){const o=this.getIdToIndexMap();for(const s of i){const a=o.get(s);if(a!==void 0){const n=this.data[a];this.getIdValue(n)===s?(t.removedOriginalIndices.add(a),t.virtualLength--):this.removeNestedItem(n,s)&&t.updatedOriginalIndices.add(a),i.delete(s)}}}}replaceNestedItem(e,t,i){const o=e?.[this.childrenKey];if(!Array.isArray(o))return!1;for(let s=0;s0;){const s=this.getIdValue(i[o]);s!==void 0&&t.has(s)?(t.delete(s),i.splice(o,1)):o++}if(t.size===0)break}}},{Chart:iH}=qF,Fp=class extends iH{getChartType(){return"standalone"}createDataSet(e){for(const t of this.series)if("childrenKey"in t.properties)return new tH(e,this.dataIdKey,t.properties.childrenKey);return super.createDataSet(e)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,o=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=o,this.animationRect=o;for(const s of[t,i])s.translationX=Math.floor(o.x),s.translationY=Math.floor(o.y);t.visible=this.series[0].visible,this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:o,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}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})}}};Fp.className="StandaloneChart",Fp.type="standalone";var{standaloneChartOptionsDefs:oH}=QF,xn={type:"chart",name:"standalone",enterprise:!0,version:ZF,options:oH,create(e,t){return new Fp(e,t)}};import{_ModuleSupport as sH}from"ag-charts-community";import{Logger as aH,angleBetween as Gc,cachedTextMeasurer as nH,calcLineHeight as rH,evaluateBezier as jc,isBetweenAngles as Uv,mergeDefaults as $c,normalizeAngle360 as lH,toPlainText as cH,wrapText as hH}from"ag-charts-core";import{_ModuleSupport as Uc}from"ag-charts-community";import{Logger as dH}from"ag-charts-core";function Yv(e,t,i){i||(t=uH(t));const o=new Map;for(const a of e){const n=a.datumIndex.type===0?`link-${a.datumIndex.index}`:`node-${a.datumIndex.index}`;o.set(a.id,{itemId:n,datum:a,linksBefore:[],linksAfter:[],maxPathLengthBefore:-1,maxPathLengthAfter:-1})}let s=0;for(const[a,n]of o.entries())s=Math.max(s,Hp(o,t,n,a,-1,[])+Hp(o,t,n,a,1,[])+1);return{links:t,nodeGraph:o,maxPathLength:s}}function Xv(e,t,i,o){const s=o.indexOf(t);if(s!==-1){for(let n=s;n!t.has(i))}function Hp(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,u=s===-1?h.id:c.id,p=s===-1?c.id:h.id,g=o===u?e.get(p):void 0;g!=null&&(r.push({node:g,link:l}),a?.push(o),n=Math.max(n,Hp(e,t,g,p,s,a)+1),a?.pop())}s===-1?i.maxPathLengthBefore=n:i.maxPathLengthAfter=n}return n}var{findNodeDatumInArray:pH,keyProperty:gH,valueProperty:Yc,DataController:mH,Group:br,HighlightState:Zv,Selection:da,Series:yH,TransformableText:fH}=Uc,xH=class extends Uc.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}},Qv=class extends yH{constructor(){super(...arguments),this.NodeEvent=xH,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 br({name:"linkGroup"})),this.nodeGroup=this.contentGroup.appendChild(new br({name:"nodeGroup"})),this.focusLinkGroup=this.highlightGroup.appendChild(new br({name:"linkGroup"})),this.focusNodeGroup=this.highlightGroup.appendChild(new br({name:"nodeGroup"})),this.highlightLinkGroup=this.highlightGroup.appendChild(new br({name:"linkGroup"})),this.labelSelection=da.select(this.labelGroup,fH),this.linkSelection=da.select(this.linkGroup,()=>this.linkFactory()),this.nodeSelection=da.select(this.nodeGroup,()=>this.nodeFactory()),this.focusLinkSelection=da.select(this.focusLinkGroup,()=>this.linkFactory()),this.focusNodeSelection=da.select(this.focusNodeGroup,()=>this.nodeFactory()),this.highlightLinkSelection=da.select(this.highlightLinkGroup,()=>this.linkFactory()),this.highlightNodeSelection=da.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 mH("standalone",e.suppressFieldDotNotation,this.ctx.eventsHub),c=i==null?null:l.request(this.id,Uc.DataSet.wrap(i)??Uc.DataSet.empty(),{props:[gH(n,void 0,{id:"idValue",includeProperty:!1}),...r==null?[]:[Yc(r,void 0,{id:"labelValue",includeProperty:!1})]],groupByKeys:!0}),h=e.request(this.id,t,{props:[Yc(o,void 0,{id:"fromValue",includeProperty:!1}),Yc(s,void 0,{id:"toValue",includeProperty:!1}),...a==null?[]:[Yc(a,void 0,{id:"sizeValue",includeProperty:!1,missingValue:0})]],groupByKeys:!1});i!=null&&l.execute();const[u,p]=await Promise.all([c??Promise.resolve(null),h]);this.nodesDataModel=u?.dataModel,this.nodesProcessedData=u?.processedData,this.linksDataModel=p?.dataModel,this.linksProcessedData=p?.processedData;const g=new Map;if(u==null){const m=p.dataModel.resolveColumnById(this,"fromValue",p.processedData),y=p.dataModel.resolveColumnById(this,"toValue",p.processedData),x=b=>{const S=g.size,v=b;return{series:this,itemId:`node-${S}`,datum:{},datumIndex:{type:1,index:S},type:1,index:S,linksBefore:[],linksAfter:[],id:b,size:0,label:v,style:this.getNodeStyle({datumIndex:{type:1,index:S},datum:{},size:0,label:v},S,!1)}},f=p.processedData.dataSources.get(this.id)?.data;if(f)for(const[b]of f.entries()){const S=m[b],v=y[b];S==null||v==null||(g.has(S)||g.set(S,x(S)),g.has(v)||g.set(v,x(v)))}}else{const m=u.dataModel.resolveColumnById(this,"idValue",u.processedData),y=r==null?void 0:u.dataModel.resolveColumnById(this,"labelValue",u.processedData),x=this.data?.dataIdKey,f=u.processedData.dataSources.get(this.id)?.data;if(f)for(const[b,S]of f.entries()){const v=m[b],M=y?.[b],D={type:1,index:b},I=x==null?void 0:S[x];g.set(v,{series:this,itemId:I==null?`node-${b}`:String(I),datum:S,datumIndex:D,type:1,index:b,linksBefore:[],linksAfter:[],id:v,size:0,label:M,style:this.getNodeStyle({datumIndex:D,datum:S,size:0,label:M},b,!1)})}}this.processedNodes=g}findNodeDatum(e){return pH(e,this.contextNodeData?.nodeData,this.data?.dataIdKey)}getNodeGraph(e,t,{includeCircularReferences:i}){const{linksDataModel:o,linksProcessedData:s}=this;if(o==null||s==null){const{links:x,nodeGraph:f,maxPathLength:b}=Yv(new Map().values(),[],i);return this.nodeCount=0,this.linkCount=0,{nodeGraph:f,links:x,maxPathLength:b}}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 x of this.processedNodes.values()){const f=e(x);c.set(x.id,f)}const h=[],u=this.data?.dataIdKey,p=s.dataSources.get(this.id)?.data;if(p)for(const[x,f]of p.entries()){const b=n[x],S=r[x],v=l==null?1:l[x],M=c.get(b),D=c.get(S);if(v<=0||M==null||D==null)continue;const I={type:0,index:x},A=u==null?void 0:f[u],k=t({series:this,itemId:A==null?`link-${x}`:String(A),datum:f,datumIndex:I,type:0,index:x,fromNode:M,toNode:D,size:v,style:this.getLinkStyle({datum:f,datumIndex:I},M.datumIndex,!1)});h.push(k)}const{links:g,nodeGraph:m,maxPathLength:y}=Yv(c.values(),h,i);for(const x of m.values())x.datum.linksBefore=x.linksBefore.map(f=>f.link),x.datum.linksAfter=x.linksAfter.map(f=>f.link);return this.nodeCount=m.size,this.linkCount=g.length,{nodeGraph:m,links:g,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??[],a=this.getHighlightedDatum();this.contentGroup.visible=this.visible;const n=a==null?Zv.None:Zv.OtherItem;this.contentGroup.opacity=this.properties.highlight.getStyle(n).opacity??1,this.labelSelection=this.updateLabelSelection({labelData:s,labelSelection:this.labelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection}),this.linkSelection=this.updateLinkSelection({nodeData:o.filter(u=>u.type===0),datumSelection:this.linkSelection}),this.updateLinkNodes({datumSelection:this.linkSelection,isHighlight:!1}),this.nodeSelection=this.updateNodeSelection({nodeData:o.filter(u=>u.type===1),datumSelection:this.nodeSelection}),this.updateNodeNodes({datumSelection:this.nodeSelection,isHighlight:!1});let r,l,c,h;a?.type===1?(r=o.filter(u=>u.type===0&&(u.toNode===a||u.fromNode===a)),l=r.map(u=>u.fromNode===a?u.toNode:u.fromNode),l.push(a),c=[],h=[a]):a?.type===0?(r=[a],l=[a.fromNode,a.toNode],c=[a],h=[]):(r=[],l=[],c=[],h=[]),this.focusLinkSelection=this.updateLinkSelection({nodeData:r,datumSelection:this.focusLinkSelection}),this.updateLinkNodes({datumSelection:this.focusLinkSelection,isHighlight:!1}),this.focusNodeSelection=this.updateNodeSelection({nodeData:l,datumSelection:this.focusNodeSelection}),this.updateNodeNodes({datumSelection:this.focusNodeSelection,isHighlight:!1}),this.highlightLinkSelection=this.updateLinkSelection({nodeData:c,datumSelection:this.highlightLinkSelection}),this.updateLinkNodes({datumSelection:this.highlightLinkSelection,isHighlight:!0}),this.highlightNodeSelection=this.updateNodeSelection({nodeData:h,datumSelection:this.highlightNodeSelection}),this.updateNodeNodes({datumSelection:this.highlightNodeSelection,isHighlight:!0})}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();if(e?.series===this&&e.type==null){const{itemId:t}=e,i=this.contextNodeData?.nodeData??[];e=t==null?void 0:i.find(o=>o.type===1&&o.id===t)}else e?.series!==this&&(e=void 0);return e}isLabelHighlighted(e,t){return t==null?!1:t.type===1?t===e:t.type===0?t.fromNode===e||t.toNode===e:!1}resetAnimation(e){}dataCount(){return Number.NaN}getSeriesDomain(e){return{domain:[]}}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:u=0}=i;return{marker:{fill:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}}}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,u=>u.datum).at(-1)}else if(o?.type===1){const r=Array.from(this.nodeSelection,h=>h.datum),c=r.indexOf(o)+t;c>=0&&cu.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 SH}from"ag-charts-community";import{SceneChangeDetection as bs}from"ag-charts-core";var{Path:bH}=SH;function qv({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,u=r*o;return{x:[s,l,h,n],y:[a,c,u,r]}}var Eo=class extends bH{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([bs()],Eo.prototype,"centerX",2),d([bs()],Eo.prototype,"centerY",2),d([bs()],Eo.prototype,"radius",2),d([bs()],Eo.prototype,"startAngle1",2),d([bs()],Eo.prototype,"endAngle1",2),d([bs()],Eo.prototype,"startAngle2",2),d([bs()],Eo.prototype,"endAngle2",2),d([bs()],Eo.prototype,"tension",2);import{_ModuleSupport as vH}from"ag-charts-community";import{BaseProperties as Jv,Property as X}from"ag-charts-core";var{FillGradientDefaults:MH,FillPatternDefaults:DH,FillImageDefaults:kH,makeSeriesTooltip:IH,SeriesProperties:AH,Label:NH}=vH,Kp=class extends NH{constructor(){super(...arguments),this.spacing=1,this.maxWidth=1}};d([X],Kp.prototype,"spacing",2),d([X],Kp.prototype,"maxWidth",2);var ao=class extends Jv{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([X],ao.prototype,"fill",2),d([X],ao.prototype,"fillOpacity",2),d([X],ao.prototype,"stroke",2),d([X],ao.prototype,"strokeOpacity",2),d([X],ao.prototype,"strokeWidth",2),d([X],ao.prototype,"lineDash",2),d([X],ao.prototype,"lineDashOffset",2),d([X],ao.prototype,"tension",2),d([X],ao.prototype,"itemStyler",2);var Ri=class extends Jv{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([X],Ri.prototype,"spacing",2),d([X],Ri.prototype,"width",2),d([X],Ri.prototype,"fill",2),d([X],Ri.prototype,"fillOpacity",2),d([X],Ri.prototype,"stroke",2),d([X],Ri.prototype,"strokeOpacity",2),d([X],Ri.prototype,"strokeWidth",2),d([X],Ri.prototype,"lineDash",2),d([X],Ri.prototype,"lineDashOffset",2),d([X],Ri.prototype,"itemStyler",2);var Qe=class extends AH{constructor(){super(...arguments),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 MH,this.fillPatternDefaults=new DH,this.fillImageDefaults=new kH,this.fills=[],this.strokes=[],this.label=new Kp,this.link=new ao,this.node=new Ri,this.tooltip=IH()}};d([X],Qe.prototype,"fromKey",2),d([X],Qe.prototype,"toKey",2),d([X],Qe.prototype,"idKey",2),d([X],Qe.prototype,"idName",2),d([X],Qe.prototype,"labelKey",2),d([X],Qe.prototype,"labelName",2),d([X],Qe.prototype,"sizeKey",2),d([X],Qe.prototype,"sizeName",2),d([X],Qe.prototype,"nodes",2),d([X],Qe.prototype,"fillGradientDefaults",2),d([X],Qe.prototype,"fillPatternDefaults",2),d([X],Qe.prototype,"fillImageDefaults",2),d([X],Qe.prototype,"fills",2),d([X],Qe.prototype,"strokes",2),d([X],Qe.prototype,"label",2),d([X],Qe.prototype,"link",2),d([X],Qe.prototype,"node",2),d([X],Qe.prototype,"tooltip",2);var{SeriesNodePickMode:eM,createDatumId:Xc,Sector:LH,getShapeStyle:Zc,getLabelStyles:TH,BBox:wH}=sH,Qc=e=>e.startAngle+Gc(e.startAngle,e.endAngle)/2,Wp=class extends Qv{constructor(e){super({moduleCtx:e,pickModes:[eM.NEAREST_NODE,eM.EXACT_SHAPE_MATCH]}),this.properties=new Qe}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new Eo}nodeFactory(){return new LH}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:u,spacing:p}}=o,g=t/2,m=i/2;let y=[];const{nodeGraph:x,links:f}=this.getNodeGraph(w=>({...w,centerX:g,centerY:m,innerRadius:Number.NaN,outerRadius:Number.NaN,startAngle:Number.NaN,endAngle:Number.NaN}),w=>({...w,centerX:g,centerY:m,radius:Number.NaN,startAngle1:Number.NaN,endAngle1:Number.NaN,startAngle2:Number.NaN,endAngle2:Number.NaN}),{includeCircularReferences:!0});let b=0;for(const[w,{datum:O,linksBefore:B,linksAfter:E}]of x.entries()){const C=B.reduce((_,{link:z})=>_+z.size,0)+E.reduce((_,{link:z})=>_+z.size,0);if(C===0)x.delete(w);else{const{label:_}=o;O.size=C,b+=O.size;const z=_.enabled?this.getLabelText(O.label,O.datum,r,"label",[],_,{datum:O.datum,value:O.label,fromKey:s,toKey:a,sizeKey:n,size:O.size}):void 0;O.label=cH(z)}}let S=0;if(this.isLabelEnabled()){const w=nH(this.properties.label);let O=0;for(const{datum:B}of x.values()){const{id:E,label:C}=B;if(C==null)continue;const _=hH(C,{maxWidth:c,font:this.properties.label,textWrap:"never"}),{width:z}=w.measureLines(_);O=Math.max(z,O),y.push({id:E,text:_,centerX:g,centerY:m,angle:Number.NaN,radius:Number.NaN,size:B.size,datumIndex:B.datumIndex,nodeDatum:B})}S=O+l}const v=x.size;let M=Math.min(t,i)/2-u-S,D=p/M;if(S!==0&&(v*D>=1.5*Math.PI||M<=0)&&(y=[],M=Math.min(t,i)/2-u,D=p/M),v*D>=2*Math.PI||M<=0){aH.warnOnce("There was insufficient space to display the Chord Series.");return}const I=M,A=M+u,k=Math.max((2*Math.PI-v*D)/b,0);let N=0;for(const{datum:w}of x.values()){w.innerRadius=I,w.outerRadius=A,w.startAngle=N,w.endAngle=N+w.size*k,N=w.endAngle+D;const O=(w.innerRadius+w.outerRadius)/2,B=Qc(w);w.midPoint={x:w.centerX+O*Math.cos(B),y:w.centerY+O*Math.sin(B)}}const L=[];for(const{datum:w,linksBefore:O,linksAfter:B}of x.values()){const E=Qc(w),C=[...O.map(z=>({link:z.link,distance:Gc(Qc(z.node.datum),E),after:!1})),...B.map(z=>({link:z.link,distance:Gc(Qc(z.node.datum),E),after:!0}))];let _=w.startAngle;for(const{link:z,after:K}of C.toSorted((F,Z)=>F.distance-Z.distance)){const F=z.size*k;K?(z.startAngle1=_,z.endAngle1=_+F):(z.startAngle2=_,z.endAngle2=_+F),_+=z.size*k}L.push(w)}const{tension:T}=this.properties.link;for(const w of f){w.radius=M;const O=qv({radius:M,startAngle:w.startAngle1,endAngle:w.endAngle2,tension:T}),B=qv({radius:M,startAngle:w.startAngle2,endAngle:w.endAngle1,tension:T}),E=jc(...O.x,.5),C=jc(...O.y,.5),_=jc(...B.x,.5),z=jc(...B.y,.5);w.midPoint={x:w.centerX+(E+_)/2,y:w.centerY+(C+z)/2},L.push(w)}for(const w of y){const O=x.get(w.id)?.datum;O!=null&&(w.radius=A+l,w.angle=lH(O.startAngle+Gc(O.startAngle,O.endAngle)/2),w.datumIndex=O.datumIndex,w.nodeDatum=O)}y.sort((w,O)=>w.angle-O.angle);let P=1/0,R=-1/0;return y=y.filter(w=>{const O=rH(h),B=Math.atan2(O/2,w.radius),E=w.angle-B,C=w.angle+B;return Uv(P,E,C)||Uv(R,E,C)?!1:(P=Math.min(E,P),R=Math.max(C,R),!0)}),{itemId:e,nodeData:L,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.getHighlightedDatum();e.labelSelection.each((o,s)=>{const{size:a,text:n,centerX:r,centerY:l,radius:c,angle:h,datumIndex:u,nodeDatum:p}=s;t.size=a;const g=this.isLabelHighlighted(p,i),m=this.getHighlightStyle(g,u),y=TH(this,void 0,t,this.properties.label,g,i),{fontStyle:x,fontWeight:f,fontSize:b,fontFamily:S,color:v}=y;o.visible=!0,o.translationX=r+c*Math.cos(h),o.translationY=l+c*Math.sin(h),o.text=n,o.fill=v,o.fontStyle=x,o.fontWeight=f,o.fontSize=b,o.fontFamily=S,o.textBaseline="middle",Math.cos(h)>=0?(o.textAlign="left",o.rotation=h):(o.textAlign="right",o.rotation=h-Math.PI);const M=m.opacity??1;o.opacity=M,o.fillOpacity=M,o.setBoxing(y)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Xc(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),u=$c(h,o.node.getStyle(s,a,t));let p=Zc(u,n,r,l);if(c!=null&&e.datumIndex!=null){const g=this.cachedDatumCallback(Xc(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const m=this.makeItemStylerParams(e,i,p);return this.callWithContext(c,m)});g&&(p=Zc($c(g,p),n,r,l))}return p.opacity=1,p}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,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);s.setStyleProperties(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=>Xc(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:u}=a.link,p=this.getHighlightStyle(o,e),g=$c(p,a.link.getStyle(n,r,i.index));let m=Zc(g,l,c,h);if(u!=null&&e!=null){const y=this.ctx.highlightManager?.getActiveHighlight(),x=this.cachedDatumCallback(Xc(e.index,"link",o?"highlight":"node"),()=>{const f=this.getHighlightStateString(y,o,i);return this.callWithContext(u,{seriesId:s,datum:t,highlightState:f,...m})});x&&(m=Zc($c(x,m),l,c,h))}return m.opacity=1,m}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,s.setStyleProperties(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 wH(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,u=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===e.type&&b.datumIndex.index===e.index);if(u==null)return;const p=u.type===0?u.fromNode.index:u.index,g=u.type===0?`${u.fromNode.label} - ${u.toNode.label}`:u.label,m=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:o?.dataSources.get(this.id)?.data[e.index],y=u.size;let x;if(u.type===0){const b=u.fromNode.datumIndex;x=this.getLinkStyle({datumIndex:e,datum:m},b,!1)}else{const b=u.label;x=this.getNodeStyle({datumIndex:e,datum:m,size:y,label:b},e.index,!1)}const f=[];if(l!=null){const b=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:m,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});f.push({label:c,fallbackLabel:l,value:b??String(y)})}return this.formatTooltipWithContext(h,{title:g,symbol:this.legendItemSymbol(u.type,p,x),data:f},{seriesId:t,datum:m,title:g,fromKey:n,toKey:r,sizeKey:l,sizeName:c,size:y,...x})}computeFocusBounds(e){return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};Wp.className="ChordSeries",Wp.type="chord";import{_ModuleSupport as CH}from"ag-charts-community";import{commonSeriesOptionsDefs as OH,constant as EH,fillGradientDefaults as PH,fillImageDefaults as RH,fillPatternDefaults as _H,required as Gp,string as qc,undocumented as jp}from"ag-charts-core";var{chordSeriesThemeableOptionsDef:zH}=CH,Jc={...zH,...OH,type:Gp(EH("chord")),fromKey:Gp(qc),toKey:Gp(qc),sizeKey:qc,sizeName:qc};Jc.fillGradientDefaults=jp(PH),Jc.fillPatternDefaults=jp(_H),Jc.fillImageDefaults=jp(RH);var tM={type:"series",name:"chord",chartType:"standalone",enterprise:!0,solo:!0,version:GF,dependencies:[xn],options:Jc,themeTemplate:{series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:jF,fillPatternDefaults:UF,fillImageDefaults:$F,highlight:XF,label:{...YF,enabled:!0,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}},create:e=>new Wp(e)};import{CartesianChartModule as BH,VERSION as VH}from"ag-charts-community";import{CARTESIAN_AXIS_TYPE as Sn,CARTESIAN_POSITION as bn,DEFAULT_SHADOW_COLOUR as FH,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS as HH,FILL_IMAGE_DEFAULTS as KH,FILL_PATTERN_SINGLE_DEFAULTS as WH,LABEL_BOXING_DEFAULTS as GH}from"ag-charts-core";var vn={$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},iM={$clone:{$omit:[["placement","spacing"],{$path:"/series/0/stageLabel"}]}},oM={y:{type:{$if:[vn,Sn.NUMBER,Sn.CATEGORY]},position:{$if:[vn,bn.LEFT,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"after"]},bn.RIGHT,bn.LEFT]}]},label:{$if:[vn,void 0,iM]}},x:{type:{$if:[vn,Sn.CATEGORY,Sn.NUMBER]},position:{$if:[vn,{$if:[{$eq:[{$path:["/series/0/stageLabel/placement",void 0]},"before"]},bn.TOP,bn.BOTTOM]},bn.BOTTOM]},label:{$if:[vn,iM,void 0]}}},jH={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",HH],["pattern",WH],["image",KH]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},[{$path:["/0",void 0,{$palette:"strokes"}]}]]},label:{...GH,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:FH,xOffset:3,yOffset:3,blur:5},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.6}}},axes:{[Sn.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[Sn.CATEGORY]:{line:{enabled:!1}}}};import{_ModuleSupport as $H}from"ag-charts-community";import{ChartAxisDirection as UH}from"ag-charts-core";import{_ModuleSupport as $p}from"ag-charts-community";import{ChartAxisDirection as Up,SeriesZIndexMap as sM}from"ag-charts-core";import{_ModuleSupport as YH}from"ag-charts-community";import{SceneChangeDetection as vs,lineDistanceSquared as eh}from"ag-charts-core";var{BBox:XH,Path:ZH}=YH,aM=1e-6;function nM([e,t],[i,o]){return Math.abs(e-i)<=aM&&Math.abs(t-o)<=aM}var no=class extends ZH{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(eh(e,t,i,o,s,a,1/0),eh(e,t,s,a,n,r,1/0),eh(e,t,n,r,l,c,1/0),eh(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),u=Math.max(t,o,a,r)-h;return new XH(l,h,c,u)}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,u;for(const p of c){if(h!=null&&nM(h,p)||u!=null&&nM(u,p))continue;const[g,m]=p;h==null?e.moveTo(g,m):e.lineTo(g,m),h??(h=p),u=p}e.closePath()}};d([vs()],no.prototype,"x0",2),d([vs()],no.prototype,"y0",2),d([vs()],no.prototype,"x1",2),d([vs()],no.prototype,"y1",2),d([vs()],no.prototype,"x2",2),d([vs()],no.prototype,"y2",2),d([vs()],no.prototype,"x3",2),d([vs()],no.prototype,"y3",2);import{_ModuleSupport as QH}from"ag-charts-community";var{NODE_UPDATE_STATE_TO_PHASE_MAPPING:qH}=QH;function rM(e,t,i,o){const{x0:s,y0:a,x1:n,y1:r,x2:l,y2:c,x3:h,y3:u,opacity:p}=e;return i?{x0:(s+h)/2,y0:(a+u)/2,x1:(n+l)/2,y1:(r+c)/2,x2:(n+l)/2,y2:(r+c)/2,x3:(s+h)/2,y3:(a+u)/2,opacity:p}:{x0:(s+n)/2,y0:(a+r)/2,x1:(s+n)/2,y1:(a+r)/2,x2:(l+h)/2,y2:(c+u)/2,x3:(l+h)/2,y3:(c+u)/2,opacity:p}}function JH(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={...vr(a,n),opacity:0}:r==="unknown"||r==="added"?l=rM(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=qH[r];return{...l,phase:c}},toFn:(a,n,r)=>{let l;return r==="removed"&&a.datum==null&&t==="fade"?l={...vr(a,n),opacity:0}:r==="removed"||i(n)?l=rM(n,a.previousDatum,e,t):l=vr(a,n),l}}}function vr(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:lM,valueProperty:e4,keyProperty:t4,updateLabelNode:i4,SMALLEST_KEY_INTERVAL:o4,LARGEST_KEY_INTERVAL:s4,diff:a4,fixNumericExtent:n4,seriesLabelFadeInAnimation:cM,resetMotion:r4,resetLabelFn:l4,animationValidation:c4,computeBarFocusBounds:h4,Group:d4,Selection:u4,PointerEvents:hM,motion:p4,checkCrisp:g4,createDatumId:m4}=$p,y4=class extends $p.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.xKey=o.properties.stageKey,this.yKey=o.properties.valueKey}},dM=class extends $p.AbstractBarSeries{constructor({moduleCtx:e,animationResetFns:t}){super({moduleCtx:e,pickModes:[lM.AXIS_ALIGNED,lM.EXACT_SHAPE_MATCH],propertyKeys:{x:["stageKey"],y:["valueKey"]},propertyNames:{x:[],y:[]},categoryKey:"xValue",datumSelectionGarbageCollection:!1,animationResetFns:{datum:t.datum,label:l4}}),this.NodeEvent=y4,this.connectorNodeGroup=this.contentGroup.appendChild(new d4({name:`${this.id}-series-connectorNodes`,zIndex:sM.BACKGROUND})),this.connectorSelection=u4.select(this.connectorNodeGroup,()=>this.connectionFactory()),this.connectorNodeGroup.pointerEvents=hM.None}get pickModeAxis(){return"main-category"}setZIndex(e){return super.setZIndex(e),this.connectorNodeGroup.zIndex=[sM.BACKGROUND,e],!0}isVertical(){return!super.isVertical()}connectionFactory(){return new no}getKeyAxis(e){if(e===Up.X)return this.properties.xKeyAxis;if(e===Up.Y)return this.properties.yKeyAxis}async processData(e){const{stageKey:t,valueKey:i}=this.properties,{visible:o,id:s}=this,a=(y,x,f)=>o&&this.ctx.legendManager.getItemEnabled({seriesId:s,itemId:f}),n=this.getCategoryAxis()?.scale,r=this.getValueAxis()?.scale,{isContinuousX:l,xScaleType:c,yScaleType:h}=this.getScaleInformation({xScale:n,yScale:r}),u=[];this.needsDataModelDiff()&&this.processedData&&u.push(a4(this.id,this.processedData)),this.ctx.animationManager.isSkipped()||u.push(c4());const p=this.visible?{}:{forceValue:0},g=this.properties.allowNullKeys??!1,{processedData:m}=await this.requestDataModel(e,this.data,{props:[t4(t,c,{id:"xValue",allowNullKey:g}),e4(i,h,{id:"yValue",...p,validation:a,invalidValue:0}),...l?[o4,s4]:[],...u],groupByKeys:!1});this.smallestDataInterval=m.reduced?.smallestKeyInterval,this.largestDataInterval=m.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i,id:o,ctx:{legendManager:s}}=this;if(!t||!i)return{domain:[]};const{keys:[a]}=t.domain;if(e===this.getCategoryDirection()){const n=i.resolveProcessedDataDefById(this,"xValue");if(n?.def.type==="key"&&n?.def.valueType==="category"){if(!this.hasData)return{domain:[]};const r=a.filter((c,h)=>s.getItemEnabled({seriesId:o,itemId:h})),l=i.getKeySortMetadata(this,"xValue",t);return{domain:r,sortMetadata:l}}return{domain:this.padBandExtent(a)}}else{const n=this.domainForClippedRange(e,["yValue"],"xValue"),r=Math.max(...n),l=[-r,r];return{domain:n4(l)}}}getSeriesRange(e,t){return[Number.NaN,Number.NaN]}createNodeData(){const{hasData:e,data:t,dataModel:i,processedData:o,id:s,ctx:{legendManager:a}}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!(e&&t&&n&&r&&i&&o?.type==="ungrouped"))return;const l=n.scale,c=r.scale,h=this.getBarDirection()===Up.X,{stageKey:u,valueKey:p}=this.properties,g=`${p}`,m={itemId:g,nodeData:[],labelData:[],connectorData:[],scales:this.calculateScaling(),groupScale:this.getScaling(this.ctx.seriesStateManager.getGroupScale(this)),visible:this.visible},y=this.visible;if(!y)return m;const x=i.resolveKeysById(this,"xValue",o),f=i.resolveColumnById(this,"yValue",o),{groupOffset:b,barOffset:S,barWidth:v}=this.getBarDimensions(),M=g4(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval);let D;const I=o.dataSources.get(this.id)?.data??[];for(const[A,k]of I.entries()){const N=y&&a.getItemEnabled({seriesId:s,itemId:A}),L=x[A];if(L===void 0&&!this.properties.allowNullKeys)continue;const T=l.convert(L);if(!Number.isFinite(T))continue;const P=Math.round(T)+b+S,R=f[A],w=Math.round(c.convert(-R)),O=Math.round(c.convert(R)),B=this.getItemStyle({datum:k,datumIndex:A},!1),E=Math.max(B.strokeWidth??0,Math.abs(O-w)),C={x:h?Math.min(O,w):P,y:h?P:Math.min(O,w),width:h?E:v,height:h?v:E},_={x:C.x+C.width/2,y:C.y+C.height/2},z=this.createLabelData({datumIndex:A,rect:C,barAlongX:h,yDatum:R,datum:k,visible:N}),K={index:A,series:this,datum:k,datumIndex:A,xValue:L,yValue:R,xKey:u,yKey:p,x:C.x,y:C.y,width:C.width,height:C.height,midPoint:_,crisp:M,label:z,visible:N};if(m.nodeData.push(K),z!=null&&m.labelData.push(z),D!=null){const F=D.rect,Z=D.nodeDatum,G=D.datumIndex;h?m.connectorData.push({datum:Z,datumIndex:G,x0:F.x,y0:F.y+F.height,x1:F.x+F.width,y1:F.y+F.height,x2:C.x+C.width,y2:C.y,x3:C.x,y3:C.y,opacity:1}):m.connectorData.push({datum:Z,datumIndex:G,x0:F.x+F.width,y0:F.y,x1:C.x,y1:C.y,x2:C.x,y2:C.y+C.height,x3:F.x+F.width,y3:F.y+F.height,opacity:1})}N&&(D={itemId:g,rect:C,nodeDatum:K,datumIndex:A})}return m}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(vr(i,o)),i.setStyleProperties({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=hM.None})}updateLabelNodes(e){const t={stageKey:this.properties.stageKey,valueKey:this.properties.valueKey},i=this.ctx.highlightManager?.getActiveHighlight(),{isHighlight:o=!1,labelSelection:s}=e;s.each((a,n)=>{const r=this.getHighlightStyle(o,n.datumIndex);a.visible=n.visible||o,a.fillOpacity=r.opacity??1,a.opacity=r.opacity??1,i4(this,a,t,this.properties.label,n,o,i)})}getHighlightLabelData(e,t){if(t.label)return[{...t.label}]}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 u=o.dataSources.get(this.id)?.data[e],p=i.resolveKeysById(this,"xValue",o)[e],g=i.resolveColumnById(this,"yValue",o)[e],m=this.properties.allowNullKeys??!1;if(!(p===void 0&&!m))return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:this.getAxisValueText(c,"tooltip",p,u,a,l),value:this.getAxisValueText(h,"tooltip",g,u,n,l)}]},{seriesId:t,datum:u,title:a,stageKey:a,valueKey:n,...this.tooltipStyle(u,e)})}resetAllAnimation(e){super.resetAllAnimation(e),r4([this.connectorSelection],vr)}animateEmptyUpdateReady({labelSelection:e}){const{connectorSelection:t}=this,i=this.isVertical(),s=JH(i,"normal");p4.fromToMotion(this.id,"connectors",this.ctx.animationManager,[t],s),cM(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(e){const{labelSelection:t}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id),cM(this,"labels",this.ctx.animationManager,t)}getDatumId(e){return m4(e.xValue)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return h4(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],u=this.properties.allowNullKeys??!1;if(!(h==null&&!u))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 f4}from"ag-charts-community";import{Property as Ct}from"ag-charts-core";var{Label:x4,AbstractBarSeriesProperties:S4,makeSeriesTooltip:b4,AxisLabel:v4}=f4,Yp=class extends x4{constructor(){super(...arguments),this.spacing=0}};d([Ct],Yp.prototype,"placement",2),d([Ct],Yp.prototype,"spacing",2);var uM=class extends v4{};d([Ct],uM.prototype,"placement",2);var hi=class extends S4{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 Yp,this.stageLabel=new uM,this.tooltip=b4()}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([Ct],hi.prototype,"stageKey",2),d([Ct],hi.prototype,"valueKey",2),d([Ct],hi.prototype,"fills",2),d([Ct],hi.prototype,"fillOpacity",2),d([Ct],hi.prototype,"strokes",2),d([Ct],hi.prototype,"strokeWidth",2),d([Ct],hi.prototype,"strokeOpacity",2),d([Ct],hi.prototype,"lineDash",2),d([Ct],hi.prototype,"lineDashOffset",2),d([Ct],hi.prototype,"label",2),d([Ct],hi.prototype,"stageLabel",2),d([Ct],hi.prototype,"tooltip",2);function pM(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:M4}=$H,Xp=class extends dM{constructor(e){super({moduleCtx:e,animationResetFns:{datum:pM}}),this.properties=new hi}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 M4}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 u,p,g,m;if(i)switch(u=t.x+t.width/2,g="center",h){case"before":p=t.y-c,m="bottom";break;case"after":p=t.y+t.height+c,m="top";break;default:p=t.y+t.height/2,m="middle"}else switch(p=t.y+t.height/2,m="middle",h){case"before":u=t.x-c,g="right";break;case"after":u=t.x+t.width+c,g="left";break;default:u=t.x+t.width/2,g="center"}const y=this.getSeriesDomain(UH.Y).domain,x=this.getLabelText(o,s,r,"y",y,l,{itemId:r,value:o,datum:s,stageKey:n,valueKey:r});return{x:u,y:p,textAlign:g,textBaseline:m,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(pM(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}};Xp.className="ConeFunnelSeries",Xp.type="cone-funnel";import{_ModuleSupport as D4}from"ag-charts-community";import{commonSeriesOptionsDefs as k4,constant as I4,required as Zp,string as gM,without as A4}from"ag-charts-core";var{coneFunnelSeriesThemeableOptionsDef:N4}=D4,L4={...A4(k4,["showInLegend"]),...N4,type:Zp(I4("cone-funnel")),stageKey:Zp(gM),valueKey:Zp(gM)};import{CARTESIAN_AXIS_TYPE as mM,FILL_GRADIENT_LINEAR_SINGLE_DEFAULTS as T4,FILL_IMAGE_DEFAULTS as w4,FILL_PATTERN_SINGLE_DEFAULTS as C4,LABEL_BOXING_DEFAULTS as O4,SAFE_FILLS_OPERATION as E4}from"ag-charts-core";var P4={series:{direction:"vertical",fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},E4]},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",T4],["pattern",C4],["image",w4]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$palette:"secondSequentialColors"},{$palette:"strokes"}]}]},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...O4,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:{enabled:{$path:["/highlight/enabled",!0]},highlightedItem:{stroke:"rgba(0, 0, 0, 0.4)",strokeWidth:2}}},seriesArea:{padding:{top:20,bottom:20}},axes:{[mM.NUMBER]:{nice:!1,gridLine:{enabled:!1},crosshair:{enabled:!1},label:{enabled:!1}},[mM.CATEGORY]:{line:{enabled:!1}}}},yM={type:"series",name:"cone-funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:VH,dependencies:[BH],options:L4,defaultAxes:oM,themeTemplate:P4,create:e=>new Xp(e)};import{CartesianChartModule as R4,VERSION as _4}from"ag-charts-community";import{_ModuleSupport as z4}from"ag-charts-community";import{ChartAxisDirection as fM,mergeDefaults as Qp}from"ag-charts-core";import{_ModuleSupport as B4}from"ag-charts-community";import{BaseProperties as V4,Property as de}from"ag-charts-core";var{Label:F4,DropShadow:H4,AbstractBarSeriesProperties:K4,makeSeriesTooltip:W4,AxisLabel:G4}=B4,j4=class extends F4{},xM=class extends G4{};d([de],xM.prototype,"placement",2);var Po=class extends V4{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([de],Po.prototype,"enabled",2),d([de],Po.prototype,"fill",2),d([de],Po.prototype,"fillOpacity",2),d([de],Po.prototype,"stroke",2),d([de],Po.prototype,"strokeWidth",2),d([de],Po.prototype,"strokeOpacity",2),d([de],Po.prototype,"lineDash",2),d([de],Po.prototype,"lineDashOffset",2);var pt=class extends K4{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 Po,this.shadow=new H4().set({enabled:!1}),this.label=new j4,this.stageLabel=new xM,this.tooltip=W4()}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([de],pt.prototype,"stageKey",2),d([de],pt.prototype,"valueKey",2),d([de],pt.prototype,"fills",2),d([de],pt.prototype,"fillOpacity",2),d([de],pt.prototype,"strokes",2),d([de],pt.prototype,"strokeWidth",2),d([de],pt.prototype,"strokeOpacity",2),d([de],pt.prototype,"lineDash",2),d([de],pt.prototype,"lineDashOffset",2),d([de],pt.prototype,"spacingRatio",2),d([de],pt.prototype,"itemStyler",2),d([de],pt.prototype,"dropOff",2),d([de],pt.prototype,"shadow",2),d([de],pt.prototype,"label",2),d([de],pt.prototype,"stageLabel",2),d([de],pt.prototype,"tooltip",2);var{resetBarSelectionsFn:$4,prepareBarAnimationFunctions:SM,midpointStartingBarPosition:bM,createDatumId:U4,Rect:Y4,motion:vM}=z4,qp=class extends dM{constructor(e){super({moduleCtx:e,animationResetFns:{datum:$4}}),this.properties=new pt}getBandScalePadding(){return{inner:this.properties.spacingRatio,outer:0}}connectorEnabled(){return this.properties.dropOff.enabled}connectorStyle(e){return Qp(this.properties.dropOff.getStyle(),this.properties.getStyle(e))}nodeFactory(){return new Y4}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(fM.Y).domain,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=Qp(l,s.getStyle(t));if(r!=null){const u=this.ctx.highlightManager?.getActiveHighlight(),p=this.cachedDatumCallback(U4(t,i?"highlight":"node"),()=>{const g=this.getHighlightStateString(u,i,t);return this.callWithContext(r,{seriesId:o,datum:e,highlightState:g,stageKey:a,valueKey:n,...h})});p&&(h=Qp(p,h))}return h}updateDatumNodes({datumSelection:e,isHighlight:t}){const{contextNodeData:i}=this;if(!i)return;const{shadow:o}=this.properties,s=this.getCategoryDirection()===fM.X,a=this.getShapeFillBBox();e.each((n,r)=>{const l=this.getItemStyle(r,t);n.setStyleProperties(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=SM(bM(i,"normal"),"unknown");vM.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=SM(bM(this.isVertical(),"fade"),"added");vM.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}};qp.className="FunnelSeries",qp.type="funnel";import{_ModuleSupport as X4}from"ag-charts-community";import{commonSeriesOptionsDefs as Z4,constant as Q4,required as Jp,string as MM,without as q4}from"ag-charts-core";var{funnelSeriesThemeableOptionsDef:J4}=X4,eK={...J4,...q4(Z4,["showInLegend"]),type:Jp(Q4("funnel")),stageKey:Jp(MM),valueKey:Jp(MM)},DM={type:"series",name:"funnel",chartType:"cartesian",enterprise:!0,solo:!0,version:_4,dependencies:[R4],options:eK,defaultAxes:oM,themeTemplate:jH,create:e=>new qp(e)};import{VERSION as tK}from"ag-charts-community";import{FONT_SIZE as iK,LABEL_BOXING_DEFAULTS as oK,SAFE_RANGE2_OPERATION as sK,SAFE_STROKE_FILL_OPERATION as aK,linearGaugeSeriesOptionsDef as nK}from"ag-charts-core";import{VERSION as rK}from"ag-charts-community";import{boolean as lK,commonChartOptionsDefs as cK,defined as Dt,linearGaugeSeriesOptionsDef as hK,positiveNumber as dK,radialGaugeSeriesOptionsDef as uK,tooltipOptionsDefs as pK,typeUnion as gK,undocumented as eg,without as kM}from"ag-charts-core";import{mergeArrayDefaults as IM,mergeDefaults as mK}from"ag-charts-core";function AM(e){const{enabled:t,mode:i,showArrow:o,range:s,position:a,pagination:n,delay:r,wrapping:l,interaction:c,renderer:h,...u}=e,p={enabled:t,showArrow:o,range:s,position:a,interaction:c,renderer:h,...u};return{chartTooltipOptions:{mode:i,pagination:n,delay:r,wrapping:l,...u},seriesTooltipOptions:p}}function yK(e){const{animation:t,background:i,container:o,contextMenu:s,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:u,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:x,title:f,width:b,type:S,cursor:v,nodeClickRange:M,tooltip:D,value:I,scale:A={},startAngle:k,endAngle:N,highlight:L,segmentation:T,bar:P,needle:R,targets:w,outerRadius:O,innerRadius:B,outerRadiusRatio:E,innerRadiusRatio:C,cornerRadius:_,cornerMode:z,label:K,secondaryLabel:F,spacing:Z,withinStudio:G,...$}=e,J=D!=null,ae=D??{},{chartTooltipOptions:ne,seriesTooltipOptions:he}=AM(ae),Ae={...$,type:S,cursor:v,context:a,nodeClickRange:M,value:I,scale:A,startAngle:k,endAngle:N,highlight:L,segmentation:T,bar:P,targets:w,outerRadius:O,innerRadius:B,outerRadiusRatio:E,innerRadiusRatio:C,cornerRadius:_,cornerMode:z,label:K,secondaryLabel:F,spacing:Z};return J&&(Ae.tooltip=he),R!=null&&(Ae.needle={enabled:!0,...R}),{animation:t,background:i,container:o,contextMenu:s,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:u,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:x,title:f,width:b,...J?{tooltip:ne}:{},series:[Ae]}}function fK(e){const{animation:t,background:i,container:o,contextMenu:s,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:u,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:x,title:f,width:b,type:S,cursor:v,nodeClickRange:M,tooltip:D,value:I,scale:A={},direction:k="vertical",thickness:N,highlight:L,segmentation:T,bar:P,targets:R,cornerRadius:w,cornerMode:O,label:B,withinStudio:E,...C}=e,_=D!=null,z=D??{},{chartTooltipOptions:K,seriesTooltipOptions:F}=AM(z),Z={...C,type:S,cursor:v,nodeClickRange:M,value:I,scale:A,direction:k,thickness:N,highlight:L,segmentation:T,bar:P,targets:R,cornerRadius:w,cornerMode:O,label:B};return _&&(Z.tooltip=F),{animation:t,background:i,container:o,contextMenu:s,context:a,footnote:n,foreground:r,height:l,listeners:c,locale:h,minHeight:u,minWidth:p,overrideDevicePixelRatio:g,padding:m,subtitle:y,theme:x,title:f,width:b,..._?{tooltip:K}:{},series:[Z]}}function NM(e,t){if(t==null)return e;const{targets:i,...o}=t;return e=mK(e,o),e.targets!=null&&i!=null&&(e.type==="radial-gauge"?e.targets=IM(e.targets,i):e.targets=IM(e.targets,i)),e}function xK(e,t){switch(e.type){case"radial-gauge":return yK(NM(e,t));case"linear-gauge":return fK(NM(e,t));default:return{series:[]}}}var Mr={theme:Dt,container:Dt,animation:Dt,background:Dt,contextMenu:Dt,context:()=>!0,listeners:Dt,locale:Dt,width:Dt,height:Dt,minWidth:Dt,minHeight:Dt,title:Dt,subtitle:Dt,footnote:Dt,padding:Dt,tooltip:{...pK,...cK.tooltip}};Mr.overrideDevicePixelRatio=eg(dK),Mr.foreground=eg(Dt),Mr.withinStudio=eg(lK);var LM={type:"preset",name:"gauge-preset",enterprise:!0,version:rK,dependencies:[xn],options:gK({"linear-gauge":{...kM(hK,["type"]),...Mr},"radial-gauge":{...kM(uK,["type"]),...Mr}},"gauge options"),create:xK};import{_ModuleSupport as Mn}from"ag-charts-community";import{StateMachine as SK,cachedTextMeasurer as TM,easeOut as bK,findRangeExtent as vK,isArray as MK,measureTextSegments as DK,mergeDefaults as wM,tickFormat as kK,toRadians as CM,toTextString as IK}from"ag-charts-core";var OM=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 AK}from"ag-charts-core";var EM={fromFn:()=>({opacity:0,phase:"initial"}),toFn:()=>({opacity:1})};function PM(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 Dr(e,t,i,o){if(i.text!=null)return i.text;const s=o??i.value;let a;return i?.formatter!=null&&(a=Sr(t,i.formatter,{seriesId:e,datum:void 0,value:s})),a==null||AK(a)?a:String(a)}function RM({path:e,x:t,y:i,size:o}){e.moveTo(t,i-o/2),e.lineTo(t,i+o/2)}import{_ModuleSupport as _M}from"ag-charts-community";import{clamp as zM,iterate as NK}from"ag-charts-core";function BM(e,t){const i=NK(e.datumUnion.nodes(),e.targetSelection.nodes());return e.pickNodeNearestDistantObject(t,i)}function VM(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=zM(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=zM(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}}function FM(e,t){const i=e.data?.dataIdKey;return _M.findNodeDatumInArray(t,e.contextNodeData?.nodeData,i)??_M.findNodeDatumInArray(t,e.contextNodeData?.targetData,i)}import{_ModuleSupport as tg}from"ag-charts-community";import{BaseProperties as th,PropertiesArray as ig,Property as H}from"ag-charts-core";import{BaseProperties as HM,Logger as LK,Property as Dn}from"ag-charts-core";var ih=class extends HM{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&&(LK.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([Dn],ih.prototype,"values",2),d([Dn],ih.prototype,"step",2),d([Dn],ih.prototype,"count",2);var kr=class extends HM{constructor(){super(...arguments),this.enabled=!1,this.interval=new ih,this.spacing=0}};d([Dn],kr.prototype,"enabled",2),d([Dn],kr.prototype,"interval",2),d([Dn],kr.prototype,"spacing",2);var{makeSeriesTooltip:TK,SeriesProperties:wK,Label:CK,AxisLabel:OK,getColorStops:EK}=tg,KM=class extends CK{};d([H],KM.prototype,"spacing",2);var gt=class extends th{constructor(){super(...arguments),this.value=0,this.label=new KM}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([H],gt.prototype,"text",2),d([H],gt.prototype,"value",2),d([H],gt.prototype,"shape",2),d([H],gt.prototype,"placement",2),d([H],gt.prototype,"spacing",2),d([H],gt.prototype,"size",2),d([H],gt.prototype,"rotation",2),d([H],gt.prototype,"fill",2),d([H],gt.prototype,"fillOpacity",2),d([H],gt.prototype,"stroke",2),d([H],gt.prototype,"strokeWidth",2),d([H],gt.prototype,"strokeOpacity",2),d([H],gt.prototype,"lineDash",2),d([H],gt.prototype,"lineDashOffset",2),d([H],gt.prototype,"label",2);var di=class extends th{constructor(){super(...arguments),this.enabled=!0,this.thicknessRatio=1,this.fills=new ig(tg.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:u}=this;return{fill:o??GM(s,a,e,i,t),fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}}};d([H],di.prototype,"enabled",2),d([H],di.prototype,"thickness",2),d([H],di.prototype,"thicknessRatio",2),d([H],di.prototype,"fills",2),d([H],di.prototype,"fillMode",2),d([H],di.prototype,"fill",2),d([H],di.prototype,"fillOpacity",2),d([H],di.prototype,"stroke",2),d([H],di.prototype,"strokeWidth",2),d([H],di.prototype,"strokeOpacity",2),d([H],di.prototype,"lineDash",2),d([H],di.prototype,"lineDashOffset",2);var Ir=class extends th{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};d([H],Ir.prototype,"values",2),d([H],Ir.prototype,"step",2),d([H],Ir.prototype,"minSpacing",2),d([H],Ir.prototype,"maxSpacing",2);var WM=class extends OK{constructor(){super(...arguments),this.placement=void 0}};d([H],WM.prototype,"placement",2);var kt=class extends th{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new ig(tg.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 Ir,this.label=new WM}getStyle(e,t,i,o){const{fill:s,fills:a,defaultFill:n,fillMode:r,fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:u,lineDash:p,lineDashOffset:g}=this;return{fill:s??(e&&a.length===0?n:void 0)??GM(a,r,t,o,i),fillOpacity:l,stroke:c,strokeWidth:h,strokeOpacity:u,lineDash:p,lineDashOffset:g}}};d([H],kt.prototype,"min",2),d([H],kt.prototype,"max",2),d([H],kt.prototype,"fills",2),d([H],kt.prototype,"fillMode",2),d([H],kt.prototype,"fill",2),d([H],kt.prototype,"fillOpacity",2),d([H],kt.prototype,"stroke",2),d([H],kt.prototype,"strokeWidth",2),d([H],kt.prototype,"strokeOpacity",2),d([H],kt.prototype,"lineDash",2),d([H],kt.prototype,"lineDashOffset",2),d([H],kt.prototype,"defaultFill",2),d([H],kt.prototype,"interval",2),d([H],kt.prototype,"label",2);var oh=class extends en{constructor(){super(...arguments),this.placement="inside-center",this.avoidCollisions=!0}};d([H],oh.prototype,"text",2),d([H],oh.prototype,"placement",2),d([H],oh.prototype,"avoidCollisions",2);var It=class extends wK{constructor(){super(...arguments),this.value=0,this.segmentation=new kr,this.defaultColorRange=[],this.targets=new ig(gt),this.defaultTarget=new gt,this.defaultScale=new kt,this.direction="vertical",this.thickness=1,this.cornerRadius=0,this.cornerMode="container",this.margin=0,this.scale=new kt,this.bar=new di,this.label=new oh,this.tooltip=TK()}};d([H],It.prototype,"value",2),d([H],It.prototype,"segmentation",2),d([H],It.prototype,"defaultColorRange",2),d([H],It.prototype,"targets",2),d([H],It.prototype,"defaultTarget",2),d([H],It.prototype,"defaultScale",2),d([H],It.prototype,"direction",2),d([H],It.prototype,"thickness",2),d([H],It.prototype,"cornerRadius",2),d([H],It.prototype,"cornerMode",2),d([H],It.prototype,"margin",2),d([H],It.prototype,"scale",2),d([H],It.prototype,"bar",2),d([H],It.prototype,"label",2),d([H],It.prototype,"tooltip",2);function GM(e,t,i,o,s){return{type:"gradient",gradient:"linear",colorSpace:"oklch",colorStops:EK(e,i,o.domain,t),rotation:s?90:0,bounds:"series"}}import{_ModuleSupport as PK}from"ag-charts-community";import{cachedTextMeasurer as RK,isArray as _K,measureTextSegments as zK,toPlainText as BK,toTextString as VK}from"ag-charts-core";var{BBox:FK}=PK;function og(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 HK(e,t){if(t==null)return!0;const i=og(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,u=t.y+t.height;return Math.max(s,l)<=Math.min(n,c)&&Math.max(a,h)<=Math.min(r,u)}function sg(e){const{clipX0:t,clipX1:i,clipY0:o,clipY1:s}=e;return t!=null&&i!=null||o!=null&&s!=null}function KK(e){if(!sg(e))return;const{x0:t,y0:i,x1:o,y1:s}=e,{x:a,y:n,width:r,height:l}=og(e);let{clipX0:c,clipX1:h,clipY0:u,clipY1:p}=e;(c==null||h==null)&&(c=t,h=o),(u==null||p==null)&&(u=i,p=s);const g=Math.min(c,h),m=Math.min(u,p),y=Math.abs(h-c),x=Math.abs(p-u);return c=Math.max(a,g),u=Math.max(n,m),h=Math.min(a+r,g+y),p=Math.min(n+l,m+x),new FK(Math.min(c,h),Math.min(u,p),Math.abs(h-c),Math.abs(p-u))}function jM(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:u,clipY0:p,clipX1:g,clipY1:m}=n??a;const{horizontalInset:y,verticalInset:x}=a,f=n!=null&&sg(n),b=sg(a);return f&&b||(!f&&b?({x0:r,y0:l,x1:c,y1:h,clipX0:u,clipY0:p,clipX1:g,clipY1:m}=a,e&&(t?g=a.clipX0:m=a.clipY0)):f&&!b?({x0:r,y0:l,x1:c,y1:h}=a,u=void 0,p=void 0,g=void 0,m=void 0):e&&(t?c=r:h=l)),{x0:r,y0:l,x1:c,y1:h,clipX0:u,clipY0:p,clipX1:g,clipY1:m,horizontalInset:y,verticalInset:x,phase:i}},toFn(s,a){const{x0:n,y0:r,x1:l,y1:c,clipX0:h,clipY0:u,clipX1:p,clipY1:g,horizontalInset:m,verticalInset:y}=a;return{x0:n,y0:r,x1:l,y1:c,clipX0:h,clipY0:u,clipX1:p,clipY1:g,horizontalInset:m,verticalInset:y}},applyFn(s,a){s.setProperties(Ar(s,a))}}}}function Ar(e,t){const{x:i,y:o,width:s,height:a}=og(t),n=KK(t),r=HK(t,n);return{x:i,y:o,width:s,height:a,clipBBox:n,visible:r}}var WK={Before:"right",Center:"center",After:"left"},GK={Before:"top",Center:"middle",After:"bottom"},jK={Before:-1,Center:-.5,After:0},$K={Before:0,Center:-.5,After:-1};function UK(e,t,i,o,s,a){const{seriesRect:n,gaugeRect:r,barRect:l}=s,{padding:c,horizontal:h}=o;i.each((u,p)=>{const g=Dr(e.id,t,p,a?.label);let m,y;p.placement==="outside-start"?h?(m=r.x,y=n.height):(m=n.width,y=n.height-(r.y+r.height)):p.placement==="outside-end"?h?(m=n.width-(r.x+r.width),y=n.height):(m=n.width,y=r.y):p.avoidCollisions&&(m=r.width,y=r.height);let x;if(g==null)return;if(m!=null&&y!=null){const w=()=>({width:m,height:y,meta:null});x=lr(BK(g),p,{padding:c},w)?.[0]}else{const w=RK(p),{width:O,height:B}=_K(g)?zK(g,p):w.measureLines(VK(g));x={text:g,fontSize:p.fontSize,lineHeight:p.lineHeight??w.lineHeight(),width:O,height:B}}if(x==null){u.visible=!1;return}const f=h?r.x:r.y+r.height,b=h?r.x+r.width:r.y,S=h?l.x:l.y+l.height,v=h?l.x+l.width:l.y,M=p.spacing*(h?1:-1);let D,I,A,k;switch(p.placement){case"outside-start":D=-1/0,I=1/0,A=f-M,k="Before";break;case"outside-end":D=-1/0,I=1/0,A=b+M,k="After";break;case"inside-start":D=f,I=v,A=f+M,k="After";break;case"inside-end":D=v,I=b,A=b-M,k="Before";break;case"inside-center":D=f,I=b,A=(f+b)/2,k="Center";break;case"bar-inside":D=S,I=v,A=(S+v)/2,k="Center";break;case"bar-inside-end":D=S,I=v,A=v-M,k="Before";break;case"bar-outside-end":D=v,I=b,A=v+M,k="After";break;case"bar-end":D=-1/0,I=1/0,A=v,k="Center";break}const N=h?A:r.x+r.width/2,L=h?r.y+r.height/2:A;let T,P;h?(T=N+jK[k]*x.width,P=T+x.width):(T=L+$K[k]*x.height,P=T+x.height);const R=Math.min(T,P)>=Math.min(D,I)&&Math.max(T,P)<=Math.max(D,I);if(p.avoidCollisions&&!R){u.visible=!1;return}u.visible=!0,u.text=x.text,u.fontSize=x.fontSize,u.lineHeight=x.lineHeight,u.textAlign=h?WK[k]:"center",u.textBaseline=h?"middle":GK[k],u.x=N,u.y=L})}var{fromToMotion:ag,resetMotion:YK,SeriesNodePickMode:$M,createDatumId:UM,BBox:ro,Group:ua,PointerEvents:YM,Selection:pa,Rect:XK,Text:XM,TransformableText:ZK,Marker:QK,LinearScale:qK,generateTicks:JK,NiceMode:ZM}=Mn,eW={before:180,middle:0,after:0},tW={before:90,middle:0,after:-90},ng=class extends Mn.Series{constructor(e){super({moduleCtx:e,pickModes:[$M.EXACT_SHAPE_MATCH,$M.NEAREST_NODE]}),this.properties=new It,this.seriesRect=ro.NaN,this.gaugeRect=ro.NaN,this.scale=new qK,this.originX=0,this.originY=0,this.scaleGroup=this.contentGroup.appendChild(new ua({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new ua({name:"itemGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new ua({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new ua({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new ua({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new ua({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new ua({name:"tickGroup"})),this.scaleSelection=pa.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=pa.select(this.itemGroup,()=>this.nodeFactory()),this.targetSelection=pa.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=pa.select(this.itemTargetLabelGroup,XM),this.labelSelection=pa.select(this.itemLabelGroup,XM),this.highlightTargetSelection=pa.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=pa.select(this.tickGroup,ZK),this.datumUnion=new OM,this.animationState=new SK("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=YM.None,this.tickGroup.pointerEvents=YM.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 XK;return e.crisp=!0,e}markerFactory(){return new QK}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){return PM(e,this.properties.scale)}getShapeFillBBox(){const{properties:e,originX:t,originY:i,horizontal:o,scale:s}=this,{thickness:a}=e,n=vK(s.range),r=new ro(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:u=t.label.color??"black",fontStyle:p=t.label.fontStyle??"normal",fontWeight:g=t.label.fontWeight??"normal",fontSize:m=t.label.fontSize,fontFamily:y=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:u,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y,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:u}=e,p=a.convert(l);let g;switch(c){case"before":g=-(h+u/2);break;case"after":g=r+h+u/2;break;default:g=r/2;break}return{x:i+n.x+(s?p:g),y:o+n.y+(s?g:p)}}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,u=t/2+s;let p,g,m=0,y=0;return this.horizontal?(p="center",i==="after"?(g="top",y=u):(g="bottom",y=-u)):(g="middle",i==="before"?(p="right",m=-u):(p="left",m=u)),{offsetX:m,offsetY:y,fill:a,textAlign:p,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:u,lineHeight:p,wrapping:g,overflowStrategy:m,formatter:y=x=>this.formatLabel(x.value)}=e;return{series:this,datum:void 0,datumIndex:{type:0},placement:i,avoidCollisions:o,spacing:s,text:a,value:t,fill:n,fontSize:r,minimumFontSize:l,fontStyle:c,fontWeight:h,fontFamily:u,lineHeight:p,wrapping:g,overflowStrategy:m,formatter:y}}verticalLabelInset(){const{label:e}=this.properties,t=TM(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=TM(o),n=i.interval.values??e.ticks({nice:[!1,!1],interval:i.interval.step,minTickCount:0,maxTickCount:6,tickCount:5})?.ticks??[],l=(s??n?.map(c=>Dr(this.id,this.ctx,this.labelDatum(o,c))??"")).reduce((c,h)=>{const{width:u}=MK(h)?DK(h,o):a.measureLines(IK(h));return Math.max(c,u)},0);return o.spacing+l}tickFormatter(e,t){const{format:i,formatter:o}=this.properties.scale.label;let s;return i!=null&&(s=kK(t,typeof i=="string"?i:void 0)),(a,n)=>{let r;return o&&(r??(r=Sr(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:u,label:p,defaultColorRange:g,defaultScale:m}=t;o.domain=[u.min,u.max],o.range=i?[0,s.width]:[s.height,0];let y,x;i?(x=1,y=Math.PI/-2):u.label.placement==="before"?(x=1,y=0):(x=-1,y=0);let f,b,S,v;i?(f=0,b=s.width,S=(s.height-r)/2,v=S+r,p.placement==="outside-start"?f+=this.horizontalLabelInset():p.placement==="outside-end"&&(b-=this.horizontalLabelInset())):(f=(s.width-r)/2,b=f+r,v=0,S=s.height,p.placement==="outside-start"?S-=this.verticalLabelInset():p.placement==="outside-end"&&(v+=this.verticalLabelInset())),this.gaugeRect=new ro(Math.min(f,b),Math.min(S,v),Math.abs(b-f),Math.abs(v-S));const M=0,D=0;o.domain=[u.min,u.max],o.range=i?[f,b]:[S,v];const I=wM({parallel:i},u.label,m.label),{tickData:{ticks:A}}=JK({scale:o,label:I,interval:u.interval,tickFormatter:(se,Q)=>this.tickFormatter(se,Q),domain:o.domain,range:this.range,reverse:!1,primaryTickCount:void 0,defaultTickMinSpacing:0,visibleRange:[0,1],niceMode:[ZM.Off,ZM.Off],labelOffset:0,axisRotation:y,sideFlag:x}),k=!1,N=this.getTargets(),L=[],T=[],P=[],R=[],[w,O]=o.range,B=Math.abs(O-w),E=i?o.convert(a):b,C=i?v:o.convert(a),_=n.enabled?n.spacing/2:0,z=i?_:0,K=i?0:_,F=Math.min(h.thickness??Math.round(h.thicknessRatio*r),r),Z=-(r-F)/2,G=i?0:Z,$=i?Z:0,J=c==="item",ae=Math.ceil(B);let ne=n.enabled?n.interval.getSegments(o,ae):void 0;const he=h.getStyle(g,i,o),Ae=u.getStyle(h.enabled,g,i,o);if(ne==null&&J){const se=Math.min(...o.domain),Q=Math.max(...o.domain),_e={value:a,segmentStart:se,segmentEnd:Q};if(h.enabled){const at=Math.min(l,F/2,B/2)*(k?-1:1),Yt=i?at:0,Le=i?0:at;L.push({series:this,itemId:"value",datum:_e,datumIndex:{type:0},type:0,x0:M+f-Yt-G,y0:D+S-Le-$,x1:M+E+Yt+G,y1:D+C+Le+$,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:z,verticalInset:K,style:he})}const le=Math.min(l,r/2,B/2)*(k?-1:1),ue=i?le:0,ee=i?0:le;R.push({series:this,itemId:"scale",datum:_e,datumIndex:{type:0},type:0,x0:M+f-ue,y0:D+S-ee,x1:M+b+ue,y1:D+v+ee,clipX0:void 0,clipY0:void 0,clipX1:void 0,clipY1:void 0,topLeftCornerRadius:l,topRightCornerRadius:l,bottomRightCornerRadius:l,bottomLeftCornerRadius:l,horizontalInset:z,verticalInset:K,style:Ae})}else{ne??(ne=o.domain);const se=M+f-G,Q=D+S-$,_e=M+E+G,Je=D+C+$;for(let le=0;leUM(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:u}=r;n.setStyleProperties(r.style,s),n.topLeftCornerRadius=l,n.topRightCornerRadius=c,n.bottomRightCornerRadius=h,n.bottomLeftCornerRadius=u,n.pointerEvents=this.properties.bar.enabled?Mn.PointerEvents.All:Mn.PointerEvents.None,(o||n.previousDatum==null)&&n.setProperties(Ar(n,r))});const{horizontal:a}=this;this.datumUnion.update(t,this.itemGroup,Mn.Rect,(n,r,l)=>{const c=Math.min(r.x,l.x),h=Math.max(r.x+r.width,l.x+l.width),u=Math.min(r.y,l.y),p=Math.max(r.y+r.height,l.y+l.height),g=h-c,m=p-u;n.pointerEvents=Mn.PointerEvents.None,n.x=c,n.y=u,n.width=g,n.height=m,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,x=l.clipBBox??y;y&&x?n.clipBBox=ro.merge([y,x]).intersection(a?new ro(c,-1/0,g,1/0):new ro(-1/0,u,1/0,m)):n.clipBBox=void 0})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>UM(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;o.setStyleProperties(s.style,i),o.setProperties(Ar(o,s)),o.topLeftCornerRadius=a,o.topRightCornerRadius=n,o.bottomRightCornerRadius=r,o.bottomLeftCornerRadius=l,o.setProperties(Ar(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);o.setStyleProperties(h),o.size=l,o.shape=r==="line"?RM:r,o.translationX=a,o.translationY=n,o.rotation=c})}getTargetStyle(e,{datumIndex:t,style:i}){const o=this.getHighlightStyle(e,t);return wM(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:u,fontSize:p,fontFamily:g,textAlign:m,textBaseline:y}=o.label;i.visible=!0,i.x=s+r,i.y=a+l,i.text=n,i.fill=c,i.fontStyle=h,i.fontWeight=u,i.fontSize=p,i.fontFamily=g,i.textAlign=m,i.textBaseline=y})}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=o.label.color,fontFamily:n=o.label.fontFamily,fontSize:r=o.label.fontSize,fontStyle:l,fontWeight:c=o.label.fontWeight,spacing:h}=i.scale.label;let{placement:u}=i.scale.label;const p=CM(i.scale.label.rotation??0);let g,m,y,x;this.horizontal?(u??(u="after"),g="center",m=u==="before"?"bottom":"top",x=this.originY+t.y+(u==="before"?-h:t.height+h)):(u??(u="before"),g=u==="before"?"end":"start",m="middle",y=this.originX+t.x+(u==="before"?-h:t.width+h)),e.tickSelection.each((f,b)=>{if(!s){f.visible=!1;return}const S=y??b.translation,v=x??b.translation;f.visible=!0,f.text=b.tickLabel,f.fill=a,f.fontFamily=n,f.fontSize=r,f.fontStyle=l,f.fontWeight=c,f.textBaseline=m,f.textAlign=g,f.x=S,f.y=v,f.rotationCenterX=S,f.rotationCenterY=v,f.rotation=p})}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 u;if(i){const m=o.convert(h);u=new ro(n,r,m-n,c)}else{const m=o.convert(h);u=new ro(n,m,l,c-m)}const p={seriesRect:s,gaugeRect:a,barRect:u},{margin:g}=this.properties;UK(this,this.ctx,t,{padding:g,horizontal:i},p,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),YK([this.datumSelection],Ar),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:bK,onUpdate:a=>this.formatLabelText(a),onStop:()=>this.formatLabelText({label:o})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=jM(!0,this.horizontal);ag(this.id,"node",e,[this.datumSelection],t,(i,o)=>o.itemId),ag(this.id,"label",e,[this.labelSelection],EM,()=>"primary"),this.animateLabelText({from:0,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t}=jM(!1,this.horizontal);ag(this.id,"node",e,[this.datumSelection],t,(i,o)=>o.itemId),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}getSeriesDomain(){return{domain:[0,1]}}dataCount(){return Number.NaN}getSeriesRange(){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 BM(this,e)}pickFocus(e){return VM(this,e)}getCaptionText(){return this.formatLabel(this.properties.value)}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};ng.className="LinearGaugeSeries",ng.type="linear-gauge";var iW={minWidth:200,minHeight:200,tooltip:{enabled:!1},series:{thickness:50,defaultColorRange:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$interpolate:[{$palette:"secondDivergingColors"},5]},sK]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",aK,{$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:{...oK,enabled:!1,placement:"inside-start",fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:2},minimumFontSize:iK.SMALL,spacing:18,color:{$ref:"chartBackgroundColor"}},margin:4,tooltip:{range:{$path:["/tooltip/range",10]}}}},QM={type:"series",name:"linear-gauge",chartType:"standalone",enterprise:!0,dependencies:[LM],version:tK,options:nK,themeTemplate:iW,create:e=>new ng(e)};import{VERSION as oW}from"ag-charts-community";import{LABEL_BOXING_DEFAULTS as sW,MULTI_SERIES_HIGHLIGHT_STYLE as aW,SAFE_RANGE2_OPERATION as nW,SAFE_STROKE_FILL_OPERATION as rW}from"ag-charts-core";import{VERSION as lW,_ModuleSupport as cW}from"ag-charts-community";import{_ModuleSupport as sh}from"ag-charts-community";import{ChartAxisDirection as qM,Property as hW,createId as JM}from"ag-charts-core";var{Chart:dW,MercatorScale:eD}=sh;function uW(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 ah=class extends dW{constructor(e,t){super(e,t),this.xAxis={id:JM(sh.Axis),direction:qM.X},this.yAxis={id:JM(sh.Axis),direction:qM.Y},this.ctx.zoomManager.setAxes([this.xAxis,this.yAxis]),this.ctx.zoomManager.panToBBoxScalingMode=sh.PanToBBoxScalingModeEnum.WhenViewportTooSmallScaleXYProportionally}getChartType(){return"topology"}updateData(){super.updateData();const e=this.getOptions();this.topology!==e.topology&&(this.topology=e.topology);const{topology:t}=this;for(const i of this.series)uW(i)&&i.setChartTopology(t)}performLayout(e){const{seriesRoot:t,annotationRoot:i}=this,o=e.layoutBox.clone().shrink(this.seriesArea.getPadding());this.seriesRect=o,this.animationRect=o;const s=this.series,a=s.reduce((l,c)=>{if(!c.visible)return l;const h=c.topologyBounds;return h==null?l:l==null?h:l.merge(h)},void 0);let n;if(a!=null){const{lon0:l,lat0:c,lon1:h,lat1:u}=a,p=[[l,c],[h,u]],g=eD.bounds(p),{width:m,height:y}=o,x=Math.min(m/g.width,y/g.height),f=g.width*x,b=g.height*x,S=(m-f)/2,v=(y-b)/2,M=S,D=v,I=S+f,A=v+b,k=this.ctx.zoomManager.getAxisZoom(this.xAxis.id),N=this.ctx.zoomManager.getAxisZoom(this.yAxis.id),L=(I-M)/(k.max-k.min),T=M-L*k.min,P=(A-D)/(1-N.min-(1-N.max)),R=D-P*(1-N.max);n=new eD(p,[[T,R],[T+L,R+P]])}for(const l of s)l.scale=n;const r=this.series.some(l=>l.visible);t.visible=r;for(const l of[t,i])l.translationX=Math.floor(o.x),l.translationY=Math.floor(o.y),l.setClipRect(o.clone());this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:r,rect:o,paddedRect:e.layoutBox},layoutBox:e.layoutBox})}hasPgUpPgDownSupport(){return!1}};ah.className="TopologyChart",ah.type="topology",d([hW],ah.prototype,"topology",2);var{topologyChartOptionsDefs:pW}=cW,Nr={type:"chart",name:"topology",enterprise:!0,version:lW,options:pW,create(e,t){return new ah(e,t)}};import{deepClone as gW,jsonWalk as mW}from"ag-charts-core";var Lr={zoom:{axes:"xy",anchorPointX:"pointer",anchorPointY:"pointer",buttons:{anchorPointX:"middle",anchorPointY:"middle"}},legend:{enabled:!1}};function lo(e){const t=gW(e);return mW(t,i=>{typeof i=="object"&&"$palette"in i&&(i.$mapPalette=i.$palette,delete i.$palette)}),t}import{_ModuleSupport as tD}from"ag-charts-community";import{Logger as iD,cachedTextMeasurer as yW,mergeDefaults as oD}from"ag-charts-core";import{_ModuleSupport as fW}from"ag-charts-community";import{SceneChangeDetection as xW,SceneObjectChangeDetection as SW,objectsEqual as bW}from"ag-charts-core";var vW=1e-9;function sD(e,t,i,o){const[s,a]=e,[n,r]=t,l=n-s,c=r-a,h=l*l+c*c;let u,p;if(Math.abs(h)t){const h=(t-s)/l,u=[i+(n-i)*h,o+(r-o)*h],p=Math.atan2(r-o,n-i);return{point:u,angle:p}}s=c,i=n,o=r}}var Tr=class cA{constructor(t,i,o,s){this.lon0=t,this.lat0=i,this.lon1=o,this.lat1=s}extend(t,i,o,s){return this.lon0=Math.min(this.lon0,t),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,o),this.lat1=Math.max(this.lat1,s),this}merge(t){return this.extend(t.lon0,t.lat0,t.lon1,t.lat1)}static extend(t,i,o,s,a){return t?t.extend(i,o,s,a):new cA(i,o,s,a)}};function kn(e,t){for(const i of e){const[o,s]=i;t=Tr.extend(t,o,s,o,s)}return t}function MW(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 rh(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,u]=c;u>i!=l>i&&t<(r-h)*(i-u)/(l-u)+h&&(o=!o),s=Math.min(s,sD(n,c,t,i)),n=c,r=h,l=u}}return(o?-1:1)*Math.sqrt(s)}var{Path:DW,ExtendedPath2D:kW,BBox:IW}=fW,In=class extends DW{constructor(){super(...arguments),this.projectedGeometry=void 0,this.renderMode=3,this.strokePath=new kW}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(rh(c,t,i),0)),1/0):1/0;case"Polygon":return a?Math.max(rh(e.coordinates,t,i),0):1/0;case"MultiLineString":return n?e.coordinates.reduce((l,c)=>Math.min(l,Math.max(aD(c,t,i)-r,0)),1/0):1/0;case"LineString":return n?Math.max(aD(e.coordinates,t,i)-r,0):1/0;case"MultiPoint":case"Point":default:return 1/0}}shouldDrawPolygons(){return(this.renderMode&1)!==0}shouldDrawLines(){return(this.renderMode&2)!==0}drawGeometryCollection(e,t){for(const i of e)t=this.drawGeometry(i,t);return t}drawMultiPolygon(e,t){if(!this.shouldDrawPolygons())return t;for(const i of e)t=this.drawPolygon(this.path,i,t);return t}drawSinglePolygon(e,t){return this.shouldDrawPolygons()?this.drawPolygon(this.path,e,t):t}drawMultiLineString(e,t){if(!this.shouldDrawLines())return t;for(const i of e)t=this.drawLineString(this.strokePath,i,t,!1);return t}drawSingleLineString(e,t){return this.shouldDrawLines()?this.drawLineString(this.strokePath,e,t,!1):t}drawGeometry(e,t){switch(e.type){case"GeometryCollection":return this.drawGeometryCollection(e.geometries,t);case"MultiPolygon":return this.drawMultiPolygon(e.coordinates,t);case"Polygon":return this.drawSinglePolygon(e.coordinates,t);case"MultiLineString":return this.drawMultiLineString(e.coordinates,t);case"LineString":return this.drawSingleLineString(e.coordinates,t);case"Point":case"MultiPoint":return t}}drawPolygon(e,t,i){if(t.length<1)return i;i=this.drawLineString(e,t[0],i,!0);for(let o=1;oi)&&(i=a,o=s)}return o}function An(e,t){if(e.bbox!=null){const[i,o,s,a]=e.bbox;return t=Tr.extend(t,i,o,s,a),t}switch(e.type){case"GeometryCollection":for(const i of e.geometries)t=An(i,t);break;case"MultiPolygon":for(const i of e.coordinates)i.length>0&&(t=kn(i[0],t));break;case"Polygon":e.coordinates.length>0&&(t=kn(e.coordinates[0],t));break;case"MultiLineString":for(const i of e.coordinates)t=kn(i,t);break;case"LineString":t=kn(e.coordinates,t);break;case"MultiPoint":for(const i of e.coordinates){const[o,s]=i;t=Tr.extend(t,o,s,o,s)}break;case"Point":{const[i,o]=e.coordinates;t=Tr.extend(t,i,o,i,o);break}}return t}function ch(e){switch(e.type){case"Polygon":return e.coordinates;case"MultiPolygon":return lh(e.coordinates,nD);case"GeometryCollection":{const t=e.geometries.map(ch).filter(i=>i!=null);return lh(t,nD)}case"MultiLineString":case"LineString":case"MultiPoint":case"Point":return}}function hh(e){switch(e.type){case"LineString":return e.coordinates;case"MultiLineString":return lh(e.coordinates,rg);case"GeometryCollection":{const t=e.geometries.map(hh).filter(i=>i!=null);return lh(t,rg)}case"MultiPolygon":case"Polygon":case"MultiPoint":case"Point":return}}function lg(e,t){if(e==null)return!1;switch(e.type){case"GeometryCollection":return e.geometries.some(i=>lg(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 ga(e,t){switch(e.type){case"GeometryCollection":return{type:"GeometryCollection",geometries:e.geometries.map(i=>ga(i,t))};case"Polygon":return{type:"Polygon",coordinates:cg(e.coordinates,t)};case"MultiPolygon":return{type:"MultiPolygon",coordinates:AW(e.coordinates,t)};case"MultiLineString":return{type:"MultiLineString",coordinates:cg(e.coordinates,t)};case"LineString":return{type:"LineString",coordinates:hg(e.coordinates,t)};case"MultiPoint":return{type:"MultiPoint",coordinates:hg(e.coordinates,t)};case"Point":return{type:"Point",coordinates:t.convert(e.coordinates)}}}function AW(e,t){return e.map(i=>cg(i,t))}function cg(e,t){return e.map(i=>hg(i,t))}function hg(e,t){return e.map(i=>t.convert(i))}function NW(){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 rD(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 lD}from"ag-charts-community";var aee=class extends lD.SeriesProperties{},wr=class extends lD.DataModelSeries{constructor(e){super(e),this.cleanup.register(this.ctx.eventsHub.on("data:update",()=>{}),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{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getHighlightedDatum(){let e=this.ctx.highlightManager?.getActiveHighlight();const{legendItemName:t}=this.properties,i=t!=null&&e?.datum==null&&t===e?.legendItemName;return e!=null&&(e.series!==this&&!i||e.datum==null)&&(e=void 0),e}isSeriesHighlighted(e){if(!this.properties.highlight.enabled)return!1;const{series:t,legendItemName:i}=e??{},{legendItemName:o}=this.properties;return t===this||o!=null&&o===i}};import{_ModuleSupport as LW}from"ag-charts-community";import{Property as De}from"ag-charts-core";var{SeriesProperties:TW,makeSeriesTooltip:wW,Label:CW}=LW,ye=class extends TW{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 CW,this.tooltip=wW()}getStyle(){const{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:o,lineDashOffset:s}=this;return{stroke:e,strokeOpacity:t,strokeWidth:i,lineDash:o,lineDashOffset:s,opacity:1}}};d([De],ye.prototype,"topology",2),d([De],ye.prototype,"title",2),d([De],ye.prototype,"legendItemName",2),d([De],ye.prototype,"idKey",2),d([De],ye.prototype,"topologyIdKey",2),d([De],ye.prototype,"idName",2),d([De],ye.prototype,"labelKey",2),d([De],ye.prototype,"labelName",2),d([De],ye.prototype,"sizeKey",2),d([De],ye.prototype,"sizeName",2),d([De],ye.prototype,"colorKey",2),d([De],ye.prototype,"colorName",2),d([De],ye.prototype,"sizeDomain",2),d([De],ye.prototype,"colorRange",2),d([De],ye.prototype,"maxStrokeWidth",2),d([De],ye.prototype,"stroke",2),d([De],ye.prototype,"strokeOpacity",2),d([De],ye.prototype,"strokeWidth",2),d([De],ye.prototype,"lineDash",2),d([De],ye.prototype,"lineDashOffset",2),d([De],ye.prototype,"itemStyler",2),d([De],ye.prototype,"label",2),d([De],ye.prototype,"tooltip",2);var{getMissCount:OW,getLabelStyles:EW,createDatumId:cD,SeriesNodePickMode:hD,valueProperty:Cr,ColorScale:PW,LinearScale:RW,Selection:dh,Text:dD,Transformable:_W}=tD,dg=class extends wr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[hD.EXACT_SHAPE_MATCH,hD.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new ye,this._chartTopology=void 0,this.colorScale=new PW,this.sizeScale=new RW,this.datumSelection=dh.select(this.contentGroup,()=>this.nodeFactory()),this.labelSelection=dh.select(this.labelGroup,dD),this.highlightDatumSelection=dh.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=dh.select(this.highlightLabelGroup,dD),this.placedLabelData=[],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=[4,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 In;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:u}=this.properties,p=new Map;for(const S of i?.features.values()??[]){const v=S.properties?.[a];v==null||!lg(S.geometry,2)||p.set(v,S)}const g=this.sizeScale.type,m=this.colorScale.type,y=this.scale?.type,{dataModel:x,processedData:f}=await this.requestDataModel(e,t,{props:[Cr(n,y,{id:"idValue",includeProperty:!1}),Cr(n,y,{id:"featureValue",includeProperty:!1,processor:()=>S=>p.get(S)}),...c==null?[]:[Cr(c,"category",{id:"labelValue"})],...r==null?[]:[Cr(r,g,{id:"sizeValue"})],...l==null?[]:[Cr(l,m,{id:"colorValue"})]]}),b=x.resolveColumnById(this,"featureValue",f);if(this.topologyBounds=b.reduce((S,v)=>{const M=v?.geometry;return M==null?S:An(M,S)},void 0),r!=null){const S=x.resolveProcessedDataIndexById(this,"sizeValue"),v=f.domain.values[S]??[];o.domain=h??v}if(u!=null&&this.isColorScaleValid()){const S=x.resolveProcessedDataIndexById(this,"colorValue");s.domain=f.domain.values[S],s.range=u,s.update()}i==null&&iD.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=OW(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelDatum(e,t,i,o,s,a){if(o==null||s==null||i==null)return;const n=hh(s);if(n==null)return;const{idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:u,colorName:p,labelKey:g,labelName:m,label:y}=this.properties;if(g==null||!y.enabled)return;const x=this.getLabelText(o,e,g,"label",[],y,{value:o,datum:e,idKey:r,idName:l,sizeKey:c,sizeName:h,colorKey:u,colorName:p,labelKey:g,labelName:m});if(x==null)return;const f=a.measureLines(String(x)),b=nh(n);if(b==null)return;const[S,v]=b.point,{width:M,height:D}=f;return{point:{x:S,y:v,size:0},label:{width:M,height:D,text:x},anchor:void 0,placement:void 0,datumIndex:t,idValue:i}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveLineDataColumns(e){const{sizeKey:t,colorKey:i,labelKey:o}=this.properties;return{idValues:this.dataModel.resolveColumnById(this,"idValue",e),featureValues:this.dataModel.resolveColumnById(this,"featureValue",e),labelValues:this.resolveColumn(o,"labelValue",e),sizeValues:this.resolveColumn(t,"sizeValue",e),colorValues:this.resolveColumn(i,"colorValue",e)}}prepareProjectedLineGeometries(e,t,i){const o=new Map;for(const[s]of i.dataSources.get(this.id)?.data.entries()??[]){const a=e[s],n=t[s]?.geometry,r=n!=null&&this.scale!=null?ga(n,this.scale):void 0;a!=null&&r!=null&&o.set(a,r)}return o}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}iD.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:o,properties:s}=this,{label:a,legendItemName:n,colorKey:r}=s;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const l=this.resolveLineDataColumns(i),c=s.maxStrokeWidth??s.strokeWidth;o.range=[Math.min(s.strokeWidth,c),c];const h=yW(a),u=this.prepareProjectedLineGeometries(l.idValues,l.featureValues,i),p=[],g=[],m=[],y=i.dataSources.get(this.id)?.data??[];for(const[x,f]of y.entries()){const b={idValue:l.idValues[x],colorValue:l.colorValues?.[x],sizeValue:l.sizeValues?.[x],labelValue:l.labelValues?.[x]},S=u.get(b.idValue);if(S==null&&m.push(b.idValue),r!=null&&b.colorValue==null)continue;const v=this.getLabelDatum(f,x,b.idValue,b.labelValue,S,h);v!=null&&g.push(v),p.push({series:this,datum:f,datumIndex:x,...b,projectedGeometry:S,legendItemName:n,style:this.getItemStyle({datumIndex:x,datum:f,colorValue:b.colorValue,sizeValue:b.sizeValue},!1)})}return this.warnMissingGeometries(m),{itemId:e,nodeData:p,labelData:g}}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;const i=this.ctx.chartService.highlight?.drawingMode??"overlay",o=this.getHighlightedDatum(),s=this.contextNodeData?.nodeData??[];this.datumSelection=this.updateDatumSelection({nodeData:s,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,isHighlight:!1,drawingMode:"overlay"}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:o==null?[]:[o],datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!0}),this.updateDatumNodes({datumSelection:t,isHighlight:!0,drawingMode:i}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(o)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>cD(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=a.getStyle();i!=null&&(h.stroke=this.isColorScaleValid()?n.convert(i):l?.[0]??a.stroke);const u=this.getHighlightStyle(s,e),p=oD(u,h);o!=null&&(p.strokeWidth=r.convert(o,{clamp:!0}));let g;return c!=null&&(g=this.cachedDatumCallback(cD(e,s?"highlight":"node"),()=>{const m=this.makeItemStylerParams(t,e,s,p);return this.callWithContext(c,m)})),g?oD(p,g):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,highlightState:n,...o}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){e.each((i,o)=>{const{projectedGeometry:s,style:a}=o;if(s==null){i.visible=!1,i.projectedGeometry=void 0;return}i.visible=!0,i.projectedGeometry=s,i.setProperties(a),i.drawingMode=t})}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=tD.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,o=this.getHighlightedDatum();t.each((s,a)=>{const{x:n,y:r,width:l,height:c,text:h,datum:u}=a,p=EW(this,void 0,i,i.label,e,o),{color:g,fontStyle:m,fontWeight:y,fontSize:x,fontFamily:f}=p;s.visible=!0,s.x=n+l/2,s.y=r+c/2,s.text=h,s.fill=g,s.fontStyle=m,s.fontWeight=y,s.fontSize=x,s.fontFamily=f,s.textAlign="center",s.textBaseline="middle";const b=u?.datumIndex;s.fillOpacity=this.getHighlightStyle(e,b).opacity??1,s.setBoxing(p)})}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=e?.idValue,i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(o=>o.datum.idValue===t);this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0&&this.highlightLabelSelection.cleanup(),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}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 dg(e)};import{VERSION as YW}from"ag-charts-community";import{_ModuleSupport as XW}from"ag-charts-community";import{Logger as ZW}from"ag-charts-core";import{_ModuleSupport as QW}from"ag-charts-community";import{Property as ma}from"ag-charts-core";var{SeriesProperties:qW,makeSeriesTooltip:JW}=QW,Ms=class extends qW{constructor(){super(...arguments),this.topology=void 0,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0,this.lineDash=[0],this.lineDashOffset=0,this.tooltip=JW()}};d([ma],Ms.prototype,"topology",2),d([ma],Ms.prototype,"stroke",2),d([ma],Ms.prototype,"strokeOpacity",2),d([ma],Ms.prototype,"strokeWidth",2),d([ma],Ms.prototype,"lineDash",2),d([ma],Ms.prototype,"lineDashOffset",2),d([ma],Ms.prototype,"tooltip",2);var{createDatumId:eG,Group:tG,Selection:iG,PointerEvents:mD}=XW,ug=class extends wr{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new Ms,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new tG({name:"itemGroup"})),this.datumSelection=iG.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=mD.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 In;return e.renderMode=2,e.lineJoin="round",e.lineCap="round",e.pointerEvents=mD.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const o=i.geometry;return o==null?t:An(o,t)},void 0),e==null&&ZW.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[u,p]of t.features.entries()){const{geometry:g}=p,m=g!=null&&i!=null?ga(g,i):void 0;m!=null&&c.push({series:this,datum:p,datumIndex:0,index:u,projectedGeometry:m,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=>eG(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}};ug.className="MapLineBackgroundSeries",ug.type="map-line-background";import{_ModuleSupport as oG}from"ag-charts-community";import{constant as sG,geoJson as aG,required as nG}from"ag-charts-core";var{mapLineBackgroundSeriesThemeableOptionsDef:rG}=oG,lG={...rG,type:nG(sG("map-line-background")),topology:aG},yD={type:"series",name:"map-line-background",chartType:"topology",enterprise:!0,version:YW,dependencies:[Nr],options:lG,themeTemplate:{...Lr,series:{stroke:{$path:["/1",{$mapPalette:"stroke"},{$mapPalette:"secondHierarchyColors"}]},strokeWidth:1,lineDash:[0],lineDashOffset:0}},create:e=>new ug(e)};import{VERSION as cG}from"ag-charts-community";import{FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as hG,FILL_IMAGE_DEFAULTS as dG,FILL_PATTERN_DEFAULTS as uG,LABEL_BOXING_DEFAULTS as pG,MULTI_SERIES_HIGHLIGHT_STYLE as gG,SAFE_RANGE2_OPERATION as mG,ValidationError as yG,validate as fG}from"ag-charts-core";import{_ModuleSupport as fD}from"ag-charts-community";import{Logger as xG,StateMachine as SG,cachedTextMeasurer as bG,mergeDefaults as xD}from"ag-charts-core";import{insertListItemsSorted as vG}from"ag-charts-core";function SD(e,t,i){const o=kn(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=MW(e[0]),[c,h]=l,u=-rh(e,c,h);let p;const g=(M,D)=>{const A=Math.max(D-u,0);return M-.5*A},m=(M,D,I)=>{const{distance:A,maxDistance:k}=i(e,M,D,I),N=Math.hypot(c-M,h-D),L=Math.min(Math.max(c,M-I/2),M+I/2),T=Math.min(Math.max(h,D-I/2),D+I/2),P=Math.hypot(c-L,h-T),R=g(A,N),w=g(k,P);return{distance:A,maxDistance:k,value:R,maxValue:w,x:M,y:D,stride:I}},y=(M,D,I,A)=>{const k=m(D,I,A);k.maxDistance>=0&&M.push(k)},x=Math.min(n,r)/2;let f={value:m(s,a,x),next:null};for(;f!=null;){const M=f.value,{distance:D,value:I,maxValue:A,x:k,y:N,stride:L}=M;if(f=f.next,D>0&&(p==null||I>p.value)&&(p=M),p!=null&&A-p.value<=t)continue;const T=L/2,P=[];y(P,k-T,N-T,T),y(P,k+T,N-T,T),y(P,k-T,N+T,T),y(P,k+T,N+T,T),P.sort(bD),f=vG(f,P,bD)}if(p==null)return;const{distance:b,x:S,y:v}=p;return{x:S,y:v,distance:b}}var bD=(e,t)=>t.maxValue-e.maxValue;function pg(e,t){const i=SD(e,t,(a,n,r,l)=>{const c=-rh(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 vD(e,t){let i;switch(e.type){case"GeometryCollection":return e.geometries.flatMap(o=>vD(o,t));case"MultiPoint":return e.coordinates;case"Point":return[e.coordinates];case"MultiPolygon":{const o=ch(e);i=o==null?void 0:pg(o,t);break}case"Polygon":{const o=e.coordinates;i=o==null?void 0:pg(o,t);break}case"MultiLineString":{const o=hh(e);i=o==null?void 0:nh(o)?.point;break}case"LineString":{const o=e.coordinates;i=nh(o)?.point;break}}return i==null?[]:[i]}import{_ModuleSupport as MG}from"ag-charts-community";var{BBox:DG}=MG;function MD(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 DG(i,o,s,a);return{series:n,axis:n}}import{_ModuleSupport as kG}from"ag-charts-community";import{Property as ie}from"ag-charts-core";var{SeriesProperties:IG,makeSeriesTooltip:AG,Label:NG}=kG,DD=class extends NG{constructor(){super(...arguments),this.placement="bottom"}};d([ie],DD.prototype,"placement",2);var oe=class extends IG{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 DD,this.tooltip=AG()}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([ie],oe.prototype,"topology",2),d([ie],oe.prototype,"title",2),d([ie],oe.prototype,"legendItemName",2),d([ie],oe.prototype,"idKey",2),d([ie],oe.prototype,"topologyIdKey",2),d([ie],oe.prototype,"idName",2),d([ie],oe.prototype,"latitudeKey",2),d([ie],oe.prototype,"latitudeName",2),d([ie],oe.prototype,"longitudeKey",2),d([ie],oe.prototype,"longitudeName",2),d([ie],oe.prototype,"labelKey",2),d([ie],oe.prototype,"labelName",2),d([ie],oe.prototype,"sizeKey",2),d([ie],oe.prototype,"sizeName",2),d([ie],oe.prototype,"colorKey",2),d([ie],oe.prototype,"colorName",2),d([ie],oe.prototype,"colorRange",2),d([ie],oe.prototype,"shape",2),d([ie],oe.prototype,"size",2),d([ie],oe.prototype,"maxSize",2),d([ie],oe.prototype,"sizeDomain",2),d([ie],oe.prototype,"fill",2),d([ie],oe.prototype,"fillOpacity",2),d([ie],oe.prototype,"stroke",2),d([ie],oe.prototype,"strokeWidth",2),d([ie],oe.prototype,"strokeOpacity",2),d([ie],oe.prototype,"lineDash",2),d([ie],oe.prototype,"lineDashOffset",2),d([ie],oe.prototype,"itemStyler",2),d([ie],oe.prototype,"label",2),d([ie],oe.prototype,"tooltip",2);var{fromToMotion:LG,getMissCount:TG,createDatumId:uh,SeriesNodePickMode:kD,valueProperty:ya,computeMarkerFocusBounds:wG,ColorScale:CG,LinearScale:OG,Group:EG,Selection:ph,Text:ID,Marker:gg,getLabelStyles:PG}=fD,mg=class extends wr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{size:["colorKey"],color:["colorKey"],label:["labelKey"]},propertyNames:{size:["sizeName"],color:["colorName"],label:["labelName"]},pickModes:[kD.EXACT_SHAPE_MATCH,kD.NEAREST_NODE],usesPlacedLabels:!0}),this.properties=new oe,this._chartTopology=void 0,this.colorScale=new CG,this.sizeScale=new OG,this.markerGroup=this.contentGroup.appendChild(new EG({name:"markerGroup"})),this.labelSelection=ph.select(this.labelGroup,ID,!1),this.highlightLabelSelection=ph.select(this.highlightLabelGroup,ID,!1),this.markerSelection=ph.select(this.markerGroup,gg,!1),this.highlightMarkerSelection=ph.select(this.highlightNodeGroup,gg),this.placedLabelData=[],this.animationState=new SG("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=[2,e],this.highlightGroup.zIndex=[3,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}async processData(e){if(this.data==null)return;const{data:t,sizeScale:i,colorScale:o}=this,{topologyIdKey:s,idKey:a,latitudeKey:n,longitudeKey:r,sizeKey:l,colorKey:c,labelKey:h,sizeDomain:u,colorRange:p}=this.properties,g=this.buildFeatureMap(s),m=this.sizeScale.type,y=this.colorScale.type,x=this.scale?.type,f=n!=null&&r!=null,{dataModel:b,processedData:S}=await this.requestDataModel(e,t,{props:[...a==null?[]:[ya(a,x,{id:"idValue",includeProperty:!1}),ya(a,x,{id:"featureValue",includeProperty:!1,processor:()=>I=>g.get(I)})],...f?[ya(n,x,{id:"latValue"}),ya(r,x,{id:"lonValue"})]:[],...h?[ya(h,"category",{id:"labelValue"})]:[],...l?[ya(l,m,{id:"sizeValue"})]:[],...c?[ya(c,y,{id:"colorValue"})]:[]]}),v=a==null?void 0:b.resolveColumnById(this,"featureValue",S),M=f?b.resolveColumnById(this,"latValue",S):void 0,D=f?b.resolveColumnById(this,"lonValue",S):void 0;if(this.topologyBounds=S.dataSources.get(this.id)?.data.reduce((I,A,k)=>{const L=v?.[k]?.geometry;if(L!=null&&(I=An(L,I)),M!=null&&D!=null){const T=D[k],P=M[k];I=Tr.extend(I,T,P,T,P)}return I},void 0),l!=null){const I=b.resolveProcessedDataIndexById(this,"sizeValue"),A=S.domain.values[I]??[];i.domain=u??A}if(p!=null&&this.isColorScaleValid()){const I=b.resolveProcessedDataIndexById(this,"colorValue");o.domain=S.domain.values[I],o.range=p,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 o=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=TG(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelDatum(e,t,i){if(t==null)return;const{idKey:o,idName:s,latitudeKey:a,latitudeName:n,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:u,colorName:p,labelKey:g,labelName:m,label:y,shape:x}=this.properties;if(g==null||!y.enabled)return;const{datum:f,datumIndex:b,index:S,idValue:v,lonValue:M,latValue:D,point:I}=e,{placement:A}=y,k=this.getLabelText(t,f,g,"label",[],y,{value:t,datum:f,idKey:o,idName:s,latitudeKey:a,latitudeName:n,longitudeKey:r,longitudeName:l,sizeKey:c,sizeName:h,colorKey:u,colorName:p,labelKey:g,labelName:m});if(k==null)return;const{width:N,height:L}=i.measureLines(String(k)),T=gg.anchor(x);return{point:{x:I.x,y:I.y,size:I.size},label:{width:N,height:L,text:k},anchor:T,placement:A,datumIndex:b,datumId:uh(S,v,M,D)}}resolveColumn(e,t,i){if(!(e==null||this.dataModel==null))return this.dataModel.resolveColumnById(this,t,i)}resolveDataColumns(e){const{idKey:t,latitudeKey:i,longitudeKey:o,sizeKey:s,colorKey:a,labelKey:n}=this.properties,r=i!=null&&o!=null;return{idValues:this.resolveColumn(t,"idValue",e),featureValues:this.resolveColumn(t,"featureValue",e),latValues:r?this.resolveColumn(i,"latValue",e):void 0,lonValues:r?this.resolveColumn(o,"lonValue",e):void 0,labelValues:this.resolveColumn(n,"labelValue",e),sizeValues:this.resolveColumn(s,"sizeValue",e),colorValues:this.resolveColumn(a,"colorValue",e)}}prepareProjectedGeometries(e,t,i){if(e==null||t==null||this.scale==null)return;const o=new Map;for(const[s]of i.dataSources.get(this.id)?.data.entries()??[]){const a=e[s],n=t[s]?.geometry,r=n==null?void 0:ga(n,this.scale);a!=null&&r!=null&&o.set(a,r)}return o}calculateMarkerSize(e){return e==null?this.properties.size:this.sizeScale.convert(e,{clamp:!0})}buildNodeDatum(e,t,i,o,s){return{series:this,datum:e,datumIndex:t,index:i,...s,point:o,midPoint:{x:o.x,y:o.y},legendItemName:this.properties.legendItemName,style:this.getMarkerItemStyle({datumIndex:t,datum:e,colorValue:s.colorValue,sizeValue:s.sizeValue},!1)}}createNodeFromLatLon(e,t,i,o,s,a,n){if(this.scale==null)throw new Error("Scale is required for createNodeFromLatLon");const[r,l]=this.scale.convert([i,o]),c={x:r,y:l,size:a},h=this.buildNodeDatum(e,t,-1,c,s),u=this.getLabelDatum(h,s.labelValue,n)??void 0;return{node:h,label:u}}createNodesFromGeometry(e,t,i,o,s,a){const n=[],r=[];for(const[l,[c,h]]of vD(i,1).entries()){const u={x:c,y:h,size:s},p=this.buildNodeDatum(e,t,l,u,o);n.push(p);const g=this.getLabelDatum(p,o.labelValue,a);g&&r.push(g)}return{nodes:n,labels:r}}warnMissingGeometries(e){if(e.length===0)return;const t=10;if(e.length>t){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}xG.warnOnce("some data items do not have matches in the provided topology",e)}buildFeatureMap(e){const t=new Map;for(const i of this.topology?.features.values()??[]){const o=i.properties?.[e];o!=null&&t.set(o,i)}return t}createNodeData(){const{id:e,dataModel:t,processedData:i,sizeScale:o,properties:s,scale:a}=this,{label:n}=s;if(t==null||i==null||a==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const r=this.resolveDataColumns(i),l=s.maxSize??s.size;o.range=[Math.min(s.size,l),l];const c=bG(n),h=this.prepareProjectedGeometries(r.idValues,r.featureValues,i),u=[],p=[],g=[],m=i.dataSources.get(this.id)?.data??[];for(const[y,x]of m.entries()){const f={idValue:r.idValues?.[y],lonValue:r.lonValues?.[y],latValue:r.latValues?.[y],colorValue:r.colorValues?.[y],sizeValue:r.sizeValues?.[y],labelValue:r.labelValues?.[y]},b=this.calculateMarkerSize(f.sizeValue),S=f.idValue==null?void 0:h?.get(f.idValue);if(f.idValue!=null&&h!=null&&S==null&&g.push(f.idValue),f.lonValue!=null&&f.latValue!=null){const v=this.createNodeFromLatLon(x,y,f.lonValue,f.latValue,f,b,c);u.push(v.node),v.label&&p.push(v.label)}else if(S!=null){const v=this.createNodesFromGeometry(x,y,S,f,b,c);u.push(...v.nodes),p.push(...v.labels)}}return this.warnMissingGeometries(g),{itemId:e,nodeData:u,labelData:p}}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,a=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateSelections(),this.contentGroup.visible=this.visible,this.labelGroup.visible=this.visible;const n=this.getHighlightedDatum(),r=this.contextNodeData?.nodeData??[];this.markerSelection=this.updateMarkerSelection({markerData:r,markerSelection:o}),this.updateMarkerNodes({markerSelection:o,isHighlight:!1,highlightedDatum:n,drawingMode:"overlay"}),this.highlightMarkerSelection=this.updateMarkerSelection({markerData:n==null?[]:[n],markerSelection:s}),this.updateMarkerNodes({markerSelection:s,isHighlight:!0,highlightedDatum:n,drawingMode:a}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection(n),(i||t)&&this.animationState.transition("resize"),this.animationState.transition("update")}updatePlacedLabelData(e){this.placedLabelData=e,this.labelSelection=this.labelSelection.update(e,t=>{t.pointerEvents=fD.PointerEvents.None}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateHighlightLabelSelection()}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,o=this.ctx.highlightManager?.getActiveHighlight();t.each((s,a)=>{const{x:n,y:r,width:l,height:c,text:h,datum:u}=a,p=PG(this,void 0,i,i.label,e,o),{color:g,fontStyle:m,fontWeight:y,fontSize:x,fontFamily:f}=p;s.visible=!0,s.x=n+l/2,s.y=r+c/2,s.text=h,s.fill=g,s.fontStyle=m,s.fontWeight=y,s.fontSize=x,s.fontFamily=f,s.textAlign="center",s.textBaseline="middle";const b=u?.datumIndex;s.fillOpacity=this.getHighlightStyle(e,b).opacity??1,s.setBoxing(p)})}getHighlightedLabelId(e=this.getHighlightedDatum()){if(e!=null)return uh(e.index,e.idValue,e.lonValue,e.latValue)}updateHighlightLabelSelection(e=this.getHighlightedDatum()){const t=this.getHighlightedLabelId(e),i=t==null||!this.isLabelEnabled()?[]:this.placedLabelData.filter(o=>o.datum.datumId===t);if(this.highlightLabelSelection=this.highlightLabelSelection.update(i),i.length===0){this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1;return}this.highlightLabelGroup.visible=!0,this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0})}updateMarkerSelection(e){const{markerData:t,markerSelection:i}=e;return i.update(t,void 0,o=>uh(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),u=xD(h,a.getStyle());!s&&i!=null&&(u.fill=this.isColorScaleValid()?n.convert(i):l?.[0]??u.fill),o!=null&&(u.size=r.convert(o,{clamp:!0}));let p=u;if(c!=null&&e!=null){const g=this.cachedDatumCallback(uh(e,s?"highlight":"node"),()=>{const m=this.makeItemStylerParams(t,e,s,p);return this.callWithContext(c,m)});g&&(p=xD(g,u))}return p}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,highlightState:n,...o,fill:r}}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i,highlightedDatum:o,drawingMode:s}=e,a=MD(this.scale);t.each((n,r)=>{const{datum:l,point:c}=r,h=this.getMarkerItemStyle(r,i);n.shape=h.shape,n.size=h.size,n.setStyleProperties(h,a),n.x=c.x,n.y=c.y,n.scalingCenterX=c.x,n.scalingCenterY=c.y,n.zIndex=!i&&o!=null&&l===o.datum?1:0,n.drawingMode=s})}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(),this.highlightLabelSelection.cleanup(),this.highlightLabelGroup.visible=!1,this.placedLabelData=[]}animateMarkers(){const{animationManager:e}=this.ctx,t=NW();LG(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),u=c*c+h*h;u=0?"N":"S"}, ${Math.abs(T).toFixed(4)}\xB0 ${T>=0?"W":"E"}`}const N=this.getMarkerItemStyle({datumIndex:e,datum:M,colorValue:I,sizeValue:D},!1);return this.formatTooltipWithContext(v,{heading:k,title:b??S,symbol:this.legendItemSymbol(e),data:A},{seriesId:t,datum:M,title:b,idKey:n,idName:r,latitudeKey:l,latitudeName:c,longitudeKey:h,longitudeName:u,colorKey:p,colorName:g,sizeKey:m,sizeName:y,labelKey:x,labelName:f,...N})}getFormattedMarkerStyle(e){const t=this.getMarkerItemStyle(e,!1);return{size:t.size,shape:t.shape}}computeFocusBounds(e){return wG(this,e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};mg.className="MapMarkerSeries",mg.type="map-marker";import{_ModuleSupport as RG}from"ag-charts-community";import{commonSeriesOptionsDefs as _G,constant as zG,geoJson as BG,required as VG,string as Ot,without as FG}from"ag-charts-core";var{mapMarkerSeriesThemeableOptionsDef:HG}=RG,KG={...FG(_G,["highlightStyle","highlight"]),...HG,type:VG(zG("map-marker")),idKey:Ot,latitudeKey:Ot,longitudeKey:Ot,sizeKey:Ot,colorKey:Ot,labelKey:Ot,idName:Ot,latitudeName:Ot,longitudeName:Ot,sizeName:Ot,colorName:Ot,labelName:Ot,topology:BG,topologyIdKey:Ot,legendItemName:Ot,title:Ot},AD={type:"series",name:"map-marker",chartType:"topology",enterprise:!0,version:cG,dependencies:[Nr],options:KG,themeTemplate:{...Lr,series:{shape:"circle",maxSize:30,fill:lo({$applySwitch:[{$path:"type"},{$mapPalette:"fill"},["gradient",hG],["image",dG],["pattern",uG]]}),stroke:{$mapPalette:"stroke"},colorRange:{$if:[{$eq:[{$mapPalette:"type"},"inbuilt"]},{$mapPalette:"divergingColors"},lo(mG)]},fillOpacity:.5,label:{...pG,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:lo(gG)},tooltip:{range:"exact"}},create:e=>new mg(e),validate(e,t,i){const o=fG(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 yG("required",r,null,i))}return o}};import{VERSION as WG}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as GG,FILL_IMAGE_DEFAULTS as jG,FILL_PATTERN_DEFAULTS as $G,LABEL_BOXING_DEFAULTS as UG,MULTI_SERIES_HIGHLIGHT_STYLE as YG,SAFE_RANGE2_OPERATION as XG}from"ag-charts-core";import{_ModuleSupport as ND}from"ag-charts-community";import{Logger as LD,cachedTextMeasurer as ZG,isArray as QG,measureTextSegments as qG,mergeDefaults as TD,toPlainText as JG}from"ag-charts-core";function e3(e,{aspectRatio:t,precision:i}){const o=SD(e,i,(l,c,h,u)=>{const p=i3(l,c,h,t),g=p+2*u*t,m=p*Math.SQRT2,y=g*Math.SQRT2;return{distance:m,maxDistance:y}});if(o==null)return;const{x:s,y:a,distance:n}=o,r=n/Math.SQRT2;return{x:s,y:a,maxWidth:r}}function t3(e,t,i,o,s){const[a,n]=e,[r,l]=t,c=1/s,h=r-a,u=l-n,[p,g]=n<=l?e:t,[m,y]=a<=r?e:t,[x,f]=n<=l?t:e,[b,S]=a<=r?t:e;let v=1/0;if(h===0)for(let N=0;N<=1;N+=1){const T=(N===0?c:-c)*(a-i)+o;if(T>=g&&T<=f){const R=Math.abs(o-T)*2*s;v=Math.min(v,R)}}else{const N=u/h;for(let L=0;L<=1;L+=1){const T=L===0?c:-c,P=(N*a-n-T*i+o)/(N-T);if(P>=m&&P<=b){const R=Math.abs(i-P)*2;v=Math.min(v,R)}}}const M=s,D=Math.abs((p-i)/(g-o)),I=Math.abs((x-i)/(f-o));if(fo&&Di&&Ai!=c>i&&t<(l-u)*(i-p)/(c-p)+u&&(s=!s);const g=t3(r,h,t,i,o);a=Math.min(a,g),r=h,l=u,c=p}}return(s?1:-1)*a}function gh(e,t,i){i>=t&&(e.maxX=Math.min(e.maxX,i-t)),i<=t&&(e.minX=Math.max(e.minX,i-t))}function o3(e,t,i,o,s,a){const n=s-a/2,r=s+a/2,[l,c]=t,[h,u]=i,p=h-l,g=u-c,[m,y]=l<=h?t:i,[x,f]=l<=h?i:t;if(p!==0){const b=g/p;for(let S=0;S<=1;S+=1){const M=((S===0?n:r)-c)/b+l;M>=m&&M<=x&&gh(e,o,M)}}else Math.max(n,Math.min(c,u))<=Math.min(r,Math.max(c,u))&&gh(e,o,l);return x=n&&f<=r?gh(e,o,x):m>o&&y>=n&&y<=r&&gh(e,o,m),e}function s3(e,t,i,o){const s={minX:-1/0,maxX:1/0};for(const r of e){let l=r.at(-1);for(const c of r)o3(s,l,c,t,i,o),l=c}const{minX:a,maxX:n}=s;return Number.isFinite(a)&&Number.isFinite(n)?{x:t+(a+n)/2,width:n-a}:{x:t,width:0}}import{_ModuleSupport as a3}from"ag-charts-community";import{Property as Oe}from"ag-charts-core";var{SeriesProperties:n3,makeSeriesTooltip:r3}=a3,ke=class extends n3{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 lc,this.tooltip=r3()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,opacity:1}}};d([Oe],ke.prototype,"topology",2),d([Oe],ke.prototype,"title",2),d([Oe],ke.prototype,"legendItemName",2),d([Oe],ke.prototype,"idKey",2),d([Oe],ke.prototype,"idName",2),d([Oe],ke.prototype,"topologyIdKey",2),d([Oe],ke.prototype,"labelKey",2),d([Oe],ke.prototype,"labelName",2),d([Oe],ke.prototype,"colorKey",2),d([Oe],ke.prototype,"colorName",2),d([Oe],ke.prototype,"colorRange",2),d([Oe],ke.prototype,"fill",2),d([Oe],ke.prototype,"fillOpacity",2),d([Oe],ke.prototype,"stroke",2),d([Oe],ke.prototype,"strokeOpacity",2),d([Oe],ke.prototype,"strokeWidth",2),d([Oe],ke.prototype,"lineDash",2),d([Oe],ke.prototype,"lineDashOffset",2),d([Oe],ke.prototype,"padding",2),d([Oe],ke.prototype,"itemStyler",2),d([Oe],ke.prototype,"label",2),d([Oe],ke.prototype,"tooltip",2);var{getMissCount:l3,createDatumId:mh,SeriesNodePickMode:wD,valueProperty:yh,ColorScale:c3,Group:CD,Selection:fh,Text:OD,PointerEvents:h3,getLabelStyles:d3}=ND,ED=ND.MercatorScale.fixedScale(),yg=class extends wr{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{color:["colorKey"],label:["labelKey"]},propertyNames:{color:["colorName"],label:["labelName"]},pickModes:[wD.EXACT_SHAPE_MATCH,wD.NEAREST_NODE]}),this.properties=new ke,this._chartTopology=void 0,this.colorScale=new c3,this.itemGroup=this.contentGroup.appendChild(new CD({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new CD({name:"itemLabelGroup"})),this.datumSelection=fh.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=fh.select(this.itemLabelGroup,OD),this.highlightDatumSelection=fh.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.highlightLabelSelection=fh.select(this.highlightLabelGroup,OD),this.previousLabelLayouts=void 0,this._previousDatumMidPoint=void 0,this.itemLabelGroup.pointerEvents=h3.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=[4,e],!0}isLabelEnabled(){return this.properties.labelKey!=null&&this.properties.label.enabled}nodeFactory(){const e=new In;return e.renderMode=1,e.lineJoin="round",e}async processData(e){if(this.data==null)return;const{data:t,topology:i,colorScale:o}=this,{topologyIdKey:s,idKey:a,colorKey:n,labelKey:r,colorRange:l}=this.properties,c=new Map;for(const y of i?.features.values()??[]){const x=y.properties?.[s];x==null||!lg(y.geometry,1)||c.set(x,y)}const h=this.colorScale.type,u=this.scale?.type,{dataModel:p,processedData:g}=await this.requestDataModel(e,t,{props:[yh(a,u,{id:"idValue",includeProperty:!1}),yh(a,u,{id:"featureValue",includeProperty:!1,processor:()=>y=>c.get(y)}),...r?[yh(r,"category",{id:"labelValue"})]:[],...n?[yh(n,h,{id:"colorValue"})]:[]]}),m=p.resolveColumnById(this,"featureValue",g);if(this.topologyBounds=m.reduce((y,x)=>{const f=x?.geometry;return f==null?y:An(f,y)},void 0),l!=null&&this.isColorScaleValid()){const y=p.resolveProcessedDataIndexById(this,"colorValue");o.domain=g.domain.values[y],o.range=l,o.update()}i==null&&LD.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 o=t.resolveProcessedDataIndexById(this,"colorValue"),s=i.input.count,a=l3(this,i.defs.values[o].missing);return!(s===0||s===a)}getLabelLayout(e,t,i,o,s){if(t==null||o==null)return;const{idKey:a,idName:n,colorKey:r,colorName:l,labelKey:c,labelName:h,padding:u,label:p}=this.properties;if(c==null||!p.enabled)return;const g=this.getLabelText(t,e,c,"label",[],p,{value:t,datum:e,idKey:a,idName:n,colorKey:r,colorName:l,labelKey:c,labelName:h});if(g==null)return;const m=QG(g)?qG(g,p):i.measureLines(String(g)),y=(m.width+2*u)/(m.height+2*u);if(s?.geometry===o&&s?.labelText===g&&s?.aspectRatio===y)return s;const x=ga(o,ED),f=ch(x);if(f==null)return;const b=e3(f,{aspectRatio:y,precision:.001});if(b==null)return;const{x:S,y:v,maxWidth:M}=b;return{geometry:o,labelText:g,aspectRatio:y,x:S,y:v,maxWidth:M,fixedPolygon:f}}getLabelDatum(e,t,i,o){const{scale:s}=this;if(s==null)return;const{padding:a,label:n}=this.properties,{labelText:r,aspectRatio:l,x:c,y:h,maxWidth:u,fixedPolygon:p}=e,g={width:Math.ceil(u*t),height:Math.ceil(u*t/l),meta:c},m=lr(JG(r),n,{padding:a},(D,I)=>{if(!I)return g;const A=s3(p,c,h,D/t);return{width:A.width*t,height:D,meta:A.x}});if(m==null)return;const[{text:y,fontSize:x,lineHeight:f,width:b},S]=m,v=bt){const i=e.length-t;e.length=t,e.push(`(+${i} more)`)}LD.warnOnce("some data items do not have matches in the provided topology",e)}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:o,scale:s,previousLabelLayouts:a}=this,{label:n,legendItemName:r,colorKey:l}=o;if(t==null||i==null)return;if(!this.visible)return{itemId:e,nodeData:[],labelData:[]};const c=s==null?Number.NaN:(s.range[1][0]-s.range[0][0])/s.bounds.width,h=this.resolveShapeDataColumns(i),u=ZG(n),p=new Map;this.previousLabelLayouts=p;const g=[],m=[],y=[],x=i.dataSources.get(this.id)?.data??[];for(const[f,b]of x.entries()){const S={idValue:h.idValues[f],colorValue:h.colorValues?.[f],labelValue:h.labelValues?.[f]},v=h.featureValues[f]?.geometry??void 0;if(v==null&&y.push(S.idValue),l!=null&&S.colorValue==null)continue;const M=this.getLabelLayout(b,S.labelValue,u,v,a?.get(S.idValue));M!=null&&p.set(S.idValue,M);const D=M!=null&&s!=null?this.getLabelDatum(M,c,f,S.idValue):void 0;D!=null&&m.push(D);const I=v!=null&&s!=null?ga(v,s):void 0;g.push({series:this,datum:b,datumIndex:f,...S,projectedGeometry:I,legendItemName:r,style:this.getItemStyle({datum:b,datumIndex:f,colorValue:S.colorValue},!1)})}return this.warnMissingGeometries(y),{itemId:e,nodeData:g,labelData:m}}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;const o=this.ctx.chartService.highlight?.drawingMode??"overlay",s=this.getHighlightedDatum(),a=this.contextNodeData?.nodeData??[],n=this.contextNodeData?.labelData??[];this.datumSelection=this.updateDatumSelection({nodeData:a,datumSelection:e}),this.updateDatumStyles({datumSelection:e,isHighlight:!1}),this.updateDatumNodes({datumSelection:e,drawingMode:"overlay"}),this.labelSelection=this.updateLabelSelection({labelData:n,labelSelection:t});const r=this.getHighlightLabelData(n,s);this.highlightLabelSelection=this.updateLabelSelection({labelData:r,labelSelection:this.highlightLabelSelection}),this.updateLabelNodes({labelSelection:this.labelSelection,isHighlight:!1}),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:s==null?[]:[s],datumSelection:i}),this.updateDatumStyles({datumSelection:i,isHighlight:!0}),this.updateDatumNodes({datumSelection:i,drawingMode:o})}getHighlightLabelData(e,t){if(e.length===0)return[];const i=mh(t?.idValue);return e.filter(o=>o.datumId===i&&o.datumIndex===t?.datumIndex)}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>mh(t.idValue))}getItemStyle({datumIndex:e,datum:t,colorValue:i},o){const{properties:s,colorScale:a}=this,{colorRange:n,itemStyler:r}=s,l=s.getStyle();if(i!=null){const u=this.isColorScaleValid()?a.convert(i):n?.[0];u!=null&&(l.fill=u)}const c=this.getHighlightStyle(o,e);let h=TD(c,l);if(r!=null&&e!=null){const u=this.cachedDatumCallback(mh(e,o?"highlight":"node"),()=>{const p=this.makeItemStylerParams(t,e,o,h);return this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],this.callWithContext(r,p))});u&&(h=TD(u,h))}return h}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,highlightState:n,...o,fill:r}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o,t)})}updateDatumNodes({datumSelection:e,drawingMode:t}){const i=MD(this.scale);e.each((o,s)=>{const{projectedGeometry:a}=s;if(a==null){o.visible=!1,o.projectedGeometry=void 0;return}o.visible=!0,o.projectedGeometry=a,o.setStyleProperties(s.style,i),o.drawingMode=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t)}updateLabelNodes({isHighlight:e,labelSelection:t}){const{properties:i}=this,o=this.ctx.highlightManager?.getActiveHighlight();t.each((s,a)=>{const{x:n,y:r,text:l,fontSize:c,lineHeight:h,datumIndex:u}=a,p=d3(this,void 0,i,i.label,e,o),{color:g,fontStyle:m,fontWeight:y,fontFamily:x}=p;s.visible=!0,s.x=n,s.y=r,s.text=l,s.fill=g,s.fontStyle=m,s.fontWeight=y,s.fontSize=c,s.lineHeight=h,s.fontFamily=x,s.textAlign="center",s.textBaseline="middle",s.fillOpacity=this.getHighlightStyle(e,u).opacity??1,s.setBoxing(p)})}resetAnimation(){}pickNodeClosestDatum({x:e,y:t}){let i=1/0,o;return this.datumSelection.each((s,a)=>{const n=s.distanceSquared(e,t);nnew yg(e)};import{VERSION as S3}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_HIERARCHY_DEFAULTS as b3,FILL_IMAGE_DEFAULTS as v3,FILL_PATTERN_HIERARCHY_DEFAULTS as M3}from"ag-charts-core";import{_ModuleSupport as D3}from"ag-charts-community";import{Logger as k3}from"ag-charts-core";import{_ModuleSupport as I3}from"ag-charts-community";import{Property as _o}from"ag-charts-core";var{SeriesProperties:A3,makeSeriesTooltip:N3}=I3,co=class extends A3{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=N3()}};d([_o],co.prototype,"topology",2),d([_o],co.prototype,"fill",2),d([_o],co.prototype,"fillOpacity",2),d([_o],co.prototype,"stroke",2),d([_o],co.prototype,"strokeOpacity",2),d([_o],co.prototype,"strokeWidth",2),d([_o],co.prototype,"lineDash",2),d([_o],co.prototype,"lineDashOffset",2),d([_o],co.prototype,"tooltip",2);var{createDatumId:L3,Selection:T3,Group:w3,PointerEvents:_D}=D3,fg=class extends wr{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[]}),this.properties=new co,this._chartTopology=void 0,this.itemGroup=this.contentGroup.appendChild(new w3({name:"itemGroup"})),this.datumSelection=T3.select(this.itemGroup,()=>this.nodeFactory()),this.itemGroup.pointerEvents=_D.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 In;return e.renderMode=1,e.lineJoin="round",e.pointerEvents=_D.None,e}processData(){const{topology:e}=this;this.topologyBounds=e?.features.reduce((t,i)=>{const o=i.geometry;return o==null?t:An(o,t)},void 0),e==null&&k3.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{fill:s,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}=o,u=[],p=[];for(const[g,m]of t.features.entries()){const{geometry:y}=m,x=y!=null&&i!=null?ga(y,i):void 0;x!=null&&u.push({series:this,datum:m,datumIndex:0,index:g,projectedGeometry:x,style:{fill:s,fillOpacity:a,stroke:n,strokeWidth:r,strokeOpacity:l,lineDash:c,lineDashOffset:h}})}return{itemId:e,nodeData:u,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=>L3(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){}pickFocus(){}computeFocusBounds(e){}hasItemStylers(){return!1}};fg.className="MapShapeBackgroundSeries",fg.type="map-shape-background";import{_ModuleSupport as C3}from"ag-charts-community";import{commonSeriesOptionsDefs as O3,constant as E3,geoJson as P3,required as R3}from"ag-charts-core";var{mapShapeBackgroundSeriesThemeableOptionsDef:_3}=C3,z3={..._3,...O3,type:R3(E3("map-shape-background")),topology:P3},zD={type:"series",name:"map-shape-background",chartType:"topology",enterprise:!0,version:S3,dependencies:[Nr],options:z3,themeTemplate:{...Lr,series:{fill:lo({$applySwitch:[{$path:"type"},{$path:["/1",{$mapPalette:"fill"},{$mapPalette:"hierarchyColors"}]},["gradient",b3],["image",v3],["pattern",M3]]}),stroke:{$ref:"chartBackgroundColor"},strokeWidth:1}},create:e=>new fg(e)};import{PolarChartModule as B3,VERSION as V3}from"ag-charts-community";import{ChartAxisDirection as BD,POLAR_AXIS_TYPE as VD}from"ag-charts-core";import{_ModuleSupport as F3}from"ag-charts-community";import{PolarZIndexMap as xg}from"ag-charts-core";import{_ModuleSupport as Or}from"ag-charts-community";import{ChartAxisDirection as ho,isDefined as H3,isGradientFill as FD,normalizeAngle360 as HD}from"ag-charts-core";import{_ModuleSupport as KD}from"ag-charts-community";import{mergeDefaults as WD}from"ag-charts-core";var{createDatumId:K3,toHighlightString:W3}=KD;function G3(e,t){const{id:i}=e,{angleKey:o,cornerRadius:s,fill:a,fillOpacity:n,lineDash:r,lineDashOffset:l,radiusKey:c,stackGroup:h,stroke:u,strokeOpacity:p,strokeWidth:g}=e.properties,m=W3(t??KD.HighlightState.None);return{angleKey:o,cornerRadius:s,fill:a,fillOpacity:n,highlightState:m,lineDash:r,lineDashOffset:l,radiusKey:c,seriesId:i,stackGroup:h,stroke:u,strokeOpacity:p,strokeWidth:g}}function Sg(e,t,i){const{styler:o}=e.properties;let s={};if(!t&&o){const a=G3(e,i);s=e.ctx.optionsGraphService.resolvePartial(["series",`${e.declarationOrder}`],e.cachedCallWithContext(o,a)??{},{pick:!1})??{}}return{cornerRadius:s.cornerRadius??e.properties.cornerRadius,fill:s.fill??e.properties.fill,fillOpacity:s.fillOpacity??e.properties.fillOpacity,lineDash:s.lineDash??e.properties.lineDash,lineDashOffset:s.lineDashOffset??e.properties.lineDashOffset,stroke:s.stroke??e.properties.stroke,strokeOpacity:s.strokeOpacity??e.properties.strokeOpacity,strokeWidth:s.strokeWidth??e.properties.strokeWidth,opacity:1}}function j3(e,t,i,o){const{id:s,properties:a}=e,{angleKey:n,radiusKey:r}=a,l=e.ctx.highlightManager?.getActiveHighlight(),c=e.getHighlightStateString(l,i,t.datumIndex),h=e.filterItemStylerFillParams(o.fill)??o.fill;return{seriesId:s,datum:t.datum,highlightState:c,angleKey:n,radiusKey:r,...o,fill:h}}function Nn(e,t,i,o){const{properties:s}=e,{itemStyler:a}=s,n=e.getHighlightStyle(i,t?.datumIndex,o);let l=WD(n,Sg(e,t===void 0,o));if(a!=null&&t!=null){const c=e.cachedDatumCallback(K3(e.getDatumId(t),i?"highlight":"node"),()=>{const h=j3(e,t,i,l);return e.callWithContext(a,h)});c&&(l=WD(c,l))}return l}var{DEFAULT_POLAR_DIRECTION_KEYS:$3,DEFAULT_POLAR_DIRECTION_NAMES:U3,PolarAxis:Y3,diff:X3,fixNumericExtent:Z3,groupAccumulativeValueProperty:GD,keyProperty:Q3,normaliseGroupTo:q3,resetLabelFn:J3,seriesLabelFadeInAnimation:ej,seriesLabelFadeOutAnimation:tj,valueProperty:ij,animationValidation:oj,createDatumId:sj,SeriesNodePickMode:jD,CategoryScale:aj,motion:$D,updateLabelNode:UD,getItemStyles:nj}=Or,rj=class extends Or.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},YD=class extends Or.PolarSeries{constructor(e,{animationResetFns:t}){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:$3,propertyNames:U3,canHaveAxes:!0,pickModes:[jD.NEAREST_NODE,jD.EXACT_SHAPE_MATCH],animationResetFns:{...t,label:J3}}),this.NodeEvent=rj,this.groupScale=new aj,this.circleCache={r:0,cx:0,cy:0}}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===ho.Angle)return t.getDomain(this,"angleValue","key",i);{const o=t.getDomain(this,"radiusValue-end","value",i).domain,s=Number.isFinite(o[1]-o[0])?[Math.min(o[0],0),Math.max(o[1],0)]:[];return{domain:Z3(s)}}}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:o}=this.properties,s=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),n=`${a}-trailing`,r=[];H3(o)&&r.push(q3([a,n],Math.abs(o))),this.needsDataModelDiff()&&this.processedData&&r.push(X3(this.id,this.processedData)),s&&r.push(oj());const l=this.visible?{}:{forceValue:0},c=this.axes[ho.Radius]?.scale.type,h=this.axes[ho.Angle]?.scale.type,u=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[Q3(t,h,{id:"angleValue",allowNullKey:u}),ij(i,c,{id:"radiusValue-raw",invalidValue:null,...l}),...GD(i,"normal",{id:"radiusValue-end",rangeId:"radiusValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},c),...GD(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,o=this.circleCache;return e!==o.r||t!==o.cx||i!==o.cy?(this.circleCache={r:e,cx:t,cy:i},!0):!1}isRadiusAxisReversed(){return this.axes[ho.Radius]?.isReversed()}maybeRefreshNodeData(){!this.didCircleChange()&&!this.nodeDataRefresh||(this.contextNodeData=this.createNodeData(),this.nodeData=this.contextNodeData?.nodeData??[],this.nodeDataRefresh=!1)}getAxisInnerRadius(){const e=this.axes[ho.Radius];return e instanceof Y3?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t,groupScale:i}=this;if(!t||e?.type!=="grouped")return;const o=this.axes[ho.Angle],s=this.axes[ho.Radius],a=o?.scale,n=s?.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),h=t.resolveColumnById(this,"radiusValue-raw",e);let u=0,p=0;o instanceof Es&&(u=o.groupPaddingInner,p=o.paddingInner);const m=(a.bandwidth??0)*(1-p),{index:y,visibleGroupCount:x}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);i.domain=Array.from({length:x}).map((E,C)=>String(C)),i.range=[-m/2,m/2],i.paddingInner=x>1?u:0;const f=this.isRadiusAxisReversed(),b=this.getAxisInnerRadius(),S=this.radius,v=S+b,{angleKey:M,radiusKey:D,angleName:I,radiusName:A,legendItemName:k,label:N}=this.properties,L=this.getSeriesDomain(ho.Radius).domain,T=(E,C,_,z)=>{const K=this.getLabelText(C,E,D,"radius",L,N,{value:C,datum:E,angleKey:M,radiusKey:D,angleName:I,radiusName:A,legendItemName:k});if(K)return{x:_,y:z,text:K,textAlign:"center",textBaseline:"middle"}},P=[],R=nj((E,C,_)=>Nn(this,E,C,_)),w={itemId:D,nodeData:P,labelData:P,styles:R};if(!this.visible)return w;const{dataSources:O}=e,B=O.get(this.id)?.data??[];for(const{datumIndex:E}of t.forEachGroupDatum(this,e)){const C=B[E],_=r[E];if(_===void 0&&!this.properties.allowNullKeys)return;const z=h[E],K=z>=0&&!Object.is(z,-0),F=l[E],Z=c[E],G=K===f;if(F===void 0||Z===void 0)return;let $,J,ae;if(B.length===1)$=-.5*Math.PI,J=1.5*Math.PI,ae=$;else{const Je=a.convert(_);$=HD(Je+i.convert(String(y))),J=HD($+i.bandwidth),ae=$+i.bandwidth/2}const ne=v-n.convert(F),he=v-n.convert(Z),Ae=(ne+he)/2,_t=Math.cos(ae)*Ae,se=Math.sin(ae)*Ae,Q=this.properties.label.enabled?T(C,z,_t,se):void 0,_e=this.getColumnWidth($,J);P.push({series:this,datum:C,datumIndex:E,point:{x:_t,y:se,size:0},midPoint:{x:_t,y:se},label:Q,angleValue:_,radiusValue:z,negative:G,innerRadius:ne,outerRadius:he,stackInnerRadius:ne,stackOuterRadius:he,startAngle:$,endAngle:J,midAngle:ae,axisInnerRadius:b,axisOuterRadius:S,columnWidth:_e,index:E})}return{itemId:D,nodeData:P,labelData:P,styles:R}}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 o=this.ctx.highlightManager.getActiveHighlight();let s=[];const a=this.ctx.highlightManager?.getActiveHighlight();t?a?.datum&&a.series===this&&s.push(a):s=this.nodeData;const n=this.isRadiusAxisReversed(),r=n?this.radius:this.getAxisInnerRadius(),l=n?this.getAxisInnerRadius():this.radius,c=this.getShapeFillBBox(),h=this.hasItemStylers();e.update(s,void 0,u=>this.getDatumId(u)).each((u,p)=>{const{midPoint:g}=p;if(h){const b=this.getHighlightState(a,t,p.datumIndex);p.style=Nn(this,p,t,b)}const m=p.style??i.styles[this.getHighlightState(o,t,p.datumIndex)],y=m.fill,f=FD(y)&&y.bounds==="item"?{centerX:g?.x??0,centerY:g?.y??0}:{centerX:0,centerY:0,innerRadius:r,outerRadius:l};this.updateItemPath(u,p,t),u.setStyleProperties(m,c,f),u.cornerRadius=m.cornerRadius??0,u.lineJoin="round"})}updateLabels(){const e=this.ctx.highlightManager?.getActiveHighlight(),t=e?.series===this&&e?.datum?e:void 0,i=t?[t]:[];this.labelSelection.update(this.nodeData).each((o,s)=>{UD(this,o,this.properties,this.properties.label,s.label,!1,e),o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1}),this.highlightLabelSelection.update(i,void 0,o=>this.getDatumId(o)).each((o,s)=>{UD(this,o,this.properties,this.properties.label,s.label,!0,e),o.fillOpacity=this.getHighlightStyle(!0,s.datumIndex).opacity??1})}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getColumnTransitionFunctions();$D.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),ej(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getColumnTransitionFunctions();$D.fromToMotion(this.id,"datums",t,[e],i),tj(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,axes:s,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:u}=a,p=s[ho.Angle],g=s[ho.Radius],m=this.nodeData?.[e];if(!i||!o||!p||!g||!m)return;const y=o.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"angleValue",o)[e],f=i.resolveColumnById(this,"radiusValue-raw",o)[e];if(x===void 0&&!this.properties.allowNullKeys)return;const b=Nn(this,m,!1);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(p,"tooltip",x,y,n,void 0),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(g,"tooltip",f,y,l,void 0),missing:Or.isTooltipValueMissing(f)}]},{seriesId:t,datum:y,title:r,angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...b})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:n}=Sg(this,!1,Or.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:n};return FD(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:o,radiusName:s,legendItemName:a,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:o,seriesId:t,enabled:i,label:{text:a??s??o},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!n}]}getDatumId(e){return sj(e.angleValue)}computeLabelsBBox(){return null}};import{_ModuleSupport as lj}from"ag-charts-community";import{Property as Ee}from"ag-charts-core";var{SeriesProperties:cj,makeSeriesTooltip:hj,Label:dj}=lj,fe=class extends cj{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",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 dj,this.tooltip=hj()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,cornerRadius:r,opacity:1}}};d([Ee],fe.prototype,"angleKey",2),d([Ee],fe.prototype,"angleName",2),d([Ee],fe.prototype,"radiusKey",2),d([Ee],fe.prototype,"radiusName",2),d([Ee],fe.prototype,"angleKeyAxis",2),d([Ee],fe.prototype,"radiusKeyAxis",2),d([Ee],fe.prototype,"legendItemName",2),d([Ee],fe.prototype,"fill",2),d([Ee],fe.prototype,"fillOpacity",2),d([Ee],fe.prototype,"stroke",2),d([Ee],fe.prototype,"strokeWidth",2),d([Ee],fe.prototype,"strokeOpacity",2),d([Ee],fe.prototype,"lineDash",2),d([Ee],fe.prototype,"lineDashOffset",2),d([Ee],fe.prototype,"cornerRadius",2),d([Ee],fe.prototype,"styler",2),d([Ee],fe.prototype,"itemStyler",2),d([Ee],fe.prototype,"rotation",2),d([Ee],fe.prototype,"stackGroup",2),d([Ee],fe.prototype,"normalizedTo",2),d([Ee],fe.prototype,"label",2),d([Ee],fe.prototype,"tooltip",2);import{_ModuleSupport as uj}from"ag-charts-community";import{_ModuleSupport as pj}from"ag-charts-community";var{motion:gj}=pj;function XD(){const e={startAngle:new Map,endAngle:new Map},t=["startAngle","endAngle"],i=(n,r,l)=>{for(const c of t){const h=e[c];let u=(l==="removed"||l==="updated"?n:r)[c],p=(l==="removed"?n:r)[c];Number.isNaN(p)&&(p=n.previousDatum?.[c]??Number.NaN);const g=u-p;Math.abs(g)>Math.PI&&(u-=Math.sign(g)*2*Math.PI),h.set(r,{from:u,to:p})}},o=(n,r)=>({startAngle:e.startAngle.get(n)[r],endAngle:e.endAngle.get(n)[r]});return{calculate:i,from:n=>o(n,"from"),to:n=>o(n,"to")}}function ZD(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 mj(e){const t=XD();return{toFn:(s,a,n)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,h,u,p,g;return n==="removed"?(c=s.innerRadius,h=s.innerRadius,u=s.columnWidth,p=s.axisInnerRadius,g=s.axisOuterRadius):(c=Number.isNaN(a.innerRadius)?e:a.innerRadius,h=Number.isNaN(a.outerRadius)?e:a.outerRadius,u=Number.isNaN(a.columnWidth)?s.columnWidth:a.columnWidth,p=a.axisInnerRadius,g=a.axisOuterRadius),{innerRadius:c,outerRadius:h,columnWidth:u,axisInnerRadius:p,axisOuterRadius:g,startAngle:r,endAngle:l}},fromFn:(s,a,n)=>{n=ZD(s,a,n),t.calculate(s,a,n);const{startAngle:r,endAngle:l}=t.from(a);let c,h,u,p,g;n==="removed"||n==="updated"?(c=s.innerRadius,h=s.outerRadius,u=s.columnWidth,p=s.axisInnerRadius,g=s.axisOuterRadius):(c=e,h=e,u=a.columnWidth,p=a.axisInnerRadius,g=a.axisOuterRadius);const m=gj.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{innerRadius:c,outerRadius:h,columnWidth:u,axisInnerRadius:p,axisOuterRadius:g,startAngle:r,endAngle:l,phase:m}}}}function yj(e,{innerRadius:t,outerRadius:i,columnWidth:o,axisInnerRadius:s,axisOuterRadius:a,startAngle:n,endAngle:r}){return{innerRadius:t,outerRadius:i,columnWidth:o,axisInnerRadius:s,axisOuterRadius:a,startAngle:n,endAngle:r}}var{SectorBox:xh,motion:fj}=uj;function bg(e){const{negative:t,innerRadius:i,outerRadius:o,stackInnerRadius:s,stackOuterRadius:a}=e;return{innerRadius:t?a:s,outerRadius:t?s:a,clipInnerRadius:t?o:i,clipOuterRadius:t?i:o}}function xj(e){const t=XD();return{toFn:(s,a,n)=>{const{startAngle:r,endAngle:l}=t.to(a);let c,h,u;if(n==="removed")c=e,h=e,u=new xh(r,l,c,h);else{let p,g;({innerRadius:c,outerRadius:h,clipInnerRadius:p,clipOuterRadius:g}=bg(a)),Number.isNaN(c)&&(c=e),Number.isNaN(h)&&(h=e),Number.isNaN(p)&&(p=e),Number.isNaN(g)&&(g=e),u=new xh(r,l,p,g)}return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:u}},fromFn:(s,a,n)=>{n=ZD(s,a,n),t.calculate(s,a,n);const{startAngle:r,endAngle:l}=t.from(a);let c,h,u;n==="removed"||n==="updated"?(c=s.innerRadius,h=s.outerRadius,u=s.clipSector):(c=e,h=e),u??(u=new xh(r,l,c,h));const p=fj.NODE_UPDATE_STATE_TO_PHASE_MAPPING[n];return{innerRadius:c,outerRadius:h,startAngle:r,endAngle:l,clipSector:u,phase:p}}}}function Sj(e,t){const{startAngle:i,endAngle:o}=t,{innerRadius:s,outerRadius:a,clipInnerRadius:n,clipOuterRadius:r}=bg(t),l=new xh(i,o,n,r);return{innerRadius:s,outerRadius:a,startAngle:i,endAngle:o,clipSector:l}}var{Sector:bj,SectorBox:vj}=F3,vg=class extends YD{constructor(e){super(e,{animationResetFns:{item:Sj}}),this.properties=new fe}setZIndex(e){return super.setZIndex(e),this.contentGroup.zIndex=[0,xg.FOREGROUND,e],this.highlightGroup.zIndex=[0,xg.HIGHLIGHT,e],this.labelGroup.zIndex=[0,xg.LABEL,e],!0}getStackId(){return`nightingale-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new bj}updateItemPath(e,t,i){const{negative:o}=t;if(e.centerX=0,e.centerY=0,e.startOuterCornerRadius=o?0:this.properties.cornerRadius,e.endOuterCornerRadius=o?0:this.properties.cornerRadius,e.startInnerCornerRadius=o?this.properties.cornerRadius:0,e.endInnerCornerRadius=o?this.properties.cornerRadius:0,i){const{startAngle:s,endAngle:a}=t,{innerRadius:n,outerRadius:r,clipInnerRadius:l,clipOuterRadius:c}=bg(t);e.innerRadius=n,e.outerRadius=r,e.startAngle=s,e.endAngle=a,e.clipSector=new vj(s,a,l,c)}}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return xj(e)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};vg.className="NightingaleSeries",vg.type="nightingale";import{_ModuleSupport as Mj}from"ag-charts-community";import{boolean as QD,commonSeriesOptionsDefs as Dj,constant as kj,number as Ij,required as Mg,string as Ds,undocumented as qD}from"ag-charts-core";var{nightingaleSeriesThemeableOptionsDef:Aj}=Mj,Dg={...Dj,...Aj,type:Mg(kj("nightingale")),angleKey:Mg(Ds),radiusKey:Mg(Ds),angleName:Ds,radiusName:Ds,legendItemName:Ds,grouped:QD,stacked:QD,stackGroup:Ds,normalizedTo:Ij};Dg.angleKeyAxis=qD(Ds),Dg.radiusKeyAxis=qD(Ds);import{FILL_GRADIENT_RADIAL_SERIES_DEFAULTS as Nj,FILL_IMAGE_DEFAULTS as Lj,FILL_PATTERN_DEFAULTS as Tj,LABEL_BOXING_DEFAULTS as wj,MULTI_SERIES_HIGHLIGHT_STYLE as Cj,POLAR_AXIS_SHAPE as JD,POLAR_AXIS_TYPE as ek}from"ag-charts-core";var Oj={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",Nj],["image",Lj],["pattern",Tj]]},stroke:{$if:[{$eq:[{$palette:"type"},"inbuilt"]},{$ref:"chartBackgroundColor"},{$palette:"stroke"}]},strokeWidth:1,label:{...wj,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:{...Cj,bringToFront:!1}},axes:{[ek.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:JD.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[ek.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:JD.CIRCLE}}}},tk={type:"series",name:"nightingale",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,stackedByDefault:!0,version:V3,dependencies:[B3],options:Dg,defaultAxes:{angle:{type:VD.ANGLE_CATEGORY},radius:{type:VD.RADIUS_NUMBER}},axisKeys:{[BD.X]:"xKeyAxis",[BD.Y]:"yKeyAxis"},themeTemplate:Oj,create:e=>new vg(e)};import{VERSION as Ej}from"ag-charts-community";import{_ModuleSupport as ik}from"ag-charts-community";import{StateMachine as Pj,cachedTextMeasurer as Rj,isArray as _j,measureTextSegments as zj,mergeDefaults as ok,toPlainText as sk,toTextString as Bj}from"ag-charts-core";import{_ModuleSupport as Vj}from"ag-charts-community";import{Property as $e}from"ag-charts-core";var{SeriesProperties:Fj,makeSeriesTooltip:Hj,Label:ak,DropShadow:Kj}=Vj,Wj=class extends ak{},kg=class extends ak{constructor(){super(...arguments),this.spacing=0}};d([$e],kg.prototype,"spacing",2),d([$e],kg.prototype,"placement",2);var qe=class extends Fj{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 Kj().set({enabled:!1}),this.label=new Wj,this.stageLabel=new kg,this.tooltip=Hj()}getStyle(e=0){const{fills:t,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r}=this;return{fill:t[e%t.length],fillOpacity:o,stroke:i[e%i.length],strokeWidth:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:1}}};d([$e],qe.prototype,"stageKey",2),d([$e],qe.prototype,"valueKey",2),d([$e],qe.prototype,"fills",2),d([$e],qe.prototype,"fillOpacity",2),d([$e],qe.prototype,"strokes",2),d([$e],qe.prototype,"strokeWidth",2),d([$e],qe.prototype,"strokeOpacity",2),d([$e],qe.prototype,"lineDash",2),d([$e],qe.prototype,"lineDashOffset",2),d([$e],qe.prototype,"direction",2),d([$e],qe.prototype,"reverse",2),d([$e],qe.prototype,"spacing",2),d([$e],qe.prototype,"aspectRatio",2),d([$e],qe.prototype,"itemStyler",2),d([$e],qe.prototype,"shadow",2),d([$e],qe.prototype,"label",2),d([$e],qe.prototype,"stageLabel",2),d([$e],qe.prototype,"tooltip",2);function nk(e,{x:t,y:i,top:o,right:s,bottom:a,left:n}){e.x0=t-o/2,e.x1=t+o/2,e.x2=t+a/2,e.x3=t-a/2,e.y0=i-n/2,e.y1=i-s/2,e.y2=i+s/2,e.y3=i+n/2}function Gj(e){return{fromFn:(s,a)=>{const{x:n,y:r}=a;let{top:l,right:c,bottom:h,left:u}=a;return e==="vertical"?(l=0,h=0):(u=0,c=0),{x:n,y:r,top:l,right:c,bottom:h,left:u}},toFn:(s,a)=>{const{x:n,y:r,top:l,right:c,bottom:h,left:u}=a;return{x:n,y:r,top:l,right:c,bottom:h,left:u}},applyFn:nk}}var{valueProperty:rk,SeriesNodePickMode:lk,createDatumId:jj,BBox:Ig,Group:Ag,Selection:Er,Text:Ng,PointerEvents:ck,fromToMotion:$j,seriesLabelFadeInAnimation:Uj,getLabelStyles:Yj}=ik,Lg=class extends ik.DataModelSeries{constructor(e){super({moduleCtx:e,categoryKey:void 0,pickModes:[lk.EXACT_SHAPE_MATCH,lk.NEAREST_NODE]}),this.properties=new qe,this.itemGroup=this.contentGroup.appendChild(new Ag({name:"itemGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new Ag({name:"itemLabelGroup"})),this.stageLabelGroup=this.contentGroup.appendChild(new Ag({name:"stageLabelGroup"})),this.datumSelection=Er.select(this.itemGroup,()=>this.nodeFactory()),this.labelSelection=Er.select(this.itemLabelGroup,Ng),this.stageLabelSelection=Er.select(this.stageLabelGroup,Ng),this.highlightLabelSelection=Er.select(this.highlightLabelGroup,Ng),this.highlightDatumSelection=Er.select(this.highlightNodeGroup,()=>this.nodeFactory()),this.animationState=new Pj("empty",{empty:{update:{target:"ready",action:()=>this.animateEmptyUpdateReady()},reset:"empty",skip:"ready"},ready:{clear:"empty",reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable()),this.itemLabelGroup.pointerEvents=ck.None,this.stageLabelGroup.pointerEvents=ck.None,this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",t=>this.onLegendItemClick(t)))}nodeFactory(){return new no}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:o}}=this,{stageKey:s,valueKey:a}=this.properties,n="category",r="number",l=(u,p,g)=>i&&o.getItemEnabled({seriesId:t,itemId:g}),c=this.visible?{}:{forceValue:0},h=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[rk(s,n,{id:"xValue",allowNullKey:h}),rk(a,r,{id:"yValue",...c,validation:l,invalidValue:0})]})}createNodeData(){const{id:e,dataModel:t,processedData:i,properties:o,visible:s,ctx:{legendManager:a}}=this,{stageKey:n,valueKey:r,direction:l,reverse:c=l==="horizontal",spacing:h,aspectRatio:u,label:p,stageLabel:g}=o;if(t==null||i==null)return;const m=l==="horizontal",y=t.resolveColumnById(this,"xValue",i),x=t.resolveColumnById(this,"yValue",i),f=t.getDomain(this,"xValue","value",i).domain,b=t.getDomain(this,"yValue","value",i).domain,S=this.ctx.domManager.isRtl,v=Rj(g),M=g.placement==="after"===S;let D,I;m?(D="center",I=g.placement==="before"?"bottom":"top"):(D=M?"right":"left",I="middle");const A=g.enabled?[]:void 0;let k=0,N=0,L=0;const T=i.dataSources.get(this.id)?.data??[];for(const[G,$]of T.entries()){const J=y[G];if(J===void 0&&!this.properties.allowNullKeys)continue;const ae=x[G],ne=s&&a.getItemEnabled({seriesId:e,itemId:G});if(L+=ae,A==null)continue;const he=this.getLabelText(J,$,n,"x",f,this.properties.stageLabel,{datum:$,value:ae,stageKey:n,valueKey:r},this.properties.allowNullKeys??!1),{width:Ae,height:_t}=_j(he)?zj(he,p):v.measureLines(Bj(he));k=Math.max(k,Ae),N=Math.max(N,_t),A.push({x:Number.NaN,y:Number.NaN,text:he,textAlign:D,textBaseline:I,visible:ne})}const P=this._nodeDataDependencies?.seriesRectWidth??0,R=this._nodeDataDependencies?.seriesRectHeight??0,w=h*(i.input.count-1);let O;if(m){const G=N+g.spacing;O=new Ig(0,g.placement==="before"?G:0,P,R-G)}else{const G=k+g.spacing;O=new Ig(M?G:0,0,P-G,R)}if(u!=null&&u!==0){const G=l==="horizontal"?1/u:u,$=Math.min(O.width,O.height*G),J=$/G;O=new Ig(O.x+(O.width-$)/2,O.y+(O.height-J)/2,$,J)}let B,E;m?E=g.placement==="before"?O.y-g.spacing:O.y+O.height+g.spacing:B=M?O.x-g.spacing:O.x+O.width+g.spacing;const C=O.width-(m?w:0),_=O.height-(m?0:w);if(C<0||_<0)return;const z=[],K=[];let F=0,Z=0;for(const[G,$]of T.entries()){const J=y[G];if(J===void 0&&!this.properties.allowNullKeys)continue;const ae=x[G],ne=s&&a.getItemEnabled({seriesId:e,itemId:G}),he=F+ae,Ae=(F+he)/(2*L),_t=(he-F)/L,se=m?C*Ae+h*G:C*.5,Q=m?_*.5:_*Ae+h*G,_e=O.x+se,Je=O.y+Q;if(A!=null){const Le=A[Z++];Le.x=B??_e,Le.y=E??Je}let le,ue,ee,Ne;if(m){const Le=C*_t;le=Le,ee=Le;const Xt=(se+Le/2)*(_/O.width),Li=(se-Le/2)*(_/O.width);ue=c?O.height-Xt:Xt,Ne=c?O.height-Li:Li}else{const Le=_*_t;ue=Le,Ne=Le;const Xt=(Q-Le/2)*(C/O.height),Li=(Q+Le/2)*(C/O.height);le=c?O.width-Xt:Xt,ee=c?O.width-Li:Li}const at=this.getLabelText(ae,$,r,"y",b,p,{datum:$,value:ae,stageKey:n,valueKey:r}),Yt={x:_e,y:Je,text:at,textAlign:"center",textBaseline:"middle",visible:ne};K.push(Yt),z.push({series:this,datum:$,datumIndex:G,index:G,xValue:J,yValue:ae,x:_e,y:Je,top:le,right:ue,bottom:ee,left:Ne,label:Yt,enabled:ne,midPoint:{x:_e,y:Je},style:this.getItemStyle({datumIndex:G,datum:$},!1)}),F=he}return{itemId:e,nodeData:z,labelData:K,stageLabelData:A,bounds:O}}updateSelections(){this.nodeDataRefresh&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}update({seriesRect:e}){this.checkResize(e);const{datumSelection:t,labelSelection:i,stageLabelSelection:o,highlightDatumSelection:s,highlightLabelSelection:a}=this;this.updateSelections(),this.contentGroup.visible=this.visible,this.contentGroup.opacity=this.getOpacity();let n=this.ctx.highlightManager?.getActiveHighlight();n!=null&&(n.series!==this||n.datum==null)&&(n=void 0);const r=this.contextNodeData?.nodeData??[],l=this.contextNodeData?.labelData??[],c=this.contextNodeData?.stageLabelData??[];this.datumSelection=this.updateDatumSelection({nodeData:r,datumSelection:t}),this.updateDatumStyles({datumSelection:t,isHighlight:!1}),this.updateDatumNodes({datumSelection:t,isHighlight:!1}),this.labelSelection=this.updateLabelSelection({labelData:l,labelSelection:i}),this.updateLabelNodes({labelSelection:i,labelProperties:this.properties.label}),this.stageLabelSelection=this.updateStageLabelSelection({stageLabelData:c,stageLabelSelection:o}),this.updateLabelNodes({labelSelection:o,labelProperties:this.properties.stageLabel,checkActiveHighlight:!0});const h=this.getHighlightLabelData(l,n)??[];this.highlightLabelSelection=a.update(h),this.updateLabelNodes({labelSelection:this.highlightLabelSelection,labelProperties:this.properties.label,isHighlight:!0}),this.highlightDatumSelection=this.updateDatumSelection({nodeData:n==null?[]:[n],datumSelection:s}),this.updateDatumStyles({datumSelection:s,isHighlight:!0}),this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("update")}updateDatumSelection(e){return e.datumSelection.update(e.nodeData)}getItemStyle({datumIndex:e,datum:t},i){const{properties:o}=this,{itemStyler:s}=o,a=this.getHighlightStyle(i,e);let r=ok(a,o.getStyle(e));if(s!=null&&e!=null){const l=this.cachedDatumCallback(jj(e,i?"highlight":"node"),()=>{const c=this.makeItemStylerParams(t,e,i,r);return this.callWithContext(s,c)});l&&(r=ok(l,r))}return r}makeItemStylerParams(e,t,i,o){const{id:s,properties:a}=this,{stageKey:n,valueKey: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,stageKey:n,valueKey:r,highlightState:c,...o,fill:h}}updateDatumStyles({datumSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getItemStyle(o,t)})}updateDatumNodes({datumSelection:e}){const{properties:t}=this,{shadow:i}=t,o=this.contextNodeData?.bounds,s=o?{series:o,axis:o}:void 0;e.each((a,n)=>{a.setStyleProperties(n.style,s),nk(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(),{labelSelection:i,labelProperties:o,isHighlight:s=!1,checkActiveHighlight:a=!1}=e;i.each((n,r,l)=>{const{visible:c,x:h,y:u,text:p,textAlign:g,textBaseline:m}=r,y=s||a&&t?.datumIndex===l,x=this.getHighlightStyle(y,l),f=Yj(this,void 0,this.properties,o,y,t),{color:b,fontSize:S,fontStyle:v,fontWeight:M,fontFamily:D}=f;n.visible=c,n.x=h,n.y=u,n.text=p,n.fill=b,n.opacity=(x.opacity??1)*(f.fillOpacity??1),n.fillOpacity=(x.opacity??1)*(f.fillOpacity??1),n.fontStyle=v,n.fontWeight=M,n.fontSize=S,n.fontFamily=D,n.textAlign=g,n.textBaseline=m,n.setBoxing(f)})}getHighlightLabelData(e,t){if(t?.label)return[{...t.label}]}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:o,properties:s}=this,{stageKey:a,valueKey:n,tooltip:r}=s;if(!i||!o)return;const l=o.dataSources.get(this.id)?.data[e],c=i.resolveColumnById(this,"xValue",o)[e],h=i.resolveColumnById(this,"yValue",o)[e],u=this.properties.allowNullKeys??!1;if(c===void 0&&!u)return;const p=this.getLabelText(c,l,a,"x",i.getDomain(this,"xValue","value",o).domain,this.properties.stageLabel,{datum:l,value:c,stageKey:a,valueKey:n}),g=this.getItemStyle({datumIndex:e,datum:l},!1);return this.formatTooltipWithContext(r,{symbol:this.legendItemSymbol(e),data:[{label:sk(p),value:sk(h)}]},{seriesId:t,datum:l,title:void 0,stageKey:a,valueKey:n,...g})}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}pickNodeClosestDatum({x:e,y:t}){let i=1/0,o;return this.datumSelection.each((s,a)=>{const n=s.distanceSquared(e,t);n{const h=r[c],u=this.properties.allowNullKeys??!1;if(!(h==null&&!u))return{legendType:"category",id:o,datum:l,itemId:c,seriesId:o,enabled:a&&s.getItemEnabled({seriesId:o,itemId:c}),label:{text:String(h)},symbol:this.legendItemSymbol(c),hideInLegend:!n}}).filter(l=>l!=null)}animateReset(){this.ctx.animationManager.skipCurrentBatch(),this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(){const{datumSelection:e,labelSelection:t,properties:i}=this,o=Gj(i.direction);$j(this.id,"nodes",this.ctx.animationManager,[e],o),Uj(this,"labels",this.ctx.animationManager,t)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.label.itemStyler!=null}};Lg.className="PyramidSeries",Lg.type="pyramid";import{_ModuleSupport as Xj}from"ag-charts-community";import{commonSeriesOptionsDefs as Zj,constant as Qj,required as Tg,string as hk}from"ag-charts-core";var{pyramidSeriesThemeableOptionsDef:qj}=Xj,Jj={...qj,...Zj,type:Tg(Qj("pyramid")),stageKey:Tg(hk),valueKey:Tg(hk)};import{DEFAULT_SHADOW_COLOUR as e$,FILL_GRADIENT_LINEAR_DEFAULTS as t$,FILL_IMAGE_DEFAULTS as i$,FILL_PATTERN_DEFAULTS as o$,LABEL_BOXING_DEFAULTS as dk}from"ag-charts-core";var s$={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",t$],["pattern",o$],["image",i$]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},label:{...dk,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},stageLabel:{...dk,enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:12},shadow:{enabled:!1,color:e$,xOffset:3,yOffset:3,blur:5},highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.4}}}},uk={type:"series",name:"pyramid",chartType:"standalone",enterprise:!0,solo:!0,version:Ej,dependencies:[xn],options:Jj,themeTemplate:s$,create:e=>new Lg(e)};import{PolarChartModule as a$,VERSION as n$}from"ag-charts-community";import{ChartAxisDirection as pk,POLAR_AXIS_TYPE as gk}from"ag-charts-core";import{FILL_GRADIENT_LINEAR_DEFAULTS as r$,FILL_GRADIENT_RADIAL_REVERSED_DEFAULTS as l$,FILL_IMAGE_DEFAULTS as mk,FILL_PATTERN_DEFAULTS as yk,LABEL_BOXING_DEFAULTS as c$,MARKER_SERIES_HIGHLIGHT_STYLE as h$,POLAR_AXIS_TYPE as d$,SAFE_STROKE_FILL_OPERATION as u$,mergeDefaults as fk}from"ag-charts-core";var xk={series:{stroke:{$palette:"stroke"},label:{...c$,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},marker:{enabled:!0,fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",l$],["image",mk],["pattern",yk]]},stroke:{$palette:"stroke"},fillOpacity:1,shape:"circle",size:6,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",1,0]}},highlight:h$,tooltip:{range:{$path:["/tooltip/range","nearest"]}}},axes:{[d$.ANGLE_CATEGORY]:{label:{spacing:10}}}},p$=fk({series:{stroke:u$,strokeWidth:2}},xk),g$=fk({series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",r$],["image",mk],["pattern",yk]]},fillOpacity:.8,strokeWidth:2,marker:{enabled:!1}}},xk);import{_ModuleSupport as Sk}from"ag-charts-community";import{ChartAxisDirection as bk}from"ag-charts-core";import{_ModuleSupport as Sh}from"ag-charts-community";import{ChartAxisDirection as Ai,extent as m$,isFiniteNumber as vk,isNumberEqual as Mk,mergeDefaults as y$}from"ag-charts-core";import{_ModuleSupport as f$}from"ag-charts-community";import{Property as ot}from"ag-charts-core";var{Label:x$,SeriesMarker:S$,SeriesProperties:b$,makeSeriesTooltip:v$}=f$,Ue=class extends b${constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",this.stroke="black",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.rotation=0,this.marker=new S$,this.label=new x$,this.tooltip=v$(),this.connectMissingData=!1}};d([ot],Ue.prototype,"angleKey",2),d([ot],Ue.prototype,"radiusKey",2),d([ot],Ue.prototype,"angleName",2),d([ot],Ue.prototype,"radiusName",2),d([ot],Ue.prototype,"angleKeyAxis",2),d([ot],Ue.prototype,"radiusKeyAxis",2),d([ot],Ue.prototype,"legendItemName",2),d([ot],Ue.prototype,"stroke",2),d([ot],Ue.prototype,"strokeWidth",2),d([ot],Ue.prototype,"strokeOpacity",2),d([ot],Ue.prototype,"lineDash",2),d([ot],Ue.prototype,"lineDashOffset",2),d([ot],Ue.prototype,"rotation",2),d([ot],Ue.prototype,"styler",2),d([ot],Ue.prototype,"marker",2),d([ot],Ue.prototype,"label",2),d([ot],Ue.prototype,"tooltip",2),d([ot],Ue.prototype,"connectMissingData",2);var{DEFAULT_POLAR_DIRECTION_KEYS:M$,DEFAULT_POLAR_DIRECTION_NAMES:D$,PolarAxis:k$,SeriesNodePickMode:Dk,keyProperty:I$,valueProperty:A$,fixNumericExtent:N$,seriesLabelFadeInAnimation:L$,markerFadeInAnimation:T$,resetMarkerFn:w$,resetLabelFn:C$,animationValidation:O$,computeMarkerFocusBounds:E$,BBox:P$,Group:R$,Path:_$,Selection:wg,Text:z$,Marker:B$,updateLabelNode:kk,getMarkerStyles:V$}=Sh,F$=class extends Sh.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},Cg=class extends Sh.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"angleValue",propertyKeys:M$,propertyNames:D$,pickModes:[Dk.NEAREST_NODE,Dk.EXACT_SHAPE_MATCH],canHaveAxes:!0,animationResetFns:{item:w$,label:C$},clipFocusBox:!1}),this.NodeEvent=F$,this.lineGroup=this.contentGroup.appendChild(new R$({name:"radar-line"})),this.lineSelection=wg.select(this.lineGroup,_$),this.resetInvalidToZero=!1,this.circleCache={r:0,cx:0,cy:0},this.lineGroup.zIndex=0,this.itemGroup.zIndex=1}renderToOffscreenCanvas(){return(this.nodeData?.length??0)>0&&this.getDrawingMode(!1)==="cutout"||super.renderToOffscreenCanvas()}nodeFactory(){return new B$}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===Ai.Angle){const o=t.getDomain(this,"angleValue","key",i).domain,s=t.getKeySortMetadata(this,"angleValue",i);return{domain:o,sortMetadata:s}}else{const o=t.getDomain(this,"radiusValue","value",i).domain,s=m$(o.length===0?o:[0].concat(o));return{domain:N$(s)}}}async processData(e){const{angleKey:t,radiusKey:i}=this.properties,o=[];this.ctx.animationManager.isSkipped()||o.push(O$());const s=this.axes[Ai.Radius]?.scale.type,a=this.axes[Ai.Angle]?.scale.type,n=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[I$(t,a,{id:"angleValue",allowNullKey:n}),A$(i,s,{id:"radiusValue",invalidValue:void 0}),...o]}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,o=this.circleCache;return e===o.r&&t===o.cx&&i===o.cy?!1:(this.circleCache={r:e,cx:t,cy:i},!0)}getAxisInnerRadius(){const e=this.axes[Ai.Radius];return e instanceof k$?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:o,angleName:s,radiusName:a,legendItemName:n,marker:r,label:l}=this.properties,c=this.axes[Ai.Angle]?.scale,h=this.axes[Ai.Radius]?.scale;if(!c||!h)return;const u=t.resolveKeysById(this,"angleValue",e),p=t.resolveColumnById(this,"radiusValue",e),g=this.getAxisInnerRadius(),m=this.getSeriesDomain(Ai.Radius).domain,y=e.dataSources.get(this.id)?.data??[],x=this.properties.allowNullKeys??!1,f=[];for(let b=0;b0&&(R="left");let w="bottom";Mk(k,0)?w="middle":k>0&&(w="top"),T={x:N+A*r.size,y:L+k*r.size,text:P,textAlign:R,textBaseline:w}}}f.push({series:this,datum:S,datumIndex:b,index:b,point:{x:N,y:L,size:r.size},midPoint:{x:N,y:L},label:T,angleValue:v,radiusValue:M,missing:!vk(D)||!vk(I)})}return{itemId:o,nodeData:f,labelData:f,styles:V$(this,this.properties,r)}}update({seriesRect:e}){const t=this.checkResize(e),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));const s=this.ctx.chartService.highlight?.drawingMode??"overlay";this.updateMarkers(this.itemSelection,!1,"overlay"),this.updateMarkers(this.highlightSelection,!0,s),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=wg.select(this.itemGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,o=this.visible&&e.shape&&i?this.nodeData:[];this.itemSelection.update(o)}updateHighlightSelection(){const{marker:e,styler:t}=this.properties;e.isDirty()&&(this.highlightSelection.clear(),this.highlightSelection.cleanup(),this.highlightSelection=wg.select(this.highlightGroup,()=>this.nodeFactory(),!1));const i=t==null?e.enabled:this.getStyle().marker.enabled,o=this.ctx.highlightManager?.getActiveHighlight(),s=this.visible&&e.shape&&i&&o?.datum?[{...o}]:[];this.highlightSelection.update(s)}getMarkerFill(e){return e?.fill??this.getStyle().marker.fill}getDatumStylerProperties(e){const{id:t,properties:i}=this,{angleKey:o,radiusKey:s}=i;return{seriesId:t,datum:e,angleKey:o,radiusKey:s}}updateDatumStyles(e,t){const i=this.ctx.highlightManager.getActiveHighlight();e.each((o,s)=>{const a=this.getHighlightState(i,t,s.datumIndex),n=this.getStyle(a),{stroke:r,strokeWidth:l,strokeOpacity:c}=n;s.style=this.getMarkerStyle(this.properties.marker,s,this.getDatumStylerProperties(s.datum),{isHighlight:t,highlightState:a},n.marker,{stroke:r,strokeWidth:l,strokeOpacity:c})})}updateMarkers(e,t,i){const o=this.getShapeFillBBox(),{contextNodeData:s}=this;if(!s)return;const a=this.ctx.highlightManager.getActiveHighlight();i=this.getDrawingMode(t,i),e.each((n,r)=>{const l=r.style??s.styles[this.getHighlightState(a,t,r.datumIndex)];this.applyMarkerStyle(l,n,r.point,o),n.drawingMode=i})}updateLabels(){const{properties:e}=this,t=this.ctx.highlightManager?.getActiveHighlight(),i=t?.series===this&&t?.datum?[{...t}]:[];this.labelSelection.update(this.nodeData).each((o,s)=>{s.label&&(o.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1,kk(this,o,e,e.label,s.label,!1,t))}),this.highlightLabelSelection.update(i).each((o,s)=>{s.label&&(o.fillOpacity=this.getHighlightStyle(!0,s.datumIndex).opacity??1,kk(this,o,e,e.label,s.label,!0,t))})}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,axes:s,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:u,marker:p}=a,g=s[Ai.Angle],m=s[Ai.Radius];if(!i||!o||!g||!m)return;const y=o.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"angleValue",o)[e],f=i.resolveColumnById(this,"radiusValue",o)[e],b=this.properties.allowNullKeys??!1;if(x===void 0&&!b)return;const S=this.getMarkerStyle(p,{datum:y,datumIndex:e},this.getDatumStylerProperties(y),{isHighlight:!1});return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(g,"tooltip",x,y,n,void 0,b),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:this.getAxisValueText(m,"tooltip",f,y,l,void 0),missing:Sh.isTooltipValueMissing(f)}]},{seriesId:t,datum:y,title:r,angleKey:n,radiusKey:l,angleName:r,radiusName:c,legendItemName:h,...S})}legendItemSymbol(){const{stroke:e,strokeWidth:t,strokeOpacity:i,lineDash:o,marker:s}=this.getStyle();return{marker:{shape:s.shape,enabled:s.enabled||t<=0,fill:this.getMarkerFill()??s.stroke??e??"rgba(0, 0, 0, 0)",stroke:s.stroke??e??"rgba(0, 0, 0, 0)",fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity,strokeWidth:s.strokeWidth,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},line:{enabled:!0,stroke:e,strokeOpacity:i,strokeWidth:t,lineDash:o}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:o}=this,{radiusKey:s,radiusName:a,legendItemName:n,showInLegend:r}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:o&&i.getItemEnabled({seriesId:t,itemId:s}),label:{text:n??a??s},symbol:this.legendItemSymbol(),legendItemName:n,hideInLegend:!r}]}pickNodeClosestDatum(e){const{nodeData:t,centerX:i,centerY:o}=this,{x:s,y:a}=e,n=this.radius;if(Math.hypot(s-i,a-o)>n+this.maxChartMarkerSize)return;let l=1/0,c;for(const h of t){const{point:{x:u=Number.NaN,y:p=Number.NaN}={}}=h;if(Number.isNaN(u)||Number.isNaN(p))continue;const g=Math.hypot(e.x-u-i,e.y-p-o);gthis.animatePaths(o),onStop:()=>this.animatePaths(1)}),T$(this,i,"added",this.getAnimationDrawingModes(),e),L$(this,"labels",i,t,this.highlightLabelSelection)}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(),o=this.getStyle();e.fill=void 0,e.stroke=o.stroke,e.strokeWidth=o.strokeWidth,e.strokeOpacity=o.strokeOpacity,e.lineDash=o.lineDash,e.lineDashOffset=o.lineDashOffset,t.clear(!0);for(const{x:s,y:a,moveTo:n}of i)n?t.moveTo(s,a):t.lineTo(s,a);return e.checkPathDirty(),o}}getStylerResult(e,t){const{styler:i}=this.properties;if(i){const o=this.makeStylerParams(t),s=this.cachedCallWithContext(i,o)??{},a=this.ctx.optionsGraphService.resolvePartial(["series",`${this.declarationOrder}`],s,{pick:!1});a&&(e=a)}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 E$(this,e)}hasItemStylers(){return this.properties.styler!=null||this.properties.marker.itemStyler!=null||this.properties.label.itemStyler!=null}};Cg.className="RadarSeries";import"ag-charts-community";import{Property as Ik}from"ag-charts-core";var Og=class extends Ue{constructor(){super(...arguments),this.fill="black",this.fillOpacity=1}};d([Ik],Og.prototype,"fill",2),d([Ik],Og.prototype,"fillOpacity",2);var{Group:H$,HighlightState:K$,Path:W$,PointerEvents:Ak,Selection:G$,toHighlightString:j$}=Sk,Eg=class extends Cg{constructor(e){super(e),this.properties=new Og,this.areaGroup=this.contentGroup.appendChild(new H$({name:"radar-area"})),this.areaSelection=G$.select(this.areaGroup,W$),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();return t.marker.fill??t.fill}updatePathNodes(){const e=this.getPathNodesStyle(),{fill:t,fillOpacity:i,strokeWidth:o,stroke:s,strokeOpacity:a,lineDash:n,lineDashOffset:r,opacity:l}=e,c=this.getLineNode();c&&c.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:Ak.None,opacity:l,stroke:s,strokeWidth:o,strokeOpacity:a,lineDash:n,lineDashOffset:r});const h=this.getAreaNode();h&&(h.setStyleProperties({fill:t,fillOpacity:i,stroke:void 0},this.getShapeFillBBox()),h.setProperties({lineJoin:"round",pointerEvents:Ak.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 Sk.PolarAxis?r:void 0},i=t(bk.Radius),o=t(bk.Angle);if(!i?.isReversed())return e;const a=o?.getAxisLinePoints()?.points??[];return e.concat(...a)}resetPaths(){const e=super.resetPaths(),t=this.getAreaNode();if(t){const{path:i}=t,o=this.getAreaPoints(),s=e??this.getStyle(),a=this.getShapeFillBBox();t.setStyleProperties({fill:s.fill,stroke:void 0,fillOpacity:s.fillOpacity,lineDash:s.lineDash,lineDashOffset:s.lineDashOffset},a),t.lineJoin=t.lineCap="round",i.clear(!0);for(const{x:n,y:r,moveTo:l,arc:c,radius:h=0,startAngle:u=0,endAngle:p=0}of o)c?i.arc(n,r,h,u,p):l?i.moveTo(n,r):i.lineTo(n,r);return i.closePath(),t.checkPathDirty(),s}}makeStylerParams(e){const{properties:t}=this,i=j$(e??K$.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,fill:t.fill,fillOpacity:t.fillOpacity,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,fill:i,fillOpacity:o,lineDash:s,lineDashOffset:a,stroke:n,strokeOpacity:r,strokeWidth:l}=this.properties,{size:c,shape:h,fill:u="transparent",fillOpacity:p}=t,g=this.getStylerResult({},e);return g.marker??(g.marker={}),{fill:g.fill??i,fillOpacity:g.fillOpacity??o,lineDash:g.lineDash??s,lineDashOffset:g.lineDashOffset??a,stroke:g.stroke??n,strokeOpacity:g.strokeOpacity??r,strokeWidth:g.strokeWidth??l,marker:{enabled:g.marker.enabled??t.enabled,fill:g.marker.fill??u,fillOpacity:g.marker.fillOpacity??p,shape:g.marker.shape??h,size:g.marker.size??c,lineDash:g.marker.lineDash??t.lineDash??s,lineDashOffset:g.marker.lineDashOffset??t.lineDashOffset??a,stroke:g.marker.stroke??t.stroke??n,strokeOpacity:g.marker.strokeOpacity??t.strokeOpacity??r,strokeWidth:g.marker.strokeWidth??t.strokeWidth??l}}}};Eg.className="RadarAreaSeries",Eg.type="radar-area";import{_ModuleSupport as $$}from"ag-charts-community";import{commonSeriesOptionsDefs as U$,constant as Y$,required as Pg,string as fa,undocumented as Nk}from"ag-charts-core";var{radarAreaSeriesThemeableOptionsDef:X$}=$$,Rg={...U$,...X$,type:Pg(Y$("radar-area")),angleKey:Pg(fa),radiusKey:Pg(fa),angleName:fa,radiusName:fa,legendItemName:fa};Rg.angleKeyAxis=Nk(fa),Rg.radiusKeyAxis=Nk(fa);var Lk={type:"series",name:"radar-area",chartType:"polar",enterprise:!0,version:n$,dependencies:[a$],options:Rg,defaultAxes:{angle:{type:gk.ANGLE_CATEGORY},radius:{type:gk.RADIUS_NUMBER}},axisKeys:{[pk.Angle]:"angleKeyAxis",[pk.Radius]:"radiusKeyAxis"},themeTemplate:g$,create:e=>new Eg(e)};import{PolarChartModule as Z$,VERSION as Q$}from"ag-charts-community";import{ChartAxisDirection as Tk,POLAR_AXIS_TYPE as wk}from"ag-charts-core";import{_ModuleSupport as q$}from"ag-charts-community";var{HighlightState:J$,PointerEvents:e5,toHighlightString:t5}=q$,_g=class extends Cg{constructor(){super(...arguments),this.properties=new Ue}updatePathSelections(){this.lineSelection.update(this.visible?[!0]:[])}updatePathNodes(){const e=this.getLineNode();if(!e)return;const t=this.getPathNodesStyle(),{strokeWidth:i,stroke:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,opacity:r}=t;e.setProperties({fill:void 0,lineJoin:"round",lineCap:"round",pointerEvents:e5.None,opacity:r,stroke:o,strokeWidth:i,strokeOpacity:s,lineDash:a,lineDashOffset:n})}makeStylerParams(e){const{properties:t}=this,i=t5(e??J$.None);return{marker:{fill:t.marker.fill,fillOpacity:t.marker.fillOpacity,size:t.marker.size,shape:t.marker.shape,stroke:t.marker.stroke,strokeOpacity:t.marker.strokeOpacity,strokeWidth:t.marker.strokeWidth,lineDash:t.marker.lineDash,lineDashOffset:t.marker.lineDashOffset},highlightState:i,lineDash:t.lineDash,lineDashOffset:t.lineDashOffset,seriesId:this.id,stroke:t.stroke,strokeOpacity:t.strokeOpacity,strokeWidth:t.strokeWidth,angleKey:t.angleKey,radiusKey:t.radiusKey}}getStyle(e){const{marker:t,lineDash:i,lineDashOffset:o,stroke:s,strokeOpacity:a,strokeWidth:n}=this.properties,{size:r,shape:l,fill:c="transparent",fillOpacity:h}=t,u=this.getStylerResult({},e);return u.marker??(u.marker={}),{lineDash:u.lineDash??i,lineDashOffset:u.lineDashOffset??o,stroke:u.stroke??s,strokeOpacity:u.strokeOpacity??a,strokeWidth:u.strokeWidth??n,marker:{enabled:u.marker.enabled??t.enabled,fill:u.marker.fill??c,fillOpacity:u.marker.fillOpacity??h,shape:u.marker.shape??l,size:u.marker.size??r,lineDash:u.marker.lineDash??t.lineDash??i,lineDashOffset:u.marker.lineDashOffset??t.lineDashOffset??o,stroke:u.marker.stroke??t.stroke??s,strokeOpacity:u.marker.strokeOpacity??t.strokeOpacity??a,strokeWidth:u.marker.strokeWidth??t.strokeWidth??n}}}};_g.className="RadarLineSeries",_g.type="radar-line";import{_ModuleSupport as i5}from"ag-charts-community";import{commonSeriesOptionsDefs as o5,constant as s5,required as zg,string as xa,undocumented as Ck}from"ag-charts-core";var{radarLineSeriesThemeableOptionsDef:a5}=i5,Bg={...o5,...a5,type:zg(s5("radar-line")),angleKey:zg(xa),radiusKey:zg(xa),angleName:xa,radiusName:xa,legendItemName:xa};Bg.angleKeyAxis=Ck(xa),Bg.radiusKeyAxis=Ck(xa);var Ok={type:"series",name:"radar-line",chartType:"polar",enterprise:!0,version:Q$,dependencies:[Z$],options:Bg,defaultAxes:{angle:{type:wk.ANGLE_CATEGORY},radius:{type:wk.RADIUS_NUMBER}},axisKeys:{[Tk.Angle]:"angleKeyAxis",[Tk.Radius]:"radiusKeyAxis"},themeTemplate:p$,create:e=>new _g(e)};import{PolarChartModule as n5,VERSION as r5}from"ag-charts-community";import{ChartAxisDirection as Ek,POLAR_AXIS_TYPE as Pk}from"ag-charts-core";import{_ModuleSupport as Pr}from"ag-charts-community";import{ChartAxisDirection as uo,angleBetween as l5,isDefined as c5,isGradientFill as Rk}from"ag-charts-core";import{_ModuleSupport as h5}from"ag-charts-community";import{Property as Pe}from"ag-charts-core";var{SeriesProperties:d5,makeSeriesTooltip:u5,Label:p5}=h5,Ie=class extends d5{constructor(){super(...arguments),this.angleKeyAxis="angle",this.radiusKeyAxis="radius",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 p5,this.tooltip=u5()}getStyle(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,cornerRadius:r}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n,cornerRadius:r,opacity:1}}};d([Pe],Ie.prototype,"angleKey",2),d([Pe],Ie.prototype,"radiusKey",2),d([Pe],Ie.prototype,"angleName",2),d([Pe],Ie.prototype,"radiusName",2),d([Pe],Ie.prototype,"angleKeyAxis",2),d([Pe],Ie.prototype,"radiusKeyAxis",2),d([Pe],Ie.prototype,"legendItemName",2),d([Pe],Ie.prototype,"fill",2),d([Pe],Ie.prototype,"fillOpacity",2),d([Pe],Ie.prototype,"stroke",2),d([Pe],Ie.prototype,"strokeWidth",2),d([Pe],Ie.prototype,"strokeOpacity",2),d([Pe],Ie.prototype,"lineDash",2),d([Pe],Ie.prototype,"lineDashOffset",2),d([Pe],Ie.prototype,"cornerRadius",2),d([Pe],Ie.prototype,"styler",2),d([Pe],Ie.prototype,"itemStyler",2),d([Pe],Ie.prototype,"rotation",2),d([Pe],Ie.prototype,"stackGroup",2),d([Pe],Ie.prototype,"normalizedTo",2),d([Pe],Ie.prototype,"label",2),d([Pe],Ie.prototype,"tooltip",2);import{_ModuleSupport as g5}from"ag-charts-community";var{SectorBox:_k,motion:m5}=g5;function y5(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 zk(e){return{toFn:(o,s,a)=>{let n,r,l,c,h;return a==="removed"?(n=e,r=e,l=s.innerRadius,c=s.outerRadius,h=new _k(n,r,l,c)):(n=s.startAngle,r=s.endAngle,l=Number.isNaN(s.innerRadius)?o.innerRadius:s.innerRadius,c=Number.isNaN(s.outerRadius)?o.outerRadius:s.outerRadius,h=s.clipSector),{startAngle:n,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h}},fromFn:(o,s,a)=>{a=y5(o,s,a);let n,r,l,c,h;a==="removed"||a==="updated"?(n=o.startAngle,r=o.endAngle,l=o.innerRadius,c=o.outerRadius,h=o.clipSector):(n=e,r=e,l=s.innerRadius,c=s.outerRadius),h??(h=new _k(n,r,l,c));const u=m5.NODE_UPDATE_STATE_TO_PHASE_MAPPING[a];return{startAngle:n,endAngle:r,innerRadius:l,outerRadius:c,clipSector:h,phase:u}}}}function f5(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:x5,DEFAULT_POLAR_DIRECTION_NAMES:S5,PolarAxis:b5,diff:v5,groupAccumulativeValueProperty:Bk,keyProperty:M5,normaliseGroupTo:D5,valueProperty:k5,fixNumericExtent:I5,resetLabelFn:A5,seriesLabelFadeInAnimation:N5,seriesLabelFadeOutAnimation:L5,animationValidation:T5,createDatumId:w5,CategoryScale:C5,Sector:O5,SectorBox:E5,motion:Vk,updateLabelNode:Fk,getItemStyles:P5}=Pr,R5=class extends Pr.SeriesNodeEvent{constructor(e,t,i,o){super(e,t,i,o),this.angleKey=o.properties.angleKey,this.radiusKey=o.properties.radiusKey}},Vg=class extends Pr.PolarSeries{constructor(e){super({moduleCtx:e,categoryKey:"radiusValue",propertyKeys:x5,propertyNames:S5,canHaveAxes:!0,animationResetFns:{item:f5,label:A5}}),this.properties=new Ie,this.NodeEvent=R5,this.groupScale=new C5,this.circleCache={r:0,cx:0,cy:0}}nodeFactory(){return new O5}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return{domain:[]};if(e===uo.Angle){const o=t.getDomain(this,"angleValue-end","value",i).domain,s=[Math.min(o[0],0),Math.max(o[1],0)];return{domain:I5(s)}}else return t.getDomain(this,"radiusValue","key",i)}async processData(e){const{angleKey:t,radiusKey:i,normalizedTo:o}=this.properties,s=!this.ctx.animationManager.isSkipped(),a=this.getStackId(),n=`${a}-trailing`,r=[];c5(o)&&r.push(D5([a,n],Math.abs(o))),this.needsDataModelDiff()&&this.processedData&&r.push(v5(this.id,this.processedData)),s&&r.push(T5());const l=this.visible?{}:{forceValue:0},c=this.axes[uo.Radius]?.scale.type,h=this.axes[uo.Angle]?.scale.type,u=this.properties.allowNullKeys??!1;await this.requestDataModel(e,this.data,{props:[M5(i,c,{id:"radiusValue",allowNullKey:u}),k5(t,h,{id:"angleValue-raw",invalidValue:null,...l}),...Bk(t,"normal",{id:"angleValue-end",rangeId:"angleValue-range",invalidValue:null,groupId:a,separateNegative:!0,...l},h),...Bk(t,"trailing",{id:"angleValue-start",invalidValue:null,groupId:n,separateNegative:!0,...l},h),...r],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}didCircleChange(){const e=this.radius,t=this.centerX,i=this.centerY,o=this.circleCache;return e===o.r&&t===o.cx&&i===o.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[uo.Radius];return e instanceof b5?this.radius*e.innerRadiusRatio:0}createNodeData(){const{processedData:e,dataModel:t}=this;if(!t||e?.type!=="grouped")return;const i=this.axes[uo.Angle],o=this.axes[uo.Radius],s=i?.scale,a=o?.scale;if(!s||!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),h=t.resolveProcessedDataIndexById(this,"angleValue-range");let u=0;o instanceof Ps&&(u=o.groupPaddingInner);const{groupScale:p}=this,{index:g,visibleGroupCount:m}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);p.domain=Array.from({length:m}).map((E,C)=>String(C)),p.range=[0,Math.abs(a.bandwidth??0)],p.paddingInner=m>1?u:0;const y=p.bandwidth>=1?p.bandwidth:p.rawBandwidth,x=i.isReversed(),f=o.isReversed(),b=f?this.radius:this.getAxisInnerRadius(),v=(f?this.getAxisInnerRadius():this.radius)+b,M=this.getSeriesDomain(uo.Angle).domain,{angleKey:D,radiusKey:I,angleName:A,radiusName:k,legendItemName:N,label:L}=this.properties,T=(E,C,_,z)=>{const K=this.getLabelText(C,E,D,"angle",M,L,{value:C,datum:E,angleKey:D,radiusKey:I,angleName:A,radiusName:k,legendItemName:N});if(K)return{x:_,y:z,text:K,textAlign:"center",textBaseline:"middle"}},P=[],R=P5((E,C,_)=>Nn(this,E,C,_)),w={itemId:I,nodeData:P,labelData:P,styles:R};if(!this.visible)return w;const{dataSources:O}=e,B=O.get(this.id)?.data??[];for(const{datumIndex:E,group:C}of t.forEachGroupDatum(this,e)){const _=B[E],z=n[E];if(z===void 0&&!this.properties.allowNullKeys)return;const K=c[E],F=r[E],Z=l[E],G=K>=0&&!Object.is(K,-0),$=C.aggregation[h][G?1:0],J=G===x;let ae=s.convert(F,{clamp:!0}),ne=s.convert(Z,{clamp:!0}),he=s.convert(0,{clamp:!0}),Ae=s.convert($,{clamp:!0});J&&([he,Ae]=[Ae,he],[ae,ne]=[ne,ae]);const se=v-a.convert(z)+p.convert(String(g)),Q=se+y,_e=(se+Q)/2,Je=ae+l5(ae,ne)/2,le=Math.cos(Je)*_e,ue=Math.sin(Je)*_e,ee=this.properties.label.enabled?T(_,K,le,ue):void 0,Ne=new E5(ae,ne,se,Q);P.push({series:this,datum:_,datumIndex:E,point:{x:le,y:ue,size:0},midPoint:{x:le,y:ue},label:ee,angleValue:K,radiusValue:z,innerRadius:se,outerRadius:Q,startAngle:he,endAngle:Ae,clipSector:Ne,reversed:J,index:E})}return w}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 o=this.ctx.highlightManager?.getActiveHighlight();t?o?.datum&&o.series===this&&i.push(o):i=this.nodeData;const{contextNodeData:s}=this;if(!s)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 h=tr(c);if(h==null)return;if(r){const y=this.getHighlightState(o,t,c.datumIndex);c.style=Nn(this,c,t,y)}const u=c.style??s.styles[this.getHighlightState(a,t,c.datumIndex)],p=u.cornerRadius,g=u.fill,m=Rk(g)&&g.bounds!=="item"?{centerX:0,centerY:0}:void 0;l.setStyleProperties(u,n,m),l.lineJoin="round",l.inset=l.stroke==null?0:l.strokeWidth/2,l.startInnerCornerRadius=h.reversed?p:0,l.startOuterCornerRadius=h.reversed?p:0,l.endInnerCornerRadius=h.reversed?0:p,l.endOuterCornerRadius=h.reversed?0:p,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(),i=t?.series===this&&t?.datum?t:void 0,o=i?[i]:[];this.labelSelection.update(this.nodeData).each((s,a)=>{Fk(this,s,e,e.label,a.label,!1,t),s.fillOpacity=this.getHighlightStyle(!1,a.datumIndex).opacity??1}),this.highlightLabelSelection.update(o,void 0,s=>this.getDatumId(s)).each((s,a)=>{Fk(this,s,e,e.label,a.label,!0,t),s.fillOpacity=this.getHighlightStyle(!0,a.datumIndex).opacity??1})}getBarTransitionFunctions(){const e=this.axes[uo.Angle]?.scale;let t=0;if(!e)return zk(t);const i=Math.min(e.domain[0],e.domain[1]),o=Math.max(e.domain[0],e.domain[1]);return i<=0&&o>=0&&(t=e.convert(0)),zk(t)}animateEmptyUpdateReady(){const{labelSelection:e}=this,t=this.getBarTransitionFunctions();Vk.fromToMotion(this.id,"datums",this.ctx.animationManager,[this.itemSelection],t),N5(this,"labels",this.ctx.animationManager,e,this.highlightLabelSelection)}animateClearingUpdateEmpty(){const{itemSelection:e}=this,{animationManager:t}=this.ctx,i=this.getBarTransitionFunctions();Vk.fromToMotion(this.id,"datums",t,[e],i),L5(this,"labels",t,this.labelSelection,this.highlightLabelSelection)}getTooltipContent(e){const{id:t,dataModel:i,processedData:o,axes:s,properties:a}=this,{angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,tooltip:u}=a,p=s[uo.Angle],g=s[uo.Radius],m=this.nodeData?.[e];if(!i||!o||!p||!g||!m)return;const y=o.dataSources.get(this.id)?.data[e],x=i.resolveKeysById(this,"radiusValue",o)[e],f=i.resolveColumnById(this,"angleValue-raw",o)[e];if(x===void 0&&!this.properties.allowNullKeys)return;const b=Nn(this,m,!1);return this.formatTooltipWithContext(u,{heading:this.getAxisValueText(g,"tooltip",x,y,l,void 0),symbol:this.legendItemSymbol(),data:[{label:r,fallbackLabel:n,value:this.getAxisValueText(p,"tooltip",f,y,n,void 0),missing:Pr.isTooltipValueMissing(f)}]},{seriesId:t,datum:y,title:r,angleKey:n,angleName:r,radiusKey:l,radiusName:c,legendItemName:h,...b})}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.itemSelection.nodes())}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:n}=Sg(this,!1,Pr.HighlightState.None),r={fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:i,strokeOpacity:o,strokeWidth:s,lineDash:a,lineDashOffset:n};return Rk(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:o,angleName:s,legendItemName:a,showInLegend:n}=this.properties;return[{legendType:"category",id:t,itemId:o,seriesId:t,enabled:i,label:{text:a??s??o},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!n}]}getDatumId(e){return w5(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}};Vg.className="RadialBarSeries",Vg.type="radial-bar";import{_ModuleSupport as _5}from"ag-charts-community";import{boolean as Hk,commonSeriesOptionsDefs as z5,constant as B5,number as V5,required as Fg,string as ks,undocumented as Kk}from"ag-charts-core";var{radialBarSeriesThemeableOptionsDef:F5}=_5,Hg={...z5,...F5,type:Fg(B5("radial-bar")),angleKey:Fg(ks),radiusKey:Fg(ks),angleName:ks,radiusName:ks,legendItemName:ks,grouped:Hk,stacked:Hk,stackGroup:ks,normalizedTo:V5};Hg.angleKeyAxis=Kk(ks),Hg.radiusKeyAxis=Kk(ks);import{FILL_GRADIENT_CONIC_SERIES_DEFAULTS as H5,FILL_IMAGE_DEFAULTS as K5,FILL_PATTERN_DEFAULTS as W5,LABEL_BOXING_DEFAULTS as G5,MULTI_SERIES_HIGHLIGHT_STYLE as j5,POLAR_AXIS_TYPE as $5}from"ag-charts-core";var U5={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",H5],["image",K5],["pattern",W5]]},stroke:{$palette:"stroke"},strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...G5,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},highlight:j5},axes:{[$5.RADIUS_CATEGORY]:{innerRadiusRatio:.2,groupPaddingInner:.2,paddingInner:.2,paddingOuter:.1}}},Wk={type:"series",name:"radial-bar",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:r5,dependencies:[n5],options:Hg,defaultAxes:{angle:{type:Pk.ANGLE_NUMBER},radius:{type:Pk.RADIUS_CATEGORY}},axisKeys:{[Ek.Angle]:"angleKeyAxis",[Ek.Radius]:"radiusKeyAxis"},themeTemplate:U5,create:e=>new Vg(e)};import{PolarChartModule as Y5,VERSION as X5}from"ag-charts-community";import{ChartAxisDirection as Gk,POLAR_AXIS_TYPE as jk}from"ag-charts-core";import{_ModuleSupport as Z5}from"ag-charts-community";import{ChartAxisDirection as Q5}from"ag-charts-core";import{Property as $k}from"ag-charts-core";var Kg=class extends fe{};d([$k],Kg.prototype,"columnWidthRatio",2),d([$k],Kg.prototype,"maxColumnWidthRatio",2);var{PolarAxis:q5,RadialColumnShape:J5,getRadialColumnWidth:eU}=Z5,Wg=class extends YD{constructor(e){super(e,{animationResetFns:{item:yj}}),this.properties=new Kg}getStackId(){return`radarColumn-stack-${this.seriesGrouping?.groupIndex??this.id}-yValues`}nodeFactory(){return new J5}getColumnTransitionFunctions(){const e=this.isRadiusAxisReversed()?this.radius:this.getAxisInnerRadius();return mj(e)}isRadiusAxisCircle(){const e=this.axes[Q5.Radius];return e instanceof q5?e.shape==="circle":!1}updateItemPath(e,t,i){e.isBeveled=this.isRadiusAxisCircle(),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:o=.5}=this.properties;return eU(e,t,this.radius,i,o)}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.styler!=null||this.properties.label.itemStyler!=null}};Wg.className="RadialColumnSeries",Wg.type="radial-column";import{_ModuleSupport as tU}from"ag-charts-community";import{boolean as Uk,commonSeriesOptionsDefs as iU,constant as oU,number as sU,required as Gg,string as Is,undocumented as Yk}from"ag-charts-core";var{radialColumnSeriesThemeableOptionsDef:aU}=tU,jg={...iU,...aU,type:Gg(oU("radial-column")),angleKey:Gg(Is),radiusKey:Gg(Is),angleName:Is,radiusName:Is,legendItemName:Is,grouped:Uk,stacked:Uk,stackGroup:Is,normalizedTo:sU};jg.angleKeyAxis=Yk(Is),jg.radiusKeyAxis=Yk(Is);import{FILL_GRADIENT_RADIAL_SERIES_DEFAULTS as nU,FILL_IMAGE_DEFAULTS as rU,FILL_PATTERN_DEFAULTS as lU,LABEL_BOXING_DEFAULTS as cU,MULTI_SERIES_HIGHLIGHT_STYLE as hU,POLAR_AXIS_SHAPE as Xk,POLAR_AXIS_TYPE as Zk}from"ag-charts-core";var dU={series:{fill:{$applySwitch:[{$path:"type"},{$palette:"fill"},["gradient",nU],["image",rU],["pattern",lU]]},stroke:{$palette:"stroke"},columnWidthRatio:.5,maxColumnWidthRatio:.5,strokeWidth:{$isUserOption:["./stroke",1,0]},label:{...cU,enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},highlight:hU},axes:{[Zk.ANGLE_CATEGORY]:{shape:{$findFirstSiblingNotOperation:Xk.CIRCLE},groupPaddingInner:0,paddingInner:0,label:{spacing:10}},[Zk.RADIUS_NUMBER]:{shape:{$findFirstSiblingNotOperation:Xk.CIRCLE},innerRadiusRatio:.5}}},Qk={type:"series",name:"radial-column",chartType:"polar",enterprise:!0,stackable:!0,groupable:!0,version:X5,dependencies:[Y5],options:jg,defaultAxes:{angle:{type:jk.ANGLE_CATEGORY},radius:{type:jk.RADIUS_NUMBER}},axisKeys:{[Gk.Angle]:"angleKeyAxis",[Gk.Radius]:"radiusKeyAxis"},themeTemplate:dU,create:e=>new Wg(e)};import{VERSION as uU}from"ag-charts-community";import{FONT_SIZE_RATIO as pU,LABEL_BOXING_DEFAULTS as qk,SAFE_RANGE2_OPERATION as gU,SAFE_STROKE_FILL_OPERATION as mU,radialGaugeSeriesOptionsDef as yU}from"ag-charts-core";import{_ModuleSupport as Sa}from"ag-charts-community";import{StateMachine as fU,isBetweenAngles as bh,isNumberEqual as Jk,mergeDefaults as xU,normalizeAngle360 as SU,normalizeAngle360Inclusive as eI,tickFormat as bU,toPlainText as vU,toRadians as Rr}from"ag-charts-core";import{_ModuleSupport as MU}from"ag-charts-community";var{SvgPath:DU,Rotatable:kU,Translatable:IU,Scalable:AU}=MU,$g=class extends kU(AU(IU(DU))){constructor(){super(...arguments),this.scalingCenterX=.5,this.scalingCenterY=.5,this.rotationCenterX=.5,this.rotationCenterY=.5}};$g.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 vh}from"ag-charts-community";import{BaseProperties as _r,PropertiesArray as Ug,Property as V,normalizeAngle360 as NU,normalizeAngle360Inclusive as LU,toDegrees as TU}from"ag-charts-core";var{getColorStops:wU}=vh,{makeSeriesTooltip:CU,SeriesProperties:OU,AxisLabel:EU,Label:PU}=vh,tI=class extends PU{};d([V],tI.prototype,"spacing",2);var mt=class extends _r{constructor(){super(...arguments),this.label=new tI}getStyle(){const{fill:e="black",fillOpacity:t=1,stroke:i="black",strokeWidth:o=0,strokeOpacity:s=1,lineDash:a=[0],lineDashOffset:n=0}=this;return{fill:e,fillOpacity:t,stroke:i,strokeWidth:o,strokeOpacity:s,lineDash:a,lineDashOffset:n}}};d([V],mt.prototype,"text",2),d([V],mt.prototype,"value",2),d([V],mt.prototype,"shape",2),d([V],mt.prototype,"placement",2),d([V],mt.prototype,"spacing",2),d([V],mt.prototype,"size",2),d([V],mt.prototype,"rotation",2),d([V],mt.prototype,"fill",2),d([V],mt.prototype,"fillOpacity",2),d([V],mt.prototype,"stroke",2),d([V],mt.prototype,"strokeWidth",2),d([V],mt.prototype,"strokeOpacity",2),d([V],mt.prototype,"lineDash",2),d([V],mt.prototype,"lineDashOffset",2),d([V],mt.prototype,"label",2);var zi=class extends _r{constructor(){super(...arguments),this.enabled=!0,this.fills=new Ug(vh.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:o,fills:s,fillMode:a,fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}=this;return{fill:i?o??sI(s,a,e,t):"none",fillOpacity:n,stroke:r,strokeWidth:l,strokeOpacity:c,lineDash:h,lineDashOffset:u}}};d([V],zi.prototype,"enabled",2),d([V],zi.prototype,"fills",2),d([V],zi.prototype,"fillMode",2),d([V],zi.prototype,"fill",2),d([V],zi.prototype,"fillOpacity",2),d([V],zi.prototype,"stroke",2),d([V],zi.prototype,"strokeWidth",2),d([V],zi.prototype,"strokeOpacity",2),d([V],zi.prototype,"lineDash",2),d([V],zi.prototype,"lineDashOffset",2);var zr=class extends _r{constructor(){super(...arguments),this.values=void 0,this.step=void 0,this.minSpacing=0,this.maxSpacing=1e3}};d([V],zr.prototype,"values",2),d([V],zr.prototype,"step",2),d([V],zr.prototype,"minSpacing",2),d([V],zr.prototype,"maxSpacing",2);var RU=class extends EU{},Et=class extends _r{constructor(){super(...arguments),this.min=0,this.max=1,this.fills=new Ug(vh.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 zr,this.label=new RU}getStyle(e,t,i){const{fill:o,fills:s,defaultFill:a,fillMode:n,fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u,lineDashOffset:p}=this;return{fill:o??(e&&s.length===0?a:void 0)??sI(s,n,t,i),fillOpacity:r,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u,lineDashOffset:p}}};d([V],Et.prototype,"min",2),d([V],Et.prototype,"max",2),d([V],Et.prototype,"fills",2),d([V],Et.prototype,"fillMode",2),d([V],Et.prototype,"fill",2),d([V],Et.prototype,"fillOpacity",2),d([V],Et.prototype,"stroke",2),d([V],Et.prototype,"strokeWidth",2),d([V],Et.prototype,"strokeOpacity",2),d([V],Et.prototype,"lineDash",2),d([V],Et.prototype,"lineDashOffset",2),d([V],Et.prototype,"defaultFill",2),d([V],Et.prototype,"interval",2),d([V],Et.prototype,"label",2);var Bi=class extends _r{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}};d([V],Bi.prototype,"enabled",2),d([V],Bi.prototype,"radiusRatio",2),d([V],Bi.prototype,"spacing",2),d([V],Bi.prototype,"fill",2),d([V],Bi.prototype,"fillOpacity",2),d([V],Bi.prototype,"stroke",2),d([V],Bi.prototype,"strokeWidth",2),d([V],Bi.prototype,"strokeOpacity",2),d([V],Bi.prototype,"lineDash",2),d([V],Bi.prototype,"lineDashOffset",2);var iI=class extends en{};d([V],iI.prototype,"text",2);var oI=class extends lc{};d([V],oI.prototype,"text",2);var Fe=class extends OU{constructor(){super(...arguments),this.startAngle=0,this.endAngle=0,this.segmentation=new kr,this.defaultColorRange=[],this.targets=new Ug(mt),this.defaultTarget=new mt,this.outerRadiusRatio=1,this.innerRadiusRatio=1,this.cornerRadius=0,this.cornerMode="container",this.spacing=0,this.scale=new Et,this.bar=new zi,this.needle=new Bi,this.label=new iI,this.secondaryLabel=new oI,this.tooltip=CU()}};d([V],Fe.prototype,"value",2),d([V],Fe.prototype,"startAngle",2),d([V],Fe.prototype,"endAngle",2),d([V],Fe.prototype,"segmentation",2),d([V],Fe.prototype,"defaultColorRange",2),d([V],Fe.prototype,"targets",2),d([V],Fe.prototype,"defaultTarget",2),d([V],Fe.prototype,"outerRadiusRatio",2),d([V],Fe.prototype,"innerRadiusRatio",2),d([V],Fe.prototype,"outerRadius",2),d([V],Fe.prototype,"innerRadius",2),d([V],Fe.prototype,"cornerRadius",2),d([V],Fe.prototype,"cornerMode",2),d([V],Fe.prototype,"spacing",2),d([V],Fe.prototype,"scale",2),d([V],Fe.prototype,"bar",2),d([V],Fe.prototype,"needle",2),d([V],Fe.prototype,"label",2),d([V],Fe.prototype,"secondaryLabel",2),d([V],Fe.prototype,"tooltip",2);function sI(e,t,i,o){const{domain:s,range:a}=o,[n,r]=a,l=NU((n+r)/2+Math.PI),c=LU(r-n);return{type:"gradient",gradient:"conic",colorSpace:"oklch",colorStops:wU(e,i,s,t).map(({color:u,stop:p})=>(p=Math.min(Math.max(p,0),1),p=(n+c*p-l)/(2*Math.PI),p=(p%1+1)%1,{stop:p,color:u})),bounds:"series",rotation:TU(l)+90}}import{_ModuleSupport as _U}from"ag-charts-community";import{toPlainText as Yg}from"ag-charts-core";var{SectorBox:Xg}=_U;function zU(e){const{startAngle:t,endAngle:i,clipStartAngle:o,clipEndAngle:s,innerRadius:a,outerRadius:n}=e;if(!(o==null||s==null))return new Xg(Math.max(o,t),Math.min(s,i),a,n)}function aI(e,t,i){return Math.max(e,i.startAngle)<=Math.min(t,i.endAngle)}function Zg(e){return e.clipStartAngle!=null&&e.clipEndAngle!=null}function Qg(e,t){const{clipStartAngle:i,clipEndAngle:o,innerRadius:s,outerRadius:a}=e;return new Xg(i,t?i:o,s,a)}function nI(e,t){const i=e?"initial":"update";return{node:{fromFn(a,n){const r=a.previousDatum;let{startAngle:l,endAngle:c}=r??n;const h=r!=null&&Zg(r)?Qg(r,e):void 0,u=Zg(n)?Qg(n,e):void 0;let p;return h!=null&&u!=null?p=h:h==null&&u!=null?(p=u,l=n.startAngle,c=n.endAngle):h!=null&&u==null?(p=void 0,l=n.startAngle,c=n.endAngle):e&&(c=l),{startAngle:l,endAngle:c,clipSector:p,phase:i}},toFn(a,n){const{startAngle:r,endAngle:l}=n;let c;return Zg(n)&&(c=Qg(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 Xg(Math.max(r,c.startAngle),Math.min(l,c.endAngle),c.innerRadius,c.outerRadius));const h=c==null||aI(r,l,c);a.startAngle=r,a.endAngle=l,a.clipSector=c,a.visible=h}},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 qg(e,t){const{startAngle:i,endAngle:o}=t,s=zU(t),a=s==null||aI(i,o,s);return{startAngle:i,endAngle:o,clipSector:s,visible:a}}function rI(e,t){const{angle:i}=t;return{rotation:i}}var BU={top:0,middle:.5,bottom:1};function VU(e,t,i,o,s,a){const{padding:n,textAlign:r,verticalAlign:l}=o;let c,h;if(i.each((M,D)=>{D.label==="primary"?c=D:D.label==="secondary"&&(h=D)}),c==null)return;const u=Dr(e.id,t,c,a?.label);if(u==null)return;const p=h==null?void 0:Dr(e.id,t,h,a?.secondaryLabel),g={padding:n},m=r==="center"?2:1,y=l==="middle"?2:1,x=M=>({width:Math.sqrt(Math.max(s**2-(M/y)**2,0))*m,height:Math.min(M,y*s),meta:null});let f,b,S;if(h!=null&&p!=null){const M=bS(Yg(u),c,Yg(p),h,g,x);f=M?.label,b=M?.secondaryLabel,S=M?.height??0}else{const M=lr(Yg(u),c,g,x);f=M?.[0],b=void 0,S=M?.[0].height??0}const v=S*BU[l];i.each((M,D)=>{let I;if(D.label==="primary"?I=f:D.label==="secondary"&&(I=b),I==null){M.visible=!1;return}M.visible=!0,M.text=I.text,M.fontSize=I.fontSize,M.lineHeight=I.lineHeight,M.textAlign=r,M.textBaseline="middle";const A=D.label==="primary"?I.height/2:S-I.height/2;M.y=D.centerY+A-v,M.x=D.centerX})}var{fromToMotion:Br,resetMotion:lI,SeriesNodePickMode:cI,createDatumId:Jg,sectorBox:FU,BBox:HU,Group:As,PointerEvents:Mh,Selection:Ns,Sector:KU,SectorBox:WU,Transformable:GU,TransformableText:jU,Text:hI,Marker:$U}=Sa,UU={inside:90,middle:0,outside:-90},YU=[{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"},{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"}],XU=[{textAlign:"right",textBaseline:"bottom"},{textAlign:"left",textBaseline:"bottom"},{textAlign:"left",textBaseline:"top"},{textAlign:"right",textBaseline:"top"}],em=class extends Sa.Series{constructor(e){super({moduleCtx:e,pickModes:[cI.EXACT_SHAPE_MATCH,cI.NEAREST_NODE]}),this.centerX=0,this.centerY=0,this.radius=0,this.textAlign="center",this.verticalAlign="middle",this.properties=new Fe,this.scale=new Gm,this.scaleGroup=this.contentGroup.appendChild(new As({name:"scaleGroup"})),this.itemGroup=this.contentGroup.appendChild(new As({name:"itemGroup"})),this.itemNeedleGroup=this.contentGroup.appendChild(new As({name:"itemNeedleGroup"})),this.itemTargetGroup=this.contentGroup.appendChild(new As({name:"itemTargetGroup"})),this.itemTargetLabelGroup=this.contentGroup.appendChild(new As({name:"itemTargetLabelGroup"})),this.itemLabelGroup=this.contentGroup.appendChild(new As({name:"itemLabelGroup"})),this.highlightTargetGroup=this.highlightGroup.appendChild(new As({name:"itemTargetLabelGroup"})),this.tickGroup=this.contentGroup.appendChild(new As({name:"tickGroup"})),this.scaleSelection=Ns.select(this.scaleGroup,()=>this.nodeFactory()),this.datumSelection=Ns.select(this.itemGroup,()=>this.nodeFactory()),this.needleSelection=Ns.select(this.itemNeedleGroup,$g),this.targetSelection=Ns.select(this.itemTargetGroup,()=>this.markerFactory()),this.targetLabelSelection=Ns.select(this.itemTargetLabelGroup,hI),this.labelSelection=Ns.select(this.itemLabelGroup,hI),this.highlightTargetSelection=Ns.select(this.highlightTargetGroup,()=>this.markerFactory()),this.tickSelection=Ns.select(this.tickGroup,Sa.TransformableText),this.datumUnion=new OM,this.animationState=new fU("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=Mh.None,this.tickGroup.pointerEvents=Mh.None,this.itemNeedleGroup.pointerEvents=Mh.None,this.itemLabelGroup.pointerEvents=Mh.None}get hasData(){return this.properties.value!=null}nodeFactory(){return new KU}markerFactory(){const e=new $U;return e.size=1,e}processData(){this.nodeDataRefresh=!0,this.animationState.transition("updateData")}formatLabel(e){const{min:t,max:i}=this.properties.scale;return PM(e,{min:t,max:i})}layoutScale(){const{scale:e,properties:t}=this,{seriesRectWidth:i,seriesRectHeight:o}=this.nodeDataDependencies,{scale:s,outerRadius:a}=this.properties,{min:n,max:r,label:l,interval:c}=s,h=Rr(t.startAngle-90),u=Rr(t.endAngle-90),g=eI(u-h)>Math.PI,m=g||bh(1.5*Math.PI,h,u),y=g||bh(0*Math.PI,h,u),x=g||bh(.5*Math.PI,h,u),f=g||bh(1*Math.PI,h,u);let b;f&&!y?b="right":!f&&y?b="left":b="center";let S;m&&!x?S="bottom":!m&&x?S="top":S="middle";const v=FU({startAngle:h,endAngle:u,innerRadius:0,outerRadius:.5}),M=-(v.x+v.width/2)*2,D=-(v.y+v.height/2)*2,I=Math.min(i/v.width,o/v.height);e.domain=[n,r],e.range=[h,u],e.arcLength=I/2;const{maxSpacing:A,minSpacing:k}=c,{arcLength:N}=e,L=A?Math.floor(N/A):1,T=k?Math.floor(N/k):1/0,P=Math.floor(4/Math.PI*Math.abs(e.range[0]-e.range[1])),R=Math.max(L,Math.min(T,P)),w=c.values??e.ticks({nice:[!1,!1],interval:c.step,minTickCount:L,maxTickCount:T,tickCount:R})?.ticks??[],O=bU(w,typeof l.format=="string"?l.format:void 0),B=[];for(const[K,F]of w.entries()){let Z;l.formatter&&(Z=Sr(this.ctx,l.formatter,{value:F,index:K,domain:e.domain,boundSeries:void 0})),Z??(Z=O?.(F)),Z!=null&&B.push({index:K,value:F,text:Z})}const E=.5*I,C=l.enabled&&a==null&&B.length>0?this.getTickLabelInset({tickData:B,radius:E,centerXOffset:M,centerYOffset:D,seriesRectWidth:i,seriesRectHeight:o,spacing:l.spacing,rotation:Rr(l.rotation??0)}):0,_=Math.max(E-C,0),z=a??_;return this.centerX=i/2+M*z,this.centerY=o/2+D*z,this.radius=z,this.textAlign=b,this.verticalAlign=S,B}getShapeFillBBox(){const{centerX:e,centerY:t,radius:i}=this,o=new HU(e-i,t-i,2*i,2*i);return{series:o,axis:o}}getTargets(){const{properties:e}=this,t=e.defaultTarget;return 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:u=t.label.color??"black",fontStyle:p=t.label.fontStyle??"normal",fontWeight:g=t.label.fontWeight??"normal",fontSize:m=t.label.fontSize,fontFamily:y=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:u,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y,spacing:x},style:i.getStyle()}})}getTargetRadius(e){const{radius:t,properties:i}=this,{innerRadiusRatio:o,outerRadiusRatio:s}=i,{placement:a,spacing:n,size:r}=e,l=t*s,c=t*o;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:o,placement:s,label:a}=e,{spacing:n,color:r,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u}=a,p=t.convert(i),g=Math.trunc(SU(p)/(Math.PI/2)),m=o/2+n;let y,x,f,b;switch(s){case"outside":({textAlign:y,textBaseline:x}=YU[g]),f=m*Math.cos(p),b=m*Math.sin(p);break;case"inside":({textAlign:y,textBaseline:x}=XU[g]),f=-m*Math.cos(p),b=-m*Math.sin(p);break;default:y="center",x="bottom",f=0,b=-m;break}return{offsetX:f,offsetY:b,fill:r,textAlign:y,textBaseline:x,fontStyle:l,fontWeight:c,fontSize:h,fontFamily:u,lineHeight:void 0}}createNodeData(){const e=this.layoutScale(),{id:t,scale:i,properties:o,radius:s,centerX:a,centerY:n}=this,{value:r,innerRadiusRatio:l,outerRadiusRatio:c,segmentation:h,cornerRadius:u,cornerMode:p,needle:g,bar:m,scale:y,label:x,secondaryLabel:f}=o,{outerRadius:b=s*c,innerRadius:S=s*l,defaultColorRange:v}=o,M=this.getTargets(),D=[],I=[],A=[],k=[],N=[],L=p==="item",T=i.convert(i.domain[0]),P=i.convert(r),R=Math.ceil(eI(P-T)*s);let w=h.enabled?h.interval.getSegments(i,R):void 0;const O=m.getStyle(v,i),B=y.getStyle(m.enabled,v,i);if(w==null&&L){const E=Math.min(...i.domain),C=Math.max(...i.domain),_={value:r,segmentStart:E,segmentEnd:C},K=Math.min(u,(b-S)/2)/((S+b)/2);D.push({series:this,itemId:"value",datum:_,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:b,innerRadius:S,startAngle:T-K,endAngle:P+K,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:u,endCornerRadius:u,style:O}),N.push({series:this,itemId:"scale",datum:_,datumIndex:{type:0},type:0,centerX:a,centerY:n,outerRadius:b,innerRadius:S,startAngle:i.range[0]-K,endAngle:i.range[1]+K,clipStartAngle:void 0,clipEndAngle:void 0,startCornerRadius:u,endCornerRadius:u,style:B})}else{w??(w=i.domain);for(let E=0;Ethis.formatLabel(J.value)}=x;k.push({label:"primary",centerX:a,centerY:n,text:E,value:r,fill:C,fontSize:_,minimumFontSize:z,fontStyle:K,fontWeight:F,fontFamily:Z,lineHeight:G,formatter:$})}if(!g.enabled&&f.enabled){const{text:E,color:C,fontSize:_,minimumFontSize:z,fontStyle:K,fontWeight:F,fontFamily:Z,lineHeight:G,formatter:$}=f;k.push({label:"secondary",centerX:a,centerY:n,text:E,value:r,fill:C,fontSize:_,minimumFontSize:z,fontStyle:K,fontWeight:F,fontFamily:Z,lineHeight:G,formatter:$})}if(g.enabled){let E=g.radiusRatio==null?S:s*g.radiusRatio;E=Math.max(E-g.spacing,0);const C=i.convert(r);A.push({centerX:a,centerY:n,radius:E,angle:C,series:this})}for(let E=0;EMath.max(...i.domain))continue;const G=this.getTargetRadius(C),$=i.convert(_),J=Rr(C.rotation+UU[C.placement]);I.push({series:this,itemId:`target-${E}`,midPoint:{x:G*Math.cos($)+a,y:G*Math.sin($)+n},datum:{value:_},datumIndex:{type:1,index:E},type:1,value:_,text:z,centerX:a,centerY:n,shape:F,radius:G,angle:$,rotation:J,size:K,label:this.getTargetLabel(C),style:Z})}return{itemId:t,nodeData:D,needleData:A,targetData:I,labelData:k,scaleData:N,tickData:e}}findNodeDatum(e){return FM(this,e)}updateSelections(e){(this.nodeDataRefresh||e)&&(this.contextNodeData=this.createNodeData(),this.nodeDataRefresh=!1)}highlightDatum(e){if(e?.series===this&&e.type===1)return e}update({seriesRect:e}){const{datumSelection:t,labelSelection:i,needleSelection:o,targetSelection:s,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 h=this.contextNodeData?.nodeData??[],u=this.contextNodeData?.labelData??[],p=this.contextNodeData?.needleData??[],g=this.contextNodeData?.targetData??[],m=this.contextNodeData?.scaleData??[],y=this.contextNodeData?.tickData??[],x=this.highlightDatum(this.ctx.highlightManager.getActiveHighlight());this.scaleSelection=this.updateScaleSelection({scaleData:m,scaleSelection:n}),this.updateScaleNodes({scaleSelection:n}),this.needleSelection=this.updateNeedleSelection({needleData:p,needleSelection:o}),this.updateNeedleNodes({needleSelection:o}),this.targetSelection=this.updateTargetSelection({targetData:g,targetSelection:s}),this.updateTargetStyles({targetSelection:s,isHighlight:!1}),this.updateTargetNodes({targetSelection:s}),this.targetLabelSelection=this.updateTargetLabelSelection({targetData:g,targetLabelSelection:a}),this.updateTargetLabelNodes({targetLabelSelection:a}),this.datumSelection=this.updateDatumSelection({nodeData:h,datumSelection:t}),this.updateDatumNodes({datumSelection:t}),this.labelSelection=this.updateLabelSelection({labelData:u,labelSelection:i}),this.updateLabelNodes({labelSelection:i}),this.highlightTargetSelection=this.updateTargetSelection({targetData:x==null?[]:[x],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=>Jg(e.nodeData.length,t.itemId))}updateDatumNodes(e){const{datumSelection:t}=e,{ctx:i,properties:o}=this,{segmentation:s}=o,a=s.spacing??0,n=i.animationManager.isSkipped(),r=this.getShapeFillBBox();t.each((l,c)=>{const{centerX:h,centerY:u,innerRadius:p,outerRadius:g,startCornerRadius:m,endCornerRadius:y}=c;l.centerX=h,l.centerY=u,l.innerRadius=p,l.outerRadius=g,l.pointerEvents=this.properties.bar.enabled?Sa.PointerEvents.All:Sa.PointerEvents.None,l.setStyleProperties(c.style,r),l.startOuterCornerRadius=m,l.startInnerCornerRadius=m,l.endOuterCornerRadius=y,l.endInnerCornerRadius=y,l.radialEdgeInset=(a+l.strokeWidth)/2,l.concentricEdgeInset=l.strokeWidth/2,c.midPoint=l.getBBox().computeCenter(),(n||l.previousDatum==null)&&l.setProperties(qg(l,c))}),this.datumUnion.update(t,this.itemGroup,Sa.Sector,(l,c,h)=>{l.clipSector??(l.clipSector=new WU(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=Sa.PointerEvents.None})}updateScaleSelection(e){return e.scaleSelection.update(e.scaleData,void 0,t=>Jg(e.scaleData.length,t.itemId))}updateScaleNodes(e){const{scaleSelection:t}=e,{segmentation:i}=this.properties,o=i.spacing??0,s=this.getShapeFillBBox();t.each((a,n)=>{const{centerX:r,centerY:l,innerRadius:c,outerRadius:h,startCornerRadius:u,endCornerRadius:p}=n;a.centerX=r,a.centerY=l,a.innerRadius=c,a.outerRadius=h,a.setStyleProperties(n.style,s),a.startOuterCornerRadius=u,a.startInnerCornerRadius=u,a.endOuterCornerRadius=p,a.endInnerCornerRadius=p,a.radialEdgeInset=(o+a.strokeWidth)/2,a.concentricEdgeInset=a.strokeWidth/2,a.setProperties(qg(a,n))})}updateNeedleSelection(e){return e.needleSelection.update(e.needleData,void 0,()=>Jg(0))}updateNeedleNodes(e){const{needleSelection:t}=e,{fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:n,lineDash:r,lineDashOffset:l}=this.properties.needle,c=this.ctx.animationManager.isSkipped();t.each((h,u)=>{const{centerX:p,centerY:g,radius:m}=u,y=m*2;h.d=$g.defaultPathData,h.setStyleProperties({fill:i,fillOpacity:o,stroke:s,strokeOpacity:a,strokeWidth:n/y,lineDash:r.map(x=>x/y),lineDashOffset:l/y}),h.translationX=p,h.translationY=g,h.scalingX=y,h.scalingY=y,c&&h.setProperties(rI(h,u))})}updateTargetSelection(e){return e.targetSelection.update(e.targetData,void 0,t=>t.itemId)}updateTargetStyles({targetSelection:e,isHighlight:t}){e.each((i,o)=>{o.style=this.getTargetStyle(t,o)})}updateTargetNodes({targetSelection:e}){e.each((t,i)=>{const{centerX:o,centerY:s,angle:a,radius:n,shape:r,size:l,rotation:c}=i;t.setStyleProperties(i.style),t.size=l,t.shape=r==="line"?RM:r,t.translationX=o+n*Math.cos(a),t.translationY=s+n*Math.sin(a),t.rotation=a+c})}getTargetStyle(e,{datumIndex:t,style:i}){const o=this.getHighlightStyle(e,t);return xU(o,{...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,o)=>{const{centerX:s,centerY:a,radius:n,angle:r,text:l}=o,{offsetX:c,offsetY:h,fill:u,fontStyle:p,fontWeight:g,fontSize:m,fontFamily:y,textAlign:x,textBaseline:f}=o.label;if(l==null){i.visible=!1;return}i.visible=!0,i.x=s+n*Math.cos(r)+c,i.y=a+n*Math.sin(r)+h,i.text=l,i.fill=u,i.fontStyle=p,i.fontWeight=g,i.fontSize=m,i.fontFamily=y,i.textAlign=x,i.textBaseline=f})}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((o,s)=>{o.fill=s.fill,o.fontStyle=s.fontStyle,o.fontWeight=s.fontWeight,o.fontFamily=s.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:o,centerY:s,properties:a}=this,{enabled:n,color:r,fontFamily:l,fontSize:c,fontStyle:h,fontWeight:u,spacing:p}=a.scale.label,g=Rr(a.scale.label.rotation??0);e.tickSelection.each((m,y)=>{if(!n){m.visible=!1;return}m.visible=!0,m.text=y.text,m.fill=r,m.fontFamily=l,m.fontSize=c,m.fontStyle=h,m.fontWeight=u;const x=t.convert(y.value),{textAlign:f,textBaseline:b}=this.getTickLabelAlign(x),S=o+(i+p)*Math.cos(x),v=s+(i+p)*Math.sin(x);m.textAlign=f,m.textBaseline=b,m.x=S,m.y=v,m.rotationCenterX=S,m.rotationCenterY=v,m.rotation=g})}getTickLabelAlign(e){const t=Math.cos(e),i=Math.sin(e);let o,s;const a=Jk(t,0),n=Jk(i,0),r=t>0&&!a,l=i>0&&!n;return o="right",a?o="center":r&&(o="left"),s="bottom",n?s="middle":l&&(s="top"),{textAlign:o,textBaseline:s}}getTickLabelInset(e){const{tickData:t,radius:i,centerXOffset:o,centerYOffset:s,seriesRectWidth:a,seriesRectHeight:n,spacing:r,rotation:l}=e,{label:c}=this.properties.scale,h=a/2+o*i,u=n/2+s*i,p=new jU;p.fontFamily=c.fontFamily,p.fontSize=c.fontSize,p.fontStyle=c.fontStyle,p.fontWeight=c.fontWeight,p.rotation=l;const g=1e-6;let m=0;for(const y of t){const x=this.scale.convert(y.value),f=Math.cos(x),b=Math.sin(x),S=h+(i+r)*f,v=u+(i+r)*b,{textAlign:M,textBaseline:D}=this.getTickLabelAlign(x);p.text=y.text,p.x=S,p.y=v,p.textAlign=M,p.textBaseline=D,p.rotationCenterX=S,p.rotationCenterY=v;const I=l?GU.toCanvas(p):p.getBBox();if(I==null)continue;const A=I.x,k=I.x+I.width,N=I.y,L=I.y+I.height,T=Math.max(0,-A),P=Math.max(0,k-a),R=Math.max(0,-N),w=Math.max(0,L-n),O=o+f;Math.abs(O)>g&&(P>0&&O>0?m=Math.max(m,P/O):T>0&&O<0&&(m=Math.max(m,T/-O)));const B=s+b;Math.abs(B)>g&&(w>0&&B>0?m=Math.max(m,w/B):R>0&&B<0&&(m=Math.max(m,R/-B)))}return 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:o,verticalAlign:s}=this,{spacing:a,innerRadiusRatio:n}=this.properties;VU(this,this.ctx,t,{padding:a,textAlign:o,verticalAlign:s},i*n,e)}resetAllAnimation(){this.ctx.animationManager.stopByAnimationGroupId(this.id),lI([this.datumSelection],qg),lI([this.needleSelection],rI),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,o,s,a;if(this.labelSelection.each((n,r)=>{n.opacity=1,r.label==="primary"?(i=n.previousDatum?.value??e.from??r.value,o=r.value):r.label==="secondary"&&(s=n.previousDatum?.value??e.from??r.value,a=r.value)}),!this.labelsHaveExplicitText())if(o==null||a==null)this.formatLabelText();else if(i===o&&s===a)this.formatLabelText({label:o,secondaryLabel:a});else{const n=`${this.id}_labels`;t.animate({id:n,groupId:"label",from:{label:i,secondaryLabel:s},to:{label:o,secondaryLabel:a},phase:e.phase??"update",onUpdate:r=>this.formatLabelText(r),onStop:()=>this.formatLabelText({label:o,secondaryLabel:a})})}}animateEmptyUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=nI(!0,this.scale.range[0]);Br(this.id,"node",e,[this.datumSelection],t,(o,s)=>s.itemId),Br(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),Br(this.id,"label",e,[this.labelSelection],EM,(o,s)=>s.label),this.animateLabelText({from:this.properties.scale.min,phase:"initial"})}animateWaitingUpdateReady(){const{animationManager:e}=this.ctx,{node:t,needle:i}=nI(!1,this.scale.range[0]);Br(this.id,"node",e,[this.datumSelection],t,(o,s)=>s.itemId),Br(this.id,"needle",e,[this.needleSelection],i,()=>"needle"),this.animateLabelText()}animateReadyResize(){this.resetAllAnimation()}dataCount(){return Number.NaN}getSeriesDomain(){return{domain:[Number.NaN,Number.NaN]}}getSeriesRange(){return[Number.NaN,Number.NaN]}getLegendData(){return[]}getTooltipContent(e){const{id:t,properties:i}=this,{tooltip:o}=i;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 BM(this,e)}pickFocus(e){return VM(this,e)}getCaptionText(){const{value:e}=this.properties,t=[];return t.push(this.formatLabel(e)),this.labelSelection.each((i,o)=>{const s=Dr(this.id,this.ctx,o);s!=null&&t.push(vU(s))}),t.join(". ")}getCategoryValue(e){}datumIndexForCategoryValue(e){}hasItemStylers(){return this.properties.label.itemStyler!=null}};em.className="RadialGaugeSeries",em.type="radial-gauge";var dI={type:"series",name:"radial-gauge",chartType:"standalone",enterprise:!0,dependencies:[LM],version:uU,options:yU,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]},gU]},scale:{defaultFill:{$path:["/1",{$palette:"fill"},{$palette:"hierarchyColors"}]},stroke:{$path:["/2",mU,{$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:{...qk,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:56,minimumFontSize:18/56,fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}},secondaryLabel:{...qk,enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:pU.LARGE},minimumFontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"}},tooltip:{range:{$path:["/tooltip/range",10]}}}},create:e=>new em(e)};import{VERSION as ZU}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as QU,FILL_IMAGE_DEFAULTS as qU,FILL_PATTERN_DEFAULTS as JU,LABEL_BOXING_DEFAULTS as eY,SAFE_FILLS_OPERATION as tY}from"ag-charts-core";import{_ModuleSupport as iY}from"ag-charts-community";import{Logger as oY,cachedTextMeasurer as sY,calcLineHeight as aY,mergeDefaults as Dh,toPlainText as nY,wrapText as tm}from"ag-charts-core";import{_ModuleSupport as rY}from"ag-charts-community";import{SceneChangeDetection as Ln,Vec2 as st,clamp as lY}from"ag-charts-core";var{BBox:cY,Path:hY}=rY,ba=class extends hY{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),o=Math.max(this.y1,this.y2)-i+this.height;return new cY(e,i,t,o)}updatePath(){const{path:e,inset:t}=this;e.clear();const i=this.height-2*this.inset,o=i/2;let s=this.x1+t,a=this.y1+t;e.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 n=this.x2-t,r=this.y2+t;this.updatePathSection(s,a,n,r,i,-o),e.lineTo(n,r+i),s=n,a=r;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+t,this.y1+t,i,o),e.closePath()}updatePathSection(e,t,i,o,s,a){const{path:n}=this,r=st.from(e,t+a+s/2),l=st.from(i,o+a+s/2);if(Math.abs(l.y-r.y)<2){n.lineTo(l.x,l.y);return}let c=st.angle(st.sub(l,r));c<0&&(c=2*Math.PI+c);const h=0,u=Math.PI/2,p=Math.PI,g=Math.PI*1.5,m=uI(r,l,0),y=uI(r,l,s);if(m.radius=g?(n.arc(r.x,t-m.radius,m.radius,u,u+y.angle,!0),n.arc(l.x,o+y.radius,y.radius,g+y.angle,g),n.lineTo(l.x,l.y)):c>h&&c<=u?(n.arc(r.x,t+y.radius,y.radius,g,g+y.angle),n.arc(l.x,o-m.radius,m.radius,u+m.angle,u,!0),n.lineTo(l.x,l.y)):c>u&&c<=p?(n.arc(r.x,t+y.radius,y.radius-s,g,g+y.angle,!0),n.arc(l.x,o-m.radius,m.radius+s,u+m.angle,u),n.lineTo(l.x,l.y)):(n.arc(r.x,t-m.radius,m.radius+s,u,u+m.angle),n.arc(l.x,o+y.radius,y.radius-s,g+y.angle,g,!0),n.lineTo(l.x,l.y))}};d([Ln()],ba.prototype,"x1",2),d([Ln()],ba.prototype,"x2",2),d([Ln()],ba.prototype,"y1",2),d([Ln()],ba.prototype,"y2",2),d([Ln()],ba.prototype,"height",2),d([Ln()],ba.prototype,"inset",2);function uI(e,t,i){const o=st.angle(st.sub(t,e)),s=st.distance(e,t),a=st.add(e,st.rotate(st.from(s/2,0),o)),n=-1/st.gradient(e,t),r=st.intercept(a,n),l=dY(.1,.5,Math.PI/2-Math.abs(st.gradient(e,t))),c=st.intersectAtX(n,r,e.x),h=Math.max(i,st.distance(e,c)*l);return{angle:st.angle(st.sub(c,e),st.sub(c,a))/-(1.1-l),radius:h}}function dY(e,t,i){return lY(e,(t-e)*i+e,t)}import{_ModuleSupport as uY}from"ag-charts-community";import{BaseProperties as pI,Property as U}from"ag-charts-core";var{FillGradientDefaults:pY,FillPatternDefaults:gY,FillImageDefaults:mY,makeSeriesTooltip:yY,SeriesProperties:fY,Label:xY}=uY,kh=class extends xY{constructor(){super(...arguments),this.spacing=1,this.placement=void 0,this.edgePlacement=void 0}};d([U],kh.prototype,"spacing",2),d([U],kh.prototype,"placement",2),d([U],kh.prototype,"edgePlacement",2);var zo=class extends pI{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}};d([U],zo.prototype,"fill",2),d([U],zo.prototype,"fillOpacity",2),d([U],zo.prototype,"stroke",2),d([U],zo.prototype,"strokeOpacity",2),d([U],zo.prototype,"strokeWidth",2),d([U],zo.prototype,"lineDash",2),d([U],zo.prototype,"lineDashOffset",2),d([U],zo.prototype,"itemStyler",2);var Pt=class extends pI{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}};d([U],Pt.prototype,"spacing",2),d([U],Pt.prototype,"minSpacing",2),d([U],Pt.prototype,"width",2),d([U],Pt.prototype,"alignment",2),d([U],Pt.prototype,"verticalAlignment",2),d([U],Pt.prototype,"sort",2),d([U],Pt.prototype,"fill",2),d([U],Pt.prototype,"fillOpacity",2),d([U],Pt.prototype,"stroke",2),d([U],Pt.prototype,"strokeOpacity",2),d([U],Pt.prototype,"strokeWidth",2),d([U],Pt.prototype,"lineDash",2),d([U],Pt.prototype,"lineDashOffset",2),d([U],Pt.prototype,"itemStyler",2);var He=class extends fY{constructor(){super(...arguments),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 pY,this.fillPatternDefaults=new gY,this.fillImageDefaults=new mY,this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=[],this.strokes=[],this.label=new kh,this.link=new zo,this.node=new Pt,this.tooltip=yY()}getStyle(e,t,i,o){const{fillOpacity:s,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l,fill:c=t[o%t.length],stroke:h=i[o%t.length]}=e?this.link:this.node;return{fill:c,fillOpacity:s,stroke:h,strokeWidth:a,strokeOpacity:n,lineDash:r,lineDashOffset:l}}};d([U],He.prototype,"nodes",2),d([U],He.prototype,"fromKey",2),d([U],He.prototype,"toKey",2),d([U],He.prototype,"idKey",2),d([U],He.prototype,"idName",2),d([U],He.prototype,"labelKey",2),d([U],He.prototype,"labelName",2),d([U],He.prototype,"sizeKey",2),d([U],He.prototype,"sizeName",2),d([U],He.prototype,"fillGradientDefaults",2),d([U],He.prototype,"fillPatternDefaults",2),d([U],He.prototype,"fillImageDefaults",2),d([U],He.prototype,"defaultColorRange",2),d([U],He.prototype,"defaultPatternFills",2),d([U],He.prototype,"fills",2),d([U],He.prototype,"strokes",2),d([U],He.prototype,"label",2),d([U],He.prototype,"link",2),d([U],He.prototype,"node",2),d([U],He.prototype,"tooltip",2);var{Transformable:SY,SeriesNodePickMode:gI,createDatumId:Ih,getShapeStyle:mI,getLabelStyles:bY,Rect:yI,BBox:fI}=iY,im=class extends Qv{constructor(e){super({moduleCtx:e,pickModes:[gI.NEAREST_NODE,gI.EXACT_SHAPE_MATCH]}),this.properties=new He}isLabelEnabled(){return(this.properties.labelKey!=null||this.nodes==null)&&this.properties.label.enabled}linkFactory(){return new ba}nodeFactory(){return new yI}createNodeData(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this.properties.node.width,{nodeGraph:i,links:o,maxPathLength:s}=this.getNodeGraph(this.createNode.bind(this,t),this.createLink,{includeCircularReferences:!1}),a=i;if(a.size===0)return;const n=this.initialiseColumns(s);this.assignNodesToColumns(a,n,s);const r=sY(this.properties.label),{columnLabelInsetBefore:l,columnLabelInsetAfter:c}=this.getColumnLabelInsets(n,r,s),h=(e-t-l-c)/(s-1);this.positionNodesInColumnsX(n,h,l),this.createGhostNodesAndColumnDiffs(a,n),this.weightNodes(n);const u=1,{sizeScale:p,nodeSpacing:g}=this.getScaleAndSpacing(n,u);if(p<0){oY.warnOnce("There was insufficient space to display the Sankey Series. Reduce [node.spacing], [node.minSpacing], or provide a larger container.");return}this.positionNodesInColumnsY(n,u,p,g),this.sortAndPositionLinks(a,p);const m=[],y=[];return this.createNodesNodeData(m,a,n,h,r,y),this.createLinksNodeData(m,o,u,p),{itemId:this.id,nodeData:m,labelData:y}}createNode(e,t){return{...t,x:Number.NaN,y:Number.NaN,width:e,height:Number.NaN}}createLink(e){return{...e,x1:Number.NaN,x2:Number.NaN,y1:Number.NaN,y2:Number.NaN,height:Number.NaN,elbows:[]}}initialiseColumns(e){const t=[];for(let i=0;iy+x.size,0),h.reduce((y,{link:x})=>y+x.size,0));if(c.length===0&&h.length===0||u===0){r.columnIndex=-1;continue}const p=this.getNodeColumn(t,r,i);l.size=u;const{label:g}=this.properties,m=g.enabled?this.getLabelText(l.label,l.datum,n,"label",[],this.properties.label,{datum:l.datum,value:l.label,fromKey:o,toKey:s,sizeKey:a,size:u}):void 0;l.label=nY(m),p.nodes.push(r),p.size+=u,r.columnIndex=p.index}}getNodeColumn(e,t,i){const{node:{alignment:o}}=this.properties,{linksBefore:s,linksAfter:a,maxPathLengthBefore:n,maxPathLengthAfter:r}=t;let l;switch(o){case"left":l=e[n];break;case"right":l=e[i-1-r];break;case"center":{if(s.length!==0)l=e[n];else if(a.length===0)l=e[0];else{const c=a.reduce((h,u)=>Math.min(h,u.node.maxPathLengthBefore),i)-1;l=e[c]}break}case"justify":{l=a.length===0?e[i-1]:e[n];break}}return l}getColumnLabelInsets(e,t,i){const{label:{spacing:o,placement:s,edgePlacement:a},node:{width:n}}=this.properties,r=this._nodeDataDependencies?.seriesRectWidth??0;let l=0,c=0;if(this.isLabelEnabled()&&(a==="outside"||a==null)){const h=(u,p)=>{const g=p;if(g.datum.label==null||g.datum.label==="")return u;let m=(r-n)/(i-1)-o;s==="center"&&a==null&&(m/=2);const y=tm(g.datum.label,{maxWidth:m,maxHeight:g.datum.height,font:this.properties.label,textWrap:"never"});let{width:x}=t.measureLines(y);return s==="center"&&a==null&&(x/=2),Math.max(u,x)};(s!=="right"||a==="outside")&&(l=n+e[0].nodes.reduce(h,0)),(s!=="left"||a==="outside")&&(c=n+e.at(-1).nodes.reduce(h,0))}return{columnLabelInsetBefore:l,columnLabelInsetAfter:c}}positionNodesInColumnsX(e,t,i){for(let o=0;oe.columnIndex;a--){const n=o.link.size,r={ghost:!0,datum:{...e.datum,size:n,y:0,height:0},weight:0,linksBefore:[{node:{columnIndex:a-1,datum:{size:n}}}],linksAfter:[{node:{columnIndex:a+1,datum:{size:n}}}],link:o.link,columnIndex:e.columnIndex,size:e.datum.size,closestColumnDiff:i,fromNode:{y:s.datum.y},toNode:{y:0}};t[a].size+=n,t[a].nodes.push(r)}}}weightNodes(e){const{properties:t}=this;if(t.node.sort==="data")return;if(t.node.sort!=="auto"){for(const s of e)s.nodes.sort((a,n)=>this.sortNodes(a,n));return}const i=e.toSorted((s,a)=>{const n=s.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0);return a.nodes.reduce((l,c)=>Math.max(l,c.datum.size),0)-n}),o={};for(let s=0;sa.weight-n.weight)}for(const s of e){for(const a of s.nodes)"ghost"in a&&a.ghost||(a.weight+=a.linksBefore.reduce((n,r)=>{if(r.node.columnIndex!==s.index-1)return n;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*o[r.node.columnIndex];return Math.max(n,l)},0),a.weight+=a.linksAfter.reduce((n,r)=>{if(r.node.columnIndex!==s.index+1)return n;const l=e[r.node.columnIndex].nodes.indexOf(r.node)*o[r.node.columnIndex];return Math.max(n,l)},0));s.nodes.sort((a,n)=>this.sortNodes(a,n))}}getScaleAndSpacing(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0,o=n=>e.reduce((r,{size:l,nodes:c})=>{const h=i-c.length*t,p=(1-(c.length-1)*n/h)/l;return Math.min(r,p)},1/0);let s=this.properties.node.spacing,a=o(s);for(;a<0&&s>this.properties.node.minSpacing;)s-=1,a=o(s);return{nodeSpacing:s,sizeScale:a}}positionNodesInColumnsY(e,t,i,o){const s=this._nodeDataDependencies?.seriesRectHeight??0;for(const a of e){let n=0;for(const c of a.nodes){const h=s*c.datum.size*i;c.datum.height=Math.max(t,h),n+=h}const r=o*(a.nodes.length-1);let l=0;this.properties.node.verticalAlignment==="bottom"?l=s-n-r:this.properties.node.verticalAlignment==="center"&&(l=(s-n-r)/2);for(const c of a.nodes)c.datum.y=l,l+=s*c.datum.size*i+o,"ghost"in c&&c.ghost&&c.link.elbows.push({x:a.x,y:c.datum.y})}}sortAndPositionLinks(e,t){const i=this._nodeDataDependencies?.seriesRectHeight??0;for(const{datum:o,linksBefore:s,linksAfter:a}of e.values()){let n=o.y;s.sort((l,c)=>this.sortNodes(l.node,c.node));for(const{link:l}of s)l.y2=n,n+=l.size*i*t;let r=o.y;a.sort((l,c)=>this.sortNodes(l.node,c.node,{invertColumnSort:!0}));for(const{link:l}of a)l.y1=r,r+=l.size*i*t}}createNodesNodeData(e,t,i,o,s,a){for(const[n,r]of i.entries()){const l=n===0,c=n===i.length-1;let h=-1/0;r.nodes.sort((u,p)=>u.datum.y-p.datum.y);for(const u of r.nodes){if("ghost"in u&&u.ghost)continue;const{datum:p}=u;p.midPoint={x:p.x+p.width/2,y:p.y+p.height/2},e.push(p),h=this.createNodeLabelData(t,o,s,a,p,l,c,h)}}}createNodeLabelData(e,t,i,o,s,a,n,r){if(s.label==null)return r;const{label:{spacing:l,edgePlacement:c,fontSize:h}}=this.properties,u=this._nodeDataDependencies?.seriesRectWidth??0,p=s.y+s.height/2;let g;if(!a&&!n){const S=aY(h),v=p-S,M=p+S;let D=u;for(const{datum:A}of e.values())A.x>s.x&&Math.max(A.y,v)<=Math.min(A.y+A.height,M)&&(D=Math.min(D,A.x-l));const I=D-s.x-2*l;g=tm(s.label,{maxWidth:I,maxHeight:s.height,font:this.properties.label,textWrap:"never",overflow:"hide"})}if(g==null||g===""){const S=c==null&&(a||n)?l:l*2;g=tm(s.label,{maxWidth:t-S,maxHeight:s.height,font:this.properties.label,textWrap:"never"})}if(g==="")return r;const{height:m}=i.measureLines(g),y=p-m/2,x=p+m/2,{x:f,textAlign:b}=this.getNodeLabelPlacement(s,a,n);return y>=r&&(o.push({x:f,y:p,textAlign:b,text:g,size:s.size,nodeDatum:s,datumIndex:s.datumIndex}),r=x),r}getNodeLabelPlacement(e,t,i){const{label:{spacing:o,placement:s,edgePlacement:a}}=this.properties;let n=e.x+e.width+o,r="left",l=s;return t&&a==null&&s==null&&(l="left"),a==="outside"?(t&&(l="left"),i&&(l="right")):a==="inside"&&(t&&(l="right"),i&&(l="left")),l==="left"?(n=e.x-o,r="right"):l==="center"&&(n=e.x+e.width/2,r="center"),{x:n,textAlign:r}}createLinksNodeData(e,t,i,o){const s=this._nodeDataDependencies?.seriesRectHeight??0,a=this.properties.node.width;for(const n of t){const{fromNode:r,toNode:l,size:c}=n;n.height=Math.max(i,s*c*o),n.x1=r.x+a,n.x2=l.x,n.midPoint={x:(n.x1+n.x2)/2,y:(n.y1+n.y2)/2+n.height/2},e.push(n)}}sortNodes(e,t,i){const{properties:o}=this;return o.node.sort==="ascending"?(e.datum.label??"").localeCompare(t.datum.label??""):o.node.sort==="descending"?(t.datum.label??"").localeCompare(e.datum.label??""):o.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.getHighlightedDatum();e.labelSelection.each((i,o)=>{const{x:s,y:a,textAlign:n,text:r,datumIndex:l,nodeDatum:c}=o,h={fromKey:this.properties.fromKey,size:o.size,sizeKey:this.properties.sizeKey,toKey:this.properties.toKey},u=this.isLabelHighlighted(c,t),p=this.getHighlightStyle(u,l),g=bY(this,void 0,h,this.properties.label,u,t),{color:m,fontStyle:y,fontWeight:x,fontSize:f,fontFamily:b}=g;i.visible=!0,i.x=s,i.y=a,i.text=r,i.fill=m,i.fontStyle=y,i.fontWeight=x,i.fontSize=f,i.fontFamily=b,i.textAlign=n,i.textBaseline="middle";const S=p.opacity??1;i.opacity=S,i.fillOpacity=S,i.setBoxing(g)})}updateNodeSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Ih(t.type,t.id))}getNodeStyle(e,t,i){const{properties:o}=this,{fills:s,strokes:a,defaultColorRange:n,defaultPatternFills:r,fillGradientDefaults:l,fillPatternDefaults:c,fillImageDefaults:h}=o,{itemStyler:u}=o.node,p=n[t%n.length].map(b=>({color:b})),g=r[t%r.length],m=this.getHighlightStyle(i,e.datumIndex),y=Dh(m,o.getStyle(!1,s,a,t)),x=o.node.fill!=null;let f=mI(y,x?l:{...l.toJson(),colorStops:p},x?c:{...c.toJson(),fill:g,stroke:g},h);if(u!=null&&e.datumIndex!=null){const b=this.cachedDatumCallback(Ih(e.datumIndex.index,"node",i?"highlight":"node"),()=>{const S=this.makeItemStylerParams(e,i,f);return this.callWithContext(u,S)});b&&(f=Dh(b,f,{...l.toJson(),colorStops:p},{...c.toJson(),fill:g,stroke:g},h))}return f.opacity=1,f}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,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);s.x=a.x,s.y=a.y,s.width=Math.max(a.width,0),s.height=Math.max(a.height,0),s.setStyleProperties(r,o)})}getShapeFillBBox(){const e=this._nodeDataDependencies?.seriesRectWidth??0,t=this._nodeDataDependencies?.seriesRectHeight??0,i=new fI(0,0,e,t);return{series:i,axis:i}}updateLinkSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>Ih(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,defaultColorRange:l,defaultPatternFills:c,fillGradientDefaults:h,fillPatternDefaults:u,fillImageDefaults:p}=a,{itemStyler:g}=a.link,m=l[i.index%l.length].map(v=>({color:v})),y=c[i.index%c.length],x=this.getHighlightStyle(o,e),f=Dh(x,a.getStyle(!0,n,r,i.index)),b=a.link.fill!=null;let S=mI(f,b?h:{...h.toJson(),colorStops:m},b?u:{...u.toJson(),fill:y,stroke:y},p);if(g!=null&&e!=null){const v=this.cachedDatumCallback(Ih(e.index,"link",o?"highlight":"node"),()=>{const M=this.ctx.highlightManager?.getActiveHighlight(),D=this.getHighlightStateString(M,o,e);return this.callWithContext(g,{seriesId:s,datum:t,highlightState:D,...S})});v&&(S=Dh(v,S,{...h.toJson(),colorStops:m},{...u.toJson(),fill:y,stroke:y},p))}return S.opacity=1,S}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.x1=a.x1,s.y1=a.y1,s.x2=a.x2,s.y2=a.y2,s.height=a.height,s.elbows=a.elbows,s.setStyleProperties(r,o),s.inset=s.strokeWidth/2})}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,u=this.contextNodeData?.nodeData.find(b=>b.datumIndex.type===e.type&&b.datumIndex.index===e.index);if(u==null)return;const p=u.type===0?u.fromNode.index:u.index,g=u.type===0?`${u.fromNode.label} - ${u.toNode.label}`:u.label,m=e.type===0?i?.dataSources.get(this.id)?.data[e.index]:o?.dataSources.get(this.id)?.data[e.index],y=u.size;let x;if(u.type===0){const b=u.fromNode.datumIndex;x=this.getLinkStyle({datumIndex:e,datum:m},b,!1)}else x=this.getNodeStyle({datumIndex:e,datum:m},e.index,!1);const f=[];if(l!=null){const b=a.format(this.callWithContext.bind(this),{type:"number",value:y,datum:m,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",domain:[],boundSeries:this.getFormatterContext("size"),fractionDigits:void 0,visibleDomain:void 0});f.push({label:c,fallbackLabel:l,value:b??String(y)})}return this.formatTooltipWithContext(h,{title:g,symbol:this.legendItemSymbol(u.type,p,x),data:f},{seriesId:t,datum:m,title:g,fromKey:n,toKey:r,sizeKey:l,sizeName:c,size:y,...x})}computeFocusBounds(e){if(e instanceof yI){const{x:t,y:i,width:o,height:s}=e,a=new fI(t,i,o,s);return SY.toCanvas(this.contentGroup,a)}return e}hasItemStylers(){return this.properties.node.itemStyler!=null||this.properties.link.itemStyler!=null||this.properties.label.itemStyler!=null}};im.className="SankeySeries",im.type="sankey";import{_ModuleSupport as vY}from"ag-charts-community";import{arrayOf as om,color as xI,commonSeriesOptionsDefs as MY,constant as DY,fillGradientDefaults as kY,fillImageDefaults as IY,fillPatternDefaults as AY,required as sm,string as Ah,undocumented as Vr}from"ag-charts-core";var{sankeySeriesThemeableOptionsDef:NY}=vY,Tn={...NY,...MY,type:sm(DY("sankey")),fromKey:sm(Ah),toKey:sm(Ah),sizeKey:Ah,sizeName:Ah};Tn.fillGradientDefaults=Vr(kY),Tn.fillPatternDefaults=Vr(AY),Tn.fillImageDefaults=Vr(IY),Tn.defaultColorRange=Vr(om(om(xI))),Tn.defaultPatternFills=Vr(om(xI));var SI={type:"series",name:"sankey",chartType:"standalone",enterprise:!0,solo:!0,version:ZU,dependencies:[xn],options:Tn,themeTemplate:{seriesArea:{padding:{top:10,bottom:10}},series:{fills:{$palette:"fills"},strokes:{$palette:"strokes"},fillGradientDefaults:QU,fillPatternDefaults:JU,fillImageDefaults:qU,defaultColorRange:{$palette:"gradients"},defaultPatternFills:tY,highlight:{enabled:{$path:["/highlight/enabled",!0]},unhighlightedItem:{opacity:.5}},label:{...eY,enabled:!0,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}},create:e=>new im(e)};import{VERSION as LY}from"ag-charts-community";import{BASE_FONT_SIZE as bI,FILL_GRADIENT_RADIAL_REVERSED_SERIES_DEFAULTS as TY,FILL_IMAGE_DEFAULTS as wY,FILL_PATTERN_DEFAULTS as CY,FONT_SIZE_RATIO as vI,LABEL_BOXING_DEFAULTS as MI}from"ag-charts-core";import{_ModuleSupport as am}from"ag-charts-community";import{formatValue as DI,isGradientFill as kI,mergeDefaults as II,normalizeAngle360 as OY,toPlainText as AI}from"ag-charts-core";import{_ModuleSupport as EY}from"ag-charts-community";import{BaseProperties as PY,Property as Re}from"ag-charts-core";var{HierarchySeriesProperties:RY,makeSeriesTooltip:_Y,HighlightProperties:zY}=EY,Ls=class extends PY{};d([Re],Ls.prototype,"fill",2),d([Re],Ls.prototype,"fillOpacity",2),d([Re],Ls.prototype,"stroke",2),d([Re],Ls.prototype,"strokeWidth",2),d([Re],Ls.prototype,"strokeOpacity",2),d([Re],Ls.prototype,"opacity",2);var nm=class extends zY{constructor(){super(...arguments),this.highlightedBranch=new Ls,this.unhighlightedBranch=new Ls}};d([Re],nm.prototype,"highlightedBranch",2),d([Re],nm.prototype,"unhighlightedBranch",2);var Rt=class extends RY{constructor(){super(...arguments),this.fillOpacity=1,this.strokeWidth=0,this.strokeOpacity=1,this.cornerRadius=0,this.highlight=new nm,this.label=new en,this.secondaryLabel=new lc,this.tooltip=_Y()}getStyle(e){const{fills:t,strokes:i,fillOpacity:o,strokeWidth:s,strokeOpacity:a}=this;return{fill:t[e%t.length],fillOpacity:o,stroke:i[e%i.length],strokeWidth:s,strokeOpacity:a,opacity:1}}};d([Re],Rt.prototype,"sizeName",2),d([Re],Rt.prototype,"labelKey",2),d([Re],Rt.prototype,"secondaryLabelKey",2),d([Re],Rt.prototype,"fillOpacity",2),d([Re],Rt.prototype,"strokeWidth",2),d([Re],Rt.prototype,"strokeOpacity",2),d([Re],Rt.prototype,"cornerRadius",2),d([Re],Rt.prototype,"sectorSpacing",2),d([Re],Rt.prototype,"padding",2),d([Re],Rt.prototype,"itemStyler",2),d([Re],Rt.prototype,"highlight",2),d([Re],Rt.prototype,"label",2),d([Re],Rt.prototype,"secondaryLabel",2),d([Re],Rt.prototype,"tooltip",2);var{fromToMotion:BY,createDatumId:VY,PointerEvents:FY,Sector:NI,Group:Nh,ScalableGroup:HY,Selection:rm,TransformableText:lm,BBox:LI,getLabelStyles:KY,toHierarchyHighlightString:WY}=am,GY=class extends am.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 TI(e,t=0,i=2*Math.PI/e.sumSize){for(const o of e.children){const s=t+o.sumSize*i;o.startAngle=t,o.endAngle=s,TI(o,t,i),t=s}}var cm=class extends am.HierarchySeries{constructor(e){super(e),this.NodeClass=GY,this.properties=new Rt,this.scalingGroup=this.contentGroup.appendChild(new HY),this.sectorGroup=this.scalingGroup.appendChild(new Nh),this.highlightSectorGroup=this.scalingGroup.appendChild(new Nh),this.sectorLabelGroup=this.scalingGroup.appendChild(new Nh),this.datumSelection=rm.select(this.sectorGroup,NI),this.labelSelection=rm.select(this.sectorLabelGroup,Nh),this.highlightSelection=rm.select(this.highlightSectorGroup,NI),this.sectorLabelGroup.pointerEvents=FY.None}processData(){super.processData(),TI(this.rootNode)}updateSelections(){const e=this.getActiveHighlightNode();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 o=Array.from(this.rootNode),s=a=>{a.append([new lm({tag:0}),new lm({tag:1})])};this.datumSelection.update(o,void 0,a=>this.getDatumId(a)),this.labelSelection.update(o,s,a=>this.getDatumId(a))}getItemStyle(e,t){const{properties:i,colorScale:o}=this,{itemStyler:s}=i,a=e.datumIndex?.[0]??0,n=this.getActiveHighlightNode(),r=this.getHierarchyHighlightState(t,n,e),l=this.getHierarchyHighlightStyles(r,this.properties.highlight),c=II(l,i.getStyle(a));e.colorValue!=null&&l?.fill==null&&(c.fill=o.convert(e.colorValue));let h=c;if(s!=null&&e!=null){const u=this.cachedDatumCallback(VY(this.getDatumId(e),t?"highlight":"node"),()=>{const p=this.makeItemStylerParams(e,h,WY(r));return this.callWithContext(s,p)});u&&(h=II(u,h))}return h}makeItemStylerParams(e,t,i){const{id:o}=this,s=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:o,datum:e.datum,depth:e.depth??0,highlightState:i,...t,fill:s}}updateNodes(){const{chart:e,data:t,maxDepth:i}=this;if(e==null||t==null)return;const{width:o,height:s}=e.seriesRect,{sectorSpacing:a=0,padding:n=0,cornerRadius:r,childrenKey:l,colorKey:c,colorName:h,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m}=this.properties;this.contentGroup.translationX=o/2,this.contentGroup.translationY=s/2;const y=a*.5,x=Math.min(o,s)/2,f=x/(i+1),b=-Math.PI/2,S={series:new LI(-x,-x,2*x,2*x),axis:new LI(-x,-x,2*x,2*x)};this.rootNode?.walk(A=>{const{startAngle:k,endAngle:N}=A;if(A.depth!=null){const L=(k+N)/2+b,T=(A.depth+.5)*f;A.midPoint.x=Math.cos(L)*T,A.midPoint.y=Math.sin(L)*T}}),this.rootNode?.walk(A=>{const{datum:k,depth:N,startAngle:L,endAngle:T,parent:P,sumSize:R}=A;A.label=void 0,A.secondaryLabel=void 0,A.contentHeight=0;let w;if(k!=null&&N!=null&&u!=null){const ee=k[u];w=this.getLabelText(ee,k,u,"label",[],this.properties.label,{depth:N,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:ee})}w===""&&(w=void 0);let O;if(k!=null&&N!=null&&p!=null){const ee=k[p];O=this.getLabelText(ee,k,p,"secondaryLabel",[],this.properties.secondaryLabel,{depth:N,datum:k,childrenKey:l,colorKey:c,colorName:h,labelKey:u,secondaryLabelKey:p,sizeKey:g,sizeName:m,value:ee})}if(O===""&&(O=void 0),N==null)return;const B=N*f+y,E=(N+1)*f-y,C=B>y?y/B:y,_=E>y?y/E:y,z=L+C,F=T+C-z,Z=L+_,$=T+_-Z,J=ee=>{if(N===0&&P?.sumSize===R)return{width:2*Math.sqrt(E**2-(ee*.5)**2),height:ee,meta:0};const at=ee,Yt=2*Math.sqrt(E**2-(B+at)**2),Le=F=Fo?{width:Xt,height:at,meta:1}:{width:Fo,height:Fi,meta:2}},ae=wu(AI(w),this.properties.label,AI(O),this.properties.secondaryLabel,{padding:n},J);if(ae==null)return;const{width:ne,height:he,meta:Ae,label:_t,secondaryLabel:se}=ae,Q=b+(L+T)/2,_e=Math.sin(Q)>=0,Je=Math.cos(Q)>=0,le=(_e?3:12)&(Je?6:9);let ue;switch(Ae){case 0:ue=0;break;case 1:{const Ne=E-(f-he)*.58,at=Math.sqrt((E-n)**2-(ne/2)**2);ue=Math.min(Ne,at);break}case 2:if(N===0){const ee=he/(2*Math.tan(F*.5))+ne*.5,Ne=Math.sqrt(E**2-(he*.5)**2)-ne*.5;ue=(ee+Ne)*.5}else ue=(B+E)*.5;break}if(_t!=null){const{fontStyle:ee="normal",fontFamily:Ne,fontWeight:at="normal",color:Yt="black"}=this.properties.label;A.label={..._t,fontStyle:ee,fontFamily:Ne,fontWeight:at,color:Yt,labelPlacement:Ae,circleQuarter:le,radius:ue,theta:Q}}if(se!=null){const{fontStyle:ee="normal",fontFamily:Ne,fontWeight:at="normal",color:Yt="black"}=this.properties.secondaryLabel;A.secondaryLabel={...se,fontStyle:ee,fontFamily:Ne,fontWeight:at,color:Yt,labelPlacement:Ae,circleQuarter:le,radius:ue,theta:Q}}A.contentHeight=ae.height});const v=(A,k,N)=>{const{depth:L,startAngle:T,endAngle:P}=A;if(L==null){k.visible=!1;return}k.visible=!0;const R=this.getItemStyle(A,N),w=R.fill,O=R.strokeWidth,B=kI(w)&&w.bounds!=="item"?S:void 0;k.setStyleProperties(R,B),k.centerX=0,k.centerY=0,k.innerRadius=L*f,k.outerRadius=(L+1)*f,k.startAngle=T+b,k.endAngle=P+b,k.inset=y+O*.5,k.cornerRadius=r};this.datumSelection.each((A,k)=>{v(k,A,!1)}),this.highlightSelection.each((A,k)=>{v(k,A,!0)});const M=this.getActiveHighlightNode(),D=(A,k,N,L)=>{const{depth:T,contentHeight:P}=A,R=N===0,w=R?A.label:A.secondaryLabel;if(T==null||w==null){k.visible=!1;return}const{labelPlacement:O,circleQuarter:B,radius:E,theta:C}=w,_=this.getHierarchyHighlightState(L,M,A),{opacity:z}=this.getHierarchyHighlightStyles(_,this.properties.highlight)??{},K={childrenKey:this.properties.childrenKey,colorKey:this.properties.colorKey,colorName:this.properties.colorName??this.properties.colorKey,depth:A.depth??Number.NaN,labelKey:this.properties.labelKey,secondaryLabelKey:this.properties.secondaryLabelKey,sizeKey:this.properties.sizeKey,sizeName:this.properties.sizeName??this.properties.sizeKey},F=R?this.properties.label:this.properties.secondaryLabel,Z=this.ctx.highlightManager?.getActiveHighlight(),G=KY(this,A,K,F,L,Z);switch(k.text=w.text,k.fontSize=w.fontSize,k.lineHeight=w.lineHeight,k.fontStyle=w.fontStyle,k.fontFamily=w.fontFamily,k.fontWeight=w.fontWeight,k.fillOpacity=z??1,k.fill=G.color,k.setBoxing(G),O){case 0:k.textAlign="center",k.textBaseline="top",k.translationX=0,k.translationY=(R?0:P-w.height)-P*.5,k.rotation=0;break;case 1:{const $=(B&3)!==0,J=R===!$?E:E-(P-w.height);k.textAlign="center",k.textBaseline=$?"bottom":"top",k.translationX=Math.cos(C)*J,k.translationY=Math.sin(C)*J,k.rotation=$?C-Math.PI*.5:C+Math.PI*.5;break}case 2:{const $=(B&6)!==0,J=R===!$?(P-w.height)*.5:(w.height-P)*.5;k.textAlign="center",k.textBaseline="middle",k.translationX=Math.cos(C)*E+Math.cos(C+Math.PI/2)*J,k.translationY=Math.sin(C)*E+Math.sin(C+Math.PI/2)*J,k.rotation=$?C:C+Math.PI;break}}k.visible=!0},I=this.getActiveHighlightNode();for(const A of this.labelSelection.selectByClass(lm)){const k=A.closestDatum();D(k,A,A.tag,k===I)}}getTooltipContent(e){const{id:t,properties:i,ctx:o}=this,{labelKey:s,secondaryLabelKey:a,childrenKey:n,sizeKey:r,sizeName:l,colorKey:c,colorName:h,tooltip:u}=i,{formatManager:p}=o,g=e.reduce((D,I)=>D?.children[I],this.rootNode);if(g==null)return;const{datum:m,depth:y}=g;if(m==null||y==null)return;const x=[],f=r==null?void 0:m[r];if(f!=null){const D=[0,this.rootNode?.sumSize??0],I=p.format(this.callWithContext.bind(this),{type:"number",value:f,datum:m,seriesId:t,legendItemName:void 0,key:r,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:D,fractionDigits:void 0,visibleDomain:void 0});x.push({label:l,fallbackLabel:r,value:I??DI(f)})}const b=c==null?void 0:m[c];if(b!=null){const{colorDomain:D}=this,I=p.format(this.callWithContext.bind(this),{type:"number",value:b,datum:m,seriesId:t,legendItemName:void 0,key:c,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:D,fractionDigits:void 0,visibleDomain:void 0});x.push({label:h,fallbackLabel:c,value:I??DI(b)})}const S=this.getItemStyle({...g,colorValue:b??g.colorValue},!1),M={shape:"square",fill:S.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};return kI(M.fill)&&(M.fill={...M.fill,gradient:"linear",rotation:0,reverse:!1}),this.formatTooltipWithContext(u,{title:s==null?void 0:m[s],symbol:{marker:M},data:x},{seriesId:t,datum:m,title:void 0,depth:y,labelKey:s,secondaryLabelKey:a,childrenKey:n,sizeKey:r,sizeName:l,colorKey:c,colorName:h,...S})}createNodeData(){}pickNodeClosestDatum(e){return this.pickNodeNearestDistantObject(e,this.datumSelection.nodes())}animateEmptyUpdateReady(){BY(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}};cm.className="SunburstSeries",cm.type="sunburst";import{_ModuleSupport as jY}from"ag-charts-community";import{commonSeriesOptionsDefs as $Y,constant as UY,required as YY,string as va,without as XY}from"ag-charts-core";var{sunburstSeriesThemeableOptionsDef:ZY}=jY,QY={...ZY,...XY($Y,["highlightStyle","highlight","showInLegend"]),type:YY(UY("sunburst")),labelKey:va,secondaryLabelKey:va,childrenKey:va,sizeKey:va,colorKey:va,sizeName:va,colorName:va},qY={series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",TY],["pattern",CY],["image",wY]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},strokeWidth:{$isUserOption:["./strokes/0",2,0]},label:{...MI,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:vI.LARGE},minimumFontSize:{$rem:9/bI},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never",spacing:2},secondaryLabel:{...MI,enabled:!0,fontFamily:{$ref:"fontFamily"},fontSize:{$rem:vI.SMALLEST},minimumFontSize:{$rem:7/bI},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"},overflowStrategy:"ellipsis",wrapping:"never"},sectorSpacing:2,padding:3,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},wI={type:"series",name:"sunburst",chartType:"standalone",enterprise:!0,solo:!0,version:LY,dependencies:[xn],options:QY,themeTemplate:qY,create:e=>new cm(e)};import{VERSION as JY}from"ag-charts-community";import{FILL_GRADIENT_LINEAR_DEFAULTS as eX,FILL_IMAGE_DEFAULTS as tX,FILL_PATTERN_DEFAULTS as iX,FONT_SIZE_RATIO as CI,LABEL_BOXING_DEFAULTS as hm}from"ag-charts-core";import{_ModuleSupport as Lh}from"ag-charts-community";import{cachedTextMeasurer as oX,calcLineHeight as sX,formatValue as OI,isGradientFill as aX,isNumberEqual as nX,mergeDefaults as EI,toPlainText as PI,wrapText as rX}from"ag-charts-core";import{_ModuleSupport as lX}from"ag-charts-community";import{BaseProperties as wn,Property as W}from"ag-charts-core";var{HierarchySeriesProperties:cX,makeSeriesTooltip:hX,Label:dX}=lX,RI=class extends dX{constructor(){super(...arguments),this.spacing=0}};d([W],RI.prototype,"spacing",2);var Ts=class extends wn{};d([W],Ts.prototype,"fill",2),d([W],Ts.prototype,"fillOpacity",2),d([W],Ts.prototype,"stroke",2),d([W],Ts.prototype,"strokeWidth",2),d([W],Ts.prototype,"strokeOpacity",2),d([W],Ts.prototype,"opacity",2);var dm=class extends wn{constructor(){super(...arguments),this.highlightedItem=new Ts,this.unhighlightedItem=new Ts}};d([W],dm.prototype,"highlightedItem",2),d([W],dm.prototype,"unhighlightedItem",2);var po=class extends wn{};d([W],po.prototype,"fill",2),d([W],po.prototype,"fillOpacity",2),d([W],po.prototype,"stroke",2),d([W],po.prototype,"strokeWidth",2),d([W],po.prototype,"strokeOpacity",2),d([W],po.prototype,"opacity",2);var Fr=class extends wn{constructor(){super(...arguments),this.highlightedBranch=new po,this.highlightedItem=new po,this.unhighlightedItem=new po,this.unhighlightedBranch=new po}};d([W],Fr.prototype,"highlightedBranch",2),d([W],Fr.prototype,"highlightedItem",2),d([W],Fr.prototype,"unhighlightedItem",2),d([W],Fr.prototype,"unhighlightedBranch",2);var ui=class extends wn{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 RI,this.highlight=new dm}};d([W],ui.prototype,"fill",2),d([W],ui.prototype,"fillOpacity",2),d([W],ui.prototype,"stroke",2),d([W],ui.prototype,"strokeWidth",2),d([W],ui.prototype,"strokeOpacity",2),d([W],ui.prototype,"cornerRadius",2),d([W],ui.prototype,"textAlign",2),d([W],ui.prototype,"gap",2),d([W],ui.prototype,"padding",2),d([W],ui.prototype,"interactive",2),d([W],ui.prototype,"label",2),d([W],ui.prototype,"highlight",2);var $t=class extends wn{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 en,this.secondaryLabel=new lc,this.highlight=new Fr}};d([W],$t.prototype,"fill",2),d([W],$t.prototype,"fillOpacity",2),d([W],$t.prototype,"stroke",2),d([W],$t.prototype,"strokeWidth",2),d([W],$t.prototype,"strokeOpacity",2),d([W],$t.prototype,"cornerRadius",2),d([W],$t.prototype,"textAlign",2),d([W],$t.prototype,"verticalAlign",2),d([W],$t.prototype,"gap",2),d([W],$t.prototype,"padding",2),d([W],$t.prototype,"label",2),d([W],$t.prototype,"secondaryLabel",2),d([W],$t.prototype,"highlight",2);var go=class extends cX{constructor(){super(...arguments),this.tooltip=hX(),this.group=new ui,this.tile=new $t,this.undocumentedGroupFills=[],this.undocumentedGroupStrokes=[]}getStyle(e,t,i,o){const{fillOpacity:s,strokeWidth:a,strokeOpacity:n,fill:r=e?t[o%t.length]:t[Math.min(o,t.length)],stroke:l=e?i[o%t.length]:i[Math.min(o,i.length)]}=e?this.tile:this.group;return{fill:r,fillOpacity:s,stroke:l,strokeWidth:a,strokeOpacity:n,opacity:1}}};d([W],go.prototype,"sizeName",2),d([W],go.prototype,"labelKey",2),d([W],go.prototype,"secondaryLabelKey",2),d([W],go.prototype,"itemStyler",2),d([W],go.prototype,"tooltip",2),d([W],go.prototype,"group",2),d([W],go.prototype,"tile",2),d([W],go.prototype,"undocumentedGroupFills",2),d([W],go.prototype,"undocumentedGroupStrokes",2);var{createDatumId:uX,Rect:_I,Group:zI,BBox:Cn,Selection:um,Text:pm,Transformable:pX,getLabelStyles:gX,HierarchyHighlightState:Vi,toHierarchyHighlightString:Hr}=Lh,mX=class extends Lh.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 ws(e){return e.children.length>0?e.sumSize-e.sizeValue:e.sizeValue}var BI={left:0,center:.5,right:1},yX={top:0,middle:.5,bottom:1},Nie=class extends Lh.Group{distanceSquared(e,t){return this.getBBox().distanceSquared(e,t)}},gm=class extends Lh.HierarchySeries{constructor(){super(...arguments),this.NodeClass=mX,this.properties=new go,this.rectGroup=this.contentGroup.appendChild(new zI),this.datumSelection=um.select(this.rectGroup,_I),this.labelSelection=um.select(this.labelGroup,zI),this.highlightSelection=um.select(this.rectGroup,_I)}groupTitleHeight(e,t){const{label:o}=this.properties.group,{labelValue:s}=e,{fontSize:a}=o;if(o.enabled&&s!=null&&a<=t.width/3&&a<=t.height/3){const{height:n}=oX(o).measureLines(s);return Math.max(n,a)}}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{padding:i,label:{spacing:o}}=this.properties.group,s=this.groupTitleHeight(e,t),a=s==null?0:s+o;return{top:i+a,right:i,bottom:i,left:i}}sortChildren({children:e}){const t=Array.from(e,(o,s)=>s).filter(o=>ws(e[o])>0).sort((o,s)=>ws(e[s])-ws(e[o]));return{sortedChildrenIndices:t,childAt:o=>{const s=t[o];return e[s]}}}squarify(e,t){const{datum:i,children:o}=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 s=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=s,e.midPoint.x=t.x+t.width/2,e.midPoint.y=t.y);const{sortedChildrenIndices:a,childAt:n}=this.sortChildren(e),r=a.every(M=>o[M].children.length===0),l=1,c=t.width-s.left-s.right,h=t.height-s.top-s.bottom;if(c<=0||h<=0)return;const u=a.length;let p=0,g=0,m=1/0,y=a.reduce((M,D)=>M+ws(o[D]),0);const x=new Cn(t.x+s.left,t.y+s.top,c,h),f=x.clone();let b=0;for(;b({left:l.x,top:l.y,right:l.x+l.width,bottom:l.y+l.height}),a=s(e),n=s(t),r=["top","right","bottom","left"];for(const l of r)nX(a[l],n[l])||t.shrink(o,l)}createNodeData(){}getItemStyle(e,t,i){const{properties:o,colorScale:s}=this,{itemStyler:a}=o,n=e.datumIndex?.[0]??0,r=t?o.fills:o.undocumentedGroupFills,l=t?o.strokes:o.undocumentedGroupStrokes,c=t?n:e.depth??-1,h=this.getActiveHighlightNode(),u=this.getHierarchyHighlightState(i,h,e),p=this.getGroupHighlightState(i,h,e),g=t?u:p,m=t?this.getTileHighlightStyle(u,p,h):this.getGroupHighlightStyle(p),y=EI(m,o.getStyle(t,r,l,c));t&&e.colorValue!=null&&m?.fill==null&&(y.fill=s.convert(e.colorValue));let x=y;if(a!=null&&e!=null){const f=this.cachedDatumCallback(uX(this.getDatumId(e),i?"highlight":"node"),()=>{const b=this.makeItemStylerParams(e,x,Hr(g));return this.callWithContext(a,b)});f&&(x=EI(f,x))}return x}makeItemStylerParams(e,t,i){const{id:o}=this,s=this.filterItemStylerFillParams(t.fill)??t.fill;return{seriesId:o,datum:e.datum,depth:e.depth??-1,highlightState:i,...t,fill:s}}updateSelections(){const e=this.getActiveHighlightNode();if(this.highlightSelection.update(e==null?[]:[e],void 0,s=>this.getDatumId(s)),!this.nodeDataRefresh)return;this.nodeDataRefresh=!1;const{seriesRect:t}=this.chart??{};if(!t)return;const i=Array.from(this.rootNode),o=s=>{s.append([new pm({tag:0}),new pm({tag:1})])};this.datumSelection.update(i,void 0,s=>this.getDatumId(s)),this.labelSelection.update(i,o,s=>this.getDatumId(s))}getActiveHighlightNode(){const e=super.getActiveHighlightNode();if(!(e?.children.length&&!this.properties.group.interactive))return e}updateNodes(){const{rootNode:e,data:t}=this,{childrenKey:i,colorKey:o,colorName:s,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,tile:c,group:h}=this.properties,{seriesRect:u}=this.chart??{};if(!u||!t)return;this.rootNode?.walk(b=>{const{datum:S,depth:v,children:M}=b,D=M.length===0,I=D?c.label:h.label;let A;if(I.enabled&&S!=null&&v!=null&&a!=null){const N=S[a];A=this.getLabelText(N,S,a,"label",[],I,{depth:v,datum:S,childrenKey:i,colorKey:o,colorName:s,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,value:N})}A===""&&(A=void 0);let k;if(c.secondaryLabel.enabled&&D&&S!=null&&v!=null&&n!=null){const N=S[n];k=this.getLabelText(N,S,n,"secondaryLabel",[],c.secondaryLabel,{depth:v,datum:S,childrenKey:i,colorKey:o,colorName:s,labelKey:a,secondaryLabelKey:n,sizeKey:r,sizeName:l,value:N})}k===""&&(k=void 0),b.labelValue=PI(A),b.secondaryLabelValue=PI(k)});const{width:p,height:g}=u;this.squarify(e,new Cn(0,0,p,g)),this.rootNode?.walk(b=>{const{bbox:S,children:v,labelValue:M,secondaryLabelValue:D}=b;if(b.label=void 0,b.secondaryLabel=void 0,S!=null)if(v.length===0){const I={width:S.width,height:S.height,meta:null},A=wu(M,this.properties.tile.label,D,this.properties.tile.secondaryLabel,{padding:c.padding},()=>I);if(A==null)return;const{height:k,label:N,secondaryLabel:L}=A,{textAlign:T,verticalAlign:P,padding:R}=c,w=BI[T]??.5,O=S.x+R+(S.width-2*R)*w,B=yX[P]??.5,E=S.y+R+k*.5+(S.height-2*R-k)*B;if(N!=null){const{fontStyle:C="normal",fontFamily:_,fontWeight:z="normal",color:K="black"}=this.properties.tile.label;b.label={text:N.text,fontSize:N.fontSize,lineHeight:N.lineHeight,fontStyle:C,fontFamily:_,fontWeight:z,color:K,textAlign:T,verticalAlign:"middle",x:O,y:E-(k-N.height)*.5}}if(L!=null){const{fontStyle:C="normal",fontFamily:_,fontWeight:z="normal",color:K="black"}=this.properties.tile.secondaryLabel;b.secondaryLabel={text:L.text,fontSize:L.fontSize,lineHeight:L.fontSize,fontStyle:C,fontFamily:_,fontWeight:z,color:K,textAlign:T,verticalAlign:"middle",x:O,y:E+(k-L.height)*.5}}}else{if(M==null)return;{const{padding:I,textAlign:A}=h,k=this.groupTitleHeight(b,S);if(k==null)return;const N=S.width-2*I,L=rX(M,{maxWidth:S.width-2*I,font:h.label,textWrap:"never"}),T=BI[A]??.5,{fontStyle:P="normal",fontFamily:R,fontWeight:w="normal",color:O="black"}=this.properties.group.label;b.label={text:L,fontSize:h.label.fontSize,lineHeight:sX(h.label.fontSize),fontStyle:P,fontFamily:R,fontWeight:w,color:O,textAlign:A,verticalAlign:"middle",x:S.x+I+N*T,y:S.y+I+k*.5}}}});const m={series:new Cn(0,0,p,g),axis:new Cn(0,0,p,g)},y=(b,S,v)=>{const{bbox:M}=b;if(M==null){S.visible=!1;return}const{depth:D=-1}=b,I=b.children.length===0,A=this.getItemStyle(b,I,v);S.crisp=!0,S.setStyleProperties(A,m),S.cornerRadius=I?c.cornerRadius:h.cornerRadius,S.zIndex=[0,D,v?1:0];const k=b.parent?.children.every(T=>T.children.length===0),N=b.parent==null?void 0:b.parent.bbox,L=b.parent==null?void 0:b.parent.padding;k===!0&&N!=null&&L!=null?(S.clipBBox=M,S.x=N.x+L.left,S.y=N.y+L.top,S.width=N.width-(L.left+L.right),S.height=N.height-(L.top+L.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((b,S)=>y(S,b,!1)),this.highlightSelection.each((b,S)=>{y(S,b,!0)});const x=(b,S,v,M)=>{const D=b.children.length===0,I=v===0?b.label:b.secondaryLabel;if(I==null){S.visible=!1;return}let A,k;v===0?(A=D?c.label:h.label,k=["series",`${this.declarationOrder}`,D?"tile":"group","label"]):(A=c.secondaryLabel,k=["series",`${this.declarationOrder}`,"tile","secondaryLabel"]);const{opacity:N}=this.getItemStyle(b,D,M)??{},L={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},T=this.ctx.highlightManager?.getActiveHighlight(),P=gX(this,b,L,A,M,T,k);S.text=I.text,S.fontSize=I.fontSize,S.lineHeight=I.lineHeight,S.fontStyle=I.fontStyle,S.fontFamily=I.fontFamily,S.fontWeight=I.fontWeight,S.fillOpacity=N??1,S.fill=P.color,S.setBoxing(P),S.textAlign=I.textAlign,S.textBaseline=I.verticalAlign,S.x=I.x,S.y=I.y,S.visible=!0,S.zIndex=1},f=this.getActiveHighlightNode();for(const b of this.labelSelection.selectByClass(pm)){const S=b.closestDatum();x(S,b,b.tag,S===f)}}getGroupHighlightState(e,t,i){const o=i.datumIndex,s=t?.datumIndex,a=this.isDescendantDatumIndex(o,s);if(i.children?.length===0)return o==null||t==null||t.children?.length===0?Vi.None:a?Vi.Item:Vi.OtherItem;if(t==null||t.children?.length===0)return Vi.None;const n=i.depth!=null&&t.depth!=null&&i.depth===t.depth;return a&&!n?Vi.None:e?Vi.Item:Vi.OtherItem}getTileHighlightStyle(e,t,i){if(i?.children&&i.children.length>0){const s=this.getGroupHighlightStyle(t);return s?.fillOpacity==null&&s?.strokeOpacity==null?void 0:{fillOpacity:s.fillOpacity,strokeOpacity:s.strokeOpacity}}return this.getHierarchyHighlightStyles(e,this.properties.tile.highlight)}getGroupHighlightStyle(e){const{highlight:t}=this.properties.group;switch(e){case Vi.Item:return t.highlightedItem;case Vi.OtherItem:return t.unhighlightedItem;default:return}}getHighlightStateString(e,t,i){if(i==null)return Hr(Vi.None);const o=i.reduce((r,l)=>r?.children[l],this.rootNode),s=this.getActiveHighlightNode();if(o==null)return Hr(Vi.None);if((o.children?.length??0)===0){const r=this.getHierarchyHighlightState(t??!1,s,o);return Hr(r)}const n=this.getGroupHighlightState(t??!1,s,o);return Hr(n)}isDescendantDatumIndex(e,t){if(t==null||t.length===0)return!0;if(e==null||e.lengtho.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:o}=this,{formatManager:s}=o,{labelKey:a,secondaryLabelKey:n,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:u,tooltip:p}=i,g=e.reduce((k,N)=>k?.children[N],this.rootNode);if(g==null)return;const{datum:m,depth:y,children:x}=g;if(m==null||y==null)return;const f=x.length===0,b=[],S=l==null?void 0:m[l];if(S!=null){const k=[0,this.rootNode?.sumSize??0],N=s.format(this.callWithContext.bind(this),{type:"number",value:S,datum:m,seriesId:t,legendItemName:void 0,key:l,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:k,fractionDigits:void 0,visibleDomain:void 0});b.push({label:c,fallbackLabel:l,value:N??OI(S)})}const v=h==null?void 0:m[h];if(v!=null){const{colorDomain:k}=this,N=s.format(this.callWithContext.bind(this),{type:"number",value:v,datum:m,seriesId:t,legendItemName:void 0,key:h,source:"tooltip",property:"color",boundSeries:this.getFormatterContext("color"),domain:k,fractionDigits:void 0,visibleDomain:void 0});b.push({label:u,fallbackLabel:h,value:N??OI(v)})}const M=this.getItemStyle({...g,colorValue:v??g.colorValue},f,!1),I={shape:"square",fill:M.fill,fillOpacity:1,stroke:void 0,strokeWidth:0,strokeOpacity:1,lineDash:[0],lineDashOffset:0};aX(I.fill)&&(I.fill={...I.fill,gradient:"linear",rotation:0,reverse:!1});const A=f?{marker:I}:void 0;return this.formatTooltipWithContext(p,{title:a==null?void 0:m[a],symbol:A,data:b},{seriesId:t,datum:m,title:void 0,depth:y,labelKey:a,secondaryLabelKey:n,childrenKey:r,sizeKey:l,sizeName:c,colorKey:h,colorName:u,...M})}computeFocusBounds(e){return pX.toCanvas(this.contentGroup,e.getBBox())}hasItemStylers(){return this.properties.itemStyler!=null||this.properties.tile.label.itemStyler!=null||this.properties.group.label.itemStyler!=null}};gm.className="TreemapSeries",gm.type="treemap";import{_ModuleSupport as fX}from"ag-charts-community";import{arrayOf as VI,color as FI,commonSeriesOptionsDefs as xX,constant as SX,required as bX,string as Ma,undocumented as HI,without as vX}from"ag-charts-core";var{treemapSeriesThemeableOptionsDef:MX}=fX,mm={...MX,...vX(xX,["highlightStyle","highlight","showInLegend"]),type:bX(SX("treemap")),labelKey:Ma,secondaryLabelKey:Ma,childrenKey:Ma,sizeKey:Ma,colorKey:Ma,sizeName:Ma,colorName:Ma};mm.undocumentedGroupFills=HI(VI(FI)),mm.undocumentedGroupStrokes=HI(VI(FI));var KI={type:"series",name:"treemap",chartType:"standalone",enterprise:!0,solo:!0,version:JY,dependencies:[xn],options:mm,themeTemplate:{series:{fills:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"fills"},{$applySwitch:[{$path:["/type",void 0,{$value:"$1"}]},{$value:"$1"},["gradient",eX],["pattern",iX],["image",tX]]}]},strokes:{$applyCycle:[{$size:{$path:["./data",{$path:"/data"}]}},{$palette:"strokes"}]},colorRange:{$palette:"divergingColors"},undocumentedGroupFills:{$palette:"hierarchyColors"},undocumentedGroupStrokes:{$palette:"secondHierarchyColors"},group:{label:{...hm,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",highlight:{unhighlightedItem:{opacity:.2,fillOpacity:.2,strokeOpacity:.2}}},tile:{label:{...hm,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:1.5},minimumFontSize:{$rem:CI.SMALLER},fontFamily:{$ref:"fontFamily"},wrapping:"on-space",overflowStrategy:"ellipsis",spacing:2},secondaryLabel:{...hm,enabled:!0,color:{$ref:"chartBackgroundColor"},fontStyle:void 0,fontWeight:void 0,fontSize:{$ref:"fontSize"},minimumFontSize:{$rem:CI.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,highlight:{unhighlightedItem:{fillOpacity:.6,strokeOpacity:.6},unhighlightedBranch:{fillOpacity:.2,strokeOpacity:.2}}}},gradientLegend:{enabled:{$if:[{$path:"../series/0/colorKey"},!0,!1]}}},create:e=>new gm(e)};import{AllCommunityModule as DX}from"ag-charts-community";import{AllCartesianAxesModule as kX}from"ag-charts-community";var WI=[kX,Gh].flat();import{AllCartesianSeriesModule as IX}from"ag-charts-community";var GI=[IX,fu,nc,yM,DM,Pu,hc,fc,bc,np].flat(),jI=[WI,GI,Bn,Xd,Zd,Gl,er,iu,Yl,su,Px,Wc,rp,xp,Zb,vp,Ip,fn].flat();import{BarSeriesModule as AX,LineSeriesModule as NX,NumberAxisModule as LX,TimeAxisModule as TX}from"ag-charts-community";import{VERSION as wX}from"ag-charts-community";import{array as CX,boolean as Da,commonChartOptionsDefs as OX,defined as ce,positiveNumber as $I,string as ka,tooltipOptionsDefs as EX,undocumented as ym,union as PX}from"ag-charts-core";import"ag-charts-community";import{FONT_SIZE_RATIO as RX,Logger as _X,SAFE_STROKE_FILL_OPERATION as zX,mergeDefaults as BX}from"ag-charts-core";import*as VX from"ag-charts-core";import{FONT_SIZE_RATIO as fm}from"ag-charts-core";var{DEFAULT_ANNOTATION_HANDLE_FILL:FX,DEFAULT_ANNOTATION_STATISTICS_COLOR:HX,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:KX,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:UI,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:YI,DEFAULT_ANNOTATION_STATISTICS_FILL:WX,DEFAULT_ANNOTATION_STATISTICS_STROKE:GX,DEFAULT_FIBONACCI_STROKES:XI,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:On,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:Bo,DEFAULT_TEXTBOX_COLOR:jX,DEFAULT_TEXTBOX_FILL:$X,DEFAULT_TEXTBOX_STROKE:UX,DEFAULT_TEXT_ANNOTATION_COLOR:YX}=VX,Ni={stroke:Bo},yt={fill:FX},ZI={color:"white",fill:Bo},Vo={color:Bo},Ia={color:YX,fontSize:{$rem:fm.LARGE},fontFamily:{$ref:"fontFamily"}},xm={...Ia,fontSize:{$ref:"fontSize"},color:HX,fill:WX,stroke:GX,strokeWidth:1,divider:{stroke:KX,strokeWidth:1,strokeOpacity:.5}},Sm={...Ni,background:{fill:On,fillOpacity:.2},handle:{...yt},text:{...Vo},statistics:{...xm}},XX={line:{...Ni,handle:{...yt},text:{...Vo}},"horizontal-line":{...Ni,handle:{...yt},axisLabel:{...ZI},text:{...Vo}},"vertical-line":{...Ni,handle:{...yt},axisLabel:{...ZI},text:{...Vo}},"disjoint-channel":{...Ni,background:{fill:On,fillOpacity:.2},handle:{...yt},text:{...Vo}},"parallel-channel":{...Ni,background:{fill:On,fillOpacity:.2},handle:{...yt},text:{...Vo}},"fibonacci-retracement":{...Ni,strokes:XI,rangeStroke:Bo,handle:{...yt},text:{...Vo,position:"center"},label:{...Ia,color:void 0,fontSize:{$rem:fm.SMALLER}}},"fibonacci-retracement-trend-based":{...Ni,strokes:XI,rangeStroke:Bo,handle:{...yt},text:{...Vo,position:"center"},label:{...Ia,color:void 0,fontSize:{$rem:fm.SMALLER}}},callout:{...Ni,...Ia,color:{$ref:"textColor"},handle:{...yt},fill:On,fillOpacity:.2},comment:{...Ia,color:"white",fontWeight:700,handle:{...yt},fill:Bo},note:{...Ia,color:jX,fill:Bo,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...yt},background:{fill:$X,stroke:UX,strokeWidth:1}},text:{...Ia,handle:{...yt}},arrow:{...Ni,handle:{...yt},text:{...Vo}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...yt,stroke:Bo}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...yt,stroke:Bo}},"date-range":{...Sm},"price-range":{...Sm},"date-price-range":{...Sm},"quick-date-price-range":{up:{...Ni,fill:On,fillOpacity:.2,handle:{...yt},statistics:{...xm,color:"#fff",fill:On,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Ni,stroke:YI,fill:UI,fillOpacity:.2,handle:{...yt,stroke:YI},statistics:{...xm,color:"#fff",fill:UI,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},ZX=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],QX=[{icon:"trend-line-drawing",tooltip:"toolbarAnnotationsLineAnnotations",value:"line-menu"},{icon:"fibonacci-retracement-drawing",tooltip:"toolbarAnnotationsFibonacciAnnotations",value:"fibonacci-menu"},{icon:"text-annotation",tooltip:"toolbarAnnotationsTextAnnotations",value:"text-menu"},{icon:"arrow-drawing",tooltip:"toolbarAnnotationsShapeAnnotations",value:"shape-menu"},{icon:"measurer-drawing",tooltip:"toolbarAnnotationsMeasurerAnnotations",value:"measurer-menu"},{icon:"delete",tooltip:"toolbarAnnotationsClearAll",value:"clear"}];function qX(e,t,i){const{dateKey:o="date",highKey:s="high",openKey:a="open",lowKey:n="low",closeKey:r="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:u=!0,rangeButtons:p=!0,statusBar:g=!0,toolbar:m=!0,zoom:y=!0,sync:x=!1,theme:f,data:b,formatter:S,...v}=e,M=e6(c,o,s,n,a,r),D=JX(i,o,a,r,u,l),A={navigator:{enabled:h,...u?{miniChart:{enabled:h,series:[{type:"line",xKey:o,yKey:l,stroke:zX,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},k={annotations:{enabled:m,optionsToolbar:{enabled:m},snap:!0,toolbar:{enabled:m,buttons:QX,padding:0},data:b,xKey:o,volumeKey:u?l:void 0}},N=g?{statusBar:{enabled:!0,highKey:s,openKey:a,lowKey:n,closeKey:r,volumeKey:u?l:void 0}}:null,L={zoom:{enabled:y,autoScaling:{enabled:!0},onDataChange:{stickToEnd:!0},enableIndependentAxes:!0}},T={ranges:{enabled:p&&y}},P=x?{sync:{enabled:x,nodeInteraction:!0,zoom:!0}}:null,R=u?{yVolume:{type:"number",position:"left",label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}}:{};return{theme:{baseTheme:typeof f=="string"?f:"ag-financial",...BX(typeof f=="object"?f:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:6},chartToolbar:{enabled:m},annotations:{...XX},ranges:{enableOutOfRange:!0,position:"bottom-left",fontSize:{$rem:[RX.MEDIUM,"chromeFontSize"]},minSize:34},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}},category:{gridLine:{enabled:!0}},time:{gridLine:{enabled:!0}},"unit-time":{gridLine:{enabled:!0}},"ordinal-time":{gridLine:{enabled:!0}}}},bar:{series:{fillOpacity:.5,highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},line:{series:{marker:{enabled:!1},highlight:{unhighlightedSeries:{opacity:1}},...Th(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...Th(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},ohlc:{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}}}},"range-area":{series:{fillOpacity:.3,strokeWidth:2,highlight:{bringToFront:!1,unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...Th(c,{hlc:{fill:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.fill"},{$palette:"down.fill"}]},stroke:{$if:[{$eq:[{$value:"$index"},1]},{$palette:"up.stroke"},{$palette:"down.stroke"}]}}})}},"range-bar":{series:{highlight:{unhighlightedItem:{opacity:1},unhighlightedSeries:{opacity:1}},...Th(c,{"high-low":{fill:{$palette:"neutral.fill"},stroke:{$palette:"neutral.stroke"}}})}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...D,...M],axes:{y:{type:"number",position:"right",crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...R,x:{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}},tooltip:{enabled:!1},data:b,formatter:S,...k,...A,...N,...L,...T,...P,...v}}function JX(e,t,i,o,s,a){return s?[{type:"bar",xKey:t,yKey:a,yKeyAxis:"yVolume",tooltip:{enabled:!1},simpleItemStyler(n){const{up:r,down:l}=e().palette;return{fill:n[i]!0,listeners:ce,locale:ce,width:ce,height:ce,minWidth:ce,minHeight:ce,title:ce,subtitle:ce,footnote:ce,padding:ce,tooltip:{...EX,...OX.tooltip}};a6.overrideDevicePixelRatio=ym($I),bm.overrideDevicePixelRatio=ym($I),bm.foreground=ym(ce);var n6={type:"preset",name:"price-volume",enterprise:!0,dependencies:[Gl,vp],version:wX,options:bm,create:qX},JI=[n6,AX,NX,nc,hc,bc,fc,Bn,Xd,Zd,Gl,er,iu,Yl,su,Wc,rp,xp,Ip,fn,Gh,TX,LX],eA=[QM,dI];import{AllPolarModule as r6}from"ag-charts-community";var tA=[r6,jm,Hm,ry,ny,tk,Lk,Ok,Wk,Qk,Bn,er,Yl,Wc].flat(),iA=[gD,yD,AD,RD,zD],oA=[DX,jI,tA,iA,eA,JI,tM,uk,SI,wI,KI].flat();import{AgCharts as wh,ModuleRegistry as sA,VERSION as l6,_Scene as c6,_Theme as h6,_Util as d6}from"ag-charts-community";import"ag-charts-community";import{ModuleRegistry as u6,enterpriseRegistry as Kr}from"ag-charts-core";function p6(){u6.registerModules(oA),Kr.styles=Cm,Kr.licenseManager=e=>new Os(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),Kr.injectWatermark=wm,Kr.createBackground=e=>new Oh(e),Kr.createForeground=e=>new Pn(e)}var g6={setLicenseKey(e){Os.setLicenseKey(e)}},m6={VERSION:l6,_Scene:c6,_Theme:h6,_Util:d6,create:wh.create.bind(wh),createSparkline:wh.__createSparkline.bind(wh),setup:()=>{sA.setRegistryMode(sA.RegistryMode.Integrated),p6()},setGridContext:Os.setGridContext.bind(Os),setLicenseKey:Os.setLicenseKey.bind(Os),isEnterprise:!0};Am.setRegistryMode(Am.RegistryMode.Enterprise),En.styles=Cm,En.licenseManager=e=>new Os(e.container?.ownerDocument??(typeof document>"u"?void 0:document)),En.injectWatermark=wm,En.createBackground=e=>new Oh(e),En.createForeground=e=>new Pn(e);export{m6 as AgChartsEnterpriseModule,Om as AgTooltipAnchorToType,Em as AgTooltipPlacementType,WI as AllCartesianAxesModule,jI as AllCartesianModule,GI as AllCartesianSeriesModule,oA as AllEnterpriseModule,eA as AllGaugeModule,iA as AllMapSeriesModule,tA as AllPolarModule,Hm as AngleCategoryAxisModule,jm as AngleNumberAxisModule,Bn as AnimationModule,Xd as AnnotationsModule,Zd as BandHighlightModule,fu as BoxPlotSeriesModule,nc as CandlestickSeriesModule,Gl as ChartToolbarModule,tM as ChordSeriesModule,yM as ConeFunnelSeriesModule,er as ContextMenuModule,iu as CrosshairModule,Yl as DataSourceModule,su as ErrorBarsModule,JI as FinancialChartModule,Px as FlashOnUpdateModule,DM as FunnelSeriesModule,Wc as GradientLegendModule,Pu as HeatmapSeriesModule,g6 as LicenseManager,QM as LinearGaugeModule,yD as MapLineBackgroundSeriesModule,gD as MapLineSeriesModule,AD as MapMarkerSeriesModule,zD as MapShapeBackgroundSeriesModule,RD as MapShapeSeriesModule,rp as NavigatorModule,tk as NightingaleSeriesModule,hc as OhlcSeriesModule,Gh as OrdinalTimeAxisModule,uk as PyramidSeriesModule,Lk as RadarAreaSeriesModule,Ok as RadarLineSeriesModule,Wk as RadialBarSeriesModule,Qk as RadialColumnSeriesModule,dI as RadialGaugeModule,ny as RadiusCategoryAxisModule,ry as RadiusNumberAxisModule,fc as RangeAreaSeriesModule,bc as RangeBarSeriesModule,xp as RangesModule,SI as SankeySeriesModule,Zb as ScrollbarModule,vp as StatusBarModule,wI as SunburstSeriesModule,Ip as SyncModule,KI as TreemapSeriesModule,np as WaterfallSeriesModule,fn as ZoomModule};