UNPKG

ag-charts-community

Version:

Advanced Charting / Charts supporting Javascript / Typescript / React / Angular / Vue

16 lines 968 kB
(function(Ea,Ms){typeof exports=="object"&&typeof module=="object"?module.exports=Ms():typeof define=="function"&&define.amd?define("agCharts",[],Ms):typeof exports=="object"?exports.agCharts=Ms():Ea.agCharts=Ms()})(this,()=>{var Ea={},Ms={exports:Ea};if(typeof zR>"u")var zR=function(t){throw new Error("Unknown module: "+t)};var Ld=Object.defineProperty,GI=Object.getOwnPropertyDescriptor,iy=Object.getOwnPropertyNames,HI=Object.prototype.hasOwnProperty,Ce=(e,t)=>function(){return e&&(t=(0,e[iy(e)[0]])(e=0)),t},kd=(e,t)=>{for(var i in t)Ld(e,i,{get:t[i],enumerable:!0})},UI=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of iy(t))!HI.call(e,n)&&n!==i&&Ld(e,n,{get:()=>t[n],enumerable:!(s=GI(t,n))||s.enumerable});return e},N=e=>UI(Ld({},"__esModule",{value:!0}),e),Cd={};kd(Cd,{error:()=>sy,errorOnce:()=>YI,log:()=>WI,logGroup:()=>ZI,reset:()=>KI,table:()=>$I,warn:()=>wd,warnOnce:()=>Pa});function WI(...e){console.log(...e)}function wd(e,...t){console.warn(`AG Charts - ${e}`,...t)}function sy(e,...t){typeof e=="object"?console.error("AG Charts error",e,...t):console.error(`AG Charts - ${e}`,...t)}function $I(...e){console.table(...e)}function ny(e,t,i){let s;e instanceof Error?s=e.message:typeof e=="string"?s=e:typeof e=="object"?s=JSON.stringify(e):s=String(e);const n=`${t}: ${s}`;_c.has(n)||(i(e),_c.add(n))}function Pa(e,...t){ny(e,"Logger.warn",i=>wd(i,...t))}function YI(e,...t){ny(e,"Logger.error",i=>sy(i,...t))}function KI(){_c.clear()}function ZI(e,t){console.groupCollapsed(e);try{return t()}finally{console.groupEnd()}}var _c,jc=Ce({"packages/ag-charts-core/src/globals/logger.ts"(){"use strict";_c=new Set}}),Nd,XI=Ce({"packages/ag-charts-core/src/interfaces/moduleDefinition.ts"(){"use strict";Nd=(e=>(e.Axis="axis",e.Chart="chart",e.Preset="preset",e.Plugin="plugin",e.Series="series",e))(Nd||{})}}),ry={};kd(ry,{detectChartDefinition:()=>tA,getAxisModule:()=>iA,getPresetModule:()=>sA,getSeriesModule:()=>nA,hasModule:()=>JI,listModulesByType:()=>eA,register:()=>oy,registerMany:()=>qI,reset:()=>QI});function oy(e,t){const{def:i,version:s}=Qi.get(e.name)??{};if(!i){Qi.set(e.name,{def:e,version:t});return}if(!i.enterprise&&e.enterprise&&t===s){Qi.set(e.name,{def:e,version:t});return}if(s===t){wd([`AG Charts - Module '${e.name}' already registered,',
                'ignoring (version: ${s}).`,"Check your code for duplicate loading of charts NPM modules."].join(" "));return}throw new Error([`AG Charts - Module '${e.name}' already registered with different version:`,`${s} vs ${t}`,"","Check your package.json for conflicting dependencies - depending on your package manager","one of these commands may help:","- npm ls ag-charts-community","- yarn why ag-charts-community"].join(`
`))}function qI(e,t){for(const i of e)oy(i,t)}function QI(){Qi.clear()}function JI(e){return Qi.has(e)}function*eA(e){for(const t of Qi.values())Ra(e,t.def)&&(yield t.def)}function tA(e){for(const t of Qi.values())if(Ra("chart",t.def)&&t.def.detect(e))return t.def;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function iA(e){const t=Qi.get(e);if(Ra("axis",t?.def))return t?.def}function sA(e){const t=Qi.get(e);if(Ra("preset",t?.def))return t?.def}function nA(e){const t=Qi.get(e);if(Ra("series",t?.def))return t?.def}function Ra(e,t){return t?.type===e}var Qi,rA=Ce({"packages/ag-charts-core/src/globals/moduleRegistry.ts"(){"use strict";jc(),Qi=new Map}}),ay=Ce({"packages/ag-charts-core/src/globals/index.ts"(){"use strict";jc(),rA()}}),oA=Ce({"packages/ag-charts-core/src/interfaces/globalTypes.ts"(){"use strict"}}),ly,aA=Ce({"packages/ag-charts-core/src/classes/eventEmitter.ts"(){"use strict";ly=class{constructor(){this.events=new Map}on(e,t){return this.events.has(e)||this.events.set(e,new Set),this.events.get(e)?.add(t),()=>this.off(e,t)}off(e,t){const i=this.events.get(e);i&&(i.delete(t),i.size===0&&this.events.delete(e))}emit(e,t){this.events.get(e)?.forEach(i=>i(t))}clear(e){e?this.events.delete(e):this.events.clear()}}}});function zc(e){return e?Ji.document?.[e]:Ji.document}function cy(e){return e?Ji.window?.[e]:Ji.window}function lA(e){Ji.document=e}function cA(e){Ji.window=e}var Ji,Fc=Ce({"packages/ag-charts-core/src/utils/dom/globalsProxy.ts"(){"use strict";Ji={},typeof window<"u"?Ji.window=window:typeof global<"u"&&(Ji.window=global.window),typeof document<"u"?Ji.document=document:typeof global<"u"&&(Ji.document=global.document)}});function hy(e,t,i){const s=zc().createElement(e);if(typeof t=="object"&&(i=t,t=void 0),t)for(const n of t.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function hA(e){return zc().createElementNS("http://www.w3.org/2000/svg",e)}var uy=Ce({"packages/ag-charts-core/src/utils/dom/domElements.ts"(){"use strict";Fc()}});function uA(e,t){const i=zc("body"),s=hy("a",{display:"none"});s.href=e,s.download=t,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}var dA=Ce({"packages/ag-charts-core/src/utils/dom/domDownload.ts"(){"use strict";uy(),Fc()}});function pA(e,t,i,s){return e.addEventListener(t,i,s),()=>e.removeEventListener(t,i,s)}var gA=Ce({"packages/ag-charts-core/src/utils/dom/domEvents.ts"(){"use strict"}});function dy(e){const t=cy("Option"),{style:i}=new t;return i.color=e,i.color||null}var fA=Ce({"packages/ag-charts-core/src/utils/dom/domUtils.ts"(){"use strict";Fc()}}),py=Ce({"packages/ag-charts-core/src/utils/dom/index.ts"(){"use strict";dA(),uy(),gA(),fA(),Fc()}});function gy(e){return e!=null}function hr(e){return Array.isArray(e)}function fy(e){return typeof e=="boolean"}function Td(e){return e instanceof Date}function Od(e){return Td(e)&&!isNaN(Number(e))}function mA(e){return e instanceof RegExp}function An(e){return typeof e=="function"}function Ln(e){return typeof e=="object"&&e!==null&&!hr(e)}function yA(e){return hr(e)||my(e)}function my(e){return typeof e=="object"&&e!==null&&e.constructor?.name==="Object"}function ur(e){return typeof e=="string"}function bA(e){return typeof e=="number"}function kn(e){return Number.isFinite(e)}function xA(e){return typeof window<"u"&&e instanceof HTMLElement}function vA(e,t){return ur(t)&&Object.keys(e).includes(t)}function MA(e,t){return Object.values(e).includes(t)}function SA(e){return typeof e=="symbol"}function yy(e){return ur(e)&&(e==="none"||dy(e)!=null)}function DA(e,t){return e in t}var _a=Ce({"packages/ag-charts-core/src/utils/typeGuards.ts"(){"use strict";py()}});function IA(e,t=0,i){const{leading:s=!1,trailing:n=!0,maxWait:r=1/0}=i??{};let o,a;if(r<t)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!a){a=Date.now(),o=setTimeout(()=>a=null,t),e(...c);return}let h=t;if(r!==1/0&&a){const u=Date.now()-a;t>r-u&&(h=r-u)}clearTimeout(o),a??(a=Date.now()),o=setTimeout(()=>{a=null,n&&e(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(o),a=null}})}function AA(e,t,i){const{leading:s=!0,trailing:n=!0}=i??{};let r,o,a=!1;function l(){n&&o?(r=setTimeout(l,t),e(...o)):a=!1,o=null}function c(...h){a?o=h:(a=!0,r=setTimeout(l,t),s?e(...h):o=h)}return Object.assign(c,{cancel(){clearTimeout(r),a=!1,o=null}})}function Ed(e,t,i=""){try{return e(...t)}catch(s){const n=i?` \`${i}\``:"";Pa(`Uncaught exception in user callback${n}`,s)}}var by=Ce({"packages/ag-charts-core/src/utils/functions.ts"(){"use strict";jc()}});function Bc(e,t="and",i=String,s=1/0){if(e.length===0)return"";if(e.length===1)return i(e[0]);e=e.map(i);const n=e.pop();if(e.length>=s){const r=e.length-(s-1);return`${e.slice(0,s-1).join(", ")}, and ${r} more ${t} ${n}`}return`${e.join(", ")} ${t} ${n}`}function Vc(e,t=1/0){if(typeof e=="number"){if(isNaN(e))return"NaN";if(e===1/0)return"Infinity";if(e===-1/0)return"-Infinity"}const i=JSON.stringify(e)??typeof e;return i.length>t?`${i.slice(0,t)}... (+${i.length-t} characters)`:i}function LA(e){let t=1;for(let i=0;i<e.length;i++)e.charCodeAt(i)===10&&t++;return t}function xy(e,t){if(e===t)return 0;const[i,s]=e.length<t.length?[e,t]:[t,e],n=i.length,r=s.length;let o=new Array(n+1).fill(0).map((l,c)=>c),a=new Array(n+1);for(let l=1;l<=r;l++){a[0]=l;for(let c=1;c<=n;c++){const h=s[l-1]===i[c-1]?0:1;a[c]=Math.min(o[c]+1,a[c-1]+1,o[c-1]+h)}[o,a]=[a,o]}return o[n]}function kA(e){return e.replace(vy,(t,i)=>(i>0?"-":"")+t.toLowerCase())}var vy,My=Ce({"packages/ag-charts-core/src/utils/strings.ts"(){"use strict";vy=/[A-Z]+(?![a-z])|[A-Z]/g}});function ja(e,t){return kn(t)?`${e}[${t}]`:e?`${e}.${t}`:t}function mo(e,t,i=""){if(!Ln(e))return{cleared:null,invalid:[new yo("required","an object",e,i)]};const s={},n=[],r=new Set(Object.keys(e)),o=[];if(Fa in t){const a=Object.keys(t),l=t[Fa];if(e.type!=null&&a.includes(e.type)||e.type==null&&l!=null){const{type:c=l,...h}=e,u=mo(h,t[c],i);Object.assign(s,{type:c},u.cleared);for(const d of u.invalid)d.setUnionType(c,i);n.push(...u.invalid)}else{const c=Bc(a,"or",h=>`'${h}'`);n.push(new yo("required",`a keyword such as ${c}`,e.type,i,"type"))}return{cleared:s,invalid:n}}for(const a of Object.keys(t)){const l=t[a],c=l[Pd],h=e[a];if(r.delete(a),typeof h>"u"&&(l[Rd]||o.push(a),!c))continue;const u=ja(i,a);if(An(l)){const p=l(h,{options:e,path:u});if(typeof p=="object"){if(n.push(...p.invalid),p.valid){s[a]=p.cleared;continue}else if(Gc(p.invalid,u))continue}else if(p){s[a]=h;continue}n.push(new yo(c?"required":"invalid",l[li],h,i,a))}else{const d=mo(h,l,u);d.cleared!=null&&(s[a]=d.cleared),n.push(...d.invalid)}}for(const a of r){const l=e[a];typeof l>"u"||n.push(new Hc(o,l,i,a))}return{cleared:s,invalid:n}}function CA(e,t,i=2){const s=[],n=e.toLowerCase(),r=Dy.get(n);for(const o of t){const a=o.toLowerCase();(r?.has(o)||a.includes(n)||xy(n,a)<=i)&&s.push(o)}return s}function ze(e,t){if(An(e)){let s=function(n,r){return e(n,r)};var i=s;return s[li]=t,s}else return{...e,[li]:t}}function Fe(e){return Object.assign(An(e)?(t,i)=>e(t,i):ts(e),{[Pd]:!0,[li]:e[li]})}function es(e){return Object.assign(An(e)?(t,i)=>e(t,i):ts(e),{[Rd]:!0,[li]:e[li]})}function ri(...e){Ln(e[0])&&(e=Object.values(e[0]));const t=Bc(e,"or",i=>`'${i}'`);return ze(i=>e.includes(i),`a keyword such as ${t}`)}function Gc(e,t){return e.some(i=>i.type==="required"&&i.path===t)}function Sy(e,t){return i=>{if(i instanceof Hc)return Pa(`Callback \`${e.path}\` returned an unknown property \`${ja(i.path,i.key)}\`${i.getPostfix()}`);const s=Vc(i.value,50);Pa(i.key?`Callback \`${e.path}\` returned an invalid property \`${ja(i.path,i.key)}\`: \`${s}\`; expecting ${i.description}, ignoring.`:`Callback \`${e.path}\` returned an invalid value \`${s}\`; expecting ${t??i.description}, ignoring.`)}}var li,Pd,za,Rd,Fa,Dy,_d,yo,Hc,ts,jd,Uc,dr,Ba,Iy,Ay,pr,Ly,ci,ky,Cy,Ss,wy,gr,Ny,Wc,$c,Yc,zd,gt,Ty,oi,Oy,Ey,bo,Py,xo,Ry,_y,jy,Fd=Ce({"packages/ag-charts-core/src/utils/validation.ts"(){"use strict";jc(),by(),My(),_a(),li=Symbol("description"),Pd=Symbol("required"),za=Symbol("marked"),Rd=Symbol("undocumented"),Fa=Symbol("union"),Dy=[["placement","position"],["padding","spacing","gap"],["color","fill","stroke"],["whisker","wick"],["nodeClick","seriesNodeClick"],["nodeDoubleClick","seriesNodeDoubleClick"],["src","url"]].reduce((e,t)=>{for(const i of t)e.set(i.toLowerCase(),new Set(t.filter(s=>s!==i)));return e},new Map),_d=(e=>(e.Invalid="invalid",e.Required="required",e.Unknown="unknown",e))(_d||{}),yo=class{constructor(e,t,i,s,n){this.type=e,this.description=t,this.value=i,this.path=s,this.key=n}setUnionType(e,t){if(this.path.startsWith(t)){const i=this.path.slice(t.length);this.altPath=`${t}[type=${e}]${i}`}}getPrefix(){const{altPath:e=this.path,key:t}=this;return!e&&!t?"Value":`Option \`${t?ja(e,t):e}\``}toString(){const{description:e="unknown",type:t,value:i}=this;return t==="required"&&i==null?`${this.getPrefix()} is required and has not been provided; expecting ${e}, ignoring.`:`${this.getPrefix()} cannot be set to \`${Vc(i,50)}\`; expecting ${e}, ignoring.`}},Hc=class extends yo{constructor(e,t,i,s){super("unknown",void 0,t,i,s),this.suggestions=e,this.key=s}getPrefix(){return`Unknown option \`${ja(this.path,this.key)}\``}getPostfix(){const e=Bc(CA(this.key,this.suggestions),"or",t=>`\`${t}\``);return e?`; Did you mean ${e}? Ignoring.`:", ignoring."}toString(){return`${this.getPrefix()}${this.getPostfix()}`}},ts=(e,t="an object")=>ze((i,s)=>{const n=mo(i,e,s.path);return{valid:!Gc(n.invalid,s.path),cleared:n.cleared,invalid:n.invalid}},t),jd=(e,t,i)=>({...e,[li]:t,[Fa]:i}),Uc=(...e)=>ze((t,i)=>{const s=[];for(const n of e){const r=n(t,i);if(typeof r=="object"){if(s.push(...r.invalid),!r.valid)return{valid:!1,cleared:t,invalid:s};t=r.cleared}else if(!r)return!1}return{valid:!0,cleared:t,invalid:s}},e.map(t=>t[li]).filter(Boolean).join(" and ")),dr=(...e)=>ze((t,i)=>{for(const s of e){const n=s(t,i);if(typeof n=="object"?n.valid:n)return n}return!1},e.map(t=>t[li]).filter(Boolean).join(" or ")),Ba=e=>kn(e)||Od(e),Iy=e=>Td(e)||(kn(e)||ur(e))&&Od(new Date(e)),Ay=ze(hr,"an array"),pr=ze(fy,"a boolean"),Ly=ze(An,"a function"),ci=ze(yy,"a color string"),ky=ze(Iy,"a date"),Cy=ze(gy,"a defined value"),Ss=ze(kn,"a number"),wy=ze(Ln,"an object"),gr=ze(ur,"a string"),Ny=ze(e=>typeof HTMLElement>"u"||e instanceof HTMLElement,"an html element"),Wc=(e,t=1/0)=>{let i;return t===1/0?i=`an array of at least ${e} items`:e===t?i=`an array of exactly ${e} items`:e===0?i=`an array of no more than ${t} items`:i=`an array of at least ${e} and no more than ${t} items`,ze(s=>hr(s)&&s.length>=e&&s.length<=t,i)},$c=(e,t=1/0)=>{let i;return t===1/0?i=`a string of at least ${e} characters`:e===t?i=`an string of exactly ${e} characters`:e===0?i=`an string of no more than ${t} characters`:i=`an string of at least ${e} and no more than ${t} characters`,ze(s=>ur(s)&&s.length>=e&&s.length<=t,i)},Yc=(e,t=!0)=>ze(i=>kn(i)&&(i>e||t&&i===e),`a number greater than ${t?"or equal to ":""}${e}`),zd=(e,t)=>ze(i=>kn(i)&&i>=e&&i<=t,`a number between ${e} and ${t} inclusive`),gt=Yc(0),Ty=Yc(0,!1),oi=zd(0,1),Oy=e=>ze((t,{options:i})=>!Ba(t)||!Ba(i[e])||t<i[e],`the value to be less than \`${e}\``),Ey=e=>ze((t,{options:i})=>!Ba(t)||!Ba(i[e])||t>i[e],`the value to be greater than \`${e}\``),bo=e=>ze(t=>e===t,`the value ${JSON.stringify(e)}`),Py=(e,t)=>ze(i=>i instanceof e,t??`an instance of ${e.name}`),xo=(e,t,i=!0)=>ze((s,n)=>{if(!hr(s))return!1;let r=i;const o=[],a=[],l=c=>r=i?r&&c:r||c;if(s.length===0)return{valid:!0,cleared:o,invalid:a};for(let c=0;c<s.length;c++){const h=s[c],u=e(h,{options:h,path:`${n.path}[${c}]`});typeof u=="object"?(r=l(u.valid),a.push(...u.invalid),u.cleared!=null&&o.push(u.cleared)):(r=l(u),u&&o.push(h))}return{valid:r,cleared:r||!i?o:null,invalid:a}},t??`${e[li]} array`),Ry=(e,t="an object array")=>ze((i,s)=>{if(!hr(i))return!1;const n=[],r=[];for(let o=0;o<i.length;o++){const a=`${s.path}[${o}]`,l=mo(i[o],e,a);Gc(l.invalid,a)||n.push(l.cleared),r.push(...l.invalid)}return{valid:!0,cleared:n,invalid:r}},t),_y=(e,t)=>ze((i,s)=>An(i)?za in i?!0:{valid:!0,cleared:Object.assign((...r)=>{const o=Ed(i,r);if(o==null)return;const a=e(o,{options:o,path:""});if(typeof a=="object"){if(a.invalid.forEach(Sy(s,t??e[li])),a.valid)return a.cleared}else{if(a)return o;Pa(`Callback \`${s.path}\` returned an invalid value \`${Vc(o,50)}\`; expecting ${t??e[li]}, ignoring.`)}},{[za]:!0}),invalid:[]}:!1,"a function"),jy=(e,t="an object")=>ze((i,s)=>An(i)?za in i?!0:{valid:!0,cleared:Object.assign((...r)=>{const o=Ed(i,r,s.path);if(o==null)return;const a=mo(o,e);return a.invalid.forEach(Sy(s,t)),a.cleared},{[za]:!0}),invalid:[]}:!1,"a function")}});function wA(e){return{enabled:pr,range:ri("tooltip","node"),highlightedItem:e,unhighlightedItem:e}}function NA(e,t){return{enabled:pr,range:ri("tooltip","node"),highlightedItem:e,unhighlightedItem:e,highlightedSeries:t,unhighlightedSeries:t}}var Bd,zy,Vd,Va,Kc,Fy,vo,Gd,Hd,Ud,By,Wd,fr,Ga,Vy,Gy,Hy,Zc,$d,Uy,TA=Ce({"packages/ag-charts-core/src/options/commonOptionsDefs.ts"(){"use strict";_a(),Fd(),Bd=e=>{if(!Ln(e))return!1;const t=Object.keys(e);return t.length===1&&t[0].startsWith("$")},zy=ts({color:ci,stop:oi},""),Vd=ze(e=>{let t=-1/0;for(const i of e)if(i?.stop!=null){if(i.stop<t)return!1;t=i.stop}return!0},"color stops to be defined in ascending order"),Va=Uc(Wc(2),xo(zy),Vd),Kc=ri("axis","item","series"),Fy=ts({type:Fe(bo("gradient")),colorStops:Fe(Va),rotation:Ss,gradient:es(ri("linear","radial","conic")),bounds:es(Kc),reverse:es(pr)},"a gradient object with color stops"),vo={stroke:ci,strokeWidth:gt,strokeOpacity:oi},Gd=ts({type:Fe(bo("gradient")),gradient:Fe(ri("linear","radial","conic")),bounds:Fe(Kc),colorStops:Fe(dr(Va,Uc(Wc(2),xo(ci)))),rotation:Fe(Ss),reverse:Fe(pr)}),Hd=ts({type:Fe(bo("pattern")),pattern:Fe(ri("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),path:$c(2),width:Fe(gt),height:Fe(gt),fill:Fe(ci),fillOpacity:Fe(oi),backgroundFill:Fe(ci),backgroundFillOpacity:Fe(oi),padding:Fe(gt),rotation:Fe(Ss),scale:Fe(gt),stroke:Fe(ci),strokeWidth:Fe(gt),strokeOpacity:Fe(oi)}),Ud=ts({type:Fe(bo("image")),url:gr,width:gt,height:gt,rotation:Fe(Ss),backgroundFill:Fe(ci),backgroundFillOpacity:oi,fit:Fe(ri("stretch","contain","cover")),repeat:Fe(ri("repeat","repeat-x","repeat-y","no-repeat"))}),By=jd({gradient:{colorStops:Va,rotation:Ss,gradient:es(ri("linear","radial","conic")),bounds:es(Kc),reverse:es(pr)},pattern:{pattern:ri("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),path:$c(2),width:gt,height:gt,rotation:Ss,scale:gt,fill:ci,fillOpacity:oi,backgroundFill:ci,backgroundFillOpacity:oi,...vo,padding:es(gt)},image:{url:Fe(gr),backgroundFill:ci,backgroundFillOpacity:oi,width:gt,height:gt,fit:ri("stretch","contain","cover","none"),repeat:ri("repeat","repeat-x","repeat-y","no-repeat"),rotation:Ss}},"a color object"),Wd=dr(ci,ts(By,"a color object")),fr={fill:Wd,fillOpacity:oi},fr.fillGradientDefaults=es(Gd),fr.fillPatternDefaults=es(Hd),fr.fillImageDefaults=es(Ud),Ga={lineDash:xo(gt),lineDashOffset:Ss},Vy={...fr,...vo,...Ga,opacity:oi,cornerRadius:gt},Gy={...vo,...Ga,opacity:oi},Hy={...fr,...vo,...Ga,opacity:oi},Zc=ts({googleFont:gr},"google font"),$d=dr(gr,Bd,Zc,xo(dr(gr,Zc))),Uy={color:ci,fontFamily:$d,fontSize:gt,fontStyle:ri("normal","italic","oblique"),fontWeight:dr(gt,ri("normal","bold","bolder","lighter"))}}});function OA(e){return typeof e>"u"?[]:Array.isArray(e)?e:[e]}function EA(e){return Array.from(new Set(e))}function PA(e,t){return e.reduce((i,s)=>{const n=t(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function Wy(e,t){if(e==null||t==null||e.length!==t.length)return!1;for(let i=0;i<e.length;i++)if(Array.isArray(e[i])&&Array.isArray(t[i])){if(!Wy(e[i],t[i]))return!1}else if(e[i]!==t[i])return!1;return!0}function RA(e,t,i=0){if(e.length===0)return[];const s=[];for(let n=0;n<t;n++)s.push(e.at((n+i)%e.length));return s}function _A(e,t){const i=new Map;return t.forEach((s,n)=>{i.set(s,n)}),e.sort((s,n)=>{const r=i.get(s)??1/0,o=i.get(n)??1/0;return r-o})}function jA(e,t){let i=0;for(;i<e.length&&t(e[i]);)i+=1;const s=i;s!==0&&e.splice(0,s)}function zA(e,t){let i=e.length-1;for(;i>=0&&t(e[i]);)i-=1;const s=e.length-1-i;s!==0&&e.splice(e.length-s,s)}var FA=Ce({"packages/ag-charts-core/src/utils/arrays.ts"(){"use strict"}});function BA(e=0){return new Promise(t=>{setTimeout(t,e)})}var $y,VA=Ce({"packages/ag-charts-core/src/utils/async.ts"(){"use strict";$y=class{constructor(){this.queue=[]}await(e=50){return new Promise(t=>{const i=()=>{clearTimeout(n),t(!0)},n=setTimeout(()=>{const r=this.queue.indexOf(i);r<0||(this.queue.splice(r,1),t(!1))},e);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(e=>e())}}}});function*GA(...e){for(const t of e)yield*t}function HA(e){return e!=null&&typeof e=="object"&&Symbol.iterator in e?e:[e]}function UA(e){for(const t of e)return t;throw new Error("AG Charts - no first() value found")}function*Yd(e){const t=[void 0,void 0];for(const i of Object.keys(e))t[0]=i,t[1]=e[i],yield t}var Yy=Ce({"packages/ag-charts-core/src/utils/iterators.ts"(){"use strict"}});function Cn(e){return e==="true"}function WA(e){return Number(e)}function Ii(e){return e}function Ky(e,t,i){i==null||i===""||i===""?e?.removeAttribute(t):e?.setAttribute(t,i.toString())}function $A(e,t){if(t!=null)for(const[i,s]of Yd(t))i!=="class"&&Ky(e,i,s)}function YA(e,t,i){if(!(e instanceof HTMLElement))return;const s=e.getAttribute(t);return s===null?i:Xy[t]?.(s)??void 0}function Zy(e,t,i){e!=null&&(i==null?e.style.removeProperty(t):e.style.setProperty(t,i.toString()))}function KA(e,t){for(const[i,s]of Yd(t))Zy(e,i,s)}var Xy,ZA=Ce({"packages/ag-charts-core/src/utils/attributeUtil.ts"(){"use strict";Yy(),Xy={role:Ii,"aria-checked":Cn,"aria-controls":Ii,"aria-describedby":Ii,"aria-disabled":Cn,"aria-expanded":Cn,"aria-haspopup":Ii,"aria-hidden":Cn,"aria-label":Ii,"aria-labelledby":Ii,"aria-live":Ii,"aria-orientation":Ii,"aria-selected":Cn,"data-focus-override":Cn,"data-focus-visible-override":Cn,"data-preventdefault":Cn,class:Ii,for:Ii,id:Ii,tabindex:WA,title:Ii,placeholder:Ii}}});function XA(e,t,i,s,n){return t<e.x+e.width&&t+s>e.x&&i<e.y+e.height&&i+n>e.y}function qA(e,t,i,s=0,n=0){return t>=e.x&&t+s<=e.x+e.width&&i>=e.y&&i+n<=e.y+e.height}function QA(e){return e==null||e.height===0||e.width===0||isNaN(e.height)||isNaN(e.width)}function JA(e,t){return e.x===t.x&&e.y===t.y&&e.width===t.width&&e.height===t.height}var eL=Ce({"packages/ag-charts-core/src/utils/boxBounds.ts"(){"use strict"}});function tL(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,e=n+1):t=n-1}return s}function iL(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2);i(n)?(s=n,t=n-1):e=n+1}return s}function sL(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),r=i(n);r==null?t=n-1:(s=r,e=n+1)}return s}function nL(e,t,i){if(e>t)return;let s;for(;t>=e;){const n=Math.floor((t+e)/2),r=i(n);r==null?e=n+1:(s=r,t=n-1)}return s}var rL=Ce({"packages/ag-charts-core/src/utils/binarySearch.ts"(){"use strict"}}),qy,Qy,oL=Ce({"packages/ag-charts-core/src/utils/caching.ts"(){"use strict";qy=class{constructor(e){this.getter=e}get(){return this.result??(this.result=this.getter()),this.result}clear(){this.result=void 0}},Qy=class{constructor(e){this.getter=e}get(){let e=this.result?.deref();return e||(e=this.getter(),this.result=new WeakRef(e),e)}clear(){this.result=void 0}}}}),Jy,aL=Ce({"packages/ag-charts-core/src/utils/cleanupRegistry.ts"(){"use strict";Jy=class{constructor(){this.callbacks=new Set}flush(){for(const e of this.callbacks)e();this.callbacks.clear()}merge(e){for(const t of e.callbacks)this.callbacks.add(t)}register(...e){for(const t of e)t&&this.callbacks.add(t)}}}});function lL(e,t){const i=Math.max(e.length,t.length),s=new Set,n=new Set;for(let r=0;r<i;r++){const o=e[r],a=t[r];o!==a&&(n.has(a)?n.delete(a):a&&s.add(a),s.has(o)?s.delete(o):o&&n.add(o))}return{changed:s.size>0||n.size>0,added:s,removed:n}}var cL=Ce({"packages/ag-charts-core/src/utils/diff.ts"(){"use strict"}});function eb(e,t,i){return Math.min(i,Math.max(e,t))}function hL(e,t,i=1e-10){return e>=t[0]-i&&e<=t[1]+i}function Kd(e,t,i=1e-10){return e===t||Math.abs(e-t)<i}function uL(e){return Math.sign(e)===-1||Object.is(e,-0)}function dL(e){return e%1===0}function pL(e,t=2){const i=10**t;return Math.round(e*i)/i}function gL(e,t){return Math.floor(e%t+(e<0?Math.abs(t):0))}function fL(e){if(Math.floor(e)===e)return 0;let t=String(e),i=0;if(e<1e-6||e>=1e21){let n;[t,n]=t.split("e"),n!=null&&(i=Number(n))}const s=t.split(".")[1]?.length??0;return Math.max(s-i,0)}var Zd=Ce({"packages/ag-charts-core/src/utils/numbers.ts"(){"use strict"}});function tb(e){return Array.isArray(e)&&e.length>=2&&e.every(kn)}function Xc(e){return Array.isArray(e)&&e.length>=2&&e.every(tb)}function mL(e){const t=e[0],i=e[e.length-1];return Kd(t[0],i[0],.001)&&Kd(t[1],i[1],.001)}function ib(e){return Array.isArray(e)&&e.every(Xc)&&e.every(mL)}function sb(e){if(e===null)return!0;if(!Ln(e)||e.type==null)return!1;const{type:t,coordinates:i}=e;switch(t){case"GeometryCollection":return Array.isArray(e.geometries)&&e.geometries.every(sb);case"MultiPolygon":return Array.isArray(i)&&i.every(ib);case"Polygon":return ib(i);case"MultiLineString":return Array.isArray(i)&&i.every(Xc);case"LineString":return Xc(i);case"MultiPoint":return Xc(i);case"Point":return tb(i);default:return!1}}function yL(e){return Ln(e)&&e.type==="Feature"&&sb(e.geometry)}function bL(e){return Ln(e)&&e.type==="FeatureCollection"&&Array.isArray(e.features)&&e.features.every(yL)}var nb,xL=Ce({"packages/ag-charts-core/src/utils/geoJson.ts"(){"use strict";Zd(),_a(),Fd(),nb=ze(bL,"a GeoJSON object")}}),rb,Xd,vL=Ce({"packages/ag-charts-core/src/utils/graph.ts"(){"use strict";rb=class{constructor(e,t){this._vertexCount=0,this.pendingProcessingEdges=[],this.cachedNeighboursEdge=e,this.processedEdge=t}clear(){this._vertexCount=0,this.pendingProcessingEdges=[]}addVertex(e){const t=new Xd(e);return this._vertexCount++,t}addEdge(e,t,i){i===this.cachedNeighboursEdge&&e.cachedNeighbours.set(t.value,t),i===this.processedEdge&&this.pendingProcessingEdges.push([e,t]);const{edges:s}=e,n=s.get(i);n?n.indexOf(t)===-1&&n.push(t):s.set(i,[t])}removeVertex(e){this._vertexCount--;const t=e.edges;if(t){for(const[i,s]of t)this._vertexCount-=s.length;e.clear()}}removeEdge(e,t){for(const[i,s]of e.edges){const n=s.indexOf(t);s.splice(n,1),s.length===0&&e.edges.delete(i)}}removeEdges(e,t){e.edges.delete(t)}getVertexValue(e){return e.value}*neighbours(e){for(const[t,i]of e.edges)for(const s of i)yield s}*neighboursAndEdges(e){for(const[t,i]of e.edges)for(const s of i)yield[s,t]}neighboursWithEdgeValue(e,t){return e.edges.get(t)??[]}findNeighbour(e,t){return e.edges.get(t)?.[0]}findNeighbourValue(e,t){const i=this.findNeighbour(e,t);if(i)return this.getVertexValue(i)}findNeighbourWithValue(e,t,i){const s=i==null?this.neighbours(e):this.neighboursWithEdgeValue(e,i);for(const n of s)if(this.getVertexValue(n)===t)return n}findVertexAlongEdge(e,t,i){if(i===this.cachedNeighboursEdge){let r;for(const o of t)if(r=(r??e).cachedNeighbours.get(o),!r)return;return r}let s=e,n;for(const r of t){let o=!1;for(const a of this.neighboursWithEdgeValue(s,i))if(this.getVertexValue(a)===r){s=a,o=!0;break}if(!o)return;n=s}return n}adjacent(e,t){for(const[i,s]of e.edges)if(s.includes(t))return!0;return!1}},Xd=class{constructor(e){this.value=e,this.edges=new Map,this.cachedNeighbours=new Map}clear(){this.edges.clear(),this.cachedNeighbours.clear()}}}});function ML(){qc.clear(),qd=1}function SL(e){const t=e.constructor,i=Object.hasOwn(t,"className")?t.className:t.name;if(!i)throw new Error(`The ${t} is missing the 'className' property.`);const s=(qc.get(i)??0)+1;return qc.set(i,s),`${i}-${s}`}function DL(){return`ag-charts-${qd++}`}function IL(){return crypto.randomUUID?.()??AL()}function AL(){const e=new Uint8Array(16);crypto.getRandomValues(e),e[6]=e[6]&15|64,e[8]=e[8]&63|128;let t="";for(let i=0;i<e.length;i++)(i===4||i===6||i===8||i===10)&&(t+="-"),t+=e[i].toString(16).padStart(2,"0");return t}var qc,LL,qd,kL=Ce({"packages/ag-charts-core/src/utils/id.ts"(){"use strict";qc=new Map,LL=Symbol("ElementID"),qd=1}}),ob,CL=Ce({"packages/ag-charts-core/src/utils/linkedList.ts"(){"use strict";ob=(e,t,i)=>{let s=e,n=s;for(const r of t)if(s==null||i(s.value,r)>0)s={value:r,next:s},n=s;else{for(n=n;n.next!=null&&i(n.next.value,r)<=0;)n=n.next;n.next={value:r,next:n.next}}return s}}});function wL(e){if(!ur(e))return!1;const t=Jd.exec(e);return Qd.test(t?t[2]:e)}function ab(e){let t,i;const s=Jd.exec(e);s&&([,t,e,i]=s);const n=Qd.exec(e);if(!n){Cd.warnOnce(`The number formatter is invalid: ${e}`);return}const[,r,o,a,l,c,h,u,d,p,g]=n;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:!!p,type:g,prefix:t,suffix:i}}function NL(e){const t=typeof e=="string"?ab(e):e;if(t==null)return;const{fill:i,align:s,sign:n="-",symbol:r,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=t;let{trim:p}=t;const g=d==null||isNaN(d);let y;if(!c)y=Ai.g,p=!0;else if(c in Ai&&c in mr)y=g?mr[c]:Ai[c];else if(c in Ai)y=Ai[c];else if(c in mr)y=mr[c];else throw new Error(`The number formatter type is invalid: ${c}`);const b=c?6:12;let m;return g||(m=d),(v,S)=>{let M=y(v,m??S??b);return p&&(M=TL(M)),l&&(M=OL(M,l)),M=PL(v,M,n),r&&r!=="#"&&(M=`${r}${M}`),r==="#"&&c==="x"&&(M=`0x${M}`),c==="s"&&(M=`${M}${EL(v)}`),(c==="%"||c==="p")&&(M=`${M}%`),a!=null&&!isNaN(a)&&(M=RL(M,a,i??o,s)),M=`${h}${M}${u}`,M}}function Qc(e){return Math.floor(Math.abs(e))}function TL(e){if(!e.endsWith("0")||e.indexOf(".")===-1)return e;let t=e.length-1;for(;t>0;)if(e[t]=="0")t-=1;else if(e[t]=="."){t-=1;break}else break;return e.substring(0,t+1)}function OL(e,t){let i=e.indexOf(".");i<0&&(i=e.length);const s=e.substring(0,i).split(""),n=e.substring(i);for(let r=s.length-3;r>0;r-=3)s.splice(r,0,t);return`${s.join("")}${n}`}function EL(e){return cb[lb(e)]}function lb(e){return eb(ep,e?Math.floor(Math.log10(Math.abs(e))/3)*3:0,tp)}function PL(e,t,i=""){if(i==="(")return e>=0?t:`(${t})`;const s=i==="+"?"+":"";return`${e>=0?s:hb}${t}`}function RL(e,t,i=" ",s=">"){let n=e;if(s===">"||!s)n=n.padStart(t,i);else if(s==="<")n=n.padEnd(t,i);else if(s==="^"){const r=Math.max(0,t-n.length),o=Math.ceil(r/2),a=Math.floor(r/2);n=n.padStart(o+n.length,i),n=n.padEnd(a+n.length,i)}return n}var Qd,Jd,mr,Ai,ep,tp,cb,hb,_L=Ce({"packages/ag-charts-core/src/utils/numberFormat.ts"(){"use strict";ay(),Zd(),_a(),Qd=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,Jd=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/,mr={b:e=>Qc(e).toString(2),c:e=>String.fromCharCode(e),d:e=>Math.round(Math.abs(e)).toFixed(0),o:e=>Qc(e).toString(8),x:e=>Qc(e).toString(16),X:e=>mr.x(e).toUpperCase(),n:e=>mr.d(e),"%":e=>`${Qc(e*100).toFixed(0)}`},Ai={e:(e,t)=>Math.abs(e).toExponential(t),E:(e,t)=>Ai.e(e,t).toUpperCase(),f:(e,t)=>Math.abs(e).toFixed(t),F:(e,t)=>Ai.f(e,t).toUpperCase(),g:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),s=Math.floor(Math.log10(i));return s>=-4&&s<t?i.toFixed(t-1-s):i.toExponential(t-1)},G:(e,t)=>Ai.g(e,t).toUpperCase(),n:(e,t)=>Ai.g(e,t),p:(e,t)=>Ai.r(e*100,t),r:(e,t)=>{if(e===0)return"0";const i=Math.abs(e),n=Math.floor(Math.log10(i))-(t-1);if(n<=0)return i.toFixed(-n);const r=10**n;return(Math.round(i/r)*r).toFixed()},s:(e,t)=>{const i=lb(e);return Ai.r(e/10**i,t)},"%":(e,t)=>Ai.f(e*100,t)},ep=-24,tp=24,cb={[ep]:"y",[-21]:"z",[-18]:"a",[-15]:"f",[-12]:"p",[-9]:"n",[-6]:"\xB5",[-3]:"m",0:"",3:"k",6:"M",9:"G",12:"T",15:"P",18:"E",21:"Z",[tp]:"Y"},hb="\u2212"}}),w={};kd(w,{AdjacencyListGraph:()=>rb,AsyncAwaitQueue:()=>$y,CleanupRegistry:()=>Jy,ErrorType:()=>_d,EventEmitter:()=>ly,Logger:()=>Cd,ModuleRegistry:()=>ry,ModuleType:()=>Nd,SimpleCache:()=>qy,UnknownError:()=>Hc,ValidationError:()=>yo,Vertex:()=>Xd,WeakCache:()=>Qy,and:()=>Uc,array:()=>Ay,arrayLength:()=>Wc,arrayOf:()=>xo,arrayOfDefs:()=>Ry,arraysEqual:()=>Wy,attachDescription:()=>ze,attachListener:()=>pA,barHighlightOptionsDef:()=>Vy,boolean:()=>pr,boxCollides:()=>XA,boxContains:()=>qA,boxEmpty:()=>QA,boxesEqual:()=>JA,callback:()=>Ly,callbackDefs:()=>jy,callbackOf:()=>_y,circularSliceArray:()=>RA,clamp:()=>eb,color:()=>ci,colorStopsOrderValidator:()=>Vd,colorUnion:()=>Wd,constant:()=>bo,countFractionDigits:()=>fL,countLines:()=>LA,createElement:()=>hy,createElementId:()=>DL,createId:()=>SL,createNumberFormatter:()=>NL,createSvgElement:()=>hA,date:()=>ky,debounce:()=>IA,defined:()=>Cy,diffArrays:()=>lL,downloadUrl:()=>uA,dropFirstWhile:()=>jA,dropLastWhile:()=>zA,entries:()=>Yd,fillGradientDefaults:()=>Gd,fillImageDefaults:()=>Ud,fillOptionsDef:()=>fr,fillPatternDefaults:()=>Hd,findMaxIndex:()=>tL,findMaxValue:()=>sL,findMinIndex:()=>iL,findMinValue:()=>nL,first:()=>UA,fontFamilyFull:()=>$d,fontOptionsDef:()=>Uy,generateUUID:()=>IL,geoJson:()=>nb,getAttribute:()=>YA,getDocument:()=>zc,getWindow:()=>cy,googleFont:()=>Zc,gradientColorStops:()=>Va,gradientStrict:()=>Fy,greaterThan:()=>Ey,groupBy:()=>PA,hasRequiredInPath:()=>Gc,highlightOptionsDef:()=>wA,htmlElement:()=>Ny,inRange:()=>hL,insertListItemsSorted:()=>ob,instanceOf:()=>Py,isArray:()=>hr,isBoolean:()=>fy,isColor:()=>yy,isDate:()=>Td,isDefined:()=>gy,isEnumKey:()=>vA,isEnumValue:()=>MA,isFiniteNumber:()=>kn,isFunction:()=>An,isHtmlElement:()=>xA,isInteger:()=>dL,isKeyOf:()=>DA,isNegative:()=>uL,isNumber:()=>bA,isNumberEqual:()=>Kd,isObject:()=>Ln,isObjectLike:()=>yA,isPlainObject:()=>my,isRegExp:()=>mA,isString:()=>ur,isSymbol:()=>SA,isValidDate:()=>Od,isValidNumberFormat:()=>wL,iterate:()=>GA,joinFormatted:()=>Bc,kebabCase:()=>kA,lessThan:()=>Oy,levenshteinDistance:()=>xy,lineDashOptionsDef:()=>Ga,lineHighlightOptionsDef:()=>Gy,modulus:()=>gL,multiSeriesHighlightOptionsDef:()=>NA,number:()=>Ss,numberMin:()=>Yc,numberRange:()=>zd,object:()=>wy,optionsDefs:()=>ts,or:()=>dr,parseColor:()=>dy,parseNumberFormat:()=>ab,pause:()=>BA,positiveNumber:()=>gt,positiveNumberNonZero:()=>Ty,ratio:()=>oi,required:()=>Fe,resetIds:()=>ML,roundTo:()=>pL,safeCall:()=>Ed,setAttribute:()=>Ky,setAttributes:()=>$A,setDocument:()=>lA,setElementStyle:()=>Zy,setElementStyles:()=>KA,setWindow:()=>cA,shapeHighlightOptionsDef:()=>Hy,sortBasedOnArray:()=>_A,string:()=>gr,stringLength:()=>$c,stringifyValue:()=>Vc,strokeOptionsDef:()=>vo,themeOperator:()=>Bd,throttle:()=>AA,toArray:()=>OA,toIterable:()=>HA,typeUnion:()=>jd,undocumented:()=>es,union:()=>ri,unionSymbol:()=>Fa,unique:()=>EA,validate:()=>mo});var T=Ce({"packages/ag-charts-core/src/main.ts"(){"use strict";ay(),oA(),XI(),aA(),TA(),py(),FA(),VA(),ZA(),eL(),rL(),oL(),aL(),cL(),by(),xL(),vL(),kL(),Yy(),CL(),_L(),Zd(),My(),_a(),Fd()}}),jL=Object.create,Ha=Object.defineProperty,ub=Object.getOwnPropertyDescriptor,zL=Object.getOwnPropertyNames,FL=Object.getPrototypeOf,BL=Object.prototype.hasOwnProperty,is=(e,t)=>{for(var i in t)Ha(e,i,{get:t[i],enumerable:!0})},db=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of zL(t))!BL.call(e,n)&&n!==i&&Ha(e,n,{get:()=>t[n],enumerable:!(s=ub(t,n))||s.enumerable});return e},yr=(e,t,i)=>(i=e!=null?jL(FL(e)):{},db(t||!e||!e.__esModule?Ha(i,"default",{value:e,enumerable:!0}):i,e)),VL=e=>db(Ha({},"__esModule",{value:!0}),e),f=(e,t,i,s)=>{for(var n=s>1?void 0:s?ub(t,i):t,r=e.length-1,o;r>=0;r--)(o=e[r])&&(n=(s?o(t,i,n):o(n))||n);return s&&n&&Ha(t,i,n),n},pb={};is(pb,{AG_CHARTS_LOCALE_EN_US:()=>B0,AgCharts:()=>ar,AgChartsCommunityModule:()=>_R,AgErrorBarSupportedSeriesTypes:()=>ew,AgTooltipAnchorToType:()=>H0,AgTooltipPlacementType:()=>U0,VERSION:()=>Ir,_ModuleSupport:()=>lI,_Scene:()=>Pm,_Theme:()=>jm,_Util:()=>zm,_Widget:()=>gI,setupCommunityModules:()=>Mm,time:()=>YP}),Ms.exports=VL(pb);var Jc=(T(),N(w)),At=(T(),N(w)),GL=(T(),N(w)),eh=class{constructor(){this.cleanup=new GL.CleanupRegistry}destroy(){this.cleanup.flush()}},HL=class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...e){for(const t of e){this.registerDependencies(t);const i=this.modules.find(s=>t.type===s.type&&("optionsKey"in t&&"optionsKey"in s?t.optionsKey===s.optionsKey:!0)&&t.identifier===s.identifier);if(i){if(t.packageType==="enterprise"&&i.packageType==="community"){const s=this.modules.indexOf(i);this.modules.splice(s,1,t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}else this.modules.push(t),"optionsKey"in t&&this.modulesByOptionKey.set(t.optionsKey,t)}}hasEnterpriseModules(){return this.modules.some(e=>e.packageType==="enterprise")}*byType(...e){const t=new Set,i=this.modules.filter(r=>e.includes(r.type)),s=r=>{const o=this.dependencies.get(r);return o?.flatMap(s).concat(o)??[]},n=[];for(const r of i){const o="optionsKey"in r?r.optionsKey:r.contextKey;if(!t.has(o)){for(const a of s(o)){if(t.has(a))continue;const l=this.modulesByOptionKey.get(a);if(!l){n.push(a);continue}e.includes(l.type)&&(yield l,t.add(a))}yield r,t.add(o)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(e){if(e.dependencies==null||e.dependencies.length===0)return;const t="optionsKey"in e?e.optionsKey:e.contextKey;this.dependencies.set(t,e.dependencies)}},Ds=new HL,wn=(T(),N(w)),th=Symbol("interpolate"),ih=e=>e[th]!=null;function sh(e,t,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const r of i){const o=r.distanceSquared(e,t);if(o===0)return{nearest:r,distanceSquared:0};o<n.distanceSquared&&(n.nearest=r,n.distanceSquared=o)}return n}function UL(e,t,i,s=1/0){const{x:n=e,y:r=t}=i.transformPoint?.(e,t)??{},o={nearest:void 0,distanceSquared:s};for(const a of i.children){const{nearest:l,distanceSquared:c}=a.nearestSquared(n,r,o.distanceSquared);if(c===0)return{nearest:l,distanceSquared:c};c<o.distanceSquared&&(o.nearest=l,o.distanceSquared=c)}return o}var Ua=class Oa{constructor(t,i,s,n){this.x=t,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:t,y:i,width:s,height:n}){return new Oa(t,i,s,n)}static merge(t){let i=1/0,s=1/0,n=-1/0,r=-1/0;for(const o of t)o.x<i&&(i=o.x),o.y<s&&(s=o.y),o.x+o.width>n&&(n=o.x+o.width),o.y+o.height>r&&(r=o.y+o.height);return new Oa(i,s,n-i,r-s)}static nearestBox(t,i,s){return sh(t,i,s)}toDOMRect(){return{x:this.x,y:this.y,width:this.width,height:this.height,top:this.y,left:this.x,right:this.x+this.width,bottom:this.y+this.height,toJSON(){return{}}}}clone(){const{x:t,y:i,width:s,height:n}=this;return new Oa(t,i,s,n)}equals(t){return(0,wn.boxesEqual)(this,t)}containsPoint(t,i){return(0,wn.boxContains)(this,t,i)}intersection(t){if(!this.collidesBBox(t))return;const i=(0,wn.clamp)(t.x,this.x,t.x+t.width),s=(0,wn.clamp)(t.y,this.y,t.y+t.height),n=(0,wn.clamp)(t.x,this.x+this.width,t.x+t.width),r=(0,wn.clamp)(t.y,this.y+this.height,t.y+t.height);return new Oa(i,s,n-i,r-s)}collidesBBox(t){return this.x<t.x+t.width&&this.x+this.width>t.x&&this.y<t.y+t.height&&this.y+this.height>t.y}computeCenter(){return{x:this.x+this.width/2,y:this.y+this.height/2}}isFinite(){return Number.isFinite(this.x)&&Number.isFinite(this.y)&&Number.isFinite(this.width)&&Number.isFinite(this.height)}distanceSquared(t,i){if(this.containsPoint(t,i))return 0;const s=t-(0,wn.clamp)(this.x,t,this.x+this.width),n=i-(0,wn.clamp)(this.y,i,this.y+this.height);return s*s+n*n}shrink(t,i){if(typeof t=="number")this.applyMargin(t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(t,i){if(typeof t=="number")this.applyMargin(-t,i);else for(const s of Object.keys(t)){const n=t[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(t,i){switch(i){case"top":this.y+=t;case"bottom":this.height-=t;break;case"left":this.x+=t;case"right":this.width-=t;break;case"vertical":this.y+=t,this.height-=t*2;break;case"horizontal":this.x+=t,this.width-=t*2;break;case void 0:this.x+=t,this.y+=t,this.width-=t*2,this.height-=t*2;break}}translate(t,i){return this.x+=t,this.y+=i,this}[th](t,i){return new Oa(this.x*(1-i)+t.x*i,this.y*(1-i)+t.y*i,this.width*(1-i)+t.width*i,this.height*(1-i)+t.height*i)}};Ua.zero=Object.freeze(new Ua(0,0,0,0)),Ua.NaN=Object.freeze(new Ua(NaN,NaN,NaN,NaN));var W=Ua,gb=(T(),N(w)),Mo=(T(),N(w)),WL=2e3,fb=Date.now(),$L=()=>{const e=Date.now()-fb;if(e>WL){const t=(Math.floor(e/100)/10).toFixed(1);Mo.Logger.log(`**** ${t}s since last log message ****`)}fb=Date.now()},me={create(...e){return Object.assign((...i)=>{me.check(...e)&&(typeof i[0]=="function"&&(i=(0,Mo.toArray)(i[0]())),$L(),Mo.Logger.log(...i))},{check:()=>me.check(...e),group:(i,s)=>me.check(...e)?Mo.Logger.logGroup(i,s):s()})},check(...e){return e.length===0&&e.push(!0),(0,Mo.toArray)((0,Mo.getWindow)("agChartsDebug")).some(i=>e.includes(i))},inDevelopmentMode(e){if(me.check("dev"))return e()}};function mb({context:e,pixelRatio:t,width:i,height:s}){e.save();try{e.resetTransform(),e.clearRect(0,0,Math.ceil(i*t),Math.ceil(s*t))}finally{e.restore()}}function yb(e){if(me.check("canvas")){const t=e.save.bind(e),i=e.restore.bind(e);let s=0;Object.assign(e,{save(){t(),s++},restore(){if(s===0)throw new Error("AG Charts - Unable to restore() past depth 0");i(),s--},verifyDepthZero(){if(s!==0)throw new Error(`AG Charts - Save/restore depth is non-zero: ${s}`)}})}}function bb(e,t,i){return[Math.floor(e*i),Math.floor(t*i)]}var ip=class{constructor(e){const{width:t,height:i,pixelRatio:s,willReadFrequently:n=!1}=e;this.width=t,this.height=i,this.pixelRatio=s;const[r,o]=bb(t,i,s);this.canvas=new OffscreenCanvas(r,o),this.context=this.canvas.getContext("2d",{willReadFrequently:n}),this.context.setTransform(s,0,0,s,0,0),yb(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.canvas,t,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(e,t,i){if(!(e>0&&t>0))return;const{canvas:s,context:n}=this;if(e!==this.width||t!==this.height||i!==this.pixelRatio){const[r,o]=bb(e,t,i);s.width=r,s.height=o}n.setTransform(i,0,0,i,0,0),this.width=e,this.height=t,this.pixelRatio=i}clear(){mb(this)}destroy(){this.canvas.width=0,this.canvas.height=0,this.context.clearRect(0,0,0,0),this.canvas=null,this.context=null,Object.freeze(this)}},nh=(T(),N(w)),YL=yr((T(),N(w))),sp=Symbol("BREAK"),Wa="__decorator_config",rh="__decorator_accessors";function KL(e,t){np(e,t).optional=!0}function np(e,t){if(Object.getOwnPropertyDescriptor(e,Wa)==null&&Object.defineProperty(e,Wa,{value:{}}),Object.getOwnPropertyDescriptor(e,rh)==null){const h=Object.getPrototypeOf(e)?.[rh]?.slice()??[];Object.defineProperty(e,rh,{value:h})}const i=e[Wa],s=t.toString();if(i[s]!=null)return i[s];i[s]={setters:[],getters:[],observers:[]};const n=Object.getOwnPropertyDescriptor(e,t);let r=n?.get,o=n?.set;if(r==null||o==null){const c=e[rh];let h=c.indexOf(t);h===-1&&(h=c.push(t)-1),r??(r=function(){let u=this.__accessors;return u==null&&(u=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:u})),u[h]}),o??(o=function(u){let d=this.__accessors;d==null&&(d=c.slice().fill(void 0),Object.defineProperty(this,"__accessors",{value:d})),d[h]=u})}return Object.defineProperty(e,t,{set:function(c){const{setters:h,observers:u}=i[s];let d;h.some(p=>p.length>2)&&(d=r.call(this));for(const p of h)if(c=p(this,t,c,d),c===sp)return;o.call(this,c);for(const p of u)p(this,c,d)},get:function(){let c=r.call(this);for(const h of i[s].getters)if(c=h(this,t,c),c===sp)return;return c},enumerable:!0,configurable:!1}),i[s]}function br(e,t,i){return(s,n)=>{const r=np(s,n);r.setters.push(e),t&&r.getters.unshift(t),i&&Object.assign(r,i)}}function xb(e){return(t,i)=>{np(t,i).observers.push(e)}}function oh(e){return typeof e<"u"&&Wa in e}function xr(e){const t=new Set;for(;oh(e);)t.add(e?.[Wa]),e=Object.getPrototypeOf(e);return Array.from(t).flatMap(i=>Object.keys(i))}function vb(e){return xr(e).reduce((t,i)=>(t[i]=e[i]??null,t),{})}var{entries:ZL,isArray:rp,isObject:Mb,isPlainObject:Nn}=YL;function ft(e,t){return Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:e.every((i,s)=>ft(i,t[s])):Nn(e)?Nn(t)?op(e,t,ft):!1:e===t}function op(e,t,i){if(Object.is(e,t))return!0;for(const s of Object.keys(t))if(!(s in e))return!1;for(const s of Object.keys(e))if(!(s in t)||!i(e[s],t[s]))return!1;return!0}function Le(...e){const t={};for(const i of e){if(!Mb(i))continue;const s=oh(i)?xr(i):Object.keys(i);for(const n of s)Nn(t[n])&&Nn(i[n])?t[n]=Le(t[n],i[n]):t[n]??(t[n]=i[n])}return t}function $a(...e){const t={};for(const i of e){if(!Mb(i))continue;const s=oh(i)?xr(i):Object.keys(i);for(const n of s)Nn(t[n])&&Nn(i[n])?t[n]=$a(t[n],i[n]):n in t||(t[n]??(t[n]=i[n]))}return t}function Sb(e,...t){return t&&rp(e)?e.map(i=>Le(i,...t)):e}function Db(e,t){const i={};for(const[s,n]of ZL(e))i[s]=t(n,s,e);return i}function G(e,t){const i={...e};for(const s of t)delete i[s];return i}function ap(e,t){if(e==null)return;const i={};for(const s of t)Object.hasOwn(e,s)&&(i[s]=e[s]);return i}function lp(e,t){return(rp(t)?t:t.split(".")).reduce((s,n)=>s[n],e)}var cp=new Set(["__proto__","constructor","prototype"]);function hp(e,t,i){const s=rp(t)?t.slice():t.split("."),n=s.pop();if(s.some(o=>cp.has(o)))return;const r=s.reduce((o,a)=>o[a],e);return r[n]=i,r[n]}function up(e,t,i){if(i===void 0)return t;for(const s of e){const n=i[s];n!==void 0&&(t[s]=n)}return t}function Us(e){return e==null||typeof e!="object"||!Nn(e)||(Object.freeze(e),Object.getOwnPropertyNames(e).forEach(t=>{const i=e[t];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&Us(i)})),e}function Ib(e,t){return Nn(e)&&t in e}function XL(e,t){return Ib(e,t)&&typeof e[t]=="string"}var qL=(T(),N(w)),So=(e,t)=>e===t;function z(e){return function(t,i){const s=`__${i}`;t[i]||QL(t,i,s,e)}}function Li(e){return z(e)}function dp(e){const t=e??{};return t.equals=qL.arraysEqual,z(e)}function QL(e,t,i,s){const{changeCb:n,convertor:r,checkDirtyOnAssignment:o=!1}=s??{},a={changeCb:n,checkDirtyOnAssignment:o,convertor:r},l=tk(i,ek(JL(ik(i,a),a),a),a);Object.defineProperty(e,t,{set:l,get:function(){return this[i]},enumerable:!0,configurable:!0})}function JL(e,t){const{convertor:i}=t;return i?function(s){e.call(this,i(s))}:e}var Ab=Symbol("no-change");function ek(e,t){const{changeCb:i}=t;return i?function(s){const n=e.call(this,s);return n!==Ab&&i.call(this,this),n}:e}function tk(e,t,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const r=t.call(this,n);return n?._dirty===!0&&this.markDirty(e),r}:t}function ik(e,t){const{equals:i=So}=t;return function(s){const n=this[e];return i(s,n)?Ab:(this[e]=s,this.onChangeDetection(e),s)}}var pp=(e,t)=>Math.sign(e-t);function Lb(e,t){if(typeof e=="number"&&typeof t=="number")return pp(e,t);const i=typeof e=="number"?[e]:e,s=typeof t=="number"?[t]:t,n=Math.min(i.length,s.length);for(let r=0;r<n;r+=1){const o=pp(i[r],s[r]);if(o!==0)return o}return pp(i.length,s.length)}var kb=(e=>(e[e.All=0]="All",e[e.None=1]="None",e))(kb||{}),sk=5,Ya=class Xm{constructor(t){this.serialNumber=Xm._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=(0,nh.createId)(this),this.name=void 0,this.transitionOut=void 0,this.pointerEvents=0,this._datum=void 0,this._previousDatum=void 0,this.scene=void 0,this._debugDirtyProperties=void 0,this.parentNode=void 0,this.cachedBBox=void 0,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.batchLevel=0,this.batchDirty=!1,this.name=t?.name,this.tag=t?.tag??NaN,this.zIndex=t?.zIndex??0,(t?.debugDirty??Xm._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(t,i,s){const n=t?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const r=(0,nh.createSvgElement)("svg");if(r.setAttribute("width",String(i)),r.setAttribute("height",String(s)),r.setAttribute("viewBox",`0 0 ${i} ${s}`),n.defs?.length){const o=(0,nh.createSvgElement)("defs");o.append(...n.defs),r.append(o)}return r.append(...n.elements),r.outerHTML}static*extractBBoxes(t,i){for(const s of t)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(t){this._datum!==t&&(this._previousDatum=this._datum,this._datum=t)}get previousDatum(){return this._previousDatum}get layerManager(){return this.scene?.layersManager}get imageLoader(){return this.scene?.imageLoader}closestDatum(){for(const{datum:t}of this.traverseUp(!0))if(t!=null)return t}preRender(t,i=1){if(this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i,this.batchLevel>0||this.batchDirty)throw new Error("AG Charts - illegal rendering state; batched update in progress");return this.childNodeCounts}isolatedRender(t){t.ctx.save();try{this.render(t)}catch(i){const s=i.errorCount??1;if(s>=sk)throw i.errorCount=s,i;nh.Logger.warnOnce("Error during rendering",i,i.stack)}finally{t.ctx.restore()}}render(t){const{stats:i}=t;if(this.debugDirtyProperties(),t.debugNodeSearch){const s=this.name??this.id;t.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(t.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}setScene(t){this.scene=t}*traverseUp(t){let i=this;for(t&&(yield i);i=i.parentNode;)yield i}isRoot(){return!this.parentNode}removeChild(t){throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`)}remove(){this.parentNode?.removeChild(this)}destroy(){this.parentNode?.removeChild(this)}batchedUpdate(t){this.batchLevel++,t(),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1)}setProperties(t){return this.batchLevel++,Object.assign(this,t),this.batchLevel--,this.batchLevel===0&&this.batchDirty&&(this.markDirty(),this.batchDirty=!1),this}containsPoint(t,i){return!1}pickNode(t,i){if(this.containsPoint(t,i))return this}pickNodes(t,i,s=[]){return this.containsPoint(t,i)&&s.push(this),s}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}onChangeDetection(t){this.markDirty(t)}markDirtyChildrenOrder(){this.cachedBBox=void 0}markDirty(t){if(this.batchLevel>0){this.batchDirty=!0;return}t!=null&&this._debugDirtyProperties&&this.markDebugProperties(t),this.cachedBBox=void 0,this.parentNode?.markDirty()}markDebugProperties(t){const i=this._debugDirtyProperties?.get(t)??[],s=new Error().stack?.split(`
`).filter(n=>n!=="Error"&&!n.includes(".markDebugProperties")&&!n.includes(".markDirty")&&!n.includes("Object.assign ")&&!n.includes(`${this.constructor.name}.`))??"unknown";i.push(s[0].replace(" at ","").trim()),this._debugDirtyProperties?.set(t,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((t,i)=>{t.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${t.length}x)`),t.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){this.parentNode?.markDirtyChildrenOrder()}toSVG(){}};Ya._nextSerialNumber=0,Ya._debugEnabled=!1,f([z()],Ya.prototype,"visible",2),f([Li({equals:ft,changeCb:e=>e.onZIndexChange()})],Ya.prototype,"zIndex",2);var Ws=Ya,Ka=(T(),N(w)),nk=(T(),N(w)),zi=Math.PI*2,Za=Math.PI/2;function ct(e){return e%=zi,e+=zi,e%=zi,e}function rk(e){return e%=zi,e+=zi,e!==zi&&(e%=zi),e}function Xa(e){return e%=zi,e<-Math.PI?e+=zi:e>=Math.PI&&(e-=zi),e}function vr(e,t,i){const s=ct(e),n=ct(t),r=ct(i);return n<r?n<=s&&s<=r:n>r?n<=s||s<=r:!0}function mt(e){return e/180*Math.PI}function ok(e){return e/Math.PI*180}function ah(e,t){return e=ct(e),t=ct(t),t-e+(e>t?zi:0)}function Cb(e){const t=ct(e);return t<=Za?t/Za:t<=Math.PI?(Math.PI-t)/Za:t<=1.5*Math.PI?(t-Math.PI)/Za:(zi-t)/Za}function gp(e,t,i){const s=Cb(i);return e*s+t*Math.abs(1-s)}function $s(e){return e?ct(mt(e)):0}var ak=(T(),N(w)),lh=(T(),N(w)),Ys=(T(),N(w)),Mr=(e,t,i)=>e*(1-i)+t*i,fp=e=>{const t=e<0?-1:1,i=Math.abs(e);return i<=.04045?e/12.92:t*((i+.055)/1.055)**2.4},mp=e=>{const t=e<0?-1:1,i=Math.abs(e);return i>.0031308?t*(1.055*i**(1/2.4)-.055):12.92*e},wb=class Te{constructor(t,i,s,n=1){this.r=(0,Ys.clamp)(0,t||0,1),this.g=(0,Ys.clamp)(0,i||0,1),this.b=(0,Ys.clamp)(0,s||0,1),this.a=(0,Ys.clamp)(0,n||0,1)}static validColorString(t){return t.indexOf("#")>=0?!!Te.parseHex(t):t.indexOf("rgb")>=0?!!Te.stringToRgba(t):Te.nameToHex.has(t.toLowerCase())}static fromString(t){if(t.indexOf("#")>=0)return Te.fromHexString(t);const i=Te.nameToHex.get(t.toLowerCase());if(i)return Te.fromHexString(i);if(t.indexOf("rgb")>=0)return Te.fromRgbaString(t);throw new Error(`Invalid color string: '${t}'`)}static parseHex(t){t=t.replace(/ /g,"").slice(1);let i;switch(t.length){case 6:case 8:i=[];for(let s=0;s<t.length;s+=2)i.push(parseInt(`${t[s]}${t[s+1]}`,16));break;case 3:case 4:i=t.split("").map(s=>parseInt(s,16)).map(s=>s+s*16);break}if(i?.length>=3&&i.every(s=>s>=0))return i.length===3&&i.push(255),i}static fromHexString(t){const i=Te.parseHex(t);if(i){const[s,n,r,o]=i;return new Te(s/255,n/255,r/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${t}'`)}static stringToRgba(t){let i=-1,s=-1;for(let a=0;a<t.length;a++){const l=t[a];if(i===-1&&l==="(")i=a;else if(l===")"){s=a;break}}if(i===-1||s===-1)return;const r=t.substring(i+1,s).split(","),o=[];for(let a=0;a<r.length;a++){const l=r[a];let c=parseFloat(l);if(!Number.isFinite(c))return;l.indexOf("%")>=0?(c=(0,Ys.clamp)(0,c,100),c/=100):a===3?c=(0,Ys.clamp)(0,c,1):(c=(0,Ys.clamp)(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(t){const i=Te.stringToRgba(t);if(i){if(i.length===3)return new Te(i[0],i[1],i[2]);if(i.length===4)return new Te(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${t}'`)}static fromArray(t){if(t.length===4)return new Te(t[0],t[1],t[2],t[3]);if(t.length===3)return new Te(t[0],t[1],t[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(t,i,s,n=1){const r=Te.HSBtoRGB(t,i,s);return new Te(r[0],r[1],r[2],n)}static fromHSL(t,i,s,n=1){const r=Te.HSLtoRGB(t,i,s);return new Te(r[0],r[1],r[2],n)}static fromOKLCH(t,i,s,n=1){const r=Te.OKLCHtoRGB(t,i,s);return new Te(r[0],r[1],r[2],n)}static padHex(t){return t.length===1?"0"+t:t}toHexString(){let t="#"+Te.padHex(Math.round(this.r*255).toString(16))+Te.padHex(Math.round(this.g*255).toString(16))+Te.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(t+=Te.padHex(Math.round(this.a*255).toString(16))),t}toRgbaString(t=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,t);return this.a!==1?(i.push(Math.round(this.a*s)/s),`rgba(${i.join(", ")})`):`rgb(${i.join(", ")})`}toString(){return this.a===1?this.toHexString():this.toRgbaString()}toHSB(){return Te.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(t,i,s){const n=fp(t),r=fp(i),o=fp(s),a=Math.cbrt(.4122214708*n+.5363325363*r+.0514459929*o),l=Math.cbrt(.2119034982*n+.6806995451*r+.1073969566*o),c=Math.cbrt(.0883024619*n+.2817188376*r+.6299787005*o),h=.2104542553*a+.793617785*l-.0040720468*c,u=1.9779984951*a-2.428592205*l+.4505937099*c,d=.0259040371*a+.7827717662*l-.808675766*c,p=Math.atan2(d,u)*180/Math.PI,g=h,y=Math.hypot(u,d),b=p>=0?p:p+360;return[g,y,b]}static OKLCHtoRGB(t,i,s){const n=t,r=i*Math.cos(s*Math.PI/180),o=i*Math.sin(s*Math.PI/180),a=(n+.3963377774*r+.2158037573*o)**3,l=(n-.1055613458*r-.0638541728*o)**3,c=(n-.0894841775*r-1.291485548*o)**3,h=4.0767416621*a-3.3077115913*l+.2309699292*c,u=-1.2684380046*a+2.6097574011*l-.3413193965*c,d=-.0041960863*a-.7034186147*l+1.707614701*c,p=mp(h),g=mp(u),y=mp(d);return[p,g,y]}static RGBtoHSL(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),o=(r+n)/2;let a,l;if(r===n)a=0,l=0;else{const c=r-n;l=o>.5?c/(2-r-n):c/(r+n),r===t?a=(i-s)/c+(i<s?6:0):r===i?a=(s-t)/c+2:a=(t-i)/c+4,a*=360/6}return[a,l,o]}static HSLtoRGB(t,i,s){if(t=(t%360+360)%360,i===0)return[s,s,s];const n=s<.5?s*(1+i):s+i-s*i,r=2*s-n;function o(h){return h<0&&(h+=1),h>1&&(h-=1),h<1/6?r+(n-r)*6*h:h<1/2?n:h<2/3?r+(n-r)*(2/3-h)*6:r}const a=o(t/360+1/3),l=o(t/360),c=o(t/360-1/3);return[a,l,c]}static RGBtoHSB(t,i,s){const n=Math.min(t,i,s),r=Math.max(t,i,s),o=r===0?0:(r-n)/r;let a=0;if(n!==r){const l=r-n,c=(r-t)/l,h=(r-i)/l,u=(r-s)/l;t===r?a=u-h:i===r?a=2+c-u:a=4+h-c,a/=6,a<0&&(a=a+1)}return[a*360,o,r]}static HSBtoRGB(t,i,s){t=(t%360+360)%360/360;let n=0,r=0,o=0;if(i===0)n=r=o=s;else{const a=(t-Math.floor(t))*6,l=a-Math.floor(a),c=s*(1-i),h=s*(1-i*l),u=s*(1-i*(1-l));switch(a>>0){case 0:n=s,r=u,o=c;break;case 1:n=h,r=s,o=c;break;case 2:n=c,r=s,o=u;break;case 3:n=c,r=h,o=s;break;case 4:n=u,r=c,o=s;break;case 5:n=s,r=c,o=h;break}}return[n,r,o]}static mix(t,i,s){return new Te(Mr(t.r,i.r,s),Mr(t.g,i.g,s),Mr(t.b,i.b,s),Mr(t.a,i.a,s))}static lighten(t,i){const s=Te.RGBtoOKLCH(t.r,t.g,t.b);return Te.fromOKLCH((0,Ys.clamp)(0,s[0]+i,1),s[1],s[2])}static darken(t,i){const s=Te.RGBtoOKLCH(t.r,t.g,t.b);return Te.fromOKLCH((0,Ys.clamp)(0,s[0]-i,1),s[1],s[2])}static interpolate(t,i){const s=1/(t.length-1),n=t.map(r=>Te.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,o)=>{const a=o/(i-1),l=t.length<=2?0:Math.min(Math.floor(a*(t.length-1)),t.length-2),c=(a-l*s)/s,h=n[l],u=n[l+1];return Te.fromOKLCH(Mr(h[0],u[0],c),Mr(h[1],u[1],c),Mr(h[2],u[2],c))})}};wb.nameToHex=new Map([["aliceblue","#F0F8FF"],["antiquewhite","#FAEBD7"],["aqua","#00FFFF"],["aquamarine","#7FFFD4"],["azure","#F0FFFF"],["beige","#F5F5DC"],["bisque","#FFE4C4"],["black","#000000"],["blanchedalmond","#FFEBCD"],["blue","#0000FF"],["blueviolet","#8A2BE2"],["brown","#A52A2A"],["burlywood","#DEB887"],["cadetblue","#5F9EA0"],["chartreuse","#7FFF00"],["chocolate","#D2691E"],["coral","#FF7F50"],["cornflowerblue","#6495ED"],["cornsilk","#FFF8DC"],["crimson","#DC143C"],["cyan","#00FFFF"],["darkblue","#00008B"],["darkcyan","#008B8B"],["darkgoldenrod","#B8860B"],["darkgray","#A9A9A9"],["darkgreen","#006400"],["darkgrey","#A9A9A9"],["darkkhaki","#BDB76B"],["darkmagenta","#8B008B"],["darkolivegreen","#556B2F"],["darkorange","#FF8C00"],["darkorchid","#9932CC"],["darkred","#8B0000"],["darksalmon","#E9967A"],["darkseagreen","#8FBC8F"],["darkslateblue","#483D8B"],["darkslategray","#2F4F4F"],["darkslategrey","#2F4F4F"],["darkturquoise","#00CED1"],["darkviolet","#9400D3"],["deeppink","#FF1493"],["deepskyblue","#00BFFF"],["dimgray","#696969"],["dimgrey","#696969"],["dodgerblue","#1E90FF"],["firebrick","#B22222"],["floralwhite","#FFFAF0"],["forestgreen","#228B22"],["fuchsia","#FF00FF"],["gainsboro","#DCDCDC"],["ghostwhite","#F8F8FF"],["gold","#FFD700"],["goldenrod","#DAA520"],["gray","#808080"],["green","#008000"],["greenyellow","#ADFF2F"],["grey","#808080"],["honeydew","#F0FFF0"],["hotpink","#FF69B4"],["indianred","#CD5C5C"],["indigo","#4B0082"],["ivory","#FFFFF0"],["khaki","#F0E68C"],["lavender","#E6E6FA"],["lavenderblush","#FFF0F5"],["lawngreen","#7CFC00"],["lemonchiffon","#FFFACD"],["lightblue","#ADD8E6"],["lightcoral","#F08080"],["lightcyan","#E0FFFF"],["lightgoldenrodyellow","#FAFAD2"],["lightgray","#D3D3D3"],["lightgreen","#90EE90"],["lightgrey","#D3D3D3"],["lightpink","#FFB6C1"],["lightsalmon","#FFA07A"],["lightseagreen","#20B2AA"],["lightskyblue","#87CEFA"],["lightslategray","#778899"],["lightslategrey","#778899"],["lightsteelblue","#B0C4DE"],["lightyellow","#FFFFE0"],["lime","#00FF00"],["limegreen","#32CD32"],["linen","#FAF0E6"],["magenta","#FF00FF"],["maroon","#800000"],["mediumaquamarine","#66CDAA"],["mediumblue","#0000CD"],["mediumorchid","#BA55D3"],["mediumpurple","#9370DB"],["mediumseagreen","#3CB371"],["mediumslateblue","#7B68EE"],["mediumspringgreen","#00FA9A"],["mediumturquoise","#48D1CC"],["mediumvioletred","#C71585"],["midnightblue","#191970"],["mintcream","#F5FFFA"],["mistyrose","#FFE4E1"],["moccasin","#FFE4B5"],["navajowhite","#FFDEAD"],["navy","#000080"],["oldlace","#FDF5E6"],["olive","#808000"],["olivedrab","#6B8E23"],["orange","#FFA500"],["orangered","#FF4500"],["orchid","#DA70D6"],["palegoldenrod","#EEE8AA"],["palegreen","#98FB98"],["paleturquoise","#AFEEEE"],["palevioletred","#DB7093"],["papayawhip","#FFEFD5"],["peachpuff","#FFDAB9"],["peru","#CD853F"],["pink","#FFC0CB"],["plum","#DDA0DD"],["powderblue","#B0E0E6"],["purple","#800080"],["rebeccapurple","#663399"],["red","#FF0000"],["rosybrown","#BC8F8F"],["royalblue","#4169E1"],["saddlebrown","#8B4513"],["salmon","#FA8072"],["sandybrown","#F4A460"],["seagreen","#2E8B57"],["seashell","#FFF5EE"],["sienna","#A0522D"],["silver","#C0C0C0"],["skyblue","#87CEEB"],["slateblue","#6A5ACD"],["slategray","#708090"],["slategrey","#708090"],["snow","#FFFAFA"],["springgreen","#00FF7F"],["steelblue","#4682B4"],["tan","#D2B48C"],["teal","#008080"],["thistle","#D8BFD8"],["tomato","#FF6347"],["transparent","#00000000"],["turquoise","#40E0D0"],["violet","#EE82EE"],["wheat","#F5DEB3"],["white","#FFFFFF"],["whitesmoke","#F5F5F5"],["yellow","#FFFF00"],["yellowgreen","#9ACD32"]]);var Be=wb,ch=class{ticks(e,t,i){}niceDomain(e,t=this.domain){return t}get bandwidth(){}get step(){}get inset(){}},qa=(e,t)=>{const i=Symbol(String(t));e[i]=void 0,Object.defineProperty(e,t,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})},Nb=e=>{const t=Be.fromString(e),[i,s,n]=Be.RGBtoOKLCH(t.r,t.g,t.b);return{l:i,c:s,h:n,a:t.a}},yp=1e-6,Tb=e=>e.c<yp||e.l<yp||e.l>1-yp,lk=(e,t,i)=>{i=(0,lh.clamp)(0,i,1);let s;if(Tb(e))s=t.h;else if(Tb(t))s=e.h;else{const a=e.h;let l=t.h;const c=t.h-e.h;c>180?l-=360:c<-180&&(l+=360),s=a*(1-i)+l*i}const n=e.c*(1-i)+t.c*i,r=e.l*(1-i)+t.l*i,o=e.a*(1-i)+t.a*i;return Be.fromOKLCH(r,n,s,o)},Do=class extends ch{constructor(){super(...arguments),this.type="color",this.defaultTickCount=0,this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Nb)}update(){const{domain:e,range:t}=this;e.length<2&&(lh.Logger.warnOnce("`colorDomain` should have at least 2 values."),e.length===0?e.push(0,1):e.length===1&&e.push(e[0]+1));for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];if(s>=n){lh.Logger.warnOnce("`colorDomain` values should be supplied in ascending order."),e.sort((r,o)=>r-o);break}}if(t.length<e.length)for(let i=t.length;i<e.length;i++)t.push(t.length>0?t[0]:"black");this.parsedRange=this.range.map(Nb)}normalizeDomains(...e){return{domain:e.flat(),animatable:!0}}toDomain(){}convert(e){this.refresh();const{domain:t,range:i,parsedRange:s}=this,n=t[0],r=t.at(-1),o=i[0],a=i[i.length-1];if(e<=n)return o;if(e>=r)return a;let l,c;if(t.length===2){const d=(e-n)/(r-n),p=1/(i.length-1);l=i.length<=2?0:Math.min(Math.floor(d*(i.length-1)),i.length-2),c=(d-l*p)/p}else{for(l=0;l<t.length-2&&!(e<t[l+1]);l++);const d=t[l],p=t[l+1];c=(e-d)/(p-d)}const h=s[l],u=s[l+1];return lk(h,u,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&lh.Logger.warnOnce("Expected update to not invalidate scale"))}};f([qa],Do.prototype,"domain",2),f([qa],Do.prototype,"range",2);var hh=class{constructor(e,t=[],i){this.colorSpace=e,this.stops=t,this.bbox=i,this._cache=void 0}createGradient(e,t,i){const s=this.bbox??t;if(!s.isFinite())return;if(this._cache!=null&&this._cache.ctx===e&&this._cache.bbox.equals(s))return this._cache.gradient;const{stops:n,colorSpace:r}=this;if(n.length===0)return;if(n.length===1)return n[0].color;let o=this.createCanvasGradient(e,s,i);if(o==null)return;const a=r==="oklch",l=.05;let c=n[0];o.addColorStop(c.stop,c.color);for(let h=1;h<n.length;h+=1){const u=n[h];if(a){const d=new Do;d.domain=[c.stop,u.stop],d.range=[c.color,u.color];for(let p=c.stop+l;p<u.stop;p+=l)o.addColorStop(p,d.convert(p))}o.addColorStop(u.stop,u.color),c=u}return"createPattern"in o&&(o=o.createPattern()),this._cache={ctx:e,bbox:s,gradient:o},o}toSvg(e){const t=this.bbox??e,i=this.createSvgGradient(t);return this.stops.forEach(({stop:s,color:n})=>{const r=(0,ak.createSvgElement)("stop");r.setAttribute("offset",`${s}`),r.setAttribute("stop-color",`${n}`),i.appendChild(r)}),i}},Ob=class extends hh{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}createCanvasGradient(e,t,i){const{angle:n}=this,r=$s(n+-90),o=i?.centerX??t.x+t.width*.5,a=i?.centerY??t.y+t.height*.5;return e.createConicGradient(r,o,a)}createSvgGradient(e){return(0,nk.createSvgElement)("linearGradient")}},ck=(T(),N(w)),Eb=class extends hh{constructor(e,t,i=0,s){super(e,t,s),this.angle=i}getGradientPoints(e){const{angle:i}=this,s=$s(i+90),n=Math.cos(s),r=Math.sin(s),o=e.width,a=e.height,l=e.x+o*.5,c=e.y+a*.5,h=Math.sqrt(a*a+o*o)/2,u=Math.atan2(a,o);let d;s<Math.PI/2?d=s:s<Math.PI?d=Math.PI-s:s<1.5*Math.PI?d=s-Math.PI:d=2*Math.PI-s;const p=h*Math.abs(Math.cos(d-u));return{x0:l+n*p,y0:c+r*p,x1:l-n*p,y1:c-r*p}}createCanvasGradient(e,t){const{x0:i,y0:s,x1:n,y1:r}=this.getGradientPoints(t);if(!(isNaN(i)||isNaN(s)||isNaN(n)||isNaN(r)))return e.createLinearGradient(i,s,n,r)}createSvgGradient(e){const{x0:t,y0:i,x1:s,y1:n}=this.getGradientPoints(e),r=(0,ck.createSvgElement)("linearGradient");return r.setAttribute("x1",String(t)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(s)),r.setAttribute("y2",String(n)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},hk=(T(),N(w)),uk=class extends hh{constructor(e,t,i){super(e,t,i)}createCanvasGradient(e,t,i){const s=i?.centerX??t.x+t.width*.5,n=i?.centerY??t.y+t.height*.5,r=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2;return e.createRadialGradient(s,n,r,s,n,o)}createSvgGradient(e){const t=e.x+e.width*.5,i=e.y+e.height*.5,s=(0,hk.createSvgElement)("radialGradient");return s.setAttribute("cx",String(t)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},dk=(T(),N(w)),Qa=(T(),N(w)),x=KL,ae=class{handleUnknownProperties(e,t){}set(e){const{className:t=this.constructor.name}=this.constructor;if(typeof e!="object")return Qa.Logger.warn(`unable to set ${t} - expecting a properties object`),this;const i=new Set(Object.keys(e));for(const s of xr(this))if(i.has(s)){const n=e[s],r=this;if(Io(r[s]))if(r[s]instanceof Ja){const o=r[s].reset(n);o!=null?r[s]=o:Qa.Logger.warn(`unable to set [${s}] - expecting a properties array`)}else r[s].set(n);else(0,Qa.isPlainObject)(n)?r[s]=$a(n,r[s]??{}):r[s]=n;i.delete(s)}this.handleUnknownProperties(i,e);for(const s of i)Qa.Logger.warn(`unable to set [${s}] in ${t} - property is unknown`);return this}toJson(){return xr(this).reduce((e,t)=>{const i=this[t];return e[t]=Io(i)?i.toJson():i,e},{})}},Ja=class SI extends Array{constructor(t,...i){super(i.length);const n=(r=>!!r?.prototype?.constructor?.name)(t)?r=>new t().set(r):t;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(t){if((0,Qa.isArray)(t)){this.length=t.length;for(let i=0;i<t.length;i++)this[i]=this.itemFactory(t[i])}return this}reset(t){if(Array.isArray(t))return new SI(this.itemFactory,...t)}toJson(){return this.map(t=>t?.toJson?.()??t)}};function Io(e){return e instanceof ae||e instanceof Ja}var bp=class extends ae{constructor(){super(...arguments),this.color="black"}};f([x],bp.prototype,"stop",2),f([x],bp.prototype,"color",2);function pk(e){let t;for(const i of e)if(i?.stop!=null){if(t!=null&&i.stop<t)return!1;t=i.stop}return!0}function Pb(e){return e.flatMap((t,i)=>{const{stop:s}=t,n=e.at(i+1)?.color;return n!=null?[t,{stop:s,color:n}]:[t]})}function gk(e,t){const i=t==="discrete"?1:0,s=e.map((n,r,{length:o})=>({stop:(r+i)/(o-1+i),color:n}));return t==="discrete"?Pb(s):s}function Rb(e,t,i,s="continuous"){const n=e.map(g=>typeof g=="string"?{color:g}:g);if(n.length===0)return gk(t,s);if(!pk(n))return dk.Logger.warnOnce("[fills] must have the stops defined in ascending order"),[];const r=Math.min(...i),o=Math.max(...i),a=s==="discrete",l=new Float64Array(n.length);let c=0,h=-1;for(let g=0;g<n.length;g+=1){const y=n[g];if(g>=h){h=n.length-1;for(let m=g+1;m<n.length;m+=1)if(n[m]?.stop!=null){h=m;break}}let b=y?.stop;if(b==null){const m=n[c]?.stop,v=n[h]?.stop,S=m??r,M=v??o,I=a&&m==null?1:0;b=S+(M-S)*(g-c+I)/(h-c+I)}else c=g;l[g]=Math.max(0,Math.min(1,(b-r)/(o-r)))}let u=n.find(g=>g.color!=null)?.color,d;const p=n.map((g,y)=>{let b=g?.color;const m=l[y];return b!=null?u=b:u!=null?b=u:(d==null&&(d=new Do,d.domain=[0,1],d.range=t),b=d.convert(m)),{stop:m,color:b}});return s==="discrete"?Pb(p):p}var uh=(T(),N(w)),fk=class{constructor(e,t){this.imageLoader=e,this._cache=void 0,this.url=t.url,this.backgroundFill=t.backgroundFill??"black",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.repeat=t.repeat??"no-repeat",this.width=t.width,this.height=t.height,this.fit=t.fit??"stretch",this.rotation=t.rotation??0}createCanvasImage(e,t,i,s){if(!t)return null;const[n,r]=this.getSize(t.width,t.height,i,s);return n<1||r<1?(uh.Logger.warnOnce("Image fill is too small to render, ignoring."),null):e.createPattern(t,this.repeat)}getSize(e,t,i,s){const{fit:n}=this;let r=e,o=t,a=1;const l=i/s,c=e/t;return n==="stretch"||e===0||t===0?(r=i,o=s):n==="contain"?a=c>l?i/e:s/t:n==="cover"&&(a=c>l?s/t:i/e),[Math.max(1,r*a),Math.max(1,o*a)]}setImageTransform(e,t){if(typeof e=="string")return;const{url:i,rotation:s,width:n,height:r}=this,o=this.imageLoader?.loadImage(i);if(!o)return;const a=$s(s),l=Math.cos(a),c=Math.sin(a),[h,u]=this.getSize(o.width,o.height,n??t.width,r??t.height),d=h/o.width,p=u/o.height,g=t.x+t.width/2,y=t.y+t.height/2,b=l*h-c*u,m=c*h+l*u,v=b/2,S=m/2;e?.setTransform(new DOMMatrix([l*d,c*p,-c*d,l*p,g-v,y-S]))}createPattern(e,t,i,s){const n=this.width??t,r=this.height??i,o=this._cache;if(o!=null&&o.ctx===e&&o.width===n&&o.height===r)return o.pattern;const a=this.imageLoader?.loadImage(this.url,s),l=this.createCanvasImage(e,a,n,r);return l==null?this.backgroundFill:(this._cache={ctx:e,pattern:l,width:n,height:r},l)}toSvg(e,t){const{url:i,rotation:s,backgroundFill:n,backgroundFillOpacity:r}=this,{x:o,y:a,width:l,height:c}=e,h=(0,uh.createSvgElement)("pattern");h.setAttribute("viewBox",`0 0 ${l} ${c}`),h.setAttribute("x",String(o)),h.setAttribute("y",String(a)),h.setAttribute("width",String(l)),h.setAttribute("height",String(c)),h.setAttribute("patternUnits","userSpaceOnUse");const u=(0,uh.createSvgElement)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(l)),u.setAttribute("height",String(c)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(r)),h.appendChild(u);const d=(0,uh.createSvgElement)("image");return d.setAttribute("href",i),d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(l)),d.setAttribute("height",String(c)),d.setAttribute("preserveAspectRatio","none"),d.setAttribute("transform",`scale(${1/t}) rotate(${s}, ${l/2}, ${c/2})`),h.appendChild(d),h}},dh=(T(),N(w));function _b(e,t,i,s){const n=e-i,r=t-s;return n*n+r*r}function ph(e,t,i,s,n,r,o){if(i===n&&s===r)return Math.min(o,_b(e,t,i,s));const a=n-i,l=r-s,c=Math.max(0,Math.min(1,((e-i)*a+(t-s)*l)/(a*a+l*l))),h=i+c*a,u=s+c*l;return Math.min(o,_b(e,t,h,u))}var jb=(T(),N(w)),mk=/^[\t\n\f\r ]*([achlmqstvz])[\t\n\f\r ]*/i,He=/^[+-]?((\d*\.\d+)|(\d+\.)|(\d+))(e[+-]?\d+)?/i,yk=/[\t\n\f\r ]*,?[\t\n\f\r ]*/,zb=/^[01]/,bk={z:[],h:[He],v:[He],m:[He,He],l:[He,He],t:[He,He],s:[He,He,He,He],q:[He,He,He,He],c:[He,He,He,He,He,He],a:[He,He,He,zb,zb,He,He]};function xk(e){if(!e)return;const t=[];let i=0,s;for(;i<e.length;){const n=mk.exec(e.slice(i));let r;if(n==null){if(!s){jb.Logger.warnOnce(`Invalid SVG path, error at index ${i}: Missing command.`);return}r=s}else r=n[1],i+=n[0].length;const o=vk(r,e,i);if(!o)return;i=o[0],s=r,t.push(o[1])}return t}function vk(e,t,i){const s=bk[e.toLocaleLowerCase()],n={command:e,params:[]};for(const r of s){const o=t.slice(i),a=r.exec(o);if(a!=null){n.params.push(parseFloat(a[0])),i+=a[0].length;const l=yk.exec(o.slice(a[0].length));l!=null&&(i+=l[0].length)}else{if(n.params.length===1)return[i,n];jb.Logger.warnOnce(`Invalid SVG path, error at index ${i}: No path segment parameters for command [${e}]`);return}}return[i,n]}function Mk(e,t){const i=-t/e;return e!==0&&i>=0&&i<=1?[i]:[]}function Sk(e,t,i,s=1e-6){if(Math.abs(e)<s)return Mk(t,i);const n=t*t-4*e*i,r=[];if(Math.abs(n)<s){const o=-t/(2*e);o>=0&&o<=1&&r.push(o)}else if(n>0){const o=Math.sqrt(n),a=(-t-o)/(2*e),l=(-t+o)/(2*e);a>=0&&a<=1&&r.push(a),l>=0&&l<=1&&r.push(l)}return r}function Dk(e,t,i,s,n=1e-6){if(Math.abs(e)<n)return Sk(t,i,s,n);const r=t/e,o=i/e,a=s/e,l=(3*o-r*r)/9,c=(9*r*o-27*a-2*r*r*r)/54,h=l*l*l+c*c,u=1/3,d=[];if(h>=0){const p=Math.sqrt(h),g=Math.sign(c+p)*Math.pow(Math.abs(c+p),u),y=Math.sign(c-p)*Math.pow(Math.abs(c-p),u),b=Math.abs(Math.sqrt(3)*(g-y)/2),m=-u*r+(g+y);if(m>=0&&m<=1&&d.push(m),Math.abs(b)<n){const v=-u*r-(g+y)/2;v>=0&&v<=1&&d.push(v)}}else{const p=Math.acos(c/Math.sqrt(-l*l*l)),g=u*r,y=2*Math.sqrt(-l),b=y*Math.cos(u*p)-g,m=y*Math.cos(u*(p+2*Math.PI))-g,v=y*Math.cos(u*(p+4*Math.PI))-g;b>=0&&b<=1&&d.push(b),m>=0&&m<=1&&d.push(m),v>=0&&v<=1&&d.push(v)}return d}function el(e,t,i,s,n,r,o,a){const l=(i-e)*(a-r)-(s-t)*(o-n);if(l===0)return 0;const c=((o-n)*(t-r)-(e-n)*(a-r))/l,h=((i-e)*(t-r)-(s-t)*(e-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function Ik(e,t,i,s,n,r,o,a,l,c,h,u){let d=0;const p=c-u,g=h-l,y=l*(u-c)-c*(h-l),b=Fb(e,i,n,o),m=Fb(t,s,r,a),v=p*b[0]+g*m[0],S=p*b[1]+g*m[1],M=p*b[2]+g*m[2],I=p*b[3]+g*m[3]+y,k=Dk(v,S,M,I);for(const L of k){const C=L*L,O=L*C,E=b[0]*O+b[1]*C+b[2]*L+b[3],_=m[0]*O+m[1]*C+m[2]*L+m[3];let F;l===h?F=(_-c)/(u-c):F=(E-l)/(h-l),F>=0&&F<=1&&d++}return d}function Fb(e,t,i,s){return[-e+3*t-3*i+s,3*e-6*t+3*i,-3*e+3*t,e]}var Ak=(T(),N(w));function Ao(e,t,i,s,n){return(1-n)**3*e+3*(1-n)**2*n*t+3*(1-n)*n**2*i+n**3*s}function gh(e,t,i,s,n){if(n<=Math.min(e,s))return e<s?0:1;if(n>=Math.max(e,s))return e<s?1:0;let r=0,o=1,a=NaN;for(let l=0;l<12;l+=1)a=(r+o)/2,Ao(e,t,i,s,a)<n?r=a:o=a;return a}function tl(e,t,i,s,n,r,o,a,l){const c=(1-l)*e+l*i,h=(1-l)*t+l*s,u=(1-l)*i+l*n,d=(1-l)*s+l*r,p=(1-l)*n+l*o,g=(1-l)*r+l*a,y=(1-l)*c+l*u,b=(1-l)*h+l*d,m=(1-l)*u+l*p,v=(1-l)*d+l*g,S=(1-l)*y+l*m,M=(1-l)*b+l*v;return[[{x:e,y:t},{x:c,y:h},{x:y,y:b},{x:S,y:M}],[{x:S,y:M},{x:m,y:v},{x:p,y:g},{x:o,y:a}]]}function Bb(e,t,i,s){const n=-e+3*t-3*i+s,r=2*(e-2*t+i),o=-e+t;if(n===0){if(r!==0){const l=-o/r;if(l>0&&l<1)return[l]}return[]}const a=r*r-4*n*o;if(a>=0){const l=Math.sqrt(a),c=(-r+l)/(2*n),h=(-r-l)/(2*n);return[c,h].filter(u=>u>0&&u<1)}return[]}function Vb(e,t,i,s,n,r,o,a){const l=Bb(e,i,n,o),c=Bb(t,s,r,a);return[...l,...c]}function xp(e,t,i){const s=Ao(e[0].x,e[1].x,e[2].x,e[3].x,.5),n=Ao(e[0].y,e[1].y,e[2].y,e[3].y,.5),r=Math.hypot(s-t,n-i),o=Math.min(Math.hypot(e[0].x-t,e[0].y-i),Math.hypot(e[1].x-t,e[1].y-i),Math.hypot(e[2].x-t,e[2].y-i),Math.hypot(e[3].x-t,e[3].y-i));return{points:e,distance:r,minDistance:o}}function Gb(e,t,i,s,n,r,o,a,l,c,h=1){let d={value:xp([{x:e,y:t},{x:i,y:s},{x:n,y:r},{x:o,y:a}],l,c),next:null},p;for(;d!=null;){const{points:g,distance:y,minDistance:b}=d.value;if(d=d.next,(p==null||y<p.distance)&&(p={distance:y,minDistance:b}),p!=null&&p.distance-b<=h)continue;const[m,v]=tl(g[0].x,g[0].y,g[1].x,g[1].y,g[2].x,g[2].y,g[3].x,g[3].y,.5),S=[xp(m,l,c),xp(v,l,c)].sort(Hb);d=(0,Ak.insertListItemsSorted)(d,S,Hb)}return p?.distance??1/0}var Hb=(e,t)=>t.minDistance-e.minDistance,Lo=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],this.cx=NaN,this.cy=NaN,this.sx=NaN,this.sy=NaN,this.openedPath=!1,this.closedPath=!1}isEmpty(){return this.commands.length===0}isDirty(){return this.closedPath!==this.previousClosedPath||this.previousCommands.length!==this.commands.length||this.previousParams.length!==this.params.length||this.previousCommands.toString()!==this.commands.toString()||this.previousParams.toString()!==this.params.toString()}getPath2D(){return this.path2d}moveTo(e,t){this.openedPath=!0,this.sx=e,this.sy=t,this.cx=e,this.cy=t,this.path2d.moveTo(e,t),this.commands.push(0),this.params.push(e,t)}lineTo(e,t){this.openedPath?(this.cx=e,this.cy=t,this.path2d.lineTo(e,t),this.commands.push(1),this.params.push(e,t)):this.moveTo(e,t)}cubicCurveTo(e,t,i,s,n,r){this.openedPath||this.moveTo(e,t),this.path2d.bezierCurveTo(e,t,i,s,n,r),this.commands.push(2),this.params.push(e,t,i,s,n,r)}closePath(){this.openedPath&&(this.cx=this.sx,this.cy=this.sy,this.sx=NaN,this.sy=NaN,this.path2d.closePath(),this.commands.push(3),this.openedPath=!1,this.closedPath=!0)}rect(e,t,i,s){this.moveTo(e,t),this.lineTo(e+i,t),this.lineTo(e+i,t+s),this.lineTo(e,t+s),this.closePath()}roundRect(e,t,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(e,t+n),this.arc(e+n,t+n,n,Math.PI,1.5*Math.PI),this.lineTo(e+n,t),this.lineTo(e+i-n,t),this.arc(e+i-n,t+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(e+i,t+n),this.lineTo(e+i,t+s-n),this.arc(e+i-n,t+s-n,n,0,Math.PI/2),this.lineTo(e+i-n,t+s),this.lineTo(e+n,t+s),this.arc(e+ +n,t+s-n,n,Math.PI/2,Math.PI),this.lineTo(e,t+s-n),this.closePath()}ellipse(e,t,i,s,n,r,o,a=!1){const l=i,c=s/i,h=Math.cos(n),u=Math.sin(n),d=-c*u,p=c*h,g=l*Math.cos(r),y=l*Math.sin(r),b=e+h*g+d*y,m=t+u*g+p*y,v=(b-this.cx)**2+(m-this.cy)**2;this.openedPath?v>1e-6&&this.lineTo(b,m):this.moveTo(b,m);let S=a?-ct(r-o):ct(o-r);Math.abs(Math.abs(o-r)-2*Math.PI)<1e-6&&S<2*Math.PI&&(S+=2*Math.PI*(a?-1:1));const M=Math.max(Math.ceil(Math.abs(S)/(Math.PI/2)),1),I=S/M,k=4/3*Math.tan(I/4);for(let L=0;L<M;L+=1){const C=r+I*(L+0),O=r+I*(L+1),E=l*Math.sin(C),_=l*Math.cos(C),F=l*Math.sin(O),j=l*Math.cos(O),Q=_-k*E,ne=E+k*_,le=j+k*F,xe=F-k*j,pe=j,be=F;this.cubicCurveTo(e+h*Q+d*ne,t+u*Q+p*ne,e+h*le+d*xe,t+u*le+p*xe,e+h*pe+d*be,t+u*pe+p*be)}}arc(e,t,i,s,n,r){this.ellipse(e,t,i,i,0,s,n,r)}appendSvg(e){const t=xk(e);if(t==null)return!1;let i=0,s=0,n,r,o=0,a=0;for(const{command:l,params:c}of t){n??(n=c[0]),r??(r=c[1]);const h=l===l.toLowerCase(),u=h?n:0,d=h?r:0;switch(l.toLowerCase()){case"m":this.moveTo(u+c[0],d+c[1]),n=u+c[0],r=d+c[1],i=n,s=r;break;case"c":this.cubicCurveTo(u+c[0],d+c[1],u+c[2],d+c[3],u+c[4],d+c[5]),o=u+c[2],a=d+c[3],n=u+c[4],r=d+c[5];break;case"s":this.cubicCurveTo(n+n-o,r+r-a,u+c[0],d+c[1],u+c[2],d+c[3]),o=u+c[0],a=d+c[1],n=u+c[2],r=d+c[3];break;case"q":this.cubicCurveTo((u+2*c[0])/3,(d+2*c[1])/3,(2*c[0]+c[2])/3,(2*c[1]+c[3])/3,c[2],c[3]),o=c[0],a=c[1],n=c[2],r=c[3];break;case"t":this.cubicCurveTo((n+2*(n+n-o))/3,(r+2*(r+r-a))/3,(2*(n+n-o)+c[0])/3,(2*(r+r-a)+c[1])/3,c[0],c[1]),o=n+n-o,a=r+r-a,n=c[0],r=c[1];break;case"a":this.svgEllipse(n,r,c[0],c[1],c[2]*Math.PI/180,c[3],c[4],u+c[5],d+c[6]),n=u+c[5],r=d+c[6];break;case"h":this.lineTo(u+c[0],r),n=u+c[0];break;case"l":this.lineTo(u+c[0],d+c[1]),n=u+c[0],r=d+c[1];break;case"v":this.lineTo(n,d+c[0]),r=d+c[0];break;case"z":this.closePath(),n=i,r=s;break;default:throw new Error(`Could not translate command '${l}' with '${c.join(" ")}'`)}}return!0}svgEllipse(e,t,i,s,n,r,o,a,l){i=Math.abs(i),s=Math.abs(s);const c=(e-a)/2,h=(t-l)/2,u=Math.sin(n),d=Math.cos(n),p=d*c+u*h,g=-u*c+d*h,y=p/i,b=g/s;let m=y*y+b*b,v=(e+a)/2,S=(t+l)/2,M=0,I=0;m>=1?(m=Math.sqrt(m),i*=m,s*=m):(m=Math.sqrt(1/m-1),r===o&&(m=-m),M=m*i*b,I=-m*s*y,v+=d*M-u*I,S+=u*M+d*I);const k=Math.atan2((g-I)/s,(p-M)/i),L=Math.atan2((-g-I)/s,(-p-M)/i)-k,C=k+L,O=!!(1-o);this.ellipse(v,S,i,s,n,k,C,O)}clear(e){e&&(this.previousCommands=this.commands,this.previousParams=this.params,this.previousClosedPath=this.closedPath),this.path2d=new Path2D,this.openedPath=!1,this.closedPath=!1,this.commands=[],this.params=[]}isPointInPath(e,t){const i=this.commands,s=this.params,n=i.length,r=-1e4,o=-1e4;let a=NaN,l=NaN,c=0,h=0,u=0;for(let d=0,p=0;d<n;d++)switch(i[d]){case 0:u+=el(a,l,c,h,r,o,e,t),c=s[p++],a=c,h=s[p++],l=h;break;case 1:u+=el(c,h,s[p++],s[p++],r,o,e,t),c=s[p-2],h=s[p-1];break;case 2:u+=Ik(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],r,o,e,t),c=s[p-2],h=s[p-1];break;case 3:u+=el(a,l,c,h,r,o,e,t);break}return u%2===1}distanceSquared(e,t){let i=1/0;const s=this.commands,n=this.params,r=s.length;let o=NaN,a=NaN,l=0,c=0;for(let h=0,u=0;h<r;h++)switch(s[h]){case 0:l=o=n[u++],c=a=n[u++];break;case 1:{const v=l,S=c;l=n[u++],c=n[u++],i=ph(e,t,v,S,l,c,i);break}case 2:const d=l,p=c,g=n[u++],y=n[u++],b=n[u++],m=n[u++];l=n[u++],c=n[u++],i=Gb(d,p,g,y,b,m,l,c,e,t)**2;break;case 3:i=ph(e,t,l,c,o,a,i);break}return i}toSVG(e=(t,i)=>({x:t,y:i})){const t=[],{commands:i,params:s}=this,n=(o,a)=>{t.push(o);for(let l=0;l<a;l+=2){const{x:c,y:h}=e(s[r++],s[r++]);t.push(c,h)}};let r=0;for(const o of i)switch(o){case 0:n("M",2);break;case 1:n("L",2);break;case 2:n("C",6);break;case 3:n("Z",0);break}return t.join(" ")}computeBBox(){const{commands:e,params:t}=this;let[i,s,n,r]=[1/0,1/0,-1/0,-1/0],[o,a]=[NaN,NaN],[l,c]=[NaN,NaN];const h=(d,p)=>{i=Math.min(p,i),s=Math.min(d,s),n=Math.max(d,n),r=Math.max(p,r),o=d,a=p};let u=0;for(const d of e)switch(d){case 0:h(t[u++],t[u++]),l=o,c=a;break;case 1:h(t[u++],t[u++]);break;case 2:{const p=o,g=a,y=t[u++],b=t[u++],m=t[u++],v=t[u++],S=t[u++],M=t[u++];Vb(p,g,y,b,m,v,S,M).forEach(k=>{const L=Ao(p,y,m,S,k),C=Ao(g,b,v,M,k);h(L,C)}),h(S,M);break}case 3:h(l,c),l=NaN,c=NaN;break}return new W(s,i,n-s,r-i)}};function Lt(e,t,i){const s=Math.round(t*e)/e;return i==null?s:i===0?0:i<1?Math.ceil(i*e)/e:Math.round((i+t)*e)/e-s}function Ub(e,t){return Math.floor(t*e)/e}function vp(e,t,i){const{width:s,height:n,padding:r,strokeWidth:o}=t,a=s/2,l=n/2,c=Math.max(1,s-r-o/2),h=Math.max(1,n-r-o/2);let u=!1;for(const[d,p]of i){const g=a+(d-.5)*c,y=l+(p-.5)*h;u?e.lineTo(g,y):e.moveTo(g,y),u=!0}e.closePath()}var Wb={circles(e,{width:t,strokeWidth:i,padding:s}){const n=t/2,r=Math.max(1,n-s-i/2);e.arc(n,n,r,0,Math.PI*2)},squares(e,{width:t,height:i,pixelRatio:s,padding:n,strokeWidth:r}){const o=n+r/2;e.moveTo(Lt(s,o),Lt(s,o)),e.lineTo(Lt(s,t-o),Lt(s,o)),e.lineTo(Lt(s,t-o),Lt(s,i-o)),e.lineTo(Lt(s,o),Lt(s,i-o)),e.closePath()},triangles(e,t){vp(e,t,[[.5,0],[1,1],[0,1]])},diamonds(e,t){vp(e,t,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(e,{width:t,height:i,padding:s}){const r=Math.max(1,(t-s)/2),o=r/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:o,h=l*Math.PI/5-a,u=t/2+Math.cos(h)*c,d=i/2+Math.sin(h)*c;e.lineTo(u,d)}e.closePath()},hearts(e,{width:t,height:i,padding:s}){const n=Math.max(1,t/4-s/2),r=t/2,o=i/2+n/2;e.arc(r-n,o-n,n,mt(130),mt(330)),e.arc(r+n,o-n,n,mt(220),mt(50)),e.lineTo(r,o+n),e.closePath()},crosses(e,t){vp(e,t,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},"vertical-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const r=Lt(s,t/2)-n%2/2;e.moveTo(r,0),e.lineTo(r,i)},"horizontal-lines"(e,{width:t,height:i,pixelRatio:s,strokeWidth:n}){const r=Lt(s,i/2)-n%2/2;e.moveTo(0,r),e.lineTo(t,r)},"forward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),r=s*Math.cos(n),o=s*Math.sin(n);e.moveTo(-r,o),e.lineTo(r,-o),e.moveTo(-r,i+o),e.lineTo(t+r,-o),e.moveTo(t-r,i+o),e.lineTo(t+r,i-o)},"backward-slanted-lines"(e,{width:t,height:i,strokeWidth:s}){const n=Math.atan2(i,t),r=s*Math.cos(n),o=s*Math.sin(n);e.moveTo(t-r,-o),e.lineTo(t+r,o),e.moveTo(-r,-o),e.lineTo(t+r,i+o),e.moveTo(-r,i-o),e.lineTo(r,i+o)}},Lk=class{constructor(e){this._cache=void 0,this.width=Math.max(e?.width??10,1),this.height=Math.max(e?.height??10,1),this.fill=e.fill??"none",this.fillOpacity=e.fillOpacity??1,this.backgroundFill=e.backgroundFill??"none",this.backgroundFillOpacity=e.backgroundFillOpacity??1,this.stroke=e.stroke??"black",this.strokeOpacity=e.strokeOpacity??1,this.strokeWidth=e.strokeWidth??1,this.padding=e.padding??1,this.pattern=e.pattern??"forward-slanted-lines",this.rotation=e.rotation??0,this.scale=e.scale??1,this.path=e.path}getPath(e){const{pattern:t,width:i,height:s,padding:n,strokeWidth:r,path:o}=this,a=new Lo;let l=Wb[t]!=null;return o&&l&&(l=!a.appendSvg(o)),l&&Wb[t](a,{width:i,height:s,pixelRatio:e,strokeWidth:r,padding:n}),a}renderStroke(e,t){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(t.strokeStyle=i,t.lineWidth=s,t.globalAlpha=n,t.stroke(e))}renderFill(e,t){const{fill:i,fillOpacity:s}=this;i!=="none"&&(t.fillStyle=i,t.globalAlpha=s,t.fill(e))}createCanvasPattern(e,t){const{width:i,height:s,scale:n,backgroundFill:r,backgroundFillOpacity:o}=this;if(i*n<1||s*n<1)return dh.Logger.warnOnce("Pattern fill is too small to render, ignoring."),null;const a=new ip({width:i,height:s,pixelRatio:t*n}),l=a.context;r!=="none"&&(l.fillStyle=r,l.globalAlpha=o,l.fillRect(0,0,i,s));const c=this.getPath(t).getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=e.createPattern(a.canvas,"repeat");return this.setPatternTransform(h,t),a.destroy(),h}setPatternTransform(e,t,i=0,s=0){if(e==null)return;const n=$s(this.rotation),r=1/t,o=Math.cos(n)*r,a=Math.sin(n)*r;e.setTransform(new DOMMatrix([o,a,-a,o,i,s]))}createPattern(e,t){if(this._cache!=null&&this._cache.ctx===e&&this._cache.pixelRatio===t)return this._cache.pattern;const i=this.createCanvasPattern(e,t);if(i!=null)return this._cache={ctx:e,pattern:i,pixelRatio:t},i}toSvg(){const{width:e,height:t,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:r,stroke:o,strokeWidth:a,strokeOpacity:l,rotation:c,scale:h}=this,u=(0,dh.createSvgElement)("pattern");u.setAttribute("viewBox",`0 0 ${e} ${t}`),u.setAttribute("width",String(e)),u.setAttribute("height",String(t)),u.setAttribute("patternUnits","userSpaceOnUse");const d=(0,dh.createSvgElement)("rect");d.setAttribute("x","0"),d.setAttribute("y","0"),d.setAttribute("width",String(e)),d.setAttribute("height",String(t)),d.setAttribute("fill",n),d.setAttribute("fill-opacity",String(r)),u.appendChild(d);const p=(0,dh.createSvgElement)("path");return p.setAttribute("fill",i),p.setAttribute("fill-opacity",String(s)),p.setAttribute("stroke-opacity",String(l)),p.setAttribute("stroke",o),p.setAttribute("stroke-width",String(a)),p.setAttribute("transform",`rotate(${c}) scale(${h})`),p.setAttribute("d",this.getPath(1).toSVG()),u.appendChild(p),u}},VR=(T(),N(w)),kk=yr((T(),N(w))),{isArray:Ck,isObject:Mp}=kk;function ki(e){return Mp(e)&&e.type=="gradient"}function $b(e){return Ck(e)&&e.every(t=>typeof t=="string")}function Tn(e){return e!==null&&Mp(e)&&e.type=="pattern"}function Sr(e){return e!==null&&Mp(e)&&e.type=="image"}function wk(e){return ki(e)||Tn(e)}var ht=class extends Ws{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill="black",this.strokeWidth=0,this.lineDashOffset=0,this.opacity=1}getGradient(e){if(ki(e))return this.createGradient(e)}createGradient(e){const{colorSpace:t="rgb",gradient:i="linear",colorStops:s,rotation:n=0,reverse:r=!1}=e;if(s==null)return;let o=Rb(s,["black"],[0,1]);switch(r&&(o=o.map(a=>({color:a.color,stop:1-a.stop})).reverse()),i){case"linear":return new Eb(t,o,n);case"radial":return new uk(t,o);case"conic":return new Ob(t,o,n)}}getPattern(e){if(Tn(e))return this.createPattern(e)}createPattern(e){return new Lk(e)}getImage(e){if(Sr(e))return this.createImage(e)}createImage(e){return new fk(this.imageLoader,e)}onFillChange(){typeof this.fill=="object"&&ft(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this.fillImage=this.getImage(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,t){return Lt(this.layerManager?.canvas?.pixelRatio??1,e,t)}markDirty(e){super.markDirty(e),this.cachedDefaultGradientFillBBox=void 0}fillStroke(e,t){this.renderFill(e,t),this.renderStroke(e,t)}renderFill(e,t){const{fill:i,fillImage:s}=this;if(i&&i!=="none"){const{globalAlpha:n}=e;s&&(e.globalAlpha=s.backgroundFillOpacity,e.fillStyle=s.backgroundFill,this.executeFill(e,t),e.globalAlpha=n),this.applyFillAndAlpha(e),this.applyShadow(e),this.executeFill(e,t),e.globalAlpha=n}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,t){t?e.fill(t):e.fill()}applyFillAndAlpha(e){const{fill:t,fillGradient:i,fillPattern:s,fillImage:n,fillOpacity:r=1,opacity:o=1}=this;if(e.globalAlpha*=o*r,i){const{fillBBox:a=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:l}=this;e.fillStyle=i.createGradient(e,a,l)??"black"}else if(s){const{x:a,y:l}=this.getBBox(),c=this.layerManager?.canvas?.pixelRatio??1,h=s.createPattern(e,c);s.setPatternTransform(h,c,a,l),h?e.fillStyle=h:(e.fillStyle=s.fill,e.globalAlpha*=s.fillOpacity)}else if(n){const a=this.getBBox(),l=n.createPattern(e,a.width,a.height,this);n.setImageTransform(l,a),e.fillStyle=l??"transparent"}else e.fillStyle=typeof t=="string"?t:"black"}applyStrokeAndAlpha(e){const{stroke:t,strokeOpacity:i=1,strokeGradient:s,opacity:n=1}=this;e.strokeStyle=s?.createGradient(e,this.getBBox())??(typeof t=="string"?t:void 0)??"black",e.globalAlpha*=n*i}applyShadow(e){const t=this.layerManager?.canvas.pixelRatio??1,i=this.fillShadow;i?.enabled&&(e.shadowColor=i.color,e.shadowOffsetX=i.xOffset*t,e.shadowOffsetY=i.yOffset*t,e.shadowBlur=i.blur*t)}renderStroke(e,t){const{stroke:i,strokeWidth:s,lineDash:n,lineDashOffset:r,lineCap:o,lineJoin:a,miterLimit:l}=this;if(i&&s){const{globalAlpha:c}=e;this.applyStrokeAndAlpha(e),e.lineWidth=s,n&&e.setLineDash(n),r&&(e.lineDashOffset=r),o&&(e.lineCap=o),a&&(e.lineJoin=a),l!=null&&(e.miterLimit=l),this.executeStroke(e,t),e.globalAlpha=c}}executeStroke(e,t){t?e.stroke(t):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox==null&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,t){return this.isPointInPath(e,t)}applySvgFillAttributes(e,t){const{fill:i,fillOpacity:s}=this;if(typeof i=="string")e.setAttribute("fill",i);else if(ki(i)&&this.fillGradient){t??(t=[]);const n=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),r=(0,Ka.generateUUID)();n.setAttribute("id",r),t.push(n),e.setAttribute("fill",`url(#${r})`)}else if(Tn(i)&&this.fillPattern){t??(t=[]);const n=this.fillPattern.toSvg(),r=(0,Ka.generateUUID)();n.setAttribute("id",r),t.push(n),e.setAttribute("fill",`url(#${r})`)}else if(Sr(i)&&this.fillImage){t??(t=[]);const n=this.layerManager?.canvas?.pixelRatio??1,r=this.fillImage.toSvg(this.getBBox(),n),o=(0,Ka.generateUUID)();r.setAttribute("id",o),t.push(r),e.setAttribute("fill",`url(#${o})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(s)),t}applySvgStrokeAttributes(e){const{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:n,lineDashOffset:r}=this;if(t!=null&&(e.setAttribute("stroke",typeof t=="string"?t:"none"),e.setAttribute("stroke-opacity",String(i)),e.setAttribute("stroke-width",String(s))),n?.some(o=>o!==0)===!0){const o=n.length%2===1?[...n,...n]:n;e.setAttribute("stroke-dasharray",o.join(" ")),e.setAttribute("stroke-dashoffset",String(r))}}};f([z()],ht.prototype,"fillOpacity",2),f([z()],ht.prototype,"strokeOpacity",2),f([Li({equals:ft,changeCb:e=>e.onFillChange()})],ht.prototype,"fill",2),f([Li({equals:ft,changeCb:e=>e.onStrokeChange()})],ht.prototype,"stroke",2),f([z()],ht.prototype,"strokeWidth",2),f([dp()],ht.prototype,"lineDash",2),f([z()],ht.prototype,"lineDashOffset",2),f([z()],ht.prototype,"lineCap",2),f([z()],ht.prototype,"lineJoin",2),f([z()],ht.prototype,"miterLimit",2),f([z({convertor:e=>(0,Ka.clamp)(0,e??1,1)})],ht.prototype,"opacity",2),f([Li({equals:So,checkDirtyOnAssignment:!0})],ht.prototype,"fillShadow",2),f([Li({equals:Ka.boxesEqual,changeCb:e=>e.onFillChange()})],ht.prototype,"fillBBox",2),f([Li({equals:ft,changeCb:e=>e.onFillChange()})],ht.prototype,"fillParams",2);var Nk=(T(),N(w)),ko=(T(),N(w)),Yb=[1,0,0,1,0,0],Ks=class Sd{get e(){return[...this.elements]}constructor(t=Yb){this.elements=[...t]}setElements(t){const i=this.elements;return i[0]=t[0],i[1]=t[1],i[2]=t[2],i[3]=t[3],i[4]=t[4],i[5]=t[5],this}get identity(){const t=this.elements;return(0,ko.isNumberEqual)(t[0],1)&&(0,ko.isNumberEqual)(t[1],0)&&(0,ko.isNumberEqual)(t[2],0)&&(0,ko.isNumberEqual)(t[3],1)&&(0,ko.isNumberEqual)(t[4],0)&&(0,ko.isNumberEqual)(t[5],0)}AxB(t,i,s){const n=t[0]*i[0]+t[2]*i[1],r=t[1]*i[0]+t[3]*i[1],o=t[0]*i[2]+t[2]*i[3],a=t[1]*i[2]+t[3]*i[3],l=t[0]*i[4]+t[2]*i[5]+t[4],c=t[1]*i[4]+t[3]*i[5]+t[5];s=s??t,s[0]=n,s[1]=r,s[2]=o,s[3]=a,s[4]=l,s[5]=c}multiplySelf(t){return this.AxB(this.elements,t.elements),this}multiply(t){const i=new Array(6);return t instanceof Sd?this.AxB(this.elements,t.elements,i):this.AxB(this.elements,[t.a,t.b,t.c,t.d,t.e,t.f],i),new Sd(i)}preMultiplySelf(t){return this.AxB(t.elements,this.elements,this.elements),this}inverse(){const t=this.elements;let i=t[0],s=t[1],n=t[2],r=t[3];const o=t[4],a=t[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,new Sd([r,-s,-n,i,n*a-r*o,s*o-i*a])}invertSelf(){const t=this.elements;let i=t[0],s=t[1],n=t[2],r=t[3];const o=t[4],a=t[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,t[0]=r,t[1]=-s,t[2]=-n,t[3]=i,t[4]=n*a-r*o,t[5]=s*o-i*a,this}transformPoint(t,i){const s=this.elements;return{x:t*s[0]+i*s[2]+s[4],y:t*s[1]+i*s[3]+s[5]}}transformBBox(t,i){const s=this.elements,n=s[0],r=s[1],o=s[2],a=s[3],l=t.width*.5,c=t.height*.5,h=t.x+l,u=t.y+c,d=Math.abs(l*n)+Math.abs(c*o),p=Math.abs(l*r)+Math.abs(c*a);return i??(i=new W(0,0,0,0)),i.x=h*n+u*o+s[4]-d,i.y=h*r+u*a+s[5]-p,i.width=d+d,i.height=p+p,i}toContext(t){if(this.identity)return;const i=this.elements;t.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(t,i,s,n,r,o,a){const l=i,c=s;let h,u;l===1&&c===1?(h=0,u=0):(h=a?.scalingCenterX??0,u=a?.scalingCenterY??0);const d=n,p=Math.cos(d),g=Math.sin(d);let y,b;d===0?(y=0,b=0):(y=a?.rotationCenterX??0,b=a?.rotationCenterY??0);const m=r,v=o,S=h*(1-l)-y,M=u*(1-c)-b;return t.setElements([p*l,g*l,-g*c,p*c,p*S-g*M+y+m,g*S+p*M+b+v]),t}};function On(e){return Zb(e.constructor)}var Kb=Symbol("isMatrixTransform");function Zb(e){return e[Kb]===!0}function Sp(e){var t,i;const s=e;if(Zb(e))return e;const n=Symbol("matrix_combined_transform");class r extends s{constructor(){super(...arguments),this[i]=new Ks,this._dirtyTransform=!0}onChangeDetection(a){super.onChangeDetection(a),this._dirtyTransform=!0,!(this.batchLevel>0)&&this.markDirty("transform")}updateMatrix(a){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(Yb),this.updateMatrix(this[n]),this._dirtyTransform=!1)}toParent(a){return this.computeTransformMatrix(),this[n].identity?a.clone():this[n].transformBBox(a)}toParentPoint(a,l){return this.computeTransformMatrix(),this[n].identity?{x:a,y:l}:this[n].transformPoint(a,l)}fromParent(a){return this.computeTransformMatrix(),this[n].identity?a.clone():this[n].inverse().transformBBox(a)}fromParentPoint(a,l){return this.computeTransformMatrix(),this[n].identity?{x:a,y:l}:this[n].inverse().transformPoint(a,l)}computeBBox(){const a=super.computeBBox();return a&&this.toParent(a)}computeBBoxWithoutTransforms(){return super.computeBBox()}pickNode(a,l){return{x:a,y:l}=this.fromParentPoint(a,l),super.pickNode(a,l)}pickNodes(a,l,c){return{x:a,y:l}=this.fromParentPoint(a,l),super.pickNodes(a,l,c)}render(a){this.computeTransformMatrix();const{ctx:l}=a,c=this[n];let h=!1;try{c.identity||(l.save(),h=!0,c.toContext(l)),super.render(a)}finally{h&&l.restore()}}toSVG(){this.computeTransformMatrix();const a=super.toSVG(),l=this[n];if(l.identity||a==null)return a;const c=(0,Nk.createSvgElement)("g");c.append(...a.elements);const[h,u,d,p,g,y]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${p} ${g} ${y})`),{elements:[c],defs:a.defs}}}return t=Kb,i=n,r[t]=!0,r}function Co(e){var t;const i=e,s=Symbol("matrix_rotation");class n extends Sp(i){constructor(){super(...arguments),this[t]=new Ks,this.rotationCenterX=0,this.rotationCenterY=0,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:a,rotationCenterX:l,rotationCenterY:c}=this;a!==0&&(Ks.updateTransformMatrix(this[s],1,1,a,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[s]))}}return t=s,f([z()],n.prototype,"rotationCenterX",2),f([z()],n.prototype,"rotationCenterY",2),f([z()],n.prototype,"rotation",2),n}function Dp(e){var t;const i=e,s=Symbol("matrix_scale");class n extends Sp(i){constructor(){super(...arguments),this[t]=new Ks,this.scalingX=1,this.scalingY=1,this.scalingCenterX=0,this.scalingCenterY=0}updateMatrix(o){super.updateMatrix(o);const{scalingX:a,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;a===1&&l===1||(Ks.updateTransformMatrix(this[s],a,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[s]))}}return t=s,f([z()],n.prototype,"scalingX",2),f([z()],n.prototype,"scalingY",2),f([z()],n.prototype,"scalingCenterX",2),f([z()],n.prototype,"scalingCenterY",2),n}function Dr(e){var t;const i=e,s=Symbol("matrix_translation");class n extends Sp(i){constructor(){super(...arguments),this[t]=new Ks,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:a,translationY:l}=this;a===0&&l===0||(Ks.updateTransformMatrix(this[s],1,1,0,a,l),o.multiplySelf(this[s]))}}return t=s,f([z()],n.prototype,"translationX",2),f([z()],n.prototype,"translationY",2),n}var tt=class{static fromCanvas(e,t){const i=[];for(const s of e.traverseUp())On(s)&&i.unshift(s);for(const s of i)t=s.fromParent(t);return On(e)&&(t=e.fromParent(t)),t}static toCanvas(e,t){t==null?t=e.getBBox():On(e)&&(t=e.toParent(t));for(const i of e.traverseUp())On(i)&&(t=i.toParent(t));return t}static fromCanvasPoint(e,t,i){const s=[];for(const n of e.traverseUp())On(n)&&s.unshift(n);for(const n of s)({x:t,y:i}=n.fromParentPoint(t,i));return On(e)&&({x:t,y:i}=e.fromParentPoint(t,i)),{x:t,y:i}}static toCanvasPoint(e,t,i){On(e)&&({x:t,y:i}=e.toParentPoint(t,i));for(const s of e.traverseUp())On(s)&&({x:t,y:i}=s.toParentPoint(t,i));return{x:t,y:i}}},il,Ip=class Oc extends Ws{constructor(t){super(t),this.childNodes=new Set,this.dirty=!1,this.dirtyZIndex=!1,this.clipRect=void 0,this.opacity=1,this.renderToOffscreenCanvas=!1,this.optimizeForInfrequentRedraws=!1,this.layer=void 0,this.image=void 0,this._lastWidth=NaN,this._lastHeight=NaN,this._lastDevicePixelRatio=NaN,this.isContainerNode=!0,this.renderToOffscreenCanvas=t?.renderToOffscreenCanvas===!0}static is(t){return t instanceof Oc}static computeChildrenBBox(t,i=!0){return W.merge(Ws.extractBBoxes(t,i))}static compareChildren(t,i){return Lb(t.zIndex,i.zIndex)||t.serialNumber-i.serialNumber}containsPoint(t,i){return!0}computeBBox(){return Oc.computeChildrenBBox(this.children())}computeSafeClippingBBox(t){const i=this.computeBBox();if(i?.isFinite()!==!0)return;let s=0;const n=4;for(const d of this.descendants())d instanceof ht&&(s=Math.max(s,d.strokeWidth));const r=Math.max(1,s/2*n),{x:o,y:a}=tt.toCanvasPoint(this,0,0),l=Ub(t,o+i.x-r)-o,c=Ub(t,a+i.y-r)-a,h=Math.ceil(i.x+i.width-l+r),u=Math.ceil(i.y+i.height-c+r);return new W(l,c,h,u)}prepareSharedCanvas(t,i,s){return il==null||il.pixelRatio!==s?il=new ip({width:t,height:i,pixelRatio:s}):il.resize(t,i,s),il}setScene(t){super.setScene(t),this.layer&&(this.scene?.layersManager.removeLayer(this.layer),this.layer=void 0);for(const i of this.children())i.setScene(t)}markDirty(t){this.dirty=!0,super.markDirty(t)}markDirtyChildrenOrder(){super.markDirtyChildrenOrder(),this.dirtyZIndex=!0,this.markDirty()}append(t){for(const i of(0,gb.toIterable)(t))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i.setScene(this.scene);this.markDirtyChildrenOrder(),this.markDirty()}appendChild(t){return this.append(t),t}removeChild(t){if(!this.childNodes?.delete(t))throw new Error(`AG Charts - internal error, unknown child node ${t.name??t.id} in $${this.name??this.id}`);t.parentNode=void 0,t.setScene(),this.markDirtyChildrenOrder(),this.markDirty()}clear(){for(const t of this.children())delete t.parentNode,t.setScene();this.childNodes?.clear(),this.markDirty()}pickNode(t,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const o=s[n].pickNode(t,i);if(o!=null)return o}}else if(!this.isContainerNode)return this}}pickNodes(t,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(t,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(t,i,s);return s}isDirty(t){const{width:i,height:s,devicePixelRatio:n}=t,{dirty:r,layer:o}=this,a=o!=null&&(this._lastWidth!==i||this._lastHeight!==s),l=this._lastDevicePixelRatio!==n;return this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,r||a||l}preRender(t){let i;if(this.dirty){i=super.preRender(t,0);for(const s of this.children()){const n=s.preRender(t);i.groups+=n.groups,i.nonGroups+=n.nonGroups,i.complexity+=n.complexity}i.groups+=1,i.nonGroups-=1}else i=this.childNodeCounts;return this.renderToOffscreenCanvas&&!this.optimizeForInfrequentRedraws&&i.nonGroups>0&&this.getVisibility()?this.layer??(this.layer=this.layerManager?.addLayer({name:this.name})):this.layer!=null&&(this.layerManager?.removeLayer(this.layer),this.layer=void 0),i}render(t){const{layer:i,renderToOffscreenCanvas:s}=this,n={...t},r=this.isDirty(t);if(this.dirty=!1,!s){this.renderInContext(n),super.render(n);return}const{ctx:o,stats:a,devicePixelRatio:l}=t;let{image:c}=this;if(r){c?.bitmap.close(),c=void 0;const u=i?void 0:this.computeSafeClippingBBox(l),d=(p,...g)=>{const y=p.context;n.ctx=y,p.clear(),y.save();try{y.setTransform(...g),y.globalAlpha=1,this.renderInContext(n)}finally{y.restore(),y.verifyDepthZero?.()}};if(i)d(i,o.getTransform());else if(u){const{x:p,y:g,width:y,height:b}=u,m=this.prepareSharedCanvas(y,b,l);d(m,l,0,0,l,-p*l,-g*l),c={bitmap:m.transferToImageBitmap(),x:p,y:g,width:y,height:b}}this.image=c,a&&a.layersRendered++}else a&&a.layersSkipped++;const{globalAlpha:h}=o;if(o.globalAlpha=h*this.opacity,i){o.save();try{o.resetTransform(),i.drawImage(o)}finally{o.restore()}}else if(c){const{bitmap:u,x:d,y:p,width:g,height:y}=c;o.drawImage(u,0,0,g*l,y*l,d,p,g,y)}o.globalAlpha=h,super.render(n)}applyClip(t,i){const{x:s,y:n,width:r,height:o}=i;t.beginPath(),t.rect(s,n,r,o),t.clip()}renderInContext(t){const{ctx:i,stats:s}=t;this.dirtyZIndex&&(this.sortChildren(Oc.compareChildren),this.dirtyZIndex=!1),i.save();try{i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),t.clipBBox=tt.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}n.isolatedRender(t)}}finally{i.restore()}}sortChildren(t){if(!this.childNodes)return;const i=[...this.childNodes].sort(t);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*children(){yield*this.childNodes}*descendants(){for(const t of this.children())yield t,t instanceof Oc&&(yield*t.descendants())}setClipRect(t){this.clipRect=t?tt.fromCanvas(this,t):void 0}setClipRectCanvasSpace(t){this.clipRect=t}getVisibility(){for(const t of this.traverseUp(!0))if(!t.visible)return!1;return!0}toSVG(){if(!this.visible)return;const t=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&t.push(...n.defs))}return{elements:i,defs:t}}};Ip.className="Group",f([z({convertor:e=>(0,gb.clamp)(0,e,1)})],Ip.prototype,"opacity",2);var re=Ip,Tk=class extends Dp(re){},Ok=class extends Co(re){},Ht=class extends Dr(re){},wo=class extends Co(Dr(re)){},Ek=(T(),N(w));function Pk(e,t){return"context"in e}function Xb(e,t){return e!=null&&Pk(e,t)&&t[0]!=null&&typeof t[0]=="object"&&t[0].context===void 0?(t[0].context=e.context,!0):!1}function Zs(e,t,...i){if(Array.isArray(e)){for(const s of e)if(Xb(s,i))break}else Xb(e,i);return t(...i)}var qb=class{constructor(){this.cache=new WeakMap}call(e,t,...i){let s,n=this.cache.get(t);try{s=JSON.stringify(i)}catch{return this.invoke(e,t,n,void 0,...i)}return n==null&&(n=new Map,this.cache.set(t,n)),n.has(s)?n.get(s):this.invoke(e,t,n,s,...i)}invoke(e,t,i,s,...n){try{const r=Zs(e,t,...n);return i&&s!=null&&i.set(s,r),r}catch(r){Ek.Logger.warnOnce("User callback errored, ignoring",r);return}}invalidateCache(){this.cache=new WeakMap}},Ap=(T(),N(w));function fh(e,t){if(!e)return;const{x:i,y:s,width:n,height:r}=_k(t);yh(e.style,"width",n),yh(e.style,"height",r),yh(e.style,"left",i),yh(e.style,"top",s)}function Qb(e){const t=parseFloat(e.style.width)||e.offsetWidth,i=parseFloat(e.style.height)||e.offsetHeight,s=parseFloat(e.style.left)||e.offsetLeft,n=parseFloat(e.style.top)||e.offsetTop;return{x:s,y:n,width:t,height:i}}function Rk(e){if(e.focus({preventScroll:!0}),e.lastChild?.textContent==null)return;const t=(0,Ap.getDocument)().createRange();t.setStart(e.lastChild,e.lastChild.textContent.length),t.setEnd(e.lastChild,e.lastChild.textContent.length);const i=(0,Ap.getWindow)().getSelection();i?.removeAllRanges(),i?.addRange(t)}function Jb(){const e=(0,Ap.getWindow)("navigator");if("scheduling"in e){const t=e.scheduling;if("isInputPending"in t)return t.isInputPending({includeContinuous:!0})}return!1}function mh(e){return`ag-charts-icon ag-charts-icon-${e}`}function _k(e){let{x:t,y:i,width:s,height:n}=e;return(s==null||s>0)&&(n==null||n>0)?e:(t!=null&&s!=null&&s<0&&(s=-s,t=t-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:t,y:i,width:s,height:n})}function yh(e,t,i){i==null?e.removeProperty(t):e.setProperty(t,`${i}px`)}var jk=yr((T(),N(w))),{Logger:sl,isArray:No,isDate:e0,isFunction:zk,isHtmlElement:Fk,isObject:Bk,isPlainObject:To,isRegExp:Vk}=jk,Lp="class-instance";function Is(e,t,i){if(No(t)){if(!No(e)||e.length!==t.length||t.some((s,n)=>Is(e[n],s,i)!=null))return t}else if(To(t)){if(!To(e))return t;const s={},n=new Set([...Object.keys(e),...Object.keys(t)]);for(const r of n)if(e[r]!==t[r])if(i?.has(r))s[r]=t[r];else if(typeof e[r]==typeof t[r]){const o=Is(e[r],t[r],i);o!==null&&(s[r]=o)}else s[r]=t[r];return Object.keys(s).length?s:null}else if(e!==t)return t;return null}function t0(e,t){for(const i of Object.keys(e))if(e[i]!==t?.[i])return!1;return!0}function Qe(e,t){return No(e)?Gk(e,t):To(e)?Hk(e,t):e instanceof Map?new Map(Qe(Array.from(e))):kp(e)}function Gk(e,t){const i=[],s=t?.seen;for(const n of e){if(typeof n=="object"&&s?.includes(n)){sl.warn("cycle detected in array",n);continue}s?.push(n),i.push(Qe(n,t)),s?.pop()}return i}function Hk(e,t){const i={};for(const s of Object.keys(e))t?.assign?.has(s)?i[s]=e[s]:t?.shallow?.has(s)?i[s]=kp(e[s]):i[s]=Qe(e[s],t);return i}function kp(e){return No(e)?e.slice(0):To(e)?{...e}:e0(e)?new Date(e):Vk(e)?new RegExp(e.source,e.flags):e}function En(e,t,i,s,n,r){if(No(e)){r=t(e,s,n,r);let o=0;for(const a of e)r=En(a,t,i,s?.[o],n,r),o++}else if(To(e)){r=t(e,s,n,r);for(const o of Object.keys(e)){if(i?.has(o))continue;const a=e[o];r=En(a,t,i,s?.[o],n,r)}}return r}function nl(e,t,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:r=[]}=i;if(e==null)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(t==null)return e;if(Io(e))return e.set(t);const o=e,a=Cp(e);for(const l of Object.keys(t)){if(cp.has(l))continue;const c=`${n?n+".":""}${l}`;if(r.includes(c))continue;const h=t[l],u=`${s?s+".":""}${l}`,d=o.constructor,p=o[l];try{const g=Cp(p),y=Cp(h);if(a===Lp&&!(l in e||l==="context")){if(h===void 0)continue;sl.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(g!=null&&y!=null&&y!==g&&(g!==Lp||y!=="object")){sl.warn(`unable to set [${u}] in ${d?.name} - can't apply type of [${y}], allowed types are: [${g}]`);continue}if(Io(p))o[l].set(h);else if(y==="object"&&l!=="context"){if(!(l in o)){sl.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}p==null?o[l]=h:nl(p,h,{...i,path:u,matcherPath:c})}else o[l]=h}catch(g){sl.warn(`unable to set [${u}] in [${d?.name}]; nested error is: ${g.message}`)}}return e}function Cp(e){return e==null?null:Fk(e)||e0(e)?"primitive":No(e)?"array":Bk(e)?To(e)?"object":Lp:zk(e)?"function":"primitive"}var i0=(T(),N(w)),Uk=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(e){return new Promise(t=>{this.acquireQueue.push([e,t]),this.available&&this.dispatchNext().catch(i=>i0.Logger.errorOnce(i))})}async acquireImmediately(e){return this.available?(await this.acquire(e),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[e,t]=this.acquireQueue.shift()??[];for(;e;){try{await e(),t?.()}catch(i){i0.Logger.error("mutex callback error",i),t?.()}[e,t]=this.acquireQueue.shift()??[]}this.available=!0}},s0=class{constructor(){this.eventListeners=new Map}addEventListener(e,t){if(typeof t!="function")throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(e);i?i.add(t):this.eventListeners.set(e,new Set([t]))}removeEventListener(e,t){const i=this.eventListeners.get(e);i!=null&&(i.delete(t),i.size===0&&this.eventListeners.delete(e))}hasEventListener(e){return this.eventListeners.has(e)}clearEventListeners(){this.eventListeners.clear()}fireEvent(e){this.eventListeners.get(e.type)?.forEach(t=>t(e))}},Pn=class extends ae{constructor(e=0,t=e,i=e,s=t){super(),this.top=e,this.right=t,this.bottom=i,this.left=s}};f([x],Pn.prototype,"top",2),f([x],Pn.prototype,"right",2),f([x],Pn.prototype,"bottom",2),f([x],Pn.prototype,"left",2);var Wk=(T(),N(w));function Oe(e,t){const i=(0,Wk.isArray)(e)?e:e.split(".");if(i.length===1){const[s]=i;return br((n,r,o)=>n[s]=o,n=>n[s],t)}return br((s,n,r)=>hp(s,i,r),s=>lp(s,i),t)}function $k(e){return br((t,i,s)=>t[e]=s)}function kt(e,t){return br((i,s,n)=>i[e][t??s]=n)}function hi(e){const{newValue:t,oldValue:i,changeValue:s}=e;return br((n,r,o,a)=>(o!==a&&(a!==void 0&&i?.call(n,a),o!==void 0&&t?.call(n,o),s?.call(n,o,a)),o))}function Rn(e){return xb(e)}var Yk=(T(),N(w));function Kk(e){return n0((t,i)=>(0,Yk.getWindow)().requestAnimationFrame(t),e)}function Zk(e){return n0((t,i=0)=>{i===0?queueMicrotask(t):setTimeout(t,i)},e)}function n0(e,t){let i=0,s=!1,n,r;const o=()=>s,a=()=>{s=!1,r?.(),r=void 0,n=void 0,i>0&&e(l)},l=()=>{const c=i;i=0,s=!0;const h=t({count:c});if(!h){a();return}h.then(a,a)};return{schedule(c){i===0&&!o()&&e(l,c),i++},async await(){if(o())for(n==null&&(n=new Promise(c=>{r=c}));o();)await n}}}var yt=(T(),N(w)),wp=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function Oo(e,t,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o}=t,{currentX:a,currentY:l}=Xs.calcCurrentXY(i,t);return{type:e,device:"mouse",offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:t}}function bh(e,t,i){return{type:e,sourceEvent:t}}var Xk={blur:e=>({type:"blur",sourceEvent:e}),change:e=>({type:"change",sourceEvent:e}),contextmenu:(e,t)=>Oo("contextmenu",e,t),focus:e=>({type:"focus",sourceEvent:e}),keydown:e=>({type:"keydown",sourceEvent:e}),keyup:e=>({type:"keyup",sourceEvent:e}),click:(e,t)=>Oo("click",e,t),dblclick:(e,t)=>Oo("dblclick",e,t),mouseenter:(e,t)=>Oo("mouseenter",e,t),mousemove:(e,t)=>Oo("mousemove",e,t),mouseleave:(e,t)=>Oo("mouseleave",e,t),wheel:e=>{const{offsetX:t,offsetY:i,clientX:s,clientY:n}=e,r=e.deltaMode===0?.01:1,o=e.deltaX*r,a=e.deltaY*r;return{type:"wheel",offsetX:t,offsetY:i,clientX:s,clientY:n,deltaX:o,deltaY:a,sourceEvent:e}},touchstart:(e,t)=>bh("touchstart",e,t),touchmove:(e,t)=>bh("touchmove",e,t),touchend:(e,t)=>bh("touchend",e,t),touchcancel:(e,t)=>bh("touchcancel",e,t)},Xs=class{static alloc(e,t,i){return Xk[e](t,i)}static isHTMLEvent(e){return wp.includes(e)}static calcCurrentXY(e,t){const i=e.getBoundingClientRect();return{currentX:t.clientX-i.x,currentY:t.clientY-i.y}}},qk=(T(),N(w)),Qk=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(e,t){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[e]=t}lazyGetWidgetListeners(e,t){var i;if(!(e in(this.sourceListeners??{}))){const s=r=>{const o=Xs.alloc(e,r,t.getElement());this.dispatch(e,t,o)},n={};e.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(e,s),t.getElement().addEventListener(e,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[e]??(i[e]=[]),this.widgetListeners[e]}add(e,t,i){this.lazyGetWidgetListeners(e,t).push(i)}remove(e,t,i){const s=this.lazyGetWidgetListeners(e,t),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(e){if(this.widgetListeners=void 0,this.sourceListeners){for(const[t,i]of(0,qk.entries)(this.sourceListeners))e.getElement().removeEventListener(t,i);this.sourceListeners=void 0}}dispatch(e,t,i){for(const s of this.widgetListeners?.[e]??[])s(i,t)}},xh=(T(),N(w)),qs=(T(),N(w)),Jk=class{constructor(e,t,i,s){this.glob=e,this.self=t,this.window=(0,qs.getWindow)(),this.cleanup=new qs.CleanupRegistry,this.mousegeneral=l=>{l.stopPropagation(),l.stopImmediatePropagation()},this.mousemove=l=>{l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mousemove(l)},this.mouseup=l=>{l.button===0&&(l.stopPropagation(),l.stopImmediatePropagation(),this.glob.globalMouseDragCallbacks?.mouseup(l),this.destroy())};const{window:n,mousegeneral:r,mousemove:o,mouseup:a}=this;this.cleanup.register((0,qs.attachListener)(n,"mousedown",r,{capture:!0}),(0,qs.attachListener)(n,"mouseenter",r,{capture:!0}),(0,qs.attachListener)(n,"mouseleave",r,{capture:!0}),(0,qs.attachListener)(n,"mouseout",r,{capture:!0}),(0,qs.attachListener)(n,"mouseover",r,{capture:!0}),(0,qs.attachListener)(n,"mousemove",o,{capture:!0}),(0,qs.attachListener)(n,"mouseup",a,{capture:!0})),t.mouseDragger=this,e.globalMouseDragCallbacks=i,e.globalMouseDragCallbacks.mousedown(s),s.stopPropagation(),s.stopImmediatePropagation()}destroy(){this.cleanup.flush(),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function eC(e,t,i,s){if(e.globalMouseDragCallbacks==null)return new Jk(e,t,i,s)}var As=(T(),N(w)),tC=500,iC=100;function sC(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY;return i*i+s*s}var Np=!1,nC=class{constructor(e,t,i,s,n){this.glob=e,this.self=t,this.initialTouch=s,this.target=n,this.cleanup=new As.CleanupRegistry,this.longTapInterrupted=!1,this.longtap=()=>{const{target:a,initialTouch:l}=this;if(!this.longTapInterrupted){const c=new As.CleanupRegistry;a.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),Np=!0;const h=y=>y.preventDefault(),u=y=>{Np=!1,y.preventDefault(),c.flush()};c.register((0,As.attachListener)(a,"touchmove",h,{passive:!1}),(0,As.attachListener)(a,"touchend",u,{passive:!1}),(0,As.attachListener)(a,"touchcancel",u,{passive:!1}));const{clientX:d,clientY:p}=l,g=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:(0,As.getWindow)(),clientX:d,clientY:p,pointerType:"touch"});a.dispatchEvent(g)}},this.touchmove=a=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(a.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||sC(h,u)>iC,c.dragTouchEnabled&&l.globalTouchDragCallbacks?.touchmove(a,u))},this.touchend=a=>{this.longTapInterrupted=!0;const l=this.findInitialFinger(a.changedTouches,a.touches);l!=null&&this.glob.globalTouchDragCallbacks?.touchend(a,l),this.destroy()},this.longtapTimer=setTimeout(this.longtap,tC);const{touchmove:r,touchend:o}=this;this.cleanup.register((0,As.attachListener)(n,"touchmove",r,{passive:!1}),(0,As.attachListener)(n,"touchstart",o,{passive:!1}),(0,As.attachListener)(n,"touchend",o,{passive:!1}),(0,As.attachListener)(n,"touchcancel",o,{passive:!1})),t.touchDragger=this,e.globalTouchDragCallbacks=i}destroy(){clearTimeout(this.longtapTimer),this.cleanup.flush(),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...e){const t=e.map(i=>Array.from(i)).flat();return Array.from(t).find(i=>i.identifier===this.initialTouch.identifier)}};function rC(e,t,i,s,n){if(!(e.globalTouchDragCallbacks!=null||Np))return new nC(e,t,i,s,n)}function Tp(e,t,i,s){const{currentX:n,currentY:r}=Xs.calcCurrentXY(e.getElement(),s),o=s.pageX-i.pageX,a=s.pageY-i.pageY;return{type:t,device:"mouse",offsetX:i.offsetX+o,offsetY:i.offsetY+a,clientX:s.clientX,clientY:s.clientY,currentX:n,currentY:r,originDeltaX:o,originDeltaY:a,sourceEvent:s}}function oC(e,{pageX:t,pageY:i}){const{x:s,y:n}=e.getElement().getBoundingClientRect();return{offsetX:t-s,offsetY:i-n}}function Op(e,t,i,s,n){const{currentX:r,currentY:o}=Xs.calcCurrentXY(e.getElement(),n),a=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:t,device:"touch",offsetX:i.offsetX+a,offsetY:i.offsetY+l,clientX:n.clientX,clientY:n.clientY,currentX:r,currentY:o,originDeltaX:a,originDeltaY:l,sourceEvent:s}}var r0={},o0=class{constructor(e){this.dispatchCallback=e,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.listeners?.clear(),this.mouseDragger?.destroy(),this.touchDragger?.destroy()}getListenerSet(e){this.listeners??(this.listeners=new Map);let t=this.listeners.get(e);return t===void 0&&(t=new Set,this.listeners.set(e,t)),t}add(e,t,i){switch(this.getListenerSet(e).add(i),e){case"drag-start":case"drag-move":case"drag-end":{this.registerDragTrigger(t);break}}}remove(e,t,i){this.getListenerSet(e).delete(i)}registerDragTrigger(e){if(this.dragTriggerRemover==null){const t=e.getElement(),i=new xh.CleanupRegistry;i.register((0,xh.attachListener)(t,"mousedown",s=>this.triggerMouseDrag(e,s)),(0,xh.attachListener)(t,"touchstart",s=>this.triggerTouchDrag(e,s),{passive:!1})),this.dragTriggerRemover=()=>i.flush()}}triggerMouseDrag(e,t){t.button===0&&this.startMouseDrag(e,t)}startMouseDrag(e,t){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};up(["pageX","pageY","offsetX","offsetY"],i,t);const s={mousedown:n=>{const r=Tp(e,"drag-start",i,n);this.dispatch("drag-start",e,r)},mousemove:n=>{const r=Tp(e,"drag-move",i,n);this.dispatch("drag-move",e,r)},mouseup:n=>{const r=Tp(e,"drag-end",i,n);this.dispatch("drag-end",e,r),this.endDrag(e,r)}};this.mouseDragger=eC(r0,this,s,t)}endDrag(e,{sourceEvent:t,clientX:i,clientY:s}){const n=e.getElement(),r=n.getBoundingClientRect();(0,xh.boxContains)(r,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",t)),t.target?.dispatchEvent(new MouseEvent("mouseenter",t)))}triggerTouchDrag(e,t){const i=t.targetTouches[0];t.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(e,t,i)}startOneFingerTouch(e,t,i){const s={pageX:NaN,pageY:NaN,...oC(e,i)};up(["pageX","pageY"],s,i);const n={touchmove:(a,l)=>{const c=Op(e,"drag-move",s,a,l);this.dispatch("drag-move",e,c)},touchend:(a,l)=>{const c=Op(e,"drag-end",s,a,l);this.dispatch("drag-end",e,c)}},r=e.getElement();this.touchDragger=rC(r0,this,n,i,r);const o=Op(e,"drag-start",s,t,i);this.dispatch("drag-start",e,o)}dispatch(e,t,i){for(const s of this.getListenerSet(e))s(i,t);this.dispatchCallback(e,i)}},aC=class{constructor(e){this.elem=e}setBounds(e){fh(this.elemContainer??this.elem,e)}getBounds(){return Qb(this.elemContainer??this.elem)}static setElementContainer(e,t){const i=e.getBounds();fh(t,i),(0,yt.setElementStyles)(e.elem,{width:"100%",height:"100%"}),e.elem.remove(),e.elemContainer=t,e.elemContainer.replaceChildren(e.elem)}},Ls=class extends aC{constructor(){super(...arguments),this.index=NaN,this.children=[]}set id(e){(0,yt.setAttribute)(this.elem,"id",e)}get id(){return(0,yt.getAttribute)(this.elem,"id")}getElement(){return this.elem}getBoundingClientRect(){return this.elem.getBoundingClientRect()}get clientWidth(){return this.elem.clientWidth}get clientHeight(){return this.elem.clientHeight}destroy(){this.parent?.removeChild(this),this.children.forEach(e=>{e.parent=void 0,e.destroy()}),this.children.length=0,this.destructor(),this.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}remove(){this.elem.remove(),this.elemContainer?.remove()}setHidden(e){(0,yt.setElementStyle)(this.elem,"display",e?"none":void 0)}isHidden(){return(0,yt.getWindow)()?.getComputedStyle?.(this.elem).display==="none"}setCursor(e){(0,yt.setElementStyle)(this.elem,"cursor",e)}setTextContent(e){this.elem.textContent=e??null}setAriaDescribedBy(e){(0,yt.setAttribute)(this.elem,"aria-describedby",e)}setAriaHidden(e){(0,yt.setAttribute)(this.elem,"aria-hidden",e)}setAriaLabel(e){(0,yt.setAttribute)(this.elem,"aria-label",e)}setAriaExpanded(e){(0,yt.setAttribute)(this.elem,"aria-expanded",e)}setAriaControls(e){(0,yt.setAttribute)(this.elem,"aria-controls",e)}setAriaHasPopup(e){(0,yt.setAttribute)(this.elem,"aria-haspopup",e)}setInnerHTML(e){this.elem.innerHTML=e}setPointerEvents(e){(0,yt.setElementStyle)(this.elem,"pointer-events",e)}isDisabled(){return(0,yt.getAttribute)(this.elem,"aria-disabled",!1)}hasPopup(){const e=(0,yt.getAttribute)(this.elem,"aria-haspopup");return e!==void 0&&e!=="false"}parseFloat(e){return e===""?0:parseFloat(e)}cssLeft(){return this.parseFloat(this.elem.style.left)}cssTop(){return this.parseFloat(this.elem.style.top)}cssWidth(){return this.parseFloat(this.elem.style.width)}cssHeight(){return this.parseFloat(this.elem.style.height)}focus(e){this.elem.focus(e)}setFocusOverride(e){(0,yt.setAttribute)(this.elem,"data-focus-override",e)}setPreventsDefault(e){(0,yt.setAttribute)(this.elem,"data-preventdefault",e)}setTabIndex(e){(0,yt.setAttribute)(this.elem,"tabindex",e)}addChild(e){this.addChildToDOM(e,this.getBefore(e)),this.children.push(e),e.index=this.children.length-1,e.parent=this,this.onChildAdded(e)}removeChild(e){const t=this.children.findIndex(i=>i===e);this.children.splice(t,1),this.removeChildFromDOM(e),this.onChildRemoved(e)}moveChild(e,t){e.domIndex!==t&&(e.domIndex=t,this.removeChildFromDOM(e),this.addChildToDOM(e,this.getBefore(e)))}addClass(...e){this.elem.classList.add(...e)}removeClass(...e){this.elem.classList.remove(...e)}toggleClass(e,t){this.elem.classList.toggle(e,t)}appendOrInsert(e,t){t?t.getElement().insertAdjacentElement("beforebegin",e):this.elem.appendChild(e)}addChildToDOM(e,t){this.appendOrInsert(e.getElement(),t)}removeChildFromDOM(e){this.elem.removeChild(e.getElement())}onChildAdded(e){}onChildRemoved(e){}getBefore({domIndex:e}){if(e!==void 0)return this.children.filter(t=>t.domIndex!==void 0&&t.domIndex>e).reduce((t,i)=>!t||i.domIndex<t.domIndex?i:t,void 0)}addListener(e,t){return Xs.isHTMLEvent(e)?(this.htmlListener??(this.htmlListener=new Qk),this.htmlListener.add(e,this,t)):(this.internalListener??(this.internalListener=new o0(this.onDispatch.bind(this))),this.internalListener.add(e,this,t)),()=>this.removeListener(e,t)}removeListener(e,t){Xs.isHTMLEvent(e)?this.htmlListener?.remove(e,this,t):this.htmlListener!=null&&this.internalListener?.remove(e,this,t)}setDragTouchEnabled(e){this.internalListener??(this.internalListener=new o0(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=e}onDispatch(e,t){if(!t.sourceEvent?.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...t,...Xs.calcCurrentXY(i.getElement(),t)};s.dispatch(e,i,n)}i=i.parent}}static addWindowEvent(e,t){const i=s=>{s.persisted||t()};return(0,yt.attachListener)((0,yt.getWindow)(),"pagehide",i)}},lC=(T(),N(w)),a0=(T(),N(w));function cC(e=0,t=0){return new OffscreenCanvas(e,t).getContext("2d")}var Ep=class{constructor(e=5){this.maxCacheSize=e,this.store=new Map}get(e){if(!this.store.has(e))return;const t=this.store.get(e);return this.store.delete(e),this.store.set(e,t),t}has(e){return this.store.has(e)}set(e,t){if(this.store.set(e,t),this.store.size>this.maxCacheSize){const i=this.store.keys();let s=this.store.size-this.maxCacheSize;for(;s>0;){const n=i.next();n.done||this.store.delete(n.value),s--}}return t}clear(){this.store.clear()}},Qs=class{static measureText(e,t){return this.getMeasurer(t).measureText(e)}static measureLines(e,t){return this.getMeasurer(t).measureLines(e)}static getMeasurer(e){const t=Ue.toFontString(e.font),i=`${t}-${e.textAlign??"start"}-${e.textBaseline??"top"}`;return this.instanceMap.get(i)??this.createFontMeasurer(t,e,i)}static clear(){this.instanceMap.clear()}static createFontMeasurer(e,t,i){const s=cC();s.font=e,s.textAlign=t.textAlign??"start",s.textBaseline=t.textBaseline??"top";const n=new l0(s,t);return this.instanceMap.set(i,n),n}};Qs.instanceMap=new Ep(10);var l0=class{constructor(e,t){this.ctx=e,this.measureMap=new Ep(100),t.textAlign&&(e.textAlign=t.textAlign),t.textBaseline&&(e.textBaseline=t.textBaseline),e.font=Ue.toFontString(t.font),this.textMeasurer=new Pp(i=>this.cachedCtxMeasureText(i),t.textBaseline??"alphabetic")}textWidth(e,t){return this.textMeasurer.textWidth(e,t)}measureText(e){return this.textMeasurer.measureText(e)}measureLines(e){return this.textMeasurer.measureLines(e)}cachedCtxMeasureText(e){if(!this.measureMap.has(e)){const t=this.ctx.measureText(e);this.measureMap.set(e,{actualBoundingBoxAscent:t.actualBoundingBoxAscent,emHeightAscent:t.emHeightAscent,emHeightDescent:t.emHeightDescent,actualBoundingBoxDescent:t.actualBoundingBoxDescent,actualBoundingBoxLeft:t.actualBoundingBoxLeft,actualBoundingBoxRight:t.actualBoundingBoxRight,alphabeticBaseline:t.alphabeticBaseline,fontBoundingBoxAscent:t.fontBoundingBoxAscent,fontBoundingBoxDescent:t.fontBoundingBoxDescent,hangingBaseline:t.hangingBaseline,ideographicBaseline:t.ideographicBaseline,width:t.width})}return this.measureMap.get(e)}},Ue=class{static toFontString({fontSize:e=10,fontStyle:t,fontWeight:i,fontFamily:s}){let n="";return t&&t!=="normal"&&(n+=`${t} `),i&&i!=="normal"&&i!==400&&(n+=`${i} `),n+=`${e}px`,n+=` ${s}`,n.trim()}static getLineHeight(e){return Math.ceil(e*this.defaultLineHeight)}static getHorizontalModifier(e){switch(e){case"left":case"start":return 0;case"center":return .5;case"right":case"end":return 1;default:return 0}}static getVerticalModifier(e){switch(e){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};Ue.EllipsisChar="\u2026",Ue.defaultLineHeight=1.15,Ue.lineSplitter=/\r?\n/g;var Pp=class{constructor(e,t="alphabetic"){this.measureTextFn=e,this.textBaseline=t,this.charMap=new Map}getMetrics(e){const t=this.measureTextFn(e);return t.fontBoundingBoxAscent??(t.fontBoundingBoxAscent=t.emHeightAscent),t.fontBoundingBoxDescent??(t.fontBoundingBoxDescent=t.emHeightDescent),{width:t.width,height:t.actualBoundingBoxAscent+t.actualBoundingBoxDescent,lineHeight:t.fontBoundingBoxAscent+t.fontBoundingBoxDescent}}getMultilineMetrics(e){let t=0,i=0,s=0,n=0,r=0,o=0;const a=Ue.getVerticalModifier(this.textBaseline),l=[];let c=0;const h=e.length;for(const u of e){const d=this.measureTextFn(u);d.fontBoundingBoxAscent??(d.fontBoundingBoxAscent=d.emHeightAscent),d.fontBoundingBoxDescent??(d.fontBoundingBoxDescent=d.emHeightDescent),t<d.width&&(t=d.width),n<d.actualBoundingBoxLeft&&(n=d.actualBoundingBoxLeft),c===0?(i+=d.actualBoundingBoxAscent,s+=d.actualBoundingBoxAscent,o=d.alphabeticBaseline):r+=d.fontBoundingBoxAscent,c===h-1?i+=d.actualBoundingBoxDescent:r+=d.fontBoundingBoxDescent,l.push({text:u,width:d.width,height:d.actualBoundingBoxAscent+d.actualBoundingBoxDescent,lineHeight:d.fontBoundingBoxAscent+d.fontBoundingBoxDescent,offsetTop:d.actualBoundingBoxAscent,offsetLeft:d.actualBoundingBoxLeft}),c++}return i+=r,s+=r*a,{width:t,height:i,offsetTop:s,offsetLeft:n,alphabeticBaseline:o,lineMetrics:l}}textWidth(e,t){if(t){let i=0;for(let s=0;s<e.length;s++)i+=this.textWidth(e.charAt(s));return i}return e.length>1?this.measureTextFn(e).width:this.charMap.get(e)??this.charWidth(e)}measureText(e){return this.getMetrics(e)}measureLines(e){const t=typeof e=="string"?e.split(Ue.lineSplitter):e;return this.getMultilineMetrics(t)}charWidth(e){const{width:t}=this.measureTextFn(e);return this.charMap.set(e,t),t}},Eo=(T(),N(w));function hC(e){for(const t of["B","KB","MB","GB"]){if(e<1536)return`${e.toFixed(1)}${t}`;e/=1024}return`${e.toFixed(1)}TB}`}function uC(){if(!("memory"in performance))return;const{totalJSHeapSize:e,usedJSHeapSize:t,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[t,e,i])typeof n=="number"&&s.push(hC(n));return`Heap ${s.join(" / ")}`}function c0(e,t,i,s,n={},r=W.zero){if(!me.check("scene:stats","scene:stats:verbose"))return;const{layersRendered:o=0,layersSkipped:a=0,nodesRendered:l=0,nodesSkipped:c=0,opsPerformed:h=0,opsSkipped:u=0}=s??{},d=performance.now(),{start:p,...g}=t,y=Object.entries(g).map(([O,E])=>u0(O,E)).filter(O=>O!=null).join(" + "),b=Object.entries(n).map(([O,E])=>`${O}: ${JSON.stringify(E)}`).join(" ; "),m=me.check("scene:stats:verbose"),v=uC(),S=[`${u0("\u23F1\uFE0F",p,d)} (${y})`,`${b}`,`Layers: ${m?Rp(o,a):e.size}`,m?`Nodes: ${Rp(l,c)}`:null,m?`Ops: ${Rp(h,u)}`:null,m&&v?v:null].filter(Eo.isString),M=new Pp(O=>i.measureText(O)),I=new Map(S.map(O=>[O,M.measureLines(O)])),k=Math.max(...Array.from(I.values(),O=>O.width)),L=yC(I.values(),O=>O.height),C=2+r.x;i.save();try{i.fillStyle="white",i.fillRect(C,0,k,L),i.fillStyle="black";let O=0;for(const[E,_]of I.entries())O+=_.height,i.fillText(E,C,O)}catch(O){Eo.Logger.warnOnce("Error during debug stats rendering",O)}finally{i.restore()}}function dC(e){const t=(0,Eo.toArray)((0,Eo.getWindow)("agChartsSceneDebug")),i=[];for(const s of t)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);e.debugNodeSearch=i}function pC(e,t){e.save();try{for(const[i,s]of Object.entries(t)){const n=tt.toCanvas(s);if(!n){Eo.Logger.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}e.globalAlpha=.8,e.strokeStyle="red",e.lineWidth=1,e.strokeRect(n.x,n.y,n.width,n.height),e.fillStyle="red",e.strokeStyle="white",e.font="16px sans-serif",e.textBaseline="top",e.textAlign="left",e.lineWidth=2,e.strokeText(i,n.x,n.y,n.width),e.fillText(i,n.x,n.y,n.width)}}catch(i){Eo.Logger.warnOnce("Error during debug rendering",i)}finally{e.restore()}}var gC=new Set,fC=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function mC(e){const{...t}=e;for(const i of Object.keys(t))fC.has(i)||typeof t[i]!="number"&&typeof t[i]!="string"&&typeof t[i]!="boolean"&&(gC.add(i),delete t[i]);return t}function vh(e,t){if(!me.check(!0,"scene"))return{};let i=0;return{node:t==="json"?mC(e):e,name:e.name??e.id,dirty:e instanceof re?e.dirty:void 0,...Array.from(e instanceof re?e.children():[],s=>vh(s,t)).reduce((s,n)=>{let{name:r}=n;const{node:{visible:o,opacity:a,zIndex:l,translationX:c,translationY:h,rotation:u,scalingX:d,scalingY:p},node:g}=n;(!o||a<=0)&&(r=`(${r})`),re.is(g)&&g.renderToOffscreenCanvas&&(r=`*${r}*`);const y=Array.isArray(l)?`(${l.join(", ")})`:l,b=[`${(i++).toString().padStart(3,"0")}|`,`${r??"<unknown>"}`,`z: ${y}`,c&&`x: ${c}`,h&&`y: ${h}`,u&&`r: ${u}`,d!=null&&d!==1&&`sx: ${d}`,p!=null&&p!==1&&`sy: ${p}`].filter(S=>!!S).join(" ");let m=b,v=1;for(;s[m]!=null&&v<100;)m=`${b} (${v++})`;return s[m]=n,s},{})}}function h0(e){const t=e instanceof re?e.dirty:void 0;if(!t)return{dirtyTree:{},paths:[]};const i=Array.from(e instanceof re?e.children():[],r=>h0(r)).filter(r=>r.paths.length>0),s=re.is(e)?e.name??e.id:e.id,n=i.length?i.flatMap(r=>r.paths).map(r=>`${s}.${r}`):[s];return{dirtyTree:{name:s,node:e,dirty:t,...i.map(r=>r.dirtyTree).filter(r=>r.dirty!=null).reduce((r,o)=>(r[o.name??"<unknown>"]=o,r),{})},paths:n}}function Rp(e,t){const i=e+t;return`${e} / ${i} (${Math.round(100*e/i)}%)`}function u0(e,t,i){const s=i!=null?i-t:t;return`${e}: ${Math.round(s*100)/100}ms`}function yC(e,t){let i=0;for(const s of e)i+=t(s);return i}var _p=!1,ui=class Ec extends ht{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=Ec.defaultFontSize,this.fontFamily="sans-serif",this.textAlign="start",this.textBaseline="alphabetic"}onTextChange(){this.lines=this.text?.split(`
`).map(t=>t.trim())??[]}static computeBBox(t,i,s,n,r=!0){const{font:o,font:{fontSize:a},textAlign:l,textBaseline:c="alphabetic",lineHeight:h=r?Ue.getLineHeight(a):void 0}=n,{width:u,alphabeticBaseline:d,offsetLeft:p,offsetTop:g,height:y}=Qs.measureLines(t,r?{font:o,lineHeight:h,textAlign:"start",textBaseline:"top"}:n),b=h==null?y:h*t.length;let m;h==null?m=g:c==="alphabetic"?m=(h-a)/2-d:m=Ue.getVerticalModifier(c)*b;const v=r?u*Ue.getHorizontalModifier(l):p;return new W(i-v,s-m,u,b)}computeBBox(t=_p){const{x:i,y:s,lines:n,textBaseline:r,textAlign:o,lineHeight:a}=this;return Ec.computeBBox(n,i,s,{font:this,textBaseline:r,textAlign:o,lineHeight:a},t)}getBBox(t=!0){if(t){_p=!0;const i=this.computeBBox(!0);return _p=!1,i}return super.getBBox()}getTextMeasureBBox(){return this.computeBBox()}isPointInPath(t,i){const s=this.getBBox();return s?s.containsPoint(t,i):!1}render(t){const{ctx:i,stats:s}=t;if(!this.lines.length||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(t);const{fill:n,stroke:r,strokeWidth:o}=this,{globalAlpha:a}=i,{pixelRatio:l}=this.layerManager.canvas;if(!n&&!(r!=null&&o>0))return super.render(t);const c=Ue.toFontString(this);i.font!==c&&(i.font=c);const{fontSize:h,lineHeight:u=Ue.getLineHeight(h),textAlign:d,textBaseline:p}=this,g=this.lines.length,y=p==="alphabetic"?0:-Ue.getVerticalModifier(p)*u*(g-1);if(i.textAlign=d,i.textBaseline=p,n){this.applyFillAndAlpha(i);const{fillShadow:b}=this;b?.enabled&&(i.shadowColor=b.color,i.shadowOffsetX=b.xOffset*l,i.shadowOffsetY=b.yOffset*l,i.shadowBlur=b.blur*l),this.renderLines(y,u,(m,v,S)=>i.fillText(m,v,S)),i.globalAlpha=a}if(r&&o){this.applyStrokeAndAlpha(i),i.lineWidth=o;const{lineDash:b,lineDashOffset:m,lineCap:v,lineJoin:S}=this;b&&i.setLineDash([...b]),m&&(i.lineDashOffset=m),v&&(i.lineCap=v),S&&(i.lineJoin=S),this.renderLines(y,u,(M,I,k)=>i.strokeText(M,I,k)),i.globalAlpha=a}if(Ec.debug.check()){const b=this.getBBox(!0);i.strokeStyle="red",i.lineWidth=1,i.strokeRect(b.x,b.y,b.width,b.height)}super.render(t)}renderLines(t,i,s){const{lines:n,x:r,y:o}=this;if(!(!Number.isFinite(r)||!Number.isFinite(o)||!Number.isFinite(t)||!Number.isFinite(i)))for(const a of n)s(a,r,o+t),t+=i}setFont(t){this.fontFamily=t.fontFamily,this.fontSize=t.fontSize??Ec.defaultFontSize,this.fontStyle=t.fontStyle,this.fontWeight=t.fontWeight}setAlign(t){this.textAlign=t.textAlign,this.textBaseline=t.textBaseline}toSVG(){if(!this.visible||!this.text)return;const t=(0,a0.createSvgElement)("text");return this.applySvgFillAttributes(t),t.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),t.setAttribute("font-size",String(this.fontSize)),t.setAttribute("font-style",this.fontStyle??""),t.setAttribute("font-weight",String(this.fontWeight??"")),t.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),t.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),t.setAttribute("x",String(this.x)),t.setAttribute("y",String(this.y)),t.textContent=this.text??"",{elements:[t]}}};ui.className="Text",ui.debug=me.create(!0,"scene:text"),ui.defaultFontSize=10,f([z()],ui.prototype,"x",2),f([z()],ui.prototype,"y",2),f([z({convertor:e=>(0,a0.isDefined)(e)?String(e):e,changeCb:e=>e.onTextChange()})],ui.prototype,"text",2),f([z()],ui.prototype,"fontStyle",2),f([z()],ui.prototype,"fontWeight",2),f([z()],ui.prototype,"fontSize",2),f([z()],ui.prototype,"fontFamily",2),f([z()],ui.prototype,"textAlign",2),f([z()],ui.prototype,"textBaseline",2),f([z()],ui.prototype,"lineHeight",2);var _t=ui,d0=class extends Co(_t){},Po=class extends Co(Dr(_t)){},Mh=class{static wrapText(e,t){return this.wrapLines(e,t).join(`
`)}static wrapLines(e,t){const i=this.textWrap(e,t);return t.overflow==="hide"&&i.some(s=>s.endsWith(Ue.EllipsisChar))?[]:i}static appendEllipsis(e){return e.replace(/[.,]{1,5}$/,"")+Ue.EllipsisChar}static truncateLine(e,t,i,s){const n=t.textWidth(Ue.EllipsisChar);let r=0,o=0;for(;o<e.length;o++){const a=t.textWidth(e.charAt(o));if(r+a>i)break;r+=a}if(e.length===o&&(!s||r+n<=i))return s?e+Ue.EllipsisChar:e;for(e=e.slice(0,o).trimEnd();e.length&&t.textWidth(e)+n>i;)e=e.slice(0,-1).trimEnd();return e+Ue.EllipsisChar}static textWrap(e,t){const i=e.split(Ue.lineSplitter),s=Qs.getMeasurer(t);if(t.textWrap==="never")return i.map(a=>this.truncateLine(a.trimEnd(),s,t.maxWidth));const n=[],r=t.textWrap==="hyphenate",o=t.textWrap==null||t.textWrap==="on-space";for(const a of i){let l=a.trimEnd();if(l===""){n.push(l);continue}let c=0,h=0,u=0;for(;c<l.length;){const d=l.charAt(c);if(h+=s.textWidth(d),d===" "&&(u=c),h>t.maxWidth){if(c===0)break;const p=s.textWidth(l.slice(0,c+1));if(p<=t.maxWidth){h=p,c++;continue}if(u){const b=this.getWordAt(l,u+1),m=s.textWidth(b);if(m<=t.maxWidth){n.push(l.slice(0,u).trimEnd()),l=l.slice(u).trimStart(),c=0,h=0,u=0;continue}else o&&m>t.maxWidth&&n.push(l.slice(0,u).trimEnd(),this.truncateLine(l.slice(u).trimStart(),s,t.maxWidth,!0))}else o&&n.push(this.truncateLine(l,s,t.maxWidth,!0));if(o){l="";break}const g=r?"-":"";let y=l.slice(0,c).trim();for(;y.length&&s.textWidth(y+g)>t.maxWidth;)y=y.slice(0,-1).trimEnd();if(n.push(y+g),!y.length){l="";break}l=l.slice(y.length).trimStart(),c=-1,h=0,u=0}c++}l&&n.push(l)}return this.avoidOrphans(n,s,t),this.clipLines(n,s,t)}static getWordAt(e,t){const i=e.indexOf(" ",t);return i===-1?e.slice(t):e.slice(t,i)}static clipLines(e,t,i){if(!i.maxHeight)return e;const{height:s,lineMetrics:n}=t.measureLines(e);if(s<=i.maxHeight)return e;for(let r=0,o=0;r<n.length;r++){const{lineHeight:a}=n[r];if(o+=a,o>i.maxHeight){if(i.overflow==="hide")return[];const l=e.slice(0,r||1),c=l.pop();return l.concat(this.truncateLine(c,t,i.maxWidth,!0))}}return e}static avoidOrphans(e,t,i){if(i.avoidOrphans===!1||e.length<2)return;const{length:s}=e,n=e[s-1],r=e[s-2];if(r.length<n.length)return;const o=r.lastIndexOf(" ");if(o===-1||o===r.indexOf(" ")||n.includes(" "))return;const a=r.slice(o+1);t.textWidth(n+a)<=i.maxWidth&&(e[s-2]=r.slice(0,o),e[s-1]=a+" "+n)}},p0={};is(p0,{BASE_FONT_SIZE:()=>Js,CARTESIAN_AXIS_TYPE:()=>f0,CARTESIAN_POSITION:()=>g0,FONT_SIZE:()=>jp,FONT_SIZE_RATIO:()=>Ci,POLAR_AXIS_SHAPE:()=>y0,POLAR_AXIS_TYPE:()=>m0});var jp=(e=>(e[e.SMALLEST=8]="SMALLEST",e[e.SMALLER=10]="SMALLER",e[e.SMALL=12]="SMALL",e[e.MEDIUM=13]="MEDIUM",e[e.LARGE=14]="LARGE",e[e.LARGEST=17]="LARGEST",e))(jp||{}),Js=12,Ci=(e=>(e[e.SMALLEST=8/Js]="SMALLEST",e[e.SMALLER=10/Js]="SMALLER",e[e.SMALL=12/Js]="SMALL",e[e.MEDIUM=13/Js]="MEDIUM",e[e.LARGE=14/Js]="LARGE",e[e.LARGEST=17/Js]="LARGEST",e))(Ci||{}),g0=(e=>(e.TOP="top",e.RIGHT="right",e.BOTTOM="bottom",e.LEFT="left",e))(g0||{}),f0=(e=>(e.CATEGORY="category",e.GROUPED_CATEGORY="grouped-category",e.ORDINAL_TIME="ordinal-time",e.UNIT_TIME="unit-time",e.TIME="time",e.NUMBER="number",e.LOG="log",e))(f0||{}),m0=(e=>(e.ANGLE_CATEGORY="angle-category",e.ANGLE_NUMBER="angle-number",e.RADIUS_CATEGORY="radius-category",e.RADIUS_NUMBER="radius-number",e))(m0||{}),y0=(e=>(e.CIRCLE="circle",e.POLYGON="polygon",e))(y0||{}),Ke=class extends ae{constructor(){super(...arguments),this.id=(0,lC.createId)(this),this.node=new d0({zIndex:1}).setProperties({textAlign:"center",pointerEvents:1}),this.enabled=!1,this.textAlign="center",this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always",this.padding=0,this.layoutStyle="block",this.truncated=!1}registerInteraction(e,t){return e.eventsHub.on("layout:complete",()=>this.updateA11yText(e,t))}computeTextWrap(e,t){const{text:i,padding:s,wrapping:n}=this,r=Math.min(this.maxWidth??1/0,e)-s*2,o=this.maxHeight??t-s*2;if(!isFinite(r)&&!isFinite(o)){this.node.text=i;return}const a=Mh.wrapText(i??"",{maxWidth:r,maxHeight:o,font:this,textWrap:n});this.node.text=a,this.truncated=a.includes(Ue.EllipsisChar)}updateA11yText(e,t){const{proxyInteractionService:i}=e;if(this.enabled&&this.text){const s=tt.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:t})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(e,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(e,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(e,t){if(t!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=tt.toCanvas(this.node),n=t.sourceEvent.offsetX+i,r=t.sourceEvent.offsetY+s;e.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:r,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(e,t){e.tooltipManager.removeTooltip(this.id)}};Ke.SMALL_PADDING=10,f([x,kt("node","visible")],Ke.prototype,"enabled",2),f([x,kt("node")],Ke.prototype,"text",2),f([x,kt("node")],Ke.prototype,"textAlign",2),f([x,kt("node")],Ke.prototype,"fontStyle",2),f([x,kt("node")],Ke.prototype,"fontWeight",2),f([x,kt("node")],Ke.prototype,"fontSize",2),f([x,kt("node")],Ke.prototype,"fontFamily",2),f([x,kt("node","fill")],Ke.prototype,"color",2),f([x],Ke.prototype,"spacing",2),f([x],Ke.prototype,"maxWidth",2),f([x],Ke.prototype,"maxHeight",2),f([x],Ke.prototype,"wrapping",2),f([x],Ke.prototype,"padding",2),f([x],Ke.prototype,"layoutStyle",2);var zp=(e=>(e.X="x",e.Y="y",e.Angle="angle",e.Radius="radius",e))(zp||{});function bC(e){switch(e){case"x":case"y":case"angle":case"radius":return!0;default:return!1}}var Sh=class{constructor(){this.title=new Ke,this.subtitle=new Ke,this.footnote=new Ke}positionCaptions(e){const{title:t,subtitle:i,footnote:s}=this,n=e.layoutBox.height/10;if(t.enabled){const{spacing:r}=t;this.positionCaption("top",t,e.layoutBox,n),this.shrinkLayoutByCaption("top",t,e.layoutBox,r)}i.enabled&&(this.positionCaption("top",i,e.layoutBox,n),this.shrinkLayoutByCaption("top",i,e.layoutBox,i.spacing)),s.enabled&&(this.positionCaption("bottom",s,e.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,e.layoutBox,s.spacing))}positionAbsoluteCaptions(e){const{title:t,subtitle:i,footnote:s}=this,{rect:n}=e.series;for(const r of[t,i,s])if(r.layoutStyle==="overlay"){if(r.textAlign==="left")r.node.x=n.x+r.padding;else if(r.textAlign==="right"){const o=r.node.getBBox();r.node.x=n.x+n.width-o.width-r.padding}}}computeX(e,t){return e==="left"?t.x:e==="right"?t.x+t.width:t.x+t.width/2}positionCaption(e,t,i,s){const n=Math.max(Ue.getLineHeight(t.fontSize),s);t.node.x=this.computeX(t.textAlign,i)+t.padding,t.node.y=i.y+(e==="top"?0:i.height)+t.padding,t.node.textBaseline=e,t.computeTextWrap(i.width,n)}shrinkLayoutByCaption(e,t,i,s=0){if(t.layoutStyle==="block"){const n=t.node.getTextMeasureBBox();i.shrink(Math.ceil(e==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),e)}}};f([x],Sh.prototype,"title",2),f([x],Sh.prototype,"subtitle",2),f([x],Sh.prototype,"footnote",2);var b0=(T(),N(w)),xC=(T(),N(w)),vC=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],MC=class{constructor(e){this.chartService=e,this.mementoOriginatorKey="chartType"}createMemento(){let e=this.chartService.publicApi?.getOptions()?.chartType;return e==null&&(e="candlestick"),e}guardMemento(e){return e==null||vC.includes(e)}restoreMemento(e,t,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>xC.Logger.error("error restoring state",n))}},SC=(T(),N(w)),Ir="12.0.1",x0=Symbol("previous-memento-not-found"),DC=class{constructor(e){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=me.create(!0,"history"),this.cleanup=new SC.CleanupRegistry,this.cleanup.register(e.on("series:undo",this.undo.bind(this)),e.on("series:redo",this.redo.bind(this)))}destroy(){this.cleanup.flush()}addMementoOriginator(e){this.originators.set(e.mementoOriginatorKey,e),this.clearState.set(e.mementoOriginatorKey,e.createMemento()),this.debugEvent("History add originator:",e.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[e,t]of this.originators.entries())this.clearState.set(e,t.createMemento())}record(e,...t){this.historyIndex<this.history.length-1&&(this.history=this.history.slice(0,this.historyIndex+1)),this.history.length>this.maxHistoryLength&&(this.history=this.history.slice(-this.maxHistoryLength));const i=new Map;for(const s of t){if(!this.originators.has(s.mementoOriginatorKey))throw new Error(`Originator [${s.mementoOriginatorKey}] has not been added to the HistoryManager.`);i.set(s.mementoOriginatorKey,s.createMemento())}this.history.push({label:e,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${e}]`)}undo(){const e=this.history[this.historyIndex];if(e){for(const t of e.mementos.keys()){const i=this.findPreviousMemento(t);if(i===x0)throw new Error(`Could not find previous memento for [${t}].`);this.restoreMemento(t,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${e.label}]`)}}redo(){const e=this.history[this.historyIndex+1];if(e){for(const[t,i]of e.mementos.entries())this.restoreMemento(t,i);this.historyIndex+=1,this.debugEvent(`History redo: [${e.label}]`)}}findPreviousMemento(e){for(let t=this.historyIndex-1;t>=0;t--)if(this.history[t].mementos.has(e))return this.history[t].mementos.get(e);return this.clearState.has(e)?this.clearState.get(e):x0}restoreMemento(e,t){this.originators.get(e)?.restoreMemento(Ir,Ir,t)}debugEvent(...e){this.debug(...e,this.history.map((t,i)=>i===this.historyIndex?`** ${t.label} **`:t.label))}},Ro=(T(),N(w)),v0=class qm{constructor(t){this.version=t.split("-")[0]}save(...t){const i={version:this.version};for(const s of Object.values(t))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(t,...i){if(typeof t!="object"){Ro.Logger.warnOnce(`Could not restore data of type [${typeof t}], expecting an object, ignoring.`);return}if(t==null){Ro.Logger.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in t)||typeof t.version!="string"){Ro.Logger.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,t[s.mementoOriginatorKey]),r=[];if(!s.guardMemento(n,r)){const o=r.length>0?`

${r.join(`

`)}

`:"";Ro.Logger.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${o}`,n);return}s.restoreMemento(this.version,t.version,n)}}encode(t,i){try{return JSON.parse(JSON.stringify(i,qm.encodeTypes))}catch(s){throw new Error(`Failed to encode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(t,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),qm.decodeTypes)}catch(s){throw new Error(`Failed to decode [${t.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(t,i){return(0,Ro.isDate)(this[t])?{__type:"date",value:this[t].toISOString()}:i}static decodeTypes(t,i){return(0,Ro.isObject)(this[t])&&"__type"in this[t]&&this[t].__type==="date"?new Date(this[t].value):i}},IC=class{constructor(){this.caretaker=new v0(Ir),this.state=new Map}setState(e,t){ft(this.state.get(e.mementoOriginatorKey),t)||this.setStateAndRestore(e,t)}setStateAndRestore(e,t){this.state.set(e.mementoOriginatorKey,t),this.restoreState(e)}restoreState(e){const{caretaker:t,state:i}=this;if(!i.has(e.mementoOriginatorKey))return;const s=i.get(e.mementoOriginatorKey);t.restore({version:t.version,[e.mementoOriginatorKey]:s},e)}},Ut=(T(),N(w)),AC=`.ag-charts-wrapper,.ag-charts-wrapper:after,.ag-charts-wrapper:before,.ag-charts-wrapper *,.ag-charts-wrapper *:after,.ag-charts-wrapper *:before{box-sizing:border-box}.ag-charts-wrapper{--align-items: center;--justify-content: center;position:relative;user-select:none;-webkit-user-select:none;-webkit-tap-highlight-color:rgba(0,0,0,0)}.ag-charts-wrapper--safe-horizontal{--justify-content: flex-start}.ag-charts-wrapper--safe-vertical{--align-items: flex-start}.ag-charts-tab-guard{width:0%;height:0%;position:absolute;pointer-events:none}.ag-charts-canvas-center{width:100%;height:100%;position:absolute;touch-action:auto;pointer-events:auto;display:flex;align-items:var(--align-items);justify-content:var(--justify-content)}.ag-charts-canvas-container,.ag-charts-canvas{position:relative;user-select:none;-webkit-user-select:none}.ag-charts-canvas-container>*,.ag-charts-canvas>*{pointer-events:none}.ag-charts-canvas canvas{display:block}.ag-charts-series-area{outline:none;pointer-events:auto;position:absolute}.ag-charts-swapchain{top:0;left:0;outline:none;opacity:0;pointer-events:none;position:absolute;width:100%;height:100%}.ag-charts-swapchain:focus-visible{opacity:1}.ag-charts-canvas-proxy,.ag-charts-canvas-overlay{inset:0;pointer-events:none;position:absolute;user-select:none;-webkit-user-select:none}.ag-charts-canvas-overlay>*{position:absolute;pointer-events:auto}.ag-charts-theme-default,.ag-charts-theme-default-dark{--ag-charts-accent-color: #2196f3;--ag-charts-background-color: #fff;--ag-charts-border-color: #dddddd;--ag-charts-border-radius: 4px;--ag-charts-chart-background-color: #fff;--ag-charts-chart-padding: 20px;--ag-charts-focus-shadow: 0 0 0 3px #2196f3;--ag-charts-foreground-color: #181d1f;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-popup-shadow: 0 0 16px rgba(0, 0, 0, .15);--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #181d1f;--ag-charts-chrome-background-color: #fafafa;--ag-charts-chrome-font-family: Verdana, sans-serif;--ag-charts-chrome-font-size: 12px;--ag-charts-chrome-font-weight: 400;--ag-charts-chrome-subtle-text-color: #8c8c8c;--ag-charts-chrome-text-color: #181d1f;--ag-charts-button-background-color: #fff;--ag-charts-button-border: 1px solid #dddddd;--ag-charts-button-font-weight: normal;--ag-charts-button-text-color: inherit;--ag-charts-input-background-color: #fff;--ag-charts-input-border: 1px solid #dddddd;--ag-charts-input-text-color: #181d1f;--ag-charts-menu-background-color: #fafafa;--ag-charts-menu-border: 1px solid #dddddd;--ag-charts-menu-text-color: #181d1f;--ag-charts-panel-background-color: #fafafa;--ag-charts-panel-text-color: #181d1f;--ag-charts-tooltip-background-color: #fafafa;--ag-charts-tooltip-border: 1px solid #dddddd;--ag-charts-tooltip-text-color: #181d1f;--ag-charts-tooltip-subtle-text-color: #8c8c8c;--ag-charts-crosshair-label-background-color: #fafafa;--ag-charts-crosshair-label-text-color: #181d1f;--ag-charts-spacing: 4px;--ag-charts-icon-size: 16px;--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-radius: var(--ag-charts-border-radius);--ag-charts-input-focus-border-color: var(--ag-charts-accent-color);--ag-charts-input-focus-text-color: var(--ag-charts-accent-color);--ag-charts-input-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-input-disabled-border-color: var(--ag-charts-border-color);--ag-charts-input-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-input-text-color) 50% );--ag-charts-input-placeholder-text-color: color-mix( in srgb, var(--ag-charts-input-background-color), var(--ag-charts-input-text-color) 60% );--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-focus-background-color: color-mix( in srgb, var(--ag-charts-button-background-color), var(--ag-charts-accent-color) 12% );--ag-charts-button-focus-border-color: var(--ag-charts-accent-color);--ag-charts-button-focus-text-color: var(--ag-charts-accent-color);--ag-charts-button-disabled-background-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-foreground-color) 6% );--ag-charts-button-disabled-border-color: var(--ag-charts-border-color);--ag-charts-button-disabled-text-color: color-mix( in srgb, var(--ag-charts-chrome-background-color), var(--ag-charts-chrome-text-color) 50% );--ag-charts-checkbox-background-color: color-mix( in srgb, var(--ag-charts-background-color), var(--ag-charts-foreground-color) 35% );--ag-charts-checkbox-checked-background-color: var(--ag-charts-accent-color);--ag-charts-tooltip-border-radius: var(--ag-charts-border-radius);--ag-charts-menu-border-radius: var(--ag-charts-border-radius);--ag-charts-chrome-font-size-small: var(--ag-charts-chrome-font-size);--ag-charts-chrome-font-size-medium: calc(var(--ag-charts-chrome-font-size) * (13 / 12));--ag-charts-chrome-font-size-large: calc(var(--ag-charts-chrome-font-size) * (14 / 12));--ag-charts-border: 1px solid var(--ag-charts-border-color);--ag-charts-focus-border: 1px solid var(--ag-charts-accent-color);--ag-charts-focus-border-shadow: 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%);--ag-charts-layer-menu: 6;--ag-charts-layer-ui-overlay: 5;--ag-charts-layer-tooltip: 4;--ag-charts-layer-toolbar: 3;--ag-charts-layer-crosshair: 2;--ag-charts-layer-annotations: 1}.ag-charts-theme-default-dark{--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 22%)}.ag-chart-canvas-wrapper .ag-charts-theme-default{--ag-charts-border-radius: var(--ag-border-radius, 4px);--ag-charts-border: var(--ag-borders-critical, solid 1px) var(--ag-charts-border-color);--ag-charts-focus-shadow: var(--ag-focus-shadow, 0 0 0 3px var(--ag-charts-accent-color));--ag-charts-focus-border-shadow: var( --ag-focus-shadow, 0 0 0 3px color-mix(in srgb, transparent, var(--ag-charts-accent-color) 20%) )}.ag-charts-icon{display:block;width:20px;height:20px;speak:none;speak:never;mask:var(--icon) center / contain no-repeat;background-color:currentColor;transition:background-color .25s ease-in-out}.ag-charts-icon-align-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNyAxMGg2djFIN3pNNCA3aDEydjFINHptMSA2aDEwdjFINXoiLz48L3N2Zz4=)}.ag-charts-icon-align-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNNCAxMGg2djFINHptMC0zaDEydjFINHptMCA2aDEwdjFINHoiLz48L3N2Zz4=)}.ag-charts-icon-align-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTAgMTBoNnYxaC02ek00IDdoMTJ2MUg0em0yIDZoMTB2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-arrow-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0iTTE1LjI5MyA0LjVIMTIuNXYtMUgxN3Y0aC0xVjUuMjA3bC05LjY0NiA5LjY0Ny0uNzA4LS43MDh6IiBmaWxsPSIjMDAwIi8+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03IDE2YTIuNSAyLjUgMCAxIDEtNSAwIDIuNSAyLjUgMCAwIDEgNSAwbS0yLjUgMS41YTEuNSAxLjUgMCAxIDAgMC0zIDEuNSAxLjUgMCAwIDAgMCAzIiBmaWxsPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-arrow-down-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik02IDhMMS41IDhMMTAgMThMMTguNSA4TDE0IDhMMTQgM0w2IDNMNiA4Wk03IDRMNyA5SDMuNjYyNDRMMTAgMTYuNDU2TDE2LjMzNzYgOUwxMyA5TDEzIDRMNyA0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-arrow-up-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik0xNCAxMkgxOC41TDEwIDJMMS41IDEySDZMNi4wMDAwMiAxN0gxNFYxMlpNMTMgMTZWMTFIMTYuMzM3NkwxMCAzLjU0NDA1TDMuNjYyNDQgMTFIN0w3LjAwMDAyIDE2SDEzWiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-callout-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtNC41MTRhMjYgMjYgMCAwIDAtMi4wMTcgMS41NGwtLjMxNC4yNmMtLjU1LjQ1Ny0xLjExNS45MjYtMS43NiAxLjQtLjY2OS40OTEtMS41NjItLjAxMi0xLjU2Mi0uOFYxNEg0LjVBMS41IDEuNSAwIDAgMSAzIDEyLjV6TTQuNSA0YS41LjUgMCAwIDAtLjUuNXY4YS41LjUgMCAwIDAgLjUuNWgxLjgzM3YzLjM3MmEzNiAzNiAwIDAgMCAxLjY3OC0xLjMzOGwuMzItLjI2NWEyNiAyNiAwIDAgMSAyLjIyNS0xLjY4NWwuMTI2LS4wODRIMTUuNWEuNS41IDAgMCAwIC41LS41di04YS41LjUgMCAwIDAtLjUtLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyAxdjNoMnYxMkg3djNINnYtM0g0VjRoMlYxek01IDVoM3YxMEg1ek0xMSAxNFY2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6bTEtN2gzdjZoLTN6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-close{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJtNSA1IDEwIDEwTTUgMTUgMTUgNSIgc3Ryb2tlPSIjMDAwIi8+PC9zdmc+)}.ag-charts-icon-comment-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy41MTMgMy45OTVhNi41IDYuNSAwIDAgMSA2LjA5OCAxMS40MWMtLjU4OC4zOTMtMS4yMTcuNTM2LTEuODI5LjU4NWExMyAxMyAwIDAgMS0xLjI3LjAxN0EyNyAyNyAwIDAgMCAxMCAxNkg0LjVhLjUuNSAwIDAgMS0uNS0uNVYxMHEwLS4yNDctLjAwNy0uNTEzYy0uMDA4LS40MTYtLjAxNi0uODU3LjAxNy0xLjI2OS4wNS0uNjEyLjE5Mi0xLjI0LjU4NS0xLjgzYTYuNSA2LjUgMCAwIDEgMi45MTgtMi4zOTNtMy41Ni42MWE1LjUgNS41IDAgMCAwLTUuNjQ2IDIuMzRjLS4yNjYuMzk3LS4zNzkuODQyLS40MiAxLjM1NC0uMDMuMzYtLjAyMi43MTgtLjAxNSAxLjEwOFE1IDkuNjg5IDUgMTB2NWg1cS4zMTEuMDAxLjU5My4wMDhjLjM5LjAwNy43NDcuMDE1IDEuMTA4LS4wMTUuNTEyLS4wNDEuOTU3LS4xNTQgMS4zNTUtLjQyYTUuNSA1LjUgMCAwIDAtMS45ODMtOS45NjciIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-crosshair-add-line{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-date-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMiAyaDF2MTZIMnptMTUgMGgxdjE2aC0xeiIgZmlsbD0iIzE4MUQxRiIvPjxwYXRoIGQ9Ik0xMy4xNTcgMTFINXYtMWg3Ljc5M0wxMSA4LjIwN2wuNzA3LS43MDcgMy4xODIgMy4xODItMy4xODIgMy4xODItLjcwNy0uNzA3eiIgZmlsbD0iIzAwMCIvPjwvc3ZnPg==)}.ag-charts-icon-date-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNMyAySDJ2MTZoMXptMy41MDcgNC44OUw4LjUgNC44OTVWMTBINXYxaDMuNXY3aDF2LTdoNS4wODhsLTEuOTU3IDEuOTU3LjcwNy43MDcgMy4xODItMy4xODJMMTMuMzM4IDcuM2wtLjcwNy43MDdMMTQuNjI0IDEwSDkuNVY0LjkzMmwxLjk1NyAxLjk1Ny43MDctLjcwN0w4Ljk4MiAzIDUuOCA2LjE4MnoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-delete{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTguNDk2IDguOTk2QS41LjUgMCAwIDEgOSA5LjQ5MnY0YS41LjUgMCAxIDEtMSAuMDA4di00YS41LjUgMCAwIDEgLjQ5Ni0uNTA0TTEyIDkuNWEuNS41IDAgMCAwLTEgMHY0YS41LjUgMCAwIDAgMSAweiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTYgNVYzLjVBMi41IDIuNSAwIDAgMSA4LjUgMWgzQTIuNSAyLjUgMCAwIDEgMTQgMy41VjVoMi44MzNhLjUuNSAwIDAgMSAwIDFIMTV2MTAuMjVjMCAuNDE1LS4wNjYuODYzLS4zIDEuMjIxLS4yNTcuMzk0LS42NzIuNjEyLTEuMi42MTJoLTdjLS41MjggMC0uOTQzLS4yMTgtMS4yLS42MTItLjIzNC0uMzU4LS4zLS44MDYtLjMtMS4yMjFWNkgzLjMzM2EuNS41IDAgMCAxIDAtMXptMS0xLjVBMS41IDEuNSAwIDAgMSA4LjUgMmgzQTEuNSAxLjUgMCAwIDEgMTMgMy41VjVIN3pNNiAxNi4yNVY2aDh2MTAuMjVjMCAuMzM1LS4wNTkuNTU0LS4xMzguNjc1LS4wNTUuMDg1LS4xNC4xNTgtLjM2Mi4xNThoLTdjLS4yMjIgMC0uMzA3LS4wNzMtLjM2Mi0uMTU4LS4wOC0uMTIxLS4xMzgtLjM0LS4xMzgtLjY3NSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-disjoint-channel,.ag-charts-icon-disjoint-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTkuMDI4IDE3LjQ2YTIuMjUgMi4yNSAwIDAgMC00LjA5Mi0xLjg1bC05LjUxMS0yLjM3OGEyLjI1IDIuMjUgMCAxIDAtLjIyNS45NzRsOS40NzUgMi4zNjlhMi4yNTEgMi4yNTEgMCAwIDAgNC4zNTMuODg2bS0xLjY2Mi0xLjk2NWExLjI1IDEuMjUgMCAxIDEtLjg4NSAyLjMzOCAxLjI1IDEuMjUgMCAwIDEgLjg4NS0yLjMzOE00LjM0MyAxMy42NjlhMS4yNSAxLjI1IDAgMSAwLTIuMzM4LS44ODUgMS4yNSAxLjI1IDAgMCAwIDIuMzM4Ljg4NU0zLjk3IDguNzY5YTIuMjUgMi4yNSAwIDAgMCAxLjQ1NS0yLjExbDkuNTExLTIuMzc4YTIuMjUgMi4yNSAwIDEgMC0uMjYtLjk2NUw1LjIgNS42ODVhMi4yNSAyLjI1IDAgMSAwLTEuMjMgMy4wODRtLjM3My0yLjU0N2ExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjc1LTMuNDM4YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-drag-handle{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjcuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjxjaXJjbGUgY3g9IjEzLjc1IiBjeT0iNy43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iMTMuNzUiIGN5PSIxMS43NSIgcj0iLjc1IiBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii41Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjExLjc1IiByPSIuNzUiIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjUiLz48Y2lyY2xlIGN4PSI1Ljc1IiBjeT0iMTEuNzUiIHI9Ii43NSIgZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuNSIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA1aDEydjFIMnoiLz48Y2lyY2xlIGN4PSIxNS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4yNSIgY3k9IjE0LjUiIHI9IjEuNzUiIHN0cm9rZT0iIzAwMCIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik0xOCAxNUg2di0xaDEyem0wLTQuNUgydi0xaDE2eiIvPjwvc3ZnPg==)}.ag-charts-icon-fibonacci-retracement-trend-based-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJtNC45OTYgMTIuNjc0IDMuMjkxLTUuNzQzLjg2OC40OTctMy4yOTEgNS43NDN6Ii8+PGNpcmNsZSBjeD0iOS43NSIgY3k9IjUuNSIgcj0iMS43NSIgc3Ryb2tlPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC4zNTEiIGN5PSIxNC41IiByPSIxLjc1IiBzdHJva2U9IiMwMDAiLz48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMTggNmgtN1Y1aDd6bTAgNC41aC03di0xaDd6bTAgNC41SDZ2LTFoMTJ6Ii8+PC9zdmc+)}.ag-charts-icon-fill-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtOC4wNzEgNC4wNi0uOTI0LS45MjQuNzA3LS43MDcgNy4yODggNy4yODgtNC45NSA0Ljk1YTMuNSAzLjUgMCAwIDEtNC45NSAwbC0xLjQxNC0xLjQxNGEzLjUgMy41IDAgMCAxIDAtNC45NXptLjcwNy43MDhMNC41MzYgOS4wMWEyLjUgMi41IDAgMCAwIDAgMy41MzZMNS45NSAxMy45NmEyLjUgMi41IDAgMCAwIDMuNTM1IDBsNC4yNDMtNC4yNDN6bTYuOSA3LjIwMi0uMzQ1LjM2My0uMzQ0LS4zNjNhLjUuNSAwIDAgMSAuNjg4IDBtLS4zNDUgMS4wOGE4IDggMCAwIDAtLjI4LjMyMyA0LjMgNC4zIDAgMCAwLS40MDkuNTgyYy0uMTEzLjIwMS0uMTQ0LjMyNi0uMTQ0LjM3OGEuODMzLjgzMyAwIDAgMCAxLjY2NyAwYzAtLjA1Mi0uMDMxLS4xNzctLjE0NC0uMzc4YTQuMyA0LjMgMCAwIDAtLjQxLS41ODIgOCA4IDAgMCAwLS4yOC0uMzIybS0uMzQ0LTEuMDguMzQ0LjM2My4zNDQtLjM2My4wMDIuMDAyLjAwNC4wMDQuMDEzLjAxMmE2IDYgMCAwIDEgLjIwNi4yMDhjLjEzMS4xMzYuMzA4LjMyNy40ODUuNTQ1LjE3Ni4yMTUuMzYzLjQ2Ny41MDcuNzI0LjEzNy4yNDMuMjczLjU1My4yNzMuODY4YTEuODMzIDEuODMzIDAgMSAxLTMuNjY3IDBjMC0uMzE1LjEzNi0uNjI1LjI3My0uODY4LjE0NC0uMjU3LjMzLS41MDkuNTA3LS43MjRhOSA5IDAgMCAxIC42NDUtLjcwOGwuMDQ2LS4wNDUuMDEzLS4wMTIuMDA0LS4wMDR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-hollow-candlestick-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1vcGFjaXR5PSIuMTUiIGQ9Ik01IDVoM3YxMEg1eiIvPjxwYXRoIGZpbGw9IiMxMzE3MjIiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTcgMXYzaDJ2MTJIN3YzSDZ2LTNINFY0aDJWMXpNNSA1aDN2MTBINXptNyAyaDN2NmgtM3ptLTEgN1Y2aDJWMy4yNWgxVjZoMnY4aC0ydjIuNzVoLTFWMTR6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-horizontal-line,.ag-charts-icon-horizontal-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNLjUgOS41aDcuMzA2YTIuMjUgMi4yNSAwIDAgMSA0LjM4OCAwSDE5LjV2MWgtNy4zMDZhMi4yNSAyLjI1IDAgMCAxLTQuMzg4IDBILjV6bTkuNSAxLjc1YTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-line-color{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTQuMjQyIDIuNzIyYy0uNjEyIDAtMS4yLjI0My0xLjYzMi42NzVsLTEuMzQzIDEuMzQ0YS41LjUgMCAwIDAtLjExMi4xMTJMNC4wNSAxMS45NTljLS4yMDcuMjA3LS4zNi40Ni0uNDQ2Ljc0di4wMDFsLS42OSAyLjc2N3YuMDAyYS44Mi44MiAwIDAgMCAxLjAyMiAxLjAyMWguMDAybDIuNjM0LS44MjJjLjI4LS4wODUuNTM0LS4yMzcuNzQtLjQ0M2w3LjEwNy03LjEwOGEuNS41IDAgMCAwIC4xMTItLjExMmwxLjM0My0xLjM0M2EyLjMwOCAyLjMwOCAwIDAgMC0xLjYzMi0zLjk0TTE0LjEyMiA3bDEuMDQ0LTEuMDQ1YTEuMzA4IDEuMzA4IDAgMSAwLTEuODQ5LTEuODVMMTIuMjcxIDUuMTV6bS0yLjU1OC0xLjE0Mi02LjgwNyA2LjgwOWEuOC44IDAgMCAwLS4xOTYuMzI1bC0uNzUgMi40NjggMi40Ny0uNzQ5YS44LjggMCAwIDAgLjMyNS0uMTk0bDYuODA4LTYuODF6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTcuMzYyIDQuODczLTQuNTk0IDYuNjU0LTQuODUtMy4zMTctNC4yNTEgNi45NzctLjg1NC0uNTJMNy42MTIgNi43OWw0Ljg5OSAzLjM1IDQuMDI4LTUuODM2eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-line-style-dashed{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDR2MUgyem0xMiAwaDR2MWgtNHpNOCA5aDR2MUg4eiIvPjwvc3ZnPg==)}.ag-charts-icon-line-style-dotted{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48Y2lyY2xlIGN4PSIyLjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iNC41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSI4LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTAuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48Y2lyY2xlIGN4PSIxMi41IiBjeT0iOS41IiByPSIuNSIgZmlsbD0iIzAwMCIvPjxjaXJjbGUgY3g9IjE0LjUiIGN5PSI5LjUiIHI9Ii41IiBmaWxsPSIjMDAwIi8+PGNpcmNsZSBjeD0iMTYuNSIgY3k9IjkuNSIgcj0iLjUiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-line-style-solid{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMiA5aDE2djFIMnoiLz48L3N2Zz4=)}.ag-charts-icon-line-with-markers-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTk4IDQuODg4LTMuNTU2IDQuOTE4YTIuMjUgMi4yNSAwIDEgMS0zLjg2Ni43NWwtMS40MzItLjlhMi4yNCAyLjI0IDAgMCAxLTIuMDA5LjQzNWwtMy44MjggNi40MjgtLjg2LS41MTJMNi40NSA5LjYyM2EyLjI1IDIuMjUgMCAxIDEgMy41MS0uNzYxbDEuMzI5LjgzNWEyLjI0IDIuMjQgMCAwIDEgMi41NTctLjQ5N2wzLjU0Mi00Ljg5OHptLTQuOTYgNS4xNTNhMS4yNSAxLjI1IDAgMSAwLS42NCAyLjQxOSAxLjI1IDEuMjUgMCAwIDAgLjY0LTIuNDE5TTkuMSA4LjMyMXEuMDY2LS4xOTIuMDY3LS40MDRhMS4yNSAxLjI1IDAgMSAwLS4wNjcuNDA0IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-lock,.ag-charts-icon-locked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuMjA3IDMuNzY0YTIuODk0IDIuODk0IDAgMCAwLTIuODk1IDIuODk0VjloNS43ODlWNi42NThhMi44OTQgMi44OTQgMCAwIDAtMi44OTUtMi44OTRNMTQuMSA5VjYuNjU4YTMuODk0IDMuODk0IDAgMSAwLTcuNzg5IDB2Mi4zNDlBMi41IDIuNSAwIDAgMCA0IDExLjV2M0EyLjUgMi41IDAgMCAwIDYuNSAxN2g4YTIuNSAyLjUgMCAwIDAgMi41LTIuNXYtM0EyLjUgMi41IDAgMCAwIDE0LjUgOXpNNi41IDEwQTEuNSAxLjUgMCAwIDAgNSAxMS41djNBMS41IDEuNSAwIDAgMCA2LjUgMTZoOGExLjUgMS41IDAgMCAwIDEuNS0xLjV2LTNhMS41IDEuNSAwIDAgMC0xLjUtMS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-measurer-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsLXJ1bGU9ImV2ZW5vZGQiIGNsaXAtcnVsZT0iZXZlbm9kZCIgZD0ibTQuNDYxIDEyLjcxIDEuNTMyLTEuNTMxIDEuNDE0IDEuNDE0LjcwNy0uNzA3TDYuNyAxMC40NzJsMS41MzItMS41MzMgMiAyIC43MDctLjcwNy0yLTIgNi4wMS02LjAxIDIuODMgMi44MjhMNS4wNSAxNy43NzggMi4yMjIgMTQuOTVsMS41MzItMS41MzIgMS40MTQgMS40MTQuNzA3LS43MDd6TS44MDggMTQuOTVsLjcwNy0uNzA3TDE0LjI0MyAxLjUxNWwuNzA3LS43MDcuNzA3LjcwNyAyLjgyOCAyLjgyOC43MDcuNzA3LS43MDcuNzA3TDUuNzU3IDE4LjQ4NWwtLjcwNy43MDctLjcwNy0uNzA3LTIuODI4LTIuODI4em0xMS4wNzgtNi44MzVMMTAuNDcgNi43bC43MDctLjcwNyAxLjQxNSAxLjQxNHptLjgyNC0zLjY1NCAxIDEgLjcwOC0uNzA3LTEtMXoiIGZpbGw9IiMxODFEMUYiLz48L3N2Zz4=)}.ag-charts-icon-note-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMyA0LjVBMS41IDEuNSAwIDAgMSA0LjUgM2gxMUExLjUgMS41IDAgMCAxIDE3IDQuNXY4YTEuNSAxLjUgMCAwIDEtMS41IDEuNWgtMy4yMWwtMS40NjkgMi41N2ExIDEgMCAwIDEtMS42ODIuMDg1TDcuMjQzIDE0SDQuNUExLjUgMS41IDAgMCAxIDMgMTIuNXpNNC41IDRhLjUuNSAwIDAgMC0uNS41djhhLjUuNSAwIDAgMCAuNS41aDMuMjU3bDIuMTk2IDMuMDc0TDExLjcxIDEzaDMuNzlhLjUuNSAwIDAgMCAuNS0uNXYtOGEuNS41IDAgMCAwLS41LS41eiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNi41IDYuNUEuNS41IDAgMCAxIDcgNmg2YS41LjUgMCAwIDEgMCAxSDdhLjUuNSAwIDAgMS0uNS0uNU02LjUgOS41QS41LjUgMCAwIDEgNyA5aDZhLjUuNSAwIDAgMSAwIDFIN2EuNS41IDAgMCAxLS41LS41IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-ohlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZD0iTTEzIDExaC0zdi0xaDNWM2gxdjJoNHYxaC00djExaC0xek02IDE3di0yaDN2LTFINlY0SDV2MUgydjFoM3YxMXoiLz48L3N2Zz4=)}.ag-charts-icon-pan-end{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0ibTYuNjQ2IDEzLjgxMy0uMzUzLjM1NC43MDcuNzA3LjM1NC0uMzU0ek0xMS4xNjYgMTBsLjM1NC4zNTQuMzU0LS4zNTQtLjM1NC0uMzU0ek03LjM1NSA1LjQ4IDcgNS4xMjZsLS43MDcuNzA3LjM1My4zNTR6bTAgOS4wNCA0LjE2Ni00LjE2Ni0uNzA3LS43MDgtNC4xNjcgNC4xNjd6bTQuMTY2LTQuODc0TDcuMzU0IDUuNDhsLS43MDguNzA3IDQuMTY3IDQuMTY3ek0xMy4wODMgNXYxMGgxVjV6Ii8+PC9zdmc+)}.ag-charts-icon-pan-left{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuNzkgNS44MzMgOC42MjUgMTBsNC4xNjYgNC4xNjctLjcwNy43MDdMNy4yMSAxMGw0Ljg3My00Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNy4yMSAxNC4xNjcgMTEuMzc2IDEwIDcuMjEgNS44MzNsLjcwNy0uNzA3TDEyLjc5IDEwbC00Ljg3MyA0Ljg3NHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-pan-start{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgNXYxMGgxVjV6TTkuNjI0IDEwbDQuMTY2LTQuMTY3LS43MDctLjcwN0w4LjIxIDEwbDQuODc0IDQuODc0LjcwNy0uNzA3eiIvPjwvc3ZnPg==)}.ag-charts-icon-parallel-channel,.ag-charts-icon-parallel-channel-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTcuNzIgNS4zMzFBMi4yNSAyLjI1IDAgMSAwIDE0LjcwNSAzLjZsLTkuNDkgNC41NjJhMi4yNSAyLjI1IDAgMSAwIC4yMDkgMS4wMWw5LjY2Mi00LjY0NmEyLjI1IDIuMjUgMCAwIDAgMi42MzQuODA1bS4zNzMtMi41NDdhMS4yNSAxLjI1IDAgMSAxLTIuMzM4Ljg4NSAxLjI1IDEuMjUgMCAwIDEgMi4zMzgtLjg4NU00LjM0MyA4LjY3YTEuMjUgMS4yNSAwIDEgMS0yLjMzOC44ODUgMS4yNSAxLjI1IDAgMCAxIDIuMzM4LS44ODVNNS4zMDcgMTYuNzI4YTIuMjUgMi4yNSAwIDEgMS0uNTI1LS44NThsOS45MjMtNC43N2EyLjI1IDIuMjUgMCAxIDEgLjM4MS45MjZ6bS0uOTY0LjI3NGExLjI1IDEuMjUgMCAxIDEtMi4zMzguODg1IDEuMjUgMS4yNSAwIDAgMSAyLjMzOC0uODg1bTEzLjAyMy01LjEwNmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-position-bottom{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzem0zLTNoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTYgMTNoOHYxSDZ6Ii8+PC9zdmc+)}.ag-charts-icon-position-center{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBkPSJNMyAxMGgxNHYxSDN6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDdoOHYxSDZ6bTAgNmg4djFINnoiLz48L3N2Zz4=)}.ag-charts-icon-position-top{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBmaWxsPSIjMDAwIiBmaWxsLW9wYWNpdHk9Ii4yNSIgZD0iTTMgMTBoMTR2MUgzeiIvPjxwYXRoIGZpbGw9IiMwMDAiIGQ9Ik02IDdoOHYxSDZ6Ii8+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1vcGFjaXR5PSIuMjUiIGQ9Ik02IDEzaDh2MUg2eiIvPjwvc3ZnPg==)}.ag-charts-icon-price-label-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNC41IDNBMS41IDEuNSAwIDAgMCAzIDQuNVYxM2ExLjUgMS41IDAgMCAwIDEuNSAxLjVoLjgzM3YuMDU3Yy4yNDItLjI5OS41OTctLjUwMyAxLS41NDhWMTMuNUg0LjVBLjUuNSAwIDAgMSA0IDEzVjQuNWEuNS41IDAgMCAxIC41LS41aDExYS41LjUgMCAwIDEgLjUuNXY4YS41LjUgMCAwIDEtLjUuNWgtNC44MThsLS4xMjYuMDg0YTI2IDI2IDAgMCAwLTIuMjI1IDEuNjg1bC0uMzIuMjY1LS4wNjguMDU2YTEuNSAxLjUgMCAwIDEtMi42MDkgMS4zNTRjLjAzMy43NjMuOTA1IDEuMjM4IDEuNTYuNzU2LjY0Ni0uNDc0IDEuMjEtLjk0MyAxLjc2MS0xLjRsLjMxMy0uMjZBMjYgMjYgMCAwIDEgMTAuOTg2IDE0SDE1LjVhMS41IDEuNSAwIDAgMCAxLjUtMS41di04QTEuNSAxLjUgMCAwIDAgMTUuNSAzeiIgY2xpcC1ydWxlPSJldmVub2RkIi8+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNOC43MTYgMTQuODE1YTIuMjUgMi4yNSAwIDEgMS00LjIxIDEuNTkzIDIuMjUgMi4yNSAwIDAgMSA0LjIxLTEuNTkzbS0xLjY2MiAxLjk2NmExLjI1IDEuMjUgMCAxIDAtLjg4NS0yLjMzOSAxLjI1IDEuMjUgMCAwIDAgLjg4NSAyLjMzOSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-price-range-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS4wNDYgMTVWNS44NzdoLjk0MlYxNXoiIGZpbGw9IiMxODFEMUYiLz48cGF0aCBkPSJNOS41IDYuMjI4IDcuMTY3IDguMzc2IDYuNSA3Ljc2MiA5LjUgNWwzIDIuNzYyLS42NjcuNjE0eiIgZmlsbD0iIzAwMCIvPjxwYXRoIGQ9Ik0yIDE4di0xaDE2djF6TTIgM1YyaDE2djF6IiBmaWxsPSIjMTgxRDFGIi8+PC9zdmc+)}.ag-charts-icon-reset{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTIuMDQgNC40NDVhNS44MSA1LjgxIDAgMCAwLTcuMjU3IDIuNDUzLjUuNSAwIDAgMS0uODY1LS41MDJBNi44MSA2LjgxIDAgMSAxIDMgOS44MTNhLjUuNSAwIDAgMSAxIDAgNS44MSA1LjgxIDAgMSAwIDguMDQtNS4zNjgiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTQuMjg5IDMuMDAyYS41LjUgMCAwIDEgLjUuNXYyLjY1NWgyLjY1NWEuNS41IDAgMCAxIDAgMUg0LjI5YS41LjUgMCAwIDEtLjUtLjVWMy41MDJhLjUuNSAwIDAgMSAuNS0uNSIgY2xpcC1ydWxlPSJldmVub2RkIi8+PC9zdmc+)}.ag-charts-icon-settings{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgeG1sOnNwYWNlPSJwcmVzZXJ2ZSIgc3R5bGU9ImZpbGwtcnVsZTpldmVub2RkIj48cGF0aCBkPSJNMTAgMTNhMyAzIDAgMSAwIDAtNiAzIDMgMCAwIDAgMCA2bTAtMWEyIDIgMCAxIDEtLjAwMS0zLjk5OUEyIDIgMCAwIDEgMTAgMTIiLz48cGF0aCBkPSJNMi4zMSAxNC4zNDVjLS44MTctMS40OTEuMDI3LTIuNDk5LjQ3NC0yLjg2NS41MzEtLjQzNC45NjktLjM2NS45NzItMS40OC0uMDAzLTEuMTE1LS40NDEtMS4wNDYtLjk3Mi0xLjQ4MS0uNDU0LS4zNzEtMS4zMTctMS40MDUtLjQzNC0yLjkzNmwuMDA1LS4wMDljLjg4NC0xLjUyIDIuMjA3LTEuMjkgMi43NTUtMS4wODMuNjQxLjI0My44MDEuNjU2IDEuNzY4LjEwMS45NjQtLjU2LjY4Ni0uOTA0Ljc5Ni0xLjU4Mi4wOTQtLjU3OC41NTktMS44NDMgMi4zMjYtMS44NDNoLjAxYzEuNzU5LjAwNSAyLjIyMiAxLjI2NiAyLjMxNiAxLjg0My4xMS42NzgtLjE2OCAxLjAyMi43OTYgMS41ODIuOTY3LjU1NSAxLjEyNy4xNDIgMS43NjgtLjEwMS41NDktLjIwOCAxLjg3Ni0uNDM4IDIuNzYgMS4wOTJzLjAyIDIuNTY1LS40MzQgMi45MzZjLS41MzEuNDM1LS45NjkuMzY2LS45NzIgMS40ODEuMDAzIDEuMTE1LjQ0MSAxLjA0Ni45NzIgMS40OC40NTQuMzcyIDEuMzE3IDEuNDA2LjQzNCAyLjkzN2wtLjAwNS4wMDljLS44ODQgMS41Mi0yLjIwNyAxLjI5LTIuNzU1IDEuMDgzLS42NDEtLjI0My0uODAxLS42NTYtMS43NjgtLjEwMS0uOTY0LjU2LS42ODYuOTA0LS43OTYgMS41ODEtLjA5NC41NzktLjU1OSAxLjg0NC0yLjMyNiAxLjg0NGgtLjAxYy0xLjc1OS0uMDA1LTIuMjIyLTEuMjY2LTIuMzE2LTEuODQ0LS4xMS0uNjc3LjE2OC0xLjAyMS0uNzk2LTEuNTgxLS45NjctLjU1NS0xLjEyNy0uMTQyLTEuNzY4LjEwMS0uNTQ5LjIwOC0xLjg3Ni40MzgtMi43Ni0xLjA5MmwtLjAyLS4wMzZ6TTkuOTg0IDIuMTYySDEwYzEuMzU1IDAgMS4zNDIgMS4wMzkgMS4zNTMgMS40MjUuMDA4LjMxMi4wNCAxLjE2IDEuMjU5IDEuODcybC4wMTUuMDA4YzEuMjI1LjcgMS45NzYuMzA0IDIuMjUxLjE1NS4zMzctLjE4MyAxLjIyNi0uNzExIDEuOTAyLjQ0NWwuMDA4LjAxNGMuNjc4IDEuMTczLS4yMjkgMS42ODItLjU1OCAxLjg4NC0uMjY2LjE2My0uOTg0LjYxNS0uOTkxIDIuMDI3di4wMTZjLjAwNyAxLjQxMi43MjUgMS44NjQuOTkxIDIuMDI3LjMyOC4yMDEgMS4yMjkuNzA3LjU2NiAxLjg3bC0uMDA4LjAxNGMtLjY3NyAxLjE3NC0xLjU3MS42NDMtMS45MS40NTktLjI3NS0uMTQ5LTEuMDI2LS41NDUtMi4yNTEuMTU0bC0uMDE1LjAwOWMtMS4yMTkuNzEyLTEuMjUxIDEuNTYtMS4yNTkgMS44NzItLjAxMS4zODYuMDAyIDEuNDI1LTEuMzUzIDEuNDI1cy0xLjM0Mi0xLjAzOS0xLjM1My0xLjQyNWMtLjAwOC0uMzEyLS4wNC0xLjE2LTEuMjU5LTEuODcybC0uMDE1LS4wMDljLTEuMjI1LS42OTktMS45NzYtLjMwMy0yLjI1MS0uMTU0LS4zMzYuMTgzLTEuMjE5LjcwNi0xLjg5NC0uNDMybC0uMDE2LS4wMjdjLS42NzgtMS4xNzQuMjI5LTEuNjgyLjU1OC0xLjg4NC4yNjYtLjE2My45ODQtLjYxNS45OTEtMi4wMjd2LS4wMTZjLS4wMDctMS40MTItLjcyNS0xLjg2NC0uOTkxLTIuMDI3LS4zMjgtLjIwMS0xLjIyOS0uNzA3LS41NjYtMS44N2wuMDA4LS4wMTRjLjY3Ny0xLjE3NCAxLjU3MS0uNjQzIDEuOTEtLjQ1OS4yNzUuMTQ5IDEuMDI2LjU0NSAyLjI1MS0uMTU1bC4wMTUtLjAwOGMxLjIxOS0uNzEyIDEuMjUxLTEuNTYgMS4yNTktMS44NzIuMDEtLjM4NC0uMDAyLTEuNDE3IDEuMzM3LTEuNDI1Ii8+PC9zdmc+)}.ag-charts-icon-step-line-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzE4MUQxRiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNiA0aDV2OGgzVjhoNXYxaC00djRoLTVWNUg3djEwSDJ2LTFoNHoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-text-annotation{--icon: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjAiIGhlaWdodD0iMjAiIHZpZXdCb3g9IjAgMCAyMCAyMCIgZmlsbD0ibm9uZSIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4KPHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik00IDRIMTZWN0gxNVY1SDEwLjVWMTVIMTRWMTZINlYxNUg5LjVWNUg1VjdINFY0WiIgZmlsbD0iYmxhY2siLz4KPC9zdmc+Cg==)}.ag-charts-icon-trend-line,.ag-charts-icon-trend-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS4zMTQgMTAuOTM4YTIuMjUgMi4yNSAwIDEgMSAuMDEtMWg5LjM1MmEyLjI1IDIuMjUgMCAxIDEgLjAxIDF6bS0yLjE4OS43MjlhMS4yNSAxLjI1IDAgMSAwIDAtMi41IDEuMjUgMS4yNSAwIDAgMCAwIDIuNW0xMy43NSAwYTEuMjUgMS4yNSAwIDEgMCAwLTIuNSAxLjI1IDEuMjUgMCAwIDAgMCAyLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-unlock,.ag-charts-icon-unlocked{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNjUxIDMuNWEyLjg5NCAyLjg5NCAwIDAgMC0yLjg5NCAyLjg5NFY5SDE0LjVhMi41IDIuNSAwIDAgMSAyLjUgMi41djNhMi41IDIuNSAwIDAgMS0yLjUgMi41aC04QTIuNSAyLjUgMCAwIDEgNCAxNC41di0zQTIuNSAyLjUgMCAwIDEgNi41IDloLjI1N1Y2LjM5NGEzLjg5NCAzLjg5NCAwIDEgMSA3Ljc4OSAwIC41LjUgMCAwIDEtMSAwQTIuODk0IDIuODk0IDAgMCAwIDEwLjY1IDMuNU02LjUgMTBBMS41IDEuNSAwIDAgMCA1IDExLjV2M0ExLjUgMS41IDAgMCAwIDYuNSAxNmg4YTEuNSAxLjUgMCAwIDAgMS41LTEuNXYtM2ExLjUgMS41IDAgMCAwLTEuNS0xLjV6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-vertical-line,.ag-charts-icon-vertical-line-drawing{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNMTAuNSA3LjgwNmEyLjI1IDIuMjUgMCAwIDEgMCA0LjM4OFYxOS41aC0xdi03LjMwNmEyLjI1IDIuMjUgMCAwIDEgMC00LjM4OFYuNWgxem0tLjUuOTQ0YTEuMjUgMS4yNSAwIDEgMSAwIDIuNSAxLjI1IDEuMjUgMCAwIDEgMC0yLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-zoom-in{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZD0iTTEwIDUuNWEuNS41IDAgMCAxIC41LjV2My41aDMuODc1YS41LjUgMCAwIDEgMCAxSDEwLjV2NC4yNWEuNS41IDAgMSAxLTEgMFYxMC41SDUuNjI1YS41LjUgMCAxIDEgMC0xSDkuNVY2YS41LjUgMCAwIDEgLjUtLjUiLz48L3N2Zz4=)}.ag-charts-icon-zoom-out{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzAwMCIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNS41IDEwYS41LjUgMCAwIDEgLjUtLjVoOGEuNS41IDAgMCAxIDAgMUg2YS41LjUgMCAwIDEtLjUtLjUiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-high-low-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJNNyA0aDJ2MTJINFY0aDNNNSA1aDN2MTBINXpNMTEgMTRWNmg1djhoLTVtMS03aDN2NmgtM3oiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjwvc3ZnPg==)}.ag-charts-icon-hlc-series{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyMCIgaGVpZ2h0PSIyMCIgZmlsbD0ibm9uZSI+PHBhdGggZmlsbD0iIzEzMTcyMiIgZmlsbC1ydWxlPSJldmVub2RkIiBkPSJtMTguMTYzIDEuODM3LTUuMzM0IDExLjYyMUw2Ljk1NyA4LjEybC00LjE5OSA5LjYyMi0uOTE2LS40IDQuNzU2LTEwLjlMMTIuNDkgMTEuOCAxNy4yNTQgMS40MnoiIGNsaXAtcnVsZT0iZXZlbm9kZCIvPjxwYXRoIGZpbGw9IiMwMDAiIGZpbGwtb3BhY2l0eT0iLjQiIGZpbGwtcnVsZT0iZXZlbm9kZCIgZD0iTTUuODI1IDIuNzA0LjU1IDEzLjc4NWwuOTAyLjQzIDQuNzI0LTkuOTE5IDYuMDM0IDUuMDI5IDMuMjU1LTguMTQtLjkyOC0uMzctMi43NDUgNi44NnptNy44NTIgMTQuNjM2IDUuNzgtMTMuMTM5LS45MTUtLjQwMi01LjIxOSAxMS44Ni02LjAwNS01LjUwNC0zLjI3OCA3LjY0OC45Mi4zOTQgMi43MjItNi4zNTJ6IiBjbGlwLXJ1bGU9ImV2ZW5vZGQiLz48L3N2Zz4=)}.ag-charts-icon-chevron-right{--icon: url(data:image/svg+xml;base64,PHN2ZyB2aWV3Qm94PSIwIDAgMjAgMjAiIGZpbGw9Im5vbmUiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PHBhdGggZmlsbC1ydWxlPSJldmVub2RkIiBjbGlwLXJ1bGU9ImV2ZW5vZGQiIGQ9Ik03LjQ3IDUuNDdhLjc1Ljc1IDAgMCAxIDEuMDYgMGw0IDRhLjc1Ljc1IDAgMCAxIDAgMS4wNmwtNCA0YS43NS43NSAwIDAgMS0xLjA2LTEuMDZMMTAuOTQgMTAgNy40NyA2LjUzYS43NS43NSAwIDAgMSAwLTEuMDYiIGZpbGw9IiMwMDAiLz48L3N2Zz4=)}.ag-charts-icon-zoom-in-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20taW4iPjxjaXJjbGUgY3g9IjExIiBjeT0iMTEiIHI9IjgiLz48bGluZSB4MT0iMjEiIHgyPSIxNi42NSIgeTE9IjIxIiB5Mj0iMTYuNjUiLz48bGluZSB4MT0iMTEiIHgyPSIxMSIgeTE9IjgiIHkyPSIxNCIvPjxsaW5lIHgxPSI4IiB4Mj0iMTQiIHkxPSIxMSIgeTI9IjExIi8+PC9zdmc+)}.ag-charts-icon-zoom-out-alt{--icon: url(data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHdpZHRoPSIyNCIgaGVpZ2h0PSIyNCIgdmlld0JveD0iMCAwIDI0IDI0IiBmaWxsPSJub25lIiBzdHJva2U9ImN1cnJlbnRDb2xvciIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiIGNsYXNzPSJsdWNpZGUgbHVjaWRlLXpvb20tb3V0Ij48Y2lyY2xlIGN4PSIxMSIgY3k9IjExIiByPSI4Ii8+PGxpbmUgeDE9IjIxIiB4Mj0iMTYuNjUiIHkxPSIyMSIgeTI9IjE2LjY1Ii8+PGxpbmUgeDE9IjgiIHgyPSIxNCIgeTE9IjExIiB5Mj0iMTEiLz48L3N2Zz4=)}.ag-charts-input{--input-layer-active: 1;--input-layer-focus: 2;--input-padding: calc(var(--ag-charts-spacing) * 2);--input-padding-large: calc(var(--ag-charts-spacing) * 2.5);color:var(--ag-charts-input-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);transition-duration:.25s;transition-property:none;transition-timing-function:ease-out}.ag-charts-input:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--input-layer-focus)}.ag-charts-button{background:var(--ag-charts-button-background-color);border:var(--ag-charts-button-border);border-radius:var(--ag-charts-button-border-radius);color:var(--ag-charts-button-text-color);cursor:pointer;padding:var(--input-padding);transition-property:background,border-color}.ag-charts-button:hover{background:var(--ag-charts-focus-color)}.ag-charts-button:has(.ag-charts-icon){padding:2px}.ag-charts-checkbox{--checkbox-transition-duration: .1s;appearance:none;background:var(--ag-charts-checkbox-background-color);border-radius:calc(var(--ag-charts-border-radius) * 9);cursor:pointer;height:18px;margin:0;transition-duration:var(--checkbox-transition-duration);transition-property:margin;width:29px}.ag-charts-checkbox:before{display:block;background:var(--ag-charts-input-background-color);border-radius:calc(var(--ag-charts-border-radius) * 7);content:" ";height:14px;margin:2px;transition-duration:var(--checkbox-transition-duration);transition-property:margin;transition-timing-function:var(--ag-charts-input-transition-easing);width:14px}.ag-charts-checkbox:checked{background:var(--ag-charts-checkbox-checked-background-color)}.ag-charts-checkbox:checked:before{margin-left:13px}.ag-charts-select{background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);padding:3px 2px 4px;font-size:inherit}.ag-charts-textarea{--textarea-line-height: 1.38;background:var(--ag-charts-input-background-color);border:var(--ag-charts-input-border);border-radius:var(--ag-charts-input-border-radius);line-height:var(--textarea-line-height);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-large);padding:var(--input-padding-large) var(--input-padding)}.ag-charts-textarea::placeholder{color:var(--ag-charts-input-placeholder-text-color)}.ag-charts-proxy-container{pointer-events:none;position:absolute}.ag-charts-proxy-elem{-webkit-appearance:none;appearance:none;background:none;border:none;color:#0000;overflow:hidden;pointer-events:auto;position:absolute}.ag-charts-proxy-elem::-moz-range-thumb,.ag-charts-proxy-elem::-moz-range-track{opacity:0}.ag-charts-proxy-elem::-webkit-slider-runnable-track,.ag-charts-proxy-elem::-webkit-slider-thumb{opacity:0}.ag-charts-proxy-elem:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow)}.ag-charts-focus-indicator{position:absolute;display:block;pointer-events:none;user-select:none;-webkit-user-select:none;width:100%;height:100%}.ag-charts-focus-indicator>div{position:absolute;outline:solid 1px var(--ag-charts-chrome-background-color);box-shadow:var(--ag-charts-focus-shadow)}.ag-charts-focus-indicator>svg{width:100%;height:100%;fill:none;overflow:visible}.ag-charts-focus-svg-outer-path{stroke:var(--ag-charts-chrome-background-color);stroke-width:4px}.ag-charts-focus-svg-inner-path{stroke:var(--ag-charts-accent-color);stroke-width:2px}.ag-charts-overlay{color:#181d1f;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay{color:#fff}.ag-charts-overlay--loading{color:#8c8c8c}.ag-charts-overlay__loading-background{background:#fff;pointer-events:none}.ag-charts-overlay.ag-charts-dark-overlay .ag-charts-overlay__loading-background{background:#192232}.ag-charts-tooltip{--tooltip-arrow-size: 8px;--tooltip-row-spacing: 8px;--tooltip-column-spacing: 16px;position:fixed;inset:unset;margin:0;padding:0;overflow:visible;top:var(--top, 0px);left:var(--left, 0px);width:max-content;max-width:100%;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);color:var(--ag-charts-tooltip-text-color);background:var(--ag-charts-tooltip-background-color);border:var(--ag-charts-tooltip-border);border-radius:var(--ag-charts-tooltip-border-radius);box-shadow:var(--ag-charts-popup-shadow)}.ag-charts-tooltip--compact .ag-charts-tooltip-content{--tooltip-row-spacing: 2px;--tooltip-column-spacing: 8px;padding:3px 6px}.ag-charts-tooltip--arrow-top:before,.ag-charts-tooltip--arrow-right:before,.ag-charts-tooltip--arrow-bottom:before,.ag-charts-tooltip--arrow-left:before{content:"";position:absolute;display:block;width:var(--tooltip-arrow-size);height:var(--tooltip-arrow-size);border:inherit;border-bottom-color:transparent;border-right-color:transparent;background:inherit;clip-path:polygon(0 0,100% 0,100% 1px,1px 100%,0 100%)}.ag-charts-tooltip--arrow-top:before{bottom:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * .5)) rotate(45deg)}.ag-charts-tooltip--arrow-bottom:before{top:100%;left:50%;transform:translate(-50%) translateY(calc(var(--tooltip-arrow-size) * -.5)) rotate(225deg)}.ag-charts-tooltip--arrow-left:before{right:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * .5)) rotate(315deg)}.ag-charts-tooltip--arrow-right:before{left:100%;top:50%;transform:translateY(-50%) translate(calc(var(--tooltip-arrow-size) * -.5)) rotate(135deg)}.ag-charts-tooltip--no-interaction{pointer-events:none;user-select:none;-webkit-user-select:none}.ag-charts-tooltip--wrap-always{overflow-wrap:break-word;word-break:break-word;hyphens:none}.ag-charts-tooltip--wrap-hyphenate{overflow-wrap:break-word;word-break:break-word;hyphens:auto}.ag-charts-tooltip--wrap-on-space{overflow-wrap:normal;word-break:normal}.ag-charts-tooltip--wrap-never{white-space:nowrap}.ag-charts-tooltip-heading,.ag-charts-tooltip-title,.ag-charts-tooltip-label,.ag-charts-tooltip-value{overflow:hidden;text-overflow:ellipsis}.ag-charts-tooltip-content{display:grid;grid:auto-flow minmax(1em,auto) / 1fr;padding:8px 12px;gap:var(--tooltip-row-spacing)}.ag-charts-tooltip-content:has(.ag-charts-tooltip-symbol){grid:auto-flow minmax(1em,auto) / auto 1fr}.ag-charts-tooltip-heading{grid-column:1 / -1}.ag-charts-tooltip-symbol{grid-column:1 / 2;place-self:center}.ag-charts-tooltip-symbol svg{display:block}.ag-charts-tooltip-title{grid-column:-2 / -1}.ag-charts-tooltip-row{grid-column:1 / -1;display:flex;gap:var(--tooltip-column-spacing);align-items:baseline;justify-content:space-between;overflow:hidden}.ag-charts-tooltip-row--inline{grid-column:-2 / -1}.ag-charts-tooltip-label{flex:1;min-width:0}.ag-charts-tooltip-value{min-width:0}.ag-charts-tooltip-footer{grid-column:1 / -1;color:var(--ag-charts-tooltip-subtle-text-color);text-align:center}.ag-charts-popover{position:absolute;border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);background:var(--ag-charts-panel-background-color);color:var(--ag-charts-chrome-text-color);font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size);font-weight:var(--ag-charts-chrome-font-weight);box-shadow:var(--ag-charts-popup-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-menu-text-color);display:grid;grid:auto-flow auto / 1fr;column-gap:12px;font-size:var(--ag-charts-chrome-font-size)}.ag-charts-menu:has(.ag-charts-menu__icon,.ag-charts-menu__row--stroke-width-visible){grid:auto-flow auto / auto 1fr}.ag-charts-menu__row--stroke-width-visible:before{content:"";height:var(--strokeWidth);width:12px;background:var(--icon-color)}.ag-charts-menu__row--stroke-width-visible[aria-disabled=true]:before{filter:grayscale(1);opacity:.5}.ag-charts-menu__row{display:grid;grid-column:1 / -1;grid-template-columns:subgrid;align-items:center;padding:var(--item-padding)}.ag-charts-menu__row:not(.ag-charts-menu__row--active){cursor:pointer}.ag-charts-menu__row:first-child{border-top-left-radius:inherit;border-top-right-radius:inherit}.ag-charts-menu__row:last-child{border-bottom-left-radius:inherit;border-bottom-right-radius:inherit}.ag-charts-menu__row:focus{background:var(--ag-charts-focus-color)}.ag-charts-menu__row:focus-visible{outline:var(--ag-charts-focus-border);box-shadow:var(--ag-charts-focus-border-shadow);z-index:var(--ag-charts-layer-menu)}.ag-charts-menu__row--active{--icon-color: var(--ag-charts-accent-color);background:var(--ag-charts-focus-color);color:var(--ag-charts-accent-color)}.ag-charts-menu__label{grid-column:-1 / span 1}.ag-charts-toolbar{--toolbar-gap: calc(var(--ag-charts-spacing) * 2);--toolbar-size: 34px;--toolbar-button-padding: 6px;align-items:center;display:flex;flex-wrap:nowrap;position:absolute}.ag-charts-toolbar__button{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-button-border);color:var(--ag-charts-button-text-color);cursor:pointer;display:flex;font-family:var(--ag-charts-chrome-font-family);font-size:var(--ag-charts-chrome-font-size-medium);font-weight:var(--ag-charts-chrome-font-weight);justify-content:center;min-height:var(--toolbar-size);min-width:var(--toolbar-size);padding:var(--toolbar-button-padding);position:relative;transition:background-color .25s ease-in-out,border-color .25s ease-in-out,color .25s ease-in-out;white-space:nowrap}.ag-charts-toolbar__button:hover{background:var(--ag-charts-focus-color);z-index:1}.ag-charts-toolbar__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-toolbar__button--active{background:var(--ag-charts-focus-color);border-color:var(--ag-charts-accent-color);color:var(--ag-charts-accent-color);z-index:2}.ag-charts-toolbar__button[aria-disabled=true]{background:var(--ag-charts-button-disabled-background-color);color:var(--ag-charts-button-disabled-text-color);cursor:default}.ag-charts-toolbar--horizontal{flex-direction:row;.ag-charts-toolbar__button{margin:0 0 0 -1px}.ag-charts-toolbar__button--first{border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-right-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar--vertical{flex-direction:column;.ag-charts-toolbar__button{margin:-1px 0 0;max-width:100%}.ag-charts-toolbar__button--first{border-top-left-radius:var(--ag-charts-border-radius);border-top-right-radius:var(--ag-charts-border-radius);margin:0}.ag-charts-toolbar__button--last{border-bottom-left-radius:var(--ag-charts-border-radius);border-bottom-right-radius:var(--ag-charts-border-radius)}}.ag-charts-toolbar__icon+.ag-charts-toolbar__label{margin-left:var(--toolbar-gap)}.ag-charts-toolbar__icon,.ag-charts-toolbar__label{pointer-events:none}.ag-charts-floating-toolbar{border:none;display:flex;.ag-charts-toolbar{align-items:unset;position:unset}}.ag-charts-floating-toolbar__drag-handle{align-items:center;background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-bottom-left-radius:var(--ag-charts-border-radius);border-top-left-radius:var(--ag-charts-border-radius);cursor:grab;display:flex;justify-content:center;min-width:24px;padding-left:0;padding-right:0}.ag-charts-floating-toolbar__drag-handle--dragging{cursor:grabbing}
`,LC=(T(),N(w)),Fp=class{constructor(){this.cleanup=new LC.CleanupRegistry,this.destroyed=!1}destroy(){this.cleanup.flush(),this.destroyed=!0}},_o=(T(),N(w)),kC=class Dd{constructor(t,i,s){this.element=t,this.topTabGuard=i,this.bottomTabGuard=s,this.cleanup=new _o.CleanupRegistry,this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,!1),this.initTabGuard(this.bottomTabGuard,!0),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(t){this.guardTabIndex=t,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){this.cleanup.flush()}initTabGuard(t,i){this.cleanup.register((0,_o.attachListener)(t,"focus",()=>this.onTab(t,i)))}setGuardIndices(t){const i=t;(0,_o.setAttribute)(this.topTabGuard,"tabindex",i),(0,_o.setAttribute)(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:t}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&t!==i&&t!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(t,i){if(this.guardTabIndex!==0){let s;t.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(t,i){const s=(0,_o.getWindow)();return Array.from(t.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const r=s.getComputedStyle(n);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(t){const i=Dd.queryFocusable(this.element,'[tabindex="0"]'),s=t?i.length-1:0;return i[s]}findExitTarget(t){const i=Dd.queryFocusable((0,_o.getDocument)(),"[tabindex]").filter(r=>r.tabIndex>0).sort((r,o)=>r.tabIndex-o.tabIndex),{before:s,after:n}=Dd.findBeforeAndAfter(i,this.guardTabIndex);return t?s:n}static findBeforeAndAfter(t,i){let s=0,n=t.length-1,r,o;for(;s<=n;){const a=Math.floor((s+n)/2),l=t[a].tabIndex;if(l===i){r=t[a-1]||void 0,o=t[a+1]||void 0;break}else l<i?(r=t[a],s=a+1):(o=t[a],n=a-1)}return{before:r,after:o}}},Ct=(T(),N(w));function Dh(e,t,i=["Escape"]){return(0,Ct.attachListener)(e,"keydown",s=>{Ih(s,...i)&&t(s)})}function Bp(e,t){const i=(0,Ct.attachListener)((0,Ct.getWindow)(),"mousedown",s=>{[0,2].includes(s.button)&&!M0(e,s)&&(t(),i())});return i}function Vp(e,t){const i=(0,Ct.attachListener)((0,Ct.getWindow)(),"touchstart",s=>{Array.from(s.targetTouches).some(r=>!M0(e,r))&&(t(),i())});return i}function M0(e,t){return t.target instanceof Node&&e.contains(t.target)}function Gp(e,t,i){const s=n=>{for(const r of t)(0,Ct.setAttribute)(r,"data-focus-visible-override",n)};return s(i),(0,Ct.attachListener)(e,"keydown",()=>s(!0),{once:!0})}function rl(e){return!(e.shiftKey||e.altKey||e.ctrlKey||e.metaKey)}function Ih(e,...t){return rl(e)&&t.some(i=>e.key===i)}function S0(e,t,i){return(0,Ct.attachListener)(e,"keydown",s=>{Ih(s,i)&&t.focus()})}var jo={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function D0(e){const{orientation:t,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:r,onBlur:o}=e,{nextKey:a,prevKey:l}=jo[t],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(g=>g.tabIndex=-1),p.target.tabIndex=0)},[h,u]=s?[i.length,i.length]:[0,1/0],d=new Ct.CleanupRegistry;for(let p=0;p<i.length;p++){const g=i[(h+p-1)%u],y=i[p],b=i[(h+p+1)%u];d.register((0,Ct.attachListener)(y,"focus",c),r&&(0,Ct.attachListener)(y,"focus",r),o&&(0,Ct.attachListener)(y,"blur",o),n&&Dh(y,n),g&&S0(y,g,l),b&&S0(y,b,a),(0,Ct.attachListener)(y,"keydown",m=>{Ih(m,a,l)&&m.preventDefault()})),y.tabIndex=p===0?0:-1}return d}var CC=class{constructor(e,t,i){this.lastFocus=t,this.closeCallback=i,this.cleanup=new Ct.CleanupRegistry,this.cleanup.register(Bp(e,()=>this.close(!0)),Vp(e,()=>this.close(!0)))}close(e){this.cleanup.flush(),this.closeCallback(),this.finishClosing(e)}finishClosing(e){this.cleanup.flush(),(0,Ct.setAttribute)(this.lastFocus,"aria-expanded",!1),e||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function I0(e){const{sourceEvent:t,orientation:i,menu:s,buttons:n,closeCallback:r,overrideFocusVisible:o}=e,{nextKey:a,prevKey:l}=jo[i],c=Lh(t);(0,Ct.setAttribute)(c,"aria-expanded",!0);const h=new CC(s,c,r),u=()=>h.close(),{cleanup:d}=h;return s.role="menu",s.ariaOrientation=i,d.merge(D0({orientation:i,buttons:n,onEscape:u,wrapAround:!0})),s.tabIndex=-1,d.register(Dh(s,u),(0,Ct.attachListener)(s,"keydown",p=>{p.target===s&&(p.key===a||p.key===l)&&(p.preventDefault(),n[0]?.focus())})),n[0]?.focus({preventScroll:!0}),o!==void 0&&d.register(Gp(s,n,o)),h}function wC(e,t){return i=>{if(e.ariaDisabled==="true")return i.preventDefault();t(i)}}function Ah(e){return"button"in e?e.button===0:rl(e)&&(e.code==="Space"||e.key==="Enter")}function Lh(e){if(e?.target instanceof HTMLElement&&"tabindex"in e.target.attributes)return e.target}function A0(e){return(0,Ct.attachListener)(e,"keydown",t=>{if(t.defaultPrevented)return;(0,Ct.getAttribute)(t.target,"data-preventdefault",!0)&&Ih(t,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&t.preventDefault()})}var Hp=(T(),N(w)),Up=(T(),N(w)),NC=class{constructor(e){this.callback=e,this.devicePixelRatio=(0,Up.getWindow)("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=t=>{t.matches||(this.devicePixelRatio=(0,Up.getWindow)("devicePixelRatio")??1,this.unregisterDevicePixelRatioListener(),this.registerDevicePixelRatioListener(),this.callback(this.pixelRatio))}}get pixelRatio(){return this.devicePixelRatio}observe(){this.registerDevicePixelRatioListener()}disconnect(){this.unregisterDevicePixelRatioListener()}unregisterDevicePixelRatioListener(){this.devicePixelRatioMediaQuery?.removeEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=void 0}registerDevicePixelRatioListener(){const e=(0,Up.getWindow)("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);e?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=e}},L0=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([t,i])=>this.observe(t,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(t=>{for(const{target:i,contentRect:{width:s,height:n}}of t){const r=this.elements.get(i);this.checkSize(r,i,s,n)}}));let e;this.pixelRatioObserver=new NC(()=>{clearTimeout(e),e=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=(0,Hp.getDocument)("readyState")==="complete",this.documentReady?this.observeWindow():(0,Hp.getWindow)()?.addEventListener("load",this.onLoad)}destroy(){(0,Hp.getWindow)()?.removeEventListener("load",this.onLoad),this.resizeObserver?.disconnect(),this.resizeObserver=void 0,this.pixelRatioObserver?.disconnect(),this.pixelRatioObserver=void 0}observeWindow(){this.pixelRatioObserver?.observe()}checkPixelRatio(){const e=this.pixelRatioObserver?.pixelRatio??1;for(const[t,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==e){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:e},i.cb(i.size,t)}}checkSize(e,t,i,s){if(e&&(i!==e.size?.width||s!==e.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;e.size={width:i,height:s,pixelRatio:n},e.cb(e.size,t)}}observe(e,t){if(!this.documentReady){this.queuedObserveRequests.push([e,t]);return}this.elements.has(e)?this.removeFromQueue(e):this.resizeObserver?.observe(e);const i={cb:t};this.elements.set(e,i)}unobserve(e){this.resizeObserver?.unobserve(e),this.elements.delete(e),this.removeFromQueue(e),this.elements.size||this.destroy()}removeFromQueue(e){this.queuedObserveRequests=this.queuedObserveRequests.filter(([t])=>t!==e)}},zo=class extends Map{constructor(e,t){super(),this.defaultValue=e,this.defaultState=t}set(e,t){return this.delete(e),typeof t<"u"&&super.set(e,t),delete this.cachedState,delete this.cachedValue,this}stateId(){return this.cachedState??(this.cachedState=Array.from(this.keys()).pop()??this.defaultState),this.cachedState}stateValue(){return this.cachedValue??(this.cachedValue=Array.from(this.values()).pop()??this.defaultValue),this.cachedValue}},TC='<div role="presentation" class="ag-charts-wrapper ag-charts-styles" data-ag-charts><div role="presentation" class="ag-charts-canvas-center"><div role="presentation" class="ag-charts-canvas-container"><div role="presentation" class="ag-charts-canvas" aria-hidden="true"></div><div role="figure" class="ag-charts-canvas-proxy"><div role="presentation" class="ag-charts-series-area"></div></div><div role="presentation" class="ag-charts-canvas-overlay ag-charts-tooltip-container"></div></div></div></div>',OC=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],EC=new Set(["canvas-container","canvas","tooltip-container"]),k0={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},PC=new Map([["styles",{childElementType:"style"}],["canvas",{childElementType:"canvas"}],["canvas-proxy",{childElementType:"div"}],["canvas-overlay",{childElementType:"div"}],["canvas-center",{childElementType:"div"}],["series-area",{childElementType:"div"}],["tooltip-container",{childElementType:"div"}]]);function RC(e,t){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===e&&t(n.intersectionRatio)},{root:e});return i.observe(e),i}var C0={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return C0}};function w0(e,t){const i=(0,Ut.createElement)("div");return i.className="ag-charts-tab-guard",e.insertAdjacentElement(t,i),i}var Wp=class go extends Fp{constructor(t,i,s,n,r="normal"){super(),this.eventsHub=t,this.chart=i,this.styleContainer=n,this.mode=r,this.anchorName=`--${(0,Ut.createId)(this)}`,this.styles=new Map,this.pendingContainer=void 0,this.container=void 0,this.documentRoot=void 0,this.initiallyConnected=void 0,this.containerSize=void 0,this.sizeMonitor=new L0,this.cursorState=new zo("default"),this.minWidth=0,this.minHeight=0,this.element=this.initDOM(),this.rootElements=this.initRootElements(),this.rootElements.canvas.element.style.setProperty("anchor-name",this.anchorName);let o=!1;if(this.observer=RC(this.element,a=>{a===0&&!o&&this.eventsHub.emit("dom:hidden",null),o=a===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",AC),this.setContainer(s),this.cleanup.register(A0(this.element)),this.mode==="normal"){const a=this.rootElements["canvas-center"].element;if(a==null)throw new Error("Error initializing tab guards");const l=w0(a,"beforebegin"),c=w0(a,"afterend");this.tabGuards=new kC(a,l,c)}}initDOM(){if(this.mode==="normal"){const s=(0,Ut.createElement)("div");return s.innerHTML=TC,s.firstChild}const t=(0,Ut.createElement)("div");t.role="presentation",t.dataset.agCharts="",t.classList.add("ag-charts-wrapper");const i=(0,Ut.createElement)("div");return t.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),t}initRootElements(){const{mode:t,element:i}=this,s={};for(const n of OC){const r=`ag-charts-${n}`;let o;if(t==="normal"?o=i.classList.contains(r)?i:i.getElementsByClassName(r)[0]:EC.has(n)?o=i:o=i.getElementsByClassName(r)[0]??(0,Ut.createElement)("div"),o==null)throw new Error(`AG Charts - unable to find DOM element ${r}`);s[n]={element:o,children:new Map,listeners:[]}}return s}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(t=>{t.children.forEach(i=>i.remove()),t.element.remove()}),this.element.remove()}postRenderUpdate(){this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(go.batchedUpdateContainer.length===0&&(0,Ut.getWindow)().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),go.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const t of go.batchedUpdateContainer)t.destroyed||t.updateContainer();go.batchedUpdateContainer.splice(0)}setSizeOptions(t=300,i=300,s,n){const{style:r}=this.element;r.width=`${s??t}px`,r.height=`${n??i}px`,this.minWidth=s??t,this.minHeight=n??i,this.updateContainerClassName()}updateContainerSize(){const{style:t}=this.rootElements["canvas-center"].element;t.visibility=this.containerSize==null?"hidden":"",this.containerSize?(t.width=`${this.containerSize.width??0}px`,t.height=`${this.containerSize.height??0}px`):(t.width="",t.height=""),this.updateContainerClassName()}setTabGuardIndex(t){this.tabGuards&&(this.tabGuards.tabIndex=t)}setContainer(t){t!==this.container&&(this.pendingContainer=t,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:t}=this;if(!(t==null||t===this.container)){if(this.container&&(this.container.removeChild(this.element),this.sizeMonitor.unobserve(this.container)),this.documentRoot!=null)for(const i of this.rootElements.styles.children.keys())this.removeChild("styles",i);this.container=t,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(t),this.initiallyConnected=this.mode==="minimal"||t.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);t.appendChild(this.element),this.sizeMonitor.observe(t,i=>{this.containerSize=i,this.updateContainerSize(),this.eventsHub.emit("dom:resize",null)}),this.eventsHub.emit("dom:container-change",null)}}setThemeClass(t){const i="ag-charts-theme-";this.element.classList.forEach(s=>{s.startsWith(i)&&s!==t&&this.element.classList.remove(s)}),this.element.classList.add(t)}setThemeParameters(t){for(const[i,s]of(0,Ut.entries)(t)){let n=`${s}`;i.endsWith("Size")||i.endsWith("Radius")?n=`${s}px`:i.endsWith("Border")&&typeof s=="boolean"&&(n=s?"var(--ag-charts-border)":"none"),this.element.style.setProperty(`--ag-charts-${(0,Ut.kebabCase)(i)}`,n)}}updateCanvasLabel(t){(0,Ut.setAttribute)(this.rootElements["canvas-proxy"].element,"aria-label",t)}getEventElement(t,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:t}addEventListener(t,i,s){const n=this.getEventElement(this.element,t);return(0,Ut.attachListener)(n,t,i,s)}removeEventListener(t,i,s){this.getEventElement(this.element,t).removeEventListener(t,i,s)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const t=(0,Ut.getWindow)(),i=new W(0,0,t.innerWidth,t.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??C0}getRawOverlayClientRect(){let t=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;t!=null;){let r;if(i!=null&&t===i)r=!0;else{const a=t.computedStyleMap?.()?.get("overflow-y")?.toString();r=a==="auto"||a==="scroll"}if(r)return W.fromDOMRect(t.getBoundingClientRect());t=t.parentElement}if(this.documentRoot!=null)return W.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=(0,Ut.getWindow)();return new W(0,0,s,n)}getShadowDocumentRoot(t=this.container){const i=t?.ownerDocument?.body??(0,Ut.getDocument)("body");for(;t!=null;){if(t===i)return;if(t.parentNode instanceof DocumentFragment)return t;t=t.parentNode}}getParent(t){return this.rootElements[t].element}getChildBoundingClientRect(t){const{children:i}=this.rootElements[t],s=[];for(const n of i.values())s.push(W.fromDOMRect(n.getBoundingClientRect()));return W.merge(s)}isManagedChildDOMElement(t,i,s){const{children:n}=this.rootElements[i],r=n?.get(s);return r!=null&&t.contains(r)}contains(t,i){return i==null?this.element.contains(t):this.rootElements[i].element.contains(t)}addStyles(t,i){const s="data-ag-charts";if(this.styles.set(t,i),this.container==null)return;const n=a=>a.getAttribute(s)===t,r=a=>{const l=new Set(["TITLE","META"]);let c=!0,h;for(const d of a.children){if(c&&l.has(d.tagName)){h=d;continue}if(c=!1,n(d))return;d.hasAttribute(s)&&(h=d)}const u=(0,Ut.createElement)("style");return this.chart.styleNonce!=null&&(u.nonce=this.chart.styleNonce),h==null?a.prepend(u):a.insertBefore(u,h.nextSibling),u};let o;this.styleContainer?o=r(this.styleContainer):this.initiallyConnected===!1?o=this.addChild("styles",t):this.documentRoot==null&&!go.headStyles.has(t)?(o=r((0,Ut.getDocument)("head")),go.headStyles.add(t)):this.documentRoot!=null&&(o=this.addChild("styles",t)),!(o==null||n(o))&&(o.setAttribute(s,t),o.innerHTML=i)}removeStyles(t){this.removeChild("styles",t)}updateCursor(t,i){this.cursorState.set(t,i),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(t,i,s,n){const{element:r,children:o,listeners:a}=this.rootElements[t];if(!o)throw new Error("AG Charts - unable to create DOM elements after destroy()");if(o.has(i))return o.get(i);const{childElementType:l="div"}=PC.get(t)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??(0,Ut.createElement)(l);for(const[h,u,d]of a)c.addEventListener(h,u,d);if(o.set(i,c),l==="style"&&this.chart.styleNonce!=null&&(c.nonce=this.chart.styleNonce),n){const h=r.querySelector(n.query);if(h==null)throw new Error(`AG Charts - addChild query failed ${n.query}`);h.insertAdjacentElement(n.where,c)}else r?.appendChild(c);return c}removeChild(t,i){const{children:s}=this.rootElements[t];s&&(s.get(i)?.remove(),s.delete(i))}incrementDataCounter(t){const{dataset:i}=this.element;i[t]??(i[t]="0"),i[t]=String(Number(i[t])+1)}setDataBoolean(t,i){this.element.dataset[t]=String(i)}updateContainerClassName(){const{element:t,containerSize:i,minWidth:s,minHeight:n}=this;t.classList.toggle(k0.safeHorizontal,s>=(i?.width??1/0)),t.classList.toggle(k0.safeVertical,n>=(i?.height??1/0))}};Wp.batchedUpdateContainer=[],Wp.headStyles=new Set;var N0=Wp,$p=(T(),N(w)),Yp=(T(),N(w)),_C=class extends Ls{constructor(){super((0,Yp.createElement)("div")),this.textElement=(0,Yp.createSvgElement)("text"),this.textElement.role="presentation",this.svgElement=(0,Yp.createSvgElement)("svg"),this.svgElement.appendChild(this.textElement),this.svgElement.style.width="100%",this.svgElement.style.opacity="0",this.svgElement.role="presentation",this.elem.appendChild(this.svgElement),this.elem.role="presentation"}set textContent(e){this.textElement.textContent=e;const i=this.textElement.getBBox?.();i&&this.svgElement.setAttribute("viewBox",`${i.x} ${i.y} ${i.width} ${i.height}`)}get textContent(){return this.textElement.textContent}destructor(){}},jC=(T(),N(w)),T0=(T(),N(w)),O0=class extends Ls{constructor(e,t){super(e),(0,T0.setAttribute)(this.elem,"role",t),this.setEnabled(!0),this.addListener("keydown",({sourceEvent:i})=>{Ah(i)&&(i.preventDefault(),this.htmlListener?.dispatch("click",this,{type:"click",device:"keyboard",sourceEvent:i}))})}destructor(){}setEnabled(e){(0,T0.setAttribute)(this.elem,"aria-disabled",!e)}addListener(e,t){return super.addListener(e,(i,s)=>{(e==="click"||e==="dblclick")&&this.isDisabled()||t(i,s)})}},ol=class extends O0{constructor(){super((0,jC.createElement)("button"))}},E0=(T(),N(w)),zC=class extends Ls{constructor(){super((0,E0.createElement)("div")),(0,E0.setAttribute)(this.elem,"role","group")}destructor(){}},Kp=(T(),N(w)),kh=(T(),N(w)),Zp=class extends Ls{constructor(e,t){super((0,kh.createElement)("div")),this.focusedChildIndex=0,this.onChildFocus=(i,s)=>{const n=this.children[this.focusedChildIndex];this.focusedChildIndex=s.index,n?.setTabIndex(-1),s.setTabIndex(0)},this.onChildKeyDown=(i,s)=>{const n=this.orientation,[r,o]=n==="both"?[jo.horizontal,jo.vertical]:[jo[n],void 0];let a=-1;if(rl(i.sourceEvent)){const l=i.sourceEvent.key;l===r.nextKey||l===o?.nextKey?a=s.index+1:(l===r.prevKey||l===o?.prevKey)&&(a=s.index-1)}this.children[a]?.focus()},(0,kh.setAttribute)(this.elem,"role",t),this.orientation=e}get orientation(){return(0,kh.getAttribute)(this.elem,"aria-orientation")??"both"}set orientation(e){(0,kh.setAttribute)(this.elem,"aria-orientation",e!=="both"?e:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}clear(){this.focusedChildIndex=0;for(const e of this.children)this.removeChildListeners(e),e.parent=void 0;this.elem.textContent="",this.children.length=0}addChildListeners(e){e.addListener("focus",this.onChildFocus),e.addListener("keydown",this.onChildKeyDown)}removeChildListeners(e){e.removeListener("focus",this.onChildFocus),e.removeListener("keydown",this.onChildKeyDown)}onChildAdded(e){this.addChildListeners(e),e.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(e){this.removeChildListeners(e);const{focusedChildIndex:t,children:i}=this,s=t===e.index;for(let n=0;n<i.length;n++){const r=i[n];r.index===t&&(this.focusedChildIndex=n),r.index=n}if(s){const n=i[t]??i[t-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},FC=class extends Zp{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(e=>e.getElement().parentElement.remove())}addChildToDOM(e,t){const i=(0,Kp.createElement)("div");(0,Kp.setAttribute)(i,"role","listitem"),(0,Kp.setElementStyle)(i,"position","absolute"),Ls.setElementContainer(e,i),this.appendOrInsert(i,t),this.setHidden(!1)}removeChildFromDOM(e){e.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(e){this.children.length===0&&(e=!0),super.setHidden(e)}},Fo=class extends Ls{constructor(e){super(e)}destructor(){}},Ch=(T(),N(w)),BC=new Intl.NumberFormat("en-US",{style:"percent"});function _n(e,t=2){return typeof e=="number"?_0(e,t):typeof e=="string"?e:String(e??"")}function P0(e){return BC.format(e)}var R0=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function _0(e,t){let i=R0.get(t);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:t,useGrouping:!1}),R0.set(t,i)),i.format(e)}var Xp=class Pc extends Ls{constructor(){super((0,Ch.createElement)("input")),this._step=Pc.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(t){this._step=t,this.getElement().step=t.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(t){if(t!==this._keyboardStep?.step&&(this._keyboardStep!==void 0&&(this.removeListener("keydown",this._keyboardStep.onKeyDown),this.removeListener("keyup",this._keyboardStep.onKeyUp),this.removeListener("blur",this._keyboardStep.onBlur),this._keyboardStep=void 0),t!==void 0)){const i=()=>this.getElement().step=t.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:t,onKeyDown:i,onKeyUp:s,onBlur:s},this.addListener("keydown",this._keyboardStep.onKeyDown),this.addListener("keyup",this._keyboardStep.onKeyUp),this.addListener("blur",this._keyboardStep.onBlur)}}get orientation(){return(0,Ch.getAttribute)(this.elem,"aria-orientation")??"both"}set orientation(t){(0,Ch.setAttribute)(this.elem,"aria-orientation",t!=="both"?t:void 0),Pc.registerDefaultPreventers(this,t)}destructor(){}clampValueRatio(t,i){const s=this.getValueRatio(),n=(0,Ch.clamp)(t,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(t,i){const{divider:s}=this.step,n=Math.round(t*1e4)/s,{ariaValueText:r=P0(n/s)}=i??{},o=this.getElement();o.value=`${n}`,o.ariaValueText=r}getValueRatio(){return this.getElement().valueAsNumber/this.step.divider}static registerDefaultPreventers(t,i){i==="both"?t.removeListener("keydown",Pc.onKeyDown):t.addListener("keydown",Pc.onKeyDown)}static onKeyDown(t,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(t.sourceEvent.code)&&t.sourceEvent.preventDefault()}};Xp.STEP_ONE={attributeValue:"1",divider:1},Xp.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var qp=Xp,j0=(T(),N(w)),VC=class extends ol{constructor(){super(),(0,j0.setAttribute)(this.elem,"role","switch"),this.setChecked(!1)}setChecked(e){(0,j0.setAttribute)(this.elem,"aria-checked",e)}},wh=class extends Zp{constructor(e="horizontal"){super(e,"toolbar")}destructor(){}};function Bo(e,t){return t.params?.type===e}function GC(e){if(e==="button")return new ol;if(e==="slider")return new qp;if(e==="toolbar")return new wh;if(e==="group")return new zC;if(e==="list")return new FC;if(e==="region")return new Fo((0,$p.createElement)("div"));if(e==="text")return new _C;if(e==="listswitch")return new VC;throw Error("AG Charts - error allocating meta")}function z0(e){const t={params:e,result:void 0};return t.result=GC(t.params.type),t}var F0=class{constructor(e,t,i){this.eventsHub=e,this.localeManager=t,this.domManager=i,this.cleanup=new $p.CleanupRegistry}destroy(){this.cleanup.flush()}addLocalisation(e){e(),this.cleanup.register(this.eventsHub.on("locale:change",e))}createProxyContainer(e){const t=z0(e),{params:i,result:s}=t,n=s.getElement();return this.domManager.addChild("canvas-proxy",i.domManagerId,n),n.classList.add(...i.classList,"ag-charts-proxy-container"),n.role=i.type,"ariaOrientation"in i&&(n.ariaOrientation=i.ariaOrientation),Bo("toolbar",t)&&(t.result.orientation=t.params.orientation),this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(e){const t=z0(e);if(Bo("button",t)){const{params:i,result:s}=t,n=s.getElement();if(this.initInteract(i,s),typeof i.textContent=="string")n.textContent=i.textContent;else{const{textContent:r}=i;this.addLocalisation(()=>{n.textContent=this.localeManager.t(r.id,r.params)})}this.setParent(t.params,t.result)}if(Bo("slider",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.type="range",n.role="presentation",n.style.margin="0px",this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),this.setParent(t.params,t.result)}if(Bo("text",t)){const{params:i,result:s}=t;this.initElement(i,s),this.setParent(t.params,t.result)}if(Bo("listswitch",t)){const{params:i,result:s}=t;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(t.params,t.result)}if(Bo("region",t)){const{params:i,result:s}=t,n=s.getElement();this.initInteract(i,s),n.role="region",this.setParent(t.params,t.result)}return t.result}initElement(e,t){const i=t.getElement();return(0,$p.setElementStyle)(i,"cursor",e.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(e,t){const{tabIndex:i,domIndex:s}=e,n=this.initElement(e,t);i!==void 0&&(n.tabIndex=i),s!==void 0&&(t.domIndex=s)}setParent(e,t){if("parent"in e)e.parent?.addChild(t);else{const i={where:e.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",e.domManagerId,t.getElement(),i)}}},B0={ariaAnnounceHoverDatum:"${datum}",ariaAnnounceChart:"chart, ${seriesCount}[number] series",ariaAnnounceHierarchyChart:"hierarchy chart, ${caption}",ariaAnnounceGaugeChart:"gauge chart, ${caption}",ariaAnnounceHierarchyDatum:"level ${level}[number], ${count}[number] children, ${description}",ariaAnnounceFlowProportionLink:"link ${index} of ${count}, from ${from} to ${to}, ${sizeName} ${size}",ariaAnnounceFlowProportionNode:"node ${index} of ${count}, ${description}",ariaDescriptionLegendItem:"Press Space or Enter to toggle visibility",ariaLabelAddHorizontalLine:"Add Horizontal Line",ariaLabelAnnotationsToolbar:"Annotations",ariaLabelAnnotationOptionsToolbar:"Annotation Options",ariaLabelAnnotationSettingsDialog:"Annotation Settings",ariaLabelColorPicker:"Color picker",ariaLabelFinancialCharts:"Financial Charts",ariaLabelLegend:"Legend",ariaLabelLegendPagination:"Legend Pagination",ariaLabelLegendPagePrevious:"Previous Legend Page",ariaLabelLegendPageNext:"Next Legend Page",ariaLabelLegendItem:"${label}, Legend item ${index}[number] of ${count}[number]",ariaLabelLegendItemUnknown:"Unknown legend item",ariaLabelNavigator:"Navigator",ariaLabelNavigatorRange:"Range",ariaLabelNavigatorMinimum:"Minimum",ariaLabelNavigatorMaximum:"Maximum",ariaLabelRangesToolbar:"Ranges",ariaLabelSettingsTabBar:"Settings",ariaLabelZoomToolbar:"Zoom",ariaValuePanRange:"${min}[percent0to2dp] to ${max}[percent0to2dp]",iconAltTextLineStyleSolid:"Solid",iconAltTextLineStyleDashed:"Long-dashed",iconAltTextLineStyleDotted:"Short-dashed",iconAltTextPositionTop:"Top",iconAltTextPositionCenter:"Center",iconAltTextPositionBottom:"Bottom",iconAltTextAlignLeft:"Left",iconAltTextAlignCenter:"Center",iconAltTextAlignRight:"Right",iconAltTextClose:"Close",overlayLoadingData:"Loading data...",overlayNoData:"No data to display",overlayNoVisibleSeries:"No visible series",overlayUnsupportedBrowser:"Incompatible browser version. Please upgrade your browser.",seriesHistogramTooltipFrequency:"Frequency",seriesHistogramTooltipSum:"${yName} (sum)",seriesHistogramTooltipCount:"${yName} (count)",seriesHistogramTooltipMean:"${yName} (mean)",toolbarSeriesTypeDropdown:"Chart Type",toolbarSeriesTypeOHLC:"OHLC",toolbarSeriesTypeHLC:"HLC",toolbarSeriesTypeHighLow:"High Low",toolbarSeriesTypeCandles:"Candles",toolbarSeriesTypeHollowCandles:"Hollow Candles",toolbarSeriesTypeLine:"Line",toolbarSeriesTypeLineWithMarkers:"Line with Markers",toolbarSeriesTypeStepLine:"Step Line",toolbarAnnotationsTrendLine:"Trend Line",toolbarAnnotationsFibonacciRetracement:"Fib Retracement",toolbarAnnotationsFibonacciRetracementTrendBased:"Fib Trend Based",toolbarAnnotationsHorizontalLine:"Horizontal Line",toolbarAnnotationsVerticalLine:"Vertical Line",toolbarAnnotationsParallelChannel:"Parallel Channel",toolbarAnnotationsDisjointChannel:"Disjoint Channel",toolbarAnnotationsClearAll:"Clear All",toolbarAnnotationsFillColor:"Fill Color",toolbarAnnotationsLineColor:"Line Color",toolbarAnnotationsLineStyle:"Line Style",toolbarAnnotationsLineStrokeWidth:"Line Stroke Width",toolbarAnnotationsSettings:"Settings",toolbarAnnotationsTextColor:"Text Color",toolbarAnnotationsTextSize:"Text Size",toolbarAnnotationsLock:"Lock",toolbarAnnotationsUnlock:"Unlock",toolbarAnnotationsDelete:"Delete",toolbarAnnotationsDragHandle:"Drag Toolbar",toolbarAnnotationsLineAnnotations:"Trend Lines",toolbarAnnotationsFibonacciAnnotations:"Fibonacci",toolbarAnnotationsTextAnnotations:"Text Annotations",toolbarAnnotationsShapeAnnotations:"Arrows",toolbarAnnotationsMeasurerAnnotations:"Measurers",toolbarAnnotationsCallout:"Callout",toolbarAnnotationsComment:"Comment",toolbarAnnotationsNote:"Note",toolbarAnnotationsText:"Text",toolbarAnnotationsArrow:"Arrow",toolbarAnnotationsArrowUp:"Arrow Up",toolbarAnnotationsArrowDown:"Arrow Down",toolbarAnnotationsDateRange:"Date Range",toolbarAnnotationsPriceRange:"Price Range",toolbarAnnotationsDatePriceRange:"Date and Price",toolbarAnnotationsQuickDatePriceRange:"Measure",toolbarRange1Month:"1M",toolbarRange1MonthAria:"1 month",toolbarRange3Months:"3M",toolbarRange3MonthsAria:"3 months",toolbarRange6Months:"6M",toolbarRange6MonthsAria:"6 months",toolbarRangeYearToDate:"YTD",toolbarRangeYearToDateAria:"Year to date",toolbarRange1Year:"1Y",toolbarRange1YearAria:"1 year",toolbarRangeAll:"All",toolbarRangeAllAria:"All",toolbarZoomZoomOut:"Zoom out",toolbarZoomZoomIn:"Zoom in",toolbarZoomPanLeft:"Pan left",toolbarZoomPanRight:"Pan right",toolbarZoomPanStart:"Pan to the start",toolbarZoomPanEnd:"Pan to the end",toolbarZoomReset:"Reset the zoom",contextMenuDownload:"Download",contextMenuToggleSeriesVisibility:"Toggle Visibility",contextMenuToggleOtherSeries:"Toggle Other Series",contextMenuZoomToCursor:"Zoom to here",contextMenuPanToCursor:"Pan to here",contextMenuResetZoom:"Reset zoom",dialogHeaderChannel:"Channel",dialogHeaderLine:"Line",dialogHeaderFibonacciRange:"Fib Retracement",dialogHeaderDateRange:"Date Range",dialogHeaderPriceRange:"Price Range",dialogHeaderDatePriceRange:"Date and Price",dialogHeaderText:"Text",dialogInputAlign:"Align",dialogInputColorPicker:"Color",dialogInputColorPickerAltText:"Text Color",dialogInputFillColorPicker:"Fill",dialogInputFillColorPickerAltText:"Fill Color",dialogInputExtendChannelStart:"Extend channel start",dialogInputExtendChannelEnd:"Extend channel end",dialogInputExtendLineStart:"Extend line start",dialogInputExtendLineEnd:"Extend line end",dialogInputExtendAbove:"Extend above",dialogInputExtendBelow:"Extend below",dialogInputExtendLeft:"Extend left",dialogInputExtendRight:"Extend right",dialogInputReverse:"Reverse",dialogInputShowFill:"Show Fill",dialogInputFontSize:"Size",dialogInputFontSizeAltText:"Font Size",dialogInputLineStyle:"Dash",dialogInputPosition:"Position",dialogInputStrokeWidth:"Weight",dialogInputStrokeWidthAltText:"Line Weight",dialogInputFibonacciBands:"Bands",dialogInputFibonacciBandsAltText:"Fibonacci Bands",inputTextareaPlaceholder:"Add Text",measurerDateRangeBars:"${value}[number] bars",measurerPriceRangeValue:"${value}[number]",measurerPriceRangePercent:"${value}[percent]",measurerVolume:"Vol ${value}",tooltipPaginationStatus:"${index}[number] of ${count}[number]"},HC=(T(),N(w)),UC=/\$\{(\w+)}(?:\[(\w+)])?/gi,Qp={number:new Intl.NumberFormat("en-US"),percent:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:2,maximumFractionDigits:2}),percent0to2dp:new Intl.NumberFormat("en-US",{style:"percent",minimumFractionDigits:0,maximumFractionDigits:2}),date:new Intl.DateTimeFormat("en-US",{dateStyle:"full"}),time:new Intl.DateTimeFormat("en-US",{timeStyle:"full"}),datetime:new Intl.DateTimeFormat("en-US",{dateStyle:"full",timeStyle:"full"})},WC=({defaultValue:e,variables:t})=>e?.replaceAll(UC,(i,s,n)=>{const r=t[s],o=n!=null?Qp[n]:null;return n!=null&&o==null&&HC.Logger.warnOnce(`Format style [${n}] is not supported`),o!=null?o.format(r):typeof r=="number"?Qp.number.format(r):r instanceof Date?Qp.datetime.format(r):String(r)}),$C=class{constructor(e){this.eventsHub=e,this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(e){this.localeText!==e&&(this.localeText=e,this.eventsHub.emit("locale:change",null))}setLocaleTextFormatter(e){this.getLocaleText=e,this.getLocaleText!==e&&(this.getLocaleText=e,this.eventsHub.emit("locale:change",null))}t(e,t={}){const{localeText:i=B0,getLocaleText:s}=this,n=i[e];return s?.({key:e,defaultValue:n,variables:t})??WC({key:e,defaultValue:n,variables:t})??e}},al=(T(),N(w)),V0=(T(),N(w)),Jp=class{constructor(e){this.enabled=!0,this.width=600,this.height=300;const{width:t,height:i,canvasElement:s,willReadFrequently:n=!1}=e;this.pixelRatio=e.pixelRatio??(0,V0.getWindow)("devicePixelRatio")??1,this.element=s??(0,V0.createElement)("canvas"),this.element.style.display="block",this.element.style.width=(t??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((t??this.width)*this.pixelRatio),this.element.height=Math.round((i??this.height)*this.pixelRatio),this.context=this.element.getContext("2d",{willReadFrequently:n}),this.onEnabledChange(),this.resize(t??0,i??0,this.pixelRatio),yb(this.context)}drawImage(e,t=0,i=0){return e.drawImage(this.context.canvas,t,i)}toDataURL(e){return this.element.toDataURL(e)}resize(e,t,i){if(!(e>0&&t>0))return;const{element:s,context:n}=this;s.width=Math.round(e*i),s.height=Math.round(t*i),n.setTransform(i,0,0,i,0,0),s.style.width=e+"px",s.style.height=t+"px",this.width=e,this.height=t,this.pixelRatio=i}clear(){mb(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}reset(){this.context.reset(),this.context.verifyDepthZero?.()}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};f([Rn(e=>e.onEnabledChange())],Jp.prototype,"enabled",2);var YC=(T(),N(w)),KC=class extends YC.EventEmitter{constructor(){super(...arguments),this.cache=new Map,this.imageLoadingCount=0}loadImage(e,t){const i=this.cache.get(e);if(i?.image)return i.image;if(i!=null&&t){i.nodes.add(t);return}if(!t)return;const s={image:void 0,nodes:new Set([t])},n=new Image;return this.imageLoadingCount++,n.onload=()=>{s.image=n;for(const r of s.nodes)r.markDirty();s.nodes.clear(),this.imageLoadingCount--,this.emit("image-loaded",{uri:e})},n.onerror=()=>{this.imageLoadingCount--,s.nodes.clear(),this.emit("image-error",{uri:e})},n.src=e,this.cache.set(e,s),s.image}waitingToLoad(){return this.imageLoadingCount>0}destroy(){this.cache.forEach(e=>{e.nodes.clear()}),this.cache.clear()}},ZC=class{constructor(e){this.canvas=e,this.debug=me.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(e,t,i){this.canvas.resize(e,t,i),this.layersMap.forEach(({canvas:s})=>s.resize(e,t,i))}addLayer(e){const{width:t,height:i,pixelRatio:s}=this.canvas,{name:n}=e,r=new ip({width:t,height:i,pixelRatio:s});return this.layersMap.set(r,{id:this.nextLayerId++,name:n,canvas:r}),this.debug("Scene.addLayer() - layers",this.layersMap),r}removeLayer(e){this.layersMap.has(e)&&(this.layersMap.delete(e),e.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const e of this.layersMap.values())e.canvas.destroy();this.layersMap.clear()}},Nh=class extends al.EventEmitter{constructor(e){super(),this.debug=me.create(!0,"scene"),this.id=(0,al.createId)(this),this.imageLoader=new KC,this.root=null,this.pendingSize=null,this.isDirty=!1,this.cleanup=new al.CleanupRegistry,this.updateDebugFlags(),this.canvas=new Jp(e),this.layersManager=new ZC(this.canvas),this.cleanup.register(this.imageLoader.on("image-loaded",()=>{this.emit("scene-changed",{})}),this.imageLoader.on("image-error",({uri:t})=>{al.Logger.warnOnce(`Unable to load image ${t}`)}))}waitingForUpdate(){return this.imageLoader?.waitingToLoad()??!1}get width(){return this.pendingSize?.[0]??this.canvas.width}get height(){return this.pendingSize?.[1]??this.canvas.height}get pixelRatio(){return this.pendingSize?.[2]??this.canvas.pixelRatio}setContainer(e){const{element:t}=this.canvas;return t.parentElement?.removeChild(t),e.appendChild(t),this}setRoot(e){return this.root===e?this:(this.isDirty=!0,this.root?.setScene(),this.root=e,e&&(e.visible=!0,e.setScene(this)),this)}updateDebugFlags(){me.inDevelopmentMode(()=>Ws._debugEnabled=!0)}clearCanvas(){this.canvas.clear()}attachNode(e){return this.appendChild(e),()=>this.removeChild(e)}appendChild(e){return this.root?.appendChild(e),this}removeChild(e){return this.root?.removeChild(e),this}download(e,t){(0,al.downloadUrl)(this.canvas.toDataURL(t),e?.trim()??"image")}getDataURL(e){return this.canvas.toDataURL(e)}resize(e,t,i){return e=Math.round(e),t=Math.round(t),i??(i=this.pixelRatio),e>0&&t>0&&(e!==this.width||t!==this.height||i!==this.pixelRatio)?(this.pendingSize=[e,t,i],this.isDirty=!0,!0):!1}render(e){const{debugSplitTimes:t={start:performance.now()},extraDebugStats:i,seriesRect:s}=e??{},{canvas:n,canvas:{context:r}={},root:o,pendingSize:a,width:l,height:c,pixelRatio:h}=this;if(!r)return;const u=performance.now();let d=!1;if(a&&(d=!0,this.layersManager.resize(...a),this.pendingSize=null),o&&!o.visible){this.isDirty=!1;return}let p;if(o instanceof re&&(p=o.dirty),o!=null&&p===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:vh(o,"console")}),c0(this.layersManager,t,r,void 0,i,s);return}const g={ctx:r,width:l,height:c,devicePixelRatio:h,debugNodes:{}};me.check("scene:stats:verbose")&&(g.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),dC(g);let y=!1;if((p!==!1||d)&&(y=!0,n.clear()),o&&me.check("scene:dirtyTree")){const{dirtyTree:b,paths:m}=h0(o);me.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:b,paths:m})}if(o&&y){if(o.visible&&o.preRender(g),this.debug.check()){const b=vh(o,"console");this.debug("Scene.render() - before",{canvasCleared:y,tree:b})}if(o.visible)try{r.save(),o.render(g),r.restore()}catch(b){throw this.canvas.reset(),b}}t["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,c0(this.layersManager,t,r,g.stats,i,s),pC(r,g.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:vh(o,"console"),canvasCleared:y})}toSVG(){const{root:e,width:t,height:i}=this;if(e!=null)return Ws.toSVG(e,t,i)}strip(){const{context:e,pixelRatio:t}=this.canvas;e.setTransform(t,0,0,t,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1,this.clear()}destroy(){this.strip(),this.canvas.destroy(),this.imageLoader.destroy(),this.cleanup.flush(),Object.assign(this,{canvas:void 0})}};Nh.className="Scene";var XC=(T(),N(w)),qC=class{constructor(e,t,i){this.eventsHub=e,this.annotationRoot=t,this.fireChartEvent=i,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(e){return e==null||(0,XC.isArray)(e)}restoreMemento(e,t,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return Le(s,n)}),this.eventsHub.emit("annotations:restore",{annotations:this.annotations})}updateData(e){this.annotations=this.cleanData(e??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Qe([...this.annotations])})}attachNode(e){return this.annotationRoot.append(e),()=>(this.annotationRoot?.removeChild(e),this)}setAnnotationStyles(e){this.styles=e}getAnnotationTypeStyles(e){return this.styles?.[e]}cleanData(e){for(const t of e)"textAlign"in t&&delete t.textAlign;return e}},G0=(e=>(e[e.CHART_BACKGROUND=0]="CHART_BACKGROUND",e[e.AXIS_BAND_HIGHLIGHT=1]="AXIS_BAND_HIGHLIGHT",e[e.AXIS_GRID=2]="AXIS_GRID",e[e.AXIS=3]="AXIS",e[e.ZOOM_SELECTION=4]="ZOOM_SELECTION",e[e.SERIES_CROSSLINE_RANGE=5]="SERIES_CROSSLINE_RANGE",e[e.SERIES_LAYER=6]="SERIES_LAYER",e[e.AXIS_FOREGROUND=7]="AXIS_FOREGROUND",e[e.SERIES_CROSSHAIR=8]="SERIES_CROSSHAIR",e[e.SERIES_CROSSLINE_LINE=9]="SERIES_CROSSLINE_LINE",e[e.SERIES_ANNOTATION=10]="SERIES_ANNOTATION",e[e.CHART_ANNOTATION=11]="CHART_ANNOTATION",e[e.CHART_ANNOTATION_FOCUSED=12]="CHART_ANNOTATION_FOCUSED",e[e.STATUS_BAR=13]="STATUS_BAR",e[e.SERIES_LABEL=14]="SERIES_LABEL",e[e.LEGEND=15]="LEGEND",e[e.NAVIGATOR=16]="NAVIGATOR",e[e.FOREGROUND=17]="FOREGROUND",e))(G0||{}),QC=class{constructor(e,t){this.eventsHub=e,this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new re({name:"Axes-Grids",zIndex:2}),this.axisGroup=new re({name:"Axes",zIndex:3}),this.axisLabelGroup=new re({name:"Axes-Labels",zIndex:14}),this.axisCrosslineRangeGroup=new re({name:"Axes-Crosslines-Range",zIndex:5}),this.axisCrosslineLineGroup=new re({name:"Axes-Crosslines-Line",zIndex:9}),this.axisCrosslineLabelGroup=new re({name:"Axes-Crosslines-Label",zIndex:14}),this.sceneRoot.appendChild(this.axisGroup),this.sceneRoot.appendChild(this.axisGridGroup),this.sceneRoot.appendChild(this.axisLabelGroup),this.sceneRoot.appendChild(this.axisCrosslineRangeGroup),this.sceneRoot.appendChild(this.axisCrosslineLineGroup),this.sceneRoot.appendChild(this.axisCrosslineLabelGroup)}updateAxes(e,t){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of e)t.includes(s)||(s.detachAxis(i),s.destroy());for(const s of t)e?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of t){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}this.eventsHub.emit("axis:change",null)}getAxisContext(e){return this.axes.get(e)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},ll=(e=>(e[e.FULL=0]="FULL",e[e.UPDATE_DATA=1]="UPDATE_DATA",e[e.PROCESS_DATA=2]="PROCESS_DATA",e[e.PROCESS_DOMAIN=3]="PROCESS_DOMAIN",e[e.PERFORM_LAYOUT=4]="PERFORM_LAYOUT",e[e.SERIES_UPDATE=5]="SERIES_UPDATE",e[e.PRE_SCENE_RENDER=6]="PRE_SCENE_RENDER",e[e.SCENE_RENDER=7]="SCENE_RENDER",e[e.NONE=8]="NONE",e))(ll||{}),Th=(T(),N(w)),Oh=class{constructor(e,t,i){this.eventsHub=e,this.caller=t,this.animationManager=i,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.pendingData=void 0,this.debug=me.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(e){typeof e=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=e,this.isLoadingInitialData=!0,this.animationManager.skip(),this.eventsHub.emit("data:source-change",null))}clearCallback(){this.dataSourceCallback=void 0}load(e){const{pendingData:t}=this;if(t!=null&&t.params.windowStart?.valueOf()===e.windowStart?.valueOf()&&t.params.windowEnd?.valueOf()===e.windowEnd?.valueOf()){const i=this.requestCounter++;this.isLoadingInitialData=!1,this.dispatch(i,t.data);return}this.isLoadingData=!0,this.throttledFetch(e)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}async getData(){const{latestRequest:e}=this;if(!e)return;const{params:t,fetchRequest:i}=e,s=await i;return{params:t,data:s}}restoreData(e){this.pendingData=e}createThrottledFetch(e){return(0,Th.throttle)(t=>this.fetch(t).catch(i=>Th.Logger.error("callback failed",i)),e,{leading:!1,trailing:!0})}createThrottledDispatch(e){return(0,Th.throttle)((t,i)=>this.dispatch(t,i),e,{leading:!0,trailing:!0})}dispatch(e,t){this.debug(`DataService - dispatching 'data-load' | ${e}`),this.eventsHub.emit("data:load",{data:t})}async fetch(e){"context"in this.caller&&(e.context=this.caller.context);const t=Promise.resolve().then(async()=>{if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const i=performance.now(),s=this.requestCounter++;this.debug(`DataService - requesting | ${s}`);let n;try{n=await this.dataSourceCallback(e),this.debug(`DataService - response | ${performance.now()-i}ms | ${s}`)}catch(o){this.debug(`DataService - request failed | ${s}`),Th.Logger.errorOnce(`DataService - request failed | [${o}]`)}this.isLoadingInitialData=!1;const r=this.freshRequests.indexOf(t);return r===-1||this.dispatchOnlyLatest&&r!==this.freshRequests.length-1?(this.debug(`DataService - discarding stale request | ${s}`),n):(this.freshRequests=this.freshRequests.slice(r+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(n)?this.throttledDispatch(s,n):this.eventsHub.emit("data:error",null),n)});this.latestRequest={params:e,fetchRequest:t},this.freshRequests.push(t),await t}};f([hi({newValue(e){this.throttledDispatch=this.createThrottledDispatch(e)}})],Oh.prototype,"dispatchThrottle",2),f([hi({newValue(e){this.throttledFetch=this.createThrottledFetch(e)}})],Oh.prototype,"requestThrottle",2);var JC=class{constructor(e,t){this.domManager=e,this.updateService=t,this.observers=[]}updateFonts(e){!e||e.size===0||(this.loadFonts(e),e.forEach(t=>{this.observeFontStatus(t)}))}destroy(){for(const e of this.observers)e.disconnect();this.observers=[]}loadFonts(e){const t=Array.from(e).map(r=>encodeURIComponent(r)),i=":wght@100;200;300;400;500;600;700;800;900",s=`${i}&family=`,n=`@import url('https://fonts.googleapis.com/css2?family=${t.join(s)}${i}&display=swap');
`;this.domManager.addStyles(`google-font-${t.join("-")}`,n)}observeFontStatus(e){const t=window.document.createElement("div");t.style.setProperty("position","absolute"),t.style.setProperty("top","0"),t.style.setProperty("margin","0"),t.style.setProperty("padding","0"),t.style.setProperty("overflow","hidden"),t.style.setProperty("visibility","hidden"),t.style.setProperty("width","auto"),t.style.setProperty("max-width","none"),t.style.setProperty("font-synthesis","none"),t.style.setProperty("font-family",e),t.style.setProperty("font-size","16px"),t.style.setProperty("white-space","nowrap"),t.textContent="UVWxyz",this.domManager.addChild("canvas-container",`font-check-${encodeURIComponent(e)}`,t);const i=new ResizeObserver(s=>{const n=s?.at(0)?.contentBoxSize.at(0)?.inlineSize;n!=null&&n>0&&(Qs.clear(),this.updateService.update(4))});i.observe(t),this.observers.push(i)}},Vo=(T(),N(w)),ew=["bar","line","scatter"],tw=void 0,iw=void 0;iw=tw;var sw=void 0,nw=void 0;nw=sw;var H0=(e=>(e.POINTER="pointer",e.NODE="node",e.CHART="chart",e))(H0||{}),U0=(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))(U0||{}),rw=void 0,ow=void 0;ow=rw;var aw=void 0,lw=void 0;lw=aw;var cw=(T(),N(w)),W0=class{constructor(){this.registeredListeners=new Map}addListener(e,t){const i={symbol:Symbol(e),handler:t};return this.registeredListeners.has(e)?this.registeredListeners.get(e).push(i):this.registeredListeners.set(e,[i]),()=>this.removeListener(i.symbol)}removeListener(e){for(const[t,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===e);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(t);break}}}dispatch(e,...t){for(const i of this.getListenersByType(e))try{i.handler(...t)}catch(s){cw.Logger.errorOnce(s)}}getListenersByType(e){return this.registeredListeners.get(e)??[]}destroy(){this.registeredListeners.clear()}},cl=new WeakMap;function Eh(e,t){const i=JSON.stringify(e,null,0);return cl.has(t)||cl.set(t,new Map),cl.get(t)?.has(i)||cl.get(t)?.set(i,t(e)),cl.get(t)?.get(i)}var eg=class{constructor(){this.weak=new WeakMap,this.strong=new Map,this.set=!1,this.value=void 0}};function hw(e,t){let i=new eg;const s=(...n)=>{let r=i;for(const o of n){const a=typeof o=="object"||typeof o=="symbol"?r.weak:r.strong;let l=a.get(o);l==null&&(l=new eg,a.set(o,l)),r=l}if(r.set)return t?.("hit",e,n),r.value;{const o=e(...n);return r.set=!0,r.value=o,t?.("miss",e,n),o}};return s.reset=()=>{i=new eg},s}function Jt(e,t){const i=new Map,s=(...o)=>o.map(a=>typeof a=="object"||typeof a=="symbol"?a:(i.has(a)||i.set(a,{v:a}),i.get(a))),n={},r=new WeakMap;return(...o)=>{const a=o.length===0?[n]:s(...o);let l=r;for(const u of a.slice(0,-1))l.has(u)||l.set(u,new WeakMap),l=l.get(u);const c=a.at(-1);let h=l.get(c);return h?t?.("hit",e,o):(h=e(...o),l.set(c,h),t?.("miss",e,o)),h}}var Ph={periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]};function tg(e,t=new Date(e.getFullYear(),0,1)){const i=e.getTimezoneOffset()-t.getTimezoneOffset(),s=e.getTime()-t.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function $0(e,t){const s=new Date(e.getFullYear(),0,1).getDay(),n=(t-s+7)%7,r=new Date(e.getFullYear(),0,n+1);return r<=e?Math.floor(tg(e,r)/7)+1:0}var uw=0,Y0=1,K0=4;function Z0(e,t=e.getFullYear()){const s=new Date(t,0,1).getDay(),n=(K0-s+7)%7,r=new Date(t,0,n-(K0-Y0)+1);return r<=e?Math.floor(tg(e,r)/7)+1:Z0(e,t-1)}function dw(e){const t=e.getTimezoneOffset(),i=Math.abs(t);return`${t>0?"-":"+"}${Wt(Math.floor(i/60),2,"0")}${Wt(Math.floor(i%60),2,"0")}`}var pw={a:e=>Ph.shortDays[e.getDay()],A:e=>Ph.days[e.getDay()],b:e=>Ph.shortMonths[e.getMonth()],B:e=>Ph.months[e.getMonth()],c:"%x, %X",d:(e,t)=>Wt(e.getDate(),2,t??"0"),e:"%_d",f:(e,t)=>Wt(e.getMilliseconds()*1e3,6,t??"0"),H:(e,t)=>Wt(e.getHours(),2,t??"0"),I:(e,t)=>{const i=e.getHours()%12;return i===0?"12":Wt(i,2,t??"0")},j:(e,t)=>Wt(tg(e)+1,3,t??"0"),m:(e,t)=>Wt(e.getMonth()+1,2,t??"0"),M:(e,t)=>Wt(e.getMinutes(),2,t??"0"),L:(e,t)=>Wt(e.getMilliseconds(),3,t??"0"),p:e=>e.getHours()<12?"AM":"PM",Q:e=>String(e.getTime()),s:e=>String(Math.floor(e.getTime()/1e3)),S:(e,t)=>Wt(e.getSeconds(),2,t??"0"),u:e=>{let t=e.getDay();return t<1&&(t+=7),String(t%7)},U:(e,t)=>Wt($0(e,uw),2,t??"0"),V:(e,t)=>Wt(Z0(e),2,t??"0"),w:(e,t)=>Wt(e.getDay(),2,t??"0"),W:(e,t)=>Wt($0(e,Y0),2,t??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(e,t)=>Wt(e.getFullYear()%100,2,t??"0"),Y:(e,t)=>Wt(e.getFullYear(),4,t??"0"),Z:e=>dw(e),"%":()=>"%"},gw={_:" ",0:"0","-":""};function Wt(e,t,i){const s=String(Math.floor(e));return s.length>=t?s:`${i.repeat(t-s.length)}${s}`}function Ar(e){const t=[];for(;e.length>0;){let i=e.indexOf("%");if(i!==0){const a=i>0?e.substring(0,i):e;t.push(a)}if(i<0)break;const s=e[i+1],n=gw[s];n!=null&&i++;const r=e[i+1],o=pw[r];if(typeof o=="function")t.push([o,n]);else if(typeof o=="string"){const a=Ar(o);t.push([a,n])}else t.push(`${n??""}${r}`);e=e.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return t.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}var ks={millisecond:"%H:%M:%S.%L",second:"%H:%M:%S",minute:"%H:%M",hour:"%H:%M",day:"%e",month:"%b",year:"%Y"},fw={millisecond:"%Y %b %e %H:%M:%S.%L",second:"%Y %b %e %H:%M:%S",minute:"%Y %b %e %H:%M",hour:"%Y %b %e %H:%M",day:"%Y %b %e",month:"%Y %b",year:"%Y"},ei={year:0,month:1,day:2,hour:3,minute:4,second:5,millisecond:6},mw=/%[-_0]?L/,yw=/%[-_0]?S/,bw=/%[-_0]?M/,xw=/%[-_0]?[HI]/,vw=/^%[-_0]?[de]$/,Mw=/^%[-_0]?[Bbm]$/,Sw=/^%[-_0]?[Yy]$/;function X0(e,t,i){if(typeof e=="string")return e;e??(e=ks);const{millisecond:s=ks.millisecond,second:n=ks.second,minute:r=ks.minute,hour:o=ks.hour,day:a=ks.day,month:l=ks.month,year:c=ks.year}=e,h=ei[t],u=fw[t],d=i?ei[i]:-1;if(d<ei.year&&h>=ei.year&&!Sw.test(c)||d<ei.month&&h>=ei.month&&!Mw.test(l)||d<ei.day&&h>=ei.day&&!vw.test(a))return u;let p;switch(t){case"year":return c;case"month":return d<ei.year?`${l} ${c}`:l;case"day":return d<ei.year?`${l} ${a} ${c}`:`${l} ${a}`;case"hour":p=o;break;case"minute":p=r;break;case"second":p=n;break;case"millisecond":p=s;break;default:return u}if(h>=ei.hour&&!xw.test(p)||h>=ei.minute&&!bw.test(p)||h>=ei.second&&!yw.test(p)||h>=ei.millisecond&&!mw.test(p))return u;let g;return d<ei.year?g=`${l} ${a} ${c}`:d<ei.month&&(g=`${l} ${a}`),g?`${p} ${g}`:p}var Go=class Id extends W0{constructor(){super(...arguments),this.formats=new Map,this.dateFormatter=hw((t,i,s,n,r)=>{const o=Id.mergeSpecifiers(t,i)??ks;return Id.getFormatter("date",o,s,n,{truncateDate:r})}),this.formatter=void 0}static mergeSpecifiers(...t){let i;for(const s of t)typeof s=="string"?i=s:(0,Vo.isPlainObject)(s)&&(i=(0,Vo.isPlainObject)(i)?{...i,...s}:s);return i}static getFormatter(t,i,s,n="long",{truncateDate:r}={}){if((0,Vo.isPlainObject)(i)){if(t!=="date"){Vo.Logger.warn("Date formatter configuration is not supported for non-date types.");return}s??(s="millisecond");const o=n==="component"?i?.[s]??ks[s]:X0(i,s,r);return Ar(o)}switch(t){case"number":const o=(0,Vo.parseNumberFormat)(i);return o==null?void 0:(0,Vo.createNumberFormatter)(o);case"date":return Ar(i);case"category":return a=>i.replace("%s",String(a))}}setFormatter(t){this.formatter!==t&&(this.formatter=t,this.formats.clear(),this.dateFormatter.reset(),this.dispatch("format-changed"))}format(t,i,{specifier:s,truncateDate:n}={}){if(i.value==null)return;const{formatter:r}=this;if(r==null)return;if(typeof r=="function"){const c=t(r,i);return c!=null?String(c):void 0}const o=r[i.property];if(o==null)return;if(typeof o=="function"){const c=t(o,i);return c!=null?String(c):void 0}else if(i.type==="date"){const{unit:c,style:h}=i;return this.dateFormatter(o,s,c,h,n)?.(i.value)}const a=s??o;if(typeof a!="string")return;let l=this.formats.get(a);return l==null&&(l=Id.getFormatter(i.type,a),this.formats.set(a,l)),l?.(i.value,i.type==="number"?i.fractionDigits:void 0)}defaultFormat(t,{specifier:i,truncateDate:s}={}){const{formatter:n}=this,r=typeof n=="function"?void 0:n?.[t.property];switch(t.type){case"date":{const{unit:o,style:a}=t,l=r!=null&&typeof r!="function"?r:void 0;return this.dateFormatter(l,i,o,a,s)?.(t.value)??String(t.value)}case"number":return _n(t.value,t.fractionDigits);case"category":return Array.isArray(t.value)?t.value.join(" - "):typeof t.value=="string"?t.value:typeof t.value=="number"?_n(t.value):String(t.value)}}},Rh=(T(),N(w)),Dw=yr((T(),N(w)));function Iw(e,t){return i=>Number(e)*(1-i)+Number(t)*i}function q0(e,t){if(typeof e=="string")try{e=Be.fromString(e)}catch{e=Be.fromArray([0,0,0])}if(typeof t=="string")try{t=Be.fromString(t)}catch{t=Be.fromArray([0,0,0])}return i=>Be.mix(e,t,i).toRgbaString()}var ig={};is(ig,{easeIn:()=>Aw,easeInOut:()=>Lw,easeInOutQuad:()=>ww,easeInQuad:()=>kw,easeOut:()=>hl,easeOutQuad:()=>Cw,inverseEaseOut:()=>J0,linear:()=>Q0});var Q0=e=>e,Aw=e=>1-Math.cos(e*Math.PI/2),hl=e=>Math.sin(e*Math.PI/2),Lw=e=>-(Math.cos(e*Math.PI)-1)/2,kw=e=>e*e,Cw=e=>1-(1-e)**2,ww=e=>e<.5?2*e*e:1-(-2*e+2)**2/2,J0=e=>2*Math.asin(e)/Math.PI,{clamp:Nw,isPlainObject:ex}=Dw,_h=.2,Ho=["initial","remove","update","add","trailing","end","none"],ul={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:_h,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+_h,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},tx=(e=>(e.Loop="loop",e.Reverse="reverse",e))(tx||{});function Tw(e){return e.every(t=>t instanceof Ws)}function jh(e){return Tw(e)?{nodes:e,selections:[]}:{nodes:[],selections:e}}function sg(e,t){return e===t?!0:Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((i,s)=>sg(i,t[s])):ih(e)&&ih(t)?e.equals(t):ex(e)&&ex(t)?op(e,t,sg):!1}var ix=class{constructor(e){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=e.id,this.groupId=e.groupId,this.autoplay=e.autoplay??!0,this.ease=e.ease??Q0,this.phase=e.phase;const t=e.duration??ul[this.phase].animationDuration;this.duration=t*e.defaultDuration,this.delay=(e.delay??0)*e.defaultDuration,this.onComplete=e.onComplete,this.onPlay=e.onPlay,this.onStop=e.onStop,this.onUpdate=e.onUpdate,this.interpolate=this.createInterpolator(e.from,e.to),this.from=e.from,e.skip===!0&&(this.onUpdate?.(e.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),e.collapsable!==!1&&(this.duration=this.checkCollapse(e,this.duration))}checkCollapse(e,t){return sg(e.from,e.to)?0:t}play(e=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,e&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(e){if(this.isComplete)return e;!this.isPlaying&&this.autoplay&&this.play(!0);const t=this.elapsed;if(this.elapsed+=e,this.delay>this.elapsed)return 0;const i=this.interpolate(this.isReverse?1-this.delta:this.delta);this.onUpdate?.(i,!1,this);const s=this.delay+this.duration;return this.elapsed>=s?(this.stop(),this.isComplete=!0,this.onComplete?.(this),e-(s-t)):0}get delta(){return this.ease(Nw(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(e,t){if(typeof t!="object"||ih(t))return this.interpolateValue(e,t);const i=[];for(const s of Object.keys(t)){const n=this.interpolateValue(e[s],t[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[r,o]of i)n[r]=o(s);return n}}interpolateValue(e,t){if(!(e==null||t==null)){if(ih(e))return i=>e[th](t,i);try{switch(typeof e){case"number":return Iw(e,t);case"string":return q0(e,t);case"boolean":if(e===t)return()=>e;break;case"object":return()=>e;default:throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}catch{}throw new Error(`Unable to interpolate values: ${e}, ${t}`)}}},Ow=(T(),N(w)),sx=class{constructor(e){this.maxAnimationTime=e,this.debug=me.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Ho.map(t=>[t,[]])),this.skipAnimations=!1,this.animationTimeConsumed=0,this.isReady=!1}get size(){return this.controllers.size}get consumedTimeMs(){return this.animationTimeConsumed}isActive(){return this.controllers.size>0}getActiveControllers(){return this.phases.get(Ho[this.currentPhase])??[]}checkOverlappingId(e){e!=null&&this.controllers.has(e)&&(this.controllers.get(e).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${e}`),this.skip())}addAnimation(e){if(e.isComplete)return;if(Ho.indexOf(e.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",e.id),e.stop();return}this.controllers.set(e.id,e),this.phases.get(e.phase)?.push(e)}removeAnimation(e){this.controllers.delete(e.id);const t=this.phases.get(e.phase),i=t?.indexOf(e);i!=null&&i>=0&&t?.splice(i,1)}progress(e){if(!this.isReady)return;let t=e===0?.01:e;const i=()=>{const c=Ho[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:ul[c]}};let{phase:s,phaseControllers:n,phaseMeta:r}=i();const o=()=>Ho[this.currentPhase]==null,a=()=>{for({phase:s,phaseControllers:n,phaseMeta:r}=i();!o()&&n.length===0;)this.currentPhase++,{phase:s,phaseControllers:n,phaseMeta:r}=i(),this.debug(`AnimationBatch - phase changing to ${s}`,{unusedTime:t},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${e}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=t,h=r.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of n)h?d.stop():t=Math.min(d.update(c),t),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-t,this.debug(`AnimationBatch - updated ${n.length} controllers; ${u} completed`,n),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(t>0&&!o());this.animationTimeConsumed>this.maxAnimationTime&&(this.debug("Animation batch exceeded max animation time, skipping",[...this.controllers]),this.stop())}ready(){if(this.isReady)return;this.isReady=!0,this.debug(`AnimationBatch - ready; skipped: ${this.skipAnimations}`,[...this.controllers]);let e=!0;for(const[,t]of this.controllers)if(t.duration>0&&ul[t.phase].skipIfNoEarlierAnimations!==!0){e=!1;break}if(!e)for(const[,t]of this.controllers)t.autoplay&&t.play(!0)}skip(e=!0){if(this.skipAnimations===!1&&e===!0){for(const t of this.controllers.values())t.stop();this.controllers.clear()}this.skipAnimations=e}play(){for(const e of this.controllers.values())e.play()}stop(){for(const e of this.controllers.values())try{e.stop(),this.removeAnimation(e)}catch(t){Ow.Logger.error("Error during animation stop",t)}this.dispatchStopped()}stopByAnimationId(e){if(e!=null&&this.controllers.has(e)){const t=this.controllers.get(e);t&&(t.stop(),this.removeAnimation(t))}}stopByAnimationGroupId(e){for(const t of this.controllers.values())t.groupId===e&&this.stopByAnimationId(t.id)}dispatchStopped(){this.stoppedCbs.forEach(e=>e()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}getRemainingTime(e){if(!this.isActive())return 0;let t=0;for(const[i,s]of this.phases)s.length!==0&&(e!=null&&e!==i||(t+=Math.max(...s.map(n=>n.isComplete?0:n.delay+n.duration-(n.elapsed??0)))));return t}destroy(){this.stop(),this.controllers.clear()}},nx=(e=>(e[e.Default=32]="Default",e[e.ZoomDrag=16]="ZoomDrag",e[e.Annotations=8]="Annotations",e[e.ContextMenu=4]="ContextMenu",e[e.Animation=2]="Animation",e[e.AnnotationsSelected=1]="AnnotationsSelected",e[e.Clickable=41]="Clickable",e[e.Focusable=34]="Focusable",e[e.Keyable=43]="Keyable",e[e.ContextMenuable=36]="ContextMenuable",e[e.AnnotationsMoveable=9]="AnnotationsMoveable",e[e.AnnotationsDraggable=57]="AnnotationsDraggable",e[e.ZoomDraggable=50]="ZoomDraggable",e[e.ZoomClickable=34]="ZoomClickable",e[e.ZoomWheelable=59]="ZoomWheelable",e[e.All=63]="All",e))(nx||{}),rx=class{constructor(){this.stateQueue=34}pushState(e){this.stateQueue|=e}popState(e){this.stateQueue&=~e}isState(e){return!!(this.stateQueue&-this.stateQueue&e)}};function ox(e){return e==null?!0:!isNaN(e)&&e>=0&&e<=2}var ax=class{constructor(e,t){this.interactionManager=e,this.chartUpdateMutex=t,this.defaultDuration=1e3,this.batch=new sx(this.defaultDuration*1.5),this.debug=me.create(!0,"animation"),this.events=new Rh.EventEmitter,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(e,t){return this.events.on(e,t)}animate(e){const t=this.batch;try{t.checkOverlappingId(e.id)}catch(a){this.failsafeOnError(a);return}let{id:i}=e;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||e.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:r}=e;if(!ox(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!ox(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const o=new ix({...e,id:i,skip:s,autoplay:this.isPlaying?e.autoplay:!1,phase:e.phase,defaultDuration:this.defaultDuration});if(!this.forceTimeJump(o,this.defaultDuration))return this.batch.addAnimation(o),o}play(){if(!this.isPlaying){this.isPlaying=!0,this.debug("AnimationManager.play()");try{this.batch.play()}catch(e){this.failsafeOnError(e)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(e){try{this.batch.stopByAnimationId(e)}catch(t){this.failsafeOnError(t)}}stopByAnimationGroupId(e){try{this.batch.stopByAnimationGroupId(e)}catch(t){this.failsafeOnError(t)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(e=!0){this.skipAnimations=e}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}getRemainingTime(e){return this.batch.getRemainingTime(e)}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(e){this.requestId=(0,Rh.getWindow)().requestAnimationFrame(t=>{e(t).catch(i=>Rh.Logger.error(i))})}forceTimeJump(e,t){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let e;const t=async i=>{await this.debug.group("AnimationManager.onAnimationFrame()",async()=>{const s=()=>{const n=i-(e??i);e=i,this.debug("AnimationManager",{controllersCount:this.batch.size,deltaTime:n}),this.interactionManager.pushState(2);try{this.batch.progress(n)}catch(r){this.failsafeOnError(r)}this.events.emit("animation-frame",{type:"animation-frame",deltaMs:n})};this.isSkippingFrames()?await this.chartUpdateMutex.acquireImmediately(s):await this.chartUpdateMutex.acquire(s),this.batch.isActive()?this.scheduleAnimationFrame(t):(this.batch.stop(),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}))})};this.events.emit("animation-start",{type:"animation-start",deltaMs:0}),this.scheduleAnimationFrame(t)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.events.emit("animation-stop",{type:"animation-stop",deltaMs:this.batch.consumedTimeMs}),this.requestId=null,this.startBatch())}failsafeOnError(e,t=!0){Rh.Logger.error("Error during animation, skipping animations",e),t&&this.cancelAnimation()}startBatch(e){this.debug(`AnimationManager - startBatch() with skipAnimations=${e}.`),this.reset(),this.batch.destroy(),this.batch=new sx(this.defaultDuration*1.5),e===!0&&this.batch.skip()}endBatch(){this.batch.isActive()?(this.batch.ready(),this.requestAnimation()):(this.interactionManager.popState(2),this.batch.isSkipped()&&this.batch.skip(!1))}onBatchStop(e){this.batch.stoppedCbs.add(e)}destroy(){this.stop(),this.events.clear()}},Ew=class{constructor(){this.download={type:"action",showOn:"always",label:"contextMenuDownload",enabled:!0,action:void 0,items:void 0},this["zoom-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuZoomToCursor",enabled:!0,action:void 0,items:void 0},this["pan-to-cursor"]={type:"action",showOn:"series-area",label:"contextMenuPanToCursor",enabled:!0,action:void 0,items:void 0},this["reset-zoom"]={type:"action",showOn:"series-area",label:"contextMenuResetZoom",enabled:!0,action:void 0,items:void 0},this["toggle-series-visibility"]={type:"action",showOn:"legend-item",label:"contextMenuToggleSeriesVisibility",enabled:!0,action:void 0,items:void 0},this["toggle-other-series"]={type:"action",showOn:"legend-item",label:"contextMenuToggleOtherSeries",enabled:!0,action:void 0,items:void 0},this.separator={type:"separator",showOn:"always",label:"separator",enabled:!0,action:void 0,items:void 0}}},Pw=class{constructor(){this.defaults=["download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series"]}},lx=class{constructor(){this.items=new Ew,this.lists=new Pw}},cx=class{constructor(e){this.eventsHub=e,this.builtins=new lx,this.hiddenActions=new Set,this.setVisible("zoom-to-cursor",!1),this.setVisible("pan-to-cursor",!1),this.setVisible("reset-zoom",!1)}static check(e,t){return t.showOn==e}static checkCallback(e,t,i){return e===t}dispatchContext(e,t,i,s){const{widgetEvent:n}=t;if(n.sourceEvent.defaultPrevented)return;const r=s?.x??t.canvasX,o=s?.y??t.canvasY,a={showOn:e,x:r,y:o,context:i,widgetEvent:n};this.eventsHub.emit("context-menu:setup",a),this.eventsHub.emit("context-menu:complete",a)}isVisible(e){return!this.hiddenActions.has(e)}setVisible(e,t){t?this.hiddenActions.delete(e):this.hiddenActions.add(e)}},hx=class{constructor(e){this.eventsHub=e,this.highlightStates=new zo}updateHighlight(e,t){const i=this.getActiveHighlight();this.highlightStates.set(e,t);const s=this.getActiveHighlight();this.isEqual(s,i)||this.eventsHub.emit("highlight:change",{callerId:e,currentHighlight:s,previousHighlight:i})}getActiveHighlight(){return this.highlightStates.stateValue()}isEqual(e,t){return e===t||e!=null&&t!=null&&e?.series===t?.series&&e?.itemId===t?.itemId&&e?.datum===t?.datum}},Rw=(T(),N(w)),ux=(T(),N(w));function dx(e,t){if(e==null||t.length===0)return[!1,!1];const i=e.valueOf(),s=t[0],n=t[t.length-1];if(typeof s=="string")return[i===s,i===n];let r=s.valueOf(),o=n.valueOf();return r>o&&([r,o]=[o,r]),[i===r,i===o]}function jn(e,t,i,s,n,r){const[o,a]=dx(t,r),[l,c]=dx(e,n);return{xKey:i,yKey:s,xValue:e,yValue:t,first:l,last:c,min:o,max:a}}function px(e,t,[i,s],n){let r=(0,ux.findMinIndex)(0,t-1,a=>{const l=e===1?a:t-a,c=n(l)?.[1]??NaN;return!Number.isFinite(c)||c>i})??0,o=(0,ux.findMaxIndex)(0,t-1,a=>{const l=e===1?a:t-a,c=n(l)?.[0]??NaN;return!Number.isFinite(c)||c<s})??t-1;return e===-1&&([r,o]=[t-o,t-r]),r=Math.max(r,0),o=Math.min(o+1,t),[r,o]}function ng(e,t,i){if(i){const{x:n,y:r,width:o,height:a}=i;return{canvasX:n+o/2,canvasY:r+a/2}}const s=t.yBar?.upperPoint??t.midPoint??e.datumMidPoint?.(t);if(s){const{x:n,y:r}=tt.toCanvasPoint(e.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(r)}}}function gx(e,t,i,s,n){let r=-1,o=0,a=0,l=!1;for(;o<s&&r<=t-e;){r+=1;const c=i+a;if(l||(a*=-1),a>=0&&(a+=1),l&&a<0&&(a-=1),c<e||c>t){l=!0;continue}n(c)&&(o+=1)}return o}var zh=class{constructor(e,t,i,s){this.domManager=i,this.tooltip=s,this.stateTracker=new zo,this.suppressState=new zo(!1),this.appliedState=null,this.cleanup=new Rw.CleanupRegistry,this.cleanup.register(s.setup(t,i),e.on("dom:hidden",()=>this.tooltip.hide()))}destroy(){this.cleanup.flush()}updateTooltip(e,t,i,s){i??(i=this.stateTracker.get(e)?.content),this.stateTracker.set(e,{meta:t,content:i,pagination:s}),this.applyStates()}removeTooltip(e){this.stateTracker.delete(e),this.applyStates()}suppressTooltip(e){this.suppressState.set(e,!0)}unsuppressTooltip(e){this.suppressState.delete(e)}applyStates(){const e=this.stateTracker.stateId(),t=e?this.stateTracker.get(e):void 0;if(this.suppressState.stateValue()||t?.meta==null||t?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(ft(this.appliedState?.content,t?.content)&&ft(this.appliedState?.pagination,t?.pagination)){const n=this.tooltip.isVisible();this.tooltip.show(s,i,t?.meta,null,void 0,n)}else this.tooltip.show(s,i,t?.meta,t?.content,t?.pagination);this.appliedState=t}static makeTooltipMeta(e,t,i,s){const{canvasX:n,canvasY:r}=e,o=t.properties.tooltip,{placement:a,anchorTo:l,xOffset:c,yOffset:h}=o.position,u=ng(t,i,s);return{canvasX:n,canvasY:r,nodeCanvasX:u?.canvasX??n,nodeCanvasY:u?.canvasY??r,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:a,anchorTo:l,xOffset:c,yOffset:h}}}},fx=(T(),N(w)),mx=3,_w=505,yx=30;function rg(e,t){const{device:i,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}=t;return{type:e,device:i,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function bx(e,t){const i=e*e+t*t,s=mx*mx;return i>=s}function jw(e,t){const i=e.clientX-t.clientX,s=e.clientY-t.clientY,n=i*i+s*s,r=yx*yx;return n<r}var xx=class{constructor(e){this.cleanup=new fx.CleanupRegistry,this.events=new fx.EventEmitter,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.cleanup.register(e.addListener("touchstart",this.onTouchStart.bind(this)),e.addListener("touchmove",this.onTouchMove.bind(this)),e.addListener("touchend",this.onTouchEnd.bind(this)),e.addListener("mousemove",this.onMouseMove.bind(this)),e.addListener("dblclick",this.onDblClick.bind(this)),e.addListener("drag-start",this.onDragStart.bind(this)),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.cleanup.flush()}onTouchStart(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=t,this.touch.clientY=i}onTouchMove(e){const{clientX:t,clientY:i}=e.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-t),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=t,this.touch.clientY=i}onTouchEnd(e){e.sourceEvent.preventDefault()}onMouseMove(e){this.events.emit("mousemove",e)}onDblClick(e){this.events.emit("dblclick",e)}onDragStart(e){this.dragStartEvent=e}onDragMove(e){this.dragStartEvent!=null&&bx(e.originDeltaX,e.originDeltaY)&&(this.events.emit("drag-start",this.dragStartEvent),this.events.emit("drag-move",{...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.events.emit("drag-move",e)}onDragEnd(e){if(this.isDragging){this.events.emit("drag-end",e),this.isDragging=!1;return}if(e.device==="mouse"){const t=rg("click",e);this.events.emit("click",t)}else if(e.sourceEvent.type==="touchend"){if(bx(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const t=rg("click",e);this.events.emit("click",t);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=_w&&jw(this.lastClick,e)){const s=rg("dblclick",e);this.events.emit("dblclick",s),this.lastClick=void 0}else this.lastClick={time:i,clientX:e.clientX,clientY:e.clientY}}}},og=class extends Fo{constructor(e){super(e)}addChildToDOM(){}removeChildFromDOM(){}},zw=class{constructor(e,t){this.seriesWidget=new og(e.getParent("series-area")),this.chartWidget=new og(e.getParent("canvas-proxy")),this.containerWidget=new og(e.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),t.withDragInterpretation&&(this.seriesDragInterpreter=new xx(this.seriesWidget))}destroy(){this.seriesDragInterpreter?.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},ut=(T(),N(w)),Fw=(T(),N(w));function dl(e,t){const[i,s]=wt(t);return(0,Fw.clamp)(i,e,s)}function wt(e){if(e.length===0)return[];const t=[1/0,-1/0];for(const i of e)i<t[0]&&(t[0]=i),i>t[1]&&(t[1]=i);return t}function pl(e){const[t,i]=wt(e);return i-t}var vx=class Qm extends ch{constructor(t=[],i=[]){super(),this.domain=t,this.range=i,this.defaultTickCount=Qm.defaultTickCount,this.defaultClamp=!1}static is(t){return t instanceof Qm}normalizeDomains(...t){return ag(...t)}calcBandwidth(t=1,i=1){const{domain:s}=this,n=this.getPixelRange();if(s.length===0)return n;let o=Math.abs(s[1].valueOf()-s[0].valueOf())/t+1;if(i!==0){const a=Math.floor(n);o=Math.min(o,a)}return n/Math.max(1,o)}convert(t,i){const{domain:s}=this;if(!s||s.length<2||t==null)return NaN;const{range:n}=this,r=i?.clamp??this.defaultClamp;let o=s[0].valueOf(),a=s[1].valueOf(),l=t.valueOf();if(this.transform&&(o=this.transform(o),a=this.transform(a),l=this.transform(l)),r){const[h,u]=wt([o,a]);if(l<h)return n[0];if(l>u)return n[1]}if(o===a)return(n[0]+n[1])/2;if(l===o)return n[0];if(l===a)return n[1];const c=n[0];return c+(l-o)/(a-o)*(n[1]-c)}invert(t,i){const{domain:s}=this;if(s.length<2)return;let n=s[0].valueOf(),r=s[1].valueOf();this.transform&&(n=this.transform(n),r=this.transform(r));const{range:o}=this,[a,l]=o;let c;return a===l?c=this.toDomain((n+r)/2):c=this.toDomain(n+(t-a)/(l-a)*(r-n)),this.transformInvert?this.transformInvert(c):c}getPixelRange(){const[t,i]=this.range;return Math.abs(i-t)}};vx.defaultTickCount=5;var Re=vx;function ag(...e){let t,i=1/0,s,n=-1/0;for(const r of e)for(const o of r){const a=o.valueOf();a<i&&(i=a,t=o),a>n&&(n=a,s=o)}return t!=null&&s!=null?{domain:[t,s],animatable:!0}:{domain:[],animatable:!1}}var Bw=(T(),N(w)),gl=(T(),N(w)),lg=class DI extends ch{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(t){return t instanceof DI}get bandwidth(){return this.refresh(),this._bandwidth}get step(){return this.refresh(),this._step}get inset(){return this.refresh(),this._inset}get rawBandwidth(){return this.refresh(),this._rawBandwidth}set padding(t){t=(0,gl.clamp)(0,t,1),this._paddingInner=t,this._paddingOuter=t}get padding(){return this._paddingInner}set paddingInner(t){this.invalid=!0,this._paddingInner=(0,gl.clamp)(0,t,1)}get paddingInner(){return this._paddingInner}set paddingOuter(t){this.invalid=!0,this._paddingOuter=(0,gl.clamp)(0,t,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&gl.Logger.warnOnce("Expected update to not invalidate scale"))}convert(t,i){this.refresh();const s=this.findIndex(t);return s==null||s<0||s>=this.bands.length?NaN:this.ordinalRange(s)}invertNearestIndex(t){this.refresh();const i=this.bands.length;if(i===0)return-1;let s=0,n=i-1,r=1/0,o=0;for(;s<=n;){const a=(n+s)/2|0,l=this.ordinalRange(a),c=Math.abs(l-t);if(c===0)return a;c<r&&(r=c,o=a),l<t?s=a+1:n=a-1}return o}update(){const[t,i]=this.range;let{_paddingInner:s}=this;const{_paddingOuter:n,round:r,bands:o}=this,a=o.length;if(a===0)return;const l=i-t;let c;a===1?(s=0,c=l*(1-n*2)):c=l/Math.max(1,a-s+n*2);const h=r?Math.floor(c):c;let u=t+(l-h*(a-s))/2,d=h*(1-s);r&&(u=Math.round(u),d=Math.round(d)),this._step=h,this._inset=u,this._bandwidth=d,this._rawBandwidth=c*(1-s)}ordinalRange(t){const{_inset:i,_step:s,range:n}=this,r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return(0,gl.clamp)(r,i+s*t,o)}};f([qa],lg.prototype,"range",2),f([qa],lg.prototype,"round",2);var Lr=lg,wi=class II extends Lr{static is(t){return t instanceof II}toDomain(t){return new Date(t)}convert(t,i){t instanceof Date||(t=new Date(t));const{domain:s,bands:n}=this;if(s.length<=0)return NaN;const r=this.ordinalRange(0),o=this.ordinalRange(n.length-1);if(n.length===0)return r;if(i?.clamp===!0){const{range:v}=this;if(t<n[0])return v[0];if(t>n[n.length-1])return v[1]}const a=i?.interpolate??!1,l=s[0].valueOf()>s[s.length-1].valueOf();if(!a){const v=super.convert(t,i);return l?o-(v-r):v}const c=t.valueOf();let h=this.findIndex(t)??0,u;l?(h=Math.min(Math.max(h,1),n.length-1),u=-1):(h=Math.min(Math.max(h,0),n.length-2),u=1);const d=n[h].valueOf(),p=n[h+u].valueOf(),g=this.ordinalRange(h),y=this.ordinalRange(h+u),m=(c-d)/(p-d)*(y-g)+g;return l?o-(m-r):m}invert(t,i=!1){this.refresh();const{domain:s,bands:n}=this;if(s.length<=0)return;const r=s[0].valueOf()>s[s.length-1].valueOf();let o;return i?o=this.invertNearestIndex(t-this.bandwidth/2):o=(0,Bw.findMinIndex)(0,n.length-1,l=>this.ordinalRange(l)>=t)??n.length-1,n[r?n.length-1-o:o]}},cg=(T(),N(w)),fl={bottomCenter:Ww,center:Uw,clone:Zw,collides:Xw,end:Gw,from:qw,height:Yw,round:Kw,start:Vw,topCenter:Hw,origin:Qw,width:$w};function Vw(e){return{x:e.x1,y:e.y1}}function Gw(e){return{x:e.x2,y:e.y2}}function Hw(e){return{x:(e.x1+e.x2)/2,y:Math.min(e.y1,e.y2)}}function Uw(e){return{x:(e.x1+e.x2)/2,y:(e.y1+e.y2)/2}}function Ww(e){return{x:(e.x1+e.x2)/2,y:Math.max(e.y1,e.y2)}}function $w(e){return Math.abs(e.x2-e.x1)}function Yw(e){return Math.abs(e.y2-e.y1)}function Kw(e){return{x1:Math.round(e.x1),y1:Math.round(e.y1),x2:Math.round(e.x2),y2:Math.round(e.y2)}}function Zw(e){return{x1:e.x1,y1:e.y1,x2:e.x2,y2:e.y2}}function Xw(e,t){const i=hg(e),s=hg(t);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function hg(e){return{x1:Math.min(e.x1,e.x2),x2:Math.max(e.x1,e.x2),y1:Math.min(e.y1,e.y2),y2:Math.max(e.y1,e.y2)}}function qw(e,t,i,s){if(typeof e=="number")return{x1:e,y1:t,x2:i,y2:s};if("width"in e)return hg({x1:e.x,y1:e.y,x2:e.x+e.width,y2:e.y+e.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(e)}] [${t}] [${i}] [${s}]`)}function Qw(){return{x1:0,y1:0,x2:0,y2:0}}function Fh(e,t,i,s,n){return t+(s-t)*((n-e)/(i-e))}function Mx(e,t,i,s,n){return e+(n-t)*((i-e)/(s-t))}function Sx(e,t,i){return[Mx(e,i.min,t,i.max,0),Mx(e,i.min,t,i.max,1)]}function Jw(e,t,i){const[s,n]=Sx(e.x1,e.x2,t),[r,o]=Sx(e.y1,e.y2,i);return{x1:s,x2:n,y1:r,y2:o}}function Dx(e,t,i,s,n,r){if(i<=n&&r<=s)return i;const o=n-i,a=r-s,l=Math.abs(o)<Math.abs(a)?o:a;return(0,cg.clamp)(e,i+l,t)}function eN(e,t,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=t,r=fl.from(i),o=fl.from(e),a=Jw(o,s,n),l=Dx(a.x1,a.x2,o.x1,o.x2,r.x1,r.x2),c=Dx(a.y1,a.y2,o.y1,o.y2,r.y1,r.y2),h={x:{min:Fh(o.x1,s.min,o.x2,s.max,l),max:Fh(o.x1,s.min,o.x2,s.max,l+e.width)},y:{min:Fh(o.y1,n.min,o.y2,n.max,c),max:Fh(o.y1,n.min,o.y2,n.max,c+e.height)}},u=h.x.max-h.x.min,d=h.y.max-h.y.min;return h.x.min=(0,cg.clamp)(0,h.x.min,1-u),h.x.max=h.x.min+u,h.y.min=(0,cg.clamp)(0,h.y.min,1-d),h.y.max=h.y.min+d,h}var tN=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},Ix=e=>(0,ut.attachDescription)((t,{options:i})=>!Re.is(e?.scale)&&!wi.is(e?.scale)||t==null||i.end==null?!0:t<=i.end,"to be less than end"),Ax=class extends Fp{constructor(e,t){super(),this.eventsHub=e,this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new zo(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new tN,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.cleanup.register(e.on("layout:complete",()=>{this.didLayoutAxes=!0;const{pendingMemento:i}=this;i&&this.restoreMemento(i.version,i.mementoVersion,i.memento),this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(e,t){if(e==null)return!0;if(!(0,ut.isObject)(e))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:Ix(i),end:ut.defined},rangeY:{start:Ix(s),end:ut.defined},ratioX:{start:ut.defined,end:ut.defined},ratioY:{start:ut.defined,end:ut.defined},autoScaledAxes:ut.defined},{invalid:r}=(0,ut.validate)(e,n);return r.length>0?(t.push(...r.map(String)),!1):!0}restoreMemento(e,t,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:e,mementoVersion:t,memento:i};return}this.pendingMemento=void 0;const n=this.getDefinedZoom();if(i?.rangeX?n.x=this.rangeToRatio(i.rangeX,"x")??{min:0,max:1}:i?.ratioX?n.x={min:i.ratioX.start??0,max:i.ratioX.end??1}:n.x={min:0,max:1},!this.navigatorModule||this.zoomModule){let a=i?.autoScaledAxes?.includes("y");if(i?.rangeY)a??(a=!1),n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1};else if(i?.ratioY)a??(a=!1),n.y={min:i.ratioY.start??0,max:i.ratioY.end??1};else{a??(a=!0);const l=a?this.getAutoScaleYZoom(n.x):void 0;n.y=l??{min:0,max:1}}n.autoScaleYAxis=a}if(this.lastRestoredState=n,s!==!0){this.updateZoom("zoom-manager",n);return}const r=this.getPrimaryAxis("x"),o=this.getPrimaryAxis("y");for(const a of[r,o])a&&this.updateAxisZoom("zoom-manager",a.id,n[a.direction])}updateAxes(e){this.axes=e;const t=new Map(e.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of e)this.axisZoomManagers.set(i.id,t.get(i.id)??new iN(i));this.state.size>0&&e.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(e=!0){this.independentAxes=e}setAutoScaleYAxis(e,t){this.autoScaleYAxis.enabled=e,this.autoScaleYAxis.padding=t,e&&this.autoScaleYZoom("toggle-auto-scale")}setNavigatorEnabled(e=!0){this.navigatorModule=e}setZoomModuleEnabled(e=!0){this.zoomModule=e}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(e,t){if(t?.x&&(t.x.min<0||t.x.max>1)&&(ut.Logger.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${t.x.min}, max: ${t.x.max} }], expecting a ratio of 0 to 1, ignoring.`),t.x=void 0),t?.y&&(t.y.min<0||t.y.max>1)&&(ut.Logger.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${t.y.min}, max: ${t.y.max} }], expecting a ratio of 0 to 1, ignoring.`),t.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===e)&&this.state.set(e,t);return}this.state.set(e,t);const i=t?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(e,t?.[s.getDirection()])}),this.applyChanges(e)}updateAxisZoom(e,t,i){this.axisZoomManagers.get(t)?.updateZoom(e,i),this.applyChanges(e)}resetZoom(e){this.autoScaleYAxis.manuallyAdjusted=!1;const t=this.getRestoredZoom();this.updateZoom(e,{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1},autoScaleYAxis:t?.autoScaleYAxis??!0})}resetAxisZoom(e,t){const s=this.axisZoomManagers.get(t)?.getDirection();if(s==null)return;const n=this.getRestoredZoom();if(s==="y"){const r=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!r}for(const r of this.axes)r.direction===s&&this.updateAxisZoom(e,r.id,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(e,t){this.axisZoomManagers.get(t)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(e,t,i){const s=this.getPrimaryAxis(t);s&&this.updateAxisZoom(e,s.id,i)}panToBBox(e,t,i){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(t.width>0&&t.height>0&&Math.abs(i.width)<=Math.abs(t.width)&&Math.abs(i.height)<=Math.abs(t.height)))return ut.Logger.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=eN(t,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(e,"x",r.x),this.updatePrimaryAxisZoom(e,"y",r.y)):this.updateZoom(e,r),!0}fireZoomPanStartEvent(e){this.eventsHub.emit("zoom:pan-start",{callerId:e})}extendToEnd(e,t,i){return this.extendWith(e,t,s=>Number(s)-i)}extendWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,r]=n,o=i(r),a=this.rangeToRatio({start:o,end:r},t);a&&this.updateZoom(e,{[t]:a})}updateWith(e,t,i){const s=this.getPrimaryAxis(t);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;let[r,o]=n;[r,o]=i(r,o);const a=this.rangeToRatio({start:r,end:o},t);a&&this.updateZoom(e,{[t]:a})}getZoom(){let e,t;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?e??(e=i.getZoom()):i.getDirection()==="y"&&(t??(t=i.getZoom()))}),e||t)return{x:e,y:t}}getAxisZoom(e){return this.axisZoomManagers.get(e)?.getZoom()??{min:0,max:1}}getAxisZooms(){const e={};for(const[t,i]of this.axisZoomManagers.entries())e[t]={direction:i.getDirection(),zoom:i.getZoom()};return e}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(e){return this.getPrimaryAxis(e)?.id}isVisibleItemsCountAtLeast(e,t){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n=new Set;let r=0;const o=[e.x.min,e.x.max],a=[e.y.min,e.y.max];for(const l of i?.boundSeries??[]){n.add(l.id);const c=t-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=t)return!0}for(const l of s?.boundSeries??[]){if(n.has(l.id))continue;const c=t-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=t)return!0}return n.size===0}getMementoRanges(){const e=this.getDefinedZoom();let t;return this.autoScaleYAxis.enabled&&(t=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(e.x,"x"),rangeY:this.getRangeDirection(e.y,"y"),ratioX:{start:e.x.min,end:e.x.max},ratioY:{start:e.y.min,end:e.y.max},autoScaledAxes:t}}getAutoScaleYZoom(e){if(!this.isZoomEnabled())return;const{independentAxes:t,autoScaleYAxis:i}=this;if(!i.enabled||i.manuallyAdjusted)return;const{padding:s}=i;return e?.min===0&&e?.max===1?{min:0,max:1}:t?this.primaryAxisZoom("y",e,{padding:s}):this.combinedAxisZoom("y",e,{padding:s})}autoScaleYZoom(e,t=!0){const{independentAxes:i}=this,s=this.getZoom();if(s?.x==null)return;const n=this.getAutoScaleYZoom(s.x);if(!(n==null||ft(s.y,n))){if(i){const r=this.getPrimaryAxis("y");(r==null?void 0:this.axisZoomManagers.get(r.id))?.updateZoom("zoom-manager",n)}else for(const r of this.axisZoomManagers.values())r.getDirection()==="y"&&r.updateZoom("zoom-manager",n);t&&this.applyChanges(e)}}applyChanges(e){if(this.autoScaleYZoom(e,!1),!Array.from(this.axisZoomManagers.values(),s=>s.applyChanges()).includes(!0))return;const i={};for(const[s,n]of this.axisZoomManagers.entries())i[s]=n.getZoom();this.eventsHub.emit("zoom:change",{...this.getZoom(),axes:i,callerId:e}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(e,t){const i=this.getPrimaryAxis(t);if(!i||!Re.is(i.scale)&&!wi.is(i.scale))return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,r]=s;let o,a;return n<=r?(o=i.scale.invert(0),a=i.scale.invert(n+(r-n)*e.max)):(o=i.scale.invert(n-(n-r)*e.min),a=i.scale.invert(0)),{start:o,end:a}}rangeToRatio(e,t){const i=this.getPrimaryAxis(t);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,r]=s,{scale:o}=i;let a=e.start==null?n:o.convert(e.start),l=e.end==null?r:o.convert(e.end)+(o.bandwidth??0);if(!(0,ut.isFiniteNumber)(a)||!(0,ut.isFiniteNumber)(l))return;const[c,h]=[Math.min(n,r),Math.max(n,r)];if(a<c||a>h){ut.Logger.warnOnce(`Invalid range start [${e.start}], expecting a value between [${o.invert(n)}] and [${o.invert?.(r)}], ignoring.`);return}if(l<c||l>h){ut.Logger.warnOnce(`Invalid range end [${e.end}], expecting a value between [${o.invert(n)}] and [${o.invert?.(r)}], ignoring.`);return}a=Math.min(h,Math.max(c,a)),l=Math.min(h,Math.max(c,l));const u=r-n,d=Math.abs((a-n)/u),p=Math.abs((l-n)/u);return{min:d,max:p}}getPrimaryAxis(e){return this.axes?.find(t=>t.direction===e)}getDomainExtents(e){const{domain:t}=e.scale,i=t.at(0),s=t.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(e){const[t,i]=e.scale.range;if(!(!(0,ut.isFiniteNumber)(t)||!(0,ut.isFiniteNumber)(i)))return[t,i]}getDefinedZoom(){const e=this.getZoom();return{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1}}}zoomBounds(e,t,i,s){const n=e.scale,r=n.range;n.range=[0,1];const o=t.scale,a=o.range;o.range=[0,1];let l=1,c=!1,h=0,u=!1;for(const g of t.boundSeries){if(!g.visible)continue;const{connectsToYAxis:y}=g,b=g.getRange("y",[i.min,i.max]);for(const m of b){const v=o.convert(m);Number.isFinite(v)&&(v<l&&(l=v,c=!y||m<0),v>h&&(h=v,u=!y||m>0))}}if((0,ut.isFiniteNumber)(t.min)&&(l=0),(0,ut.isFiniteNumber)(t.max)&&(h=1),n.range=r,o.range=a,l>=h)return;const d=(c?s:0)+(u?s:0),p=Math.min((h-l)*(1+d),1);if(!(p<=0)){if(c&&u){const g=(h+l)/2;l=g-p/2,h=g+p/2}else!c&&u?h=l+p:c&&!u&&(l=h-p);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 s=e==="x"?"y":"x",n=this.getPrimaryAxis(s),r=this.getPrimaryAxis(e);if(!(n==null||r==null))return this.zoomBounds(n,r,t,i)}combinedAxisZoom(e,t,{padding:i=0}={}){const s=e==="x"?"y":"x",n=new Map;for(const l of this.axes)if(l.direction===s)for(const c of l.boundSeries)n.set(c,l);let r=1,o=0;for(const l of this.axes)if(l.direction===e)for(const c of l.boundSeries){const h=n.get(c);if(h==null)continue;const u=this.zoomBounds(h,l,t,i);if(u==null)return;r=Math.min(r,u.min),o=Math.max(o,u.max)}const a=1e-6;if(r<a&&(r=0),o>1-a&&(o=1),!(r>o))return{min:r,max:o}}},iN=class{constructor(e){this.axis=e;const[t=0,i=1]=e.visibleRange;this.state=new zo({min:t,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(e,t){this.state.set(e,t)}getZoom(){return Qe(this.state.stateValue())}hasChanges(){const e=this.currentZoom,t=this.state.stateValue();return e.min!==t.min||e.max!==t.max}applyChanges(){const e=this.hasChanges();return this.currentZoom=this.state.stateValue(),e}},GR=(T(),N(w)),ug=(e=>(e[e.Caption=0]="Caption",e[e.Legend=1]="Legend",e[e.ToolbarLeft=2]="ToolbarLeft",e[e.ToolbarBottom=3]="ToolbarBottom",e[e.Navigator=4]="Navigator",e[e.Overlay=5]="Overlay",e))(ug||{}),Lx=class{constructor(e){this.eventsHub=e,this.elements=new Map}registerElement(e,t){return this.elements.has(e)?this.elements.get(e).add(t):this.elements.set(e,new Set([t])),()=>this.elements.get(e)?.delete(t)}createContext(e,t){const i=new sN(e,t);for(const s of Object.values(ug))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(e,t){const{width:i,height:s}=e;this.eventsHub.emit("layout:complete",{axes:t.axes??[],chart:{width:i,height:s},clipSeries:t.clipSeries??!1,series:t.series})}},sN=class{constructor(e,t){this.width=e,this.height=t,this.layoutBox=new W(0,0,e,t)}},kx=(T(),N(w));function nN({point:e,anchor:t},i,s,n,r){if(e.size===0)return!1;let o=e.x,a=e.y;t!=null&&(o-=(t.x-.5)*e.size,a-=(t.y-.5)*e.size);let l=o;o<i?l=i:o>i+n&&(l=i+n);let c=a;a<s?c=s:a>s+r&&(c=s+r);const h=o-l,u=a-c;return Math.sqrt(h*h+u*u)<=e.size*.5}function rN(e){return e!=null&&typeof e.point=="object"&&typeof e.label=="object"}var oN={top:{x:0,y:-1},bottom:{x:0,y:1},left:{x:-1,y:0},right:{x:1,y:0},"top-left":{x:-1,y:-1},"top-right":{x:1,y:-1},"bottom-left":{x:-1,y:1},"bottom-right":{x:1,y:1}};function aN(e,t,i=5){const s=new Map,n=[],r=new Map([...e.entries()].map(([a,l])=>[a,l.toSorted((c,h)=>h.point.size-c.point.size)])),o=[...r.values()].flat();for(const[a,l]of r.entries()){const c=[];if(l[0]?.label){for(let h=0,u=l.length;h<u;h++){const d=l[h],{point:p,label:g,anchor:y}=d,{text:b,width:m,height:v}=g,S=p.size*.5;let M=0,I=0;if(S>0&&d.placement!=null){const F=oN[d.placement];M=(m*.5+S+i)*F.x,I=(v*.5+S+i)*F.y}const k=p.x-m*.5+M-((y?.x??.5)-.5)*p.size,L=p.y-v*.5+I-((y?.y??.5)-.5)*p.size;if(!(0,kx.boxContains)(t,k,L,m,v)||o.some(F=>nN(F,k,L,m,v))||n.some(F=>(0,kx.boxCollides)(F,k,L,m,v)))continue;const _={index:h,text:b,x:k,y:L,width:m,height:v,datum:d};c.push(_),n.push(_)}s.set(a,c)}}return s}var lN=class{constructor(){this.labelData=new Map}updateLabels(e,t,i=W.zero){const s={x:-t.left,y:-t.top,width:i.width+t.left+t.right,height:i.height+t.top+t.bottom},n=new Set(e.map(o=>o.id));for(const o of this.labelData.keys())n.has(o)||this.labelData.delete(o);for(const o of e){const a=o.getLabelData();a.every(rN)&&this.labelData.set(o.id,a)}const r=aN(this.labelData,s,5);for(const o of e)o.updatePlacedLabelData?.(r.get(o.id)??[])}},Cx=(T(),N(w)),cN=class{constructor(e){this.eventsHub=e,this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:e,isFixed:t})=>!e&&!t).map(({enabled:e,seriesId:t,itemId:i,legendItemName:s})=>({visible:e,seriesId:t,itemId:i,legendItemName:s}))}guardMemento(e){return e==null||(0,Cx.isArray)(e)}restoreMemento(e,t,i){i?.forEach(s=>{const{seriesId:n,data:r}=this.getRestoredData(s)??{};!n||!r||this.updateData(n,r)}),this.update()}getRestoredData(e){const{seriesId:t,itemId:i,legendItemName:s,visible:n}=e;if(t){const o=(this.legendDataMap.get(t)??[]).map(a=>{const l=a.seriesId===t&&(!i||a.itemId===i);return l&&a.isFixed&&this.warnFixed(a.seriesId,a.itemId),!a.isFixed&&l?{...a,enabled:n}:a});return{seriesId:t,data:o}}if(!(i==null&&s==null))for(const r of this.getData()){if(i!=null&&r.itemId!==i||s!=null&&r.legendItemName!==s)continue;if(r.isFixed){this.warnFixed(r.seriesId,i);return}const o=(this.legendDataMap.get(r.seriesId)??[]).map(a=>a.itemId===i||a.legendItemName===s?{...a,enabled:n}:a);return{seriesId:r.seriesId,data:o}}}warnFixed(e,t){Cx.Logger.warnOnce(`The legend item with seriesId [${e}] and itemId [${t}] is not configurable, this series item cannot be toggled through the legend.`)}update(e){this.eventsHub.emit("legend:change",{legendData:e??this.getData()})}updateData(e,t=[]){this.legendDataMap.set(e,t)}clearData(){this.legendDataMap.clear()}toggleItem(e,t,i,s){if(s){this.getData().forEach(a=>{const l=(this.legendDataMap.get(a.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:e}:c);this.updateData(a.seriesId,l)});return}const n=this.getData(t),r=n.length===1,o=n.map(a=>i==null&&r||a.itemId===i?{...a,enabled:e}:a);this.updateData(t,o)}getData(e){return e?this.legendDataMap.get(e)??[]:[...this.legendDataMap].reduce((t,[i,s])=>t.concat(s),[])}getDatum({seriesId:e,itemId:t}={}){return this.getData(e).find(i=>i.itemId===t)}getSeriesEnabled(e){const t=this.getData(e);if(t.length>0)return t.some(i=>i.enabled)}getItemEnabled({seriesId:e,itemId:t}={}){return this.getDatum({seriesId:e,itemId:t})?.enabled??!0}},hN=class{constructor(){this.groups=new Map}registerSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;let n=this.groups.get(s);n==null&&(n=new Map,this.groups.set(s,n)),n.set(e,{grouping:t,visible:i})}updateSeries({internalId:e,seriesGrouping:t,visible:i,type:s}){if(!t)return;const n=this.groups.get(s)?.get(e);n&&(n.grouping=t,n.visible=i)}deregisterSeries({internalId:e,type:t}){const i=this.groups.get(t);i!=null&&(i.delete(e),i.size===0&&this.groups.delete(t))}getVisiblePeerGroupIndex({type:e,seriesGrouping:t,visible:i}){if(!t)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set,r=this.groups.get(e);for(const a of r?.values()??[])a.visible&&(s.add(a.grouping.groupIndex),a.grouping.groupIndex===t.groupIndex&&n.add(a.grouping.stackIndex));const o=Array.from(s);return o.sort((a,l)=>a-l),{visibleGroupCount:o.length,visibleSameStackCount:n.size,index:o.indexOf(t.groupIndex)}}},uN=(T(),N(w)),wx=class{constructor(e){this.updateCallback=e,this.events=new uN.EventEmitter}addListener(e,t){return this.events.on(e,t)}destroy(){this.events.clear()}update(e=0,t){this.updateCallback(e,t)}dispatchUpdateComplete(e){this.events.emit("update-complete",{type:"update-complete",apiUpdate:e})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:e}){this.events.emit("process-data",{type:"process-data",series:e})}},dN=class{constructor(e,t){this.eventsHub=new b0.EventEmitter,this.callbackCache=new qb,this.highlightManager=new hx(this.eventsHub),this.formatManager=new Go,this.layoutManager=new Lx(this.eventsHub),this.localeManager=new $C(this.eventsHub),this.seriesStateManager=new hN,this.stateManager=new IC,this.seriesLabelLayoutManager=new lN,this.cleanup=new b0.CleanupRegistry,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:r,fireEvent:o,updateCallback:a,updateMutex:l,styleContainer:c,chartType:h,domMode:u,withDragInterpretation:d}=t;this.chartService=e,this.syncManager=n,this.domManager=new N0(this.eventsHub,this.chartService,r,c,u),this.widgets=new zw(this.domManager,{withDragInterpretation:d});const p=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new Nh({canvasElement:p}),this.scene.setRoot(s),this.cleanup.register(this.scene.on("scene-changed",()=>{this.updateService.update(7)})),this.axisManager=new QC(this.eventsHub,s),this.legendManager=new cN(this.eventsHub),this.annotationManager=new qC(this.eventsHub,e.annotationRoot,o),this.chartTypeOriginator=new MC(e),this.interactionManager=new rx,this.contextMenuRegistry=new cx(this.eventsHub),this.updateService=new wx(a),this.proxyInteractionService=new F0(this.eventsHub,this.localeManager,this.domManager),this.fontManager=new JC(this.domManager,this.updateService),this.historyManager=new DC(this.eventsHub),this.animationManager=new ax(this.interactionManager,l),this.dataService=new Oh(this.eventsHub,e,this.animationManager),this.tooltipManager=new zh(this.eventsHub,this.localeManager,this.domManager,e.tooltip),this.zoomManager=new Ax(this.eventsHub,o);for(const g of Ds.byType("context")){if(!g.chartTypes.includes(h))continue;const y=g.moduleFactory(this);this.contextModules.push(y),this[g.contextKey]=y}}destroy(){this.animationManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.domManager.destroy(),this.fontManager.destroy(),this.proxyInteractionService.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(e=>e.destroy()),this.cleanup.flush()}},Nx=class extends ae{constructor(){super(...arguments),this.range="tooltip"}};f([x],Nx.prototype,"range",2);var Tx=(T(),N(w));function pN(e,t){if(e.size!==t.size)return!1;for(const i of e)if(!t.has(i))return!1;return!0}function gN(e,t){if(e==null||t==null)return e===t;if(e.size!==t.size)return!1;for(const[i,s]of e){const n=t.get(i);if(n==null||!pN(s,n))return!1}return!0}function fN(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1){const{type:s,idsMap:n,scopes:r,data:o,...a}=e[i],{type:l,idsMap:c,scopes:h,data:u,...d}=t[i];if(s!==l||r&&h&&!(0,Tx.arraysEqual)(r,h)||o&&u&&o!==u||!ft(a,d)||!gN(n,c))return!1}return!0}function mN(e,t){const{props:i,...s}=e,{props:n,...r}=t;return ft(s,r)&&fN(i,n)}function yN(e,t,i,s){return t===e.data&&(0,Tx.arraysEqual)(i,e.ids)&&mN(s,e.opts)}var Ox=(T(),N(w)),$t=(T(),N(w)),Ex=class AI{constructor(){this.domain=new Set}static is(t){return t instanceof AI}extend(t){this.domain.add(t)}getDomain(){return Array.from(this.domain)}},zn=class LI{constructor(){this.domain=[1/0,-1/0]}static is(t){return t instanceof LI}static extendDomain(t,i=[1/0,-1/0]){for(const s of t)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(t){this.domain[0]>t&&(this.domain[0]=t),this.domain[1]<t&&(this.domain[1]=t)}getDomain(){return[...this.domain]}},Uo=0,Wo=1,Cs=2,bN=class{constructor(e){const t=e.reduce((r,o)=>Math.max(r,o.length),0);let s=1<<32-Math.clz32(t);t===s/2&&(s=s>>>1),this.maxLevelSize=s;const n=new Float64Array((s*2-1)*2).fill(NaN);for(const r of e)for(let o=0;o<r.length;o+=1){const a=Number(r[o]),l=s+o-1,c=(l*Cs|0)+Uo,h=(l*Cs|0)+Wo,u=n[c],d=n[h];(!Number.isFinite(u)||a<u)&&(n[c]=a),(!Number.isFinite(d)||a>d)&&(n[h]=a)}for(let r=s/2|0;r>=1;r=r/2|0){const o=r-1|0,a=o+r|0;for(let l=0;l<r;l+=1){const c=o+l,h=a+l*2,u=h+1,d=n[(h*Cs|0)+Uo],p=n[(u*Cs|0)+Uo];n[(c*Cs|0)+Uo]=!Number.isFinite(p)||d<p?d:p;const g=n[(h*Cs|0)+Wo],y=n[(u*Cs|0)+Wo];n[(c*Cs|0)+Wo]=!Number.isFinite(y)||g>y?g:y}}this.buffer=n}computeRangeInto(e,t,i,s,n,r,o){const a=n+r-1;if(a<t||n>=i)return o;if(n>=t&&a<i){const l=e[(s*Cs|0)+Uo],c=e[(s*Cs|0)+Wo];Number.isFinite(l)&&(o[0]=Math.min(o[0],l)),Number.isFinite(c)&&(o[1]=Math.max(o[1],c))}else r>1&&(s=s*2|0,r=r/2|0,this.computeRangeInto(e,t,i,s+1|0,n,r,o),this.computeRangeInto(e,t,i,s+2|0,n+r,r,o));return o}rangeBetween(e,t){if(e>t)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,n=[1/0,-1/0];return this.computeRangeInto(s,e,t,0,0,i,n),n}get range(){const{buffer:e}=this;return[e[Uo],e[Wo]]}};function xN(e){if(e.length<=1)return 1;let t=0,i=e[0];for(let s=1;s<e.length;s++){const n=e[s];if(n==null)continue;if(typeof n.valueOf()!="number")return;const o=Math.sign(n-i);if(o!==0){if(t!==0&&t!==o)return;t=o}i=n}return t===0?1:t}var Px=Symbol("sort-orders"),Rx=Symbol("domain-ranges");function vN(e){return e.map(t=>(0,$t.isObject)(t)?JSON.stringify(t):t).join("-")}function di(e){const t=e?.map(Number);return t?.every(Number.isFinite)?t:[]}function dg(e,t){return t?.get(e.id)??0}function MN(e){return"scopes"in e&&Array.isArray(e.scopes)}function pg(e,t){const i=[];for(let s=0;s<e;s+=1)i[s]=t;return i}function Bh(e,t,i){const s=[];for(const n of e){const r=n.get(t)?.[i];if(r==null)return;s.push(r)}return s}function _x(e){const t=[];let i=0,s;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=n.exec(e);){if(s.index!==i)return;i=s.index+s[0].length;const r=s[1].trim();if(r.startsWith("."))t.push(r.slice(1).trim());else if(r.startsWith("[")){const o=r.slice(1,-1).trim();o.startsWith("'")?t.push(o.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):o.startsWith('"')?t.push(o.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):t.push(o)}else t.push(r)}if(i===e.length)return t}function SN(e){return t=>{let i=t;for(const s of e)i=i[s];return i}}var jx=class{constructor(e,t="standalone",i=!1){this.opts=e,this.mode=t,this.suppressFieldDotNotation=i,this.debug=me.create(!0,"data-model"),this.scopeCache=new Map,this.keys=[],this.values=[],this.aggregates=[],this.groupProcessors=[],this.propertyProcessors=[],this.reducers=[],this.processors=[],this.markScopeDatumInvalid=function(a,l,c,h){for(const u of a)h.has(u)||h.set(u,pg(l.length,!1)),h.get(u)[c]=!0};let s=!0;for(const a of e.props){if(a.type==="key"&&!s)throw new Error("AG Charts - internal config error: keys must come before values.");a.type==="value"&&s&&(s=!1)}const n=({matchGroupIds:a=[]})=>{for(const l of a)if(this.values.every(c=>c.groupId!==l))throw new Error(`AG Charts - internal config error: matchGroupIds properties must match defined groups (${l}).`)},r=new Set,o=new Set;for(const a of e.props){const l=a.type==="key"?r:o;switch(MN(a)&&a.scopes?.forEach(c=>l.add(c)),a.type){case"key":this.keys.push({...a,index:this.keys.length,missing:new Map});break;case"value":if(a.property==null)throw new Error(`AG Charts - internal config error: no properties specified for value definitions: ${JSON.stringify(a)}`);this.values.push({...a,index:this.values.length,missing:new Map});break;case"aggregate":n(a),this.aggregates.push({...a,index:this.aggregates.length});break;case"group-value-processor":n(a),this.groupProcessors.push({...a,index:this.groupProcessors.length});break;case"property-value-processor":this.propertyProcessors.push({...a,index:this.propertyProcessors.length});break;case"reducer":this.reducers.push({...a,index:this.reducers.length});break;case"processor":this.processors.push({...a,index:this.processors.length});break}}if(this.opts.groupByKeys||this.opts.groupByFn!=null){const a=new Set(o.values());if(r.forEach(l=>a.delete(l)),a.size>0)throw new Error(`AG Charts - scopes missing key for grouping, illegal configuration: ${[...a.values()]}`)}}resolveProcessedDataDefById(e,t){const i=this.scopeCache.get(e.id)?.get(t);if(!i)throw new Error(`AG Charts - didn't find property definition for [${t}, ${e.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(e,t){return this.resolveProcessedDataDefById(e,t).index}resolveKeysById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${t}, ${e.id}]`);return n.get(e.id)}hasColumnById(e,t){return this.scopeCache.get(e.id)?.get(t)!=null}resolveColumnById(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${t}, ${e.id}]`);return n}*forEachDatum(e,t,i){const s=t.columnScopes.findIndex(n=>n.has(e.id));for(const n of i.datumIndices[s]??[])yield t.columns[s][n]}*forEachGroupDatum(e,t){const i=t.columnScopes.findIndex(r=>r.has(e.id)),s={groupIndex:0,columnIndex:i},n=[];for(const r of t.groups){s.group=r;let o=0;for(const a of r.datumIndices[i]??n)s.datumIndex=a,s.valueIndex=o++,yield s;s.groupIndex++}}*forEachGroupDatumTuple(e,t){const s={columnIndex:t.columnScopes.findIndex(n=>n.has(e.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(e,t))s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=n.group,s.nextGroupIndex=n.groupIndex,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=n.datumIndex,s.group!=null&&s.datumIndexes[1]!=null&&(yield s);s.group=s.nextGroup,s.groupIndex=s.nextGroupIndex,s.nextGroup=void 0,s.nextGroupIndex=void 0,s.datumIndexes[0]=s.datumIndexes[1],s.datumIndexes[1]=s.datumIndexes[2],s.datumIndexes[2]=void 0,s.group!=null&&s.datumIndexes[1]!=null&&(yield s)}getDomain(e,t,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(e,t)]??[]}getDomainBetweenRange(e,t,[i,s],n){const r=t.map(c=>this.resolveProcessedDataIndexById(e,c)),o=r.join(":"),a=n[Rx];let l=a.get(o);if(l==null){const c=r.map(h=>n.columns[h]);l=new bN(c),a.set(o,l)}return l.rangeBetween(i,s)}getSortOrder(e,t,i){const s=this.resolveProcessedDataIndexById(e,t),n=i[Px];let r=n.get(s);if(r==null){const o=i.columns[s];r={sortOrder:xN(o)},n.set(s,r)}return r.sortOrder}getDomainsByType(e,t){switch(e){case"key":return t.domain.keys;case"value":return t.domain.values;case"aggregate":return t.domain.aggValues;case"group-value-processor":return t.domain.groups;default:return null}}processData(e){const{opts:{groupByKeys:t,groupByFn:i},aggregates:s,groupProcessors:n,reducers:r,processors:o,propertyProcessors:a}=this,l=performance.now();if(t&&this.keys.length===0)return;let c=this.extractData(e);t?c=this.groupData(c):i&&(c=this.groupData(c,i(c))),n.length>0&&c.type==="grouped"&&this.postProcessGroups(c),s.length>0&&c.type==="ungrouped"?this.aggregateUngroupedData(c):s.length>0&&c.type==="grouped"&&this.aggregateGroupedData(c),a.length>0&&this.postProcessProperties(c),r.length>0&&this.reduceData(c),o.length>0&&this.postProcessData(c),this.warnDataMissingProperties(e);const h=performance.now();return c.time=h-l,this.debug.check()&&DN(c),this.processScopeCache(),c}warnDataMissingProperties(e){if(e.size!==0)for(const t of(0,$t.iterate)(this.keys,this.values))for(const[i,s]of t.missing){if(s<(e.get(i)?.length??1/0))continue;const n=i==null?"":` for ${i}`;$t.Logger.warnOnce(`the key '${t.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const e of(0,$t.iterate)(this.keys,this.values,this.aggregates))if(e.idsMap)for(const[t,i]of e.idsMap)for(const s of i)if(!this.scopeCache.has(t))this.scopeCache.set(t,new Map([[s,e]]));else{if(this.scopeCache.get(t)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(t).set(s,e)}}valueGroupIdxLookup({matchGroupIds:e}){const t=[];for(const[i,s]of this.values.entries())(!e||s.groupId&&e.includes(s.groupId))&&t.push(i);return t}valueIdxLookup(e,t){const i=e==null||e.length===0,s=typeof t=="string"?t:t.id,n=o=>{if(o.idsMap){for(const[a,l]of o.idsMap)if(e?.includes(a)&&l.has(s))return!0}return!1},r=this.values.reduce((o,a,l)=>((a.scopes==null||i&&!a.scopes.length||a.scopes.some(h=>e?.includes(h)))&&(a.property===s||a.id===s||n(a))&&o.push(l),o),[]);if(r.length===0)throw new Error(`AG Charts - configuration error, unknown property ${JSON.stringify(t)} in scope(s) ${JSON.stringify(e)}`);return r}extractData(e){const{dataDomain:t,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:r}=this,{invalidData:o,invalidKeys:a,allKeyMappings:l}=this.extractKeys(n,e,i),{columns:c,columnScopes:h,partialValidDataCount:u,maxDataLength:d}=this.extractValues(o,r,e,a,i),p=g=>{const y=t.get(g),b=y.getDomain();return zn.is(y)&&b[0]>b[1]?[]:b};return{type:"ungrouped",input:{count:d},scopes:new Set(e.keys()),dataSources:e,aggregation:void 0,keys:[...l.values()],columns:c,columnScopes:h,invalidKeys:a,invalidData:o,domain:{keys:n.map(p),values:r.map(p)},defs:{allScopesHaveSameDefs:s,keys:n,values:r},partialValidDataCount:u,time:0,[Rx]:new Map,[Px]:new Map}}extractKeys(e,t,i){const s=new Map,n=new Map,r=new Map;let o,a;const l=(c,h)=>{const u=a.get(c);o.set(h,o.get(u)),s.has(u)&&(s.set(h,s.get(u)),n.set(h,n.get(u)))};for(const c of e){const{invalidValue:h,scopes:u}=c;o=new Map,a=new Map,r.set(c,o);for(const d of u??[]){const p=t.get(d)??[];if(a.has(p)){l(p,d);continue}const g=[];o.set(d,g),a.set(p,d);let y,b;for(let m=0;m<p.length;m++){if(p[m]==null||typeof p[m]!="object")continue;const v=i(c,p[m],m,d);if(v.valid){g.push(v.value);continue}g.push(h),y??(y=pg(p.length,!1)),b??(b=pg(p.length,!1)),y[m]=!0,b[m]=!0}y&&b&&(s.set(d,y),n.set(d,b))}}return{invalidData:n,invalidKeys:s,allKeyMappings:r}}extractValues(e,t,i,s,n){let r=0;const o=[],a=[];let l=0;for(const c of t){const{invalidValue:h}=c;if(new Set(c.scopes.map(b=>i.get(b))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const d=new Set(c.scopes),p=(0,$t.first)(c.scopes),g=i.get(p),y=new Array;for(let b=0;b<g.length;b++){if(g[b]==null||typeof g[b]!="object")continue;const m=g[b],v=s.get(p)?.[b],S=n(c,m,b,c.scopes);let M=S.value;(v||!S.valid)&&this.markScopeDatumInvalid(c.scopes,g,b,e),v?M=h:S.valid||(r+=1,M=h),y[b]=M}o.push(y),a.push(d),l=Math.max(l,y.length)}return{columns:o,columnScopes:a,partialValidDataCount:r,maxDataLength:l}}groupData(e,t){var i;const s=new Map,{keys:n,columns:r,columnScopes:o,invalidKeys:a,invalidData:l}=e,c=e.scopes,h=new Set;for(const p of c){const g=r.map((M,I)=>I).filter(M=>!h.has(M)&&o[M].has(p));if(g.length===0)continue;for(const M of g)h.add(M);const y=new Set;for(const M of g)for(const I of o[M])y.add(I);const b=n.map(M=>M.get(p)).filter(M=>M!=null),m=r[(0,$t.first)(g)],v=l?.get(p),S=a?.get(p);for(let M=0;M<m.length;M++){if(S?.[M]===!0)continue;const I=b.map(O=>O[M]);if(I==null||I.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const k=t?.(I)??I,L=vN(k),C=s.get(L)??{keys:k,datumIndices:[],validScopes:c};if(s.has(L)||s.set(L,C),v?.[M]===!0){C.validScopes===c&&(C.validScopes=new Set(c.values()));for(const O of y)C.validScopes.delete(O)}for(const O of g)(i=C.datumIndices)[O]??(i[O]=[]),C.datumIndices[O].push(M)}}const u=[],d=[];for(const{keys:p,datumIndices:g,validScopes:y}of s.values())u.push(p),d.push({datumIndices:g,keys:p,aggregation:[],validScopes:y});return{...e,type:"grouped",domain:{...e.domain,groups:u},groups:d}}aggregateUngroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{keys:i,columns:s,dataSources:n}=e,r=(0,$t.first)(n.keys()),o=n.get(r);e.aggregation=o?.map((a,l)=>{const c=[];for(const[h,u]of this.aggregates.entries()){const d=this.valueGroupIdxLookup(u);let p=u.groupAggregateFunction?.()??[1/0,-1/0];const g=d.map(v=>s[v][l]),y=Bh(i,r,l),b=y!=null?u.aggregateFunction(g,y):void 0;b&&(p=u.groupAggregateFunction?.(b,p)??zn.extendDomain(b,p));const m=u.finalFunction?.(p)??p;c[h]=m,zn.extendDomain(m,t[h])}return c})}aggregateGroupedData(e){const t=this.aggregates.map(()=>[1/0,-1/0]);e.domain.aggValues=t;const{columns:i}=e;for(const[s,n]of this.aggregates.entries()){const r=this.valueGroupIdxLookup(n);for(const o of e.groups){o.aggregation??(o.aggregation=[]);const a=o.keys;let l=n.groupAggregateFunction?.()??[1/0,-1/0];const c=Math.max(...r.map(u=>o.datumIndices[u]?.length??0));for(let u=0;u<c;u++){const d=r.map(g=>i[g][o.datumIndices[g]?.[u]]),p=n.aggregateFunction(d,a);p&&(l=n.groupAggregateFunction?.(p,l)??zn.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;o.aggregation[s]=h,zn.extendDomain(h,t[s])}}}postProcessGroups(e){const{groupProcessors:t}=this,{columnScopes:i,columns:s,invalidData:n}=e;for(const r of t){const o=this.valueGroupIdxLookup(r),a=r.adjust()();for(const l of e.groups)a(s,o,l);for(const l of o){const h=this.values[l].valueType==="category",u=s[l],d=(0,$t.first)(i[l]),p=n?.get(d),g=h?new Ex:new zn;for(let y=0;y<u.length;y+=1)p?.[y]!==!0&&g.extend(u[y]);e.domain.values[l]=g.getDomain()}}}postProcessProperties(e){for(const{adjust:t,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))t()(e,n)}reduceData(e){e.reduced??(e.reduced={});const{dataSources:t,keys:i}=e;for(const s of this.reducers){const n=s.reducer();let r=s.initialValue;if(e.type==="grouped")for(const o of e.groups)r=n(r,o.keys);else{const o=(0,$t.first)(t.keys()),a=i.map(h=>h.get(o)).filter(h=>h!=null),l=a.map(()=>{}),c=t.get(o);for(let h=0;h<c.length;h+=1){for(let u=0;u<l.length;u++)l[u]=a[u]?.[h];r=n(r,l)}}e.reduced[s.property]=r}}postProcessData(e){e.reduced??(e.reduced={});for(const t of this.processors)e.reduced[t.property]=t.calculate(e,e.reduced[t.property])}initDataDomainProcessor(){const{keys:e,values:t}=this,i=new Set;for(const h of t)if(h.scopes)for(const u of h.scopes)i.add(u);const s=new Map,n=new Map;let r=!0;const o=()=>{for(const h of(0,$t.iterate)(e,t))h.valueType==="category"?s.set(h,new Ex):(s.set(h,new zn),r&&(r=(h.scopes??[]).length===i.size))};o();const a=this.buildAccessors((0,$t.iterate)(e,t)),l={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(h,u,d,p)=>{let g,y;if(a.has(h.property)){try{y=a.get(h.property)(u)}catch{}g=y!=null}else g=h.property in u,y=g?u[h.property]:h.missingValue;h.forceValue!=null&&(y=g&&(0,$t.isNegative)(y)?-1*h.forceValue:h.forceValue,g=!0),l.missing=!g;const b="missingValue"in h;if(!g&&!b)if(typeof p=="string"){const m=h.missing.get(p)??0;h.missing.set(p,m+1)}else for(const m of p){const v=h.missing.get(m)??0;h.missing.set(m,v+1)}if(s.has(h)||o(),g&&h.validation?.(y,u,d)===!1)if(l.valid=!1,"invalidValue"in h)y=h.invalidValue;else return this.mode!=="integrated"&&$t.Logger.warnOnce(`invalid value of type [${typeof y}] for [${h.scopes} / ${h.id}] ignored:`,`[${y}]`),l.value=void 0,l;else l.valid=!0;if(h.processor){let m=n.get(h);m==null&&(m=h.processor(),n.set(h,m)),y=m(y,d)}return s.get(h)?.extend(y),l.value=y,l},initDataDomain:o,scopes:i,allScopesHaveSameDefs:r}}buildAccessors(e){const t=new Map;if(this.suppressFieldDotNotation)return t;for(const i of e){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=_x(i.property);if(n==null){$t.Logger.warnOnce("Invalid property path [%s]",i.property);continue}const r=SN(n);t.set(i.property,r)}return t}};function DN(e){const t=(i,s)=>{s.length>0&&($t.Logger.log(`DataModel.processData() - ${i}`),$t.Logger.table(s))};$t.Logger.log("DataModel.processData() - processedData",e),t("Key Domains",e.domain.keys),t("Group Domains",e.domain.groups??[]),t("Value Domains",e.domain.values),t("Aggregate Domains",e.domain.aggValues??[])}var zx=class Dn{constructor(t,i){this.mode=t,this.suppressFieldDotNotation=i,this.debug=me.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(t,i,s){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");return new Promise((n,r)=>{this.requested.push({id:t,opts:s,data:i,resolve:n,reject:r})})}execute(t){if(this.status!=="setup")throw new Error("AG Charts - data request after data setup phase.");this.status="executed",this.debug("DataController.execute() - requested",this.requested);const i=this.validateRequests(this.requested);this.debug("DataController.execute() - validated",i);const s=this.mergeRequested(i);this.debug("DataController.execute() - merged",s),this.debug.check()&&((0,Ox.getWindow)().processedData=[]);const n=[];for(const{data:r,ids:o,opts:a,resolves:l,rejects:c}of s){const h=t?.find(p=>yN(p,r,o,a));let u,d;if(h==null)try{u=new jx(a,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(g=>[g.id,g.data]));d=u.processData(p)}catch(p){c.forEach(g=>g(p));continue}else({dataModel:u,processedData:d}=h);n.push({opts:a,data:r,ids:o,dataModel:u,processedData:d}),this.debug.check()&&(0,Ox.getWindow)("processedData").push(d),d?.partialValidDataCount===0?l.forEach(p=>p({dataModel:u,processedData:d})):d?this.splitResult(u,d,o,l):c.forEach(p=>p(new Error("AG Charts - no processed data generated")))}return n}validateRequests(t){const i=[];for(const[s,n]of t.entries())s>0&&n.data.length!==t[0].data.length&&n.opts.groupByData===!1&&n.opts.groupByKeys===!1?n.reject(new Error("all series[].data arrays must be of the same length and have matching keys.")):i.push(n);return i}mergeRequested(t){const i=[];for(const s of t){const n=i.find(Dn.groupMatch(s));n?n.push(s):i.push([s])}return i.map(Dn.mergeRequests)}splitResult(t,i,s,n){for(let r=0;r<s.length;r++){const o=n[r];o({dataModel:t,processedData:i})}}static groupMatch({data:t,opts:i}){function s(c){return c.filter(h=>h.type==="key").map(h=>h.property).join(";")}const{groupByData:n,groupByKeys:r=!1,groupByFn:o,props:a}=i,l=s(a);return([c])=>(n===!1||c.data===t)&&(c.opts.groupByKeys??!1)===r&&c.opts.groupByFn===o&&s(c.opts.props)===l}static mergeRequests(t){const i=new Set(["key","group-value-processor"]);return t.reduce((s,{id:n,data:r,resolve:o,reject:a,opts:{props:l,...c}})=>{s.ids.push(n),s.rejects.push(a),s.resolves.push(o),s.data??(s.data=r),s.opts??(s.opts={...c,props:[]});for(const h of l){const u={...h,scopes:[n],data:r};Dn.createIdsMap(n,u);const d=s.opts.props.find(p=>p.type===u.type&&(i.has(p.type)||p.data===u.data)&&Dn.deepEqual(p,u));if(!d){s.opts.props.push(u);continue}d.scopes??(d.scopes=[]),d.scopes.push(...u.scopes??[]),(d.type==="key"||d.type==="value")&&u.idsMap?.size&&Dn.mergeIdsMap(u.idsMap,d.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(t,i){for(const[s,n]of t){const r=i.get(s);if(r==null)i.set(s,new Set(n));else for(const o of n)r.add(o)}}static createIdsMap(t,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(t)?i.idsMap.get(t).add(i.id):i.idsMap.set(t,new Set([i.id])))}static deepEqual(t,i){if(t===i)return!0;if(t&&i&&typeof t=="object"&&typeof i=="object"){if(t.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(t)){if(n=t.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!Dn.deepEqual(t[s],i[s]))return!1;return!0}const r=Object.keys(t);if(n=r.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const o=r[s];if(!Dn.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!Dn.deepEqual(t[o],i[o])))return!1}return!0}return!1}};zx.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var Fx=zx,IN=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(e,t){this.axesMap.set(e,t.moduleFactory),t.themeTemplate&&this.setThemeTemplate(e,t.themeTemplate)}create(e,t){const i=this.axesMap.get(e);if(i)return i(t);throw new Error(`AG Charts - unknown axis type: ${e}`)}has(e){return this.axesMap.has(e)}keys(){return this.axesMap.keys()}setThemeTemplate(e,t){return this.themeTemplates.set(e,t),this}getThemeTemplate(e){return this.themeTemplates.get(e)}},kr=new IN,ml=[{type:"root",optionsKey:"animation",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"annotations",chartTypes:["cartesian"]},{type:"root",optionsKey:"background",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"foreground",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],optionsInnerKey:"image"},{type:"root",optionsKey:"chartToolbar",chartTypes:["cartesian"]},{type:"root",optionsKey:"contextMenu",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"statusBar",chartTypes:["cartesian"],identifier:"status-bar"},{type:"root",optionsKey:"dataSource",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"]},{type:"root",optionsKey:"sync",chartTypes:["cartesian"]},{type:"root",optionsKey:"zoom",chartTypes:["cartesian","topology"]},{type:"root",optionsKey:"ranges",chartTypes:["cartesian"]},{type:"legend",optionsKey:"gradientLegend",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],identifier:"gradient"},{type:"root",optionsKey:"navigator",chartTypes:["cartesian"]},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"angle-number"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-category"},{type:"axis",optionsKey:"axes[]",chartTypes:["polar"],identifier:"radius-number"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"bar",community:!0},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"line",community:!0},{type:"axis",optionsKey:"axes[]",chartTypes:["cartesian"],identifier:"ordinal-time"},{type:"axis-option",optionsKey:"crosshair",chartTypes:["cartesian"]},{type:"axis-option",optionsKey:"bandHighlight",chartTypes:["cartesian"]},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"box-plot"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"candlestick"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"cone-funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"funnel"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"ohlc"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"heatmap"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-area"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"range-bar"},{type:"series",optionsKey:"series[]",chartTypes:["cartesian"],identifier:"waterfall"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"nightingale"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-area"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radar-line"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-bar"},{type:"series",optionsKey:"series[]",chartTypes:["polar"],identifier:"radial-column"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"sunburst"},{type:"series",optionsKey:"series[]",chartTypes:["hierarchy"],identifier:"treemap"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-marker"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-shape-background"},{type:"series",optionsKey:"series[]",chartTypes:["topology"],identifier:"map-line-background"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"chord"},{type:"series",optionsKey:"series[]",chartTypes:["flow-proportion"],identifier:"sankey"},{type:"series",optionsKey:"series[]",chartTypes:["standalone"],identifier:"pyramid"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"linear-gauge"},{type:"series",optionsKey:"series[]",chartTypes:["gauge"],identifier:"radial-gauge"},{type:"series-option",optionsKey:"errorBar",chartTypes:["cartesian"],identifier:"error-bars"},{type:"context",contextKey:"sharedToolbar",chartTypes:["cartesian"]}];function Cr(e){return ml.find(t=>t.type==="series"&&t.identifier===e)?.chartTypes}function AN(e){return Cr(e)?.find(i=>i==="cartesian")==="cartesian"}function LN(e){return Cr(e)?.find(i=>i==="polar")==="polar"}function kN(e){return Cr(e)?.find(i=>i==="hierarchy")==="hierarchy"}function CN(e){return Cr(e)?.find(i=>i==="topology")==="topology"}function wN(e){return Cr(e)?.find(i=>i==="flow-proportion")==="flow-proportion"}function NN(e){return Cr(e)?.find(i=>i==="standalone")==="standalone"}function TN(e){return Cr(e)?.find(i=>i==="gauge")==="gauge"}function ON(e){return e.packageType==="enterprise"}function EN(e){if(!ON(e))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const t=ml.find(i=>i.type===e.type&&("optionsKey"in i&&"optionsKey"in e?i.optionsKey===e.optionsKey:!0)&&("contextKey"in i&&"contextKey"in e?i.contextKey===e.contextKey:!0)&&i.identifier===e.identifier&&e.chartTypes.every(s=>i.chartTypes.includes(s)));return t&&(t.useCount??(t.useCount=0),t.useCount++),t!=null}function PN(){return ml.filter(({useCount:e})=>e==null||e===0)}var RN=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(e,{optionsKey:t,moduleFactory:i,themeTemplate:s}){this.legendMap.set(e,{optionsKey:t,moduleFactory:i}),this.themeTemplates.set(t,s)}create(e,t){const i=this.legendMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown legend type: ${e}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((e,[t,i])=>(e[t]=i.optionsKey,e),{})}},gg=new RN,Bx=class extends Map{get(e){return super.get(e)??"unknown"}isCartesian(e){return this.get(e)==="cartesian"}isPolar(e){return this.get(e)==="polar"}isHierarchy(e){return this.get(e)==="hierarchy"}isTopology(e){return this.get(e)==="topology"}isFlowProportion(e){return this.get(e)==="flow-proportion"}isStandalone(e){return this.get(e)==="standalone"}isGauge(e){return this.get(e)==="gauge"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(e=>this.isCartesian(e))}get polarTypes(){return this.seriesTypes.filter(e=>this.isPolar(e))}get hierarchyTypes(){return this.seriesTypes.filter(e=>this.isHierarchy(e))}get topologyTypes(){return this.seriesTypes.filter(e=>this.isTopology(e))}get flowProportionTypes(){return this.seriesTypes.filter(e=>this.isFlowProportion(e))}get standaloneTypes(){return this.seriesTypes.filter(e=>this.isStandalone(e))}get gaugeTypes(){return this.seriesTypes.filter(e=>this.isGauge(e))}},_N=class extends Map{set(e,t){return super.set(e,Le(t,this.get(e)))}},Ve=new Bx,jN=new Bx,fg=new _N,zN=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(e,{chartTypes:[t],moduleFactory:i,defaultAxes:s,themeTemplate:n,solo:r,stackable:o,groupable:a,stackedByDefault:l,hidden:c}){this.setThemeTemplate(e,n),this.seriesMap.set(e,{moduleFactory:i,defaultAxes:s,solo:r,stackable:o,groupable:a,stackedByDefault:l}),Ve.set(e,t),c||jN.set(e,t)}create(e,t){const i=this.seriesMap.get(e)?.moduleFactory;if(i)return i(t);throw new Error(`AG Charts - unknown series type: ${e}`)}cloneDefaultAxes(e){const t=this.seriesMap.get(e)?.defaultAxes;return t==null?null:{axes:Qe(t)}}setThemeTemplate(e,t){const i=this.themeTemplates.get(e);this.themeTemplates.set(e,Le(t,i))}getThemeTemplate(e){return this.themeTemplates.get(e)}isSolo(e){return this.seriesMap.get(e)?.solo??!1}isGroupable(e){return this.seriesMap.get(e)?.groupable??!1}isStackable(e){return this.seriesMap.get(e)?.stackable??!1}isStackedByDefault(e){return this.seriesMap.get(e)?.stackedByDefault??!1}},ss=new zN,HR=(T(),N(w)),mg=class In{constructor(t){this.chart=t}subscribe(t=In.DEFAULT_GROUP){let i=this.get(t);return i||(i={members:new Set},In.chartsGroups.set(t,i)),i.members.add(this.chart),this}unsubscribe(t=In.DEFAULT_GROUP){const i=this.get(t);return i?.members.delete(this.chart),delete i?.domains?.x?.sources?.[this.chart.id],delete i?.domains?.y?.sources?.[this.chart.id],this}getChart(){return this.chart}getGroupState(t=In.DEFAULT_GROUP){return this.get(t)}getGroupMembers(t=In.DEFAULT_GROUP){const i=this.get(t);return i?Array.from(i.members):[]}getGroupSiblings(t=In.DEFAULT_GROUP){return this.getGroupMembers(t).filter(i=>i!==this.chart)}getGroupSyncMode(t=In.DEFAULT_GROUP){return this.getGroupMembers(t).some(i=>i.series.length>1)?"multi-series":"single-series"}get(t){return In.chartsGroups.get(t)}};mg.chartsGroups=new Map,mg.DEFAULT_GROUP=Symbol("sync-group-default");var FN=mg,yg=class extends ae{constructor(){super(...arguments),this.enabled=!1}};f([x],yg.prototype,"enabled",2),f([x],yg.prototype,"tabIndex",2);var Vh=(T(),N(w)),Vx={};is(Vx,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>ns,fromToMotion:()=>Je,staticFromToMotion:()=>en});var ns={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Je(e,t,i,s,n,r,o){const{fromFn:a,toFn:l,applyFn:c=(g,y)=>g.setProperties(y)}=n,{nodes:h,selections:u}=jh(s),d=(g,y)=>{let b,m=0,v=0;for(const S of y){const M=g[m]===S,I={last:v>=y.length-1,lastLive:m>=g.length-1,prev:y[v-1],prevFromProps:b,prevLive:g[m-1],next:y[v+1],nextLive:g[m+(M?1:0)]},k=`${e}_${t}_${S.id}`;i.stopByAnimationId(k);let L="unknown";M?r&&o&&(L=BN(S,S.datum,r,o)):L="removed",S.transitionOut=L==="removed";const{phase:C,start:O,finish:E,delay:_,duration:F,...j}=a(S,S.datum,L,I),{phase:Q,start:ne,finish:le,delay:xe,duration:pe,...be}=l(S,S.datum,L,I),ue=E==null;i.animate({id:k,groupId:e,phase:C??Q??"update",duration:F??pe,delay:_??xe,from:j,to:be,ease:hl,collapsable:ue,onPlay:()=>{const $={...O,...ne,...j};c(S,$,"start")},onUpdate($){c(S,$,"update")},onStop:()=>{const $={...O,...ne,...j,...be,...E,...le};c(S,$,"end")}}),M&&m++,v++,b=j}};let p=0;for(const g of u){const y=g.nodes(),b=y.filter(m=>!g.isGarbage(m));d(b,y),i.animate({id:`${e}_${t}_selection_${p}`,groupId:e,phase:"end",from:0,to:1,ease:hl,onStop(){g.cleanup()}}),p++}d(h,h)}function en(e,t,i,s,n,r,o){const{nodes:a,selections:l}=jh(s),{start:c,finish:h,phase:u}=o;i.animate({id:`${e}_${t}`,groupId:e,phase:u??"update",from:n,to:r,ease:hl,onPlay:()=>{if(c){for(const d of a)d.setProperties(c);for(const d of l)for(const p of d.nodes())p.setProperties(c)}},onUpdate(d){for(const p of a)p.setProperties(d);for(const p of l)for(const g of p.nodes())g.setProperties(d)},onStop:()=>{for(const d of a)d.setProperties({...r,...h});for(const d of l){for(const p of d.nodes())p.setProperties({...r,...h});d.cleanup()}}})}function BN(e,t,i,s){const n=i(e,t);return s.added.has(n)?"added":s.removed.has(n)?"removed":e.previousDatum==null&&e.datum!=null?"added":e.previousDatum!=null&&e.datum==null?"removed":"updated"}var Gx={};is(Gx,{resetMotion:()=>Nt});function Nt(e,t){const{nodes:i,selections:s}=jh(e);for(const n of s){for(const r of n.nodes()){const o=t(r,r.datum);r.setProperties(o)}n.cleanup()}for(const n of i){const r=t(n,n.datum);n.setProperties(r)}}var bt=class fo{constructor(t,i,s=!0){this.parentNode=t,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=me.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(Ws,i)?()=>new i:i}static select(t,i,s=!0){return new fo(t,i,s)}static selectAll(t,i){const s=[],n=r=>{if(i(r)&&s.push(r),r instanceof re)for(const o of r.children())n(o)};return n(t),s}static selectByClass(t,...i){return fo.selectAll(t,s=>i.some(n=>s instanceof n))}static selectByTag(t,i){return fo.selectAll(t,s=>s.tag===i)}createNode(t,i,s){const n=this.nodeFactory(t);return n.datum=t,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(t,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",t),s){const n=new Map(t.map((r,o)=>[s(r),[r,o]]));for(const[r,o]of this._nodesMap.entries())if(n.has(o)){const[a]=n.get(o);r.datum=a,this.garbageBin.delete(r),n.delete(o)}else this.garbageBin.add(r);for(const[r,[o,a]]of n.entries())this._nodesMap.set(this.createNode(o,i,a),r)}else{const n=Math.max(t.length,this.data.length);for(let r=0;r<n;r++)r>=t.length?this.garbageBin.add(this._nodes[r]):r>=this._nodes.length?this.createNode(t[r],i):(this._nodes[r].datum=t[r],this.garbageBin.delete(this._nodes[r]))}return this.data=t.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return this.garbageBin.size===0?this:(this._nodes=this._nodes.filter(t=>this.garbageBin.has(t)?(this._nodesMap.delete(t),this.garbageBin.delete(t),t.destroy(),!1):!0),this)}clear(){return this.update([]),this}isGarbage(t){return this.garbageBin.has(t)}each(t){for(const i of this._nodes.entries())t(i[1],i[1].datum,i[0]);return this}*[Symbol.iterator](){for(let t=0;t<this._nodes.length;t++){const i=this._nodes[t];yield{node:i,datum:i.datum,index:t}}}select(t){return fo.selectAll(this.parentNode,t)}selectByClass(t){return fo.selectByClass(this.parentNode,t)}selectByTag(t){return fo.selectByTag(this.parentNode,t)}nodes(){return this._nodes}at(t){return this._nodes.at(t)}get length(){return this._nodes.length}},VN=(T(),N(w)),pi=class extends ht{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.fill=void 0,this.strokeWidth=1}set x(e){this.x1=e,this.x2=e}set y(e){this.y1=e,this.y2=e}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new W(Math.min(this.x1,this.x2),Math.min(this.y1,this.y2),Math.abs(this.x2-this.x1),Math.abs(this.y2-this.y1))}isPointInPath(e,t){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(e,t):!1}distanceSquared(e,t){const{x1:i,y1:s,x2:n,y2:r}=this;return ph(e,t,i,s,n,r,1/0)}render(e){const{ctx:t,devicePixelRatio:i}=e;let{x1:s,y1:n,x2:r,y2:o}=this;if(s===r){const{strokeWidth:a}=this,l=Math.round(s*i)/i+Math.trunc(a*i)%2/(i*2);s=l,r=l}else if(n===o){const{strokeWidth:a}=this,l=Math.round(n*i)/i+Math.trunc(a*i)%2/(i*2);n=l,o=l}t.beginPath(),t.moveTo(s,n),t.lineTo(r,o),this.fillStroke(t),this.fillShadow?.markClean(),super.render(e)}toSVG(){if(!this.visible)return;const e=(0,VN.createSvgElement)("line");return e.setAttribute("x1",String(this.x1)),e.setAttribute("y1",String(this.y1)),e.setAttribute("x2",String(this.x2)),e.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(e),{elements:[e]}}};pi.className="Line",f([z()],pi.prototype,"x1",2),f([z()],pi.prototype,"y1",2),f([z()],pi.prototype,"x2",2),f([z()],pi.prototype,"y2",2);var bg="color: green",xg="color: grey";function GN(){return xb(()=>{})}function vg(e,t){const i=xr(t);if(i.length===0)return;const s=vb(e);for(const n of i)n in s&&(t[n]=s[n])}var Hx=class{transitionRoot(e,t){this.parent?this.parent.transitionRoot(e,t):this.transition(e,t)}},Mg=class Di extends Hx{constructor(t,i,s){super(),this.defaultState=t,this.states=i,this.enterEach=s,this.debug=me.create(!0,"animation"),this.state=t,this.debug(`%c${this.constructor.name} | init -> ${t}`,bg)}transition(t,i){if(!this.transitionChild(t,i)||this.state===Di.child||this.state===Di.parent)return;const n=this.state,r=this.states[this.state];let o=r[t];const a=`%c${this.constructor.name} | ${this.state} -> ${t} ->`;if(Array.isArray(o))o=o.find(h=>{if(!h.guard)return!0;const u=h.guard(i);return u||this.debug(`${a} (guarded)`,h.target,xg),u});else if(typeof o=="object"&&!(o instanceof Di)&&o.guard&&!o.guard(i)){this.debug(`${a} (guarded)`,o.target,xg);return}if(!o){this.debug(`${a} ${this.state}`,xg);return}const l=this.getDestinationState(o),c=l===this.state?void 0:r.onExit;this.debug(`${a} ${l}`,bg),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof Di)&&o.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==Di.child&&l!==Di.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(t,i){setTimeout(()=>{this.transition(t,i)},0)}is(t){return this.state===Di.child&&this.childState?this.childState.is(t):this.state===t}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(t,i){return this.state!==Di.child||!this.childState||(vg(this,this.childState),this.childState.transition(t,i),!this.childState.is(Di.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${t} -> ${this.defaultState}`,bg),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(t){let i=this.state;return typeof t=="string"?i=t:t instanceof Di?(this.childState=t,this.childState.parent=this,i=Di.child):typeof t=="object"&&(t.target instanceof Di?(this.childState=t.target,this.childState.parent=this,i=Di.child):t.target!=null&&(i=t.target)),i}};Mg.child="__child",Mg.parent="__parent";var yl=Mg,HN=class extends Hx{constructor(...e){super(),this.stateMachines=e;for(const t of e)t.parent=this}transition(e,t){for(const i of this.stateMachines)vg(this,i),i.transition(e,t)}transitionAsync(e,t){for(const i of this.stateMachines)vg(this,i),i.transitionAsync(e,t)}},Sg=(T(),N(w)),Dg=(T(),N(w)),Ig=class{constructor(){this.moduleMap=new Map}*modules(){for(const e of this.moduleMap.values())yield e.moduleInstance}addModule(e,t){if(this.moduleMap.has(e.optionsKey))throw new Error(`AG Charts - module already initialised: ${e.optionsKey}`);this.moduleMap.set(e.optionsKey,{module:e,moduleInstance:t(e)})}removeModule(e){const t=(0,Dg.isString)(e)?e:e.optionsKey;this.moduleMap.get(t)?.moduleInstance.destroy(),this.moduleMap.delete(t)}getModule(e){return this.moduleMap.get((0,Dg.isString)(e)?e:e.optionsKey)?.moduleInstance}isEnabled(e){return this.moduleMap.has((0,Dg.isString)(e)?e:e.optionsKey)}mapModules(e){return Array.from(this.moduleMap.values(),(t,i)=>e(t.moduleInstance,i))}destroy(){for(const e of this.moduleMap.keys())this.moduleMap.get(e)?.moduleInstance.destroy();this.moduleMap.clear()}},UN=(T(),N(w)),ws=class extends ht{constructor(e={}){super(e),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.horizontal=!1,this.strokeWidth=1}computeBBox(){return new W(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(e,t){return!1}render(e){const{ctx:t}=e;let{x1:i,y1:s,x2:n,y2:r}=this;i=this.align(i),s=this.align(s),n=this.align(n),r=this.align(r);const{fill:o,horizontal:a}=this,{globalAlpha:l}=t;o!=null&&(this.applyFillAndAlpha(t),t.beginPath(),t.moveTo(i,s),t.lineTo(n,s),t.lineTo(n,r),t.lineTo(i,r),t.closePath(),t.fill(),t.globalAlpha=l);const{stroke:c,strokeWidth:h,startLine:u,endLine:d}=this;if(!!((u||d)&&c&&h)){const{lineDash:g,lineDashOffset:y,lineCap:b,lineJoin:m}=this;this.applyStrokeAndAlpha(t),t.lineWidth=h,g&&t.setLineDash([...g]),y&&(t.lineDashOffset=y),b&&(t.lineCap=b),m&&(t.lineJoin=m),t.beginPath(),u&&(t.moveTo(i,s),a?t.lineTo(i,r):t.lineTo(n,s)),d&&(t.moveTo(n,r),a?t.lineTo(n,s):t.lineTo(i,r)),t.stroke(),t.globalAlpha=l}this.fillShadow?.markClean(),super.render(e)}};ws.className="Range",f([z()],ws.prototype,"x1",2),f([z()],ws.prototype,"y1",2),f([z()],ws.prototype,"x2",2),f([z()],ws.prototype,"y2",2),f([z()],ws.prototype,"startLine",2),f([z()],ws.prototype,"endLine",2),f([z()],ws.prototype,"horizontal",2);var Gh=(T(),N(w));function WN(e){return e!=null&&Object.hasOwn(e,"toString")&&(0,Gh.isString)(e.toString())}function $N(e){return e!=null&&Object.hasOwn(e,"valueOf")&&(0,Gh.isFiniteNumber)(e.valueOf())}function Hh(e){return(0,Gh.isFiniteNumber)(e)||(0,Gh.isValidDate)(e)||$N(e)}function YN(e,t){return e!=null&&(!t||Hh(e))}function Ag(e){return WN(e)&&Object.hasOwn(e,"id")?e.id:e}function Ux(e){switch(e.type){case"line":return e.value;case"range":return e.range}}function Wx(e,t){const i=Ux(e);if(i==null)return!1;const s=Re.is(t)||wi.is(t),n=r=>YN(r,s)&&!isNaN(t.convert(r,{clamp:!0}));if(e.type==="range"){const[r,o]=i;return n(r)&&n(o)}else return n(i)}var KN={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:-1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},ZN={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:-1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},XN={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:-1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:-1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},qN={top:{rangeH:0,rangeV:-1,labelH:0,labelV:1},"inside-top":{rangeH:0,rangeV:-1,labelH:0,labelV:-1},"top-left":{rangeH:-1,rangeV:-1,labelH:1,labelV:-1},"inside-top-left":{rangeH:-1,rangeV:-1,labelH:-1,labelV:-1},left:{rangeH:-1,rangeV:0,labelH:1,labelV:0},"inside-left":{rangeH:-1,rangeV:0,labelH:-1,labelV:0},"bottom-left":{rangeH:-1,rangeV:1,labelH:1,labelV:1},"inside-bottom-left":{rangeH:-1,rangeV:1,labelH:-1,labelV:1},bottom:{rangeH:0,rangeV:1,labelH:0,labelV:-1},"inside-bottom":{rangeH:0,rangeV:1,labelH:0,labelV:1},"bottom-right":{rangeH:1,rangeV:1,labelH:-1,labelV:1},"inside-bottom-right":{rangeH:1,rangeV:1,labelH:1,labelV:1},right:{rangeH:1,rangeV:0,labelH:-1,labelV:0},"inside-right":{rangeH:1,rangeV:0,labelH:1,labelV:0},"top-right":{rangeH:1,rangeV:-1,labelH:-1,labelV:-1},"inside-top-right":{rangeH:1,rangeV:-1,labelH:1,labelV:-1},inside:{rangeH:0,rangeV:0,labelH:0,labelV:0}},Fi=class extends ae{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};f([x],Fi.prototype,"enabled",2),f([x],Fi.prototype,"text",2),f([x],Fi.prototype,"fontStyle",2),f([x],Fi.prototype,"fontWeight",2),f([x],Fi.prototype,"fontSize",2),f([x],Fi.prototype,"fontFamily",2),f([x],Fi.prototype,"padding",2),f([x],Fi.prototype,"color",2),f([x],Fi.prototype,"position",2),f([x],Fi.prototype,"rotation",2),f([x],Fi.prototype,"parallel",2);var ai=class extends ae{constructor(){super(),this.id=(0,UN.createId)(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Fi,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.position="top",this.rangeGroup=new re({name:this.id}),this.lineGroup=new re({name:this.id}),this.labelGroup=new re({name:this.id}),this.crossLineRange=new ws,this.crossLineLabel=new Po,this.data=void 0,this.startLine=!1,this.endLine=!1,this._isRange=void 0,this.lineGroup.append(this.crossLineRange),this.labelGroup.append(this.crossLineLabel),this.crossLineRange.pointerEvents=1}get defaultLabelPosition(){return"top"}update(e){const{enabled:t,type:i,data:s,scale:n}=this;if(!n||!t||!e||!Wx(this,n)||s==null){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.updateNodes();const r=i==="range";r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(e){if(this.data=void 0,!e)return;const{type:t,range:i,value:s,scale:n,clippedRange:r,strokeWidth:o=0}=this;if(!n)return;const a=n.bandwidth??0,l=n.step??0,c=n instanceof Lr?(l-a)/2:0,[h,u]=wt(r);let d,p,g,y;if(t==="line"){const b=a/2;if(d=n.convert(s)+b,p=NaN,g=n.convert(s,{clamp:!0})+b,y=NaN,g>=u||g<=h)return}else if(i){const[b,m]=i;if(d=n.convert(b),p=n.convert(m),g=n.convert(b,{clamp:!0}),y=n.convert(m,{clamp:!0}),g>y&&([g,y]=[y,g],[d,p]=[p,d]),g>=u||y<=h)return;Number.isFinite(d)&&(g-=c),Number.isFinite(p)&&(p+=a,y+=a+c)}else return;g=dl(g,r),y=dl(y,r),d-c>=g&&(d-=c),p+c<=y&&(p+=c),this.startLine=o>0&&d>=g&&d<=g+c,this.endLine=o>0&&p>=y-a-c&&p<=y,this.data=[g,y],this.label.enabled===!1||this.label.text}updateNodes(){const{position:e,data:[t,i]=[0,0],gridLength:s}=this,n=Number.isFinite(i)?i-t:0;let r;switch(e){case"top":case"bottom":r=new W(t,e==="top"?0:-s,n,s);break;case"left":case"right":r=new W(e==="left"?0:-s,t,s,n)}this.updateRangeNode(r);const{label:o}=this;o.enabled!==!1&&o.text&&(this.updateLabel(),this.positionLabel(r))}updateRangeNode(e){const{type:t,position:i,crossLineRange:s,startLine:n,endLine:r,fill:o,fillOpacity:a,stroke:l,strokeWidth:c,strokeOpacity:h,lineDash:u}=this;s.x1=e.x,s.x2=e.x+e.width,s.y1=e.y,s.y2=e.y+e.height,s.horizontal=i==="top"||i==="bottom",s.startLine=n,s.endLine=r,s.fill=t==="range"?o:void 0,s.fillOpacity=a??1,s.stroke=l,s.strokeWidth=c??1,s.strokeOpacity=h??1,s.lineDash=u}updateLabel(){const{crossLineLabel:e,label:t}=this;t.text&&(e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.fontSize=t.fontSize,e.fontFamily=t.fontFamily,e.fill=t.color,e.text=t.text)}get anchor(){const e=this.position==="left"||this.position==="right",t=this.type==="range",{position:i=this.defaultLabelPosition}=this.label;return t?(e?XN:qN)[i]:(e?KN:ZN)[i]}positionLabel(e){const{crossLineLabel:t,label:i,anchor:s}=this;t.rotation=mt(i.rotation??0),t.textBaseline="middle",t.textAlign="center";const n=t.getBBox();if(!n)return;const{width:r,height:o}=n,a=i.padding+r/2,l=i.padding+o/2,c=e.x+e.width*(s.rangeH+1)/2-a*s.labelH,h=e.y+e.height*(s.rangeV+1)/2-l*s.labelV;t.x=c,t.y=h,t.rotationCenterX=c,t.rotationCenterY=h}computeLabelSize(){const{label:e}=this;if(e.enabled===!1||!e.text)return;const t=new Po;t.fontFamily=e.fontFamily,t.fontSize=e.fontSize,t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.text=e.text,t.rotation=mt(e.rotation??0),t.textBaseline="middle",t.textAlign="center";const i=t.getBBox();if(!i)return;const{width:s,height:n}=i;return{width:s,height:n}}calculatePadding(e){const{label:t,anchor:i}=this,s=this.computeLabelSize();if(!s)return;const{width:n,height:r}=s,o=t.padding+n,a=t.padding+r,l=this.position==="left"||this.position==="right";l&&(i.rangeH===-1&&i.labelH===1?e.left=Math.max(e.left??0,o):i.rangeH===1&&i.labelH===-1&&(e.right=Math.max(e.right??0,o))),l||(i.rangeV===-1&&i.labelV===1?e.top=Math.max(e.top??0,a):i.rangeV===1&&i.labelV===-1&&(e.bottom=Math.max(e.bottom??0,a)))}};ai.className="CrossLine",f([x],ai.prototype,"enabled",2),f([x],ai.prototype,"type",2),f([x],ai.prototype,"range",2),f([x],ai.prototype,"value",2),f([x],ai.prototype,"defaultColorRange",2),f([x],ai.prototype,"fill",2),f([x],ai.prototype,"fillOpacity",2),f([x],ai.prototype,"stroke",2),f([x],ai.prototype,"strokeWidth",2),f([x],ai.prototype,"strokeOpacity",2),f([x],ai.prototype,"lineDash",2),f([x],ai.prototype,"label",2);var Uh=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};f([x],Uh.prototype,"enabled",2),f([x],Uh.prototype,"width",2),f([x],Uh.prototype,"style",2);var $o=class extends ae{};f([x],$o.prototype,"step",2),f([x],$o.prototype,"values",2),f([x],$o.prototype,"minSpacing",2),f([x],$o.prototype,"maxSpacing",2);var Tt=class extends ae{constructor(){super(...arguments),this.enabled=!0,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1,this._formatters={"component:year":void 0,"component:month":void 0,"component:day":void 0,"component:none":void 0,"long:year":void 0,"long:month":void 0,"long:day":void 0,"long:none":void 0}}getSideFlag(){return this.mirrored?1:-1}formatValue(e,t,i,s={dateStyle:"long",truncateDate:void 0}){const{formatter:n,format:r}=this,{type:o,value:a,domain:l,boundSeries:c}=t,h=t.type==="number"?t.fractionDigits:void 0,u=t.type==="date"?t.unit:void 0;let d;if(n!=null){const p=t.type==="date"?t.step:void 0;d=e(n,{value:a,index:i,domain:l,fractionDigits:h,unit:u,step:p,boundSeries:c})}if(r!=null&&d==null){const{specifier:p,dateStyle:g,truncateDate:y}=s,b=`${g}:${y??"none"}`;let m=this._formatters[b];const v=Go.mergeSpecifiers(p,r);(m==null||m.type!==o||m.unit!==u||!ft(m.mergedFormat,v))&&(m={type:o,mergedFormat:v,unit:u,formatter:Go.getFormatter(o,v,u,g,s)},this._formatters[b]=m),d=m.formatter?.(a,h)}return d!=null?String(d):void 0}};f([x],Tt.prototype,"enabled",2),f([x],Tt.prototype,"fontStyle",2),f([x],Tt.prototype,"fontWeight",2),f([x],Tt.prototype,"fontSize",2),f([x],Tt.prototype,"fontFamily",2),f([x],Tt.prototype,"spacing",2),f([x],Tt.prototype,"minSpacing",2),f([x],Tt.prototype,"color",2),f([x],Tt.prototype,"rotation",2),f([x],Tt.prototype,"avoidCollisions",2),f([x],Tt.prototype,"mirrored",2),f([x],Tt.prototype,"parallel",2),f([x],Tt.prototype,"itemStyler",2),f([x],Tt.prototype,"formatter",2),f([x],Tt.prototype,"format",2);var Wh=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};f([x],Wh.prototype,"enabled",2),f([x],Wh.prototype,"width",2),f([x],Wh.prototype,"stroke",2);var wr=class extends ae{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};f([x],wr.prototype,"enabled",2),f([x],wr.prototype,"width",2),f([x],wr.prototype,"size",2),f([x],wr.prototype,"stroke",2);var rs=class extends ae{constructor(){super(...arguments),this.caption=new Ke,this.enabled=!1,this.spacing=Ke.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};f([x],rs.prototype,"enabled",2),f([x],rs.prototype,"text",2),f([x],rs.prototype,"spacing",2),f([x],rs.prototype,"fontStyle",2),f([x],rs.prototype,"fontWeight",2),f([x],rs.prototype,"fontSize",2),f([x],rs.prototype,"fontFamily",2),f([x],rs.prototype,"color",2),f([x],rs.prototype,"wrapping",2),f([x],rs.prototype,"formatter",2);var $x=(e=>(e[e.TickAndDomain=0]="TickAndDomain",e[e.TicksOnly=1]="TicksOnly",e[e.Off=2]="Off",e))($x||{});function Yx(e){const[t,i]=wt(e.range),s=Math.floor(t),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var Lg=Math.PI*2,QN=Lg/2;function JN(e,t){return Math.abs(t-e)<QN?t:e>t?t+Lg:t-Lg}function Kx(e){const{min:t,max:i}=e,s=l=>l<t||l>i;return{tick:{fromFn(l,c,h){let{x1:u,x2:d,y1:p,y2:g}=l,y=l.opacity;return(h==="added"||s(c.offset))&&({x1:u,x2:d,y1:p,y2:g}=c,y=0),{x1:u,x2:d,y1:p,y2:g,opacity:y,phase:ns[h]}},toFn(l,c,h){const{x1:u,x2:d,y1:p,y2:g}=c;let y=1;return h==="removed"&&(y=0),{x1:u,x2:d,y1:p,y2:g,opacity:y}},applyFn(l,c){l.setProperties(c),l.visible=!s(l.y)}},line:{fromFn(l,c){const{x1:h,x2:u,y1:d,y2:p}=l.previousDatum??c;return{x1:h,x2:u,y1:d,y2:p,phase:ns.updated}},toFn(l,c){const{x1:h,x2:u,y1:d,y2:p}=c;return{x1:h,x2:u,y1:d,y2:p}}},label:{fromFn(l,c,h){const u=l.previousDatum??c;let{x:d,y:p,rotationCenterX:g,rotationCenterY:y,rotation:b}=u,m=l.opacity;return h==="removed"||s(u.y)?b=c.rotation:(h==="added"||s(l.datum.y))&&({x:d,y:p,rotationCenterX:g,rotationCenterY:y,rotation:b}=c,m=0),{x:d,y:p,rotationCenterX:g,rotationCenterY:y,rotation:b,opacity:m,phase:ns[h]}},toFn(l,c,h){const{x:u,y:d,rotationCenterX:p,rotationCenterY:g}=c;let y=0,b=1;return h==="added"?y=c.rotation:h==="removed"?(b=0,y=c.rotation):y=JN(l.previousDatum?.rotation??c.rotation,c.rotation),{x:u,y:d,rotationCenterX:p,rotationCenterY:g,rotation:y,opacity:b,finish:{rotation:c.rotation}}}},group:{fromFn(l,c){const{translationX:h,translationY:u}=l;return{translationX:h,translationY:u,phase:ns.updated}},toFn(l,c){const{translationX:h,translationY:u}=c;return{translationX:h,translationY:u}}}}}function Zx(){return(e,t)=>({translationX:t.translationX,translationY:t.translationY})}function $h(){return(e,t)=>({x:t.x,y:t.y,rotationCenterX:t.rotationCenterX,rotationCenterY:t.rotationCenterY,rotation:t.rotation})}function kg(){return(e,t)=>{const{x1:i,x2:s,y1:n,y2:r}=t;return{x1:i,x2:s,y1:n,y2:r}}}var Xx=(e=>(e[e.TickLines=0]="TickLines",e[e.AxisLine=1]="AxisLine",e[e.TickLabels=2]="TickLabels",e))(Xx||{}),tn=class kI{constructor(t,i){this.moduleCtx=t,this.scale=i,this.id=(0,Sg.createId)(this),this._crossLines=[],this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new $o,this.dataDomain={domain:[],clipped:!1},this.title=new rs,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new re({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new wo({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new wo({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new re({name:`${this.id}-Labels`,zIndex:10}),this.gridGroup=new Ht({name:`${this.id}-Axis-grid`,zIndex:2}),this.gridLineGroup=this.gridGroup.appendChild(new re({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new wo({name:`${this.id}-CrossLines-Range`,zIndex:5}),this.crossLineLineGroup=new wo({name:`${this.id}-CrossLines-Line`,zIndex:9}),this.crossLineLabelGroup=new wo({name:`${this.id}-CrossLines-Label`,zIndex:14}),this.tickLabelGroupSelection=bt.select(this.tickLabelGroup,Po,!1),this.line=new Wh,this.tick=new wr,this.gridLine=new Uh,this.label=this.createLabel(),this.defaultTickMinSpacing=kI.defaultTickMinSpacing,this.translation={x:0,y:0},this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.cleanup=new Sg.CleanupRegistry,this.range=[0,1],this.visibleRange=[0,1],this.animatable=!0,this.unzoomedInputDomain=void 0,this.unzoomedInputRangeExtent=NaN,this.unzoomedInputGridLength=NaN,this.unzoomedInputInitialPrimaryTickCount=void 0,this.formatterBoundSeries=new Sg.WeakCache(()=>{const{direction:s,boundSeries:n}=this;return Us(n.flatMap(r=>r.getFormatterContext(s)))}),this.moduleMap=new Ig,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s))}set crossLines(t){const{CrossLineConstructor:i}=this.constructor;this._crossLines.forEach(s=>this.detachCrossLine(s)),this._crossLines=t.map(s=>{const n=new i;return n.set(s),n}),this._crossLines.forEach(s=>{this.attachCrossLine(s),this.initCrossLine(s)})}get crossLines(){return this._crossLines}get type(){return this.constructor.type??""}get primaryLabel(){}get primaryTick(){}resetAnimation(t){}attachCrossLine(t){this.crossLineRangeGroup.appendChild(t.rangeGroup),this.crossLineLineGroup.appendChild(t.lineGroup),this.crossLineLabelGroup.appendChild(t.labelGroup)}detachCrossLine(t){this.crossLineRangeGroup.removeChild(t.rangeGroup),this.crossLineLineGroup.removeChild(t.lineGroup),this.crossLineLabelGroup.removeChild(t.labelGroup)}destroy(){this.moduleMap.destroy(),this.cleanup.flush()}setScaleRange(t){const{range:i,scale:s}=this,n=(i[1]-i[0])/(t[1]-t[0]),r=n*t[0],o=i[0]-r;s.range=[o,o+n]}updateScale(){const{range:[t,i]}=this;this.setScaleRange(this.visibleRange),this.crossLines.forEach(s=>{s.clippedRange=[t,i]})}setCrossLinesVisible(t){this.crossLineRangeGroup.visible=t,this.crossLineLineGroup.visible=t,this.crossLineLabelGroup.visible=t}attachAxis(t){t.gridNode.appendChild(this.gridGroup),t.axisNode.appendChild(this.axisGroup),t.labelNode.appendChild(this.labelGroup),t.crossLineRangeNode.appendChild(this.crossLineRangeGroup),t.crossLineLineNode.appendChild(this.crossLineLineGroup),t.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(t){t.gridNode.removeChild(this.gridGroup),t.axisNode.removeChild(this.axisGroup),t.labelNode.removeChild(this.labelGroup),t.crossLineRangeNode.removeChild(this.crossLineRangeGroup),t.crossLineLineNode.removeChild(this.crossLineLineGroup),t.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(t){this.labelGroup.append(t)}inRange(t,i=0){const[s,n]=wt(this.range);return t>=s-i&&t<=n+i}getRangeOverflow(t){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[r,o]=wt([i[0]-n*s[0],i[0]-n*s[0]+n]);return t<r?t-r:t>o?t-o:0}createDatumFormatter(t,i){}onGridLengthChange(t,i){i^t&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){}createLabel(){return new Tt}update(){this.formatterBoundSeries.clear(),this.unzoomedTickLayout=void 0,this.updatePosition(),this.updateSelections(),this.tickLineGroup.visible=this.tick.enabled,this.gridLineGroup.visible=this.gridLine.enabled,this.tickLabelGroup.visible=this.label.enabled,this.updateLabels(),this.updateCrossLines()}getLabelStyles(t,i,s=this.label){const n={color:s.color,spacing:s.spacing,fontFamily:s.fontFamily,fontSize:s.fontSize,fontStyle:s.fontStyle,fontWeight:s.fontWeight};let r;s.itemStyler&&(r=this.callWithContext(s.itemStyler,{...t,...n}));const{color:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}=Le(r,i,n);return{fill:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}}getTickSize(t=this.tick){return t.enabled?t.size:0}processData(){const{includeInvisibleDomains:t,boundSeries:i,direction:s}=this,r=(t?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(s));this.setDomains(...r)}setDomains(...t){let i,s;t.length>0?{domain:i,animatable:s}=this.scale.normalizeDomains(...t):(i=[],s=!0),this.dataDomain=this.normaliseDataDomain(i),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateDomain(t){const{nice:i,dataDomain:{domain:s},range:n,scale:r,gridLength:o,unzoomedInputDomain:a,unzoomedInputRangeExtent:l,unzoomedInputGridLength:c,unzoomedInputInitialPrimaryTickCount:h}=this;let{unzoomedTickLayout:u}=this;const d=pl(n);if(this.updateScale(),u==null||a!==s||l!==d||c!==o||h?.unzoomed!==t?.unzoomed||h?.zoomed!==t?.zoomed){const p=r.range;this.setScaleRange([0,1]);const g=i?0:2;u=this.calculateTickLayout(s,g,[0,1],t),r.range=p,this.unzoomedInputDomain=s,this.unzoomedInputRangeExtent=d,this.unzoomedInputGridLength=o,this.unzoomedTickLayout=u,this.unzoomedInputInitialPrimaryTickCount=t}return this.updateScale(),r.domain=u.niceDomain,{unzoomedTickLayout:u,domain:r.domain}}calculateLayout(t,i){this.chartLayout=i;const{visibleRange:s,nice:n}=this,r=s[0]===0&&s[1]===1,{unzoomedTickLayout:o,domain:a}=this.calculateDomain(t);let l;if(r)l=o;else{const g=n?1:2;l=this.calculateTickLayout(a,g,s,t)}const{rawTickCount:c=0,fractionDigits:h,bbox:u}=l,d=o.rawTickCount??0,p=c!==0&&d!==0?{zoomed:c,unzoomed:d}:void 0;return this.tickLayout=l.layout,this.layout.label={fractionDigits:h,spacing:this.label.spacing,format:this.label.format},this.layoutCrossLines(),{primaryTickCount:p,bbox:u}}updateCrossLines(){const t=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.update(t)})}updatePosition(){const{crossLineRangeGroup:t,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:r}=this,o=Math.floor(r.x),a=Math.floor(r.y);n.setProperties({translationX:o,translationY:a}),t.setProperties({translationX:o,translationY:a}),i.setProperties({translationX:o,translationY:a}),s.setProperties({translationX:o,translationY:a})}tickFormatter(t,i,s,n,r,o="long"){const{moduleCtx:a,label:l}=this,{formatManager:c}=a,h=s?this.primaryLabel:void 0,u=this.tickFormatParams(t,i,n,r),d=this.formatterBoundSeries.get();let p,g,y;if(u.type==="number")p=u.fractionDigits;else if(u.type==="date"){const{unit:I,step:k,epoch:L}=u;g={unit:I,step:k,epoch:L},y=u.truncateDate}const b=this.callWithContext.bind(this),m={datum:void 0,seriesId:void 0,legendItemName:void 0,key:void 0,source:"axis-label",property:this.direction,domain:t,boundSeries:d},v=h??l,S=s?l.format:void 0,M={specifier:Go.mergeSpecifiers(h?.format,l.format),truncateDate:y};return(I,k)=>{const L=this.datumFormatParams(I,m,p,g,o);return L.value=I,v.formatValue(b,L,k,{specifier:S,dateStyle:o,truncateDate:y})??c.format(b,L,M)??c.defaultFormat(L,M)}}formatDatum(t,i,s,n,r,o,a,l,c,h=this.callWithContext.bind(this)){if(t==null)return"";const{moduleCtx:u,direction:d,dataDomain:p}=this;a??(a=p.domain);const{formatManager:g}=u,y=this.formatterBoundSeries.get();let b;switch(i){case"crosshair":case"annotation-label":b=this.layout.label.fractionDigits+1;break;case"series-label":b=2;break;case"tooltip":b=3;break;case"legend-label":b=void 0;break}const m=this.datumFormatParams(t,{source:i,datum:r,seriesId:s,legendItemName:n,key:o,property:d,domain:a,boundSeries:y},b,void 0,"long"),{type:v,value:S}=m,M=h,I=l?.formatValue(M,v,S,c??m)??g.format(M,m)??this.label.formatValue(M,m,NaN)??g.defaultFormat(m);return String(I)}getBBox(){return this.axisGroup.getBBox()}initCrossLine(t){t.scale=this.scale,t.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(t=>this.includeInvisibleDomains||t.isEnabled())}clipTickLines(t,i,s,n){this.tickLineGroup.setClipRect(new W(t,i,s,n))}clipGrid(t,i,s,n){this.gridGroup.setClipRect(new W(t,i,s,n))}getTitleFormatterParams(t){const{direction:i}=this,s=this.formatterBoundSeries.get();return{domain:t,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(t){return{domain:[...t],clipped:!1}}getLayoutState(){return{id:this.id,rect:this.getBBox(),gridPadding:this.gridPadding,seriesAreaPadding:this.seriesAreaPadding,tickSize:this.getTickSize(),direction:this.direction,domain:this.dataDomain.domain,scale:this.scale,...this.layout}}getModuleMap(){return this.moduleMap}createModuleContext(){return this.axisContext??(this.axisContext=this.createAxisContext()),{...this.moduleCtx,parent:this.axisContext}}createAxisContext(){const{scale:t}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:Re.is(t)||wi.is(t),getCanvasBounds:()=>tt.toCanvas(this.axisGroup),seriesKeyProperties:()=>this.boundSeries.reduce((i,s)=>(s.getKeyProperties(this.direction).forEach(r=>i.add(r)),i),new Set),seriesIds:()=>this.boundSeries.map(i=>i.id),scaleInvert:i=>t.invert(i,!0),scaleInvertNearest:i=>t.invert(i,!0),formatScaleValue:(i,s,n)=>this.formatDatum(i,s,void 0,void 0,void 0,void 0,void 0,n),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i),pickBand:i=>this.pickBand(i)}}pickBand(t){if(!Lr.is(this.scale))return;const{scale:i,range:s}=this,n=i.invert(this.isVertical()?t.y:t.x,!0),r=i.bandwidth??0,a=((i.step??0)-r)/2,l=i.convert(n),c=l-a,h=l+r+a;return{id:this.id,value:n,band:[dl(c,s),dl(h,s)],position:l}}isVertical(){return this.direction==="y"}isReversed(){return this.reverse}callWithContext(t,...i){const{callbackCache:s,chartService:n}=this.moduleCtx;return s.call([this,n],t,...i)}};tn.defaultTickMinSpacing=50,tn.CrossLineConstructor=ai,f([x],tn.prototype,"nice",2),f([x],tn.prototype,"reverse",2),f([x],tn.prototype,"keys",2),f([x],tn.prototype,"interval",2),f([x],tn.prototype,"title",2),f([Rn((e,t,i)=>e.onGridLengthChange(t,i))],tn.prototype,"gridLength",2);var Cg=tn,Yh=(T(),N(w)),eT=(T(),N(w));function Kh(e,t){return e.valueOf()-t.valueOf()}function tT(e){let t=NaN;const i=[];for(const s of e){const n=s.valueOf();t!==n&&i.push(s),t=n}return i}function wg(e){const t=e.slice().sort(Kh);return Ng(t)==null?tT(t):t}function Ng(e){if(e.length===0)return 1;const t=Number(e[e.length-1])>Number(e[0])?1:-1;let i=-1/0*t;for(const s of e){const n=s.valueOf();if(Math.sign(n-i)!==t)return;i=n}return t}var qx=(T(),N(w)),Yo=(T(),N(w)),Ko=1e3,Fn=Ko*60,Nr=Fn*60,Tr=Nr*24,Qx=Tr*7,Tg=Tr*30,bl=Tr*365,Zo=new Date().getTimezoneOffset()*Fn,xl={millisecond:{milliseconds:1,hierarchy:"day",encode(e){return e.getTime()},decode(e){return new Date(e)}},second:{milliseconds:Ko,hierarchy:"day",encode(e,t){const i=t?0:Zo;return Math.floor((e.getTime()-i)/Ko)},decode(e,t){const i=t?0:Zo;return new Date(i+e*Ko)}},minute:{milliseconds:Fn,hierarchy:"day",encode(e,t){const i=t?0:Zo;return Math.floor((e.getTime()-i)/Fn)},decode(e,t){const i=t?0:Zo;return new Date(i+e*Fn)}},hour:{milliseconds:Nr,hierarchy:"day",encode(e,t){const i=t?0:Zo;return Math.floor((e.getTime()-i)/Nr)},decode(e,t){const i=t?0:Zo;return new Date(i+e*Nr)}},day:{milliseconds:Tr,hierarchy:"month",encode(e,t){const i=t?0:e.getTimezoneOffset()*Fn;return Math.floor((e.getTime()-i)/Tr)},decode(e,t){let i;return t?(i=new Date(0),i.setUTCDate(i.getUTCDate()+e),i.setUTCHours(0,0,0,0)):(i=new Date(1970,0,1),i.setDate(i.getDate()+e)),i}},month:{milliseconds:Tg,hierarchy:"year",encode(e,t){return t?e.getUTCFullYear()*12+e.getUTCMonth():e.getFullYear()*12+e.getMonth()},decode(e,t){if(t){const i=Math.floor(e/12),s=e-i*12;return new Date(Date.UTC(i,s,1))}else{const i=Math.floor(e/12),s=e-i*12;return new Date(i,s,1)}}},year:{milliseconds:bl,hierarchy:void 0,encode(e,t){return t?e.getUTCFullYear():e.getFullYear()},decode(e,t){const i=new Date;return t?(i.setUTCFullYear(e),i.setUTCMonth(0,1),i.setUTCHours(0,0,0,0)):(i.setFullYear(e),i.setMonth(0,1),i.setHours(0,0,0,0)),i}}};function vl(e){return typeof e=="string"?{unit:e,step:1,epoch:void 0,utc:!1}:{unit:e.unit,step:e.step??1,epoch:e.epoch,utc:e.utc??!1}}function Ml(e,t,i,s){if(i==null)return 0;const n=xl[e];return Math.floor(n.encode(new Date(i),s))%t}function Xo(e,t,i,s,n){const r=xl[t];return Math.floor((r.encode(new Date(e),s)-n)/i)}function Sl(e,t,i,s,n){return xl[t].decode(e*i+n,s)}function Zh(e,t,i,s,n){const r=new Date(e),o=Xo(r,t,i,s,n);return Sl(o,t,i,s,n)}function Xh(e,t,i,s,n){const r=new Date(Number(e)-1),o=Xo(r,t,i,s,n);return Sl(o+1,t,i,s,n)}function Bi(e,t){const{unit:i,step:s,epoch:n,utc:r}=vl(e),o=Ml(i,s,n,r);return Zh(t,i,s,r,o)}function Jx(e,t){const{unit:i,step:s,epoch:n,utc:r}=vl(e),o=Ml(i,s,n,r);return Xh(t,i,s,r,o)}function ev(e,t){const{unit:i,step:s,epoch:n,utc:r}=vl(e),o=Ml(i,s,n,r);return Sl(Xo(Xh(t,i,s,r,o),i,s,r,o)-1,i,s,r,o)}function tv(e,t){const{unit:i,step:s,epoch:n,utc:r}=vl(e),o=Ml(i,s,n,r);return Sl(Xo(Zh(t,i,s,r,o),i,s,r,o)+1,i,s,r,o)}function Og(e,t,i){if(e.valueOf()>t.valueOf()&&([e,t]=[t,e],i!=null&&(i=[1-i[1],1-i[0]])),i!=null){const s=t.valueOf()-e.valueOf(),n=e.valueOf();e=new Date(n+i[0]*s),t=new Date(n+i[1]*s)}return[new Date(e),new Date(t)]}function iv(e,t,i,{extend:s=!1,visibleRange:n=[0,1],limit:r,defaultAlignment:o="start"}={}){const a=vl(e),{unit:l,step:c,utc:h}=a;let u;a.epoch!=null?u=a.epoch:o==="interval"?u=void 0:t.valueOf()>i.valueOf()?u=i:u=t,[t,i]=Og(t,i,n);const d=Ml(a.unit,a.step,u,a.utc),p=s?Zh(t,l,c,h,d):Xh(t,l,c,h,d),g=Xo(p,l,c,h,d),y=s?Xh(i,l,c,h,d):Zh(i,l,c,h,d);let b=Xo(y,l,c,h,d);return r!=null&&b-g>r&&(b=g+r),{range:[g,b],unit:l,step:c,utc:h,offset:d}}function Eg(e,t,i,s){const{range:[n,r]}=iv(e,t,i,s);return Math.abs(r-n)}function Vi(e,t,i,s){const{range:[n,r],unit:o,step:a,utc:l,offset:c}=iv(e,t,i,s),h=[];for(let u=n;u<=r;u+=1){const d=Sl(u,o,a,l,c);h.push(d)}return h}function sn(e){return typeof e=="string"?e:e.unit}function Bn(e){return typeof e=="string"?1:e.step??1}function Dl(e){return typeof e=="string"?void 0:e.epoch}function Il(e){return xl[sn(e)].hierarchy}function Ni(e){return Bn(e)*xl[sn(e)].milliseconds}var it=(e,t)=>({duration:Ni(e)*t,timeInterval:e,step:t}),Pg=[it({unit:"second"},1),it({unit:"second"},5),it({unit:"second"},15),it({unit:"second"},30),it({unit:"minute"},1),it({unit:"minute"},5),it({unit:"minute"},15),it({unit:"minute"},30),it({unit:"hour"},1),it({unit:"hour"},3),it({unit:"hour"},6),it({unit:"hour"},12),it({unit:"day"},1),it({unit:"day"},2),it({unit:"day",step:7},1),it({unit:"day",step:7},2),it({unit:"day",step:7},3),it({unit:"month"},1),it({unit:"month"},2),it({unit:"month"},3),it({unit:"month"},4),it({unit:"month"},6),it({unit:"year"},1)],sv=[1,2,5,10];function nv(e,t){return Math.abs(Math.round(e)-e)<t}function rv(e,t,i){return Math.abs(t-e)>=i?Math.abs(t-e)/i+1:1}function Al(e,t,i,s,n,r){if(e===t)return{ticks:[e],count:1};if(i<2)return{ticks:[e,t],count:2};const o=Ll(e,t,i,s,n);if(!Number.isFinite(o))return{ticks:[],count:0};let a=e,l=t;if(nv(a/o,1e-12)||(a=Math.ceil(a/o)*o),nv(l/o,1e-12)||(l=Math.floor(l/o)*o),r!=null){const h=l-a,u=t-e,d=e+u*r[0],p=e+u*r[1];r=[(d-a)/h,(p-a)/h]}const{ticks:c}=Qh(a,l,o,r);return{ticks:c,count:rv(e,t,o)}}var iT=Math.floor(2*Qx/Tg*10)/10;function ov({timeInterval:e,step:t}){const i=Ni(e)*t,s=Il(e),n=s?Ni(s):void 0;return i<=(n??1/0)*iT}function av(e,{weekStart:t}){if(e.unit==="day"&&e.step===7)return t}function qh(e,t,i,s,n,{weekStart:r,primaryOnly:o=!1,targetInterval:a}){if(i<=0)return;const l=a??Math.abs(t-e)/Math.max(i,1),c=Pg.findLast(p=>(!o||ov(p))&&l>p.duration),h=Pg.find(p=>(!o||ov(p))&&l<=p.duration);if(c==null)return{unit:"millisecond",step:Math.max(Ll(e,t,i,s,n),1)};if(h==null)return{unit:"year",step:a==null?Ll(e/bl,t/bl,i,s,n):1};const{timeInterval:u,step:d}=l-c.duration<h.duration-l?c:h;return{unit:u.unit,step:Bn(u)*d,epoch:av(u,{weekStart:r})}}function Ll(e,t,i,s=0,n=1/0){if(e===t)return(0,Yo.clamp)(1,s,n);if(i<1)return NaN;const r=Math.abs(t-e),o=10**Math.floor(Math.log10(r/i));let a=NaN,l=1/0,c=!1;for(const h of sv){const u=Math.ceil(r/(h*o)),d=u>=s&&u<=n;if(c&&!d)continue;const p=Math.abs(u-i);(l>p||c!==d)&&(c||(c=d),l=p,a=h)}return a*o}function lv(e){for(let t=e.length-1;t>=0;t-=1)if(e[t]!=="0")return t+1;return 0}function cv(e,t){const i=(0,Yo.parseNumberFormat)(t??",f");if(i==null)return;(i.precision==null||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n))return 0;const[r,o]=n.toExponential((i.type?6:12)-1).split(/[.e]/g);return(r!=="1"&&r!=="-1"?1:0)+lv(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...e.map(n=>{if(!Number.isFinite(n)||n===0)return 0;const r=Math.floor(Math.log10(Math.abs(n))),o=i.type?6:12,a=n.toExponential(o-1).split(/[.e]/g)[1],l=lv(a);return Math.max(0,l-r)}))));const s=(0,Yo.createNumberFormatter)(i);return n=>s(Number(n))}function Qh(e,t,i,s){if(!Number.isFinite(i)||i<=0)return{ticks:[],count:0};if(e===t)return{ticks:[e],count:1};const n=10**(0,Yo.countFractionDigits)(i),r=Math.min(e,t),o=Math.max(e,t);let a,l;if(s!=null&&(s[0]!==0||s[1]!==1)){const h=t-e,u=e+h*s[0],d=t-h*(1-s[1]);a=Math.min(u,d),l=Math.max(u,d)}else a=r,l=o;a=Math.floor(a*n)/n,l=Math.ceil(l*n)/n;const c=[];for(let h=0;;h+=1){const u=Math.round((r+i*h)*n)/n;if(u>o)break;u>=a&&u<=l&&c.push(u)}return{ticks:c,count:rv(r,o,i)}}function qo(e,t){return e>=t?(Yo.Logger.warnOnce("the configured interval results in more than 1 item per pixel, ignoring. Supply a larger interval or omit this configuration"),!0):!1}function hv(e,t){const i=Math.abs(t-e),s=10**Math.floor(Math.log10(i));let n=1/0,r=[e,t];for(const o of sv){const a=o*s,l=Math.floor(e/a)*a,c=Math.ceil(t/a)*a,h=1-i/Math.abs(c-l);n>h&&(n=h,r=[l,c])}return r}function uv(e,t,i,s,n,r){if(e<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};r=Math.max(r,e/(n+1)),i??(i=r),s??(s=e),i>s&&(i===r?i=s:s=i),i=Math.max(i,1);const o=Math.max(1,Math.floor(e/(t*i))),a=Math.min(o,Math.ceil(e/(t*s))),l=(0,Yo.clamp)(a,Math.floor(n/t),o);return{minTickCount:a,maxTickCount:o,tickCount:l}}function Ti(e){return e instanceof Date?e.getTime():e}function Jh(e){return e<Ko?"millisecond":e<Fn?"second":e<Nr?"minute":e<Nr*23?"hour":e<28*Tr?"day":e<bl?"month":"year"}function Rg(e){if(e.length===0)return"millisecond";if(e.length===1)return eu(e[0]);let t=1/0;for(let i=1;i<e.length;i++)t=Math.min(t,Math.abs(e[i].valueOf()-e[i-1].valueOf()));return Jh(t)}function eu(e){return Bi("second",e)<e?"millisecond":Bi("minute",e)<e?"second":Bi("hour",e)<e?"minute":Bi("day",e)<e?"hour":Bi("month",e)<e?"day":Bi("year",e)<e?"month":"year"}function _g(e){const[t,i]=e.length===0?[0,0]:wt([e[0].valueOf(),e[e.length-1].valueOf()]),s=new Date(t).getFullYear(),n=new Date(i).getFullYear();if(s!==n)return;const r=new Date(t).getMonth(),o=new Date(i).getMonth();if(r!==o)return"year";const a=new Date(t).getDate(),l=new Date(i).getDate();return a!==l?"month":"day"}var tu=new Date(1970,0,4),Or=class CI extends Re{constructor(){super([],[0,1]),this.type="time"}static is(t){return t instanceof CI}toDomain(t){return new Date(t)}convert(t,i){return super.convert(t?.valueOf()??NaN,i)}invert(t){return new Date(super.invert(t))}niceDomain(t,i=this.domain){if(i.length<2)return[];let[s,n]=i;const r=4,o=this.getPixelRange();for(let a=0;a<r;a++){const[l,c]=nT(s,n,t,o);if(Ti(s)===Ti(l)&&Ti(n)===Ti(c))break;s=l,n=c}return[s,n]}ticks(t,i=this.domain,s=[0,1],n=!1){const{nice:r,interval:o,tickCount:a=Re.defaultTickCount,minTickCount:l,maxTickCount:c}=t;if(i.length<2)return;const h=i.map(Ti),u=h[0],d=h[h.length-1];if(o!=null){const g=this.getPixelRange();return{ticks:jg({start:u,stop:d,interval:o,availableRange:g,visibleRange:s,extend:n})??sT({start:u,stop:d,tickCount:a,minTickCount:l,maxTickCount:c,visibleRange:s,extend:n}),count:void 0}}else{if(r&&a===2)return{ticks:i,count:void 0};if(r&&a===1)return{ticks:i.slice(0,1),count:void 0}}const p=qh(u,d,a,l,c,{weekStart:tu});if(p!=null)return{ticks:Vi(p,new Date(u),new Date(d),{visibleRange:s,extend:n}),count:void 0,timeInterval:p}}};function sT({start:e,stop:t,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:r,extend:o}){const a=qh(e,t,i,s,n,{weekStart:tu});return a?Vi(a,new Date(e),new Date(t),{visibleRange:r,extend:o}):[]}function jg({start:e,stop:t,interval:i,availableRange:s,visibleRange:n,extend:r}){if(!i)return[];if((0,qx.isPlainObject)(i)||typeof i=="string"){const u=Vi(i,new Date(e),new Date(t),{visibleRange:n,extend:r});return qo(u.length,s)?void 0:u}const o=Math.abs(i);if(qo(Math.abs(t-e)/o,s))return;const a=Pg.findLast(u=>o%u.duration===0);if(a){const{timeInterval:u,step:d,duration:p}=a,g={...u,step:d*Bn(u)*Math.round(o/p),epoch:av(u,{weekStart:tu})};return Vi(g,new Date(e),new Date(t),{visibleRange:n,extend:r})}let l=new Date(Math.min(e,t));const c=new Date(Math.max(e,t)),h=[];for(;l<=c;)h.push(l),l=new Date(l),l.setMilliseconds(l.getMilliseconds()+o);return h}function nT(e,t,i,s){const{interval:n}=i,r=Math.min(Ti(e),Ti(t)),o=Math.max(Ti(e),Ti(t));let a;if((0,qx.isPlainObject)(n)||typeof n=="string")a=n;else{let u;typeof n=="number"&&(u=(o-r)/Math.max(n,1),qo(u,s)&&(u=void 0)),u??(u=i.tickCount??Re.defaultTickCount),a=qh(r,o,u,i.minTickCount,i.maxTickCount,{weekStart:tu})}if(a==null)return[e,t];const l=Vi(a,new Date(r),new Date(o),{extend:!0});if(l==null||l.length<2)return[e,t];const c=l[0],h=l[l.length-1];return e<=t?[c,h]:[h,c]}var zg=class wI extends wi{constructor(){super(...arguments),this.type="ordinal-time",this.defaultTickCount=Re.defaultTickCount,this._domain=[],this.isReversed=!1}static is(t){return t instanceof wI}set domain(t){t!==this._domain&&(this.invalid=!0,this._domain=t,this._bands=void 0,this.isReversed=t.length>0&&t[0]>t[t.length-1])}get domain(){return this._domain}get bands(){return this._bands??(this._bands=this.isReversed?this.domain.slice().reverse():this.domain),this._bands}normalizeDomains(...t){const i=t.filter(s=>s.length>0);if(i.length===0)return{domain:[],animatable:!1};if(i.length===1){let s=i[0];const n=Ng(s);return n===-1?s=s.slice().reverse():n==null&&(s=wg(s.slice())),{domain:s,animatable:!0}}return{domain:wg(i.flat()),animatable:!0}}ticks({interval:t,maxTickCount:i,tickCount:s=i},n=this.domain,r=[0,1],o=!1){if(!n.length)return;this.refresh();const{isReversed:a}=this;if(t==null)return{ticks:dv(n,s,a,r,o),count:void 0};const l=n[0].valueOf(),c=n[n.length-1].valueOf(),[h,u]=this.range,d=Math.abs(u-h);let p=jg({start:l,stop:c,interval:t,availableRange:d,visibleRange:r,extend:o})??dv(n,s,a,r,o),g=-1;return p=p.filter(y=>{const b=this.findIndex(y)??-1,m=b===g;return g=b,!m}),{ticks:p,count:void 0}}findIndex(t){const{bands:i}=this,s=t.valueOf();return(0,eT.findMinIndex)(0,i.length-1,n=>i[n].valueOf()>=s)}};function dv(e,t,i,s,n){const r=[],o=Math.ceil(e.length/t),a=Math.floor(o/2);let l=Math.floor(s[0]*e.length),c=Math.ceil(s[1]*e.length);n&&(l>o&&(l-=o),c<e.length-o&&(c+=o));for(let h=l;h<c;h+=1){const u=i?e.length-1-h:h;(o<=0||(u+a)%o===0)&&r.push(e[h])}return r}var Vn=(T(),N(w)),pv=5e7,Ns=class NI extends wi{constructor(){super(...arguments),this.type="unit-time",this.defaultTickCount=12,this._domain=[],this._bands=void 0}static is(t){return t instanceof NI}static supportsInterval(t,i){return gv(t,i)}set domain(t){t!==this._domain&&(this._domain=t,this._bands=void 0)}get domain(){return this._domain}get interval(){return this._interval}set interval(t){this._interval!==t&&(this._interval=t,this._bands=void 0)}get bands(){return this._bands??(this._bands=this.calculateBands(this._domain,[0,1])),this._bands}normalizeDomains(...t){return ag(...t)}convert(t,i){t instanceof Date||(t=new Date(t));const{domain:s,interval:n}=this;if(s.length<2)return NaN;if(i?.clamp!==!0&&n!=null){const r=t.valueOf(),[o,a]=iu(s,n),l=Math.min(o.valueOf(),a.valueOf()),c=Math.max(o.valueOf(),a.valueOf());if(r<l||r>=c+Ni(n))return NaN}return super.convert(t,i)}calculateBands(t,i,s=!1){if(t===this.domain&&i[0]===0&&i[1]===1&&!s&&this._bands!=null)return this._bands;if(t.length<2)return[];const{interval:n}=this;if(n==null)return[];const r={visibleRange:i,extend:s};if(!gv(t,n,r))return[];const[o,a]=iu(t,n);return Eg(n,o,a,r)>pv?(Vn.Logger.warnOnce("the configured unit results in too many bands, ignoring. Supply a larger unit."),[]):Vi(n,o,a,r)}ticks({interval:t},i=this.domain,s=[0,1],n=!1){if(i.length<2)return;const r=this.calculateBands(i,s,n),o=this.interval?Ni(this.interval):1/0;if(t==null)return{ticks:r,count:void 0};const a=Math.min(i[0].valueOf(),i[1].valueOf()),l=Math.max(i[0].valueOf(),i[1].valueOf());let c,h,u;(0,Vn.isPlainObject)(t)||typeof t=="string"?(c=Vi(t,i[0],i[1],{extend:!0,visibleRange:s}),h=0,u=c.length-1):(c=r,h=(0,Vn.findMaxIndex)(0,r.length-1,v=>r[v].valueOf()<=a)??0,u=(0,Vn.findMaxIndex)(0,r.length-1,v=>r[v].valueOf()<=l)??r.length-1);const d=[];let p;for(let v=h;v<=u;v++){const S=c[v].valueOf(),M=(0,Vn.findMaxIndex)(0,r.length-1,k=>r[k].valueOf()<=S),I=M!=null&&M!=p?r[M]:void 0;p=M,I!=null&&S-I.getTime()<=o&&d.push(I)}let g,y;if(this.interval){const v=iu([new Date(a),new Date(l)],this.interval);g=v[0].valueOf(),y=v[1].valueOf()}else g=a,y=l;let b=(0,Vn.findMinIndex)(0,d.length-1,v=>d[v].valueOf()>=g)??0,m=(0,Vn.findMaxIndex)(0,d.length-1,v=>d[v].valueOf()<=y)??d.length-1;return n&&(b=Math.max(b-1,0),m=Math.min(m+1,d.length-1)),{ticks:d.slice(b,m+1),count:d.length}}findIndex(t){const{bands:i}=this,s=t.valueOf();return(0,Vn.findMaxIndex)(0,i.length-1,n=>i[n].valueOf()<=s)}};function gv(e,t,i){const[s,n]=iu(e,t);return Eg(t,s,n,i)<=pv}function iu(e,t){const i=Bi(t,e[0]),s=Bi(t,e[1]);return[i,s]}var rT=(T(),N(w));function oT(e,t,i,s,n){let[r,o]=wt(t.map(Number));const a=Math.floor(i.unzoomed);if(a<=1){const[m,v]=aT(r,o),S=5*Math.pow(2,-Math.ceil(Math.log2(n[1]-n[0]))),{ticks:M}=Al(m,v,S,void 0,void 0,n),I=[e.toDomain(m),e.toDomain(v)];return s&&I.reverse(),{domain:I,ticks:M}}if(r===o){const m=Math.floor(Math.log10(r)),v=Math.pow(10,m),S=Math.min(v,1),M=a-1;r-=S*Math.floor(M/2),o=r+S*M}let l=r,c=o;l=lT(l,c,a);const h=hT(l,c,a),u=a-1;c=l+u*h;const d=Math.floor(l/h)*h,p=Math.floor(c/h)*h;d<=r&&p>=o&&(l=d,c=p);const g=[e.toDomain(l),e.toDomain(c)];s&&g.reverse();const y=h*((i.unzoomed-1)/(i.zoomed-1)),b=cT(l,y,Math.floor(i.zoomed));return{domain:g,ticks:b}}function aT(e,t){let i=e,s=t,n=0;do{[i,s]=hv(i,s);const{ticks:r}=Al(i,s,5);if(r.length%2===1)return[i,s];i-=1,s+=1}while(n++<10);return[e,t]}function lT(e,t,i){e=Math.floor(e);const s=Math.abs(t-e)/(i-1),n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return Math.floor(e/r)*r}function cT(e,t,i){const s=(0,rT.countFractionDigits)(t),n=Math.pow(10,s),r=[];for(let o=0;o<i;o++){const a=e+t*o;r.push(Math.round(a*n)/n)}return r}function hT(e,t,i){const s=i-1,n=(t-e)/s;return uT(n)}function uT(e){const t=Math.floor(Math.log10(e)),i=Math.pow(10,t),s=e/i;return s>0&&s<=1?i:s>1&&s<=2?2*i:s>2&&s<=5?5*i:s>5&&s<=10?10*i:e}function Fg(){const e=new Map;return t=>{const i=e.get(t);return i?(e.set(t,i+1),`${t}_${i}`):(e.set(t,1),t)}}var dT=(T(),N(w)),xt=class extends ae{constructor(){super(...arguments),this.enabled=!0,this._cachedFormatter=void 0}formatValue(e,t,i,s){const{formatter:n,format:r}=this;let o;if(n!=null&&(o??(o=e(n,s))),r!=null){let a=this._cachedFormatter;(a==null||a.type!==t||a.format!==r)&&(a={type:t,format:r,formatter:Go.getFormatter(t,r)},this._cachedFormatter=a),o??(o=a.formatter?.(i))}return o!=null?String(o):void 0}};f([x],xt.prototype,"enabled",2),f([x],xt.prototype,"color",2),f([x],xt.prototype,"fontStyle",2),f([x],xt.prototype,"fontWeight",2),f([x],xt.prototype,"fontSize",2),f([x],xt.prototype,"fontFamily",2),f([x],xt.prototype,"formatter",2),f([x],xt.prototype,"format",2);function pT(e,t,i=0,s=0){const n=$s(e),r=!n&&s>=0&&s<=Math.PI?-1:1,o=!n&&i>=0&&i<=Math.PI?-1:1;let a=0;return t?a=r*Math.PI/2:o===-1&&(a=Math.PI),{configuredRotation:n,defaultRotation:a,parallelFlipFlag:r,regularFlipFlag:o}}function gT(e,t){return e??(t?0:10)}function fT(e,t,i,s){return e&&!t?i*s===-1?"top":"bottom":"middle"}function mT(e,t,i,s,n){const r=t>0&&t<=Math.PI,o=i>0&&i<=Math.PI,a=r||o?-1:1;if(e)if(t||i){if(s*a===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function Bg(e,t){if(e!=null){if(typeof e=="string")return e;if((0,dT.isPlainObject)(e)&&t!=null)return e[sn(t)]}}function yT(e,t,i,s,n){const r=Bg(e.format,s)??(typeof e.format=="string"?e.format:void 0);if(r==null)return{width:0,height:0};const o=Ar(r),a=s?Il(s):void 0,l=Bg(t?.format,a),c=l?Ar(l):o,h=new Date(i[0]),u=new Date(i[i.length-1]),d=a?Vi(a,new Date(i[0]),new Date(i[i.length-1]),{extend:!0}):void 0;let p=0,g=0;if(o!=null){let y,b;d!=null&&d.length>1?(y=d[0],b=d[1]):(y=h,b=u);const m=Vi(s,y,b,{limit:50});for(const v of m){const S=o(v),{width:M,height:I}=n.measureLines(S);p=Math.max(p,M),g=Math.max(g,I)}}if(c!=null&&d!=null)for(const y of d){const b=c(y),{width:m,height:v}=n.measureLines(b);p=Math.max(p,m),g=Math.max(g,v)}return{width:Math.ceil(p),height:Math.ceil(g)}}function bT(e,t,i,s){const n=[];for(const{tickLabel:r,translation:o}of e){if(!r)continue;const{x:a,y:l}=i.transformBBox(new W(t,o,0,0)),{width:c,height:h}=s.measureLines(r);n.push({point:{x:a,y:l},label:{text:r,width:c,height:h}})}return n}function xT({width:e,height:t,spacing:i},s,n){const r=[];for(const o of[0,i]){const{x:a,y:l}=n.transformBBox(new W(s,o,0,0));r.push({point:{x:a,y:l},label:{text:void 0,width:e,height:t}})}return r}var vT=new Date(1970,0,4),fv=class{constructor(e){this.axis=e}estimateTickCount(e,t,i,s,n){const{scale:r}=this.axis,{defaultTickCount:o}=r;return uv(pl(e),pl(t),s,n,o,i)}filterTicks(e,t){const{minSpacing:i,maxSpacing:s}=this.axis.interval,r=i!=null||s!=null?Math.ceil(e.length/t):2,o=e.length%r?-1:0;return e.filter((a,l)=>(l+o)%r===0)}generateTicks({range:e,domain:t,reverse:i,primaryTickCount:s,defaultTickMinSpacing:n,visibleRange:r,niceMode:o,parallelFlipRotation:a,regularFlipRotation:l,labelX:c,sideFlag:h,removeOverflowLabels:u,removeOverflowThreshold:d=0,sizeLimit:p}){const{scale:g,label:y,primaryLabel:b,interval:{minSpacing:m,maxSpacing:v}}=this.axis,{parallel:S,fontFamily:M,fontSize:I,fontStyle:k,fontWeight:L}=y,C=s!==void 0,{defaultRotation:O,configuredRotation:E,parallelFlipFlag:_,regularFlipFlag:F}=pT(y.rotation,S,l,a),{maxTickCount:j}=this.estimateTickCount(e,r,n,m,v),ne=!(Re.is(g)||wi.is(g))||isNaN(j)?10:j,le=fT(S,E,h,_),xe={fontFamily:M,fontSize:I,fontStyle:k,fontWeight:L},pe=Qs.getMeasurer({font:xe}),be=y.enabled&&y.avoidCollisions,ue=E+O,$=new Ks,te=fe=>{const Se=ue+fe;Ks.updateTransformMatrix($,1,1,Se,0,0)},ie=({ticks:fe},Se)=>(te(Se),bT(fe,c,$,pe)),de=(fe,Se)=>{const{niceDomain:Ge,ticks:Pe,timeInterval:Vt}=fe;if(Vt==null)return[];te(Se);const bs=ST(Pe),{width:Mn,height:xs}=yT(y,b,Ge??t,Vt,pe);return xT({width:Mn,height:xs,spacing:bs},c,$)},ee=(fe,Se)=>{if(!be)return!1;const Ge=E!==0||Se!==0,Pe=gT(y.minSpacing,Ge);return mv(de(fe,Se),Pe)||mv(ie(fe,Se),Pe)};let J={tickDomain:[],ticks:[],rawTicks:[],rawTickCount:void 0,timeInterval:void 0,fractionDigits:0,niceDomain:void 0},Y=0,X=0,U=!0,H=!1;for(;!H&&U&&Y<=ne;){X=0;for(const fe of this.getTickStrategies({domain:t,range:e,reverse:i,niceMode:o,secondaryAxis:C,index:Y,sizeLimit:p}))({tickData:J,index:Y,autoRotation:X,terminate:H}=fe({index:Y,tickData:J,terminate:H,primaryTickCount:s,defaultTickMinSpacing:n,visibleRange:r,labelsOverlap(){return ee(J,X)}}));U=ee(J,X)}const se=mT(S,E,X,h,F),he=E+X;if(u&&J.ticks.length>2){const fe=ie(J,X),Se=J.ticks.at(-1),Ge=fe.at(-1);if(Se!=null&&Ge!=null&&Se.translation+Ge.label.width/2>e[1]+d){Se.tickLabel=void 0;const Pe=J.ticks[0];Pe.translation===0&&r[0]===0&&r[1]===1&&(Pe.tickLabel=void 0)}}return{tickData:J,rotation:he,textBaseline:le,textAlign:se}}getTickStrategies({domain:e,range:t,reverse:i,niceMode:s,index:n,secondaryAxis:r,sizeLimit:o}){const{scale:a,label:l,interval:c}=this.axis,{minSpacing:h}=c,u=Re.is(a)||wi.is(a),d=l.enabled&&l.avoidCollisions,p=!u&&n!==0&&d,g=l.autoRotate===!0&&l.rotation===void 0,y=[];let b;c.values?b=3:r?b=1:p?b=2:b=0;const m=({index:v,tickData:S,primaryTickCount:M,defaultTickMinSpacing:I,visibleRange:k,terminate:L})=>this.createTickData(e,t,i,s,k,M,I,b,v,S,L,o);if(y.push(m),!u&&h!=null){const v=({index:S,tickData:M,primaryTickCount:I,defaultTickMinSpacing:k,visibleRange:L,terminate:C})=>this.createTickData(e,t,i,s,L,I,k,2,S,M,C,o);y.push(v)}if(d&&g){const v=({index:S,tickData:M,labelsOverlap:I,terminate:k})=>({index:S,tickData:M,autoRotation:I()?$s(l.autoRotateAngle):0,terminate:k});y.push(v)}return y}createTickData(e,t,i,s,n,r,o,a,l,c,h,u){const{scale:d,interval:p}=this.axis,{step:g,values:y,minSpacing:b,maxSpacing:m}=p,{maxTickCount:v,minTickCount:S,tickCount:M}=this.estimateTickCount(t,n,o,b,m),I=Re.is(d)||wi.is(d),k=!I||isNaN(v)?10:v,L=_=>I?Math.max(M-_,S):v,C=c.rawTicks,O=g==null&&y==null&&L(l)>S&&(I||a===2),E={domain:e,range:t,reverse:i,niceMode:s,visibleRange:n,primaryTickCount:r,tickGenerationType:a,previousTicks:C,minTickCount:S,maxTickCount:v,tickCount:0,sizeLimit:u};if(E.tickCount=L(l),c=this.getTicks(E),O&&yv(c.rawTicks,C)){let _=l,F=k;for(;_<=F;)l=(_+F)/2|0,E.tickCount=L(l),c=this.getTicks(E),yv(c.rawTicks,C)?_=l+1:F=l-1}return l+=1,h||(h=g!=null||y!=null),{tickData:c,index:l,autoRotation:0,terminate:h}}getTimeIntervalTicks(e,t,i,s){const n=Il(i);if(n==null)return;const{scale:r}=this.axis;if(!Or.is(r)&&!wi.is(r))return;s&&(e=[1-e[1],1-e[0]]);const o=Math.min(r.domain[0].valueOf(),r.domain[r.domain.length-1].valueOf()),a=Math.max(r.domain[0].valueOf(),r.domain[r.domain.length-1].valueOf());let[l,c]=Og(new Date(o),new Date(a),e);l=Bi(n,l),l.valueOf()>=o&&(l=ev(n,l)),c=Jx(n,c),c.valueOf()<=a&&(c=tv(n,c));const h=Vi(n,l,c),u=Ni(i),d=Ns.is(r)&&r.interval!=null&&Ni(r.interval)<u;let p,g=new Set;if(Or.is(r)||Ns.is(r)){p=[];const y={...t,interval:i},b=!Ns.is(r)||d;for(let m=0;m<h.length-1;m+=1){const v=h[m],S=h[m+1],M=m===h.length-2,I=S.valueOf()-v.valueOf(),k=[Math.max((o-v.valueOf())/I,0),Math.min((a-v.valueOf())/I,1)],L=b?MT(y.interval,[v,S],k,!0):r.ticks(y,[v,S],k,!0)?.ticks??[];if((0,Yh.dropFirstWhile)(L,_=>_.valueOf()<v.valueOf()),M||(0,Yh.dropLastWhile)(L,_=>b?_.valueOf()+u>S.valueOf():_.valueOf()>=S.valueOf()),L.length===0)continue;const C=L[0],O=Kh(C,v);(b?O===0:O<=u)&&g.add(p.length),p.push(...L)}}else if(zg.is(r)){p=r.ticks(t,void 0,e,!0)?.ticks??[];let y=0;for(let b=0;b<p.length;b++){const m=p[b];let v=!1;for(;y<h.length&&Kh(h[y],m)<=0;)v=!0,y++;v&&g.add(b)}}else p=[];return(g.size===0||g.size===1&&g.has(0))&&(g=void 0),{ticks:p,tickCount:void 0,primaryTicksIndices:g,interpolate:d}}getTicks({domain:e,range:t,reverse:i,niceMode:s,visibleRange:n,tickGenerationType:r,previousTicks:o,tickCount:a,minTickCount:l,maxTickCount:c,primaryTickCount:h,sizeLimit:u=1/0}){const{axis:d}=this,{label:p,primaryLabel:g,scale:y,interval:b}=d,m={nice:s===0,interval:b.step,tickCount:a,minTickCount:l,maxTickCount:c},v={...m,nice:s===0||s===1};let S;r===1&&h!=null&&Re.is(y)&&(S=oT(y,e,h,i,n));const M=s===0?S?.domain??y.niceDomain(m,e):e;let I=M,k,L,C,O,E=!1;const _=g?.enabled===!0&&v.interval==null,F=y.domain;switch(y.domain=M,r){case 3:if(I=b.values,k=b.values,L=k.length,E=Ns.is(y),Re.is(y)){const[ee,J]=wt(M.map(Number));k=k.filter(Y=>Number(Y)>=ee&&Number(Y)<=J).sort((Y,X)=>Number(Y)-Number(X))}break;case 1:if(S)k=S.ticks,L=S.ticks.length;else{const ee=y.ticks(v,M,n);k=ee?.ticks??[],L=ee?.count}break;case 2:k=this.filterTicks(o,a),L=void 0;break;default:{if(M.length>0&&v.interval==null&&(Ns.is(y)||_&&(Or.is(y)||zg.is(y)))){const Y=M,X=Math.min(Y[0].valueOf(),Y[Y.length-1].valueOf()),U=Math.max(Y[0].valueOf(),Y[Y.length-1].valueOf());C=qh(X,U,a,l,c,{weekStart:g==null?vT:void 0,primaryOnly:!0})}const ee=Ns.is(y)?y.interval:void 0;ee!=null&&C!=null&&Ni(ee)>=Ni(C)&&(C=ee);const J=C?this.getTimeIntervalTicks(n,v,C,i):void 0;if(J)({ticks:k,tickCount:L,primaryTicksIndices:O,interpolate:E}=J);else{const Y=Ns.is(y)&&v.interval==null&&C!=null?{...v,interval:C}:v,X=y.ticks(Y,M,n);k=X?.ticks??[],L=X?.count,(Or.is(y)||wi.is(y))&&(C??(C=v.interval??X?.timeInterval))}}}const j=k.reduce((ee,J)=>Math.max(ee,typeof J=="number"?(0,Yh.countFractionDigits)(J):0),0);_||(O=void 0);const Q=_?"component":"long",ne=p.enabled?d.tickFormatter(M,k,!1,j,C,Q):void 0,le=C!=null?Il(C):void 0,xe=_?d.tickFormatter(M,k,!0,j,le,Q):void 0,pe=(y.bandwidth??0)/2,be=[],ue=Or.is(y)||wi.is(y),$=Fg(),te=d.direction==="y",ie=(Lr.is(y)?y.bandwidth:null)??1/0,de={font:p,maxWidth:te?u:ie,maxHeight:te?ie:u,overflow:p.truncate?"ellipsis":"hide",textWrap:p.wrapping};for(let ee=0;ee<k.length;ee++){const J=k[ee],Y=y.convert(J,{interpolate:E})+pe;if(t.length>0&&!d.inRange(Y,.001))continue;const X=O?.has(ee)??!1;let U=X?xe?.(J,ee):ne?.(J,ee);p.avoidCollisions&&(U=Mh.wrapText(U??String(J),de)||U);let H;const se=ue?J?.valueOf():void 0;Number.isFinite(se)?H=$(`v:${se}`):H=$(`l:${U}`),be.push({tick:J,tickId:H,tickLabel:U,translation:Math.floor(Y),primary:X})}return y.domain=F,{tickDomain:I,rawTicks:k,rawTickCount:L,fractionDigits:j,timeInterval:C,ticks:be,niceDomain:M}}};function mv(e,t=0){const i=[];for(const s of e){const{x:n,y:r}=s.point;let{width:o,height:a}=s.label;if(o+=t,a+=t,i.some(l=>(0,Yh.boxCollides)(l,n,r,o,a)))return!0;i.push({x:n,y:r,width:o,height:a})}return!1}function MT(e,t,i,s){if(e==null)return t;const n=t[0].valueOf(),r=t[1].valueOf();if(typeof e!="number"){const a=t[0],l=typeof e=="string"?{unit:e,epoch:a}:{...e,epoch:a};return Vi(l,t[0],t[1],{visibleRange:i,extend:s})}const o=[];for(let a=n;a<=r;a+=e)o.push(new Date(a));return o}function yv(e,t){if(e.length!==t.length)return!1;for(let i=0;i<e.length;i+=1)if(e[i]?.valueOf()!==t[i]?.valueOf())return!1;return!0}function ST(e){if(e.length<2)return 1/0;let t=0,i=e[0].translation;for(let s=1;s<e.length;s++){const n=e[s].translation,r=Math.abs(n-i);t=Math.max(t,r),i=n}return t}var kl=class extends Tt{constructor(){super(...arguments),this.autoRotateAngle=335,this.wrapping="never",this.truncate=!1}};f([x],kl.prototype,"autoRotate",2),f([x],kl.prototype,"autoRotateAngle",2),f([x],kl.prototype,"wrapping",2),f([x],kl.prototype,"truncate",2);var su=class TI extends Cg{constructor(t,i){super(t,i),this.maxThicknessRatio=.3,this.headingLabelGroup=this.axisGroup.appendChild(new Ht({name:`${this.id}-Axis-heading`})),this.lineNodeGroup=this.axisGroup.appendChild(new Ht({name:`${this.id}-Axis-line`})),this.lineNode=this.lineNodeGroup.appendChild(new pi({zIndex:1})),this.tickLineGroupSelection=bt.select(this.tickLineGroup,pi,!1),this.gridLineGroupSelection=bt.select(this.gridLineGroup,pi,!1),this.tempText=new Po({debugDirty:!1}),this.tempCaption=new Ke,this.tickGenerator=new fv(this),this.animationManager=t.animationManager,this.animationState=new yl("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.headingLabelGroup.appendChild(this.title.caption.node);let s;this.cleanup.register(t.eventsHub.on("layout:complete",n=>{const r=[n.chart.width,n.chart.height];s!=null&&!(0,Vh.arraysEqual)(r,s)&&this.animationState.transition("resize"),s=r}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(t){return t instanceof TI}get horizontal(){return this.position==="top"||this.position==="bottom"}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}resetAnimation(t){t==="initial"&&this.animationState.transition("reset")}get direction(){return this.position==="top"||this.position==="bottom"?"x":"y"}createAxisContext(){return{...super.createAxisContext(),position:this.position}}createLabel(){return new kl}updateDirection(){switch(this.position){case"top":this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(t,i){return this.updateDirection(),super.calculateLayout(t,i)}layoutCrossLines(){const t=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.calculateLayout?.(t)})}calculateTickLayout(t,i,s,n){const r=this.label.getSideFlag(),o=this.horizontal?-.5*Math.PI:0,a=ct(o),l=ct(o-Math.PI/2),c=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(i===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1){const{bbox:ie,spacing:de}=this.tickBBox(t,[],[]);return{ticks:[],rawTickCount:0,tickDomain:t,niceDomain:t,fractionDigits:0,timeInterval:void 0,bbox:ie,layout:{ticks:[],tickLines:[],gridLines:[],labels:[],spacing:de}}}const{range:h,reverse:u,defaultTickMinSpacing:d}=this,p=this.horizontal&&Re.is(this.scale),g=this.tickGenerator.generateTicks({domain:t,range:h,reverse:u,niceMode:i,visibleRange:s,primaryTickCount:n,defaultTickMinSpacing:d,parallelFlipRotation:a,regularFlipRotation:l,labelX:c,sideFlag:r,removeOverflowLabels:p,removeOverflowThreshold:this.chartLayout?.padding.right,sizeLimit:this.chartLayout?.sizeLimit}),{tickData:y}=g,{ticks:b,tickDomain:m,rawTicks:v,rawTickCount:S,fractionDigits:M,timeInterval:I,niceDomain:k=t}=y,L=b.map(ie=>this.getTickLabelProps(ie,g)),{position:C,horizontal:O,gridPadding:E,gridLength:_}=this,F=C==="bottom"||C==="right"?-1:1,j=E,Q=F*_-E,{gridLine:ne}=this,le=b.map(({tickId:ie,translation:de},ee)=>{const[J,Y,X,U]=O?[de,j,de,Q]:[j,de,Q,de],{style:H,width:se}=ne,{stroke:he,lineDash:fe}=H[ee%H.length]??{};return{tickId:ie,offset:de,x1:J,y1:Y,x2:X,y2:U,stroke:he,strokeWidth:se,lineDash:fe}}),{tick:xe,primaryTick:pe}=this,be=b.map(({primary:ie,tickId:de,translation:ee})=>{const J=ie&&pe?.enabled?pe:xe,Y=-F*this.getTickSize(J),[X,U,H,se]=O?[ee,0,ee,Y]:[0,ee,Y,ee],{stroke:he,width:fe}=J;return{tickId:de,offset:ee,x1:X,y1:U,x2:H,y2:se,stroke:he,strokeWidth:fe,lineDash:void 0}}),{bbox:ue,spacing:$}=this.tickBBox(m,b,L);return{ticks:v,rawTickCount:S,tickDomain:m,niceDomain:k,fractionDigits:M,timeInterval:I,bbox:ue,layout:{ticks:b,gridLines:le,tickLines:be,labels:L,spacing:$}}}update(){this.updateDirection();const t=Array.from(this.tickLabelGroupSelection.nodes(),o=>o.datum.tickId);super.update(),this.tickLineGroup.visible=this.tick.enabled||(this.primaryTick?.enabled??!1),this.tickLabelGroup.visible=this.label.enabled||(this.primaryTick?.enabled??!1);const{tickLayout:i}=this;if(this.updateTitle(this.scale.domain,i?.spacing??0),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),i){const{ticks:o}=i;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const a=o.map(c=>c.tickId),l=(0,Vh.diffArrays)(t,a);this.animationState.transition("update",l)}}const{enabled:s,stroke:n,width:r}=this.line;this.lineNode.setProperties({stroke:n,strokeWidth:s?r:0}),this.updateTickLines(),this.updateGridLines()}getAxisTransform(){return{translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){super.updatePosition();const t=this.getAxisTransform();this.tickLineGroup.datum=t,this.tickLabelGroup.datum=t,this.lineNodeGroup.datum=t,this.headingLabelGroup.datum=t}getAxisLineCoordinates(){const{horizontal:t}=this,[i,s]=wt(this.range);return t?{x1:i,x2:s,y1:0,y2:0}:{x1:0,x2:0,y1:i,y2:s}}getTickLineBBox(t){const{translation:i}=t,{position:s,primaryTick:n}=this;let r=this.getTickSize();switch(n?.enabled&&(r=Math.max(r,this.getTickSize(n))),s){case"top":return new W(i,-r,i,r);case"bottom":return new W(i,0,i,r);case"left":return new W(-r,i,r,i);case"right":return new W(0,i,r,i)}}lineNodeBBox(){const{position:t,seriesAreaPadding:i}=this,{y1:s,y2:n}=this.getAxisLineCoordinates(),r=n-s;switch(t){case"top":return new W(s,-i,r,i);case"bottom":return new W(s,0,r,i);case"left":return new W(-i,s,i,r);case"right":return new W(0,s,i,r)}}titleBBox(t,i){const{tempCaption:s}=this;return s.node.setProperties(this.titleProps(s,t,i)),s.node.getBBox()}tickBBox(t,i,s){const{tick:n,primaryTick:r,label:o,primaryLabel:a,title:l,position:c,horizontal:h,seriesAreaPadding:u}=this,d=[];if(d.push(this.lineNodeBBox()),n.enabled||r?.enabled)for(const b of i)d.push(this.getTickLineBBox(b));const{tempText:p}=this;if(o.enabled)for(const b of s){if(!b.visible)continue;p.setProperties(b);const m=p.getBBox(!1);m&&d.push(m)}if(a?.enabled&&c==="bottom"&&(d.push(new W(0,Ue.getLineHeight(o.fontSize)+2,1,this.getTickSize(n)+o.spacing+u)),a.format!=null)){const{format:m}=a,S=((0,Vh.isPlainObject)(m)?Object.values(m):[m]).reduce((M,I)=>Math.max(M,(0,Vh.countLines)(I)),0);d.push(new W(0,this.getTickSize(r??n)+a.spacing+u,1,S*Ue.getLineHeight(a.fontSize)+2))}let g=0;if(l.enabled){const b=W.merge(d);g=h?b.height:b.width,d.push(this.titleBBox(t,g))}return{bbox:W.merge(d),spacing:g}}titleProps(t,i,s){const{title:n}=this;if(!n.enabled)return t.enabled=!1,{visible:!1,text:"",textBaseline:"bottom",x:0,y:0,rotationCenterX:0,rotationCenterY:0,rotation:0};t.enabled=!0,t.color=n.color,t.fontFamily=n.fontFamily,t.fontSize=n.fontSize,t.fontStyle=n.fontStyle,t.fontWeight=n.fontWeight,t.wrapping=n.wrapping;const r=(n.spacing??0)+s,{range:o}=this,a=(o[0]+o[1])/2;let l,c,h,u;switch(this.position){case"top":l=a,c=-r,h=0,u="bottom";break;case"bottom":l=a,c=r,h=0,u="top";break;case"left":l=-r,c=a,h=-.5*Math.PI,u="bottom";break;case"right":l=r,c=a,h=.5*Math.PI,u="bottom";break}const{formatter:d=g=>g.defaultValue}=n,p=this.callWithContext(d,this.getTitleFormatterParams(i));return t.text=p,{visible:!0,text:p,textBaseline:u,x:l,y:c,rotationCenterX:l,rotationCenterY:c,rotation:h}}getTickLabelProps(t,i){const{horizontal:s,primaryLabel:n,primaryTick:r,seriesAreaPadding:o,scale:a}=this,{tickId:l,tickLabel:c="",translation:h,primary:u}=t,d=u&&n?.enabled?n:this.label,p=u&&r?.enabled?r:this.tick,{rotation:g,textBaseline:y,textAlign:b}=i,{range:m}=a,S=this.label.getSideFlag()*(this.getTickSize(p)+d.spacing+o),M=c!=="",I=s?h:S,k=s?-S:h;return{...this.getLabelStyles({value:c},void 0,d),tickId:l,rotation:g,text:c,textAlign:b,textBaseline:y,visible:M,x:I,y:k,rotationCenterX:I,rotationCenterY:k,range:m}}updateSelections(){if(!this.tickLayout)return;const t=this.getAxisLineCoordinates(),{tickLines:i,gridLines:s,labels:n}=this.tickLayout,r=o=>o.tickId;this.lineNode.datum=t,this.gridLineGroupSelection.update(this.gridLine.enabled?s:[],void 0,r),this.tickLineGroupSelection.update(i,void 0,r),this.tickLabelGroupSelection.update(n,void 0,r)}updateGridLines(){this.gridLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateTickLines(){this.tickLineGroupSelection.each((t,i)=>{t.stroke=i.stroke,t.strokeWidth=i.strokeWidth,t.lineDash=i.lineDash})}updateTitle(t,i){const{caption:s}=this.title,n=this.titleProps(s,t,i);s.node.visible=n.visible,s.node.text=n.text,s.node.textBaseline=n.textBaseline,s.node.datum=n}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((t,i)=>{t.fill=i.fill,t.fontFamily=i.fontFamily,t.fontSize=i.fontSize,t.fontStyle=i.fontStyle,t.fontWeight=i.fontWeight,t.text=i.text,t.textBaseline=i.textBaseline,t.textAlign=i.textAlign??"center"})}animateReadyUpdate(t){const{animationManager:i}=this.moduleCtx,s=Yx(this),n=Kx(s);Je(this.id,"axis-group",i,[this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],n.group),Je(this.id,"line",i,[this.lineNode],n.line),Je(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(r,o)=>o.tickId,t),Je(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(r,o)=>o.tickId,t),Je(this.id,"title",i,[this.title.caption.node],n.label,(r,o)=>o.tickId,t)}resetSelectionNodes(){Nt([this.lineNodeGroup,this.tickLabelGroup,this.tickLineGroup,this.headingLabelGroup],Zx()),Nt([this.gridLineGroupSelection,this.tickLineGroupSelection],kg()),Nt([this.tickLabelGroupSelection],$h()),Nt([this.title.caption.node],$h()),Nt([this.lineNode],kg())}};f([x],su.prototype,"thickness",2),f([x],su.prototype,"maxThicknessRatio",2),f([x],su.prototype,"position",2);var Cl=su,bv=["top","right","bottom","left"];function DT(e){return typeof e=="string"&&bv.includes(e)}function IT(e){const t=[],i=[],s=[...bv];for(const n of e)n instanceof Cl&&(DT(n.position)?i.push(n.position):t.push(n));for(const n of t){let r;do r=s.pop();while(r&&i.includes(r));if(r==null)break;n.position=r}}var AT=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function LT(e,t,i){const s=(c,h,u)=>{const d=[c];for(const p of AT)p in h&&h[p]!=null&&d.push(`${p}=${h[p]}`);return u?.seriesGrouping&&d.push(`seriesGrouping.groupId=${u?.seriesGrouping.groupId}`),d.join(";")},n=new Map;let r=0;for(const c of e){const h=s(c.type,c.properties,i?.[r]);n.has(h)||n.set(h,[]),n.get(h)?.push([c,r++])}const o=new Map;r=0;for(const c of t){const h=s(c.type,c,c);o.has(h)||o.set(h,[]),o.get(h)?.push([c,r++])}if(![...n.keys()].some(c=>o.has(c)))return{status:"no-overlap",oldKeys:n.keys(),newKeys:o.keys()};const l=[];for(const[c,h]of o.entries())for(const[u,d]of h){const p=n.get(c);if(p==null||p.length<1){l.push({opts:u,targetIdx:d,idx:d,status:"add"}),n.delete(c);continue}const[g,y]=p.shift(),b=i?.[y]??{},m=Is(b,u??{}),{groupIndex:v,stackIndex:S}=m?.seriesGrouping??{};v!=null||S!=null?l.push({opts:u,series:g,diff:m,targetIdx:d,idx:y,status:"series-grouping"}):m?l.push({opts:u,series:g,diff:m,targetIdx:d,idx:y,status:"update"}):l.push({opts:u,series:g,targetIdx:d,idx:y,status:"no-op"}),p.length===0&&n.delete(c)}for(const c of n.values())for(const[h,u]of c)l.push({series:h,idx:u,targetIdx:-1,status:"remove"});return{status:"overlap",changes:l}}function Er(e){const{series:t}=e;return t?.[0]?.type??"line"}function xv(e){const t=Er(e);return Ve.isCartesian(t)||AN(t)}function kT(e){const t=Er(e);return Ve.isPolar(t)||LN(t)}function vv(e){const t=Er(e);return Ve.isHierarchy(t)||kN(t)}function Mv(e){const t=Er(e);return Ve.isTopology(t)||CN(t)}function Sv(e){const t=Er(e);return Ve.isFlowProportion(t)||wN(t)}function Dv(e){const t=Er(e);return Ve.isStandalone(t)||NN(t)}function Vg(e){const t=Er(e);return Ve.isGauge(t)||TN(t)}var CT=class extends Ig{applyOptions(e){for(const t of this.moduleMap.values())t.module.optionsKey in e&&Io(t.moduleInstance)&&t.moduleInstance.set(e[t.module.optionsKey])}*legends(){for(const{module:e,moduleInstance:t}of this.moduleMap.values())e.type==="legend"&&(yield{legendType:e.identifier,legend:t})}},Iv=(T(),N(w)),Gg="ag-charts-overlay",Av="ag-charts-dark-overlay",Pr=class extends ae{constructor(e,t){super(),this.className=e,this.defaultMessageId=t,this.enabled=!0}getText(e){return e.t(this.text??this.defaultMessageId)}getElement(e,t,i,s){if(this.content?.remove(),this.focusBox=s,this.renderer){const n={},r=Zs(e,this.renderer,n);if(r instanceof HTMLElement)this.content=r;else{const o=(0,Iv.createElement)("div");o.innerHTML=r;const{firstElementChild:a}=o;a instanceof HTMLElement&&o.childElementCount===1?this.content=a:this.content=o}}else{const n=(0,Iv.createElement)("div",{display:"flex",alignItems:"center",justifyContent:"center",boxSizing:"border-box",height:"100%",margin:"8px",fontFamily:"var(--ag-charts-font-family)",fontSize:"var(--ag-charts-font-size)",fontWeight:"var(--ag-charts-font-weight)"});n.innerText=this.getText(i),this.content=n,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(r){n.style.opacity=String(r)},onStop(){n.style.opacity="1"}})}return this.content}removeElement(e=()=>this.content?.remove(),t){if(this.content){if(t){const{content:i}=this;t.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){e?.()}})}else e?.();this.content=void 0,this.focusBox=void 0}}};f([x],Pr.prototype,"enabled",2),f([x],Pr.prototype,"text",2),f([x],Pr.prototype,"renderer",2);var Qo=class extends ae{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Pr("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Pr("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Pr("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Pr("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(e){for(const t of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(t.focusBox!==void 0)return{text:t.getText(e),rect:t.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};f([x],Qo.prototype,"darkTheme",2),f([x],Qo.prototype,"loading",2),f([x],Qo.prototype,"noData",2),f([x],Qo.prototype,"noVisibleSeries",2),f([x],Qo.prototype,"unsupportedBrowser",2);var wl=(T(),N(w));function wT(e,t){const{animationDuration:i}=ul.add,s=i*t,n=(0,wl.createElement)("div",`${Gg}--loading`,{display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column",height:"100%",boxSizing:"border-box",font:"13px Verdana, sans-serif",userSelect:"none",animation:`ag-charts-loading ${s}ms linear 50ms both`}),r=(0,wl.createElement)("span",{width:"45px",height:"40px",backgroundImage:["linear-gradient(#0000 calc(1 * 100% / 6), #ccc 0 calc(3 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(2 * 100% / 6), #ccc 0 calc(4 * 100% / 6), #0000 0), ","linear-gradient(#0000 calc(3 * 100% / 6), #ccc 0 calc(5 * 100% / 6), #0000 0)"].join(""),backgroundSize:"10px 400%",backgroundRepeat:"no-repeat",animation:"ag-charts-loading-matrix 1s infinite linear"}),o=(0,wl.createElement)("p",{marginTop:"1em"});o.innerText=e;const a=(0,wl.createElement)("div",`${Gg}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=(0,wl.createElement)("style");return l.innerText=["@keyframes ag-charts-loading { from { opacity: 0 } to { opacity: 1 } }","@keyframes ag-charts-loading-matrix {","0% { background-position: 0% 0%, 50% 0%, 100% 0%; }","100% { background-position: 0% 100%, 50% 100%, 100% 100%; }","}"].join(" "),n.replaceChildren(l,r,o,a),n}var nu=(T(),N(w)),NT=(T(),N(w)),Lv=(e=>(e[e.None=0]="None",e[e.Item=1]="Item",e[e.Series=2]="Series",e[e.OtherSeries=3]="OtherSeries",e[e.OtherItem=4]="OtherItem",e))(Lv||{}),nn=class extends ae{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};f([x],nn.prototype,"fill",2),f([x],nn.prototype,"fillOpacity",2),f([x],nn.prototype,"stroke",2),f([x],nn.prototype,"strokeWidth",2),f([x],nn.prototype,"strokeOpacity",2),f([x],nn.prototype,"lineDash",2),f([x],nn.prototype,"lineDashOffset",2);var rn=class extends ae{};f([x],rn.prototype,"fill",2),f([x],rn.prototype,"fillOpacity",2),f([x],rn.prototype,"stroke",2),f([x],rn.prototype,"strokeWidth",2),f([x],rn.prototype,"strokeOpacity",2),f([x],rn.prototype,"lineDash",2),f([x],rn.prototype,"lineDashOffset",2),f([x],rn.prototype,"opacity",2);var Gn=class extends ae{constructor(){super(...arguments),this.enabled=!0,this.range="tooltip",this.highlightedItem={},this.unhighlightedItem={},this.highlightedSeries={},this.unhighlightedSeries={}}getItemHighlightStyle(e){switch(e){case 1:return this.highlightedItem;case 4:return this.unhighlightedItem;case 2:return this.highlightedSeries;case 3:return this.unhighlightedSeries}}getSeriesHighlightStyle(e){switch(e){case 1:case 4:case 2:return this.highlightedSeries;case 3:return this.unhighlightedSeries}}getStyle(e){return Le(this.getItemHighlightStyle(e),this.getSeriesHighlightStyle(e))}};f([x],Gn.prototype,"enabled",2),f([x],Gn.prototype,"range",2),f([x],Gn.prototype,"highlightedItem",2),f([x],Gn.prototype,"unhighlightedItem",2),f([x],Gn.prototype,"highlightedSeries",2),f([x],Gn.prototype,"unhighlightedSeries",2);var ru=class extends ae{};f([x],ru.prototype,"strokeWidth",2),f([x],ru.prototype,"dimOpacity",2),f([x],ru.prototype,"enabled",2);var kv=class extends ae{constructor(){super(...arguments),this.color="black"}};f([x],kv.prototype,"color",2);var Gi=class extends ae{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};f([x],Gi.prototype,"type",2),f([x],Gi.prototype,"colorStops",2),f([x],Gi.prototype,"bounds",2),f([x],Gi.prototype,"gradient",2),f([x],Gi.prototype,"rotation",2),f([x],Gi.prototype,"reverse",2);var Ze=class extends ae{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.scale=1,this.reverse=!1,this.pattern="forward-slanted-lines",this.width=26,this.height=26,this.padding=6,this.fill="black",this.fillOpacity=1,this.backgroundFill="white",this.backgroundFillOpacity=1,this.stroke="black",this.strokeOpacity=1,this.strokeWidth=0}};f([x],Ze.prototype,"type",2),f([x],Ze.prototype,"colorStops",2),f([x],Ze.prototype,"bounds",2),f([x],Ze.prototype,"gradient",2),f([x],Ze.prototype,"rotation",2),f([x],Ze.prototype,"scale",2),f([x],Ze.prototype,"reverse",2),f([x],Ze.prototype,"path",2),f([x],Ze.prototype,"pattern",2),f([x],Ze.prototype,"width",2),f([x],Ze.prototype,"height",2),f([x],Ze.prototype,"padding",2),f([x],Ze.prototype,"fill",2),f([x],Ze.prototype,"fillOpacity",2),f([x],Ze.prototype,"backgroundFill",2),f([x],Ze.prototype,"backgroundFillOpacity",2),f([x],Ze.prototype,"stroke",2),f([x],Ze.prototype,"strokeOpacity",2),f([x],Ze.prototype,"strokeWidth",2);var gi=class extends ae{constructor(){super(...arguments),this.type="image",this.url="",this.rotation=0,this.scale=1,this.backgroundFill="black",this.backgroundFillOpacity=1,this.repeat="no-repeat",this.fit="contain"}};f([x],gi.prototype,"type",2),f([x],gi.prototype,"url",2),f([x],gi.prototype,"rotation",2),f([x],gi.prototype,"scale",2),f([x],gi.prototype,"backgroundFill",2),f([x],gi.prototype,"backgroundFillOpacity",2),f([x],gi.prototype,"repeat",2),f([x],gi.prototype,"fit",2);var Nl=class extends ae{constructor(e=!0){super(),this.deprecated=e,this.item=new nn,this.series=new ru,this.text=new kv}set(e){return this.deprecated&&NT.Logger.warnOnce("highlightStyle is deprecated, use highlight instead."),super.set(e)}};f([x],Nl.prototype,"item",2),f([x],Nl.prototype,"series",2),f([x],Nl.prototype,"text",2);var Oi=class extends ae{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new Gn,this.highlightStyle=new Nl}handleUnknownProperties(e,t){"context"in t&&(this.context=t.context,e.delete("context"))}};f([x],Oi.prototype,"id",2),f([x],Oi.prototype,"visible",2),f([x],Oi.prototype,"focusPriority",2),f([x],Oi.prototype,"showInLegend",2),f([x],Oi.prototype,"cursor",2),f([x],Oi.prototype,"nodeClickRange",2),f([x],Oi.prototype,"highlight",2),f([x],Oi.prototype,"highlightStyle",2);var Cv=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.ANY_CONTENT=1]="ANY_CONTENT",e))(Cv||{}),wv=(e=>(e[e.FOREGROUND=0]="FOREGROUND",e[e.HIGHLIGHT=1]="HIGHLIGHT",e[e.LABEL=2]="LABEL",e))(wv||{});function Rr(e,t,i,s){if(ki(e))return{type:"gradient",gradient:e.gradient??t.gradient,colorStops:e.colorStops??t.colorStops,bounds:e.bounds??t.bounds,rotation:e.rotation??t.rotation,reverse:e.reverse??t.reverse};if(Tn(e)){const n=e.pattern??i.pattern;let r=e.strokeWidth;n==="backward-slanted-lines"||n==="forward-slanted-lines"||n==="horizontal-lines"||n==="vertical-lines"?r??(r=i.strokeWidth):r??(r=0);const o=e.width??e.height??i.width,a=e.height??e.width??i.height;return{type:"pattern",pattern:n,width:o,height:a,path:e.path,padding:e.padding??i.padding,fill:e.fill??i.fill,fillOpacity:e.fillOpacity??i.fillOpacity,backgroundFill:e.backgroundFill??i.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??i.backgroundFillOpacity,stroke:e.stroke??i.stroke,strokeOpacity:e.strokeOpacity??i.strokeOpacity,strokeWidth:r,rotation:e.rotation??i.rotation,scale:e.scale??i.scale}}return Sr(e)?{type:"image",url:e.url,width:e.width,height:e.height,backgroundFill:e.backgroundFill??s.backgroundFill,backgroundFillOpacity:e.backgroundFillOpacity??s.backgroundFillOpacity,rotation:e.rotation??s.rotation,repeat:e.repeat??s.repeat,fit:e.fit??s.fit}:e}function Ts(e,t,i,s){return!ki(e?.fill)&&!Tn(e?.fill)&&!Sr(e?.fill)?e:{...e,fill:Rr(e.fill,t,i,s)}}function Nv(e,t,i,s){i==null||!ki(t)||t.bounds==null||t.bounds==="item"?e.fillBBox=void 0:e.fillBBox=i[t.bounds],e.fillParams=s}function on(e,t,i,s,n){const r=i?.opacity??t.opacity??1,o=i?.fill??t.fill;e.fill=o,Nv(e,i?.fill??t.fill,s,n),e.fillOpacity=(i?.fillOpacity??t.fillOpacity??1)*r,e.stroke=i?.stroke??t.stroke,e.strokeOpacity=(i?.strokeOpacity??t.strokeOpacity??1)*r,e.strokeWidth=i?.strokeWidth??t.strokeWidth??0,e.lineDash=i?.lineDash??t.lineDash,e.lineDashOffset=i?.lineDashOffset??t.lineDashOffset??0}var Tv=(e=>(e[e.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",e[e.NEAREST_NODE=1]="NEAREST_NODE",e[e.AXIS_ALIGNED=2]="AXIS_ALIGNED",e))(Tv||{}),TT=.25,OT=.125,Tl=class{constructor(e,t,i,s){this.type=e,this.event=t,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},Hg=class{constructor(e,t,i){this.series=e,this.seriesGrouping=t,this.oldGrouping=i,this.type="groupingChanged"}};function Ov(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}function Ug(e){switch(e){case"x":return"x";case"y":return"y";case"angle":return"angle";case"radius":return"radius"}}var ou=class extends s0{constructor(e){super(),this.cleanup=new nu.CleanupRegistry,this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=Tl,this.internalId=(0,nu.createId)(this),this.contentGroup=new Ht({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Ht({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new Ht({name:`${this.internalId}-annotation`}),this.labelGroup=new Ht({name:`${this.internalId}-series-labels`}),this.axes={},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Ig,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.events=new nu.EventEmitter,this._pickNodeCache=new Ep,this.fireEventWrapper=a=>super.fireEvent(a);const{moduleCtx:t,pickModes:i,propertyKeys:s={},propertyNames:n={},canHaveAxes:r=!1,usesPlacedLabels:o=!1}=e;this.ctx=t,this.propertyKeys=s,this.propertyNames=n,this.canHaveAxes=r,this.usesPlacedLabels=o,this.highlightGroup=new Ht({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new re({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new re({name:"highlightLabel",zIndex:10})),this.pickModes=i}get pickModeAxis(){return"main"}get id(){return this.properties?.id??this.internalId}get type(){return this.constructor.type??""}get focusable(){return!0}get data(){return this._data??this._chartData}set visible(e){this.properties.visible=e,this.ctx.legendManager.toggleItem(e,this.id),this.ctx.legendManager.update(),this.visibleMaybeChanged()}get visible(){return this.ctx.legendManager.getSeriesEnabled(this.id)??this.properties.visible}get hasData(){return this.data!=null&&this.data.length>0}get tooltipEnabled(){return this.properties.tooltip?.enabled}onDataChange(){this.nodeDataRefresh=!0,this._pickNodeCache.clear()}setOptionsData(e){this._data=e,this.onDataChange()}setChartData(e){this._chartData=e,this.data===e&&this.onDataChange()}onSeriesGroupingChange(e,t){const{internalId:i,type:s,visible:n}=this;e&&this.ctx.seriesStateManager.deregisterSeries(this),t&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:t}),this.fireEvent(new Hg(this,t,e))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(e,t,i){e.appendChild(this.contentGroup),t.appendChild(this.highlightGroup),t.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(e,t,i){e?.removeChild(this.contentGroup),t.removeChild(this.highlightGroup),t.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(e){return e===this._declarationOrder?!1:(this._declarationOrder=e,this.contentGroup.zIndex=[1,e,0],this.highlightGroup.zIndex=[1,e,1],this.labelGroup.zIndex=[1,e,2],this.annotationGroup.zIndex=e,!0)}renderToOffscreenCanvas(){return!1}addEventListener(e,t){return super.addEventListener(e,t)}removeEventListener(e,t){return super.removeEventListener(e,t)}hasEventListener(e){return super.hasEventListener(e)}addChartEventListeners(){}updatedDomains(){}destroy(){this.cleanup.flush(),this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getPropertyValues(e,t){const i=Ov(e),s=i!=null?Ug(this.resolveKeyDirection(i)):e,n=t?.[s],r=[];if(!n)return r;const o=(...a)=>{for(const l of a)Array.isArray(l)?o(...l):typeof l=="object"?o(...Object.values(l)):r.push(l)};return o(...n.map(a=>this.properties[a])),r}getKeys(e){return this.getPropertyValues(Ug(e),this.propertyKeys)}getKeyProperties(e){return this.propertyKeys[this.resolveKeyDirection(e)]??[]}getNames(e){return this.getPropertyValues(Ug(e),this.propertyNames)}getFormatterContext(e){const{id:t}=this,i=this.getPropertyValues(e,this.propertyKeys),s=this.getPropertyValues(e,this.propertyNames),n=[];for(let r=0;r<i.length;r++)n.push({seriesId:t,key:i[r],name:s[r]});return n}resolveKeyDirection(e){return e}getDomain(e){const t=this.getSeriesDomain(e),i=this.moduleMap.mapModules(s=>s.getDomain(e)).flat();return i.length!==0?t.concat(i):t}getRange(e,t){return this.getSeriesRange(e,t)}getVisibleItems(e,t,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){if(!this.properties.highlight)return 1;const{opacity:t=1}=this.getHighlightStyle();return t}getStrokeWidth(e){if(!this.properties.highlight.enabled)return e;const{strokeWidth:t=e}=this.getHighlightStyle();return t}getHighlightState(e,t,i){const s=this.ctx.highlightManager?.getActiveHighlight();if(e)return 1;if(s?.series==null)return 0;if(this.isSeriesHighlighted(s,i)){const n=this.isItemHighlighted(s,t);return n==null||n?2:4}return 3}isSeriesHighlighted(e,t){return e?.series===this}isItemHighlighted(e,t){if(!(e?.datumIndex==null||t==null))return e.datumIndex===t}getHighlightStyle(e,t,i){const s=this.getHighlightState(e,t,i);return this.properties.highlight.getStyle(s)}getModuleTooltipParams(){return this.moduleMap.mapModules(e=>e.getTooltipParams()).reduce((e,t)=>Object.assign(e,t),{})}pickNodes(e,t,i=!1){const{pickModes:s,pickModeAxis:n,visible:r,contentGroup:o}=this;if(!r||!o.visible||t==="highlight"&&!this.properties.highlight.enabled||t==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let a=1/0;if(t==="tooltip"||t==="highlight-tooltip"){const{tooltip:d}=this.properties;a=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(t==="event"||t==="context-menu"){const{nodeClickRange:d}=this.properties;a=typeof d=="number"?d:1/0,i||(i=d==="exact")}const l=s.filter(d=>!i||d===0),{x:c,y:h}=e,u=JSON.stringify({x:c,y:h,maxDistance:a,selectedPickModes:l});if(this._pickNodeCache.has(u))return this._pickNodeCache.get(u);for(const d of l){let p;switch(d){case 0:{const g=this.pickNodesExactShape(e);p=g.length===0?void 0:{datums:g,distance:0};break}case 1:{const g=this.pickNodeClosestDatum(e),y=g?.distance===0?this.pickNodesExactShape(e):void 0;y!=null&&y.length!==0?p={datums:y,distance:0}:g?p={datums:[g.datum],distance:g.distance}:p=void 0;break}case 2:{const g=n!=null?this.pickNodeMainAxisFirst(e,n==="main-category"):void 0;p=g!=null?{datums:[g.datum],distance:g.distance}:void 0;break}}if(p&&p.distance<=a)return this._pickNodeCache.set(u,{pickMode:d,datums:p.datums,distance:p.distance})}return this._pickNodeCache.set(u,void 0)}pickNodesExactShape(e){const t=[];for(const i of this.contentGroup.pickNodes(e.x,e.y)){const s=i.closestDatum();s!=null&&s.missing!==!0&&t.push(s)}return t}pickNodeClosestDatum(e){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(e,t){const i=sh(e.x,e.y,t),s=i.nearest?.closestDatum();if(s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(e,t){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(e){}fireEvent(e){Zs([this.properties,this.ctx.chartService],this.fireEventWrapper,e)}fireNodeClickEvent(e,t){const i=new this.NodeEvent("seriesNodeClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(e,t){const i=new this.NodeEvent("seriesNodeDoubleClick",e,t,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(e,t){return new this.NodeEvent("nodeContextMenuAction",e,t,this)}onLegendInitialState(e,t){const{visible:i=!0,itemId:s,legendItemName:n}=t??{};this.toggleSeriesItem(i,e,s,n)}onLegendItemClick(e){const{enabled:t,itemId:i,series:s,legendType:n}=e,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,a=r!=null&&r===e.legendItemName;(s.id===this.id||a||o!=null)&&this.toggleSeriesItem(t,n,i,r,e)}onLegendItemDoubleClick(e){const{enabled:t,itemId:i,series:s,numVisibleItems:n,legendType:r}=e,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===e.legendItemName;s.id===this.id||l||a!=null?this.toggleSeriesItem(!0,r,i,o,e):t&&n===1?this.toggleSeriesItem(!0,r,void 0,o):this.toggleSeriesItem(!1,r,void 0,o)}toggleSeriesItem(e,t,i,s,n){const r=this.id;(e||t!=="category")&&(this.visible=e),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:n?.legendItemName??s,visible:e};this.fireEvent(o),this.ctx.legendManager.toggleItem(e,r,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(e,t,i,s,n,r,o){if(e==null)return"";const{axes:a,canHaveAxes:l,ctx:c,id:h,properties:u}=this,{formatManager:d}=c,p="legendItemName"in u?u.legendItemName:void 0,g="series-label",y={seriesId:this.id,...o},b=this.callWithContext.bind(this),m=I=>r.formatValue(b,I.type,I.value,y)??d.format(b,I)??String(e),v=l?Ov(s):void 0,S=v!=null?a[this.resolveKeyDirection(v)]:void 0;if(S!=null)return S.formatDatum(e,g,h,p,t,i,n,r,y,b);const M=this.getFormatterContext(s);switch(s){case"y":case"color":case"size":return m({type:"number",value:e,datum:t,seriesId:h,legendItemName:p,key:i,source:g,property:s,domain:n,boundSeries:M,fractionDigits:void 0});case"x":case"radius":case"angle":case"label":case"secondaryLabel":case"calloutLabel":case"sectorLabel":case"legendItem":return m({type:"category",value:e,datum:t,seriesId:h,legendItemName:p,key:i,source:g,property:s,domain:n,boundSeries:M})}}getMarkerStyle(e,t,i,s=!1,n=e.size??0,r){const{itemStyler:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=e;let u=Ts(Le({size:n},r,e.getStyle()),a,l,c);if(o&&i){const d=this.cachedCallWithContext(o,{seriesId:this.id,...u,...i,highlighted:s,datum:t});u=Ts(Le(d,u),a,l,c)}return u}updateMarkerStyle(e,t,i,s,n,r,o,a,{applyTranslation:l=!0,selected:c=!0}={}){const h=this.getMarkerStyle(e,i,n,r,s?.size,o),{shape:u,size:d}=h,p=this.visible&&d>0&&s&&!isNaN(s.x)&&!isNaN(s.y);if(on(t,h,void 0,a),l?t.setProperties({visible:p,shape:u,size:d,x:s?.x,y:s?.y,scalingCenterX:s?.x,scalingCenterY:s?.y}):t.setProperties({visible:p,shape:u,size:d}),c||(t.fillOpacity*=TT,t.strokeOpacity*=OT),typeof e.shape=="function"&&!t.dirtyPath){t.path.clear(!0),t.updatePath(),t.checkPathDirty();const g=t.getBBox();if(s!=null&&g.isFinite()){const y=g.computeCenter(),[b,m]=["x","y"].map(v=>(h.strokeWidth??0)+Math.abs(y[v]-s[v]));s.focusSize=Math.max(g.width+b,g.height+m)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(e){const{width:t,height:i}=e??{width:NaN,height:NaN},s=e?{seriesRectWidth:t,seriesRectHeight:i}:void 0,n=Is(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(e){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(e,t){const{datumCallbackCache:i}=this,s=i.get(e);if(s!=null)return s;try{const n=t();return i.set(e,n),n}catch(n){nu.Logger.error(String(n))}}cachedCallWithContext(e,...t){return this.ctx.callbackCache.call([this.properties,this.ctx.chartService],e,...t)}callWithContext(e,...t){return Zs([this.properties,this.ctx.chartService],e,...t)}formatTooltipWithContext(e,t,i){return e.formatTooltip([this.properties,this.ctx.chartService],t,i)}minTimeInterval(){}};f([hi({changeValue:function(e,t){this.onSeriesGroupingChange(t,e)}})],ou.prototype,"seriesGrouping",2);var Ev=(T(),N(w)),Jo=(T(),N(w)),ET=(T(),N(w)),ti=class extends ht{constructor(){super(...arguments),this.path=new Lo,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(e){this._clipX=e,this.dirtyPath=!0}set clipY(e){this._clipY=e,this.dirtyPath=!0}set dirtyPath(e){this._dirtyPath!==e&&(this._dirtyPath=e,e&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}resetPathDirty(){this.path.clear(!0),this._dirtyPath=!1}isPathDirty(){return this.path.isDirty()}onChangeDetection(e){this._dirtyPath||(this._dirtyPath=!0,super.onChangeDetection(e))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)}distanceSquared(e,t){return this.distanceSquaredTransformedPoint(e,t)}svgPathData(e){return this.updatePathIfDirty(),this.path.toSVG(e)}distanceSquaredTransformedPoint(e,t){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(e,t)?0:this.path.distanceSquared(e,t)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(e){return e.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=e.devicePixelRatio,this.updatePathIfDirty(),super.preRender(e,this.path.commands.length)}render(e){const{ctx:t}=e;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){t.save();try{const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Lo),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),t.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(t)}finally{t.restore()}}else this._clipPath=void 0,this.drawPath(t);this.fillShadow?.markClean(),super.render(e)}drawPath(e){this.fillStroke(e,this.path.getPath2D())}toSVG(){if(!this.visible)return;const e=(0,ET.createSvgElement)("path");e.setAttribute("d",this.svgPathData());const t=this.applySvgFillAttributes(e,[]);return this.applySvgStrokeAttributes(e),{elements:[e],defs:t}}};ti.className="Path",f([z()],ti.prototype,"clip",2),f([z()],ti.prototype,"clipX",1),f([z()],ti.prototype,"clipY",1);var PT=class{constructor(e){this.swapChain=e,this.hasBeenActivated=!1,this.div=(0,Jo.createElement)("div"),this.svg=(0,Jo.createSvgElement)("svg"),this.outerPath=(0,Jo.createSvgElement)("path"),this.innerPath=(0,Jo.createSvgElement)("path"),this.svg.append(this.outerPath),this.svg.append(this.innerPath),this.outerPath.classList.add("ag-charts-focus-svg-outer-path"),this.innerPath.classList.add("ag-charts-focus-svg-inner-path"),this.element=(0,Jo.createElement)("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",t=>this.onSwap(t))}clear(){}update(e,t,i){if(t!=null)if(e instanceof ti){const s=(r,o)=>{let{x:a,y:l}=tt.toCanvasPoint(e,r,o);return a-=t.x??0,l-=t.y??0,{x:a,y:l}},n=e.svgPathData(s);this.outerPath.setAttribute("d",n),this.innerPath.setAttribute("d",n),this.show(this.svg)}else{let s;if(i){const n=Math.max(e.x-t.x,0),r=Math.max(e.y-t.y,0),o=Math.min(e.x+e.width-t.x,t.width),a=Math.min(e.y+e.height-t.y,t.height);s=new W(n,r,o-n,a-r)}else s=new W(e.x-t.x,e.y-t.y,e.width,e.height);fh(this.div,s),this.show(this.div)}}onSwap(e){e!==this.element.parentElement&&(this.element.remove(),e.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(e){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(e)}overrideFocusVisible(e){this.focusVisible=e;const t={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",t[`${e}`])}isFocusVisible(e=!1){if(!e&&!this.hasBeenActivated)return!1;const t=this.element.parentElement;return t!=null&&(0,Jo.getWindow)().getComputedStyle(t).opacity==="1"}},Hi=(T(),N(w)),RT=class{constructor(e,t,i){this.label1=e,this.label2=t,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=s=>((0,Hi.setElementStyle)(s.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",s)),this.onFocus=s=>((0,Hi.setElementStyle)(s.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",s)),(0,Hi.setAttribute)(this.label1,"id",(0,Hi.createElementId)()),(0,Hi.setAttribute)(this.label2,"id",(0,Hi.createElementId)()),(0,Hi.setElementStyle)(this.label1,"display","none"),(0,Hi.setElementStyle)(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(i),this.inactiveAnnouncer=this.createAnnouncer(i),(0,Hi.setAttribute)(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(e){const t=(0,Hi.createElement)("div");return t.role=e,t.className="ag-charts-swapchain",t.addEventListener("blur",this.onBlur),t.addEventListener("focus",this.onFocus),t}destroy(){for(const e of[this.activeAnnouncer,this.inactiveAnnouncer])e.removeEventListener("blur",this.onBlur),e.removeEventListener("focus",this.onFocus),e.remove()}focus(e){this.focusOptions=e,this.activeAnnouncer.focus(e),this.focusOptions=void 0}update(e){this.skipDispatch=!0,this.swap(e),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(e,t){this.listeners[e].push(t),e==="swap"&&t(this.activeAnnouncer)}dispatch(e,t){e==="focus"?this.hasFocus=!0:e==="blur"&&(this.hasFocus=!1),this.listeners[e].forEach(i=>i(t))}swap(e){const t=this.activeAnnouncer.tabIndex;this.label2.textContent=e,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],(0,Hi.setAttributes)(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),(0,Hi.setAttributes)(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:t}),this.dispatch("swap",this.activeAnnouncer)}},_T=(T(),N(w)),jT={arrowdown:{bindings:[{code:"ArrowDown"}]},arrowleft:{bindings:[{code:"ArrowLeft"}]},arrowright:{bindings:[{code:"ArrowRight"}]},arrowup:{bindings:[{code:"ArrowUp"}]},delete:{bindings:[{key:"Backspace"},{key:"Delete"}],activatesFocusIndicator:!1},redo:{bindings:[{key:"y",ctrlOrMeta:!0},{key:"z",ctrlOrMeta:!0,shift:!0}],activatesFocusIndicator:!1},undo:{bindings:[{key:"z",ctrlOrMeta:!0}],activatesFocusIndicator:!1},submit:{bindings:[{key:"Enter"},{code:"Enter"},{code:"Space"}]},zoomin:{bindings:[{key:"+"},{code:"ZoomIn"},{code:"Add"}],activatesFocusIndicator:!1},zoomout:{bindings:[{key:"-"},{code:"ZoomOut"},{code:"Substract"}],activatesFocusIndicator:!1}};function zT(e,t){for(const i of t)if("code"in i){if(i.code===e.code)return!0}else if(i.key===e.key&&(i.shift===void 0||i.shift===e.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===e.ctrlKey||i.ctrlOrMeta===e.metaKey))return!0;return!1}function FT(e){for(const[t,{activatesFocusIndicator:i=!0,bindings:s}]of(0,_T.entries)(jT))if(zT(e,s))return{name:t,activatesFocusIndicator:i}}function BT(e,t,i){const s=ng(e,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof W){const{x:r,y:o}=n.computeCenter();return{x:t.x+r,y:t.y+o}}return tt.toCanvas(n).computeCenter()}}function VT({bounds:e}){return e instanceof W?e:e!=null?tt.toCanvas(e):W.NaN}function GT(e,t,i){const{x:s,y:n}=BT(e,t,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}var au=(T(),N(w));function Pv(e,t,i,s){let{top:n,right:r,bottom:o,left:a,width:l,height:c}=s;return a!=null?l!=null?r=i.width-a+l:r!=null&&(l=i.width-a-r):r!=null&&l!=null&&(a=i.width-r-l),n!=null?c!=null?o=i.height-n-c:o!=null&&(c=i.height-o-n):o!=null&&c!=null&&(n=i.height-o-c),l==null?c==null?(l=e,c=t):l=Math.ceil(e*c/t):c==null&&(c=Math.ceil(t*l/e)),a==null&&(r==null?a=Math.floor((i.width-l)/2):a=i.width-r-l),n==null&&(o==null?n=Math.floor((i.height-c)/2):n=i.height-c-o),{x:a,y:n,width:l,height:c}}var HT=(T(),N(w)),Rv=.1,_v=200,jv=12,UT=.5,WT=class{constructor(){this.events=new HT.EventEmitter,this.x1=NaN,this.y1=NaN,this.x=NaN,this.y=NaN,this.vx=0,this.vy=0,this.t0=NaN,this.animationFrameHandle=void 0}reset(){this.x=NaN,this.y=NaN,this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0)}update(e,t){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=e,this.y=t,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=e,this.y1=t,this.t0=Date.now(),this.animationFrameHandle==null&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:e,y1:t,t0:i}=this,s=Date.now(),n=s-i;this.t0=s;const r=.001,o=Math.ceil(n/(r*1e3))|0;let{x:a,y:l,vx:c,vy:h}=this;for(let u=0;u<o;u+=1){const d=a-e,p=l-t,g=-(_v*d+jv*c)/Rv,y=-(_v*p+jv*h)/Rv;c+=g*r,h+=y*r,a+=c*r,l+=h*r}Math.hypot(a-e,l-t)<UT?(this.x=this.x1,this.y=this.y1,this.vx=0,this.vy=0):(this.x=a,this.y=l,this.vx=c,this.vy=h,this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this))),this.emitUpdate()}emitUpdate(){this.events.emit("update",{x:this.x,y:this.y})}},$T=(T(),N(w)),lu=null;function Ol(e){return e===""?"":(lu??(lu=(0,$T.createElement)("div")),lu.textContent=String(e),lu.innerHTML.replace(/\n/g,"<br>"))}function El(e,t){const{path:i,size:s}=e,{x:n,y:r}=e;i.clear();let o=!1;for(const[a,l]of t){const c=n+(a-.5)*s,h=r+(l-.5)*s;o?i.lineTo(c,h):i.moveTo(c,h),o=!0}i.closePath()}var YT={circle({path:e,x:t,y:i,size:s}){const n=s/2;e.arc(t,i,n,0,Math.PI*2),e.closePath()},cross(e){El(e,[[.25,0],[.5,.25],[.75,0],[1,.25],[.75,.5],[1,.75],[.75,1],[.5,.75],[.25,1],[0,.75],[.25,.5],[0,.25]])},diamond(e){El(e,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:e,x:t,y:i,size:s}){const n=s/4;i=i+n/2,e.arc(t-n,i-n,n,mt(130),mt(330)),e.arc(t+n,i-n,n,mt(220),mt(50)),e.lineTo(t,i+n),e.closePath()},pin({path:e,x:t,y:i,size:s}){e.moveTo(t+(.15625-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.15625-.5)*s,i+(.151491-.5)*s,t+(.307741-.5)*s,i+(0-.5)*s,t+(.5-.5)*s,i+(0-.5)*s),e.cubicCurveTo(t+(.692259-.5)*s,i+(0-.5)*s,t+(.84375-.5)*s,i+(.151491-.5)*s,t+(.84375-.5)*s,i+(.34375-.5)*s),e.cubicCurveTo(t+(.84375-.5)*s,i+(.493824-.5)*s,t+(.784625-.5)*s,i+(.600181-.5)*s,t+(.716461-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.699009-.5)*s,i+(.719769-.5)*s,t+(.681271-.5)*s,i+(.743104-.5)*s,t+(.663785-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.611893-.5)*s,i+(.834367-.5)*s,t+(.562228-.5)*s,i+(.899699-.5)*s,t+(.528896-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.524075-.5)*s,i+(.992358-.5)*s,t+(.512663-.5)*s,i+(1-.5)*s,t+(.5-.5)*s,i+(1-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.487337-.5)*s,i+(1-.5)*s,t+(.475925-.5)*s,i+(.992358-.5)*s,t+(.471104-.5)*s,i+(.980648-.5)*s),e.cubicCurveTo(t+(.437772-.5)*s,i+(.899699-.5)*s,t+(.388107-.5)*s,i+(.834367-.5)*s,t+(.336215-.5)*s,i+(.766105-.5)*s),e.cubicCurveTo(t+(.318729-.5)*s,i+(.743104-.5)*s,t+(.300991-.5)*s,i+(.719769-.5)*s,t+(.283539-.5)*s,i+(.695393-.5)*s),e.cubicCurveTo(t+(.215375-.5)*s,i+(.600181-.5)*s,t+(.15625-.5)*s,i+(.493824-.5)*s,t+(.15625-.5)*s,i+(.34375-.5)*s),e.closePath()},plus(e){El(e,[[1/3,0],[2/3,0],[2/3,1/3],[1,1/3],[1,2/3],[2/3,2/3],[2/3,1],[1/3,1],[1/3,2/3],[0,2/3],[0,1/3],[1/3,1/3]])},square({path:e,x:t,y:i,size:s,pixelRatio:n}){const r=s/2;e.moveTo(Lt(n,t-r),Lt(n,i-r)),e.lineTo(Lt(n,t+r),Lt(n,i-r)),e.lineTo(Lt(n,t+r),Lt(n,i+r)),e.lineTo(Lt(n,t-r),Lt(n,i+r)),e.closePath()},star({path:e,x:t,y:i,size:s}){const r=s/2,o=r/2,a=Math.PI/2;for(let l=0;l<5*2;l++){const c=l%2===0?r:o,h=l*Math.PI/5-a,u=t+Math.cos(h)*c,d=i+Math.sin(h)*c;e.lineTo(u,d)}e.closePath()},triangle(e){El(e,[[.5,0],[1,.87],[0,.87]])}},Pl=class extends ti{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}isPointInPath(e,t){return this.distanceSquared(e,t)<=0}distanceSquared(e,t){const i=vt.anchor(this.shape);return Math.max(Math.hypot(e-this.x+(i.x-.5)*this.size,t-this.y+(i.y-.5)*this.size)-this.size/2,0)}updatePath(){const{path:e,shape:t,x:i,y:s,size:n}=this,r=this.layerManager?.canvas?.pixelRatio??1,o=vt.anchor(t),a={path:e,x:i-(o.x-.5)*n,y:s-(o.y-.5)*n,size:n,pixelRatio:r};e.clear(),typeof t=="string"?YT[t](a):typeof t=="function"&&t(a)}computeBBox(){const{x:e,y:t,size:i}=this,s=vt.anchor(this.shape);return new W(e-i*s.x,t-i*s.y,i,i)}executeFill(e,t){if(t)return super.executeFill(e,t)}executeStroke(e,t){if(t)return super.executeStroke(e,t)}};f([Li({equals:So})],Pl.prototype,"shape",2),f([z()],Pl.prototype,"x",2),f([z()],Pl.prototype,"y",2),f([z({convertor:Math.abs})],Pl.prototype,"size",2);var vt=class extends Co(Dp(Dr(Pl))){static anchor(e){return e==="pin"?{x:.5,y:1}:typeof e=="function"&&"anchor"in e?e.anchor:{x:.5,y:.5}}constructor(e){super(e),e?.shape!=null&&(this.shape=e.shape)}};function zv(e,t,i=t*(5/3)){const s=new re,n=Math.min(e.marker.strokeWidth??1,2),r=Math.min(e.line?.strokeWidth??0,2),o=Math.max(e.marker.enabled===!1?0:t,e.line==null?0:i),a=Math.max(e.marker.enabled===!1?0:t,r);if(e.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=e.line,u=new pi;u.x1=0,u.y1=a/2,u.x2=o,u.y2=a/2,u.stroke=l,u.strokeOpacity=c,u.strokeWidth=r,u.lineDash=h,s.append(u)}if(e.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:p,lineDashOffset:g}=e.marker,y=new vt;y.shape=l??"square",y.size=t,y.fill=c,y.fillOpacity=h??1,y.stroke=u,y.strokeOpacity=d??1,y.strokeWidth=n,y.lineDash=p,y.lineDashOffset=g??0;const b=vt.anchor(l),m=o/2+(b.x-.5)*t,v=a/2+(b.y-.5)*t,S=t/(t+n);y.x=m,y.y=v,y.scalingCenterX=m,y.scalingCenterY=v,y.scalingX=S,y.scalingY=S,s.append(y)}return re.toSVG(s,o,a)}var jt="ag-charts-tooltip",Fv="ag-charts-tooltip--dark";function Bv(e){const t=[],i=new Map;for(const s of e)if(s.type==="structured"){const{heading:n}=s,r=n!=null?i.get(n):void 0,o={type:"structured",heading:n,items:[s]};r==null?(i.set(n,o),t.push(o)):r.items.push(s)}else t.push(s);return t}function Vv(e){const t=Bv(e),i=[];return t.forEach(s=>{if(s.type==="raw")return"";s.heading!=null&&i.push(s.heading),s.items.forEach(n=>{n.title!=null&&i.push(n.title),n.data?.forEach(r=>{i.push(r.label??r.fallbackLabel,r.value)})})}),i.join("; ")}function Wg(e,t,i){let s="";e==null?s+=`<span class="${jt}-label">${Ol(t)}</span>`:(s+=`<span class="${jt}-label">${Ol(e)}</span>`,s+=" ",s+=`<span class="${jt}-value">${Ol(t)}</span>`);const n=[`${jt}-row`];return i&&n.push(`${jt}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function KT(e){let t="";if(e.data?.length&&e.data.every(n=>n.value==null||n.value===""))return t;const i=e.title==null&&e.data?.length===1,s=e.symbol==null?void 0:zv(e.symbol,12);return s!=null&&(e.title!=null||e.data?.length)&&(t+=`<span class="${jt}-symbol">${s}</span>`),e.title!=null&&(t+=`<span class="${jt}-title">${Ol(e.title)}</span>`,t+=" "),e.data?.forEach(n=>{t+=Wg(n.label??n.fallbackLabel,n.value,i),t+=" "}),t}function Gv(e,t){if(e==null||t.length===1)return;const i=e?.t("tooltipPaginationStatus",{index:t.index+1,count:t.length});return`<div class="${jt}-footer">${i}</div>`}function Hv(e,t,i,s){const n=t.items.length===1?t.items[0]:void 0;let r,o,a;switch(i){case"compact":r=!0,o=n?.title;break;case"single":r=n!=null&&(t.heading==null||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,a=t.heading??n?.title;break;case"shared":r=!1}let l="";if(r&&n!=null?(o!=null&&(l+=Wg(void 0,o,!1)),n.data?.forEach(h=>{l+=Wg(h.label??a,h.value,!1),l+=" "})):(t.heading!=null&&(l+=`<span class="${jt}-heading">${Ol(t.heading)}</span>`,l+=" "),t.items.forEach(h=>{l+=KT(h)})),l.length===0)return;const c=i!=="compact"&&s!=null?Gv(e,s):void 0;return c+null&&(l+=c),l=`<div class="${jt}-content">${l.trimEnd()}</div>`,l}function ZT(e,t){const i=t==null?void 0:Gv(e,t);return i==null?"":`<div class="${jt}-content">${i}</div>`}function Uv(e,t,i,s){const n=Bv(t);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return Hv(e,n[0],i,s);{const r=n.map(o=>o.type==="structured"?Hv(e,o,i):o.rawHtmlString);return s!=null&&r.push(ZT(e,s)??""),r.join("")}}}var XT={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},qT={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},QT={left:3,"top-left":void 0,"bottom-left":void 0,top:2,center:void 0,bottom:1,right:0,"top-right":void 0,"bottom-right":void 0},Wv={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},JT={pointer:"top",node:"top",chart:"top-left"},_r=class extends ae{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}};f([x],_r.prototype,"xOffset",2),f([x],_r.prototype,"yOffset",2),f([x],_r.prototype,"anchorTo",2),f([x],_r.prototype,"placement",2);var Ui=class extends ae{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new _r,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.cleanup=new au.CleanupRegistry,this.springAnimation=new WT,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new L0,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.cleanup.register(this.springAnimation.events.on("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(e,t){return"togglePopover"in(0,au.getWindow)().HTMLElement.prototype&&(this.element=t.addChild("tooltip-container",jt),this.element.setAttribute("popover","manual"),this.element.className=jt,this.element.style.positionAnchor=t.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=e,()=>{t.removeChild("tooltip-container",jt),this.cleanup.flush(),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(e){return this.element?.contains(e)??!1}updateTooltipPosition(){const{element:e,_elementSize:t,positionParams:i}=this;if(e==null||t==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:r}=i,{x:o,y:a}=this.springAnimation,l=r.position?.anchorTo??"pointer";let c=r.position?.placement??JT[l];Array.isArray(c)||(c=[c]);const h=r.position?.xOffset??0,u=r.position?.yOffset??0,d=n.x,p=n.y,g=n.width-t.width-1+d,y=n.height-t.height+p;let b=0,m,v,S=!1;do{m=c[b],b+=1;const C=this.getTooltipBounds({elementSize:t,placement:m,anchorTo:l,canvasX:o,canvasY:a,yOffset:u,xOffset:h,canvasRect:s});v=Pv(t.width,t.height,n,C),S=!1,Wv[m]&1&&(S||(S=v.x<d||v.x>g)),Wv[m]&2&&(S||(S=v.y<p||v.y>y))}while(b<c.length&&S);const M=(0,au.clamp)(d,v.x,g),I=(0,au.clamp)(p,v.y,y);S||(S=M!==v.x||I!==v.y);const k=l!=="chart"&&!S&&!h&&!u,L=r.showArrow??this.showArrow??k;this.arrowPosition=L?QT[m]:void 0,this.updateClassModifiers(),e.style.translate=`${M}px ${I}px`}show(e,t,i,s,n,r=!1){const{element:o}=this;if(o!=null&&s!=null&&s.length!==0){const c=Uv(this.localeManager,s,this.mode,this.pagination?n:void 0);if(c==null){this.toggle(!1);return}o.innerHTML=c}else if(o==null||o.innerHTML===""){this.toggle(!1);return}const a={x:e.x-t.x,y:e.y-t.y,width:e.width,height:e.height};switch(this.positionParams={canvasRect:t,relativeRect:a,meta:i},i.position?.anchorTo??"pointer"){case"node":this.springAnimation.update(i.nodeCanvasX??i.canvasX,i.nodeCanvasY??i.canvasY);break;case"pointer":this.springAnimation.update(i.canvasX,i.canvasY);break;case"chart":this.springAnimation.reset()}i.enableInteraction?(this.enableInteraction=!0,o.style.pointerEvents="auto",o.removeAttribute("aria-hidden"),o.tabIndex=-1):(this.enableInteraction=!1,o.style.pointerEvents="none",o.setAttribute("aria-hidden","true"),o.removeAttribute("tabindex")),o.style.setProperty("--top",`${t.top}px`),o.style.setProperty("--left",`${t.left}px`),this.updateClassModifiers(),this.toggle(!0,r)}hide(){this.toggle(!1)}maybeEnterInteractiveTooltip({relatedTarget:e},t){const{interactive:i,interactiveLeave:s,enabled:n,element:r}=this;if(r==null)return!1;if(s)return!0;const o=i&&n&&this.isVisible()&&e instanceof Node&&this.contains(e);return o&&(this.interactiveLeave={callback:t,listener:a=>{(a.relatedTarget==null||a.relatedTarget instanceof Node&&!this.contains(a.relatedTarget))&&this.popInteractiveLeaveCallback()}},r.addEventListener("focusout",this.interactiveLeave.listener),r.addEventListener("mouseout",this.interactiveLeave.listener)),o}popInteractiveLeaveCallback(){const{interactiveLeave:e,element:t}=this;this.interactiveLeave=void 0,e&&(t&&(t.removeEventListener("focusout",e.listener),t.removeEventListener("mouseout",e.listener)),e.callback())}toggle(e,t=!1){const{delay:i}=this;e&&i>0&&!t?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(e))}toggleCallback(e){this.element?.isConnected&&this._visible!==e&&(this._visible=e,this.element.togglePopover(e),e?this.updateTooltipPosition():(this.springAnimation.reset(),this.popInteractiveLeaveCallback()))}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:e}=this.element,t=(i,s)=>e.toggle(`${jt}--${i}`,s);t("no-interaction",!this.enableInteraction),t("arrow-top",this.arrowPosition===1),t("arrow-right",this.arrowPosition===3),t("arrow-bottom",this.arrowPosition===2),t("arrow-left",this.arrowPosition===0),t("compact",this.mode==="compact"),e.toggle(Fv,this.darkTheme);for(const i of this.wrapTypes)e.toggle(`${jt}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(e){const{elementSize:t,anchorTo:i,placement:s,canvasX:n,canvasY:r,yOffset:o,xOffset:a,canvasRect:l}=e,{width:c,height:h}=t,u={width:c,height:h};if(i==="node"||i==="pointer"){const d=XT[s],p=qT[s];return u.top=r+o+h*(p-1)/2+8*p,u.left=n+a+c*(d-1)/2+8*d,u}switch(s){case"top":return u.top=o,u.left=l.width/2-c/2+a,u;case"right":return u.top=l.height/2-h/2+o,u.left=l.width-c/2+a,u;case"left":return u.top=l.height/2-h/2+o,u.left=a,u;case"bottom":return u.top=l.height-h+o,u.left=l.width/2-c/2+a,u;case"top-left":return u.top=o,u.left=a,u;case"top-right":return u.top=o,u.left=l.width-c+a,u;case"bottom-right":return u.top=l.height-h+o,u.left=l.width-c+a,u;case"bottom-left":return u.top=l.height-h+o,u.left=a,u}return u}};f([x],Ui.prototype,"enabled",2),f([x],Ui.prototype,"mode",2),f([x],Ui.prototype,"showArrow",2),f([x],Ui.prototype,"delay",2),f([x],Ui.prototype,"range",2),f([x],Ui.prototype,"wrapping",2),f([x],Ui.prototype,"position",2),f([x],Ui.prototype,"pagination",2),f([x],Ui.prototype,"darkTheme",2),f([x],Ui.prototype,"bounds",2);function $g(e,t){return e.series===t.series&&ft(e.datumIndex,t.datumIndex)}var eO=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(e,t){this.candidates=e;let i=t!=null?e.findIndex(s=>$g(s,t)):-1;return i===-1&&(i=0),this.active=e[i],{current:this.active,index:i,length:e.length}}next(){const{candidates:e,active:t}=this,i=t==null?-1:e.findIndex(n=>$g(n,t));if(i===-1)return;let s=i+1;return s>=e.length&&(s=0),this.active=e[s],{current:this.active,index:s,length:this.candidates.length}}},tO=class extends Fp{constructor(e){super(),this.chart=e,this.id=(0,Ev.createId)(this),this.series=[],this.highlight={pendingHoverEvent:void 0,appliedHoverEvent:void 0,stashedHoverEvent:void 0},this.tooltip={lastHover:void 0},this.hoverDevice="pointer",this.previousInputDevice="keyboard",this.focus={sortedSeries:[],series:void 0,seriesIndex:0,datumIndex:0,datum:void 0},this.cachedTooltipContent=void 0,this.hoverScheduler=Kk(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=5){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.tooltipCandidates=new eO;const t=e.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=e.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new RT(t,i,"img"),this.swapChain.addListener("blur",o=>this.onBlur(o)),this.swapChain.addListener("focus",()=>this.onFocus()),e.ctx.domManager.mode==="normal"&&(this.focusIndicator=new PT(this.swapChain),this.focusIndicator.overrideFocusVisible(e.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:n,containerWidget:r}=e.ctx.widgets;n.setTabIndex(-1),this.cleanup.register(()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>e.ctx.domManager.removeChild("series-area","series-area-aria-label2"),n.addListener("focus",()=>this.swapChain.focus({preventScroll:!0})),n.addListener("mousemove",o=>this.onHover(o,n)),n.addListener("wheel",o=>this.onWheel(o)),n.addListener("mouseleave",o=>this.onLeave(o)),n.addListener("keydown",o=>this.onKeyDown(o)),n.addListener("contextmenu",(o,a)=>this.onContextMenu(o,a)),r.addListener("contextmenu",(o,a)=>this.onContextMenu(o,a)),r.addListener("click",(o,a)=>this.onClick(o,a)),r.addListener("dblclick",(o,a)=>this.onClick(o,a)),e.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),e.ctx.eventsHub.on("dom:resize",()=>this.clearAll()),e.ctx.eventsHub.on("highlight:change",o=>this.changeHighlightDatum(o)),e.ctx.eventsHub.on("layout:complete",o=>this.layoutComplete(o)),e.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),e.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),e.ctx.eventsHub.on("zoom:change",()=>this.clearAll()),e.ctx.eventsHub.on("zoom:pan-start",()=>this.clearAll())),s&&this.cleanup.register(s.events.on("drag-move",o=>this.onDragMove(o,n)),s.events.on("click",o=>this.onClick(o,n)),s.events.on("dblclick",o=>this.onClick(o,n)))}get bbox(){return(this.seriesRect??W.zero).clone()}isState(e){return this.chart.ctx.interactionManager.isState(e)}isIgnoredTouch(e){return!(e.device!=="touch"||e.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var e;this.cachedTooltipContent=void 0,(e=this.highlight).stashedHoverEvent??(e.stashedHoverEvent=this.highlight.appliedHoverEvent),this.chart.ctx.tooltipManager.removeTooltip(this.id),this.focusIndicator?.clear(),this.clearHighlight()}preSceneRender(){this.highlight.stashedHoverEvent!=null&&(this.highlight.pendingHoverEvent=this.highlight.stashedHoverEvent,this.highlight.stashedHoverEvent=void 0,this.handleHoverHighlight(!0)),this.tooltip.lastHover!=null&&this.handleHoverTooltip(this.tooltip.lastHover,!0)}updateComplete(){this.isState(34)&&this.focusIndicator?.isFocusVisible()&&this.handleSeriesFocus(0,0,!0)}update(e,t){this.chart.ctx.updateService.update(e,t)}seriesChanged(e){this.focus.sortedSeries=[...e].sort((t,i)=>{let s=t.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[t._declarationOrder,i._declarationOrder]),s<n?-1:s>n?1:0}),this.series=e}layoutComplete(e){this.seriesRect=e.series.rect,this.hoverRect=e.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(e.series.paddedRect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(e.chart)}onContextMenu(e,t){const{sourceEvent:i}=e;if(i.currentTarget!=t.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=e;this.chart.ctx.contextMenuRegistry.dispatchContext("always",{widgetEvent:e,canvasX:l,canvasY:c},void 0)}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=tt.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNodes({x:e.currentX,y:e.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.matches[0].datum)}const r=s?.series;this.clearAll();const o=e.currentX+t.cssLeft(),a=e.currentY+t.cssTop();r&&s?this.chart.ctx.contextMenuRegistry.dispatchContext("series-node",{widgetEvent:e,canvasX:o,canvasY:a},{pickedSeries:r,pickedNode:s},n):this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{widgetEvent:e,canvasX:o,canvasY:a},void 0,n)}onLeave(e){!this.isState(41)||e.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.maybeEnterInteractiveTooltip(e.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.hoverDevice!=="keyboard"&&this.clearAll())}onWheel(e){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(e,t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t))}onHover(e,t){this.isState(41)&&this.onHoverLikeEvent(e,t)}onHoverLikeEvent(e,t){if(!this.isIgnoredTouch(e)&&(e.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&e.sourceEvent.preventDefault(),t===this.chart.ctx.widgets.seriesWidget&&((e.device==="touch"||iO(e,"drag-move"))&&(this.tooltip.lastHover=e),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=e,this.hoverScheduler.schedule(),this.isState(32)))){const{currentX:i,currentY:s}=e,n=this.pickNodes({x:i,y:s},"event")?.matches,r=n?.[0];r?.series.hasEventListener("seriesNodeClick")||r?.series.hasEventListener("seriesNodeDoubleClick")||n!=null&&n.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(e,t){if(e.device==="keyboard"||(t===this.chart.ctx.widgets.seriesWidget&&this.chart.ctx.animationManager.isActive()&&this.chart.ctx.animationManager.skipCurrentBatch(),e.device==="touch"&&t===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41)))return;if(t===this.chart.ctx.widgets.seriesWidget){if(!t.getElement().contains(e.sourceEvent.target))return}else if(e.sourceEvent.target!=t.getElement())return;if(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(e,t),!this.isState(32))return;if(t==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(e)){this.update(5),e.sourceEvent.preventDefault();return}const i={type:e.type==="click"?"click":"doubleClick",event:e.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(e){this.isState(34)&&(this.hoverDevice="pointer",this.maybeEnterInteractiveTooltip(e)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(e){if(!this.isState(43))return;const t=FT(e.sourceEvent);switch(t?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.previousInputDevice==="keyboard"),t?.name){case"redo":return this.chart.ctx.eventsHub.emit("series:redo",null);case"undo":return this.chart.ctx.eventsHub.emit("series:undo",null);case"zoomin":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:1,widgetEvent:e});case"zoomout":return this.chart.ctx.eventsHub.emit("series:keynav-zoom",{delta:-1,widgetEvent:e});case"arrowup":return this.onArrow(-1,0,e);case"arrowdown":return this.onArrow(1,0,e);case"arrowleft":return this.onArrow(0,-1,e);case"arrowright":return this.onArrow(0,1,e);case"submit":return this.onSubmit(e)}}onArrow(e,t,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=e,this.focus.datumIndex+=t,this.handleFocus(e,t),i.sourceEvent.preventDefault(),this.chart.ctx.eventsHub.emit("series:focus-change",null))}onSubmit(e){if(!this.isState(34))return;const{series:t,datum:i}=this.focus,s=e.sourceEvent;t!=null&&i!=null?t.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(e){var t;const i=this.pickNodes({x:e.currentX,y:e.currentY},"event");if(i==null||i.matches.length===0)return;const s=this.chart.tooltip.pagination?this.tooltipCandidates.update(i.matches,this.tooltipCandidates.current)?.current:void 0,{series:n,datum:r}=s??i.matches[0],o=s==null?i.distance:0;if(e.type==="click"){const l=n.fireNodeClickEvent(e.sourceEvent,r)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(l!=null){e.sourceEvent.preventDefault();const{currentX:c,currentY:h}=e,u=c+(this.hoverRect?.x??0),d=h+(this.hoverRect?.y??0);(t=this.highlight).pendingHoverEvent??(t.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.current,u,d,{index:l.index,length:l.length})}return!0}return e.type==="dblclick"?(e.preventZoomDblClick=o===0,n.fireNodeDoubleClickEvent(e.sourceEvent,r),!0):!1}handleFocus(e,t){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(e,t):this.focusIndicator?.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(e,t,i=!1){if(this.chart.chartType==="hierarchy"||this.chart.chartType==="gauge"){this.handleSoloSeriesFocus(e,t,i);return}const{focus:s}=this,n=s.sortedSeries.filter(c=>c.visible&&c.focusable);if(n.length===0)return;const r=s.datumIndex-t,o=s.seriesIndex-e;s.seriesIndex=(0,Ev.clamp)(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const a=this.focus.datumIndex,l=this.focus.seriesIndex;this.updatePickedFocus(a,t,r,l,e,o,i)}handleSoloSeriesFocus(e,t,i){this.focus.series=this.focus.sortedSeries[0];const s=this.focus.datumIndex,n=this.focus.seriesIndex,r=this.focus.datumIndex-t,o=this.focus.seriesIndex-e;this.updatePickedFocus(s,t,r,n,e,o,i)}updatePickedFocus(e,t,i,s,n,r,o){const{focus:a,hoverRect:l,seriesRect:c}=this;if(a.series==null||l==null)return;const h=a?.series?.pickFocus({datumIndex:e,datumIndexDelta:t,otherIndex:s,otherIndexDelta:n,seriesRect:c});if(!h)return;const{datum:u}=h;if(a.datum=u,a.datumIndex=h.datumIndex,h.otherIndex!=null&&(a.seriesIndex=h.otherIndex),this.focusIndicator?.isFocusVisible()){this.chart.ctx.animationManager.reset();const p=VT(h),{x:g,y}=p.computeCenter();if(!l.containsPoint(g,y)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,p))return;const{x1:b,x2:m,y1:v,y2:S}=fl.from(p),M=l.containsPoint(b,v),I=l.containsPoint(m,v),k=l.containsPoint(b,S),L=l.containsPoint(m,S);if(!(M||I||k||L)){const C=fl.from(l);h.movedBounds=p.clone(),b<C.x1&&m<C.x1?(h.movedBounds.x=C.x1-2,h.movedBounds.width=4):b>C.x2&&m>C.x2&&(h.movedBounds.x=C.x2-2,h.movedBounds.width=4),v<C.y1&&S<C.y1?(h.movedBounds.y=C.y1-2,h.movedBounds.height=4):v>C.y2&&S>C.y2&&(h.movedBounds.y=C.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const d=GT(a.series,l,h);if(d!=null&&this.hoverDevice==="keyboard"){this.tooltip.lastHover=void 0,this.highlight.appliedHoverEvent=void 0,this.highlight.pendingHoverEvent=void 0,this.highlight.stashedHoverEvent=void 0;const p=this.getTooltipContent(a.series,u.datumIndex,u),g=zh.makeTooltipMeta(d,a.series,u,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,u),p?this.chart.ctx.tooltipManager.updateTooltip(this.id,g,p):this.chart.ctx.tooltipManager.removeTooltip(this.id),o||(t===0&&n===0||i!==h.datumIndex||r!==(h.otherIndex??a.seriesIndex))&&p!=null&&this.swapChain.update(this.getDatumAriaText(u,p))}}getDatumAriaText(e,t){const i=t==null?"":Vv(t);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:e.series.getDatumAriaText?.(e,i)??i})}clearHighlight(){this.highlight.pendingHoverEvent=void 0,this.highlight.appliedHoverEvent=void 0,this.chart.ctx.highlightManager.updateHighlight(this.id)}clearTooltip(){this.chart.ctx.tooltipManager.removeTooltip(this.id),this.tooltip.lastHover=void 0}clearAll(){this.clearHighlight(),this.clearTooltip(),this.focusIndicator?.clear()}handleHoverHighlight(e){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const t=this.highlight.appliedHoverEvent;if(!t||!this.isState(41))return;const{currentX:i,currentY:s}=t,n=t.currentX+(this.hoverRect?.x??0),r=t.currentY+(this.hoverRect?.y??0);if(e?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(n,r)){this.clearHighlight();return}const{range:o}=this.chart.highlight,a=o==="tooltip"?"highlight-tooltip":"highlight",l=this.pickNodes({x:i,y:s},a);if(!l||l.matches.length===0){this.chart.ctx.highlightManager.updateHighlight(this.id);return}const{current:c}=this.tooltipCandidates,u=(c==null?void 0:l.matches.find(d=>$g(d,c)))?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,u),this.hoverDevice="pointer"}handleHoverTooltip(e,t){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:s,currentY:n}=e,r=s+(this.hoverRect?.x??0),o=n+(this.hoverRect?.y??0),a=e.sourceEvent.target;if(t?this.chart.ctx.animationManager.isActive():!this.hoverRect?.containsPoint(r,o)){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(a&&this.chart.tooltip.interactive&&this.chart.ctx.domManager.isManagedChildDOMElement(a,"canvas-overlay",jt))return;const l=this.pickNodes({x:e.currentX,y:e.currentY},"tooltip");if(!l||l.matches.length===0){this.hoverDevice=="pointer"&&this.clearTooltip();return}if(this.hoverDevice="pointer",l.distance===0){const{current:c,index:h,length:u}=this.tooltipCandidates.update(l.matches,this.chart.tooltip.pagination?i:void 0);this.showTooltip(c,r,o,{index:h,length:u})}else this.showTooltip(l.matches[0],r,o)}showTooltip({series:e,datum:t,datumIndex:i},s,n,r){const o=this.getTooltipContent(e,i,t);if(o!=null){const l=zh.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},e,t,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,l,o,r)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}maybeEnterInteractiveTooltip(e){return this.chart.tooltip.maybeEnterInteractiveTooltip(e,()=>{this.tooltip.lastHover=void 0,this.chart.ctx.tooltipManager.removeTooltip(this.id),this.chart.ctx.highlightManager.updateHighlight(this.id)})}changeHighlightDatum(e){const t=e.previousHighlight?.series,i=e.currentHighlight?.series;t?.properties.cursor&&e.previousHighlight?.datum&&this.chart.ctx.domManager.updateCursor(t.id),i?.properties.cursor&&i.properties.cursor!=="default"&&e.currentHighlight?.datum&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||t==null?this.update(5):this.update(5,{seriesToUpdate:new Set([t,i].filter(Boolean))})}pickNodes(e,t,i){const s=[...this.series].reverse();let n;for(const r of s){if(!r.visible||!r.contentGroup.visible)continue;const o=r.pickNodes(e,t,i);if(o==null||o.datums.length===0)continue;const{datums:a,distance:l}=o;if(o.datums.length!==0){if(l===0){n?.distance!==0&&(n={matches:[],distance:0});for(const c of a){const{datumIndex:h}=c;n.matches.push({series:r,datum:c,datumIndex:h})}}else if(n==null||n.distance>l){const[c]=a,{datumIndex:h}=c;n={matches:[{series:r,datum:c,datumIndex:h}],distance:l}}}}return n}getTooltipContent(e,t,i){if(!(e.tooltipEnabled??this.chart.tooltip.enabled)){this.cachedTooltipContent=void 0;return}const{cachedTooltipContent:n}=this;if(n!=null&&n.series===e&&n.datumIndex===t)return n.content;{let r=this.chart.getTooltipContent(e,t,i);return r.length===0&&(r=void 0),this.cachedTooltipContent={series:e,datumIndex:t,content:r},r}}};function iO(e,t){return e.type!==t}var sO=(T(),N(w)),$v=30,nO=class{constructor(e){this.seriesRoot=e,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(e){this.expectedSeriesCount=e}requestGroup(e){const{internalId:t,type:i,contentGroup:s,seriesGrouping:n}=e,{groupIndex:r=t}=n??{},o=this.series.get(t);if(o!=null)throw new Error(`AG Charts - series already has an allocated layer: ${JSON.stringify(o)}`);this.series.size===0&&(this.mode=this.expectedSeriesCount>=$v?"aggressive-grouping":"normal");let a=this.groups.get(i);a==null&&(a=new Map,this.groups.set(i,a));const l=this.lookupIdx(r);let c=a.get(l);return c==null&&(c={type:i,id:l,seriesIds:[],group:this.seriesRoot.appendChild(new re({name:`${e.contentGroup.name??i}-managed-layer`,zIndex:e.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(t,{layerState:c,seriesConfig:e}),c.seriesIds.push(t),c.group.appendChild(s),c.group}changeGroup(e){const{internalId:t,seriesGrouping:i,type:s,contentGroup:n,oldGrouping:r}=e,{groupIndex:o=t}=i??{};this.groups.get(s)?.get(o)?.seriesIds.includes(t)||(this.series.has(t)&&this.releaseGroup({internalId:t,seriesGrouping:r,type:s,contentGroup:n}),this.requestGroup(e))}releaseGroup(e){const{internalId:t,contentGroup:i,type:s}=e;if(!this.series.has(t))throw new Error(`AG Charts - series doesn't have an allocated layer: ${t}`);const n=this.series.get(t)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(r=>r!==t),n.group.removeChild(i)),n?.seriesIds.length===0?(this.seriesRoot.removeChild(n.group),this.groups.get(n.type)?.delete(n.id),this.groups.get(s)?.delete(t)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(t)}updateLayerCompositing(){this.groups.forEach(e=>{e.forEach(t=>{const{group:i,seriesIds:s}=t;let n;s.length===0?n=!1:s.length>1?n=!0:n=this.series.get(s[0])?.seriesConfig.renderToOffscreenCanvas()===!0,i.renderToOffscreenCanvas=n,i.zIndex=this.getLowestSeriesZIndex(s)})})}lookupIdx(e){return this.mode==="normal"?e:typeof e=="string"&&(e=Number(e.split("-").at(-1)),!e)?0:Math.floor((0,sO.clamp)(0,e/this.expectedSeriesCount,1)*$v)}destroy(){this.groups.forEach(e=>{e.forEach(t=>{this.seriesRoot.removeChild(t.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(e){return e.reduce((i,s)=>{const r=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||r==null?r:Lb(i,r)<=0?i:r},void 0)??1}},Yv=class extends ae{constructor(){super(...arguments),this.dragAction="drag"}};f([x],Yv.prototype,"dragAction",2);var rO=(T(),N(w)),oO=class{constructor(e,t,i,s,n,r){this.chart=e,this.eventsHub=t,this.dataService=i,this.updateService=s,this.zoomManager=n,this.animationManager=r,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.cleanup=new rO.CleanupRegistry,this.cleanup.register(this.eventsHub.on("data:source-change",()=>this.onDataSourceChange()),this.eventsHub.on("data:load",()=>this.onDataLoad()),this.eventsHub.on("data:error",()=>this.onDataError()),this.updateService.addListener("update-complete",o=>this.onUpdateComplete(o)),this.eventsHub.on("zoom:change",()=>this.onZoomChange()))}destroy(){this.cleanup.flush()}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(4)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(e){!e.apiUpdate&&!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow(e)}onZoomChange(){this.dirtyZoom=!0}updateWindow(e){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let i,s=!0;if(t){const n=this.zoomManager.getAxisZoom(t.id);(n.min!==0||n.max!==1)&&(i=this.getAxisWindow(t,n)),s=this.shouldRefresh(e,t,n)}this.dirtyZoom=!1,this.dirtyDataSource=!1,s&&this.dataService.load({windowStart:i?.min,windowEnd:i?.max})}getValidAxis(){return this.chart.axes.find(e=>e.type==="time")}shouldRefresh(e,t,i){if(e.apiUpdate||this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const s=this.lastAxisZooms.get(t.id);return s&&i.min===s.min&&i.max===s.max?!1:(this.lastAxisZooms.set(t.id,i),!0)}getAxisWindow(e,t){const{domain:i}=e.scale;if(!t||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*t.min),r=new Date(Number(i[0])+s*t.max);return{min:n,max:r}}},Kv=(T(),N(w)),Yg=(T(),N(w)),aO=/^((?!chrome|android).)*safari/i,lO=/Version\/(\d+(\.\d+)?)/,cO=/Chrome/,hO=/Chrome\/(\d+)/,uO=/Edg/,dO=/OPR/;function pO(){const{userAgent:e}=(0,Yg.getWindow)("navigator");if(aO.test(e)){const t=lO.exec(e);if(t==null)return!1;const i=parseFloat(t[1]),s=Math.floor(i)>16;return s||Yg.Logger.warnOnce(`Unsupported Safari version: ${i}; ${e}`),!s}else if(cO.test(e)&&!uO.test(e)&&!dO.test(e)){const t=hO.exec(e);if(t==null)return!1;const i=parseInt(t[1],10),s=i>126;return s||Yg.Logger.warnOnce(`Unsupported Chrome version: ${i}; ${e}`),!s}return!1}var gO=new Set(["map-shape-background","map-line-background"]),fO=class{constructor(e,t,i,s,n,r,o){this.chartLike=e,this.overlays=t,this.eventsHub=i,this.dataService=s,this.localeManager=n,this.animationManager=r,this.domManager=o,this.cleanup=new Kv.CleanupRegistry,this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(Gg),this.cleanup.register(this.eventsHub.on("layout:complete",a=>this.onLayoutComplete(a)))}destroy(){this.cleanup.flush(),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:e}}){const t=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!gO.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(Av):this.overlayElem.classList.remove(Av),this.overlayElem.style.left=`${e.x}px`,this.overlayElem.style.top=`${e.y}px`,this.overlayElem.style.width=`${e.width}px`,this.overlayElem.style.height=`${e.height}px`;const n=t,r=!t&&!i,o=i&&!s,a=this.overlays.unsupportedBrowser.enabled&&pO();n?this.showOverlay(this.overlays.loading,e):this.hideOverlay(this.overlays.loading),r?this.showOverlay(this.overlays.noData,e):this.hideOverlay(this.overlays.noData),o?this.showOverlay(this.overlays.noVisibleSeries,e):this.hideOverlay(this.overlays.noVisibleSeries),a?this.showOverlay(this.overlays.unsupportedBrowser,e):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||r||o||a;(0,Kv.setAttribute)(this.overlayElem,"aria-hidden",!l)}showOverlay(e,t){if(!e.enabled)return;const i=e.getElement(this.chartLike,this.animationManager,this.localeManager,t);this.overlayElem.appendChild(i)}hideOverlay(e){e.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},Wi=me.create(!0,"opts"),Kg=class extends ae{constructor(){super(...arguments),this.padding=new Pn(0)}};f([x],Kg.prototype,"clip",2),f([x],Kg.prototype,"padding",2);var et=class OI extends s0{constructor(t,i){var s;super(),this.id=(0,At.createId)(this),this.seriesRoot=new Ht({name:`${this.id}-series-root`,zIndex:6}),this.annotationRoot=new Ht({name:`${this.id}-annotation-root`,zIndex:10}),this.titleGroup=new re({name:"titles",zIndex:14}),this.debug=me.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new At.AsyncAwaitQueue,this.chartCaptions=new Sh,this.padding=new Pn(20),this.seriesArea=new Kg,this.keyboard=new yg,this.touch=new Yv,this.mode="standalone",this.styleNonce=void 0,this.formatter=void 0,this.suppressFieldDotNotation=!1,this.loadGoogleFonts=!1,this.destroyed=!1,this.cleanup=new At.CleanupRegistry,this.chartAnimationPhase="initial",this.modulesManager=new CT,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this.syncStatus="init",this.fireEventWrapper=h=>super.fireEvent(h),this.apiUpdate=!1,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new At.AsyncAwaitQueue,this.performUpdateType=8,this.runningUpdateType=8,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new Uk,this.updateRequestors={},this.performUpdateTrigger=Zk(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(u){At.Logger.error("update error",u,u.stack)}}).catch(u=>At.Logger.errorOnce(u))}),this._performUpdateSplits={},this.axes=[],this.series=[],this._cachedData=void 0,this.onSeriesNodeClick=h=>{this.fireEvent(h)},this.onSeriesNodeDoubleClick=h=>{this.fireEvent(h)},this.onSeriesVisibilityChange=h=>{this.fireEvent(h)},this.seriesGroupingChanged=h=>{if(!(h instanceof Hg))return;const{series:u,seriesGrouping:d,oldGrouping:p}=h;u.contentGroup.isRoot()||this.seriesLayerManager.changeGroup({internalId:u.internalId,type:u.type,contentGroup:u.contentGroup,renderToOffscreenCanvas:()=>u.renderToOffscreenCanvas(),seriesGrouping:d,oldGrouping:p})},this.chartOptions=t;const n=i?.scene,r=i?.container??t.processedOptions.container??void 0,o=i?.styleContainer??t.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const a=new re({name:"root"});a.visible=!1,a.append(this.seriesRoot),a.append(this.annotationRoot),a.append(this.titleGroup),this.titleGroup.append(this.title.node),this.titleGroup.append(this.subtitle.node),this.titleGroup.append(this.footnote.node),this.tooltip=new Ui,this.seriesLayerManager=new nO(this.seriesRoot),this.mode=t.userOptions.mode??this.mode,this.styleNonce=t.processedOptions.styleNonce;const l=this.ctx=new dN(this,{chartType:this.getChartType(),scene:n,root:a,container:r,styleContainer:o,domMode:t.optionMetadata.domMode,withDragInterpretation:t.optionMetadata.withDragInterpretation??!0,syncManager:new FN(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,u)=>this.update(h,u),updateMutex:this.updateMutex});this.cleanup.register(l.eventsHub.on("dom:resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new Qo,(s=this.overlays.loading).renderer??(s.renderer=()=>wT(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new oO(this,l.eventsHub,l.dataService,l.updateService,l.zoomManager,l.animationManager),new fO(this,this.overlays,l.eventsHub,l.dataService,l.localeManager,l.animationManager,l.domManager)],this.highlight=new Nx,this.container=r;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new tO(this.initSeriesAreaDependencies()),this.cleanup.register(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.eventsHub.on("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.eventsHub.on("data:load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),Ls.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(7)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.eventsHub.on("zoom:change",()=>{this.series.forEach(u=>u.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(4,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(t){return OI.chartsInstances.get(t)}get canvasElement(){return this.ctx.scene.canvas.element}download(t,i){this.ctx.scene.download(t,i)}getCanvasDataURL(t){return this.ctx.scene.getDataURL(t)}toSVG(){return this.ctx.scene.toSVG()}get seriesAreaBoundingBox(){return this.seriesAreaManager.bbox}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(t){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(t)}fireEvent(t){Zs(this,this.fireEventWrapper,t)}initSeriesAreaDependencies(){const{ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:r,mode:o}=this,a=this.getChartType();return{fireEvent:this.fireEvent.bind(this),getUpdateType:()=>this.performUpdateType,getTooltipContent:(u,d,p)=>this.getTooltipContent(u,d,p),chartType:a,ctx:t,tooltip:i,highlight:s,overlays:n,seriesRoot:r,mode:o}}getModuleContext(){return this.ctx}getTooltipContent(t,i,s){const n=t.properties.tooltip.enabled!==!1?t.getTooltipContent(i,s):void 0,r=n==null?[]:[n];if(this.tooltip.mode!=="shared"||this.series.length===1)return r;const o=t.getCategoryValue(i);return o==null?r:this.series.flatMap(a=>{if(a===t)return r;if(!a.isEnabled()||a.properties.tooltip.enabled===!1)return[];const l=a.datumIndexForCategoryValue(o),c=l==null?void 0:a.getTooltipContent(l,void 0);return c==null?[]:[c]})}getCaptionText(){return[this.title,this.subtitle,this.footnote].filter(t=>t.enabled&&t.text).map(t=>t.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const t of this.series)t.resetAnimation(this.chartAnimationPhase);for(const t of this.axes)t.resetAnimation(this.chartAnimationPhase);this.animationRect=void 0,this.ctx.animationManager.reset()}skipAnimations(){this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0}detachAndClear(){this.container=void 0,this.ctx.scene.clearCanvas()}destroy(t){if(this.destroyed)return;const i=t?.keepTransferableResources;let s;return this.performUpdateType=8,this.cleanup.flush(),this.processors.forEach(n=>n.destroy()),this.overlays.destroy(),this.modulesManager.destroy(),i?(this.ctx.scene.strip(),s={container:this.container,scene:this.ctx.scene}):(this.ctx.scene.destroy(),this.container=void 0),this.destroySeries(this.series),this.seriesLayerManager.destroy(),this.axes.forEach(n=>n.destroy()),this.axes=[],this.animationRect=void 0,this.ctx.destroy(),this.destroyed=!0,Object.freeze(this),s}requestFactoryUpdate(t){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await t(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>At.Logger.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const t of this.series)t.resetDatumCallbackCache()}update(t=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:r=this.series,newAnimationBatch:o,apiUpdate:a=!1}=i??{};this.apiUpdate=a,this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(l=>l.markNodeDataDirty());for(const l of r)this.seriesToUpdate.add(l);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.debug.check()){let l=new Error().stack??"<unknown>";l=l.replace(/\([^)]*/g,""),this.updateRequestors[l]=t}t<this.performUpdateType&&(this.performUpdateType=t,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}async performUpdate(t){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:r}=this,o=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=8,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<7&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",ll[i]);let a=performance.now();n.start??(n.start=a);const l=h=>{n[h]??(n[h]=0),n[h]+=performance.now()-a,a=performance.now()};switch(i){case 0:if(this.checkUpdateShortcut(0))break;this.ctx.updateService.dispatchPreDomUpdate(),this.updateDOM();case 1:if(this.checkUpdateShortcut(1))break;await this.updateData(),l("\u2B07\uFE0F");case 2:if(this.checkUpdateShortcut(2))break;await this.processData(),this.seriesAreaManager.dataChanged(),l("\u{1F3ED}");case 3:if(this.checkUpdateShortcut(3))break;await this.processDomains(),l("\u26F0\uFE0F");case 4:if(await this.checkFirstAutoSize(),this.checkUpdateShortcut(4))break;await this.processLayout(),l("\u2316");case 5:{if(this.checkUpdateShortcut(5))break;await this.updateSeries(o),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 6:if(this.checkUpdateShortcut(6))break;r.updateService.dispatchPreSceneRender(),l("\u2196");case 7:if(this.checkUpdateShortcut(7))break;r.animationManager.endBatch(),s.updateShortcutCount=this.updateShortcutCount,r.scene.render({debugSplitTimes:n,extraDebugStats:s,seriesRect:this.seriesRect}),this.extraDebugStats={};for(const h of Object.keys(n))delete n[h];this.ctx.domManager.incrementDataCounter("sceneRenders"),this.ctx.domManager.postRenderUpdate();case 8:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.updateService.dispatchUpdateComplete(this.apiUpdate),this.apiUpdate=!1,this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=8,this.syncStatus="ready"),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-n.start)*100)/100,count:t,performUpdateType:ll[i]})}updateThemeClassName(){const t="ag-charts-theme-",i=[`${t}default`,`${t}default-dark`];let s=i[0],n=!1,{theme:r}=this.chartOptions.processedOptions;for(;typeof r!="string"&&r!=null;)r=r.baseTheme;typeof r=="string"&&(s=r.replace("ag-",t),n=r.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:t,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(t?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(t){return this.destroyed?!0:this.updateShortcutCount>3?(At.Logger.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=t?(this.updateShortcutCount++,!0):!1}async checkFirstAutoSize(){this.width!=null&&this.height!=null||this._lastAutoSize||await this._autoSizeNotify.await(500)||this.debug("Chart.checkFirstAutoSize() - timeout for first size update.")}onAxisChange(t,i){i==null&&t.length===0||this.ctx.axisManager.updateAxes(i??[],t)}onSeriesChange(t,i){const s=i?.filter(n=>!t.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(t.length);for(const n of t){if(i?.includes(n))continue;const r=this.seriesLayerManager.requestGroup(n);n.attachSeries(r,this.seriesRoot,this.annotationRoot);const o=this;n.chart={get mode(){return o.mode},get isMiniChart(){return!1},get seriesRect(){return o.seriesRect}},n.resetAnimation(this.chartAnimationPhase),this.addSeriesListeners(n),n.addChartEventListeners()}this.seriesAreaManager?.seriesChanged(t)}destroySeries(t){t?.forEach(i=>{i.removeEventListener("seriesNodeClick",this.onSeriesNodeClick),i.removeEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),i.removeEventListener("groupingChanged",this.seriesGroupingChanged),i.destroy(),this.seriesLayerManager.releaseGroup(i),i.detachSeries(void 0,this.seriesRoot,this.annotationRoot),i.chart=void 0})}addSeriesListeners(t){this.hasEventListener("seriesNodeClick")&&t.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&t.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&t.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),t.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const t of this.axes)t.boundSeries=this.series.filter(i=>i.axes[t.direction]===t)}assignAxesToSeries(){const t=(0,At.groupBy)(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=t[s];if(!n){At.Logger.warnOnce(`no available axis for direction [${s}]; check series and axes configuration.`);return}const r=i.getKeys(s),o=n.find(a=>!a.keys.length||r.some(l=>a.keys.includes(l)));if(!o){At.Logger.warnOnce(`no matching axis for direction [${s}] and keys [${r}]; check series and axes configuration.`);return}i.axes[s]=o}}parentResize(t){if(t==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=t;const{pixelRatio:n}=t;if(i=Math.floor(i),s=Math.floor(s),i===0&&s===0)return;const[r=0,o=0,a=1]=this._lastAutoSize??[];r===i&&o===s&&a===n||(this._lastAutoSize=[i,s,n],this.resize("SizeMonitor",{}))}resize(t,i){const{scene:s,animationManager:n}=this.ctx,{inWidth:r,inHeight:o,inMinWidth:a,inMinHeight:l,inOverrideDevicePixelRatio:c}=i;this.ctx.domManager.setSizeOptions(a??this.minWidth,l??this.minHeight,r??this.width,o??this.height);const h=r??this.width??this._lastAutoSize?.[0],u=o??this.height??this._lastAutoSize?.[1],d=c??this.overrideDevicePixelRatio??this._lastAutoSize?.[2];if(this.debug(`Chart.resize() from ${t}`,{width:h,height:u,pixelRatio:d,stack:new Error().stack}),!(h==null||u==null||!(0,At.isFiniteNumber)(h)||!(0,At.isFiniteNumber)(u))&&s.resize(h,u,d)){n.reset();let p=!0;(this.width==null||this.height==null)&&this._firstAutoSize&&(p=!1,this._firstAutoSize=!1),this.update(4,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const t=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(t)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const t=new Fx(this.mode,this.suppressFieldDotNotation),i=this.series.map(n=>n.processData(t)),s=this.modulesManager.mapModules(n=>n.processData?.(t));this._cachedData=t.execute(this._cachedData),await Promise.all([...i,...s]),this.updateLegends()}async processDomains(){for(const t of this.axes)t.processData();for(const t of this.series)t.updatedDomains()}updateLegends(t){for(const{legend:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(t):this.setLegendData(s,i)}setCategoryLegendData(t){var i;const{ctx:{legendManager:s,stateManager:n}}=this;t&&this.series.forEach(o=>{const a=t.find(l=>l.seriesId===o.id);o.onLegendInitialState("category",a)});const r=this.series.flatMap(o=>{const a=o.getLegendData("category");return s.updateData(o.id,a),a});if(t){n.setStateAndRestore(s,t);return}if(this.mode!=="integrated"){const o={},a=new Map(this.series.map(l=>[l.id,l.type]));for(const{seriesId:l,symbol:{marker:c},label:h}of r.filter(u=>!u.hideInLegend)){if(c.fill==null)continue;const u=a.get(l),d=o[u]??(o[u]={});d[i=h.text]??(d[i]=c.fill),d[h.text]!==c.fill&&At.Logger.warnOnce(`legend item '${h.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(t,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(t))}async processLayout(){const t=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),t&&!this.animationRect?.equals(t)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(t){const{seriesRect:i}=this;await Promise.all(t.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(t,i){const s=(0,At.getWindow)("agChartsDebugTimeout");s==null?(t??(t=1e5),i??(i=!1)):(t=s,i??(i=!0));const n=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==8||this.runningUpdateType!==8||this.ctx.scene.waitingForUpdate())&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==8||this.runningUpdateType!==8)&&await this._performUpdateNotify.await(),performance.now()-n>t){const r=`Chart.waitForUpdate() timeout of ${t} reached - first chart update taking too long.`;if(i)throw new Error(r);At.Logger.warnOnce(r)}Jb()&&await(0,At.pause)(),this.ctx.scene.waitingForUpdate()&&await(0,At.pause)(50)}}filterMiniChartSeries(t){return t?.filter(i=>i.showInMiniChart!==!1)}applyOptions(t){const s=this.firstApply?t.processedOptions:t.diffOptions(this.chartOptions);if(s==null||Object.keys(s).length===0){Wi("Chart.applyOptions() - no delta, forcing re-layout",s),this.update(4,{apiUpdate:!0,newAnimationBatch:!0});return}const n=this.firstApply?{}:this.chartOptions.processedOptions,r=t.processedOptions;Wi("Chart.applyOptions() - applying delta",s);const o=this.applyModules(r),a=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer","formatter"];s.listeners&&this.registerListeners(this,s.listeners),nl(this,s,{skip:a});let l=!1,c="no-op";s.series!=null&&(c=this.applySeries(this,s.series,n?.series),l=!0),c==="replaced"&&this.resetAnimations(),this.applyAxes(this,r,n,c,[])&&(l=!0),s.data&&(this.data=s.data),s.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,s.legend.listeners),s.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=s.locale?.localeText),this.chartOptions=t;const h=this.modulesManager.getModule("navigator"),u=this.modulesManager.getModule("zoom");!h?.enabled&&!u?.enabled&&this.ctx.zoomManager.updateZoom("chart");const d=h?.miniChart,p=r.navigator?.miniChart?.series??r.series;d?.enabled===!0&&p!=null?this.applyMiniChartOptions(d,p,r,n):d?.enabled===!1&&(d.series=[],d.axes=[]),this.ctx.annotationManager.setAnnotationStyles(t.annotationThemes),l||(l=this.shouldForceNodeDataRefresh(s,c));const y=l||o?0:4;this.maybeResetAnimations(c),this.shouldClearLegendData(r,n,c)&&this.ctx.legendManager.clearData(),this.applyInitialState(r),this.ctx.formatManager.setFormatter(r.formatter),Wi("Chart.applyOptions() - update type",ll[y],{seriesStatus:c,forceNodeDataRefresh:l}),this.update(y,{apiUpdate:!0,forceNodeDataRefresh:l,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(t){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:r,zoomManager:o}=this.ctx,{initialState:a}=t;if("annotations"in t&&t.annotations?.enabled&&a?.annotations!=null){const l=a.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return Le(c,h)});r.setState(i,l)}a?.chartType!=null&&r.setState(s,a.chartType),(t.navigator?.enabled||t.zoom?.enabled)&&a?.zoom!=null&&r.setState(o,a.zoom),a?.legend!=null&&this.updateLegends(a.legend),a!=null&&n.clear()}maybeResetAnimations(t){if(this.mode==="standalone")switch(t){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(t,i){const s=!!t.data||i==="data-change"||i==="replaced",n=gg.getKeys(),r=Object.values(n).some(a=>t[a]!=null),o=t.title!=null&&t.subtitle!=null||t.formatter!=null;return s||r||o}shouldClearLegendData(t,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated"&&(t.series?.length!==i.series?.length||!t.series?.every((o,a)=>o.type===i.series?.[a].type)),r=i.legend!=null&&t.legend==null;return n||r}applyMiniChartOptions(t,i,s,n){const r=n?.navigator?.miniChart?.series??n?.series,o=this.applySeries(t,this.filterMiniChartSeries(i),this.filterMiniChartSeries(r));this.applyAxes(t,s,n,o,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const a=t.series;for(const h of a)h.properties.id=void 0;const l=t.axes,c=l.find(h=>h.direction==="x");for(const h of l)h.nice=!1,h.gridLine.enabled=!1,h.label.enabled=h===c,h.tick.enabled=!1,h.interactionEnabled=!1;if(c!=null){const h=s.navigator?.miniChart,u=h?.label,d=h?.label?.interval;if(c.line.enabled=!1,c.label.set(G(u,["interval","autoRotate","autoRotateAngle","itemStyler","minSpacing","rotation"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:p}=c;if(p.length===0)p.set([{label:{enabled:!0}}]);else for(let g=1;g<p.length;g++)p[g].label.enabled=!1}else(c.type==="time"||c.type==="unit-time"||c.type==="ordinal-time")&&(c.parentLevel.enabled=!1);c.interval.step=d?.step,c.interval.values=d?.values,c.interval.minSpacing=d?.minSpacing,c.interval.maxSpacing=d?.maxSpacing}}applyModules(t){const{type:i}=this.constructor;let s=!1;for(const n of Ds.byType("root","legend")){const o=t[n.optionsKey]!=null&&n.chartTypes.includes(i);o!==this.modulesManager.isEnabled(n)&&(o?(this.modulesManager.addModule(n,a=>a.moduleFactory(this.getModuleContext())),n.type==="legend"&&this.modulesManager.getModule(n)?.attachLegend(this.ctx.scene),this[n.optionsKey]=this.modulesManager.getModule(n)):(this.modulesManager.removeModule(n),delete this[n.optionsKey]),s=!0)}return s}initSeriesDeclarationOrder(t){for(let i=0;i<t.length;i++)t[i].setSeriesIndex(i)}applySeries(t,i,s){if(!i)return"no-change";const n=LT(t.series,i,s);if(n.status==="no-overlap"){Wi(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const h=i.map(u=>this.createSeries(u));return this.initSeriesDeclarationOrder(h),t.series=h,"replaced"}Wi("Chart.applySeries() - matchResult",n);const r=[];let o=!1,a=!1,l=!1;const c=n.changes.toSorted((h,u)=>h.targetIdx-u.targetIdx);for(const h of c)switch(a||(a=h.status==="series-grouping"),o||(o=h.diff?.data!=null),l||(l=h.status!=="no-op"),h.status){case"add":{const u=this.createSeries(h.opts);r.push(u),Wi("Chart.applySeries() - created new series",u);break}case"remove":Wi(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":r.push(h.series),Wi(`Chart.applySeries() - no change to series at previous idx ${h.idx}`,h.series);break;case"series-grouping":case"update":default:{const{series:u,diff:d,idx:p}=h;Wi(`Chart.applySeries() - applying series diff previous idx ${p}`,d,u),this.applySeriesValues(u,d),u.markNodeDataDirty(),r.push(u)}}return this.initSeriesDeclarationOrder(r),Wi("Chart.applySeries() - final series instances",r),t.series=r,a?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(t,i,s,n,r=[]){if(!("axes"in i)||!i.axes)return!1;r=["axes[].type",...r];const o=i.axes;return!(n==="replaced")&&t.axes.length===o.length&&t.axes.every((c,h)=>c.type===o[h].type)&&xv(s)?(t.axes.forEach((c,h)=>{const u=s.axes?.[h]??{},d=Is(u,o[h]);Wi(`Chart.applyAxes() - applying axis diff idx ${h}`,d);const p=`axes[${h}]`;nl(c,d,{path:p,skip:r})}),!0):(Wi(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),t.axes=this.createAxis(o,r),!0)}createSeries(t){const i=ss.create(t.type,this.getModuleContext());return this.applySeriesOptionModules(i,t),this.applySeriesValues(i,t),i}applySeriesOptionModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const r of Ds.byType("series-option"))r.optionsKey in i&&r.seriesTypes.includes(t.type)&&n.addModule(r,o=>o.moduleFactory(s))}applySeriesValues(t,i){const s=t.getModuleMap(),{type:n,data:r,listeners:o,seriesGrouping:a,showInMiniChart:l,...c}=i;for(const h of ml)if(h.type==="series-option"&&h.optionsKey in c){const u=s.getModule(h.optionsKey);if(u){const d=c[h.optionsKey];delete c[h.optionsKey],u.properties.set(d)}}c.visible!=null&&(t.visible=c.visible),t.properties.set(c),"data"in i&&t.setOptionsData(r),o&&this.registerListeners(t,o),"seriesGrouping"in i&&(a==null?t.seriesGrouping=void 0:t.seriesGrouping={...t.seriesGrouping,...a})}createAxis(t,i){const s=[],n=this.getModuleContext();for(let r=0;r<t.length;r++){const o=t[r],a=kr.create(o.type,n);this.applyAxisModules(a,o),nl(a,o,{path:`axes[${r}]`,skip:i}),s.push(a)}return IT(s),s}applyAxisModules(t,i){const s=t.createModuleContext(),n=t.getModuleMap();for(const r of Ds.byType("axis-option")){const o=i[r.optionsKey]!=null;o!==n.isEnabled(r)&&(o?(n.addModule(r,a=>a.moduleFactory(s)),t[r.optionsKey]=n.getModule(r)):(n.removeModule(r),delete t[r.optionsKey]))}}registerListeners(t,i){t.clearEventListeners();for(const[s,n]of(0,At.entries)(i))t.addEventListener(s,n)}};et.chartsInstances=new WeakMap,f([hi({newValue(e){this.destroyed||(this.ctx.domManager.setContainer(e),et.chartsInstances.set(e,this))},oldValue(e){et.chartsInstances.delete(e)}})],et.prototype,"container",2),f([hi({newValue(e){this.resize("width option",{inWidth:e})}})],et.prototype,"width",2),f([hi({newValue(e){this.resize("height option",{inHeight:e})}})],et.prototype,"height",2),f([hi({newValue(e){this.resize("minWidth option",{inMinWidth:e})}})],et.prototype,"minWidth",2),f([hi({newValue(e){this.resize("minHeight option",{inMinHeight:e})}})],et.prototype,"minHeight",2),f([hi({newValue(e){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:e})}})],et.prototype,"overrideDevicePixelRatio",2),f([x],et.prototype,"padding",2),f([x],et.prototype,"seriesArea",2),f([x],et.prototype,"keyboard",2),f([x],et.prototype,"touch",2),f([x],et.prototype,"mode",2),f([x],et.prototype,"styleNonce",2),f([Oe("chartCaptions.title")],et.prototype,"title",2),f([Oe("chartCaptions.subtitle")],et.prototype,"subtitle",2),f([Oe("chartCaptions.footnote")],et.prototype,"footnote",2),f([x],et.prototype,"formatter",2),f([x],et.prototype,"suppressFieldDotNotation",2),f([x],et.prototype,"loadGoogleFonts",2),f([hi({changeValue(e,t){this.onAxisChange(e,t)}})],et.prototype,"axes",2),f([hi({changeValue(e,t){this.onSeriesChange(e,t)}})],et.prototype,"series",2);var cu=et,ge=(T(),N(w)),Rl=(T(),N(w));function Zv(e,t){let i=[];const s=Vg(e),n=e?.series?.[0]?.type,r=n?Ve.get(n):"unknown";for(const o of ml)if(!(r!=="unknown"&&!o.chartTypes.includes(r))){if(o.type==="root"||o.type==="legend"){const a=e[o.optionsKey];if(a==null)continue;o.optionsInnerKey?a[o.optionsInnerKey]&&(i.push(`${o.optionsKey}.${o.optionsInnerKey}`),delete a[o.optionsInnerKey]):(i.push(o.optionsKey),delete e[o.optionsKey])}else if(o.type==="axis"){if(!("axes"in e)||!(0,Rl.isArray)(e.axes)||!e.axes?.some(a=>a.type===o.identifier))continue;i.push(`axis[type=${o.identifier}]`),e.axes=e.axes.filter(a=>a.type!==o.identifier)}else if(o.type==="axis-option"){if(!("axes"in e)||!(0,Rl.isArray)(e.axes)||!e.axes?.some(a=>a[o.optionsKey]))continue;i.push(`axis.${o.optionsKey}`),e.axes.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}else if(o.type==="series"){if(o.community||!(0,Rl.isArray)(e.series)||!e.series?.some(a=>a.type===o.identifier))continue;i.push(`series[type=${o.identifier}]`),e.series=e.series.filter(a=>a.type!==o.identifier)}else if(o.type==="series-option"){if(!(0,Rl.isArray)(e.series)||!e.series?.some(a=>a[o.optionsKey]))continue;i.push(`series.${o.optionsKey}`),e.series.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}}if(i.length&&!t){s&&(i=["AgCharts.createGauge"]);let o="ag-charts-enterprise",a="https://www.ag-grid.com/charts/javascript/installation/";e.mode==="integrated"&&(o="ag-grid-charts-enterprise' or 'ag-grid-enterprise/charts-enterprise",a="https://www.ag-grid.com/javascript-data-grid/integrated-charts-installation/"),Rl.Logger.warnOnce([`unable to use these enterprise features as '${o}' has not been loaded:`,"",...i,"",`See: ${a}`].join(`
`))}}function mO(e){const t="mode"in e&&e.mode==="integrated";for(const i of Ds.byType("root","legend")){const s=e[i.optionsKey],n=s!=null&&s.enabled===!1,r=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!t;n&&r&&delete e[i.optionsKey]}}var K=(T(),N(w)),Xv=(T(),N(w));function qv(e){return e?.up||e?.down||e?.neutral?"user-full":e?.fills||e?.strokes?"user-indexed":"inbuilt"}var lt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},Os={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},Zg={};is(Zg,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Fl,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>Gl,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Hl,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Ul,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Wl,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Bl,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Vl,DEFAULT_CAPTION_ALIGNMENT:()=>Wn,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Un,DEFAULT_FIBONACCI_STROKES:()=>jl,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Mt,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>st,DEFAULT_GRIDLINE_ENABLED:()=>os,DEFAULT_POLAR_SERIES_STROKE:()=>mu,DEFAULT_SEPARATION_LINES_COLOUR:()=>_l,DEFAULT_SHADOW_COLOUR:()=>Hn,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>yu,DEFAULT_TEXTBOX_COLOR:()=>Kl,DEFAULT_TEXTBOX_FILL:()=>$l,DEFAULT_TEXTBOX_STROKE:()=>Yl,DEFAULT_TEXT_ANNOTATION_COLOR:()=>zl,DEFAULT_TOOLBAR_POSITION:()=>Zl,IS_DARK_THEME:()=>ea,PALETTE_ALT_DOWN_FILL:()=>Jg,PALETTE_ALT_DOWN_STROKE:()=>qg,PALETTE_ALT_NEUTRAL_FILL:()=>ef,PALETTE_ALT_NEUTRAL_STROKE:()=>tf,PALETTE_ALT_UP_FILL:()=>Qg,PALETTE_ALT_UP_STROKE:()=>Xg,PALETTE_DOWN_FILL:()=>pu,PALETTE_DOWN_STROKE:()=>uu,PALETTE_NEUTRAL_FILL:()=>fu,PALETTE_NEUTRAL_STROKE:()=>gu,PALETTE_UP_FILL:()=>du,PALETTE_UP_STROKE:()=>hu});var ea=Symbol("is-dark-theme"),_l=Symbol("default-separation-lines-colour"),Hn=Symbol("default-shadow-colour"),Un=Symbol("default-caption-layout-style"),Wn=Symbol("default-caption-alignment"),hu=Symbol("palette-up-stroke"),uu=Symbol("palette-down-stroke"),du=Symbol("palette-up-fill"),pu=Symbol("palette-down-fill"),gu=Symbol("palette-neutral-stroke"),fu=Symbol("palette-neutral-fill"),Xg=Symbol("palette-alt-up-stroke"),qg=Symbol("palette-alt-down-stroke"),Qg=Symbol("palette-alt-up-fill"),Jg=Symbol("palette-alt-down-fill"),ef=Symbol("palette-gray-fill"),tf=Symbol("palette-gray-stroke"),mu=Symbol("default-polar-series-stroke"),yu=Symbol("default-sparkline-crosshair-stroke"),st=Symbol("default-financial-charts-annotation-stroke"),jl=Symbol("default-hierarchy-strokes"),zl=Symbol("default-text-annotation-color"),Mt=Symbol("default-financial-charts-annotation-background-fill"),Fl=Symbol("default-annotation-handle-fill"),Bl=Symbol("default-annotation-statistics-fill"),Vl=Symbol("default-annotation-statistics-stroke"),Gl=Symbol("default-annotation-statistics-color"),Hl=Symbol("default-annotation-statistics-divider-stroke"),Ul=Symbol("default-annotation-statistics-fill"),Wl=Symbol("default-annotation-statistics-stroke"),$l=Symbol("default-textbox-fill"),Yl=Symbol("default-textbox-stroke"),Kl=Symbol("default-textbox-color"),Zl=Symbol("default-toolbar-position"),os=Symbol("default-gridline-enabled"),Qv=[{type:"number",position:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/series/0/direction",void 0]},"horizontal"]},"left","bottom"]}}],yO={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillFallback"},{$palette:"fill"}]},sf={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},{$palette:"fillsFallback"},{$palette:"fills"}]},bu={$if:[{$isGradient:{$palette:"fill"}},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},bO={$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isPattern:{$palette:"fill"}},{$isImage:{$value:"$1"}}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},$n={type:"pattern",pattern:"forward-slanted-lines",width:10,height:10,padding:2,fill:{$if:[{$or:[{$isGradient:{$palette:"fill"}},{$isImage:{$palette:"fill"}}]},{$palette:"fillFallback"},{$if:[{$isPattern:{$palette:"fill"}},{$path:["/fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:bu,strokeOpacity:1,strokeWidth:4,backgroundFill:"none",backgroundFillOpacity:1,rotation:0,scale:1},jr={type:"image",backgroundFill:{$palette:"fillFallback"},backgroundFillOpacity:1,repeat:"no-repeat",fit:"contain",rotation:0};function Ei(e){return Db(e,t=>{const i=Be.fromString(t);return[Be.darken(i,.15).toString(),t,Be.lighten(i,.15).toString()]})}var nf={stroke:{$path:["../../highlightStyle/item/stroke","rgba(0, 0, 0, 0.4)"]},strokeWidth:{$path:["../../highlightStyle/item/strokeWidth",2]},strokeOpacity:{$path:["../../highlightStyle/item/strokeOpacity",void 0]},opacity:{$path:["../../highlightStyle/item/opacity",1]}},Jv={...nf,fill:{$path:["../../highlightStyle/item/fill","rgba(255,255,255, 0.33)"]},fillOpacity:{$path:["../../highlightStyle/item/fillOpacity",void 0]}};function Yn(e=!0){return{enabled:!0,highlightedItem:e?Jv:nf,unhighlightedItem:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]}},highlightedSeries:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]}},unhighlightedSeries:{opacity:{$path:["../../highlightStyle/series/dimOpacity",void 0]}}}}function eM(e=!0){return{enabled:!0,highlightedItem:e?Jv:nf,unhighlightedItem:{strokeWidth:{$path:["../../highlightStyle/series/strokeWidth",void 0]},opacity:{$path:["../../highlightStyle/series/dimOpacity",void 0]}}}}var rf="white",xO={get cartesian(){return{seriesTypes:Ve.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Ve.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Ve.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Ve.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Ve.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Ve.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Ve.gaugeTypes,commonOptions:[]}}},vO={"radial-gauge":!0,"linear-gauge":!0};function MO(e){return vO[e]===!0}var Pi=class Rc{static getDefaultColors(){return{fills:lt,fillsFallback:Object.values(lt),strokes:Os,sequentialColors:Ei(lt),divergingColors:[lt.ORANGE,lt.YELLOW,lt.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Be.interpolate([Be.fromHexString(lt.BLUE),Be.fromHexString("#cbdef5")],8).map(t=>t.toString()),secondDivergingColors:[lt.GREEN,lt.YELLOW,lt.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:lt.GREEN,stroke:Os.GREEN},down:{fill:lt.RED,stroke:Os.RED},neutral:{fill:lt.GRAY,stroke:Os.GRAY},altUp:{fill:lt.BLUE,stroke:Os.BLUE},altDown:{fill:lt.ORANGE,stroke:Os.ORANGE},altNeutral:{fill:lt.GRAY,stroke:Os.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:.325},backgroundColor:rf,borderColor:{$foregroundOpacity:.15},borderRadius:4,chartBackgroundColor:{$ref:"backgroundColor"},chartPadding:20,focusShadow:"0 0 0 3px var(--ag-charts-accent-color)",foregroundColor:"#181d1f",fontFamily:"Verdana, sans-serif",fontSize:Js,fontWeight:400,gridLineColor:{$foregroundBackgroundMix:.1},popupShadow:"0 0 16px rgba(0, 0, 0, 0.15)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:.02},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:{$ref:"foregroundColor"},chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},buttonBackgroundColor:{$ref:"backgroundColor"},buttonBorder:!0,buttonFontWeight:400,buttonTextColor:{$ref:"textColor"},inputBackgroundColor:{$ref:"backgroundColor"},inputBorder:!0,inputTextColor:{$ref:"textColor"},menuBackgroundColor:{$ref:"chromeBackgroundColor"},menuBorder:!0,menuTextColor:{$ref:"chromeTextColor"},panelBackgroundColor:{$ref:"chromeBackgroundColor"},panelSubtleTextColor:{$ref:"chromeSubtleTextColor"},tooltipBackgroundColor:{$ref:"chromeBackgroundColor"},tooltipBorder:!0,tooltipTextColor:{$ref:"chromeTextColor"},tooltipSubtleTextColor:{$ref:"chromeSubtleTextColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"chartBackgroundColor"}}}static getAxisDefaults(t,{title:i,time:s}){return Le(t,i&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Ci.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},s&&{parentLevel:{enabled:!1,label:{enabled:{$path:"../../label/enabled"},fontSize:{$path:"../../label/fontSize"},fontFamily:{$path:"../../label/fontFamily"},fontWeight:"bold",spacing:{$path:"../../label/spacing"},color:{$path:"../../label/color"},avoidCollisions:{$path:"../../label/avoidCollisions"}},tick:{enabled:{$path:"../../tick/enabled"},width:{$path:"../../tick/width"},size:{$path:"../../tick/size"},stroke:{$path:"../../tick/stroke"}}}},{label:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},spacing:11,color:{$ref:"textColor"},avoidCollisions:!0},line:{enabled:!0,width:1,stroke:{$ref:"axisColor"}},tick:{enabled:!1,size:6,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:{$apply:[{stroke:{$ref:"gridLineColor"},lineDash:[]},[{stroke:{$ref:"gridLineColor"},lineDash:[]}]]}},crossLines:{$apply:[{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.08,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}},void 0,{$pathString:["/common/axes/$axisType/crossLines",{axisType:{$path:["/axes/$index/type"]}}]},{$pathString:["/$seriesType/axes/$axisType/crossLines",{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["/axes/$index/type"]}}]}]}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"chartBackgroundColor"}},padding:{top:{$ref:"chartPadding"},right:{$ref:"chartPadding"},bottom:{$ref:"chartPadding"},left:{$ref:"chartPadding"}},seriesArea:{padding:{top:0,right:0,bottom:0,left:0}},keyboard:{enabled:!0},title:{enabled:!1,text:"Title",spacing:{$if:[{$path:"../subtitle/enabled"},10,20]},fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Ci.LARGEST},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Un,textAlign:Wn},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Ci.MEDIUM},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Un,textAlign:Wn},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:Ci.MEDIUM},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Un,textAlign:Wn},legend:{enabled:{$and:[{$greaterThan:[{$size:[{$path:"/series"}]},1]},{$or:[{$isChartType:"cartesian"},{$isChartType:"standalone"},{$and:[{$isChartType:"polar"},{$not:{$isSeriesType:"pie"}},{$not:{$isSeriesType:"donut"}}]}]}]},position:"bottom",orientation:{$if:[{$or:[{$eq:[{$path:"./position"},"left"]},{$eq:[{$path:"./position"},"right"]}]},"vertical","horizontal"]},spacing:30,listeners:{},toggleSeries:!0,item:{paddingX:16,paddingY:8,marker:{size:15,padding:8},showSeriesStroke:!0,label:{color:{$ref:"textColor"},fontSize:{$rem:Ci.SMALL},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"}}},reverseOrder:!1,pagination:{marker:{size:12},activeStyle:{fill:{$ref:"foregroundColor"}},inactiveStyle:{fill:{$ref:"subtleTextColor"}},highlightStyle:{fill:{$ref:"foregroundColor"}},label:{color:{$ref:"textColor"}}}},tooltip:{enabled:!0,darkTheme:ea,delay:0,pagination:!1,mode:{$if:[{$and:[{$isChartType:"cartesian"},{$not:{$hasSeriesType:"bubble"}},{$not:{$hasSeriesType:"scatter"}},{$greaterThan:[{$size:[{$path:"/series"}]},1]},{$lessThan:[{$size:[{$path:"/series"}]},4]}]},"shared","single"]}},overlays:{darkTheme:ea},listeners:{},series:{tooltip:{range:{$path:["/tooltip/range","exact"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","pointer"]},placement:{$path:["/tooltip/position/placement",void 0]},xOffset:{$path:["/tooltip/position/xOffset",0]},yOffset:{$path:["/tooltip/position/yOffset",0]}}}}}}constructor(t={}){const{overrides:i,palette:s,params:n}=Qe(t),r=this.createChartConfigPerChartType(this.getDefaults()),o={};i&&this.processOverrides(o,i);const{fills:a,strokes:l,sequentialColors:c,...h}=this.getDefaultColors();this.palette=Us(Le(s,{fills:Object.values(a),strokes:Object.values(l),sequentialColors:Object.values(c),...h})),this.paletteType=qv(s),this.params=Le(n,this.getPublicParameters()),this.config=Us(Qe(r)),this.overrides=Us(i),this.presets=Us(o)}processOverrides(t,i){Ve.seriesTypes.forEach(s=>{const n=s,r=i[n];MO(n)&&(t[n]=r,delete i[n])})}createChartConfigPerChartType(t){for(const[i,{seriesTypes:s}]of(0,Xv.entries)(xO)){const n=fg.get(i);for(const r of s)t[r]??(t[r]=Qe(n))}return t}getDefaults(){const t=(i,s)=>{const n={},r={axes:{},...gg.getThemeTemplates(),...this.getChartDefaults(),...fg.get(i)};for(const o of s){n[o]=Le(ss.getThemeTemplate(o),n[o]??Qe(r));const{axes:a}=n[o];for(const l of kr.keys())a[l]=Le(a[l],kr.getThemeTemplate(l),Rc.axisDefault[l]);(o==="map-shape-background"||o==="map-line-background")&&delete n[o].series.tooltip}return n};return Le(t("cartesian",Ve.cartesianTypes),t("polar",Ve.polarTypes),t("hierarchy",Ve.hierarchyTypes),t("topology",Ve.topologyTypes),t("flow-proportion",Ve.flowProportionTypes),t("standalone",Ve.standaloneTypes),t("gauge",Ve.gaugeTypes))}static applyTemplateTheme(t,i,s){if((0,Xv.isArray)(t))for(let n=0;n<t.length;n++){const r=t[n];typeof r=="symbol"&&s?.has(r)&&(t[n]=s.get(r))}else for(const n of Object.keys(t)){const r=t[n];typeof r=="symbol"&&s?.has(r)&&(t[n]=s.get(r))}}templateTheme(t,i=!0){const s=i?Qe(t):t,n=this.getTemplateParameters();return En(s,Rc.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return Rc.getDefaultColors()}getPublicParameters(){return Rc.getDefaultPublicParameters()}getTemplateParameters(){const t=new Map;t.set(ea,!1),t.set(_l,"#d9d9d9"),t.set(Hn,"#00000080"),t.set(yu,"#aaa"),t.set(Un,"block"),t.set(Wn,"center"),t.set(jl,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),t.set(mu,rf),t.set(st,lt.BLUE),t.set(Mt,lt.BLUE),t.set(zl,lt.BLUE),t.set(Fl,rf),t.set(Bl,"#fafafa"),t.set(Vl,"#ddd"),t.set(Gl,"#000"),t.set(Hl,"#181d1f"),t.set(Ul,"#e35c5c"),t.set(Wl,"#e35c5c"),t.set($l,"#fafafa"),t.set(Yl,"#ddd"),t.set(Kl,"#000"),t.set(Zl,"top"),t.set(os,!1);const i=this.getDefaultColors();return t.set(hu,this.palette.up?.stroke??i.up.stroke),t.set(du,this.palette.up?.fill??i.up.fill),t.set(uu,this.palette.down?.stroke??i.down.stroke),t.set(pu,this.palette.down?.fill??i.down.fill),t.set(gu,this.palette.neutral?.stroke??i.neutral.stroke),t.set(fu,this.palette.neutral?.fill??i.neutral.fill),t.set(Xg,this.palette.altUp?.stroke??i.up.stroke),t.set(Qg,this.palette.altUp?.fill??i.up.fill),t.set(qg,this.palette.altDown?.stroke??i.down.stroke),t.set(Jg,this.palette.altDown?.fill??i.down.fill),t.set(ef,this.palette.altNeutral?.fill??i.altNeutral.fill),t.set(tf,this.palette.altNeutral?.stroke??i.altNeutral.stroke),t}};Pi.axisDefault={number:Pi.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:!1}),log:Pi.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}},{title:!0,time:!1}),category:Pi.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0,wrapping:"on-space"},gridLine:{enabled:os},crosshair:{enabled:!1}},{title:!0,time:!1}),"grouped-category":Pi.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:_l},label:{spacing:10,rotation:270},maxThicknessRatio:.5,paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}},{title:!0,time:!1}),time:Pi.getAxisDefaults({keys:[],gridLine:{enabled:os},crosshair:{enabled:!0}},{title:!0,time:!0}),"unit-time":Pi.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!1},gridLine:{enabled:os},crosshair:{enabled:!0},parentLevel:{enabled:!0}},{title:!0,time:!0}),"ordinal-time":Pi.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:os},crosshair:{enabled:!0}},{title:!0,time:!0}),"angle-category":Pi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:os},shape:{$findFirstSiblingNotOperation:void 0}},{title:!1,time:!1}),"angle-number":Pi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:os}},{title:!1,time:!1}),"radius-category":Pi.getAxisDefaults({positionAngle:0,line:{enabled:!1}},{title:!0,time:!1}),"radius-number":Pi.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$findFirstSiblingNotOperation:void 0}},{title:!0,time:!1})};var as=Pi,of="#192232",Yt={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},zr={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},ta=class extends as{getDefaultColors(){return{fills:Yt,fillsFallback:Object.values(Yt),strokes:zr,sequentialColors:Ei(Yt),divergingColors:[Yt.ORANGE,Yt.YELLOW,Yt.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[Yt.GREEN,Yt.YELLOW,Yt.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:Yt.GREEN,stroke:zr.GREEN},down:{fill:Yt.RED,stroke:zr.RED},neutral:{fill:Yt.GRAY,stroke:zr.GRAY},altUp:{fill:Yt.BLUE,stroke:zr.BLUE},altDown:{fill:Yt.ORANGE,stroke:zr.ORANGE},altNeutral:{fill:Yt.GRAY,stroke:zr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:.737},backgroundColor:of,borderColor:{$foregroundBackgroundMix:.216},chromeBackgroundColor:{$foregroundBackgroundMix:.07},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundMix:.257},popupShadow:"0 0 16px rgba(0, 0, 0, 0.33)",subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"chartBackgroundColor"},.57]},crosshairLabelBackgroundColor:{$foregroundBackgroundMix:.65}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(ea,!0),e.set(mu,of),e.set(_l,"#7f8389"),e.set(st,Yt.BLUE),e.set(zl,"#fff"),e.set(Mt,Yt.BLUE),e.set(Fl,of),e.set(Bl,"#28313e"),e.set(Vl,"#4b525d"),e.set(Gl,"#fff"),e.set(Hl,"#fff"),e.set($l,"#28313e"),e.set(Yl,"#4b525d"),e.set(Kl,"#fff"),e}constructor(e){super(e)}},fi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Fr={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},SO=class extends ta{getDefaultColors(){return{...super.getDefaultColors(),fills:{...fi},fillsFallback:Object.values({...fi}),strokes:{...Fr},sequentialColors:Ei(fi),divergingColors:[fi.GREEN,fi.BLUE,fi.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:fi.GREEN,stroke:Fr.GREEN},down:{fill:fi.RED,stroke:Fr.RED},neutral:{fill:fi.BLUE,stroke:Fr.BLUE},altUp:{fill:fi.GREEN,stroke:Fr.GREEN},altDown:{fill:fi.RED,stroke:Fr.RED},altNeutral:{fill:fi.GRAY,stroke:Fr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.12}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,fi.BLUE),e.set(Mt,fi.BLUE),e.set(Un,"overlay"),e.set(Wn,"left"),e.set(Zl,"bottom"),e.set(os,!0),e}},mi={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},Br={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},DO=class extends as{getDefaultColors(){return{...super.getDefaultColors(),fills:{...mi},fillsFallback:Object.values({...mi}),strokes:{...Br},sequentialColors:Ei(mi),divergingColors:[mi.GREEN,mi.BLUE,mi.RED],up:{fill:mi.GREEN,stroke:Br.GREEN},down:{fill:mi.RED,stroke:Br.RED},neutral:{fill:mi.BLUE,stroke:Br.BLUE},altUp:{fill:mi.GREEN,stroke:Br.GREEN},altDown:{fill:mi.RED,stroke:Br.RED},altNeutral:{fill:mi.GRAY,stroke:Br.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),chartPadding:0,gridLineColor:{$foregroundBackgroundMix:.06}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,mi.BLUE),e.set(Mt,mi.BLUE),e.set(Un,"overlay"),e.set(Wn,"left"),e.set(Zl,"bottom"),e.set(os,!0),e}},Kt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Vr={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},IO=class extends ta{getDefaultColors(){return{...super.getDefaultColors(),fills:Kt,fillsFallback:Object.values(Kt),strokes:Vr,sequentialColors:Ei(Kt),divergingColors:[Kt.ORANGE,Kt.YELLOW,Kt.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[Kt.GREEN,Kt.YELLOW,Kt.RED],up:{fill:Kt.GREEN,stroke:Vr.GREEN},down:{fill:Kt.RED,stroke:Vr.RED},neutral:{fill:Kt.GRAY,stroke:Vr.GRAY},altUp:{fill:Kt.BLUE,stroke:Vr.BLUE},altDown:{fill:Kt.RED,stroke:Vr.RED},altNeutral:{fill:Kt.GRAY,stroke:Vr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,Kt.BLUE),e.set(Mt,Kt.BLUE),e}},Zt={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},Gr={BLUE:"#1565C0",ORANGE:"#E65100",GREEN:"#2E7D32",CYAN:"#00838F",YELLOW:"#F9A825",VIOLET:"#4527A0",GRAY:"#616161",MAGENTA:"#C2185B",BROWN:"#4E342E",RED:"#B71C1C"},AO=class extends as{getDefaultColors(){return{...super.getDefaultColors(),fills:Zt,fillsFallback:Object.values(Zt),strokes:Gr,sequentialColors:Ei(Zt),divergingColors:[Zt.ORANGE,Zt.YELLOW,Zt.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[Zt.GREEN,Zt.YELLOW,Zt.RED],up:{fill:Zt.GREEN,stroke:Gr.GREEN},down:{fill:Zt.RED,stroke:Gr.RED},neutral:{fill:Zt.GRAY,stroke:Gr.GRAY},altUp:{fill:Zt.BLUE,stroke:Gr.BLUE},altDown:{fill:Zt.RED,stroke:Gr.RED},altNeutral:{fill:Zt.GRAY,stroke:Gr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,Zt.BLUE),e.set(Mt,Zt.BLUE),e}},nt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Hr={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},LO=class extends ta{getDefaultColors(){return{fills:nt,fillsFallback:Object.values(nt),strokes:Hr,sequentialColors:Ei(nt),divergingColors:[nt.BLUE,nt.RED],hierarchyColors:[],secondSequentialColors:[nt.BLUE,nt.PURPLE,nt.MAGENTA,nt.PINK,nt.RED,nt.ORANGE,nt.YELLOW,nt.GREEN],secondDivergingColors:[nt.BLUE,nt.RED],secondHierarchyColors:[],up:{fill:nt.GREEN,stroke:Hr.GREEN},down:{fill:nt.RED,stroke:Hr.RED},neutral:{fill:nt.GRAY,stroke:Hr.GRAY},altUp:{fill:nt.BLUE,stroke:Hr.BLUE},altDown:{fill:nt.RED,stroke:Hr.RED},altNeutral:{fill:nt.GRAY,stroke:Hr.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,nt.BLUE),e.set(Mt,nt.BLUE),e}},rt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},Ur={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},kO=class extends as{getDefaultColors(){return{...super.getDefaultColors(),fills:rt,fillsFallback:Object.values(rt),strokes:Ur,sequentialColors:Ei(rt),divergingColors:[rt.BLUE,rt.RED],hierarchyColors:[],secondSequentialColors:[rt.BLUE,rt.PURPLE,rt.MAGENTA,rt.PINK,rt.RED,rt.ORANGE,rt.YELLOW,rt.GREEN],secondDivergingColors:[rt.BLUE,rt.RED],secondHierarchyColors:[],up:{fill:rt.GREEN,stroke:Ur.GREEN},down:{fill:rt.RED,stroke:Ur.RED},neutral:{fill:rt.GRAY,stroke:Ur.GRAY},altUp:{fill:rt.BLUE,stroke:Ur.BLUE},altDown:{fill:rt.RED,stroke:Ur.RED},altNeutral:{fill:rt.GRAY,stroke:Ur.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,rt.BLUE),e.set(Mt,rt.BLUE),e}},St={BLUE:"#4472C4",ORANGE:"#ED7D31",GRAY:"#A5A5A5",YELLOW:"#FFC000",MODERATE_BLUE:"#5B9BD5",GREEN:"#70AD47",DARK_GRAY:"#7B7B7B",DARK_BLUE:"#264478",VERY_DARK_GRAY:"#636363",DARK_YELLOW:"#997300"},Kn={BLUE:"#6899ee",ORANGE:"#ffa55d",GRAY:"#cdcdcd",YELLOW:"#ffea53",MODERATE_BLUE:"#82c3ff",GREEN:"#96d56f",DARK_GRAY:"#a1a1a1",DARK_BLUE:"#47689f",VERY_DARK_GRAY:"#878787",DARK_YELLOW:"#c0993d"},CO=class extends ta{getDefaultColors(){return{...super.getDefaultColors(),fills:{...St,RED:St.ORANGE},fillsFallback:Object.values({...St,RED:St.ORANGE}),strokes:{...Kn,RED:Kn.ORANGE},sequentialColors:Ei({...St,RED:St.ORANGE}),divergingColors:[St.ORANGE,St.YELLOW,St.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[St.GREEN,St.YELLOW,St.ORANGE],up:{fill:St.GREEN,stroke:Kn.GREEN},down:{fill:St.ORANGE,stroke:Kn.ORANGE},neutral:{fill:St.GRAY,stroke:Kn.GRAY},altUp:{fill:St.BLUE,stroke:Kn.BLUE},altDown:{fill:St.ORANGE,stroke:Kn.ORANGE},altNeutral:{fill:St.GRAY,stroke:Kn.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,St.BLUE),e.set(Mt,St.BLUE),e}},Ot={BLUE:"#5281d5",ORANGE:"#ff8d44",GRAY:"#b5b5b5",YELLOW:"#ffd02f",MODERATE_BLUE:"#6aabe6",GREEN:"#7fbd57",DARK_GRAY:"#8a8a8a",DARK_BLUE:"#335287",VERY_DARK_GRAY:"#717171",DARK_YELLOW:"#a98220"},an={BLUE:"#214d9b",ORANGE:"#c25600",GRAY:"#7f7f7f",YELLOW:"#d59800",MODERATE_BLUE:"#3575ac",GREEN:"#4b861a",DARK_GRAY:"#575757",DARK_BLUE:"#062253",VERY_DARK_GRAY:"#414141",DARK_YELLOW:"#734f00"},wO=class extends as{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Ot,RED:Ot.ORANGE},fillsFallback:Object.values({...Ot,RED:Ot.ORANGE}),strokes:{...an,RED:an.ORANGE},sequentialColors:Ei({...Ot,RED:Ot.ORANGE}),divergingColors:[Ot.ORANGE,Ot.YELLOW,Ot.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Ot.GREEN,Ot.YELLOW,Ot.ORANGE],secondHierarchyColors:[],up:{fill:Ot.GREEN,stroke:an.GREEN},down:{fill:Ot.ORANGE,stroke:an.ORANGE},neutral:{fill:an.GRAY,stroke:an.GRAY},altUp:{fill:Ot.BLUE,stroke:an.BLUE},altDown:{fill:Ot.ORANGE,stroke:an.ORANGE},altNeutral:{fill:Ot.GRAY,stroke:an.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,Ot.BLUE),e.set(Mt,Ot.BLUE),e}},q=(T(),N(w)),P=(T(),N(w)),R=(T(),N(w)),xu=(0,R.union)("millisecond","second","minute","hour","day","month","year"),tM={unit:(0,R.required)(xu),step:R.positiveNumberNonZero,epoch:R.date,utc:R.boolean};tM.every=R.callback;var af=(0,R.optionsDefs)(tM,"a time interval object"),ls=(0,R.attachDescription)(R.isValidNumberFormat,"a valid number format string"),Wr={enabled:R.boolean,text:R.string,padding:R.number,...R.fontOptionsDef},Es=(0,R.attachDescription)({enabled:R.boolean,type:(0,R.required)((0,R.union)("line","range")),range:(0,R.and)((0,R.attachDescription)((e,{options:t})=>t.type==="range","crossLine type to be 'range'"),(0,R.arrayOf)(R.defined),(0,R.arrayLength)(2,2)),value:(0,R.and)((0,R.attachDescription)((e,{options:t})=>t.type==="line","crossLine type to be 'line'"),R.defined),label:Wr,fill:R.color,fillOpacity:R.ratio,...R.strokeOptionsDef,...R.lineDashOptionsDef},"cross-line options"),ln={...Es,label:{...Wr,position:(0,R.union)("top","left","right","bottom","top-left","top-right","bottom-left","bottom-right","inside","inside-left","inside-right","inside-top","inside-bottom","inside-top-left","inside-bottom-left","inside-top-right","inside-bottom-right"),rotation:R.number}},cn={enabled:R.boolean,rotation:R.number,avoidCollisions:R.boolean,minSpacing:R.positiveNumber,spacing:R.positiveNumber,formatter:R.callback,itemStyler:(0,R.callbackDefs)({...R.fontOptionsDef,spacing:R.number}),...R.fontOptionsDef},Xl={autoRotate:R.boolean,autoRotateAngle:R.number,wrapping:(0,R.union)("never","always","hyphenate","on-space"),truncate:(0,R.undocumented)(R.boolean),...cn},lf={format:ls,...Xl},ql={format:(0,R.or)(R.string,R.object),...Xl},iM={enabled:R.boolean,width:R.positiveNumber,size:R.positiveNumber,stroke:R.color},vu={enabled:R.boolean,label:ql,tick:iM},$r={reverse:R.boolean,gridLine:{enabled:R.boolean,width:R.positiveNumber,style:(0,R.arrayOfDefs)({stroke:(0,R.or)(R.color,R.themeOperator),lineDash:(0,R.arrayOf)(R.positiveNumber)},"a grid-line style object array")},interval:{values:(0,R.arrayOf)(R.defined),minSpacing:R.positiveNumber},label:cn,line:{enabled:R.boolean,width:R.positiveNumber,stroke:R.color},tick:iM,context:()=>!0};$r.layoutConstraints=(0,R.undocumented)({stacked:(0,R.required)(R.boolean),align:(0,R.required)((0,R.union)("start","end")),unit:(0,R.required)((0,R.union)("percent","px")),width:(0,R.required)(R.positiveNumber)});var hn={...$r,keys:(0,R.arrayOf)(R.string),crossLines:(0,R.arrayOfDefs)(ln,"a cross-line options array"),position:(0,R.union)("top","right","bottom","left"),thickness:R.positiveNumber,maxThicknessRatio:R.ratio,title:{enabled:R.boolean,text:R.string,spacing:R.positiveNumber,formatter:R.callback,...R.fontOptionsDef}},Ql={enabled:R.boolean,...R.fillOptionsDef,...R.strokeOptionsDef,...R.lineDashOptionsDef};hn.title._enabledFromTheme=(0,R.undocumented)(R.boolean);function Zn(e,t){const i={enabled:R.boolean,xOffset:R.number,yOffset:R.number,formatter:(0,R.callbackOf)(R.string),renderer:(0,R.callbackOf)((0,R.or)(R.string,(0,R.optionsDefs)({text:R.string,color:R.color,backgroundColor:R.color,opacity:R.ratio},"crosshair label renderer result object")))};let s;return e&&(s={...i,format:t?(0,R.or)(R.string,(0,R.optionsDefs)({millisecond:R.string,second:R.string,hour:R.string,day:R.string,month:R.string,year:R.string})):R.string}),{enabled:R.boolean,snap:R.boolean,label:s??i,...R.strokeOptionsDef,...R.lineDashOptionsDef}}function Xn(e,t){return{min:(0,R.and)(e,(0,R.lessThan)("max")),max:(0,R.and)(e,(0,R.greaterThan)("min")),nice:R.boolean,interval:{step:t?(0,R.or)(R.positiveNumberNonZero,xu,af):R.positiveNumberNonZero,values:(0,R.arrayOf)(e),minSpacing:(0,R.and)(R.positiveNumber,(0,R.lessThan)("maxSpacing")),maxSpacing:(0,R.and)(R.positiveNumber,(0,R.greaterThan)("minSpacing"))}}}var A=(T(),N(w)),Mu=(0,A.or)((0,A.union)("circle","cross","diamond","heart","plus","pin","square","star","triangle"),A.callback),sM=(0,A.union)("never","always","hyphenate","on-space"),Su=(0,A.union)("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Du=(0,A.or)(A.positiveNumber,(0,A.union)("exact","nearest")),nM=(0,A.union)("pointer","start","middle","end"),Iu={enabled:A.boolean,text:A.string,textAlign:(0,A.union)("left","center","right"),wrapping:(0,A.union)("never","always","hyphenate","on-space"),spacing:A.positiveNumber,maxWidth:A.positiveNumber,maxHeight:A.positiveNumber,...A.fontOptionsDef};Iu.padding=(0,A.undocumented)(A.positiveNumber);var Au={enabled:A.boolean,text:A.string,renderer:(0,A.callbackOf)((0,A.or)(A.string,A.htmlElement))},cf=["defaults","download","zoom-to-cursor","pan-to-cursor","reset-zoom","toggle-series-visibility","toggle-other-series","separator"],rM={type:(0,A.union)("action","separator"),showOn:(0,A.union)("always","series-area","series-node","legend-item"),label:(0,A.required)(A.string),enabled:A.boolean,action:A.callback,items:(e,t)=>oM(e,t)};rM.iconUrl=(0,A.undocumented)(A.string);var NO=(0,A.optionsDefs)(rM),TO=(0,A.attachDescription)((e,t)=>{let i;return typeof e=="string"?cf.includes(e)?i=!0:(i={valid:!1,invalid:[],cleared:null},i.invalid.push(new A.ValidationError(A.ErrorType.Invalid,`a context menu item string alias: ["${cf.join('", "')}"]`,e,t.path))):i=NO(e,t),i},`a context menu item object or string alias: [${cf.join(", ")}]`),oM=(0,A.arrayOf)(TO,"a menu items array",!1),Yr={label:A.string,ariaLabel:A.string,tooltip:A.string,icon:(0,A.union)("align-center","align-left","align-right","arrow-drawing","arrow-down-drawing","arrow-up-drawing","callout-annotation","candlestick-series","close","comment-annotation","date-range-drawing","date-price-range-drawing","delete","disjoint-channel-drawing","drag-handle","fill-color","line-style-solid","line-style-dashed","line-style-dotted","high-low-series","hlc-series","hollow-candlestick-series","horizontal-line-drawing","line-color","line-series","line-with-markers-series","locked","measurer-drawing","note-annotation","ohlc-series","pan-end","pan-left","pan-right","pan-start","parallel-channel-drawing","position-bottom","position-center","position-top","price-label-annotation","price-range-drawing","reset","settings","step-line-series","text-annotation","trend-line-drawing","fibonacci-retracement-drawing","fibonacci-retracement-trend-based-drawing","unlocked","vertical-line-drawing","zoom-in","zoom-out")},cs=(0,A.or)(A.string,(0,A.callbackOf)(A.string)),aM=(0,A.optionsDefs)({x:cs,y:cs,angle:cs,radius:cs,size:cs,color:cs,label:cs,secondaryLabel:cs,sectorLabel:cs,calloutLabel:cs,legendItem:cs}),oe={width:A.positiveNumber,height:A.positiveNumber,minWidth:A.positiveNumber,minHeight:A.positiveNumber,suppressFieldDotNotation:A.boolean,title:Iu,subtitle:Iu,footnote:Iu,padding:{top:A.positiveNumber,right:A.positiveNumber,bottom:A.positiveNumber,left:A.positiveNumber},seriesArea:{clip:A.boolean,padding:{top:A.positiveNumber,right:A.positiveNumber,bottom:A.positiveNumber,left:A.positiveNumber}},legend:{enabled:A.boolean,position:(0,A.union)("top","right","bottom","left"),orientation:(0,A.union)("horizontal","vertical"),maxWidth:A.positiveNumber,maxHeight:A.positiveNumber,spacing:A.positiveNumber,preventHidingAll:A.boolean,reverseOrder:A.boolean,toggleSeries:A.boolean,item:{marker:{size:A.positiveNumber,shape:Mu,padding:A.positiveNumber,strokeWidth:A.positiveNumber},line:{length:A.positiveNumber,strokeWidth:A.positiveNumber},label:{maxLength:A.positiveNumber,formatter:A.callback,...A.fontOptionsDef},maxWidth:A.positiveNumber,paddingX:A.positiveNumber,paddingY:A.positiveNumber,showSeriesStroke:A.boolean},pagination:{marker:{size:A.positiveNumber,shape:Mu,padding:A.positiveNumber},activeStyle:{...A.fillOptionsDef,...A.strokeOptionsDef},inactiveStyle:{...A.fillOptionsDef,...A.strokeOptionsDef},highlightStyle:{...A.fillOptionsDef,...A.strokeOptionsDef},label:A.fontOptionsDef},listeners:{legendItemClick:A.callback,legendItemDoubleClick:A.callback}},gradientLegend:{enabled:A.boolean,position:(0,A.union)("top","right","bottom","left"),spacing:A.positiveNumber,reverseOrder:A.boolean,gradient:{preferredLength:A.positiveNumber,thickness:A.positiveNumber},scale:{label:{...A.fontOptionsDef,minSpacing:A.positiveNumber,format:ls,formatter:A.callback},padding:A.positiveNumber,interval:{step:A.number,values:A.array,minSpacing:(0,A.and)(A.positiveNumber,(0,A.lessThan)("maxSpacing")),maxSpacing:(0,A.and)(A.positiveNumber,(0,A.greaterThan)("minSpacing"))}}},listeners:{seriesNodeClick:A.callback,seriesNodeDoubleClick:A.callback,seriesVisibilityChange:A.callback,click:A.callback,doubleClick:A.callback,annotations:A.callback,zoom:A.callback},loadGoogleFonts:A.boolean,highlight:{range:(0,A.union)("tooltip","node")},overlays:{loading:Au,noData:Au,noVisibleSeries:Au,unsupportedBrowser:Au},tooltip:{enabled:A.boolean,showArrow:A.boolean,pagination:A.boolean,delay:A.positiveNumber,range:Du,wrapping:sM,mode:(0,A.union)("single","shared","compact"),position:{anchorTo:(0,A.union)("pointer","node","chart"),placement:(0,A.or)(Su,(0,A.arrayOf)(Su)),xOffset:A.number,yOffset:A.number}},animation:{enabled:A.boolean,duration:A.positiveNumber},contextMenu:{enabled:A.boolean,items:oM},context:()=>!0,dataSource:{getData:A.callback},keyboard:{enabled:A.boolean,tabIndex:A.number},touch:{dragAction:(0,A.union)("none","drag","hover")},ranges:{enabled:A.boolean,buttons:(0,A.arrayOfDefs)({...Yr,value:(0,A.or)(A.number,(0,A.and)((0,A.arrayOf)((0,A.or)(A.number,A.date)),(0,A.arrayLength)(2,2)),A.callback)},"range button options array")},locale:{localeText:A.object,getLocaleText:(0,A.callbackOf)(A.string)},background:{visible:A.boolean,fill:A.color,image:{url:(0,A.required)(A.string),top:A.number,right:A.number,bottom:A.number,left:A.number,width:A.positiveNumber,height:A.positiveNumber,opacity:A.ratio}},styleNonce:A.string,sync:{enabled:A.boolean,groupId:A.string,axes:(0,A.union)("x","y","xy"),nodeInteraction:A.boolean,zoom:A.boolean},zoom:{enabled:A.boolean,enableAxisDragging:A.boolean,enableDoubleClickToReset:A.boolean,enablePanning:A.boolean,enableScrolling:A.boolean,enableSelecting:A.boolean,enableTwoFingerZoom:A.boolean,keepAspectRatio:A.boolean,anchorPointX:nM,anchorPointY:nM,axes:(0,A.union)("x","y","xy"),deceleration:(0,A.or)((0,A.union)("off","short","long"),A.ratio),minVisibleItems:A.positiveNumber,panKey:(0,A.union)("alt","ctrl","meta","shift"),scrollingStep:A.ratio,autoScaling:{enabled:A.boolean,padding:A.ratio},buttons:{enabled:A.boolean,buttons:(0,A.arrayOfDefs)({...Yr,value:(0,A.union)("reset","zoom-in","zoom-out","pan-left","pan-right","pan-start","pan-end"),section:A.string},"zoom button options array"),visible:(0,A.union)("always","zoomed","hover")}},formatter:(0,A.or)((0,A.callbackOf)(A.string),aM)};oe.dataSource.requestThrottle=(0,A.undocumented)(A.positiveNumber),oe.dataSource.updateThrottle=(0,A.undocumented)(A.positiveNumber),oe.dataSource.updateDuringInteraction=(0,A.undocumented)(A.boolean),oe.zoom.enableIndependentAxes=(0,A.undocumented)(A.boolean),oe.statusBar=(0,A.undocumented)(A.defined),oe.foreground=(0,A.undocumented)({visible:A.boolean,text:A.string,image:{url:A.string,top:A.number,right:A.number,bottom:A.number,left:A.number,width:A.positiveNumber,height:A.positiveNumber,opacity:A.ratio},...A.fillOptionsDef}),oe.overrideDevicePixelRatio=(0,A.undocumented)(A.number),oe.sync.domainMode=(0,A.undocumented)((0,A.union)("direction","position","key"));var Ie={cursor:A.string,context:()=>!0,showInLegend:A.boolean,nodeClickRange:Du,listeners:{seriesNodeClick:A.callback,seriesNodeDoubleClick:A.callback},highlightStyle:{item:{...A.fillOptionsDef,...A.strokeOptionsDef},series:{enabled:A.boolean,dimOpacity:A.ratio,strokeWidth:A.positiveNumber}},highlight:(0,A.highlightOptionsDef)(A.shapeHighlightOptionsDef)},hs={...Ie,id:A.string,visible:A.boolean,context:()=>!0,data:A.array};hs.seriesGrouping=(0,A.undocumented)(A.defined);var un={enabled:A.boolean,shape:Mu,size:A.positiveNumber,itemStyler:(0,A.callbackDefs)({...A.fillOptionsDef,...A.strokeOptionsDef,...A.lineDashOptionsDef,shape:Mu,size:A.positiveNumber}),...A.fillOptionsDef,...A.strokeOptionsDef,...A.lineDashOptionsDef},_e={enabled:A.boolean,formatter:A.callback,format:ls,...A.fontOptionsDef},qn={..._e,lineHeight:A.positiveNumber,minimumFontSize:A.positiveNumber,wrapping:sM,overflowStrategy:(0,A.union)("ellipsis","hide")},Jl={visible:A.boolean,cap:{visible:A.boolean,length:A.positiveNumber,lengthRatio:A.ratio,...A.strokeOptionsDef,...A.lineDashOptionsDef},...A.strokeOptionsDef,...A.lineDashOptionsDef},Lu={...Jl,xLowerKey:A.string,xUpperKey:A.string,yLowerKey:A.string,yUpperKey:A.string,xLowerName:A.string,xUpperName:A.string,yLowerName:A.string,yUpperName:A.string,itemStyler:(0,A.callbackDefs)({visible:A.boolean,...A.strokeOptionsDef,...A.lineDashOptionsDef,cap:{visible:A.boolean,length:A.positiveNumber,lengthRatio:A.ratio,...A.strokeOptionsDef,...A.lineDashOptionsDef}})},ke={enabled:A.boolean,showArrow:A.boolean,range:Du,renderer:(0,A.callbackOf)((0,A.or)(A.string,(0,A.optionsDefs)({heading:A.string,title:A.string,data:(0,A.arrayOfDefs)({label:(0,A.required)(A.string),value:(0,A.required)(A.string)})},"tooltip renderer result object"))),position:{anchorTo:(0,A.union)("node","pointer","chart"),placement:(0,A.or)(Su,(0,A.arrayOf)(Su)),xOffset:A.number,yOffset:A.number},interaction:{enabled:A.boolean}},Ps={enabled:A.boolean,xOffset:A.number,yOffset:A.number,blur:A.positiveNumber,color:A.color},ku=(0,A.typeUnion)({linear:{},smooth:{tension:A.ratio},step:{position:(0,A.union)("start","middle","end")}},"interpolation line options"),ec={fills:(0,P.and)((0,P.arrayLength)(2),(0,P.arrayOf)((0,P.optionsDefs)({color:P.color,stop:P.number},"")),P.colorStopsOrderValidator),fillMode:(0,P.union)("continuous","discrete")},Cu={value:(0,P.required)(P.number),text:P.string,shape:(0,P.or)((0,P.union)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),P.callback),placement:(0,P.union)("before","after","middle"),spacing:P.positiveNumber,size:P.positiveNumber,rotation:P.number,...P.fillOptionsDef,...P.strokeOptionsDef,...P.lineDashOptionsDef},wu={value:(0,P.required)(P.number),text:P.string,shape:(0,P.or)((0,P.union)("circle","cross","diamond","heart","plus","pin","square","star","triangle","line"),P.callback),placement:(0,P.union)("inside","outside","middle"),spacing:P.positiveNumber,size:P.positiveNumber,rotation:P.number,label:{..._e,spacing:P.positiveNumber},...P.fillOptionsDef,...P.strokeOptionsDef,...P.lineDashOptionsDef},Nu={direction:(0,P.union)("horizontal","vertical"),cornerMode:(0,P.union)("container","item"),cornerRadius:P.positiveNumber,thickness:P.positiveNumber,segmentation:{enabled:P.boolean,spacing:P.positiveNumber,interval:{values:(0,P.arrayOf)(P.number),step:P.number,count:P.number}},bar:{enabled:P.boolean,thickness:P.positiveNumber,thicknessRatio:P.ratio,...ec,...P.fillOptionsDef,...P.strokeOptionsDef,...P.lineDashOptionsDef},label:{...qn,text:P.string,spacing:P.positiveNumber,avoidCollisions:P.boolean,placement:(0,P.union)("inside-start","outside-start","inside-end","outside-end","inside-center","bar-inside","bar-inside-end","bar-outside-end","bar-end")},tooltip:ke,...G(Ie,["listeners"])},Qn={...Nu,...G(hs,["listeners"]),type:(0,P.required)((0,P.constant)("linear-gauge")),value:(0,P.required)(P.number),scale:{min:(0,P.and)(P.number,(0,P.lessThan)("max")),max:(0,P.and)(P.number,(0,P.greaterThan)("min")),label:{enabled:P.boolean,formatter:P.callback,rotation:P.number,spacing:P.positiveNumber,minSpacing:P.positiveNumber,placement:(0,P.union)("before","after"),avoidCollisions:P.boolean,format:ls,...P.fontOptionsDef},interval:{values:(0,P.arrayOf)(P.number),step:P.number},...ec,...P.fillOptionsDef,...P.strokeOptionsDef,...P.lineDashOptionsDef},targets:(0,P.arrayOfDefs)(Cu,"target options array")};Qn.margin=(0,P.undocumented)(P.number),Qn.defaultColorRange=(0,P.undocumented)((0,P.arrayOf)(P.color)),Qn.defaultTarget=(0,P.undocumented)({...Cu,value:P.number,label:{..._e,spacing:P.number}}),Qn.defaultScale=(0,P.undocumented)(Qn.scale),Qn.scale.defaultFill=(0,P.undocumented)(P.color);var Tu={outerRadius:P.positiveNumber,innerRadius:P.positiveNumber,outerRadiusRatio:P.ratio,innerRadiusRatio:P.ratio,startAngle:P.number,endAngle:P.number,spacing:P.positiveNumber,cornerMode:(0,P.union)("container","item"),cornerRadius:P.positiveNumber,scale:{min:(0,P.and)(P.number,(0,P.lessThan)("max")),max:(0,P.and)(P.number,(0,P.greaterThan)("min")),label:{enabled:P.boolean,formatter:P.callback,rotation:P.number,spacing:P.positiveNumber,minSpacing:P.positiveNumber,avoidCollisions:P.boolean,format:ls,...P.fontOptionsDef},interval:{values:(0,P.arrayOf)(P.number),step:P.number},...ec,...P.fillOptionsDef,...P.strokeOptionsDef,...P.lineDashOptionsDef},segmentation:{enabled:P.boolean,spacing:P.positiveNumber,interval:{values:(0,P.arrayOf)(P.number),step:P.number,count:P.number}},bar:{enabled:P.boolean,...ec,...P.fillOptionsDef,...P.strokeOptionsDef,...P.lineDashOptionsDef},needle:{enabled:P.boolean,spacing:P.positiveNumber,radiusRatio:P.ratio,...P.fillOptionsDef,...P.strokeOptionsDef,...P.lineDashOptionsDef},label:{text:P.string,spacing:P.positiveNumber,...qn},secondaryLabel:{text:P.string,...qn},tooltip:ke,...Ie},tc={...Tu,...hs,type:(0,P.required)((0,P.constant)("radial-gauge")),value:(0,P.required)(P.number),targets:(0,P.arrayOfDefs)(wu,"target options array")};tc.defaultColorRange=(0,P.undocumented)((0,P.arrayOf)(P.color)),tc.defaultTarget=(0,P.undocumented)({...wu,value:P.number,label:{..._e,spacing:P.number}}),tc.scale.defaultFill=(0,P.undocumented)(P.color);var ye=(T(),N(w)),lM=(T(),N(w)),cM=(T(),N(w));function hM(e,t,i){if(i==null||i[0]===0&&i[1]===1)return{ticks:e,count:e.length};const s=(0,cM.clamp)(0,Math.floor(i[0]*e.length),e.length),n=(0,cM.clamp)(0,Math.ceil(i[1]*e.length),e.length),r=t?e.length-n:s,o=t?e.length-s:n;return{ticks:e.slice(r,o),count:e.length}}var ic=class EI extends Lr{constructor(){super(...arguments),this.type="band",this.defaultTickCount=0,this.index=new Map,this.indexInitialised=!1,this._domain=[]}static is(t){return t instanceof EI}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index.clear(),this.indexInitialised=!1)}get domain(){return this._domain}get bands(){return this._domain}normalizeDomains(...t){let i;const s=new Set;let n=!0;for(const r of t)s.has(r)||(s.add(r),i==null?i=uM(r):(n&&(n=OO(r,i)),i=uM([...i,...r])));return i??(i=[]),{domain:i,animatable:n}}toDomain(t){}invert(t,i=!1){this.refresh();const s=i?this.bandwidth/2:0,n=this.invertNearestIndex(Math.max(0,t-s));return i||t===this.ordinalRange(n)?this.domain[n]:void 0}ticks(t,i=this.domain,s){return hM(i,!1,s)}findIndex(t){const{index:i,indexInitialised:s}=this;if(!s){const{domain:n}=this;for(let r=0;r<n.length;r++)i.set(Ti(n[r]),r);this.indexInitialised=!0}return i.get(Ti(t))}};function uM(e){let t;const i=new Set;for(const s of e){const n=Ti(s),r=i.size;i.add(n),i.size!==r?t?.push(s):t??(t=e.slice(0,i.size))}return t??e}function OO(e,t){let i=-1;for(const s of e){const n=t.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}var ia=class PI extends Cl{constructor(t,i=new ic){super(t,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(t){return t instanceof PI}normaliseDataDomain(t){return{domain:t,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:t,paddingOuter:i}=this;if(!(0,lM.isFiniteNumber)(t)||!(0,lM.isFiniteNumber)(i)){const s=this.reduceBandScalePadding();t??(t=s.inner),i??(i=s.outer)}this.scale.paddingInner=t??0,this.scale.paddingOuter=i??0}reduceBandScalePadding(){return this.boundSeries.reduce((t,i)=>{const s=i.getBandScalePadding?.();return s&&(t.inner>s.inner&&(t.inner=s.inner),t.outer<s.outer&&(t.outer=s.outer)),t},{inner:1/0,outer:-1/0})}tickFormatParams(t,i,s,n){return{type:"category"}}datumFormatParams(t,i,s,n,r){const{datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}=i;return Array.isArray(t)&&t.some(g=>typeof g!="string")?t=t.map(String):!Array.isArray(t)&&typeof t!="string"&&typeof t!="number"&&!(t instanceof Date)&&(t=String(t)),{type:"category",value:t,datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}}};ia.className="CategoryAxis",ia.type="category",f([x],ia.prototype,"groupPaddingInner",2),f([x],ia.prototype,"paddingInner",2),f([x],ia.prototype,"paddingOuter",2);var Kr=ia,sc=(T(),N(w)),dM=class RI extends ic{static is(t){return t instanceof RI}normalizeDomains(...t){const{domain:i}=super.normalizeDomains(...t);return{domain:i,animatable:!1}}findIndex(t){return super.findIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const i=JSON.stringify(t),s=this._domain.find(n=>JSON.stringify(n)===i);if(s!=null)return super.findIndex(s)}};function dn(e){if(e.length===0)return null;let t=1/0,i=-1/0;for(const n of e){const r=n instanceof Date?n.getTime():n;typeof r=="number"&&(r<t&&(t=r),r>i&&(i=r))}const s=[t,i];return s.every(isFinite)?s:null}function hf(e,t,i){let s=!1;return e.length>2&&(e=dn(e)??[NaN,NaN]),t!=null&&(s||(s=t>e[0]),e=[t,e[1]]),i!=null&&(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{extent:e,clipped:s}}var Zr=(T(),N(w)),pM=(T(),N(w));function Ou(e,t=[0,0]){for(const i of e)typeof i=="number"&&(i<0&&(t[0]+=i),i>0&&(t[1]+=i));return t}function EO(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>Ou(s)}}function gM(e,t){return{id:e,type:"aggregate",matchGroupIds:t?[t]:void 0,aggregateFunction:i=>Ou(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s)}}function PO(e,t){return{id:e,matchGroupIds:[t],type:"aggregate",aggregateFunction:s=>zn.extendDomain(s)}}function uf(e){return{id:e,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(t,i=[0,0])=>(i[0]+=t?.[0]??0,i[1]+=t?.[1]??0,i)}}function fM(e,t){return{id:e,matchGroupIds:t?[t]:void 0,type:"aggregate",aggregateFunction:s=>Ou(s),groupAggregateFunction:(s,n=[0,0,-1])=>(n[0]+=s?.[0]??0,n[1]+=s?.[1]??0,n[2]++,n),finalFunction:(s=[0,0,0])=>{const n=s[0]+s[1];return n>=0?[0,n/s[2]]:[n/s[2],0]}}}function df(e,t,i){const s={id:e,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,r=[])=>{const o=r[1]-r[0];return t.aggregateFunction(n).map(a=>a/o)}};return t.groupAggregateFunction&&(s.groupAggregateFunction=t.groupAggregateFunction),s}function mM(e){return()=>{let t=0;return i=>(0,pM.isFiniteNumber)(i)?(t+=e?Math.max(0,i):i,t):i}}function yM(){return()=>{let e=0;return t=>{if(!(0,pM.isFiniteNumber)(t))return t;const i=e;return e+=t,i}}}function bM(e){return e!=null&&Hh(e)}function RO(e){return e!=null}function xM(e){switch(e){case"number":case"log":case"time":case"unit-time":case"ordinal-time":case"color":return bM;default:return RO}}function vM(e){switch(e){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function us(e,t,i={}){return{property:e,type:"key",valueType:vM(t),validation:xM(t),...i}}function De(e,t,i={}){return{property:e,type:"value",valueType:vM(t),validation:xM(t),...i}}function MM(e,t={}){return{property:e,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...t}}var _O=function(e){return e};function SM(...e){const t=e.filter(i=>i!=null);return t.length===0?()=>_O:t.length===1?t[0]:()=>{const i=t.map(s=>s());return(s,n)=>i.reduce((r,o)=>o(r,n),s)}}function pf(e,t={}){const{min:i=-1/0,max:s=1/0,processor:n,...r}=t;return{type:"value",property:e,valueType:"range",validation:bM,processor:SM(n,()=>o=>(0,Zr.isFiniteNumber)(o)?(0,Zr.clamp)(i,o,s):o),...r}}function nc(e,t,i={}){const{onlyPositive:s,processor:n,...r}=i;return{...De(e,t,r),processor:SM(n,mM(s))}}function jO(e,t,i={}){return{...De(e,t,i),processor:yM()}}function Jn(e,t,i,s,n){return[De(e,n,s),CM(s.groupId,t,i,s.separateNegative),...s.rangeId!=null?[PO(s.rangeId,s.groupId)]:[]]}function DM(e,t,i){return[De(e,t,i),wM(i.groupId)]}var IM={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let e=NaN;return(t=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-e);return e=s,!isNaN(n)&&n>0&&n<t?n:t}}},AM={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let e=NaN;return(t=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-e);return e=s,!isNaN(n)&&n>0&&n>t?n:t}}},LM={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:e}})=>e?.slice().sort((t,i)=>{for(let s=0;s<t.length;s++){const n=t[s]-i[s];if(n!==0)return n}return 0})};function zO({normaliseTo:e}){const t=(i,s)=>{if(s===0)return null;const n=(i??0)*e/s;return n>=0?Math.min(e,n):Math.max(-e,n)};return()=>()=>(i,s,n)=>{const r=FO(i,s,n);for(const o of s)for(const a of n.datumIndices[o]??[]){const l=i[o],c=l[a];if(c==null){l[a]=void 0;continue}l[a]=typeof c=="number"?t(c,r):c.map(h=>t(h,r))}}}function FO(e,t,i){const s=[0,0];for(const n of t){const r=e[n];for(const o of i.datumIndices[n]??[]){const a=r[o];if(a==null)continue;const l=typeof a=="number"?a:Math.max(...a.map(h=>h??0)),c=l<0?0:1;c===0?s[c]=Math.min(s[c],l):s[c]=Math.max(s[c],l)}}return Math.max(Math.abs(s[0]),s[1])}function Eu(e,t){return{type:"group-value-processor",matchGroupIds:e,adjust:Eh({normaliseTo:t},zO)}}function BO({normaliseTo:e,zeroDomain:t,rangeMin:i,rangeMax:s}){const n=e[1]-e[0],r=(o,a,l)=>{const c=e[0]+(o-a)/l*n;return l===0?t:c>=e[1]?e[1]:c<e[0]?e[0]:c};return()=>(o,a)=>{let[l,c]=o.domain.values[a];i!=null&&(l=i),s!=null&&(c=s);const h=c-l;o.domain.values[a]=[e[0],e[1]];const u=o.columns[a];for(let d=0;d<u.length;d+=1)u[d]=r(u[d],l,h)}}function Xr(e,t,i,s,n){return{type:"property-value-processor",property:e,adjust:Eh({normaliseTo:t,rangeMin:s,rangeMax:n,zeroDomain:i},BO)}}var rc=1,Pu=2;function kM(e,t,i,s){let n=rc|Pu;if(t.valueType==="category")return i.length<e&&(n&=~rc),n;let r=s[0]?.valueOf();for(let o=1;n!==0&&o<s.length;o++){const a=s[o]?.valueOf();(!Number.isFinite(a)||r>a)&&(n&=~Pu),Number.isFinite(a)&&r===a&&(n&=~rc),r=a}return n}function sa(e){return{type:"processor",property:"animationValidation",calculate(t){const{keys:i,values:s}=t.defs,{input:{count:n},domain:{keys:r,values:o},keys:a,columns:l}=t;let c=rc|Pu;if(n!==0){for(let h=0;c!==0&&h<i.length;h++)for(const u of i[h].scopes)c&=kM(n,i[h],r[h],a[h].get(u));for(let h=0;c!==0&&h<s.length;h++){const u=s[h];e?.includes(u.id)&&(c&=kM(n,u,o[h],l[h]))}}return{uniqueKeys:(c&rc)!==0,orderedKeys:(c&Pu)!==0}}}}function VO({mode:e,separateNegative:t}){return()=>()=>(i,s,n)=>{const r=[0,0];for(const o of s)for(const a of n.datumIndices[o]??[]){const l=i[o],c=l[a],h=(0,Zr.isNegative)(c)&&t?0:1;(0,Zr.isFiniteNumber)(c)&&(e==="normal"&&(r[h]+=c),l[a]=r[h],e==="trailing"&&(r[h]+=c))}}}function GO({mode:e,sum:t}){return()=>{const i=[];let s=!0;return()=>(n,r,o)=>{let a=0;for(const l of r){const c=n[l];for(const h of o.datumIndices[l]??[]){const u=c[h],d=s&&t==="current"?0:i[l];i[l]=u;const p=t==="current"?u:d;if(!(0,Zr.isFiniteNumber)(u)||!(0,Zr.isFiniteNumber)(d)){c[h]=a;continue}e==="normal"&&(a+=p),c[h]=a,e==="trailing"&&(a+=p)}}s=!1}}}function CM(e,t,i,s=!1){let n;if(t.startsWith("window")){const r=t.endsWith("-trailing")?"trailing":"normal";n=Eh({mode:r,sum:i},GO)}else n=Eh({mode:t,separateNegative:s},VO);return{type:"group-value-processor",matchGroupIds:[e],adjust:n}}function HO(){return()=>(e,t,i)=>{const s=new Float64Array(t.length);let n=0;for(const r of t){const o=e[r];for(const a of i.datumIndices[r]??[]){const l=o[a];s[n]=Number.isFinite(l)?l:NaN,n+=1,o[a]=s.subarray(0,n)}}}}function wM(e){return{type:"group-value-processor",matchGroupIds:[e],adjust:HO}}function NM(e){return e.id??e.property}function UO(e,t,i){const s=new Map,n=t.defs.values;for(let a=0;a<n.length;a+=1){const l=n[a];if(l.scopes?.includes(e)===!1)continue;const c=NM(l);if(s.has(c))return;s.set(c,a)}const r=[],o=i.defs.values;for(let a=0;a<o.length;a+=1){const l=o[a];if(l.scopes?.includes(e)===!1)continue;const c=NM(l),h=s.get(c);if(h==null)return;s.delete(c),r.push({previousIndex:h,nextIndex:a})}if(s.size===0)return r}function gf(e,t,i,s,n){for(const{previousIndex:r,nextIndex:o}of i){const a=e[r],l=t[o],c=a[s],h=l[n];if(c!==h)return!1}return!0}function na(e,t,i=!0){return{type:"processor",property:"diff",calculate(s,n){const r=new Map,o=new Map,a=new Map,l=new Map,c=t.keys,h=s.keys,u=t.columns,d=s.columns,p=UO(e,t,s);if(p==null)return n;const g=Math.max(t.input.count,s.input.count);for(let m=0;m<g;m++){const v=m<t.input.count,S=m<s.input.count,M=v?Bh(c,e,m):void 0,I=M!=null?Ri(M):"",k=S?Bh(h,e,m):void 0,L=k!=null?Ri(k):"";if(S&&v&&I===L){gf(u,d,p,m,m)||a.set(L,m);continue}const C=l.get(L);C!=null?((i||!gf(u,d,p,C,m))&&(a.set(L,m),r.set(L,m)),l.delete(L)):S&&o.set(L,m);const O=o.get(I);O!=null?((i||!gf(u,d,p,O,m))&&(a.set(I,m),r.set(I,m)),o.delete(I)):v&&(a.delete(I),l.set(I,m))}const b={changed:o.size>0||a.size>0||l.size>0,added:new Set(o.keys()),updated:new Set(a.keys()),removed:new Set(l.keys()),moved:new Set(r.keys())};return{...n,[e]:b}}}}function Ri(e,...t){let i;return(0,Zr.isArray)(e)?i=e.map(n=>Ag(n)).join("___"):i=Ag(e),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&t.length>0&&(i+=`___${t.join("___")}`),i}var WO=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(e,t){e>this.right&&(this.right=e),e<this.left&&(this.left=e),t>this.bottom&&(this.bottom=t),t<this.top&&(this.top=t)}},$O=class _I{constructor(t="",i,s){this.label=t,this.parent=i,this.refId=s,this.position=0,this.subtreeLeft=NaN,this.subtreeRight=NaN,this.children=[],this.leafCount=0,this.prelim=0,this.mod=0,this.ancestor=this,this.change=0,this.shift=0,this.index=0,this.screen=0,this.depth=i?i.depth+1:0}insertTick(t,i){let s=this;for(let n=0;n<t.length;n++){const r=t[n],o=n!==t.length-1,{children:a}=s,l=a.find(c=>c.label===r);if(l&&o)s=l;else{const c=new _I(r,s,i);c.index=a.length,a.push(c),o&&(s=c)}}}getLeftSibling(){return this.index>0?this.parent?.children[this.index-1]:void 0}getLeftmostSibling(){return this.index>0?this.parent?.children[0]:void 0}nextLeft(){return this.children[0]}nextRight(){return this.children.at(-1)}getSiblings(){return this.parent?.children.filter((t,i)=>i!==this.index)??[]}};function YO(e){const t=e.reduce((s,n)=>s<n.length?n.length:s,0),i=new $O;for(let s=0;s<e.length;s++){const n=e[s];for(;n.length<t;)n.push("");i.insertTick(n,s)}return i}function KO(e,t,i){const s=t.index-e.index,n=i/s;t.change-=n,t.shift+=i,e.change+=n,t.prelim+=i,t.mod+=i}function ZO(e,t,i){return t.getSiblings().indexOf(e.ancestor)>=0?e.ancestor:i}function XO({children:e}){let t=0,i=0;for(let s=e.length-1;s>=0;s--){const n=e[s];n.prelim+=t,n.mod+=t,i+=n.change,t+=n.shift+i}}function qO(e,t){const i=e.getLeftSibling();if(i){let s=e,n=e,r=i,o=n.getLeftmostSibling(),a=n.mod,l=s.mod,c=r.mod,h=o.mod;for(;r.nextRight()&&n.nextLeft();){r=r.nextRight(),n=n.nextLeft(),o=o.nextLeft(),s=s.nextRight(),s.ancestor=e;const u=r.prelim+c-(n.prelim+a)+1;u>0&&(KO(ZO(r,e,t),e,u),a+=u,l+=u),c+=r.mod,a+=n.mod,h+=o.mod,l+=s.mod}r.nextRight()&&!s.nextRight()?s.mod+=c-l:(n.nextLeft()&&!o.nextLeft()&&(o.mod+=a-h),t=e)}return t}function TM(e){const{children:t}=e;if(t.length){let[i]=t;for(const r of t)TM(r),i=qO(r,i);XO(e);const s=(t[0].prelim+t.at(-1).prelim)/2,n=e.getLeftSibling();n?(e.prelim=n.prelim+1,e.mod=e.prelim-s):e.prelim=s}else{const i=e.getLeftSibling();e.prelim=i?i.prelim+1:0}}function OM(e,t,i){e.position=e.prelim+t,i.insertNode(e);for(const s of e.children)OM(s,t+e.mod,i)}function EM(e){const{children:t}=e;let i=0;for(const s of t)EM(s),s.children.length?i+=s.leafCount:i++;e.leafCount=i,t.length?(e.subtreeLeft=t[0].subtreeLeft,e.subtreeRight=t[t.length-1].subtreeRight,e.position=(e.subtreeLeft+e.subtreeRight)/2):(e.subtreeLeft=e.position,e.subtreeRight=e.position)}function QO(e){const t=new JO,i=YO(e);return TM(i),OM(i,-i.prelim,t),EM(i),t}var JO=class{constructor(){this.dimensions=new WO,this.nodes=[],this.depth=0}insertNode(e){this.depth<e.depth&&(this.depth=e.depth),this.dimensions.update(e.position,e.depth),this.nodes.push(e)}scaling(e,t){let i=1;if(e>0){const{left:s,right:n}=this.dimensions;n!==s&&(i=e/(n-s))}return t&&(i*=-1),i}},Rs=class extends ae{constructor(){super(...arguments),this.enabled=!0}};f([x],Rs.prototype,"enabled",2),f([x],Rs.prototype,"avoidCollisions",2),f([x],Rs.prototype,"color",2),f([x],Rs.prototype,"spacing",2),f([x],Rs.prototype,"rotation",2),f([x],Rs.prototype,"fontStyle",2),f([x],Rs.prototype,"fontWeight",2),f([x],Rs.prototype,"fontSize",2),f([x],Rs.prototype,"fontFamily",2);var Ru=class extends ae{constructor(){super(...arguments),this.enabled=!0}};f([x],Ru.prototype,"enabled",2),f([x],Ru.prototype,"width",2),f([x],Ru.prototype,"stroke",2);var ff=class extends ae{constructor(){super(...arguments),this.label=new Rs,this.tick=new Ru}};f([x],ff.prototype,"label",2),f([x],ff.prototype,"tick",2);var qr=class extends Kr{constructor(e){super(e,new dM),this.tickScale=new dM,this.depthOptions=new Ja(ff),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:e}=this.tickTreeLayout,{range:t,step:i,inset:s,bandwidth:n}=this.scale,r=Math.abs(t[1]-t[0])-i,o=this.tickTreeLayout.scaling(r,t[0]>t[1]),a=s+n/2;let l=0;for(const c of e){const h=c.position*o;l>h&&(l=h),c.screen=h+a}for(const c of e)c.screen-=l}getDepthOptionsMap(e){const t=[],{depthOptions:i,label:s}=this,n=this.horizontal?0:-90;for(let r=0;r<e;r++)t.push(i[r]?.label.enabled??s.enabled?{enabled:!0,spacing:i[r]?.label.spacing??s.spacing,rotation:i[r]?.label.rotation??(r?n:s.rotation),avoidCollisions:i[r]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,rotation:0,avoidCollisions:!1});return t}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((e,t)=>e.setProperties(t))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){this.updateDirection(),this.updateScale();const{step:e}=this.scale,{title:t,label:i,range:s,depthOptions:n,horizontal:r,line:o}=this;if(this.lineNode.datum=r?{x1:s[0],x2:s[1],y1:0,y2:0}:{x1:0,x2:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:o.stroke,strokeWidth:o.enabled?o.width:0}),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:W.zero,spacing:0,separatorLayout:[],tickLabelLayout:[]};const{depth:a,nodes:l}=this.tickTreeLayout,c=Math.ceil(i.fontSize/e),h=r?-i.getSideFlag():i.getSideFlag(),u=[],d=new Map,p=new Po,g=this.getDepthOptionsMap(a),y=h*g[0].spacing,b=this.tickFormatter(this.scale.domain,this.scale.domain,!1),m=(E,_)=>{const F=a-E.depth;if(!g[F]?.enabled||_%c!==0||!(0,sc.inRange)(E.screen,s))return!1;const j=b(E.label,_-1),Q=this.getLabelStyles({value:j,depth:F},n[F]?.label);return p.setProperties({...Q,text:j,textAlign:"center",textBaseline:i.parallel?"top":"bottom",lineHeight:Ue.getLineHeight(Q.fontSize),x:r?E.screen:y,y:r?y:E.screen,rotation:0}),!0},v={};l.forEach((E,_)=>{const F=a-E.depth;if(v[F]??(v[F]=0),!m(E,_)||!p.getBBox())return;d.set(_,p.getBBox()),p.rotation=$s(g[F]?.rotation);const{width:Q,height:ne}=p.getBBox(),le=r?ne:Q;v[F]<le&&(v[F]=le)});const S=Fg(),M=new Map,I=E=>{if(E===0)return 0;let _=v[0];for(let F=1;F<=E;F++)_+=g[F].spacing,F!==E&&(_+=v[F]);return _};l.forEach((E,_)=>{if(_===0)return;const F=m(E,_),j=!E.children.length,Q=a-E.depth;if(E.parent){const ue=j?E.position:E.position-(E.leafCount-1)/2;if(!M.has(ue)){const $=this.depthOptions[Q]?.tick;let te=v[0];for(let ie=0;ie<=Q;ie++)te+=g[ie].spacing,ie!==0&&(te+=v[ie]);M.set(ue,{tickSize:te,tickStroke:$?.stroke,tickWidth:$?.enabled!==!1?$?.width:0})}}if(!F)return;const ne=$s(g[Q].rotation),{width:le,height:xe}=d.get(_),pe=I(Q);if(p.textAlign="end",p.textBaseline="middle",p.rotation=ne,r?(p.x+=le/2,p.y+=(pe+gp(le/2,xe/2,ne))*h,p.rotationCenterX=E.screen,p.rotationCenterY=p.y):(p.x+=pe*h+gp((g[Q].spacing*h+le)/2,i.mirrored?le:0,ne),p.rotationCenterX=p.x-le/2,p.rotationCenterY=E.screen),g[Q].avoidCollisions){const{width:ue,height:$}=p.getBBox(),te=r?ue:$,ie=j?e:E.leafCount*e;if(te>ie){d.delete(_);return}}const{text:be=""}=p;u.push({text:be,visible:!0,range:this.scale.range,tickId:S(be),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,rotationCenterY:p.rotationCenterY,textAlign:p.textAlign,textBaseline:p.textBaseline,x:p.x,y:p.y}),d.set(_,tt.toCanvas(p))});const k=[...M.values()];k.push(k[0]);const L=[this.lineNodeBBox(),W.merge(d.values()),new W(0,0,k[0].tickSize*h,0)];let C=0;if(t.enabled){const E=W.merge(L);C=r?E.height:E.width,L.push(this.titleBBox(this.scale.domain,C))}const O=W.merge(L);return this.layoutCrossLines(),{bbox:O,spacing:C,separatorLayout:k,tickLabelLayout:u}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:e,tick:t,gridLine:i,gridLength:s}=this,{separatorLayout:n,spacing:r}=this.computedLayout,{position:o,horizontal:a,gridPadding:l}=this,c=o==="bottom"||o==="right"?-1:1,h=l,u=c*s-l,d=e.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).ticks.map((p,g)=>({tickId:Ri(p,g),offset:Math.round(e.convert(p))}));this.gridLineGroupSelection.update(i.enabled&&s?d.map(({tickId:p,offset:g},y)=>{const[b,m,v,S]=a?[g,g,h,u]:[h,u,g,g],{style:M,width:I}=i,{stroke:k,lineDash:L}=M[y%M.length]??{};return{tickId:p,offset:g,x1:b,y1:v,x2:m,y2:S,stroke:k,strokeWidth:I,lineDash:L}}):[]),this.tickLineGroupSelection.update(t.enabled?d.map(({tickId:p,offset:g},y)=>{const{tickSize:b=this.getTickSize(),tickStroke:m=t.stroke,tickWidth:v=t.width}=n[y]??{},S=-c*b,[M,I,k,L]=a?[g,g,0,S]:[0,S,g,g];return{tickId:p,offset:g,x1:M,y1:k,x2:I,y2:L,stroke:m,strokeWidth:v,lineDash:void 0}}):[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(this.scale.domain,r),this.updateCrossLines(),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:e,tickLabelLayout:t,spacing:i,bbox:s}=this.computeLayout();return this.computedLayout={separatorLayout:e,tickLabelLayout:t,spacing:i},{bbox:s,niceDomain:this.scale.domain}}onGridVisibilityChange(){this.gridLineGroupSelection.clear(),this.tickLabelGroupSelection.clear()}updateScale(){super.updateScale(),this.tickScale.range=this.scale.range,this.scale.paddingOuter=this.scale.paddingInner/2}processData(){const{direction:e}=this,t=this.boundSeries.filter(n=>n.visible).flatMap(n=>n.getDomain(e));this.dataDomain={domain:dn(t)??this.filterDuplicateArrays(t),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>(0,sc.toArray)((0,sc.isObject)(n)&&"value"in n?n.value:n));this.tickTreeLayout=QO(i);const s=[];for(const n of this.tickTreeLayout.nodes)n.leafCount||n.refId==null||s.push(this.dataDomain.domain[n.refId]);this.scale.domain=(0,sc.sortBasedOnArray)(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]])}filterDuplicateArrays(e){const t=new Set;return e.filter(i=>{const s=(0,sc.isArray)(i)?JSON.stringify(i):i;return t.has(s)?!1:(t.add(s),!0)})}};qr.className="GroupedCategoryAxis",qr.type="grouped-category",f([x],qr.prototype,"depthOptions",2);var PM=(T(),N(w)),e1=(T(),N(w)),t1={2:(e,t)=>Math.log2(t),[Math.E]:(e,t)=>Math.log(t),10:(e,t)=>Math.log10(t)},i1=(e,t)=>Math.log(t)/Math.log(e);function mf(e,t,i){const s=Math.min(...t),n=t1[e]??i1;return s>=0?n(e,i):-n(e,-i)}var s1={[Math.E]:(e,t)=>Math.exp(t),10:(e,t)=>t>=0?10**t:1/10**-t},n1=(e,t)=>e**t;function yf(e,t,i){const s=Math.min(...t),n=s1[e]??n1;return s>=0?n(e,i):-n(e,-i)}var bf=class jI extends Re{constructor(t=[1,10],i=[0,1]){super(t,i),this.type="log",this.defaultClamp=!0,this.base=10,this.log=s=>mf(this.base,this.domain,s),this.pow=s=>yf(this.base,this.domain,s)}static is(t){return t instanceof jI}transform(t){const[i,s]=wt(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[i,s]=wt(this.domain);return i>=0!=s>=0?NaN:i>=0?Math.exp(t):-Math.exp(-t)}toDomain(t){return t}niceDomain(t,i=this.domain){if(i.length<2)return[];const{base:s}=this,[n,r]=i,o=n>r?Math.ceil:Math.floor,a=n>r?Math.floor:Math.ceil,l=yf(s,i,o(mf(s,i,n))),c=yf(s,i,a(mf(s,i,r)));return[l,c]}ticks({interval:t,tickCount:i=Re.defaultTickCount},s=this.domain,n){if(!s||s.length<2||i<1)return;const r=this.base,[o,a]=s,l=Math.min(o,a),c=Math.max(o,a);let h=this.log(l),u=this.log(c);if(t){const b=I=>I>=l&&I<=c,m=Math.min(Math.abs(t),Math.abs(u-h)),{ticks:v,count:S}=Qh(h,u,m,n),M=v.map(this.pow).filter(b);if(!qo(M.length,this.getPixelRange()))return{ticks:M,count:S}}if(!(0,e1.isInteger)(r)||u-h>=i){const b=Math.min(u-h,i),{ticks:m,count:v}=Al(h,u,b,void 0,void 0,n);return{ticks:m.map(this.pow),count:v}}const d=[],p=l>0;h=Math.floor(h)-1,u=Math.round(u)+1;const g=pl(this.range)/i;let y=1/0;for(let b=h;b<=u;b++){const m=this.convert(this.pow(b+1));for(let v=1;v<r;v++){const S=p?v:r-v+1,M=this.pow(b)*S,I=this.convert(M),k=Math.abs(y-I),L=Math.abs(I-m),C=k>=g&&L>=g;M>=l&&M<=c&&(v===1||C||d.length===0)&&(d.push(M),y=I)}}return hM(d,p,n)}},_s=class Jm extends Re{constructor(){super([0,1],[0,1]),this.type="number"}static is(t){return t instanceof Jm}static getTickStep(t,i,s){const{interval:n,tickCount:r=Re.defaultTickCount,minTickCount:o,maxTickCount:a}=s;return n??Ll(t,i,r,o,a)}toDomain(t){return t}ticks({interval:t,tickCount:i=Re.defaultTickCount,minTickCount:s,maxTickCount:n},r=this.domain,o){if(!r||r.length<2||i<1||!r.every(isFinite))return{ticks:[],count:0};const[a,l]=r;if(t){const c=Math.abs(t);if(!qo((l-a)/c,this.getPixelRange()))return Qh(a,l,c,o)}return Al(a,l,i,s,n,o)}niceDomain(t,i=this.domain){if(i.length<2)return[];const{tickCount:s=Re.defaultTickCount}=t;let[n,r]=i;if(s===1)[n,r]=hv(n,r);else if(s>1){const o=n>r?Math.ceil:Math.floor,a=n>r?Math.floor:Math.ceil,l=4;for(let c=0;c<l;c++){const h=n,u=r,d=Jm.getTickStep(n,r,t),[p,g]=i;if(n=o(p/d)*d,r=a(g/d)*d,n===h&&r===u)break}}return[n,r]}},js=class extends Cl{constructor(e,t=new _s){super(e,t)}normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=hf(e,t,i);return{domain:s,clipped:n}}createDatumFormatter(e,t){const{format:i}=this.label;return typeof i=="number"?cv(t,i):void 0}tickFormatParams(e,t,i){return{type:"number",fractionDigits:i}}datumFormatParams(e,t,i){const{datum:s,seriesId:n,legendItemName:r,key:o,source:a,property:l,domain:c,boundSeries:h}=t;return{type:"number",value:e,datum:s,seriesId:n,legendItemName:r,key:o,source:a,property:l,domain:c,boundSeries:h,fractionDigits:i}}};js.className="NumberAxis",js.type="number",f([x],js.prototype,"min",2),f([x],js.prototype,"max",2);var ra=class extends js{normaliseDataDomain(e){const{min:t,max:i}=this,{extent:s,clipped:n}=hf(e,t,i);return s[0]<0&&s[1]>0||e[0]<0&&e[1]>0?(PM.Logger.warn("The log axis domain crosses zero, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):s[0]===0||s[1]===0||e[0]===0||e[1]===0?(PM.Logger.warn("The log axis domain contains a value of 0, the chart data cannot be rendered. See log axis documentation for more information."),{domain:[],clipped:n}):{domain:s,clipped:n}}set base(e){this.scale.base=e}get base(){return this.scale.base}constructor(e){super(e,new bf)}};ra.className="LogAxis",ra.type="log";var r1=(T(),N(w)),oa=class extends ae{constructor(){super(...arguments),this.enabled=!1,this.label=new Tt,this.tick=new wr}};f([x],oa.prototype,"enabled",2),f([x],oa.prototype,"label",2),f([x],oa.prototype,"tick",2);var zs=class extends Cl{constructor(e){super(e,new Or),this.parentLevel=new oa,this.min=void 0,this.max=void 0,this.minGranularity=void 0}get _unit(){}set _unit(e){r1.Logger.warnOnce("To use 'unit', use an axis with type 'unit-time' instead of 'time'.")}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}normaliseDataDomain(e){return xf(e,this.min,this.max)}processData(){super.processData();const{boundSeries:e,direction:t,min:i,max:s}=this;this.minGranularity=RM(e,t,i,s)}tickFormatParams(e,t,i,s){s??(s=Rg(t));const n=_g(e),r=sn(s),o=Bn(s),a=Dl(s);return{type:"date",unit:r,step:o,epoch:a,truncateDate:n}}datumFormatParams(e,t,i,s,n){if(typeof e=="number"&&(e=new Date(e)),s==null){const{minGranularity:b}=this,m=eu(e);b!=null&&Ni(b)<Ni(m)?s=b:s=m}const{datum:r,seriesId:o,legendItemName:a,key:l,source:c,property:h,domain:u,boundSeries:d}=t,p=sn(s),g=Bn(s),y=Dl(s);return{type:"date",value:e,datum:r,seriesId:o,legendItemName:a,key:l,source:c,property:h,domain:u,boundSeries:d,unit:p,step:g,epoch:y,style:n}}};zs.className="TimeAxis",zs.type="time",f([x],zs.prototype,"parentLevel",2),f([x],zs.prototype,"min",2),f([x],zs.prototype,"max",2),f([x,kt("_unit")],zs.prototype,"unit",2);function RM(e,t,i,s){const n=e.reduce((r,o)=>Math.min(o.minTimeInterval()??1/0,r),1/0);return Number.isFinite(n)?Jh(n):_M(e,t,i,s)?.unit}function _M(e,t,i,s){let n=1/0,r=-1/0,o,a=0;const l=[];for(const d of e){if(!d.visible)continue;const{domain:p}=xf(d.getDomain(t),void 0,void 0);if(p.length===0)continue;const g=p[0].valueOf(),y=p[p.length-1].valueOf();l.push(g,y),n=Math.min(n??1/0,g,y),r=Math.max(r??-1/0,g,y);const b=Math.abs(y-g);if(b===0)continue;const m=d.dataCount();if(a=Math.max(a,m),m<=1)continue;const v=b/(m-1);o=Math.min(o??1/0,v)}if(n=Math.min(n,i?.valueOf()??1/0,s?.valueOf()??1/0),r=Math.max(r,i?.valueOf()??-1/0,s?.valueOf()??-1/0),!Number.isFinite(n)||!Number.isFinite(r))return;o??(o=Math.abs(r-n)),o=Math.min(o,o1(l));const c=Jh(o);let h=o/Ni(c);a<=2?h=Math.floor(h):h=Math.round(h),h=Math.max(h,1);const u=h===1?void 0:Bi(c,n);return{unit:c,step:h,epoch:u}}function o1(e){e.sort((i,s)=>i-s);let t=1/0;for(let i=1;i<e.length;i++){const s=e[i-1],n=e[i];n-s>0&&(t=Math.min(t,Math.abs(n-s)))}return t}function xf(e,t,i){let s=!1;return typeof t=="number"&&(t=new Date(t)),typeof i=="number"&&(i=new Date(i)),e.length>2&&(e=dn(e)?.map(n=>new Date(n))??[]),t instanceof Date&&(s||(s=t>e[0]),e=[t,e[1]]),i instanceof Date&&(s||(s=i<e[1]),e=[e[0],i]),e[0]>e[1]&&(e=[]),{domain:e,clipped:s}}var er=class extends Kr{constructor(e){super(e,new Ns),this.parentLevel=new oa,this.min=void 0,this.max=void 0,this.unit=void 0,this.defaultUnit=void 0}get primaryLabel(){return this.parentLevel.enabled?this.parentLevel.label:void 0}get primaryTick(){return this.parentLevel.enabled?this.parentLevel.tick:void 0}processData(){super.processData();let e;const{domain:t}=this.dataDomain;if(t.length===2&&t[0].valueOf()===t[1].valueOf())e=eu(t[0]);else{const{boundSeries:i,direction:s,min:n,max:r}=this;e=_M(i,s,n,r)}ft(this.defaultUnit,e)||(this.defaultUnit=e)}updateScale(){super.updateScale(),this.scale.interval=this.unit??this.defaultUnit}normaliseDataDomain(e){return xf(e,this.min,this.max)}createDatumFormatter(e,t){const i=this.scale.interval,{format:s}=this.label;if(s==null)return;const n=Bg(i!=null?X0(s,sn(i)):s,i);if(n!=null)return Ar(n)}tickFormatParams(e,t,i,s){s??(s=Rg(t));const n=_g(e),r=sn(s),o=Bn(s),a=Dl(s);return{type:"date",unit:r,step:o,epoch:a,truncateDate:n}}datumFormatParams(e,t,i,s,n){const r=this.unit??this.defaultUnit??"millisecond";e=Bi(r,e),typeof e=="number"&&(e=new Date(e)),s??(s=r);const{datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p}=t,g=sn(s),y=Bn(s),b=Dl(s);return{type:"date",value:e,datum:o,seriesId:a,legendItemName:l,key:c,source:h,property:u,domain:d,boundSeries:p,unit:g,step:y,epoch:b,style:n}}};er.className="UnitTimeAxis",er.type="unit-time",f([x],er.prototype,"parentLevel",2),f([x],er.prototype,"min",2),f([x],er.prototype,"max",2),f([x],er.prototype,"unit",2);var aa={...hn,...Xn(ye.number),type:(0,ye.required)((0,ye.constant)("number")),label:lf,crosshair:Zn(!0)},la={...hn,...Xn(ye.number),type:(0,ye.required)((0,ye.constant)("log")),base:(0,ye.and)(ye.positiveNumberNonZero,(0,ye.attachDescription)(e=>e!==1,"not equal to 1")),label:lf,crosshair:Zn(!0)},ca={...hn,...Xn((0,ye.or)(ye.number,ye.date),!0),type:(0,ye.required)((0,ye.constant)("time")),label:ql,parentLevel:vu,crosshair:Zn(!0,!0)},ha={...hn,type:(0,ye.required)((0,ye.constant)("category")),label:Xl,paddingInner:ye.ratio,paddingOuter:ye.ratio,groupPaddingInner:ye.ratio,crosshair:Zn(),bandHighlight:Ql},ua={...hn,type:(0,ye.required)((0,ye.constant)("grouped-category")),label:Xl,crosshair:Zn(),bandHighlight:Ql,paddingInner:ye.ratio,groupPaddingInner:ye.ratio,depthOptions:(0,ye.arrayOfDefs)({label:{enabled:ye.boolean,avoidCollisions:ye.boolean,rotation:ye.number,spacing:ye.number,...ye.fontOptionsDef},tick:{enabled:ye.boolean,stroke:ye.color,width:ye.positiveNumber}},"depth options objects array")},da={...hn,...G(Xn((0,ye.or)(ye.number,ye.date),!0),["nice"]),type:(0,ye.required)((0,ye.constant)("unit-time")),unit:(0,ye.or)(af,xu),label:ql,parentLevel:vu,paddingInner:ye.ratio,paddingOuter:ye.ratio,groupPaddingInner:ye.ratio,crosshair:Zn(!0,!0),bandHighlight:Ql},a1={type:"axis",name:"number",chartType:"cartesian",options:aa,create:e=>new js(e)},l1={type:"axis",name:"log",chartType:"cartesian",options:la,create:e=>new ra(e)},c1={type:"axis",name:"time",chartType:"cartesian",options:ca,create:e=>new zs(e)},h1={type:"axis",name:"category",chartType:"cartesian",options:ha,create:e=>new Kr(e)},u1={type:"axis",name:"grouped-category",chartType:"cartesian",options:ua,create:e=>new qr(e)},d1={type:"axis",name:"unit-time",chartType:"cartesian",options:da,create:e=>new er(e)},ce=(T(),N(w)),pa={...hn,type:(0,ce.required)((0,ce.constant)("ordinal-time")),paddingInner:ce.ratio,paddingOuter:ce.ratio,groupPaddingInner:ce.ratio,label:ql,parentLevel:vu,interval:Xn((0,ce.or)(ce.number,ce.date),!0).interval,crosshair:Zn(!0,!0),bandHighlight:Ql},jM={...$r,...Xn(ce.number),type:(0,ce.required)((0,ce.constant)("angle-number")),crossLines:(0,ce.arrayOfDefs)(Es),startAngle:ce.number,endAngle:ce.number,label:{...cn,orientation:(0,ce.union)("fixed","parallel","perpendicular"),format:ls}},p1={innerRadiusRatio:ce.ratio},zM={...$r,...p1,type:(0,ce.required)((0,ce.constant)("angle-category")),shape:(0,ce.union)("polygon","circle"),crossLines:(0,ce.arrayOfDefs)(Es),startAngle:ce.number,endAngle:ce.number,paddingInner:ce.ratio,groupPaddingInner:ce.ratio,label:{...cn,orientation:(0,ce.union)("fixed","parallel","perpendicular")}},FM={...$r,...Xn(ce.number),type:(0,ce.required)((0,ce.constant)("radius-number")),shape:(0,ce.union)("polygon","circle"),positionAngle:ce.number,innerRadiusRatio:ce.ratio,crossLines:(0,ce.arrayOfDefs)({...Es,label:{...Wr,positionAngle:ce.number}},"cross-line options"),title:{enabled:ce.boolean,text:ce.string,spacing:ce.positiveNumber,formatter:ce.callback,...ce.fontOptionsDef},label:{...cn,format:ls}},BM={...$r,type:(0,ce.required)((0,ce.constant)("radius-category")),positionAngle:ce.number,innerRadiusRatio:ce.ratio,paddingInner:ce.ratio,paddingOuter:ce.ratio,groupPaddingInner:ce.ratio,label:cn,crossLines:(0,ce.arrayOfDefs)({...Es,label:{...Wr,positionAngle:ce.number}},"cross-line options"),title:{enabled:ce.boolean,text:ce.string,spacing:ce.positiveNumber,formatter:ce.callback,...ce.fontOptionsDef}},Et=(T(),N(w)),VM=(0,Et.multiSeriesHighlightOptionsDef)(Et.shapeHighlightOptionsDef,Et.shapeHighlightOptionsDef),GM={showInMiniChart:Et.boolean,connectMissingData:Et.boolean,interpolation:ku,label:_e,marker:un,tooltip:ke,shadow:Ps,...Ie,...Et.fillOptionsDef,...Et.strokeOptionsDef,...Et.lineDashOptionsDef,highlight:VM},HM={...GM,...hs,highlight:VM,type:(0,Et.required)((0,Et.constant)("area")),xKey:(0,Et.required)(Et.string),yKey:(0,Et.required)(Et.string),xName:Et.string,yName:Et.string,stacked:Et.boolean,stackGroup:Et.string,normalizedTo:Et.number},ve=(T(),N(w)),UM=(0,ve.multiSeriesHighlightOptionsDef)(ve.barHighlightOptionsDef,ve.barHighlightOptionsDef),vf={direction:(0,ve.union)("horizontal","vertical"),showInMiniChart:ve.boolean,cornerRadius:ve.positiveNumber,itemStyler:(0,ve.callbackDefs)({...ve.fillOptionsDef,...ve.strokeOptionsDef,...ve.lineDashOptionsDef,cornerRadius:ve.positiveNumber}),crisp:ve.boolean,label:{..._e,placement:(0,ve.union)("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:ve.positiveNumber},errorBar:Jl,shadow:Ps,tooltip:ke,...Ie,highlight:UM,...ve.fillOptionsDef,...ve.strokeOptionsDef,...ve.lineDashOptionsDef};vf.sparklineMode=(0,ve.undocumented)(ve.boolean);var oc={...vf,...hs,highlight:UM,type:(0,ve.required)((0,ve.constant)("bar")),xKey:(0,ve.required)(ve.string),yKey:(0,ve.required)(ve.string),xName:ve.string,yName:ve.string,direction:(0,ve.union)("horizontal","vertical"),grouped:ve.boolean,stacked:ve.boolean,stackGroup:ve.string,normalizedTo:ve.number,legendItemName:ve.string,errorBar:Lu};oc.pickOutsideVisibleMinorAxis=(0,ve.undocumented)(ve.boolean),oc.fastDataProcessing=(0,ve.undocumented)(ve.boolean),oc.focusPriority=(0,ve.undocumented)(ve.number);var Xe=(T(),N(w)),WM={title:Xe.string,domain:(0,Xe.arrayOf)(Xe.number),maxSize:Xe.positiveNumber,showInMiniChart:Xe.boolean,label:{placement:(0,Xe.union)("top","right","bottom","left"),..._e},tooltip:ke,...Ie,...G(un,["enabled"]),highlight:(0,Xe.multiSeriesHighlightOptionsDef)(Xe.shapeHighlightOptionsDef,Xe.shapeHighlightOptionsDef)},g1={...WM,...hs,type:(0,Xe.required)((0,Xe.constant)("bubble")),xKey:(0,Xe.required)(Xe.string),yKey:(0,Xe.required)(Xe.string),sizeKey:(0,Xe.required)(Xe.string),labelKey:Xe.string,xName:Xe.string,yName:Xe.string,sizeName:Xe.string,labelName:Xe.string,highlight:(0,Xe.multiSeriesHighlightOptionsDef)(Xe.shapeHighlightOptionsDef,Xe.shapeHighlightOptionsDef)},dt=(T(),N(w)),$M={showInMiniChart:dt.boolean,cornerRadius:dt.positiveNumber,label:_e,tooltip:ke,shadow:Ps,...Ie,...dt.fillOptionsDef,...dt.strokeOptionsDef,...dt.lineDashOptionsDef,highlight:(0,dt.multiSeriesHighlightOptionsDef)(dt.shapeHighlightOptionsDef,dt.shapeHighlightOptionsDef)},f1={...hs,...$M,type:(0,dt.required)((0,dt.constant)("histogram")),xKey:(0,dt.required)(dt.string),yKey:dt.string,xName:dt.string,yName:dt.string,areaPlot:dt.boolean,aggregation:(0,dt.union)("count","sum","mean"),bins:(0,dt.arrayOf)((0,dt.arrayOf)(dt.number)),binCount:dt.positiveNumber},We=(T(),N(w)),YM=(0,We.multiSeriesHighlightOptionsDef)(We.shapeHighlightOptionsDef,We.lineHighlightOptionsDef),Mf={title:We.string,showInMiniChart:We.boolean,connectMissingData:We.boolean,interpolation:ku,label:_e,marker:un,tooltip:ke,errorBar:Jl,...Ie,...We.strokeOptionsDef,...We.lineDashOptionsDef,highlight:YM};Mf.sparklineMode=(0,We.undocumented)(We.boolean);var _u={...Mf,...hs,highlight:YM,type:(0,We.required)((0,We.constant)("line")),xKey:(0,We.required)(We.string),yKey:(0,We.required)(We.string),xName:We.string,yName:We.string,stacked:We.boolean,stackGroup:We.string,normalizedTo:We.number,legendItemName:We.string,errorBar:Lu};_u.pickOutsideVisibleMinorAxis=(0,We.undocumented)(We.boolean),_u.focusPriority=(0,We.undocumented)(We.number);var Pt=(T(),N(w)),KM={title:Pt.string,showInMiniChart:Pt.boolean,label:{placement:(0,Pt.union)("top","right","bottom","left"),..._e},tooltip:ke,errorBar:Jl,...Ie,...G(un,["enabled"]),highlight:(0,Pt.multiSeriesHighlightOptionsDef)(Pt.shapeHighlightOptionsDef,Pt.shapeHighlightOptionsDef)},m1={...KM,...hs,type:(0,Pt.required)((0,Pt.constant)("scatter")),xKey:(0,Pt.required)(Pt.string),yKey:(0,Pt.required)(Pt.string),labelKey:Pt.string,xName:Pt.string,yName:Pt.string,labelName:Pt.string,errorBar:Lu,highlight:(0,Pt.multiSeriesHighlightOptionsDef)(Pt.shapeHighlightOptionsDef,Pt.shapeHighlightOptionsDef)},_i=(T(),N(w)),Z=(T(),N(w)),ZM=(0,Z.multiSeriesHighlightOptionsDef)(Z.shapeHighlightOptionsDef,Z.shapeHighlightOptionsDef),Sf={...Ie,radiusMin:Z.positiveNumber,radiusMax:Z.positiveNumber,rotation:Z.number,outerRadiusOffset:Z.number,outerRadiusRatio:Z.ratio,hideZeroValueSectorsInLegend:Z.boolean,sectorSpacing:Z.positiveNumber,cornerRadius:Z.positiveNumber,itemStyler:(0,Z.callbackDefs)({...Z.fillOptionsDef,...Z.strokeOptionsDef,...Z.lineDashOptionsDef,cornerRadius:Z.positiveNumber}),title:{enabled:Z.boolean,text:Z.string,showInLegend:Z.boolean,spacing:Z.positiveNumber,...Z.fontOptionsDef},calloutLabel:{enabled:Z.boolean,offset:Z.number,minAngle:Z.positiveNumber,avoidCollisions:Z.boolean,formatter:Z.callback,format:Z.string,...Z.fontOptionsDef},sectorLabel:{enabled:Z.boolean,positionOffset:Z.number,positionRatio:Z.ratio,formatter:Z.callback,format:Z.string,...Z.fontOptionsDef},calloutLine:{colors:(0,Z.arrayOf)(Z.color),length:Z.positiveNumber,strokeWidth:Z.positiveNumber},fills:(0,Z.arrayOf)(Z.colorUnion),strokes:(0,Z.arrayOf)(Z.color),tooltip:ke,shadow:Ps,highlight:ZM,...Z.lineDashOptionsDef,...G(Z.fillOptionsDef,["fill"]),...G(Z.strokeOptionsDef,["stroke"])},Qr={...Sf,...hs,type:(0,Z.required)((0,Z.constant)("pie")),angleKey:(0,Z.required)(Z.string),radiusKey:Z.string,calloutLabelKey:Z.string,sectorLabelKey:Z.string,legendItemKey:Z.string,angleName:Z.string,radiusName:Z.string,calloutLabelName:Z.string,sectorLabelName:Z.string,highlight:ZM};Qr.defaultColorRange=(0,Z.undocumented)((0,Z.arrayOf)((0,Z.arrayOf)(Z.color))),Qr.defaultPatternFills=(0,Z.undocumented)((0,Z.arrayOf)(Z.color)),Qr.title._enabledFromTheme=(0,Z.undocumented)(Z.boolean),Qr.calloutLabel._enabledFromTheme=(0,Z.undocumented)(Z.boolean),Qr.sectorLabel._enabledFromTheme=(0,Z.undocumented)(Z.boolean);var XM={...Sf,innerRadiusOffset:_i.number,innerRadiusRatio:_i.ratio,innerCircle:{fill:_i.string,fillOpacity:_i.ratio},innerLabels:{spacing:_i.positiveNumber,..._i.fontOptionsDef}},y1={...XM,...Qr,type:(0,_i.required)((0,_i.constant)("donut")),innerLabels:(0,_i.arrayOfDefs)({text:(0,_i.required)(_i.string),spacing:_i.positiveNumber,..._i.fontOptionsDef},"inner label options array")},B=(T(),N(w)),ga={lineStyle:(0,B.union)("solid","dashed","dotted"),...B.lineDashOptionsDef},Jr={...B.fillOptionsDef,...B.strokeOptionsDef,...B.lineDashOptionsDef},ac={visible:B.boolean,locked:B.boolean,handle:Jr,...B.fontOptionsDef},ju={position:(0,B.union)("top","center","bottom"),alignment:(0,B.union)("left","center","right"),...B.fontOptionsDef},qM={position:(0,B.union)("top","inside","bottom"),alignment:(0,B.union)("left","center","right"),...B.fontOptionsDef},b1={enabled:B.boolean,cornerRadius:B.positiveNumber,formatter:B.callback,...B.fontOptionsDef,...B.fillOptionsDef,...B.strokeOptionsDef,...B.lineDashOptionsDef},x1={visible:B.boolean,...ga,...B.strokeOptionsDef},QM={divider:B.strokeOptionsDef,...B.fillOptionsDef,...B.strokeOptionsDef,...B.fontOptionsDef},JM={handle:Jr,statistics:QM,...ga,...B.fillOptionsDef,...B.strokeOptionsDef},zu={visible:B.boolean,locked:B.boolean,extendStart:B.boolean,extendEnd:B.boolean,handle:Jr,text:ju,...ga,...B.strokeOptionsDef},Df={visible:B.boolean,locked:B.boolean,axisLabel:b1,handle:Jr,text:ju,...ga,...B.strokeOptionsDef},If={visible:B.boolean,locked:B.boolean,extendStart:B.boolean,extendEnd:B.boolean,handle:Jr,text:qM,background:B.fillOptionsDef,...ga,...B.strokeOptionsDef},eS={...If},tS={...If,middle:x1},Af={label:B.fontOptionsDef,showFill:B.boolean,isMultiColor:B.boolean,strokes:(0,B.arrayOf)(B.color),rangeStroke:B.color,bands:(0,B.union)(4,6,10),...zu},iS={...B.fillOptionsDef,...B.strokeOptionsDef,...ac},sS={...B.fillOptionsDef,...B.strokeOptionsDef,...ac},nS={...B.fillOptionsDef,...B.strokeOptionsDef,...ac,background:{...B.fillOptionsDef,...B.strokeOptionsDef}},Lf={visible:B.boolean,locked:B.boolean,handle:Jr,...B.fillOptionsDef},Fu={visible:B.boolean,locked:B.boolean,extendStart:B.boolean,extendEnd:B.boolean,handle:Jr,text:ju,background:B.fillOptionsDef,statistics:QM,...ga,...B.strokeOptionsDef},rS={visible:B.boolean,up:JM,down:JM},fa={enabled:B.boolean,axesButtons:{enabled:B.boolean,axes:(0,B.union)("x","y","xy")},toolbar:{enabled:B.boolean,padding:B.positiveNumber,buttons:(0,B.arrayOfDefs)({...Yr,value:(0,B.union)("line-menu","fibonacci-menu","text-menu","shape-menu","measurer-menu","line","horizontal-line","vertical-line","parallel-channel","disjoint-channel","fibonacci-retracement","fibonacci-retracement-trend-based","text","comment","callout","note","clear")},"annotation toolbar buttons array")},optionsToolbar:{enabled:B.boolean,buttons:(0,B.arrayOf)((0,B.or)((0,B.optionsDefs)({...Yr,value:(0,B.required)((0,B.union)("line-stroke-width","line-style-type","line-color","fill-color","text-color","text-size","delete","settings"))}),(0,B.optionsDefs)({...Yr,value:(0,B.required)((0,B.union)("lock")),checkedOverrides:Yr})))}};fa.data=(0,B.undocumented)(B.array),fa.xKey=(0,B.undocumented)(B.string),fa.volumeKey=(0,B.undocumented)(B.string),fa.snap=(0,B.undocumented)(B.boolean);var D=(T(),N(w)),kf={...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber,whisker:{...D.strokeOptionsDef,...D.lineDashOptionsDef},cap:{lengthRatio:D.ratio}},Cf={...kf,opacity:D.ratio},oS={direction:(0,D.union)("horizontal","vertical"),showInMiniChart:D.boolean,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber,whisker:{...D.strokeOptionsDef,...D.lineDashOptionsDef},cap:{lengthRatio:D.ratio}}),tooltip:ke,...Ie,...kf,highlight:(0,D.multiSeriesHighlightOptionsDef)(Cf,Cf)},wf={cornerRadius:D.positiveNumber,wick:{...D.strokeOptionsDef,...D.lineDashOptionsDef},...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},aS={...wf,opacity:D.ratio},lS={item:{up:wf,down:wf},itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber,wick:{...D.strokeOptionsDef,...D.lineDashOptionsDef}}),showInMiniChart:D.boolean,tooltip:ke,...Ie,highlight:(0,D.multiSeriesHighlightOptionsDef)(aS,aS)},cS={fills:(0,D.arrayOf)(D.colorUnion),strokes:(0,D.arrayOf)(D.color),label:{spacing:D.positiveNumber,maxWidth:D.positiveNumber,..._e},link:{tension:D.ratio,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,tension:D.ratio}),...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},node:{width:D.positiveNumber,spacing:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef}),...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},tooltip:ke,...Ie},hS={direction:(0,D.union)("horizontal","vertical"),fills:(0,D.arrayOf)(D.colorUnion),strokes:(0,D.arrayOf)(D.color),label:{spacing:D.positiveNumber,placement:(0,D.union)("before","middle","after"),..._e},stageLabel:{placement:(0,D.union)("before","after"),format:ls,...cn},tooltip:ke,...G(Ie,["showInLegend"]),...G(D.fillOptionsDef,["fill"]),...G(D.strokeOptionsDef,["stroke"]),...D.lineDashOptionsDef,highlight:(0,D.highlightOptionsDef)(D.lineHighlightOptionsDef)},uS={direction:(0,D.union)("horizontal","vertical"),fills:(0,D.arrayOf)(D.colorUnion),strokes:(0,D.arrayOf)(D.color),itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef}),spacingRatio:D.ratio,crisp:D.boolean,dropOff:{enabled:D.boolean,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},stageLabel:{placement:(0,D.union)("before","after"),format:ls,...cn},label:_e,tooltip:ke,shadow:Ps,...G(Ie,["showInLegend"]),...G(D.fillOptionsDef,["fill"]),...G(D.strokeOptionsDef,["stroke"]),...D.lineDashOptionsDef},dS={title:D.string,textAlign:(0,D.union)("left","center","right"),verticalAlign:(0,D.union)("top","middle","bottom"),itemPadding:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef}),showInMiniChart:D.boolean,label:qn,tooltip:ke,...Ie,...D.strokeOptionsDef},pS={showInMiniChart:D.boolean,itemStyler:(0,D.callbackDefs)({...D.strokeOptionsDef,...D.lineDashOptionsDef}),item:{up:{...D.strokeOptionsDef,...D.lineDashOptionsDef},down:{...D.strokeOptionsDef,...D.lineDashOptionsDef}},tooltip:ke,...Ie,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.lineHighlightOptionsDef,D.lineHighlightOptionsDef)},gS={maxStrokeWidth:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.strokeOptionsDef,...D.lineDashOptionsDef}),sizeDomain:(0,D.arrayOf)(D.positiveNumber),label:_e,tooltip:ke,...Ie,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlightStyle:{...Ie.highlightStyle,...D.strokeOptionsDef},highlight:(0,D.multiSeriesHighlightOptionsDef)(D.lineHighlightOptionsDef,D.lineHighlightOptionsDef)},fS={...D.strokeOptionsDef,...D.lineDashOptionsDef},mS={colorRange:(0,D.arrayOf)(D.color),maxSize:D.positiveNumber,sizeDomain:(0,D.arrayOf)(D.positiveNumber),label:{placement:(0,D.union)("top","bottom","left","right"),..._e},tooltip:ke,...Ie,...G(un,["enabled"]),highlightStyle:{...Ie.highlightStyle,...D.fillOptionsDef,...D.strokeOptionsDef},highlight:(0,D.multiSeriesHighlightOptionsDef)(D.shapeHighlightOptionsDef,D.shapeHighlightOptionsDef)},yS={colorRange:(0,D.arrayOf)(D.color),padding:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef}),label:qn,tooltip:ke,...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlightStyle:{...Ie.highlightStyle,...D.fillOptionsDef,...D.strokeOptionsDef},highlight:(0,D.multiSeriesHighlightOptionsDef)(D.shapeHighlightOptionsDef,D.shapeHighlightOptionsDef)},bS={...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},xS={cornerRadius:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber}),label:_e,tooltip:ke,...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.barHighlightOptionsDef,D.barHighlightOptionsDef)},vS={direction:(0,D.union)("horizontal","vertical"),aspectRatio:D.positiveNumber,spacing:D.positiveNumber,reverse:D.boolean,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef}),fills:(0,D.arrayOf)(D.colorUnion),strokes:(0,D.arrayOf)(D.color),label:_e,stageLabel:{spacing:D.positiveNumber,placement:(0,D.union)("before","after"),..._e},tooltip:ke,shadow:Ps,...Ie,...G(D.fillOptionsDef,["fill"]),...G(D.strokeOptionsDef,["stroke"]),...D.lineDashOptionsDef},MS={connectMissingData:D.boolean,marker:un,label:_e,tooltip:ke,...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.shapeHighlightOptionsDef,D.shapeHighlightOptionsDef)},SS={connectMissingData:D.boolean,marker:un,label:_e,tooltip:ke,...Ie,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.shapeHighlightOptionsDef,D.lineHighlightOptionsDef)},DS={cornerRadius:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber}),label:_e,tooltip:ke,...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.barHighlightOptionsDef,D.barHighlightOptionsDef)},IS={cornerRadius:D.positiveNumber,columnWidthRatio:D.ratio,maxColumnWidthRatio:D.ratio,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber}),label:_e,tooltip:ke,...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.barHighlightOptionsDef,D.barHighlightOptionsDef)},AS={showInMiniChart:D.boolean,connectMissingData:D.boolean,interpolation:ku,label:{..._e,padding:D.positiveNumber,placement:(0,D.union)("inside","outside")},marker:un,tooltip:ke,shadow:Ps,...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.shapeHighlightOptionsDef,D.shapeHighlightOptionsDef)},LS={direction:(0,D.union)("horizontal","vertical"),grouped:D.boolean,showInMiniChart:D.boolean,cornerRadius:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber}),label:{..._e,padding:D.positiveNumber,placement:(0,D.union)("inside","outside")},tooltip:ke,shadow:Ps,...Ie,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,highlight:(0,D.multiSeriesHighlightOptionsDef)(D.barHighlightOptionsDef,D.barHighlightOptionsDef)},kS={fills:(0,D.arrayOf)(D.colorUnion),strokes:(0,D.arrayOf)(D.color),label:{..._e,spacing:D.positiveNumber},link:{itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef}),...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},node:{width:D.positiveNumber,spacing:D.positiveNumber,alignment:(0,D.union)("left","center","right","justify"),itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef}),...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},tooltip:ke,...Ie},CS={fills:(0,D.arrayOf)(D.colorUnion),strokes:(0,D.arrayOf)(D.color),colorRange:(0,D.arrayOf)(D.color),sectorSpacing:D.positiveNumber,cornerRadius:D.positiveNumber,padding:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef}),label:{spacing:D.positiveNumber,...qn},secondaryLabel:qn,tooltip:ke,...G(Ie,["highlight","showInLegend"]),...G(D.fillOptionsDef,["fill"]),...G(D.strokeOptionsDef,["stroke"]),highlightStyle:{label:{color:D.color},secondaryLabel:{color:D.color},...D.fillOptionsDef,...D.strokeOptionsDef}},wS={fills:(0,D.arrayOf)(D.colorUnion),strokes:(0,D.arrayOf)(D.color),colorRange:(0,D.arrayOf)(D.color),itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef}),group:{gap:D.positiveNumber,padding:D.positiveNumber,cornerRadius:D.positiveNumber,textAlign:(0,D.union)("left","center","right"),interactive:D.boolean,label:{..._e,spacing:D.positiveNumber},...D.fillOptionsDef,...D.strokeOptionsDef},tile:{gap:D.positiveNumber,padding:D.positiveNumber,cornerRadius:D.positiveNumber,textAlign:(0,D.union)("left","center","right"),verticalAlign:(0,D.union)("top","middle","bottom"),label:{..._e,spacing:D.positiveNumber,lineHeight:D.positiveNumber,minimumFontSize:D.positiveNumber,wrapping:(0,D.union)("never","always","hyphenate","on-space"),overflowStrategy:(0,D.union)("ellipsis","hide")},secondaryLabel:{..._e,lineHeight:D.positiveNumber,minimumFontSize:D.positiveNumber,wrapping:(0,D.union)("never","always","hyphenate","on-space"),overflowStrategy:(0,D.union)("ellipsis","hide")},...D.fillOptionsDef,...D.strokeOptionsDef},tooltip:ke,...G(Ie,["highlight","showInLegend"]),highlightStyle:{group:{label:{color:D.color},...D.fillOptionsDef,...D.strokeOptionsDef},tile:{label:{color:D.color},secondaryLabel:{color:D.color},...D.fillOptionsDef,...D.strokeOptionsDef}}},Nf={name:D.string,cornerRadius:D.positiveNumber,itemStyler:(0,D.callbackDefs)({...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef,cornerRadius:D.positiveNumber}),label:{..._e,padding:D.positiveNumber,placement:(0,D.union)("inside-start","inside-center","inside-end","outside-start","outside-end")},tooltip:ke,shadow:Ps,...D.fillOptionsDef,...D.strokeOptionsDef,...D.lineDashOptionsDef},NS={direction:(0,D.union)("horizontal","vertical"),showInMiniChart:D.boolean,item:{positive:Nf,negative:Nf,total:Nf},line:{enabled:D.boolean,...D.strokeOptionsDef,...D.lineDashOptionsDef},tooltip:ke,...Ie},Bu=(0,q.optionsDefs)({__type:(0,q.required)((0,q.constant)("date")),value:(0,q.or)(q.string,q.number)},"a serializable date object"),TS={width:q.positiveNumber,height:q.positiveNumber,grip:q.boolean,fill:q.color,stroke:q.color,strokeWidth:q.positiveNumber,cornerRadius:q.positiveNumber},we={enabled:q.boolean,height:q.positiveNumber,spacing:q.positiveNumber,cornerRadius:q.number,mask:{fill:q.color,fillOpacity:q.ratio,stroke:q.color,strokeWidth:q.positiveNumber},minHandle:TS,maxHandle:TS,miniChart:{enabled:q.boolean,padding:{top:q.positiveNumber,bottom:q.positiveNumber},label:{enabled:q.boolean,avoidCollisions:q.boolean,spacing:q.positiveNumber,format:ls,formatter:q.callback,interval:{minSpacing:q.positiveNumber,maxSpacing:q.positiveNumber,values:q.array,step:q.number},...q.fontOptionsDef},series:q.defined}},ii={number:{...G(aa,["type","crossLines"]),top:G(aa,["type","crossLines","position"]),right:G(aa,["type","crossLines","position"]),bottom:G(aa,["type","crossLines","position"]),left:G(aa,["type","crossLines","position"]),crossLines:G(ln,["type"])},log:{...G(la,["type","crossLines"]),top:G(la,["type","crossLines","position"]),right:G(la,["type","crossLines","position"]),bottom:G(la,["type","crossLines","position"]),left:G(la,["type","crossLines","position"]),crossLines:G(ln,["type"])},category:{...G(ha,["type","crossLines"]),top:G(ha,["type","crossLines","position"]),right:G(ha,["type","crossLines","position"]),bottom:G(ha,["type","crossLines","position"]),left:G(ha,["type","crossLines","position"]),crossLines:G(ln,["type"])},time:{...G(ca,["type","crossLines"]),top:G(ca,["type","crossLines","position"]),right:G(ca,["type","crossLines","position"]),bottom:G(ca,["type","crossLines","position"]),left:G(ca,["type","crossLines","position"]),crossLines:G(ln,["type"])},"unit-time":{...G(da,["type","crossLines"]),top:G(da,["type","crossLines","position"]),right:G(da,["type","crossLines","position"]),bottom:G(da,["type","crossLines","position"]),left:G(da,["type","crossLines","position"]),crossLines:G(ln,["type"])},"grouped-category":{...G(ua,["type"]),top:G(ua,["type","position"]),right:G(ua,["type","position"]),bottom:G(ua,["type","position"]),left:G(ua,["type","position"]),crossLines:G(ln,["type"])},"ordinal-time":{...G(pa,["type","crossLines"]),top:G(pa,["type","crossLines","position"]),right:G(pa,["type","crossLines","position"]),bottom:G(pa,["type","crossLines","position"]),left:G(pa,["type","crossLines","position"]),crossLines:G(ln,["type"])}},ma={"angle-category":{...G(zM,["type","crossLines"]),crossLines:G(Es,["type"])},"angle-number":{...G(jM,["type","crossLines"]),crossLines:G(Es,["type"])},"radius-category":{...G(BM,["type","crossLines"]),crossLines:{...G(Es,["type"]),label:{...Wr,positionAngle:q.number}}},"radius-number":{...G(FM,["type","crossLines"]),crossLines:{...G(Es,["type"]),label:{...Wr,positionAngle:q.number}}}},Ee={visible:q.boolean},v1={common:{...oe,navigator:we,axes:{...ii,...ma},annotations:{...fa,line:zu,"horizontal-line":Df,"vertical-line":Df,"disjoint-channel":eS,"parallel-channel":tS,"fibonacci-retracement":Af,"fibonacci-retracement-trend-based":Af,callout:iS,comment:sS,note:nS,text:ac,arrow:zu,"arrow-up":Lf,"arrow-down":Lf,"date-range":Fu,"price-range":Fu,"date-price-range":Fu,"quick-date-price-range":rS},chartToolbar:{enabled:q.boolean},initialState:{legend:(0,q.arrayOfDefs)({visible:q.boolean,seriesId:q.string,itemId:q.string,legendItemName:q.string},"legend state array"),zoom:{rangeX:{start:(0,q.or)(q.number,Bu),end:(0,q.or)(q.number,Bu)},rangeY:{start:(0,q.or)(q.number,Bu),end:(0,q.or)(q.number,Bu)},ratioX:{start:q.ratio,end:q.ratio},ratioY:{start:q.ratio,end:q.ratio},autoScaledAxes:(0,q.arrayOf)((0,q.constant)("y"))}}},line:{...oe,axes:ii,series:Mf,navigator:we,...Ee},scatter:{...oe,axes:ii,series:KM,navigator:we,...Ee},bubble:{...oe,axes:ii,series:WM,navigator:we,...Ee},area:{...oe,axes:ii,series:GM,navigator:we,...Ee},bar:{...oe,axes:ii,series:vf,navigator:we,...Ee},"box-plot":{...oe,axes:ii,series:oS,navigator:we,...Ee},candlestick:{...oe,axes:ii,series:lS,navigator:we,...Ee},"cone-funnel":{...oe,axes:ii,series:hS,navigator:we,...Ee},funnel:{...oe,axes:ii,series:uS,navigator:we,...Ee},ohlc:{...oe,axes:ii,series:pS,navigator:we,...Ee},histogram:{...oe,axes:G(ii,["category","grouped-category","unit-time","ordinal-time"]),series:$M,navigator:we,...Ee},heatmap:{...oe,axes:ii,series:dS,navigator:we,...Ee},waterfall:{...oe,axes:ii,series:NS,navigator:we,...Ee},"range-bar":{...oe,axes:ii,series:LS,navigator:we,...Ee},"range-area":{...oe,axes:ii,series:AS,navigator:we,...Ee},donut:{...oe,series:XM,navigator:we,...Ee},pie:{...oe,series:Sf,navigator:we,...Ee},"radar-line":{...oe,axes:ma,series:SS,navigator:we,...Ee},"radar-area":{...oe,axes:ma,series:MS,navigator:we,...Ee},"radial-bar":{...oe,axes:ma,series:DS,navigator:we,...Ee},"radial-column":{...oe,axes:ma,series:IS,navigator:we,...Ee},nightingale:{...oe,axes:ma,series:xS,navigator:we,...Ee},sunburst:{...oe,series:CS,navigator:we,...Ee},treemap:{...oe,series:wS,navigator:we,...Ee},"map-shape":{...oe,series:yS,navigator:we,...Ee},"map-line":{...oe,series:gS,navigator:we,...Ee},"map-marker":{...oe,series:mS,navigator:we,...Ee},"map-shape-background":{...oe,series:bS,navigator:we,...Ee},"map-line-background":{...oe,series:fS,navigator:we,...Ee},sankey:{...oe,series:kS,navigator:we,...Ee},chord:{...oe,series:cS,navigator:we,...Ee},pyramid:{...oe,series:vS,navigator:we,...Ee},"radial-gauge":{...oe,...Tu,targets:G(wu,["value"]),tooltip:{...Tu.tooltip,...oe.tooltip}},"linear-gauge":{...oe,...Nu,targets:G(Cu,["value"]),tooltip:{...Nu.tooltip,...oe.tooltip}}};function Vu(e,t){const i={};for(const s of Reflect.ownKeys(e))i[s]=t(e[s],s,e);return i}var M1=Vu(v1,function e(t,i){if((0,q.isSymbol)(i))return t;if((0,q.isFunction)(t))return(0,q.or)(t,q.themeOperator,q.isSymbol);if((0,q.isObject)(t))return(0,q.or)((0,q.optionsDefs)(q.unionSymbol in t?Vu(t,s=>(0,q.isObject)(s)?Vu(s,e):s):Vu(t,e)),q.themeOperator,q.isSymbol);throw new Error(`Invalid theme override value: ${String(t)}`)}),Xt={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},eo={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},S1=class extends ta{getDefaultColors(){return{fills:Xt,fillsFallback:Object.values(Xt),strokes:eo,sequentialColors:Ei(Xt),divergingColors:[Xt.ORANGE,Xt.YELLOW,Xt.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[Xt.GREEN,Xt.YELLOW,Xt.RED],secondHierarchyColors:[],up:{fill:Xt.GREEN,stroke:eo.GREEN},down:{fill:Xt.RED,stroke:eo.RED},neutral:{fill:Xt.GRAY,stroke:eo.GRAY},altUp:{fill:Xt.BLUE,stroke:eo.BLUE},altDown:{fill:Xt.ORANGE,stroke:eo.ORANGE},altNeutral:{fill:Xt.GRAY,stroke:eo.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,Xt.BLUE),e.set(Mt,Xt.BLUE),e}},qt={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},to={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},D1=class extends as{getDefaultColors(){return{...super.getDefaultColors(),fills:qt,fillsFallback:Object.values(qt),strokes:to,sequentialColors:Ei(qt),divergingColors:[qt.ORANGE,qt.YELLOW,qt.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[qt.GREEN,qt.YELLOW,qt.RED],secondHierarchyColors:[],up:{fill:qt.GREEN,stroke:to.GREEN},down:{fill:qt.RED,stroke:to.RED},neutral:{fill:qt.GRAY,stroke:to.GRAY},altUp:{fill:qt.BLUE,stroke:to.BLUE},altDown:{fill:qt.ORANGE,stroke:to.ORANGE},altNeutral:{fill:qt.GRAY,stroke:to.GRAY}}}getTemplateParameters(){const e=super.getTemplateParameters();return e.set(st,qt.BLUE),e.set(Mt,qt.BLUE),e}},Tf=Jt(()=>new as),I1=me.create(!0,"perf"),ds=(e,t,i)=>{I1("[CACHE] ChartTheme",e,t.name,i)},Of={"ag-default-dark":Jt(()=>new ta),"ag-sheets-dark":Jt(()=>new CO,ds),"ag-polychroma-dark":Jt(()=>new LO,ds),"ag-vivid-dark":Jt(()=>new S1,ds),"ag-material-dark":Jt(()=>new IO,ds),"ag-financial-dark":Jt(()=>new SO,ds),"ag-default":Tf,"ag-sheets":Jt(()=>new wO,ds),"ag-polychroma":Jt(()=>new kO,ds),"ag-vivid":Jt(()=>new D1,ds),"ag-material":Jt(()=>new AO,ds),"ag-financial":Jt(()=>new DO,ds)},Gu=Jt(A1,ds);function A1(e){if(e instanceof as)return e;if(!w1(e))return Tf();if(e==null||typeof e=="string"){const n=Of[e??"ag-default"];if(n)return n();throw new Error(`Cannot find theme \`${e}\`.`)}const{cleared:t,invalid:i}=(0,K.validate)(L1(e),k1,"theme");for(const n of i)K.Logger.warnOnce(String(n));const s=t?.baseTheme?Gu(t.baseTheme):Tf();return t?new s.constructor(t):s}function L1(e){if(!(0,K.isObject)(e)||!(0,K.isObject)(e.baseTheme))return e;let t=e,i,s;const n=[];for(;typeof t=="object";)i??(i=t.palette),s??(s=t.params),t.overrides&&n.push(t.overrides),t=t.baseTheme;return{baseTheme:t,overrides:Le(...n),params:s,palette:i}}var k1={baseTheme:(0,K.or)(K.string,K.object),overrides:M1,params:{accentColor:K.color,axisColor:K.color,backgroundColor:K.color,borderColor:K.color,borderRadius:K.number,chartBackgroundColor:K.color,chartPadding:K.number,focusShadow:K.string,foregroundColor:K.color,fontFamily:K.fontFamilyFull,fontSize:K.number,fontWeight:(0,K.or)(K.string,K.number),gridLineColor:K.color,popupShadow:K.string,subtleTextColor:K.color,textColor:K.color,chromeBackgroundColor:K.color,chromeFontFamily:K.fontFamilyFull,chromeFontSize:K.number,chromeFontWeight:(0,K.or)(K.string,K.number),chromeSubtleTextColor:K.color,chromeTextColor:K.color,buttonBackgroundColor:K.color,buttonBorder:K.boolean,buttonFontWeight:K.number,buttonTextColor:K.color,inputBackgroundColor:K.color,inputBorder:K.boolean,inputTextColor:K.color,menuBackgroundColor:K.color,menuBorder:K.boolean,menuTextColor:K.color,panelBackgroundColor:K.color,panelSubtleTextColor:K.color,tooltipBackgroundColor:K.color,tooltipBorder:K.boolean,tooltipTextColor:K.color,tooltipSubtleTextColor:K.color,crosshairLabelBackgroundColor:K.color,crosshairLabelTextColor:K.color},palette:{fills:(0,K.arrayOf)(K.colorUnion),strokes:(0,K.arrayOf)(K.color),up:{fill:(0,K.or)(K.color,K.gradientStrict),stroke:K.color},down:{fill:(0,K.or)(K.color,K.gradientStrict),stroke:K.color},neutral:{fill:(0,K.or)(K.color,K.gradientStrict),stroke:K.color}}},C1=(0,K.union)("ag-default","ag-default-dark","ag-sheets","ag-sheets-dark","ag-polychroma","ag-polychroma-dark","ag-vivid","ag-vivid-dark","ag-material","ag-material-dark","ag-financial","ag-financial-dark");function w1(e){const{invalid:t}=(0,K.validate)({theme:e},{theme:(0,K.or)(C1,K.object)});for(const i of t)K.Logger.warnOnce(String(i));return t.length===0}var tr={isEnterprise:!1},OS=yr((T(),N(w))),UR=(T(),N(w)),N1=yr((T(),N(w))),T1=yr((T(),N(w))),{isNumber:O1,isObjectLike:E1}=T1,zt="path",ps="pathArray",Ft="default",gs="override",io="user",lc="operation",cc="operationValue",Ef="dependency",Pf="autoEnable",ES="autoEnableValue";function hc(e,t){return typeof e=="string"&&t!=null&&(typeof t=="object"||Array.isArray(t))&&e in t}function Rf(e){return O1(e)&&e>=0&&e<=1}function fs(e,t){let i=e;for(const s of t){if(!(typeof s=="string"&&i!=null&&(typeof i=="object"||Array.isArray(i))&&s in i))return;i=i[s]}return i}function _f(e,t,i){const s=t.length;if(s===0)return;let n=e;const r=s-1,o=t[r];for(let a=0;a<r;a++){const l=t[a],c=t[a+1];let h=n[l];h==null?(h=isNaN(Number(c))?{}:[],n[l]=h):E1(h)||(h={},n[l]=h),n=h}n[o]=i}function PS(e){return e.findLastIndex(t=>!isNaN(Number(t)))}function uc(e){const t=PS(e);return Number(e[t])}function ya(e,t,i){const s=t.split("/");let n=[...e];t.startsWith("/")&&(n=[],s.shift());let r=!1;for(const o of s){if(o==="..")n.pop(),r||n.pop();else if(o===".")n.pop();else if(o==="$index"){const a=uc(e);if(isNaN(a))return pn;n.push(`${a}`)}else if(o==="$prevIndex"){const a=uc(e);if(isNaN(a)||Number(a)<=0)return pn;n.push(`${Number(a)-1}`)}else if(o.startsWith("$")){const a=i?.[o.slice(1)];if(a==null)return pn;n.push(a)}else o.length!==0&&n.push(o);r=o===".."}return n}var pn=Symbol("unresolvable-path"),ba=Symbol("resolved-to-branch"),{Logger:so,circularSliceArray:Fs,isArray:P1,isNumber:R1,isObjectLike:_1,isPlainObject:Hu,isString:xa}=N1;function va(e){if(e==null||typeof e!="object"||Array.isArray(e))return;const t=Object.getOwnPropertyNames(e);if(t.length===0)return;const i=t[0];if(CE.has(i))return{operation:i,values:Array.isArray(e[i])?e[i]:[e[i]]}}function j1(e,t,i){const s=va(e.getVertexValue(i));switch(s?.operation){case"$path":const[n]=s.values,r=e.getPathArray(t),o=ya(r,n);return o===pn?void 0:e.findVertexAtPath(o);case"$value":return t}}var z1={$hasSeriesType:{dependencies:jf,resolve:F1},$isChartType:{dependencies:jf,resolve:V1},$isSeriesType:{dependencies:jf,resolve:B1}};function jf(e,t,i){const s=e.findVertexAtPath(["series","0","type"]);s&&e.addEdge(t,s,Ef)}function F1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getResolvedPath(["series"]);if(!Array.isArray(r))return!1;for(const o of r)if(o.type===n)return!0;return!1}function B1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return e.getResolvedPath(["series","0","type"])===n}function V1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getResolvedPath(["series","0","type"]);if(typeof r!="string")return!1;switch(n){case"cartesian":return Ve.isCartesian(r);case"polar":return Ve.isPolar(r);case"standalone":return Ve.isStandalone(r)}return!1}var G1={$foregroundBackgroundMix:H1,$foregroundOpacity:U1,$interpolate:W1,$isGradient:$1,$isImage:Y1,$isPattern:K1,$mix:Z1};function H1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getParamValue("foregroundColor"),o=e.getParamValue("backgroundColor");if(typeof r=="string"&&typeof o=="string"&&Rf(n))return Be.mix(Be.fromString(r),Be.fromString(o),1-n).toString();me.inDevelopmentMode(()=>so.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function U1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s),r=e.getParamValue("foregroundColor");if(typeof r=="string"&&Rf(n)){const o=Be.fromString(r);return new Be(o.r,o.g,o.b,n).toString()}me.inDevelopmentMode(()=>so.warnOnce(`\`$foregroundOpacity\` json operation failed on [${String(n)}}}] at [${e.getPathArray(t).join(".")}], expecting a number between 0 and 1.`))}function W1(e,t,i){const[s,n]=i,r=e.resolveVertexValue(t,s),o=e.resolveVertexValue(t,n);if(!(!P1(r)||!R1(o)))return Be.interpolate(r.map(a=>Be.fromString(a)),o).map(a=>a.toString())}function $1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return ki(n)}function Y1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Sr(n)}function K1(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return Tn(n)}function Z1(e,t,i){const[s,n,r]=i,o=e.resolveVertexValue(t,s),a=e.resolveVertexValue(t,n),l=e.resolveVertexValue(t,r),c=e.getPathArray(t),h=`\`$mix\` json operation failed on [${String(o)}, ${String(a)}, ${String(l)}] at [${c.join(".")}], expecting`,u=`${h} two colors and a number between 0 and 1.`;if(typeof a!="string"||!Rf(l)){me.inDevelopmentMode(()=>so.warnOnce(u));return}if(typeof o=="string")try{return Be.mix(Be.fromString(o),Be.fromString(a),l).toString()}catch{me.inDevelopmentMode(()=>so.warnOnce(u));return}if(!ki(o)){me.inDevelopmentMode(()=>so.warnOnce(u));return}let d=o.colorStops;try{d=d?.map(p=>{let g;return typeof p.color=="string"&&(g=Be.mix(Be.fromString(p.color),Be.fromString(a),l).toString()),{...p,color:g}})}catch{me.inDevelopmentMode(()=>so.warnOnce(`${h} a gradient, a color and a number between 0 and 1.`));return}return{...o,colorStops:d}}var X1={$rem:q1};function q1(e,t,i){const[s]=i,n=e.getVertexValue(s),r=e.getParamValue("fontSize");if(typeof r=="number"&&typeof n=="number")return Math.round(n*r);me.inDevelopmentMode(()=>so.warnOnce(`\`$rem\` json operation failed on [${String(n)}] at [${e.getPathArray(t).join(".")}], expecting a number.`))}var Q1={$and:J1,$eq:eE,$greaterThan:tE,$if:iE,$lessThan:sE,$not:nE,$or:rE,$switch:oE};function J1(e,t,i){for(const s of i)if(!e.resolveVertexValue(t,s))return!1;return!0}function eE(e,t,i){let s,n=!0;for(const r of i){const o=e.resolveVertexValue(t,r);if(n)s=o,n=!1;else if(o!==s)return!1}return!0}function tE(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)>e.resolveVertexValue(t,n)}function iE(e,t,i){const[s,n,r]=i,a=e.resolveVertexValue(t,s)?n:r;for(const l of e.neighboursWithEdgeValue(a,zt))e.addEdge(t,l,zt);return e.resolveVertexValue(t,a)}function sE(e,t,i){const[s,n]=i;return e.resolveVertexValue(t,s)<e.resolveVertexValue(t,n)}function nE(e,t,i){for(const s of i)return!e.resolveVertexValue(t,s)}function rE(e,t,i){for(const s of i)if(e.resolveVertexValue(t,s))return!0;return!1}function oE(e,t,i){const[s,n,...r]=i,o=e.resolveVertexValue(t,s);for(const a of r){const l=e.getVertexValue(a);if(!Array.isArray(l))continue;const[c,h]=l;if(o===c||Array.isArray(c)&&c.includes(o))return h}return e.getVertexValue(n)}var aE={$isUserOption:{dependencies:zf,resolve:lE},$palette:cE,$mapPalette:hE,$path:{dependencies:zf,resolve:uE},$pathString:{dependencies:zf,resolve:dE},$ref:pE};function lE(e,t,i){const[s,n,r]=i,o=e.resolveVertexValue(t,s);if(!xa(o))throw new Error(`\`$path\` json operation failed on [${String(o)}], expecting a string.`);const a=e.getPathArray(t),l=ya(a,o);if(l===pn)return;const c=e.findVertexAtPath(l);return c&&e.findNeighbour(c,io)?e.resolveVertexValue(t,n):e.resolveVertexValue(t,r)}var RS=new Set(["fill","fillFallback","stroke","gradient","range2"]);function cE(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!xa(n))return;if(RS.has(n)){const o=e.getPathArray(t),a=uc(o);if(isNaN(a))return;switch(n){case"fill":return Fs(e.palette.fills,1,a)[0];case"fillFallback":return Fs(e.palette.fillsFallback,1,a)[0];case"stroke":return Fs(e.palette.strokes,1,a)[0];case"gradient":return Fs(e.palette.sequentialColors,1,a)[0];case"range2":return Fs(e.palette.fills,2,a)}return}if(n==="gradients")return e.palette.sequentialColors;const r=fs(e.palette,n.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function hE(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);if(!xa(n))return;if(RS.has(n)){const o=e.getPathArray(t);let a=uc(o),l=0;const c=["series","0","type"];for(let h=0;h<a;h++){c[1]=`${h}`;const u=e.getResolvedPath(c);(u==="map-shape-background"||u==="map-line-background")&&l++}if(a-=l,isNaN(a))return;switch(n){case"fill":return Fs(e.palette.fills,1,a)[0];case"fillFallback":return Fs(e.palette.fillsFallback,1,a)[0];case"stroke":return Fs(e.palette.strokes,1,a)[0];case"gradient":return Fs(e.palette.sequentialColors,1,a)[0];case"range2":return Fs(e.palette.fills,2,a)}return}if(n==="gradients")return e.palette.sequentialColors;const r=fs(e.palette,n.split("."));return Array.isArray(r)?[...r]:typeof r=="object"?{...r}:r}function zf(e,t,i){const[s]=i,n=e.getVertexValue(s);if(xa(n)){const r=e.getPathArray(t),o=ya(r,n);if(o===pn)return;const a=e.findVertexAtPath(o);a&&e.addEdge(t,a,Ef)}}function uE(e,t,i){const s=i.length>1,n=i.length>2,[r,o,a]=i,l=e.resolveVertexValue(t,r),c=n?e.resolveVertexValue(t,a):null;if(!xa(l))throw new Error(`\`$path\` json operation failed on [${String(l)}], expecting a string.`);const h=e.getPathArray(t),u=ya(h,l);if(u===pn)return;const d=c?fs(c,u):e.getResolvedPath(u);if(d!=null)return d;if(s)return e.resolveVertexValue(t,o)}function dE(e,t,i){const[s,n]=i,r=e.resolveVertexValue(t,s);if(!xa(r))throw new Error(`\`$path\` json operation failed on [${String(r)}], expecting a string.`);let o;n&&(o=e.graftAndResolveOrphan(t,n));const a=e.getPathArray(t),l=ya(a,r,o);if(l===pn)throw new Error(`Unresolvable path [${r}] at [${a.join(".")}]`);return l}function pE(e,t,i){const[s]=i,n=e.getVertexValue(s);return e.getParamValue(n)}var gE={$apply:fE,$applyTheme:mE,$findFirstSiblingNotOperation:yE,$map:bE,$merge:xE,$omit:vE,$size:ME,$shallow:SE,$value:DE};function fE(e,t,i){const[s,n,r,o]=i,a=e.getVertexValue(s);if(!Hu(a))return;const l=n?e.getVertexValue(n):void 0,c=e.neighboursWithEdgeValue(t,zt),h=r?e.resolveVertexValue(t,r):void 0,u=o?e.resolveVertexValue(t,o):void 0;if(c.length===0&&l!=null)if(va(l)){const d=e.resolveVertexValue(t,n);Hu(d)&&e.graftObject(t,d,[h,u])}else e.graftObject(t,l,[h,u]);for(const d of c)if(e.neighboursWithEdgeValue(d,zt).length===0){const p=e.addVertex({});e.addEdge(d,p,Ft)}else e.graftObject(d,a,[h,u]);return ba}function mE(e,t,i){const[s,n,r]=i;let o=e.getVertexValue(s);if(typeof o=="string"&&(o=[o]),!Array.isArray(o))return;const a=e.neighboursWithEdgeValue(t,zt),l=r?e.getVertexValue(r):[],c=Array.isArray(l)?new Set(l):new Set;for(const h of a){const u=e.graftAndResolveOrphan(h,n);for(const d of o){const p=ya([],d,u);p!==pn&&e.graftConfig(h,p,c)}}return ba}function yE(e,t,i){const[s]=i,n=e.getPathArray(t),r=PS(n);if(r<0)return e.resolveVertexValue(t,s);const o=n.slice(0,r),a=e.findVertexAtPath(o);if(!a)return e.resolveVertexValue(t,s);const l=e.neighboursWithEdgeValue(a,zt);for(let c=0;c<l.length;c++){if(`${c}`===n[r])continue;const h=o.concat([`${c}`,...n.slice(r+1)]),u=e.findVertexAtPath(h);if(!u)continue;const d=e.findNeighbourValue(u,io);if(d!=null)return d;const p=e.findNeighbourValue(u,gs);if(p!=null)return p}return e.resolveVertexValue(t,s)}function bE(e,t,i){const[s,n]=i,r=e.getVertexValue(s),o=e.resolveVertexValue(t,n);if(!Array.isArray(o))return;if(!va(r))return o.map(()=>r);let a=0;for(const l of o)e.graftValue(t,`${a}`,r,l),a++;return ba}function xE(e,t,i){for(const s of i){const n=e.resolveVertexValue(t,s);Hu(n)&&e.graftObject(t,n)}return ba}function vE(e,t,i){const[s,n]=i;let r=e.getVertexValue(s);if(!Array.isArray(r)){const a=j1(e,t,n);if(!a)return;r=e.resolveVertexValue(a,s)}const o=e.resolveVertexValue(t,n);if(!(!Array.isArray(r)||!Hu(o)))return G(o,r)}function ME(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return _1(n)?Object.keys(n).length:0}function SE(e,t,i){const s=[];for(const n of i)s.push(e.getVertexValue(n));return s}function DE(e,t,i){const[s]=i,n=e.getVertexValue(s),r=e.getPathArray(t);if(n==="$index")return uc(r);if(n==="$1")return e.resolveValue$1(r)}var IE={$isEven:AE,$mul:LE,$round:kE};function AE(e,t,i){const[s]=i,n=e.resolveVertexValue(t,s);return isNaN(Number(n))?!1:Number(n)%2===0}function LE(e,t,i){let s;for(const n of i){const r=e.resolveVertexValue(t,n);s==null?s=Number(r):s*=Number(r)}return s}function kE(e,t,i){for(const s of i)return Math.round(Number(e.resolveVertexValue(t,s)))}var Bs={...z1,...G1,...X1,...aE,...Q1,...IE,...gE},CE=new Set(Object.keys(Bs)),{isObject:wE,isObjectLike:_S,isPlainObject:Uu}=OS,NE=Jt(TE);function TE(e,t){return new jS(e.config,t,e.params,e.palette,e.overrides,e.getTemplateParameters())}var dc=class vs extends OS.AdjacencyListGraph{constructor(t={},i={},s={},n={},r={},o=new Map){super(zt,lc),this.resolvedParams={},this.resolvedAnnotations={},this.value$1={},this.cachedPathVertices=new Map,this.EMPTY_PATH_ARRAY_VERTEX=this.addVertex([]),this.root=this.addVertex("root"),this.params=this.addVertex("params"),this.annotations=this.addVertex("annotations"),this.config=t,this.overrides=r,this.internalParams=o,this.palette=Qe(n),this.palette.type=wE(i?.theme)?qv(i.theme?.palette):"inbuilt";const a="line",l=i.series?.[0]?.type??a,c=ss.cloneDefaultAxes(l);i.axes??(i.axes=c?.axes??[]),this.buildGraphFromObject(this.root,io,G(i,["theme"])),this.buildGraphFromObject(this.root,Ft,G(t[l],vs.COMPLEX_KEYS));const h=r?G(r[l],vs.COMPLEX_KEYS):{};Object.keys(h).length>0&&this.buildGraphFromObject(this.root,gs,h);const u=r?G(r.common,vs.COMPLEX_KEYS):{};Object.keys(u).length>0&&this.buildGraphFromObject(this.root,gs,Ve.isCartesian(l)?u:G(u,["zoom","navigator"])),this.buildGraphFromObject(this.params,Ft,s);const d=this.findNeighbourWithValue(this.root,"axes",zt),p=this.findNeighbourWithValue(this.root,"series",zt);d&&this.buildGraphFromObject(d,Ft,{$applyTheme:[["/$seriesType/axes/$axisType/$position","/$seriesType/axes/$axisType"],{seriesType:{$path:["/series/0/type","line"]},axisType:{$path:["./type","category"]},position:{$path:["./position"]}},["top","right","bottom","left"]]}),p&&this.buildGraphFromObject(p,Ft,{$applyTheme:["/$seriesType/series",{seriesType:{$path:["./type","line"]}}]});const g=G(t[l]?.annotations??{},vs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(g).length>0&&this.buildGraphFromObject(this.annotations,Ft,g);const y=G(r?.common?.annotations??{},vs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(y).length>0&&this.buildGraphFromObject(this.annotations,gs,y);const b=ap(t[l]?.annotations??{},vs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(b).length>0&&this.buildGraphFromObject(this.root,Ft,{annotations:b});const m=ap(r?.common?.annotations??{},vs.ANNOTATIONS_OPTIONS_KEYS);Object.keys(m).length>0&&this.buildGraphFromObject(this.root,gs,{annotations:m}),this.buildDependencyGraph()}clear(){super.clear(),this.cachedPathVertices.clear()}resolve(){return this.resolved={},this.resolvedParams={},this.resolvedAnnotations={},this.resolveVertex(this.params,this.resolvedParams),this.resolveVertex(this.annotations,this.resolvedAnnotations),this.resolveVertex(this.root),this.resolved}resolveParams(){return this.resolvedParams}resolveAnnotationThemes(){return this.resolvedAnnotations}findVertexAtPath(t){const i=t.join(".");if(this.cachedPathVertices.has(i))return this.cachedPathVertices.get(i);const s=this.findVertexAlongEdge(this.root,t,zt);if(s)return this.cachedPathVertices.set(i,s),s}getParamValue(t){if(this.resolvedParams[t]!=null)return this.resolvedParams[t];const i=this.findVertexAlongEdge(this.params,[t],zt);if(!i)return;const s=this.findNeighbour(i,Ft);if(!s)return;const n=this.resolveVertexValue(i,s);return this.resolvedParams[t]=n,n}getPathArray(t){return this.findNeighbourValue(t,ps)??[]}getResolvedPath(t){return fs(this.resolved,t)}resolveVertexValue(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,lc);if(s&&hc(s,Bs)){const r=this.neighboursWithEdgeValue(i,cc),o=Bs[s],l=(typeof o=="function"?o:o.resolve)?.(this,t,r);return l===ba?void 0:l}let n=this.getVertexValue(i);if(Array.isArray(n)){const r={};this.resolveVertexChildren(i,r),n=fs(r,this.getPathArray(t))}return this.resolveValueOrSymbol(n)}resolveValue$1(t){return fs(this.value$1,t)}graftConfig(t,i,s){const n=fs(this.config,i),r=this.findNeighbour(t,ps);if(Uu(n)&&this.buildGraphFromObject(t,Ft,n,r,void 0,s),this.overrides){const o=fs(this.overrides,i);Uu(o)&&this.buildGraphFromObject(t,gs,o,r,void 0,s);const a=fs(this.overrides,["common",...i.slice(1)]);Uu(a)&&this.buildGraphFromObject(t,gs,a,r,void 0,s)}this.buildDependencyGraph()}graftObject(t,i,s){const n=this.findNeighbour(t,ps);if(this.buildGraphFromObject(t,Ft,i,n),this.overrides&&s)for(const r of s){if(r==null)continue;const o=fs(this.overrides,r);o&&this.buildGraphFromObject(t,gs,o,n)}this.buildDependencyGraph()}graftValue(t,i,s,n){const r=[...this.getPathArray(t),i];_f(this.value$1,r,n);const o=this.findVertexAtPath(r)??this.addVertex(i);this.buildGraphFromValue(t,o,Ft,r,s),this.buildDependencyGraph()}graftAndResolveOrphan(t,i){const s={},n=this.addVertex(s),r=this.getPathArray(t);return this.graftAndResolveChildren(i,n,r,[]),this.resolveVertex(n,s),fs(s,r)}buildGraphFromObject(t,i,s,n,r=vs.SHALLOW_KEYS,o){const a=va(s);if(a){const u=this.addVertex(s);this.addEdge(t,u,i),this.buildGraphFromOperation(u,i,a,n);return}if(Object.keys(s).length===0){this.addEdge(t,this.addVertex(Array.isArray(s)?[]:{}),i),this.buildGraphAutoEnable(t,i,s,void 0);return}const l=this.getVertexChildrenByKey(t),c=n?this.getVertexValue(n):[];let h;for(const u of Object.keys(s)){if(o?.has(u))continue;const d=l.get(u)??this.addVertex(u),p=[...c,u];r?.has(u)?this.buildShallowGraphFromValue(t,d,i,p,s[u]):this.buildGraphFromValue(t,d,i,p,s[u],r),u==="enabled"&&(h=d)}this.buildGraphAutoEnable(t,i,s,h)}buildGraphAutoEnable(t,i,s,n){if(i===Ft&&!n||i===io&&n||i!==Ft&&i!==io&&i!==gs)return;let r=this.findNeighbour(t,Pf);r||(r=this.addVertex(Pf),this.addEdge(t,r,Pf)),n&&this.addEdge(n,r,ES);const{enabled:o,_enabledFromTheme:a}=s;this.addEdge(r,this.addVertex({enabled:o,_enabledFromTheme:a,keys:Object.keys(s).length}),i)}getVertexChildrenByKey(t){const i=this.neighboursWithEdgeValue(t,zt),s=new Map;for(const n of i)s.set(this.getVertexValue(n),n);return s}buildGraphFromValue(t,i,s,n,r,o){this.addEdge(t,i,zt);let a=this.findNeighbour(i,ps);a||(a=this.addVertex(n),this.addEdge(i,a,ps));const l=va(r);if(l){const c=this.addVertex(r);this.addEdge(i,c,s),this.addEdge(c,a,ps),this.buildGraphFromOperation(c,s,l,a)}else if(_S(r))this.buildGraphFromObject(i,s,r,a,o);else{const c=this.addVertex(r);this.addEdge(i,c,s)}}buildShallowGraphFromValue(t,i,s,n,r){this.addEdge(t,i,zt);let o=this.findNeighbour(i,ps);o||(o=this.addVertex(n),this.addEdge(i,o,ps));const a=this.addVertex(r);this.addEdge(i,a,s)}buildGraphFromOperation(t,i,s,n){const r=this.addVertex(s.operation);this.addEdge(t,r,lc);for(const o of s.values)this.buildGraphFromOperationValue(t,o,i,n)}buildGraphFromOperationValue(t,i,s,n=this.EMPTY_PATH_ARRAY_VERTEX){const r=this.addVertex(i);this.addEdge(t,n,ps),this.addEdge(t,r,cc);const o=va(i);o?this.buildGraphFromOperation(r,s,o,n):_S(i)&&this.buildGraphFromObject(r,s,i,n)}buildDependencyGraph(){for(const[t,i]of this.pendingProcessingEdges){const s=this.getVertexValue(i);if(!hc(s,Bs))continue;const n=this.neighboursWithEdgeValue(t,cc),r=Bs[s];(typeof r=="function"?void 0:r.dependencies)?.(this,t,n)}this.pendingProcessingEdges=[]}resolveVertex(t,i=this.resolved){const s=this.getPathArray(t);this.resolveVertexInEdgePriority(t,i,s),this.resolveVertexAutoEnable(t,i,s),this.resolveVertexChildren(t,i)}resolveVertexInEdgePriority(t,i,s){const n=this.neighboursWithEdgeValue(t,zt),[r]=vs.EDGE_PRIORITY;for(const o of vs.EDGE_PRIORITY){const a=this.findNeighbour(t,o);if(a==null)continue;const l=this.resolveVertexValueInternal(t,a);if(!(l==null&&o!==r)&&!(n.length>0&&Array.isArray(l)&&o!==r)){if(s.length===0){if(l==null)continue;this.resolved=l}else _f(i,s,l);break}}}resolveVertexValueInternal(t,i){this.resolveVertexDependencies(i);const s=this.findNeighbourValue(i,lc);if(s&&hc(s,Bs)){const n=this.neighboursWithEdgeValue(i,cc),r=Bs[s],a=(typeof r=="function"?r:r.resolve)?.(this,t,n);return a===ba?void 0:a}return this.resolveValueOrSymbol(this.getVertexValue(i))}resolveVertexAutoEnable(t,i,s){const[n]=this.neighboursWithEdgeValue(t,ES);if(!n)return;const r=this.findNeighbourValue(n,Ft),o=this.findNeighbourValue(n,gs),a=this.findNeighbourValue(n,io);a&&a.enabled==null&&!r?._enabledFromTheme&&!o?._enabledFromTheme&&_f(i,s,!0)}resolveVertexChildren(t,i){const s=this.neighboursWithEdgeValue(t,zt);for(const n of s){const r=this.getVertexValue(n);s.length>1&&hc(r,Bs)||r!=="_enabledFromTheme"&&this.resolveVertex(n,i)}}resolveVertexDependencies(t){const i=this.neighboursWithEdgeValue(t,Ef);for(const s of i)this.resolveVertex(s)}graftAndResolveChildren(t,i,s,n){for(const r of this.neighboursWithEdgeValue(t,zt)){const o=this.getVertexValue(r),a=[...s,o],l=[...n,o],c=this.addVertex(o),h=this.findNeighbourValue(r,Ft);this.addEdge(i,c,zt);const u=this.addVertex(a);if(this.addEdge(c,u,ps),Uu(h)){this.buildGraphFromObject(c,Ft,h,u);const d=this.findNeighbour(c,Ft);this.addEdge(d,this.addVertex(a),ps);const p=this.findNeighbourValue(d,lc);if(hc(p,Bs)){const g=this.neighboursWithEdgeValue(d,cc),y=Bs[p];(typeof y=="function"?void 0:y.dependencies)?.(this,d,g)}}this.graftAndResolveChildren(r,c,a,l)}}resolveValueOrSymbol(t){return typeof t=="symbol"&&this.internalParams?.has(t)?this.internalParams.get(t):t}};dc.EDGE_PRIORITY=[io,gs,Ft],dc.SHALLOW_KEYS=new Set(["context","data","topology"]),dc.COMPLEX_KEYS=["annotations","axes","series"],dc.ANNOTATIONS_OPTIONS_KEYS=["axesButtons","data","enabled","optionsToolbar","snap","toolbar","xKey","volumeKey"];var jS=dc,zS=e=>`'${e}'`,no=class Gt{constructor(t,i,s,n,r,o,a=!1){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=s??{};let l=null;t instanceof Gt?(l=t,this.specialOverrides=l.specialOverrides,o===void 0&&(o=Is(l.userOptions,i,Gt.JSON_DIFF_OPTS)),this.userOptions=Qe($a(o,l.userOptions),{...Gt.OPTIONS_CLONE_OPTS_SLOW,seen:[]})):(this.userOptions=Qe(t??i,{...Gt.OPTIONS_CLONE_OPTS_SLOW,seen:[]}),this.specialOverrides=this.specialOverridesDefaults({...n})),a&&this.removeLeftoverSymbols(this.userOptions);let c,h,u,d,p,g;!a&&o!==void 0&&Gt.isFastPathDelta(o)&&l!=null?({activeTheme:c,processedOptions:h,fastDelta:u}=this.fastSetup(o,l),d=l.themeParameters,p=l.annotationThemes):(Gt.perfDebug("ChartOptions.slowSetup()"),{activeTheme:c,processedOptions:h,themeParameters:d,annotationThemes:p,googleFonts:g}=this.slowSetup(s,o,a)),this.activeTheme=c,this.processedOptions=h,this.fastDelta=u??void 0,this.themeParameters=d,this.annotationThemes=p,this.googleFonts=g,me.inDevelopmentMode(()=>Us(this))}static isFastPathDelta(t){for(const i of Object.keys(t??{}))if(!this.FAST_PATH_OPTIONS.has(i))return Gt.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return Gt.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(t,i){const{activeTheme:s,processedOptions:n}=i,{presetType:r}=this.optionMetadata;if(r!=null&&t?.data!=null){const a=ge.ModuleRegistry.getPresetModule(r);if(a?.processData){const{series:l,data:c}=a.processData(t.data);t=Le({series:l,data:c},t)}}this.fastSeriesSetup(t,n);const o=Le(t,n);return Gt.debug("ChartOptions.fastSetup() - processed options",o),{activeTheme:s,processedOptions:o,fastDelta:t}}fastSeriesSetup(t,i){t?.series&&(t.series?.every((s,n)=>t0(s,i.series?.[n]??{}))?delete t.series:t.series=t.series.map((s,n)=>$a(s,i.series?.[n]??{})))}slowSetup(t,i,s=!1){let n=Qe(this.userOptions,Gt.OPTIONS_CLONE_OPTS_FAST);i&&(n=Le(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:r}=this.optionMetadata;if(r!=null){const p=ge.ModuleRegistry.getPresetModule(r);if(p){const{validate:g=ge.validate}=p,y=n,b=n.type,m=b!=null?Gu(n.theme).presets[b]:void 0,{cleared:v,invalid:S}=g(y,p.options,"");S.forEach(M=>ge.Logger.warn(M)),(0,ge.hasRequiredInPath)(S,"")?n={}:(Gt.debug(">>> AgCharts.createOrUpdate() - applying preset",v),n=p.create(v,m,()=>this.activeTheme))}}this.soloSeriesIntegrity(n),tr.isEnterprise||Zv(n);const o=Gu(n.theme);if(r!=null&&o.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=ge.ModuleRegistry.detectChartDefinition(n),!this.chartDef.placeholder){const{validate:p=ge.validate}=this.chartDef,{cleared:g,invalid:y}=p(n,this.chartDef.options,"");y.forEach(b=>ge.Logger.warn(b)),n=g}this.validateAxesOptions(n),this.removeDisabledOptions(n);let a=this.processFonts(o.params);a=this.processFonts(n,a),this.processSeriesOptions(n);const l=NE(o,n),c=l.resolve(),h=l.resolveParams(),u=l.resolveAnnotationThemes();l.clear();const d=Le(t,c);return mO(d),tr.isEnterprise||Zv(d,!0),this.validateSeriesOptions(d),this.validateAxesOptions(d),this.validatePluginOptions(d),this.processMiniChartSeriesOptions(d),d.loadGoogleFonts||a.clear(),Gt.debug(()=>["ChartOptions.slowSetup() - processed options",Qe(d)]),{activeTheme:o,processedOptions:d,themeParameters:h,annotationThemes:u,googleFonts:a}}validatePluginOptions(t){for(const i of ge.ModuleRegistry.listModulesByType(ge.ModuleType.Plugin)){const s=i.name;if(s in t&&(!i.chartType||i.chartType===this.chartDef?.name)){const{cleared:n,invalid:r}=(0,ge.validate)(t[s],i.options,i.name);r.forEach(o=>ge.Logger.warn(o)),t[s]=n}}}validateSeriesOptions(t){const i=this.chartDef?.name,s=[],n=t.series?.length??0;let r;for(let o=0;o<n;o++){const a=`series[${o}]`,l=t.series[o],c=ge.ModuleRegistry.getSeriesModule(l.type);if(c==null){r??(r=(0,ge.joinFormatted)(Array.from(ge.ModuleRegistry.listModulesByType(ge.ModuleType.Series)).filter(p=>!i||p.chartType===i).map(p=>p.name),"or",zS)),ge.Logger.warn(l.type==null?`Option \`${a}.type\` is required and has not been provided; expecting ${r}, ignoring.`:`Unknown type \`${l.type}\` at \`${a}.type\`; expecting ${r}, ignoring.`);continue}else if(i&&c.chartType!==i){ge.Logger.warn(`Series type \`${c.name}\` at \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}const{validate:h=ge.validate}=c,{cleared:u,invalid:d}=h(l,c.options,a);d.forEach(p=>ge.Logger.warn(p)),(0,ge.hasRequiredInPath)(d,a)||s.push(u)}t.series=s}validateAxesOptions(t){if(!("axes"in t)||!t.axes)return;const i=this.chartDef?.name,s=[],n=t.axes.length??0;let r;for(let o=0;o<n;o++){const a=`axes[${o}]`,l=t.axes[o],c=ge.ModuleRegistry.getAxisModule(l.type);if(c==null){r??(r=(0,ge.joinFormatted)(Array.from(ge.ModuleRegistry.listModulesByType(ge.ModuleType.Axis)).filter(p=>p.chartType===i).map(p=>p.name),"or",zS)),ge.Logger.warn(`Unknown type \`${l.type}\` at  \`${a}.type\`; expecting one of ${r}, ignoring all axes options.`),delete t.axes;break}else if(c.chartType!==i){ge.Logger.warn(`Axis type \`${c.name}\` at  \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);break}const{validate:h=ge.validate}=c,{cleared:u,invalid:d}=h(l,c.options,a);d.forEach(p=>ge.Logger.warn(p)),(0,ge.hasRequiredInPath)(d,a)||s.push(u)}t.axes=s}diffOptions(t){return this===t?{}:t==null?this.processedOptions:this.fastDelta??Is(t.processedOptions,this.processedOptions,Gt.JSON_DIFF_OPTS)}optionsType(t){return t.series?.[0]?.type??"line"}processSeriesOptions(t){const i=t.series?.map(s=>{s.type??(s.type="line");const r=!!ge.ModuleRegistry.getSeriesModule(s.type)?.options.visible;return Le(this.getSeriesGroupingOptions(s),s,r&&{visible:!0})});t.series=this.setSeriesGroupingOptions(i??[])}processMiniChartSeriesOptions(t){const i=t.navigator?.miniChart?.series;i!=null&&(t.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getSeriesGroupingOptions(t){const i=ss.isGroupable(t.type),s=ss.isStackable(t.type),n=ss.isStackedByDefault(t.type);t.grouped&&!i&&ge.Logger.warnOnce(`unsupported grouping of series type "${t.type}".`),(t.stacked||t.stackGroup)&&!s&&ge.Logger.warnOnce(`unsupported stacking of series type "${t.type}".`);let{grouped:r,stacked:o}=t;return o??(o=(n||t.stackGroup!=null)&&!(i&&r)),r??(r=!0),{stacked:s&&o,grouped:i&&r&&!(s&&o)}}setSeriesGroupingOptions(t){const i=this.getSeriesGrouping(t);Gt.debug("ChartOptions.setSeriesGroupingOptions() - series grouping: ",i);const s={},n=i.reduce((r,o)=>{var a;return o.groupType==="default"||(r[a=o.seriesType]??(r[a]=0),r[o.seriesType]+=o.groupType==="stack"?1:o.series.length),r},{});return i.flatMap(r=>{var o;switch(s[o=r.seriesType]??(s[o]=0),r.groupType){case"stack":{const a=s[r.seriesType]++;return r.series.map((l,c)=>Object.assign(l,{seriesGrouping:{groupId:r.groupId,groupIndex:a,groupCount:n[r.seriesType],stackIndex:c,stackCount:r.series.length}}))}case"group":return r.series.map(a=>Object.assign(a,{seriesGrouping:{groupId:r.groupId,groupIndex:s[r.seriesType]++,groupCount:n[r.seriesType],stackIndex:0,stackCount:0}}))}return r.series}).map(({stacked:r,grouped:o,...a})=>a)}getSeriesGroupId(t){return[t.type,t.xKey,t.stacked?t.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(t){const i=new Map;return t.reduce((s,n)=>{const r=n.type;if(!n.stacked&&!n.grouped)s.push({groupType:"default",seriesType:r,series:[n],groupId:"__default__"});else{const o=this.getSeriesGroupId(n);if(!i.has(o)){const l={groupType:n.stacked?"stack":"group",seriesType:r,series:[],groupId:o};i.set(o,l),s.push(l)}i.get(o).series.push(n)}return s},[])}soloSeriesIntegrity(t){if(!(0,ge.isArray)(t.series))return;const i=t.series;if(i&&i.length>1&&i.some(s=>ss.isSolo(s.type))){const s=this.optionsType(t);if(ss.isSolo(s))ge.Logger.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),t.series=i.slice(0,1);else{const{solo:n,nonSolo:r}=(0,ge.groupBy)(i,a=>ss.isSolo(a.type)?"solo":"nonSolo"),o=(0,ge.unique)(n.map(a=>a.type)).join(", ");ge.Logger.warn(`Unable to mix these series types with the lead series type: ${o}`),t.series=r}}}static processFontOptions(t,i,s,n=new Set){if(typeof t=="object"&&"fontFamily"in t)if(Array.isArray(t.fontFamily)){const r=[];for(const o of t.fontFamily)typeof o=="object"&&"googleFont"in o?(r.push(o.googleFont),n?.add(o.googleFont)):r.push(o);t.fontFamily=r.join(", ")}else typeof t.fontFamily=="object"&&"googleFont"in t.fontFamily&&(t.fontFamily=t.fontFamily.googleFont,n?.add(t.fontFamily));return n}processFonts(t,i=new Set){return En(t,Gt.processFontOptions,new Set(["data","theme"]),void 0,void 0,i)}static removeDisabledOptionJson(t){"enabled"in t&&t.enabled===!1&&Object.keys(t).forEach(i=>{i!=="enabled"&&delete t[i]})}removeDisabledOptions(t){En(t,Gt.removeDisabledOptionJson,new Set(["data","theme","contextMenu"]))}static removeLeftoverSymbolsJson(t){if(!(!t||!(0,ge.isObject)(t)))for(const i of Object.keys(t)){const s=t[i];(0,ge.isSymbol)(s)&&delete t[i]}}removeLeftoverSymbols(t){En(t,Gt.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(t){if(t.window==null?t.window=(0,ge.getWindow)():(0,ge.setWindow)(t.window),t.document==null?t.document=(0,ge.getDocument)():(0,ge.setDocument)(t.document),t.window==null)throw new Error("AG Charts - unable to resolve global window");if(t.document==null)throw new Error("AG Charts - unable to resolve global document");return t}};no.OPTIONS_CLONE_OPTS_SLOW={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},no.OPTIONS_CLONE_OPTS_FAST={shallow:new Set(["container"]),assign:new Set(["data","context","theme"])},no.JSON_DIFF_OPTS=new Set(["data"]),no.perfDebug=me.create(!0,"perf"),no.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),no.debug=me.create(!0,"opts");var pc=no,FS=me.create(!0,"opts"),ro="AG Charts - Chart was destroyed, cannot perform request.",gc=class{constructor(t,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=t}async update(t){if(!this.chart)throw new Error(ro);return FS.group("AgChartInstance.update()",async()=>{this.factoryApi.update(t,this),await this.chart?.waitForUpdate()})}async updateDelta(t){if(!this.chart)throw new Error(ro);return FS.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,t),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(ro);const t=Qe(this.chart.getOptions(),pc.OPTIONS_CLONE_OPTS_FAST);for(const i of Object.keys(t))i.startsWith("_")&&delete t[i];return t}waitForUpdate(){if(!this.chart)throw new Error(ro);return this.chart.waitForUpdate()}async download(t){if(!this.chart)throw new Error(ro);const i=await this.prepareResizedChart(this,this.chart,t);try{i.chart?.download(t?.fileName,t?.fileFormat)}finally{i.destroy()}}async __toSVG(t){if(!this.chart)throw new Error(ro);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...t});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(t){if(!this.chart)throw new Error(ro);const i=await this.prepareResizedChart(this,this.chart,t);try{return i.chart.getCanvasDataURL(t?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(t){const{chart:i}=this;if(!i)return;const s=this.getEnabledOriginators();if(!s.includes(i.ctx.legendManager)){await this.setStateOriginators(t,s);return}await this.setStateOriginators(t,s.filter(n=>n!==i.ctx.zoomManager)),await this.setStateOriginators(t,[i.ctx.zoomManager])}resetAnimations(){this.chart?.resetAnimations()}skipAnimations(){this.chart?.skipAnimations()}destroy(){this.releaseChart?(this.releaseChart(),this.releaseChart=void 0):this.chart&&(this.chart.publicApi=void 0,this.chart.destroy()),this.chart=void 0}async prepareResizedChart(t,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,r=s.height??i.height??i.ctx.scene.canvas.height,o=t.getState(),a=Ds.hasEnterpriseModules(),l={...i.chartOptions.processedOverrides,container:document.createElement("div"),width:n,height:r};s.width!=null&&s.height!=null&&(l.overrideDevicePixelRatio=1);const c=i.getOptions();a&&(l.animation={enabled:!1},this.licenseManager?.isDisplayWatermark()&&(l.foreground={text:this.licenseManager.getWatermarkMessage(),image:{url:"data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iMjU4IiBoZWlnaHQ9IjQwIiB2aWV3Qm94PSIwIDAgMjU4IDQwIiBmaWxsPSJub25lIiB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciPgo8cGF0aCBkPSJNMjUuNzc5IDI4LjY1N0gxMy4zNTlMMTEuMTczIDM0LjAxMkg1LjY3Mjk3TDE3LjE4MiA3LjA1OTk5SDIxLjk1M0wzMy40NjIgMzQuMDEySDI3Ljk2MkwyNS43NzYgMjguNjU3SDI1Ljc3OVpNMjQuMDY4IDI0LjM5N0wxOS41ODggMTMuNDM0TDE1LjEwNyAyNC4zOTdIMjQuMDY4Wk02Mi4wOTIgMTguODIzSDQ5LjgxN1YyMy4wODZINTYuNzc1QzU2LjU1NSAyNS4yMjIgNTUuNzU1IDI2LjkyNyA1NC4zNzIgMjguMjAyQzUyLjk4OSAyOS40NzYgNTEuMTY2IDMwLjExNSA0OC45MDkgMzAuMTE1QzQ3LjYyMiAzMC4xMTUgNDYuNDUgMjkuODg1IDQ1LjM5MyAyOS40MjNDNDQuMzU4MyAyOC45NzgxIDQzLjQzMjYgMjguMzEzOCA0Mi42OCAyNy40NzZDNDEuOTI3IDI2LjYzOSA0MS4zNDQgMjUuNjMxIDQwLjkzMSAyNC40NTNDNDAuNTE5IDIzLjI3NSA0MC4zMTEgMjEuOTcgNDAuMzExIDIwLjUzN0M0MC4zMTEgMTkuMTA1IDQwLjUxNiAxNy44IDQwLjkzMSAxNi42MjFDNDEuMzQ0IDE1LjQ0MyA0MS45MjcgMTQuNDM2IDQyLjY4IDEzLjU5OEM0My40Mzc2IDEyLjc1NzcgNDQuMzY5NiAxMi4wOTMyIDQ1LjQxMSAxMS42NTFDNDYuNDc4IDExLjE4OSA0Ny42NTYgMTAuOTYgNDguOTQ2IDEwLjk2QzUxLjYxMiAxMC45NiA1My42MzcgMTEuNjAyIDU1LjAyIDEyLjg4NUw1OC4zIDkuNjA0OTlDNTUuODE3IDcuNjY5OTkgNTIuNjc2IDYuNjk5OTkgNDguODcyIDYuNjk5OTlDNDYuNzYgNi42OTk5OSA0NC44NTMgNy4wMzQ5OSA0My4xNTQgNy43MDA5OUM0MS40NTUgOC4zNjc5OSAzOS45OTggOS4zMDM5OSAzOC43ODMgMTAuNTA0QzM3LjU2NyAxMS43MDcgMzYuNjM0IDEzLjE1OCAzNS45NzcgMTQuODU3QzM1LjMxOSAxNi41NTYgMzQuOTk0IDE4LjQ1MSAzNC45OTQgMjAuNTRDMzQuOTk0IDIyLjYzIDM1LjMyOSAyNC40OTQgMzUuOTk1IDI2LjIwNUMzNi42NjIgMjcuOTE2IDM3LjYwNSAyOS4zNzQgMzguODE3IDMwLjU3N0M0MC4wMzIgMzEuNzggNDEuNDg2IDMyLjcxMyA0My4xODggMzMuMzgzQzQ0Ljg4OCAzNC4wNDkgNDYuNzgyIDM0LjM4NCA0OC44NzIgMzQuMzg0QzUwLjk2MSAzNC4zODQgNTIuNzUgMzQuMDQ5IDU0LjM5IDMzLjM4M0M1Ni4wMzEgMzIuNzE2IDU3LjQyNiAzMS43OCA1OC41NzkgMzAuNTc3QzU5LjczMyAyOS4zNzQgNjAuNjE5IDI3LjkxNiA2MS4yMzkgMjYuMjA1QzYxLjg2IDI0LjQ5NCA2Mi4xNyAyMi42MDUgNjIuMTcgMjAuNTRDNjIuMTY5NiAxOS45Njg4IDYyLjE0NDUgMTkuMzk4IDYyLjA5NSAxOC44MjlMNjIuMDkyIDE4LjgyM1pNMTUxLjgxIDE2Ljk4MUMxNTMuNDEgMTQuNjA5IDE1Ny40MTkgMTQuMzU4IDE1OS4wMjIgMTQuMzU4VjE4LjkxQzE1Ni45NTcgMTguOTEgMTU0Ljk4NSAxOC45OTYgMTUzLjc1NyAxOS44OTJDMTUyLjUyOSAyMC43OTIgMTUxLjkxOSAyMS45ODIgMTUxLjkxOSAyMy40NjRWMzMuOTlIMTQ2Ljk2NFYxNC4zNThIMTUxLjczNkwxNTEuODEgMTYuOTgxWk0xNDMuMDExIDE0LjM2MVYzNC4wMzFIMTM4LjI0TDEzOC4xMzEgMzEuMDQ1QzEzNy40NjYgMzIuMDc2IDEzNi41NTEgMzIuOTIxOSAxMzUuNDcxIDMzLjUwNEMxMzQuMzc2IDM0LjA5OSAxMzMuMDY4IDM0LjM5NiAxMzEuNTM2IDM0LjM5NkMxMzAuMiAzNC4zOTYgMTI4Ljk2MyAzNC4xNTIgMTI3LjgyMiAzMy42NjhDMTI2LjcgMzMuMTk2NCAxMjUuNjg5IDMyLjQ5NSAxMjQuODU1IDMxLjYwOUMxMjQuMDE4IDMwLjcyMiAxMjMuMzU0IDI5LjY2MiAxMjIuODcxIDI4LjQyMkMxMjIuMzg0IDI3LjE4NSAxMjIuMTQyIDI1LjgxMSAxMjIuMTQyIDI0LjMwNEMxMjIuMTQyIDIyLjc5OCAxMjIuMzg0IDIxLjM3OCAxMjIuODcxIDIwLjExNkMxMjMuMzU3IDE4Ljg1NCAxMjQuMDE4IDE3Ljc3MiAxMjQuODU1IDE2Ljg3M0MxMjUuNjg4IDE1Ljk3NjQgMTI2LjY5OCAxNS4yNjM2IDEyNy44MjIgMTQuNzhDMTI4Ljk2MyAxNC4yODEgMTMwLjIwMyAxNC4wMzMgMTMxLjUzNiAxNC4wMzNDMTMzLjA0MyAxNC4wMzMgMTM0LjMzIDE0LjMxOCAxMzUuMzk3IDE0Ljg4OEMxMzYuNDYyIDE1LjQ1ODkgMTM3LjM3NSAxNi4yNzggMTM4LjA1NyAxNy4yNzZWMTQuMzYxSDE0My4wMTFaTTEzMi42MzEgMzAuMTMzQzEzNC4yNTYgMzAuMTMzIDEzNS41NjcgMjkuNTk0IDEzNi41NjUgMjguNTEyQzEzNy41NjEgMjcuNDMgMTM4LjA2IDI1Ljk5MSAxMzguMDYgMjQuMTk2QzEzOC4wNiAyMi40MDEgMTM3LjU2MSAyMC45OSAxMzYuNTY1IDE5Ljg5OUMxMzUuNTcgMTguODA3IDEzNC4yNTkgMTguMjU4IDEzMi42MzEgMTguMjU4QzEzMS4wMDMgMTguMjU4IDEyOS43MjkgMTguODA0IDEyOC43MzQgMTkuODk5QzEyNy43MzggMjAuOTkzIDEyNy4yMzkgMjIuNDM4IDEyNy4yMzkgMjQuMjMzQzEyNy4yMzkgMjYuMDI4IDEyNy43MzUgMjcuNDMzIDEyOC43MzQgMjguNTE1QzEyOS43MjkgMjkuNTk0IDEzMS4wMjggMzAuMTM2IDEzMi42MzEgMzAuMTM2VjMwLjEzM1pNOTMuNjk4IDI3Ljg3NkM5My41Nzk1IDI4LjAwMjUgOTMuNDU2NCAyOC4xMjQ2IDkzLjMyOSAyOC4yNDJDOTEuOTQ3IDI5LjUxNiA5MC4xMjMgMzAuMTU1IDg3Ljg2NiAzMC4xNTVDODYuNTggMzAuMTU1IDg1LjQwOCAyOS45MjYgODQuMzUgMjkuNDY0QzgzLjMxNTUgMjkuMDE4OSA4Mi4zODk4IDI4LjM1NDYgODEuNjM3IDI3LjUxN0M4MC44ODQgMjYuNjc5IDgwLjMwMSAyNS42NzIgNzkuODg5IDI0LjQ5NEM3OS40NzYgMjMuMzE1IDc5LjI2OSAyMi4wMSA3OS4yNjkgMjAuNTc4Qzc5LjI2OSAxOS4xNDUgNzkuNDczIDE3Ljg0IDc5Ljg4OSAxNi42NjJDODAuMzAxIDE1LjQ4NCA4MC44ODQgMTQuNDc2IDgxLjYzNyAxMy42MzlDODIuMzk0OSAxMi43OTg3IDgzLjMyNzMgMTIuMTM0MiA4NC4zNjkgMTEuNjkyQzg1LjQzNiAxMS4yMyA4Ni42MTQgMTEgODcuOTAzIDExQzkwLjU3IDExIDkyLjU5NSAxMS42NDIgOTMuOTc3IDEyLjkyNkw5Ny4yNTggOS42NDQ5OUM5NC43NzQgNy43MTA5OSA5MS42MzMgNi43Mzk5OSA4Ny44MjkgNi43Mzk5OUM4NS43MTggNi43Mzk5OSA4My44MTEgNy4wNzQ5OSA4Mi4xMTIgNy43NDE5OUM4MC40MTMgOC40MDc5OSA3OC45NTYgOS4zNDQ5OSA3Ny43NCAxMC41NDVDNzYuNTI1IDExLjc0NyA3NS41OTIgMTMuMTk5IDc0LjkzNCAxNC44OThDNzQuMjc3IDE2LjU5NyA3My45NTEgMTguNDkxIDczLjk1MSAyMC41ODFDNzMuOTUxIDIyLjY3IDc0LjI4NiAyNC41MzQgNzQuOTUzIDI2LjI0NUM3NS42MTkgMjcuOTU3IDc2LjU2MiAyOS40MTQgNzcuNzc0IDMwLjYxN0M3OC45OSAzMS44MiA4MC40NDQgMzIuNzUzIDgyLjE0NiAzMy40MjNDODMuODQ1IDM0LjA5IDg1LjczOSAzNC40MjQgODcuODI5IDM0LjQyNEM4OS45MTkgMzQuNDI0IDkxLjcwOCAzNC4wOSA5My4zNDggMzMuNDIzQzk0LjcxOCAzMi44NjUgOTUuOTE4IDMyLjEyMSA5Ni45NDggMzEuMTkxQzk3LjE0OSAzMS4wMDggOTcuMzQ4IDMwLjgxNSA5Ny41MzcgMzAuNjJMOTMuNzAxIDI3Ljg4NUw5My42OTggMjcuODc2Wk0xMTAuODAyIDE0LjAxNUMxMDkuMTk5IDE0LjAxNSAxMDYuODM2IDE0LjQ3MSAxMDUuNjExIDE2LjE1OEwxMDUuNTM3IDYuMDE1OTlIMTAwLjc2NVYzMy45MzlIMTA1LjcyVjIyLjY0MUMxMDUuNzcxIDIxLjQ2MDcgMTA2LjI4OCAyMC4zNDg4IDEwNy4xNTcgMTkuNTQ4OUMxMDguMDI3IDE4Ljc0OTEgMTA5LjE3OCAxOC4zMjY2IDExMC4zNTggMTguMzc0QzExMy4zOTcgMTguMzc0IDExNC4yNjggMjEuMTU5IDExNC4yNjggMjIuNjQxVjMzLjkzOUgxMTkuMjIzVjIxLjA1OUMxMTkuMjIzIDIxLjA1OSAxMTkuMTQyIDE0LjAxNSAxMTAuODAyIDE0LjAxNVpNMTczLjc2MyAxNC4zNThIMTY5Ljk5OVY4LjcxNDk5SDE2NS4wNDhWMTQuMzU4SDE2MS4yODRWMTguOTE2SDE2NS4wNDhWMzQuMDAzSDE2OS45OTlWMTguOTE2SDE3My43NjNWMTQuMzU4Wk0xOTAuNzg3IDI1LjI2MkMxOTAuMTI5IDI0LjUwMTQgMTg5LjMwNyAyMy44OTk0IDE4OC4zODQgMjMuNTAxQzE4Ny40ODggMjMuMTE3IDE4Ni4zMzEgMjIuNzMyIDE4NC45NDggMjIuMzY0QzE4NC4xNjUgMjIuMTQzOSAxODMuMzkgMjEuODk3OCAxODIuNjIzIDIxLjYyNkMxODIuMTYzIDIxLjQ2MjEgMTgxLjc0MSAyMS4yMDY2IDE4MS4zODMgMjAuODc1QzE4MS4yMzUgMjAuNzQyMSAxODEuMTE4IDIwLjU3ODkgMTgxLjAzOSAyMC4zOTY0QzE4MC45NjEgMjAuMjE0IDE4MC45MjIgMjAuMDE2NiAxODAuOTI3IDE5LjgxOEMxODAuOTI3IDE5LjI3MiAxODEuMTU2IDE4Ljg0NCAxODEuNjI1IDE4LjUxQzE4Mi4xMjEgMTguMTU2IDE4Mi44NjIgMTcuOTc2IDE4My44MjYgMTcuOTc2QzE4NC43OSAxNy45NzYgMTg1LjU4NyAxOC4yMDkgMTg2LjE0OCAxOC42NjhDMTg2LjcwNiAxOS4xMjQgMTg3LjAwNyAxOS43MjUgMTg3LjA3MiAyMC41TDE4Ny4wOTQgMjAuNzgySDE5MS42MzNMMTkxLjYxNyAyMC40NkMxOTEuNTIxIDE4LjQ4NSAxOTAuNzcxIDE2LjkgMTg5LjM4NSAxNS43NUMxODguMDEyIDE0LjYxMiAxODYuMTg1IDE0LjAzMyAxODMuOTYyIDE0LjAzM0MxODIuNDc3IDE0LjAzMyAxODEuMTQxIDE0LjI4NyAxNzkuOTk0IDE0Ljc4NkMxNzguODMxIDE1LjI5MSAxNzcuOTI2IDE1Ljk5NSAxNzcuMjk2IDE2Ljg4MkMxNzYuNjczIDE3Ljc0NTUgMTc2LjMzOCAxOC43ODQgMTc2LjM0MSAxOS44NDlDMTc2LjM0MSAyMS4xNjcgMTc2LjY5OCAyMi4yNDkgMTc3LjM5OSAyMy4wNjRDMTc4LjA2IDIzLjg0MzIgMTc4Ljg5OCAyNC40NTM0IDE3OS44NDIgMjQuODQ0QzE4MC43NDQgMjUuMjE2IDE4MS45MjggMjUuNjA3IDE4My4zNjEgMjZDMTg0LjgwNiAyNi40MSAxODUuODcyIDI2Ljc4NSAxODYuNTMgMjcuMTIzQzE4Ny4xIDI3LjQxNCAxODcuMzc5IDI3Ljg0NSAxODcuMzc5IDI4LjQ0NEMxODcuMzc5IDI5LjA0MiAxODcuMTIyIDI5LjQ2NyAxODYuNTk1IDI5LjgzOUMxODYuMDQzIDMwLjIyNiAxODUuMjM3IDMwLjQyNSAxODQuMjAxIDMwLjQyNUMxODMuMTY2IDMwLjQyNSAxODIuMzk0IDMwLjE3NCAxODEuNzQ5IDI5LjY3NEMxODEuMTEzIDI5LjE4MSAxODAuNzcyIDI4LjU4OSAxODAuNzEgMjcuODY0TDE4MC42ODUgMjcuNTgySDE3Ni4wMTNMMTc2LjAyNSAyNy45MDFDMTc2LjA2NyAyOS4wOTU1IDE3Ni40NzIgMzAuMjQ4NyAxNzcuMTg4IDMxLjIwNkMxNzcuOTA3IDMyLjE4IDE3OC44OTMgMzIuOTU4IDE4MC4xMTggMzMuNTE5QzE4MS4zMzYgMzQuMDc3IDE4Mi43MzIgMzQuMzYyIDE4NC4yNjYgMzQuMzYyQzE4NS44MDEgMzQuMzYyIDE4Ny4xMDkgMzQuMTA4IDE4OC4yMzggMzMuNjA5QzE4OS4zNzYgMzMuMTA0IDE5MC4yNzIgMzIuMzk0IDE5MC45MDEgMzEuNDk0QzE5MS41MzQgMzAuNTkyIDE5MS44NTMgMjkuNTU0IDE5MS44NTMgMjguNDAzQzE5MS44MjggMjcuMTEgMTkxLjQ2NiAyNi4wNTMgMTkwLjc3NyAyNS4yNjJIMTkwLjc4N1oiIGZpbGw9IiM5QjlCOUIiLz4KPHBhdGggZD0iTTI0MS45ODIgMjUuNjU4MlYxNy43MTE3SDIyOC40NDFMMjIwLjQ5NCAyNS42NTgySDI0MS45ODJaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNTcuMjM5IDUuOTUwODFIMjQwLjI2NUwyMzIuMjU1IDEzLjg5NzNIMjU3LjIzOVY1Ljk1MDgxWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjEyLjYxMSAzMy42MDQ4TDIxNi42OCAyOS41MzYxSDIzMC40MTJWMzcuNDgyN0gyMTIuNjExVjMzLjYwNDhaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yMTUuNTk5IDIxLjc4MDNIMjI0LjM3MkwyMzIuMzgyIDEzLjgzMzdIMjE1LjU5OVYyMS43ODAzWiIgZmlsbD0iIzlCOUI5QiIvPgo8cGF0aCBkPSJNMjA2IDMzLjYwNDdIMjEyLjYxMUwyMjAuNDk0IDI1LjY1ODJIMjA2VjMzLjYwNDdaIiBmaWxsPSIjOUI5QjlCIi8+CjxwYXRoIGQ9Ik0yNDAuMjY1IDUuOTUwODFMMjM2LjE5NyAxMC4wMTk0SDIxMC4yNTlWMi4wNzI4OEgyNDAuMjY1VjUuOTUwODFaIiBmaWxsPSIjOUI5QjlCIi8+Cjwvc3ZnPgo=",width:170,height:25,right:25,bottom:50,opacity:.7}}));const h={...i.chartOptions.specialOverrides},u={...i.chartOptions.optionMetadata},d=await this.chart?.ctx.dataService.getData(),p=this.factoryApi.create(c,l,h,u,d);await p.setState(o),p.chart?.ctx.zoomManager.updateZoom("chartProxy",i.ctx.zoomManager.getZoom()),p.chart?.ctx.legendManager.clearData(),p.chart?.ctx.legendManager.update(i.ctx.legendManager.getData()),i.series.forEach((y,b)=>{p.chart.series[b].visible=y.visible});const g=[];for(const y of i.modulesManager.legends())g.push(y.legend.pagination?.currentPage??0);for(const y of p.chart.modulesManager.legends()){const b=g.shift()??0;y.legend.pagination&&y.legend.pagination.setPage(b)}return p.chart?.update(0,{forceNodeDataRefresh:!0}),await p.waitForUpdate(),p}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:t,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:r,legendManager:o}}=this.chart,a=[];return"annotations"in t&&t.annotations?.enabled&&a.push(s),i.presetType==="price-volume"&&a.push(n),(t.navigator?.enabled||t.zoom?.enabled)&&a.push(r),"legend"in this.chart&&a.push(o),a}async setStateOriginators(t,i){this.factoryApi.caretaker.restore(t,...i),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};gc.chartInstances=new WeakMap,f([hi({oldValue(e){e.destroyed||(e.publicApi=void 0),gc.chartInstances.delete(e)},newValue(e){e&&(e.publicApi=this,gc.chartInstances.set(e,this))}})],gc.prototype,"chart",2);var BS=gc,Ff=class extends eh{constructor(e){super(),this.ctx=e,this.localeText=void 0}};f([Rn(e=>{e.ctx.localeManager.setLocaleText(e.localeText)}),x],Ff.prototype,"localeText",2),f([Rn(e=>{e.ctx.localeManager.setLocaleTextFormatter(e.getLocaleText)}),x],Ff.prototype,"getLocaleText",2);var OE={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Ff(e)},EE=(T(),N(w)),fc=(e,{x0:t,y0:i,x1:s,y1:n,cx:r,cy:o},a,l)=>{if(l&&e.moveTo(t,i),t!==s||i!==n){const c=Math.atan2(i-o,t-r),h=Math.atan2(n-o,s-r);e.arc(r,o,a,c,h)}else e.lineTo(t,i)},VS=1e-6,Wu=(e,t,i,s,n)=>{let r=!1,o=!1,a=s-Math.sqrt(Math.max(n**2-i**2,0)),l=0,c=0,h=i-Math.sqrt(Math.max(n**2-s**2,0));return a>e?(r=!0,a=e,l=i-Math.sqrt(Math.max(n**2-(s-e)**2))):a<VS&&(a=0),h>t?(o=!0,c=s-Math.sqrt(Math.max(n**2-(i-t)**2)),h=t):h<VS&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:o}},$u=(e,t,i,s,n,r,o)=>{let{topLeft:a,topRight:l,bottomRight:c,bottomLeft:h}=r;const u=Math.max(a+h,l+c),d=Math.max(a+l,h+c);if(u<=0&&d<=0){o==null?e.rect(t,i,s,n):e.rect(o.x,o.y,o.width,o.height);return}else if(o==null&&a===l&&a===c&&a===h){e.roundRect(t,i,s,n,a);return}if(s<0&&(t+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(o==null)o=new W(t,i,s,n);else{const L=Math.max(t,o.x),C=Math.min(t+s,o.x+o.width),O=Math.max(i,o.y),E=Math.min(i+n,o.y+o.height);o=new W(L,O,C-L,E-O)}const p=Math.max(u/n,d/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let g=!0,y=!0,b=!0,m=!0,v,S,M,I;if(g){const L=Wu(o.height,o.width,Math.max(t+a-o.x,0),Math.max(i+a-o.y,0),a);L.leadingClipped&&(m=!1),L.trailingClipped&&(y=!1);const C=Math.max(o.x+L.leading1,o.x),O=Math.max(o.y+L.leading0,o.y),E=Math.max(o.x+L.trailing1,o.x),_=Math.max(o.y+L.trailing0,o.y),F=t+a,j=i+a;v={x0:C,y0:O,x1:E,y1:_,cx:F,cy:j}}if(y){const L=Wu(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(t+s-l),0),l);L.leadingClipped&&(g=!1),L.trailingClipped&&(b=!1);const C=Math.min(o.x+o.width-L.leading0,o.x+o.width),O=Math.max(o.y+L.leading1,o.y),E=Math.min(o.x+o.width-L.trailing0,o.x+o.width),_=Math.max(o.y+L.trailing1,o.y),F=t+s-l,j=i+l;S={x0:C,y0:O,x1:E,y1:_,cx:F,cy:j}}if(b){const L=Wu(o.height,o.width,Math.max(o.x+o.width-(t+s-c),0),Math.max(o.y+o.height-(i+n-c),0),c);L.leadingClipped&&(y=!1),L.trailingClipped&&(m=!1);const C=Math.min(o.x+o.width-L.leading1,o.x+o.width),O=Math.min(o.y+o.height-L.leading0,o.y+o.height),E=Math.min(o.x+o.width-L.trailing1,o.x+o.width),_=Math.min(o.y+o.height-L.trailing0,o.y+o.height),F=t+s-c,j=i+n-c;M={x0:C,y0:O,x1:E,y1:_,cx:F,cy:j}}if(m){const L=Wu(o.width,o.height,Math.max(o.y+o.height-(i+n-h),0),Math.max(t+h-o.x,0),h);L.leadingClipped&&(b=!1),L.trailingClipped&&(g=!1);const C=Math.max(o.x+L.leading0,o.x),O=Math.min(o.y+o.height-L.leading1,o.y+o.height),E=Math.max(o.x+L.trailing0,o.x),_=Math.min(o.y+o.height-L.trailing1,o.y+o.height),F=t+h,j=i+n-h;I={x0:C,y0:O,x1:E,y1:_,cx:F,cy:j}}let k=!1;g&&v!=null&&(fc(e,v,a,!k),k||(k=!0)),y&&S!=null&&(fc(e,S,l,!k),k||(k=!0)),b&&M!=null&&(fc(e,M,c,!k),k||(k=!0)),m&&I!=null&&fc(e,I,h,!k),e.closePath()},si=class extends ti{constructor(){super(...arguments),this.borderPath=new Lo,this.x=0,this.y=0,this.width=10,this.height=10,this.topLeftCornerRadius=0,this.topRightCornerRadius=0,this.bottomRightCornerRadius=0,this.bottomLeftCornerRadius=0,this.clipBBox=void 0,this.crisp=!1,this.lastUpdatePathStrokeWidth=this.strokeWidth,this.effectiveStrokeWidth=this.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(e){this.topLeftCornerRadius=e,this.topRightCornerRadius=e,this.bottomRightCornerRadius=e,this.bottomLeftCornerRadius=e}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:e,borderPath:t,crisp:i,topLeftCornerRadius:s,topRightCornerRadius:n,bottomRightCornerRadius:r,bottomLeftCornerRadius:o}=this;let{x:a,y:l,width:c,height:h,strokeWidth:u,clipBBox:d}=this;const g=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(e.clear(!0),t.clear(!0),i&&(c<=g&&(y*=c/g),h<=g&&(y*=h/g),c=this.align(a,c),h=this.align(l,h),a=this.align(a),l=this.align(l),d=d!=null?new W(this.align(d.x),this.align(d.y),this.align(d.x,d.width),this.align(d.y,d.height)):void 0),u)if(c<g){const b=a+g/2;t.moveTo(b,l),t.lineTo(b,l+h),u=g,this.borderClipPath=void 0}else if(h<g){const b=l+g/2;t.moveTo(a,b),t.lineTo(a+c,b),u=g,this.borderClipPath=void 0}else if(u<c&&u<h){const b=u/2;a+=b,l+=b,c-=u,h-=u;const m=d?.clone().shrink(b),v={topLeft:s>0?s-u:0,topRight:n>0?n-u:0,bottomRight:r>0?r-u:0,bottomLeft:o>0?o-u:0};this.borderClipPath=void 0,c>0&&h>0&&(m==null||m?.width>0&&m?.height>0)&&($u(e,a,l,c,h,v,m),$u(t,a,l,c,h,v,m))}else this.borderClipPath=this.borderClipPath??new Lo,this.borderClipPath.clear(!0),this.borderClipPath.rect(a,l,c,h),t.rect(a,l,c,h);else{const b={topLeft:s,topRight:n,bottomRight:r,bottomLeft:o};this.borderClipPath=void 0,$u(e,a,l,c,h,b,d)}if([s,n,r,o].every(b=>b===0)){const b=this.getBBox();this.hittester=b.containsPoint.bind(b),this.distanceSquared=(m,v)=>this.getBBox().distanceSquared(m,v)}else this.hittester=super.isPointInPath,this.distanceCalculator=super.distanceSquaredTransformedPoint;this.effectiveStrokeWidth=u,this.lastUpdatePathStrokeWidth=u,this.microPixelEffectOpacity=y}computeBBox(){const{x:e,y:t,width:i,height:s,clipBBox:n}=this;return n?.clone()??new W(e,t,i,s)}isPointInPath(e,t){return this.hittester(e,t)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(e,t){return this.distanceCalculator(e,t)}applyFillAndAlpha(e){super.applyFillAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}applyStrokeAndAlpha(e){super.applyStrokeAndAlpha(e),e.globalAlpha*=this.microPixelEffectOpacity}renderStroke(e){const{stroke:t,effectiveStrokeWidth:i}=this;if(t&&i){const{globalAlpha:s}=e,{lineDash:n,lineDashOffset:r,lineCap:o,lineJoin:a,borderPath:l,borderClipPath:c}=this;c&&e.clip(c.getPath2D()),this.applyStrokeAndAlpha(e),e.lineWidth=i,n&&e.setLineDash(n),r&&(e.lineDashOffset=r),o&&(e.lineCap=o),a&&(e.lineJoin=a),e.stroke(l.getPath2D()),e.globalAlpha=s}}};si.className="Rect",f([z()],si.prototype,"x",2),f([z()],si.prototype,"y",2),f([z()],si.prototype,"width",2),f([z()],si.prototype,"height",2),f([z()],si.prototype,"topLeftCornerRadius",2),f([z()],si.prototype,"topRightCornerRadius",2),f([z()],si.prototype,"bottomRightCornerRadius",2),f([z()],si.prototype,"bottomLeftCornerRadius",2),f([Li({equals:EE.boxesEqual})],si.prototype,"clipBBox",2),f([z()],si.prototype,"crisp",2);var Ma=class extends eh{constructor(e){super(),this.ctx=e,this.rectNode=new si,this.textNode=new _t,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.cleanup.register(e.scene.attachNode(this.node),e.eventsHub.on("layout:complete",t=>this.onLayoutComplete(t)))}createNode(){return new re({name:"background",zIndex:0})}onLayoutComplete(e){const{width:t,height:i}=e.chart;this.rectNode.width=t,this.rectNode.height=i}};f([x,kt("node","visible")],Ma.prototype,"visible",2),f([x,kt("rectNode","fill")],Ma.prototype,"fill",2),f([x],Ma.prototype,"image",2),f([x,kt("textNode")],Ma.prototype,"text",2);var GS={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new Ma(e)},Yu=(T(),N(w));function PE({orientation:e,bboxes:t,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:r=0,forceResult:o=!1}){const a=e==="horizontal",l={max:a?s:i,fn:a?d=>d.width:d=>d.height,padding:a?r:n},c={max:a?i:s,fn:a?d=>d.height:d=>d.width,padding:a?n:r};let h=0;const u=[];for(;h<t.length;){const d=t.slice(h),p=RE(d,h,l,c,o);if(!p)return;h+=p.processedBBoxCount,u.push(p.pageIndices)}return jE(u,e,t,n,r)}function RE(e,t,i,s,n){let o=FE(e,i);if(o<1){if(!n)return;o=1}let a=o;for(;a>=1;){const l=_E(e,t,a,i,s,n);if(l==null&&a<=1)return;if(l==null){a--;continue}if(typeof l=="number"){if(l<=1)return;a=l<a&&l>1?l:a,a--;continue}return{processedBBoxCount:l.length*l[0].length,pageIndices:l}}}function _E(e,t,i,s,n,r){const o=[];let a=0,l=0,c=[];const h=[];for(let u=0;u<e.length;u++){const d=(u+i)%i;d===0&&(a+=l,l=0,c.length>0&&o.push(c),c=[]);const p=s.fn(e[u])+s.padding;h[d]=Math.max(h[d]??0,p),l=Math.max(l,n.fn(e[u])+n.padding);const g=a+l,y=!r||o.length>0;if(g>n.max&&y){c=[];break}if(h.reduce((m,v)=>m+v,0)>s.max&&!r)return h.length<i?h.length:void 0;c.push(u+t)}return c.length>0&&o.push(c),o.length>0?o:void 0}function jE(e,t,i,s,n){let r=0,o=0;return{pages:e.map(l=>{t==="horizontal"&&(l=zE(l));let c=0;const h=l.map(p=>{const g=p.map(m=>(c=Math.max(m,c),i[m]));let y=0,b=0;return g.forEach(m=>{y+=m.height+s,b=Math.max(b,m.width+n)}),{indices:p,bboxes:g,columnHeight:Math.ceil(y),columnWidth:Math.ceil(b)}});let u=0,d=0;return h.forEach(p=>{u+=p.columnWidth,d=Math.max(d,p.columnHeight)}),r=Math.max(u,r),o=Math.max(d,o),{columns:h,startIndex:l[0][0],endIndex:c,pageWidth:u,pageHeight:d}}),maxPageWidth:r,maxPageHeight:o}}function zE(e){const t=[];for(const i of e[0])t.push([]);return e.forEach((i,s)=>{i.forEach((n,r)=>{t[r][s]=n})}),t}function FE(e,t){const i=e.length;let s=0;for(let n=0;n<i;n++)if(s+=t.fn(e[n])+t.padding,s>t.max)return i/n<2?Math.ceil(i/2):n;return i}var HS=(T(),N(w)),Sa=class extends ae{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};f([x],Sa.prototype,"color",2),f([x],Sa.prototype,"fontStyle",2),f([x],Sa.prototype,"fontWeight",2),f([x],Sa.prototype,"fontSize",2),f([x],Sa.prototype,"fontFamily",2);var gn=class extends ae{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};f([x],gn.prototype,"size",2),f([x],gn.prototype,"fill",2),f([x],gn.prototype,"fillOpacity",2),f([x],gn.prototype,"stroke",2),f([x],gn.prototype,"strokeWidth",2),f([x],gn.prototype,"strokeOpacity",2);var Ku=class extends ae{constructor(e){super(),this.parent=e,this.shape="triangle",this.size=15,this.padding=8}};f([hi({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],Ku.prototype,"shape",2),f([x],Ku.prototype,"size",2),f([x],Ku.prototype,"padding",2);var oo=class extends ae{constructor(e,t){super(),this.chartUpdateCallback=e,this.pageUpdateCallback=t,this.id=(0,HS.createId)(this),this.marker=new Ku(this),this.activeStyle=new gn,this.inactiveStyle=new gn,this.highlightStyle=new gn,this.label=new Sa,this.group=new Ht({name:"pagination"}),this.labelNode=new _t,this.totalPages=0,this.currentPage=0,this.translationX=0,this.translationY=0,this.nextButtonDisabled=!1,this.previousButtonDisabled=!1,this._visible=!0,this._enabled=!0,this._orientation="vertical",this.nextButton=new vt,this.previousButton=new vt,this.labelNode.setProperties({textBaseline:"middle",fontSize:12,fontFamily:"Verdana, sans-serif",fill:"black",y:1}),this.group.append([this.nextButton,this.previousButton,this.labelNode]),this.update(),this.updateMarkers()}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(e){this._enabled=e,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(e){switch(this._orientation=e,e){case"horizontal":{this.previousButton.rotation=-Math.PI/2,this.nextButton.rotation=Math.PI/2;break}case"vertical":default:this.previousButton.rotation=0,this.nextButton.rotation=Math.PI}}get orientation(){return this._orientation}update(){this.updateLabel(),this.updatePositions(),this.enableOrDisableButtons()}updatePositions(){this.group.translationX=this.translationX,this.group.translationY=this.translationY,this.updateLabelPosition(),this.updateNextButtonPosition()}updateLabelPosition(){const{size:e,padding:t}=this.marker;this.nextButton.size=e,this.previousButton.size=e,this.labelNode.x=e/2+t}updateNextButtonPosition(){const e=this.labelNode.getBBox();this.nextButton.translationX=e.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:e,totalPages:t,labelNode:i,label:{color:s,fontStyle:n,fontWeight:r,fontSize:o,fontFamily:a}}=this;i.text=`${e+1} / ${t}`,i.fill=s,i.fontStyle=n,i.fontWeight=r,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:e,previousButton:t,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:r,highlightStyle:o,highlightActive:a}=this,l=(c,h)=>h?r:c===a?o:n;this.updateMarker(e,l("next",i)),this.updateMarker(t,l("previous",s))}updateMarker(e,t){const{shape:i,size:s}=this.marker;e.shape=i,e.size=s,e.fill=t.fill,e.fillOpacity=t.fillOpacity??1,e.stroke=t.stroke,e.strokeWidth=t.strokeWidth,e.strokeOpacity=t.strokeOpacity}enableOrDisableButtons(){const{currentPage:e,totalPages:t}=this,i=t===0,s=e===t-1,n=e===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(e){e=(0,HS.clamp)(0,e,Math.max(0,this.totalPages-1)),this.currentPage!==e&&(this.currentPage=e,this.onPaginationChanged())}getCursor(e){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[e]?void 0:"pointer"}onClick(e,t){e.preventDefault(),t==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):t==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(e){this.highlightActive=e,this.updateMarkers(),this.chartUpdateCallback(7)}onPaginationChanged(){this.pageUpdateCallback(this.currentPage)}incrementPage(){this.currentPage=Math.min(this.currentPage+1,this.totalPages-1)}decrementPage(){this.currentPage=Math.max(this.currentPage-1,0)}onMarkerShapeChange(){this.updatePositions(),this.updateMarkers(),this.chartUpdateCallback(7)}attachPagination(e){e.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const e=tt.toCanvas(this.previousButton),t=tt.toCanvas(this.nextButton);return{prev:e,next:t}}};oo.className="Pagination",f([x],oo.prototype,"marker",2),f([x],oo.prototype,"activeStyle",2),f([x],oo.prototype,"inactiveStyle",2),f([x],oo.prototype,"highlightStyle",2),f([x],oo.prototype,"label",2);var US=(T(),N(w)),BE=class{constructor(e,t){this.dirty=!0,this.itemList=e.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${t}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=e.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${t}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=(0,US.createElement)("p"),this.itemDescription.style.display="none",this.itemDescription.id=(0,US.createElementId)(),this.itemDescription.textContent=this.getItemAriaDescription(e.localeManager),this.itemList.getElement().append(this.itemDescription)}initLegendList(e){if(!this.dirty)return;const{ctx:t,itemSelection:i,datumReader:s,itemListener:n}=e,r=t.localeManager,o=i.length;i.each((a,l,c)=>{a.proxyButton?.destroy(),a.proxyButton=t.proxyInteractionService.createProxyElement({type:"listswitch",textContent:this.getItemAriaText(r,s.getItemLabel(l),c,o),ariaChecked:!!a.datum.enabled,ariaDescribedBy:this.itemDescription.id,parent:this.itemList});const h=a.proxyButton;h.addListener("click",u=>n.onClick(u.sourceEvent,a.datum,h)),h.addListener("dblclick",u=>n.onDoubleClick(u.sourceEvent,a.datum)),h.addListener("mouseenter",u=>n.onHover(u.sourceEvent,a)),h.addListener("mouseleave",()=>n.onLeave()),h.addListener("contextmenu",u=>n.onContextClick(u,a)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",u=>n.onHover(u.sourceEvent,a)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(e){e.visible&&(this.initLegendList(e),this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!0)),this.updateVisibility(e.visible)}updateVisibility(e){this.itemList.setHidden(!e),this.paginationGroup.setHidden(!e)}updateItemProxyButtons({itemSelection:e,group:t,pagination:i,interactive:s}){const n=tt.toCanvas(t);this.itemList.setBounds(n);const r=Math.max(...e.nodes().map(o=>o.getBBox().height));e.each((o,a)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=tt.toCanvas(o),p=(r-u)/2,g={x:c-n.x,y:h-p-n.y,height:r,width:d},y=s&&l;o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(y),o.proxyButton.setPointerEvents(y?void 0:"none"),o.proxyButton.setBounds(g)}})}updatePaginationProxyButtons(e,t){const{pagination:i}=e;if(this.paginationGroup.setHidden(!i.visible),t&&"ctx"in e){const{ctx:r,oldPages:o,newPages:a}=e,l=(o?.length??a.length)>1,c=a.length>1;l!==c&&(c?(this.prevButton=r.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",h=>this.onPageButton(e,h,"previous")),this.prevButton.addListener("mouseenter",()=>i.onMouseHover("previous")),this.prevButton.addListener("mouseleave",()=>i.onMouseHover(void 0)),this.nextButton??(this.nextButton=r.proxyInteractionService.createProxyElement({type:"button",textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",h=>this.onPageButton(e,h,"next")),this.nextButton.addListener("mouseenter",()=>i.onMouseHover("next")),this.nextButton.addListener("mouseleave",()=>i.onMouseHover(void 0))):(this.nextButton?.destroy(),this.prevButton?.destroy(),this.nextButton=void 0,this.prevButton=void 0))}const{prev:s,next:n}=i.computeCSSBounds();this.prevButton?.setBounds(s),this.nextButton?.setBounds(n),this.prevButton?.setEnabled(i.currentPage!==0),this.nextButton?.setEnabled(i.currentPage!==i.totalPages-1),this.nextButton?.setCursor(i.getCursor("next")),this.prevButton?.setCursor(i.getCursor("previous"))}onPageButton(e,t,i){e.pagination.onClick(t.sourceEvent,i),this.updatePaginationProxyButtons(e,!1)}onDataUpdate(e,t){this.dirty=e.length!==t.length||e.some((i,s,n)=>{const[r,o]=[t[s],e[s]];return r.id!==o.id})}onLocaleChanged(e,t,i){const s=t.length;t.each(({proxyButton:n},r,o)=>{const a=n?.getElement();if(a!=null){const l=i.getItemLabel(r);a.textContent=this.getItemAriaText(e,l,o,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(e)}onPageChange(e){this.updateItemProxyButtons(e),this.updatePaginationProxyButtons(e,!1)}getItemAriaText(e,t,i,s){return i>=0&&t?(i++,e.t("ariaLabelLegendItem",{label:t,index:i,count:s})):e.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(e){return e.t("ariaDescriptionLegendItem")}};function WS(e,{itemId:t,seriesId:i,label:{text:s}},n){const r={defaultPrevented:!1,apiEvent:{type:e,itemId:t,seriesId:i,text:s,event:n,preventDefault:()=>r.defaultPrevented=!0}};return r}var $i=class extends Dr(re){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new re({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new _t),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new vt({zIndex:1})),this.line=this.symbolsGroup.appendChild(new pi({zIndex:0}));const{label:e,line:t,symbolsGroup:i}=this;t.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,e.textBaseline="middle",e.fontSize=12,e.fontFamily="Verdana, sans-serif",e.fill="black",e.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(e){this.enabled=e,this.refreshVisibilities()}getTextMeasureBBox(){return this.layout(),W.merge([this.symbolsGroup.getBBox(),this.label.getTextMeasureBBox()])}refreshVisibilities(){const e=this.enabled?1:.5;this.label.opacity=e,this.opacity=e}layout(){const{marker:e,line:t,length:i,isCustomMarker:s}=this;let n=0,r=0;if(e.visible){const{size:o}=e,a=vt.anchor(e.shape);n=(a.x-.5)*o+i/2,r=(a.y-.5)*o,s?(e.x=0,e.y=0,e.translationX=n,e.translationY=r):(e.x=n,e.y=r,e.translationX=0,e.translationY=0)}t.visible&&(t.x1=0,t.x2=i,t.y1=0,t.y2=0)}preRender(e){const t=super.preRender(e);return this.layout(),t}layoutLabel(){const{length:e,spacing:t}=this;this.label.x=e+t}computeBBox(){return this.layout(),super.computeBBox()}};$i.className="MarkerLabel",f([kt("label")],$i.prototype,"text",2),f([kt("label")],$i.prototype,"fontStyle",2),f([kt("label")],$i.prototype,"fontWeight",2),f([kt("label")],$i.prototype,"fontSize",2),f([kt("label")],$i.prototype,"fontFamily",2),f([kt("label","fill")],$i.prototype,"color",2),f([Rn(e=>e.layoutLabel())],$i.prototype,"spacing",2),f([Rn(e=>e.layoutLabel())],$i.prototype,"length",2),f([z()],$i.prototype,"isCustomMarker",2);var ir=class extends ae{constructor(){super(...arguments),this.maxLength=void 0,this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};f([x],ir.prototype,"maxLength",2),f([x],ir.prototype,"color",2),f([x],ir.prototype,"fontStyle",2),f([x],ir.prototype,"fontWeight",2),f([x],ir.prototype,"fontSize",2),f([x],ir.prototype,"fontFamily",2),f([x],ir.prototype,"formatter",2);var Da=class extends ae{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};f([x],Da.prototype,"shape",2),f([x],Da.prototype,"size",2),f([x],Da.prototype,"padding",2),f([x],Da.prototype,"strokeWidth",2),f([x],Da.prototype,"enabled",2);var Bf=class extends ae{};f([x],Bf.prototype,"strokeWidth",2),f([x],Bf.prototype,"length",2);var sr=class extends ae{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new Da,this.label=new ir,this.line=new Bf}};f([x],sr.prototype,"maxWidth",2),f([x],sr.prototype,"paddingX",2),f([x],sr.prototype,"paddingY",2),f([x],sr.prototype,"showSeriesStroke",2),f([x],sr.prototype,"marker",2),f([x],sr.prototype,"label",2),f([x],sr.prototype,"line",2);var Vf=class extends ae{};f([x],Vf.prototype,"legendItemClick",2),f([x],Vf.prototype,"legendItemDoubleClick",2);var VE={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},GE={type:"pattern",pattern:"forward-slanted-lines",width:8,height:8,padding:1,fill:"black",fillOpacity:1,backgroundFill:"white",backgroundFillOpacity:1,stroke:"black",strokeOpacity:1,strokeWidth:0,rotation:0,scale:1},HE={type:"image",backgroundFill:"black",backgroundFillOpacity:1,rotation:0,repeat:"no-repeat",fit:"contain",width:8,height:8},yi=class extends ae{constructor(e){super(),this.ctx=e,this.id=(0,Yu.createId)(this),this.group=new Ht({name:"legend",zIndex:15}),this.itemSelection=bt.select(this.group,$i),this.oldSize=[0,0],this.pages=[],this.maxPageSize=[0,0],this.paginationTrackingIndex=0,this.truncatedItems=new Set,this._data=[],this.toggleSeries=!0,this.item=new sr,this.listeners=new Vf,this.enabled=!0,this.position="bottom",this.spacing=20,this.cleanup=new Yu.CleanupRegistry,this.size=[0,0],this._visible=!0,this.pagination=new oo(i=>e.updateService.update(i),i=>this.updatePageNumber(i)),this.pagination.attachPagination(this.group);const{items:t}=e.contextMenuRegistry.builtins;t["toggle-series-visibility"].action=i=>this.contextToggleVisibility(i),t["toggle-other-series"].action=i=>this.contextToggleOtherSeries(i),this.cleanup.register(e.eventsHub.on("legend:change",this.onLegendDataChange.bind(this)),e.layoutManager.registerElement(1,i=>this.positionLegend(i)),e.eventsHub.on("locale:change",()=>this.onLocaleChanged()),()=>delete t["toggle-series-visibility"].action,()=>delete t["toggle-other-series"].action,()=>this.group.remove()),this.domProxy=new BE(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(e.legendManager)}set data(e){ft(e,this._data)||(this.domProxy.onDataUpdate(this._data,e),this._data=e,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:e=[]}){this.enabled&&(this.data=e.filter(t=>!t.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.cleanup.flush(),this.itemSelection.clear()}getOrientation(){return this.orientation??"horizontal"}set visible(e){this._visible=e,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(e){e.appendChild(this.group)}getItemLabel(e){const{formatter:t}=this.item.label;if(t){const i=e.datum;return this.cachedCallWithContext(t,{itemId:e.itemId,value:e.label.text,seriesId:e.seriesId,...i&&{datum:i}})}return e.label.text}calcLayout(e,t){const{paddingX:i,paddingY:s,label:n,maxWidth:r,label:{maxLength:o=1/0,fontStyle:a,fontWeight:l,fontSize:c,fontFamily:h}}=this.item,u=[...this.data];this.reverseOrder&&u.reverse(),this.itemSelection.update(u);const d=[],p=Qs.getMeasurer({font:n}),y=r??e*.8,{markerWidth:b,anyLineEnabled:m}=this.calculateMarkerWidth();if(this.itemSelection.each((E,_)=>{E.fontStyle=a,E.fontWeight=l,E.fontSize=c,E.fontFamily=h;const F=this.updateMarkerLabel(E,_,b,m),j=_.itemId??_.id,ne=(this.getItemLabel(_)??"<unknown>").replace(/\r?\n/g," ");E.text=this.truncate(ne,o,y,F,p,j),d.push(E.getTextMeasureBBox())}),e=Math.max(1,e),t=Math.max(1,t),!isFinite(e))return{};const v=this.size,S=this.oldSize;v[0]=e,v[1]=t,(v[0]!==S[0]||v[1]!==S[1])&&(S[0]=v[0],S[1]=v[1]);const{pages:M,maxPageHeight:I,maxPageWidth:k}=this.updatePagination(d,e,t),L=this.pages;this.pages=M,this.maxPageSize=[k-i,I-s];const C=this.pagination.currentPage,O=this.pages[C];return this.pages.length<1||!O?(this.visible=!1,{oldPages:L}):(this.visible=!0,this.updatePositions(C),this.update(),{oldPages:L})}isCustomMarker(e,t){return e&&t!==void 0&&typeof t!="string"}calcSymbolsEnabled(e){const{showSeriesStroke:t,marker:i}=this.item,s=!!i.enabled||!t||(e.marker.enabled??!0),n=!!(e.line&&t),r=this.isCustomMarker(s,e.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:r}}calcSymbolsLengths(e,t,i){const{marker:s,line:n}=this.item;let r;const{shape:o}=e.marker;if(this.isCustomMarker(t,o)){const c=new vt;c.shape=o,c.updatePath();const h=c.getBBox();r=Math.max(h.width,h.height)}const a=t?s.size:0,l=i?n.length??25:0;return{markerLength:a,lineLength:l,customMarkerSize:r}}calculateMarkerWidth(){let e=0,t=!1;return this.itemSelection.each((i,s)=>{const{symbol:n}=s,{lineEnabled:r,markerEnabled:o}=this.calcSymbolsEnabled(n),{markerLength:a,lineLength:l,customMarkerSize:c=-1/0}=this.calcSymbolsLengths(n,o,r);e=Math.max(e,l,c,a),t||(t=r)}),{markerWidth:e,anyLineEnabled:t}}updateMarkerLabel(e,t,i,s){const{marker:n,paddingX:r}=this.item,{symbol:o}=t;let a=r;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(o),h=n.padding;(l||s)&&(a+=h+i);const{marker:u,line:d}=e;return u.visible=l,u.visible&&(u.shape=n.shape??o.marker.shape??"square",u.size=n.size,on(u,this.getMarkerStyles(o))),d.visible=s,d.visible&&on(d,this.getLineStyles(o)),e.length=i,e.spacing=h,e.isCustomMarker=c,a}truncate(e,t,i,s,n,r){let o=!1;e.length>t&&(e=e.substring(0,t),o=!0);const a=Mh.truncateLine(e,n,i-s,o);return a.endsWith(Ue.EllipsisChar)?this.truncatedItems.add(r):this.truncatedItems.delete(r),a}updatePagination(e,t,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,e.length);this.pagination.orientation=s,this.pagination.translationX=0,this.pagination.translationY=0;const{pages:r,maxPageHeight:o,maxPageWidth:a,paginationBBox:l,paginationVertical:c}=this.calculatePagination(e,t,i),h=r.findIndex(S=>S.endIndex>=n);this.pagination.currentPage=(0,Yu.clamp)(0,h,r.length-1);const{paddingX:u,paddingY:d}=this.item,p=8,g=a-u,y=o-d;let b=0,m=-l.y-this.item.marker.size/2;c?m+=y+p:(b+=-l.x+g+p,m+=(y-l.height)/2),this.pagination.translationX=b,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((S,M,I)=>{I>(r[v]?.endIndex??1/0)&&v++,S.pageIndex=v}),{maxPageHeight:o,maxPageWidth:a,pages:r}}calculatePagination(e,t,i){const{paddingX:s,paddingY:n}=this.item,r=this.getOrientation(),o=["left","right"].includes(this.position);let a=this.pagination.getBBox(),l=new W(0,0,0,0),c=[],h=0,u=0,d=0;const p=y=>y.width===a.width&&y.height===a.height,g=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(d++>10){Yu.Logger.warn("unable to find stable legend layout.");break}a=l;const y=t-(o?0:a.width),b=i-(o?a.height:0),m=PE({orientation:r,bboxes:e,maxHeight:b,maxWidth:y,itemPaddingY:n,itemPaddingX:s,forceResult:g});c=m?.pages??[],h=m?.maxPageWidth??0,u=m?.maxPageHeight??0;const v=c.length;if(this.pagination.visible=v>1,this.pagination.totalPages=v,this.pagination.update(),this.pagination.updateMarkers(),l=this.pagination.getBBox(),!this.pagination.visible)break}while(!p(l));return{maxPageWidth:h,maxPageHeight:u,pages:c,paginationBBox:l,paginationVertical:o}}updatePositions(e=0){const{item:{paddingY:t},itemSelection:i,pages:s}=this;if(s.length<1||!s[e])return;const{columns:n,startIndex:r,endIndex:o}=s[e];let a=0,l=0;const c=n.length,h=n[0].indices.length,u=this.getOrientation()==="horizontal",d=n[0].bboxes[0].height+t,p=[];i.each((g,y,b)=>{if(b<r||b>o){g.visible=!1;return}const m=b-r;let v,S;u?(v=m%c,S=Math.floor(m/c)):(v=Math.floor(m/h),S=m%h),g.visible=!0;const M=n[v];M&&(l=Math.floor(d*S),a=Math.floor(p[S]??0),p[S]=(p[S]??0)+M.columnWidth,g.translationX=a,g.translationY=l)})}updatePageNumber(e){const{itemSelection:t,group:i,pagination:s,pages:n,toggleSeries:r}=this,{startIndex:o,endIndex:a}=n[e];o===0?this.paginationTrackingIndex=0:e===n.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((o+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(e),this.domProxy.onPageChange({itemSelection:t,group:i,pagination:s,interactive:r}),this.ctx.updateService.update(7)}update(){const{label:{color:e}}=this.item;this.itemSelection.each((t,i)=>{t.setEnabled(i.enabled),t.color=e}),this.updateContextMenu()}updateContextMenu(){this.ctx.contextMenuRegistry.setVisible("toggle-series-visibility",this.toggleSeries),this.ctx.contextMenuRegistry.setVisible("toggle-other-series",this.toggleSeries)}getLineStyles(e){const{stroke:t,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=e.line??{},r=Math.min(2,s??1);return{stroke:t,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??r,lineDash:n}}getMarkerStyles({marker:e}){const{fill:t,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:r,lineDash:o,lineDashOffset:a}=e,l=Math.min(2,r??1);return Tn(t)&&(t.width=8,t.height=8,t.padding=1,t.strokeWidth=Math.min(2,t.strokeWidth??2)),Sr(t)&&(t.fit="contain",t.width=void 0,t.height=void 0,t.repeat="no-repeat"),Ts({fill:t,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a},VE,GE,HE)}computePagedBBox(){const e=re.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[t,i]=this.maxPageSize;e.height=Math.max(i,e.height),e.width=Math.max(t,e.width)}return e}findNode(e){const{datum:t,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===e.itemId)[0]??{};if(t===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${t}, proxyButton: ${JSON.stringify(i)} }`);return{datum:t,proxyButton:i}}contextToggleVisibility(e){const{datum:t,proxyButton:i}=this.findNode(e);this.doClick(e.event,t,i)}contextToggleOtherSeries(e){this.doDoubleClick(e.event,this.findNode(e).datum)}onContextClick(e,t){const{sourceEvent:i}=e,s=t.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!1:this.ctx.contextMenuRegistry.builtins.items["toggle-series-visibility"].enabled=!0;const n=this.ctx.chartService.series.length>1&&this.ctx.chartService.series[0]?.getLegendData("category")[0]?.hideToggleOtherSeries!==!0;this.ctx.contextMenuRegistry.setVisible("toggle-other-series",n);const{offsetX:r,offsetY:o}=i,{x:a,y:l}=tt.toCanvasPoint(t,r,o);this.ctx.contextMenuRegistry.dispatchContext("legend-item",{widgetEvent:e,canvasX:a,canvasY:l},{legendItem:s})}onClick(e,t,i){this.doClick(e,t,i)&&e.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(e=>e.getLegendData("category")).filter(e=>e.enabled).length}doClick(e,t,i){const{listeners:{legendItemClick:s},ctx:{chartService:n,highlightManager:r},preventHidingAll:o,toggleSeries:a}=this;if(!t)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:u,legendItemName:d}=t,p=n.series.find(b=>b.id===c);if(!p)return!1;let g=u;const y=WS("click",t,e);return s&&Zs([p.properties,this.ctx.chartService],s,y.apiEvent),y.defaultPrevented||(a&&(g=!u,o&&!g&&this.getVisibleItemCount()<2&&(g=!0),i.setChecked(g),this.ctx.eventsHub.emit("legend:item-click",{legendType:l,series:p,itemId:h,enabled:g,legendItemName:d})),g?r.updateHighlight(this.id,{series:p,itemId:h,datum:void 0,datumIndex:void 0,legendItemName:d}):r.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:t.skipAnimations??!1})),!0}onDoubleClick(e,t){this.doDoubleClick(e,t)&&e.preventDefault()}doDoubleClick(e,t){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(!t)return!1;const{legendType:r,id:o,itemId:a,seriesId:l}=t,c=s.series.find(u=>u.id===o);if(!c)return!1;const h=WS("dblclick",t,e);if(i&&Zs([c.properties,this.ctx.chartService],i,h.apiEvent),h.defaultPrevented)return!0;if(n){const u=s.series.flatMap(y=>y.getLegendData("category"));let d=0;const p=new Set;for(const y of u)y.enabled&&(d+=1,y.legendItemName!=null&&p.add(y.legendItemName));p.size>0&&(d=p.size);const g=u.find(y=>y.itemId===a&&y.seriesId===l);this.ctx.eventsHub.emit("legend:item-double-click",{legendType:r,series:c,itemId:a,numVisibleItems:d,enabled:g?.enabled??!1,legendItemName:g?.legendItemName})}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(e,t){let i;return e instanceof FocusEvent?i=tt.toCanvas(t).computeCenter():(e.preventDefault(),i=tt.toCanvasPoint(t,e.offsetX,e.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(e,t){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(t.pageIndex);const i=t.datum,s=i?this.ctx.chartService.series.find(n=>n.id===i?.id):void 0;if(i&&this.truncatedItems.has(i.itemId??i.id)){const n=this.toTooltipMeta(e,t);this.ctx.tooltipManager.updateTooltip(this.id,n,[{type:"structured",title:this.getItemLabel(i)}])}else this.ctx.tooltipManager.removeTooltip(this.id);i?.enabled&&s?this.updateHighlight({series:s,itemId:i?.itemId,datum:void 0,datumIndex:void 0,legendItemName:i?.legendItemName}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(e){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,e):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=e,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(e){const t=this.positionLegendScene(e);this.positionLegendDOM(t)}positionLegendScene(e){if(!this.enabled||!this.data.length)return;const{layoutBox:t}=e,{x:i,y:s,width:n,height:r}=t,[o,a]=this.calculateLegendDimensions(t),{oldPages:l}=this.calcLayout(o,a),c=this.computePagedBBox(),h=()=>{switch(this.position){case"top":case"left":return 0;case"bottom":return r-c.height;case"right":default:return n-c.width}};if(this.visible){const u=this.spacing;let d,p;switch(this.position){case"top":case"bottom":d=(n-c.width)/2,p=h(),t.shrink(c.height+u,this.position);break;case"left":case"right":default:d=h(),p=(r-c.height)/2,t.shrink(c.width+u,this.position)}this.group.translationX=Math.floor(i+d-c.x),this.group.translationY=Math.floor(s+p-c.y)}return l}positionLegendDOM(e){const{ctx:t,itemSelection:i,pagination:s,pages:n,toggleSeries:r,group:o,listeners:{legendItemClick:a,legendItemDoubleClick:l}}=this,c=this.visible&&this.enabled,h=r||l!=null||a!=null;this.domProxy.update({visible:c,interactive:h,ctx:t,itemSelection:i,group:o,pagination:s,oldPages:e,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(e){const{width:t,height:i}=e,s=t/i,n=.5,r=.2,o=.25;let a,l;switch(this.position){case"top":case"bottom":{const c=s<1?Math.min(n,r*(1/s)):r;a=this.maxWidth?Math.min(this.maxWidth,t):t,l=this.maxHeight?Math.min(this.maxHeight,i):Math.round(i*c);break}case"left":case"right":default:{const c=s>1?Math.min(n,o*s):o;a=this.maxWidth?Math.min(this.maxWidth,t):Math.round(t*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[a,l]}cachedCallWithContext(e,...t){const{callbackCache:i,chartService:s}=this.ctx;return i.call([this,s],e,...t)}};yi.className="Legend",f([x],yi.prototype,"toggleSeries",2),f([x],yi.prototype,"pagination",2),f([x],yi.prototype,"item",2),f([x],yi.prototype,"listeners",2),f([Rn((e,t,i)=>{if(e.updateGroupVisibility(),t===i)return;const{ctx:{legendManager:s,stateManager:n}}=e;i===!1&&t===!0&&n.restoreState(s)}),x],yi.prototype,"enabled",2),f([x],yi.prototype,"position",2),f([x],yi.prototype,"maxWidth",2),f([x],yi.prototype,"maxHeight",2),f([x],yi.prototype,"reverseOrder",2),f([x],yi.prototype,"orientation",2),f([x],yi.prototype,"preventHidingAll",2),f([x],yi.prototype,"spacing",2);var UE={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:e=>new yi(e),packageType:"community",removable:"standalone-only"},Gf=(T(),N(w));function Zu(e,t,i,s,n){const r=(u,d,p,g)=>{i.animate({id:`${e}_${t}_${d.id}_${u}`,groupId:e,from:p?1:0,to:1,ease:hl,collapsable:p,onUpdate(y,b){b&&u!=="removed"||(d.path.clear(!0),g(y,d),d.checkPathDirty())},onStop(){u==="added"&&(d.path.clear(!0),g(1,d),d.checkPathDirty())},phase:ns[u]})},o=new ti,a=u=>(o.resetPathDirty(),u(0,o),o.resetPathDirty(),u(1,o),o.checkPathDirty(),o.isPathDirty()),{addPhaseFn:l,updatePhaseFn:c,removePhaseFn:h}=n;for(const u of s)i.isSkipped()||(r("removed",u,!a(h),h),r("updated",u,!a(c),c)),r("added",u,!a(l),l)}function Ne({id:e},t,i,...s){for(const n of s)n.cleanup();en(e,t,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function nr({id:e},t,i,...s){en(e,t,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function fn(e){return{opacity:1}}var Hf=class extends ae{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(e){this._dirty=!1}isDirty(){return this._dirty}onChangeDetection(e){this.markDirty()}},ms=class extends Hf{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};f([x,z()],ms.prototype,"enabled",2),f([x,z()],ms.prototype,"color",2),f([x,z()],ms.prototype,"xOffset",2),f([x,z()],ms.prototype,"yOffset",2),f([x,z()],ms.prototype,"blur",2);var Rt=class extends Hf{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Gi,this.fillPatternDefaults=new Ze,this.fillImageDefaults=new gi,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}=this;return{size:e,shape:t,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};f([x,z()],Rt.prototype,"enabled",2),f([x,Li({equals:So})],Rt.prototype,"shape",2),f([x,z()],Rt.prototype,"size",2),f([x,Li({equals:ft})],Rt.prototype,"fill",2),f([x],Rt.prototype,"fillGradientDefaults",2),f([x],Rt.prototype,"fillPatternDefaults",2),f([x],Rt.prototype,"fillImageDefaults",2),f([x,z()],Rt.prototype,"fillOpacity",2),f([x,z()],Rt.prototype,"stroke",2),f([x,z()],Rt.prototype,"strokeWidth",2),f([x,z()],Rt.prototype,"strokeOpacity",2),f([x],Rt.prototype,"lineDash",2),f([x],Rt.prototype,"lineDashOffset",2),f([x,Li({equals:So})],Rt.prototype,"itemStyler",2);var $S=class extends ae{constructor(){super(...arguments),this.enabled=!1}};f([x],$S.prototype,"enabled",2);var mn=class extends ae{constructor(){super(...arguments),this.interaction=new $S,this.position=new _r,this.range=void 0,this.class=void 0}formatTooltip(e,t,i){const s=this.renderer==null?void 0:Zs(e,this.renderer,i);return typeof s=="string"?{type:"raw",rawHtmlString:s}:s!=null?{type:"structured",...t,...s}:{type:"structured",...t}}};f([x],mn.prototype,"enabled",2),f([x],mn.prototype,"showArrow",2),f([x],mn.prototype,"renderer",2),f([x],mn.prototype,"interaction",2),f([x],mn.prototype,"position",2),f([x],mn.prototype,"range",2),f([x],mn.prototype,"class",2);function yn(){return new mn}var Ia=(T(),N(w)),WE=class{constructor(e,t,i){this.root=new KE(e,t,i)}clear(e){this.root.clear(e)}addValue(e,t){const i={hitTester:e,value:t,distanceSquared:(s,n)=>e.distanceSquared(s,n)};this.root.addElem(i)}find(e,t){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(e,t,i),i.best}},$E=class{constructor(e,t,i,s){this.nw=e,this.ne=t,this.sw=i,this.se=s}addElem(e){this.nw.addElem(e),this.ne.addElem(e),this.sw.addElem(e),this.se.addElem(e)}find(e,t,i){this.nw.find(e,t,i),this.ne.find(e,t,i),this.sw.find(e,t,i),this.se.find(e,t,i)}},YE=class{constructor(e,t,i){this.capacity=e,this.maxdepth=t,this.boundary=i??W.NaN,this.elems=[],this.subdivisions=void 0}clear(e){this.elems.length=0,this.boundary=e,this.subdivisions=void 0}addElem(e){this.addCondition(e)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(e):this.subdivide(e):this.subdivisions.addElem(e))}find(e,t,i){this.findCondition(e,t,i)&&(this.subdivisions===void 0?this.findAction(e,t,i):this.subdivisions.find(e,t,i))}subdivide(e){this.subdivisions=this.makeSubdivisions();for(const t of this.elems)this.subdivisions.addElem(t);this.subdivisions.addElem(e),this.elems.length=0}makeSubdivisions(){const{x:e,y:t,width:i,height:s}=this.boundary,{capacity:n}=this,r=this.maxdepth-1,o=i/2,a=s/2,l=new W(e,t,o,a),c=new W(e+o,t,o,a),h=new W(e,t+a,o,a),u=new W(e+o,t+a,o,a);return new $E(this.child(n,r,l),this.child(n,r,c),this.child(n,r,h),this.child(n,r,u))}},KE=class zI extends YE{addCondition(t){const{x:i,y:s}=t.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(t,i,s){const{best:n}=s;return n.distanceSquared!==0&&this.boundary.distanceSquared(t,i)<n.distanceSquared}findAction(t,i,s){const n=sh(t,i,this.elems,s.best.distanceSquared);n.nearest!==void 0&&n.distanceSquared<s.best.distanceSquared&&(s.best=n)}child(t,i,s){return new zI(t,i,s)}},ZE=(T(),N(w)),Uf=class extends ou{constructor({clipFocusBox:e,categoryKey:t,...i}){super(i),this.categoryKey=t,this.clipFocusBox=e??!0}dataCount(){return this.processedData?.dataSources?.get(this.id)?.length??0}getScaleInformation({xScale:e,yScale:t}){const i=Re.is(e),s=Re.is(t);return{isContinuousX:i,isContinuousY:s,xScaleType:e?.type,yScaleType:t?.type}}getModulePropertyDefinitions(){const e=this.axes.x?.scale,t=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:e,yScale:t}))).flat()}async requestDataModel(e,t,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await e.request(this.id,t??[],i);return this.dataModel=s,this.processedData=n,this.events.emit("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const e=this.processedData?.reduced?.animationValidation;if(!e)return!0;const{orderedKeys:t,uniqueKeys:i}=e;return t&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(e){const t=this.getNodeData();if(t===void 0||t.length===0)return;const i=this.computeFocusDatumIndex(e,t);if(i===void 0)return;const{clipFocusBox:s}=this,n=t[i],r={...e,datumIndex:i},o=this.computeFocusBounds(r);if(o!==void 0)return{bounds:o,clipFocusBox:s,datum:n,datumIndex:i}}isDatumEnabled(e,t){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=e[t];return!i&&s&&n}computeFocusDatumIndex(e,t){const i=(o,a)=>{for(;o>=0&&!this.isDatumEnabled(t,o);)o+=a;return o===-1?void 0:o},s=(o,a)=>{for(;o<t.length&&!this.isDatumEnabled(t,o);)o+=a;return o===t.length?void 0:o};let n;const r=(0,ZE.clamp)(0,e.datumIndex,t.length-1);return e.datumIndexDelta<0?n=i(r,e.datumIndexDelta):e.datumIndexDelta>0?n=s(r,e.datumIndexDelta):n=s(r,1)??i(r,-1),n===void 0?e.datumIndexDelta===0?void 0:e.datumIndex-e.datumIndexDelta:n}keysOrValues(e){const t=this.dataModel.resolveProcessedDataIndexById(this,e);return this.processedData?.keys[t]?.get(this.id)??this.processedData?.columns[t]??[]}getCategoryKey(){return this.categoryKey}getCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();return!t||!i||!s||(t.invalidData?.get(this.id)?.[e]??!1)?void 0:this.keysOrValues(s)[e]}datumIndexForCategoryValue(e){const{processedData:t,dataModel:i}=this,s=this.getCategoryKey();if(!t||!i||!s)return;e=e.valueOf();const n=t.invalidData?.get(this.id),r=this.keysOrValues(s);for(let o=0;o<r.length;o+=1){if(n?.[o]===!0)continue;const a=r[o]?.valueOf();if(ft(e,a))return o}}},ao={x:["xKey"],y:["yKey"]},lo={x:["xName"],y:["yName"]},Wf=class extends Tl{constructor(e,t,i,s){super(e,t,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},bn=class extends Oi{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};f([x],bn.prototype,"legendItemName",2),f([x],bn.prototype,"pickOutsideVisibleMinorAxis",2);var Xu=100,rr=class extends Uf{constructor({pathsPerSeries:e=["path"],hasMarkers:t=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:r=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:a,propertyKeys:l,propertyNames:c,...h}){if(super({propertyKeys:l,propertyNames:c,canHaveAxes:!0,...h}),this.NodeEvent=Wf,this.dataNodeGroup=this.contentGroup.appendChild(new re({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new re({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new Ht({name:`${this.id}-series-labels`})),this.labelSelection=bt.select(this.labelGroup,_t),this.highlightSelection=bt.select(this.highlightNode,()=>this.opts.hasMarkers?new vt:this.nodeFactory()),this.highlightLabelSelection=bt.select(this.highlightLabel,_t),this.annotationSelections=new Set,this.debug=me.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:e,hasMarkers:t,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,propertyKeys:l,propertyNames:c,animationResetFns:a,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:r},this.paths=e.map(u=>new ti({name:`${this.id}-${u}`})),this.datumSelection=bt.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=bt.select(this.markerGroup,vt,r),this.animationState=new yl("empty",{empty:{update:{target:"ready",action:u=>this.animateEmptyUpdateReady(u)},reset:"empty",skip:"ready",disable:"disabled"},ready:{updateData:"waiting",clear:"clearing",highlight:u=>this.animateReadyHighlight(u),highlightMarkers:u=>this.animateReadyHighlightMarkers(u),resize:u=>this.animateReadyResize(u),reset:"empty",skip:"ready",disable:"disabled"},waiting:{update:{target:"ready",action:u=>{this.ctx.animationManager.isSkipped()?this.resetAllAnimation(u):this.animateWaitingUpdateReady(u)}},reset:"empty",skip:"ready",disable:"disabled"},disabled:{update:u=>this.resetAllAnimation(u),reset:"empty"},clearing:{update:{target:"empty",action:u=>this.animateClearingUpdateEmpty(u)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}get contextNodeData(){return this._contextNodeData}getNodeData(){return this.contextNodeData?.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),this.attachPaths(this.paths,t,i)}detachSeries(e,t,i){super.detachSeries(e,t,i),this.detachPaths(this.paths,t,i)}updatedDomains(){this.animationState.transition("updateData")}attachPaths(e,t,i){for(const s of e)this.contentGroup.appendChild(s)}detachPaths(e,t,i){for(const s of e)this.contentGroup.removeChild(s)}renderToOffscreenCanvas(){const e=this.getNodeData();return e!=null&&e.length>Xu}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"?this.animationState.transition("skip"):e==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)),this.ctx.eventsHub.on("legend:item-double-click",e=>this.onLegendItemDoubleClick(e)))}destroy(){super.destroy(),this._contextNodeData=void 0}isSeriesHighlighted(e){const{series:t,legendItemName:i}=e??{},{legendItemName:s}=this.properties;return t===this||s!=null&&s===i}update({seriesRect:e}){const{visible:t,_contextNodeData:i}=this,s=this.ctx.highlightManager?.getActiveHighlight(),n=this.isSeriesHighlighted(s),r=this.checkResize(e),o=this.updateHighlightSelection(n);this.contentGroup.batchedUpdate(()=>{const l=this.updateSelections(t);this.updateNodes(o,n,t,r||l)});const a=this.getAnimationData(e,i);a&&(r&&this.animationState.transition("resize",a),this.animationState.transition("update",a))}updateSelections(e){var t;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!e&&i)return!1;const{nodeDataRefresh:s}=this;if(!s&&!this.isPathOrSelectionDirty())return!1;if(s){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const n=this.isProcessedDataAnimatable();this._contextNodeData&&((t=this._contextNodeData).animationValid??(t.animationValid=n));const{dataModel:r,processedData:o}=this;r!==void 0&&o!==void 0&&this.events.emit("data-update",{dataModel:r,processedData:o}),this.updateSeriesSelections()}return s}updateSeriesSelections(e){const{datumSelection:t,labelSelection:i,markerSelection:s,paths:n}=this,r=this._contextNodeData;if(!r)return;const{nodeData:o,labelData:a,itemId:l}=r;this.updatePaths({seriesHighlighted:e,itemId:l,contextData:r,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:t}),this.labelGroup.batchedUpdate(()=>{this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i})??i}),this.opts.hasMarkers&&this.markerGroup.batchedUpdate(()=>{this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:s})})}getShapeFillBBox(){const{axes:e}=this,t=e.x,i=e.y,[s,n]=wt(t?.range??[0,1]),[r,o]=wt(i?.range??[0,1]),a=this.getSeriesDomain("x"),l=[t?.scale.convert(a.at(0)),t?.scale.convert(a.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=wt(l),[p,g]=wt(h);return{axis:new W(s,r,n-s,o-r),series:new W(u,p,d-u,g-p)}}updateNodes(e,t,i,s){const{highlightSelection:n,highlightLabelSelection:r,opts:{hasMarkers:o,hasHighlightedLabels:a}}=this,l=!this.ctx.animationManager.isSkipped(),c=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=l||c,this.highlightGroup.visible=(l||c)&&t,o?this.markerGroup.batchedUpdate(()=>{this.updateMarkerNodes({markerSelection:n,isHighlight:!0}),this.animationState.transition("highlightMarkers",n)}):(this.updateDatumNodes({datumSelection:n,isHighlight:!0}),this.animationState.transition("highlight",n)),a&&this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:r})});const{dataNodeGroup:h,markerGroup:u,datumSelection:d,labelSelection:p,markerSelection:g,paths:y,labelGroup:b}=this,{itemId:m}=this.contextNodeData??{};if(h.visible=l||c,b.visible=c,o&&(u.visible=c),this.updatePathNodes({seriesHighlighted:t,itemId:m,paths:y,visible:c,animationEnabled:l}),!h.visible)return;const v=this.properties.highlightStyle.series.strokeWidth!=null,{highlight:{unhighlightedItem:S,highlightedSeries:M,unhighlightedSeries:I}={}}=this.properties,k=S!=null||M!=null||I!=null;(s||v||k)&&(this.updateDatumNodes({datumSelection:d,highlightedItems:e,isHighlight:!1}),this.usesPlacedLabels||this.labelGroup.batchedUpdate(()=>{this.updateLabelNodes({labelSelection:p})}),o&&this.markerGroup.batchedUpdate(()=>{this.updateMarkerNodes({markerSelection:g,isHighlight:!1})}))}getHighlightLabelData(e,t){const i=e.filter(s=>s.datum===t.datum&&s.itemId===t.itemId);return i.length===0?void 0:i}getHighlightData(e,t){return t?[t]:void 0}updateHighlightSelection(e){const{highlightSelection:t,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const n=this.ctx.highlightManager?.getActiveHighlight(),r=e&&n?.datum?n:void 0;let o,a;if(r!=null){const l=this.isLabelEnabled(),{labelData:c,nodeData:h}=s;a=this.getHighlightData(h,r),o=l?this.getHighlightLabelData(c,r):void 0}return this.highlightSelection=this.updateHighlightSelectionItem({items:a,highlightSelection:t}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),a}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:e}of this.datumSelection)e.datum.missing!==!0&&(yield e)}getQuadTree(){if(this.quadtree===void 0){const{width:e,height:t}=this.ctx.scene.canvas,i=new W(0,0,e,t);this.quadtree=new WE(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(e){}pickNodesExactShape(e){const t=super.pickNodesExactShape(e);if(t.length!==0)return t;const{x:i,y:s}=e,{opts:{hasMarkers:n}}=this,{dataNodeGroup:r,markerGroup:o}=this;let a=r.pickNodes(i,s).filter(l=>l.datum.missing!==!0);if(a.length===0&&n&&(a=o?.pickNodes(i,s).filter(l=>l.datum.missing!==!0)),a.length!==0)return a.map(c=>c.datum);for(const l of this.moduleMap.modules()){const{datum:c}=l.pickNodeExact(e)??{};if(c!=null&&c?.missing!==!0)return[c]}return[]}pickNodeClosestDatum(e){const{x:t,y:i}=e,{axes:s,_contextNodeData:n}=this;if(!n)return;const r=s.x,o=s.y,a={x:t,y:i};let l=1/0,c;for(const h of n.nodeData){const{point:{x:u=NaN,y:d=NaN}={}}=h;if(isNaN(u)||isNaN(d)||!(r?.inRange(u)&&o?.inRange(d)))continue;const g=Math.max((a.x-u)**2+(a.y-d)**2,0);g<l&&(l=g,c=h)}for(const h of this.moduleMap.modules()){const u=h.pickNodeNearest(e);if(u!==void 0&&u.distanceSquared<l){l=u.distanceSquared,c=u.datum;break}}if(c){const h=Math.max(Math.sqrt(l)-(c.point?.size??0)/2,0);return{datum:c,distance:h}}}pickNodeMainAxisFirst(e,t){const{x:i,y:s}=e,{axes:n,_contextNodeData:r}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!r)return;const a=n.x,l=n.y,c=[a,l].filter(Kr.is).map(g=>g.direction);if(t&&c.length===0)return;const[h="x"]=c,u=[i,s];h!=="x"&&u.reverse();const d=[1/0,1/0];let p;for(const g of r.nodeData){const{x:y=NaN,y:b=NaN}=g.point??g.midPoint??{};if(isNaN(y)||isNaN(b)||g.missing===!0)continue;const m=[a?.inRange(y,1),l?.inRange(b,1)];if(h!=="x"&&m.reverse(),!m[0]||!o&&!m[1])continue;const v=[y,b];h!=="x"&&v.reverse();let S=!0;for(let M=0;M<v.length;M++){const I=Math.abs(v[M]-u[M]);if(I>d[M]){S=!1;break}else I<d[M]&&(d[M]=I,d.fill(1/0,M+1,d.length))}S&&(p=g)}if(p){let g=Math.max(d[0]**2+d[1]**2-(p.point?.size??0),0);for(const y of this.moduleMap.modules()){const b=y.pickNodeMainAxisFirst(e);if(b!==void 0&&b.distanceSquared<g){p=b.datum,g=b.distanceSquared;break}}return{datum:p,distance:Math.sqrt(g)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(e,t,i,s){let n;if(s==null){const{processedData:a,dataModel:l}=this;n=l.getSortOrder(this,e,a)??1}else n=s.sortOrder;const r=this.keysOrValues(e),o=0;return px(n,i?.length??r.length,t,a=>{const l=i?.[a]??a;return this.xCoordinateRange(r[l],o,l)})}domainForVisibleRange(e,t,i,s,n){const{processedData:r,dataModel:o}=this,[a,l]=s,c=this.keysOrValues(i),h=o.getSortOrder(this,i,r);if(h!=null){const g=this.visibleRange(i,s,n,{sortOrder:h});return o.getDomainBetweenRange(this,t,g,r)}const u=t.map(g=>this.keysOrValues(g));let d=1/0,p=-1/0;return c.forEach((g,y)=>{const[b,m]=this.xCoordinateRange(g,0,y);if(!(m<a||b>l))for(let v=0;v<t.length;v++){const S=u[v][y];d=Math.min(d,S),p=Math.max(p,S)}}),d>p?[NaN,NaN]:[d,p]}domainForClippedRange(e,t,i){const{processedData:s,dataModel:n,axes:r}=this,a=XE(r[e==="x"?"y":"x"]);if(!a)return t.flatMap(g=>n.getDomain(this,g,"value",s));const l=this.keysOrValues(i),c=n.getSortOrder(this,i,s);if(c!=null){const g=qE(c,l.length,a,y=>l[y]);return n.getDomainBetweenRange(this,t,g,s)}const h=t.map(g=>this.keysOrValues(g)),u=a[0].valueOf(),d=a[1].valueOf(),p=[];return l.forEach((g,y)=>{const b=g.valueOf();if(b<u||b>d)return;const m=h.map(v=>v[y]);b>=u&&p.push(...m),b<=d&&p.push(...m)}),p}countVisibleItems(e,t,i,s,n){const{dataModel:r,processedData:o}=this;if(!r||!o)return 1/0;const a=this.keysOrValues(e),l=t.map(I=>r.resolveColumnById(this,I,o)),c=this.axes.x,h=this.axes.y,u=this.shouldFlipXY(),d=c.range,p=h.range,g=(I,k,L)=>I[0]+(L-k[0])/(k[1]-k[0])*(I[1]-I[0]),y=g(d,c.visibleRange,i[0]),b=g(d,c.visibleRange,i[1]),m=g(p,h.visibleRange,u?s[0]:s[1]),v=g(p,h.visibleRange,u?s[1]:s[0]),S=Math.round((i[0]+(i[1]-i[0])/2)*a.length),M=0;return gx(0,a.length-1,S,n,I=>{let[k,L]=this.xCoordinateRange(a[I],M,I),[C,O]=this.yCoordinateRange(l.map(E=>E[I]),M,I);return!(0,Ia.isFiniteNumber)(k)||!(0,Ia.isFiniteNumber)(L)||!(0,Ia.isFiniteNumber)(C)||!(0,Ia.isFiniteNumber)(O)?!1:(u&&([k,L,C,O]=[C,O,k,L]),k>=y&&L<=b&&C>=m&&O<=v)})}minTimeInterval(){let e;try{e=this.keysOrValues("xValue")}catch{}if(e==null||e.length>1e3)return;let t=1/0,i=e[0],s;for(let n=1;n<e.length;n++){const r=e[n];if(r!=null&&i!=null){const o=r.valueOf()-i.valueOf(),a=Math.sign(o);if(a===0)continue;if(s!==void 0&&a!==s)return;t=Math.min(t,Math.abs(o)),s=a}i=r}if(Number.isFinite(t))return t}updateHighlightSelectionItem(e){const{opts:{hasMarkers:t}}=this,{items:i,highlightSelection:s}=e,n=i??[];if(t){const r=s;return this.updateMarkerSelection({nodeData:n,markerSelection:r})}else return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(e){return this.updateLabelSelection({labelData:e.items??[],labelSelection:e.highlightLabelSelection})}updateDatumSelection(e){return e.datumSelection}updateDatumNodes(e){}updateMarkerSelection(e){return e.markerSelection}updateMarkerNodes(e){}updatePaths(e){e.paths.forEach(t=>t.visible=!1)}updatePathNodes(e){const{paths:t,visible:i}=e;for(const s of t)s.visible=i}resetPathAnimation(e){const{path:t}=this.opts?.animationResetFns??{};t&&e.paths.forEach(i=>{Nt([i],t)})}resetDatumAnimation(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Nt([e.datumSelection],t)}resetLabelAnimation(e){const{label:t}=this.opts?.animationResetFns??{};t&&Nt([e.labelSelection],t)}resetMarkerAnimation(e){const{marker:t}=this.opts?.animationResetFns??{};t&&this.opts.hasMarkers&&Nt([e.markerSelection],t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(e),this.resetDatumAnimation(e),this.resetLabelAnimation(e),this.resetMarkerAnimation(e),e.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){const{datum:t}=this.opts?.animationResetFns??{};t&&Nt([e],t)}animateReadyHighlightMarkers(e){const{marker:t}=this.opts?.animationResetFns??{};t&&Nt([e],t)}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(e,t){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:t,paths:this.paths,seriesRect:e}:void 0}updateLabelSelection(e){return e.labelSelection}getScaling(e){if(e instanceof bf){const{range:t,domain:i}=e;return{type:"log",convert:s=>e.convert(s),domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Re){const{range:t,domain:i}=e;return{type:"continuous",domain:[i[0],i[1]],range:[t[0],t[1]]}}else if(e instanceof Lr)return{type:"category",domain:e instanceof Ns?e.bands:e.domain,inset:e.inset,step:e.step}}calculateScaling(){const e={};for(const t of Object.values(zp)){const i=this.axes[t];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(e[t]=s)}return e}};function XE(e){let t,i;if((e instanceof js||e instanceof zs)&&({min:t,max:i}=e),!(t==null&&i==null))return t??(t=-1/0),i??(i=1/0),[t,i]}function qE(e,t,i,s){const n=i[0].valueOf(),r=i[1].valueOf();let o=(0,Ia.findMinIndex)(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h>=n}),a=(0,Ia.findMaxIndex)(0,t-1,l=>{const c=e===1?l:t-l,h=s(c)?.valueOf();return!Number.isFinite(h)||h<=r});return o==null||a==null?[0,0]:(e===-1&&([o,a]=[t-a,t-o]),o=Math.max(o,0),a=Math.min(a+1,t),[o,a])}var Aa=class extends ae{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};f([x],Aa.prototype,"type",2),f([x],Aa.prototype,"tension",2),f([x],Aa.prototype,"position",2);var ot=class extends bn{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Gi,this.fillPatternDefaults=new Ze,this.fillImageDefaults=new gi,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Aa,this.shadow=new ms,this.marker=new Rt,this.label=new xt,this.tooltip=yn(),this.connectMissingData=!1}};f([x],ot.prototype,"xKey",2),f([x],ot.prototype,"xName",2),f([x],ot.prototype,"yKey",2),f([x],ot.prototype,"yName",2),f([x],ot.prototype,"yFilterKey",2),f([x],ot.prototype,"normalizedTo",2),f([x],ot.prototype,"fill",2),f([x],ot.prototype,"fillGradientDefaults",2),f([x],ot.prototype,"fillPatternDefaults",2),f([x],ot.prototype,"fillImageDefaults",2),f([x],ot.prototype,"fillOpacity",2),f([x],ot.prototype,"stroke",2),f([x],ot.prototype,"strokeWidth",2),f([x],ot.prototype,"strokeOpacity",2),f([x],ot.prototype,"lineDash",2),f([x],ot.prototype,"lineDashOffset",2),f([x],ot.prototype,"interpolation",2),f([x],ot.prototype,"shadow",2),f([x],ot.prototype,"marker",2),f([x],ot.prototype,"label",2),f([x],ot.prototype,"tooltip",2),f([x],ot.prototype,"connectMissingData",2);function Vs(e){switch(e.type){case"linear":case"step":return[{x:e.x0,y:e.y0},{x:e.x1,y:e.y1}];case"cubic":return[{x:e.cp0x,y:e.cp0y},{x:e.cp3x,y:e.cp3y}]}}function QE(e){const t=Vs(e);return t[0].x>t[1].x&&t.reverse(),t}function JE(e,t){const{x:i,y:s}=t;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:e.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function mc(e,t,i){const[s,n]=Vs(e),r=n.x!==s.x?(i.x-t.x)/(n.x-s.x):0,o=n.y!==s.y?(i.y-t.y)/(n.y-s.y):0;switch(e.type){case"linear":return{type:"linear",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:e.moveTo,cp0x:t.x,cp0y:t.y,cp1x:i.x-(e.cp2x-s.x)*r,cp1y:i.y-(e.cp2y-s.y)*o,cp2x:i.x-(e.cp1x-s.x)*r,cp2y:i.y-(e.cp1y-s.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:e.moveTo,x0:t.x,y0:t.y,x1:i.x,y1:i.y,stepX:i.x-(e.stepX-s.x)*r}}}function YS(e,t,i){const{moveTo:s}=e,[n,r]=QE(e),{x:o,y:a}=n,{x:l,y:c}=r;if(i<o)return mc(e,n,n);if(t>l)return mc(e,r,r);switch(e.type){case"linear":{const h=a===c?void 0:(c-a)/(l-o),u=h==null?a:h*(t-o)+a,d=h==null?a:h*(i-o)+a;return{type:"linear",moveTo:s,x0:t,y0:u,x1:i,y1:d}}case"step":if(i<=e.stepX){const h=e.y0;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:i}}else if(t>=e.stepX){const h=e.y1;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:h,stepX:t}}else{const{y0:h,y1:u,stepX:d}=e;return{type:"step",moveTo:s,x0:t,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=gh(e.cp0x,e.cp1x,e.cp2x,e.cp3x,t);let[u,d]=tl(e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,h);const p=gh(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=tl(d[0].x,d[0].y,d[1].x,d[1].y,d[2].x,d[2].y,d[3].x,d[3].y,p),{type:"cubic",moveTo:s,cp0x:d[0].x,cp0y:d[0].y,cp1x:d[1].x,cp1y:d[1].y,cp2x:d[2].x,cp2y:d[2].y,cp3x:d[3].x,cp3y:d[3].y}}}}function e2(e){const t=[];let i=0,s=NaN,n=NaN;for(const{x:r,y:o}of e){if(i>0){const a=i===1;t.push({type:"linear",moveTo:a,x0:s,y0:n,x1:r,y1:o})}i+=1,s=r,n=o}return t}var t2={start:0,middle:.5,end:1};function i2(e,t){const i=[];let s=0,n=NaN,r=NaN;const o=typeof t=="number"?t:t2[t];for(const{x:a,y:l}of e){if(s>0){const c=s===1,h=n+(a-n)*o;i.push({type:"step",moveTo:c,x0:n,y0:r,x1:a,y1:l,stepX:h})}s+=1,n=a,r=l}return i}var qu=.05;function s2(e,t){const i=Array.isArray(e)?e:Array.from(e);if(i.length<=1)return[];const s=i.map((r,o)=>{const a=o===0?r:i[o-1],l=o===i.length-1?r:i[o+1],c=o===0||o===i.length-1;if(Math.sign(a.y-r.y)===Math.sign(l.y-r.y))return 0;if(!c){const h=Math.abs(a.y-l.y),u=Math.abs(r.y-a.y)/h,d=Math.abs(r.y-l.y)/h;if(u<=qu||1-u<=qu||d<=qu||1-d<=qu)return 0}return(l.y-a.y)/(l.x-a.x)});s[1]===0&&(s[0]*=2),s[s.length-2]===0&&(s[s.length-1]*=2);const n=[];for(let r=1;r<i.length;r+=1){const o=i[r-1],a=s[r-1],l=i[r],c=s[r],h=l.x-o.x,u=l.y-o.y;let d=h*t/3,p=h*a*t/3,g=h*t/3,y=h*c*t/3;c===0&&Math.abs(p)>Math.abs(u)&&(d*=Math.abs(u/p),p=Math.sign(p)*Math.abs(u)),a===0&&Math.abs(y)>Math.abs(u)&&(g*=Math.abs(u/y),y=Math.sign(y)*Math.abs(u)),n.push({type:"cubic",moveTo:r===1,cp0x:o.x,cp0y:o.y,cp1x:o.x+d,cp1y:o.y+p,cp2x:l.x-g,cp2y:l.y-y,cp3x:l.x,cp3y:l.y})}return n}function Dt(e,t,i){return(t-e)*i+e}function n2(e,t){const{x0:i,y0:s,x1:n,y1:r}=e,a=(r-s)/(n-i)*(t-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:t,leftCp2y:a,stepX:t,stepY0:a,stepY1:a,rightCp1x:t,rightCp1y:a,rightCp2x:n,rightCp2y:r}}function r2(e,t){const{cp0x:i,cp0y:s,cp1x:n,cp1y:r,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=e,h=gh(i,n,o,l,t),[u,d]=tl(i,s,n,r,o,a,l,c,h),p=u[3].y;return{leftCp1x:u[1].x,leftCp1y:u[1].y,leftCp2x:u[2].x,leftCp2y:u[2].y,stepX:t,stepY0:p,stepY1:p,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function o2(e){const{x0:t,y0:i,x1:s,y1:n,stepX:r}=e;return{leftCp1x:(t+r)/2,leftCp1y:i,leftCp2x:(t+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:n,rightCp1x:(r+s)/2,rightCp1y:n,rightCp2x:(r+s)/2,rightCp2y:n}}function KS(e,t){return e.type==="linear"?n2(e,t):e.type==="cubic"?r2(e,t):o2(e)}function ZS(e,t,i,s,n,r,o){switch(t){case 0:o?e.moveTo(n,r):e.moveTo(i,s);break;case 1:o?e.lineTo(n,r):e.lineTo(i,s);break}}function XS(e,t,i,s,n,r){r?e.lineTo(t,i):e.lineTo(s,n)}function qS(e,t,i,s,n,r,o,a,l,c){c?e.cubicCurveTo(r,o,s,n,t,i):e.cubicCurveTo(s,n,r,o,a,l)}function QS(e,t,i,s,n,r,o){o?(e.lineTo(r,n),e.lineTo(r,i),e.lineTo(t,i)):(e.lineTo(r,i),e.lineTo(r,n),e.lineTo(s,n))}function $f(e,t,i,s){const[n,r]=Vs(t);switch(ZS(e,i,n.x,n.y,r.x,r.y,s),t.type){case"linear":XS(e,t.x0,t.y0,t.x1,t.y1,s);break;case"cubic":qS(e,t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,s);break;case"step":QS(e,t.x0,t.y0,t.x1,t.y1,t.stepX,s);break}}function JS(e,t,i){const[s,n]=Vs(e),[r,o]=Vs(t),a=Dt(s.x,r.x,i),l=Dt(s.y,r.y,i),c=Dt(n.x,o.x,i),h=Dt(n.y,o.y,i);return[{x:a,y:l},{x:c,y:h}]}function Yf(e,t,i,s,n,r){const[{x:o,y:a},{x:l,y:c}]=JS(t,i,s);if(ZS(e,n,o,a,l,c,r),t.type==="cubic"&&i.type==="cubic"){const h=Dt(t.cp1x,i.cp1x,s),u=Dt(t.cp1y,i.cp1y,s),d=Dt(t.cp2x,i.cp2x,s),p=Dt(t.cp2y,i.cp2y,s);qS(e,o,a,h,u,d,p,l,c,r)}else if(t.type==="step"&&i.type==="step"){const h=Dt(t.stepX,i.stepX,s);QS(e,o,a,l,c,h,r)}else if(t.type==="linear"&&i.type==="linear")XS(e,o,a,l,c,r);else{let h;t.type==="step"?h=t.stepX:i.type==="step"?h=i.stepX:h=(o+l)/2;const u=KS(t,h),d=KS(i,h),p=Dt(u.leftCp1x,d.leftCp1x,s),g=Dt(u.leftCp1y,d.leftCp1y,s),y=Dt(u.leftCp2x,d.leftCp2x,s),b=Dt(u.leftCp2y,d.leftCp2y,s),m=Dt(u.stepX,d.stepX,s),v=Dt(u.stepY0,d.stepY0,s),S=Dt(u.stepY1,d.stepY1,s),M=Dt(u.rightCp1x,d.rightCp1x,s),I=Dt(u.rightCp1y,d.rightCp1y,s),k=Dt(u.rightCp2x,d.rightCp2x,s),L=Dt(u.rightCp2y,d.rightCp2y,s);r?(e.cubicCurveTo(k,L,M,I,m,S),e.lineTo(m,v),e.cubicCurveTo(y,b,p,g,o,a)):(e.cubicCurveTo(p,g,y,b,m,v),e.lineTo(m,S),e.cubicCurveTo(M,I,k,L,l,c))}}var a2=1e3,eD=(e=>(e[e.Zero=0]="Zero",e[e.Split=1]="Split",e))(eD||{});function l2(e,t){return e==null||t==null||typeof e!="object"||typeof t!="object"?!1:"id"in e&&"id"in t?e.id===t.id:e.toString()===t.toString()}function bi(e){return Ag(e).valueOf()}function ni(e,t){if(!t)return NaN;if(e instanceof Date&&(e=e.getTime()),t.type==="continuous"&&typeof e=="number")return(e-t.domain[0])/(t.domain[1]-t.domain[0])*(t.range[1]-t.range[0])+t.range[0];if(t.type==="log"&&typeof e=="number")return t.convert(e);if(t.type!=="category")return NaN;const i=bi(e);let s=t.domain.findIndex(n=>bi(n)===i);return s===-1&&(s=t.domain.findIndex(n=>l2(e,n))),s>=0?t.inset+t.step*s:NaN}function tD({data:e},t){return e.map((i,s)=>({xValue0Index:t.indexOf(bi(i.xValue0)),xValue1Index:t.indexOf(bi(i.xValue1)),datumIndex:s}))}function iD(e){return Object.values(e.scales).every(t=>t.type==="category"?t.domain.length<a2:!0)}function c2(e,t){const i=t.scales.x,s=e.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let n=-1/0;for(const r of i.domain){const o=ni(r,s);if(Number.isFinite(o)){if(o<n)return!1;n=o}}return!0}function h2(e,t){let i=-1/0;for(const s of e){const n=ni(s.value,t.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function u2(e,t){const i=new Map;for(const{xValue0:h,xValue1:u}of e.data){const d=bi(h),p=bi(u);i.set(d,h).set(p,u)}const s=Array.from(i,([h,u])=>({axisValue:h,value:u}));s.sort((h,u)=>ni(h.value,e.scales.x)-ni(u.value,e.scales.x));const n=[];for(const{xValue0:h,xValue1:u}of t.data){const d=bi(h),p=bi(u);i.has(d)||(i.set(d,h),n.push({axisValue:d,value:h})),i.has(p)||(i.set(p,u),n.push({axisValue:p,value:u}))}n.sort((h,u)=>ni(h.value,t.scales.x)-ni(u.value,t.scales.x));const r=s;let o=0;for(const h of n){for(let u=r.length-1;u>o;u-=1){const d=ni(h.value,t.scales.x),p=ni(r[u].value,t.scales.x);if(d>p){o=u+1;break}}r.splice(o,0,h),o+=1}if(!h2(r,t))return;const a=r.map(h=>h.axisValue),l=tD(t,a),c=tD(e,a);return{axisValues:a,oldDataAxisIndices:l,newDataAxisIndices:c}}function sD(e,t,i){if(i.xValue1Index===i.xValue0Index+1)return e;const s=Vs(e),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),r=s[0].x+(t-i.xValue0Index)*n,o=r+n;return YS(e,r,o)}function nD(e,t){const[i,s]=Vs(e),n=ni(0,t.scales.y);return mc(e,{x:i.x,y:n},{x:s.x,y:n})}function rD(e){const[t,i]=Vs(e);return JE(e,{x:(t.x+i.x)/2,y:(t.y+i.y)/2})}function oD(e,t,i,s,n,r){let o,a;if(n.xValue0Index>=r.xValue1Index){const u=s.findLast(p=>p.xValue1Index<=r.xValue1Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue1,a=d?.yValue1}else if(n.xValue0Index<=r.xValue0Index){const u=s.find(p=>p.xValue0Index>=r.xValue0Index)?.datumIndex,d=u!=null?i.data[u]:void 0;o=d?.xValue0,a=d?.yValue0}if(o==null||a==null)switch(t){case 0:return nD(e,i);case 1:return rD(e)}const l=ni(o,i.scales.x),c=ni(a,i.scales.y),h={x:l,y:c};return mc(e,h,h)}function Kf(e,t){if(t==null)return;const i=bi(e.xValue0),s=bi(e.xValue1);return t.find(n=>bi(n.xValue0)===i&&bi(n.xValue1)===s)?.span}function aD(e,t,i,s,n,r,o){const a=e.data[s.datumIndex],l=a.span,c=Kf(a,n);if(c!=null)o.removed.push({from:c,to:c}),o.moved.push({from:c,to:l}),o.added.push({from:l,to:l});else{const h=oD(l,t,e,i,s,r);o.added.push({from:h,to:l})}}function lD(e,t,i,s,n,r,o){const a=e.data[s.datumIndex],l=a.span,c=Kf(a,n);if(c!=null)o.removed.push({from:l,to:l}),o.moved.push({from:l,to:c}),o.added.push({from:c,to:c});else{const h=oD(l,t,e,i,s,r);o.removed.push({from:l,to:h})}}function cD(e,t,i,s,n){const r=t[n.xValue0Index],o=i.data.find(b=>bi(b.xValue0)===r),a=t[n.xValue1Index],l=i.data.find(b=>bi(b.xValue1)===a);if(o==null||l==null)return;const[{x:c},{x:h}]=Vs(e),u=ni(o.xValue0,i.scales.x),d=ni(o.yValue0,i.scales.y),p=ni(l.xValue1,i.scales.x),g=ni(l.yValue1,i.scales.y);let y=s.data[n.datumIndex].span;return y=mc(y,{x:u,y:d},{x:p,y:g}),y=YS(y,c,h),y}function d2(e,t,i,s,n,r,o,a,l){const c=n+1,h=o.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),u=r.find(S=>S.xValue0Index<=n&&S.xValue1Index>=c),d=t.zeroData,p=e.zeroData;if(h==null&&u!=null){aD(e,i,r,u,d,a,l);return}else if(h!=null&&u==null){lD(t,i,o,h,p,a,l);return}else if(h==null||u==null)return;let g;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?g=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?g=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?g=1:g=0;const y=t.data[h.datumIndex],b=sD(y.span,n,h),m=e.data[u.datumIndex],v=sD(m.span,n,u);if(g===1){const S=cD(b,s,t,e,u);S!=null?(l.removed.push({from:b,to:S}),l.moved.push({from:S,to:v}),l.added.push({from:v,to:v})):lD(t,i,o,h,p,a,l)}else if(g===-1){const S=cD(v,s,e,t,h);S!=null?(l.removed.push({from:b,to:b}),l.moved.push({from:b,to:S}),l.added.push({from:S,to:v})):aD(e,i,r,u,d,a,l)}else l.removed.push({from:b,to:b}),l.moved.push({from:b,to:v}),l.added.push({from:v,to:v})}function p2(e,t,i,s){const n={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:o,newDataAxisIndices:a}=e,l={xValue0Index:Math.max(o.at(0)?.xValue0Index??-1/0,a.at(0)?.xValue0Index??-1/0),xValue1Index:Math.min(o.at(-1)?.xValue1Index??1/0,a.at(-1)?.xValue1Index??1/0)};for(let c=0;c<r.length-1;c+=1)d2(t,i,s,r,c,a,o,l,n);return n}function hD(e,t,i){const{span:s}=t;switch(i){case 0:return Kf(t,e.zeroData)??nD(s,e);case 1:return rD(s)}}function g2(e,t,i){const s=[],n=[];for(const r of t.data){const o=r.span,a=hD(t,r,i);n.push({from:o,to:a})}for(const r of e.data){const o=r.span,a=hD(e,r,i);s.push({from:a,to:o})}return{removed:n,moved:[],added:s}}function yc(e,t,i){if(!iD(e)||!iD(t)||!c2(e,t))return;const s=u2(e,t);return s==null?g2(e,t,i):p2(s,e,t,i)}var Zf=(T(),N(w));function uD(e){return e.type==="continuous"||e.type==="log"}function dD(e){return e.type==="category"}function co(e,t){return e===void 0||t===void 0?e!==void 0||t!==void 0:uD(e)&&uD(t)?e.type===t.type&&(0,Zf.arraysEqual)(e.domain,t.domain)&&(0,Zf.arraysEqual)(e.range,t.range):dD(e)&&dD(t)?e.inset===t.inset&&e.step===t.step&&(0,Zf.arraysEqual)(e.domain,t.domain):!1}function bc(e){return e==null?!1:e.type==="category"?e.domain.every(t=>t!=null):e.domain.every(t=>Number.isFinite(t)||t instanceof Date)&&e.range.every(t=>Number.isFinite(t))}function Qu(e,t){let i;const s=e.map(n=>n.point);switch(t.type){case"linear":i=e2(s);break;case"smooth":i=s2(s,t.tension);break;case"step":i=i2(s,t.position);break}return i.map((n,r)=>({span:n,xValue0:e[r].xDatum,yValue0:e[r].yDatum,xValue1:e[r+1].xDatum,yValue1:e[r+1].yDatum}))}function pD(e,t,i=.001){return Math.abs(e.x-t.x)<i&&Math.abs(e.y-t.y)<i}function Xf({path:e},t){let i;for(const{span:s}of t){const[n,r]=Vs(s),o=i!=null&&pD(i,n)?1:0;$f(e,s,o,!1),i=r}}function Ju(e,t,i){let s;for(const n of i){const[r,o]=JS(n.from,n.to,e),a=s!=null&&pD(s,r)?1:0;Yf(t.path,n.from,n.to,e,a,!1),s=o}}function qf(e,t,i){const s=(a,l)=>Ju(a,l,t.removed),n=(a,l)=>Ju(a,l,t.moved),r=(a,l)=>Ju(a,l,t.added),o=Qf(e,i);return{status:e,path:{addPhaseFn:r,updatePhaseFn:n,removePhaseFn:s},pathProperties:o}}function Qf(e,t){const i=t==="none"?"updated":e,s={fromFn:n=>{let r;return e==="removed"?r={finish:{visible:!1}}:e==="added"?r={start:{visible:!0}}:r={},{phase:ns[i],...r}},toFn:n=>({phase:ns[i]})};return t==="fade"?{fromFn:n=>({opacity:e==="added"?0:n.opacity,...s.fromFn(n)}),toFn:n=>({opacity:e==="removed"?0:1,...s.toFn(n)})}:s}function gD(e,t,i){const s=e.scales.x?.type==="category",n=t.scales.x?.type==="category";if(s!==n||!bc(e.scales.x)||!bc(t.scales.x)||e.strokeData==null||t.strokeData==null)return;let r="updated";t.visible&&!e.visible?r="removed":!t.visible&&e.visible&&(r="added");const o=yc({scales:e.scales,data:e.strokeData.spans},{scales:t.scales,data:t.strokeData.spans},1);if(o==null)return;const a=qf(r,o,"fade"),l=(i?.changed??!0)||!co(e.scales.x,t.scales.x)||!co(e.scales.y,t.scales.y)||r!=="updated";return{status:r,stroke:a,hasMotion:l}}function fD({path:e},{spans:t,phantomSpans:i}){for(let s=0;s<t.length;s+=1){const{span:n}=t[s],r=i[s].span;$f(e,n,0,!1),$f(e,r,1,!0),e.closePath()}}function ed(e,{path:t},i,s){for(let n=0;n<i.length;n+=1){const r=i[n],o=s[n];Yf(t,r.from,r.to,e,0,!1),Yf(t,o.from,o.to,e,1,!0),t.closePath()}}function mD(e,t,i,s){const n=(l,c)=>ed(l,c,t.removed,i.removed),r=(l,c)=>ed(l,c,t.moved,i.moved),o=(l,c)=>ed(l,c,t.added,i.added),a=Qf(e,s);return{status:e,path:{addPhaseFn:o,updatePhaseFn:r,removePhaseFn:n},pathProperties:a}}function yD(e,t){const i=e.scales.x?.type==="category",s=t.scales.x?.type==="category";if(i!==s||!bc(e.scales.x)||!bc(t.scales.x))return;let n="updated";t.visible&&!e.visible?n="removed":!t.visible&&e.visible&&(n="added");const r=yc({scales:e.scales,data:e.fillData.spans},{scales:t.scales,data:t.fillData.spans},0);if(r==null)return;const o=yc({scales:e.scales,data:e.fillData.phantomSpans},{scales:t.scales,data:t.fillData.phantomSpans},0);if(o==null)return;const a=yc({scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},{scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},0);if(a==null)return;const l="none",c=mD(n,r,o,l),h=qf(n,a,l);return{status:n,fill:c,stroke:h}}var f2=(T(),N(w));function xc({id:e},t,i,...s){const n={phase:i?ns[i]:"trailing"};en(e,"markers",t,s,{opacity:0},{opacity:1},n),s.forEach(r=>r.cleanup())}function Jf({id:e},t,...i){en(e,"markers",t,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function em({id:e,nodeDataDependencies:t},i,...s){const n=t.seriesRectWidth;Je(e,"markers",i,s,{fromFn:(a,l)=>{const c=l.midPoint?.x??n;let h=(0,f2.clamp)(0,J0(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:_h,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function vc(e){return{opacity:1,scalingX:1,scalingY:1}}function Mc(e,t){return{x:t.point?.x??NaN,y:t.point?.y??NaN,scalingCenterX:t.point?.x??NaN,scalingCenterY:t.point?.y??NaN}}function Sc(e,{datumIndex:t}){const i=e.getNodeData();if(i===void 0)return;const s=i[t],{point:n}=s??{};if(s==null||n==null)return;const r=4+(n.focusSize??e.getFormattedMarkerStyle(s).size),o=r/2,a=s.point.x-o,l=s.point.y-o;return tt.toCanvas(e.contentGroup,new W(a,l,r,r))}function tm({id:e,visible:t,nodeDataDependencies:i},s,...n){const{seriesRectWidth:r,seriesRectHeight:o}=i;en(e,"path_properties",s,n,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:o,visible:t},finish:{clip:!1,visible:t}})}function td({id:e},t,i,s="add",...n){en(e,t,i,n,{opacity:0},{opacity:1},{phase:s})}function im(e){return t=>({visible:e.getVisible(),opacity:e.getOpacity(),clipScalingX:1,clip:!1})}function id({nodeDataDependencies:e},t){const i=s=>isFinite(s)?s:0;t.clipX=i(e.seriesRectWidth),t.clipY=i(e.seriesRectHeight)}var m2=.125,y2=.25,sd=class extends rr{constructor(e){super({moduleCtx:e,propertyKeys:ao,propertyNames:lo,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:im({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:fn,marker:(t,i)=>({...vc(t),...Mc(t,i)})},clipFocusBox:!1}),this.properties=new ot,this.connectsToYAxis=!0,this.backgroundGroup=new re({name:`${this.id}-background`,zIndex:0}),this._isStacked=void 0}get pickModeAxis(){return"main"}renderToOffscreenCanvas(){return super.renderToOffscreenCanvas()||this.contextNodeData!=null&&(this.contextNodeData.fillData.spans.length>Xu||this.contextNodeData.strokeData.spans.length>Xu)}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}attachPaths([e,t]){this.backgroundGroup.appendChild(e),this.contentGroup.appendChild(t),t.zIndex=-1}detachPaths([e,t]){this.backgroundGroup.removeChild(e),this.contentGroup.removeChild(t)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(e){const t=this.isStacked();return!super.setSeriesIndex(e)&&this._isStacked===t?!1:(this._isStacked=t,t?(this.backgroundGroup.zIndex=[0,e],this.contentGroup.zIndex=[1,e,0]):(this.backgroundGroup.zIndex=[1,e,0,0],this.contentGroup.zIndex=[1,e,0,1]),!0)}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=1}={}}=this,{xKey:r,yKey:o,yFilterKey:a,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{xScaleType:p,yScaleType:g}=this.getScaleInformation({xScale:u,yScale:d}),y={value:`area-stack-${s}-yValue`,values:`area-stack-${s}-yValues`,stack:`area-stack-${s}-yValue-stack`,marker:`area-stack-${s}-yValues-marker`},b=[];(0,Gf.isDefined)(c)&&b.push(Eu(Object.values(y),c)),h&&b.push(sa());const m={invalidValue:null};((0,Gf.isDefined)(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0),await this.requestDataModel(e,t,{props:[us(r,p,{id:"xValue"}),De(o,g,{id:"yValueRaw",...m}),...a!=null?[De(a,g,{id:"yFilterRaw"})]:[],...DM(o,g,{id:"yValueStack",...m,groupId:y.stack}),De(o,g,{id:"yValue",...m,groupId:y.value}),...Jn(o,"window","current",{id:"yValueEnd",...m,groupId:y.values},g),...Jn(o,"normal","current",{id:"yValueCumulative",...m,groupId:y.marker},g),...b],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}getSeriesDomain(e){const{processedData:t,dataModel:i,axes:s}=this;if(!t||!i)return[];const n=s.y;if(e==="x"){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return o?.def.type==="key"&&o.def.valueType==="category"?a:di(dn(a))}const r=this.domainForClippedRange("y",["yValueCumulative"],"xValue");if(n instanceof ra||n instanceof zs)return di(r);{const o=Number.isFinite(r[1]-r[0])?[r[0]>0?0:r[0],r[1]<0?0:r[1]]:[];return di(o)}}getSeriesRange(e,t){const[i,s]=this.domainForVisibleRange("y",["yValueCumulative"],"xValue",t);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValueCumulative"],e,t,i)}createNodeData(){const{axes:e,data:t,processedData:i,dataModel:s}=this,n=e.x,r=e.y;if(!n||!r||!t||!s||i?.type!=="grouped")return;const{yKey:o,xKey:a,xName:l,yName:c,yFilterKey:h,marker:u,label:d,fill:p,stroke:g,connectMissingData:y,interpolation:b}=this.properties,{scale:m}=n,{scale:v}=r,S=this.getSeriesDomain("y"),{isContinuousY:M}=this.getScaleInformation({xScale:m,yScale:v}),I=(m.bandwidth??0)/2,k=s.resolveKeysById(this,"xValue",i),L=s.resolveColumnById(this,"yValueEnd",i),C=s.resolveColumnById(this,"yValueRaw",i),O=s.resolveColumnById(this,"yValueCumulative",i),E=h!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,_=s.resolveColumnById(this,"yValueStack",i),F=(U,H,se)=>{let he;return((0,Gf.isDefined)(this.properties.normalizedTo)?M&&Hh(se):!isNaN(se))&&(he=H),{x:m.convert(U)+I,y:v.convert(he),size:u.size}},j=[],Q=[],{visibleSameStackCount:ne}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let le=!1;const{dataSources:xe}=i,pe=xe.get(this.id)??[];for(const{datumIndex:U}of s.forEachGroupDatum(this,i)){const H=k[U];if(H==null)return;const se=pe[U],he=C[U],fe=O[U],Se=L[U],Ge=Number.isFinite(he),Pe=F(H,+fe,he),Vt=E!=null?E[U]===he:void 0;if(Vt===!1&&(le=!0),Ge&&u&&Q.push({series:this,itemId:o,datum:se,datumIndex:U,midPoint:{x:Pe.x,y:Pe.y},cumulativeValue:Se,yValue:he,xValue:H,yKey:o,xKey:a,point:Pe,fill:u.fill??p,stroke:u.stroke??g,strokeWidth:u.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:Vt}),Ge&&d){const bs=this.getLabelText(he,se,o,"y",S,d,{value:he,datum:se,xKey:a,yKey:o,xName:l,yName:c});j.push({series:this,itemId:o,datum:se,datumIndex:U,x:Pe.x,y:Pe.y,labelText:bs})}}const be=U=>U.flatMap(H=>Array.isArray(H)?Qu(H,b):new Array(H.skip).fill(null)),ue=(U,H)=>({point:{x:m.convert(U)+I,y:v.convert(H)},xDatum:U,yDatum:H}),$=U=>{const H=[];for(const{datumIndexes:[se,he,fe]}of s.forEachGroupDatumTuple(this,i)){const Se=k[he],Ge=_[he],Pe=Ge[U],Vt=Number.isFinite(Pe);if(y&&!Vt)continue;const bs=se!=null?_[se]:void 0,Mn=fe!=null?_[fe]:void 0;let xs=0,vi=!0,Sn=0,Mi=!0;for(let Si=0;Si<=U;Si+=1){const qi=Ge[Si];if(Number.isFinite(qi)){const FR=bs==null||Number.isFinite(bs[Si]),BR=Mn==null||Number.isFinite(Mn[Si]);FR?xs+=qi:vi=!1,BR?Sn+=qi:Mi=!1}}const Xi=H[H.length-1];if(!y&&(!vi||!Mi||!Vt||xs!==Sn))if(!Vt&&Array.isArray(Xi)&&Xi.length===1)H[H.length-1]={skip:1};else{const Si=ue(Se,xs),qi=ue(Se,Sn);Array.isArray(Xi)?Xi.push(Si):Xi!=null&&(Xi.skip+=1),H.push(Vt?[qi]:{skip:0})}else{const Si=y?Pe:Math.max(xs,Sn),qi=ue(Se,Si);Array.isArray(Xi)?Xi.push(qi):Xi!=null?(Xi.skip+=1,H.push([qi])):H.push([qi])}}return be(H)},te=this.seriesGrouping?.stackIndex??0,ie=()=>{const U=Array.from(s.forEachGroupDatum(this,i),({datumIndex:H})=>{const se=k[H],fe=_[H][te];if(!(y&&!Number.isFinite(fe)))return ue(se,0)}).filter(H=>H!=null);return Qu(U,b)},de=$(te),ee=de.map(()=>null);for(let U=te-1;U>=-1;U-=1){let H;for(let se=0;se<ee.length;se+=1)ee[se]==null&&(H??(H=U!==-1?$(U):ie()),ee[se]=H[se])}const J=de.map((U,H)=>U??ee[H]),Y=de.filter(U=>U!=null);return{itemId:o,fillData:{itemId:o,spans:J,phantomSpans:ee},strokeData:{itemId:o,spans:Y},labelData:j,nodeData:Q,scales:this.calculateScaling(),visible:this.visible,stackVisible:ne>0,crossFiltering:le}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{visible:t,animationEnabled:i}=e,[s,n]=e.paths,r=this.contextNodeData?.crossFiltering===!0,{strokeWidth:o,stroke:a,strokeOpacity:l,lineDash:c,lineDashOffset:h,fill:u,fillOpacity:d,opacity:p}=Le(this.getHighlightStyle(),this.properties);n.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:a,strokeWidth:o,strokeOpacity:l*(r?y2:1),lineDash:c,lineDashOffset:h,opacity:p,visible:t||i});const g=Rr(u,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults,this.properties.fillImageDefaults);on(s,{fill:g,stroke:void 0,fillOpacity:d*(r?m2:1)},void 0,this.getShapeFillBBox()),s.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:p,visible:t||i}),id(this,n),id(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("AreaSeries")}updateFillPath(e,t){const[i]=e;i.path.clear(),fD(i,t.fillData),i.markDirty("AreaSeries")}updateStrokePath(e,t){const{spans:i}=t.strokeData,[,s]=e;s.path.clear(),Xf(s,i),s.markDirty("AreaSeries")}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,marker:r,stroke:o,strokeWidth:a,strokeOpacity:l}=this.properties,c=this.getSeriesDomain("x"),h=this.getSeriesDomain("y"),u=this.getShapeFillBBox(),d=r.getStyle();t.each((p,g)=>{const{xValue:y,yValue:b}=g,m=this.getHighlightStyle(i,g.datumIndex),v=Le(m,d,{stroke:o,strokeWidth:a,strokeOpacity:l});this.updateMarkerStyle(r,p,g.datum,g.point,jn(y,b,s,n,c,h),i,v,u,{selected:g.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t)}updateLabelNodes(e){const{labelSelection:t}=e,{enabled:i,fontStyle:s,fontWeight:n,fontSize:r,fontFamily:o,color:a}=this.properties.label;t.each((l,c)=>{const{x:h,y:u,labelText:d}=c;d&&i&&this.visible?(l.fontStyle=s,l.fontWeight=n,l.fontSize=r,l.fontFamily=o,l.textAlign="center",l.textBaseline="bottom",l.text=d,l.x=h,l.y=u-10,l.fill=a,l.fillOpacity=this.getHighlightStyle(!1,c.datumIndex).opacity??1,l.visible=!0):l.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h,marker:u,legendItemName:d}=r,p=n.x,g=n.y;if(!i||!s||!p||!g)return;const y=s.dataSources.get(this.id)?.[e],b=i.resolveKeysById(this,"xValue",s)[e],m=i.resolveColumnById(this,"yValueRaw",s)[e],{xDomain:v,yDomain:S}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(b==null)return;const M=u.getStyle(),I=this.getMarkerStyle(u,y,jn(b,m,o,l,v,S),!1,void 0,M);return this.formatTooltipWithContext(h,{heading:p.formatDatum(b,"tooltip",t,d,y,o),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:g.formatDatum(m,"tooltip",t,d,y,l)}]},{seriesId:t,datum:y,title:c,xKey:o,xName:a,yKey:l,yName:c,...I,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:r,marker:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties,h=!o.enabled||o.fill===void 0,u=h?Rr(e,a,l,c):Rr(o.fill,o.fillGradientDefaults,o.fillPatternDefaults,o.fillImageDefaults);return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:u,fillOpacity:h?i:o.fillOpacity}),enabled:o.enabled||n<=0},line:{stroke:t,strokeOpacity:s,strokeWidth:n,lineDash:r}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:e,id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:o??r??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,contextData:s,paths:n}=e,{animationManager:r}=this.ctx;this.updateAreaPaths(n,s),tm(this,r,...n),Nt([t],Mc),em(this,r,t),Ne(this,"labels",r,i)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateAreaPaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:r,previousContextData:o}=e,[a,l]=r;if(n.visible===!1&&o?.visible===!1||a==null&&l==null)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateAreaPaths(r,n)},h=()=>{t.skipCurrentBatch(),c()};if(n==null||o==null){c(),xc(this,t,"added",i),td(this,"fill_path_properties",t,"add",a),td(this,"stroke_path_properties",t,"add",l),Ne(this,"labels",t,s);return}if(n.crossFiltering!==o.crossFiltering){h();return}const u=yD(n,o);if(u===void 0){h();return}else if(u.status==="no-op")return;xc(this,t,void 0,i),Je(this.id,"fill_path_properties",t,[a],u.fill.pathProperties),Zu(this.id,"fill_path_update",t,[a],u.fill.path),Je(this.id,"stroke_path_properties",t,[l],u.stroke.pathProperties),Zu(this.id,"stroke_path_update",t,[l],u.stroke.path),Ne(this,"labels",t,s),this.ctx.animationManager.animate({id:this.id,groupId:"reset_after_animation",phase:"trailing",from:{},to:{},onComplete:()=>this.updateAreaPaths(r,n)})}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new re}getFormattedMarkerStyle(e){const{xValue:t,yValue:i,xKey:s,yKey:n}=e,r=this.getSeriesDomain("x"),o=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,jn(t,i,s,n,r,o),!0)}computeFocusBounds(e){return Sc(this,e)}};sd.className="AreaSeries",sd.type="area";var b2={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:e=>new sd(e),stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:$n,fillImageDefaults:jr,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Hn,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:$n},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Yn()}}},bD={type:"series",name:"area",chartType:"cartesian",options:HM,create:e=>new sd(e)},WR=(T(),N(w)),x2=(T(),N(w)),v2=(T(),N(w)),M2=(T(),N(w));function sm(e,t){for(const i of t){const s=i.datum;s===void 0?M2.Logger.error("undefined datum"):e.addValue(i,s)}}function nm(e,t){const{x:i,y:s}=t,{nearest:n,distanceSquared:r}=e.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(r)}}var rm=class extends bn{constructor(){super(...arguments),this.direction="vertical"}};f([x],rm.prototype,"direction",2);var xD=class extends rr{constructor(){super(...arguments),this.groupScale=new ic,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(e,t){const i=typeof t=="boolean"?1:.5,s=(0,v2.isFiniteNumber)(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=dn(e)??[NaN,NaN];return typeof t=="boolean"?n[t?0:1]-=(t?1:-1)*s:(n[0]-=s,n[1]+=s),di(n)}getBandScalePadding(){return{inner:.3,outer:.15}}shouldFlipXY(){return!this.isVertical()}isVertical(){return this.properties.direction==="vertical"}getBarDirection(){return this.shouldFlipXY()?"x":"y"}getCategoryDirection(){return this.shouldFlipXY()?"y":"x"}getValueAxis(){const e=this.getBarDirection();return this.axes[e]}getCategoryAxis(){const e=this.getCategoryDirection();return this.axes[e]}getBandwidth(e,t){return Re.is(e.scale)?e.scale.calcBandwidth(this.smallestDataInterval,t):e.scale.bandwidth}xCoordinateRange(e){const t=this.axes[this.getCategoryDirection()],i=t.scale,s=this.getBandwidth(t,0)??0,n=Re.is(i)?s*-.5:0,r=i.convert(e)+n;return[r,r+s]}yCoordinateRange(e){const i=this.axes[this.getBarDirection()].scale,s=e.map(n=>i.convert(n));if(s.length===1){const n=i.convert(0);return[Math.min(s[0],n),Math.max(s[0],n)]}return[Math.min(...s),Math.max(...s)]}updateGroupScale(e){const t=[],{groupScale:i}=this,s=this.getBandwidth(e),{index:n,visibleGroupCount:r}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let a=0;a<r;a++)t.push(String(a));return i.domain=t,i.range=[0,s??0],e instanceof qr?i.paddingInner=e.groupPaddingInner:e instanceof Kr?(i.paddingInner=e.groupPaddingInner,i.round=i.padding!==0):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(e){return this.getBarDirection()==="x"?e==="x"?"y":"x":e}initQuadTree(e){sm(e,this.datumNodesIter())}pickNodeClosestDatum(e){return nm(this,e)}},om=class extends xt{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};f([x],om.prototype,"placement",2),f([x],om.prototype,"padding",2);var $e=class extends rm{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Gi,this.fillPatternDefaults=new Ze,this.fillImageDefaults=new gi,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.crisp=void 0,this.shadow=new ms,this.label=new om,this.tooltip=yn(),this.sparklineMode=!1,this.fastDataProcessing=!1}};f([x],$e.prototype,"xKey",2),f([x],$e.prototype,"xName",2),f([x],$e.prototype,"yKey",2),f([x],$e.prototype,"yName",2),f([x],$e.prototype,"yFilterKey",2),f([x],$e.prototype,"stackGroup",2),f([x],$e.prototype,"normalizedTo",2),f([x],$e.prototype,"fill",2),f([x],$e.prototype,"fillGradientDefaults",2),f([x],$e.prototype,"fillPatternDefaults",2),f([x],$e.prototype,"fillImageDefaults",2),f([x],$e.prototype,"fillOpacity",2),f([x],$e.prototype,"stroke",2),f([x],$e.prototype,"strokeWidth",2),f([x],$e.prototype,"strokeOpacity",2),f([x],$e.prototype,"lineDash",2),f([x],$e.prototype,"lineDashOffset",2),f([x],$e.prototype,"cornerRadius",2),f([x],$e.prototype,"crisp",2),f([x],$e.prototype,"itemStyler",2),f([x],$e.prototype,"shadow",2),f([x],$e.prototype,"label",2),f([x],$e.prototype,"tooltip",2),f([x],$e.prototype,"sparklineMode",2),f([x],$e.prototype,"fastDataProcessing",2);var S2=(T(),N(w));function vD(e,t,i,s){if(t!=null){const[n,r]=t;if(n!==0||r!==1)return!1}if(Re.is(e)){const n=e.calcBandwidth(s)-e.calcBandwidth(i);if(n>0&&n<1)return!1}return!0}var am=e=>(0,S2.isNegative)(e.yValue??0);function Dc(e,t,i){const{startingX:s,startingY:n}=I2(e,t);return{isVertical:e,calculate:(o,a)=>{let l=e?o.x:s,c=e?n:o.y,h=e?o.width:0,u=e?0:o.height;const{opacity:d=1}=o;a&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=a,h=e?a.width:0,u=e?0:a.height,e&&!am(a)?c+=a.height:!e&&am(a)&&(l+=a.width));let p;return o.clipBBox==null?p=void 0:am(o)?p=e?new W(l,c-u,h,u):new W(l-h,c,h,u):p=new W(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:p,opacity:d}},mode:i}}function D2(e,t){return{isVertical:e,calculate:i=>({x:e?i.x:i.x+i.width/2,y:e?i.y+i.height/2:i.y,width:e?i.width:0,height:e?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:t}}function Ic(e){const t=r=>r==null||isNaN(r.x)||isNaN(r.y);return{toFn:(r,o,a)=>a==="removed"&&r.datum==null&&e.mode==="fade"?{...Ac(r,o),opacity:0}:a==="removed"||t(o)?e.calculate(o,r.previousDatum):{x:o.x,y:o.y,width:o.width,height:o.height,clipBBox:o.clipBBox,opacity:o.opacity??1},fromFn:(r,o,a)=>{a==="updated"&&t(o)?a="removed":a==="updated"&&t(r.previousDatum)&&(a="added");let l;a==="added"&&r.previousDatum==null&&e.mode==="fade"?l={...Ac(r,o),opacity:0}:a==="unknown"||a==="added"?l=e.calculate(o,r.previousDatum):l={x:r.x,y:r.y,width:r.width,height:r.height,clipBBox:r.clipBBox,opacity:r.opacity??1};const c=ns[a];return{...l,phase:c}},applyFn:(r,o,a)=>{r.setProperties(o),r.crisp=a==="end"&&(r.datum?.crisp??!1)}}}function I2(e,t){const i=t[e?"y":"x"];let s=1/0,n=0;return i?(e?n=i.scale.convert(Re.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Re.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function Ac(e,{x:t,y:i,width:s,height:n,clipBBox:r,opacity:o=1}){return{x:t,y:i,width:s,height:n,clipBBox:r,opacity:o,crisp:e.datum?.crisp??!1}}function lm(e,t){if(t===void 0)return;const{x:i,y:s,width:n,height:r}=t;return tt.toCanvas(e.contentGroup,new W(i,s,n,r))}function cm(e,t,i,s,n,r){let o=r?.reduced?.diff?.[e];if(o?.changed)return o;const a=A2(s,n);return o==null&&r?.reduced?.diff!=null?(o={changed:!0,added:new Set,updated:new Set,removed:new Set,moved:new Set},a?o.updated=new Set(Array.from(t,({datum:l})=>i(l))):o.added=new Set(Array.from(t,({datum:l})=>i(l)))):a&&(o={changed:!0,added:new Set,updated:new Set(Array.from(t,({datum:l})=>i(l))),removed:new Set,moved:new Set}),o}function MD(e){return typeof e=="object"&&e!==null&&"groupScale"in e}function A2(e,t){if(!t)return!1;const i=e.scales,s=t.scales;if(!co(i.x,s.x)||!co(i.y,s.y))return!0;if(!MD(e)||!MD(t))return!1;const n=e.groupScale,r=t.groupScale;return!co(n,r)}function SD(e,t,i){if(t.enabled&&i){const{x:s,y:n,text:r,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=t;e.setProperties({visible:!0,x:s,y:n,text:r,fill:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:o,textBaseline:a})}else e.visible=!1}var L2={"inside-start":{inside:!0,direction:-1,textAlignment:1},"inside-end":{inside:!0,direction:1,textAlignment:-1},"outside-start":{inside:!1,direction:-1,textAlignment:-1},"outside-end":{inside:!1,direction:1,textAlignment:1}};function DD({isUpward:e,isVertical:t,placement:i,padding:s=0,rect:n}){let r=n.x+n.width/2,o=n.y+n.height/2,a="center",l="middle";if(i!=="inside-center"){const c=(e?1:-1)*(t?-1:1),{direction:h,textAlignment:u}=L2[i],d=(h+1)*.5;if(t){const p=e?n.y+n.height:n.y,g=n.height*c;o=p+g*d+s*u*c,l=u===c?"top":"bottom"}else{const p=e?n.x:n.x+n.width,g=n.width*c;r=p+g*d+s*u*c,a=u===c?"left":"right"}}return{x:r,y:o,textAlign:a,textBaseline:l}}var k2=0,C2=1,w2=2,N2=3,T2=4,Lc=class extends xD{constructor(e){super({moduleCtx:e,propertyKeys:ao,propertyNames:lo,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:Ac,label:fn}}),this.properties=new $e,this.connectsToYAxis=!0,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":void 0}crossFilteringEnabled(){return this.properties.yFilterKey!=null&&(this.seriesGrouping==null||this.seriesGrouping.stackIndex===0)}async processData(e){if(!this.data)return;const{xKey:t,yKey:i,yFilterKey:s,normalizedTo:n,fastDataProcessing:r}=this.properties,{seriesGrouping:{groupIndex:o=this.id}={},data:a}=this,l=this.seriesGrouping?.groupCount??0,h=(this.seriesGrouping?.stackCount??0)>=1||n!=null,u=!r||l>1||h,d=!this.ctx.animationManager.isSkipped(),p=this.getCategoryAxis()?.scale,g=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:b,yScaleType:m}=this.getScaleInformation({xScale:p,yScale:g}),v=`bar-stack-${o}-yValues`,S=`${v}-trailing`,M=this.visible?{}:{forceValue:0},I=[us(t,b,{id:"xValue"}),De(i,m,{id:"yValue-raw",invalidValue:null,...M})];this.crossFilteringEnabled()&&I.push(De(s,m,{id:"yFilterValue",invalidValue:null,...M})),h&&I.push(...Jn(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:v,separateNegative:!0,...M},m),...Jn(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:S,separateNegative:!0,...M},m)),y&&I.push(IM,AM),(0,x2.isFiniteNumber)(n)&&I.push(Eu([v,S],Math.abs(n))),d&&this.processedData&&I.push(na(this.id,this.processedData)),(d||!u)&&I.push(sa());const{dataModel:k,processedData:L}=await this.requestDataModel(e,a,{props:I,groupByKeys:u,groupByData:!u});this.dataAggregationFilters=this.aggregateData(k,L),this.smallestDataInterval=L.reduced?.smallestKeyInterval,this.largestDataInterval=L.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(i==null||t==null)return[];if(e===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",t);return o?.def.type==="key"&&o.def.valueType==="category"?a:this.padBandExtent(a)}const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";let n=this.domainForClippedRange(e,[s],"xValue");const r=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",t):void 0;if(r!=null&&(n=[Math.min(n[0],r[0]),Math.max(n[1],r[1])]),this.getValueAxis()instanceof ra)return di(n);{const o=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return di(o)}}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",t);return[Math.min(s,0),Math.max(n,0)]}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,groupScale:i,dataAggregationFilters:s}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!e||!t||!n||!r)return;const o=t.dataSources?.get(this.id);if(o==null)return;const a=n.scale,l=r.scale,{xKey:c,yKey:h,xName:u,yName:d,legendItemName:p,label:g}=this.properties,y=this.getSeriesDomain("y"),b=r.isReversed(),{barWidth:m,groupIndex:v}=this.updateGroupScale(n),S=i.convert(String(v)),M=Re.is(a)?m*-.5:0,I=e.resolveKeysById(this,"xValue",t),k=e.resolveColumnById(this,"yValue-raw",t),L=this.crossFilteringEnabled()?e.resolveColumnById(this,"yFilterValue",t):void 0,C=!this.ctx.animationManager.isSkipped(),O=$=>a.convert(I[$])+S+M,E=this.properties.crisp??vD(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),_=l.convert(0),F=({datum:$,datumIndex:te,valueIndex:ie,xValue:de,yValue:ee,cumulativeValue:J,phantom:Y,currY:X,prevY:U,x:H,width:se,isPositive:he,yRange:fe,labelText:Se,opacity:Ge,crossScale:Pe=1})=>{const Vt=he!==b,bs=l.convert(X),Mn=l.convert(U),xs=l.convert(fe),vi=this.getBarDirection()==="x",Sn=se*.5*(1-Pe),Mi={x:vi?Math.min(bs,Mn):H+Sn,y:vi?H+Sn:Math.min(bs,Mn),width:vi?Math.abs(Mn-bs):se*Pe,height:vi?se*Pe:Math.abs(Mn-bs)},Xi=new W(Mi.x,Mi.y,Mi.width,Mi.height),Si={x:vi?Math.min(_,xs):H+Sn,y:vi?H+Sn:Math.min(_,xs),width:vi?Math.abs(_-xs):se*Pe,height:vi?se*Pe:Math.abs(_-xs)},qi=this.shouldFlipXY()?Mi.height:Mi.width;return{series:this,itemId:Y?Ri(h,Y):h,datum:$,datumIndex:te,valueIndex:ie,cumulativeValue:J,phantom:Y,xValue:de,yValue:ee,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:qi,lengthMax:qi},x:Si.x,y:Si.y,width:Si.width,height:Si.height,midPoint:{x:Mi.x+Mi.width/2,y:Mi.y+Mi.height/2},opacity:Ge,topLeftCornerRadius:vi!==Vt,topRightCornerRadius:Vt,bottomRightCornerRadius:vi===Vt,bottomLeftCornerRadius:!Vt,clipBBox:Xi,crisp:E,label:Se!=null?{text:Se,...DD({isUpward:Vt,isVertical:!vi,placement:g.placement,padding:g.padding,rect:Mi})}:void 0,missing:ee==null,focusable:!Y}},j=[],Q=[],ne=[],le=($,te,ie,de,ee,J,Y,X)=>{const U=I[$];if(U==null)return;const H=o[$],se=k[$],he=L!=null?Number(L[$]):void 0,fe=se>=0&&!Object.is(se,-0);if(!Number.isFinite(J)||he!=null&&!Number.isFinite(he))return;const Se=se!=null?this.getLabelText(he??se,H,h,"y",y,g,{datum:H,value:he??se,xKey:c,yKey:h,xName:u,yName:d,legendItemName:p}):void 0,Ge=he!=null&&he>se,Pe=F({datum:H,datumIndex:$,valueIndex:te,xValue:U,yValue:he??se,cumulativeValue:he??J,phantom:!1,currY:he!=null?ee+he:J,prevY:ee,x:ie,width:de,isPositive:fe,yRange:Math.max(ee+(he??-1/0),Y),labelText:Se,opacity:X,crossScale:Ge?.6:void 0});if(Q.push(Pe),ne.push(Pe),he!=null){const Vt=F({datum:o[$],datumIndex:$,valueIndex:te,xValue:U,yValue:he,cumulativeValue:he,phantom:!0,currY:J,prevY:ee,x:ie,width:de,isPositive:fe,yRange:Y,labelText:void 0,opacity:X,crossScale:void 0});j.push(Vt)}},[xe,pe]=a.range,be=pe-xe,ue=s?.find($=>$.maxRange>be);if(t.type==="grouped"){const $=m,te=e.hasColumnById(this,"yValue-start"),ie=te?e.resolveColumnById(this,"yValue-start",t):void 0,de=te?e.resolveColumnById(this,"yValue-end",t):void 0,ee=te?e.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:J,valueIndex:Y,group:{aggregation:X}}of e.forEachGroupDatum(this,t)){const U=O(J),H=k[J],se=H>=0&&!Object.is(H,-0),he=te?Number(ie?.[J]):0,fe=te?Number(de?.[J]):H;let Se=fe;te&&(Se=X[ee][se?1:0]),le(J,Y,U,$,he,fe,Se,1)}}else if(ue==null){const $=m;let[te,ie]=this.visibleRange("xValue",n.range);t.input.count<1e3&&(te=0,ie=t.input.count);for(let de=te;de<ie;de+=1){const ee=O(de),J=Number(k[de]);le(de,0,ee,$,0,J,J,1)}}else{const{indexData:$,indices:te}=ue,[ie,de]=this.visibleRange("xValue",n.range,te);for(let ee=ie;ee<de;ee+=1){const J=ee*T2,Y=$[J+k2],X=$[J+C2],U=$[J+w2],H=$[J+N2];if(Y===-1)continue;const se=O((Y+X)/2|0),he=Math.abs(O(X)-O(Y))+m,fe=I[H]!=null?Number(k[H]):NaN,Se=I[U]!=null?Number(k[U]):NaN;if(fe>0){const Ge=Se>=0?Se/fe:1;le(H,0,se,he,0,fe,fe,Ge)}if(Se<0){const Ge=fe<=0?fe/Se:1;le(U,1,se,he,0,Se,Se,Ge)}}}return{itemId:h,nodeData:j.length>0?[...j,...Q]:Q,labelData:ne,scales:this.calculateScaling(),visible:this.visible||C,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new si}getHighlightData(e,t){const i=e.find(s=>s.datum===t.datum&&!s.phantom);return i!=null?[i]:void 0}updateDatumSelection(e){return e.datumSelection.update(e.nodeData,void 0,t=>this.getDatumId(t))}getItemBaseStyle(e,t){const{properties:i}=this,{cornerRadius:s,fillGradientDefaults:n,fillPatternDefaults:r,fillImageDefaults:o}=i,a=this.getHighlightStyle(e,t?.datumIndex);return Ts({fill:a?.fill??i.fill,fillOpacity:a?.fillOpacity??i.fillOpacity,opacity:a?.opacity??1,stroke:a?.stroke??i.stroke,strokeWidth:a?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:a?.strokeOpacity??i.strokeOpacity,lineDash:a?.lineDash??i.lineDash??[],lineDashOffset:a?.lineDashOffset??i.lineDashOffset,cornerRadius:a?.cornerRadius??s},n,r,o)}getItemStyleOverrides(e,t,i,s,n,r){const{id:o,properties:a}=this,{xKey:l,yKey:c,itemStyler:h,fillGradientDefaults:u,fillPatternDefaults:d,fillImageDefaults:p}=a;if(h==null)return;const{xDomain:g,yDomain:y}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")})),b=this.cachedDatumCallback(Ri(e,r?"highlight":"node"),()=>this.callWithContext(h,{seriesId:o,...jn(i,s,l,c,g,y),datum:t,xValue:i,yValue:s,highlighted:r,...n}));return Ts(b,u,d,p)}updateDatumNodes(e){const{shadow:t}=this.properties,i=this.getCategoryDirection()==="x",s=this.getShapeFillBBox();e.datumSelection.each((n,r)=>{const o=this.getItemBaseStyle(e.isHighlight,r),a=this.getItemStyleOverrides(String(r.datumIndex),r.datum,r.xValue,r.yValue,o,e.isHighlight);on(n,o,a,s);const l=a?.cornerRadius??o.cornerRadius;n.topLeftCornerRadius=r.topLeftCornerRadius?l:0,n.topRightCornerRadius=r.topRightCornerRadius?l:0,n.bottomRightCornerRadius=r.bottomRightCornerRadius?l:0,n.bottomLeftCornerRadius=r.bottomLeftCornerRadius?l:0,n.visible=i?(r.clipBBox?.width??r.width)>0:(r.clipBBox?.height??r.height)>0,n.crisp=r.crisp,n.fillShadow=t})}updateLabelSelection(e){const t=this.isLabelEnabled()?e.labelData:[];return e.labelSelection.update(t,i=>{i.pointerEvents=1})}updateLabelNodes(e){e.labelSelection.each((t,i)=>{t.fillOpacity=this.getHighlightStyle(!1,i?.datumIndex).opacity??1,SD(t,this.properties.label,i.label)})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n}=this,{xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,tooltip:u}=n,d=this.getCategoryAxis(),p=this.getValueAxis();if(!i||!s||!d||!p)return;const g=s.dataSources.get(this.id)?.[e],y=i.resolveKeysById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValue-raw",s)[e];if(y==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(e),g,y,b,m,!1)),this.formatTooltipWithContext(u,{heading:d.formatDatum(y,"tooltip",t,c,g,r),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:p.formatDatum(b,"tooltip",t,c,g,a)}]},{seriesId:t,datum:g,title:l,xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:e,stroke:t,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:Ts({fill:e??"rgba(0, 0, 0, 0)",stroke:t??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){const{showInLegend:t}=this.properties;if(e!=="category")return[];const{id:i,ctx:{legendManager:s},visible:n}=this,{yKey:r,yName:o,legendItemName:a}=this.properties;return[{legendType:"category",id:i,itemId:r,seriesId:i,enabled:n&&s.getItemEnabled({seriesId:i,itemId:r}),label:{text:a??o??r},symbol:this.legendItemSymbol(),legendItemName:a,hideInLegend:!t}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t,annotationSelections:i}){const s=Ic(Dc(this.isVertical(),this.axes,"normal"));Je(this.id,"nodes",this.ctx.animationManager,[e],s),Ne(this,"labels",this.ctx.animationManager,t),Ne(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(e){const{datumSelection:t,labelSelection:i,annotationSelections:s,contextData:n,previousContextData:r}=e;this.ctx.animationManager.stopByAnimationGroupId(this.id);const o=cm(this.id,t,this.getDatumId.bind(this),e.contextData,r,this.processedData),a=r==null?"fade":"normal",l=Ic(Dc(this.isVertical(),this.axes,a));Je(this.id,"nodes",this.ctx.animationManager,[t],l,(c,h)=>this.getDatumId(h),o),(o?.changed||!co(n.groupScale,r?.groupScale))&&(Ne(this,"labels",this.ctx.animationManager,i),Ne(this,"annotations",this.ctx.animationManager,...s))}getDatumId(e){return Ri(e.xValue,e.valueIndex,e.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){const t=this.contextNodeData?.nodeData[e].clipBBox;return lm(this,t)}};Lc.className="BarSeries",Lc.type="bar";var ID={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:e=>new Lc(e),stackable:!0,groupable:!0,defaultAxes:Qv,themeTemplate:{series:{direction:"vertical",fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:$n,fillImageDefaults:jr,fillOpacity:1,strokeWidth:{$isUserOption:["./stroke",2,0]},lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$if:[{$or:[{$eq:[{$path:"./placement"},"outside-start"]},{$eq:[{$path:"./placement"},"outside-end"]}]},{$ref:"textColor"},{$ref:"chartBackgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Hn,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}},highlight:Yn()}}},AD={type:"series",name:"bar",chartType:"cartesian",options:oc,create:e=>new Lc(e)},hm=class extends Rt{constructor(){super(...arguments),this.maxSize=30}};f([x,z()],hm.prototype,"maxSize",2),f([x,dp()],hm.prototype,"domain",2);var LD=class extends xt{constructor(){super(...arguments),this.placement="top"}};f([x],LD.prototype,"placement",2);var je=class extends bn{constructor(){super(...arguments),this.label=new LD,this.tooltip=yn(),this.marker=new hm}};f([x],je.prototype,"xKey",2),f([x],je.prototype,"yKey",2),f([x],je.prototype,"sizeKey",2),f([x],je.prototype,"labelKey",2),f([x],je.prototype,"xFilterKey",2),f([x],je.prototype,"yFilterKey",2),f([x],je.prototype,"sizeFilterKey",2),f([x],je.prototype,"xName",2),f([x],je.prototype,"yName",2),f([x],je.prototype,"sizeName",2),f([x],je.prototype,"labelName",2),f([x],je.prototype,"title",2),f([Oe("marker.shape")],je.prototype,"shape",2),f([Oe("marker.size")],je.prototype,"size",2),f([Oe("marker.maxSize")],je.prototype,"maxSize",2),f([Oe("marker.domain")],je.prototype,"domain",2),f([Oe("marker.fillGradientDefaults")],je.prototype,"fillGradientDefaults",2),f([Oe("marker.fillPatternDefaults")],je.prototype,"fillPatternDefaults",2),f([Oe("marker.fillImageDefaults")],je.prototype,"fillImageDefaults",2),f([Oe("marker.fill")],je.prototype,"fill",2),f([Oe("marker.fillOpacity")],je.prototype,"fillOpacity",2),f([Oe("marker.stroke")],je.prototype,"stroke",2),f([Oe("marker.strokeWidth")],je.prototype,"strokeWidth",2),f([Oe("marker.strokeOpacity")],je.prototype,"strokeOpacity",2),f([Oe("marker.lineDash")],je.prototype,"lineDash",2),f([Oe("marker.lineDashOffset")],je.prototype,"lineDashOffset",2),f([Oe("marker.itemStyler")],je.prototype,"itemStyler",2),f([x],je.prototype,"label",2),f([x],je.prototype,"tooltip",2);var O2=class extends Wf{constructor(e,t,i,s){super(e,t,i,s),this.sizeKey=s.properties.sizeKey}},nd=class extends rr{constructor(e){super({moduleCtx:e,propertyKeys:{...ao,label:["labelKey"],size:["sizeKey"]},propertyNames:{...lo,label:["labelName"],size:["sizeName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:fn,marker:vc},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=O2,this.properties=new je,this.sizeScale=new _s}get pickModeAxis(){return"main-category"}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:t,yScale:i}),r=this.sizeScale.type,{xKey:o,yKey:a,sizeKey:l,xFilterKey:c,yFilterKey:h,sizeFilterKey:u,labelKey:d,marker:p}=this.properties,{dataModel:g,processedData:y}=await this.requestDataModel(e,this.data,{props:[De(o,s,{id:"xValue"}),De(a,n,{id:"yValue"}),...c!=null?[De(c,s,{id:"xFilterValue"})]:[],...h!=null?[De(h,n,{id:"yFilterValue"})]:[],...u!=null?[De(u,r,{id:"sizeFilterValue"})]:[],De(l,r,{id:"sizeValue"}),...d?[De(d,"band",{id:"labelValue"})]:[]]}),b=g.resolveProcessedDataIndexById(this,"sizeValue"),m=p.domain?[p.domain[0],p.domain[1]]:void 0;this.sizeScale.domain=m??y.domain.values[b]??[],this.animationState.transition("updateData")}xCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.x.scale.convert(e),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*t;return[a-h,a+h]}yCoordinateRange(e,t,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.y.scale.convert(e[0]),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*t;return[a-h,a+h]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},n=s[e],r=t.resolveProcessedDataDefById(this,n),o=t.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[n],l);return di(dn(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,sizeScale:s,visible:n}=this,{xKey:r,yKey:o,sizeKey:a,xFilterKey:l,yFilterKey:c,sizeFilterKey:h,labelKey:u,xName:d,yName:p,sizeName:g,labelName:y,label:b,marker:m}=this.properties,{placement:v}=b,S=vt.anchor(m.shape),M=e.x,I=e.y;if(!(t&&i&&n&&M&&I))return;const k=t.resolveColumnById(this,"xValue",i),L=t.resolveColumnById(this,"yValue",i),C=a!=null?t.resolveColumnById(this,"sizeValue",i):void 0,O=u!=null?t.resolveColumnById(this,"labelValue",i):void 0,E=l!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,_=c!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,F=h!=null?t.resolveColumnById(this,"sizeFilterValue",i):void 0;let j;u?j=[]:a?j=t.getDomain(this,"sizeValue","value",i):j=[];const Q=M.scale,ne=I.scale,le=(Q.bandwidth??0)/2,xe=(ne.bandwidth??0)/2,pe=[];s.range=[m.size,m.maxSize];const be=Qs.getMeasurer({font:b});return i.dataSources.get(this.id)?.forEach((ue,$)=>{const te=k[$],ie=L[$],de=C?.[$],ee=Q.convert(te)+le,J=ne.convert(ie)+xe;let Y;E!=null&&_!=null&&(Y=E[$]===te&&_[$]===ie,F!=null&&Y&&(Y=F[$]===de));const X=O!=null?O[$]:de,U=this.getLabelText(X,ue,u??a,u!=null?"label":"size",j,b,{value:X,datum:ue,xKey:r,yKey:o,sizeKey:a,labelKey:u,xName:d,yName:p,sizeName:g,labelName:y}),H=be.measureText(String(U)),se=de!=null?s.convert(de):m.size;pe.push({series:this,itemId:o,yKey:o,xKey:r,datum:ue,datumIndex:$,xValue:te,yValue:ie,sizeValue:de,point:{x:ee,y:J,size:se},midPoint:{x:ee,y:J},label:{text:U,...H},anchor:S,placement:v,selected:Y})}),{itemId:o,nodeData:pe,labelData:pe,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?t:[];return i.update(s,void 0,n=>Ri([n.xValue,n.yValue,n.sizeValue,n.label.text]))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,sizeKey:r,labelKey:o,marker:a}=this.properties,l=a.getStyle();this.sizeScale.range=[a.size,a.maxSize];const c=this.getShapeFillBBox();t.each((h,u)=>{const d=this.getHighlightStyle(i,u.datumIndex),p=Le(d,l);this.updateMarkerStyle(a,h,u.datum,u.point,{xKey:s,yKey:n,sizeKey:r,labelKey:o},i,p,c,{selected:u.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=t.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=t.fontStyle,i.fontWeight=t.fontWeight,i.fontSize=t.fontSize,i.fontFamily=t.fontFamily,i.textAlign="left",i.textBaseline="top",i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r,ctx:o}=this,{formatManager:a}=o,{xKey:l,xName:c,yKey:h,yName:u,sizeKey:d,sizeName:p,labelKey:g,labelName:y,title:b,tooltip:m,marker:v,legendItemName:S}=r,M=n.x,I=n.y;if(!i||!s||!M||!I)return;const k=s.dataSources.get(this.id)?.[e],L=i.resolveColumnById(this,"xValue",s)[e],C=i.resolveColumnById(this,"yValue",s)[e],O=this.contextNodeData?.nodeData[e];if(L==null||O==null)return;const E=[];if(this.isLabelEnabled()&&g!=null){const j=i.resolveColumnById(this,"labelValue",s)[e],Q=a.format(this.callWithContext.bind(this),{type:"category",value:j,datum:k,seriesId:t,legendItemName:S,key:g,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});E.push({label:y,fallbackLabel:g,value:Q??_n(j)})}if(E.push({label:c,fallbackLabel:l,value:M.formatDatum(L,"tooltip",t,S,k,l)},{label:u,fallbackLabel:h,value:I.formatDatum(C,"tooltip",t,S,k,h)}),d!=null){const j=i.resolveColumnById(this,"sizeValue",s)[e],Q=i.getDomain(this,"sizeValue","value",s),ne=a.format(this.callWithContext.bind(this),{type:"number",value:j,datum:k,seriesId:t,legendItemName:S,key:d,source:"tooltip",property:"size",boundSeries:this.getFormatterContext("size"),domain:Q,fractionDigits:void 0});E.push({label:p,fallbackLabel:d,value:ne??_n(j)})}const _=v.getStyle(),F=this.getMarkerStyle(v,k,{xKey:l,yKey:h,sizeKey:d,labelKey:g,highlighted:!0},!1,void 0,_);return this.formatTooltipWithContext(m,{title:b,symbol:this.legendItemSymbol(),data:E},{seriesId:t,datum:k,title:h,xKey:l,xName:c,yKey:h,yName:u,sizeKey:d,sizeName:p,labelKey:g,labelName:y,...F,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(){const{id:e,ctx:{legendManager:t},visible:i}=this,{yKey:s,yName:n,title:r}=this.properties;return[{legendType:"category",id:e,itemId:s,seriesId:e,enabled:i&&t.getItemEnabled({seriesId:e,itemId:s}),label:{text:r??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:e,labelSelection:t}){Jf(this,this.ctx.animationManager,e),Ne(this,"labels",this.ctx.animationManager,t)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new re}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,sizeKey:s,labelKey:n,marker:r}=this.properties;return this.getMarkerStyle(r,e,{xKey:t,yKey:i,sizeKey:s,labelKey:n},!1,e.point.size)}computeFocusBounds(e){return Sc(this,e)}};nd.className="BubbleSeries",nd.type="bubble";var E2={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:e=>new nd(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,maxSize:30,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:$n,fillImageDefaults:jr,fillOpacity:.8,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Yn()}}},kD={type:"series",name:"bubble",chartType:"cartesian",options:g1,create:e=>new nd(e)},um=(T(),N(w)),at=class extends bn{constructor(){super(...arguments),this.fillGradientDefaults=new Gi,this.fillPatternDefaults=new Ze,this.fillImageDefaults=new gi,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.areaPlot=!1,this.aggregation="sum",this.shadow=new ms,this.label=new xt,this.tooltip=yn()}};f([x],at.prototype,"xKey",2),f([x],at.prototype,"yKey",2),f([x],at.prototype,"xName",2),f([x],at.prototype,"yName",2),f([x],at.prototype,"fill",2),f([x],at.prototype,"fillGradientDefaults",2),f([x],at.prototype,"fillPatternDefaults",2),f([x],at.prototype,"fillImageDefaults",2),f([x],at.prototype,"fillOpacity",2),f([x],at.prototype,"stroke",2),f([x],at.prototype,"strokeWidth",2),f([x],at.prototype,"strokeOpacity",2),f([x],at.prototype,"lineDash",2),f([x],at.prototype,"lineDashOffset",2),f([x],at.prototype,"cornerRadius",2),f([x],at.prototype,"areaPlot",2),f([x],at.prototype,"bins",2),f([x],at.prototype,"aggregation",2),f([x],at.prototype,"binCount",2),f([x],at.prototype,"shadow",2),f([x],at.prototype,"label",2),f([x],at.prototype,"tooltip",2);var CD=10,rd=class extends rr{constructor(e){super({moduleCtx:e,propertyKeys:ao,propertyNames:lo,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:Ac,label:fn}}),this.properties=new at,this.calculatedBins=[]}deriveBins(e){const t=Al(e[0],e[1],CD).ticks,i=Ll(e[0],e[1],CD),[s]=t,n=r=>[r,r+i];return[[s-i,s],...t.map(n)]}calculateNiceBins(e,t){const i=Math.floor(e[0]),s=e[1],n=t||1,{start:r,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(r,s,o,n)}getBins(e,t,i,s){const n=[],r=this.calculatePrecision(i);for(let o=0;o<s;o++){const a=Math.round((e+o*i)*r)/r;let l=Math.round((e+(o+1)*i)*r)/r;o===s-1&&(l=Math.max(l,t)),n[o]=[a,l]}return n}calculatePrecision(e){let t=10;if(isFinite(e)&&e>0)for(;e<1;)t*=10,e*=10;return t}calculateNiceStart(e,t,i){const s=Math.abs(t-e)/i,n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return{start:Math.floor(e/r)*r,binSize:s}}async processData(e){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:t,yKey:i,areaPlot:s,aggregation:n}=this.properties,r=this.axes.x?.scale,o=this.axes.y?.scale,{xScaleType:a,yScaleType:l}=this.getScaleInformation({yScale:o,xScale:r}),c=[us(t,a),LM];if(i){let u=uf("groupAgg");n==="count"||(n==="sum"?u=gM("groupAgg"):n==="mean"&&(u=fM("groupAgg"))),s&&(u=df("groupAgg",u)),c.push(De(i,l,{invalidValue:void 0}),u)}else{c.push(MM("count"));let u=uf("groupAgg");s&&(u=df("groupAgg",u)),c.push(u)}const h=u=>{const d=di(u.domain.keys[0]);if(d.length===0)return u.domain.groups=[],()=>[];const p=(0,um.isNumber)(this.properties.binCount)?this.calculateNiceBins(d,this.properties.binCount):this.properties.bins??this.deriveBins(d),g=p.length;return this.calculatedBins=[...p],y=>{let b=y[0];if((0,um.isDate)(b)&&(b=b.getTime()),!(0,um.isNumber)(b))return[];for(let m=0;m<g;m++){const v=p[m];if(b>=v[0]&&b<v[1]||m===g-1&&b<=v[1])return v}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(na(this.id,this.processedData,!1)),await this.requestDataModel(e,this.data,{props:c,groupByFn:h}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(e){const{processedData:t,dataModel:i}=this;if(!t||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",t),n=this.calculatedBins?.[0][0],r=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return di(e==="x"?[n,r]:s)}getSeriesRange(e,[t,i]){const{dataModel:s,processedData:n}=this;if(!s||n?.type!=="grouped")return[NaN,NaN];const r=this.axes.x.scale,o=0;let a=-1/0;return n.groups.forEach(({keys:l,aggregation:c})=>{const[[h,u]=[0,0]]=c,[d,p]=l,[g,y]=wt([r.convert(d),r.convert(p)]);if(y>=t&&g<=i){const b=h+u;a=Math.max(a,b)}}),o>a?[NaN,NaN]:[o,a]}frequency(e){return e.datumIndices.reduce((t,i)=>t+i.length,0)}createNodeData(){const{id:e,axes:t,processedData:i,dataModel:s}=this,n=t.x,r=t.y;if(!n||!r||!s)return;const{scale:o}=n,{scale:a}=r,{xKey:l,yKey:c,xName:h,yName:u,legendItemName:d}=this.properties,p=this.properties.label.formatter,g=[],y={itemId:this.properties.yKey??this.id,nodeData:g,labelData:g,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||i==null||i.type!=="grouped"||(i.groups.forEach((b,m)=>{const{keys:v,aggregation:S}=b,[[M,I]=[0,0]]=S,k=this.frequency(b),L=v,[C,O]=L,E=[...s.forEachDatum(this,i,b)],_=o.convert(C),F=o.convert(O),j=M+I,Q=a.convert(0),ne=a.convert(j),le=Math.abs(F-_),xe=Math.abs(ne-Q),pe=Math.min(_,F),be=Math.min(Q,ne);let ue;j!==0&&(ue={x:pe+le/2,y:be+xe/2,text:this.cachedDatumCallback(Ri(m,"label"),()=>p?.({value:j,datum:E,seriesId:e,xKey:l,yKey:c,xName:h,yName:u}))??r.formatDatum(j,"series-label",e,d,E,c)});const $={x:pe+le/2,y:be+xe/2},te=r.isReversed();g.push({series:this,datumIndex:m,datum:E,aggregatedValue:j,frequency:k,domain:L,yKey:c,xKey:l,x:pe,y:be,xValue:_,yValue:ne,width:le,height:xe,midPoint:$,topLeftCornerRadius:!te,topRightCornerRadius:!te,bottomRightCornerRadius:te,bottomLeftCornerRadius:te,label:ue,crisp:!0})}),g.sort((b,m)=>b.x-m.x)),y}nodeFactory(){return new si}updateDatumSelection(e){const{nodeData:t,datumSelection:i}=e;return i.update(t,void 0,s=>s.domain.join("_"))}getItemBaseStyle(e,t){const{properties:i}=this,s=this.getHighlightStyle(e,t?.datumIndex);return Ts({fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??this.getStrokeWidth(i.strokeWidth),strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset,cornerRadius:s?.cornerRadius??i.cornerRadius,opacity:s?.opacity??1},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}updateDatumNodes(e){const{isHighlight:t}=e,{shadow:i}=this.properties,s=this.getShapeFillBBox();e.datumSelection.each((n,r)=>{const o=this.getItemBaseStyle(t,r),{cornerRadius:a}=o,{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:u}=r;on(n,o,void 0,s),n.topLeftCornerRadius=l?a:0,n.topRightCornerRadius=c?a:0,n.bottomRightCornerRadius=h?a:0,n.bottomLeftCornerRadius=u?a:0,n.crisp=r.crisp,n.fillShadow=i,n.visible=r.height>0})}updateLabelSelection(e){const{labelData:t,labelSelection:i}=e;return i.update(t,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(e){const{fontStyle:t,fontWeight:i,fontFamily:s,fontSize:n,color:r}=this.properties.label,o=this.isLabelEnabled();e.labelSelection.each((a,l)=>{o&&l?.label?(a.text=l.label.text,a.x=l.label.x,a.y=l.label.y,a.fontStyle=t,a.fontWeight=i,a.fontFamily=s,a.fontSize=n,a.fill=r,a.visible=!0,a.fillOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1):a.visible=!1})}initQuadTree(e){const{value:t}=this.contentGroup.children().next();t instanceof re&&sm(e,t.children())}pickNodeClosestDatum(e){return nm(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r,ctx:{localeManager:o}}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u,legendItemName:d}=r,p=n.x,g=n.y;if(!i||s?.type!=="grouped"||!p||!g)return;const y=s.groups[e],{aggregation:b,keys:m}=y,[[v,S]=[0,0]]=b,M=this.frequency(y),I=m,[k,L]=I,C=v+S,O={data:[...i.forEachDatum(this,s,y)],aggregatedValue:C,frequency:M,domain:I},E=[{label:l,fallbackLabel:a,value:`${p.formatDatum(k,"tooltip",t,d,O,a)} - ${p.formatDatum(L,"tooltip",t,d,O,a)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:g.formatDatum(M,"tooltip",t,d,O,c)}];if(c!=null){let _;switch(r.aggregation){case"sum":_=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":_=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":_=o.t("seriesHistogramTooltipCount",{yName:h??c});break}E.push({label:_,value:g.formatDatum(C,"tooltip",t,d,O,c)})}return this.formatTooltipWithContext(u,{symbol:this.legendItemSymbol(),data:E},{seriesId:t,datum:O,title:h,xKey:a,xName:l,yKey:c,yName:h,xRange:[k,L],frequency:M,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:e,fillOpacity:t,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l,fillImageDefaults:c}=this.properties;return{marker:Ts({fill:e??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:t,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o},a,l,c)}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:r,showInLegend:o}=this.properties;return[{legendType:"category",id:t,itemId:n,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:r??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:e,labelSelection:t}){const i=Ic(Dc(!0,this.axes,"normal"));Je(this.id,"datums",this.ctx.animationManager,[e],i),Ne(this,"labels",this.ctx.animationManager,t)}animateWaitingUpdateReady(e){const t=Ic(Dc(!0,this.axes,"normal")),i=cm(this.id,e.datumSelection,s=>Ri(s.domain),e.contextData,e.previousContextData,this.processedData);Je(this.id,"datums",this.ctx.animationManager,[e.datumSelection],t,(s,n)=>Ri(n.domain),i),i?.changed&&Ne(this,"labels",this.ctx.animationManager,e.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:e}){return lm(this,this.contextNodeData?.nodeData[e])}};rd.className="HistogramSeries",rd.type="histogram";var P2={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:e=>new rd(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:$n,fillImageDefaults:jr,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"chartBackgroundColor"}},shadow:{enabled:!1,color:Hn,xOffset:3,yOffset:3,blur:5},highlight:Yn()}}},wD={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:f1,create:e=>new rd(e)},R2=(T(),N(w)),It=class extends bn{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new Aa,this.marker=new Rt,this.label=new xt,this.tooltip=yn(),this.connectMissingData=!1,this.sparklineMode=!1}};f([x],It.prototype,"xKey",2),f([x],It.prototype,"yKey",2),f([x],It.prototype,"xName",2),f([x],It.prototype,"yName",2),f([x],It.prototype,"yFilterKey",2),f([x],It.prototype,"stackGroup",2),f([x],It.prototype,"normalizedTo",2),f([x],It.prototype,"title",2),f([x],It.prototype,"stroke",2),f([x],It.prototype,"strokeWidth",2),f([x],It.prototype,"strokeOpacity",2),f([x],It.prototype,"lineDash",2),f([x],It.prototype,"lineDashOffset",2),f([x],It.prototype,"interpolation",2),f([x],It.prototype,"marker",2),f([x],It.prototype,"label",2),f([x],It.prototype,"tooltip",2),f([x],It.prototype,"connectMissingData",2),f([x],It.prototype,"sparklineMode",2);var _2=.25,kc=class extends rr{constructor(e){super({moduleCtx:e,propertyKeys:ao,propertyNames:lo,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:im({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:fn,marker:(t,i)=>({...vc(t),...Mc(t,i)})},clipFocusBox:!1}),this.properties=new It,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(e){if(this.data==null)return;const{data:t,visible:i,seriesGrouping:{groupIndex:s=this.id,stackCount:n=0}={}}=this,{xKey:r,yKey:o,yFilterKey:a,connectMissingData:l,normalizedTo:c}=this.properties,h=!this.ctx.animationManager.isSkipped(),u=this.axes.x?.scale,d=this.axes.y?.scale,{isContinuousX:p,xScaleType:g,yScaleType:y}=this.getScaleInformation({xScale:u,yScale:d}),b=n>=1||c!=null,m={invalidValue:null};l&&b&&(m.invalidValue=0),b&&!i&&(m.forceValue=0);const v=[];if((!p||b)&&v.push(us(r,g,{id:"xKey"})),v.push(De(r,g,{id:"xValue"}),De(o,y,{id:"yValueRaw",...m,invalidValue:void 0})),a!=null&&v.push(De(a,y,{id:"yFilterRaw"})),b){const I=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];v.push(...Jn(o,"window","current",{id:"yValueEnd",...m,groupId:I[0]},y),...Jn(o,"window-trailing","current",{id:"yValueStart",...m,groupId:I[1]},y),...Jn(o,"normal","current",{id:"yValueCumulative",...m,groupId:I[2]},y)),(0,R2.isDefined)(c)&&v.push(Eu([I[0],I[1],I[2]],c))}h&&(v.push(sa(p?["xValue"]:void 0)),this.processedData&&v.push(na(this.id,this.processedData)));const{dataModel:S,processedData:M}=await this.requestDataModel(e,t,{props:v,groupByKeys:b,groupByData:!b});this.dataAggregationFilters=this.aggregateData(S,M),this.animationState.transition("updateData")}xCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.x.scale.convert(e),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}yCoordinateRange(e,t){const{marker:i}=this.properties,s=this.axes.y.scale.convert(e[0]),n=i.enabled?.5*i.size*t:0;return[s-n,s+n]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!t||!i)return[];if(e==="x"){const r=t.resolveProcessedDataDefById(this,"xValue"),o=t.getDomain(this,"xValue","value",i);return r?.def.type==="value"&&r.def.valueType==="category"?o:di(dn(o))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue");return di(n)}getSeriesRange(e,t){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",t)}getVisibleItems(e,t,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],e,t,i)}aggregateData(e,t){}createNodeData(){const{dataModel:e,processedData:t,axes:i,dataAggregationFilters:s}=this,n=i.x,r=i.y;if(!e||!t||!n||!r)return;const{xKey:o,yKey:a,yFilterKey:l,xName:c,yName:h,marker:u,label:d,connectMissingData:p,interpolation:g,legendItemName:y}=this.properties,b=this.dataModel?.hasColumnById(this,"yValueEnd"),m=n.scale,v=r.scale,S=(m.bandwidth??0)/2,M=(v.bandwidth??0)/2,I=u.enabled?u.size:0,k=t.dataSources.get(this.id)??[],L=e.resolveColumnById(this,"xValue",t),C=e.resolveColumnById(this,"yValueRaw",t),O=b?e.resolveColumnById(this,"yValueEnd",t):void 0,E=b?e.resolveColumnById(this,"yValueCumulative",t):C,_=l!=null?e.resolveColumnById(this,"yFilterRaw",t):void 0,F=this.getSeriesDomain("y"),j={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},Q=[];let ne;const le=Y=>{const X=k[Y],U=L[Y],H=C[Y],se=O?.[Y],he=_?.[Y],fe=m.convert(U)+S,Se=v.convert(E[Y])+M;if(!Number.isFinite(fe))return;if(H!=null){const Pe=d.enabled?this.getLabelText(H,X,a,"y",F,d,{value:H,datum:X,xKey:o,yKey:a,xName:c,yName:h,legendItemName:y}):void 0;Q.push({series:this,datum:X,datumIndex:Y,yKey:a,xKey:o,point:{x:fe,y:Se,size:I},midPoint:{x:fe,y:Se},cumulativeValue:se,yValue:H,xValue:U,capDefaults:j,labelText:Pe,selected:he})}if(ne==null)return;const Ge=ne[ne.length-1];if(H!=null){const Pe={point:{x:fe,y:Se},xDatum:U,yDatum:H};Array.isArray(Ge)?Ge.push(Pe):Ge!=null?(Ge.skip+=1,ne.push([Pe])):ne.push([Pe])}else p||(Array.isArray(Ge)||Ge==null?ne.push({skip:0}):Ge.skip+=1)},[xe,pe]=m.range,be=pe-xe,$=s?.find(Y=>Y.maxRange>be)?.indices;let[te,ie]=this.visibleRange("xValue",n.range,$);te=Math.max(te-1,0),ie=Math.min(ie+1,$?.length??L.length),t.input.count<1e3&&(te=0,ie=t.input.count),$==null&&(ne=[]);for(let Y=te;Y<ie;Y+=1)le($?.[Y]??Y);const de=ne?.flatMap(Y=>Array.isArray(Y)?Qu(Y,g):[]),ee=de!=null?{itemId:a,spans:de}:void 0,J=_?.some((Y,X)=>Y===C[X])??!1;return{itemId:a,nodeData:Q,labelData:Q,strokeData:ee,scales:this.calculateScaling(),visible:this.visible,crossFiltering:J}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(e){const{paths:[t],visible:i,animationEnabled:s}=e,n=this.contextNodeData?.crossFiltering===!0,{strokeWidth:r,stroke:o,strokeOpacity:a,lineDash:l,lineDashOffset:c,opacity:h}=Le(this.getHighlightStyle(),this.properties);t.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:h,stroke:o,strokeWidth:r,strokeOpacity:a*(n?_2:1),lineDash:l,lineDashOffset:c}),s||(t.visible=i),id(this,t)}getMarkerItemBaseStyle(e){const{properties:t}=this,{marker:i}=t,s=this.getHighlightStyle(e);return Ts({size:i.size,shape:i.shape,fill:s?.fill??i.fill,fillOpacity:s?.fillOpacity??i.fillOpacity,stroke:s?.stroke??i.stroke,strokeWidth:s?.strokeWidth??i.strokeWidth,strokeOpacity:s?.strokeOpacity??i.strokeOpacity,lineDash:s?.lineDash??i.lineDash,lineDashOffset:s?.lineDashOffset??i.lineDashOffset,opacity:s?.opacity??1},i.fillGradientDefaults,i.fillPatternDefaults,i.fillImageDefaults)}getMarkerItemStyleOverrides(e,t,i,s,n,r){const{id:o,properties:a}=this,{xKey:l,yKey:c,marker:h}=a,{itemStyler:u}=h;if(u!=null)return this.cachedDatumCallback(Ri(e,r?"highlight":"node"),()=>{const d=this.getSeriesDomain("x"),p=this.getSeriesDomain("y");return this.callWithContext(u,{seriesId:o,...jn(i,s,l,c,d,p),datum:t,highlighted:r,...n})})}updateMarkerSelection(e){let{nodeData:t}=e;const{markerSelection:i}=e;return t=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?t:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(t,void 0,n=>Ri(n.xValue))}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,stroke:r,strokeWidth:o,strokeOpacity:a,marker:l}=this.properties,c=this.getSeriesDomain("x"),h=this.getSeriesDomain("y"),u=this.ctx.animationManager.isSkipped(),d=this.getShapeFillBBox(),p=l.getStyle();t.each((g,y)=>{const{xValue:b,yValue:m}=y,v=this.getHighlightStyle(i,y.datumIndex),S=Le(v,p,{stroke:r,strokeWidth:o,strokeOpacity:a});this.updateMarkerStyle(l,g,y.datum,y.point,jn(b,m,s,n,c,h),i,S,d,{applyTranslation:u,selected:y.selected})}),i||l.markClean()}updateLabelSelection(e){return e.labelSelection.update(this.isLabelEnabled()?e.labelData:[])}updateLabelNodes(e){const{enabled:t,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:r,color:o}=this.properties.label;e.labelSelection.each((a,l)=>{t&&l?.labelText?(a.fontStyle=i,a.fontWeight=s,a.fontSize=n,a.fontFamily=r,a.textAlign="center",a.textBaseline="bottom",a.text=l.labelText,a.x=l.point.x,a.y=l.point.y-10,a.fill=o,a.visible=!0,a.fillOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1):a.visible=!1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h,legendItemName:u}=r,d=n.x,p=n.y;if(!i||!s||!d||!p)return;const g=s.dataSources.get(this.id)?.[e],y=i.resolveColumnById(this,"xValue",s)[e],b=i.resolveColumnById(this,"yValueRaw",s)[e];if(y==null)return;const m=this.getMarkerItemBaseStyle(!1);return Object.assign(m,this.getMarkerItemStyleOverrides(String(e),g,y,b,m,!1)),this.formatTooltipWithContext(h,{heading:d.formatDatum(y,"tooltip",t,u,g,o),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(b,"tooltip",t,u,g,l)}]},{seriesId:t,datum:g,title:c,xKey:o,xName:a,yKey:l,yName:c,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const e="rgba(0, 0, 0, 0)",{stroke:t,strokeOpacity:i,strokeWidth:s,lineDash:n,marker:r}=this.properties;return{marker:{...this.getMarkerStyle(r,void 0,void 0,!1,void 0,{fill:r.fill??e,stroke:r.stroke??t??e}),enabled:r.enabled},line:{stroke:t??e,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(e){if(e!=="category")return[];const{id:t,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,title:o,legendItemName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:t,itemId:n,legendItemName:a,seriesId:t,enabled:s&&i.getItemEnabled({seriesId:t,itemId:n}),label:{text:a??o??r??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(e){this.updateLinePaths(e.paths,e.contextData)}plotNodeDataPoints(e,t){if(t.length===0)return;const i=t[0].point;e.moveTo(i.x,i.y);for(let s=1;s<t.length;s+=1){const{x:n,y:r}=t[s].point;e.lineTo(n,r)}}updateLinePaths(e,t){const i=t.strokeData?.spans,[s]=e;s.path.clear(),i!=null?Xf(s,i):this.plotNodeDataPoints(s.path,t.nodeData),s.markDirty("LineSeries")}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s,contextData:n,paths:r}=e,{animationManager:o}=this.ctx;this.updateLinePaths(r,n),tm(this,o,...r),Nt([t],Mc),em(this,o,t),Ne(this,"labels",o,i),Ne(this,"annotations",o,...s)}animateReadyResize(e){const{contextData:t,paths:i}=e;this.updateLinePaths(i,t),super.animateReadyResize(e)}animateWaitingUpdateReady(e){const{animationManager:t}=this.ctx,{markerSelection:i,labelSelection:s,annotationSelections:n,contextData:r,paths:o,previousContextData:a}=e,[l]=o;if(r.visible===!1&&a?.visible===!1)return;this.resetMarkerAnimation(e),this.resetLabelAnimation(e);const c=()=>{this.resetPathAnimation(e),this.updateLinePaths(o,r)},h=()=>{t.skipCurrentBatch(),c()};if(r==null||a==null){c(),xc(this,t,"added",i),td(this,"path_properties",t,"add",l),Ne(this,"labels",t,s),Ne(this,"annotations",t,...n);return}if(r.crossFiltering!==a.crossFiltering){h();return}const u=gD(r,a,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;Je(this.id,"path_properties",t,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(o,r):u.status==="removed"?this.updateLinePaths(o,a):Zu(this.id,"path_update",t,[l],u.stroke.path),u.hasMotion&&(xc(this,t,void 0,i),Ne(this,"labels",t,s),Ne(this,"annotations",t,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new re}getFormattedMarkerStyle(e){const{xKey:t,yKey:i}=this.properties,{xValue:s,yValue:n}=e,r=this.getSeriesDomain("x"),o=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,e.datum,jn(s,n,t,i,r,o),!0)}computeFocusBounds(e){return Sc(this,e)}};kc.className="LineSeries",kc.type="line";var ND={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:e=>new kc(e),stackable:!0,defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{stroke:bu,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:{$isUserOption:["./stroke",1,0]},fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:$n,fillImageDefaults:jr},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Yn()}}},TD={type:"series",name:"line",chartType:"cartesian",options:_u,create:e=>new kc(e)},OD=class extends xt{constructor(){super(...arguments),this.placement="top"}};f([x],OD.prototype,"placement",2);var qe=class extends bn{constructor(){super(...arguments),this.label=new OD,this.tooltip=yn(),this.marker=new Rt}};f([x],qe.prototype,"xKey",2),f([x],qe.prototype,"yKey",2),f([x],qe.prototype,"labelKey",2),f([x],qe.prototype,"xFilterKey",2),f([x],qe.prototype,"yFilterKey",2),f([x],qe.prototype,"xName",2),f([x],qe.prototype,"yName",2),f([x],qe.prototype,"labelName",2),f([x],qe.prototype,"title",2),f([Oe("marker.shape")],qe.prototype,"shape",2),f([Oe("marker.size")],qe.prototype,"size",2),f([Oe("marker.fill")],qe.prototype,"fill",2),f([Oe("marker.fillGradientDefaults")],qe.prototype,"fillGradientDefaults",2),f([Oe("marker.fillPatternDefaults")],qe.prototype,"fillPatternDefaults",2),f([Oe("marker.fillImageDefaults")],qe.prototype,"fillImageDefaults",2),f([Oe("marker.fillOpacity")],qe.prototype,"fillOpacity",2),f([Oe("marker.stroke")],qe.prototype,"stroke",2),f([Oe("marker.strokeWidth")],qe.prototype,"strokeWidth",2),f([Oe("marker.strokeOpacity")],qe.prototype,"strokeOpacity",2),f([Oe("marker.lineDash")],qe.prototype,"lineDash",2),f([Oe("marker.lineDashOffset")],qe.prototype,"lineDashOffset",2),f([Oe("marker.itemStyler")],qe.prototype,"itemStyler",2),f([x],qe.prototype,"label",2),f([x],qe.prototype,"tooltip",2);var od=class extends rr{constructor(e){super({moduleCtx:e,propertyKeys:{...ao,label:["labelKey"]},propertyNames:{...lo,label:["labelName"]},categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:vc,label:fn},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new qe}get pickModeAxis(){return"main-category"}async processData(e){if(this.data==null||!this.visible)return;const t=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:t,yScale:i}),{xKey:r,yKey:o,xFilterKey:a,yFilterKey:l,labelKey:c}=this.properties;await this.requestDataModel(e,this.data,{props:[De(r,s,{id:"xValue"}),De(o,n,{id:"yValue"}),...a!=null?[De(a,s,{id:"xFilterValue"})]:[],...l!=null?[De(l,n,{id:"yFilterValue"})]:[],...c?[De(c,"band",{id:"labelValue"})]:[]]}),this.animationState.transition("updateData")}xCoordinateRange(e,t){const i=this.axes.x.scale.convert(e),s=.5*this.properties.size*t;return[i-s,i+s]}yCoordinateRange(e,t){const i=this.axes.y.scale.convert(e[0]),s=.5*this.properties.size*t;return[i-s,i+s]}getSeriesDomain(e){const{dataModel:t,processedData:i}=this;if(!i||!t)return[];const s={x:"xValue",y:"yValue"},n=s[e],r=t.resolveProcessedDataDefById(this,n),o=t.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[e==="x"?"y":"x"],c=this.domainForClippedRange(e,[n],l);return di(dn(c))}getSeriesRange(e,t){return this.domainForVisibleRange("y",["yValue"],"xValue",t)}getVisibleItems(e,t,i){return this.countVisibleItems("xValue",["yValue"],e,t,i)}createNodeData(){const{axes:e,dataModel:t,processedData:i,visible:s}=this,{xKey:n,yKey:r,xFilterKey:o,yFilterKey:a,labelKey:l,xName:c,yName:h,labelName:u,marker:d,label:p}=this.properties,{placement:g}=p,y=vt.anchor(d.shape),b=e.x,m=e.y;if(!(t&&i&&s&&b&&m))return;const v=t.resolveColumnById(this,"xValue",i),S=t.resolveColumnById(this,"yValue",i),M=l!=null?t.resolveColumnById(this,"labelValue",i):void 0,I=o!=null?t.resolveColumnById(this,"xFilterValue",i):void 0,k=a!=null?t.resolveColumnById(this,"yFilterValue",i):void 0,L=b.scale,C=m.scale,O=(L.bandwidth??0)/2,E=(C.bandwidth??0)/2,_=[],F=l==null?[]:this.getSeriesDomain("y"),j=Qs.getMeasurer({font:p});return(i.dataSources.get(this.id)??[]).forEach((ne,le)=>{const xe=v[le],pe=S[le],be=L.convert(xe)+O,ue=C.convert(pe)+E,$=I!=null&&k!=null?I[le]===xe&&k[le]===pe:void 0,te=M!=null?M?.[le]:pe,ie=this.getLabelText(te,ne,l??r,l!=null?"label":"y",F,p,{value:te,datum:ne,xKey:n,yKey:r,labelKey:l,xName:c,yName:h,labelName:u}),de=j.measureText(ie);_.push({series:this,itemId:r,yKey:r,xKey:n,datum:ne,datumIndex:le,xValue:xe,yValue:pe,capDefaults:{lengthRatioMultiplier:d.getDiameter(),lengthMax:1/0},point:{x:be,y:ue,size:d.size},midPoint:{x:be,y:ue},label:{text:ie,...de},anchor:y,placement:g,selected:$})}),{itemId:r,nodeData:_,labelData:_,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(e){const{nodeData:t,markerSelection:i}=e;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?t:[])}updateMarkerNodes(e){const{markerSelection:t,isHighlight:i}=e,{xKey:s,yKey:n,labelKey:r,marker:o}=this.properties,a=o.getStyle(),l=this.getShapeFillBBox();t.each((c,h)=>{const u=this.getHighlightStyle(i,h.datumIndex),d=Le(u,a);this.updateMarkerStyle(o,c,h.datum,h.point,{xKey:s,yKey:n,labelKey:r},i,d,l,{selected:h.selected})}),i||o.markClean()}updatePlacedLabelData(e){this.labelSelection.update(e.map(t=>({...t.datum,point:{x:t.x,y:t.y,size:t.datum.point.size}})),t=>{t.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(e){const{label:t}=this.properties;e.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=t.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=t.fontStyle,i.fontWeight=t.fontWeight,i.fontSize=t.fontSize,i.fontFamily=t.fontFamily,i.textAlign="left",i.textBaseline="top",i.fillOpacity=this.getHighlightStyle(!1,s.datumIndex).opacity??1})}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,axes:n,properties:r,ctx:o}=this,{formatManager:a}=o,{xKey:l,xName:c,yKey:h,yName:u,labelKey:d,labelName:p,title:g,tooltip:y,marker:b,legendItemName:m}=r,v=n.x,S=n.y;if(!i||!s||!v||!S)return;const M=s.dataSources.get(this.id)?.[e],I=i.resolveColumnById(this,"xValue",s)[e],k=i.resolveColumnById(this,"yValue",s)[e],L=this.contextNodeData?.nodeData[e];if(I==null||L==null)return;const C=[];if(this.isLabelEnabled()&&d!=null){const E=i.resolveColumnById(this,"labelValue",s)[e],_=a.format(this.callWithContext.bind(this),{type:"category",value:E,datum:M,seriesId:t,legendItemName:m,key:d,source:"tooltip",property:"label",domain:[],boundSeries:this.getFormatterContext("label")});C.push({label:p,fallbackLabel:d,value:_??_n(E)})}C.push({label:c,fallbackLabel:l,value:v.formatDatum(I,"tooltip",t,m,M,l)},{label:u,fallbackLabel:h,value:S.formatDatum(k,"tooltip",t,m,M,h)});const O=this.getMarkerStyle(b,L.datum,{xKey:l,yKey:h,labelKey:d,highlighted:!0});return this.formatTooltipWithContext(y,{symbol:this.legendItemSymbol(),title:g,data:C},{seriesId:t,datum:M,title:u,xKey:l,xName:c,yKey:h,yName:u,labelKey:d,labelName:p,...O,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(e){if(e!=="category")return[];const{yKey:t,yName:i,title:s,showInLegend:n}=this.properties,{id:r,ctx:{legendManager:o},visible:a}=this;return[{legendType:"category",id:r,itemId:t,seriesId:r,enabled:a&&o.getItemEnabled({seriesId:r,itemId:t}),label:{text:s??i??t},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(e){const{markerSelection:t,labelSelection:i,annotationSelections:s}=e;Jf(this,this.ctx.animationManager,t),Ne(this,"labels",this.ctx.animationManager,i),Ne(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new re}getFormattedMarkerStyle(e){const{xKey:t,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,e.datum,{xKey:t,yKey:i,labelKey:s},!0)}computeFocusBounds(e){return Sc(this,e)}};od.className="ScatterSeries",od.type="scatter";var j2={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:e=>new od(e),defaultAxes:[{type:"number",position:"bottom"},{type:"number",position:"left"}],themeTemplate:{series:{shape:"circle",size:7,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:$n,fillImageDefaults:jr,fillOpacity:.8,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}},tooltip:{range:{$path:["/tooltip/range","nearest"]},position:{anchorTo:{$path:["/tooltip/position/anchorTo","node"]}}},highlight:Yn()}}},ED={type:"series",name:"scatter",chartType:"cartesian",options:m1,create:e=>new od(e)},$R=(T(),N(w)),PD=(T(),N(w)),RD=class ey{constructor(t,i,s,n){this.startAngle=t,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:t,endAngle:i,innerRadius:s,outerRadius:n}=this;return new ey(t,i,s,n)}equals(t){return this.startAngle===t.startAngle&&this.endAngle===t.endAngle&&this.innerRadius===t.innerRadius&&this.outerRadius===t.outerRadius}[th](t,i){return new ey(this.startAngle*(1-i)+t.startAngle*i,this.endAngle*(1-i)+t.endAngle*i,this.innerRadius*(1-i)+t.innerRadius*i,this.outerRadius*(1-i)+t.outerRadius*i)}};function _D({startAngle:e,endAngle:t,innerRadius:i,outerRadius:s}){let n=1/0,r=1/0,o=-1/0,a=-1/0;const l=(c,h)=>{n=Math.min(c,n),r=Math.min(h,r),o=Math.max(c,o),a=Math.max(h,a)};return l(i*Math.cos(e),i*Math.sin(e)),l(i*Math.cos(t),i*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),vr(0,e,t)&&l(s,0),vr(Math.PI*.5,e,t)&&l(0,s),vr(Math.PI,e,t)&&l(-s,0),vr(Math.PI*1.5,e,t)&&l(0,-s),new W(n,r,o-n,a-r)}function ad(e,t,i){const s=Math.sqrt(Math.pow(e,2)+Math.pow(t,2)),{innerRadius:n,outerRadius:r}=i;if(i.startAngle===i.endAngle||s<Math.min(n,r)||s>Math.max(n,r))return!1;const o=Xa(i.startAngle),a=Xa(i.endAngle),l=Math.atan2(t,e);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function z2(e,t,i,s,n,r,o,a,l,c){if(isNaN(e)||isNaN(t))return 0;r&&([n,s]=[s,n]);const h=(c-a)/(l-o),u=a-h*o,d=Math.pow(h,2)+1,p=2*(h*(u-t)-e),g=Math.pow(e,2)+Math.pow(u-t,2)-Math.pow(i,2),y=Math.pow(p,2)-4*d*g;if(y<0)return 0;const b=(-p+Math.sqrt(y))/2/d,m=(-p-Math.sqrt(y))/2/d;let v=0;return[b,m].forEach(S=>{if(!(S>=Math.min(o,l)&&S<=Math.max(o,l)))return;const I=h*S+u,k=S-e,L=I-t,C=Math.atan2(L,k);vr(C,s,n)&&v++}),v}function jD(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=t,o={x:r*Math.cos(i),y:r*Math.sin(i)},a={x:r*Math.cos(s),y:r*Math.sin(s)},l=n===0?{x:0,y:0}:{x:n*Math.cos(i),y:n*Math.sin(i)},c=n===0?{x:0,y:0}:{x:n*Math.cos(s),y:n*Math.sin(s)};return el(e.start.x,e.start.y,e.end.x,e.end.y,o.x,o.y,l.x,l.y)||el(e.start.x,e.start.y,e.end.x,e.end.y,a.x,a.y,c.x,c.y)||z2(0,0,r,i,s,!0,e.start.x,e.start.y,e.end.x,e.end.y)}function zD(e,t){const i={x:e.x,y:e.y},s={x:e.x+e.width,y:e.y},n={x:e.x,y:e.y+e.height},r={x:e.x+e.width,y:e.y+e.height};return jD({start:i,end:s},t)||jD({start:n,end:r},t)}function FD(e,t,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(e+1*i))+Math.asin(Math.abs(1*s)/(e+1*s))-t<0)return 1;let r=0,o=1;for(let a=0;a<8;a+=1){const l=(r+o)/2;Math.asin(Math.abs(l*i)/(e+l*i))+Math.asin(Math.abs(l*s)/(e+l*s))-t<0?r=l:o=l}return r}var F2=1e-6;function or(e,t){return ah(e,t)<F2?t:ct(e-t)+t}function ld(e,t,i=0){const n=Math.abs(t-e)>=2*Math.PI?2*Math.PI:ct(t-e);return e=or(e,i),t=e+n,{startAngle:e,endAngle:t}}function cd(e,t,i,s,n,r){const o=Math.sin(r),a=Math.cos(r),l=e**2+t**2-i**2;let c,h,u,d;if(a>.5){const S=o/a,M=1+S**2,I=-2*(e+t*S),k=I**2-4*M*l;if(k<0)return;const L=(-I+Math.sqrt(k))/(2*M),C=(-I-Math.sqrt(k))/(2*M);c=L,h=L*S,u=C,d=C*S}else{const S=a/o,M=1+S**2,I=-2*(t+e*S),k=I**2-4*M*l;if(k<0)return;const L=(-I+Math.sqrt(k))/(2*M),C=(-I-Math.sqrt(k))/(2*M);c=L*S,h=L,u=C*S,d=C}const p=a,g=o,y=c*p+h*g,b=u*p+d*g,m=y>0?or(Math.atan2(h-t,c-e),s):NaN,v=b>0?or(Math.atan2(d-t,u-e),s):NaN;if(m>=s&&m<=n)return m;if(v>=s&&v<=n)return v}function hd(e,t,i,s,n,r){const o=Math.hypot(e,t),a=(o**2-i**2+r**2)/(2*o),l=o-a,c=Math.atan2(t,e),h=Math.acos(-l/i),u=or(c+h,s),d=or(c-h,s);if(u>=s&&u<=n)return u;if(d>=s&&d<=n)return d}var dm=class{constructor(e,t,i,s,n){this.cx=e,this.cy=t,this.r=i,this.a0=s,this.a1=n,this.a0>=this.a1&&(this.a0=NaN,this.a1=NaN)}isValid(){return Number.isFinite(this.a0)&&Number.isFinite(this.a1)}pointAt(e){return{x:this.cx+this.r*Math.cos(e),y:this.cy+this.r*Math.sin(e)}}clipStart(e){e==null||!this.isValid()||e<this.a0||(this.a0=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(e){e==null||!this.isValid()||e>this.a1||(this.a1=e,(Number.isNaN(e)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Bt=class extends ti{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.innerRadius=10,this.outerRadius=20,this.startAngle=0,this.endAngle=Math.PI*2,this.clipSector=void 0,this.concentricEdgeInset=0,this.radialEdgeInset=0,this.startOuterCornerRadius=0,this.endOuterCornerRadius=0,this.startInnerCornerRadius=0,this.endInnerCornerRadius=0}set inset(e){this.concentricEdgeInset=e,this.radialEdgeInset=e}set cornerRadius(e){this.startOuterCornerRadius=e,this.endOuterCornerRadius=e,this.startInnerCornerRadius=e,this.endInnerCornerRadius=e}computeBBox(){return _D(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:e}=this;let{innerRadius:t,outerRadius:i}=this;return t=t>0?t+e:0,i=Math.max(i-e,0),{innerRadius:t,outerRadius:i}}normalizedClipSector(){const{clipSector:e}=this;if(e==null)return;const{startAngle:t,endAngle:i}=ld(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),r=ld(e.startAngle,e.endAngle,t);return new RD(Math.max(t,r.startAngle),Math.min(i,r.endAngle),Math.max(s,e.innerRadius),Math.min(n,e.outerRadius))}getAngleOffset(e){return e>0?this.radialEdgeInset/e:0}arc(e,t,i,s,n,r,o,a){if(e<=0)return;const{startAngle:l,endAngle:c}=ld(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(a&&h<=0)return;const p=a?this.getAngleOffset(h+e):this.getAngleOffset(u-e),g=o?l+p+t:c-p-t,y=a?h+e:u-e,b=y*Math.cos(g),m=y*Math.sin(g);if(d!=null&&(!o&&!(g>=l-1e-6&&g<=d.endAngle-1e-6)||o&&!(g>=d.startAngle+1e-6&&g<=c-1e-6)||a&&y<d.innerRadius-1e-6||!a&&y>d.outerRadius+1e-6))return;const v=new dm(b,m,e,i,s);if(d!=null){a?(v.clipStart(cd(b,m,e,i,s,d.endAngle)),v.clipEnd(cd(b,m,e,i,s,d.startAngle))):(v.clipStart(cd(b,m,e,i,s,d.startAngle)),v.clipEnd(cd(b,m,e,i,s,d.endAngle)));let L,C;if(o?(L=hd(b,m,e,i,s,d.innerRadius),C=hd(b,m,e,i,s,d.outerRadius)):(L=hd(b,m,e,i,s,d.outerRadius),C=hd(b,m,e,i,s,d.innerRadius)),v.clipStart(L),v.clipEnd(C),L!=null){const{x:O,y:E}=v.pointAt(L),_=or(Math.atan2(E,O),l);o?r?.clipStart(_):n.clipEnd(_)}if(C!=null){const{x:O,y:E}=v.pointAt(C),_=or(Math.atan2(E,O),l);o?n.clipStart(_):r?.clipEnd(_)}}if(d!=null){const{x:L,y:C}=v.pointAt((v.a0+v.a1)/2);if(!ad(L,C,d))return}const{x:S,y:M}=v.pointAt(o===a?v.a0:v.a1),I=or(Math.atan2(M,S),l),k=a?r:n;return o?k?.clipStart(I):k?.clipEnd(I),v}updatePath(){const{path:t,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:r}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:a,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=ld(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),g=this.normalizedClipSector(),y=u-h,b=y>=2*Math.PI-1e-6;if(t.clear(),d===0&&p===0||d>p)return;if((g?.startAngle??h)===(g?.endAngle??u))return;if(b&&this.clipSector==null&&o===0&&a===0&&l===0&&c===0){t.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),t.arc(i,s,p,h,u),d>n&&(t.moveTo(i+d*Math.cos(u),s+d*Math.sin(u)),t.arc(i,s,d,u,h,!0)),t.closePath();return}else if(this.clipSector==null&&Math.abs(d-p)<1e-6){t.arc(i,s,p,h,u,!1),t.arc(i,s,p,u,h,!0),t.closePath();return}const m=this.getAngleOffset(d),v=this.getAngleOffset(p);if(y<2*v)return;const M=(g?.innerRadius??d)>n,I=d<n||y<2*m,k=p-d,L=Math.max(o,l,a,c),C=L>0?Math.min(k/L,1):1;o*=C,a*=C,l*=C,c*=C;const O=FD(p,y-2*v,-o,-a);if(o*=O,a*=O,!I&&M){const X=FD(d,y-2*m,l,c);l*=X,c*=X}else l=0,c=0;const E=Math.max(o+l,a+c),_=E>0?Math.min(k/E,1):1;o*=_,a*=_,l*=_,c*=_;let F=0,j=0;const Q=o/(p-o),ne=a/(p-a);if(Q>=0&&Q<1-1e-6)F=Math.asin(Q);else{F=y/2;const X=p/(1/Math.sin(F)+1);o=Math.min(X,o)}if(ne>=0&&ne<1-1e-6)j=Math.asin(ne);else{j=y/2;const X=p/(1/Math.sin(j)+1);a=Math.min(X,a)}const le=Math.asin(l/(d+l)),xe=Math.asin(c/(d+c)),pe=g?.outerRadius??p,be=this.getAngleOffset(pe),ue=new dm(0,0,pe,h+be,u-be),$=g?.innerRadius??d,te=this.getAngleOffset($),ie=M?new dm(0,0,$,h+te,u-te):void 0;g!=null&&(ue.clipStart(g.startAngle),ue.clipEnd(g.endAngle),ie?.clipStart(g.startAngle),ie?.clipEnd(g.endAngle));const de=this.arc(o,F,h-Math.PI*.5,h+F,ue,ie,!0,!1),ee=this.arc(a,j,u-j,u+Math.PI*.5,ue,ie,!1,!1),J=this.arc(c,xe,u+Math.PI*.5,u+Math.PI-xe,ue,ie,!1,!0),Y=this.arc(l,le,h+Math.PI+le,h+Math.PI*1.5,ue,ie,!0,!0);if(I){const X=y<Math.PI*.5?r*(1+Math.cos(y))/Math.sin(y):NaN;let U;X>0&&X<p?U=Math.max(Math.hypot(r,X),d):U=r,U=Math.max(U,d);const H=h+y*.5;t.moveTo(i+U*Math.cos(H),s+U*Math.sin(H))}else if(!(Y?.isValid()===!0||ie?.isValid()===!0)){const X=h+y/2,U=d*Math.cos(X),H=d*Math.sin(X);t.moveTo(i+U,s+H)}if(de?.isValid()===!0){const{cx:X,cy:U,r:H,a0:se,a1:he}=de;t.arc(i+X,s+U,H,se,he)}if(ue.isValid()){const{r:X,a0:U,a1:H}=ue;t.arc(i,s,X,U,H)}if(ee?.isValid()===!0){const{cx:X,cy:U,r:H,a0:se,a1:he}=ee;t.arc(i+X,s+U,H,se,he)}if(!I){if(J?.isValid()===!0){const{cx:X,cy:U,r:H,a0:se,a1:he}=J;t.arc(i+X,s+U,H,se,he)}if(ie?.isValid()===!0){const{r:X,a0:U,a1:H}=ie;t.arc(i,s,X,H,U,!0)}if(Y?.isValid()===!0){const{cx:X,cy:U,r:H,a0:se,a1:he}=Y;t.arc(i+X,s+U,H,se,he)}}t.closePath()}isPointInPath(e,t){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=this.clipSector??this;return ad(e-this.centerX,t-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,r),outerRadius:Math.max(n,r)})}};Bt.className="Sector",f([z()],Bt.prototype,"centerX",2),f([z()],Bt.prototype,"centerY",2),f([z()],Bt.prototype,"innerRadius",2),f([z()],Bt.prototype,"outerRadius",2),f([z()],Bt.prototype,"startAngle",2),f([z()],Bt.prototype,"endAngle",2),f([Li({equals:(e,t)=>e.equals(t)})],Bt.prototype,"clipSector",2),f([z()],Bt.prototype,"concentricEdgeInset",2),f([z()],Bt.prototype,"radialEdgeInset",2),f([z()],Bt.prototype,"startOuterCornerRadius",2),f([z()],Bt.prototype,"endOuterCornerRadius",2),f([z()],Bt.prototype,"startInnerCornerRadius",2),f([z()],Bt.prototype,"endInnerCornerRadius",2);var BD=class extends Ke{constructor(){super(...arguments),this.showInLegend=!1}};f([x],BD.prototype,"showInLegend",2);var pm=class extends xt{constructor(){super(...arguments),this.spacing=2}set(e,t){return super.set(e)}};f([x],pm.prototype,"text",2),f([x],pm.prototype,"spacing",2);var gm=class extends ae{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};f([x],gm.prototype,"fill",2),f([x],gm.prototype,"fillOpacity",2);var La=class extends xt{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};f([x],La.prototype,"offset",2),f([x],La.prototype,"minAngle",2),f([x],La.prototype,"minSpacing",2),f([x],La.prototype,"maxCollisionOffset",2),f([x],La.prototype,"avoidCollisions",2);var fm=class extends xt{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};f([x],fm.prototype,"positionOffset",2),f([x],fm.prototype,"positionRatio",2);var ud=class extends ae{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};f([x],ud.prototype,"colors",2),f([x],ud.prototype,"length",2),f([x],ud.prototype,"strokeWidth",2);var Me=class extends Oi{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(lt),this.strokes=Object.values(Os),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.innerLabels=new Ja(pm),this.title=new BD,this.innerCircle=new gm,this.shadow=new ms,this.calloutLabel=new La,this.sectorLabel=new fm,this.calloutLine=new ud,this.tooltip=yn()}};f([x],Me.prototype,"angleKey",2),f([x],Me.prototype,"angleName",2),f([x],Me.prototype,"angleFilterKey",2),f([x],Me.prototype,"radiusKey",2),f([x],Me.prototype,"radiusName",2),f([x],Me.prototype,"radiusMin",2),f([x],Me.prototype,"radiusMax",2),f([x],Me.prototype,"calloutLabelKey",2),f([x],Me.prototype,"calloutLabelName",2),f([x],Me.prototype,"sectorLabelKey",2),f([x],Me.prototype,"sectorLabelName",2),f([x],Me.prototype,"legendItemKey",2),f([x],Me.prototype,"defaultColorRange",2),f([x],Me.prototype,"defaultPatternFills",2),f([x],Me.prototype,"fills",2),f([x],Me.prototype,"strokes",2),f([x],Me.prototype,"fillOpacity",2),f([x],Me.prototype,"strokeOpacity",2),f([x],Me.prototype,"lineDash",2),f([x],Me.prototype,"lineDashOffset",2),f([x],Me.prototype,"cornerRadius",2),f([x],Me.prototype,"itemStyler",2),f([x],Me.prototype,"rotation",2),f([x],Me.prototype,"outerRadiusOffset",2),f([x],Me.prototype,"outerRadiusRatio",2),f([x],Me.prototype,"innerRadiusOffset",2),f([x],Me.prototype,"innerRadiusRatio",2),f([x],Me.prototype,"strokeWidth",2),f([x],Me.prototype,"sectorSpacing",2),f([x],Me.prototype,"hideZeroValueSectorsInLegend",2),f([x],Me.prototype,"innerLabels",2),f([x],Me.prototype,"title",2),f([x],Me.prototype,"innerCircle",2),f([x],Me.prototype,"shadow",2),f([x],Me.prototype,"calloutLabel",2),f([x],Me.prototype,"sectorLabel",2),f([x],Me.prototype,"calloutLine",2),f([x],Me.prototype,"tooltip",2);function ho(e,t,i,s){const n=[i.convert(0),i.convert(1)],r=[s.convert(0),s.convert(1)],o=Math.PI/-2+mt(t),a=e?"initial":"update",l=({radius:g})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*g}),c=({radius:g})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*g});return{nodes:{toFn:(g,y,b,{prevLive:m})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:I}=y;const{stroke:k,fill:L}=y.sectorFormat;if(b==="removed"&&m?(v=m.datum?.endAngle,S=m.datum?.endAngle):b==="removed"&&!m&&(v=o,S=o),b==="removed"){const C=l(y);M=C.innerRadius,I=C.outerRadius}return{startAngle:v,endAngle:S,outerRadius:I,innerRadius:M,stroke:k,fill:L}},fromFn:(g,y,b,{prevFromProps:m})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:I}=g,{fill:k,stroke:L}=y.sectorFormat;if(b==="updated"&&g.previousDatum==null&&(b="added"),b==="unknown"||b==="added"&&!m?(v=o,S=o,M=y.innerRadius,I=y.outerRadius):b==="added"&&m&&(v=m.endAngle??o,S=m.endAngle??o,M=m.innerRadius??y.innerRadius,I=m.outerRadius??y.outerRadius),b==="added"&&!e){const C=c(y);M=C.innerRadius,I=C.outerRadius}return b==="updated"&&(k=g.fill??k,L=(typeof g.stroke=="string"?g.stroke:void 0)??L),{startAngle:v,endAngle:S,innerRadius:M,outerRadius:I,fill:k,stroke:L,phase:a}}},innerCircle:{fromFn:(g,y)=>({size:g.previousDatum?.radius??g.size??0,phase:a}),toFn:(g,y)=>({size:y.radius??0})}}}function mm(e,t){return{startAngle:t.startAngle,endAngle:t.endAngle,innerRadius:t.innerRadius,outerRadius:t.outerRadius,stroke:t.sectorFormat.stroke}}function ym(e,t){const i=t.y-e.centerY,s=t.x-e.centerX,n=Math.atan2(i,s),r=e.getItemNodes();for(const o of r)if(o.datum.missing!==!0&&vr(n,o.startAngle,o.endAngle)){const a=Math.sqrt(s*s+i*i);let l=0;return a<o.innerRadius?l=o.innerRadius-a:a>o.outerRadius&&(l=a-o.outerRadius),{datum:o.datum,distance:l}}}var VD=(e=>(e[e.BACKGROUND=0]="BACKGROUND",e[e.FOREGROUND=1]="FOREGROUND",e[e.HIGHLIGHT=2]="HIGHLIGHT",e[e.LABEL=3]="LABEL",e))(VD||{}),bm={angle:["angleKey"],radius:["radiusKey"]},xm={angle:["angleName"],radius:["radiusName"]},dd=class extends Uf{constructor({categoryKey:e,pickModes:t=[1,0],canHaveAxes:i=!1,animationResetFns:s,...n}){super({...n,categoryKey:e,pickModes:t,canHaveAxes:i}),this.directions=["angle","radius"],this.itemGroup=this.contentGroup.appendChild(new re),this.nodeData=[],this.itemSelection=bt.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=bt.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=bt.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=bt.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=s,this.animationState=new yl("empty",{empty:{update:{target:"ready",action:r=>this.animateEmptyUpdateReady(r)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:r=>this.animateReadyHighlight(r),highlightMarkers:r=>this.animateReadyHighlightMarkers(r),resize:r=>this.animateReadyResize(r),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:r=>this.animateWaitingUpdateReady(r)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:r=>this.animateClearingUpdateEmpty(r)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.contentGroup.zIndex=[e,1],this.highlightGroup.zIndex=[e,2],this.labelGroup.zIndex=[e,3],!0):!1}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}labelFactory(){const e=new _t;return e.pointerEvents=1,e}addChartEventListeners(){this.cleanup.register(this.ctx.eventsHub.on("legend:item-click",e=>this.onLegendItemClick(e)),this.ctx.eventsHub.on("legend:item-double-click",e=>this.onLegendItemDoubleClick(e)))}getInnerRadius(){return 0}computeLabelsBBox(e,t){return null}getShapeFillBBox(){const e=this.radius;return{series:new W(-e,-e,e*2,e*2),axis:new W(-e,-e,e*2,e*2)}}resetAllAnimation(){const{item:e,label:t}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),e&&Nt([this.itemSelection,this.highlightSelection],e),t&&Nt([this.labelSelection,this.highlightLabelSelection],t),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(e){const{item:t,label:i}=this.animationResetFns??{};t&&Nt([this.highlightSelection],t),i&&Nt([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(e){}animateReadyResize(e){this.resetAllAnimation()}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(e){const t=this.getNodeData()?.[e.datumIndex];if(t!==void 0)return this.itemSelection.select(i=>i instanceof ti&&i.datum===t)[0]}getSeriesRange(e,t){return[NaN,NaN]}isSeriesHighlighted(e,t){const{series:i,legendItemName:s,itemId:n}=e??{},r=t?.[n];return i===this||r!=null&&r===s}},B2=class extends Tl{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},pd=class extends dd{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...bm,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...xm,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:mm,label:fn}}),this.properties=new Me,this.phantomNodeData=void 0,this.backgroundGroup=new Ht({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new _s,this.radiusScale=new _s,this.phantomGroup=this.backgroundGroup.appendChild(new re({name:"phantom"})),this.phantomSelection=bt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new re({name:"pieCalloutLabels"})),this.calloutLabelSelection=new bt(this.calloutLabelGroup,re),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new re({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new vt({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new vt({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new re({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new re({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=bt.select(this.innerLabelsGroup,_t),this.innerCircleSelection=bt.select(this.innerCircleGroup,()=>new vt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=B2,this.angleScale=new _s,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2,this.innerLabelsGroup.pointerEvents=1}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e?.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.backgroundGroup.zIndex=[0,e],!0):!1}nodeFactory(){return new Bt}getSeriesDomain(e){return e==="angle"?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(this.data==null)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(b,m)=>t&&s.getItemEnabled({seriesId:i,itemId:m})?b:0,u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(us(c,"band",{id:"legendItemKey"})):a?d.push(us(a,"band",{id:"calloutLabelKey"})):l&&d.push(us(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,y=this.angleScale.type;o&&p.push(pf(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),De(o,g,{id:"radiusRaw",processor:h}),Xr("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(De(a,"band",{id:"calloutLabelValue"})),l&&p.push(De(l,"band",{id:"sectorLabelValue"})),c&&p.push(De(c,"band",{id:"legendItemValue"})),r&&p.push(nc(r,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),De(r,y,{id:"angleFilterRaw"}),Xr("angleFilterValue",[0,1],0,0)),u&&this.processedData&&d.length>0&&p.push(na(this.id,this.processedData)),p.push(sa()),await this.requestDataModel(e,this.data,{props:[...d,nc(n,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),De(n,y,{id:"angleRaw"}),Xr("angleValue",[0,1],0,0),...p]});for(const b of this.processedData?.defs?.values??[]){const{id:m,missing:v,property:S}=b,M=dg(this,v);m!=="angleRaw"&&M>0&&PD.Logger.warnOnce(`no value was found for the key '${String(S)}' on ${M} data element${M>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),n=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterValue",t):void 0,r=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterRaw",t):void 0,o=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,a=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,h=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o,innerRadiusRatio:a}=this.properties;if(!i||t?.type!=="ungrouped")return;const l=this.getProcessedDataValues(i,t),{angleValues:c,angleRawValues:h,angleFilterValues:u,angleFilterRawValues:d,radiusValues:p,radiusRawValues:g,legendItemValues:y}=l,b=d?.some((L,C)=>L>h[C])??!1;let m=0,v=0;const S=[],M=d!=null?[]:void 0,I=t.dataSources.get(this.id)??[],k=t.invalidData?.get(this.id);return I.forEach((L,C)=>{if(k?.[C]===!0)return;const O=b?u[C]:c[C],E=d!=null&&!b?Math.sqrt(d[C]/h[C]):1,_=s.convert(m)+mt(o);m=O,v+=O;const F=s.convert(m)+mt(o),j=Math.abs(F-_),Q=_+j/2,ne=h[C],xe=(p?.[C]??1)*E,pe=g?.[C],be=y?.[C],ue=this.getLabels(C,L,Q,j,l),$=this.getSectorFormat(L,C,!1),te={itemId:C,series:this,datum:L,datumIndex:C,angleValue:ne,midAngle:Q,midCos:Math.cos(Q),midSin:Math.sin(Q),startAngle:_,endAngle:F,radius:xe,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(xe),0),sectorFormat:$,radiusValue:pe,legendItemValue:be,enabled:r&&n.getItemEnabled({seriesId:e,itemId:C}),focusable:!0,...ue};S.push(te),M?.push({...te,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=v===0,this.zerosumInnerRing.visible=v===0&&a!=null&&a!==1&&a>0,{itemId:e,nodeData:S,labelData:S,phantomNodeData:M}}getLabelContent(e,t,i){const{id:s,ctx:n,properties:r}=this,{formatManager:o}=n,{calloutLabel:a,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:u}=r,d=i.calloutLabelValues?.[e],p=i.sectorLabelValues?.[e],g=i.legendItemValues?.[e],y={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},b={callout:void 0,sector:void 0,legendItem:void 0};return c&&(b.callout=this.getLabelText(d,t,c,"calloutLabel",[],a,{...y,value:d})),h&&(b.sector=this.getLabelText(p,t,h,"sectorLabel",[],l,{...y,value:p})),u!=null&&g!=null&&(b.legendItem=o.format(this.callWithContext.bind(this),{type:"category",value:g,datum:t,seriesId:s,legendItemName:void 0,key:u,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??g),b}getLabels(e,t,i,s,n){const{properties:r}=this,{calloutLabel:o,sectorLabel:a,legendItemKey:l}=r,c=this.getLabelContent(e,t,n),h={};return o.enabled&&c.callout&&s>=mt(o.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),a.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=Xa(e),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=(0,PD.modulus)(r,t.length);return t[o]}getNodeFill(e,t,i){return Rr(e,{type:"gradient",bounds:"series",colorStops:t.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(!(!ki(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i,s,n){const{angleKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,fills:h,strokes:u,defaultColorRange:d,defaultPatternFills:p,itemStyler:g}=this.properties,y=u[t%u.length],b=h[t%h.length],{fill:m,fillOpacity:v,stroke:S,strokeWidth:M,strokeOpacity:I,lineDash:k,lineDashOffset:L,cornerRadius:C,opacity:O}=Le(this.getHighlightStyle(i,s?.datumIndex,n),{fill:b,stroke:y},this.properties),E=d[t%d.length],_=p[t%p.length],F=m??"black";let j;return g&&(j=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(g,{datum:e,angleKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,fill:this.getNodeFill(F,E,_),fillOpacity:v,stroke:S,strokeWidth:M,strokeOpacity:I,lineDash:k,lineDashOffset:L,cornerRadius:C,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(j?.fill??F,E,_),fillOpacity:j?.fillOpacity??v,stroke:j?.stroke??S,strokeWidth:j?.strokeWidth??M,strokeOpacity:j?.strokeOpacity??I,lineDash:j?.lineDash??k,lineDashOffset:j?.lineDashOffset??L,cornerRadius:j?.cornerRadius??C,opacity:O}}getInnerRadius(){const{radius:e}=this,{innerRadiusRatio:t=1,innerRadiusOffset:i=0}=this.properties,s=e*t+i;return s===e||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:e,outerRadiusOffset:t}=this.properties;return Math.max(this.radius*e+t,0)}updateRadiusScale(e){const t=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=Is(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const n=this.getTitleTranslationY();t.node.y=isFinite(n)?n:0;const r=t.node.getBBox(!1);t.node.visible=t.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(r)}for(const n of[this.zerosumInnerRing,this.zerosumOuterRing])n.fillOpacity=0,n.stroke=this.properties.calloutLabel.color,n.strokeWidth=1,n.strokeOpacity=1;this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:r,innerLabelsSelection:o}=this,a=this.nodeData.map(c=>({...c,sectorFormat:{...c.sectorFormat}})),l=(c,h)=>{c.update(h,void 0,u=>this.getDatumId(u.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(e,this.nodeData),l(t,a),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,c=>{const h=new pi;h.tag=0,h.pointerEvents=1,c.appendChild(h);const u=new _t;u.tag=1,u.pointerEvents=1,c.appendChild(u)}),r.update(this.nodeData),s.update(a),o.update(this.properties.innerLabels,c=>{c.pointerEvents=1})}updateInnerCircleSelection(){const{innerCircle:e}=this.properties;let t=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),r=1;t=Math.ceil(n*2+r)}const s=e?[{radius:t}]:[];this.innerCircleSelection.update(s)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:s,processedData:n}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!s||!n)return;const{legendItemValues:r}=this.getProcessedDataValues(s,n),o=this.isSeriesHighlighted(t,r);this.highlightGroup.visible=i&&o,this.highlightLabel.visible=i&&o,this.labelGroup.visible=i,this.innerCircleSelection.each((d,{radius:p})=>{d.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:p})});const a=this.radiusScale.range[0],l=this.radiusScale.range[1],c=this.getShapeFillBBox(),h=this.ctx.animationManager.isSkipped(),u=(d,p,g,y)=>{const b=this.getSectorFormat(p.datum,p.itemId,y,p,r);p.sectorFormat.fill=b.fill,p.sectorFormat.stroke=b.stroke,h&&(d.startAngle=p.startAngle,d.endAngle=p.endAngle,d.innerRadius=p.innerRadius,d.outerRadius=p.outerRadius),(y||h)&&(d.fill=b.fill,d.stroke=b.stroke);const m=this.getFillParams(b.fill,a,l);on(d,b,void 0,c,m),d.cornerRadius=b.cornerRadius,d.fillShadow=this.properties.shadow;const v=Math.max((this.properties.sectorSpacing+(b.stroke!=null?b.strokeWidth:0))/2,0);d.inset=v,d.lineJoin=this.properties.sectorSpacing>=0||v>0?"miter":"round"};this.itemSelection.each((d,p,g)=>u(d,p,g,!1)),this.highlightSelection.each((d,p,g)=>{u(d,p,g,!0),d.visible=p.itemId===t?.itemId}),this.phantomSelection.each((d,p,g)=>u(d,p,g,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:s}=this.properties,n=t,r=$b(i)?i??this.properties.strokes:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(a=>{const l=a.closestDatum(),{calloutLabel:c,outerRadius:h,datumIndex:u}=l;if(c?.text&&!c.hidden&&h!==0){a.visible=!0,a.strokeWidth=n,a.stroke=r[u%r.length],a.strokeOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1,a.fill=void 0;const d=l.midCos*h,p=l.midSin*h;let g=l.midCos*(h+e),y=l.midSin*(h+e);if((c.collisionTextAlign??c.collisionOffsetY!==0)&&c.box!=null){const m=c.box;let v=g,S=y;g<m.x?v=m.x:g>m.x+m.width&&(v=m.x+m.width),y<m.y?S=m.y:y>m.y+m.height&&(S=m.y+m.height);const M=v-g,I=S-y,k=Math.sqrt(Math.pow(M,2)+Math.pow(I,2)),L=k-o;L>0&&(g=g+M*L/k,y=y+I*L/k)}a.x1=d,a.y1=p,a.x2=g,a.y2=y}else a.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;t.x+a<s?l=(t.x+t.width-s)/t.width:t.x+t.width-a>n&&(l=(n-t.x)/t.width);const c=t.y+a<r||t.y+t.height-a>o,h=l===1?e.length:Math.floor(e.length*l)-1,u=this.bboxIntersectsSurroundingSeries(t);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=t,r=e.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!o(m));if(l.forEach(m=>{const v=m.calloutLabel;v!=null&&(v.hidden=!1,v.collisionTextAlign=void 0,v.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,v)=>m.midSin-v.midSin),h=l.filter(m=>m.midCos>=0).sort((m,v)=>m.midSin-v.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),p=m=>{const v=m.calloutLabel;if(v==null)return W.zero.clone();const S=m.outerRadius+i.length+s,M=m.midCos*S,I=m.midSin*S+v.collisionOffsetY,k=v.collisionTextAlign??v.textAlign,L=v.textBaseline;return _t.computeBBox(v.text,M,I,{font:this.properties.calloutLabel,textAlign:k,textBaseline:L},!1)},g=(m,v,S)=>{const M=p(m).grow(n/2),I=p(v).grow(n/2);M.x<I.x+I.width&&M.x+M.width>I.x&&(S==="to-top"?M.y<I.y+I.height:M.y+M.height>I.y)&&(v.calloutLabel.collisionOffsetY=S==="to-top"?M.y-I.y-I.height:M.y+M.height-I.y)},y=m=>{const v=m.slice().sort((M,I)=>Math.abs(M.midSin)-Math.abs(I.midSin))[0],S=m.indexOf(v);for(let M=S-1;M>=0;M--){const I=m[M+1],k=m[M];g(I,k,"to-top")}for(let M=S+1;M<m.length;M++){const I=m[M-1],k=m[M];g(I,k,"to-bottom")}},b=m=>{const v=l.some(C=>C.calloutLabel.collisionOffsetY!==0),S=m.map(C=>p(C)),M=S.map(C=>C.clone().grow(n/2));let I=!1;for(let C=0;C<M.length&&!I;C++){const O=M[C];for(let E=C+1;E<m.length;E++){const _=M[E];if(O.collidesBBox(_)){I=!0;break}}}const k=a.map(C=>{const{startAngle:O,endAngle:E,outerRadius:_}=C;return{startAngle:O,endAngle:E,innerRadius:r,outerRadius:_}}),L=S.some(C=>k.some(O=>zD(C,O)));!I&&!v&&!L||m.filter(C=>C.calloutLabel.textAlign==="center").forEach(C=>{const O=C.calloutLabel;C.midCos<0?O.collisionTextAlign="right":C.midCos>0?O.collisionTextAlign="left":O.collisionTextAlign="center"})};y(c),y(h),b(u),b(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new _t;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,u=t.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,g=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,b={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(b);const m=a.getBBox(!1);let v=h.text,S=!0;if(i.avoidCollisions){const{textLength:M,hasVerticalOverflow:I}=this.getLabelOverflow(h.text,m,e);v=h.text.length===M?h.text:`${h.text.substring(0,M)}\u2026`,S=!I}l.text=v,l.x=g,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(b),l.fill=o,l.fillOpacity=this.getHighlightStyle(!1,c.datumIndex).opacity??1,l.visible=S})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new _t;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(!1),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const g=d.outerRadius+n+r,y=d.midCos*g,b=d.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=b,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox(!1);if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const v=-this.centerY,S=new W(h.x-a,v,h.width+2*a,h.y+h.height+a-v);if(m.collidesBBox(S)){p.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:v,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(p.text,m,t),I=p.text.length>2&&v<2;if(S||I||M){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:W.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=(h,u)=>{const{sectorLabel:d,outerRadius:p}=u;let g=!1;if(d&&p!==0){const y=t*(1-a)+p*a+o;h.fill=l,h.fillOpacity=this.getHighlightStyle(!1,u.datumIndex).opacity??1,h.fontStyle=s,h.fontWeight=n,h.fontSize=i,h.fontFamily=r,h.text=d.text,h.x=u.midCos*y,h.y=u.midSin*y,h.textAlign="center",h.textBaseline="middle";const b=h.getBBox(!1),m=[[b.x,b.y],[b.x+b.width,b.y],[b.x+b.width,b.y+b.height],[b.x,b.y+b.height]],{startAngle:v,endAngle:S}=u,M={startAngle:v,endAngle:S,innerRadius:t,outerRadius:p};m.every(([I,k])=>ad(I,k,M))&&(g=!0)}h.visible=g};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const e=[],t=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:p,fontSize:g,fontFamily:y,color:b}=u;h.fontStyle=d,h.fontWeight=p,h.fontSize=g,h.fontFamily=y,h.text=u.text,h.x=0,h.y=0,h.fill=b,h.textAlign="center",h.textBaseline="alphabetic",e.push(h.getBBox(!1)),t.push(u.spacing)});const i=h=>h===0?0:t[h],s=h=>h===t.length-1?0:t[h],n=e.reduce((h,u,d)=>h+u.height+i(d)+s(d),0),r=Math.max(...e.map(h=>h.width)),o=this.getInnerRadius(),l=Math.sqrt(Math.pow(r/2,2)+Math.pow(n/2,2))<=(o>0?o:this.getOuterRadius()),c=[];for(let h=0,u=-n/2;h<e.length;h++){const p=e[h].height+u+i(h);c.push(p),u=p+s(h)}this.innerLabelsSelection.each((h,u,d)=>{h.y=c[d],h.visible=l})}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2,this.zerosumInnerRing.size=this.getInnerRadius()*2}pickNodeClosestDatum(e){return ym(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:r}}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,tooltip:y}=n,b=this.properties.title.text;if(!i||!s)return;const m=s.dataSources.get(this.id)?.[e],v=this.getProcessedDataValues(i,s),{angleRawValues:S}=v,M=S[e],I=this.getLabelContent(e,m,v),k=I.legendItem??I.callout??I.sector??d,L=i.getDomain(this,"angleRaw","value",s),C=r.format(this.callWithContext.bind(this),{type:"number",value:M,datum:m,seriesId:t,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:L,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0})??_n(M,3);return this.formatTooltipWithContext(y,{title:b,symbol:this.legendItemSymbol(e),data:[{label:k,fallbackLabel:u,value:C}]},{seriesId:t,datum:m,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,...this.getSectorFormat(m,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return ki(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{visible:t,processedData:i,dataModel:s,id:n,ctx:{legendManager:r}}=this;if(!s||!i||e!=="category")return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!a||a===o)&&(!l||l===o))return[];const u=this.getProcessedDataValues(s,i),{angleRawValues:d}=u,p=this.properties.title?.showInLegend&&this.properties.title.text,g=[],y=this.properties.hideZeroValueSectorsInLegend,b=i.dataSources.get(this.id),m=i.invalidData?.get(this.id);for(let v=0;v<i.input.count;v++){const S=b?.[v],M=d[v];if(m?.[v]===!0||y&&M===0)continue;const I=[];p&&I.push(p);const k=this.getLabelContent(v,S,u);c&&k.legendItem!==void 0?I.push(k.legendItem):a&&a!==o&&k.callout!==void 0?I.push(k.callout):l&&l!==o&&k.sector!==void 0&&I.push(k.sector),I.length!==0&&g.push({legendType:"category",id:n,datum:S,itemId:v,seriesId:n,hideToggleOtherSeries:!0,enabled:t&&r.getItemEnabled({seriesId:n,itemId:v}),label:{text:I.join(" - ")},symbol:this.legendItemSymbol(v),legendItemName:c!=null?S[c]:void 0,hideInLegend:!h})}return g}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((n,r)=>i.toggleItem(n,t,r)),i.update(),s.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=ho(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Je(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Je(this.id,"innerCircle",t,[this.innerCircleSelection],i.innerCircle),Ne(this,"callout",t,this.calloutLabelSelection),Ne(this,"sector",t,this.labelSelection),Ne(this,"highlight",t,this.highlightLabelSelection),Ne(this,"inner",t,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=!this.nodeData.some(p=>p.enabled),d=ho(!1,this.properties.rotation,n,r);Je(this.id,"nodes",o,[e,t,i],d.nodes,(p,g)=>this.getDatumId(g.datumIndex),a),Je(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),Ne(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ne(this,"sector",this.ctx.animationManager,this.labelSelection),Ne(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,Ne(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=ho(!1,this.properties.rotation,s,n);Je(this.id,"nodes",r,[e,t,i],o.nodes,(a,l)=>this.getDatumId(l.datumIndex)),Je(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),nr(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),nr(this,"sector",this.ctx.animationManager,this.labelSelection),nr(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),nr(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};pd.className="DonutSeries",pd.type="donut";var V2={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Ci.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:sf,fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,innerRadiusRatio:{$if:[{$eq:[{$path:["./innerRadiusOffset",void 0]},void 0]},.7,void 0]},shadow:{enabled:!1,color:Hn,xOffset:3,yOffset:3,blur:5},innerLabels:{$apply:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},highlight:eM()},legend:{enabled:!0}},G2={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:e=>new pd(e),themeTemplate:V2},H2={type:"series",name:"donut",chartType:"polar",options:y1,create:e=>new pd(e)},GD=(T(),N(w)),HD=class extends Ke{constructor(){super(...arguments),this.showInLegend=!1}};f([x],HD.prototype,"showInLegend",2);var ka=class extends xt{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};f([x],ka.prototype,"offset",2),f([x],ka.prototype,"minAngle",2),f([x],ka.prototype,"minSpacing",2),f([x],ka.prototype,"maxCollisionOffset",2),f([x],ka.prototype,"avoidCollisions",2);var vm=class extends xt{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};f([x],vm.prototype,"positionOffset",2),f([x],vm.prototype,"positionRatio",2);var gd=class extends ae{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};f([x],gd.prototype,"colors",2),f([x],gd.prototype,"length",2),f([x],gd.prototype,"strokeWidth",2);var Ae=class extends Oi{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(lt),this.strokes=Object.values(Os),this.fillOpacity=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.cornerRadius=0,this.rotation=0,this.outerRadiusOffset=0,this.outerRadiusRatio=1,this.strokeWidth=1,this.sectorSpacing=0,this.hideZeroValueSectorsInLegend=!1,this.title=new HD,this.shadow=new ms,this.calloutLabel=new ka,this.sectorLabel=new vm,this.calloutLine=new gd,this.tooltip=yn()}};f([x],Ae.prototype,"angleKey",2),f([x],Ae.prototype,"angleName",2),f([x],Ae.prototype,"angleFilterKey",2),f([x],Ae.prototype,"radiusKey",2),f([x],Ae.prototype,"radiusName",2),f([x],Ae.prototype,"radiusMin",2),f([x],Ae.prototype,"radiusMax",2),f([x],Ae.prototype,"calloutLabelKey",2),f([x],Ae.prototype,"calloutLabelName",2),f([x],Ae.prototype,"sectorLabelKey",2),f([x],Ae.prototype,"sectorLabelName",2),f([x],Ae.prototype,"legendItemKey",2),f([x],Ae.prototype,"defaultColorRange",2),f([x],Ae.prototype,"defaultPatternFills",2),f([x],Ae.prototype,"fills",2),f([x],Ae.prototype,"strokes",2),f([x],Ae.prototype,"fillOpacity",2),f([x],Ae.prototype,"strokeOpacity",2),f([x],Ae.prototype,"lineDash",2),f([x],Ae.prototype,"lineDashOffset",2),f([x],Ae.prototype,"cornerRadius",2),f([x],Ae.prototype,"itemStyler",2),f([x],Ae.prototype,"rotation",2),f([x],Ae.prototype,"outerRadiusOffset",2),f([x],Ae.prototype,"outerRadiusRatio",2),f([x],Ae.prototype,"strokeWidth",2),f([x],Ae.prototype,"sectorSpacing",2),f([x],Ae.prototype,"hideZeroValueSectorsInLegend",2),f([x],Ae.prototype,"title",2),f([x],Ae.prototype,"shadow",2),f([x],Ae.prototype,"calloutLabel",2),f([x],Ae.prototype,"sectorLabel",2),f([x],Ae.prototype,"calloutLine",2),f([x],Ae.prototype,"tooltip",2);var U2=class extends Tl{constructor(e,t,i,s){super(e,t,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},fd=class extends dd{constructor(e){super({moduleCtx:e,categoryKey:void 0,propertyKeys:{...bm,sectorLabel:["sectorLabelKey"],calloutLabel:["calloutLabelKey"]},propertyNames:{...xm,sectorLabel:["sectorLabelName"],calloutLabel:["calloutLabelName"]},pickModes:[1,0],animationResetFns:{item:mm,label:fn}}),this.properties=new Ae,this.phantomNodeData=void 0,this.backgroundGroup=new Ht({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new _s,this.radiusScale=new _s,this.phantomGroup=this.backgroundGroup.appendChild(new re({name:"phantom"})),this.phantomSelection=bt.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new re({name:"pieCalloutLabels"})),this.calloutLabelSelection=new bt(this.calloutLabelGroup,re),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new re({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new vt({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=U2,this.angleScale=new _s,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(t=>t+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(e,t,i){super.attachSeries(e,t,i),e.appendChild(this.backgroundGroup)}detachSeries(e,t,i){super.detachSeries(e,t,i),e?.removeChild(this.backgroundGroup)}setSeriesIndex(e){return super.setSeriesIndex(e)?(this.backgroundGroup.zIndex=[0,e],!0):!1}nodeFactory(){const e=new Bt;return e.miterLimit=1e9,e}getSeriesDomain(e){return e==="angle"?this.angleScale.domain:this.radiusScale.domain}async processData(e){if(this.data==null)return;const{visible:t,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(b,m)=>t&&s.getItemEnabled({seriesId:i,itemId:m})?b:0,u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(us(c,"band",{id:"legendItemKey"})):a?d.push(us(a,"band",{id:"calloutLabelKey"})):l&&d.push(us(l,"band",{id:"sectorLabelKey"}));const g=this.radiusScale.type,y=this.angleScale.type;o&&p.push(pf(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,missingValue:this.properties.radiusMax??1,processor:h}),De(o,g,{id:"radiusRaw",processor:h}),Xr("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(De(a,"band",{id:"calloutLabelValue"})),l&&p.push(De(l,"band",{id:"sectorLabelValue"})),c&&p.push(De(c,"band",{id:"legendItemValue"})),r&&p.push(nc(r,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),De(r,y,{id:"angleFilterRaw"}),Xr("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&d.length>0&&p.push(na(this.id,this.processedData)),p.push(sa()),await this.requestDataModel(e,this.data,{props:[...d,nc(n,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),De(n,y,{id:"angleRaw"}),Xr("angleValue",[0,1],0,0),...p]});for(const b of this.processedData?.defs?.values??[]){const{id:m,missing:v,property:S}=b,M=dg(this,v);m!=="angleRaw"&&M>0&&GD.Logger.warnOnce(`no value was found for the key '${String(S)}' on ${M} data element${M>1?"s":""}`)}this.animationState.transition("updateData")}maybeRefreshNodeData(){if(!this.nodeDataRefresh)return;const{nodeData:e=[],phantomNodeData:t}=this.createNodeData()??{};this.nodeData=e,this.phantomNodeData=t,this.nodeDataRefresh=!1}getProcessedDataValues(e,t){const i=e.resolveColumnById(this,"angleValue",t),s=e.resolveColumnById(this,"angleRaw",t),n=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterValue",t):void 0,r=this.properties.angleFilterKey!=null?e.resolveColumnById(this,"angleFilterRaw",t):void 0,o=this.properties.radiusKey?e.resolveColumnById(this,"radiusValue",t):void 0,a=this.properties.radiusKey?e.resolveColumnById(this,"radiusRaw",t):void 0,l=this.properties.calloutLabelKey?e.resolveColumnById(this,"calloutLabelValue",t):void 0,c=this.properties.sectorLabelKey?e.resolveColumnById(this,"sectorLabelValue",t):void 0,h=this.properties.legendItemKey?e.resolveColumnById(this,"legendItemValue",t):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:e,processedData:t,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o}=this.properties;if(!i||t?.type!=="ungrouped")return;const a=this.getProcessedDataValues(i,t),{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:u,radiusValues:d,radiusRawValues:p,legendItemValues:g}=a,y=u?.some((k,L)=>k>c[L])??!1;let b=0,m=0;const v=[],S=u!=null?[]:void 0,M=t.dataSources.get(this.id)??[],I=t.invalidData?.get(this.id);return M.forEach((k,L)=>{if(I?.[L]===!0)return;const C=y?h[L]:l[L],O=u!=null&&!y?Math.sqrt(u[L]/c[L]):1,E=s.convert(b)+mt(o);b=C,m+=C;const _=s.convert(b)+mt(o),F=Math.abs(_-E),j=E+F/2,Q=c[L],le=(d?.[L]??1)*O,xe=p?.[L],pe=g?.[L],be=this.getLabels(L,k,j,F,a),ue=this.getSectorFormat(k,L,!1),$={itemId:L,series:this,datum:k,datumIndex:L,angleValue:Q,midAngle:j,midCos:Math.cos(j),midSin:Math.sin(j),startAngle:E,endAngle:_,radius:le,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(le),0),sectorFormat:ue,radiusValue:xe,legendItemValue:pe,enabled:r&&n.getItemEnabled({seriesId:e,itemId:L}),...be};v.push($),S?.push({...$,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=m===0,{itemId:e,nodeData:v,labelData:v,phantomNodeData:S}}getLabelContent(e,t,i){const{id:s,ctx:n,properties:r}=this,{formatManager:o}=n,{calloutLabel:a,sectorLabel:l,calloutLabelKey:c,sectorLabelKey:h,legendItemKey:u}=r,d=i.calloutLabelValues?.[e],p=i.sectorLabelValues?.[e],g=i.legendItemValues?.[e],y={datum:t,angleKey:this.properties.angleKey,angleName:this.properties.angleName,radiusKey:this.properties.radiusKey,radiusName:this.properties.radiusName,calloutLabelKey:this.properties.calloutLabelKey,calloutLabelName:this.properties.calloutLabelName,sectorLabelKey:this.properties.sectorLabelKey,sectorLabelName:this.properties.sectorLabelName,legendItemKey:this.properties.legendItemKey},b={callout:void 0,sector:void 0,legendItem:void 0};return c&&(b.callout=this.getLabelText(d,t,c,"calloutLabel",[],a,{...y,value:d})),h&&(b.sector=this.getLabelText(p,t,h,"sectorLabel",[],l,{...y,value:p})),u!=null&&g!=null&&(b.legendItem=o.format(this.callWithContext.bind(this),{type:"category",value:g,datum:t,seriesId:s,legendItemName:void 0,key:u,source:"legend-label",property:"legendItem",domain:[],boundSeries:this.getFormatterContext("legendItem")})??g),b}getLabels(e,t,i,s,n){const{properties:r}=this,{calloutLabel:o,sectorLabel:a,legendItemKey:l}=r,c=this.getLabelContent(e,t,n),h={};return o.enabled&&c.callout&&s>=mt(o.minAngle)&&(h.calloutLabel={...this.getTextAlignment(i),text:c.callout,hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),a.enabled&&c.sector&&(h.sectorLabel={text:c.sector}),l&&c.legendItem&&(h.legendItem={key:l,text:c.legendItem}),h}getTextAlignment(e){const t=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"top"},{textAlign:"right",textBaseline:"middle"}],i=Xa(e),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=(0,GD.modulus)(r,t.length);return t[o]}getNodeFill(e,t,i){return Rr(e,{type:"gradient",bounds:"series",colorStops:t.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"none",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0},{type:"image",backgroundFill:i,backgroundFillOpacity:1,fit:"contain",repeat:"no-repeat",rotation:0})}getFillParams(e,t,i){if(!(!ki(e)||e.bounds==="item"))return{centerX:0,centerY:0,innerRadius:t,outerRadius:i}}getSectorFormat(e,t,i,s,n){const{angleKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,fills:h,strokes:u,defaultColorRange:d,defaultPatternFills:p,itemStyler:g}=this.properties,y=u[t%u.length],b=h[t%h.length],{fill:m,fillOpacity:v,stroke:S,strokeWidth:M,strokeOpacity:I,lineDash:k,lineDashOffset:L,cornerRadius:C,opacity:O}=Le(this.getHighlightStyle(i,s?.datumIndex,n),{fill:b,stroke:y},this.properties),E=d[t%d.length],_=p[t%p.length],F=m??"black";let j;return g&&(j=this.cachedDatumCallback(this.getDatumId(t)+(i?"-highlight":"-hide"),()=>this.callWithContext(g,{datum:e,angleKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,fill:this.getNodeFill(F,E,_),strokeOpacity:I,stroke:S,strokeWidth:M,fillOpacity:v,lineDash:k,lineDashOffset:L,cornerRadius:C,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(j?.fill??F,E,_),fillOpacity:j?.fillOpacity??v,stroke:j?.stroke??S,strokeWidth:j?.strokeWidth??M,strokeOpacity:j?.strokeOpacity??I,lineDash:j?.lineDash??k,lineDashOffset:j?.lineDashOffset??L,cornerRadius:j?.cornerRadius??C,opacity:O}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(e){const t=[0,this.getOuterRadius()];this.radiusScale.range=t,e&&(this.previousRadiusScale.range=t);const i=s=>({...s,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(s.radius),0)});this.nodeData=this.nodeData.map(i),this.phantomNodeData=this.phantomNodeData?.map(i)}getTitleTranslationY(){const e=Math.max(0,this.radiusScale.range[1]);if(e===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-e);return-e-i-s}update({seriesRect:e}){const{title:t}=this.properties,i={seriesRectWidth:e?.width,seriesRectHeight:e?.height},s=Is(this.nodeDataDependencies,i)!=null;if(s&&(this._nodeDataDependencies=i),this.maybeRefreshNodeData(),this.updateTitleNodes(),this.updateRadiusScale(s),this.contentGroup.translationX=this.centerX,this.contentGroup.translationY=this.centerY,this.highlightGroup.translationX=this.centerX,this.highlightGroup.translationY=this.centerY,this.backgroundGroup.translationX=this.centerX,this.backgroundGroup.translationY=this.centerY,this.labelGroup&&(this.labelGroup.translationX=this.centerX,this.labelGroup.translationY=this.centerY),t){const n=this.getTitleTranslationY();t.node.y=isFinite(n)?n:0;const r=t.node.getBBox(!1);t.node.visible=t.enabled&&isFinite(n)&&!this.bboxIntersectsSurroundingSeries(r)}this.zerosumOuterRing.fillOpacity=0,this.zerosumOuterRing.stroke=this.properties.calloutLabel.color,this.zerosumOuterRing.strokeWidth=1,this.zerosumOuterRing.strokeOpacity=1,this.updateNodeMidPoint(),this.updateSelections(),this.updateNodes(e)}updateTitleNodes(){const{oldTitle:e}=this,{title:t}=this.properties;e!==t&&(e&&this.labelGroup?.removeChild(e.node),t&&(t.node.textBaseline="bottom",this.labelGroup?.appendChild(t.node)),this.oldTitle=t)}updateNodeMidPoint(){const e=t=>{const i=t.innerRadius+(t.outerRadius-t.innerRadius)/2;t.midPoint={x:t.midCos*Math.max(0,i),y:t.midSin*Math.max(0,i)}};this.nodeData.forEach(e),this.phantomNodeData?.forEach(e)}updateSelections(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,highlightLabelSelection:s,calloutLabelSelection:n,labelSelection:r}=this,o=this.nodeData.map(l=>({...l,sectorFormat:{...l.sectorFormat}})),a=(l,c)=>{l.update(c,void 0,h=>this.getDatumId(h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};a(e,this.nodeData),a(t,o),a(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,l=>{const c=new pi;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new _t;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),r.update(this.nodeData),s.update(o)}updateNodes(e){const t=this.ctx.highlightManager.getActiveHighlight(),{visible:i,dataModel:s,processedData:n}=this;if(this.backgroundGroup.visible=i,this.contentGroup.visible=i,!s||!n)return;const{legendItemValues:r}=this.getProcessedDataValues(s,n),o=this.isSeriesHighlighted(t,r);this.highlightGroup.visible=i&&o,this.highlightLabel.visible=i&&o,this.labelGroup&&(this.labelGroup.visible=i);const a=this.radiusScale.range[0],l=this.radiusScale.range[1],c=this.getShapeFillBBox(),h=this.ctx.animationManager.isSkipped(),u=(d,p,g,y)=>{const b=this.getSectorFormat(p.datum,p.itemId,y,p,r);p.sectorFormat.fill=b.fill,p.sectorFormat.stroke=b.stroke,h&&(d.startAngle=p.startAngle,d.endAngle=p.endAngle,d.innerRadius=p.innerRadius,d.outerRadius=p.outerRadius),(y||h)&&(d.fill=b.fill,d.stroke=b.stroke);const m=this.getFillParams(b.fill,a,l);on(d,b,void 0,c,m),d.cornerRadius=b.cornerRadius,d.fillShadow=this.properties.shadow;const v=Math.max((this.properties.sectorSpacing+(b.stroke!=null?b.strokeWidth:0))/2,0);d.inset=v,d.lineJoin=this.properties.sectorSpacing>=0||v>0?"miter":"round"};this.itemSelection.each((d,p,g)=>u(d,p,g,!1)),this.highlightSelection.each((d,p,g)=>{u(d,p,g,!0),d.visible=p.itemId===t?.itemId}),this.phantomSelection.each((d,p,g)=>u(d,p,g,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(e),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:e,strokeWidth:t,colors:i},strokes:s}=this.properties,n=t,r=$b(i)?i:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach(a=>{const l=a.closestDatum(),{calloutLabel:c,outerRadius:h,datumIndex:u}=l;if(c?.text&&!c.hidden&&h!==0){a.visible=!0,a.strokeWidth=n,a.stroke=r[u%r.length],a.strokeOpacity=this.getHighlightStyle(!1,l.datumIndex).opacity??1,a.fill=void 0;const d=l.midCos*h,p=l.midSin*h;let g=l.midCos*(h+e),y=l.midSin*(h+e);if((c.collisionTextAlign??c.collisionOffsetY!==0)&&c.box!=null){const m=c.box;let v=g,S=y;g<m.x?v=m.x:g>m.x+m.width&&(v=m.x+m.width),y<m.y?S=m.y:y>m.y+m.height&&(S=m.y+m.height);const M=v-g,I=S-y,k=Math.sqrt(Math.pow(M,2)+Math.pow(I,2)),L=k-o;L>0&&(g=g+M*L/k,y=y+I*L/k)}a.x1=d,a.y1=p,a.x2=g,a.y2=y}else a.visible=!1})}getLabelOverflow(e,t,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;t.x+a<s?l=(t.x+t.width-s)/t.width:t.x+t.width-a>n&&(l=(n-t.x)/t.width);const c=t.y+a<r||t.y+t.height-a>o,h=l===1?e.length:Math.floor(e.length*l)-1,u=this.bboxIntersectsSurroundingSeries(t);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(e){const{surroundingRadius:t}=this;if(t==null)return!1;const i=[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y},{x:e.x+e.width,y:e.y+e.height},{x:e.x,y:e.y+e.height}],s=t**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:e}=this,{calloutLabel:t,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=t,r=e.convert(0),o=m=>!m.calloutLabel||m.outerRadius===0,a=this.calloutNodeData,l=a.filter(m=>!o(m));if(l.forEach(m=>{const v=m.calloutLabel;v!=null&&(v.hidden=!1,v.collisionTextAlign=void 0,v.collisionOffsetY=0)}),l.length<=1)return;const c=l.filter(m=>m.midCos<0).sort((m,v)=>m.midSin-v.midSin),h=l.filter(m=>m.midCos>=0).sort((m,v)=>m.midSin-v.midSin),u=l.filter(m=>m.midSin<0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),d=l.filter(m=>m.midSin>=0&&m.calloutLabel?.textAlign==="center").sort((m,v)=>m.midCos-v.midCos),p=m=>{const v=m.calloutLabel;if(v==null)return W.zero.clone();const S=m.outerRadius+i.length+s,M=m.midCos*S,I=m.midSin*S+v.collisionOffsetY,k=v.collisionTextAlign??v.textAlign,L=v.textBaseline;return _t.computeBBox(v.text,M,I,{font:this.properties.calloutLabel,textAlign:k,textBaseline:L},!1)},g=(m,v,S)=>{const M=p(m).grow(n/2),I=p(v).grow(n/2);M.x<I.x+I.width&&M.x+M.width>I.x&&(S==="to-top"?M.y<I.y+I.height:M.y+M.height>I.y)&&(v.calloutLabel.collisionOffsetY=S==="to-top"?M.y-I.y-I.height:M.y+M.height-I.y)},y=m=>{const v=m.slice().sort((M,I)=>Math.abs(M.midSin)-Math.abs(I.midSin))[0],S=m.indexOf(v);for(let M=S-1;M>=0;M--){const I=m[M+1],k=m[M];g(I,k,"to-top")}for(let M=S+1;M<m.length;M++){const I=m[M-1],k=m[M];g(I,k,"to-bottom")}},b=m=>{const v=l.some(C=>C.calloutLabel.collisionOffsetY!==0),S=m.map(C=>p(C)),M=S.map(C=>C.clone().grow(n/2));let I=!1;for(let C=0;C<M.length&&!I;C++){const O=M[C];for(let E=C+1;E<m.length;E++){const _=M[E];if(O.collidesBBox(_)){I=!0;break}}}const k=a.map(C=>{const{startAngle:O,endAngle:E,outerRadius:_}=C;return{startAngle:O,endAngle:E,innerRadius:r,outerRadius:_}}),L=S.some(C=>k.some(O=>zD(C,O)));!I&&!v&&!L||m.filter(C=>C.calloutLabel.textAlign==="center").forEach(C=>{const O=C.calloutLabel;C.midCos<0?O.collisionTextAlign="right":C.midCos>0?O.collisionTextAlign="left":O.collisionTextAlign="center"})};y(c),y(h),b(u),b(d)}updateCalloutLabelNodes(e){const{radiusScale:t}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new _t;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,u=t.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,g=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,b={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=g,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(b);const m=a.getBBox(!1);let v=h.text,S=!0;if(i.avoidCollisions){const{textLength:M,hasVerticalOverflow:I}=this.getLabelOverflow(h.text,m,e);v=h.text.length===M?h.text:`${h.text.substring(0,M)}\u2026`,S=!I}l.text=v,l.x=g,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(b),l.fill=o,l.fillOpacity=this.getHighlightStyle(!1,c.datumIndex).opacity??1,l.visible=S})}computeLabelsBBox(e,t){const{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,maxCollisionOffset:o,minSpacing:a}=i;if(!i.avoidCollisions)return null;this.maybeRefreshNodeData(),this.updateRadiusScale(!1),this.computeCalloutLabelCollisionOffsets();const l=[],c=new _t;let h;const{title:u}=this.properties;if(u?.text&&u.enabled){const d=this.getTitleTranslationY();isFinite(d)&&(c.text=u.text,c.x=0,c.y=d,c.setFont(u),c.setAlign({textBaseline:"bottom",textAlign:"center"}),h=c.getBBox(!1),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const g=d.outerRadius+n+r,y=d.midCos*g,b=d.midSin*g+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=b,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox(!1);if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const v=-this.centerY,S=new W(h.x-a,v,h.width+2*a,h.y+h.height+a-v);if(m.collidesBBox(S)){p.hidden=!0;return}}if(e.hideWhenNecessary){const{textLength:v,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(p.text,m,t),I=p.text.length>2&&v<2;if(S||I||M){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:W.merge(l)}updateSectorLabelNodes(){const{radiusScale:e}=this,t=e.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=t>0,h=this.ctx.legendManager.getData(this.id)?.filter(d=>d.enabled).length===1,u=(d,p)=>{const{sectorLabel:g,outerRadius:y,startAngle:b,endAngle:m}=p;let v=!1;if(g&&y!==0){const S=t*(1-a)+y*a+o;d.fill=l,d.fillOpacity=this.getHighlightStyle(!1,p.datumIndex).opacity??1,d.fontStyle=s,d.fontWeight=n,d.fontSize=i,d.fontFamily=r,d.text=g.text,!c&&h?(d.x=0,d.y=0):(d.x=p.midCos*S,d.y=p.midSin*S),d.textAlign="center",d.textBaseline="middle";const I=d.getBBox(!1),k=[[I.x,I.y],[I.x+I.width,I.y],[I.x+I.width,I.y+I.height],[I.x,I.y+I.height]],L={startAngle:b,endAngle:m,innerRadius:t,outerRadius:y};k.every(([C,O])=>ad(C,O,L))&&(v=!0)}d.visible=v};this.labelSelection.each(u),this.highlightLabelSelection.each(u)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(e){return ym(this,e)}getTooltipContent(e){const{id:t,dataModel:i,processedData:s,properties:n,ctx:{formatManager:r}}=this,{legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,tooltip:y}=n,b=this.properties.title.text;if(!i||!s)return;const m=s.dataSources.get(this.id)?.[e],v=this.getProcessedDataValues(i,s),{angleRawValues:S}=v,M=S[e],I=this.getLabelContent(e,m,v),k=I.legendItem??I.callout??I.sector??d,L=i.getDomain(this,"angleRaw","value",s),C=r.format(this.callWithContext.bind(this),{type:"number",value:M,datum:m,seriesId:t,legendItemName:void 0,key:u,source:"tooltip",property:"angle",domain:L,boundSeries:this.getFormatterContext("angle"),fractionDigits:void 0})??_n(M,3);return this.formatTooltipWithContext(y,{title:b,symbol:this.legendItemSymbol(e),data:[{label:k,fallbackLabel:u,value:C}]},{seriesId:t,datum:m,title:d,legendItemKey:o,calloutLabelKey:a,calloutLabelName:l,sectorLabelKey:c,sectorLabelName:h,angleKey:u,angleName:d,radiusKey:p,radiusName:g,...this.getSectorFormat(m,e,!1)})}legendItemSymbol(e){const t=this.processedData?.dataSources.get(this.id)?.[e],i=this.getSectorFormat(t,e,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return ki(l)&&(l={...l,gradient:"linear",rotation:0,reverse:!1}),{marker:{fill:l,stroke:c,fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}}}getLegendData(e){const{id:t,visible:i,processedData:s,dataModel:n,ctx:{legendManager:r}}=this;if(!n||!s||e!=="category")return[];const{angleKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c,showInLegend:h}=this.properties;if(!c&&(!a||a===o)&&(!l||l===o))return[];const u=this.getProcessedDataValues(n,s),{angleRawValues:d}=u,p=this.properties.title?.showInLegend&&this.properties.title.text,g=[],y=this.properties.hideZeroValueSectorsInLegend,b=s.dataSources.get(this.id),m=s.invalidData?.get(this.id);for(let v=0;v<s.input.count;v++){const S=b?.[v],M=d[v];if(m?.[v]===!0||y&&M===0)continue;const I=[];p&&I.push(p);const k=this.getLabelContent(v,S,u);c&&k.legendItem!==void 0?I.push(k.legendItem):a&&a!==o&&k.callout!==void 0?I.push(k.callout):l&&l!==o&&k.sector!==void 0&&I.push(k.sector),I.length!==0&&g.push({legendType:"category",id:t,datum:S,itemId:v,seriesId:t,hideToggleOtherSeries:!0,enabled:i&&r.getItemEnabled({seriesId:t,itemId:v}),label:{text:I.join(" - ")},symbol:this.legendItemSymbol(v),legendItemName:c!=null?S[c]:void 0,hideInLegend:!h})}return g}setLegendState(e){const{id:t,ctx:{legendManager:i,updateService:s}}=this;e.forEach((n,r)=>i.toggleItem(n,t,r)),i.update(),s.update(5)}animateEmptyUpdateReady(e){const{animationManager:t}=this.ctx,i=ho(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Je(this.id,"nodes",t,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datumIndex)),Ne(this,"callout",t,this.calloutLabelSelection),Ne(this,"sector",t,this.labelSelection),Ne(this,"highlight",t,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,processedData:s,radiusScale:n,previousRadiusScale:r}=this,{animationManager:o}=this.ctx,a=s?.reduced?.diff?.[this.id];this.ctx.animationManager.stopByAnimationGroupId(this.id);const l=(a?.moved.size??0)===0,c=(s?.defs.keys.length??0)>0,h=s?.reduced?.animationValidation?.uniqueKeys??!0;(!l||!c||!h)&&this.ctx.animationManager.skipCurrentBatch();const u=ho(!1,this.properties.rotation,n,r);Je(this.id,"nodes",o,[e,t,i],u.nodes,(d,p)=>this.getDatumId(p.datumIndex),a),Ne(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ne(this,"sector",this.ctx.animationManager,this.labelSelection),Ne(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:e,highlightSelection:t,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=ho(!1,this.properties.rotation,s,n);Je(this.id,"nodes",r,[e,t,i],o.nodes,(a,l)=>this.getDatumId(l.datumIndex)),nr(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),nr(this,"sector",this.ctx.animationManager,this.labelSelection),nr(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(e){return`${e}`}};fd.className="PieSeries",fd.type="pie";var W2={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:Ci.LARGE},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},spacing:5},calloutLabel:{enabled:!0,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},offset:3,minAngle:.001},sectorLabel:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},color:{$ref:"chartBackgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:{$value:"$1"}},{$isPattern:{$value:"$1"}},{$isImage:{$value:"$1"}}]},{$path:["../../strokes/$index",{$ref:"foregroundColor"}]},{$value:"$1"}]},{$if:[{$eq:[{$path:"../strokeWidth"},0]},{$path:"../fills"},{$path:"../strokes"}]}]}},fills:{$palette:"fills"},strokes:{$palette:"strokes"},defaultColorRange:{$palette:"gradients"},defaultPatternFills:sf,fillOpacity:1,strokeOpacity:1,strokeWidth:{$isUserOption:["./strokes/0",2,0]},lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Hn,xOffset:3,yOffset:3,blur:5},highlight:Yn()},legend:{enabled:!0}},$2={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:e=>new fd(e),themeTemplate:W2},Y2={type:"series",name:"pie",chartType:"polar",options:Qr,create:e=>new fd(e)};function Mm(){Ds.register(GS,UE,OE,b2,ID,E2,ND,j2,G2,$2,P2);for(const e of[js,Kr,zs,qr,ra,er])kr.register(e.type,{moduleFactory:t=>new e(t)})}var UD=(T(),N(w));function K2(){for(const e of Ds.modules){if(e.packageType==="enterprise"&&!EN(e)&&UD.Logger.errorOnce("Unexpected enterprise module registered: "+e.identifier),e.type==="root"&&e.themeTemplate)for(const t of e.chartTypes)fg.set(t,e.themeTemplate);if(e.type==="series"){if(e.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${e.identifier}`);ss.register(e.identifier,e)}if(e.type==="series-option"&&e.themeTemplate)for(const t of e.seriesTypes)ss.setThemeTemplate(t,e.themeTemplate);if(e.type==="axis-option"&&e.themeTemplate)for(const t of e.axisTypes){const i=kr.getThemeTemplate(t),s=Le(e.themeTemplate,i);kr.setThemeTemplate(t,s)}e.type==="axis"&&kr.register(e.identifier,e),e.type==="legend"&&gg.register(e.identifier,e)}if(Ds.hasEnterpriseModules()){const e=PN();e.length>0&&UD.Logger.errorOnce("Enterprise modules expected but not registered: ",e)}}var V=(T(),N(w)),xi=Symbol("IGNORED_PROP");function Yi(e,t){const i={};for(const s of Object.keys(t)){const n=t[s];n!==xi&&Object.hasOwn(e,s)&&(i[s]=n)}return i}function WD(e){const{enabled:t,mode:i,showArrow:s,range:n,position:r,pagination:o,delay:a,wrapping:l,interaction:c,renderer:h,...u}=e,d=Yi(e,{enabled:t,showArrow:s,range:n,position:r,interaction:c,renderer:h,...u});return{chartTooltipOptions:Yi(e,{enabled:xi,showArrow:xi,range:xi,position:xi,mode:i,pagination:o,delay:a,wrapping:l,...u}),seriesTooltipOptions:d}}function Z2(e){const{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:y,title:b,width:m,type:v,cursor:S,nodeClickRange:M,tooltip:I={},value:k,scale:L={},startAngle:C,endAngle:O,highlightStyle:E,highlight:_,segmentation:F,bar:j,needle:Q,targets:ne,outerRadius:le,innerRadius:xe,outerRadiusRatio:pe,innerRadiusRatio:be,cornerRadius:ue,cornerMode:$,label:te,secondaryLabel:ie,spacing:de,...ee}=e,{chartTooltipOptions:J,seriesTooltipOptions:Y}=WD(I),X=Yi(e,{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:y,title:b,tooltip:J,width:m}),U=Yi(e,{needle:Q!=null?{enabled:!0,...Q}:xi,startAngle:C,endAngle:O,scale:L,type:v,cursor:S,context:r,nodeClickRange:M,tooltip:Y,value:k,highlightStyle:E,highlight:_,segmentation:F,bar:j,targets:ne,outerRadius:le,innerRadius:xe,outerRadiusRatio:pe,innerRadiusRatio:be,cornerRadius:ue,cornerMode:$,label:te,secondaryLabel:ie,spacing:de,...ee});return{...X,series:[U]}}function X2(e){const{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:y,title:b,width:m,type:v,cursor:S,nodeClickRange:M,tooltip:I={},value:k,scale:L={},direction:C="vertical",thickness:O,highlightStyle:E,highlight:_,segmentation:F,bar:j,targets:Q,cornerRadius:ne,cornerMode:le,label:xe,...pe}=e,{chartTooltipOptions:be,seriesTooltipOptions:ue}=WD(I),$=Yi(e,{animation:t,background:i,container:s,contextMenu:n,context:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,overrideDevicePixelRatio:d,padding:p,subtitle:g,theme:y,title:b,tooltip:be,width:m}),te=Yi(e,{scale:L,type:v,cursor:S,context:r,nodeClickRange:M,tooltip:ue,value:k,direction:C,thickness:O,highlightStyle:E,highlight:_,segmentation:F,bar:j,targets:Q,cornerRadius:ne,cornerMode:le,label:xe,...pe});return{...$,series:[te]}}function $D(e,t){if(t==null)return e;const{targets:i,...s}=t;return e=Le(e,s),e.targets!=null&&i!=null&&(e.targets=Sb(e.targets,i)),e}function q2(e,t){switch(e.type){case"radial-gauge":const i=$D(e,t);return Z2(i);case"linear-gauge":const s=$D(e,t);return X2(s);default:return{}}}var Q2=(T(),N(w)),Ki={stroke:st},Qt={fill:Fl},YD={color:"white",fill:st},xn={color:st},uo={color:zl,fontSize:{$rem:Ci.LARGE},fontFamily:{$ref:"fontFamily"}},Sm={...uo,fontSize:{$ref:"fontSize"},color:Gl,fill:Bl,stroke:Vl,strokeWidth:1,divider:{stroke:Hl,strokeWidth:1,strokeOpacity:.5}},Dm={...Ki,background:{fill:Mt,fillOpacity:.2},handle:{...Qt},text:{...xn},statistics:{...Sm}},J2={line:{...Ki,handle:{...Qt},text:{...xn}},"horizontal-line":{...Ki,handle:{...Qt},axisLabel:{...YD},text:{...xn}},"vertical-line":{...Ki,handle:{...Qt},axisLabel:{...YD},text:{...xn}},"disjoint-channel":{...Ki,background:{fill:Mt,fillOpacity:.2},handle:{...Qt},text:{...xn}},"parallel-channel":{...Ki,background:{fill:Mt,fillOpacity:.2},handle:{...Qt},text:{...xn}},"fibonacci-retracement":{...Ki,strokes:jl,rangeStroke:st,handle:{...Qt},text:{...xn,position:"center"},label:{...uo,color:void 0,fontSize:{$rem:Ci.SMALLER}}},"fibonacci-retracement-trend-based":{...Ki,strokes:jl,rangeStroke:st,handle:{...Qt},text:{...xn,position:"center"},label:{...uo,color:void 0,fontSize:{$rem:Ci.SMALLER}}},callout:{...Ki,...uo,color:{$ref:"textColor"},handle:{...Qt},fill:Mt,fillOpacity:.2},comment:{...uo,color:"white",fontWeight:700,handle:{...Qt},fill:st},note:{...uo,color:Kl,fill:st,stroke:{$ref:"chartBackgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Qt},background:{fill:$l,stroke:Yl,strokeWidth:1}},text:{...uo,handle:{...Qt}},arrow:{...Ki,handle:{...Qt},text:{...xn}},"arrow-up":{fill:{$palette:"up.fill"},handle:{...Qt,stroke:st}},"arrow-down":{fill:{$palette:"down.fill"},handle:{...Qt,stroke:st}},"date-range":{...Dm},"price-range":{...Dm},"date-price-range":{...Dm},"quick-date-price-range":{up:{...Ki,fill:Mt,fillOpacity:.2,handle:{...Qt},statistics:{...Sm,color:"#fff",fill:Mt,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Ki,stroke:Wl,fill:Ul,fillOpacity:.2,handle:{...Qt,stroke:Wl},statistics:{...Sm,color:"#fff",fill:Ul,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},eP=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],tP=[{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 iP(e,t,i){const{dateKey:s="date",highKey:n="high",openKey:r="open",lowKey:o="low",closeKey:a="close",volumeKey:l="volume",chartType:c="candlestick",navigator:h=!1,volume:u=!0,rangeButtons:d=!0,statusBar:p=!0,toolbar:g=!0,zoom:y=!0,sync:b=!1,theme:m,data:v,formatter:S,...M}=e,I=nP(c,s,n,o,r,a),k=sP(i,r,a,u,l),C={navigator:{enabled:h,...u?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:bu,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},O={annotations:{enabled:g,optionsToolbar:{enabled:g},snap:!0,toolbar:{enabled:g,buttons:tP,padding:0},data:v,xKey:s,volumeKey:u?l:void 0}},E=p?{statusBar:{enabled:!0,data:v,highKey:n,openKey:r,lowKey:o,closeKey:a,volumeKey:u?l:void 0}}:null,_={zoom:{enabled:y,autoScaling:{enabled:!0},enableIndependentAxes:!0}},F={ranges:{enabled:d}},j=b?{sync:{enabled:b,nodeInteraction:!0,zoom:!0}}:null,Q=u?[{type:"number",position:"left",keys:[l],label:{enabled:!1},crosshair:{enabled:!1},gridLine:{enabled:!1},nice:!1,layoutConstraints:{stacked:!1,width:20,unit:"percent",align:"end"}}]:[];return{theme:{baseTheme:typeof m=="string"?m:"ag-financial",...Le(typeof m=="object"?m:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:6},chartToolbar:{enabled:g},annotations:{...J2},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...XD(c,{hlc:{stroke:{$palette:"altNeutral.stroke"},strokeWidth:2},line:{stroke:{$palette:"neutral.stroke"}},"step-line":{stroke:{$palette:"neutral.stroke"},interpolation:{type:"step"}}})}},candlestick:{series:{...XD(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...k,...I],axes:[{type:"number",position:"right",keys:[r,a,n,o],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...Q,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:v,formatter:S,...O,...C,...E,..._,...F,...j,...M}}function sP(e,t,i,s,n){return s?[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},itemStyler({datum:r}){const{up:o,down:a}=e().palette;return{fill:r[t]<r[i]?o?.fill:a?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}var KD="range-area";function nP(e,t,i,s,n,r){const o={xKey:t,openKey:n,closeKey:r,highKey:i,lowKey:s},a={xKey:t,yKey:r},l={pickOutsideVisibleMinorAxis:!0};switch(e??"candlestick"){case"ohlc":return rP(l,o);case"line":case"step-line":return oP(l,a);case"hlc":return aP(l,a,o);case"high-low":return lP(l,o);case"candlestick":case"hollow-candlestick":return ZD(l,o);default:return Q2.Logger.warnOnce(`unknown chart type: ${e}; expected one of: ${eP.join(", ")}`),ZD(l,o)}}function rP(e,t){return[{type:"ohlc",focusPriority:0,...e,...t}]}function oP(e,t){return[{type:"line",focusPriority:0,...e,...t}]}function aP(e,t,{xKey:i,highKey:s,closeKey:n,lowKey:r}){return[{type:KD,focusPriority:0,...e,xKey:i,yHighKey:s,yLowKey:n,fill:du,stroke:hu},{type:KD,focusPriority:0,...e,xKey:i,yHighKey:n,yLowKey:r,fill:pu,stroke:uu},{type:"line",...e,...t}]}function lP(e,{xKey:t,highKey:i,lowKey:s}){return[{type:"range-bar",...e,xKey:t,yHighKey:i,yLowKey:s,fill:fu,stroke:gu,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function ZD(e,t){return[{type:"candlestick",focusPriority:0,...e,...t}]}function XD(e,t){return t[e]??t.default}var qD={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:yu,lineDash:[0],label:{enabled:!1}}},Im={...qD,nice:!1},md={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},Am={style:[{stroke:{$ref:"gridLineColor"}}],width:2},cP={number:{gridLine:Am},time:{gridLine:Am},category:{gridLine:Am}},hP={overrides:{common:{animation:{enabled:!1},contextMenu:{enabled:!1},keyboard:{enabled:!1},background:{visible:!1},navigator:{enabled:!1},padding:{top:0,right:0,bottom:0,left:0},axes:{number:{...Im,interval:{values:[0]}},log:{...Im},time:{...Im},category:{...qD}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...md,position:{...md.position,anchorTo:"pointer"},range:"nearest"},axes:cP},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:md},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:md}}},QD=Jt(uP);function uP(e,t){return typeof e=="string"?{...t,baseTheme:e}:e!=null?{...e,baseTheme:QD(e.baseTheme,t)}:t}function JD(e){if(Array.isArray(e)&&e.length!==0){const t=e.find(i=>i!=null);if(typeof t=="number")return{data:e.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(t))return{data:e.map(s=>({x:s?.[0],y:s?.[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}else if(e?.length===0)return{data:e,series:[{xKey:"x",yKey:"y"}],datumKey:"y"};return{data:e}}function dP(e){switch(e?.type){case"number":{const{type:n,min:r,max:o,reverse:a}=e;return Yi(e,{type:n,reverse:a,min:r,max:o})}case"time":{const{type:n,min:r,max:o,reverse:a}=e;return Yi(e,{type:n,reverse:a,min:r,max:o})}case"category":default:const{paddingInner:t,paddingOuter:i,reverse:s}=e??{};return Yi({...e,type:"category"},{type:"category",reverse:s,paddingInner:t,paddingOuter:i})}}function pP(e,t,i){const s={};return e?.stroke!=null&&(s.style=[{stroke:e?.stroke}],s.enabled??(s.enabled=!0)),e?.strokeWidth!=null&&(s.width=e?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),e?.visible!=null&&(s.enabled=e.visible),s.enabled??(s.enabled=t),s}var gP=Jt((e,t,i)=>s=>{const n=s.datum[s.xKey],r=s.datum[s.yKey],o=i!=null?s.datum[i]:s.datum,a=t?.renderer?.({context:e,datum:o,xValue:n,yValue:r});if(typeof a=="string")return a;const l=a?.content??r.toFixed(2);return a?.title?{heading:void 0,title:void 0,data:[{label:a.title,value:l}]}:{heading:void 0,title:l,data:[]}});function fP(e){const{background:t,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,theme:u,data:d,crosshair:p,axis:g,min:y,max:b,tooltip:m,context:v,styleNonce:S,...M}=e,I=Yi(e,{background:t,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,styleNonce:S,tooltip:xi,context:xi,data:xi,crosshair:xi,axis:xi,min:xi,max:xi,theme:xi}),{data:k,series:[L]=[],datumKey:C}=JD(d),O=M;L!=null&&Object.assign(O,L),O.tooltip={...m,renderer:gP(v,m,C)},I.theme=QD(u,hP),I.data=k,I.series=[O];const E=O.type!=="bar"||O.direction!=="horizontal",[_,F]=E?["bottom","left"]:["left","bottom"],j={...dP(g),position:_,...Yi(e,{crosshair:p})},Q={type:"number",gridLine:pP(g,!1,e),position:F,...Yi(e,{min:y,max:b})};return I.axes=E?[Q,j]:[j,Q],I}var mP={chartType:(0,V.union)("candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"),dateKey:V.string,openKey:V.string,highKey:V.string,lowKey:V.string,closeKey:V.string,volumeKey:V.string,navigator:V.boolean,volume:V.boolean,rangeButtons:V.boolean,statusBar:V.boolean,toolbar:V.boolean,zoom:V.boolean,sync:V.boolean,theme:V.defined,container:V.defined,width:V.defined,height:V.defined,minWidth:V.defined,minHeight:V.defined,listeners:V.defined,initialState:V.defined,title:V.defined,data:V.array,formatter:V.defined},Lm={theme:V.defined,container:V.defined,animation:V.defined,background:V.defined,contextMenu:V.defined,context:()=>!0,listeners:V.defined,locale:V.defined,width:V.defined,height:V.defined,minWidth:V.defined,minHeight:V.defined,title:V.defined,subtitle:V.defined,footnote:V.defined,padding:V.defined,tooltip:{...ke,...oe.tooltip}};Lm.overrideDevicePixelRatio=(0,V.undocumented)(V.positiveNumber);var km=["showInLegend","showInMiniChart","grouped","stacked","stackGroup","tooltip","listeners","errorBar","xKey","yKey","type"],Cm={visible:V.boolean,reverse:V.boolean,stroke:V.color,strokeWidth:V.positiveNumber},wm={context:()=>!0,tooltip:V.defined,theme:V.defined,background:V.defined,container:V.defined,width:V.defined,height:V.defined,minWidth:V.defined,minHeight:V.defined,padding:V.defined,listeners:V.defined,locale:V.defined,data:V.defined,styleNonce:V.string,axis:(0,V.typeUnion)({number:{...Cm,min:(0,V.and)(V.number,(0,V.lessThan)("max")),max:(0,V.and)(V.number,(0,V.greaterThan)("min"))},category:{...Cm,paddingInner:V.ratio,paddingOuter:V.ratio},time:{...Cm,min:(0,V.and)((0,V.or)(V.number,V.date),(0,V.lessThan)("max")),max:(0,V.and)((0,V.or)(V.number,V.date),(0,V.greaterThan)("min"))}},"axis options","category"),min:(0,V.and)(V.number,(0,V.lessThan)("max")),max:(0,V.and)(V.number,(0,V.greaterThan)("min")),crosshair:{enabled:V.boolean,snap:V.boolean,...V.strokeOptionsDef,...V.lineDashOptionsDef},xKey:V.string,yKey:V.string},yP={type:"preset",name:"price-volume",enterprise:!0,options:mP,create:iP},bP={type:"preset",name:"gauge-preset",enterprise:!0,options:(0,V.typeUnion)({"linear-gauge":{...G(Qn,["type"]),...Lm},"radial-gauge":{...G(tc,["type"]),...Lm}},"gauge options"),create:q2},xP={type:"preset",name:"sparkline",options:(0,V.typeUnion)({area:{...wm,...G(HM,km)},bar:{...wm,...G(oc,km)},line:{...wm,...G(_u,km)}},"sparkline options"),create:fP,processData:JD},Nm=(T(),N(w)),Cc=(T(),N(w)),vP=["top","right","bottom","left"],yd=class FI extends cu{constructor(t,i){super(t,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(t,i){super.onAxisChange(t,i),this.syncAxisChanges(t,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(t)}destroySeries(t){super.destroySeries(t),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(t){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(t),s.setClipRect(t)}async processData(){await super.processData(),this.syncStatus==="init"&&(this.syncStatus="domains-calculated"),this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}async processDomains(){await super.processDomains();for(const t of this.axes){const i=await this.getSyncedDomain(t);i!=null&&t.setDomains(i)}}performLayout(t){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:r,visible:o}=this.updateAxes(t.layoutBox);this.seriesRoot.visible=o,this.seriesRect=r,this.animationRect=t.layoutBox;const{x:a,y:l}=r;if(t.width!==this.lastLayoutWidth||t.height!==this.lastLayoutHeight)for(const d of[i,s])d.translationX=Math.floor(a),d.translationY=Math.floor(l);else{const{translationX:d,translationY:p}=i;en(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:d,translationY:p},{translationX:Math.floor(a),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=t.width,this.lastLayoutHeight=t.height;const c=r.clone().grow(this.seriesArea.padding),h=this.seriesArea.clip||n?c:void 0,{lastUpdateClipRect:u}=this;this.lastUpdateClipRect=h,this.ctx.animationManager.isActive()&&u!=null?this.ctx.animationManager.animate({id:this.id,groupId:"clip-rect",phase:"update",from:u,to:c,onUpdate:d=>this.setRootClipRects(d),onComplete:()=>this.setRootClipRects(h)}):this.setRootClipRects(h),this.ctx.layoutManager.emitLayoutComplete(t,{axes:this.axes.map(d=>d.getLayoutState()),series:{visible:o,rect:r,paddedRect:c},clipSeries:n})}updateAxes(t){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(t);for(const r of this.axes)r.update(),r.setCrossLinesVisible(!n),this.clipAxis(r,s,t);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(t){let i,s,n=0;const r=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),t.clone()),n++>r){Cc.Logger.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(t,i){const s=new Map,n={};let r=!1,o=!1;for(const m of vP){const v=this.seriesArea.padding[m],S=this.axes.findLast(M=>M.position===m);S?S.seriesAreaPadding=v:i.shrink(v,m)}const a=(t.get("left")??0)+(t.get("right")??0),l=(t.get("top")??0)+(t.get("bottom")??0),c=this.buildCrossLinePadding(t),h=c.left+c.right,u=c.top+c.bottom;i.width<=a+h||i.height<=l+u?r=!0:i.shrink(c);const{scene:d}=this.ctx,p=i.clone().shrink(Object.fromEntries(t));for(const m of this.axes){const{position:v="left",direction:S}=m,M=S==="y";let I;this.sizeAxis(m,p,v),m.thickness==null?I=Tm(M,d)*(m.maxThicknessRatio??1):I=m.thickness;const{primaryTickCount:k,bbox:L}=m.calculateLayout(m.nice?n[S]:void 0,{sizeLimit:I,padding:this.padding});n[S]??(n[S]=k),o||(o=m.dataDomain.clipped||m.visibleRange[0]>0||m.visibleRange[1]<1),m.thickness==null&&(I=Math.min(Tm(M,L)??0,I)),s.set(m.id,Math.ceil(I))}const g=(0,Cc.groupBy)(this.axes,m=>m.position??"left"),y=new Map,b=new Map;for(const[m,v]of(0,Cc.entries)(g)){let S=Tm(m!=="left"&&m!=="right",d)%d.pixelRatio,M=0;for(const I of v??[]){b.set(I.id,S);const k=s.get(I.id)??0;M=Math.max(M,S+k),I.layoutConstraints.stacked&&(S+=k+FI.AxesPadding)}y.set(m,Math.ceil(M))}for(const[m,v]of(0,Cc.entries)(g))this.positionAxes({axes:v??[],position:m,axisWidths:s,axisOffsets:b,axisAreaWidths:y,axisBound:i,seriesRect:p});return{clipSeries:o,seriesRect:p,axisAreaWidths:y,overflows:r}}buildCrossLinePadding(t){const i={top:0,right:0,bottom:0,left:0};this.axes.forEach(s=>{const{position:n,label:r}=s;s.crossLines?.forEach(o=>{var a;o instanceof ai&&(o.position=n??"top",(a=o.label).parallel??(a.parallel=r.parallel)),o.calculatePadding?.(i)})});for(const[s,n=0]of(0,Cc.entries)(i))i[s]=Math.max(n-(t.get(s)??0),0);return i}clampToOutsideSeriesRect(t,i,s,n){const r=s==="x"?t.x:t.y,o=s==="x"?t.width:t.height;return n===1?Math.min(i,r+o):Math.max(i,r)}async getSyncedDomain(t){const i=this.modulesManager.getModule("sync");if(i?.enabled)return await i.getSyncedDomain(t)}syncAxisChanges(t,i){const s=this.modulesManager.getModule("sync");if(!s?.enabled)return;const n=new Set(i??[]);for(const r of t)n.delete(r);for(const r of n)s.removeAxis(r)}sizeAxis(t,i,s){const n=t instanceof js,r=s==="left"||s==="right",{width:o,height:a}=i,l=r?a:o;let c=0,h=l,{min:u,max:d}=this.ctx.zoomManager.getAxisZoom(t.id);const{width:p,unit:g,align:y}=t.layoutConstraints;g==="px"?h=c+p:h=h*p/100,y==="end"&&(c=l-(h-c),h=l),r&&(n?[c,h]=[h,c]:[u,d]=[1-d,1-u]),t.range=[c,h],t.visibleRange=[u,d],t.gridLength=r?o:a}positionAxes(t){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:r,axisAreaWidths:o,seriesRect:a,position:l}=t,c=o.get(l)??0;let h="x",u="y",d=1;(l==="top"||l==="bottom")&&(h="y",u="x");let p=s[h];(l==="right"||l==="bottom")&&(d=-1,p+=h==="x"?s.width:s.height);for(const g of i){const y=o.get(u==="x"?"left":"top")??0,b=n.get(g.id)??0,m=r.get(g.id)??0;g.gridPadding=c-m-b,g.translation[u]=s[u]+y,g.translation[h]=this.clampToOutsideSeriesRect(a,p+d*(m+b),h,d)}}shouldFlipXY(){return this.series.every(t=>t instanceof rr&&t.shouldFlipXY())}getDefaultState(){const t=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&t.set(i,s)}return{axisAreaWidths:t,clipSeries:!1,overflows:!1}}isLayoutStable(t,i){if(i.overflows!==t.overflows||i.clipSeries!==t.clipSeries)return!1;for(const s of t.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const r=t.axisAreaWidths.get(s);if((n!=null||r!=null)&&n!==r)return!1}return!0}clipAxis(t,i,s){const n=Math.ceil(t.gridLine?.width??0),r=Math.ceil(t.line?.width??0);let{width:o,height:a}=i;switch(o+=t.direction==="x"?n:r,a+=t.direction==="y"?n:r,t.clipGrid(i.x,i.y,o,a),t.position){case"left":case"right":t.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":t.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);break}}};yd.className="CartesianChart",yd.type="cartesian",yd.AxesPadding=15;var MP=yd;function Tm(e,t){return e?t?.width:t?.height}var Ye=(T(),N(w)),po={mode:(0,Ye.undocumented)((0,Ye.union)("integrated","standalone")),container:Ye.htmlElement,context:()=>!0,theme:Ye.defined,series:Ye.array,annotations:Ye.defined,navigator:Ye.defined,initialState:{chartType:Ye.string,annotations:Ye.defined,legend:(0,Ye.arrayOfDefs)({visible:Ye.boolean,seriesId:Ye.string,itemId:Ye.string,legendItemName:Ye.string},"legend state array"),zoom:Ye.defined}},eI={...oe,...po,axes:(0,Ye.arrayLength)(2),data:Ye.array},tI={...oe,...po,axes:(0,Ye.arrayLength)(2),data:Ye.array},SP={...oe,...po,data:Ye.array,topology:Ye.geoJson},DP={...oe,...po,data:Ye.array},IP={...oe,...po,data:Ye.array},AP={...oe,...po,data:Ye.array,nodes:Ye.array},LP={...oe,...po,data:Ye.array},kP=new Set(["number","log","time"]),CP=e=>(0,Nm.isObject)(e)&&!kP.has(e.type),wP={type:"chart",name:"cartesian",options:eI,detect:xv,create(e,t){return new MP(e,t)},validate(e,t,i){const s=[];e?.series?.[0]?.type==="histogram"&&e?.axes?.some(CP)&&(s.push(new Nm.ValidationError("invalid","only continuous axis types when histogram series is used",e.axes,i,"axes")),e=G(e,["axes"]));const n=(0,Nm.validate)(e,t,i);return n.invalid.push(...s),n}},YR=(T(),N(w)),wc=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},NP={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:Sv,create:wc},TP={type:"chart",name:"gauge",placeholder:!0,options:{},detect:Vg,create:wc},OP={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:vv,create:wc},EP={type:"chart",name:"standalone",placeholder:!0,options:{},detect:Dv,create:wc},PP={type:"chart",name:"topology",placeholder:!0,options:{},detect:Mv,create:wc},iI=(T(),N(w)),sI=(T(),N(w)),Ca=class extends Cg{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}layoutCrossLines(){const e=this.label.getSideFlag(),t=this.isAnySeriesActive(),{rotation:i,parallelFlipRotation:s,regularFlipRotation:n}=this.calculateRotations();this.crossLines.forEach(r=>{r.sideFlag=-e,r.direction=i===-Math.PI/2?"angle":"radius",r.parallelFlipRotation=s,r.regularFlipRotation=n,r.calculateLayout?.(t,this.reverse)})}updatePosition(){super.updatePosition();const e=Math.floor(this.translation.x),t=Math.floor(this.translation.y);this.tickLineGroup.translationX=e,this.tickLineGroup.translationY=t,this.tickLabelGroup.translationX=e,this.tickLabelGroup.translationY=t,this.crossLineRangeGroup.translationX=e,this.crossLineRangeGroup.translationY=t,this.crossLineLineGroup.translationX=e,this.crossLineLineGroup.translationY=t,this.crossLineLabelGroup.translationX=e,this.crossLineLabelGroup.translationY=t,this.tickLabelGroupSelection.each($h())}computeLabelsBBox(e,t){return null}computeRange(){}getAxisLinePoints(){}};f([x],Ca.prototype,"shape",2),f([x],Ca.prototype,"innerRadiusRatio",2);var Om=class extends cu{constructor(e,t){super(e,t),this.padding=new Pn(40),this.ctx.axisManager.axisGroup.zIndex=7}getChartType(){return"polar"}async performLayout(e){const{layoutBox:t}=e;t.shrink(this.seriesArea.padding.toJson());const i=t.clone();this.seriesRect=i,this.animationRect=i,this.seriesRoot.translationX=i.x,this.seriesRoot.translationY=i.y,await this.computeCircle(i),this.axes.forEach(s=>s.update()),this.ctx.layoutManager.emitLayoutComplete(e,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(e,t,i,s){const n=this.axes.find(l=>l.direction==="angle"),r=this.axes.find(l=>l.direction==="radius");if(!(n instanceof Ca)||!(r instanceof Ca))return;const o=n.scale,a=r.innerRadiusRatio;n.innerRadiusRatio=a,n.computeRange(),n.gridLength=s,r.gridAngles=o.ticks({nice:n.nice,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0})?.ticks?.map(l=>o.convert(l)),r.gridRange=n.range,r.range=[s,s*a],[n,r].forEach(l=>{l.translation.x=e.x+t,l.translation.y=e.y+i,l.calculateLayout()})}async computeCircle(e){const t=this.series.filter(RP),i=this.axes.filter(_P),s=(c,h,u)=>{this.updateAxes(e,c,h,u),t.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=u});const d=t.filter(p=>p.type==="donut"||p.type==="pie");if(d.length>1){const p=d.map(g=>{const y=g.getInnerRadius();return{series:g,innerRadius:y}}).sort((g,y)=>g.innerRadius-y.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let g=0;g<p.length-1;g++)p[g].series.surroundingRadius=p[g+1].innerRadius}},n=e.width/2,r=e.height/2,o=Math.max(0,Math.min(e.width,e.height)/2);let a=o;s(n,r,a);const l=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const p of(0,sI.iterate)(i,t)){const g=await p.computeLabelsBBox({hideWhenNecessary:c},e);g&&h.push(g)}if(h.length===0){s(n,r,o);return}const u=W.merge(h),d=this.refineCircle(u,a,e);s(d.centerX,d.centerY,d.radius),a=d.radius};await l(),await l(),await l(),await l({hideWhenNecessary:!0}),await l({hideWhenNecessary:!0});for(const c of(0,sI.iterate)(i,t))await c.computeLabelsBBox({hideWhenNecessary:!0},e);return{radius:a,centerX:n,centerY:r}}refineCircle(e,t,i){const n=-t,r=-t,o=t,a=t;let l=Math.max(0,n-e.x),c=Math.max(0,r-e.y),h=Math.max(0,e.x+e.width-o),u=Math.max(0,e.y+e.height-a);l=h=Math.max(l,h),c=u=Math.max(c,u);const d=i.width-l-h,p=i.height-c-u;let g=Math.min(d,p)/2;const y=.5*i.width/2,b=.5*i.height/2,m=Math.min(y,b);if(g<m){g=m;const M=l+h,I=c+u;if(2*g+I>i.height){const k=i.height-2*g;Math.min(c,u)*2>k?(c=k/2,u=k/2):c>u?c=k-u:u=k-c}if(2*g+M>i.width){const k=i.width-2*g;Math.min(l,h)*2>k?(l=k/2,h=k/2):l>h?l=k-h:h=k-l}}const v=l+2*g+h,S=c+2*g+u;return{centerX:(i.width-v)/2+l+g,centerY:(i.height-S)/2+c+g,radius:g}}};Om.className="PolarChart",Om.type="polar";function RP(e){return e instanceof dd}function _P(e){return e instanceof Ca}var jP={type:"chart",name:"polar",options:tI,detect:kT,create(e,t){return new Om(e,t)},validate(e,t,i){const s=[],n=e?.series?.[0]?.type;(n==="pie"||n==="donut")&&e?.axes&&(s.push(new iI.UnknownError([],e.axes,i,"axes")),e=G(e,["axes"]));const r=(0,iI.validate)(e,t,i);return r.invalid.push(...s),r}},KR=(T(),N(w)),zP=[wP,a1,l1,c1,h1,u1,d1,bD,AD,kD,wD,TD,ED],FP=[jP,H2,Y2],BP=[...zP,...FP,NP,TP,OP,EP,PP,yP,bP,xP],VP=1e3,Em=class lr{constructor(t,i,s,n,r,o=VP){this.name=t,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=r,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(t,i,s,n,r){return this.pools.has(t)||this.pools.set(t,new lr(t,i,s,n,r)),this.pools.get(t)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(t){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(t),lr.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):lr.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i]),this.busyPool.add(i),{item:i,release:()=>this.release(i)}}obtainFree(){const t=this.freePool.pop();if(t==null)throw new Error("AG Charts - pool has no free instances");return lr.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,t]),this.busyPool.add(t),{item:t,release:()=>this.release(t)}}release(t){if(!this.busyPool.has(t))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");lr.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]),this.releaseItem(t),this.busyPool.delete(t),this.freePool.push(t),lr.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,t]);const i=Date.now(),s=i+this.cleanupTimeMs*.5;this.cleanPoolTimer&&(this.cleanPoolDue??1/0)<s&&(clearTimeout(this.cleanPoolTimer),this.cleanPoolTimer=void 0),this.cleanPoolTimer||(this.cleanPoolDue=i+this.cleanupTimeMs,this.cleanPoolTimer=setTimeout(this.cleanPool.bind(this),this.cleanupTimeMs))}cleanPool(){const t=this.freePool.splice(0);for(const i of t)this.destroyItem(i);lr.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${t.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const t of this.busyPool.values())this.destroyItem(t);this.busyPool.clear()}};Em.pools=new Map,Em.debug=me.create(!0,"pool");var GP=Em;Jc.ModuleRegistry.registerMany(BP,Ir);var vn=me.create(!0,"opts"),ar=class{static licenseCheck(e){this.licenseChecked||(this.licenseManager=tr.licenseManager?.(e),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(e){return tr.licenseManager?.({}).getLicenseDetails(e)}static getInstance(e){return nI.getInstance(e)}static create(e,t){return vn.group("AgCharts.create()",()=>{e=me.inDevelopmentMode(()=>Us(Qe(e)))??e,this.licenseCheck(e);const i=nI.createOrUpdate({userOptions:e,licenseManager:this.licenseManager,optionsMetadata:t});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&tr.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(e){return vn.group("AgCharts.createFinancialChart()",()=>this.create(e,{presetType:"price-volume"}))}static createGauge(e){return vn.group("AgCharts.createGauge()",()=>this.create(e,{presetType:"gauge-preset"}))}static __createSparkline(e){return vn.group("AgCharts.__createSparkline()",()=>{const{pool:t,...i}=e;return this.create(i,{presetType:"sparkline",pool:t??!0,domMode:"minimal",withDragInterpretation:!1})})}};ar.licenseChecked=!1;var Gs=class cr{static getInstance(t){const i=cu.getInstance(t);return i?BS.chartInstances.get(i):void 0}static initialiseModules(){cr.initialised||(Mm(),K2(),cr.initialised=!0)}static createOrUpdate(t){let{proxy:i}=t;const{userOptions:s,licenseManager:n,processedOverrides:r=i?.chart?.chartOptions.processedOverrides??{},specialOverrides:o=i?.chart?.chartOptions.specialOverrides??{},optionsMetadata:a=i?.chart?.chartOptions.optionMetadata??{},deltaOptions:l,data:c,stripSymbols:h=!1}=t,u=tr.styles!=null?[["ag-charts-enterprise",tr.styles]]:[];cr.initialiseModules(),vn(()=>[">>> AgCharts.createOrUpdate() user options",Qe(s)]);const{presetType:d}=a;let p=s;ar.optionsMutationFn&&p&&(p=ar.optionsMutationFn(Qe(p,pc.OPTIONS_CLONE_OPTS_FAST),d),vn(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Qe(p)]));const g=this.getPool(a);let y=!1,b,m=i?.chart;m==null&&g?.hasFree()&&(b=g.obtainFree(),m=b.item);const{document:v,window:S,styleContainer:M,...I}=p??{},k=m?.getChartOptions(),L=new pc(k,I,r,{...o,document:v,window:S,styleContainer:M},a,l,h);return(m==null||Jc.ModuleRegistry.detectChartDefinition(L.processedOptions)!==Jc.ModuleRegistry.detectChartDefinition(m.chartOptions.processedOptions))&&(b?.release(),b=this.getPool(L.optionMetadata)?.obtain(L),b?m=b.item:(y=!0,m=cr.createChartInstance(L,m))),u.forEach(([C,O])=>{m.ctx.domManager.addStyles(C,O)}),m.ctx.fontManager.updateFonts(L.googleFonts),c!=null&&m.ctx.dataService.restoreData(c),i==null?(i=new BS(m,cr.callbackApi,n),i.releaseChart=b?.release):(b||y)&&(i.releaseChart?.(),i.chart=m,i.releaseChart=b?.release),vn.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[m.id]=m),m.queuedUserOptions.push(L.userOptions),m.queuedChartOptions.push(L),m.requestFactoryUpdate(C=>{vn.group(">>>> Chart.applyOptions()",()=>{C.applyOptions(L);const O=C.queuedUserOptions.indexOf(L.userOptions)+1;C.queuedUserOptions.splice(0,O),C.queuedChartOptions.splice(0,O)})}),i}static markRemovedProperties(t,i,s=!1){if(typeof t!="object")return s;for(const n of Object.keys(t))typeof t[n]>"u"&&(Object.assign(t,{[n]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(t,i){i=Qe(i,pc.OPTIONS_CLONE_OPTS_FAST);const s=En(i,cr.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);vn(()=>[">>> AgCharts.updateUserDelta() user delta",Qe(i)]),cr.createOrUpdate({proxy:t,deltaOptions:i,stripSymbols:s})}static createChartInstance(t,i){const s=i?.destroy({keepTransferableResources:!0});return Jc.ModuleRegistry.detectChartDefinition(t.processedOptions).create(t,s)}static getPool(t){if(t.pool===!0)return GP.getPool(t.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};Gs.caretaker=new v0(Ir),Gs.initialised=!1,Gs.callbackApi={caretaker:Gs.caretaker,create(e,t,i,s,n){return Gs.createOrUpdate({userOptions:e,processedOverrides:t,specialOverrides:i,optionsMetadata:s,data:n})},update(e,t){return Gs.createOrUpdate({userOptions:e,proxy:t})},updateUserDelta(e,t){return Gs.updateUserDelta(e,t)}},Gs.detachAndClear=e=>e.detachAndClear(),Gs.destroy=e=>e.destroy();var nI=Gs,Pm={};is(Pm,{Arc:()=>Hs,BBox:()=>W,Caption:()=>Ke,CategoryScale:()=>ic,Group:()=>re,Line:()=>pi,LinearScale:()=>_s,Marker:()=>vt,Path:()=>ti,RadialColumnShape:()=>Zi,Rect:()=>si,Scene:()=>Nh,Sector:()=>Bt,Shape:()=>ht,TranslatableGroup:()=>Ht,getRadialColumnWidth:()=>rI,toRadians:()=>mt});var HP=(T(),N(w)),Hs=class extends ti{constructor(){super(...arguments),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0}get fullPie(){return(0,HP.isNumberEqual)(ct(this.startAngle),ct(this.endAngle))}updatePath(){const e=this.path;e.clear(),e.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?e.closePath():this.type===2&&!this.fullPie&&(e.lineTo(this.centerX,this.centerY),e.closePath())}computeBBox(){return new W(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(e,t){const i=this.getBBox();return this.type!==0&&i.containsPoint(e,t)&&this.path.isPointInPath(e,t)}};Hs.className="Arc",f([z()],Hs.prototype,"centerX",2),f([z()],Hs.prototype,"centerY",2),f([z()],Hs.prototype,"radius",2),f([z()],Hs.prototype,"startAngle",2),f([z()],Hs.prototype,"endAngle",2),f([z()],Hs.prototype,"counterClockwise",2),f([z()],Hs.prototype,"type",2);var Rm=(T(),N(w));function _m(e,t,i){const s=Math.sqrt(e**2+t**2),r=Math.atan2(t,e)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}var Zi=class extends ti{constructor(){super(...arguments),this.isBeveled=!0,this.columnWidth=0,this.startAngle=0,this.endAngle=0,this.outerRadius=0,this.innerRadius=0,this.axisInnerRadius=0,this.axisOuterRadius=0,this.isRadiusAxisReversed=!1}set cornerRadius(e){}computeBBox(){const{innerRadius:e,outerRadius:t,columnWidth:i}=this,s=this.getRotation(),n=-i/2,r=i/2,o=-t,a=-e;let l=1/0,c=1/0,h=-1/0,u=-1/0;for(let d=0;d<4;d+=1){const{x:p,y:g}=_m(d%2===0?n:r,d<2?o:a,s);l=Math.min(p,l),c=Math.min(g,c),h=Math.max(p,h),u=Math.max(g,u)}return new W(l,c,h-l,u-c)}getRotation(){const{startAngle:e,endAngle:t}=this,i=ah(e,t);return ct(e+i/2+Math.PI/2)}updatePath(){const{isBeveled:e}=this;e?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:e,innerRadius:t,outerRadius:i,path:s}=this,n=-e/2,r=e/2,o=-i,a=-t,l=this.getRotation(),c=[[n,a],[n,o],[r,o],[r,a]].map(([h,u])=>_m(h,u,l));s.clear(!0),s.moveTo(c[0].x,c[0].y),s.lineTo(c[1].x,c[1].y),s.lineTo(c[2].x,c[2].y),s.lineTo(c[3].x,c[3].y),s.closePath()}updateBeveledPath(){const{columnWidth:e,path:t,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:r,isRadiusAxisReversed:o}=this,a=(0,Rm.isNumberEqual)(s,n),l=Math.asin(e/2/s),c=this.getRotation(),h=(C,O)=>_m(C,O,c),u=(C,O)=>Math.sqrt(C**2+O**2),d=(C,O)=>O>C?0:Math.sqrt(C**2-O**2),p=(C,O,E)=>E?C<O:C>O,g=a&&!isNaN(l)&&l<Math.PI/6;let y=-e/2,b=e/2;const m=-i,v=-s*(g?Math.cos(l):1),S=p(r,u(s,e/2),!o);if(S){const C=d(r,s);y=-C,b=C}t.clear(!0);const M=h(y,v);t.moveTo(M.x,M.y);const I=(0,Rm.isNumberEqual)(s,i),k=p(r,u(i,e/2),!o);if(I&&g)t.arc(0,0,s,ct(-l-Math.PI/2)+c,ct(l-Math.PI/2)+c,!1);else if(k){const C=-d(r,e/2),O=d(r,i);if(!S){const E=h(y,C);t.lineTo(E.x,E.y)}if(t.arc(0,0,r,Math.atan2(C,y)+c,Math.atan2(m,-O)+c,!1),!(0,Rm.isNumberEqual)(O,0)){const E=h(O,m);t.lineTo(E.x,E.y)}t.arc(0,0,r,Math.atan2(m,O)+c,Math.atan2(C,b)+c,!1)}else{const C=h(y,m),O=h(b,m);t.lineTo(C.x,C.y),t.lineTo(O.x,O.y)}const L=h(b,v);if(t.lineTo(L.x,L.y),g)t.arc(0,0,s,ct(l-Math.PI/2)+c,ct(-l-Math.PI/2)+c,!0);else{const C=h(y,v);t.lineTo(C.x,C.y)}t.closePath()}};Zi.className="RadialColumnShape",f([z()],Zi.prototype,"isBeveled",2),f([z()],Zi.prototype,"columnWidth",2),f([z()],Zi.prototype,"startAngle",2),f([z()],Zi.prototype,"endAngle",2),f([z()],Zi.prototype,"outerRadius",2),f([z()],Zi.prototype,"innerRadius",2),f([z()],Zi.prototype,"axisInnerRadius",2),f([z()],Zi.prototype,"axisOuterRadius",2),f([z()],Zi.prototype,"isRadiusAxisReversed",2);function rI(e,t,i,s,n){const r=ah(e,t),o=r*(1-s)/2;if(e+=o,t-=o,r<.001)return 2*i*n;if(r>=2*Math.PI){const p=e+r/2;e=p-Math.PI,t=p+Math.PI}const a=i*Math.cos(e),l=i*Math.sin(e),c=i*Math.cos(t),h=i*Math.sin(t),u=Math.floor(Math.sqrt((a-c)**2+(l-h)**2)),d=2*i*n;return Math.max(1,Math.min(d,u))}var jm={};is(jm,{ChartTheme:()=>as,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Fl,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>Gl,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Hl,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>Ul,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Wl,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Bl,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>Vl,DEFAULT_CAPTION_ALIGNMENT:()=>Wn,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Un,DEFAULT_FIBONACCI_STROKES:()=>jl,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>Mt,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>st,DEFAULT_GRIDLINE_ENABLED:()=>os,DEFAULT_POLAR_SERIES_STROKE:()=>mu,DEFAULT_SEPARATION_LINES_COLOUR:()=>_l,DEFAULT_SHADOW_COLOUR:()=>Hn,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>yu,DEFAULT_TEXTBOX_COLOR:()=>Kl,DEFAULT_TEXTBOX_FILL:()=>$l,DEFAULT_TEXTBOX_STROKE:()=>Yl,DEFAULT_TEXT_ANNOTATION_COLOR:()=>zl,DEFAULT_TOOLBAR_POSITION:()=>Zl,IS_DARK_THEME:()=>ea,PALETTE_ALT_DOWN_FILL:()=>Jg,PALETTE_ALT_DOWN_STROKE:()=>qg,PALETTE_ALT_NEUTRAL_FILL:()=>ef,PALETTE_ALT_NEUTRAL_STROKE:()=>tf,PALETTE_ALT_UP_FILL:()=>Qg,PALETTE_ALT_UP_STROKE:()=>Xg,PALETTE_DOWN_FILL:()=>pu,PALETTE_DOWN_STROKE:()=>uu,PALETTE_NEUTRAL_FILL:()=>fu,PALETTE_NEUTRAL_STROKE:()=>gu,PALETTE_UP_FILL:()=>du,PALETTE_UP_STROKE:()=>hu,getChartTheme:()=>Gu,resolveOperation:()=>WP,themeNames:()=>UP,themeSymbols:()=>Zg,themes:()=>Of});var UP=Object.keys(Of);function WP(e){const t=as.getDefaultPublicParameters(),i=as.getDefaultColors();return new jS({line:{operation:e}},{series:[{type:"line"}]},t,i).resolve().operation}var zm={};is(zm,{Color:()=>Be,interpolateColor:()=>q0});var $P=(T(),N(w));function oI(e,t,i,s){return{unit:e,step:t,epoch:i,utc:s,every(n){return oI(this.unit,(this.step??1)*n,this.epoch,this.utc)}}}var aI={};function pt(e,t=1,i,s=!1){$P.Logger.warnOnce("time import is deprecated, use object notation instead");const n=`${e}:${t}:${i?.getTime()??0}:${s}`;let r=aI[n];return r==null&&(r=oI(e,t,i,s),aI[n]=r),r}var YP={get millisecond(){return pt("millisecond")},get second(){return pt("second")},get minute(){return pt("minute")},get hour(){return pt("hour")},get day(){return pt("day")},get monday(){return pt("day",7,new Date(1970,0,5))},get tuesday(){return pt("day",7,new Date(1970,0,6))},get wednesday(){return pt("day",7,new Date(1970,0,7))},get thursday(){return pt("day",7,new Date(1970,0,1))},get friday(){return pt("day",7,new Date(1970,0,2))},get saturday(){return pt("day",7,new Date(1970,0,3))},get sunday(){return pt("day",7,new Date(1970,0,4))},get month(){return pt("month")},get year(){return pt("year")},get utcMillisecond(){return pt("millisecond",1,void 0,!0)},get utcSecond(){return pt("second",1,void 0,!0)},get utcMinute(){return pt("minute",1,void 0,!0)},get utcHour(){return pt("hour",1,void 0,!0)},get utcDay(){return pt("day",1,void 0,!0)},get utcMonth(){return pt("month",1,void 0,!0)},get utcYear(){return pt("year",1,void 0,!0)}},lI={};is(lI,{AbstractBarSeries:()=>xD,AbstractBarSeriesProperties:()=>rm,ActionOnSet:()=>hi,AnchoredPopover:()=>bI,Animation:()=>ix,AnimationManager:()=>ax,Arc:()=>Hs,Axis:()=>Cg,AxisGroupZIndexMap:()=>Xx,AxisInterval:()=>$o,AxisLabel:()=>Tt,AxisTick:()=>wr,AxisTickGenerator:()=>fv,BASE_FONT_SIZE:()=>Js,BBox:()=>W,Background:()=>Ma,BackgroundModule:()=>GS,BandScale:()=>Lr,BarSeries:()=>Lc,BarSeriesModule:()=>ID,BaseModuleInstance:()=>eh,BaseProperties:()=>ae,BaseToolbar:()=>Zm,ButtonWidget:()=>ol,CachedTextMeasurer:()=>l0,CachedTextMeasurerPool:()=>Qs,CallbackCache:()=>qb,Caption:()=>Ke,CartesianAxis:()=>Cl,CartesianSeries:()=>rr,CartesianSeriesNodeEvent:()=>Wf,CartesianSeriesProperties:()=>bn,CategoryAxis:()=>Kr,CategoryScale:()=>ic,ChangeDetectableProperties:()=>Hf,Chart:()=>cu,ChartAxisDirection:()=>zp,ChartOptions:()=>pc,ChartUpdateType:()=>ll,CollapseMode:()=>eD,Color:()=>Be,ColorScale:()=>Do,ConicGradient:()=>Ob,ContextMenuBuiltins:()=>lx,ContextMenuRegistry:()=>cx,ContinuousScale:()=>Re,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>ao,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>lo,DEFAULT_POLAR_DIRECTION_KEYS:()=>bm,DEFAULT_POLAR_DIRECTION_NAMES:()=>xm,DEFAULT_TOOLTIP_CLASS:()=>jt,DEFAULT_TOOLTIP_DARK_CLASS:()=>Fv,DIRECTION_SWAP_AXES:()=>Qv,DOMManager:()=>N0,DataController:()=>Fx,DataModel:()=>jx,DataModelSeries:()=>Uf,DataService:()=>Oh,Debug:()=>me,Deprecated:()=>XP,DeprecatedAndRenamedTo:()=>qP,DiscreteTimeScale:()=>wi,DragInterpreter:()=>xx,DraggablePopover:()=>xI,DropShadow:()=>ms,ExtendedPath2D:()=>Lo,FILL_IMAGE_DEFAULTS:()=>jr,FILL_PATTERN_DEFAULTS:()=>$n,FONT_SIZE:()=>jp,FONT_SIZE_RATIO:()=>Ci,FillGradientDefaults:()=>Gi,FillImageDefaults:()=>gi,FillPatternDefaults:()=>Ze,FloatingToolbar:()=>ER,FormatManager:()=>Go,Gradient:()=>hh,Group:()=>re,GroupedCategoryAxis:()=>qr,HdpiCanvas:()=>Jp,HierarchyNode:()=>fR,HierarchySeries:()=>mR,HierarchySeriesProperties:()=>ys,HighlightManager:()=>hx,HighlightOptions:()=>rn,HighlightProperties:()=>Gn,HighlightState:()=>Lv,HighlightStyle:()=>Nl,Image:()=>Na,InteractionManager:()=>rx,InteractionState:()=>nx,InterpolationProperties:()=>Aa,Invalidating:()=>qa,LARGEST_KEY_INTERVAL:()=>AM,Label:()=>xt,LayoutElement:()=>ug,LayoutManager:()=>Lx,LegendMarkerLabel:()=>$i,Line:()=>pi,LineSeries:()=>kc,LineSeriesModule:()=>ND,LinearGradient:()=>Eb,LinearScale:()=>_s,LogScale:()=>bf,LonLatBBox:()=>yR,Marker:()=>vt,Menu:()=>wR,MenuItemWidget:()=>$m,MenuWidget:()=>fI,MercatorScale:()=>bR,ModuleRegistry:()=>KP.ModuleRegistry,Motion:()=>ig,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>ns,NativeWidget:()=>Fo,NewAreaSeriesModule:()=>bD,NewBarSeriesModule:()=>AD,NewBubbleSeriesModule:()=>kD,NewHistogramSeriesModule:()=>wD,NewLineSeriesModule:()=>TD,NewScatterSeriesModule:()=>ED,NiceMode:()=>$x,Node:()=>Ws,NumberAxis:()=>js,ObserveChanges:()=>Rn,OrdinalTimeScale:()=>zg,PHASE_METADATA:()=>ul,PHASE_ORDER:()=>Ho,PREV_NEXT_KEYS:()=>jo,Padding:()=>Pn,ParallelStateMachine:()=>HN,Path:()=>ti,PointerEvents:()=>kb,PolarAxis:()=>Ca,PolarSeries:()=>dd,PolarZIndexMap:()=>VD,Popover:()=>Km,PropertiesArray:()=>Ja,Property:()=>x,ProxyInteractionService:()=>F0,ProxyOnWrite:()=>$k,ProxyProperty:()=>Oe,ProxyPropertyOnWrite:()=>kt,QUICK_TRANSITION:()=>_h,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Xu,RadialColumnShape:()=>Zi,Range:()=>ws,Rect:()=>si,RepeatType:()=>tx,Rotatable:()=>Co,RotatableGroup:()=>Ok,RotatableText:()=>d0,SAFE_FILLS_OPERATION:()=>sf,SAFE_FILL_OPERATION:()=>yO,SAFE_RANGE2_OPERATION:()=>bO,SAFE_STROKE_FILL_OPERATION:()=>bu,SKIP_JS_BUILTINS:()=>cp,SMALLEST_KEY_INTERVAL:()=>IM,SORT_DOMAIN_GROUPS:()=>LM,Scalable:()=>Dp,ScalableGroup:()=>Tk,Scene:()=>Nh,SceneArrayChangeDetection:()=>dp,SceneChangeDetection:()=>z,SceneObjectChangeDetection:()=>Li,Sector:()=>Bt,SectorBox:()=>RD,Selection:()=>bt,Series:()=>ou,SeriesContentZIndexMap:()=>wv,SeriesGroupingChangedEvent:()=>Hg,SeriesItemHighlightStyle:()=>nn,SeriesMarker:()=>Rt,SeriesNodeEvent:()=>Tl,SeriesNodePickMode:()=>Tv,SeriesProperties:()=>Oi,SeriesTooltip:()=>mn,SeriesZIndexMap:()=>Cv,Shape:()=>ht,SimpleTextMeasurer:()=>Pp,SliderWidget:()=>qp,StateMachine:()=>yl,StateMachineProperty:()=>GN,StopProperties:()=>bp,SvgPath:()=>pI,TRIPLE_EQ:()=>So,Text:()=>_t,TextUtils:()=>Ue,TextWrapper:()=>Mh,ThemeConstants:()=>p0,ThemeSymbols:()=>Zg,TimeAxisParentLevel:()=>oa,TimeScale:()=>Or,Toolbar:()=>TR,ToolbarButtonProperties:()=>Tc,ToolbarButtonWidget:()=>vI,ToolbarWidget:()=>wh,Tooltip:()=>Ui,TooltipManager:()=>zh,TooltipPosition:()=>_r,Transformable:()=>tt,TransformableGroup:()=>wo,TransformableText:()=>Po,Translatable:()=>Dr,TranslatableGroup:()=>Ht,TranslatableSvgPath:()=>LR,UnitTimeScale:()=>Ns,UpdateService:()=>wx,Vec2:()=>wa,Vec4:()=>fl,WIDGET_HTML_EVENTS:()=>wp,Widget:()=>Ls,WidgetEventUtil:()=>Xs,ZIndexMap:()=>G0,ZoomManager:()=>Ax,accumulateGroup:()=>CM,accumulateStack:()=>wM,accumulatedValue:()=>mM,accumulativeValueProperty:()=>nc,addEscapeEventListener:()=>Dh,addHitTestersToQuadtree:()=>sm,addMouseCloseListener:()=>Bp,addOverrideFocusVisibleEventListener:()=>Gp,addTouchCloseListener:()=>Vp,adjustLabelPlacement:()=>DD,angleBetween:()=>ah,angleCategoryAxisOptionsDefs:()=>zM,angleNumberAxisOptionsDefs:()=>jM,angularPadding:()=>gp,animationValidation:()=>sa,annotationCalloutStylesDefs:()=>iS,annotationChannelStyleDefs:()=>If,annotationChannelTextDefs:()=>qM,annotationCommentStylesDefs:()=>sS,annotationCrossLineStyleDefs:()=>Df,annotationDisjointChannelStyleDefs:()=>eS,annotationFibonacciStylesDefs:()=>Af,annotationLineStyleDefs:()=>zu,annotationLineTextDefs:()=>ju,annotationMeasurerStylesDefs:()=>Fu,annotationNoteStylesDefs:()=>nS,annotationOptionsDef:()=>fa,annotationParallelChannelStyleDefs:()=>tS,annotationQuickMeasurerStylesDefs:()=>rS,annotationShapeStylesDefs:()=>Lf,annotationTextStylesDef:()=>ac,applyShapeFillBBox:()=>Nv,applyShapeStyle:()=>on,areScalingEqual:()=>co,area:()=>df,autoSizedLabelOptionsDefs:()=>qn,bezier2DDistance:()=>Gb,bezier2DExtrema:()=>Vb,boxPlotHighlightStyleOptionsDef:()=>Cf,boxPlotSeriesThemeableOptionsDef:()=>oS,boxPlotStyleOptionsDef:()=>kf,buildDateFormatter:()=>Ar,buildResetPathFn:()=>im,calculateDataDiff:()=>cm,calculateLabelTranslation:()=>MR,calculatePlacement:()=>Pv,callWithContext:()=>Zs,candlestickSeriesThemeableOptionsDef:()=>lS,cartesianAxisBandHighlightOptions:()=>Ql,cartesianAxisCrosshairOptions:()=>Zn,cartesianAxisLabelOptionsDefs:()=>Xl,cartesianAxisOptionsDefs:()=>hn,cartesianChartOptionsDefs:()=>eI,cartesianCrossLineOptionsDefs:()=>ln,cartesianNumericAxisLabel:()=>lf,cartesianTimeAxisLabel:()=>ql,cartesianTimeAxisParentLevel:()=>vu,checkCrisp:()=>vD,chordSeriesThemeableOptionsDef:()=>cS,clampArray:()=>dl,clippedRoundRect:()=>$u,collapsedStartingBarPosition:()=>Dc,commonAxisLabelOptionsDefs:()=>cn,commonAxisOptionsDefs:()=>$r,commonChartOptionsDefs:()=>oe,commonCrossLineLabelOptionsDefs:()=>Wr,commonCrossLineOptionsDefs:()=>Es,commonSeriesOptionsDefs:()=>hs,commonSeriesThemeableOptionsDefs:()=>Ie,compareDates:()=>Kh,computeBarFocusBounds:()=>lm,computeMarkerFocusBounds:()=>Sc,coneFunnelSeriesThemeableOptionsDef:()=>hS,continuousAxisOptions:()=>Xn,countExpandingSearch:()=>gx,createButton:()=>SR,createCheckbox:()=>DR,createDatumId:()=>Ri,createDeprecationWarning:()=>Fm,createIcon:()=>dI,createIdsGenerator:()=>Fg,createSelect:()=>IR,createTextArea:()=>AR,dateToNumber:()=>Ti,dateTruncationForDomain:()=>_g,datesSortOrder:()=>Ng,datumKeys:()=>Bh,datumStylerProperties:()=>jn,deconstructSelectionsOrNodes:()=>jh,deepClone:()=>Qe,deepFreeze:()=>Us,diff:()=>na,drawCorner:()=>fc,drawMarkerUnitPolygon:()=>El,durationDay:()=>Tr,durationHour:()=>Nr,durationMinute:()=>Fn,durationMonth:()=>Tg,durationSecond:()=>Ko,durationWeek:()=>Qx,durationYear:()=>bl,easing:()=>ig,enterpriseModule:()=>tr,errorBarOptionsDefs:()=>Lu,errorBarThemeableOptionsDefs:()=>Jl,estimateTickCount:()=>uv,evaluateBezier:()=>Ao,extent:()=>dn,extractDecoratedProperties:()=>vb,fillsOptionsDef:()=>ec,findMinMax:()=>wt,findQuadtreeMatch:()=>nm,findRangeExtent:()=>pl,fixNumericExtent:()=>di,flowProportionChartOptionsDefs:()=>AP,focusCursorAtEnd:()=>Rk,formatNumber:()=>_0,formatObjectValidator:()=>aM,formatPercent:()=>P0,formatValue:()=>_n,fromToMotion:()=>Je,funnelSeriesThemeableOptionsDef:()=>uS,gaugeChartOptionsDefs:()=>LP,getAngleRatioRadians:()=>Cb,getColorStops:()=>Rb,getCrossLineValue:()=>Ux,getDateTicksForInterval:()=>jg,getDatumRefPoint:()=>ng,getElementBBox:()=>Qb,getIconClassNames:()=>mh,getLastFocus:()=>Lh,getMissCount:()=>dg,getPath:()=>lp,getPathComponents:()=>_x,getRadialColumnWidth:()=>rI,getSequentialColors:()=>Ei,getShapeFill:()=>Rr,getShapeStyle:()=>Ts,groupAccumulativeValueProperty:()=>Jn,groupAverage:()=>fM,groupCount:()=>uf,groupStackValueProperty:()=>DM,groupSum:()=>gM,hasNoModifiers:()=>rl,heatmapSeriesThemeableOptionsDef:()=>dS,hierarchyChartOptionsDefs:()=>IP,initMenuKeyNav:()=>I0,initRovingTabIndex:()=>D0,interpolatePoints:()=>Qu,interpolationOptionsDefs:()=>ku,intervalCeil:()=>Jx,intervalEpoch:()=>Dl,intervalExtent:()=>Og,intervalFloor:()=>Bi,intervalHierarchy:()=>Il,intervalMilliseconds:()=>Ni,intervalNext:()=>tv,intervalPrevious:()=>ev,intervalRange:()=>Vi,intervalRangeCount:()=>Eg,intervalStep:()=>Bn,intervalUnit:()=>sn,isAgFlowProportionChartOptions:()=>Sv,isAgGaugeChartOptions:()=>Vg,isAgHierarchyChartOptions:()=>vv,isAgStandaloneChartOptions:()=>Dv,isAgTopologyChartOptions:()=>Mv,isBetweenAngles:()=>vr,isButtonClickEvent:()=>Ah,isChartAxisDirection:()=>bC,isContinuous:()=>Hh,isDecoratedObject:()=>oh,isDenseInterval:()=>qo,isGradientFill:()=>ki,isGradientOrPatternFill:()=>wk,isImageFill:()=>Sr,isInputPending:()=>Jb,isObjectWithProperty:()=>Ib,isObjectWithStringProperty:()=>XL,isPatternFill:()=>Tn,isProperties:()=>Io,isScaleValid:()=>bc,jsonApply:()=>nl,jsonDiff:()=>Is,jsonPropertyCompare:()=>t0,jsonWalk:()=>En,keyProperty:()=>us,legendSymbolSvg:()=>zv,lineDistanceSquared:()=>ph,linearGaugeSeriesOptionsDef:()=>Qn,linearGaugeSeriesThemeableOptionsDef:()=>Nu,linearGaugeTargetOptionsDef:()=>Cu,listDecoratedProperties:()=>xr,lowestGranularityForInterval:()=>Jh,lowestGranularityUnitForTicks:()=>Rg,lowestGranularityUnitForValue:()=>eu,makeAccessibleClickListener:()=>wC,makeSeriesTooltip:()=>yn,mapLineBackgroundSeriesThemeableOptionsDef:()=>fS,mapLineSeriesThemeableOptionsDef:()=>gS,mapMarkerSeriesThemeableOptionsDef:()=>mS,mapShapeBackgroundSeriesThemeableOptionsDef:()=>bS,mapShapeSeriesThemeableOptionsDef:()=>yS,mapValues:()=>Db,markerFadeInAnimation:()=>xc,markerOptionsDefs:()=>un,markerScaleInAnimation:()=>Jf,markerSwipeScaleInAnimation:()=>em,merge:()=>$a,mergeArrayDefaults:()=>Sb,mergeDefaults:()=>Le,midpointStartingBarPosition:()=>D2,minimumTimeAxisDatumGranularity:()=>RM,moduleRegistry:()=>Ds,motion:()=>RR,multiSeriesHighlightStyle:()=>Yn,nearestSquared:()=>sh,nearestSquaredInContainer:()=>UL,nightingaleSeriesThemeableOptionsDef:()=>xS,normaliseGroupTo:()=>Eu,normalisePropertyTo:()=>Xr,normalisedExtentWithMetadata:()=>hf,normalizeAngle180:()=>Xa,normalizeAngle360:()=>ct,normalizeAngle360FromDegrees:()=>$s,normalizeAngle360Inclusive:()=>rk,normalizeContinuousDomains:()=>ag,numberFormatValidator:()=>ls,objectsEqual:()=>ft,objectsEqualWith:()=>op,ohlcSeriesThemeableOptionsDef:()=>pS,ordinalTimeAxisOptionsDefs:()=>pa,pairUpSpans:()=>yc,partialAssign:()=>up,pathFadeInAnimation:()=>td,pathMotion:()=>Zu,pathSwipeInAnimation:()=>tm,pick:()=>ap,pickByMatchingAngle:()=>ym,plotAreaPathFill:()=>fD,plotInterpolatedAreaSeriesFillSpans:()=>ed,plotInterpolatedLinePathStroke:()=>Ju,plotLinePathStroke:()=>Xf,polarChartOptionsDefs:()=>tI,prepareAreaFillAnimationFns:()=>mD,prepareAreaPathAnimation:()=>yD,prepareAxisAnimationContext:()=>Yx,prepareAxisAnimationFunctions:()=>Kx,prepareBarAnimationFunctions:()=>Ic,prepareLinePathAnimation:()=>gD,prepareLinePathPropertyAnimation:()=>Qf,prepareLinePathStrokeAnimationFns:()=>qf,preparePieSeriesAnimationFunctions:()=>ho,pyramidSeriesThemeableOptionsDef:()=>vS,radarAreaSeriesThemeableOptionsDef:()=>MS,radarLineSeriesThemeableOptionsDef:()=>SS,radialBarSeriesThemeableOptionsDef:()=>DS,radialColumnSeriesThemeableOptionsDef:()=>IS,radialGaugeSeriesOptionsDef:()=>tc,radialGaugeSeriesThemeableOptionsDef:()=>Tu,radialGaugeTargetOptionsDef:()=>wu,radiusCategoryAxisOptionsDefs:()=>BM,radiusNumberAxisOptionsDefs:()=>FM,range:()=>Qh,rangeAreaSeriesThemeableOptionsDef:()=>AS,rangeBarSeriesThemeableOptionsDef:()=>LS,rangeValidator:()=>Du,rangedValueProperty:()=>pf,resetAxisGroupFn:()=>Zx,resetAxisLabelSelectionFn:()=>$h,resetAxisLineSelectionFn:()=>kg,resetBarSelectionsFn:()=>Ac,resetLabelFn:()=>fn,resetMarkerFn:()=>vc,resetMarkerPositionFn:()=>Mc,resetMotion:()=>Nt,resetPieSelectionsFn:()=>mm,rowCountProperty:()=>MM,sankeySeriesThemeableOptionsDef:()=>kS,scale:()=>ni,sectorBox:()=>_D,seriesLabelFadeInAnimation:()=>Ne,seriesLabelFadeOutAnimation:()=>nr,seriesLabelOptionsDefs:()=>_e,setElementBBox:()=>fh,setPath:()=>hp,shadowOptionsDefs:()=>Ps,shallowClone:()=>kp,singleSeriesHighlightStyle:()=>eM,solveBezier:()=>gh,sortAndUniqueDates:()=>wg,splitBezier2D:()=>tl,standaloneChartOptionsDefs:()=>DP,staticFromToMotion:()=>en,stopPageScrolling:()=>A0,sum:()=>EO,sumValues:()=>Ou,sunburstSeriesThemeableOptionsDef:()=>CS,tickFormat:()=>cv,timeInterval:()=>af,timeIntervalUnit:()=>xu,toDegrees:()=>ok,toRadians:()=>mt,toolbarButtonOptionsDefs:()=>Yr,tooltipContentAriaLabel:()=>Vv,tooltipHtml:()=>Uv,tooltipOptionsDefs:()=>ke,topologyChartOptionsDefs:()=>SP,trailingAccumulatedValue:()=>yM,trailingAccumulatedValueProperty:()=>jO,treemapSeriesThemeableOptionsDef:()=>wS,updateClipPath:()=>id,updateLabelNode:()=>SD,validateCrossLineValue:()=>Wx,valueProperty:()=>De,visibleRangeIndices:()=>px,waterfallSeriesThemeableOptionsDef:()=>NS,without:()=>G});var KP=(T(),N(w)),ZP=(T(),N(w));function Fm(){return(e,t)=>{const i=[`Property [${e}] is deprecated.`,t].filter(Boolean).join(" ");ZP.Logger.warnOnce(i)}}function XP(e,t){const i=Fm(),s=t?.default;return br((n,r,o)=>(o!==s&&i(r.toString(),e),o))}function qP(e,t){const i=Fm();return br((s,n,r)=>(r!==s[e]&&(i(n.toString(),`Use [${e}] instead.`),hp(s,e,t?t(r):r)),sp),(s,n)=>(i(n.toString(),`Use [${e}] instead.`),lp(s,e)))}var cI=(T(),N(w)),wa={add:QP,angle:nR,apply:pR,equal:uR,distance:tR,distanceSquared:iR,from:dR,gradient:oR,intercept:aR,intersectAtX:cR,intersectAtY:lR,length:Vm,lengthSquared:eR,multiply:JP,normalized:sR,origin:hI,required:gR,rotate:rR,round:hR,sub:Bm};function QP(e,t){return typeof t=="number"?{x:e.x+t,y:e.y+t}:{x:e.x+t.x,y:e.y+t.y}}function Bm(e,t){return typeof t=="number"?{x:e.x-t,y:e.y-t}:{x:e.x-t.x,y:e.y-t.y}}function JP(e,t){return typeof t=="number"?{x:e.x*t,y:e.y*t}:{x:e.x*t.x,y:e.y*t.y}}function Vm(e){return Math.sqrt(e.x*e.x+e.y*e.y)}function eR(e){return e.x*e.x+e.y*e.y}function tR(e,t){const i=Bm(e,t);return Math.sqrt(i.x*i.x+i.y*i.y)}function iR(e,t){const i=Bm(e,t);return i.x*i.x+i.y*i.y}function sR(e){const t=Vm(e);return{x:e.x/t,y:e.y/t}}function nR(e,t){return t==null?Math.atan2(e.y,e.x):Math.atan2(e.y,e.x)-Math.atan2(t.y,t.x)}function rR(e,t,i=hI()){const s=Vm(e);return{x:i.x+s*Math.cos(t),y:i.y+s*Math.sin(t)}}function oR(e,t,i){const s=t.x-e.x;return(i==null?t.y-e.y:i-t.y-(i-e.y))/s}function aR(e,t,i){return(i==null?e.y:i-e.y)-t*e.x}function lR(e,t,i=0,s){return{x:e===1/0?1/0:(i-t)/e,y:s==null?i:s-i}}function cR(e,t,i=0,s){const n=e===1/0?1/0:e*i+t;return{x:i,y:s==null?n:s-n}}function hR(e,t=2){return{x:(0,cI.roundTo)(e.x,t),y:(0,cI.roundTo)(e.y,t)}}function uR(e,t){return e.x===t.x&&e.y===t.y}function dR(e,t){if(typeof e=="number")return{x:e,y:t};if("currentX"in e)return{x:e.currentX,y:e.currentY};if("offsetWidth"in e)return{x:e.offsetWidth,y:e.offsetHeight};if("width"in e)return[{x:e.x,y:e.y},{x:e.x+e.width,y:e.y+e.height}];if("x1"in e)return[{x:e.x1,y:e.y1},{x:e.x2,y:e.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(e)}] [${t}]`)}function pR(e,t){return e.x=t.x,e.y=t.y,e}function gR(e){return{x:e?.x??0,y:e?.y??0}}function hI(){return{x:0,y:0}}var bd=(T(),N(w)),uI=class Ad{constructor(t,i,s,n,r,o,a,l,c){this.series=t,this.datumIndex=i,this.datum=s,this.sizeValue=n,this.colorValue=r,this.sumSize=o,this.depth=a,this.parent=l,this.children=c,this.midPoint={x:0,y:0}}get hasChildren(){return this.children.length>0}walk(t,i=Ad.Walk.PreOrder){i===Ad.Walk.PreOrder&&t(this),this.children.forEach(s=>{s.walk(t,i)}),i===Ad.Walk.PostOrder&&t(this)}*[Symbol.iterator](){yield this;for(const t of this.children)yield*t}};uI.Walk={PreOrder:0,PostOrder:1};var fR=uI,mR=class extends ou{constructor(e){super({moduleCtx:e,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Do,this.animationState=new yl("empty",{empty:{update:{target:"ready",action:t=>this.animateEmptyUpdateReady(t)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:t=>this.animateReadyHighlight(t),resize:t=>this.animateReadyResize(t),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:t=>this.animateWaitingUpdateReady(t)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:t=>this.animateClearingUpdateEmpty(t)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(e){e==="initial"?this.animationState.transition("reset"):e==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:e}=this,{childrenKey:t,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let r=0,o=1/0,a=-1/0;const l=(d,p,g)=>{const y=g.depth!=null?g.depth+1:0,b=t!=null?d[t]:void 0,m=b==null||b.length===0;let v=i!=null?d[i]:void 0;Number.isFinite(v)?v=Math.max(v,0):v=m?1:0;const S=v;r=Math.max(r,y);const M=s!=null?d[s]:void 0;return typeof M=="number"&&(o=Math.min(o,M),a=Math.max(a,M)),c(new e(this,p,d,v,M,S,y,g,[]),b)},c=(d,p)=>{const{datumIndex:g}=d;return p?.forEach((y,b)=>{const m=l(y,g.concat(b),d);d.children.push(m),d.sumSize+=m.sumSize}),d},h=c(new e(this,[],void 0,0,void 0,0,void 0,void 0,[]),this.data),u=[o,a];this.colorScale.domain=o<a?[o,a]:[0,1],this.colorScale.range=n??["black"],this.colorScale.update(),this.rootNode=h,this.maxDepth=r,this.colorDomain=u}update({seriesRect:e}){this.updateSelections(),this.updateNodes();const t=this.getAnimationData();this.checkResize(e)&&this.animationState.transition("resize",t),this.animationState.transition("update",t)}resetAllAnimation(e){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateWaitingUpdateReady(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}animateReadyHighlight(e){}animateReadyResize(e){this.resetAllAnimation(e)}animateClearingUpdateEmpty(e){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(e)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}dataCount(){return NaN}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(e,t){return[NaN,NaN]}getLegendData(e){const{colorKey:t,colorRange:i}=this.properties,{id:s,ctx:{legendManager:n},visible:r}=this;return e==="gradient"&&t!=null&&i!=null?[{legendType:"gradient",enabled:r&&n.getItemEnabled({seriesId:s}),seriesId:s,series:this.getFormatterContext("color"),colorRange:i,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(e){return e.datumIndex.join(":")}getDatumId(e){return this.getDatumIdFromData(e)}removeMeIndexPathForIndex(e){return this.datumSelection.at(e+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(e){for(const{index:t,datum:i}of this.datumSelection)if((0,bd.arraysEqual)(i.datumIndex,e))return t-1;return 0}pickFocus(e){if(!this.rootNode?.children.length)return;const t=(0,bd.clamp)(0,e.datumIndex-e.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=e;let n=this.removeMeIndexPathForIndex(t);const r=n.reduce((l,c)=>l.children[c],this.rootNode);if(s>0&&r.hasChildren)n=[...n,0];else if(s<0&&n.length>1)n=n.slice(0,-1);else if(s===0&&i!==0){const l=r.parent.children.length-1;n=n.slice(),n[n.length-1]=(0,bd.clamp)(0,n[n.length-1]+i,l)}const o=n.reduce((l,c)=>l.children[c],this.rootNode),a=this.computeFocusBounds(this.datumSelection.at(t+1));if(a!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:o.depth,bounds:a,clipFocusBox:!0}}getDatumAriaText(e,t){if(!(e instanceof this.NodeClass)){bd.Logger.error(`datum is not HierarchyNode: ${JSON.stringify(e)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(e.depth??-1)+1,count:e.children.length,description:t})}getCategoryValue(e){}datumIndexForCategoryValue(e){}},ys=class extends Oi{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(lt),this.fillGradientDefaults=new Gi,this.fillPatternDefaults=new Ze,this.fillImageDefaults=new gi,this.strokes=Object.values(Os)}};f([x],ys.prototype,"childrenKey",2),f([x],ys.prototype,"sizeKey",2),f([x],ys.prototype,"colorKey",2),f([x],ys.prototype,"colorName",2),f([x],ys.prototype,"fills",2),f([x],ys.prototype,"fillGradientDefaults",2),f([x],ys.prototype,"fillPatternDefaults",2),f([x],ys.prototype,"fillImageDefaults",2),f([x],ys.prototype,"strokes",2),f([x],ys.prototype,"colorRange",2);var yR=class BI{constructor(t,i,s,n){this.lon0=t,this.lat0=i,this.lon1=s,this.lat1=n}extend(t,i,s,n){return this.lon0=Math.min(this.lon0,t),this.lat0=Math.min(this.lat0,i),this.lon1=Math.max(this.lon1,s),this.lat1=Math.max(this.lat1,n),this}merge(t){return this.extend(t.lon0,t.lat0,t.lon1,t.lat1)}static extend(t,i,s,n,r){return t?t.extend(i,s,n,r):new BI(i,s,n,r)}},xd=Math.PI/180,Gm=e=>e*xd,Hm=e=>-Math.log(Math.tan(Math.PI*.25+e*xd*.5)),Um=e=>e/xd,Wm=e=>(Math.atan(Math.exp(-e))-Math.PI*.25)/(xd*.5),bR=class ty extends ch{constructor(t,i){super(),this.domain=t,this.range=i,this.type="mercator",this.defaultTickCount=0,this.bounds=ty.bounds(t)}static bounds(t){const[[i,s],[n,r]]=t,o=Gm(i),a=Hm(s),l=Gm(n),c=Hm(r);return new W(Math.min(o,l),Math.min(a,c),Math.abs(l-o),Math.abs(c-a))}static fixedScale(){return new ty([[Um(0),Wm(0)],[Um(1),Wm(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...t){let i=-1/0,s=1/0,n=-1/0,r=1/0;for(const o of t)for(const[a,l]of o)i=Math.min(a,i),s=Math.max(a,s),n=Math.min(l,n),r=Math.max(l,r);return{domain:[[i,n],[s,r]],animatable:!0}}convert([t,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[(Gm(t)-this.bounds.x)*a+s,(Hm(i)-this.bounds.y)*l+n]}invert([t,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[Um((t-s)/a+this.bounds.x),Wm((i-n)/l+this.bounds.y)]}},xR={top:{xTranslationDirection:0,yTranslationDirection:-1},bottom:{xTranslationDirection:0,yTranslationDirection:1},left:{xTranslationDirection:-1,yTranslationDirection:0},right:{xTranslationDirection:1,yTranslationDirection:0},"top-left":{xTranslationDirection:1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"bottom-right":{xTranslationDirection:-1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:1,yTranslationDirection:0},"inside-right":{xTranslationDirection:-1,yTranslationDirection:0},"inside-top":{xTranslationDirection:0,yTranslationDirection:1},"inside-bottom":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-right":{xTranslationDirection:-1,yTranslationDirection:-1}},vR={top:{xTranslationDirection:1,yTranslationDirection:0},bottom:{xTranslationDirection:-1,yTranslationDirection:0},left:{xTranslationDirection:0,yTranslationDirection:-1},right:{xTranslationDirection:0,yTranslationDirection:1},"top-left":{xTranslationDirection:-1,yTranslationDirection:-1},"top-right":{xTranslationDirection:-1,yTranslationDirection:1},"bottom-left":{xTranslationDirection:1,yTranslationDirection:-1},"bottom-right":{xTranslationDirection:1,yTranslationDirection:1},inside:{xTranslationDirection:0,yTranslationDirection:0},"inside-left":{xTranslationDirection:0,yTranslationDirection:1},"inside-right":{xTranslationDirection:0,yTranslationDirection:-1},"inside-top":{xTranslationDirection:-1,yTranslationDirection:0},"inside-bottom":{xTranslationDirection:1,yTranslationDirection:0},"inside-top-left":{xTranslationDirection:-1,yTranslationDirection:1},"inside-bottom-left":{xTranslationDirection:1,yTranslationDirection:1},"inside-top-right":{xTranslationDirection:-1,yTranslationDirection:-1},"inside-bottom-right":{xTranslationDirection:1,yTranslationDirection:-1}};function MR({yDirection:e,padding:t=0,position:i="top",bbox:s}){const n=e?xR:vR,{xTranslationDirection:r,yTranslationDirection:o}=n[i],a=r*(t+s.width/2),l=o*(t+s.height/2);return{xTranslation:a,yTranslation:l}}var ji=(T(),N(w));function SR(e,t){const i=(0,ji.createElement)("button",vd("ag-charts-input ag-charts-button",t));return e.label!==void 0?i.append(e.label):(i.append(dI(e.icon)),i.ariaLabel=e.altText),i.addEventListener("click",e.onPress),(0,ji.setAttributes)(i,t),i}function DR(e,t){const i=(0,ji.createElement)("input",vd("ag-charts-input ag-charts-checkbox",t));return i.type="checkbox",i.checked=e.checked,i.addEventListener("change",s=>e.onChange(i.checked,s)),i.addEventListener("keydown",s=>{Ah(s)&&(s.preventDefault(),i.click())}),(0,ji.setAttributes)(i,t),i}function IR(e,t){const i=(0,ji.createElement)("select",vd("ag-charts-input ag-charts-select",t));return i.append(...e.options.map(s=>{const n=(0,ji.createElement)("option");return n.value=s.value,n.textContent=s.label,n})),(0,ji.setAttribute)(i,"data-preventdefault",!1),i.value=e.value,i.addEventListener("change",s=>e.onChange(i.value,s)),(0,ji.setAttributes)(i,t),i}function AR(e,t){const i=(0,ji.createElement)("textarea",vd("ag-charts-input ag-charts-textarea",t));return i.value=e.value,i.addEventListener("input",s=>e.onChange(i.value,s)),(0,ji.setAttributes)(i,t),(0,ji.setAttribute)(i,"data-preventdefault",!1),i}function dI(e){const t=(0,ji.createElement)("span",`ag-charts-icon ag-charts-icon-${e}`);return(0,ji.setAttribute)(t,"aria-hidden",!0),t}function vd(e,t){return t==null?e:`${e} ${t.class}`}var pI=class extends ti{constructor(e=""){super(),this._d="",this.d=e}get d(){return this._d}set d(e){e!==this._d&&(this._d=e,this.path.clear(),this.path.appendSvg(e),this.checkPathDirty())}},LR=class extends Dr(pI){isPointInPath(e,t){return super.isPointInPath(e-this.translationX,t-this.translationY)}},Na=class extends Ws{constructor(e){super(),this.sourceImage=e,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(e){const{ctx:t}=e,i=this.sourceImage;i&&(t.globalAlpha=this.opacity,t.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(e)}};f([z()],Na.prototype,"x",2),f([z()],Na.prototype,"y",2),f([z()],Na.prototype,"width",2),f([z()],Na.prototype,"height",2),f([z()],Na.prototype,"opacity",2);var gI={};is(gI,{ButtonWidget:()=>ol,MenuItemWidget:()=>$m,MenuWidget:()=>fI,NativeWidget:()=>Fo,SliderWidget:()=>qp,ToolbarWidget:()=>wh,WIDGET_HTML_EVENTS:()=>wp,Widget:()=>Ls,WidgetEventUtil:()=>Xs});var Ta=(T(),N(w)),kR=(T(),N(w)),$m=class extends O0{constructor(){super((0,kR.createElement)("div"),"menuitem")}},CR=["Escape","ArrowLeft"],fI=class VI extends Zp{constructor(t="vertical"){super(t,"menu"),this.closeSubMenu=i=>this.openSubMenu(i,void 0)}destructor(){this.selfClose("2")}addSeparator(){const t=(0,Ta.getDocument)().createElement("div");return(0,Ta.setAttribute)(t,"role","separator"),this.elem.appendChild(t),t}onChildAdded(t){super.onChildAdded(t),t.hasPopup()||t.addListener("mouseenter",this.closeSubMenu)}onChildRemoved(t){super.onChildRemoved(t),t.hasPopup()||t.removeListener("mouseenter",this.closeSubMenu)}addSubMenu(){const t=new $m,i=(0,Ta.createElementId)(),s=new VI(this.orientation),n=o=>{t.isDisabled()||this.openSubMenu(o,s)},r=o=>{rl(o.sourceEvent)&&o.sourceEvent.code==="ArrowRight"&&n(o)};return t.setAriaHasPopup("menu"),t.setAriaExpanded(!1),t.setAriaControls(i),t.addListener("click",n),t.addListener("mouseenter",n),t.addListener("keydown",r),s.addListener("close-widget",()=>t.setAriaExpanded(!1)),s.addListener("open-widget",()=>t.setAriaExpanded(!0)),s.id=i,this.addChild(t),{subMenuButton:t,subMenu:s}}openSubMenu(t,i){const{openScope:s}=this;s&&(s.openSubMenu?.selfClose("4"),i?.open(t),s.openSubMenu=i)}open(t,i){if(this.openScope!=null)return;this.openScope={lastFocus:Lh(t.sourceEvent),openSubMenu:void 0,abort:()=>this.selfClose("1"),close:()=>this.selfClose("0"),removers:new Ta.CleanupRegistry};const s=this.openScope,n=this.children.map(r=>r.getElement());(0,Ta.setAttribute)(s.lastFocus,"aria-expanded",!0),s.removers.register(Bp(this.elem,s.abort),Vp(this.elem,s.abort),...this.children.map(r=>Dh(r.getElement(),s.close,CR)),i?.overrideFocusVisible&&Gp(this.elem,n,i.overrideFocusVisible)),this.internalListener?.dispatch("open-widget",this,{type:"open-widget"}),this.children[0]?.focus({preventScroll:!0})}selfClose(t){if(this.openScope===void 0)return;const{lastFocus:i,removers:s,openSubMenu:n}=this.openScope;this.openScope=void 0,n?.selfClose("3"),(0,Ta.setAttribute)(i,"aria-expanded",!1),t==="0"&&i?.focus({preventScroll:!0}),s.flush(),this.internalListener?.dispatch("close-widget",this,{type:"close-widget"})}close(){this.selfClose("0")}},Ym=(T(),N(w)),Nc=(T(),N(w)),mI=(T(),N(w)),yI="canvas-overlay",Km=class extends eh{constructor(e,t,i){super(),this.ctx=e,this.hideFns=[],this.moduleId=`popover-${t}`,i?.detached?this.element=(0,mI.createElement)("div"):this.element=e.domManager.addChild(yI,this.moduleId),this.element.setAttribute("role","presentation"),this.cleanup.register(()=>e.domManager.removeChild(yI,this.moduleId))}attachTo(e){this.element.parentElement||e.element.append(this.element)}hide(e){const{lastFocus:t=this.lastFocus}=e??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),t?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(e,t){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=(0,mI.createElement)("div","ag-charts-popover");if(t.ariaLabel!=null&&i.setAttribute("aria-label",t.ariaLabel),t.class!=null&&i.classList.add(t.class),i.replaceChildren(...e),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),t.onHide&&this.hideFns.push(t.onHide),t.initialFocus&&t.sourceEvent){const s=Lh(t.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=t.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(e){const t=this.getPopoverElement();t&&(t.style.setProperty("right","unset"),t.style.setProperty("bottom","unset"),e.x!=null&&t.style.setProperty("left",`${Math.floor(e.x)}px`),e.y!=null&&t.style.setProperty("top",`${Math.floor(e.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},bI=class extends Km{setAnchor(e,t){this.anchor=e,this.fallbackAnchor=t,this.updatePosition(e),this.repositionWithinBounds()}showWithChildren(e,t){const i=t.anchor??this.anchor,s=t.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(e,t);return i&&this.setAnchor(i,s),(0,Nc.getWindow)().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:e,ctx:t,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!e||!s)return;const n=t.domManager.getBoundingClientRect(),{offsetWidth:r,offsetHeight:o}=s;let a=(0,Nc.clamp)(0,e.x,n.width-r),l=(0,Nc.clamp)(0,e.y,n.height-o);a!==e.x&&i?.x!=null&&(a=(0,Nc.clamp)(0,i.x-r,n.width-r)),l!==e.y&&i?.y!=null&&(l=(0,Nc.clamp)(0,i.y-o,n.height-o)),this.updatePosition({x:a,y:l})}},wR=class extends bI{show(e){const t=e.items.map(s=>this.createRow(e,s)),i=this.showWithChildren(t,e);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=I0({orientation:"vertical",menu:i,buttons:t,sourceEvent:e.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(e,t){const{menuItemRole:i="menuitem"}=e,s=t.value===e.value,n=(0,Ym.createElement)("div","ag-charts-menu__row");if(n.setAttribute("role",i),i==="menuitemradio"&&n.setAttribute("aria-checked",(e.value===t.value).toString()),typeof t.value=="string"&&(n.dataset.popoverId=t.value),n.classList.toggle("ag-charts-menu__row--active",s),t.icon!=null){const l=(0,Ym.createElement)("span",`ag-charts-menu__icon ${mh(t.icon)}`);n.appendChild(l)}const r=t.strokeWidth!=null;if(r&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",r),n.style.setProperty("--strokeWidth",r?`${t.strokeWidth}px`:null)),t.label!=null){const l=(0,Ym.createElement)("span","ag-charts-menu__label");l.textContent=this.ctx.localeManager.t(t.label),n.appendChild(l)}"altText"in t&&(n.ariaLabel=this.ctx.localeManager.t(t.altText));const o=()=>{e.onPress?.(t)},a=l=>{Ah(l)&&(o(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",a),n.addEventListener("click",a),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},xI=class extends Km{constructor(){super(...arguments),this.dragged=!1}setDragHandle(e){e.addListener("drag-start",t=>{e.addClass(this.dragHandleDraggingClass),this.onDragStart(t)}),e.addListener("drag-move",this.onDragMove.bind(this)),e.addListener("drag-end",()=>{e.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(e){const t=this.getPopoverElement();t&&(e.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:wa.from(e.clientX,e.clientY),position:wa.from(Number(t.style.getPropertyValue("left").replace("px","")),Number(t.style.getPropertyValue("top").replace("px","")))})}onDragMove(e){const{dragStartState:t}=this,i=this.getPopoverElement();if(!t||!i)return;const s=wa.sub(wa.from(e.clientX,e.clientY),t.client),n=wa.add(t.position,s),r=this.ctx.domManager.getBoundingClientRect(),o={};n.x>=0&&n.x+i.offsetWidth<=r.width&&(o.x=n.x),n.y>=0&&n.y+i.offsetHeight<=r.height&&(o.y=n.y),this.updatePosition(o)}onDragEnd(){this.dragStartState=void 0}},Tc=class extends ae{};f([x],Tc.prototype,"icon",2),f([x],Tc.prototype,"label",2),f([x],Tc.prototype,"ariaLabel",2),f([x],Tc.prototype,"tooltip",2);var NR=(T(),N(w)),vI=class extends ol{constructor(e){super(),this.localeManager=e}update(e){const{localeManager:t}=this;e.tooltip&&(this.elem.title=t.t(e.tooltip));let i="";if(e.icon!=null&&(i=`<span class="${mh(e.icon)} ag-charts-toolbar__icon"></span>`),e.label!=null){const s=t.t(e.label);i=`${i}<span class="ag-charts-toolbar__label">${s}</span>`}this.elem.innerHTML=i}setChecked(e){(0,NR.setAttribute)(this.elem,"aria-checked",e)}},MI="ag-charts-toolbar__button--active",Zm=class extends wh{constructor({eventsHub:e,localeManager:t},i,s){super(s),this.ariaLabelId=i,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new W0,this.hasPrefix=!1,this.buttonWidgets=[],this.updateAriaLabel=()=>this.setAriaLabel(this.localeManager.t(this.ariaLabelId)),this.eventsHub=e,this.localeManager=t,this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",s==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",s==="vertical"),this.eventsHub.on("locale:change",this.updateAriaLabel),this.updateAriaLabel()}setAriaLabelId(e){this.ariaLabelId=e,this.updateAriaLabel()}addToolbarListener(e,t){return this.events.addListener(e,t)}clearButtons(){for(const e of this.buttonWidgets)e.destroy();this.buttonWidgets.splice(0)}updateButtons(e){const{buttonWidgets:t}=this;for(const[i,s]of e.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=e.length;i<t.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(e.length),this.refreshButtonClasses()}updateButtonByIndex(e,t){this.buttonWidgets.at(e)?.update(t)}clearActiveButton(){for(const e of this.buttonWidgets)e.toggleClass(MI,!1)}toggleActiveButtonByIndex(e){if(e!==-1)for(const[t,i]of this.buttonWidgets.entries())i.toggleClass(MI,e!=null&&e===t)}toggleButtonEnabledByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setEnabled(t)}toggleSwitchCheckedByIndex(e,t){e!==-1&&this.buttonWidgets.at(e)?.setChecked(t)}getButtonBounds(){return this.buttonWidgets.map(e=>this.getButtonWidgetBounds(e))}setButtonHiddenByIndex(e,t){this.buttonWidgets.at(e)?.setHidden(t)}getButtonWidgetBounds(e){const t=this.getBounds(),i=e.getBounds();return new W(i.x+t.x,i.y+t.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:e,hasPrefix:t}=this;let i,s,n;for(const[r,o]of e.entries())i=!t&&r===0||n!=o.section,s=r===e.length-1||o.section!=e.at(r+1)?.section,o.toggleClass("ag-charts-toolbar__button--first",i),o.toggleClass("ag-charts-toolbar__button--last",s),o.toggleClass("ag-charts-toolbar__button--gap",r>0&&i),n=o.section}createButton(e,t){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:e,...t instanceof ae?t.toJson():t},r=this.getButtonWidgetBounds(i);this.events.dispatch("button-pressed",{event:s,button:n,buttonBounds:r})}),i.addListener("focus",()=>{this.events.dispatch("button-focused",{button:{index:e}})}),t.section&&(i.section=t.section),this.buttonWidgets.push(i),this.addChild(i),i}},TR=class extends Zm{createButtonWidget(){return new vI(this.localeManager)}},Md=(T(),N(w)),OR=class extends xI{constructor(e,t,i){super(e,t),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(e,t={}){this.showWithChildren(e,{...t,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const e=this.getPopoverElement();return new W(e?.offsetLeft??0,e?.offsetTop??0,e?.offsetWidth??0,e?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(e,t,i){const s=this.getPopoverElement();if(!s)return;const n=e.position??"above",{offsetWidth:r,offsetHeight:o}=s;let a=e.y-o-i,l=e.x-r/2;n==="below"?a=e.y+i:n==="right"?(a=e.y-o/2,l=e.x+t):n==="above-left"&&(l=e.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="none")}capturePointerEvents(){const e=this.getPopoverElement();e&&(e.style.pointerEvents="unset")}updatePosition(e){const t=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();e.x=Math.floor((0,Md.clamp)(0,e.x,i.width-t.width)),e.y=Math.floor((0,Md.clamp)(0,e.y,i.height-t.height)),super.updatePosition(e),this.onPopoverMoved()}},ER=class extends Zm{constructor(e,t,i){super(e,t,"horizontal"),this.hasPrefix=!0,this.popover=new OR(e,i,this.onPopoverMoved.bind(this)),this.dragHandle=new PR(e.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}destroy(){super.destroy(),this.popover.destroy()}show(e={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],e)}hide(){this.popover.hide()}setAnchor(e){this.popover.setAnchor(e,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const e=this.popover.getBounds();if(this.popoverBounds?.equals(e))return;this.popoverBounds=e.clone();const t=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:e,buttonBounds:t})}getButtonWidgetBounds(e){const t=this.popover.getBounds(),i=super.getButtonWidgetBounds(e),s=this.dragHandle.getBounds();return new W(i.x+t.x-s.width,i.y+t.y,i.width,i.height)}},PR=class extends Fo{constructor(e){super((0,Md.createElement)("div","ag-charts-floating-toolbar__drag-handle"));const t=new Fo((0,Md.createElement)("span",`${mh("drag-handle")} ag-charts-toolbar__icon`));t.setAriaHidden(!0),this.addChild(t),this.elem.title=e}},RR={...Vx,...Gx},_R={VERSION:Ir,_Scene:Pm,_Theme:jm,_Util:zm,create:ar.create.bind(ar),createSparkline:ar.__createSparkline.bind(ar),setup:Mm,isEnterprise:!1};if(typeof Ms.exports=="object"&&typeof Ea=="object"){var jR=(e,t,i,s)=>{if(t&&typeof t=="object"||typeof t=="function")for(let n of Object.getOwnPropertyNames(t))!Object.prototype.hasOwnProperty.call(e,n)&&n!==i&&Object.defineProperty(e,n,{get:()=>t[n],enumerable:!(s=Object.getOwnPropertyDescriptor(t,n))||s.enumerable});return e};Ms.exports=jR(Ms.exports,Ea)}return Ms.exports});