UNPKG

ag-charts-community

Version:

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

13 lines 866 kB
(function(ko,rs){typeof exports=="object"&&typeof module=="object"?module.exports=rs():typeof define=="function"&&define.amd?define("agCharts",[],rs):typeof exports=="object"?exports.agCharts=rs():ko.agCharts=rs()})(this,()=>{var ko={},rs={exports:ko};if(typeof h1>"u")var h1=function(e){throw new Error("Unknown module: "+e)};var _h=Object.defineProperty,Qv=Object.getOwnPropertyDescriptor,Gg=Object.getOwnPropertyNames,Jv=Object.prototype.hasOwnProperty,$t=(t,e)=>function(){return t&&(e=(0,t[Gg(t)[0]])(t=0)),e},jh=(t,e)=>{for(var i in e)_h(t,i,{get:e[i],enumerable:!0})},tM=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Gg(e))!Jv.call(t,n)&&n!==i&&_h(t,n,{get:()=>e[n],enumerable:!(s=Qv(e,n))||s.enumerable});return t},k=t=>tM(_h({},"__esModule",{value:!0}),t),Vg={};jh(Vg,{error:()=>Yg,errorOnce:()=>nM,log:()=>eM,logGroup:()=>oM,reset:()=>rM,table:()=>iM,warn:()=>Ug,warnOnce:()=>sM});function eM(...t){console.log(...t)}function Ug(t,...e){console.warn(`AG Charts - ${t}`,...e)}function Yg(t,...e){typeof t=="object"?console.error("AG Charts error",t,...e):console.error(`AG Charts - ${t}`,...e)}function iM(...t){console.table(...t)}function sM(t,...e){const i=`Logger.warn: ${t}`;Sr.has(i)||(Ug(t,...e),Sr.add(i))}function nM(t,...e){const i=`Logger.error: ${t}`;Sr.has(i)||(Yg(t,...e),Sr.add(i))}function rM(){Sr.clear()}function oM(t,e){console.groupCollapsed(t);try{return e()}finally{console.groupEnd()}}var Sr,aM=$t({"packages/ag-charts-core/src/globals/logger.ts"(){"use strict";Sr=new Set}}),Fh,lM=$t({"packages/ag-charts-core/src/interfaces/moduleDefinition.ts"(){"use strict";Fh=(t=>(t.Axis="axis",t.Chart="chart",t.Preset="preset",t.Plugin="plugin",t.Series="series",t))(Fh||{})}}),Wg={};jh(Wg,{detectChartDefinition:()=>pM,getAxisModule:()=>fM,getSeriesModule:()=>gM,hasModule:()=>uM,listModulesByType:()=>dM,register:()=>$g,registerMany:()=>cM,reset:()=>hM});function $g(t){const e=Is.get(t.name);if(e&&(e.enterprise||!t.enterprise))throw new Error(`AG Charts - Module '${t.name}' already registered`);Is.set(t.name,t)}function cM(t){for(const e of t)$g(e)}function hM(){Is.clear()}function uM(t){return Is.has(t)}function*dM(t){for(const e of Is.values())e.type===t&&(yield e)}function pM(t){for(const e of Is.values())if(mM(e)&&e.detect(t))return e;throw new Error("AG Charts - Unknown chart type; Check options are correctly structured and series types are specified")}function gM(t){const e=Is.get(t);if(bM(e))return e}function fM(t){const e=Is.get(t);if(yM(e))return e}function mM(t){return t?.type==="chart"}function yM(t){return t?.type==="axis"}function bM(t){return t?.type==="series"}var Is,xM=$t({"packages/ag-charts-core/src/globals/moduleRegistry.ts"(){"use strict";Is=new Map}}),vM=$t({"packages/ag-charts-core/src/globals/index.ts"(){"use strict";aM(),xM()}}),MM=$t({"packages/ag-charts-core/src/interfaces/globalTypes.ts"(){"use strict"}}),Hg,SM=$t({"packages/ag-charts-core/src/classes/eventEmitter.ts"(){"use strict";Hg=class{constructor(){this.events=new Map}on(t,e){return this.events.has(t)||this.events.set(t,new Set),this.events.get(t)?.add(e),()=>this.off(t,e)}off(t,e){const i=this.events.get(t);i&&(i.delete(e),i.size===0&&this.events.delete(t))}emit(t,e){this.events.get(t)?.forEach(i=>i(e))}clear(t){t?this.events.delete(t):this.events.clear()}}}});function Kg(t,e="and",i=String,s=1/0){if(t.length===1)return i(t[0]);t=t.map(i);const n=t.pop();if(t.length>=s){const r=t.length-(s-1);return`${t.slice(0,s-1).join(", ")}, and ${r} more ${e} ${n}`}return`${t.join(", ")} ${e} ${n}`}function Zg(t,e=1/0){if(typeof t=="number"){if(isNaN(t))return"NaN";if(t===1/0)return"Infinity";if(t===-1/0)return"-Infinity"}const i=JSON.stringify(t)??typeof t;return i.length>e?`${i.slice(0,e)}... (+${i.length-e} characters)`:i}function DM(t){let e=1;for(let i=0;i<t.length;i++)t.charCodeAt(i)===10&&e++;return e}function Xg(t,e){if(t===e)return 0;const[i,s]=t.length<e.length?[t,e]:[e,t],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]}var qg=$t({"packages/ag-charts-core/src/utils/strings.ts"(){"use strict"}});function pl(t){return t?Gi.document?.[t]:Gi.document}function Qg(t){return t?Gi.window?.[t]:Gi.window}function IM(t){Gi.document=t}function AM(t){Gi.window=t}var Gi,gl=$t({"packages/ag-charts-core/src/utils/dom/globalsProxy.ts"(){"use strict";Gi={},typeof window<"u"?Gi.window=window:typeof global<"u"&&(Gi.window=global.window),typeof document<"u"?Gi.document=document:typeof global<"u"&&(Gi.document=global.document)}});function Jg(t,e,i){const s=pl().createElement(t);if(typeof e=="object"&&(i=e,e=void 0),e)for(const n of e.split(" "))s.classList.add(n);return i&&Object.assign(s.style,i),s}function LM(t){return pl().createElementNS("http://www.w3.org/2000/svg",t)}var tf=$t({"packages/ag-charts-core/src/utils/dom/domElements.ts"(){"use strict";gl()}});function CM(t,e){const i=pl("body"),s=Jg("a",{display:"none"});s.href=t,s.download=e,i.appendChild(s),s.click(),setTimeout(()=>i.removeChild(s))}var NM=$t({"packages/ag-charts-core/src/utils/dom/domDownload.ts"(){"use strict";tf(),gl()}});function ef(t){const e=Qg("Option"),{style:i}=new e;return i.color=t,i.color||null}var TM=$t({"packages/ag-charts-core/src/utils/dom/domUtils.ts"(){"use strict";gl()}}),sf=$t({"packages/ag-charts-core/src/utils/dom/index.ts"(){"use strict";NM(),tf(),TM(),gl()}});function nf(t){return t!=null}function en(t){return Array.isArray(t)}function rf(t){return typeof t=="boolean"}function zh(t){return t instanceof Date}function Bh(t){return zh(t)&&!isNaN(Number(t))}function kM(t){return t instanceof RegExp}function wo(t){return typeof t=="function"}function fl(t){return typeof t=="object"&&t!==null&&!en(t)}function wM(t){return en(t)||of(t)}function of(t){return typeof t=="object"&&t!==null&&t.constructor?.name==="Object"}function Rn(t){return typeof t=="string"}function EM(t){return typeof t=="number"}function Dr(t){return Number.isFinite(t)}function OM(t){return typeof window<"u"&&t instanceof HTMLElement}function RM(t,e){return Rn(e)&&Object.keys(t).includes(e)}function PM(t,e){return Object.values(t).includes(e)}function _M(t){return typeof t=="symbol"}function af(t){return Rn(t)&&ef(t)!=null}var Gh=$t({"packages/ag-charts-core/src/utils/typeGuards.ts"(){"use strict";sf()}});function Eo(t,e,i=""){if(!fl(t)){const l=lf(i,t,"an object",!0);return{valid:null,errors:[new Oo(l,i,!0)]}}const s=[],n=new Set(Object.keys(t)),r=[],o={};function a(l){return en(e)?`${i}[${l}]`:i?`${i}.${l}`:l}for(const l of Object.keys(e)){const c=e[l],h=t[l],u=c[Vh];if(n.delete(l),typeof h>"u"&&(s.push(l),!u))continue;const d=a(l);if(wo(c)){const p={options:t,path:d};if(c(h,p))o[l]=p.result?.valid??h;else if(!p.result){const f=lf(d,h,c,u);r.push(new Oo(f,i,u))}p.result&&r.push(...p.result.errors)}else{const p=Eo(h,c,d);p.valid!=null&&(o[l]=p.valid),r.push(...p.errors)}}for(const l of n){if(typeof t[l]>"u")continue;const h=jM(l,a(l),s);r.push(new Oo(h,i,void 0,!0))}return{valid:o,errors:r}}function lf(t,e,i,s){const n=Rn(i)?i:i[sn],r=n?`; expecting ${n}`:"",o=t?`Option \`${t}\``:"Value";return s&&e==null?`${o} is required and has not been provided${r}, ignoring.`:`${o} cannot be set to \`${Zg(e,50)}\`${r}, ignoring.`}function jM(t,e,i){const s=FM(t,i),n=s?`; Did you mean \`${s}\`? Ignoring.`:", ignoring.";return`Unknown option \`${e}\`${n}`}function FM(t,e,i=2){let s=1/0;const n=t.toLowerCase();return e.reduce((r,o)=>{const a=Xg(n,o.toLowerCase());return s>a&&a<=i?(s=a,o):r},null)}function jt(t,e){return Object.assign(wo(t)?(i,s)=>t(i,s):{...t},{[sn]:e})}function Ht(t){return Object.assign(wo(t)?(e,i)=>t(e,i):Pn(t),{[Vh]:!0,[sn]:t[sn]})}function os(...t){fl(t[0])&&(t=Object.values(t[0]));const e=Kg(t,"or",i=>`'${i}'`);return jt(i=>t.includes(i),`a keyword such as ${e}`)}var sn,Vh,Oo,Pn,Uh,Ro,Po,_o,cf,hf,jo,uf,Li,df,pf,nn,gf,Yh,ml,yl,Wh,di,ff,as,mf,yf,Fo,bf,zo,xf,bl,vf=$t({"packages/ag-charts-core/src/utils/validation.ts"(){"use strict";qg(),Gh(),sn=Symbol("description"),Vh=Symbol("required"),Oo=class{constructor(t,e,i,s){this.message=t,this.path=e,this.required=i,this.unknown=s}toString(){return this.message}},Pn=(t,e="an object")=>jt((i,s)=>(s.result=Eo(i,t,s.path),!s.result.errors.some(n=>n.required&&n.path===s.path)),e),Uh=(t,e="an object")=>jt((i,s)=>(s.result=Eo(i,t,s.path),s.result.errors=s.result.errors.filter(n=>!n.unknown),!s.result.errors.some(n=>n.required&&n.path===s.path)),e),Ro=(...t)=>jt((e,i)=>t.every(s=>{const n=s(e,i);return i.result&&!n&&delete i.result,n}),t.map(e=>e[sn]).filter(Boolean).join(" and ")),Po=(...t)=>jt((e,i)=>t.some(s=>{const n=s(e,i);return i.result&&!n&&delete i.result,n}),t.map(e=>e[sn]).filter(Boolean).join(" or ")),_o=t=>Dr(t)||Bh(t),cf=t=>zh(t)||(Dr(t)||Rn(t))&&Bh(new Date(t)),hf=jt(en,"an array"),jo=jt(rf,"a boolean"),uf=jt(wo,"a function"),Li=jt(af,"a color string"),df=jt(cf,"a date"),pf=jt(nf,"a defined value"),nn=jt(Dr,"a number"),gf=jt(fl,"an object"),Yh=jt(Rn,"a string"),ml=(t,e=1/0)=>{let i;return e===1/0?i=`an array of at least ${t} items`:t===e?i=`an array of exactly ${t} items`:t===0?i=`an array of no more than ${e} items`:i=`an array of at least ${t} and no more than ${e} items`,jt(s=>en(s)&&s.length>=t&&s.length<=e,i)},yl=(t,e=!0)=>jt(i=>Dr(i)&&(i>t||e&&i===t),`a number greater than ${e?"or equal to ":""}${t}`),Wh=(t,e)=>jt(i=>Dr(i)&&i>=t&&i<=e,`a number between ${t} and ${e} inclusive`),di=yl(0),ff=yl(0,!1),as=Wh(0,1),mf=t=>jt((e,{options:i})=>!_o(e)||!_o(i[t])||e<i[t],`the value to be less than \`${t}\``),yf=t=>jt((e,{options:i})=>!_o(e)||!_o(i[t])||e>i[t],`the value to be greater than \`${t}\``),Fo=t=>jt(e=>t===e,`the value ${JSON.stringify(t)}`),bf=(t,e)=>jt(i=>i instanceof t,e??`an instance of ${t.name}`),zo=(t,e)=>jt((i,s)=>en(i)&&i.every(n=>{const r=t(n,s);return delete s.result,r}),e??`${t[sn]} array`),xf=(t,e="an object array")=>jt((i,s)=>{if(!en(i))return!1;const n=[],r=[];for(let o=0;o<i.length;o++){const a=`${s.path}[${o}]`,l=Eo(i[o],t,a);r.push(...l.errors),l.errors.some(c=>c.required&&c.path===a)||n.push(l.valid)}return s.result={valid:n,errors:r},!0},e),bl=(t,e="an object")=>{const i=Uh({type:Ht(os(...Object.keys(t)))});return jt((s,n)=>{if(i(s,n)){const r=s.type,o={type:Ht(Fo(r)),...t[r]},a=Pn(o)(s,n);if(n.result)for(const l of n.result.errors)l.message+=` (type="${r}")`;return a}return!1},e)}}}),Mf,Sf,Bo,xl,Df,$h,Hh,Kh,If,Af,Lf,Zh,vl,Cf,Nf,zM=$t({"packages/ag-charts-core/src/options/commonOptionsDefs.ts"(){"use strict";vf(),Mf=Pn({color:Li,stop:as},""),Sf=jt(t=>{let e=-1/0;for(const i of t)if(i?.stop!=null){if(i.stop<e)return!1;e=i.stop}return!0},"color stops to be defined in ascending order"),Bo=Ro(ml(2),Ro(zo(Mf),Sf)),xl=os("axis","item","series"),Df=bl({gradient:{gradient:os("linear","radial","conic"),bounds:xl,colorStops:Ht(Bo),rotation:nn,reverse:jo}},"a gradient object with color stops"),$h={stroke:Li,strokeWidth:di,strokeOpacity:as},Hh=Pn({type:Ht(Fo("gradient")),gradient:Ht(os("linear","radial","conic")),bounds:Ht(xl),colorStops:Ht(Po(Bo,Ro(ml(2),zo(Li)))),rotation:Ht(nn),reverse:Ht(jo)}),Kh=Pn({type:Ht(Fo("pattern")),pattern:Ht(os("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses")),width:Ht(di),height:Ht(di),fill:Ht(Li),fillOpacity:Ht(as),backgroundFill:Ht(Li),backgroundFillOpacity:Ht(as),padding:Ht(di),rotation:Ht(nn),stroke:Ht(Li),strokeWidth:Ht(di),strokeOpacity:Ht(as)}),If={gradient:os("linear","radial","conic"),bounds:xl,reverse:jo},Af={rotation:nn,padding:di},Lf=bl({gradient:{...If,colorStops:Bo,rotation:nn},pattern:{...Af,pattern:os("vertical-lines","horizontal-lines","forward-slanted-lines","backward-slanted-lines","circles","squares","triangles","diamonds","stars","hearts","crosses"),width:di,height:di,fill:Li,fillOpacity:as,backgroundFill:Li,backgroundFillOpacity:as,...$h}},"a color object"),Zh=Po(Li,Lf),vl={fill:Zh,fillOpacity:as},vl.fillGradientDefaults=Hh,vl.fillPatternDefaults=Kh,Cf={lineDash:zo(di),lineDashOffset:nn},Nf={color:Li,fontFamily:Yh,fontSize:di,fontStyle:os("normal","italic","oblique"),fontWeight:Po(di,os("normal","bold","bolder","lighter"))}}});function BM(t){return typeof t>"u"?[]:Array.isArray(t)?t:[t]}function GM(t){return Array.from(new Set(t))}function VM(t,e){return t.reduce((i,s)=>{const n=e(s);return i[n]??(i[n]=[]),i[n].push(s),i},{})}function Tf(t,e){if(t==null||e==null||t.length!==e.length)return!1;for(let i=0;i<t.length;i++)if(Array.isArray(t[i])&&Array.isArray(e[i])){if(!Tf(t[i],e[i]))return!1}else if(t[i]!==e[i])return!1;return!0}function UM(t,e,i=0){if(t.length===0)return[];const s=[];for(let n=0;n<e;n++)s.push(t.at((n+i)%t.length));return s}function YM(t,e){const i=new Map;return e.forEach((s,n)=>{i.set(s,n)}),t.sort((s,n)=>{const r=i.get(s)??1/0,o=i.get(n)??1/0;return r-o})}var WM=$t({"packages/ag-charts-core/src/utils/arrays.ts"(){"use strict"}});function $M(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,t=n+1):e=n-1}return s}function HM(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2);i(n)?(s=n,e=n-1):t=n+1}return s}function KM(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),r=i(n);r==null?e=n-1:(s=r,t=n+1)}return s}function ZM(t,e,i){if(t>e)return;let s;for(;e>=t;){const n=Math.floor((e+t)/2),r=i(n);r==null?t=n+1:(s=r,e=n-1)}return s}var XM=$t({"packages/ag-charts-core/src/utils/binarySearch.ts"(){"use strict"}});function qM(t,e){const i=Math.max(t.length,e.length),s=new Set,n=new Set;for(let r=0;r<i;r++){const o=t[r],a=e[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 QM=$t({"packages/ag-charts-core/src/utils/diff.ts"(){"use strict"}});function JM(t,e=0,i){const{leading:s=!1,trailing:n=!0,maxWait:r=1/0}=i??{};let o,a;if(r<e)throw new Error("Value of maxWait cannot be lower than waitMs.");function l(...c){if(s&&!a){a=Date.now(),o=setTimeout(()=>a=null,e),t(...c);return}let h=e;if(r!==1/0&&a){const u=Date.now()-a;e>r-u&&(h=r-u)}clearTimeout(o),a??(a=Date.now()),o=setTimeout(()=>{a=null,n&&t(...c)},h)}return Object.assign(l,{cancel(){clearTimeout(o),a=null}})}function tS(t,e,i){const{leading:s=!0,trailing:n=!0}=i??{};let r,o,a=!1;function l(){n&&o?(r=setTimeout(l,e),t(...o)):a=!1,o=null}function c(...h){a?o=h:(a=!0,r=setTimeout(l,e),s?t(...h):o=h)}return Object.assign(c,{cancel(){clearTimeout(r),a=!1,o=null}})}var eS=$t({"packages/ag-charts-core/src/utils/functions.ts"(){"use strict"}});function*iS(...t){for(const e of t)yield*e}function sS(t){return t!=null&&typeof t=="object"&&Symbol.iterator in t?t:[t]}function nS(t){for(const e of t)return e;throw new Error("AG Charts - no first() value found")}function*rS(t){const e=[void 0,void 0];for(const i of Object.keys(t))e[0]=i,e[1]=t[i],yield e}var oS=$t({"packages/ag-charts-core/src/utils/iterators.ts"(){"use strict"}});function kf(t,e,i){return Math.min(i,Math.max(t,e))}function aS(t,e,i=1e-10){return t>=e[0]-i&&t<=e[1]+i}function lS(t,e,i=1e-10){return t===e||Math.abs(t-e)<i}function cS(t){return Math.sign(t)===-1||Object.is(t,-0)}function hS(t){return t%1===0}function uS(t,e=2){const i=10**e;return Math.round(t*i)/i}function dS(t,e){return Math.floor(t%e+(t<0?Math.abs(e):0))}function pS(t){if(Math.floor(t)===t)return 0;let e=String(t),i=0;if(t<1e-6||t>=1e21){let n;[e,n]=e.split("e"),n!=null&&(i=Number(n))}const s=e.split(".")[1]?.length??0;return Math.max(s-i,0)}var wf=$t({"packages/ag-charts-core/src/utils/numbers.ts"(){"use strict"}});function gS(t){if(!Rn(t))return!1;const e=qh.exec(t);return Xh.test(e?e[2]:t)}function Ef(t){let e,i;const s=qh.exec(t);s&&([,e,t,i]=s);const n=Xh.exec(t);if(!n)throw new Error(`The number formatter is invalid: ${t}`);const[,r,o,a,l,c,h,u,d,p,f]=n;return{fill:r,align:o,sign:a,symbol:l,zero:c,width:parseInt(h),comma:u,precision:parseInt(d),trim:!!p,type:f,prefix:e,suffix:i}}function fS(t){const e=typeof t=="string"?Ef(t):t,{fill:i,align:s,sign:n="-",symbol:r,zero:o,width:a,comma:l,type:c,prefix:h="",suffix:u="",precision:d}=e;let{trim:p}=e;const f=d==null||isNaN(d);let y;if(!c)y=pi.g,p=!0;else if(c in pi&&c in _n)y=f?_n[c]:pi[c];else if(c in pi)y=pi[c];else if(c in _n)y=_n[c];else throw new Error(`The number formatter type is invalid: ${c}`);let x;return f?x=c?6:12:x=d,m=>{let v=y(m,x);return p&&(v=mS(v)),l&&(v=yS(v,l)),v=xS(m,v,n),r&&r!=="#"&&(v=`${r}${v}`),r==="#"&&c==="x"&&(v=`0x${v}`),c==="s"&&(v=`${v}${bS(m)}`),(c==="%"||c==="p")&&(v=`${v}%`),a!=null&&!isNaN(a)&&(v=vS(v,a,i??o,s)),v=`${h}${v}${u}`,v}}function Ml(t){return Math.floor(Math.abs(t))}function mS(t){return t.replace(/\.0+$/,"").replace(/(\.[1-9])0+$/,"$1")}function yS(t,e){let i=t.indexOf(".");i<0&&(i=t.length);const s=t.substring(0,i).split(""),n=t.substring(i);for(let r=s.length-3;r>0;r-=3)s.splice(r,0,e);return`${s.join("")}${n}`}function bS(t){return Rf[Of(t)]}function Of(t){return kf(Qh,t?Math.floor(Math.log10(Math.abs(t))/3)*3:0,Jh)}function xS(t,e,i=""){if(i==="(")return t>=0?e:`(${e})`;const s=i==="+"?"+":"";return`${t>=0?s:Pf}${e}`}function vS(t,e,i=" ",s=">"){let n=t;if(s===">"||!s)n=n.padStart(e,i);else if(s==="<")n=n.padEnd(e,i);else if(s==="^"){const r=Math.max(0,e-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 Xh,qh,_n,pi,Qh,Jh,Rf,Pf,MS=$t({"packages/ag-charts-core/src/utils/numberFormat.ts"(){"use strict";wf(),Gh(),Xh=/^(?:(.)?([<>=^]))?([+\-( ])?([$€£¥₣₹#])?(0)?(\d+)?(,)?(?:\.(\d+))?(~)?([%a-z])?$/i,qh=/^((?:[^#]|#[^{])*)#{([^}]+)}(.*)$/,_n={b:t=>Ml(t).toString(2),c:t=>String.fromCharCode(t),d:t=>Math.round(Math.abs(t)).toFixed(0),o:t=>Ml(t).toString(8),x:t=>Ml(t).toString(16),X:t=>_n.x(t).toUpperCase(),n:t=>_n.d(t),"%":t=>`${Ml(t*100).toFixed(0)}`},pi={e:(t,e)=>Math.abs(t).toExponential(e),E:(t,e)=>pi.e(t,e).toUpperCase(),f:(t,e)=>Math.abs(t).toFixed(e),F:(t,e)=>pi.f(t,e).toUpperCase(),g:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),s=Math.floor(Math.log10(i));return s>=-4&&s<e?i.toFixed(e-1-s):i.toExponential(e-1)},G:(t,e)=>pi.g(t,e).toUpperCase(),n:(t,e)=>pi.g(t,e),p:(t,e)=>pi.r(t*100,e),r:(t,e)=>{if(t===0)return"0";const i=Math.abs(t),n=Math.floor(Math.log10(i))-(e-1);if(n<=0)return i.toFixed(-n);const r=10**n;return(Math.round(i/r)*r).toFixed()},s:(t,e)=>{const i=Of(t);return pi.r(t/10**i,e)},"%":(t,e)=>pi.f(t*100,e)},Qh=-24,Jh=24,Rf={[Qh]:"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",[Jh]:"Y"},Pf="\u2212"}}),T={};jh(T,{EventEmitter:()=>Hg,Logger:()=>Vg,ModuleRegistry:()=>Wg,ModuleType:()=>Fh,ValidationError:()=>Oo,and:()=>Ro,array:()=>hf,arrayLength:()=>ml,arrayOf:()=>zo,arrayOfDefs:()=>xf,arraysEqual:()=>Tf,attachDescription:()=>jt,boolean:()=>jo,callback:()=>uf,circularSliceArray:()=>UM,clamp:()=>kf,color:()=>Li,colorUnion:()=>Zh,constant:()=>Fo,countFractionDigits:()=>pS,countLines:()=>DM,createElement:()=>Jg,createNumberFormatter:()=>fS,createSvgElement:()=>LM,date:()=>df,debounce:()=>JM,defined:()=>pf,diffArrays:()=>qM,downloadUrl:()=>CM,entries:()=>rS,fillGradientDefaults:()=>Hh,fillOptionsDef:()=>vl,fillPatternDefaults:()=>Kh,findMaxIndex:()=>$M,findMaxValue:()=>KM,findMinIndex:()=>HM,findMinValue:()=>ZM,first:()=>nS,fontOptionsDef:()=>Nf,getDocument:()=>pl,getWindow:()=>Qg,gradientColorStops:()=>Bo,gradientStrict:()=>Df,greaterThan:()=>yf,groupBy:()=>VM,inRange:()=>aS,instanceOf:()=>bf,isArray:()=>en,isBoolean:()=>rf,isColor:()=>af,isDate:()=>zh,isDefined:()=>nf,isEnumKey:()=>RM,isEnumValue:()=>PM,isFiniteNumber:()=>Dr,isFunction:()=>wo,isHtmlElement:()=>OM,isInteger:()=>hS,isNegative:()=>cS,isNumber:()=>EM,isNumberEqual:()=>lS,isObject:()=>fl,isObjectLike:()=>wM,isPlainObject:()=>of,isRegExp:()=>kM,isString:()=>Rn,isSymbol:()=>_M,isValidDate:()=>Bh,isValidNumberFormat:()=>gS,iterate:()=>iS,joinFormatted:()=>Kg,lessThan:()=>mf,levenshteinDistance:()=>Xg,lineDashOptionsDef:()=>Cf,modulus:()=>dS,number:()=>nn,numberMin:()=>yl,numberRange:()=>Wh,object:()=>gf,optionsDefs:()=>Pn,or:()=>Po,parseColor:()=>ef,parseNumberFormat:()=>Ef,partialDefs:()=>Uh,positiveNumber:()=>di,positiveNumberNonZero:()=>ff,ratio:()=>as,required:()=>Ht,roundTo:()=>uS,setDocument:()=>IM,setWindow:()=>AM,sortBasedOnArray:()=>YM,string:()=>Yh,stringifyValue:()=>Zg,strokeOptionsDef:()=>$h,throttle:()=>tS,toArray:()=>BM,toIterable:()=>sS,typeUnion:()=>bl,union:()=>os,unique:()=>GM,validate:()=>Eo});var w=$t({"packages/ag-charts-core/src/main.ts"(){"use strict";vM(),MM(),lM(),SM(),zM(),sf(),WM(),XM(),QM(),eS(),oS(),MS(),wf(),qg(),Gh(),vf()}}),Sl=Object.defineProperty,_f=Object.getOwnPropertyDescriptor,SS=Object.getOwnPropertyNames,DS=Object.prototype.hasOwnProperty,Ci=(t,e)=>{for(var i in e)Sl(t,i,{get:e[i],enumerable:!0})},IS=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of SS(e))!DS.call(t,n)&&n!==i&&Sl(t,n,{get:()=>e[n],enumerable:!(s=_f(e,n))||s.enumerable});return t},AS=t=>IS(Sl({},"__esModule",{value:!0}),t),g=(t,e,i,s)=>{for(var n=s>1?void 0:s?_f(e,i):e,r=t.length-1,o;r>=0;r--)(o=t[r])&&(n=(s?o(e,i,n):o(n))||n);return s&&n&&Sl(e,i,n),n},jf={};Ci(jf,{AG_CHARTS_LOCALE_EN_US:()=>ny,AgCharts:()=>wn,AgChartsCommunityModule:()=>l1,AgErrorBarSupportedSeriesTypes:()=>Lw,AgTooltipAnchorToType:()=>og,AgTooltipPlacementType:()=>ag,AgTooltipPositionType:()=>lg,VERSION:()=>Fr,_ModuleSupport:()=>Av,_Scene:()=>xg,_Theme:()=>Sg,_Util:()=>Dg,_Widget:()=>kv,setupCommunityModules:()=>ng,time:()=>jy}),rs.exports=AS(jf);var Dl=(w(),k(T)),gi=(w(),k(T)),Il=class{constructor(){this.destroyFns=[]}destroy(){for(const t of this.destroyFns)t()}},LS=class{constructor(){this.modules=[],this.dependencies=new Map,this.modulesByOptionKey=new Map}register(...t){for(const e of t){this.registerDependencies(e);const i=this.modules.find(s=>e.type===s.type&&("optionsKey"in e&&"optionsKey"in s?e.optionsKey===s.optionsKey:!0)&&e.identifier===s.identifier);if(i){if(e.packageType==="enterprise"&&i.packageType==="community"){const s=this.modules.indexOf(i);this.modules.splice(s,1,e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}else this.modules.push(e),"optionsKey"in e&&this.modulesByOptionKey.set(e.optionsKey,e)}}hasEnterpriseModules(){return this.modules.some(t=>t.packageType==="enterprise")}*byType(...t){const e=new Set,i=this.modules.filter(r=>t.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(!e.has(o)){for(const a of s(o)){if(e.has(a))continue;const l=this.modulesByOptionKey.get(a);if(!l){n.push(a);continue}t.includes(l.type)&&(yield l,e.add(a))}yield r,e.add(o)}}if(n.length>0)throw new Error(`Could not resolve module dependencies: ${n}`)}registerDependencies(t){if(t.dependencies==null||t.dependencies.length===0)return;const e="optionsKey"in t?t.optionsKey:t.contextKey;this.dependencies.set(e,t.dependencies)}},ls=new LS,Ir=(w(),k(T)),Al={containsPoint:CS,isEmpty:NS,normalize:TS};function CS(t,e,i){return e>=t.x&&e<=t.x+t.width&&i>=t.y&&i<=t.y+t.height}function NS(t){return t==null||t.height===0||t.width===0||isNaN(t.height)||isNaN(t.width)}function TS(t){let{x:e,y:i,width:s,height:n}=t;return(s==null||s>0)&&(n==null||n>0)?t:(e!=null&&s!=null&&s<0&&(s=-s,e=e-s),i!=null&&n!=null&&n<0&&(n=-n,i=i-n),{x:e,y:i,width:s,height:n})}var Ll=Symbol("interpolate"),Cl=t=>t[Ll]!=null;function Nl(t,e,i,s=1/0){const n={nearest:void 0,distanceSquared:s};for(const r of i){const o=r.distanceSquared(t,e);if(o===0)return{nearest:r,distanceSquared:0};o<n.distanceSquared&&(n.nearest=r,n.distanceSquared=o)}return n}function kS(t,e,i,s=1/0){const{x:n=t,y:r=e}=i.transformPoint?.(t,e)??{},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 Go=class To{constructor(e,i,s,n){this.x=e,this.y=i,this.width=s,this.height=n}static fromDOMRect({x:e,y:i,width:s,height:n}){return new To(e,i,s,n)}static merge(e){let i=1/0,s=1/0,n=-1/0,r=-1/0;for(const o of e)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 To(i,s,n-i,r-s)}static nearestBox(e,i,s){return Nl(e,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:e,y:i,width:s,height:n}=this;return new To(e,i,s,n)}equals(e){return this.x===e.x&&this.y===e.y&&this.width===e.width&&this.height===e.height}containsPoint(e,i){return Al.containsPoint(this,e,i)}intersection(e){if(!this.collidesBBox(e))return;const i=(0,Ir.clamp)(e.x,this.x,e.x+e.width),s=(0,Ir.clamp)(e.y,this.y,e.y+e.height),n=(0,Ir.clamp)(e.x,this.x+this.width,e.x+e.width),r=(0,Ir.clamp)(e.y,this.y+this.height,e.y+e.height);return new To(i,s,n-i,r-s)}collidesBBox(e){return this.x<e.x+e.width&&this.x+this.width>e.x&&this.y<e.y+e.height&&this.y+this.height>e.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(e,i){if(this.containsPoint(e,i))return 0;const s=e-(0,Ir.clamp)(this.x,e,this.x+this.width),n=i-(0,Ir.clamp)(this.y,i,this.y+this.height);return s*s+n*n}shrink(e,i){if(typeof e=="number")this.applyMargin(e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(n,s)}return this.width<0&&(this.width=0),this.height<0&&(this.height=0),this}grow(e,i){if(typeof e=="number")this.applyMargin(-e,i);else for(const s of Object.keys(e)){const n=e[s];typeof n=="number"&&this.applyMargin(-n,s)}return this}applyMargin(e,i){switch(i){case"top":this.y+=e;case"bottom":this.height-=e;break;case"left":this.x+=e;case"right":this.width-=e;break;case"vertical":this.y+=e,this.height-=e*2;break;case"horizontal":this.x+=e,this.width-=e*2;break;case void 0:this.x+=e,this.y+=e,this.width-=e*2,this.height-=e*2;break}}translate(e,i){return this.x+=e,this.y+=i,this}[Ll](e,i){return new To(this.x*(1-i)+e.x*i,this.y*(1-i)+e.y*i,this.width*(1-i)+e.width*i,this.height*(1-i)+e.height*i)}};Go.zero=Object.freeze(new Go(0,0,0,0)),Go.NaN=Object.freeze(new Go(NaN,NaN,NaN,NaN));var B=Go,wS=(w(),k(T)),Ar=(w(),k(T)),ES=2e3,Ff=Date.now(),OS=()=>{const t=Date.now()-Ff;if(t>ES){const e=(Math.floor(t/100)/10).toFixed(1);Ar.Logger.log(`**** ${e}s since last log message ****`)}Ff=Date.now()},vt={create(...t){return Object.assign((...i)=>{vt.check(...t)&&(typeof i[0]=="function"&&(i=(0,Ar.toArray)(i[0]())),OS(),Ar.Logger.log(...i))},{check:()=>vt.check(...t),group:(i,s)=>vt.check(...t)?Ar.Logger.logGroup(i,s):s()})},check(...t){return t.length===0&&t.push(!0),(0,Ar.toArray)((0,Ar.getWindow)("agChartsDebug")).some(i=>t.includes(i))},inDevelopmentMode(t){if(vt.check("dev"))return t()}};function zf({context:t,pixelRatio:e,width:i,height:s}){t.save(),t.resetTransform(),t.clearRect(0,0,Math.ceil(i*e),Math.ceil(s*e)),t.restore()}function Bf(t){if(vt.check("canvas")){const e=t.save.bind(t),i=t.restore.bind(t);let s=0;Object.assign(t,{save(){e(),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 Gf(t,e,i){return[Math.floor(t*i),Math.floor(e*i)]}var tu=class{constructor(t){const{width:e,height:i,pixelRatio:s,willReadFrequently:n=!1}=t;this.width=e,this.height=i,this.pixelRatio=s;const[r,o]=Gf(e,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),Bf(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.canvas,e,i)}transferToImageBitmap(){return this.canvas.transferToImageBitmap()}resize(t,e,i){if(!(t>0&&e>0))return;const{canvas:s,context:n}=this;if(t!==this.width||e!==this.height||i!==this.pixelRatio){const[r,o]=Gf(t,e,i);s.width=r,s.height=o}n.setTransform(i,0,0,i,0,0),this.width=t,this.height=e,this.pixelRatio=i}clear(){zf(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)}},eu=(w(),k(T)),iu=new Map;function RS(){iu.clear()}function fi(t){const e=t.constructor,i=Object.hasOwn(e,"className")?e.className:e.name;if(!i)throw new Error(`The ${e} is missing the 'className' property.`);const s=(iu.get(i)??0)+1;return iu.set(i,s),`${i}-${s}`}function su(){return crypto.randomUUID?.()??PS()}function PS(){const t=new Uint8Array(16);crypto.getRandomValues(t),t[6]=t[6]&15|64,t[8]=t[8]&63|128;let e="";for(let i=0;i<t.length;i++)(i===4||i===6||i===8||i===10)&&(e+="-"),e+=t[i].toString(16).padStart(2,"0");return e}function G(t){return function(e,i){const s=`__${i}`;e[i]||_S(e,i,s,t)}}function _S(t,e,i,s){const{type:n="normal",changeCb:r,convertor:o,checkDirtyOnAssignment:a=!1}=s??{},l={type:n,changeCb:r,checkDirtyOnAssignment:a,convertor:o};let c;switch(n){case"normal":c=BS(i,l);break;case"transform":c=GS(i);break;case"path":c=VS(i);break}c=zS(i,FS(jS(c,l),l),l),Object.defineProperty(t,e,{set:c,get:function(){return this[i]},enumerable:!0,configurable:!0})}function jS(t,e){const{convertor:i}=e;return i?function(s){t.call(this,i(s))}:t}var Tl=Symbol("no-change");function FS(t,e){const{changeCb:i}=e;return i?function(s){const n=t.call(this,s);return n!==Tl&&i.call(this,this),n}:t}function zS(t,e,i){const{checkDirtyOnAssignment:s}=i;return s?function(n){const r=e.call(this,n);return n?._dirty===!0&&this.markDirty(t),r}:e}function BS(t,e){const{changeCb:i}=e;return function(s){const n=this[t];return s!==n?(this[t]=s,this.markDirty(t),i?.(this),s):Tl}}function GS(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this.markDirtyTransform(),e):Tl}}function VS(t){return function(e){const i=this[t];return e!==i?(this[t]=e,this._dirtyPath||(this._dirtyPath=!0,this.markDirty(t)),e):Tl}}var Vf=(t=>(t[t.All=0]="All",t[t.None=1]="None",t))(Vf||{}),Vo=class _g{constructor(e){this.serialNumber=_g._nextSerialNumber++,this.childNodeCounts={groups:0,nonGroups:0,thisComplexity:0,complexity:0},this.id=fi(this),this.pointerEvents=0,this._dirty=!0,this.dirtyZIndex=!1,this.isContainerNode=!1,this.visible=!0,this.zIndex=0,this.name=e?.name,this.tag=e?.tag??NaN,this.zIndex=e?.zIndex??0,(e?.debugDirty??_g._debugEnabled)&&(this._debugDirtyProperties=new Map([["__first__",[]]]))}static toSVG(e,i,s){const n=e?.toSVG();if(n==null||!n.elements.length&&!n.defs?.length)return;const r=(0,eu.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,eu.createSvgElement)("defs");o.append(...n.defs),r.append(o)}return r.append(...n.elements),r.outerHTML}static*extractBBoxes(e,i){for(const s of e)if(!i||s.visible&&!s.transitionOut){const n=s.getBBox();n&&(yield n)}}get datum(){return this._datum}set datum(e){this._datum!==e&&(this._previousDatum=this._datum,this._datum=e)}get previousDatum(){return this._previousDatum}get layerManager(){return this._layerManager}get dirty(){return this._dirty}closestDatum(){for(const{datum:e}of this.traverseUp(!0))if(e!=null)return e}preRender(e,i=1){this.childNodeCounts.groups=0,this.childNodeCounts.nonGroups=1,this.childNodeCounts.complexity=i,this.childNodeCounts.thisComplexity=i;for(const s of this.children()){const n=s.preRender(e);this.childNodeCounts.groups+=n.groups,this.childNodeCounts.nonGroups+=n.nonGroups,this.childNodeCounts.complexity+=n.complexity}return this.childNodeCounts}render(e){const{stats:i}=e;if(this._dirty=!1,this.debugDirtyProperties(),e.debugNodeSearch){const s=this.name??this.id;e.debugNodeSearch.some(n=>typeof n=="string"?n===s:n.test(s))&&(e.debugNodes[this.name??this.id]=this)}i&&(i.nodesRendered++,i.opsPerformed+=this.childNodeCounts.thisComplexity)}_setLayerManager(e){this._layerManager=e,this._debug=e?.debug;for(const i of this.children())i._setLayerManager(e)}sortChildren(e){if(this.dirtyZIndex=!1,!this.childNodes)return;const i=[...this.childNodes].sort(e);this.childNodes.clear();for(const s of i)this.childNodes.add(s)}*traverseUp(e){let i=this;for(e&&(yield i);i=i.parentNode;)yield i}*children(){if(this.childNodes)for(const e of this.childNodes)yield e}*descendants(){for(const e of this.children())yield e,yield*e.descendants()}isLeaf(){return!this.childNodes?.size}isRoot(){return!this.parentNode}append(e){this.childNodes??(this.childNodes=new Set);for(const i of(0,eu.toIterable)(e))i.parentNode?.removeChild(i),this.childNodes.add(i),i.parentNode=this,i._setLayerManager(this.layerManager);this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}appendChild(e){return this.append(e),e}removeChild(e){if(!this.childNodes?.delete(e))throw new Error(`AG Charts - internal error, unknown child node ${e.name??e.id} in $${this.name??this.id}`);delete e.parentNode,e._setLayerManager(),this.invalidateCachedBBox(),this.dirtyZIndex=!0,this.markDirty()}remove(){this.parentNode?.removeChild(this)}clear(){for(const e of this.children())delete e.parentNode,e._setLayerManager();this.childNodes?.clear(),this.invalidateCachedBBox()}destroy(){this.parentNode?.removeChild(this)}setProperties(e,i){if(i)for(const s of i)this[s]=e[s];else Object.assign(this,e);return this}containsPoint(e,i){return!1}pickNode(e,i){if(!(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))){if(this.childNodes!=null&&this.childNodes.size!==0){const s=[...this.children()];for(let n=s.length-1;n>=0;n--){const r=s[n].pickNode(e,i);if(r)return r}}else if(!this.isContainerNode)return this}}pickNodes(e,i,s=[]){if(!this.visible||this.pointerEvents===1||!this.containsPoint(e,i))return s;this.isContainerNode||s.push(this);for(const n of this.children())n.pickNodes(e,i,s);return s}invalidateCachedBBox(){this.cachedBBox!=null&&(this.cachedBBox=void 0,this.parentNode?.invalidateCachedBBox())}getBBox(){return this.cachedBBox==null&&(this.cachedBBox=Object.freeze(this.computeBBox())),this.cachedBBox}computeBBox(){}markDirty(e){const{_dirty:i}=this;e!=null&&this._debugDirtyProperties&&this.markDebugProperties(e),!(this.cachedBBox==null&&i)&&(this.invalidateCachedBBox(),this._dirty=!0,this.parentNode&&this.parentNode.markDirty())}markClean(){if(this._dirty){this._dirty=!1,this.debugDirtyProperties();for(const e of this.children())e.markClean()}}markDebugProperties(e){const i=this._debugDirtyProperties?.get(e)??[],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(e,i)}debugDirtyProperties(){this._debugDirtyProperties!=null&&(this._debugDirtyProperties.has("__first__")||this._debugDirtyProperties.forEach((e,i)=>{e.length>1&&(console.groupCollapsed(`Property changed multiple times before render: ${this.constructor.name}.${i} (${e.length}x)`),e.forEach(s=>console.log(s)),console.groupEnd())}),this._debugDirtyProperties.clear())}onZIndexChange(){const{parentNode:e}=this;e&&(e.dirtyZIndex=!0)}toSVG(){}};Vo._nextSerialNumber=0,Vo._debugEnabled=!1,g([G()],Vo.prototype,"visible",2),g([G({changeCb:t=>t.onZIndexChange()})],Vo.prototype,"zIndex",2);var As=Vo,US=(w(),k(T)),mi=(w(),k(T)),kl=Symbol("BREAK"),Lr="__decorator_config";function YS(t,e){nu(t,e).optional=!0}function nu(t,e){Object.getOwnPropertyDescriptor(t,Lr)==null&&Object.defineProperty(t,Lr,{value:{}});const i=t[Lr],s=e.toString();if(typeof i[s]<"u")return i[s];const n=new WeakMap;i[s]={setters:[],getters:[],observers:[],valuesMap:n};const r=Object.getOwnPropertyDescriptor(t,e),o=r?.set,a=r?.get;return Object.defineProperty(t,e,{set:function(h){const{setters:u,observers:d}=i[s];let p;u.some(f=>f.length>2)&&(p=a?a.call(this):n.get(this));for(const f of u)if(h=f(this,e,h,p),h===kl)return;o?o.call(this,h):n.set(this,h);for(const f of d)f(this,h,p)},get:function(){let h=a?a.call(this):n.get(this);for(const u of i[s].getters)if(h=u(this,e,h),h===kl)return;return h},enumerable:!0,configurable:!1}),i[s]}function Ls(t,e,i){return(s,n)=>{const r=nu(s,n);r.setters.push(t),e&&r.getters.unshift(e),i&&Object.assign(r,i)}}function Uf(t){return(e,i)=>{nu(e,i).observers.push(t)}}function Uo(t){return typeof t<"u"&&Lr in t}function rn(t){const e=new Set;for(;Uo(t);)e.add(t?.[Lr]),t=Object.getPrototypeOf(t);return Array.from(e).flatMap(i=>Object.keys(i))}function Yf(t){return rn(t).reduce((e,i)=>(e[i]=t[i]??null,e),{})}function WS(t,e){const i=e.toString();for(;Uo(t);){const s=t[Lr];if(Object.hasOwn(s,i))return s[i];t=Object.getPrototypeOf(t)}}function cs(t,e){return Array.isArray(t)?!Array.isArray(e)||t.length!==e.length?!1:t.every((i,s)=>cs(i,e[s])):(0,mi.isPlainObject)(t)?(0,mi.isPlainObject)(e)?ru(t,e,cs):!1:t===e}function ru(t,e,i){for(const s of Object.keys(e))if(!(s in t))return!1;for(const s of Object.keys(t))if(!(s in e)||!i(t[s],e[s]))return!1;return!0}function gt(...t){const e={};for(const i of t){if(!(0,mi.isObject)(i))continue;const s=Uo(i)?rn(i):Object.keys(i);for(const n of s)(0,mi.isPlainObject)(e[n])&&(0,mi.isPlainObject)(i[n])?e[n]=gt(e[n],i[n]):e[n]??(e[n]=i[n])}return e}function Yo(...t){const e={};for(const i of t){if(!(0,mi.isObject)(i))continue;const s=Uo(i)?rn(i):Object.keys(i);for(const n of s)(0,mi.isPlainObject)(e[n])&&(0,mi.isPlainObject)(i[n])?e[n]=Yo(e[n],i[n]):n in e||(e[n]??(e[n]=i[n]))}return e}function wl(t,...e){return e&&(0,mi.isArray)(t)?t.map(i=>gt(i,...e)):t}function Wf(t,e){const i={};for(const[s,n]of(0,mi.entries)(t))i[s]=e(n,s,t);return i}function on(t,e){const i={...t};for(const s of e)delete i[s];return i}function Cr(t,e){return((0,mi.isArray)(e)?e:e.split(".")).reduce((s,n)=>s[n],t)}var ou=new Set(["__proto__","constructor","prototype"]);function au(t,e,i){const s=(0,mi.isArray)(e)?e.slice():e.split("."),n=s.pop();if(s.some(o=>ou.has(o)))return;const r=s.reduce((o,a)=>o[a],t);return r[n]=i,r[n]}function lu(t,e,i){if(i===void 0)return e;for(const s of t){const n=i[s];n!==void 0&&(e[s]=n)}return e}function jn(t){return t==null||typeof t!="object"||!(0,mi.isPlainObject)(t)||(Object.freeze(t),Object.getOwnPropertyNames(t).forEach(e=>{const i=t[e];i!==null&&(typeof i=="object"||typeof i=="function")&&!Object.isFrozen(i)&&jn(i)})),t}var $S=(w(),k(T)),Ni=Math.PI*2,Wo=Math.PI/2;function Pt(t){return t%=Ni,t+=Ni,t%=Ni,t}function HS(t){return t%=Ni,t+=Ni,t!==Ni&&(t%=Ni),t}function $o(t){return t%=Ni,t<-Math.PI?t+=Ni:t>=Math.PI&&(t-=Ni),t}function an(t,e,i){const s=Pt(t),n=Pt(e),r=Pt(i);return n<r?n<=s&&s<=r:n>r?n<=s||s<=r:!0}function zt(t){return t/180*Math.PI}function KS(t){return t/Math.PI*180}function El(t,e){return t=Pt(t),e=Pt(e),e-t+(t>e?Ni:0)}function $f(t){const e=Pt(t);return e<=Wo?e/Wo:e<=Math.PI?(Math.PI-e)/Wo:e<=1.5*Math.PI?(e-Math.PI)/Wo:(Ni-e)/Wo}var ZS=(w(),k(T)),Ol=(w(),k(T)),Cs=(w(),k(T)),Fn=(t,e,i)=>t*(1-i)+e*i,cu=t=>{const e=t<0?-1:1,i=Math.abs(t);return i<=.04045?t/12.92:e*((i+.055)/1.055)**2.4},hu=t=>{const e=t<0?-1:1,i=Math.abs(t);return i>.0031308?e*(1.055*i**(1/2.4)-.055):12.92*t},Hf=class St{constructor(e,i,s,n=1){this.r=(0,Cs.clamp)(0,e||0,1),this.g=(0,Cs.clamp)(0,i||0,1),this.b=(0,Cs.clamp)(0,s||0,1),this.a=(0,Cs.clamp)(0,n||0,1)}static validColorString(e){return e.indexOf("#")>=0?!!St.parseHex(e):e.indexOf("rgb")>=0?!!St.stringToRgba(e):St.nameToHex.has(e.toLowerCase())}static fromString(e){if(e.indexOf("#")>=0)return St.fromHexString(e);const i=St.nameToHex.get(e.toLowerCase());if(i)return St.fromHexString(i);if(e.indexOf("rgb")>=0)return St.fromRgbaString(e);throw new Error(`Invalid color string: '${e}'`)}static parseHex(e){e=e.replace(/ /g,"").slice(1);let i;switch(e.length){case 6:case 8:i=[];for(let s=0;s<e.length;s+=2)i.push(parseInt(`${e[s]}${e[s+1]}`,16));break;case 3:case 4:i=e.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(e){const i=St.parseHex(e);if(i){const[s,n,r,o]=i;return new St(s/255,n/255,r/255,o/255)}throw new Error(`Malformed hexadecimal color string: '${e}'`)}static stringToRgba(e){let i=-1,s=-1;for(let a=0;a<e.length;a++){const l=e[a];if(i===-1&&l==="(")i=a;else if(l===")"){s=a;break}}if(i===-1||s===-1)return;const r=e.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,Cs.clamp)(0,c,100),c/=100):a===3?c=(0,Cs.clamp)(0,c,1):(c=(0,Cs.clamp)(0,c,255),c/=255),o.push(c)}return o}static fromRgbaString(e){const i=St.stringToRgba(e);if(i){if(i.length===3)return new St(i[0],i[1],i[2]);if(i.length===4)return new St(i[0],i[1],i[2],i[3])}throw new Error(`Malformed rgb/rgba color string: '${e}'`)}static fromArray(e){if(e.length===4)return new St(e[0],e[1],e[2],e[3]);if(e.length===3)return new St(e[0],e[1],e[2]);throw new Error("The given array should contain 3 or 4 color components (numbers).")}static fromHSB(e,i,s,n=1){const r=St.HSBtoRGB(e,i,s);return new St(r[0],r[1],r[2],n)}static fromHSL(e,i,s,n=1){const r=St.HSLtoRGB(e,i,s);return new St(r[0],r[1],r[2],n)}static fromOKLCH(e,i,s,n=1){const r=St.OKLCHtoRGB(e,i,s);return new St(r[0],r[1],r[2],n)}static padHex(e){return e.length===1?"0"+e:e}toHexString(){let e="#"+St.padHex(Math.round(this.r*255).toString(16))+St.padHex(Math.round(this.g*255).toString(16))+St.padHex(Math.round(this.b*255).toString(16));return this.a<1&&(e+=St.padHex(Math.round(this.a*255).toString(16))),e}toRgbaString(e=3){const i=[Math.round(this.r*255),Math.round(this.g*255),Math.round(this.b*255)],s=Math.pow(10,e);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 St.RGBtoHSB(this.r,this.g,this.b)}static RGBtoOKLCH(e,i,s){const n=cu(e),r=cu(i),o=cu(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,f=h,y=Math.hypot(u,d),x=p>=0?p:p+360;return[f,y,x]}static OKLCHtoRGB(e,i,s){const n=e,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=hu(h),f=hu(u),y=hu(d);return[p,f,y]}static RGBtoHSL(e,i,s){const n=Math.min(e,i,s),r=Math.max(e,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===e?a=(i-s)/c+(i<s?6:0):r===i?a=(s-e)/c+2:a=(e-i)/c+4,a*=360/6}return[a,l,o]}static HSLtoRGB(e,i,s){if(e=(e%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(e/360+1/3),l=o(e/360),c=o(e/360-1/3);return[a,l,c]}static RGBtoHSB(e,i,s){const n=Math.min(e,i,s),r=Math.max(e,i,s),o=r===0?0:(r-n)/r;let a=0;if(n!==r){const l=r-n,c=(r-e)/l,h=(r-i)/l,u=(r-s)/l;e===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(e,i,s){e=(e%360+360)%360/360;let n=0,r=0,o=0;if(i===0)n=r=o=s;else{const a=(e-Math.floor(e))*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(e,i,s){return new St(Fn(e.r,i.r,s),Fn(e.g,i.g,s),Fn(e.b,i.b,s),Fn(e.a,i.a,s))}static lighten(e,i){const s=St.RGBtoOKLCH(e.r,e.g,e.b);return St.fromOKLCH((0,Cs.clamp)(0,s[0]+i,1),s[1],s[2])}static darken(e,i){const s=St.RGBtoOKLCH(e.r,e.g,e.b);return St.fromOKLCH((0,Cs.clamp)(0,s[0]-i,1),s[1],s[2])}static interpolate(e,i){const s=1/(e.length-1),n=e.map(r=>St.RGBtoOKLCH(r.r,r.g,r.b));return Array.from({length:i},(r,o)=>{const a=o/(i-1),l=e.length<=2?0:Math.min(Math.floor(a*(e.length-1)),e.length-2),c=(a-l*s)/s,h=n[l],u=n[l+1];return St.fromOKLCH(Fn(h[0],u[0],c),Fn(h[1],u[1],c),Fn(h[2],u[2],c))})}};Hf.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 Dt=Hf,Rl=class{ticks(t,e,i){}niceDomain(t,e=this.domain){return e}tickFormatter(t){}datumFormatter(t){}get bandwidth(){}get step(){}get inset(){}},Nr=(t,e)=>{const i=Symbol(String(e));t[i]=void 0,Object.defineProperty(t,e,{get(){return this[i]},set(s){this[i]!==s&&(this[i]=s,this.invalid=!0)},enumerable:!0,configurable:!1})},Kf=t=>{const e=Dt.fromString(t),[i,s,n]=Dt.RGBtoOKLCH(e.r,e.g,e.b);return{l:i,c:s,h:n,a:e.a}},uu=1e-6,Zf=t=>t.c<uu||t.l<uu||t.l>1-uu,XS=(t,e,i)=>{i=(0,Ol.clamp)(0,i,1);let s;if(Zf(t))s=e.h;else if(Zf(e))s=t.h;else{const a=t.h;let l=e.h;const c=e.h-t.h;c>180?l-=360:c<-180&&(l+=360),s=a*(1-i)+l*i}const n=t.c*(1-i)+e.c*i,r=t.l*(1-i)+e.l*i,o=t.a*(1-i)+e.a*i;return Dt.fromOKLCH(r,n,s,o)},Tr=class extends Rl{constructor(){super(...arguments),this.type="color",this.invalid=!0,this.domain=[0,1],this.range=["red","blue"],this.parsedRange=this.range.map(Kf)}update(){const{domain:t,range:e}=this;t.length<2&&(Ol.Logger.warnOnce("`colorDomain` should have at least 2 values."),t.length===0?t.push(0,1):t.length===1&&t.push(t[0]+1));for(let i=1;i<t.length;i++){const s=t[i-1],n=t[i];if(s>=n){Ol.Logger.warnOnce("`colorDomain` values should be supplied in ascending order."),t.sort((r,o)=>r-o);break}}if(e.length<t.length)for(let i=e.length;i<t.length;i++)e.push(e.length>0?e[0]:"black");this.parsedRange=this.range.map(Kf)}normalizeDomains(...t){return{domain:t.flat(),animatable:!0}}toDomain(){}convert(t){this.refresh();const{domain:e,range:i,parsedRange:s}=this,n=e[0],r=e.at(-1),o=i[0],a=i[i.length-1];if(t<=n)return o;if(t>=r)return a;let l,c;if(e.length===2){const d=(t-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<e.length-2&&!(t<e[l+1]);l++);const d=e[l],p=e[l+1];c=(t-d)/(p-d)}const h=s[l],u=s[l+1];return XS(h,u,c).toRgbaString()}invert(){}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&Ol.Logger.warnOnce("Expected update to not invalidate scale"))}};g([Nr],Tr.prototype,"domain",2),g([Nr],Tr.prototype,"range",2);var Pl=class{constructor(t,e=[],i){this.colorSpace=t,this.stops=e,this.bbox=i,this._cache=void 0}createGradient(t,e,i){const s=this.bbox??e;if(isNaN(s.x)||isNaN(s.y))return;if(this._cache!=null&&this._cache.ctx===t&&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(t,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 Tr;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:t,bbox:s,gradient:o},o}toSvg(t){const e=this.bbox??t,i=this.createSvgGradient(e);return this.stops.forEach(({stop:s,color:n})=>{const r=(0,ZS.createSvgElement)("stop");r.setAttribute("offset",`${s}`),r.setAttribute("stop-color",`${n}`),i.appendChild(r)}),i}},Xf=class extends Pl{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}createCanvasGradient(t,e,i){const{angle:n}=this,r=Pt(zt(n+-90)),o=i?.centerX??e.x+e.width*.5,a=i?.centerY??e.y+e.height*.5;return t.createConicGradient(r,o,a)}createSvgGradient(t){return(0,$S.createSvgElement)("linearGradient")}},qS=(w(),k(T)),qf=class extends Pl{constructor(t,e,i=0,s){super(t,e,s),this.angle=i}getGradientPoints(t){const{angle:i}=this,s=Pt(zt(i+90)),n=Math.cos(s),r=Math.sin(s),o=t.width,a=t.height,l=t.x+o*.5,c=t.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(t,e){const{x0:i,y0:s,x1:n,y1:r}=this.getGradientPoints(e);return t.createLinearGradient(i,s,n,r)}createSvgGradient(t){const{x0:e,y0:i,x1:s,y1:n}=this.getGradientPoints(t),r=(0,qS.createSvgElement)("linearGradient");return r.setAttribute("x1",String(e)),r.setAttribute("y1",String(i)),r.setAttribute("x2",String(s)),r.setAttribute("y2",String(n)),r.setAttribute("gradientUnits","userSpaceOnUse"),r}},QS=(w(),k(T)),JS=class extends Pl{constructor(t,e,i){super(t,e,i)}createCanvasGradient(t,e,i){const s=i?.centerX??e.x+e.width*.5,n=i?.centerY??e.y+e.height*.5,r=i?.innerRadius??0,o=i?.outerRadius??Math.hypot(e.width*.5,e.height*.5)/Math.SQRT2;return t.createRadialGradient(s,n,r,s,n,o)}createSvgGradient(t){const e=t.x+t.width*.5,i=t.y+t.height*.5,s=(0,QS.createSvgElement)("radialGradient");return s.setAttribute("cx",String(e)),s.setAttribute("cy",String(i)),s.setAttribute("r",String(Math.hypot(t.width*.5,t.height*.5)/Math.SQRT2)),s.setAttribute("gradientUnits","userSpaceOnUse"),s}},tD=(w(),k(T)),kr=(w(),k(T)),nt=class{handleUnknownProperties(t,e){}set(t){const{className:e=this.constructor.name}=this.constructor;if(typeof t!="object")return kr.Logger.warn(`unable to set ${e} - expecting a properties object`),this;const i=new Set(Object.keys(t));for(const s of rn(this))if(i.has(s)){const n=t[s],r=this;if(Ti(r[s]))if(r[s]instanceof Ho){const o=r[s].reset(n);o!=null?r[s]=o:kr.Logger.warn(`unable to set [${s}] - expecting a properties array`)}else r[s].set(n);else(0,kr.isPlainObject)(n)?r[s]=Yo(n,r[s]??{}):r[s]=n;i.delete(s)}this.handleUnknownProperties(i,t);for(const s of i)kr.Logger.warn(`unable to set [${s}] in ${e} - property is unknown`);return this}isValid(t){return rn(this).every(e=>{const i=WS(this,e);if(i==null)return!0;const s=i.optional===!0||typeof this[e]<"u";return s||kr.Logger.warnOnce(`${t??""}[${e}] is required.`),s})}toJson(){return rn(this).reduce((t,e)=>{const i=this[e];return t[e]=Ti(i)?i.toJson():i,t},{})}},Ho=class Fv extends Array{constructor(e,...i){super(i.length);const n=(r=>!!r?.prototype?.constructor?.name)(e)?r=>new e().set(r):e;Object.defineProperty(this,"itemFactory",{value:n,enumerable:!1,configurable:!1}),this.set(i)}set(e){if((0,kr.isArray)(e)){this.length=e.length;for(let i=0;i<e.length;i++)this[i]=this.itemFactory(e[i])}return this}reset(e){if(Array.isArray(e))return new Fv(this.itemFactory,...e)}toJson(){return this.map(e=>e?.toJson?.()??e)}};function Ti(t){return t instanceof nt||t instanceof Ho}var Tt=(w(),k(T));function eD(t,e={}){const{optional:i=!1}=e;return Ls((s,n,r)=>{const o={...e,target:s,property:n};if(i&&typeof r>"u"||t(r,o))return Ti(s[n])&&!Ti(r)?(s[n].set(r),s[n]):r;const a=(0,Tt.stringifyValue)(r,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${wr(t,o)}`:"";return Tt.Logger.warn(`Property [${l}] of [${c}] cannot be set to [${a}]${h}, ignoring.`),kl},void 0,{optional:i})}var iD=!1,b=iD?(t,e={})=>{const{optional:i=!1}=e;return Ls((s,n,r)=>{const o={...e,target:s,property:n};if(i&&typeof r>"u"||t(r,o)){if(Ti(s[n])&&!Ti(r))return s[n].set(r),s[n]}else{const a=(0,Tt.stringifyValue)(r,50),l=String(n).replace(/^_*/,""),c=s.constructor.className??s.constructor.name.replace(/Properties$/,""),h=t.message?`; expecting ${wr(t,o)}`:"";Tt.Logger.warn(`TempValidation!!! Property [${l}] of [${c}] cannot be set to [${a}]${h}, ignoring.`)}return r},void 0,{optional:i})}:()=>YS,ln=(...t)=>{const e=[];return Lt((i,s)=>(e.length=0,t.every(n=>{const r=n(i,s);return r||e.push(wr(n,s)),r})),()=>e.filter(Boolean).join(" AND "))},we=(...t)=>Lt((e,i)=>t.some(s=>s(e,i)),e=>t.map(dD(e)).filter(Boolean).join(" OR ")),F=Ul(Lt((t,e)=>Ti(t)||(0,Tt.isObject)(t)&&Ti(e.target[e.property]),"a properties object")),Qf=Ul(Lt(t=>(0,Tt.isObject)(t),"an object")),H=Lt(Tt.isBoolean,"a boolean"),Ze=Lt(Tt.isFunction,"a function"),O=Lt(Tt.isString,"a string"),ct=gD(Lt(Tt.isFiniteNumber,"a number")),Jf=Lt(t=>(0,Tt.isNumber)(t)&&!isNaN(t),"a real number"),_l=Lt(t=>(0,Tt.isNumber)(t)&&isNaN(t),"NaN"),j=ct.restrict({min:0}),It=ct.restrict({min:0,max:1}),jl=we(ct,_l),zn=pD(Lt(Tt.isArray,"an array")),ge=(t,e)=>Lt((i,s)=>(0,Tt.isArray)(i)&&i.every(n=>t(n,s)),i=>{const s=wr(zn,i)??"";return typeof e=="function"?`${s} of ${e(i)}`:e?`${s} of ${e}`:s}),Fl=t=>(0,Tt.isFiniteNumber)(t)||(0,Tt.isValidDate)(t),zl=t=>Lt((e,i)=>!Fl(e)||!Fl(i.target[t])||e<i.target[t],`to be less than ${t}`),Bl=t=>Lt((e,i)=>!Fl(e)||!Fl(i.target[t])||e>i.target[t],`to be greater than ${t}`),du=Lt(Tt.isValidDate,"Date object"),pu=we(du,j),tm="A color string can be in one of the following formats to be valid: #rgb, #rrggbb, rgb(r, g, b), rgba(r, g, b, a) or a CSS color name such as 'white', 'orange', 'cyan', etc",dt=Lt(Tt.isColor,`color string. ${tm}`),hs=Ul(Lt(t=>(0,Tt.isObject)(t)&&t.type==="gradient","a color gradient object")),us=Ul(Lt(t=>(0,Tt.isObject)(t)&&t.type==="pattern","a color pattern object")),cn=Lt(ge(dt),`color strings. ${tm}`),sD=ge(H,"boolean values"),em=ge(ct,"numbers"),im=ge(O,"strings"),nD=Lt(ge(du),"Date objects"),gu=Lt(ge(F),"objects"),rD=At(["butt","round","square"],"a line cap"),oD=At(["round","bevel","miter"],"a line join"),aD=At(["solid","dashed","dotted"],"a line style"),ds=Lt(ge(j),"numbers specifying the length in pixels of alternating dashes and gaps, for example, [6, 3] means dashes with a length of 6 pixels with gaps between of 3 pixels."),fu=At(["top","right","bottom","left"],"a position"),Ns=At(["normal","italic","oblique"],"a font style"),Ts=we(At(["normal","bold","bolder","lighter"],"a font weight"),ct.restrict({min:1,max:1e3})),Gl=At(["never","always","hyphenate","on-space"],"a text wrap strategy"),sm=At(["left","center","right"],"a text align"),lD=At(["top","middle","bottom"],"a vertical align"),cD=At(["ellipsis","hide"],"an overflow strategy"),nm=At(["horizontal","vertical"],"a direction"),hD=At(["inside","outside"],"a placement"),Vl=we(At(["exact","nearest"],"interaction range"),ct),mu=At(["top","bottom","left","right"]);function At(t,e="a"){return Lt((i,s)=>{const n=t.find(r=>{const o=typeof r=="string"?r:r.value;return i===o});if(n==null)return!1;if(typeof n!="string"&&(n.deprecated===!0||n.deprecatedTo!=null)){const r=[`Property [%s] with value '${n.value}' is deprecated.`];n.deprecatedTo&&r.push(`Use ${n.deprecatedTo} instead.`),Tt.Logger.warnOnce(r.join(" "),s.property)}return!0},`${e} keyword such as ${uD(t)}`)}var rm=we(ln(ct.restrict({min:1}),zl("maxSpacing")),_l),om=we(ln(ct.restrict({min:1}),Bl("minSpacing")),_l);function Lt(t,e){return t.message=e,t}function uD(t){const e=t.filter(s=>typeof s=="string"||s.undocumented!==!0).map(s=>`'${typeof s=="string"?s:s.value}'`);if(e.length===1)return e[0];const i=e.pop();return`${e.join(", ")} or ${i}`}function wr(t,e){return(0,Tt.isFunction)(t.message)?t.message(e):t.message}function dD(t){return e=>wr(e,t)}function pD(t){return Object.assign(t,{restrict({length:e,minLength:i}={}){let s="an array";return(0,Tt.isNumber)(i)&&i>0?s="a non-empty array":(0,Tt.isNumber)(e)&&(s=`an array of length ${e}`),Lt(n=>(0,Tt.isArray)(n)&&((0,Tt.isNumber)(e)?n.length===e:!0)&&((0,Tt.isNumber)(i)?n.length>=i:!0),s)}})}function gD(t){return Object.assign(t,{restrict({min:e,max:i}={}){const s=["a number"],n=(0,Tt.isNumber)(e),r=(0,Tt.isNumber)(i);return n&&r?s.push(`between ${e} and ${i} inclusive`):n?s.push(`greater than or equal to ${e}`):r&&s.push(`less than or equal to ${i}`),Lt(o=>(0,Tt.isFiniteNumber)(o)&&(n?o>=e:!0)&&(r?o<=i:!0),s.join(" "))}})}function Ul(t){return Object.assign(t,{restrict(e){return Lt(i=>i instanceof e,i=>wr(t,i)??`an instance of ${e.name}`)}})}var yu=class extends nt{constructor(){super(...arguments),this.color="black"}};g([b(ct,{optional:!0})],yu.prototype,"stop",2),g([b(dt,{optional:!0})],yu.prototype,"color",2);function fD(t){let e;for(const i of t)if(i?.stop!=null){if(e!=null&&i.stop<e)return!1;e=i.stop}return!0}function am(t){return t.flatMap((e,i)=>{const{stop:s}=e,n=t.at(i+1)?.color;return n!=null?[e,{stop:s,color:n}]:[e]})}function mD(t,e){const i=e==="discrete"?1:0,s=t.map((n,r,{length:o})=>({stop:(r+i)/(o-1+i),color:n}));return e==="discrete"?am(s):s}function lm(t,e,i,s="continuous"){const n=t.map(f=>typeof f=="string"?{color:f}:f);if(n.length===0)return mD(e,s);if(!fD(n))return tD.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 f=0;f<n.length;f+=1){const y=n[f];if(f>=h){h=n.length-1;for(let m=f+1;m<n.length;m+=1)if(n[m]?.stop!=null){h=m;break}}let x=y?.stop;if(x==null){const m=n[c]?.stop,v=n[h]?.stop,S=m??r,M=v??o,D=a&&m==null?1:0;x=S+(M-S)*(f-c+D)/(h-c+D)}else c=f;l[f]=Math.max(0,Math.min(1,(x-r)/(o-r)))}let u=n.find(f=>f.color!=null)?.color,d;const p=n.map((f,y)=>{let x=f?.color;const m=l[y];return x!=null?u=x:u!=null?x=u:(d==null&&(d=new Tr,d.domain=[0,1],d.range=e),x=d.convert(m)),{stop:m,color:x}});return s==="discrete"?am(p):p}var bu=(w(),k(T)),yD=(w(),k(T));function Ko(t,e,i,s){const n=t-i,r=e-s;return n*n+r*r}function Zo(t,e,i,s,n,r,o){if(i===n&&s===r)return Math.min(o,Ko(t,e,i,s));const a=n-i,l=r-s,c=Math.max(0,Math.min(1,((t-i)*a+(e-s)*l)/(a*a+l*l))),h=i+c*a,u=s+c*l;return Math.min(o,Ko(t,e,h,u))}function bD(t,e,i,s,n,r,o,a,l){a&&([o,r]=[r,o]);const c=Math.atan2(e-s,t-i);if(!an(c,r,o)){const u=i+Math.cos(r)*n,d=s+Math.sin(r)*n,p=i+Math.cos(r)*n,f=s+Math.sin(r)*n;return Math.min(l,Ko(t,e,u,d),Ko(t,e,p,f))}const h=n-Math.sqrt(Ko(t,e,i,s));return Math.min(l,h*h)}function xD(t,e){const i=-e/t;return t!==0&&i>=0&&i<=1?[i]:[]}function vD(t,e,i){if(t===0)return xD(e,i);const s=e*e-4*t*i,n=[];if(s===0){const r=-e/(2*t);r>=0&&r<=1&&n.push(r)}else if(s>0){const r=Math.sqrt(s),o=(-e-r)/(2*t),a=(-e+r)/(2*t);o>=0&&o<=1&&n.push(o),a>=0&&a<=1&&n.push(a)}return n}function MD(t,e,i,s){if(t===0)return vD(e,i,s);const n=e/t,r=i/t,o=s/t,a=(3*r-n*n)/9,l=(9*n*r-27*o-2*n*n*n)/54,c=a*a*a+l*l,h=1/3,u=[];if(c>=0){const d=Math.sqrt(c),p=Math.sign(l+d)*Math.pow(Math.abs(l+d),h),f=Math.sign(l-d)*Math.pow(Math.abs(l-d),h),y=Math.abs(Math.sqrt(3)*(p-f)/2),x=-h*n+(p+f);if(x>=0&&x<=1&&u.push(x),y===0){const m=-h*n-(p+f)/2;m>=0&&m<=1&&u.push(m)}}else{const d=Math.acos(l/Math.sqrt(-a*a*a)),p=h*n,f=2*Math.sqrt(-a),y=f*Math.cos(h*d)-p,x=f*Math.cos(h*(d+2*Math.PI))-p,m=f*Math.cos(h*(d+4*Math.PI))-p;y>=0&&y<=1&&u.push(y),x>=0&&x<=1&&u.push(x),m>=0&&m<=1&&u.push(m)}return u}function Er(t,e,i,s,n,r,o,a){const l=(i-t)*(a-r)-(s-e)*(o-n);if(l===0)return 0;const c=((o-n)*(e-r)-(t-n)*(a-r))/l,h=((i-t)*(e-r)-(s-e)*(t-n))/l;return c>=0&&c<=1&&h>=0&&h<=1?1:0}function SD(t,e,i,s,n,r,o,a,l,c,h,u){let d=0;const p=c-u,f=h-l,y=l*(u-c)-c*(h-l),x=cm(t,i,n,o),m=cm(e,s,r,a),v=p*x[0]+f*m[0],S=p*x[1]+f*m[1],M=p*x[2]+f*m[2],D=p*x[3]+f*m[3]+y,C=MD(v,S,M,D);for(const L of C){const I=L*L,N=L*I,E=x[0]*N+x[1]*I+x[2]*L+x[3],R=m[0]*N+m[1]*I+m[2]*L+m[3];let z;l===h?z=(R-c)/(u-c):z=(E-l)/(h-l),z>=0&&z<=1&&d++}return d}function cm(t,e,i,s){return[-t+3*e-3*i+s,3*t-6*e+3*i,-3*t+3*e,t]}function hm(t,e,i,s,n,r,o,a,l,c){if(isNaN(t)||isNaN(e))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-e)-t),f=Math.pow(t,2)+Math.pow(u-e,2)-Math.pow(i,2),y=Math.pow(p,2)-4*d*f;if(y<0)return 0;const x=(-p+Math.sqrt(y))/2/d,m=(-p-Math.sqrt(y))/2/d;let v=0;return[x,m].forEach(S=>{if(!(S>=Math.min(o,l)&&S<=Math.max(o,l)))return;const D=h*S+u,C=S-t,L=D-e,I=Math.atan2(L,C);an(I,s,n)&&v++}),v}function Yl(t,e,i,s,n){return(1-n)**3*t+3*(1-n)**2*n*e+3*(1-n)*n**2*i+n**3*s}function Wl(t,e,i,s,n){if(n<=Math.min(t,s))return t<s?0:1;if(n>=Math.max(t,s))return t<s?1:0;let r=0,o=1,a=NaN;for(let l=0;l<12;l+=1)a=(r+o)/2,Yl(t,e,i,s,a)<n?r=a:o=a;return a}function $l(t,e,i,s,n,r,o,a,l){const c=(1-l)*t+l*i,h=(1-l)*e+l*s,u=(1-l)*i+l*n,d=(1-l)*s+l*r,p=(1-l)*n+l*o,f=(1-l)*r+l*a,y=(1-l)*c+l*u,x=(1-l)*h+l*d,m=(1-l)*u+l*p,v=(1-l)*d+l*f,S=(1-l)*y+l*m,M=(1-l)*x+l*v;return[[{x:t,y:e},{x:c,y:h},{x:y,y:x},{x:S,y:M}],[{x:S,y:M},{x:m,y:v},{x:p,y:f},{x:o,y:a}]]}function xu(t,e,i,s){const n=-t+3*e-3*i+s,r=3*t-6*e+3*i,o=-3*t+3*e;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 um(t,e,i,s,n,r,o,a){const l=xu(t,i,n,o),c=xu(e,s,r,a);return[...l,...c]}var Or=class{constructor(){this.path2d=new Path2D,this.previousCommands=[],this.previousParams=[],this.previousClosedPath=!1,this.commands=[],this.params=[],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(t,e){this.openedPath=!0,this.path2d.moveTo(t,e),this.commands.push(0),this.params.push(t,e)}lineTo(t,e){this.openedPath?(this.path2d.lineTo(t,e),this.commands.push(1),this.params.push(t,e)):this.moveTo(t,e)}rect(t,e,i,s){this.moveTo(t,e),this.lineTo(t+i,e),this.lineTo(t+i,e+s),this.lineTo(t,e+s),this.closePath()}roundRect(t,e,i,s,n){n=Math.min(n,i/2,s/2),this.moveTo(t,e+n),this.arc(t+n,e+n,n,Math.PI,1.5*Math.PI),this.lineTo(t+n,e),this.lineTo(t+i-n,e),this.arc(t+i-n,e+n,n,1.5*Math.PI,2*Math.PI),this.lineTo(t+i,e+n),this.lineTo(t+i,e+s-n),this.arc(t+i-n,e+s-n,n,0,Math.PI/2),this.lineTo(t+i-n,e+s),this.lineTo(t+n,e+s),this.arc(t+ +n,e+s-n,n,Math.PI/2,Math.PI),this.lineTo(t,e+s-n),this.closePath()}arc(t,e,i,s,n,r){this.openedPath=!0,this.path2d.arc(t,e,i,s,n,r),this.commands.push(2),this.params.push(t,e,i,s,n,r?1:0)}cubicCurveTo(t,e,i,s,n,r){this.openedPath||this.moveTo(t,e),this.path2d.bezierCurveTo(t,e,i,s,n,r),this.commands.push(3),this.params.push(t,e,i,s,n,r)}closePath(){this.openedPath&&(this.path2d.closePath(),this.commands.push(4),this.openedPath=!1,this.closedPath=!0)}clear(t){t&&(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(t,e){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+=Er(a,l,c,h,r,o,t,e),c=s[p++],a=c,h=s[p++],l=h;break;case 1:u+=Er(c,h,s[p++],s[p++],r,o,t,e),c=s[p-2],h=s[p-1];break;case 3:u+=SD(c,h,s[p++],s[p++],s[p++],s[p++],s[p++],s[p++],r,o,t,e),c=s[p-2],h=s[p-1];break;case 2:{const f=s[p++],y=s[p++],x=s[p++],m=s[p++],v=s[p++],S=!!s[p++];if(u+=hm(f,y,x,m,v,S,r,o,t,e),!isNaN(a)){const M=f+Math.cos(m)*x,D=y+Math.sin(m)*x;u+=Er(c,h,M,D,r,o,t,e)}c=f+Math.cos(v)*x,h=y+Math.sin(v)*x;break}case 4:u+=Er(a,l,c,h,r,o,t,e);break}return u%2===1}distanceSquared(t,e){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 d=n[u++],p=n[u++];i=Zo(t,e,l,c,d,p,i);break}case 3:yD.Logger.error("Command.Curve distanceSquare not implemented");break;case 2:{const d=n[u++],p=n[u++],f=n[u++],y=n[u++],x=n[u++],m=d+Math.cos(y)*f,v=p+Math.sin(y)*f,S=!!n[u++];i=Zo(t,e,l,c,m,v,i),i=bD(t,e,d,p,f,y,x,S,i),l=d+Math.cos(x)*f,c=p+Math.sin(x)*f;break}case 4:i=Zo(t,e,l,c,o,a,i);break}return i}toSVG(t=(e,i)=>({x:e,y:i})){const e=[],{commands:i,params:s}=this,n=(o,...a)=>{e.push(o);for(let l=0;l<a.length;l+=2){const{x:c,y:h}=t(a[l],a[l+1]);e.push(c,h)}};let r=0;for(const o of i)switch(o){case 0:n("M",s[r++],s[r++]);break;case 1:n("L",s[r++],s[r++]);break;case 3:n("C",s[r++],s[r++],s[r++],s[r++],s[r++],s[r++]);break;case 2:{const a=s[r++],l=s[r++],c=s[r++],h=s[r++],u=s[r++],d=s[r++];let p=d?h-u:u-h;p<0&&(p+=Math.ceil(-p/(2*Math.PI))*2*Math.PI),d&&(p=-p);const f=Math.max(Math.ceil(Math.abs(p)/(Math.PI/2)),1),y=p/f,x=4/3*Math.tan(y/4),m=e.length===0?"M":"L";n(m,a+Math.cos(h)*c,l+Math.sin(h)*c);for(let v=0;v<f;v+=1){const S=h+y*(v+0),M=h+y*(v+1),D=c*Math.sin(S),C=c*Math.cos(S),L=c*Math.sin(M),I=c*Math.cos(M);n("C",a+C-x*D,l+D+x*C,a+I+x*L,l+L-x*I,a+I,l+L)}break}case 4:e.push("Z");break}return e.join(" ")}computeBBox(){const{commands:t,params:e}=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,f)=>{i=Math.min(p,i),s=Math.min(d,s),n=Math.max(d,n),r=Math.max(p,r),f&&([o,a]=[d,p])};let u=0;for(const d of t)switch(d){case 0:h(e[u++],e[u++],!0),[l,c]=[o,a];break;case 1:h(e[u++],e[u++],!0);break;case 3:{const p=e[u++],f=e[u++],y=e[u++],x=e[u++],m=e[u++],v=e[u++];h(m,v,!0),um(o,a,p,f,y,x,m,v).forEach(M=>{const D=Yl(o,p,y,m,M),C=Yl(a,f,x,v,M);h(D,C)});break}case 2:{const p=e[u++],f=e[u++],y=e[u++];let x=Pt(e[u++]),m=Pt(e[u++]);e[u++]&&([x,m]=[m,x]);const S=(D,C)=>{const L=p+y*Math.cos(D),I=f+y*Math.sin(D);h(L,I,C)};S(x),S(m,!0);const M=[0,Math.PI/2,Math.PI,3*Math.PI/2];for(const D of M)(x<m&&x<=D&&D<=m||x>m&&(x<=D||D<=m))&&S(D);break}case 4:[o,a]=[l,c];break}return new B(s,i,n-s,r-i)}};function fe(t,e,i){const s=Math.round(e*t)/t;return i==null?s:i===0?0:i<1?Math.ceil(i*t)/t:Math.round((i+e)*t)/t-s}function dm(t,e){return Math.floor(e*t)/t}function vu(t,e,i){const{width:s,height:n,padding:r,strokeWidth:o}=e,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 f=a+(d-.5)*c,y=l+(p-.5)*h;u?t.lineTo(f,y):t.moveTo(f,y),u=!0}t.closePath()}var DD={circles(t,{width:e,strokeWidth:i,padding:s}){const n=e/2,r=Math.max(1,n-s-i/2);t.arc(n,n,r,0,Math.PI*2)},squares(t,{width:e,height:i,pixelRatio:s,padding:n,strokeWidth:r}){const o=n+r/2;t.moveTo(fe(s,o),fe(s,o)),t.lineTo(fe(s,e-o),fe(s,o)),t.lineTo(fe(s,e-o),fe(s,i-o)),t.lineTo(fe(s,o),fe(s,i-o)),t.closePath()},triangles(t,e){vu(t,e,[[.5,0],[1,1],[0,1]])},diamonds(t,e){vu(t,e,[[.5,0],[1,.5],[.5,1],[0,.5]])},stars(t,{width:e,height:i,padding:s}){const r=Math.max(1,(e-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=e/2+Math.cos(h)*c,d=i/2+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},hearts(t,{width:e,height:i,padding:s}){const n=Math.max(1,e/4-s/2),r=e/2,o=i/2+n/2;t.arc(r-n,o-n,n,zt(130),zt(330)),t.arc(r+n,o-n,n,zt(220),zt(50)),t.lineTo(r,o+n),t.closePath()},crosses(t,e){vu(t,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]])},"vertical-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const r=fe(s,e/2)-n%2/2;t.moveTo(r,0),t.lineTo(r,i)},"horizontal-lines"(t,{width:e,height:i,pixelRatio:s,strokeWidth:n}){const r=fe(s,i/2)-n%2/2;t.moveTo(0,r),t.lineTo(e,r)},"forward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),r=s*Math.cos(n),o=s*Math.sin(n);t.moveTo(-r,o),t.lineTo(r,-o),t.moveTo(-r,i+o),t.lineTo(e+r,-o),t.moveTo(e-r,i+o),t.lineTo(e+r,i-o)},"backward-slanted-lines"(t,{width:e,height:i,strokeWidth:s}){const n=Math.atan2(i,e),r=s*Math.cos(n),o=s*Math.sin(n);t.moveTo(e-r,-o),t.lineTo(e+r,o),t.moveTo(-r,-o),t.lineTo(e+r,i+o),t.moveTo(-r,i-o),t.lineTo(r,i+o)}},ID=class{constructor(t,e=1){this.pixelRatio=e,this._cache=void 0,this.width=Math.max(t?.width??10,1),this.height=Math.max(t?.height??10,1),this.fill=t.fill??"transparent",this.fillOpacity=t.fillOpacity??1,this.backgroundFill=t.backgroundFill??"transparent",this.backgroundFillOpacity=t.backgroundFillOpacity??1,this.stroke=t.stroke??"black",this.strokeOpacity=t.strokeOpacity??1,this.strokeWidth=t.strokeWidth??1,this.padding=t.padding??1,this.pattern=t.pattern??"forward-slanted-lines",this.rotation=t.rotation??0}getPath(){const{pattern:t,width:e,height:i,padding:s,strokeWidth:n,pixelRatio:r}=this,o=new Or;return DD[t](o,{width:e,height:i,pixelRatio:r,strokeWidth:n,padding:s}),o}renderStroke(t,e){const{stroke:i,strokeWidth:s,strokeOpacity:n}=this;s&&(e.strokeStyle=i,e.lineWidth=s,e.globalAlpha=n,e.stroke(t))}renderFill(t,e){const{fill:i,fillOpacity:s}=this;e.fillStyle=i,e.globalAlpha=s,e.fill(t)}createCanvasPattern(t){const{width:e,height:i,backgroundFill:s,backgroundFillOpacity:n,pixelRatio:r,rotation:o}=this,a=new tu({width:e,height:i,pixelRatio:r}),l=a.context;l.fillStyle=s,l.globalAlpha=n,l.fillRect(0,0,e,i);const c=this.getPath().getPath2D();this.renderFill(c,l),this.renderStroke(c,l);const h=t.createPattern(a.canvas,"repeat"),u=Pt(zt(o)),d=1/r,p=Math.cos(u)*d,f=Math.sin(u)*d;return h?.setTransform(new DOMMatrix([p,f,-f,p,0,0])),a.destroy(),h}createPattern(t){if(this._cache!=null&&this._cache.ctx===t)return this._cache.pattern;const e=this.createCanvasPattern(t);if(e!=null)return this._cache={ctx:t,pattern:e},e}toSvg(){const{width:t,height:e,fill:i,fillOpacity:s,backgroundFill:n,backgroundFillOpacity:r,stroke:o,strokeWidth:a,strokeOpacity:l,rotation:c}=this,h=(0,bu.createSvgElement)("pattern");h.setAttribute("viewBox",`0 0 ${t} ${e}`),h.setAttribute("width",String(t)),h.setAttribute("height",String(e)),h.setAttribute("patternUnits","userSpaceOnUse");const u=(0,bu.createSvgElement)("rect");u.setAttribute("x","0"),u.setAttribute("y","0"),u.setAttribute("width",String(t)),u.setAttribute("height",String(e)),u.setAttribute("fill",n),u.setAttribute("fill-opacity",String(r)),h.appendChild(u);const d=(0,bu.createSvgElement)("path");return d.setAttribute("fill",i),d.setAttribute("fill-opacity",String(s)),d.setAttribute("stroke-opacity",String(l)),d.setAttribute("stroke",o),d.setAttribute("stroke-width",String(a)),d.setAttribute("transform",`rotate(${c})`),d.setAttribute("d",this.getPath().toSVG()),h.appendChild(d),h}},Mu=(w(),k(T));function Vi(t){return(0,Mu.isObject)(t)&&t.type=="gradient"}function pm(t){return(0,Mu.isArray)(t)&&t.every(e=>typeof e=="string")}function Bn(t){return t!==null&&(0,Mu.isObject)(t)&&t.type=="pattern"}function AD(t){return Vi(t)||Bn(t)}var Ge=class Ds extends As{constructor(){super(...arguments),this.fillOpacity=1,this.strokeOpacity=1,this.fill=Ds.defaultStyles.fill,this.stroke=Ds.defaultStyles.stroke,this.strokeWidth=Ds.defaultStyles.strokeWidth,this.lineDash=Ds.defaultStyles.lineDash,this.lineDashOffset=Ds.defaultStyles.lineDashOffset,this.lineCap=Ds.defaultStyles.lineCap,this.lineJoin=Ds.defaultStyles.lineJoin,this.miterLimit=void 0,this.opacity=Ds.defaultStyles.opacity,this.fillShadow=Ds.defaultStyles.fillShadow}restoreOwnStyles(){const{defaultStyles:e}=this.constructor;Object.assign(this,e)}getGradient(e){if(Vi(e))return this.createGradient(e)}createGradient(e){const{colorSpace:i="rgb",gradient:s="linear",colorStops:n,rotation:r=0,reverse:o=!1}=e;if(n==null)return;let a=lm(n,["black"],[0,1]);switch(o&&(a=a.map(l=>({color:l.color,stop:1-l.stop})).reverse()),s){case"linear":return new qf(i,a,r);case"radial":return new JS(i,a);case"conic":return new Xf(i,a,r)}}getPattern(e){if(Bn(e))return this.createPattern(e)}createPattern(e){const i=this.layerManager?.canvas?.pixelRatio??1;return new ID(e,i)}onFillChange(){typeof this.fill=="object"&&cs(this._cachedFill??{},this.fill)||(this.fillGradient=this.getGradient(this.fill),this.fillPattern=this.getPattern(this.fill),this._cachedFill=this.fill)}onStrokeChange(){this.strokeGradient=this.getGradient(this.stroke)}align(e,i){return fe(this.layerManager?.canvas?.pixelRatio??1,e,i)}preRender(e,i){return this.dirty&&(this.cachedDefaultGradientFillBBox=void 0),super.preRender(e,i)}fillStroke(e,i){this.renderFill(e,i),this.renderStroke(e,i)}renderFill(e,i){if(this.fill){const{globalAlpha:s}=e;this.applyFill(e),this.applyFillAlpha(e),this.applyShadow(e),this.executeFill(e,i),e.globalAlpha=s}e.shadowColor="rgba(0, 0, 0, 0)"}executeFill(e,i){i?e.fill(i):e.fill()}applyFill(e){const{fill:i,fillGradient:s,fillBBox:n=this.getDefaultGradientFillBBox()??this.getBBox(),fillParams:r}=this,o=n?s?.createGradient(e,n,r):void 0,a=this.fillPattern?.createPattern(e);e.fillStyle=a??o??(typeof i=="string"?i:void 0)??"black"}applyStroke(e){e.strokeStyle=this.strokeGradient?.createGradient(e,this.getBBox())??(typeof this.stroke=="string"?this.stroke:void 0)??"black"}applyFillAlpha(e){e.globalAlpha*=this.opacity*this.fillOpacity}applyShadow(e){const i=this.layerManager?.canvas.pixelRatio??1,s=this.fillShadow;s?.enabled&&(e.shadowColor=s.color,e.shadowOffsetX=s.xOffset*i,e.shadowOffsetY=s.yOffset*i,e.shadowBlur=s.blur*i)}renderStroke(e,i){if(this.stroke&&this.strokeWidth){const{globalAlpha:s}=e;this.applyStroke(e),e.globalAlpha*=this.opacity*this.strokeOpacity,e.lineWidth=this.strokeWidth,this.lineDash&&e.setLineDash(this.lineDash),this.lineDashOffset&&(e.lineDashOffset=this.lineDashOffset),this.lineCap&&(e.lineCap=this.lineCap),this.lineJoin&&(e.lineJoin=this.lineJoin),this.miterLimit!=null&&(e.miterLimit=this.miterLimit),this.executeStroke(e,i),e.globalAlpha=s}}executeStroke(e,i){i?e.stroke(i):e.stroke()}getDefaultGradientFillBBox(){return this.cachedDefaultGradientFillBBox==null&&(this.cachedDefaultGradientFillBBox=Object.freeze(this.computeDefaultGradientFillBBox())),this.cachedDefaultGradientFillBBox}computeDefaultGradientFillBBox(){}containsPoint(e,i){return this.isPointInPath(e,i)}applySvgFillAttributes(e,i){const{fill:s,fillOpacity:n}=this;if(typeof s=="string")e.setAttribute("fill",s);else if(Vi(s)&&this.fillGradient){i??(i=[]);const r=this.fillGradient.toSvg(this.fillBBox??this.getBBox()),o=su();r.setAttribute("id",o),i.push(r),e.setAttribute("fill",`url(#${o})`)}else if(Bn(s)&&this.fillPattern){i??(i=[]);const r=this.fillPattern.toSvg(),o=su();r.setAttribute("id",o),i.push(r),e.setAttribute("fill",`url(#${o})`)}else e.setAttribute("fill","none");return e.setAttribute("fill-opacity",String(n)),i}applySvgStrokeAttributes(e){const{stroke:i,strokeOpacity:s,strokeWidth:n,lineDash:r,lineDashOffset:o}=this;if(i!=null&&(e.setAttribute("stroke",typeof i=="string"?i:"none"),e.setAttribute("stroke-opacity",String(s)),e.setAttribute("stroke-width",String(n))),r?.some(a=>a!==0)===!0){const a=r.length%2===1?[...r,...r]:r;e.setAttribute("stroke-dasharray",a.join(" ")),e.setAttribute("stroke-dashoffset",String(o))}}};Ge.defaultStyles={fill:"black",stroke:void 0,strokeWidth:0,lineDash:void 0,lineDashOffset:0,lineCap:void 0,lineJoin:void 0,opacity:1,fillShadow:void 0},g([G()],Ge.prototype,"fillOpacity",2),g([G()],Ge.prototype,"strokeOpacity",2),g([G({changeCb:t=>t.onFillChange()})],Ge.prototype,"fill",2),g([G({changeCb:t=>t.onStrokeChange()})],Ge.prototype,"stroke",2),g([G()],Ge.prototype,"strokeWidth",2),g([G()],Ge.prototype,"lineDash",2),g([G()],Ge.prototype,"lineDashOffset",2),g([G()],Ge.prototype,"lineCap",2),g([G()],Ge.prototype,"lineJoin",2),g([G()],Ge.prototype,"miterLimit",2),g([G({convertor:t=>(0,US.clamp)(0,t,1)})],Ge.prototype,"opacity",2),g([G({checkDirtyOnAssignment:!0})],Ge.prototype,"fillShadow",2),g([G({changeCb:t=>t.onFillChange()})],Ge.prototype,"fillBBox",2),g([G({changeCb:t=>t.onFillChange()})],Ge.prototype,"fillParams",2);var ki=Ge,LD=(w(),k(T)),Rr=(w(),k(T)),gm=[1,0,0,1,0,0],Ui=class Eh{get e(){return[...this.elements]}constructor(e=gm){this.elements=[...e]}setElements(e){const i=this.elements;return i[0]=e[0],i[1]=e[1],i[2]=e[2],i[3]=e[3],i[4]=e[4],i[5]=e[5],this}get identity(){const e=this.elements;return(0,Rr.isNumberEqual)(e[0],1)&&(0,Rr.isNumberEqual)(e[1],0)&&(0,Rr.isNumberEqual)(e[2],0)&&(0,Rr.isNumberEqual)(e[3],1)&&(0,Rr.isNumberEqual)(e[4],0)&&(0,Rr.isNumberEqual)(e[5],0)}AxB(e,i,s){const n=e[0]*i[0]+e[2]*i[1],r=e[1]*i[0]+e[3]*i[1],o=e[0]*i[2]+e[2]*i[3],a=e[1]*i[2]+e[3]*i[3],l=e[0]*i[4]+e[2]*i[5]+e[4],c=e[1]*i[4]+e[3]*i[5]+e[5];s=s??e,s[0]=n,s[1]=r,s[2]=o,s[3]=a,s[4]=l,s[5]=c}multiplySelf(e){return this.AxB(this.elements,e.elements),this}multiply(e){const i=new Array(6);return e instanceof Eh?this.AxB(this.elements,e.elements,i):this.AxB(this.elements,[e.a,e.b,e.c,e.d,e.e,e.f],i),new Eh(i)}preMultiplySelf(e){return this.AxB(e.elements,this.elements,this.elements),this}inverse(){const e=this.elements;let i=e[0],s=e[1],n=e[2],r=e[3];const o=e[4],a=e[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,new Eh([r,-s,-n,i,n*a-r*o,s*o-i*a])}invertSelf(){const e=this.elements;let i=e[0],s=e[1],n=e[2],r=e[3];const o=e[4],a=e[5],l=1/(i*r-s*n);return i*=l,s*=l,n*=l,r*=l,e[0]=r,e[1]=-s,e[2]=-n,e[3]=i,e[4]=n*a-r*o,e[5]=s*o-i*a,this}transformPoint(e,i){const s=this.elements;return{x:e*s[0]+i*s[2]+s[4],y:e*s[1]+i*s[3]+s[5]}}transformBBox(e,i){const s=this.elements,n=s[0],r=s[1],o=s[2],a=s[3],l=e.width*.5,c=e.height*.5,h=e.x+l,u=e.y+c,d=Math.abs(l*n)+Math.abs(c*o),p=Math.abs(l*r)+Math.abs(c*a);return i??(i=new B(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(e){if(this.identity)return;const i=this.elements;e.transform(i[0],i[1],i[2],i[3],i[4],i[5])}static updateTransformMatrix(e,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),f=Math.sin(d);let y,x;d===0?(y=0,x=0):(y=a?.rotationCenterX??0,x=a?.rotationCenterY??0);const m=r,v=o,S=h*(1-l)-y,M=u*(1-c)-x;return e.setElements([p*l,f*l,-f*c,p*c,p*S-f*M+y+m,f*S+p*M+x+v]),e}};function hn(t){return mm(t.constructor)}var fm=Symbol("isMatrixTransform");function mm(t){return t[fm]===!0}function Su(t){var e,i;const s=t;if(mm(t))return t;const n=Symbol("matrix_combined_transform");class r extends s{constructor(){super(...arguments),this[i]=new Ui,this._dirtyTransform=!0}markDirtyTransform(){this._dirtyTransform=!0,super.markDirty()}updateMatrix(a){}computeTransformMatrix(){this._dirtyTransform&&(this[n].setElements(gm),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;c.identity||(l.save(),h=!0,c.toContext(l)),super.render(a),h&&l.restore()}toSVG(){this.computeTransformMatrix();const a=super.toSVG(),l=this[n];if(l.identity||a==null)return a;const c=(0,LD.createSvgElement)("g");c.append(...a.elements);const[h,u,d,p,f,y]=l.e;return c.setAttribute("transform",`matrix(${h} ${u} ${d} ${p} ${f} ${y})`),{elements:[c],defs:a.defs}}}return e=fm,i=n,r[e]=!0,r}function Pr(t){var e;const i=t,s=Symbol("matrix_rotation");class n extends Su(i){constructor(){super(...arguments),this[e]=new Ui,this.rotationCenterX=null,this.rotationCenterY=null,this.rotation=0}updateMatrix(o){super.updateMatrix(o);const{rotation:a,rotationCenterX:l,rotationCenterY:c}=this;a!==0&&(Ui.updateTransformMatrix(this[s],1,1,a,0,0,{rotationCenterX:l,rotationCenterY:c}),o.multiplySelf(this[s]))}}return e=s,g([G({type:"transform"})],n.prototype,"rotationCenterX",2),g([G({type:"transform"})],n.prototype,"rotationCenterY",2),g([G({type:"transform"})],n.prototype,"rotation",2),n}function Du(t){var e;const i=t,s=Symbol("matrix_scale");class n extends Su(i){constructor(){super(...arguments),this[e]=new Ui,this.scalingX=1,this.scalingY=1,this.scalingCenterX=null,this.scalingCenterY=null}updateMatrix(o){super.updateMatrix(o);const{scalingX:a,scalingY:l,scalingCenterX:c,scalingCenterY:h}=this;a===1&&l===1||(Ui.updateTransformMatrix(this[s],a,l,0,0,0,{scalingCenterX:c,scalingCenterY:h}),o.multiplySelf(this[s]))}}return e=s,g([G({type:"transform"})],n.prototype,"scalingX",2),g([G({type:"transform"})],n.prototype,"scalingY",2),g([G({type:"transform"})],n.prototype,"scalingCenterX",2),g([G({type:"transform"})],n.prototype,"scalingCenterY",2),n}function Gn(t){var e;const i=t,s=Symbol("matrix_translation");class n extends Su(i){constructor(){super(...arguments),this[e]=new Ui,this.translationX=0,this.translationY=0}updateMatrix(o){super.updateMatrix(o);const{translationX:a,translationY:l}=this;a===0&&l===0||(Ui.updateTransformMatrix(this[s],1,1,0,a,l),o.multiplySelf(this[s]))}}return e=s,g([G({type:"transform"})],n.prototype,"translationX",2),g([G({type:"transform"})],n.prototype,"translationY",2),n}var Kt=class{static fromCanvas(t,e){const i=[];for(const s of t.traverseUp())hn(s)&&i.unshift(s);for(const s of i)e=s.fromParent(e);return hn(t)&&(e=t.fromParent(e)),e}static toCanvas(t,e){e==null?e=t.getBBox():hn(t)&&(e=t.toParent(e));for(const i of t.traverseUp())hn(i)&&(e=i.toParent(e));return e}static fromCanvasPoint(t,e,i){const s=[];for(const n of t.traverseUp())hn(n)&&s.unshift(n);for(const n of s)({x:e,y:i}=n.fromParentPoint(e,i));return hn(t)&&({x:e,y:i}=t.fromParentPoint(e,i)),{x:e,y:i}}static toCanvasPoint(t,e,i){hn(t)&&({x:e,y:i}=t.toParentPoint(e,i));for(const s of t.traverseUp())hn(s)&&({x:e,y:i}=s.toParentPoint(e,i));return{x:e,y:i}}},Iu=(t,e)=>Math.sign(t-e);function ym(t,e){if(typeof t=="number"&&typeof e=="number")return Iu(t,e);const i=typeof t=="number"?[t]:t,s=typeof e=="number"?[e]:e,n=Math.min(i.length,s.length);for(let r=0;r<n;r+=1){const o=Iu(i[r],s[r]);if(o!==0)return o}return Iu(i.length,s.length)}var Xo,Au=class hl extends As{constructor(e){super(e),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=e?.renderToOffscreenCanvas===!0}static is(e){return e instanceof hl}static computeChildrenBBox(e,i=!0){return B.merge(As.extractBBoxes(e,i))}static compareChildren(e,i){return ym(e.zIndex,i.zIndex)||e.serialNumber-i.serialNumber}containsPoint(e,i){return!0}computeBBox(){return hl.computeChildrenBBox(this.children())}computeSafeClippingBBox(e){const i=this.computeBBox();if(!i.isFinite())return;let s=0;const n=4;for(const d of this.descendants())d instanceof ki&&(s=Math.max(s,d.strokeWidth));const r=Math.max(1,s/2*n),{x:o,y:a}=Kt.toCanvasPoint(this,0,0),l=dm(e,o+i.x-r)-o,c=dm(e,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 B(l,c,h,u)}prepareSharedCanvas(e,i,s){return Xo==null||Xo.pixelRatio!==s?Xo=new tu({width:e,height:i,pixelRatio:s}):Xo.resize(e,i,s),Xo}isDirty(e){const{width:i,height:s,devicePixelRatio:n}=e,{dirty:r,dirtyZIndex:o,layer:a}=this,l=a!=null&&(this._lastWidth!==i||this._lastHeight!==s),c=this._lastDevicePixelRatio!==n;if(this._lastWidth=i,this._lastHeight=s,this._lastDevicePixelRatio=n,r||o||l||c)return!0;for(const h of this.children())if(h.dirty)return!0;return!1}preRender(e){const i=super.preRender(e,0);return i.groups+=1,i.nonGroups-=1,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(e){const{layer:i,renderToOffscreenCanvas:s}=this,n={...e};if(!s){this.renderInContext(n),super.render(n);return}const{ctx:r,stats:o,devicePixelRatio:a}=e;let{image:l}=this;if(this.isDirty(e)){l?.bitmap.close(),l=void 0;const h=i?void 0:this.computeSafeClippingBBox(a),u=(d,...p)=>{const f=d.context;n.ctx=f,d.clear(),f.save(),f.setTransform(...p),f.globalAlpha=1,this.renderInContext(n),f.restore(),f.verifyDepthZero?.()};if(i)u(i,r.getTransform());else if(h){const{x:d,y:p,width:f,height:y}=h,x=this.prepareSharedCanvas(f,y,a);u(x,a,0,0,a,-d*a,-p*a),l={bitmap:x.transferToImageBitmap(),x:d,y:p,width:f,height:y}}else this.dirtyZIndex&&this.sortChildren(hl.compareChildren);this.image=l,o&&o.layersRendered++}else this.skipRender(n),o&&o.layersSkipped++;const{globalAlpha:c}=r;if(r.globalAlpha=c*this.opacity,i)r.save(),r.resetTransform(),i.drawImage(r),r.restore();else if(l){const{bitmap:h,x:u,y:d,width:p,height:f}=l;r.drawImage(h,0,0,p*a,f*a,u,d,p,f)}r.globalAlpha=c,super.render(n)}skipRender(e){const{stats:i}=e;for(const s of this.children())s.markClean(),i&&(i.nodesSkipped+=this.childNodeCounts.groups+this.childNodeCounts.nonGroups,i.opsSkipped+=this.childNodeCounts.complexity)}applyClip(e,i){const{x:s,y:n,width:r,height:o}=i;e.beginPath(),e.rect(s,n,r,o),e.clip()}renderInContext(e){const{ctx:i,stats:s}=e;this.dirtyZIndex&&this.sortChildren(hl.compareChildren),i.save(),i.globalAlpha*=this.opacity,this.clipRect!=null&&(this.applyClip(i,this.clipRect),e.clipBBox=Kt.toCanvas(this,this.clipRect));for(const n of this.children()){if(!n.visible){n.markClean(),s&&(s.nodesSkipped+=n.childNodeCounts.nonGroups+n.childNodeCounts.groups,s.opsSkipped+=n.childNodeCounts.complexity);continue}i.save(),n.render(e),i.restore()}i.restore()}setClipRect(e){this.clipRect=e?Kt.fromCanvas(this,e):void 0}setClipRectCanvasSpace(e){this.clipRect=e}_setLayerManager(e){this.layer&&(this._layerManager?.removeLayer(this.layer),this.layer=void 0),super._setLayerManager(e)}getVisibility(){for(const e of this.traverseUp(!0))if(!e.visible)return!1;return!0}toSVG(){if(!this.visible)return;const e=[],i=[];for(const s of this.children()){const n=s.toSVG();n!=null&&(i.push(...n.elements),n.defs!=null&&e.push(...n.defs))}return{elements:i,defs:e}}};Au.className="Group",g([G({convertor:t=>(0,wS.clamp)(0,t,1)})],Au.prototype,"opacity",2);var it=Au,CD=class extends Du(it){},ND=class extends Pr(it){},Xe=class extends Gn(it){},qo=class extends Pr(Gn(it)){},bm=class{constructor(){this.queue=[]}await(t=50){return new Promise(e=>{const i=()=>{clearTimeout(n),e(!0)},n=setTimeout(()=>{const r=this.queue.indexOf(i);r<0||(this.queue.splice(r,1),e(!1))},t);this.queue.push(i)})}notify(){this.queue.splice(0).forEach(t=>t())}};function TD(){return new Promise(t=>{setTimeout(t,0)})}var Lu=(w(),k(T));function Hl(t,e){t&&(e=Al.normalize(e),e.width==null?t.style.removeProperty("width"):t.style.width=`${e.width}px`,e.height==null?t.style.removeProperty("height"):t.style.height=`${e.height}px`,e.x==null?t.style.removeProperty("left"):t.style.left=`${e.x}px`,e.y==null?t.style.removeProperty("top"):t.style.top=`${e.y}px`)}function xm(t){const e=parseFloat(t.style.width)||t.offsetWidth,i=parseFloat(t.style.height)||t.offsetHeight,s=parseFloat(t.style.left)||t.offsetLeft,n=parseFloat(t.style.top)||t.offsetTop;return{x:s,y:n,width:e,height:i}}function kD(t){if(t.focus({preventScroll:!0}),t.lastChild?.textContent==null)return;const e=(0,Lu.getDocument)().createRange();e.setStart(t.lastChild,t.lastChild.textContent.length),e.setEnd(t.lastChild,t.lastChild.textContent.length);const i=(0,Lu.getWindow)().getSelection();i?.removeAllRanges(),i?.addRange(e)}var wD=0;function ED(t){return`${t??"ag-charts-element"}-${wD++}`}function vm(){const t=(0,Lu.getWindow)("navigator");if("scheduling"in t){const e=t.scheduling;if("isInputPending"in e)return e.isInputPending({includeContinuous:!0})}return!1}function Kl(t){return`ag-charts-icon ag-charts-icon-${t}`}var U=(w(),k(T)),Cu="class-instance";function ps(t,e,i){if((0,U.isArray)(e)){if(!(0,U.isArray)(t)||t.length!==e.length||e.some((s,n)=>ps(t[n],s,i)!=null))return e}else if((0,U.isPlainObject)(e)){if(!(0,U.isPlainObject)(t))return e;const s={},n=new Set([...Object.keys(t),...Object.keys(e)]);for(const r of n)if(t[r]!==e[r])if(i?.has(r))s[r]=e[r];else if(typeof t[r]==typeof e[r]){const o=ps(t[r],e[r],i);o!==null&&(s[r]=o)}else s[r]=e[r];return Object.keys(s).length?s:null}else if(t!==e)return e;return null}function Mm(t,e){for(const i of Object.keys(t))if(t[i]!==e?.[i])return!1;return!0}function Ft(t,e){return(0,U.isArray)(t)?t.map(i=>Ft(i,e)):(0,U.isPlainObject)(t)?OD(t,e):t instanceof Map?new Map(Ft(Array.from(t))):Nu(t)}function OD(t,e){const i={};for(const s of Object.keys(t))e?.assign?.has(s)?i[s]=t[s]:e?.shallow?.has(s)?i[s]=Nu(t[s]):i[s]=Ft(t[s],e);return i}function Nu(t){return(0,U.isArray)(t)?t.slice(0):(0,U.isPlainObject)(t)?{...t}:(0,U.isDate)(t)?new Date(t):(0,U.isRegExp)(t)?new RegExp(t.source,t.flags):t}function ks(t,e,i,s,n,r){if((0,U.isArray)(t)){r=e(t,s,n,r);let o=0;for(const a of t)r=ks(a,e,i,s?.[o],n,r),o++}else if((0,U.isPlainObject)(t)){r=e(t,s,n,r);for(const o of Object.keys(t)){if(i?.has(o))continue;const a=t[o];r=ks(a,e,i,s?.[o],n,r)}}return r}function Qo(t,e,i={}){const{path:s,matcherPath:n=s?.replace(/(\[[0-9+]+])/i,"[]"),skip:r=[]}=i;if(t==null)throw new Error(`AG Charts - target is uninitialised: ${s??"<root>"}`);if(e==null)return t;if(Ti(t))return t.set(e);const o=t,a=Tu(t);for(const l of Object.keys(e)){if(ou.has(l))continue;const c=`${n?n+".":""}${l}`;if(r.includes(c))continue;const h=e[l],u=`${s?s+".":""}${l}`,d=o.constructor,p=o[l];try{const f=Tu(p),y=Tu(h);if(a===Cu&&!(l in t||l==="context")){if(h===void 0)continue;U.Logger.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}if(f!=null&&y!=null&&y!==f&&(f!==Cu||y!=="object")){U.Logger.warn(`unable to set [${u}] in ${d?.name} - can't apply type of [${y}], allowed types are: [${f}]`);continue}if(Ti(p))o[l].set(h);else if(y==="object"&&l!=="context"){if(p==null){U.Logger.warn(`unable to set [${u}] in ${d?.name} - property is unknown`);continue}Qo(p,h,{...i,path:u,matcherPath:c})}else o[l]=h}catch(f){U.Logger.warn(`unable to set [${u}] in [${d?.name}]; nested error is: ${f.message}`)}}return t}function Tu(t){return t==null?null:(0,U.isHtmlElement)(t)||(0,U.isDate)(t)?"primitive":(0,U.isArray)(t)?"array":(0,U.isObject)(t)?(0,U.isPlainObject)(t)?"object":Cu:(0,U.isFunction)(t)?"function":"primitive"}function Zl(t,e,i,s){return wu(t,e,s??t,{matches:new Map},i)}var ku=Symbol("operation-resolved-undefined");function wu(t,e,i,s,n,r=[],o={}){if((0,U.isArray)(t)){Sm(t,e,i,s,r,o);let a=0;for(const l of t)wu(l,e,i,s,n,[...r,`${a}`],o),a++}else if((0,U.isPlainObject)(t)){Sm(t,e,i,s,r,o);for(const a of Object.keys(t)){if(n?.has(a))continue;const l=t[a];wu(l,e,i,s,n,[...r,a],o)}}return o}function Sm(t,e,i,s,n,r){if((0,U.isArray)(t))for(let o=0;o<t.length;o++)t[o]=Dm(t[o],e,i,s,[...n,`${o}`],r),t[o]===ku&&(t[o]=void 0);else{let o=!1;for(const a of Object.keys(t))t[a]=Dm(t[a],e,i,s,[...n,a],r),o||(o=Yi(a,ql)),t[a]===ku&&delete t[a];if(o&&Object.keys(t).length>1)for(const a of Object.keys(t))Yi(a,ql)&&delete t[a]}}function Dm(t,e,i,s,n,r){const o=un(t);if(!o)return t;r[n.join(".")]=t;const a=Jo(o.operation,o.values,e,i,n,s);return a===void 0?ku:a}function un(t){if(!(0,U.isPlainObject)(t))return;const[e]=Object.keys(t);if(Yi(e,ql))return{operation:e,values:t[e]}}function Jo(t,e,i,s,n,r){r.referencedParams??(r.referencedParams=new Set);const o=["$find","$map"];(0,U.isArray)(e)&&!o.includes(t)&&(e=e.map(l=>{const c=un(l);return c?Jo(c.operation,c.values,i,s,n,r):l}));const a=ql[t];return a(e,n,i,s,r)}function Yi(t,e){return(0,U.isString)(t)&&((0,U.isObject)(e)||(0,U.isArray)(e))&&t in e}function Xl(t){return(0,U.isNumber)(t)&&t>=0&&t<=1}function Im(t){return(0,U.isObject)(t)&&t.type=="gradient"}function RD(t){return t!==null&&(0,U.isObject)(t)&&t.type=="pattern"}function Am(t,e){const i=e.split("/");let s=[...t];e.startsWith("/")&&(s=[],i.shift());let n=!1;for(const r of i){if(r==="..")s.pop(),n||s.pop();else if(r===".")s.pop();else if(r==="$index"){const o=t.findLast(a=>!isNaN(Number(a)));o!=null&&s.push(o)}else if(r==="$prevIndex"){const o=t.findLast(a=>!isNaN(Number(a)));o!=null&&s.push(`${Number(o)-1}`)}else r.length!==0&&s.push(r);n=r===".."}return s}var PD={$ref:Lm,$path:VD,$palette:GD},_D={$if:([t,e,i])=>t?e:i,$eq:([t,e])=>t===e,$not:([t])=>!t,$or:t=>(0,U.isArray)(t)&&t.some(Boolean),$and:t=>(0,U.isArray)(t)&&t.every(Boolean),$switch:()=>{},$isOperation:UD},jD={$isEven:YD,$mul:WD,$round:$D},FD={$map:HD,$find:KD,$merge:ZD,$omit:XD,$value:qD},zD={$rem:QD},BD={$mix:JD,$foregroundBackgroundMix:tI,$foregroundBackgroundAccentMix:eI,$interpolate:iI,$isGradient:([t])=>Im(t),$isPattern:([t])=>RD(t)},ql={...PD,..._D,...jD,...FD,...zD,...BD};function Lm(t,e,i,s,n){if(!Yi(t,i)){U.Logger.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting one of [${Object.keys(i).join(", ")}].`);return}const r=un(i[t]);if(r?.operation!=="$ref")return i[t];if(n.referencedParams?.has(r.values)){U.Logger.warnOnce(`\`$ref\` json operation failed on [${String(t)}] at [${e.join(".")}], circular reference detected with [${[...n.referencedParams].join(", ")}].`);return}return n.referencedParams?.add(r.values),Lm(r.values,e,i,s,n)}function GD(t,e,i,s){if(!(0,U.isString)(t))return;const n=i.__palette;if(["fill","fillFallback","stroke","gradient","range2"].includes(t)){const o=e.findLastIndex(u=>!isNaN(Number(u)));let a=Number(e[o]);if(isNaN(a))return;const l=e.slice(0,o),c=["map-shape-background","map-line-background"],h=Cr(s,l).slice(0,a).filter(u=>c.includes(u.type)).length;switch(a-=h,t){case"fill":return(0,U.circularSliceArray)(n.fills,1,a)[0];case"fillFallback":return(0,U.circularSliceArray)(n.fillsFallback,1,a)[0];case"stroke":return(0,U.circularSliceArray)(n.strokes,1,a)[0];case"gradient":return(0,U.circularSliceArray)(n.sequentialColors,1,a)[0];case"range2":return(0,U.circularSliceArray)(n.fills,2,a)}return}return t==="gradients"?n.sequentialColors:Cr(n,t)}function VD(t,e,i,s){let n=!1,r,o=!1,a=s;if((0,U.isArray)(t))n=!0,r=t[1],o=t.length===3,a=o?t[2]:a,t=t[0];else if(!(0,U.isString)(t)){U.Logger.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a string.`);return}const l=Am(o?[]:e,t);let c=a;for(const h of l){if(!Yi(h,c)){if(n)return r;U.Logger.warnOnce(`\`$path\` json operation failed on [${String(t)}] at [${e.join(".")}] resolved to [${l.join(".")}], could not find path in object.`);return}c=c[h]}return Object.isFrozen(c)?Ft(c):c}function UD(t,e,i,s){const n=(0,U.isString)(t)?Am(e,t):e,r=n.length===0?s:Cr(s,n);return un(r)!=null}function YD([t],e){if(typeof t=="number")return t%2===0;U.Logger.warnOnce(`\`$isEven\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function WD([t,e],i){if(typeof t=="number"&&typeof e=="number")return t*e;U.Logger.warnOnce(`\`$mul\` json operation failed on [${String(t)}] and [${String(e)}] at [${i.join(".")}], expecting two numbers.`)}function $D([t],e){if(typeof t=="number")return Math.round(t);U.Logger.warnOnce(`\`$round\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function HD([t,e],i,s,n,r){const o=un(e);if(o&&(e=Jo(o.operation,o.values,s,n,i,r)),!(0,U.isArray)(e))return[];const a=un(t);return a?(r.matches.set(i.join("."),e),e.map(()=>({[a.operation]:a.values}))):[]}function KD([t,e],i,s,n,r){const o=un(e);if(o&&(e=Jo(o.operation,o.values,s,n,i,r)),!(0,U.isArray)(e))return;const a=un(t);return a?e.find(l=>Jo(a.operation,a.values,s,l,[],r)):t?e[0]:void 0}function ZD(t){if((0,U.isArray)(t)){for(const e of t)if(!(0,U.isPlainObject)(e))return;return gt(...t)}}function XD([t,e]){if(!(!(0,U.isArray)(t)||!(0,U.isPlainObject)(e)))return on(e,t)}function qD(t,e,i,s,n){if(t!=="$1"&&t!=="$index")return t;const r=e.findLastIndex(l=>!isNaN(Number(l)));if(r===-1)return t;const o=Number(e[r]);if(t==="$index")return o;const a=e.slice(0,r).join(".");return n.matches.get(a)?.at(o)}function QD([t],e,i){const s="fontSize";if(Yi(s,i)&&typeof i[s]=="number"&&typeof t=="number")return Math.round(t*i[s]);U.Logger.warnOnce(`\`$rem\` json operation failed on [${String(t)}] at [${e.join(".")}], expecting a number.`)}function JD([t,e,i],s){const n=`\`$mix\` json operation failed on [${String(t)}, ${String(e)}, ${String(i)}] at [${s.join(".")}], expecting`,r=`${n} two colors and a number between 0 and 1.`;if(typeof e!="string"||!Xl(i)){U.Logger.warnOnce(r);return}if(typeof t=="string")try{return Dt.mix(Dt.fromString(t),Dt.fromString(e),i).toString()}catch{U.Logger.warnOnce(r);return}if(!Im(t)){U.Logger.warnOnce(r);return}let o=t.colorStops;try{o=o?.map(a=>{let l;return typeof a.color=="string"&&(l=Dt.mix(Dt.fromString(a.color),Dt.fromString(e),i).toString()),{...a,color:l}})}catch{U.Logger.warnOnce(`${n} a gradient, a color and a number between 0 and 1.`);return}return{...t,colorStops:o}}function tI([t],e,i){const s="foregroundColor",n="backgroundColor";if(Yi(s,i)&&Yi(n,i)&&typeof i[s]=="string"&&typeof i[n]=="string"&&Xl(t))return Dt.mix(Dt.fromString(i[s]),Dt.fromString(i[n]),t).toString();U.Logger.warnOnce(`\`$foregroundBackgroundMix\` json operation failed on [${String(t)}}}] at [${e.join(".")}], expecting a number between 0 and 1.`)}function eI([t,e],i,s){const n="foregroundColor",r="backgroundColor",o="accentColor";if(Yi(n,s)&&Yi(r,s)&&Yi(o,s)&&typeof s[n]=="string"&&typeof s[r]=="string"&&typeof s[o]=="string"&&Xl(t)&&Xl(e))return Dt.mix(Dt.mix(Dt.fromString(s[n]),Dt.fromString(s[r]),t),Dt.fromString(s[o]),e).toString();U.Logger.warnOnce(`\`$foregroundBackgroundAccentMix\` json operation failed on [${String(t)}, ${String(e)}}] at [${i.join(".")}], expecting two numbers between 0 and 1.`)}function iI([t,e]){if(!(!(0,U.isArray)(t)||!(0,U.isNumber)(e)))return Dt.interpolate(t.map(i=>Dt.fromString(i)),e).map(i=>i.toString())}var Cm=(w(),k(T)),sI=class{constructor(){this.available=!0,this.acquireQueue=[]}acquire(t){return new Promise(e=>{this.acquireQueue.push([t,e]),this.available&&this.dispatchNext().catch(i=>Cm.Logger.errorOnce(i))})}async acquireImmediately(t){return this.available?(await this.acquire(t),!0):!1}async waitForClearAcquireQueue(){return this.acquire(()=>Promise.resolve(void 0))}async dispatchNext(){this.available=!1;let[t,e]=this.acquireQueue.shift()??[];for(;t;){try{await t(),e?.()}catch(i){Cm.Logger.error("mutex callback error",i),e?.()}[t,e]=this.acquireQueue.shift()??[]}this.available=!0}},Nm=class{constructor(){this.eventListeners=new Map}addEventListener(t,e){if(typeof e!="function")throw new Error("AG Charts - listener must be a Function");const i=this.eventListeners.get(t);i?i.add(e):this.eventListeners.set(t,new Set([e]))}removeEventListener(t,e){const i=this.eventListeners.get(t);i!=null&&(i.delete(e),i.size===0&&this.eventListeners.delete(t))}hasEventListener(t){return this.eventListeners.has(t)}clearEventListeners(){this.eventListeners.clear()}fireEvent(t){this.eventListeners.get(t.type)?.forEach(e=>e(t))}},dn=class extends nt{constructor(t=0,e=t,i=t,s=e){super(),this.top=t,this.right=e,this.bottom=i,this.left=s}};g([b(j)],dn.prototype,"top",2),g([b(j)],dn.prototype,"right",2),g([b(j)],dn.prototype,"bottom",2),g([b(j)],dn.prototype,"left",2);var nI=(w(),k(T));function kt(t,e){const i=(0,nI.isArray)(t)?t:t.split(".");if(i.length===1){const[s]=i;return Ls((n,r,o)=>n[s]=o,n=>n[s],e)}return Ls((s,n,r)=>au(s,i,r),s=>Cr(s,i),e)}function rI(t){return Ls((e,i,s)=>e[t]=s)}function De(t,e){return Ls((i,s,n)=>i[t][e??s]=n)}function ni(t){const{newValue:e,oldValue:i,changeValue:s}=t;return Ls((n,r,o,a)=>(o!==a&&(a!==void 0&&i?.call(n,a),o!==void 0&&e?.call(n,o),s?.call(n,o,a)),o))}function pn(t){return Uf(t)}var oI=(w(),k(T));function aI(t){return Tm((e,i)=>(0,oI.getWindow)().requestAnimationFrame(e),t)}function lI(t){return Tm((e,i=0)=>{i===0?queueMicrotask(e):setTimeout(e,i)},t)}function Tm(t,e){let i=0,s=!1,n,r;const o=()=>s,a=()=>{s=!1,r?.(),r=void 0,n=void 0,i>0&&t(l)},l=()=>{const c=i;i=0,s=!0;const h=e({count:c});if(!h){a();return}h.then(a,a)};return{schedule(c){i===0&&!o()&&t(l,c),i++},async await(){if(o())for(n==null&&(n=new Promise(c=>{r=c}));o();)await n}}}var Eu=(w(),k(T)),km=(w(),k(T));function Vn(t){return t==="true"}function cI(t){return Number(t)}function Wi(t){return t}var hI={role:Wi,"aria-checked":Vn,"aria-controls":Wi,"aria-describedby":Wi,"aria-disabled":Vn,"aria-expanded":Vn,"aria-haspopup":Vn,"aria-hidden":Vn,"aria-label":Wi,"aria-labelledby":Wi,"aria-live":Wi,"aria-orientation":Wi,"aria-selected":Vn,"data-preventdefault":Vn,class:Wi,id:Wi,tabindex:cI,title:Wi,placeholder:Wi};function wt(t,e,i){i==null||i===""||i===""?t?.removeAttribute(e):t?.setAttribute(e,i.toString())}function Un(t,e){if(e!=null)for(const[i,s]of(0,km.entries)(e))i!=="class"&&wt(t,i,s)}function Ql(t,e,i){if(!(t instanceof HTMLElement))return;const s=t.getAttribute(e);return s===null?i:hI[e]?.(s)??void 0}function $i(t,e,i){t!=null&&(i==null?t.style.removeProperty(e):t.style.setProperty(e,i.toString()))}function uI(t,e){for(const[i,s]of(0,km.entries)(e))$i(t,i,s)}var Ou=["blur","change","contextmenu","focus","keydown","keyup","click","dblclick","mouseenter","mousemove","mouseleave","wheel","touchstart","touchmove","touchend","touchcancel"];function _r(t,e,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o}=e,{currentX:a,currentY:l}=ws.calcCurrentXY(i,e);return{type:t,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:e}}function Jl(t,e,i){return{type:t,sourceEvent:e}}var dI={blur:t=>({type:"blur",sourceEvent:t}),change:t=>({type:"change",sourceEvent:t}),contextmenu:(t,e)=>_r("contextmenu",t,e),focus:t=>({type:"focus",sourceEvent:t}),keydown:t=>({type:"keydown",sourceEvent:t}),keyup:t=>({type:"keyup",sourceEvent:t}),click:(t,e)=>_r("click",t,e),dblclick:(t,e)=>_r("dblclick",t,e),mouseenter:(t,e)=>_r("mouseenter",t,e),mousemove:(t,e)=>_r("mousemove",t,e),mouseleave:(t,e)=>_r("mouseleave",t,e),wheel:t=>{const{offsetX:e,offsetY:i,clientX:s,clientY:n}=t,r=t.deltaMode===0?.01:1,o=t.deltaX*r,a=t.deltaY*r;return{type:"wheel",offsetX:e,offsetY:i,clientX:s,clientY:n,deltaX:o,deltaY:a,sourceEvent:t}},touchstart:(t,e)=>Jl("touchstart",t,e),touchmove:(t,e)=>Jl("touchmove",t,e),touchend:(t,e)=>Jl("touchend",t,e),touchcancel:(t,e)=>Jl("touchcancel",t,e)},ws=class{static alloc(t,e,i){return dI[t](e,i)}static isHTMLEvent(t){return Ou.includes(t)}static calcCurrentXY(t,e){const i=t.getBoundingClientRect();return{currentX:e.clientX-i.x,currentY:e.clientY-i.y}}},pI=(w(),k(T)),gI=class{constructor(){this.widgetListeners={},this.sourceListeners={}}initSourceHandler(t,e){this.sourceListeners??(this.sourceListeners={}),this.sourceListeners[t]=e}lazyGetWidgetListeners(t,e){var i;if(!(t in(this.sourceListeners??{}))){const s=r=>{const o=ws.alloc(t,r,e.getElement());for(const a of this.widgetListeners?.[t]??[])a(o,e)},n={};t.startsWith("touch")&&(n.passive=!1),this.initSourceHandler(t,s),e.getElement().addEventListener(t,s,n)}return this.widgetListeners??(this.widgetListeners={}),(i=this.widgetListeners)[t]??(i[t]=[]),this.widgetListeners[t]}add(t,e,i){this.lazyGetWidgetListeners(t,e).push(i)}remove(t,e,i){const s=this.lazyGetWidgetListeners(t,e),n=s.indexOf(i);n>-1&&s.splice(n,1)}destroy(t){for(const[e,i]of(0,pI.entries)(this.sourceListeners??{}))t.getElement().removeEventListener(e,i);this.widgetListeners=void 0,this.sourceListeners=void 0}},fI=(w(),k(T)),mI=class{constructor(t,e,i,s){this.glob=t,this.self=e,this.window=(0,fI.getWindow)(),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;n.addEventListener("mousedown",r,{capture:!0}),n.addEventListener("mouseenter",r,{capture:!0}),n.addEventListener("mouseleave",r,{capture:!0}),n.addEventListener("mouseout",r,{capture:!0}),n.addEventListener("mouseover",r,{capture:!0}),n.addEventListener("mousemove",o,{capture:!0}),n.addEventListener("mouseup",a,{capture:!0}),e.mouseDragger=this,t.globalMouseDragCallbacks=i,t.globalMouseDragCallbacks.mousedown(s)}destroy(){const{window:t,mousegeneral:e,mousemove:i,mouseup:s}=this;t.removeEventListener("mousedown",e,{capture:!0}),t.removeEventListener("mouseenter",e,{capture:!0}),t.removeEventListener("mouseleave",e,{capture:!0}),t.removeEventListener("mouseout",e,{capture:!0}),t.removeEventListener("mouseover",e,{capture:!0}),t.removeEventListener("mousemove",i,{capture:!0}),t.removeEventListener("mouseup",s,{capture:!0}),this.glob.globalMouseDragCallbacks=void 0,this.self.mouseDragger=void 0}};function yI(t,e,i,s){if(t.globalMouseDragCallbacks==null)return new mI(t,e,i,s)}var bI=(w(),k(T)),xI=500,vI=100;function MI(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY;return i*i+s*s}var Ru=!1,SI=class{constructor(t,e,i,s,n){this.glob=t,this.self=e,this.initialTouch=s,this.target=n,this.longTapInterrupted=!1,this.longtap=()=>{const{target:a,initialTouch:l}=this;if(!this.longTapInterrupted){a.dispatchEvent(new TouchEvent("touchcancel",{touches:[l],bubbles:!0})),Ru=!0;const c=f=>{f.preventDefault()},h=f=>{Ru=!1,f.preventDefault(),a.removeEventListener("touchmove",c),a.removeEventListener("touchend",h),a.removeEventListener("touchcancel",h)};a.addEventListener("touchmove",c,{passive:!1}),a.addEventListener("touchend",h,{passive:!1}),a.addEventListener("touchcancel",h,{passive:!1});const{clientX:u,clientY:d}=l,p=new PointerEvent("contextmenu",{bubbles:!0,cancelable:!0,view:(0,bI.getWindow)(),clientX:u,clientY:d,pointerType:"touch"});a.dispatchEvent(p)}},this.touchmove=a=>{const{glob:l,self:c,initialTouch:h}=this,u=this.findInitialFinger(a.targetTouches);u!=null&&(this.longTapInterrupted=this.longTapInterrupted||MI(h,u)>vI,c.dragTouchEnabled&&u!=null&&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,xI);const{touchmove:r,touchend:o}=this;n.addEventListener("touchmove",r,{passive:!1}),n.addEventListener("touchstart",o,{passive:!1}),n.addEventListener("touchend",o,{passive:!1}),n.addEventListener("touchcancel",o,{passive:!1}),e.touchDragger=this,t.globalTouchDragCallbacks=i}destroy(){const{longtapTimer:t,touchmove:e,touchend:i}=this;clearTimeout(t),this.target.removeEventListener("touchstart",i),this.target.removeEventListener("touchmove",e),this.target.removeEventListener("touchend",i),this.target.removeEventListener("touchcancel",i),this.glob.globalTouchDragCallbacks=void 0,this.self.touchDragger=void 0}findInitialFinger(...t){const e=t.map(i=>Array.from(i)).flat();return Array.from(e).find(i=>i.identifier===this.initialTouch.identifier)}};function DI(t,e,i,s,n){if(!(t.globalTouchDragCallbacks!=null||Ru))return new SI(t,e,i,s,n)}function Pu(t,e,i,s){const{currentX:n,currentY:r}=ws.calcCurrentXY(t.getElement(),s),o=s.pageX-i.pageX,a=s.pageY-i.pageY;return{type:e,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 II(t,{pageX:e,pageY:i}){const{x:s,y:n}=t.getElement().getBoundingClientRect();return{offsetX:e-s,offsetY:i-n}}function _u(t,e,i,s,n){const{currentX:r,currentY:o}=ws.calcCurrentXY(t.getElement(),n),a=n.pageX-i.pageX,l=n.pageY-i.pageY;return{type:e,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 wm={},Em=class{constructor(t){this.dispatchCallback=t,this.dragTouchEnabled=!0}destroy(){this.dragTriggerRemover?.(),this.dragTriggerRemover=void 0,this.dragStartListeners=void 0,this.dragMoveListeners=void 0,this.dragEndListeners=void 0,this.mouseDragger?.destroy(),this.touchDragger?.destroy()}add(t,e,i){switch(t){case"drag-start":{this.dragStartListeners??(this.dragStartListeners=[]),this.dragStartListeners.push(i),this.registerDragTrigger(e);break}case"drag-move":{this.dragMoveListeners??(this.dragMoveListeners=[]),this.dragMoveListeners.push(i),this.registerDragTrigger(e);break}case"drag-end":{this.dragEndListeners??(this.dragEndListeners=[]),this.dragEndListeners.push(i),this.registerDragTrigger(e);break}}}remove(t,e,i){switch(t){case"drag-start":return this.removeHandler(this.dragStartListeners,i);case"drag-move":return this.removeHandler(this.dragMoveListeners,i);case"drag-end":return this.removeHandler(this.dragEndListeners,i)}}removeHandler(t,e){const i=t?.indexOf(e);i!==void 0&&t?.splice(i,1)}registerDragTrigger(t){if(this.dragTriggerRemover==null){const e=s=>this.triggerMouseDrag(t,s),i=s=>this.triggerTouchDrag(t,s);t.getElement().addEventListener("mousedown",e),t.getElement().addEventListener("touchstart",i,{passive:!1}),this.dragTriggerRemover=()=>{t.getElement().removeEventListener("mousedown",e),t.getElement().removeEventListener("touchstart",i)}}}triggerMouseDrag(t,e){e.button===0&&this.startMouseDrag(t,e)}startMouseDrag(t,e){const i={pageX:NaN,pageY:NaN,offsetX:NaN,offsetY:NaN};lu(["pageX","pageY","offsetX","offsetY"],i,e);const s={mousedown:n=>{const r=Pu(t,"drag-start",i,n);this.dispatch("drag-start",t,r)},mousemove:n=>{const r=Pu(t,"drag-move",i,n);this.dispatch("drag-move",t,r)},mouseup:n=>{const r=Pu(t,"drag-end",i,n);this.dispatch("drag-end",t,r),this.endDrag(t,r)}};this.mouseDragger=yI(wm,this,s,e)}endDrag(t,{sourceEvent:e,clientX:i,clientY:s}){const n=t.getElement(),r=n.getBoundingClientRect();Al.containsPoint(r,i,s)||(n.dispatchEvent(new MouseEvent("mouseleave",e)),e.target?.dispatchEvent(new MouseEvent("mouseenter",e)))}triggerTouchDrag(t,e){const i=e.targetTouches[0];e.targetTouches.length===1&&i!=null&&this.startOneFingerTouch(t,e,i)}startOneFingerTouch(t,e,i){const s={pageX:NaN,pageY:NaN,...II(t,i)};lu(["pageX","pageY"],s,i);const n={touchmove:(a,l)=>{const c=_u(t,"drag-move",s,a,l);this.dispatch("drag-move",t,c)},touchend:(a,l)=>{const c=_u(t,"drag-end",s,a,l);this.dispatch("drag-end",t,c)}},r=t.getElement();this.touchDragger=DI(wm,this,n,i,r);const o=_u(t,"drag-start",s,e,i);this.dispatch("drag-start",t,o)}dispatch(t,e,i){switch(t){case"drag-start":this.dragStartListeners?.forEach(s=>s(i,e));break;case"drag-move":this.dragMoveListeners?.forEach(s=>s(i,e));break;case"drag-end":this.dragEndListeners?.forEach(s=>s(i,e));break}this.dispatchCallback(t,i)}},AI=class{constructor(t){this.elem=t}setBounds(t){Hl(this.elemContainer??this.elem,t)}getBounds(){return xm(this.elemContainer??this.elem)}static setElementContainer(t,e){const i=t.getBounds();Hl(e,i),uI(t.elem,{width:"100%",height:"100%"}),t.elem.remove(),t.elemContainer=e,t.elemContainer.replaceChildren(t.elem)}},gs=class extends AI{constructor(t){super(t),this.elem=t,this.index=NaN,this.children=[]}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(t=>{t.parent=void 0,t.destroy()}),this.children.length=0,this.destructor(),this.elem.remove(),this.elemContainer?.remove(),this.internalListener?.destroy(),this.htmlListener?.destroy(this)}setHidden(t){$i(this.elem,"display",t?"none":void 0)}isHidden(){return(0,Eu.getWindow)()?.getComputedStyle?.(this.elem).display==="none"}setCursor(t){$i(this.elem,"cursor",t)}setTextContent(t){this.elem.textContent=t??null}setAriaDescribedBy(t){wt(this.elem,"aria-describedby",t)}setAriaHidden(t){wt(this.elem,"aria-hidden",t)}setAriaLabel(t){wt(this.elem,"aria-label",t)}setInnerHTML(t){this.elem.innerHTML=t}isDisabled(){return Ql(this.elem,"aria-disabled",!1)}parseFloat(t){return t===""?0:parseFloat(t)}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(){this.elem.focus()}setPreventsDefault(t){wt(this.elem,"data-preventdefault",t)}setTabIndex(t){wt(this.elem,"tabindex",t)}addChild(t){this.addChildToDOM(t,this.getBefore(t)),this.children.push(t),t.index=this.children.length-1,t.parent=this,this.onChildAdded(t)}removeChild(t){const e=this.children.findIndex(i=>i===t);this.children.splice(e,1),this.removeChildFromDOM(t),this.onChildRemoved(t)}moveChild(t,e){t.domIndex!==e&&(t.domIndex=e,this.removeChildFromDOM(t),this.addChildToDOM(t,this.getBefore(t)))}addClass(...t){this.elem.classList.add(...t)}removeClass(...t){this.elem.classList.remove(...t)}toggleClass(t,e){this.elem.classList.toggle(t,e)}appendOrInsert(t,e){e?e.getElement().insertAdjacentElement("beforebegin",t):this.elem.appendChild(t)}addChildToDOM(t,e){this.appendOrInsert(t.getElement(),e)}removeChildFromDOM(t){this.elem.removeChild(t.getElement())}onChildAdded(t){}onChildRemoved(t){}getBefore({domIndex:t}){if(t!==void 0)return this.children.filter(e=>e.domIndex!==void 0&&e.domIndex>t).reduce((e,i)=>!e||i.domIndex<e.domIndex?i:e,void 0)}addListener(t,e){return ws.isHTMLEvent(t)?(this.htmlListener??(this.htmlListener=new gI),this.htmlListener.add(t,this,e)):(this.internalListener??(this.internalListener=new Em(this.onDispatch.bind(this))),this.internalListener.add(t,this,e)),()=>this.removeListener(t,e)}removeListener(t,e){ws.isHTMLEvent(t)?this.htmlListener?.remove(t,this,e):this.htmlListener!=null&&this.internalListener?.remove(t,this,e)}setDragTouchEnabled(t){this.internalListener??(this.internalListener=new Em(this.onDispatch.bind(this))),this.internalListener.dragTouchEnabled=t}onDispatch(t,e){if(!e.sourceEvent.bubbles)return;let{parent:i}=this;for(;i!=null;){const{internalListener:s}=i;if(s!=null){const n={...e,...ws.calcCurrentXY(i.getElement(),e)};s.dispatch(t,i,n)}i=i.parent}}static addWindowEvent(t,e){const i=s=>{s.persisted||e()};return(0,Eu.getWindow)().addEventListener("pagehide",i),()=>(0,Eu.getWindow)().removeEventListener("pagehide",i)}},LI=(w(),k(T));function CI(t=0,e=0){return new OffscreenCanvas(t,e).getContext("2d")}var ju=class{constructor(t=5){this.maxCacheSize=t,this.store=new Map}get(t){if(!this.store.has(t))return;const e=this.store.get(t);return this.store.delete(t),this.store.set(t,e),e}has(t){return this.store.has(t)}set(t,e){if(this.store.set(t,e),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 e}clear(){this.store.clear()}},Es=class{static measureText(t,e){return this.getMeasurer(e).measureText(t)}static measureLines(t,e){return this.getMeasurer(e).measureLines(t)}static getMeasurer(t){const e=typeof t.font=="string"?t.font:Bt.toFontString(t.font),i=`${e}-${t.textAlign??"start"}-${t.textBaseline??"alphabetic"}`;return this.instanceMap.get(i)??this.createFontMeasurer(e,t,i)}static createFontMeasurer(t,e,i){const s=CI();s.font=t,s.textAlign=e.textAlign??"start",s.textBaseline=e.textBaseline??"alphabetic";const n=new Om(s,e);return this.instanceMap.set(i,n),n}};Es.instanceMap=new ju(10);var Om=class{constructor(t,e){this.ctx=t,this.measureMap=new ju(100),e.textAlign&&(t.textAlign=e.textAlign),e.textBaseline&&(t.textBaseline=e.textBaseline),t.font=typeof e.font=="string"?e.font:Bt.toFontString(e.font),this.textMeasurer=new Fu(i=>this.cachedCtxMeasureText(i),e.textBaseline??"alphabetic")}textWidth(t,e){return this.textMeasurer.textWidth(t,e)}measureText(t){return this.textMeasurer.measureText(t)}measureLines(t){return this.textMeasurer.measureLines(t)}cachedCtxMeasureText(t){if(!this.measureMap.has(t)){const e=this.ctx.measureText(t);this.measureMap.set(t,{actualBoundingBoxAscent:e.actualBoundingBoxAscent,emHeightAscent:e.emHeightAscent,emHeightDescent:e.emHeightDescent,actualBoundingBoxDescent:e.actualBoundingBoxDescent,actualBoundingBoxLeft:e.actualBoundingBoxLeft,actualBoundingBoxRight:e.actualBoundingBoxRight,alphabeticBaseline:e.alphabeticBaseline,fontBoundingBoxAscent:e.fontBoundingBoxAscent,fontBoundingBoxDescent:e.fontBoundingBoxDescent,hangingBaseline:e.hangingBaseline,ideographicBaseline:e.ideographicBaseline,width:e.width})}return this.measureMap.get(t)}},Bt=class{static toFontString({fontSize:t=10,fontStyle:e,fontWeight:i,fontFamily:s,lineHeight:n}){let r="";return e&&(r+=`${e} `),i&&(r+=`${i} `),r+=`${t}px`,n&&(r+=`/${n}px`),r+=` ${s}`,r.trim()}static getLineHeight(t){return Math.ceil(t*this.defaultLineHeight)}static getVerticalModifier(t){switch(t){case"hanging":case"top":return 0;case"middle":return .5;case"alphabetic":case"bottom":case"ideographic":default:return 1}}};Bt.EllipsisChar="\u2026",Bt.defaultLineHeight=1.15,Bt.lineSplitter=/\r?\n/g;var Fu=class{constructor(t,e="alphabetic"){this.measureTextFn=t,this.textBaseline=e,this.charMap=new Map}getMetrics(t){const e=this.measureTextFn(t);return e.fontBoundingBoxAscent??(e.fontBoundingBoxAscent=e.emHeightAscent),e.fontBoundingBoxDescent??(e.fontBoundingBoxDescent=e.emHeightDescent),{width:e.width,height:e.actualBoundingBoxAscent+e.actualBoundingBoxDescent,lineHeight:e.fontBoundingBoxAscent+e.fontBoundingBoxDescent,offsetTop:e.actualBoundingBoxAscent,offsetLeft:e.actualBoundingBoxLeft}}getMultilineMetrics(t){let e=0,i=0,s=0,n=0,r=0;const o=Bt.getVerticalModifier(this.textBaseline),a=[];let l=0;const c=t.length;for(const h of t){const u=this.measureTextFn(h);u.fontBoundingBoxAscent??(u.fontBoundingBoxAscent=u.emHeightAscent),u.fontBoundingBoxDescent??(u.fontBoundingBoxDescent=u.emHeightDescent),e<u.width&&(e=u.width),n<u.actualBoundingBoxLeft&&(n=u.actualBoundingBoxLeft),l===0?(i+=u.actualBoundingBoxAscent,s+=u.actualBoundingBoxAscent):r+=u.fontBoundingBoxAscent,l===c-1?i+=u.actualBoundingBoxDescent:r+=u.fontBoundingBoxDescent,a.push({text:h,width:u.width,height:u.actualBoundingBoxAscent+u.actualBoundingBoxDescent,lineHeight:u.fontBoundingBoxAscent+u.fontBoundingBoxDescent,offsetTop:u.actualBoundingBoxAscent,offsetLeft:u.actualBoundingBoxLeft}),l++}return i+=r,s+=r*o,{width:e,height:i,offsetTop:s,offsetLeft:n,lineMetrics:a}}textWidth(t,e){if(e){let i=0;for(let s=0;s<t.length;s++)i+=this.textWidth(t.charAt(s));return i}return t.length>1?this.measureTextFn(t).width:this.charMap.get(t)??this.charWidth(t)}measureText(t){return this.getMetrics(t)}measureLines(t){const e=typeof t=="string"?t.split(Bt.lineSplitter):t;return this.getMultilineMetrics(e)}charWidth(t){const{width:e}=this.measureTextFn(t);return this.charMap.set(t,e),e}},yi=class Oh extends ki{constructor(){super(...arguments),this.x=0,this.y=0,this.lines=[],this.text=void 0,this.fontSize=10,this.fontFamily="sans-serif",this.textAlign=Oh.defaultStyles.textAlign,this.textBaseline=Oh.defaultStyles.textBaseline}onTextChange(){this.lines=this.text?.split(`
`).map(e=>e.trim())??[]}static computeBBox(e,i,s,n){const{offsetTop:r,offsetLeft:o,width:a,height:l}=Es.measureLines(e,n);return new B(i-o,s-r,a,l)}computeBBox(){const{x:e,y:i,lines:s,textBaseline:n,textAlign:r}=this;return Oh.computeBBox(s,e,i,{font:this,textBaseline:n,textAlign:r})}isPointInPath(e,i){const s=this.getBBox();return s?s.containsPoint(e,i):!1}render(e){const{ctx:i,stats:s}=e;if(!this.lines.length||!this.layerManager)return s&&(s.nodesSkipped+=1),super.render(e);const{fill:n,stroke:r,strokeWidth:o}=this,{pixelRatio:a}=this.layerManager.canvas;if(!n&&!(r!=null&&o>0))return super.render(e);const l=Bt.toFontString(this);if(i.font!==l&&(i.font=l),i.textAlign=this.textAlign,i.textBaseline=this.textBaseline,n){this.applyFill(i),i.globalAlpha*=this.opacity*this.fillOpacity;const{fillShadow:c}=this;c?.enabled&&(i.shadowColor=c.color,i.shadowOffsetX=c.xOffset*a,i.shadowOffsetY=c.yOffset*a,i.shadowBlur=c.blur*a),this.renderLines((h,u,d)=>i.fillText(h,u,d))}if(r&&o){this.applyStroke(i),i.lineWidth=o,i.globalAlpha*=this.opacity*this.strokeOpacity;const{lineDash:c,lineDashOffset:h,lineCap:u,lineJoin:d}=this;c&&i.setLineDash(c),h&&(i.lineDashOffset=h),u&&(i.lineCap=u),d&&(i.lineJoin=d),this.renderLines((p,f,y)=>i.strokeText(p,f,y))}super.render(e)}renderLines(e){const{lines:i,x:s,y:n}=this,r=this.lineHeight??Bt.getLineHeight(this.fontSize);let o=(r-r*i.length)*Bt.getVerticalModifier(this.textBaseline);for(const a of i)e(a,s,n+o),o+=r}setFont(e){this.fontFamily=e.fontFamily,this.fontSize=e.fontSize,this.fontStyle=e.fontStyle,this.fontWeight=e.fontWeight}setAlign(e){this.textAlign=e.textAlign,this.textBaseline=e.textBaseline}toSVG(){if(!this.visible||!this.text)return;const e=(0,LI.createSvgElement)("text");return this.applySvgFillAttributes(e),e.setAttribute("font-family",this.fontFamily?.split(",")[0]??""),e.setAttribute("font-size",String(this.fontSize)),e.setAttribute("font-style",this.fontStyle??""),e.setAttribute("font-weight",String(this.fontWeight??"")),e.setAttribute("text-anchor",{center:"middle",left:"start",right:"end",start:"start",end:"end"}[this.textAlign??"start"]),e.setAttribute("alignment-baseline",{alphabetic:"alphabetic",top:"top",bottom:"bottom",hanging:"hanging",middle:"middle",ideographic:"ideographic"}[this.textBaseline??"alphabetic"]),e.setAttribute("x",String(this.x)),e.setAttribute("y",String(this.y)),e.textContent=this.text??"",{elements:[e]}}};yi.className="Text",yi.defaultStyles={...ki.defaultStyles,textAlign:"start",fontStyle:void 0,fontWeight:void 0,fontSize:10,fontFamily:"sans-serif",textBaseline:"alphabetic"},g([G()],yi.prototype,"x",2),g([G()],yi.prototype,"y",2),g([G({changeCb:t=>t.onTextChange()})],yi.prototype,"text",2),g([G()],yi.prototype,"fontStyle",2),g([G()],yi.prototype,"fontWeight",2),g([G()],yi.prototype,"fontSize",2),g([G()],yi.prototype,"fontFamily",2),g([G()],yi.prototype,"textAlign",2),g([G()],yi.prototype,"textBaseline",2),g([G()],yi.prototype,"lineHeight",2);var me=yi,Rm=class extends Pr(me){},jr=class extends Pr(Gn(me)){},zu=class{static wrapText(t,e){return this.wrapLines(t,e).join(`
`)}static wrapLines(t,e){const i=this.textWrap(t,e);return e.overflow==="hide"&&i.some(s=>s.endsWith(Bt.EllipsisChar))?[]:i}static appendEllipsis(t){return t.replace(/[.,]{1,5}$/,"")+Bt.EllipsisChar}static truncateLine(t,e,i,s){const n=e.textWidth(Bt.EllipsisChar);let r=0,o=0;for(;o<t.length;o++){const a=e.textWidth(t.charAt(o));if(r+a>i)break;r+=a}if(t.length===o&&(!s||r+n<=i))return s?t+Bt.EllipsisChar:t;for(t=t.slice(0,o).trimEnd();t.length&&e.textWidth(t)+n>i;)t=t.slice(0,-1).trimEnd();return t+Bt.EllipsisChar}static textWrap(t,e){const i=t.split(Bt.lineSplitter),s=Es.getMeasurer(e);if(e.textWrap==="never")return i.map(a=>this.truncateLine(a.trimEnd(),s,e.maxWidth));const n=[],r=e.textWrap==="hyphenate",o=e.textWrap==null||e.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>e.maxWidth){if(c===0)break;const p=s.textWidth(l.slice(0,c+1));if(p<=e.maxWidth){h=p,c++;continue}if(u){const x=this.getWordAt(l,u+1),m=s.textWidth(x);if(m<=e.maxWidth){n.push(l.slice(0,u).trimEnd()),l=l.slice(u).trimStart(),c=0,h=0,u=0;continue}else o&&m>e.maxWidth&&n.push(l.slice(0,u).trimEnd(),this.truncateLine(l.slice(u).trimStart(),s,e.maxWidth,!0))}else o&&n.push(this.truncateLine(l,s,e.maxWidth,!0));if(o){l="";break}const f=r?"-":"";let y=l.slice(0,c).trim();for(;y.length&&s.textWidth(y+f)>e.maxWidth;)y=y.slice(0,-1).trimEnd();if(n.push(y+f),!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,e),this.clipLines(n,s,e)}static getWordAt(t,e){const i=t.indexOf(" ",e);return i===-1?t.slice(e):t.slice(e,i)}static clipLines(t,e,i){if(!i.maxHeight)return t;const{height:s,lineMetrics:n}=e.measureLines(t);if(s<=i.maxHeight)return t;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=t.slice(0,r||1),c=l.pop();return l.concat(this.truncateLine(c,e,i.maxWidth,!0))}}return t}static avoidOrphans(t,e,i){if(i.avoidOrphans===!1||t.length<2)return;const{length:s}=t,n=t[s-1],r=t[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);e.textWidth(n+a)<=i.maxWidth&&(t[s-2]=r.slice(0,o),t[s-1]=a+" "+n)}},Gt=class extends nt{constructor(){super(...arguments),this.id=fi(this),this.node=new Rm({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(t,e){return t.layoutManager.addListener("layout:complete",()=>this.updateA11yText(t,e))}computeTextWrap(t,e){const{text:i,padding:s,wrapping:n}=this,r=Math.min(this.maxWidth??1/0,t)-s*2,o=this.maxHeight??e-s*2;if(!isFinite(r)&&!isFinite(o)){this.node.text=i;return}const a=zu.wrapText(i??"",{maxWidth:r,maxHeight:o,font:this,textWrap:n});this.node.text=a,this.truncated=a.includes(Bt.EllipsisChar)}updateA11yText(t,e){const{proxyInteractionService:i}=t;if(this.enabled&&this.text){const s=Kt.toCanvas(this.node);if(s){const{id:n}=this;this.proxyText??(this.proxyText=i.createProxyElement({type:"text",domManagerId:n,where:e})),this.proxyText.textContent=this.text,this.proxyText.setBounds(s),this.proxyText.addListener("mousemove",r=>this.handleMouseMove(t,r)),this.proxyText.addListener("mouseleave",r=>this.handleMouseLeave(t,r))}}else this.proxyText?.destroy(),this.proxyText=void 0}handleMouseMove(t,e){if(e!=null&&this.enabled&&this.node.visible&&this.truncated){const{x:i,y:s}=Kt.toCanvas(this.node),n=e.sourceEvent.offsetX+i,r=e.sourceEvent.offsetY+s;t.tooltipManager.updateTooltip(this.id,{canvasX:n,canvasY:r,showArrow:!1},[{type:"structured",title:this.text}])}}handleMouseLeave(t,e){t.tooltipManager.removeTooltip(this.id)}};Gt.SMALL_PADDING=10,g([b(H),De("node","visible")],Gt.prototype,"enabled",2),g([b(O,{optional:!0}),De("node")],Gt.prototype,"text",2),g([b(sm,{optional:!0}),De("node")],Gt.prototype,"textAlign",2),g([b(Ns,{optional:!0}),De("node")],Gt.prototype,"fontStyle",2),g([b(Ts,{optional:!0}),De("node")],Gt.prototype,"fontWeight",2),g([b(j),De("node")],Gt.prototype,"fontSize",2),g([b(O),De("node")],Gt.prototype,"fontFamily",2),g([b(dt,{optional:!0}),De("node","fill")],Gt.prototype,"color",2),g([b(j,{optional:!0})],Gt.prototype,"spacing",2),g([b(j,{optional:!0})],Gt.prototype,"maxWidth",2),g([b(j,{optional:!0})],Gt.prototype,"maxHeight",2),g([b(Gl)],Gt.prototype,"wrapping",2),g([b(j)],Gt.prototype,"padding",2),g([b(O)],Gt.prototype,"layoutStyle",2);var Bu=(t=>(t.X="x",t.Y="y",t))(Bu||{}),NI=(w(),k(T)),Gu=(t=>(t[t.Caption=0]="Caption",t[t.Legend=1]="Legend",t[t.ToolbarLeft=2]="ToolbarLeft",t[t.ToolbarBottom=3]="ToolbarBottom",t[t.Navigator=4]="Navigator",t[t.Overlay=5]="Overlay",t))(Gu||{}),Pm=class{constructor(){this.events=new NI.EventEmitter,this.elements=new Map}addListener(t,e){return this.events.on(t,e)}registerElement(t,e){return this.elements.has(t)?this.elements.get(t).add(e):this.elements.set(t,new Set([e])),()=>this.elements.get(t)?.delete(e)}createContext(t,e){const i=new TI(t,e);for(const s of Object.values(Gu))typeof s=="number"&&this.elements.get(s)?.forEach(n=>n(i));return i}emitLayoutComplete(t,e){const i="layout:complete",{width:s,height:n}=t;this.events.emit(i,{type:i,axes:e.axes??[],chart:{width:s,height:n},clipSeries:e.clipSeries??!1,series:e.series})}},TI=class{constructor(t,e){this.width=t,this.height=e,this.layoutBox=new B(0,0,t,e)}},tc=class{constructor(){this.title=new Gt,this.subtitle=new Gt,this.footnote=new Gt}positionCaptions(t){const{title:e,subtitle:i,footnote:s}=this,n=t.layoutBox.height/10;if(e.enabled){const{spacing:r}=e;this.positionCaption("top",e,t.layoutBox,n),this.shrinkLayoutByCaption("top",e,t.layoutBox,r)}i.enabled&&(this.positionCaption("top",i,t.layoutBox,n),this.shrinkLayoutByCaption("top",i,t.layoutBox,i.spacing)),s.enabled&&(this.positionCaption("bottom",s,t.layoutBox,n),this.shrinkLayoutByCaption("bottom",s,t.layoutBox,s.spacing))}positionAbsoluteCaptions(t){const{title:e,subtitle:i,footnote:s}=this,{rect:n}=t.series;for(const r of[e,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(t,e){return t==="left"?e.x:t==="right"?e.x+e.width:e.x+e.width/2}positionCaption(t,e,i,s){const n=Math.max(Bt.getLineHeight(e.fontSize),s);e.node.x=this.computeX(e.textAlign,i)+e.padding,e.node.y=i.y+(t==="top"?0:i.height)+e.padding,e.node.textBaseline=t,e.computeTextWrap(i.width,n)}shrinkLayoutByCaption(t,e,i,s=0){if(e.layoutStyle==="block"){const n=e.node.getBBox();i.shrink(Math.ceil(t==="top"?n.y-i.y+n.height+s:i.y+i.height-n.y+s),t)}}};g([b(F)],tc.prototype,"title",2),g([b(F)],tc.prototype,"subtitle",2),g([b(F)],tc.prototype,"footnote",2);var kI=(w(),k(T)),wI=["candlestick","hollow-candlestick","ohlc","line","step-line","hlc","high-low"],EI=class{constructor(t){this.chartService=t,this.mementoOriginatorKey="chartType"}createMemento(){let t=this.chartService.publicApi?.getOptions()?.chartType;return t==null&&(t="candlestick"),t}guardMemento(t){return t==null||wI.includes(t)}restoreMemento(t,e,i){if(i==null)return;const s={chartType:i};this.chartService.publicApi?.updateDelta(s).catch(n=>kI.Logger.error("error restoring state",n))}},_m=class{constructor(){this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns.length=0}setFns(t){this.destroy(),this.destroyFns=t}push(...t){this.destroyFns.push(...t)}},Fr="11.2.1",jm=Symbol("previous-memento-not-found"),OI=class{constructor(t){this.history=[],this.historyIndex=-1,this.originators=new Map,this.clearState=new Map,this.maxHistoryLength=100,this.debug=vt.create(!0,"history"),this.destroyFns=new _m,this.destroyFns.setFns([t.addListener("series-undo",this.undo.bind(this)),t.addListener("series-redo",this.redo.bind(this))])}destroy(){this.destroyFns.destroy()}addMementoOriginator(t){this.originators.set(t.mementoOriginatorKey,t),this.clearState.set(t.mementoOriginatorKey,t.createMemento()),this.debugEvent("History add originator:",t.mementoOriginatorKey)}clear(){this.debug("History clear:",Object.keys(this.originators)),this.history=[],this.historyIndex=-1;for(const[t,e]of this.originators.entries())this.clearState.set(t,e.createMemento())}record(t,...e){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 e){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:t,mementos:i}),this.historyIndex=this.history.length-1,this.debugEvent(`History record: [${t}]`)}undo(){const t=this.history[this.historyIndex];if(t){for(const e of t.mementos.keys()){const i=this.findPreviousMemento(e);if(i===jm)throw new Error(`Could not find previous memento for [${e}].`);this.restoreMemento(e,i)}this.historyIndex-=1,this.debugEvent(`History undo: [${t.label}]`)}}redo(){const t=this.history[this.historyIndex+1];if(t){for(const[e,i]of t.mementos.entries())this.restoreMemento(e,i);this.historyIndex+=1,this.debugEvent(`History redo: [${t.label}]`)}}findPreviousMemento(t){for(let e=this.historyIndex-1;e>=0;e--)if(this.history[e].mementos.has(t))return this.history[e].mementos.get(t);return this.clearState.has(t)?this.clearState.get(t):jm}restoreMemento(t,e){this.originators.get(t)?.restoreMemento(Fr,Fr,e)}debugEvent(...t){this.debug(...t,this.history.map((e,i)=>i===this.historyIndex?`** ${e.label} **`:e.label))}},zr=(w(),k(T)),Fm=class jg{constructor(e){this.version=e.split("-")[0]}save(...e){const i={version:this.version};for(const s of Object.values(e))i[s.mementoOriginatorKey]=this.encode(s,s.createMemento());return i}restore(e,...i){if(typeof e!="object"){zr.Logger.warnOnce(`Could not restore data of type [${typeof e}], expecting an object, ignoring.`);return}if(e==null){zr.Logger.warnOnce("Could not restore data of type [null], expecting an object, ignoring.");return}if(!("version"in e)||typeof e.version!="string"){zr.Logger.warnOnce("Could not restore data, missing [version] string in object, ignoring.");return}for(const s of i){const n=this.decode(s,e[s.mementoOriginatorKey]),r=[];if(!s.guardMemento(n,r)){const o=r.length>0?`

${r.join(`

`)}

`:"";zr.Logger.warnOnce(`Could not restore [${s.mementoOriginatorKey}] data, value was invalid, ignoring.${o}`,n);return}s.restoreMemento(this.version,e.version,n)}}encode(e,i){try{return JSON.parse(JSON.stringify(i,jg.encodeTypes))}catch(s){throw new Error(`Failed to encode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}decode(e,i){if(i==null)return i;try{return JSON.parse(JSON.stringify(i),jg.decodeTypes)}catch(s){throw new Error(`Failed to decode [${e.mementoOriginatorKey}] value [${s}].`,{cause:s})}}static encodeTypes(e,i){return(0,zr.isDate)(this[e])?{__type:"date",value:this[e].toISOString()}:i}static decodeTypes(e,i){return(0,zr.isObject)(this[e])&&"__type"in this[e]&&this[e].__type==="date"?new Date(this[e].value):i}},RI=class{constructor(){this.caretaker=new Fm(Fr),this.state=new Map}setState(t,e){cs(this.state.get(t.mementoOriginatorKey),e)||this.setStateAndRestore(t,e)}setStateAndRestore(t,e){this.state.set(t.mementoOriginatorKey,e),this.restoreState(t)}restoreState(t){const{caretaker:e,state:i}=this;if(!i.has(t.mementoOriginatorKey))return;const s=i.get(t.mementoOriginatorKey);e.restore({version:e.version,[t.mementoOriginatorKey]:s},t)}},bi=(w(),k(T)),PI=`.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-foreground-color: #464646;--ag-charts-font-family: Verdana, sans-serif;--ag-charts-font-size: 12px;--ag-charts-font-weight: 400;--ag-charts-padding: 20px;--ag-charts-shadow-color: #00000080;--ag-charts-subtle-text-color: #8c8c8c;--ag-charts-text-color: #464646;--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-input-background-color: #fff;--ag-charts-input-text-color: #464646;--ag-charts-crosshair-label-background-color: #fff;--ag-charts-crosshair-label-text-color: #464646;--ag-charts-spacing: 4px;--ag-charts-border-radius: 4px;--ag-charts-shadow: 0 2px 8px 0 color-mix(in srgb, black 8%, transparent);--ag-charts-focus-shadow: 0 0 0 3px var(--ag-charts-accent-color);--ag-charts-focus-color: color-mix(in srgb, var(--ag-charts-background-color), var(--ag-charts-accent-color) 12%);--ag-charts-input-border-color: var(--ag-charts-border-color);--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-background-color: var(--ag-charts-background-color);--ag-charts-button-border-color: var(--ag-charts-border-color);--ag-charts-button-border-radius: var(--ag-charts-border-radius);--ag-charts-button-text-color: var(--ag-charts-text-color);--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-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: solid 1px var(--ag-charts-border-color);--ag-charts-focus-border: solid 1px 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-shadow: 0 2px 12px 0 color-mix(in srgb, black 33.3%, transparent);--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-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:1px solid var(--ag-charts-border-color);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:1px solid var(--ag-charts-input-border-color);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:1px solid var(--ag-charts-border-color);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-chrome-text-color);background:var(--ag-charts-chrome-background-color);border:var(--ag-charts-border);border-radius:var(--ag-charts-border-radius);box-shadow:var(--ag-charts-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-chrome-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-chrome-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-shadow);z-index:var(--ag-charts-layer-ui-overlay)}.ag-charts-menu{--item-padding: 6px 12px;--icon-color: var(--ag-charts-chrome-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-border);color:var(--ag-charts-chrome-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}
`,_I=(w(),k(T)),Os=class{constructor(){this.registeredListeners=new Map}addListener(t,e){const i={symbol:Symbol(t),handler:e};return this.registeredListeners.has(t)?this.registeredListeners.get(t).push(i):this.registeredListeners.set(t,[i]),()=>this.removeListener(i.symbol)}removeListener(t){for(const[e,i]of this.registeredListeners.entries()){const s=i.findIndex(n=>n.symbol===t);if(s>=0){i.splice(s,1),i.length===0&&this.registeredListeners.delete(e);break}}}dispatch(t,...e){for(const i of this.getListenersByType(t))try{i.handler(...e)}catch(s){_I.Logger.errorOnce(String(s))}}getListenersByType(t){return this.registeredListeners.get(t)??[]}destroy(){this.registeredListeners.clear()}},gn=class{constructor(){this.listeners=new Os,this.destroyFns=[],this.destroyed=!1}addListener(t,e){return this.listeners.addListener(t,e)}destroy(){this.listeners.destroy(),this.destroyFns.forEach(t=>t()),this.destroyed=!0}},zm=(w(),k(T)),jI=class Rh{constructor(e,i,s){this.element=e,this.topTabGuard=i,this.bottomTabGuard=s,this.destroyFns=[],this.guardTabIndex=0,this.hasFocus=!1,this.initTabGuard(this.topTabGuard,n=>this.onTab(n,!1)),this.initTabGuard(this.bottomTabGuard,n=>this.onTab(n,!0)),this.element.addEventListener("focus",()=>this.onFocus(),{capture:!0}),this.element.addEventListener("blur",n=>this.onBlur(n),{capture:!0})}set tabIndex(e){this.guardTabIndex=e,this.guardTabIndex===0?this.setGuardIndices(void 0):this.hasFocus||this.setGuardIndices(this.guardTabIndex)}destroy(){for(const e of this.destroyFns)e();this.destroyFns.length=0}initTabGuard(e,i){const s=()=>i(e);e.addEventListener("focus",s),this.destroyFns.push(()=>e.removeEventListener("focus",s))}setGuardIndices(e){const i=e;wt(this.topTabGuard,"tabindex",i),wt(this.bottomTabGuard,"tabindex",i)}onFocus(){this.hasFocus=!0,this.guardTabIndex!==0&&this.setGuardIndices(0)}onBlur({relatedTarget:e}){const{topTabGuard:i,bottomTabGuard:s}=this;this.hasFocus=!1,this.guardTabIndex!==0&&e!==i&&e!==s&&this.setGuardIndices(this.guardTabIndex)}onTab(e,i){if(this.guardTabIndex!==0){let s;e.tabIndex===0?(s=this.findExitTarget(!i),this.setGuardIndices(this.guardTabIndex)):s=this.findEnterTarget(i),s?.focus()}}static queryFocusable(e,i){const s=(0,zm.getWindow)();return Array.from(e.querySelectorAll(i)).filter(n=>{if(n instanceof HTMLElement){const r=s.getComputedStyle(n);return r.display!=="none"&&r.visibility!=="none"}return!1})}findEnterTarget(e){const i=Rh.queryFocusable(this.element,'[tabindex="0"]'),s=e?i.length-1:0;return i[s]}findExitTarget(e){const i=Rh.queryFocusable((0,zm.getDocument)(),"[tabindex]").filter(r=>r.tabIndex>0).sort((r,o)=>r.tabIndex-o.tabIndex),{before:s,after:n}=Rh.findBeforeAndAfter(i,this.guardTabIndex);return e?s:n}static findBeforeAndAfter(e,i){let s=0,n=e.length-1,r,o;for(;s<=n;){const a=Math.floor((s+n)/2),l=e[a].tabIndex;if(l===i){r=e[a-1]||void 0,o=e[a+1]||void 0;break}else l<i?(r=e[a],s=a+1):(o=e[a],n=a-1)}return{before:r,after:o}}};function Hi(t,e,i,s,n){e.addEventListener(i,s);const r=()=>e.removeEventListener(i,s,n);return t.push(r),r}function Bm(t,e,i){Hi(t,e,"keydown",s=>{s.key==="Escape"&&i(s)})}function FI(t,e,i){const s=Hi(t,window,"mousedown",n=>{[0,2].includes(n.button)&&!Gm(e,n)&&(i(),s())});return s}function zI(t,e,i){const s=Hi(t,window,"touchstart",n=>{Array.from(n.targetTouches).some(o=>!Gm(e,o))&&(i(),s())});return s}function Gm(t,e){if(e.target instanceof Element){const{x:i,y:s,width:n,height:r}=t.getBoundingClientRect(),{clientX:o,clientY:a}=e;return o>=i&&a>=s&&o<=i+n&&a<=s+r}return!1}function ec(t){return!(t.shiftKey||t.altKey||t.ctrlKey||t.metaKey)}function Vu(t,e,...i){return ec(t)&&(t.key===e||i.some(s=>t.key===s))}function Vm(t,e,i,s){i&&Hi(t,e,"keydown",n=>{Vu(n,s)&&i.focus()})}function BI(t,e,i,s,n,r){Vm(t,e,n,r),Vm(t,e,i,s),Hi(t,e,"keydown",o=>{Vu(o,s,r)&&o.preventDefault()})}var Br={horizontal:{nextKey:"ArrowRight",prevKey:"ArrowLeft"},vertical:{nextKey:"ArrowDown",prevKey:"ArrowUp"}};function Um(t){const{orientation:e,buttons:i,wrapAround:s=!1,onEscape:n,onFocus:r,onBlur:o}=t,{nextKey:a,prevKey:l}=Br[e],c=p=>{p.target&&"tabIndex"in p.target&&(i.forEach(f=>f.tabIndex=-1),p.target.tabIndex=0)},[h,u]=s?[i.length,i.length]:[0,1/0],d=[];for(let p=0;p<i.length;p++){const f=i[(h+p-1)%u],y=i[p],x=i[(h+p+1)%u];Hi(d,y,"focus",c),r&&Hi(d,y,"focus",r),o&&Hi(d,y,"blur",o),n&&Bm(d,y,n),BI(d,y,x,a,f,l),y.tabIndex=p===0?0:-1}return d}var GI=class{constructor(t,e,i){this.lastFocus=e,this.closeCallback=i,this.destroyFns=[],this.destroyFns.push(FI(this.destroyFns,t,()=>this.close(!0))),this.destroyFns.push(zI(this.destroyFns,t,()=>this.close(!0)))}close(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,this.closeCallback(),this.finishClosing(t)}finishClosing(t){this.destroyFns.forEach(e=>e()),this.destroyFns.length=0,wt(this.lastFocus,"aria-expanded",!1),t||this.lastFocus?.focus({preventScroll:!0}),this.lastFocus=void 0}};function Ym(t){const{sourceEvent:e,orientation:i,menu:s,buttons:n,closeCallback:r,overrideFocusVisible:o,autoCloseOnBlur:a=!1}=t,{nextKey:l,prevKey:c}=Br[i],h=Yu(e);wt(h,"aria-expanded",!0);const u=new GI(s,h,r),d=()=>u.close(),{destroyFns:p}=u;if(s.role="menu",s.ariaOrientation=i,p.push(...Um({orientation:i,buttons:n,onEscape:d,wrapAround:!0})),s.tabIndex=-1,Bm(p,s,d),Hi(p,s,"keydown",f=>{f.target===s&&(f.key===l||f.key===c)&&(f.preventDefault(),n[0]?.focus())}),a){const f=y=>{!n.includes(y.relatedTarget)&&d()};for(const y of n)Hi(p,y,"blur",f)}return n[0]?.focus({preventScroll:!0}),o!==void 0&&(n.forEach(y=>y.setAttribute("data-focus-visible-override",o.toString())),Hi(p,s,"keydown",()=>{n.forEach(y=>y.setAttribute("data-focus-visible-override","true"))},{once:!0})),u}function VI(t,e){return i=>{if(t.ariaDisabled==="true")return i.preventDefault();e(i)}}function Uu(t){return"button"in t?t.button===0:ec(t)&&(t.code==="Space"||t.key==="Enter")}function Yu(t){if(t?.target instanceof HTMLElement&&"tabindex"in t.target.attributes)return t.target}function Wm(t){const e=i=>{if(i.defaultPrevented)return;Ql(i.target,"data-preventdefault",!0)&&Vu(i,"ArrowRight","ArrowLeft","ArrowDown","ArrowUp")&&i.preventDefault()};return t.addEventListener("keydown",e),()=>t.removeEventListener("keydown",e)}var Wu=(w(),k(T)),$u=(w(),k(T)),UI=class{constructor(t){this.callback=t,this.devicePixelRatio=(0,$u.getWindow)("devicePixelRatio")??1,this.devicePixelRatioMediaQuery=void 0,this.devicePixelRatioListener=e=>{e.matches||(this.devicePixelRatio=(0,$u.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 t=(0,$u.getWindow)("matchMedia")?.(`(resolution: ${this.pixelRatio}dppx)`);t?.addEventListener("change",this.devicePixelRatioListener),this.devicePixelRatioMediaQuery=t}},$m=class{constructor(){this.elements=new Map,this.documentReady=!1,this.queuedObserveRequests=[],this.onLoad=()=>{this.documentReady=!0,this.queuedObserveRequests.forEach(([e,i])=>this.observe(e,i)),this.queuedObserveRequests=[],this.observeWindow()},typeof ResizeObserver<"u"&&(this.resizeObserver=new ResizeObserver(e=>{for(const{target:i,contentRect:{width:s,height:n}}of e){const r=this.elements.get(i);this.checkSize(r,i,s,n)}}));let t;this.pixelRatioObserver=new UI(()=>{clearTimeout(t),t=setTimeout(()=>this.checkPixelRatio(),0)}),this.documentReady=(0,Wu.getDocument)("readyState")==="complete",this.documentReady?this.observeWindow():(0,Wu.getWindow)()?.addEventListener("load",this.onLoad)}destroy(){(0,Wu.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 t=this.pixelRatioObserver?.pixelRatio??1;for(const[e,i]of this.elements)if(i.size!=null&&i.size.pixelRatio!==t){const{width:s,height:n}=i.size;i.size={width:s,height:n,pixelRatio:t},i.cb(i.size,e)}}checkSize(t,e,i,s){if(t&&(i!==t.size?.width||s!==t.size?.height)){const n=this.pixelRatioObserver?.pixelRatio??1;t.size={width:i,height:s,pixelRatio:n},t.cb(t.size,e)}}observe(t,e){if(!this.documentReady){this.queuedObserveRequests.push([t,e]);return}this.elements.has(t)?this.removeFromQueue(t):this.resizeObserver?.observe(t);const i={cb:e};this.elements.set(t,i)}unobserve(t){this.resizeObserver?.unobserve(t),this.elements.delete(t),this.removeFromQueue(t),this.elements.size||this.destroy()}removeFromQueue(t){this.queuedObserveRequests=this.queuedObserveRequests.filter(([e])=>e!==t)}},Gr=class extends Map{constructor(t,e){super(),this.defaultValue=t,this.defaultState=e}set(t,e){return this.delete(t),typeof e<"u"&&super.set(t,e),this}stateId(){return Array.from(this.keys()).pop()??this.defaultState}stateValue(){return Array.from(this.values()).pop()??this.defaultValue}},YI='<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>',WI=["styles","canvas","canvas-center","canvas-container","canvas-overlay","canvas-proxy","series-area","tooltip-container"],Hm={safeHorizontal:"ag-charts-wrapper--safe-horizontal",safeVertical:"ag-charts-wrapper--safe-vertical"},$I=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 HI(t,e){if(typeof IntersectionObserver>"u")return;const i=new IntersectionObserver(s=>{for(const n of s)n.target===t&&e(n.intersectionRatio)},{root:t});return i.observe(t),i}var Km={x:0,y:0,width:0,height:0,top:0,bottom:0,left:0,right:0,toJSON(){return Km}};function Zm(t,e){const i=(0,bi.createElement)("div");return i.className="ag-charts-tab-guard",t.insertAdjacentElement(e,i),i}var Hu=class xr extends gn{constructor(e,i,s="normal"){super(),this.styleContainer=i,this.mode=s,this.anchorName=`--${fi(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 $m,this.cursorState=new Gr("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 n=!1;if(this.observer=HI(this.element,r=>{r===0&&!n&&this.listeners.dispatch("hidden",{type:"hidden"}),n=r===0}),this.setSizeOptions(),this.updateContainerSize(),this.addStyles("ag-charts-community",PI),this.setContainer(e),this.destroyFns.push(Wm(this.element)),this.mode==="normal"){const r=this.rootElements["canvas-center"].element;if(r==null)throw new Error("Error initializing tab guards");const o=Zm(r,"beforebegin"),a=Zm(r,"afterend");this.tabGuards=new jI(r,o,a)}}initDOM(){if(this.mode==="normal"){const s=(0,bi.createElement)("div");return s.innerHTML=YI,s.firstChild}const e=(0,bi.createElement)("div");e.role="presentation",e.classList.add("ag-charts-canvas-container","ag-charts-canvas","ag-charts-tooltip-container");const i=(0,bi.createElement)("div");return e.appendChild(i),i.role="presentation",i.classList.add("ag-charts-series-area"),e}initRootElements(){return WI.reduce((e,i)=>{const s=`ag-charts-${i}`;let n=this.element.classList.contains(s)?this.element:this.element.querySelector(`.${s}`);if(!n&&this.mode==="normal")throw new Error(`AG Charts - unable to find DOM element ${s}`);return n??(n=(0,bi.createElement)("div")),e[i]={element:n,children:new Map,listeners:[]},e},{})}destroy(){super.destroy(),this.observer?.unobserve(this.element),this.container&&this.sizeMonitor.unobserve(this.container),this.pendingContainer=void 0,Object.values(this.rootElements).forEach(e=>{e.children.forEach(i=>i.remove()),e.element.remove()}),this.element.remove()}postRenderUpdate(){this.mode!=="minimal"&&(this.pendingContainer==null||this.pendingContainer===this.container||(xr.batchedUpdateContainer.length===0&&(0,bi.getWindow)().setTimeout(this.applyBatchedUpdateContainer.bind(this),0),xr.batchedUpdateContainer.push(this)))}applyBatchedUpdateContainer(){for(const e of xr.batchedUpdateContainer)e.destroyed||e.updateContainer();xr.batchedUpdateContainer.splice(0)}setSizeOptions(e=300,i=300,s,n){const{style:r}=this.element;r.width=`${s??e}px`,r.height=`${n??i}px`,this.minWidth=s??e,this.minHeight=n??i,this.updateContainerClassName()}updateContainerSize(){const{style:e}=this.rootElements["canvas-center"].element;e.visibility=this.containerSize==null?"hidden":"",this.containerSize?(e.width=`${this.containerSize.width??0}px`,e.height=`${this.containerSize.height??0}px`):(e.width="",e.height=""),this.updateContainerClassName()}setTabGuardIndex(e){this.tabGuards&&(this.tabGuards.tabIndex=e)}setContainer(e){e!==this.container&&(this.pendingContainer=e,(this.mode==="minimal"||this.container==null)&&this.updateContainer())}updateContainer(){const{pendingContainer:e}=this;if(!(e==null||e===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=e,this.pendingContainer=void 0,this.documentRoot=this.getShadowDocumentRoot(e),this.initiallyConnected=this.mode==="minimal"||e.isConnected;for(const[i,s]of this.styles)this.addStyles(i,s);e.appendChild(this.element),this.sizeMonitor.observe(e,i=>{this.containerSize=i,this.updateContainerSize(),this.listeners.dispatch("resize",{type:"resize"})}),this.listeners.dispatch("container-changed",{type:"container-changed"})}}setThemeClass(e){const i="ag-charts-theme-";this.element.classList.forEach(s=>{s.startsWith(i)&&s!==e&&this.element.classList.remove(s)}),this.element.classList.add(e)}setThemeParameters(e){const i={accentColor:"accent-color",axisColor:"axis-color",backgroundColor:"background-color",borderColor:"border-color",foregroundColor:"foreground-color",fontFamily:"font-family",fontSize:"font-size",fontWeight:"font-weight",gridLineColor:"grid-line-color",padding:"padding",subtleTextColor:"subtle-text-color",textColor:"text-color",chromeBackgroundColor:"chrome-background-color",chromeFontFamily:"chrome-font-family",chromeFontSize:"chrome-font-size",chromeFontWeight:"chrome-font-weight",chromeSubtleTextColor:"chrome-subtle-text-color",chromeTextColor:"chrome-text-color",inputBackgroundColor:"input-background-color",inputTextColor:"input-text-color",crosshairLabelBackgroundColor:"crosshair-label-background-color",crosshairLabelTextColor:"crosshair-label-text-color"},s=["fontSize","chromeFontSize"];for(const[n,r]of(0,bi.entries)(e)){let o=`${r}`;s.includes(n)&&(o=`${r}px`),this.element.style.setProperty(`--ag-charts-${i[n]}`,o)}}updateCanvasLabel(e){wt(this.rootElements["canvas-proxy"].element,"aria-label",e)}getEventElement(e,i){return["focus","blur","keydown","keyup"].includes(i)?this.rootElements["series-area"].element:e}addEventListener(e,i,s){this.getEventElement(this.element,e).addEventListener(e,i,s)}removeEventListener(e,i,s){this.getEventElement(this.element,e).removeEventListener(e,i,s)}getBoundingClientRect(){return this.rootElements.canvas.element.getBoundingClientRect()}getOverlayClientRect(){const e=(0,bi.getWindow)(),i=new B(0,0,e.innerWidth,e.innerHeight),s=this.getRawOverlayClientRect();return i.intersection(s)?.toDOMRect()??Km}getRawOverlayClientRect(){let e=this.element;const i=this.element.getRootNode()?.fullscreenElement;for(;e!=null;){let r;if(i!=null&&e===i)r=!0;else{const a=e.computedStyleMap?.()?.get("overflow-y")?.toString();r=a==="auto"||a==="scroll"}if(r)return B.fromDOMRect(e.getBoundingClientRect());e=e.parentElement}if(this.documentRoot!=null)return B.fromDOMRect(this.documentRoot.getBoundingClientRect());const{innerWidth:s,innerHeight:n}=(0,bi.getWindow)();return new B(0,0,s,n)}getShadowDocumentRoot(e=this.container){const i=e?.ownerDocument?.body??(0,bi.getDocument)("body");for(;e!=null;){if(e===i)return;if(e.parentNode instanceof DocumentFragment)return e;e=e.parentNode}}getParent(e){return this.rootElements[e].element}getChildBoundingClientRect(e){const{children:i}=this.rootElements[e],s=[];for(const n of i.values())s.push(B.fromDOMRect(n.getBoundingClientRect()));return B.merge(s)}isManagedChildDOMElement(e,i,s){const{children:n}=this.rootElements[i],r=n?.get(s);return r!=null&&e.contains(r)}contains(e,i){return i==null?this.element.contains(e):this.rootElements[i].element.contains(e)}addStyles(e,i){const s="data-ag-charts";if(this.styles.set(e,i),this.container==null)return;const n=a=>a.getAttribute(s)===e,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,bi.createElement)("style");return 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",e):this.documentRoot==null&&!xr.headStyles.has(e)?(o=r((0,bi.getDocument)("head")),xr.headStyles.add(e)):this.documentRoot!=null&&(o=this.addChild("styles",e)),!(o==null||n(o))&&(o.setAttribute(s,e),o.innerHTML=i)}removeStyles(e){this.removeChild("styles",e)}updateCursor(e,i){this.cursorState.set(e,i),this.element.style.cursor=this.cursorState.stateValue()}getCursor(){return this.element.style.cursor}addChild(e,i,s,n){const{element:r,children:o,listeners:a}=this.rootElements[e];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"}=$I.get(e)??{};if(s&&s.tagName.toLowerCase()!==l.toLowerCase())throw new Error("AG Charts - mismatching DOM element type");const c=s??(0,bi.createElement)(l);for(const[h,u,d]of a)c.addEventListener(h,u,d);if(o.set(i,c),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(e,i){const{children:s}=this.rootElements[e];s&&(s.get(i)?.remove(),s.delete(i))}incrementDataCounter(e){const{dataset:i}=this.element;i[e]??(i[e]="0"),i[e]=String(Number(i[e])+1)}setDataBoolean(e,i){this.element.dataset[e]=String(i)}updateContainerClassName(){const{element:e,containerSize:i,minWidth:s,minHeight:n}=this;e.classList.toggle(Hm.safeHorizontal,s>=(i?.width??1/0)),e.classList.toggle(Hm.safeVertical,n>=(i?.height??1/0))}};Hu.batchedUpdateContainer=[],Hu.headStyles=new Set;var Xm=Hu,KI=(w(),k(T)),Ku=(w(),k(T)),ZI=class extends gs{constructor(){super((0,Ku.createElement)("div")),this.textElement=(0,Ku.createSvgElement)("text"),this.textElement.role="presentation",this.svgElement=(0,Ku.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(t){this.textElement.textContent=t;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(){}},XI=(w(),k(T)),ta=class extends gs{constructor(){super((0,XI.createElement)("button")),this.setEnabled(!0)}destructor(){}setEnabled(t){wt(this.elem,"aria-disabled",!t),$i(this.elem,"pointer-events",t?void 0:"none")}addListener(t,e){return super.addListener(t,(i,s)=>{(t==="click"||t==="dblclick")&&this.isDisabled()||e(i,s)})}},qI=(w(),k(T)),QI=class extends gs{constructor(){super((0,qI.createElement)("div")),wt(this.elem,"role","group")}destructor(){}},JI=(w(),k(T)),tA=(w(),k(T)),qm=class extends gs{constructor(t,e){super((0,tA.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"?[Br.horizontal,Br.vertical]:[Br[n],void 0];let a=-1;if(ec(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()},this.orientation=t,wt(this.elem,"role",e)}get orientation(){return Ql(this.elem,"aria-orientation")??"both"}set orientation(t){wt(this.elem,"aria-orientation",t!=="both"?t:void 0)}focus(){this.children[this.focusedChildIndex]?.focus()}onChildAdded(t){t.addListener("focus",this.onChildFocus),t.addListener("keydown",this.onChildKeyDown),t.setTabIndex(this.children.length===1?0:-1)}onChildRemoved(t){t.removeListener("focus",this.onChildFocus),t.removeListener("keydown",this.onChildKeyDown);const{focusedChildIndex:e,children:i}=this,s=e===t.index;for(let n=0;n<i.length;n++){const r=i[n];r.index===e&&(this.focusedChildIndex=n),r.index=n}if(s){const n=i[e]??i[e-1];n?(this.focusedChildIndex=n.index,n.setTabIndex(0)):this.focusedChildIndex=0}}},eA=class extends qm{constructor(){super("both","list"),this.setHidden(!0)}destructor(){this.children.forEach(t=>t.getElement().parentElement.remove())}addChildToDOM(t,e){const i=(0,JI.createElement)("div");wt(i,"role","listitem"),$i(i,"position","absolute"),gs.setElementContainer(t,i),this.appendOrInsert(i,e),this.setHidden(!1)}removeChildFromDOM(t){t.getElement().parentElement.remove(),this.setHidden(this.children.length===0)}setHidden(t){this.children.length===0&&(t=!0),super.setHidden(t)}},Vr=class extends gs{constructor(t){super(t)}destructor(){}},Qm=(w(),k(T)),iA=new Intl.NumberFormat("en-US",{style:"percent"});function Rs(t,e=2){return typeof t=="number"?ey(t,e):typeof t=="string"?t:String(t??"")}function Jm(t){return iA.format(t)}var ty=new Map().set(2,new Intl.NumberFormat("en-US",{maximumFractionDigits:2,useGrouping:!1}));function ey(t,e){let i=ty.get(e);return i||(i=new Intl.NumberFormat("en-US",{maximumFractionDigits:e,useGrouping:!1}),ty.set(e,i)),i.format(t)}var Zu=class ul extends gs{constructor(){super((0,Qm.createElement)("input")),this._step=ul.STEP_ONE,this.orientation="both"}get step(){return this._step}set step(e){this._step=e,this.getElement().step=e.attributeValue}get keyboardStep(){return this._keyboardStep?.step??this._step}set keyboardStep(e){if(e!==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),e!==void 0)){const i=()=>this.getElement().step=e.attributeValue,s=()=>this.getElement().step=this._step.attributeValue;this._keyboardStep={step:e,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 Ql(this.elem,"aria-orientation")??"both"}set orientation(e){wt(this.elem,"aria-orientation",e!=="both"?e:void 0),ul.registerDefaultPreventers(this,e)}destructor(){}clampValueRatio(e,i){const s=this.getValueRatio(),n=(0,Qm.clamp)(e,s,i);return n!==s&&this.setValueRatio(n),n}setValueRatio(e,i){const{divider:s}=this.step,n=Math.round(e*1e4)/s,{ariaValueText:r=Jm(n/s)}=i??{},o=this.getElement();o.value=`${n}`,o.ariaValueText=r}getValueRatio(){return parseFloat(this.getElement().value)/this.step.divider}static registerDefaultPreventers(e,i){i==="both"?e.removeListener("keydown",ul.onKeyDown):e.addListener("keydown",ul.onKeyDown)}static onKeyDown(e,i){let s=[];const{orientation:n}=i;n==="horizontal"?s=["ArrowUp","ArrowDown"]:n==="vertical"&&(s=["ArrowLeft","ArrowRight"]),s.includes(e.sourceEvent.code)&&e.sourceEvent.preventDefault()}};Zu.STEP_ONE={attributeValue:"1",divider:1},Zu.STEP_HUNDRETH={attributeValue:"0.01",divider:100};var Xu=Zu,sA=class extends ta{constructor(){super(),wt(this.elem,"role","switch"),this.setChecked(!1)}setChecked(t){wt(this.elem,"aria-checked",t)}},ic=class extends qm{constructor(t="horizontal"){super(t,"toolbar")}destructor(){}};function Ur(t,e){return e.params?.type===t}function nA(t){if(t==="button")return new ta;if(t==="slider")return new Xu;if(t==="toolbar")return new ic;if(t==="group")return new QI;if(t==="list")return new eA;if(t==="region")return new Vr((0,KI.createElement)("div"));if(t==="text")return new ZI;if(t==="listswitch")return new sA;throw Error("AG Charts - error allocating meta")}function iy(t){const e={params:t,result:void 0};return e.result=nA(e.params.type),e}var sy=class{constructor(t,e){this.localeManager=t,this.domManager=e,this.destroyFns=[]}destroy(){this.destroyFns.forEach(t=>t())}addLocalisation(t){t(),this.destroyFns.push(this.localeManager.addListener("locale-changed",t))}createProxyContainer(t){const e=iy(t),{params:i,result:s}=e,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),Ur("toolbar",e)&&(e.result.orientation=e.params.orientation),this.addLocalisation(()=>{n.ariaLabel=this.localeManager.t(i.ariaLabel.id,i.ariaLabel.params)}),s}createProxyElement(t){const e=iy(t);if(Ur("button",e)){const{params:i,result:s}=e,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(e.params,e.result)}if(Ur("slider",e)){const{params:i,result:s}=e,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(e.params,e.result)}if(Ur("text",e)){const{params:i,result:s}=e;this.initElement(i,s),this.setParent(e.params,e.result)}if(Ur("listswitch",e)){const{params:i,result:s}=e;this.initInteract(i,s),s.setTextContent(i.textContent),s.setChecked(i.ariaChecked),s.setAriaDescribedBy(i.ariaDescribedBy),this.setParent(e.params,e.result)}if(Ur("region",e)){const{params:i,result:s}=e,n=s.getElement();this.initInteract(i,s),n.role="region",this.setParent(e.params,e.result)}return e.result}initElement(t,e){const i=e.getElement();return wt(i,"id",t.id),$i(i,"cursor",t.cursor),i.classList.toggle("ag-charts-proxy-elem",!0),i}initInteract(t,e){const{tabIndex:i,domIndex:s}=t,n=this.initElement(t,e);i!==void 0&&(n.tabIndex=i),s!==void 0&&(e.domIndex=s)}setParent(t,e){if("parent"in t)t.parent?.addChild(e);else{const i={where:t.where,query:".ag-charts-series-area"};this.domManager.addChild("canvas-proxy",t.domManagerId,e.getElement(),i)}}},ny={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",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",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]"},rA=(w(),k(T)),oA=/\$\{(\w+)}(?:\[(\w+)])?/gi,qu={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"})},aA=({defaultValue:t,variables:e})=>t?.replaceAll(oA,(i,s,n)=>{const r=e[s],o=n!=null?qu[n]:null;return n!=null&&o==null&&rA.Logger.warnOnce(`Format style [${n}] is not supported`),o!=null?o.format(r):typeof r=="number"?qu.number.format(r):r instanceof Date?qu.datetime.format(r):String(r)}),lA=class extends Os{constructor(){super(...arguments),this.localeText=void 0,this.getLocaleText=void 0}setLocaleText(t){this.localeText!==t&&(this.localeText=t,this.dispatch("locale-changed"))}setLocaleTextFormatter(t){this.getLocaleText=t,this.getLocaleText!==t&&(this.getLocaleText=t,this.dispatch("locale-changed"))}t(t,e={}){const{localeText:i=ny,getLocaleText:s}=this,n=i[t];return s?.({key:t,defaultValue:n,variables:e})??aA({key:t,defaultValue:n,variables:e})??t}},cA=(w(),k(T)),ry=(w(),k(T)),Qu=class{constructor(t){this.enabled=!0,this.width=600,this.height=300;const{width:e,height:i,canvasElement:s,willReadFrequently:n=!1}=t;this.pixelRatio=t.pixelRatio??(0,ry.getWindow)("devicePixelRatio")??1,this.element=s??(0,ry.createElement)("canvas"),this.element.style.display="block",this.element.style.width=(e??this.width)+"px",this.element.style.height=(i??this.height)+"px",this.element.width=Math.round((e??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(e??0,i??0,this.pixelRatio),Bf(this.context)}drawImage(t,e=0,i=0){return t.drawImage(this.context.canvas,e,i)}toDataURL(t){return this.element.toDataURL(t)}resize(t,e,i){if(!(t>0&&e>0))return;const{element:s,context:n}=this;s.width=Math.round(t*i),s.height=Math.round(e*i),n.setTransform(i,0,0,i,0,0),s.style.width=t+"px",s.style.height=e+"px",this.width=t,this.height=e,this.pixelRatio=i}clear(){zf(this)}destroy(){this.element.remove(),this.element.width=0,this.element.height=0,this.context.clearRect(0,0,0,0),Object.freeze(this)}onEnabledChange(){this.element&&(this.element.style.display=this.enabled?"":"none")}};g([pn(t=>t.onEnabledChange())],Qu.prototype,"enabled",2);var hA=class{constructor(t){this.canvas=t,this.debug=vt.create(!0,"scene"),this.layersMap=new Map,this.nextLayerId=0}get size(){return this.layersMap.size}resize(t,e,i){this.canvas.resize(t,e,i),this.layersMap.forEach(({canvas:s})=>s.resize(t,e,i))}addLayer(t){const{width:e,height:i,pixelRatio:s}=this.canvas,{name:n}=t,r=new tu({width:e,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(t){this.layersMap.has(t)&&(this.layersMap.delete(t),t.destroy(),this.debug("Scene.removeLayer() -  layers",this.layersMap))}clear(){for(const t of this.layersMap.values())t.canvas.destroy();this.layersMap.clear()}},sc=(w(),k(T));function uA(t){for(const e of["B","KB","MB","GB"]){if(t<1536)return`${t.toFixed(1)}${e}`;t/=1024}return`${t.toFixed(1)}TB}`}function dA(){if(!("memory"in performance))return;const{totalJSHeapSize:t,usedJSHeapSize:e,jsHeapSizeLimit:i}=performance.memory,s=[];for(const n of[e,t,i])typeof n=="number"&&s.push(uA(n));return`Heap ${s.join(" / ")}`}function oy(t,e,i,s,n={},r=B.zero){if(!vt.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,...f}=e,y=Object.entries(f).map(([E,R])=>ly(E,R)).filter(E=>E!=null).join(" + "),x=Object.entries(n).map(([E,R])=>`${E}: ${JSON.stringify(R)}`).join(" ; "),m=vt.check("scene:stats:verbose"),v=dA(),S=[`${ly("\u23F1\uFE0F",p,d)} (${y})`,`${x}`,`Layers: ${m?Ju(o,a):t.size}`,m?`Nodes: ${Ju(l,c)}`:null,m?`Ops: ${Ju(h,u)}`:null,m&&v?v:null].filter(sc.isString),M=new Fu(E=>i.measureText(E)),D=new Map(S.map(E=>[E,M.measureLines(E)])),C=Math.max(...Array.from(D.values(),E=>E.width)),L=bA(D.values(),E=>E.height),I=2+r.x;i.save(),i.fillStyle="white",i.fillRect(I,0,C,L),i.fillStyle="black";let N=0;for(const[E,R]of D.entries())N+=R.height,i.fillText(E,I,N);i.restore()}function pA(t){const e=(0,sc.toArray)((0,sc.getWindow)("agChartsSceneDebug")),i=[];for(const s of e)s==="layout"?i.push("seriesRoot","legend","root",/.*Axis-\d+-axis.*/):i.push(s);t.debugNodeSearch=i}function gA(t,e){t.save();for(const[i,s]of Object.entries(e)){const n=Kt.toCanvas(s);if(!n){sc.Logger.log(`Scene.render() - no bbox for debugged node [${i}].`);continue}t.globalAlpha=.8,t.strokeStyle="red",t.lineWidth=1,t.strokeRect(n.x,n.y,n.width,n.height),t.fillStyle="red",t.strokeStyle="white",t.font="16px sans-serif",t.textBaseline="top",t.textAlign="left",t.lineWidth=2,t.strokeText(i,n.x,n.y,n.width),t.fillText(i,n.x,n.y,n.width)}t.restore()}var fA=new Set,mA=new Set(["gradient","zIndex","clipRect","cachedBBox","childNodeCounts","path","__zIndex","name","__scalingCenterX","__scalingCenterY","__rotationCenterX","__rotationCenterY","_previousDatum","__fill","__lineDash","borderPath","borderClipPath","_clipPath"]);function yA(t){const{...e}=t;for(const i of Object.keys(e))mA.has(i)||typeof e[i]!="number"&&typeof e[i]!="string"&&typeof e[i]!="boolean"&&(fA.add(i),delete e[i]);return e}function nc(t,e){if(!vt.check(!0,"scene"))return{};let i=0;return{node:e==="json"?yA(t):t,name:t.name??t.id,dirty:t.dirty,...Array.from(t.children(),s=>nc(s,e)).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:f}=n;(!o||a<=0)&&(r=`(${r})`),it.is(f)&&f.renderToOffscreenCanvas&&(r=`*${r}*`);const y=Array.isArray(l)?`(${l.join(", ")})`:l,x=[`${(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=x,v=1;for(;s[m]!=null&&v<100;)m=`${x} (${v++})`;return s[m]=n,s},{})}}function ay(t){if(!t.dirty)return{dirtyTree:{},paths:[]};const e=Array.from(t.children(),n=>ay(n)).filter(n=>n.paths.length>0),i=it.is(t)?t.name??t.id:t.id,s=e.length?e.flatMap(n=>n.paths).map(n=>`${i}.${n}`):[i];return{dirtyTree:{name:i,node:t,dirty:t.dirty,...e.map(n=>n.dirtyTree).filter(n=>n.dirty!=null).reduce((n,r)=>(n[r.name??"<unknown>"]=r,n),{})},paths:s}}function Ju(t,e){const i=t+e;return`${t} / ${i} (${Math.round(100*t/i)}%)`}function ly(t,e,i){const s=i!=null?i-e:e;return`${t}: ${Math.round(s*100)/100}ms`}function bA(t,e){let i=0;for(const s of t)i+=e(s);return i}var rc=class{constructor(t){this.debug=vt.create(!0,"scene"),this.id=fi(this),this.root=null,this.pendingSize=null,this.isDirty=!1,this.updateDebugFlags(),this.canvas=new Qu(t),this.layersManager=new hA(this.canvas)}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(t){const{element:e}=this.canvas;return e.parentElement?.removeChild(e),t.appendChild(e),this}setRoot(t){return this.root===t?this:(this.isDirty=!0,this.root?._setLayerManager(),this.root=t,t&&(t.visible=!0,t._setLayerManager(this.layersManager)),this)}updateDebugFlags(){vt.inDevelopmentMode(()=>As._debugEnabled=!0)}clear(){this.canvas.clear()}attachNode(t){return this.appendChild(t),()=>this.removeChild(t)}appendChild(t){return this.root?.appendChild(t),this}removeChild(t){return this.root?.removeChild(t),this}download(t,e){(0,cA.downloadUrl)(this.canvas.toDataURL(e),t?.trim()??"image")}getDataURL(t){return this.canvas.toDataURL(t)}resize(t,e,i){return t=Math.round(t),e=Math.round(e),i??(i=this.pixelRatio),t>0&&e>0&&(t!==this.width||e!==this.height||i!==this.pixelRatio)?(this.pendingSize=[t,e,i],this.isDirty=!0,!0):!1}render(t){const{debugSplitTimes:e={start:performance.now()},extraDebugStats:i,seriesRect:s}=t??{},{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}if(o?.dirty===!1&&!this.isDirty){this.debug.check()&&this.debug("Scene.render() - no-op",{tree:nc(o,"console")}),oy(this.layersManager,e,r,void 0,i,s);return}const p={ctx:r,width:l,height:c,devicePixelRatio:h,debugNodes:{}};vt.check("scene:stats:verbose")&&(p.stats={layersRendered:0,layersSkipped:0,nodesRendered:0,nodesSkipped:0,opsPerformed:0,opsSkipped:0}),pA(p);let f=!1;if((o?.dirty!==!1||d)&&(f=!0,n.clear()),o&&vt.check("scene:dirtyTree")){const{dirtyTree:y,paths:x}=ay(o);vt.create("scene:dirtyTree")("Scene.render() - dirtyTree",{dirtyTree:y,paths:x})}if(o&&f){if(o.visible&&o.preRender(p),this.debug.check()){const y=nc(o,"console");this.debug("Scene.render() - before",{canvasCleared:f,tree:y})}o.visible&&(r.save(),o.render(p),r.restore())}e["\u270D\uFE0F"]=performance.now()-u,r.verifyDepthZero?.(),this.isDirty=!1,oy(this.layersManager,e,r,p.stats,i,s),gA(r,p.debugNodes),o&&this.debug.check()&&this.debug("Scene.render() - after",{tree:nc(o,"console"),canvasCleared:f})}toSVG(){const{root:t,width:e,height:i}=this;if(t!=null)return As.toSVG(t,e,i)}strip(){const{context:t,pixelRatio:e}=this.canvas;t.setTransform(e,0,0,e,0,0),this.layersManager.clear(),this.setRoot(null),this.isDirty=!1}destroy(){this.strip(),this.canvas.destroy(),Object.assign(this,{canvas:void 0})}};rc.className="Scene";var xA=(w(),k(T));function vA(t,e){return"context"in t}function td(t,e,i){return vA(t,i)&&i[0]!=null&&typeof i[0]=="object"&&(i[0].context=t.context),e(...i)}var MA=class{constructor(){this.cache=new WeakMap}call(t,e,...i){let s,n=this.cache.get(e);try{s=JSON.stringify(i)}catch{return this.invoke(t,e,i,n)}return n==null&&(n=new Map,this.cache.set(e,n)),n.has(s)?n.get(s):this.invoke(t,e,i,n,s)}invoke(t,e,i,s,n){try{const r=td(t,e,i);return s&&n!=null&&s.set(n,r),r}catch(r){xA.Logger.warnOnce("User callback errored, ignoring",r);return}}invalidateCache(){this.cache=new WeakMap}},SA=(w(),k(T)),DA=class extends gn{constructor(t,e){super(),this.annotationRoot=t,this.fireChartEvent=e,this.mementoOriginatorKey="annotations",this.annotations=[]}createMemento(){return this.annotations}guardMemento(t){return t==null||(0,SA.isArray)(t)}restoreMemento(t,e,i){this.annotations=this.cleanData(i??[]).map(s=>{const n=this.getAnnotationTypeStyles(s.type);return gt(s,n)}),this.listeners.dispatch("restore-annotations",{type:"restore-annotations",annotations:this.annotations})}updateData(t){this.annotations=this.cleanData(t??[])}fireChangedEvent(){this.fireChartEvent({type:"annotations",annotations:Ft([...this.annotations])})}attachNode(t){return this.annotationRoot.append(t),()=>(this.annotationRoot?.removeChild(t),this)}setAnnotationStyles(t){this.styles=t}getAnnotationTypeStyles(t){return this.styles?.[t]}cleanData(t){for(const e of t)"textAlign"in e&&delete e.textAlign;return t}},cy=(t=>(t[t.CHART_BACKGROUND=0]="CHART_BACKGROUND",t[t.AXIS_GRID=1]="AXIS_GRID",t[t.AXIS=2]="AXIS",t[t.ZOOM_SELECTION=3]="ZOOM_SELECTION",t[t.SERIES_CROSSLINE_RANGE=4]="SERIES_CROSSLINE_RANGE",t[t.SERIES_LAYER=5]="SERIES_LAYER",t[t.AXIS_FOREGROUND=6]="AXIS_FOREGROUND",t[t.SERIES_CROSSHAIR=7]="SERIES_CROSSHAIR",t[t.SERIES_CROSSLINE_LINE=8]="SERIES_CROSSLINE_LINE",t[t.SERIES_ANNOTATION=9]="SERIES_ANNOTATION",t[t.CHART_ANNOTATION=10]="CHART_ANNOTATION",t[t.CHART_ANNOTATION_FOCUSED=11]="CHART_ANNOTATION_FOCUSED",t[t.STATUS_BAR=12]="STATUS_BAR",t[t.SERIES_LABEL=13]="SERIES_LABEL",t[t.LEGEND=14]="LEGEND",t[t.NAVIGATOR=15]="NAVIGATOR",t[t.FOREGROUND=16]="FOREGROUND",t))(cy||{}),IA=class{constructor(t){this.sceneRoot=t,this.axes=new Map,this.axisGridGroup=new it({name:"Axes-Grids",zIndex:1}),this.axisGroup=new it({name:"Axes",zIndex:2}),this.axisLabelGroup=new it({name:"Axes-Labels",zIndex:13}),this.axisCrosslineRangeGroup=new it({name:"Axes-Crosslines-Range",zIndex:4}),this.axisCrosslineLineGroup=new it({name:"Axes-Crosslines-Line",zIndex:8}),this.axisCrosslineLabelGroup=new it({name:"Axes-Crosslines-Label",zIndex:13}),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(t,e){const i={axisNode:this.axisGroup,gridNode:this.axisGridGroup,labelNode:this.axisLabelGroup,crossLineRangeNode:this.axisCrosslineRangeGroup,crossLineLineNode:this.axisCrosslineLineGroup,crossLineLabelNode:this.axisCrosslineLabelGroup};for(const s of t)e.includes(s)||(s.detachAxis(i),s.destroy());for(const s of e)t?.includes(s)||s.attachAxis(i);this.axes.clear();for(const s of e){const n=s.createAxisContext();this.axes.has(n.direction)?this.axes.get(n.direction)?.push(n):this.axes.set(n.direction,[n])}}getAxisContext(t){return this.axes.get(t)??[]}destroy(){this.axes.clear(),this.sceneRoot.removeChild(this.axisGroup),this.sceneRoot.removeChild(this.axisGridGroup)}},oc=(w(),k(T)),ac=class extends Os{constructor(t){super(),this.animationManager=t,this.dispatchOnlyLatest=!0,this.dispatchThrottle=0,this.requestThrottle=300,this.isLoadingInitialData=!1,this.isLoadingData=!1,this.freshRequests=[],this.requestCounter=0,this.debug=vt.create(!0,"data-model","data-source"),this.throttledFetch=this.createThrottledFetch(this.requestThrottle),this.throttledDispatch=this.createThrottledDispatch(this.dispatchThrottle)}updateCallback(t){typeof t=="function"&&(this.debug("DataService - updated data source callback"),this.dataSourceCallback=t,this.isLoadingInitialData=!0,this.animationManager.skip(),this.dispatch("data-source-change"))}clearCallback(){this.dataSourceCallback=void 0}load(t){this.isLoadingData=!0,this.throttledFetch(t)}isLazy(){return this.dataSourceCallback!=null}isLoading(){return this.isLazy()&&(this.isLoadingInitialData||this.isLoadingData)}createThrottledFetch(t){return(0,oc.throttle)(e=>this.fetch(e).catch(i=>oc.Logger.error("callback failed",i)),t,{leading:!1,trailing:!0})}createThrottledDispatch(t){return(0,oc.throttle)((e,i)=>{this.debug(`DataService - dispatching 'data-load' | ${e}`),this.dispatch("data-load",{type:"data-load",data:i})},t,{leading:!0,trailing:!0})}async fetch(t){if(!this.dataSourceCallback)throw new Error("DataService - [dataSource.getData] callback not initialised");const e=performance.now(),i=this.requestCounter++;this.debug(`DataService - requesting | ${i}`),this.freshRequests.push(i);let s;try{s=await this.dataSourceCallback(t),this.debug(`DataService - response | ${performance.now()-e}ms | ${i}`)}catch(r){this.debug(`DataService - request failed | ${i}`),oc.Logger.errorOnce(`DataService - request failed | [${r}]`)}this.isLoadingInitialData=!1;const n=this.freshRequests.findIndex(r=>r===i);if(n===-1||this.dispatchOnlyLatest&&n!==this.freshRequests.length-1){this.debug(`DataService - discarding stale request | ${i}`);return}this.freshRequests=this.freshRequests.slice(n+1),this.freshRequests.length===0&&(this.isLoadingData=!1),Array.isArray(s)?this.throttledDispatch(i,s):this.dispatch("data-error")}};g([ni({newValue(t){this.throttledDispatch=this.createThrottledDispatch(t)}})],ac.prototype,"dispatchThrottle",2),g([ni({newValue(t){this.throttledFetch=this.createThrottledFetch(t)}})],ac.prototype,"requestThrottle",2);var lc=(w(),k(T)),ed=(w(),k(T));function AA(t,e){return i=>Number(t)*(1-i)+Number(e)*i}function hy(t,e){if(typeof t=="string")try{t=Dt.fromString(t)}catch{t=Dt.fromArray([0,0,0])}if(typeof e=="string")try{e=Dt.fromString(e)}catch{e=Dt.fromArray([0,0,0])}return i=>Dt.mix(t,e,i).toRgbaString()}var id={};Ci(id,{easeIn:()=>LA,easeInOut:()=>CA,easeInOutQuad:()=>kA,easeInQuad:()=>NA,easeOut:()=>ea,easeOutQuad:()=>TA,inverseEaseOut:()=>dy,linear:()=>uy});var uy=t=>t,LA=t=>1-Math.cos(t*Math.PI/2),ea=t=>Math.sin(t*Math.PI/2),CA=t=>-(Math.cos(t*Math.PI)-1)/2,NA=t=>t*t,TA=t=>1-(1-t)**2,kA=t=>t<.5?2*t*t:1-(-2*t+2)**2/2,dy=t=>2*Math.asin(t)/Math.PI,cc=.2,Yr=["initial","remove","update","add","trailing","end","none"],ia={initial:{animationDuration:1,animationDelay:0},add:{animationDuration:.25,animationDelay:.75},remove:{animationDuration:.25,animationDelay:0},update:{animationDuration:.5,animationDelay:.25},trailing:{animationDuration:cc,animationDelay:1,skipIfNoEarlierAnimations:!0},end:{animationDelay:1+cc,animationDuration:0,skipIfNoEarlierAnimations:!0},none:{animationDuration:0,animationDelay:0}},py=(t=>(t.Loop="loop",t.Reverse="reverse",t))(py||{});function wA(t){return t.every(e=>e instanceof As)}function hc(t){return wA(t)?{nodes:t,selections:[]}:{nodes:[],selections:t}}function sd(t,e){return t===e?!0:Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((i,s)=>sd(i,e[s])):Cl(t)&&Cl(e)?t.equals(e):(0,ed.isPlainObject)(t)&&(0,ed.isPlainObject)(e)?ru(t,e,sd):!1}var gy=class{constructor(t){this.isComplete=!1,this.elapsed=0,this.iteration=0,this.isPlaying=!1,this.isReverse=!1,this.id=t.id,this.groupId=t.groupId,this.autoplay=t.autoplay??!0,this.ease=t.ease??uy,this.phase=t.phase;const e=t.duration??ia[this.phase].animationDuration;this.duration=e*t.defaultDuration,this.delay=(t.delay??0)*t.defaultDuration,this.onComplete=t.onComplete,this.onPlay=t.onPlay,this.onStop=t.onStop,this.onUpdate=t.onUpdate,this.interpolate=this.createInterpolator(t.from,t.to),this.from=t.from,t.skip===!0&&(this.onUpdate?.(t.to,!1,this),this.onStop?.(this),this.onComplete?.(this),this.isComplete=!0),t.collapsable!==!1&&(this.duration=this.checkCollapse(t,this.duration))}checkCollapse(t,e){return sd(t.from,t.to)?0:e}play(t=!1){this.isPlaying||this.isComplete||(this.isPlaying=!0,this.onPlay?.(this),this.autoplay&&(this.autoplay=!1,t&&this.onUpdate?.(this.from,!0,this)))}stop(){this.isPlaying=!1,this.isComplete||(this.isComplete=!0,this.onStop?.(this))}update(t){if(this.isComplete)return t;!this.isPlaying&&this.autoplay&&this.play(!0);const e=this.elapsed;if(this.elapsed+=t,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),t-(s-e)):0}get delta(){return this.ease((0,ed.clamp)(0,(this.elapsed-this.delay)/this.duration,1))}createInterpolator(t,e){if(typeof e!="object"||Cl(e))return this.interpolateValue(t,e);const i=[];for(const s of Object.keys(e)){const n=this.interpolateValue(t[s],e[s]);n!=null&&i.push([s,n])}return s=>{const n={};for(const[r,o]of i)n[r]=o(s);return n}}interpolateValue(t,e){if(!(t==null||e==null)){if(Cl(t))return i=>t[Ll](e,i);try{switch(typeof t){case"number":return AA(t,e);case"string":return hy(t,e);case"boolean":if(t===e)return()=>t;break;case"object":return()=>t}}catch{}throw new Error(`Unable to interpolate values: ${t}, ${e}`)}}},EA=(w(),k(T)),fy=class{constructor(t){this.maxAnimationTime=t,this.debug=vt.create(!0,"animation"),this.controllers=new Map,this.stoppedCbs=new Set,this.currentPhase=0,this.phases=new Map(Yr.map(e=>[e,[]])),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(Yr[this.currentPhase])??[]}checkOverlappingId(t){t!=null&&this.controllers.has(t)&&(this.controllers.get(t).stop(),this.debug(`Skipping animation batch due to update of existing animation: ${t}`),this.skip())}addAnimation(t){if(t.isComplete)return;if(Yr.indexOf(t.phase)<this.currentPhase){this.debug("Skipping animation due to being for an earlier phase",t.id),t.stop();return}this.controllers.set(t.id,t),this.phases.get(t.phase)?.push(t)}removeAnimation(t){this.controllers.delete(t.id);const e=this.phases.get(t.phase),i=e?.indexOf(t);i!=null&&i>=0&&e?.splice(i,1)}progress(t){if(!this.isReady)return;let e=t===0?.01:t;const i=()=>{const c=Yr[this.currentPhase];return{phaseControllers:[...this.getActiveControllers()],phase:c,phaseMeta:ia[c]}};let{phase:s,phaseControllers:n,phaseMeta:r}=i();const o=()=>Yr[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:e},n)},l=this.controllers.size;this.debug(`AnimationBatch - ${t}ms; phase ${s} with ${n?.length} of ${l}`);do{const c=e,h=r.skipIfNoEarlierAnimations&&this.animationTimeConsumed===0;let u=0;for(const d of n)h?d.stop():e=Math.min(d.update(c),e),d.isComplete&&(u++,this.removeAnimation(d));this.animationTimeConsumed+=c-e,this.debug(`AnimationBatch - updated ${n.length} controllers; ${u} completed`),this.debug(`AnimationBatch - animationTimeConsumed: ${this.animationTimeConsumed}`),a()}while(e>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 t=!0;for(const[,e]of this.controllers)if(e.duration>0&&ia[e.phase].skipIfNoEarlierAnimations!==!0){t=!1;break}if(!t)for(const[,e]of this.controllers)e.autoplay&&e.play(!0)}skip(t=!0){if(this.skipAnimations===!1&&t===!0){for(const e of this.controllers.values())e.stop();this.controllers.clear()}this.skipAnimations=t}play(){for(const t of this.controllers.values())t.play()}stop(){for(const t of this.controllers.values())try{t.stop(),this.removeAnimation(t)}catch(e){EA.Logger.error("Error during animation stop",e)}this.dispatchStopped()}stopByAnimationId(t){if(t!=null&&this.controllers.has(t)){const e=this.controllers.get(t);e&&(e.stop(),this.removeAnimation(e))}}stopByAnimationGroupId(t){for(const e of this.controllers.values())e.groupId===t&&this.stopByAnimationId(e.id)}dispatchStopped(){this.stoppedCbs.forEach(t=>t()),this.stoppedCbs.clear()}isSkipped(){return this.skipAnimations}destroy(){this.stop(),this.controllers.clear()}},my=(t=>(t[t.Default=32]="Default",t[t.ZoomDrag=16]="ZoomDrag",t[t.Annotations=8]="Annotations",t[t.ContextMenu=4]="ContextMenu",t[t.Animation=2]="Animation",t[t.AnnotationsSelected=1]="AnnotationsSelected",t[t.Clickable=41]="Clickable",t[t.Focusable=34]="Focusable",t[t.Keyable=43]="Keyable",t[t.ContextMenuable=36]="ContextMenuable",t[t.AnnotationsMoveable=9]="AnnotationsMoveable",t[t.AnnotationsDraggable=57]="AnnotationsDraggable",t[t.ZoomDraggable=50]="ZoomDraggable",t[t.ZoomClickable=34]="ZoomClickable",t[t.ZoomWheelable=59]="ZoomWheelable",t[t.All=63]="All",t))(my||{}),yy=class{constructor(){this.stateQueue=34}pushState(t){this.stateQueue|=t}popState(t){this.stateQueue&=~t}isState(t){return!!(this.stateQueue&-this.stateQueue&t)}};function by(t){return t==null?!0:!isNaN(t)&&t>=0&&t<=2}var xy=class{constructor(t,e){this.interactionManager=t,this.chartUpdateMutex=e,this.defaultDuration=1e3,this.batch=new fy(this.defaultDuration*1.5),this.debug=vt.create(!0,"animation"),this.events=new lc.EventEmitter,this.rafAvailable=typeof requestAnimationFrame<"u",this.isPlaying=!0,this.requestId=null,this.skipAnimations=!0,this.currentAnonymousAnimationId=0}addListener(t,e){return this.events.on(t,e)}animate(t){const e=this.batch;try{e.checkOverlappingId(t.id)}catch(a){this.failsafeOnError(a);return}let{id:i}=t;i==null&&(i=`__${this.currentAnonymousAnimationId}`,this.currentAnonymousAnimationId+=1);const s=this.isSkipped()||t.phase==="none";s&&this.debug("AnimationManager - skipping animation");const{delay:n,duration:r}=t;if(!by(n))throw new Error(`Animation delay of ${n} is unsupported (${i})`);if(!by(r))throw new Error(`Animation duration of ${r} is unsupported (${i})`);const o=new gy({...t,id:i,skip:s,autoplay:this.isPlaying?t.autoplay:!1,phase:t.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(t){this.failsafeOnError(t)}this.requestAnimation()}}stop(){this.isPlaying=!1,this.cancelAnimation(),this.debug("AnimationManager.stop()"),this.batch.stop()}stopByAnimationId(t){try{this.batch.stopByAnimationId(t)}catch(e){this.failsafeOnError(e)}}stopByAnimationGroupId(t){try{this.batch.stopByAnimationGroupId(t)}catch(e){this.failsafeOnError(e)}}reset(){this.isPlaying?(this.stop(),this.play()):this.stop()}skip(t=!0){this.skipAnimations=t}isSkipped(){return!this.rafAvailable||this.skipAnimations||this.batch.isSkipped()}isActive(){return this.isPlaying&&this.batch.isActive()}skipCurrentBatch(){this.debug.check()&&this.debug("AnimationManager - skipCurrentBatch()",{stack:new Error().stack}),this.batch.skip()}isSkippingFrames(){return!0}scheduleAnimationFrame(t){this.requestId=(0,lc.getWindow)().requestAnimationFrame(e=>{t(e).catch(i=>lc.Logger.error(i))})}forceTimeJump(t,e){return!1}requestAnimation(){if(!this.rafAvailable||!this.batch.isActive()||this.requestId!==null)return;let t;const e=async i=>{const s=()=>{const n=i-(t??i);t=i,this.debug("AnimationManager - onAnimationFrame()",{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(e):(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(e)}cancelAnimation(){this.requestId!==null&&(cancelAnimationFrame(this.requestId),this.requestId=null,this.startBatch())}failsafeOnError(t,e=!0){lc.Logger.error("Error during animation, skipping animations",t),e&&this.cancelAnimation()}startBatch(t){this.debug(`AnimationManager - startBatch() with skipAnimations=${t}.`),this.reset(),this.batch.destroy(),this.batch=new fy(this.defaultDuration*1.5),t===!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(t){this.batch.stoppedCbs.add(t)}destroy(){this.stop(),this.events.clear()}},vy=class extends gn{seriesEvent(t){this.listeners.dispatch(t,{type:t})}seriesKeyNavZoom(t,e){const i={type:"series-keynav-zoom",delta:t,widgetEvent:e};this.listeners.dispatch("series-keynav-zoom",i)}legendItemClick(t,e,i,s,n){const r={type:"legend-item-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:n};this.listeners.dispatch("legend-item-click",r)}legendItemDoubleClick(t,e,i,s,n,r){const o={type:"legend-item-double-click",legendType:t,series:e,itemId:i,enabled:s,legendItemName:r,numVisibleItems:n};this.listeners.dispatch("legend-item-double-click",o)}},My=class{constructor(){this.defaultActions=[],this.disabledActions=new Set,this.hiddenActions=new Set,this.listeners=new Os}static check(t,e){return e.type===t}static checkCallback(t,e,i){return t===e}dispatchContext(t,e,i,s){const{sourceEvent:n}=e;if(n.defaultPrevented)return;const r=s?.x??e.canvasX,o=s?.y??e.canvasY,a={type:t,x:r,y:o,context:i,sourceEvent:n};this.listeners.dispatch("",a)}addListener(t){return this.listeners.addListener("",t)}filterActions(t){return this.defaultActions.filter(e=>e.id!=null&&!this.hiddenActions.has(e.id)&&["all",t].includes(e.type))}registerDefaultAction(t){const e=t.id!=null&&!this.defaultActions.some(({id:i})=>i===t.id);return e&&this.defaultActions.push(t),()=>{const i=e?this.defaultActions.findIndex(({id:s})=>s===t.id):-1;i!==-1&&this.defaultActions.splice(i,1)}}enableAction(t){this.disabledActions.delete(t)}disableAction(t){this.disabledActions.add(t)}showAction(t){this.hiddenActions.add(t)}hideAction(t){this.hiddenActions.delete(t)}isDisabled(t){return this.disabledActions.has(t)}},Sy=class extends gn{constructor(){super(...arguments),this.highlightStates=new Gr}updateHighlight(t,e){const{activeHighlight:i}=this;this.highlightStates.set(t,e),this.activeHighlight=this.highlightStates.stateValue(),this.isEqual(this.activeHighlight,i)||this.listeners.dispatch("highlight-change",{type:"highlight-change",currentHighlight:this.activeHighlight,previousHighlight:i,callerId:t})}getActiveHighlight(){return this.activeHighlight}isEqual(t,e){return t===e||t!=null&&e!=null&&t?.series===e?.series&&t?.itemId===e?.itemId&&t?.datum===e?.datum}},Dy=(w(),k(T));function Iy(t,e){if(t==null||e.length===0)return[!1,!1];const i=t.valueOf(),s=e[0],n=e[e.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 fn(t,e,i,s,n){const{xValue:r,yValue:o}=t,[a,l]=Iy(o,n),[c,h]=Iy(r,s);return{xKey:e,yKey:i,xValue:r,yValue:o,first:c,last:h,min:a,max:l}}function Ay(t,[e,i],s){const n=(0,Dy.findMinIndex)(0,t-1,o=>{const a=s(o)?.[1]??NaN;return!Number.isFinite(a)||a>e})??0;let r=(0,Dy.findMaxIndex)(0,t-1,o=>{const a=s(o)?.[0]??NaN;return!Number.isFinite(a)||a<i})??t-1;return r=Math.min(r+1,t),[n,r]}function nd(t,e,i){if(i){const{x:n,y:r,width:o,height:a}=i;return{canvasX:n+o/2,canvasY:r+a/2}}const s=e.yBar?.upperPoint??e.midPoint??t.datumMidPoint?.(e);if(s){const{x:n,y:r}=Kt.toCanvasPoint(t.contentGroup,s.x,s.y);return{canvasX:Math.round(n),canvasY:Math.round(r)}}}function Ly(t,e,i,s,n){let r=-1,o=0,a=0,l=!1;for(;o<s&&r<=e-t;){r+=1;const c=i+a;if(l||(a*=-1),a>=0&&(a+=1),l&&a<0&&(a-=1),c<t||c>e){l=!0;continue}n(c)&&(o+=1)}return o}var uc=class{constructor(t,e,i){this.domManager=e,this.tooltip=i,this.stateTracker=new Gr,this.suppressState=new Gr(!1),this.appliedState=null,this.destroyFns=[],this.destroyFns.push(i.setup(t,e),e.addListener("hidden",()=>this.tooltip.hide()))}destroy(){this.destroyFns.forEach(t=>t())}updateTooltip(t,e,i,s){i??(i=this.stateTracker.get(t)?.content),this.stateTracker.set(t,{meta:e,content:i,pagination:s}),this.applyStates()}removeTooltip(t){this.stateTracker.delete(t),this.applyStates()}suppressTooltip(t){this.suppressState.set(t,!0)}unsuppressTooltip(t){this.suppressState.delete(t)}applyStates(){const t=this.stateTracker.stateId(),e=t?this.stateTracker.get(t):void 0;if(this.suppressState.stateValue()||e?.meta==null||e?.content==null){this.appliedState=null,this.tooltip.hide();return}const i=this.domManager.getBoundingClientRect(),s=this.tooltip.bounds==="extended"?this.domManager.getOverlayClientRect():i;if(this.appliedState?.content===e?.content){const n=this.tooltip.isVisible();this.tooltip.show(s,i,e?.meta,null,void 0,n)}else this.tooltip.show(s,i,e?.meta,e?.content,e?.pagination);this.appliedState=e}static makeTooltipMeta(t,e,i,s){const{canvasX:n,canvasY:r}=t,o=e.properties.tooltip,{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:u,yOffset:d}=o.position,p=nd(e,i,s);return{canvasX:n,canvasY:r,nodeCanvasX:p?.canvasX??n,nodeCanvasY:p?.canvasY??r,enableInteraction:o.interaction?.enabled??!1,showArrow:o.showArrow,position:{placement:a,defaultPlacement:l,anchorTo:c,defaultAnchorTo:h,xOffset:u,yOffset:d}}}isEnteringInteractiveTooltip(t){const{tooltip:e}=this,i=t.relatedTarget;return e.interactive&&e.enabled&&e.isVisible()&&e.contains(i)}},Cy=3,OA=505,Ny=30;function rd(t,e,i){const{offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}=i;return{type:e,device:t,offsetX:s,offsetY:n,clientX:r,clientY:o,currentX:a,currentY:l,sourceEvent:c}}function Ty(t,e){const i=t*t+e*e,s=Cy*Cy;return i>=s}function RA(t,e){const i=t.clientX-e.clientX,s=t.clientY-e.clientY,n=i*i+s*s,r=Ny*Ny;return n<r}var ky=class{constructor(t){this.destroyFns=[],this.listeners=new Os,this.isDragging=!1,this.touch={distanceTravelledX:0,distanceTravelledY:0,clientX:0,clientY:0},this.destroyFns.push(t.addListener("touchstart",this.onTouchStart.bind(this)),t.addListener("touchmove",this.onTouchMove.bind(this)),t.addListener("touchend",this.onTouchEnd.bind(this)),t.addListener("mousemove",this.onMouseMove.bind(this)),t.addListener("dblclick",this.onDblClick.bind(this)),t.addListener("drag-start",this.onDragStart.bind(this)),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",this.onDragEnd.bind(this)))}destroy(){this.destroyFns.forEach(t=>t()),this.listeners.destroy()}addListener(t,e){return this.listeners.addListener(t,e)}dispatch(t){this.listeners.dispatch(t.type,t)}onTouchStart(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX=0,this.touch.distanceTravelledY=0,this.touch.clientX=e,this.touch.clientY=i}onTouchMove(t){const{clientX:e,clientY:i}=t.sourceEvent.targetTouches[0]??{clientX:1/0,clientY:1/0};this.touch.distanceTravelledX+=Math.abs(this.touch.clientX-e),this.touch.distanceTravelledY+=Math.abs(this.touch.clientY-i),this.touch.clientX=e,this.touch.clientY=i}onTouchEnd(t){t.sourceEvent.preventDefault()}onMouseMove(t){this.dispatch(t)}onDblClick(t){this.dispatch({device:"mouse",...t})}onDragStart(t){this.dragStartEvent=t}onDragMove(t){this.dragStartEvent!=null&&Ty(t.originDeltaX,t.originDeltaY)&&(this.dispatch(this.dragStartEvent),this.dispatch({...this.dragStartEvent,type:"drag-move"}),this.dragStartEvent=void 0,this.isDragging=!0),this.isDragging&&this.dispatch(t)}onDragEnd(t){if(this.isDragging){this.dispatch(t),this.isDragging=!1;return}if(t.device==="mouse"){const e=rd("mouse","click",t);this.dispatch(e)}else if(t.sourceEvent.type==="touchend"){if(Ty(this.touch.distanceTravelledX,this.touch.distanceTravelledY))return;const e=rd("touch","click",t);this.dispatch(e);const i=Date.now();if(this.lastClick!==void 0&&i-this.lastClick.time<=OA&&RA(this.lastClick,t)){const s=rd(t.device,"dblclick",t);this.dispatch(s),this.lastClick=void 0}else this.lastClick={time:i,clientX:t.clientX,clientY:t.clientY}}}},od=class extends Vr{constructor(t){super(t)}addChildToDOM(){}removeChildFromDOM(){}},PA=class{constructor(t){this.seriesWidget=new od(t.getParent("series-area")),this.chartWidget=new od(t.getParent("canvas-proxy")),this.containerWidget=new od(t.getParent("canvas-container")),this.containerWidget.addChild(this.chartWidget),this.chartWidget.addChild(this.seriesWidget),this.seriesDragInterpreter=new ky(this.seriesWidget)}destroy(){this.seriesDragInterpreter.destroy(),this.seriesWidget.destroy(),this.chartWidget.destroy(),this.containerWidget.destroy()}},ft=(w(),k(T)),_A=(w(),k(T));function ad(t,e){const[i,s]=ne(e);return(0,_A.clamp)(i,t,s)}function ne(t){if(t.length===0)return[];const e=[1/0,-1/0];for(const i of t)i<e[0]&&(e[0]=i),i>e[1]&&(e[1]=i);return e}function Wr(t){const[e,i]=ne(t);return i-e}var wy=class zv extends Rl{constructor(e=[],i=[]){super(),this.domain=e,this.range=i,this.defaultClamp=!1}static is(e){return e instanceof zv}normalizeDomains(...e){let i,s=1/0,n,r=-1/0;for(const o of e)for(const a of o){const l=a.valueOf();l<s&&(s=l,i=a),l>r&&(r=l,n=a)}return i!=null&&n!=null?{domain:[i,n],animatable:!0}:{domain:[],animatable:!1}}transform(e){return e}transformInvert(e){return e}calcBandwidth(e=1){const{domain:i}=this,s=this.getPixelRange();if(i.length===0)return s;const n=Math.abs(i[1].valueOf()-i[0].valueOf())/e+1,r=Math.floor(s),o=Math.min(n,r);return s/Math.max(1,o)}convert(e,i=this.defaultClamp){const{domain:s}=this;if(!s||s.length<2)return NaN;const n=Number(this.transform(s[0])),r=Number(this.transform(s[1])),o=Number(this.transform(e)),{range:a}=this,[l,c]=a;if(i){const[h,u]=ne([n,r]);if(o<h)return l;if(o>u)return c}return n===r?(l+c)/2:o===n?l:o===r?c:l+(o-n)/(r-n)*(c-l)}invert(e,i){const s=this.domain.map(h=>this.transform(h)),[n,r]=s,{range:o}=this,[a,l]=o;let c;return a===l?c=this.toDomain((Number(n)+Number(r))/2):c=this.toDomain(Number(n)+(e-a)/(l-a)*(Number(r)-Number(n))),this.transformInvert(c)}getPixelRange(){const[e,i]=this.range;return Math.abs(i-e)}};wy.defaultTickCount=5;var Ct=wy,jA=(w(),k(T));function Ey(t,e){return t.valueOf()-e.valueOf()}function FA(t){let e=NaN;const i=[];for(const s of t){const n=s.valueOf();e!==n&&i.push(s),e=n}return i}function ld(t){const e=t.slice().sort(Ey);return cd(e)==null?FA(e):e}function cd(t){if(t.length===0)return 1;const e=Number(t[t.length-1])>Number(t[0])?1:-1;let i=-1/0*e;for(const s of t){const n=s.valueOf();if(Math.sign(n-i)!==e)return;i=n}return e}var dc={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 hd(t,e=new Date(t.getFullYear(),0,1)){const i=t.getTimezoneOffset()-e.getTimezoneOffset(),s=t.getTime()-e.getTime()+i*6e4,n=36e5*24;return Math.floor(s/n)}function Oy(t,e){const s=new Date(t.getFullYear(),0,1).getDay(),n=(e-s+7)%7,r=new Date(t.getFullYear(),0,n+1);return r<=t?Math.floor(hd(t,r)/7)+1:0}var zA=0,Ry=1,Py=4;function _y(t,e=t.getFullYear()){const s=new Date(e,0,1).getDay(),n=(Py-s+7)%7,r=new Date(e,0,n-(Py-Ry)+1);return r<=t?Math.floor(hd(t,r)/7)+1:_y(t,e-1)}function BA(t){const e=t.getTimezoneOffset(),i=Math.abs(e);return`${e>0?"-":"+"}${Ee(Math.floor(i/60),2,"0")}${Ee(Math.floor(i%60),2,"0")}`}var GA={a:t=>dc.shortDays[t.getDay()],A:t=>dc.days[t.getDay()],b:t=>dc.shortMonths[t.getMonth()],B:t=>dc.months[t.getMonth()],c:"%x, %X",d:(t,e)=>Ee(t.getDate(),2,e??"0"),e:"%_d",f:(t,e)=>Ee(t.getMilliseconds()*1e3,6,e??"0"),H:(t,e)=>Ee(t.getHours(),2,e??"0"),I:(t,e)=>{const i=t.getHours()%12;return i===0?"12":Ee(i,2,e??"0")},j:(t,e)=>Ee(hd(t)+1,3,e??"0"),m:(t,e)=>Ee(t.getMonth()+1,2,e??"0"),M:(t,e)=>Ee(t.getMinutes(),2,e??"0"),L:(t,e)=>Ee(t.getMilliseconds(),3,e??"0"),p:t=>t.getHours()<12?"AM":"PM",Q:t=>String(t.getTime()),s:t=>String(Math.floor(t.getTime()/1e3)),S:(t,e)=>Ee(t.getSeconds(),2,e??"0"),u:t=>{let e=t.getDay();return e<1&&(e+=7),String(e%7)},U:(t,e)=>Ee(Oy(t,zA),2,e??"0"),V:(t,e)=>Ee(_y(t),2,e??"0"),w:(t,e)=>Ee(t.getDay(),2,e??"0"),W:(t,e)=>Ee(Oy(t,Ry),2,e??"0"),x:"%-m/%-d/%Y",X:"%-I:%M:%S %p",y:(t,e)=>Ee(t.getFullYear()%100,2,e??"0"),Y:(t,e)=>Ee(t.getFullYear(),4,e??"0"),Z:t=>BA(t),"%":()=>"%"},VA={_:" ",0:"0","-":""};function Ee(t,e,i){const s=String(Math.floor(t));return s.length>=e?s:`${i.repeat(e-s.length)}${s}`}function sa(t){const e=[];for(;t.length>0;){let i=t.indexOf("%");if(i!==0){const a=i>0?t.substring(0,i):t;e.push(a)}if(i<0)break;const s=t[i+1],n=VA[s];n!=null&&i++;const r=t[i+1],o=GA[r];if(typeof o=="function")e.push([o,n]);else if(typeof o=="string"){const a=sa(o);e.push([a,n])}else e.push(`${n??""}${r}`);t=t.substring(i+2)}return i=>{const s=typeof i=="number"?new Date(i):i;return e.map(n=>typeof n=="string"?n:n[0](s,n[1])).join("")}}var jy={};Ci(jy,{TimeInterval:()=>Yn,day:()=>pc,friday:()=>nL,hour:()=>Zr,millisecond:()=>Fy,minute:()=>Kr,monday:()=>tL,month:()=>$n,saturday:()=>rL,second:()=>Hr,sunday:()=>ra,thursday:()=>sL,tuesday:()=>eL,utcDay:()=>bL,utcHour:()=>fL,utcMinute:()=>dL,utcMonth:()=>ML,utcYear:()=>IL,wednesday:()=>iL,year:()=>gc});var UA=(w(),k(T)),Yn=class{constructor(t,e,i){this._encode=t,this._decode=e,this._rangeCallback=i}floor(t){const e=new Date(t),i=this._encode(e);return this._decode(i)}ceil(t){const e=new Date(Number(t)-1),i=this._encode(e);return this._decode(i+1)}range(t,e,{extend:i=!1,visibleRange:s=[0,1]}={}){let n=!1;t.getTime()>e.getTime()&&([t,e]=[e,t],n=!0);const r=this._rangeCallback?.(t,e),o=this._encode(i?this.floor(t):this.ceil(t)),a=this._encode(i?this.ceil(e):this.floor(e));if(a<o)return[];const l=a-o;let c,h;n?(c=Math.ceil(o+(1-s[1])*l),h=Math.floor(o+(1-s[0])*l)):(c=Math.floor(o+s[0]*l),h=Math.ceil(o+s[1]*l));const u=[];for(let d=c;d<=h;d+=1){const p=this._decode(d);u.push(p)}return r?.(),u}},xi=class extends Yn{getOffset(t,e){return Math.floor(this._encode(new Date(t)))%e}every(t,e){let i=0,s;const n=t;t=Math.max(1,Math.round(t)),n!==t&&UA.Logger.warnOnce(`interval step of [${n}] rounded to [${t}].`);const{snapTo:r="start"}=e??{};if(typeof r=="string"){const l=i;s=(c,h)=>{const u=r==="start"?c:h;return i=this.getOffset(u,t),()=>i=l}}else typeof r=="number"?i=this.getOffset(new Date(r),t):r instanceof Date&&(i=this.getOffset(r,t));const o=l=>Math.floor((this._encode(l)-i)/t),a=l=>this._decode(l*t+i);return new Yn(o,a,s)}};function YA(t){return t.getTime()}function WA(t){return new Date(t)}var Fy=new xi(YA,WA),mn=1e3,Oe=mn*60,qe=Oe*60,wi=qe*24,Ps=wi*7,na=wi*30,$r=wi*365,zy=new Date().getTimezoneOffset()*Oe;function $A(t){return Math.floor((t.getTime()-zy)/mn)}function HA(t){return new Date(zy+t*mn)}var Hr=new xi($A,HA),By=new Date().getTimezoneOffset()*Oe;function KA(t){return Math.floor((t.getTime()-By)/Oe)}function ZA(t){return new Date(By+t*Oe)}var Kr=new xi(KA,ZA),Gy=new Date().getTimezoneOffset()*Oe;function XA(t){return Math.floor((t.getTime()-Gy)/qe)}function qA(t){return new Date(Gy+t*qe)}var Zr=new xi(XA,qA);function QA(t){const e=t.getTimezoneOffset()*Oe;return Math.floor((t.getTime()-e)/wi)}function JA(t){const e=new Date(1970,0,1);return e.setDate(e.getDate()+t),e}var pc=new xi(QA,JA);function Wn(t){const i=(7+t-4)%7;function s(r){const o=r.getTimezoneOffset()*Oe;return Math.floor((r.getTime()-o)/Ps-i/7)}function n(r){const o=new Date(1970,0,1);return o.setDate(o.getDate()+r*7+i),o}return new xi(s,n)}var ra=Wn(0),tL=Wn(1),eL=Wn(2),iL=Wn(3),sL=Wn(4),nL=Wn(5),rL=Wn(6);function oL(t){return t.getFullYear()*12+t.getMonth()}function aL(t){const e=Math.floor(t/12),i=t-e*12;return new Date(e,i,1)}var $n=new xi(oL,aL);function lL(t){return t.getFullYear()}function cL(t){const e=new Date;return e.setFullYear(t),e.setMonth(0,1),e.setHours(0,0,0,0),e}var gc=new xi(lL,cL);function hL(t){return Math.floor(t.getTime()/Oe)}function uL(t){return new Date(t*Oe)}var dL=new xi(hL,uL);function pL(t){return Math.floor(t.getTime()/qe)}function gL(t){return new Date(t*qe)}var fL=new xi(pL,gL);function mL(t){return Math.floor(t.getTime()/wi)}function yL(t){const e=new Date(0);return e.setUTCDate(e.getUTCDate()+t),e.setUTCHours(0,0,0,0),e}var bL=new xi(mL,yL);function xL(t){return t.getUTCFullYear()*12+t.getUTCMonth()}function vL(t){const e=Math.floor(t/12),i=t-e*12;return new Date(Date.UTC(e,i,1))}var ML=new xi(xL,vL);function SL(t){return t.getUTCFullYear()}function DL(t){const e=new Date;return e.setUTCFullYear(t),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0),e}var IL=new xi(SL,DL);function Ve(t){return t instanceof Date?t.getTime():t}function ud(t,e,i){const s=Vy(t,e,i),n=sa(s);return r=>n(r)}function Vy(t,e,i=0){let s=1/0;for(let h=1;h<t.length;h++)s=Math.min(s,Math.abs(t[h].valueOf()-t[h-1].valueOf()));const[n,r]=e.length===0?[0,0]:ne([e[0].valueOf(),e[e.length-1].valueOf()]),o=new Date(n).getFullYear(),l=new Date(r).getFullYear()-o>0,c=isFinite(s)?AL(s,t):LL(t[0]);return NL(Math.max(c-i,0),l,t)}function AL(t,e){return t<mn?0:t<Oe?1:t<qe?2:t<wi?3:t<Ps?4:t<wi*28||t<wi*31&&CL(e)?5:t<$r?6:7}function LL(t){return Hr.floor(t)<t?0:Kr.floor(t)<t?1:Zr.floor(t)<t?2:pc.floor(t)<t?3:$n.floor(t)<t?ra.floor(t)<t?4:5:gc.floor(t)<t?6:7}function CL(t){let e=new Date(t[0]).getMonth();for(let i=1;i<t.length;i++){const s=new Date(t[i]).getMonth();if(e===s)return!0;e=s}return!1}function NL(t,e,i){const s=Ve(i[0]),n=Ve(i.at(-1)),r=Math.abs(n-s),o=e||t===7,a=r===0,c=[["hour",6*qe,14*wi,3,"%I %p"],["hour",Oe,6*qe,3,"%I:%M"],["second",1e3,6*qe,1,":%S"],["ms",0,6*qe,0,".%L"],["am/pm",Oe,6*qe,3,"%p"]," ",["day",wi,Ps,4,"%a"],["month",a?0:Ps,52*Ps,5,"%b %d"],["month",5*Ps,10*$r,6,"%B"]," ",["year",o?0:$r,1/0,7,"%Y"]].filter(d=>{if(typeof d=="string")return!0;const[p,f,y,x]=d;return x>=t&&f<=r&&r<y}).reduce((d,p)=>(typeof p=="string"?d.result.push(p):d.used.has(p[0])||(d.result.push(p),d.used.add(p[0])),d),{result:[],used:new Set}).result,h=c.findIndex(d=>typeof d!="string"),u=c.findLastIndex(d=>typeof d!="string");return c.slice(h,u+1).map(d=>typeof d=="string"?d:d[4]).join("").replaceAll(/\s+/g," ").trim()}var oa=(w(),k(T)),Uy=(w(),k(T));function Yy(t,e,i){if(i==null||i[0]===0&&i[1]===1)return t;const s=(0,Uy.clamp)(0,Math.floor(i[0]*t.length),t.length),n=(0,Uy.clamp)(0,Math.ceil(i[1]*t.length),t.length),r=e?t.length-n:s,o=e?t.length-s:n;return t.slice(r,o)}var fc=class Bv extends Rl{constructor(){super(...arguments),this.invalid=!0,this.range=[0,1],this.round=!1,this.interval=void 0,this._bandwidth=1,this._step=1,this._inset=1,this._rawBandwidth=1,this._paddingInner=0,this._paddingOuter=0}static is(e){return e instanceof Bv}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(e){e=(0,oa.clamp)(0,e,1),this._paddingInner=e,this._paddingOuter=e}get padding(){return this._paddingInner}set paddingInner(e){this.invalid=!0,this._paddingInner=(0,oa.clamp)(0,e,1)}get paddingInner(){return this._paddingInner}set paddingOuter(e){this.invalid=!0,this._paddingOuter=(0,oa.clamp)(0,e,1)}get paddingOuter(){return this._paddingOuter}refresh(){this.invalid&&(this.invalid=!1,this.update(),this.invalid&&oa.Logger.warnOnce("Expected update to not invalidate scale"))}ticks(e,i=this.domain,s){return Yy(i,!1,s)}convert(e,i){this.refresh();const s=this.getIndex(e);return s==null||s<0||s>=this.domain.length?NaN:this.ordinalRange(s)}invertNearestIndex(e){this.refresh();const{domain:i}=this;if(i.length===0)return-1;let s=0,n=i.length-1,r=1/0,o=0;for(;s<=n;){const a=(n+s)/2|0,l=this.ordinalRange(a),c=Math.abs(l-e);if(c===0)return a;c<r&&(r=c,o=a),l<e?s=a+1:n=a-1}return o}update(){const e=this.domain.length;if(e===0)return;const[i,s]=this.range;let{_paddingInner:n}=this;const{_paddingOuter:r,round:o}=this,a=s-i;let l;e===1?(n=0,l=a*(1-r*2)):l=a/Math.max(1,e-n+r*2);const c=o?Math.floor(l):l;let h=i+(a-c*(e-n))/2,u=c*(1-n);o&&(h=Math.round(h),u=Math.round(u)),this._step=c,this._inset=h,this._bandwidth=u,this._rawBandwidth=l*(1-n)}ordinalRange(e){const{_inset:i,_step:s,range:n}=this,r=Math.min(n[0],n[1]),o=Math.max(n[0],n[1]);return(0,oa.clamp)(r,i+s*e,o)}};g([Nr],fc.prototype,"range",2),g([Nr],fc.prototype,"round",2),g([Nr],fc.prototype,"interval",2);var aa=fc,Xr=(w(),k(T)),Zt=(t,e,i)=>({duration:e*i,timeInterval:t,step:i}),la=[Zt(Hr,mn,1),Zt(Hr,mn,5),Zt(Hr,mn,15),Zt(Hr,mn,30),Zt(Kr,Oe,1),Zt(Kr,Oe,5),Zt(Kr,Oe,15),Zt(Kr,Oe,30),Zt(Zr,qe,1),Zt(Zr,qe,3),Zt(Zr,qe,6),Zt(Zr,qe,12),Zt(pc,wi,1),Zt(pc,wi,2),Zt(ra,Ps,1),Zt(ra,Ps,2),Zt(ra,Ps,3),Zt($n,na,1),Zt($n,na,2),Zt($n,na,3),Zt($n,na,4),Zt($n,na,6),Zt(gc,$r,1)],Wy=[1,2,5,10];function $y(t,e){return Math.abs(Math.round(t)-t)<e}function dd(t,e,i,s,n,r){if(i<2)return[t,e];const o=ca(t,e,i,s,n);if(!Number.isFinite(o))return[];if($y(t/o,1e-12)||(t=Math.ceil(t/o)*o),$y(e/o,1e-12)||(e=Math.floor(e/o)*o),r!=null&&r[0]!==0&&r[1]!==1){const a=e-t,l=t+a*r[0],c=e-a*(1-r[1]);return ha(l-l%o,c+c%o,o)}return ha(t,e,o)}function Hy(t,e,i,s,n,r){const o=r??Math.abs(e-t)/Math.max(i,1);let a=0;for(const d of la){if(o<=d.duration)break;a++}if(a===0){const d=Math.max(ca(t,e,i,s,n),1);return Fy.every(d)}else if(a===la.length){const d=r==null?ca(t/$r,e/$r,i,s,n):1;return gc.every(d)}const l=la[a-1],c=la[a],{timeInterval:h,step:u}=o-l.duration<c.duration-o?l:c;return h.every(u)}function ca(t,e,i,s=0,n=1/0){if(t===e)return(0,Xr.clamp)(1,s,n);if(i<1)return NaN;const r=Math.abs(e-t),o=10**Math.floor(Math.log10(r/i));let a=NaN,l=1/0,c=!1;for(const h of Wy){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 Ky(t){for(let e=t.length-1;e>=0;e-=1)if(t[e]!=="0")return e+1;return 0}function Zy(t,e){const i=(0,Xr.parseNumberFormat)(e??",f");(i.precision==null||isNaN(i.precision))&&(!i.type||"eEFgGnprs".includes(i.type)?i.precision=Math.max(...t.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)+Ky(o)+1})):"f%".includes(i.type)&&(i.precision=Math.max(...t.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=Ky(a);return Math.max(0,l-r)}))));const s=(0,Xr.createNumberFormatter)(i);return n=>s(Number(n))}function ha(t,e,i){if(!Number.isFinite(i)||i<=0)return[];const s=10**(0,Xr.countFractionDigits)(i),n=Math.min(t,e),r=Math.max(t,e),o=[];for(let a=0;;a+=1){const l=Math.round((n+i*a)*s)/s;if(l>r)break;o.push(l)}return o}function qr(t,e){return t>=e?(Xr.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 TL(t,e){const i=Math.abs(e-t),s=10**Math.floor(Math.log10(i));let n=1/0,r=[t,e];for(const o of Wy){const a=o*s,l=Math.floor(t/a)*a,c=Math.ceil(e/a)*a,h=1-i/Math.abs(c-l);n>h&&(n=h,r=[l,c])}return r}function Xy(t,e,i,s,n,r){if(t<=0)return{minTickCount:0,maxTickCount:0,tickCount:0};r=Math.max(r,t/(n+1)),i??(i=r),s??(s=t),i>s&&(i===r?i=s:s=i);const o=Math.max(1,Math.floor(t/(e*i))),a=Math.min(o,Math.ceil(t/(e*s))),l=(0,Xr.clamp)(a,Math.floor(n/e),o);return{minTickCount:a,maxTickCount:o,tickCount:l}}var qy=class extends Ct{constructor(){super([],[0,1]),this.type="time"}toDomain(t){return new Date(t)}convert(t,e){return t instanceof Date||(t=new Date(t)),super.convert(t,e)}invert(t){return new Date(super.invert(t))}niceDomain(t,e=this.domain){if(e.length<2)return[];let[i,s]=e;const n=4,r=this.getPixelRange();for(let o=0;o<n;o++){const[a,l]=kL(i,s,t,r);if(Ve(i)===Ve(a)&&Ve(s)===Ve(l))break;i=a,s=l}return[i,s]}ticks(t,e=this.domain,i=[0,1]){const{nice:s,interval:n,tickCount:r=Ct.defaultTickCount,minTickCount:o,maxTickCount:a}=t;if(e.length<2)return[];const l=e.map(Ve),c=l[0],h=l[l.length-1];if(n!=null){const u=this.getPixelRange();return pd({start:c,stop:h,interval:n,availableRange:u,visibleRange:i})??Qy({start:c,stop:h,tickCount:r,minTickCount:o,maxTickCount:a,visibleRange:i})}else{if(s&&r===2)return e;if(s&&r===1)return e.slice(0,1)}return Qy({start:c,stop:h,tickCount:r,minTickCount:o,maxTickCount:a,visibleRange:i})}_tickFormatter({domain:t,ticks:e,specifier:i},s){return i!=null?sa(i):ud(e,t,s)}tickFormatter(t){return this._tickFormatter(t)}datumFormatter(t){return this._tickFormatter(t,1)}};function Qy({start:t,stop:e,tickCount:i,minTickCount:s,maxTickCount:n,visibleRange:r}){const o=Hy(t,e,i,s,n);return o?o.range(new Date(t),new Date(e),{visibleRange:r}):[]}function pd({start:t,stop:e,interval:i,availableRange:s,visibleRange:n}){if(!i)return[];if(i instanceof Yn){const h=i.range(new Date(t),new Date(e),{visibleRange:n});return qr(h.length,s)?void 0:h}const r=Math.abs(i);if(qr(Math.abs(e-t)/r,s))return;const o=la.findLast(h=>r%h.duration===0);if(o)return o.timeInterval.every(r/(o.duration/o.step)).range(new Date(t),new Date(e),{visibleRange:n});let a=new Date(Math.min(t,e));const l=new Date(Math.max(t,e)),c=[];for(;a<=l;)c.push(a),a=new Date(a),a.setMilliseconds(a.getMilliseconds()+r);return c}function kL(t,e,i,s){const{interval:n}=i,r=Math.min(Ve(t),Ve(e)),o=Math.max(Ve(t),Ve(e));let a;if(n instanceof Yn)a=n;else{let l;typeof n=="number"&&(l=(o-r)/Math.max(n,1),qr(l,s)&&(l=null)),l??(l=i.tickCount??Ct.defaultTickCount),a=Hy(r,o,l,i.minTickCount,i.maxTickCount)}if(a){const l=a.range(new Date(r),new Date(o),{extend:!0});return t>e&&l.reverse(),[l[0],l.at(-1)]}else return[t,e]}var _s=class Gv extends aa{constructor(){super(...arguments),this.type="ordinal-time",this._domain=[],this.isReversed=!1}static is(e){return e instanceof Gv}set domain(e){e!==this._domain&&(this.invalid=!0,this._domain=e,this.isReversed=e.length>0&&e[0]>e[e.length-1],this.sortedTimestamps=void 0,this.precomputedSteps=void 0)}get domain(){return this._domain}toDomain(e){return new Date(e)}normalizeDomains(...e){const i=e.filter(s=>s.length>0);if(i.length===0)return{domain:[],animatable:!1};if(i.length===1){let s=i[0];const n=cd(s);return n===-1?s=s.slice().reverse():n==null&&(s=ld(s.slice())),{domain:s,animatable:!0}}return{domain:ld(i.flat()),animatable:!0}}ticks({interval:e,maxTickCount:i},s=this.domain,n=[0,1]){if(!s.length)return[];this.refresh();const{isReversed:r}=this;if(e==null)return Jy(s,i,r,n);const[o,a]=[s[0].valueOf(),s.at(-1).valueOf()],l=Math.min(o,a),c=Math.max(o,a),[h,u]=this.range,d=Math.abs(u-h),p=pd({start:l,stop:c,interval:e,availableRange:d,visibleRange:n})??Jy(s,i,r,n);let f=-1;return p.filter(y=>{const x=this.findInterval(y.valueOf()),m=x===f;return f=x,!m})}getSortedTimestamps(){let{sortedTimestamps:e}=this;return e==null&&(e=this.domain.map(Ve),this.isReversed&&e.reverse(),this.sortedTimestamps=e),e}getPrecomputedSteps(){const{domain:e}=this;let{precomputedSteps:i}=this;const s=e.length<1e4?e.length:Math.ceil(e.length/16);if(i!=null||s<=1)return i;const n=this.getSortedTimestamps();i=new Int32Array(s);const r=n[0],a=n[n.length-1]-r,l=0,c=n.length-1;for(let h=0;h<i.length;h+=1)i[h]=this.findIntervalInRange(r+h/s*a,l,c);this.precomputedSteps=i}findIntervalInRange(e,i,s){const n=this.getSortedTimestamps();for(;i<=s;){const r=(i+s)/2|0;if(n[r]===e)return r;n[r]<e?i=r+1:s=r-1}return i}findInterval(e){const i=this.getPrecomputedSteps();let s,n;if(i==null)s=0,n=this.domain.length-1;else{const r=this.getSortedTimestamps(),o=r[0],a=r[r.length-1],l=Math.min((e-o)/(a-o)*i.length|0,i.length-1|0);s=i[l],n=l<i.length-2?i[l+1]:r.length-1}return this.findIntervalInRange(e,s,n)}tickFormatter({domain:e,ticks:i,specifier:s}){return s!=null?sa(s):ud(i,e)}datumFormatter(e){return this.tickFormatter(e)}invert(e,i=!1){this.refresh();const{domain:s}=this;if(i){const r=this.invertNearestIndex(e-this.bandwidth/2);return r!=null?s[r]:void 0}return(0,jA.findMinValue)(0,s.length-1,r=>this.ordinalRange(r)>=e?s[r]:void 0)??s[0]}getIndex(e){const i=this.getSortedTimestamps(),s=Number(e);if(s<i[0])return;let n=this.findInterval(s);return this.isReversed&&(n=this.domain.length-n-1),n}};function Jy(t,e,i,s){const n=[],r=Math.ceil(t.length/e),o=Math.floor(r/2),a=Math.floor(s[0]*t.length),l=Math.ceil(s[1]*t.length);for(let c=a;c<l;c+=1){const h=i?t.length-1-c:c;(r<=0||(h+o)%r===0)&&n.push(t[c])}return i&&n.reverse(),n}var gd=(w(),k(T)),ua={bottomCenter:PL,center:RL,clone:zL,collides:BL,end:EL,from:GL,height:jL,round:FL,start:wL,topCenter:OL,origin:VL,width:_L};function wL(t){return{x:t.x1,y:t.y1}}function EL(t){return{x:t.x2,y:t.y2}}function OL(t){return{x:(t.x1+t.x2)/2,y:Math.min(t.y1,t.y2)}}function RL(t){return{x:(t.x1+t.x2)/2,y:(t.y1+t.y2)/2}}function PL(t){return{x:(t.x1+t.x2)/2,y:Math.max(t.y1,t.y2)}}function _L(t){return Math.abs(t.x2-t.x1)}function jL(t){return Math.abs(t.y2-t.y1)}function FL(t){return{x1:Math.round(t.x1),y1:Math.round(t.y1),x2:Math.round(t.x2),y2:Math.round(t.y2)}}function zL(t){return{x1:t.x1,y1:t.y1,x2:t.x2,y2:t.y2}}function BL(t,e){const i=fd(t),s=fd(e);return i.x1<=s.x2&&i.x2>=s.x1&&i.y1<=s.y2&&i.y2>=s.y1}function fd(t){return{x1:Math.min(t.x1,t.x2),x2:Math.max(t.x1,t.x2),y1:Math.min(t.y1,t.y2),y2:Math.max(t.y1,t.y2)}}function GL(t,e,i,s){if(typeof t=="number")return{x1:t,y1:e,x2:i,y2:s};if("width"in t)return fd({x1:t.x,y1:t.y,x2:t.x+t.width,y2:t.y+t.height});throw new Error(`Values can not be converted into a vector4: [${JSON.stringify(t)}] [${e}] [${i}] [${s}]`)}function VL(){return{x1:0,y1:0,x2:0,y2:0}}function mc(t,e,i,s,n){return e+(s-e)*((n-t)/(i-t))}function tb(t,e,i,s,n){return t+(n-e)*((i-t)/(s-e))}function eb(t,e,i){return[tb(t,i.min,e,i.max,0),tb(t,i.min,e,i.max,1)]}function UL(t,e,i){const[s,n]=eb(t.x1,t.x2,e),[r,o]=eb(t.y1,t.y2,i);return{x1:s,x2:n,y1:r,y2:o}}function ib(t,e,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,gd.clamp)(t,i+l,e)}function YL(t,e,i){const{x:s={min:0,max:1},y:n={min:0,max:1}}=e,r=ua.from(i),o=ua.from(t),a=UL(o,s,n),l=ib(a.x1,a.x2,o.x1,o.x2,r.x1,r.x2),c=ib(a.y1,a.y2,o.y1,o.y2,r.y1,r.y2),h={x:{min:mc(o.x1,s.min,o.x2,s.max,l),max:mc(o.x1,s.min,o.x2,s.max,l+t.width)},y:{min:mc(o.y1,n.min,o.y2,n.max,c),max:mc(o.y1,n.min,o.y2,n.max,c+t.height)}},u=h.x.max-h.x.min,d=h.y.max-h.y.min;return h.x.min=(0,gd.clamp)(0,h.x.min,1-u),h.x.max=h.x.min+u,h.y.min=(0,gd.clamp)(0,h.y.min,1-d),h.y.max=h.y.min+d,h}var WL=["rangeX","rangeY","ratioX","ratioY","autoScaledAxes"],$L=class{constructor(){this.enabled=!1,this.padding=0,this.manuallyAdjusted=!1}},sb=t=>(0,ft.attachDescription)((e,{options:i})=>!Ct.is(t?.scale)&&!_s.is(t?.scale)||e==null||i.end==null?!0:e<=i.end,"to be less than end"),nb=class extends gn{constructor(t,e){super(),this.fireChartEvent=t,this.mementoOriginatorKey="zoom",this.axisZoomManagers=new Map,this.state=new Gr(void 0,"initial"),this.axes=[],this.didLayoutAxes=!1,this.autoScaleYAxis=new $L,this.lastRestoredState=void 0,this.independentAxes=!1,this.navigatorModule=!1,this.zoomModule=!1,this.pendingMemento=void 0,this.destroyFns.push(e.addListener("layout:complete",()=>{const{pendingMemento:i}=this,s=!this.didLayoutAxes;this.didLayoutAxes=!0,i?this.restoreMemento(i.version,i.mementoVersion,i.memento):s&&this.autoScaleYZoom("zoom-manager")}))}createMemento(){return this.getMementoRanges()}guardMemento(t,e){if(t==null)return!0;if(!(0,ft.isObject)(t))return!1;for(const o of Object.keys(t))if(!WL.includes(o))return!1;const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n={rangeX:{start:(0,ft.and)((0,ft.or)(ft.number,ft.date),sb(i)),end:(0,ft.or)(ft.number,ft.date)},rangeY:{start:(0,ft.and)((0,ft.or)(ft.number,ft.date),sb(s)),end:(0,ft.or)(ft.number,ft.date)},ratioX:{start:(0,ft.and)(ft.ratio,(0,ft.lessThan)("end")),end:ft.ratio},ratioY:{start:(0,ft.and)(ft.ratio,(0,ft.lessThan)("end")),end:ft.ratio},autoScaledAxes:(0,ft.arrayOf)((0,ft.union)("y"))},r=(0,ft.validate)(t,n);return r.errors.length>0?(e.push(...r.errors.map(o=>o.message)),!1):!0}restoreMemento(t,e,i){const{independentAxes:s}=this;if(!this.axes||!this.didLayoutAxes){this.pendingMemento={version:t,mementoVersion:e,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");i?.rangeY?(n.y=this.rangeToRatio(i.rangeY,"y")??{min:0,max:1},a??(a=!1)):i?.ratioY?(n.y={min:i.ratioY.start??0,max:i.ratioY.end??1},a??(a=!1)):(n.y={min:0,max:1},a??(a=!0)),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(t){this.axes=t;const e=new Map(t.map(i=>[i.id,this.axisZoomManagers.get(i.id)]));this.axisZoomManagers.clear();for(const i of t)this.axisZoomManagers.set(i.id,e.get(i.id)??new HL(i));this.state.size>0&&t.length>0&&this.updateZoom(this.state.stateId(),this.state.stateValue())}setIndependentAxes(t=!0){this.independentAxes=t}setAutoScaleYAxis(t,e){this.autoScaleYAxis.enabled=t,this.autoScaleYAxis.padding=e}setNavigatorEnabled(t=!0){this.navigatorModule=t}setZoomModuleEnabled(t=!0){this.zoomModule=t}isNavigatorEnabled(){return this.navigatorModule}isZoomEnabled(){return this.zoomModule}updateZoom(t,e){if(e?.x&&(e.x.min<0||e.x.max>1)&&(ft.Logger.warnOnce(`Attempted to update x-axis zoom to an invalid ratio of [{ min: ${e.x.min}, max: ${e.x.max} }], expecting a ratio of 0 to 1, ignoring.`),e.x=void 0),e?.y&&(e.y.min<0||e.y.max>1)&&(ft.Logger.warnOnce(`Attempted to update y-axis zoom to an invalid ratio of [{ min: ${e.y.min}, max: ${e.y.max} }], expecting a ratio of 0 to 1, ignoring.`),e.y=void 0),this.axisZoomManagers.size===0){const s=this.state.stateId();(s==="initial"||s===t)&&this.state.set(t,e);return}this.state.set(t,e);const i=e?.autoScaleYAxis;i!=null&&(this.autoScaleYAxis.manuallyAdjusted=!i),this.axisZoomManagers.forEach(s=>{s.updateZoom(t,e?.[s.getDirection()])}),this.applyChanges(t)}updateAxisZoom(t,e,i){this.axisZoomManagers.get(e)?.updateZoom(t,i),this.applyChanges(t)}resetZoom(t){this.autoScaleYAxis.manuallyAdjusted=!1;const e=this.getRestoredZoom();this.updateZoom(t,{x:{min:e?.x?.min??0,max:e?.x?.max??1},y:{min:e?.y?.min??0,max:e?.y?.max??1},autoScaleYAxis:e?.autoScaleYAxis??!0})}resetAxisZoom(t,e){const s=this.axisZoomManagers.get(e)?.getDirection();if(s==null)return;const n=this.getRestoredZoom();if(s==="y"){const r=n?.autoScaleYAxis??!0;this.autoScaleYAxis.manuallyAdjusted=!r}this.updateAxisZoom(t,e,n?.[s]??{min:0,max:1})}setAxisManuallyAdjusted(t,e){this.axisZoomManagers.get(e)?.getDirection()==="y"&&(this.autoScaleYAxis.manuallyAdjusted=!0)}updatePrimaryAxisZoom(t,e,i){const s=this.getPrimaryAxis(e);s&&this.updateAxisZoom(t,s.id,i)}panToBBox(t,e,i){if(!this.isZoomEnabled()&&!this.isNavigatorEnabled())return!1;const s=this.getZoom();if(s===void 0||!s.x&&!s.y)return!1;if(!(e.width>0&&e.height>0&&Math.abs(i.width)<=Math.abs(e.width)&&Math.abs(i.height)<=Math.abs(e.height)))return ft.Logger.warnOnce("cannot pan to target BBox - chart too small?"),!1;const r=YL(e,s,i);return this.independentAxes?(this.updatePrimaryAxisZoom(t,"x",r.x),this.updatePrimaryAxisZoom(t,"y",r.y)):this.updateZoom(t,r),!0}fireZoomPanStartEvent(t){this.listeners.dispatch("zoom-pan-start",{type:"zoom-pan-start",callerId:t})}extendToEnd(t,e,i){return this.extendWith(t,e,s=>Number(s)-i)}extendWith(t,e,i){const s=this.getPrimaryAxis(e);if(!s)return;const n=this.getDomainExtents(s);if(!n)return;const[,r]=n,o=i(r),a=this.rangeToRatio({start:o,end:r},e);a&&this.updateZoom(t,{[e]:a})}updateWith(t,e,i){const s=this.getPrimaryAxis(e);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},e);a&&this.updateZoom(t,{[e]:a})}getZoom(){let t,e;if(this.axisZoomManagers.forEach(i=>{i.getDirection()==="x"?t??(t=i.getZoom()):i.getDirection()==="y"&&(e??(e=i.getZoom()))}),t||e)return{x:t,y:e}}getAxisZoom(t){return this.axisZoomManagers.get(t)?.getZoom()??{min:0,max:1}}getAxisZooms(){const t={};for(const[e,i]of this.axisZoomManagers.entries())t[e]={direction:i.getDirection(),zoom:i.getZoom()};return t}getRestoredZoom(){return this.lastRestoredState}getPrimaryAxisId(t){return this.getPrimaryAxis(t)?.id}isVisibleItemsCountAtLeast(t,e){const i=this.getPrimaryAxis("x"),s=this.getPrimaryAxis("y"),n=new Set;let r=0;const o=[t.x.min,t.x.max],a=[t.y.min,t.y.max];for(const l of i?.boundSeries??[]){n.add(l.id);const c=e-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=e)return!0}for(const l of s?.boundSeries??[]){if(n.has(l.id))continue;const c=e-(r??0),h=l.getVisibleItems(o,a,c);if(r+=h,r>=e)return!0}return n.size===0}getMementoRanges(){const t=this.getDefinedZoom();let e;return this.autoScaleYAxis.enabled&&(e=this.autoScaleYAxis.manuallyAdjusted?[]:["y"]),{rangeX:this.getRangeDirection(t.x,"x"),rangeY:this.getRangeDirection(t.y,"y"),ratioX:{start:t.x.min,end:t.x.max},ratioY:{start:t.y.min,end:t.y.max},autoScaledAxes:e}}autoScaleYZoom(t,e=!0){if(!this.isZoomEnabled())return;const{independentAxes:i,autoScaleYAxis:s}=this,n=this.getZoom();if(n?.x==null||!s.enabled||s.manuallyAdjusted)return;const{padding:r}=s;let o;if(n.x?.min===0&&n.x?.max===1?o={min:0,max:1}:i?o=this.primaryAxisZoom("y",n.x,{padding:r}):o=this.combinedAxisZoom("y",n.x,{padding:r}),o!=null){if(i){const a=this.getPrimaryAxis("y");(a==null?void 0:this.axisZoomManagers.get(a.id))?.updateZoom("zoom-manager",o)}else for(const a of this.axisZoomManagers.values())a.getDirection()==="y"&&a.updateZoom("zoom-manager",o);e&&this.applyChanges(t)}}applyChanges(t){if(this.autoScaleYZoom(t,!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.listeners.dispatch("zoom-change",{type:"zoom-change",...this.getZoom(),axes:i,callerId:t}),this.fireChartEvent({type:"zoom",...this.getMementoRanges()})}getRangeDirection(t,e){const i=this.getPrimaryAxis(e);if(!i||!Ct.is(i.scale)&&!_s.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)*t.max)):(o=i.scale.invert(n-(n-r)*t.min),a=i.scale.invert(0)),{start:o,end:a}}rangeToRatio(t,e){const i=this.getPrimaryAxis(e);if(!i)return;const s=this.getDomainPixelExtents(i);if(!s)return;const[n,r]=s;let o=t.start==null?n:i.scale.convert?.(t.start),a=t.end==null?r:i.scale.convert?.(t.end);if(!(0,ft.isFiniteNumber)(o)||!(0,ft.isFiniteNumber)(a))return;const[l,c]=[Math.min(n,r),Math.max(n,r)];if(o<l||o>c){ft.Logger.warnOnce(`Invalid range start [${t.start}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(r)}], ignoring.`);return}if(a<l||a>c){ft.Logger.warnOnce(`Invalid range end [${t.end}], expecting a value between [${i.scale.invert?.(n)}] and [${i.scale.invert?.(r)}], ignoring.`);return}o=Math.min(c,Math.max(l,o)),a=Math.min(c,Math.max(l,a));const h=r-n,u=Math.abs((o-n)/h),d=Math.abs((a-n)/h);return{min:u,max:d}}getPrimaryAxis(t){return this.axes?.find(e=>e.direction===t)}getDomainExtents(t){const{domain:e}=t.scale,i=e.at(0),s=e.at(-1);if(!(i==null||s==null))return[i,s]}getDomainPixelExtents(t){const{domain:e}=t.scale,i=t.scale.convert?.(e.at(0)),s=t.scale.convert?.(e.at(-1));if(!(!(0,ft.isFiniteNumber)(i)||!(0,ft.isFiniteNumber)(s)))return[i,s]}getDefinedZoom(){const t=this.getZoom();return{x:{min:t?.x?.min??0,max:t?.x?.max??1},y:{min:t?.y?.min??0,max:t?.y?.max??1}}}zoomBounds(t,e,i,s){const n=t.scale,r=n.range;n.range=[0,1];const o=e.scale,a=o.range;o.range=[0,1];let l=1,c=!1,h=0,u=!1;for(const f of e.boundSeries){const{connectsToYAxis:y}=f,x=f.getRange("y",[i.min,i.max]);for(const m of x){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,ft.isFiniteNumber)(e.min)&&(l=0),(0,ft.isFiniteNumber)(e.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 f=(h+l)/2;l=f-p/2,h=f+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(t,e,{padding:i=0}={}){const s=t==="x"?"y":"x",n=this.getPrimaryAxis(s),r=this.getPrimaryAxis(t);if(!(n==null||r==null))return this.zoomBounds(n,r,e,i)}combinedAxisZoom(t,e,{padding:i=0}={}){const s=t==="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===t)for(const c of l.boundSeries){const h=n.get(c);if(h==null)continue;const u=this.zoomBounds(h,l,e,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}}},HL=class{constructor(t){this.axis=t;const[e=0,i=1]=t.visibleRange;this.state=new Gr({min:e,max:i}),this.currentZoom=this.state.stateValue()}getDirection(){return this.axis.direction}updateZoom(t,e){this.state.set(t,e)}getZoom(){return Ft(this.state.stateValue())}hasChanges(){const t=this.currentZoom,e=this.state.stateValue();return t.min!==e.min||t.max!==e.max}applyChanges(){const t=this.hasChanges();return this.currentZoom=this.state.stateValue(),t}};function KL(t,e,i,s,n,r){if(t.size===0)return!1;let o=t.x,a=t.y;e!=null&&(o-=(e.x-.5)*t.size,a-=(e.y-.5)*t.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)<=t.size*.5}function rb(t,e,i,s,n){const r=t.x+t.width>e&&t.x<e+s,o=t.y+t.height>i&&t.y<i+n;return r&&o}function ZL(t,e,i,s,n){return e+s<t.x+t.width&&e>t.x&&i>t.y&&i+n<t.y+t.height}function XL(t){return t!=null&&typeof t.point=="object"&&typeof t.label=="object"}var qL={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 QL(t,e,i=5){const s=new Map,n=[],r=new Map([...t.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:f,anchor:y}=d,{text:x,width:m,height:v}=f,S=p.size*.5;let M=0,D=0;if(S>0&&d.placement!=null){const z=qL[d.placement];M=(m*.5+S+i)*z.x,D=(v*.5+S+i)*z.y}const C=p.x-m*.5+M-((y?.x??.5)-.5)*p.size,L=p.y-v*.5+D-((y?.y??.5)-.5)*p.size;if(!(!e||ZL(e,C,L,m,v))||o.some(z=>KL(z.point,z.anchor,C,L,m,v))||n.some(z=>rb(z,C,L,m,v)))continue;const R={index:h,text:x,x:C,y:L,width:m,height:v,datum:d};c.push(R),n.push(R)}s.set(a,c)}}return s}function JL(t,e=0){const i=[];for(let s=0;s<t.length;s++){const n=t[s],{point:{x:r,y:o},label:{text:a}}=n;let{width:l,height:c}=n.label;if(l+=e,c+=e,i.some(h=>rb(h,r,o,l,c)))return!0;i.push({index:s,text:a,x:r,y:o,width:l,height:c,datum:n})}return!1}var tC=class{constructor(){this.labelData=new Map}updateLabels(t,e,i=B.zero){const s={x:-e.left,y:-e.top,width:i.width+e.left+e.right,height:i.height+e.top+e.bottom},n=new Set(t.map(o=>o.id));for(const o of this.labelData.keys())n.has(o)||this.labelData.delete(o);for(const o of t){const a=o.getLabelData();a.every(XL)&&this.labelData.set(o.id,a)}const r=QL(this.labelData,s,5);for(const o of t)o.updatePlacedLabelData?.(r.get(o.id)??[])}},ob=(w(),k(T)),eC=class extends gn{constructor(){super(...arguments),this.mementoOriginatorKey="legend",this.legendDataMap=new Map}createMemento(){return this.getData().filter(({hideInLegend:t,isFixed:e})=>!t&&!e).map(({enabled:t,seriesId:e,itemId:i,legendItemName:s})=>({visible:t,seriesId:e,itemId:i,legendItemName:s}))}guardMemento(t){return t==null||(0,ob.isArray)(t)}restoreMemento(t,e,i){i?.forEach(s=>{const{seriesId:n,data:r}=this.getRestoredData(s)??{};!n||!r||this.updateData(n,r)}),this.update()}getRestoredData(t){const{seriesId:e,itemId:i,legendItemName:s,visible:n}=t;if(e){const o=(this.legendDataMap.get(e)??[]).map(a=>{const l=a.seriesId===e&&(!i||a.itemId===i);return l&&a.isFixed&&this.warnFixed(a.seriesId,a.itemId),!a.isFixed&&l?{...a,enabled:n}:a});return{seriesId:e,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(t,e){ob.Logger.warnOnce(`The legend item with seriesId [${t}] and itemId [${e}] is not configurable, this series item cannot be toggled through the legend.`)}update(t){this.listeners.dispatch("legend-change",{type:"legend-change",legendData:t??this.getData()})}updateData(t,e=[]){this.legendDataMap.set(t,e)}clearData(){this.legendDataMap.clear()}toggleItem(t,e,i,s){if(s){this.getData().forEach(a=>{const l=(this.legendDataMap.get(a.seriesId)??[]).map(c=>c.legendItemName===s?{...c,enabled:t}:c);this.updateData(a.seriesId,l)});return}const n=this.getData(e),r=n.length===1,o=n.map(a=>i==null&&r||a.itemId===i?{...a,enabled:t}:a);this.updateData(e,o)}getData(t){return t?this.legendDataMap.get(t)??[]:[...this.legendDataMap].reduce((e,[i,s])=>e.concat(s),[])}getDatum({seriesId:t,itemId:e}={}){return this.getData(t).find(i=>i.itemId===e)}getSeriesEnabled(t){const e=this.getData(t);if(e.length>0)return e.some(i=>i.enabled)}getItemEnabled({seriesId:t,itemId:e}={}){return this.getDatum({seriesId:t,itemId:e})?.enabled??!0}},iC=class{constructor(){this.groups={}}registerSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){var n;e&&((n=this.groups)[s]??(n[s]={}),this.groups[s][t]={grouping:e,visible:i})}updateSeries({internalId:t,seriesGrouping:e,visible:i,type:s}){if(!e)return;const n=this.groups[s]?.[t];n&&(n.grouping=e,n.visible=i)}deregisterSeries({internalId:t,type:e}){this.groups[e]&&delete this.groups[e][t],this.groups[e]&&Object.keys(this.groups[e]).length===0&&delete this.groups[e]}getVisiblePeerGroupIndex({type:t,seriesGrouping:e,visible:i}){if(!e)return{visibleGroupCount:i?1:0,visibleSameStackCount:i?1:0,index:0};const s=new Set,n=new Set;for(const o of Object.values(this.groups[t]??{}))o.visible&&(s.add(o.grouping.groupIndex),o.grouping.groupIndex===e.groupIndex&&n.add(o.grouping.stackIndex));const r=Array.from(s);return r.sort((o,a)=>o-a),{visibleGroupCount:r.length,visibleSameStackCount:n.size,index:r.indexOf(e.groupIndex)}}},sC=(w(),k(T)),da=(t=>(t[t.FULL=0]="FULL",t[t.UPDATE_DATA=1]="UPDATE_DATA",t[t.PROCESS_DATA=2]="PROCESS_DATA",t[t.PERFORM_LAYOUT=3]="PERFORM_LAYOUT",t[t.SERIES_UPDATE=4]="SERIES_UPDATE",t[t.PRE_SCENE_RENDER=5]="PRE_SCENE_RENDER",t[t.SCENE_RENDER=6]="SCENE_RENDER",t[t.NONE=7]="NONE",t))(da||{}),ab=class{constructor(t){this.updateCallback=t,this.events=new sC.EventEmitter}addListener(t,e){return this.events.on(t,e)}removeListener(t,e){return this.events.on(t,e)}destroy(){this.events.clear()}update(t=0,e){this.updateCallback(t,e)}dispatchUpdateComplete(){this.events.emit("update-complete",{type:"update-complete"})}dispatchPreDomUpdate(){this.events.emit("pre-dom-update",{type:"pre-dom-update"})}dispatchPreSceneRender(){this.events.emit("pre-scene-render",{type:"pre-scene-render"})}dispatchProcessData({series:t}){this.events.emit("process-data",{type:"process-data",series:t})}},nC=class{constructor(t,e){this.callbackCache=new MA,this.chartEventManager=new vy,this.highlightManager=new Sy,this.layoutManager=new Pm,this.localeManager=new lA,this.seriesStateManager=new iC,this.stateManager=new RI,this.seriesLabelLayoutManager=new tC,this.contextModules=[];const{scene:i,root:s,syncManager:n,container:r,fireEvent:o,updateCallback:a,updateMutex:l,styleContainer:c,chartType:h,domMode:u}=e;this.chartService=t,this.syncManager=n,this.domManager=new Xm(r,c,u),this.widgets=new PA(this.domManager);const d=this.domManager.addChild("canvas","scene-canvas",i?.canvas.element);this.scene=i??new rc({canvasElement:d}),this.scene.setRoot(s),this.axisManager=new IA(s),this.legendManager=new eC,this.annotationManager=new DA(t.annotationRoot,o),this.chartTypeOriginator=new EI(t),this.interactionManager=new yy,this.contextMenuRegistry=new My,this.updateService=new ab(a),this.proxyInteractionService=new sy(this.localeManager,this.domManager),this.historyManager=new OI(this.chartEventManager),this.animationManager=new xy(this.interactionManager,l),this.dataService=new ac(this.animationManager),this.tooltipManager=new uc(this.localeManager,this.domManager,t.tooltip),this.zoomManager=new nb(o,this.layoutManager);for(const p of ls.byType("context")){if(!p.chartTypes.includes(h))continue;const f=p.moduleFactory(this);this.contextModules.push(f),this[p.contextKey]=f}}destroy(){this.animationManager.destroy(),this.highlightManager.destroy(),this.axisManager.destroy(),this.callbackCache.invalidateCache(),this.chartEventManager.destroy(),this.domManager.destroy(),this.highlightManager.destroy(),this.proxyInteractionService.destroy(),this.syncManager.destroy(),this.tooltipManager.destroy(),this.zoomManager.destroy(),this.widgets.destroy(),this.contextModules.forEach(t=>t.destroy())}},lb=class extends nt{constructor(){super(...arguments),this.range="tooltip"}};g([b(At(["tooltip","node"],"a range"))],lb.prototype,"range",2);var cb=(w(),k(T));function rC(t,e){if(t.size!==e.size)return!1;for(const i of t)if(!e.has(i))return!1;return!0}function oC(t,e){if(t==null||e==null)return t===e;if(t.size!==e.size)return!1;for(const[i,s]of t){const n=e.get(i);if(n==null||!rC(s,n))return!1}return!0}function aC(t,e){if(t.length!==e.length)return!1;for(let i=0;i<t.length;i+=1){const{type:s,idsMap:n,scopes:r,data:o,...a}=t[i],{type:l,idsMap:c,scopes:h,data:u,...d}=e[i];if(s!==l||r&&h&&!(0,cb.arraysEqual)(r,h)||o&&u&&o!==u||!cs(a,d)||!oC(n,c))return!1}return!0}function lC(t,e){const{props:i,...s}=t,{props:n,...r}=e;return cs(s,r)&&aC(i,n)}function cC(t,e,i,s){return e===t.data&&(0,cb.arraysEqual)(i,t.ids)&&lC(s,t.opts)}var hb=(w(),k(T)),Re=(w(),k(T)),ub=class Vv{constructor(){this.domain=new Set}static is(e){return e instanceof Vv}extend(e){this.domain.add(e)}getDomain(){return Array.from(this.domain)}},yn=class Uv{constructor(){this.domain=[1/0,-1/0]}static is(e){return e instanceof Uv}static extendDomain(e,i=[1/0,-1/0]){for(const s of e)typeof s=="number"&&(i[0]>s&&(i[0]=s),i[1]<s&&(i[1]=s));return i}extend(e){this.domain[0]>e&&(this.domain[0]=e),this.domain[1]<e&&(this.domain[1]=e)}getDomain(){return[...this.domain]}},Qr=0,Jr=1,fs=2,hC=class{constructor(t){const e=t.reduce((r,o)=>Math.max(r,o.length),0);let s=1<<32-Math.clz32(e);e===s/2&&(s=s>>>1),this.maxLevelSize=s;const n=new Float64Array((s*2-1)*2).fill(NaN);for(const r of t)for(let o=0;o<r.length;o+=1){const a=Number(r[o]),l=s+o-1,c=(l*fs|0)+Qr,h=(l*fs|0)+Jr,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*fs|0)+Qr],p=n[(u*fs|0)+Qr];n[(c*fs|0)+Qr]=!Number.isFinite(p)||d<p?d:p;const f=n[(h*fs|0)+Jr],y=n[(u*fs|0)+Jr];n[(c*fs|0)+Jr]=!Number.isFinite(y)||f>y?f:y}}this.buffer=n}computeRangeInto(t,e,i,s,n,r,o){const a=n+r-1;if(a<e||n>=i)return o;if(n>=e&&a<i){const l=t[(s*fs|0)+Qr],c=t[(s*fs|0)+Jr];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(t,e,i,s+1|0,n,r,o),this.computeRangeInto(t,e,i,s+2|0,n+r,r,o));return o}rangeBetween(t,e){if(t>e)return[NaN,NaN];const{maxLevelSize:i,buffer:s}=this,n=[1/0,-1/0];return this.computeRangeInto(s,t,e,0,0,i,n),n}get range(){const{buffer:t}=this;return[t[Qr],t[Jr]]}},db=Symbol("domain-ranges");function uC(t){return t.map(e=>(0,Re.isObject)(e)?JSON.stringify(e):e).join("-")}function ri(t){const e=t?.map(Number);return e?.every(Number.isFinite)?e:[]}function md(t,e){return e?.get(t.id)??0}function dC(t){return"scopes"in t&&Array.isArray(t.scopes)}function yd(t,e){const i=[];for(let s=0;s<t;s+=1)i[s]=e;return i}function yc(t,e,i){const s=[];for(const n of t){const r=n.get(e)?.[i];if(r==null)return;s.push(r)}return s}function pb(t){const e=[];let i=0,s;const n=/((?:(?:^|\.)\s*\w+|\[\s*(?:'(?:[^']|(?<!\\)\\')*'|"(?:[^"]|(?<!\\)\\")*"|-?\d+)\s*\])\s*)/g;for(;s=n.exec(t);){if(s.index!==i)return;i=s.index+s[0].length;const r=s[1].trim();if(r.startsWith("."))e.push(r.slice(1).trim());else if(r.startsWith("[")){const o=r.slice(1,-1).trim();o.startsWith("'")?e.push(o.slice(1,-1).replace(/(?<!\\)\\'/g,"'")):o.startsWith('"')?e.push(o.slice(1,-1).replace(/(?<!\\)\\"/g,'"')):e.push(o)}else e.push(r)}if(i===t.length)return e}function pC(t){return e=>{let i=e;for(const s of t)i=i[s];return i}}var gb=class{constructor(t,e="standalone",i=!1){this.opts=t,this.mode=e,this.suppressFieldDotNotation=i,this.debug=vt.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,yd(l.length,!1)),h.get(u)[c]=!0};let s=!0;for(const a of t.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 t.props){const l=a.type==="key"?r:o;switch(dC(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(t,e){const i=this.scopeCache.get(t.id)?.get(e);if(!i)throw new Error(`AG Charts - didn't find property definition for [${e}, ${t.id}]`);return{index:i.index,def:i}}resolveProcessedDataIndexById(t,e){return this.resolveProcessedDataDefById(t,e).index}resolveKeysById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.keys[s];if(n==null)throw new Error(`AG Charts - didn't find keys for [${e}, ${t.id}]`);return n.get(t.id)}hasColumnById(t,e){return this.scopeCache.get(t.id)?.get(e)!=null}resolveColumnById(t,e,i){const s=this.resolveProcessedDataIndexById(t,e),n=i.columns?.[s];if(n==null)throw new Error(`AG Charts - didn't find column for [${e}, ${t.id}]`);return n}*forEachDatum(t,e,i){const s=e.columnScopes.findIndex(n=>n.has(t.id));for(const n of i.datumIndices[s]??[])yield e.columns[s][n]}*forEachGroupDatum(t,e){const i=e.columnScopes.findIndex(r=>r.has(t.id)),s={groupIndex:0,columnIndex:i},n=[];for(const r of e.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(t,e){const s={columnIndex:e.columnScopes.findIndex(n=>n.has(t.id)),datumIndexes:[void 0,void 0,void 0]};for(const n of this.forEachGroupDatum(t,e))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(t,e,i,s){return this.getDomainsByType(i??"value",s)?.[this.resolveProcessedDataIndexById(t,e)]??[]}getDomainBetweenRange(t,e,[i,s],n){const r=e.map(c=>this.resolveProcessedDataIndexById(t,c)),o=r.join(":"),a=n[db];let l=a.get(o);if(l==null){const c=r.map(h=>n.columns[h]);l=new hC(c),a.set(o,l)}return l.rangeBetween(i,s)}getDomainsByType(t,e){switch(t){case"key":return e.domain.keys;case"value":return e.domain.values;case"aggregate":return e.domain.aggValues;case"group-value-processor":return e.domain.groups;default:return null}}processData(t){const{opts:{groupByKeys:e,groupByFn:i},aggregates:s,groupProcessors:n,reducers:r,processors:o,propertyProcessors:a}=this,l=performance.now();if(e&&this.keys.length===0)return;let c=this.extractData(t);e?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(t);const h=performance.now();return c.time=h-l,this.debug.check()&&gC(c),this.processScopeCache(),c}warnDataMissingProperties(t){if(t.size!==0)for(const e of(0,Re.iterate)(this.keys,this.values))for(const[i,s]of e.missing){if(s<(t.get(i)?.length??1/0))continue;const n=i==null?"":` for ${i}`;Re.Logger.warnOnce(`the key '${e.property}' was not found in any data element${n}.`)}}processScopeCache(){this.scopeCache.clear();for(const t of(0,Re.iterate)(this.keys,this.values,this.aggregates))if(t.idsMap)for(const[e,i]of t.idsMap)for(const s of i)if(!this.scopeCache.has(e))this.scopeCache.set(e,new Map([[s,t]]));else{if(this.scopeCache.get(e)?.has(s))throw new Error("duplicate definition ids on the same scope are not allowed.");this.scopeCache.get(e).set(s,t)}}valueGroupIdxLookup({matchGroupIds:t}){const e=[];for(const[i,s]of this.values.entries())(!t||s.groupId&&t.includes(s.groupId))&&e.push(i);return e}valueIdxLookup(t,e){const i=t==null||t.length===0,s=typeof e=="string"?e:e.id,n=o=>{if(o.idsMap){for(const[a,l]of o.idsMap)if(t?.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=>t?.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(e)} in scope(s) ${JSON.stringify(t)}`);return r}extractData(t){const{dataDomain:e,processValue:i,allScopesHaveSameDefs:s}=this.initDataDomainProcessor(),{keys:n,values:r}=this,{invalidData:o,invalidKeys:a,allKeyMappings:l}=this.extractKeys(n,t,i),{columns:c,columnScopes:h,partialValidDataCount:u,maxDataLength:d}=this.extractValues(o,r,t,a,i),p=f=>{const y=e.get(f),x=y.getDomain();return yn.is(y)&&x[0]>x[1]?[]:x};return{type:"ungrouped",input:{count:d},scopes:new Set(t.keys()),dataSources:t,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,[db]:new Map}}extractKeys(t,e,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 t){const{invalidValue:h,scopes:u}=c;o=new Map,a=new Map,r.set(c,o);for(const d of u??[]){const p=e.get(d)??[];if(a.has(p)){l(p,d);continue}const f=[];o.set(d,f),a.set(p,d);let y,x;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){f.push(v.value);continue}f.push(h),y??(y=yd(p.length,!1)),x??(x=yd(p.length,!1)),y[m]=!0,x[m]=!0}y&&x&&(s.set(d,y),n.set(d,x))}}return{invalidData:n,invalidKeys:s,allKeyMappings:r}}extractValues(t,e,i,s,n){let r=0;const o=[],a=[];let l=0;for(const c of e){const{invalidValue:h}=c;if(new Set(c.scopes.map(x=>i.get(x))).size>1)throw new Error(`AG Charts - more than one data source for: ${JSON.stringify(c)}`);const d=new Set(c.scopes),p=(0,Re.first)(c.scopes),f=i.get(p),y=new Array;for(let x=0;x<f.length;x++){if(f[x]==null||typeof f[x]!="object")continue;const m=f[x],v=s.get(p)?.[x],S=n(c,m,x,c.scopes);let M=S.value;(v||!S.valid)&&this.markScopeDatumInvalid(c.scopes,f,x,t),v?M=h:S.valid||(r+=1,M=h),y[x]=M}o.push(y),a.push(d),l=Math.max(l,y.length)}return{columns:o,columnScopes:a,partialValidDataCount:r,maxDataLength:l}}groupData(t,e){var i;const s=new Map,{keys:n,columns:r,columnScopes:o,invalidKeys:a,invalidData:l}=t,c=t.scopes,h=new Set;for(const p of c){const f=r.map((M,D)=>D).filter(M=>!h.has(M)&&o[M].has(p));if(f.length===0)continue;for(const M of f)h.add(M);const y=new Set;for(const M of f)for(const D of o[M])y.add(D);const x=n.map(M=>M.get(p)).filter(M=>M!=null),m=r[(0,Re.first)(f)],v=l?.get(p),S=a?.get(p);for(let M=0;M<m.length;M++){if(S?.[M]===!0)continue;const D=x.map(N=>N[M]);if(D==null||D.length===0)throw new Error("AG Charts - no keys found for scope: "+p);const C=e?.(D)??D,L=uC(C),I=s.get(L)??{keys:C,datumIndices:[],validScopes:c};if(s.has(L)||s.set(L,I),v?.[M]===!0){I.validScopes===c&&(I.validScopes=new Set(c.values()));for(const N of y)I.validScopes.delete(N)}for(const N of f)(i=I.datumIndices)[N]??(i[N]=[]),I.datumIndices[N].push(M)}}const u=[],d=[];for(const{keys:p,datumIndices:f,validScopes:y}of s.values())u.push(p),d.push({datumIndices:f,keys:p,aggregation:[],validScopes:y});return{...t,type:"grouped",domain:{...t.domain,groups:u},groups:d}}aggregateUngroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{keys:i,columns:s,dataSources:n}=t,r=(0,Re.first)(n.keys()),o=n.get(r);t.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 f=d.map(v=>s[v][l]),y=yc(i,r,l),x=y!=null?u.aggregateFunction(f,y):void 0;x&&(p=u.groupAggregateFunction?.(x,p)??yn.extendDomain(x,p));const m=u.finalFunction?.(p)??p;c[h]=m,yn.extendDomain(m,e[h])}return c})}aggregateGroupedData(t){const e=this.aggregates.map(()=>[1/0,-1/0]);t.domain.aggValues=e;const{columns:i}=t;for(const[s,n]of this.aggregates.entries()){const r=this.valueGroupIdxLookup(n);for(const o of t.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(f=>i[f][o.datumIndices[f]?.[u]]),p=n.aggregateFunction(d,a);p&&(l=n.groupAggregateFunction?.(p,l)??yn.extendDomain(p,l))}const h=n.finalFunction?.(l)??l;o.aggregation[s]=h,yn.extendDomain(h,e[s])}}}postProcessGroups(t){const{groupProcessors:e}=this,{columnScopes:i,columns:s,invalidData:n}=t;for(const r of e){const o=this.valueGroupIdxLookup(r),a=r.adjust()();for(const l of t.groups)a(s,o,l);for(const l of o){const h=this.values[l].valueType==="category",u=s[l],d=(0,Re.first)(i[l]),p=n?.get(d),f=h?new ub:new yn;for(let y=0;y<u.length;y+=1)p?.[y]!==!0&&f.extend(u[y]);t.domain.values[l]=f.getDomain()}}}postProcessProperties(t){for(const{adjust:e,property:i,scopes:s}of this.propertyProcessors)for(const n of this.valueIdxLookup(s,i))e()(t,n)}reduceData(t){t.reduced??(t.reduced={});const{dataSources:e,keys:i}=t;for(const s of this.reducers){const n=s.reducer();let r=s.initialValue;if(t.type==="grouped")for(const o of t.groups)r=n(r,o.keys);else{const o=(0,Re.first)(e.keys()),a=i.map(h=>h.get(o)).filter(h=>h!=null),l=a.map(()=>{}),c=e.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)}}t.reduced[s.property]=r}}postProcessData(t){t.reduced??(t.reduced={});for(const e of this.processors)t.reduced[e.property]=e.calculate(t,t.reduced[e.property])}initDataDomainProcessor(){const{keys:t,values:e}=this,i=new Set;for(const h of e)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,Re.iterate)(t,e))h.valueType==="category"?s.set(h,new ub):(s.set(h,new yn),r&&(r=(h.scopes??[]).length===i.size))};o();const a=this.buildAccessors((0,Re.iterate)(t,e)),l={value:void 0,missing:!1,valid:!1};return{dataDomain:s,processValue:(h,u,d,p)=>{let f,y;if(a.has(h.property)){try{y=a.get(h.property)(u)}catch{}f=y!=null}else f=h.property in u,y=f?u[h.property]:h.missingValue;h.forceValue!=null&&(y=f&&(0,Re.isNegative)(y)?-1*h.forceValue:h.forceValue,f=!0),l.missing=!f;const x="missingValue"in h;if(!f&&!x)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(),f&&h.validation?.(y,u,d)===!1)if(l.valid=!1,"invalidValue"in h)y=h.invalidValue;else return this.mode!=="integrated"&&Re.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(t){const e=new Map;if(this.suppressFieldDotNotation)return e;for(const i of t){if(!(i.property.includes(".")||i.property.includes("[")))continue;const n=pb(i.property);if(n==null){Re.Logger.warnOnce("Invalid property path [%s]",i.property);continue}const r=pC(n);e.set(i.property,r)}return e}};function gC(t){const e=(i,s)=>{s.length>0&&(Re.Logger.log(`DataModel.processData() - ${i}`),Re.Logger.table(s))};Re.Logger.log("DataModel.processData() - processedData",t),e("Key Domains",t.domain.keys),e("Group Domains",t.domain.groups??[]),e("Value Domains",t.domain.values),e("Aggregate Domains",t.domain.aggValues??[])}var fb=class tn{constructor(e,i){this.mode=e,this.suppressFieldDotNotation=i,this.debug=vt.create(!0,"data-model"),this.requested=[],this.status="setup"}async request(e,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:e,opts:s,data:i,resolve:n,reject:r})})}execute(e){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,hb.getWindow)().processedData=[]);const n=[];for(const{data:r,ids:o,opts:a,resolves:l,rejects:c}of s){const h=e?.find(p=>cC(p,r,o,a));let u,d;if(h==null)try{u=new gb(a,this.mode,this.suppressFieldDotNotation);const p=new Map(i.map(f=>[f.id,f.data]));d=u.processData(p)}catch(p){c.forEach(f=>f(p));continue}else({dataModel:u,processedData:d}=h);n.push({opts:a,data:r,ids:o,dataModel:u,processedData:d}),this.debug.check()&&(0,hb.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(e){const i=[];for(const[s,n]of e.entries())s>0&&n.data.length!==e[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(e){const i=[];for(const s of e){const n=i.find(tn.groupMatch(s));n?n.push(s):i.push([s])}return i.map(tn.mergeRequests)}splitResult(e,i,s,n){for(let r=0;r<s.length;r++){const o=n[r];o({dataModel:e,processedData:i})}}static groupMatch({data:e,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===e)&&(c.opts.groupByKeys??!1)===r&&c.opts.groupByFn===o&&s(c.opts.props)===l}static mergeRequests(e){const i=new Set(["key","group-value-processor"]);return e.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};tn.createIdsMap(n,u);const d=s.opts.props.find(p=>p.type===u.type&&(i.has(p.type)||p.data===u.data)&&tn.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&&tn.mergeIdsMap(u.idsMap,d.idsMap)}return s},{ids:[],rejects:[],resolves:[],data:null,opts:null})}static mergeIdsMap(e,i){for(const[s,n]of e){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(e,i){i.id!=null&&(i.idsMap??(i.idsMap=new Map),i.idsMap.has(e)?i.idsMap.get(e).add(i.id):i.idsMap.set(e,new Set([i.id])))}static deepEqual(e,i){if(e===i)return!0;if(e&&i&&typeof e=="object"&&typeof i=="object"){if(e.constructor!==i.constructor)return!1;let s,n;if(Array.isArray(e)){if(n=e.length,n!==i.length)return!1;for(s=n-1;s>=0;s--)if(!tn.deepEqual(e[s],i[s]))return!1;return!0}const r=Object.keys(e);if(n=r.length,n!==Object.keys(i).length)return!1;for(s=n-1;s>=0;s--){const o=r[s];if(!tn.skipKeys.has(o)&&(!Object.hasOwn(i,o)||!tn.deepEqual(e[o],i[o])))return!1}return!0}return!1}};fb.skipKeys=new Set(["id","idsMap","type","scopes","data"]);var mb=fb,fC=class{constructor(){this.axesMap=new Map,this.themeTemplates=new Map}register(t,e){this.axesMap.set(t,e.moduleFactory),e.themeTemplate&&this.setThemeTemplate(t,e.themeTemplate)}create(t,e){const i=this.axesMap.get(t);if(i)return i(e);throw new Error(`AG Charts - unknown axis type: ${t}`)}has(t){return this.axesMap.has(t)}keys(){return this.axesMap.keys()}setThemeTemplate(t,e){return this.themeTemplates.set(t,e),this}getThemeTemplate(t){return this.themeTemplates.get(t)}},Hn=new fC,pa=[{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:"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 Kn(t){return pa.find(e=>e.type==="series"&&e.identifier===t)?.chartTypes}function mC(t){return Kn(t)?.find(i=>i==="cartesian")==="cartesian"}function yC(t){return Kn(t)?.find(i=>i==="polar")==="polar"}function bC(t){return Kn(t)?.find(i=>i==="hierarchy")==="hierarchy"}function xC(t){return Kn(t)?.find(i=>i==="topology")==="topology"}function vC(t){return Kn(t)?.find(i=>i==="flow-proportion")==="flow-proportion"}function MC(t){return Kn(t)?.find(i=>i==="standalone")==="standalone"}function SC(t){return Kn(t)?.find(i=>i==="gauge")==="gauge"}function DC(t){return t.packageType==="enterprise"}function IC(t){if(!DC(t))throw new Error("AG Charts - internal configuration error, only enterprise modules need verification.");const e=pa.find(i=>i.type===t.type&&("optionsKey"in i&&"optionsKey"in t?i.optionsKey===t.optionsKey:!0)&&("contextKey"in i&&"contextKey"in t?i.contextKey===t.contextKey:!0)&&i.identifier===t.identifier&&t.chartTypes.every(s=>i.chartTypes.includes(s)));return e&&(e.useCount??(e.useCount=0),e.useCount++),e!=null}function AC(){return pa.filter(({useCount:t})=>t==null||t===0)}var LC=class{constructor(){this.legendMap=new Map,this.themeTemplates=new Map}register(t,{optionsKey:e,moduleFactory:i,themeTemplate:s}){this.legendMap.set(t,{optionsKey:e,moduleFactory:i}),this.themeTemplates.set(e,s)}create(t,e){const i=this.legendMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown legend type: ${t}`)}getThemeTemplates(){return Object.fromEntries(this.themeTemplates)}getKeys(){return Array.from(this.legendMap.entries()).reduce((t,[e,i])=>(t[e]=i.optionsKey,t),{})}},bd=new LC,yb=class extends Map{get(t){return super.get(t)??"unknown"}isCartesian(t){return this.get(t)==="cartesian"}isPolar(t){return this.get(t)==="polar"}isHierarchy(t){return this.get(t)==="hierarchy"}isTopology(t){return this.get(t)==="topology"}isFlowProportion(t){return this.get(t)==="flow-proportion"}isStandalone(t){return this.get(t)==="standalone"}isGauge(t){return this.get(t)==="gauge"}get seriesTypes(){return Array.from(this.keys())}get cartesianTypes(){return this.seriesTypes.filter(t=>this.isCartesian(t))}get polarTypes(){return this.seriesTypes.filter(t=>this.isPolar(t))}get hierarchyTypes(){return this.seriesTypes.filter(t=>this.isHierarchy(t))}get topologyTypes(){return this.seriesTypes.filter(t=>this.isTopology(t))}get flowProportionTypes(){return this.seriesTypes.filter(t=>this.isFlowProportion(t))}get standaloneTypes(){return this.seriesTypes.filter(t=>this.isStandalone(t))}get gaugeTypes(){return this.seriesTypes.filter(t=>this.isGauge(t))}},CC=class extends Map{set(t,e){return super.set(t,gt(e,this.get(t)))}},Yt=new yb,NC=new yb,xd=new CC,TC=class{constructor(){this.seriesMap=new Map,this.themeTemplates=new Map}register(t,{chartTypes:[e],moduleFactory:i,tooltipDefaults:s,defaultAxes:n,themeTemplate:r,solo:o,stackable:a,groupable:l,stackedByDefault:c,hidden:h}){this.setThemeTemplate(t,r),this.seriesMap.set(t,{moduleFactory:i,tooltipDefaults:s,defaultAxes:n,solo:o,stackable:a,groupable:l,stackedByDefault:c}),Yt.set(t,e),h||NC.set(t,e)}create(t,e){const i=this.seriesMap.get(t)?.moduleFactory;if(i)return i(e);throw new Error(`AG Charts - unknown series type: ${t}`)}cloneDefaultAxes(t){const e=this.seriesMap.get(t)?.defaultAxes;return e==null?null:{axes:Ft(e)}}setThemeTemplate(t,e){const i=this.themeTemplates.get(t);this.themeTemplates.set(t,gt(e,i))}getThemeTemplate(t){return this.themeTemplates.get(t)}getTooltipDefauls(t){return this.seriesMap.get(t)?.tooltipDefaults}isSolo(t){return this.seriesMap.get(t)?.solo??!1}isGroupable(t){return this.seriesMap.get(t)?.groupable??!1}isStackable(t){return this.seriesMap.get(t)?.stackable??!1}isStackedByDefault(t){return this.seriesMap.get(t)?.stackedByDefault??!1}},Ei=new TC,vd=class vr extends gn{constructor(e){super(),this.chart=e}subscribe(e=vr.DEFAULT_GROUP){let i=this.get(e);return i||(i=new Set,vr.chartsGroups.set(e,i)),i.add(this.chart),this}unsubscribe(e=vr.DEFAULT_GROUP){return this.get(e)?.delete(this.chart),this}getChart(){return this.chart}getGroup(e=vr.DEFAULT_GROUP){const i=this.get(e);return i?Array.from(i):[]}getGroupSiblings(e=vr.DEFAULT_GROUP){return this.getGroup(e).filter(i=>i!==this.chart)}get(e){return vr.chartsGroups.get(e)}};vd.chartsGroups=new Map,vd.DEFAULT_GROUP=Symbol("sync-group-default");var kC=vd,Md=class extends nt{constructor(){super(...arguments),this.enabled=!1}};g([b(H)],Md.prototype,"enabled",2),g([b(ct)],Md.prototype,"tabIndex",2);var bb=(w(),k(T)),xb={};Ci(xb,{NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ki,fromToMotion:()=>Xt,staticFromToMotion:()=>js});var Ki={added:"add",updated:"update",removed:"remove",unknown:"initial","no-op":"none"};function Xt(t,e,i,s,n,r,o){const{fromFn:a,toFn:l,applyFn:c=(f,y)=>f.setProperties(y)}=n,{nodes:h,selections:u}=hc(s),d=(f,y)=>{let x,m=0,v=0;for(const S of y){const M=f[m]===S,D={last:v>=y.length-1,lastLive:m>=f.length-1,prev:y[v-1],prevFromProps:x,prevLive:f[m-1],next:y[v+1],nextLive:f[m+(M?1:0)]},C=`${t}_${e}_${S.id}`;i.stopByAnimationId(C);let L="unknown";M?r&&o&&(L=wC(S,S.datum,r,o)):L="removed",S.transitionOut=L==="removed";const{phase:I,start:N,finish:E,delay:R,duration:z,...W}=a(S,S.datum,L,D),{phase:yt,start:$,finish:q,delay:tt,duration:ht,...lt}=l(S,S.datum,L,D),V=E==null;i.animate({id:C,groupId:t,phase:I??yt??"update",duration:z??ht,delay:R??tt,from:W,to:lt,ease:ea,collapsable:V,onPlay:()=>{const Y={...N,...$,...W};c(S,Y,"start")},onUpdate(Y){c(S,Y,"update")},onStop:()=>{const Y={...N,...$,...W,...lt,...E,...q};c(S,Y,"end")}}),M&&m++,v++,x=W}};let p=0;for(const f of u){const y=f.nodes(),x=y.filter(m=>!f.isGarbage(m));d(x,y),i.animate({id:`${t}_${e}_selection_${p}`,groupId:t,phase:"end",from:0,to:1,ease:ea,onStop(){f.cleanup()}}),p++}d(h,h)}function js(t,e,i,s,n,r,o){const{nodes:a,selections:l}=hc(s),{start:c,finish:h,phase:u}=o;i.animate({id:`${t}_${e}`,groupId:t,phase:u??"update",from:n,to:r,ease:ea,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 f of p.nodes())f.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 wC(t,e,i,s){const n=i(t,e);return s.added.has(n)?"added":s.removed.has(n)?"removed":"updated"}var vb={};Ci(vb,{resetMotion:()=>Ie});function Ie(t,e){const{nodes:i,selections:s}=hc(t);for(const n of s){for(const r of n.nodes()){const o=e(r,r.datum);r.setProperties(o)}n.cleanup()}for(const n of i){const r=e(n,n.datum);n.setProperties(r)}}var Sd="color: green",Dd="color: grey";function EC(){return Uf(()=>{})}function Id(t,e){const i=rn(e);if(i.length===0)return;const s=Yf(t);for(const n of i)n in s&&(e[n]=s[n])}var Mb=class{transitionRoot(t,e){this.parent?this.parent.transitionRoot(t,e):this.transition(t,e)}},Ad=class ui extends Mb{constructor(e,i,s){super(),this.defaultState=e,this.states=i,this.enterEach=s,this.debug=vt.create(!0,"animation"),this.state=e,this.debug(`%c${this.constructor.name} | init -> ${e}`,Sd)}transition(e,i){if(!this.transitionChild(e,i)||this.state===ui.child||this.state===ui.parent)return;const n=this.state,r=this.states[this.state];let o=r[e];const a=`%c${this.constructor.name} | ${this.state} -> ${e} ->`;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,Dd),u});else if(typeof o=="object"&&!(o instanceof ui)&&o.guard&&!o.guard(i)){this.debug(`${a} (guarded)`,o.target,Dd);return}if(!o){this.debug(`${a} ${this.state}`,Dd);return}const l=this.getDestinationState(o),c=l===this.state?void 0:r.onExit;this.debug(`${a} ${l}`,Sd),this.state=l,typeof o=="function"?o(i):typeof o=="object"&&!(o instanceof ui)&&o.action?.(i),c?.(),this.enterEach?.(n,l),l!==n&&l!==ui.child&&l!==ui.parent&&this.states[l].onEnter?.(n,i)}transitionAsync(e,i){setTimeout(()=>{this.transition(e,i)},0)}is(e){return this.state===ui.child&&this.childState?this.childState.is(e):this.state===e}resetHierarchy(){this.debug(`%c${this.constructor.name} | ${this.state} -> [resetHierarchy] -> ${this.defaultState}`,"color: green"),this.state=this.defaultState}transitionChild(e,i){return this.state!==ui.child||!this.childState||(Id(this,this.childState),this.childState.transition(e,i),!this.childState.is(ui.parent))?!0:(this.debug(`%c${this.constructor.name} | ${this.state} -> ${e} -> ${this.defaultState}`,Sd),this.state=this.defaultState,this.states[this.state].onEnter?.(),this.childState.resetHierarchy(),!1)}getDestinationState(e){let i=this.state;return typeof e=="string"?i=e:e instanceof ui?(this.childState=e,this.childState.parent=this,i=ui.child):typeof e=="object"&&(e.target instanceof ui?(this.childState=e.target,this.childState.parent=this,i=ui.child):e.target!=null&&(i=e.target)),i}};Ad.child="__child",Ad.parent="__parent";var ga=Ad,OC=class extends Mb{constructor(...t){super(),this.stateMachines=t;for(const e of t)e.parent=this}transition(t,e){for(const i of this.stateMachines)Id(this,i),i.transition(t,e)}transitionAsync(t,e){for(const i of this.stateMachines)Id(this,i),i.transitionAsync(t,e)}},Sb=(w(),k(T)),Ld=(w(),k(T)),Cd=class{constructor(){this.moduleMap=new Map}*modules(){for(const t of this.moduleMap.values())yield t.moduleInstance}addModule(t,e){if(this.moduleMap.has(t.optionsKey))throw new Error(`AG Charts - module already initialised: ${t.optionsKey}`);this.moduleMap.set(t.optionsKey,{module:t,moduleInstance:e(t)})}removeModule(t){const e=(0,Ld.isString)(t)?t:t.optionsKey;this.moduleMap.get(e)?.moduleInstance.destroy(),this.moduleMap.delete(e)}getModule(t){return this.moduleMap.get((0,Ld.isString)(t)?t:t.optionsKey)?.moduleInstance}isEnabled(t){return this.moduleMap.has((0,Ld.isString)(t)?t:t.optionsKey)}mapModules(t){return Array.from(this.moduleMap.values(),(e,i)=>t(e.moduleInstance,i))}destroy(){for(const t of this.moduleMap.keys())this.moduleMap.get(t)?.moduleInstance.destroy();this.moduleMap.clear()}},re=class Mr{constructor(e,i,s=!0){this.parentNode=e,this.autoCleanup=s,this.garbageBin=new Set,this._nodesMap=new Map,this._nodes=[],this.data=[],this.debug=vt.create(!0,"scene","scene:selections"),this.nodeFactory=Object.prototype.isPrototypeOf.call(As,i)?()=>new i:i}static select(e,i,s=!0){return new Mr(e,i,s)}static selectAll(e,i){const s=[],n=r=>{i(r)&&s.push(r);for(const o of r.children())n(o)};return n(e),s}static selectByClass(e,...i){return Mr.selectAll(e,s=>i.some(n=>s instanceof n))}static selectByTag(e,i){return Mr.selectAll(e,s=>s.tag===i)}createNode(e,i,s){const n=this.nodeFactory(e);return n.datum=e,i?.(n),s==null?this._nodes.push(n):this._nodes.splice(s,0,n),this.parentNode.appendChild(n),n}update(e,i,s){if(this.garbageBin.size>0&&this.debug("Selection - update() called with pending garbage",e),s){const n=new Map(e.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(e.length,this.data.length);for(let r=0;r<n;r++)r>=e.length?this.garbageBin.add(this._nodes[r]):r>=this._nodes.length?this.createNode(e[r],i):(this._nodes[r].datum=e[r],this.garbageBin.delete(this._nodes[r]))}return this.data=e.slice(),this.autoCleanup&&this.cleanup(),this}cleanup(){return this.garbageBin.size===0?this:(this._nodes=this._nodes.filter(e=>this.garbageBin.has(e)?(this._nodesMap.delete(e),this.garbageBin.delete(e),e.destroy(),!1):!0),this)}clear(){return this.update([]),this}isGarbage(e){return this.garbageBin.has(e)}each(e){for(const i of this._nodes.entries())e(i[1],i[1].datum,i[0]);return this}*[Symbol.iterator](){for(let e=0;e<this._nodes.length;e++){const i=this._nodes[e];yield{node:i,datum:i.datum,index:e}}}select(e){return Mr.selectAll(this.parentNode,e)}selectByClass(e){return Mr.selectByClass(this.parentNode,e)}selectByTag(e){return Mr.selectByTag(this.parentNode,e)}nodes(){return this._nodes}at(e){return this._nodes.at(e)}get length(){return this._nodes.length}},RC=(w(),k(T)),vi=class extends ki{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.restoreOwnStyles()}set x(t){this.x1=t,this.x2=t}set y(t){this.y1=t,this.y2=t}get midPoint(){return{x:(this.x1+this.x2)/2,y:(this.y1+this.y2)/2}}computeBBox(){return new B(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(t,e){return this.x1===this.x2||this.y1===this.y2?this.getBBox().clone().grow(this.strokeWidth/2).containsPoint(t,e):!1}distanceSquared(t,e){const{x1:i,y1:s,x2:n,y2:r}=this;return Zo(t,e,i,s,n,r,1/0)}render(t){const{ctx:e,devicePixelRatio:i}=t;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}e.beginPath(),e.moveTo(s,n),e.lineTo(r,o),this.fillStroke(e),this.fillShadow?.markClean(),super.render(t)}toSVG(){if(!this.visible)return;const t=(0,RC.createSvgElement)("line");return t.setAttribute("x1",String(this.x1)),t.setAttribute("y1",String(this.y1)),t.setAttribute("x2",String(this.x2)),t.setAttribute("y2",String(this.y2)),this.applySvgStrokeAttributes(t),{elements:[t]}}};vi.className="Line",vi.defaultStyles={...ki.defaultStyles,fill:void 0,strokeWidth:1},g([G()],vi.prototype,"x1",2),g([G()],vi.prototype,"y1",2),g([G()],vi.prototype,"x2",2),g([G()],vi.prototype,"y2",2);var Zi=class extends ki{constructor(t={}){super(t),this.x1=0,this.y1=0,this.x2=0,this.y2=0,this.startLine=!1,this.endLine=!1,this.isRange=!1,this.restoreOwnStyles()}computeBBox(){return new B(this.x1,this.y1,this.x2-this.x1,this.y2-this.y1)}isPointInPath(t,e){return!1}render(t){const{ctx:e}=t;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,opacity:a,isRange:l}=this;if(!!(l&&o)){const{fillOpacity:y}=this;this.applyFill(e),e.globalAlpha=a*y,e.beginPath(),e.moveTo(i,s),e.lineTo(n,s),e.lineTo(n,r),e.lineTo(i,r),e.closePath(),e.fill()}const{stroke:h,strokeWidth:u,startLine:d,endLine:p}=this;if(!!((d||p)&&h&&u)){const{strokeOpacity:y,lineDash:x,lineDashOffset:m,lineCap:v,lineJoin:S}=this;this.applyStroke(e),e.globalAlpha=a*y,e.lineWidth=u,x&&e.setLineDash(x),m&&(e.lineDashOffset=m),v&&(e.lineCap=v),S&&(e.lineJoin=S),e.beginPath(),d&&(e.moveTo(i,s),e.lineTo(n,s)),p&&(e.moveTo(n,r),e.lineTo(i,r)),e.stroke()}this.fillShadow?.markClean(),super.render(t)}};Zi.className="Range",Zi.defaultStyles={...ki.defaultStyles,strokeWidth:1},g([G()],Zi.prototype,"x1",2),g([G()],Zi.prototype,"y1",2),g([G()],Zi.prototype,"x2",2),g([G()],Zi.prototype,"y2",2),g([G()],Zi.prototype,"startLine",2),g([G()],Zi.prototype,"endLine",2),g([G()],Zi.prototype,"isRange",2);var ye=class extends nt{constructor(){super(...arguments),this.enabled=!0}getFont(){return Bt.toFontString(this)}};g([b(H)],ye.prototype,"enabled",2),g([b(dt,{optional:!0})],ye.prototype,"color",2),g([b(Ns,{optional:!0})],ye.prototype,"fontStyle",2),g([b(Ts,{optional:!0})],ye.prototype,"fontWeight",2),g([b(j)],ye.prototype,"fontSize",2),g([b(O)],ye.prototype,"fontFamily",2),g([b(Ze,{optional:!0})],ye.prototype,"formatter",2);function bc(t){const{parallelFlipRotation:e=0,regularFlipRotation:i=0}=t,s=t.rotation?Pt(zt(t.rotation)):0,n=!s&&e>=0&&e<=Math.PI?-1:1,r=!s&&i>=0&&i<=Math.PI?-1:1;let o=0;return t.parallel?o=n*Math.PI/2:r===-1&&(o=Math.PI),{configuredRotation:s,defaultRotation:o,parallelFlipFlag:n,regularFlipFlag:r}}function PC(t,e){return t??(e?0:10)}function _C(t,e,i,s){return t&&!e?i*s===-1?"hanging":"bottom":"middle"}function Db(t,e,i,s,n){const r=e>0&&e<=Math.PI,o=i>0&&i<=Math.PI,a=r||o?-1:1;if(t)if(e||i){if(s*a===-1)return"end"}else return"center";else if(s*n===-1)return"end";return"start"}function jC(t,e,i,s){const n=[];for(const{tickLabel:r,translationY:o}of t){if(!r)continue;const{width:a,height:l}=s.measureLines(r),c=new B(e,o,a,l),h=new B(e,o,0,0);i.transformBBox(h,c);const{x:u,y:d}=c;n.push({point:{x:u,y:d},label:{text:r,width:a,height:l}})}return n}var FC=(w(),k(T)),xc=(w(),k(T));function zC(t){return t!=null&&Object.hasOwn(t,"toString")&&(0,xc.isString)(t.toString())}function BC(t){return t!=null&&Object.hasOwn(t,"valueOf")&&(0,xc.isFiniteNumber)(t.valueOf())}function vc(t){return(0,xc.isFiniteNumber)(t)||(0,xc.isValidDate)(t)||BC(t)}function GC(t,e){return t!=null&&(!e||vc(t))}function Nd(t){return zC(t)&&Object.hasOwn(t,"id")?t.id:t}var Td=t=>t==="value"?Lt((e,i)=>i.target.type==="line",e=>e.target.type==="range"?"crossLine type 'range' to have a 'range' property instead of 'value'":"crossLine property 'type' to be 'line'"):Lt((e,i)=>i.target.type==="range",e=>e.target.type==="line"?"crossLine type 'line' to have a 'value' property instead of 'range'":"crossLine property 'type' to be 'range'");function Ib(t){switch(t.type){case"line":return t.value;case"range":return t.range}}function Ab(t,e){if(t==null)return!1;const i=Ct.is(e)||_s.is(e),s=n=>GC(n,i)&&!isNaN(e.convert(n));if((0,FC.isArray)(t)){const[n,r]=t;return s(n)&&s(r)}else return s(t)}var VC={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}},UC={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 kd({yDirection:t,padding:e=0,position:i="top",bbox:s}){const n=t?VC:UC,{xTranslationDirection:r,yTranslationDirection:o}=n[i],a=r*(e+s.width/2),l=o*(e+s.height/2);return{xTranslation:a,yTranslation:l}}function Lb({yDirection:t,bbox:e,padding:i=0,position:s="top"}){const n={};return s.startsWith("inside")||(s==="top"&&!t?n.top=i+e.height:s==="bottom"&&!t?n.bottom=i+e.height:s==="left"&&t?n.left=i+e.width:s==="right"&&t&&(n.right=i+e.width)),n}var Mc=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e/2,y:i}:{x:e,y:isNaN(s)?i:(i+s)/2},Cb=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:e,y:isNaN(n)?s:(s+n)/2}:{x:i/2,y:s},Nb=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:(i+s)/2}:{x:e/2,y:isNaN(s)?i:s},Tb=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i/2,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:(s+n)/2},YC=({xEnd:t,yStart:e,yEnd:i})=>({x:t/2,y:isNaN(i)?e:(e+i)/2}),kb=({direction:t,xStart:e,xEnd:i,yStart:s})=>t==="y"?{x:e/2,y:s}:{x:i,y:s},wb=({direction:t,xStart:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:isNaN(s)?i:s}:{x:e,y:i},Eb=({direction:t,xEnd:e,yStart:i,yEnd:s})=>t==="y"?{x:e,y:i}:{x:e,y:isNaN(s)?i:s},Ob=({direction:t,xStart:e,xEnd:i,yStart:s,yEnd:n})=>t==="y"?{x:i,y:isNaN(n)?s:n}:{x:e,y:isNaN(n)?s:n},Rb={top:{c:Mc},bottom:{c:Tb},left:{c:Cb},right:{c:Nb},"top-left":{c:kb},"top-right":{c:Eb},"bottom-left":{c:wb},"bottom-right":{c:Ob},inside:{c:YC},"inside-left":{c:Cb},"inside-right":{c:Nb},"inside-top":{c:Mc},"inside-bottom":{c:Tb},"inside-top-left":{c:kb},"inside-bottom-left":{c:wb},"inside-top-right":{c:Eb},"inside-bottom-right":{c:Ob}},WC=At(["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"],"crossLine label position"),Oi=class extends nt{constructor(){super(...arguments),this.fontSize=14,this.fontFamily="Verdana, sans-serif",this.padding=5,this.color="rgba(87, 87, 87, 1)"}};g([b(H,{optional:!0})],Oi.prototype,"enabled",2),g([b(O,{optional:!0})],Oi.prototype,"text",2),g([b(Ns,{optional:!0})],Oi.prototype,"fontStyle",2),g([b(Ts,{optional:!0})],Oi.prototype,"fontWeight",2),g([b(j)],Oi.prototype,"fontSize",2),g([b(O)],Oi.prototype,"fontFamily",2),g([b(ct)],Oi.prototype,"padding",2),g([b(dt,{optional:!0})],Oi.prototype,"color",2),g([b(WC,{optional:!0})],Oi.prototype,"position",2),g([b(ct,{optional:!0})],Oi.prototype,"rotation",2),g([b(H,{optional:!0})],Oi.prototype,"parallel",2);var Qe=class extends nt{constructor(){super(),this.id=fi(this),this.defaultColorRange=[],this.fill="#c16068",this.label=new Oi,this.scale=void 0,this.clippedRange=[-1/0,1/0],this.gridLength=0,this.sideFlag=-1,this.parallelFlipRotation=0,this.regularFlipRotation=0,this.direction="x",this.rangeGroup=new it({name:this.id}),this.lineGroup=new it({name:this.id}),this.labelGroup=new it({name:this.id}),this.crossLineRange=new Zi,this.crossLineLabel=new jr,this.labelPoint=void 0,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}update(t){const{enabled:e,type:i,data:s,scale:n}=this;if(!n||!e||!t||!this.isValid()||!Ab(Ib(this),n)||s==null){this.rangeGroup.visible=!1,this.lineGroup.visible=!1,this.labelGroup.visible=!1;return}this.rangeGroup.visible=t,this.lineGroup.visible=t,this.labelGroup.visible=t,this.updateNodes();const r=i==="range";r!==this._isRange&&(r?this.rangeGroup.appendChild(this.crossLineRange):this.lineGroup.appendChild(this.crossLineRange)),this._isRange=r}calculateLayout(t,e){if(!t)return;const{type:i,range:s,value:n,scale:r,gridLength:o,sideFlag:a,direction:l,label:{position:c="top"},clippedRange:h,strokeWidth:u=0}=this;if(this.data=void 0,!r)return;const d=r.bandwidth??0,p=r.step??0,f=(e?-1:1)*(r instanceof aa?(p-d)/2:0),[y,x]=[0,a*o];let m,v,S,M;if(i==="line"){const N=d/2;m=r.convert(n)+N,v=NaN,S=r.convert(n,!0)+N,M=NaN}else if(s){const[N,E]=s,R=N?.valueOf()===E?.valueOf()&&_s.is(r)?d/2+f:0;m=r.convert(N)+R,v=r.convert(E)+d,S=r.convert(N,!0)+R-f,M=r.convert(E,!0)+d+f}else return;S=ad(S,h),M=ad(M,h);const D=(m===S||v===M||S!==M)&&Math.abs(M-S)>0;if(D&&S>M&&([S,M]=[M,S],[m,v]=[v,m]),m-f>=S&&(m-=f),v+f<=M&&(v+=f),this.startLine=u>0&&m>=S&&m<=S+f,this.endLine=u>0&&v>=M-d-f&&v<=M,i==="range"&&!D&&!this.startLine&&!this.endLine||(this.data=[S,M],this.label.enabled===!1||!this.label.text))return;const{c:C=Mc}=Rb[c]??{},{x:L,y:I}=C({direction:l,xStart:y,xEnd:x,yStart:S,yEnd:M});this.labelPoint={x:L,y:I}}updateNodes(){this.updateRangeNode();const{label:t}=this;t.enabled!==!1&&t.text&&(this.updateLabel(),this.positionLabel())}updateRangeNode(){const{type:t,crossLineRange:e,sideFlag:i,gridLength:s,data:n,startLine:r,endLine:o,fill:a,fillOpacity:l,stroke:c,strokeWidth:h,lineDash:u}=this;e.x1=0,e.x2=i*s,e.y1=n?.[0]??0,e.y2=n?.[1]??0,e.startLine=r,e.endLine=o,e.isRange=t==="range",e.fill=a,e.fillOpacity=l??1,e.stroke=c,e.strokeWidth=h??1,e.strokeOpacity=this.strokeOpacity??1,e.lineDash=u}updateLabel(){const{crossLineLabel:t,label:e}=this;e.text&&(t.fontStyle=e.fontStyle,t.fontWeight=e.fontWeight,t.fontSize=e.fontSize,t.fontFamily=e.fontFamily,t.fill=e.color,t.text=e.text)}positionLabel(){const{crossLineLabel:t,labelPoint:{x:e=void 0,y:i=void 0}={},label:{parallel:s,rotation:n,position:r="top",padding:o=0},direction:a,parallelFlipRotation:l,regularFlipRotation:c}=this;if(e===void 0||i===void 0)return;const{defaultRotation:h,configuredRotation:u}=bc({rotation:n,parallel:s,regularFlipRotation:c,parallelFlipRotation:l});t.rotation=h+u,t.textBaseline="middle",t.textAlign="center";const d=t.getBBox();if(!d)return;const p=a==="y",{xTranslation:f,yTranslation:y}=kd({yDirection:p,padding:o,position:r,bbox:d});t.translationX=e+f,t.translationY=i+y}computeLabelBBox(){const{label:t}=this;if(t.enabled===!1||!t.text)return;const e=new jr;e.fontFamily=t.fontFamily,e.fontSize=t.fontSize,e.fontStyle=t.fontStyle,e.fontWeight=t.fontWeight,e.text=t.text;const{labelPoint:{x:i=void 0,y:s=void 0}={},label:{parallel:n,rotation:r,position:o="top",padding:a=0},direction:l,parallelFlipRotation:c,regularFlipRotation:h}=this;if(i===void 0||s===void 0)return;const{configuredRotation:u}=bc({rotation:r,parallel:n,regularFlipRotation:h,parallelFlipRotation:c});e.rotation=u,e.textBaseline="middle",e.textAlign="center";const d=e.getBBox();if(!d)return;const p=l==="y",{xTranslation:f,yTranslation:y}=kd({yDirection:p,padding:a,position:o,bbox:d});return e.x=i+f,e.y=s+y,e.getBBox()}calculatePadding(t){const{data:e,direction:i,label:{padding:s=0,position:n="top"}}=this;if(e==null)return;const r=this.computeLabelBBox();if(r?.x==null||r?.y==null)return;const o=Lb({yDirection:i==="y",padding:s,position:n,bbox:r});t.left=Math.max(t.left??0,o.left??0),t.right=Math.max(t.right??0,o.right??0),t.top=Math.max(t.top??0,o.top??0),t.bottom=Math.max(t.bottom??0,o.bottom??0)}};Qe.className="CrossLine",g([b(H,{optional:!0})],Qe.prototype,"enabled",2),g([b(At(["range","line"],"a crossLine type"))],Qe.prototype,"type",2),g([b(ln(Td("range"),zn.restrict({length:2})),{optional:!0})],Qe.prototype,"range",2),g([b(Td("value"),{optional:!0})],Qe.prototype,"value",2),g([b(cn)],Qe.prototype,"defaultColorRange",2),g([b(dt)],Qe.prototype,"fill",2),g([b(It,{optional:!0})],Qe.prototype,"fillOpacity",2),g([b(dt,{optional:!0})],Qe.prototype,"stroke",2),g([b(ct,{optional:!0})],Qe.prototype,"strokeWidth",2),g([b(It,{optional:!0})],Qe.prototype,"strokeOpacity",2),g([b(ds,{optional:!0})],Qe.prototype,"lineDash",2),g([b(F)],Qe.prototype,"label",2);var $C=(w(),k(T)),HC=["stroke","lineDash"],KC=ge(t=>(0,$C.isObject)(t)&&Object.keys(t).every(e=>HC.includes(e)),"objects with gridline style properties such as 'stroke' or 'lineDash'"),Sc=class{constructor(){this.enabled=!0,this.width=1,this.style=[{stroke:void 0,lineDash:[]}]}};g([b(H)],Sc.prototype,"enabled",2),g([b(j)],Sc.prototype,"width",2),g([b(KC)],Sc.prototype,"style",2);var ZC=(w(),k(T)),Pb=Lt(t=>(0,ZC.isFiniteNumber)(t)&&t>0||t instanceof Yn,"a non-zero positive Number value or, for a time axis, a Time Interval such as 'agCharts.time.month'"),Zn=class extends nt{};g([b(Pb,{optional:!0})],Zn.prototype,"step",2),g([b(zn,{optional:!0})],Zn.prototype,"values",2),g([b(rm,{optional:!0})],Zn.prototype,"minSpacing",2),g([b(om,{optional:!0})],Zn.prototype,"maxSpacing",2);var be=class extends nt{constructor(){super(...arguments),this.enabled=!0,this.spacing=5,this.color="#575757",this.avoidCollisions=!0,this.mirrored=!1,this.parallel=!1}getSideFlag(){return this.mirrored?1:-1}getFont(){return Bt.toFontString(this)}};g([b(H)],be.prototype,"enabled",2),g([b(Ns,{optional:!0})],be.prototype,"fontStyle",2),g([b(Ts,{optional:!0})],be.prototype,"fontWeight",2),g([b(ct.restrict({min:1}))],be.prototype,"fontSize",2),g([b(O)],be.prototype,"fontFamily",2),g([b(j)],be.prototype,"spacing",2),g([b(jl,{optional:!0})],be.prototype,"minSpacing",2),g([b(dt,{optional:!0})],be.prototype,"color",2),g([b(ct,{optional:!0})],be.prototype,"rotation",2),g([b(H)],be.prototype,"avoidCollisions",2),g([b(H)],be.prototype,"mirrored",2),g([b(H)],be.prototype,"parallel",2),g([b(Ze,{optional:!0})],be.prototype,"itemStyler",2),g([b(Ze,{optional:!0})],be.prototype,"formatter",2),g([b(O,{optional:!0})],be.prototype,"format",2);var Dc=class{constructor(){this.enabled=!0,this.width=1,this.stroke=void 0}};g([b(H)],Dc.prototype,"enabled",2),g([b(j)],Dc.prototype,"width",2),g([b(dt,{optional:!0})],Dc.prototype,"stroke",2);var to=class extends nt{constructor(){super(...arguments),this.enabled=!0,this.width=1,this.size=6}};g([b(H)],to.prototype,"enabled",2),g([b(j)],to.prototype,"width",2),g([b(j)],to.prototype,"size",2),g([b(dt,{optional:!0})],to.prototype,"stroke",2);var Xi=class extends nt{constructor(){super(...arguments),this.caption=new Gt,this.enabled=!1,this.spacing=Gt.SMALL_PADDING,this.fontSize=10,this.fontFamily="sans-serif",this.wrapping="always"}};g([b(H)],Xi.prototype,"enabled",2),g([b(O,{optional:!0})],Xi.prototype,"text",2),g([b(j,{optional:!0})],Xi.prototype,"spacing",2),g([b(Ns,{optional:!0})],Xi.prototype,"fontStyle",2),g([b(Ts,{optional:!0})],Xi.prototype,"fontWeight",2),g([b(j)],Xi.prototype,"fontSize",2),g([b(O)],Xi.prototype,"fontFamily",2),g([b(dt,{optional:!0})],Xi.prototype,"color",2),g([b(Gl)],Xi.prototype,"wrapping",2),g([b(Ze,{optional:!0})],Xi.prototype,"formatter",2);var _b=(t=>(t[t.TickAndDomain=0]="TickAndDomain",t[t.TicksOnly=1]="TicksOnly",t[t.Off=2]="Off",t))(_b||{});function Ic(t){const[e,i]=ne(t.range),s=Math.floor(e),n=Math.ceil(i);return{min:s,max:n,visible:s!==n}}var wd=Math.PI*2,XC=wd/2;function qC(t,e){return Math.abs(e-t)<XC?e:t>e?e+wd:e-wd}function jb(t){const e=(o,a)=>{const[l=t.min,c=t.max]=ne(a??[]);return o<l||o>c};return{tick:{fromFn(o,a,l){let c=o.y1+o.translationY,h=o.opacity;return(l==="added"||e(o.datum.translationY,o.datum.range))&&(c=a.translationY,h=0),{y:0,translationY:c,opacity:h,phase:Ki[l]}},toFn(o,a,l){const c=a.translationY;let h=1;return l==="removed"&&(h=0),{y:0,translationY:c,opacity:h,finish:{y:c,translationY:0}}},applyFn(o,a){o.setProperties(a),o.visible=!e(o.y)}},line:{fromFn(o,a){return{...o.previousDatum??a,phase:Ki.updated}},toFn(o,a){return{...a}}},label:{fromFn(o,a,l){const c=o.previousDatum??a,h=c.x,u=c.y,d=c.rotationCenterX;let p=Math.round(o.translationY),f=c.rotation,y=o.opacity;return l==="removed"||e(c.y,c.range)?f=a.rotation:(l==="added"||e(o.datum.y,o.datum.range))&&(p=Math.round(c.translationY),y=0,f=a.rotation),{x:h,y:u,rotationCenterX:d,translationY:p,rotation:f,opacity:y,phase:Ki[l]}},toFn(o,a,l){const c=a.x,h=a.y,u=a.rotationCenterX,d=Math.round(a.translationY);let p=0,f=1;return l==="added"?p=a.rotation:l==="removed"?(f=0,p=a.rotation):p=qC(o.previousDatum?.rotation??a.rotation,a.rotation),{x:c,y:h,rotationCenterX:u,translationY:d,rotation:p,opacity:f,finish:{rotation:a.rotation}}}},group:{fromFn(o,a){const{rotation:l,translationX:c,translationY:h}=o;return{rotation:l,translationX:c,translationY:h,phase:Ki.updated}},toFn(o,a){const{rotation:l,translationX:c,translationY:h}=a;return{rotation:l,translationX:c,translationY:h}}}}}function Fb(){return(t,e)=>({rotation:e.rotation,rotationCenterX:e.rotationCenterX,rotationCenterY:e.rotationCenterY,translationX:e.translationX,translationY:e.translationY})}function Ed(t){const{visible:e,min:i,max:s}=t;return(n,r)=>{const o=r.translationY,a=e&&o>=i&&o<=s;return{y:o,translationY:0,opacity:1,visible:a}}}function Od(){return(t,e)=>({x:e.x,y:e.y,translationY:e.translationY,rotation:e.rotation,rotationCenterX:e.rotationCenterX})}function zb(){return(t,e)=>({...e})}var Ac=class extends Gn(vi){},Bb=(t=>(t[t.TickLines=0]="TickLines",t[t.AxisLine=1]="AxisLine",t[t.TickLabels=2]="TickLabels",t))(Bb||{}),Fs=class Yv{constructor(e,i){this.moduleCtx=e,this.scale=i,this.id=fi(this),this.nice=!0,this.reverse=!1,this.keys=[],this.interval=new Zn,this.dataDomain={domain:[],clipped:!1},this.layoutConstraints={stacked:!0,align:"start",width:100,unit:"percent"},this.boundSeries=[],this.includeInvisibleDomains=!1,this.interactionEnabled=!0,this.axisGroup=new qo({name:`${this.id}-axis`}),this.tickLineGroup=this.axisGroup.appendChild(new it({name:`${this.id}-Axis-tick-lines`,zIndex:0})),this.tickLabelGroup=this.axisGroup.appendChild(new it({name:`${this.id}-Axis-tick-labels`,zIndex:2})),this.labelGroup=new it({name:`${this.id}-Labels`,zIndex:9}),this.gridGroup=new qo({name:`${this.id}-Axis-grid`,zIndex:1}),this.gridLineGroup=this.gridGroup.appendChild(new it({name:`${this.id}-gridLines`})),this.crossLineRangeGroup=new qo({name:`${this.id}-CrossLines-Range`,zIndex:4}),this.crossLineLineGroup=new qo({name:`${this.id}-CrossLines-Line`,zIndex:8}),this.crossLineLabelGroup=new qo({name:`${this.id}-CrossLines-Label`,zIndex:13}),this.tickLineGroupSelection=re.select(this.tickLineGroup,Ac,!1),this.tickLabelGroupSelection=re.select(this.tickLabelGroup,jr,!1),this.gridLineGroupSelection=re.select(this.gridLineGroup,Ac,!1),this._crossLines=[],this.line=new Dc,this.tick=new to,this.gridLine=new Sc,this.label=this.createLabel(),this.defaultTickMinSpacing=Yv.defaultTickMinSpacing,this.translation={x:0,y:0},this.rotation=0,this.layout={label:{fractionDigits:0,spacing:this.label.spacing,format:this.label.format}},this.axisContext=void 0,this.labelFormatter=void 0,this.datumFormatter=void 0,this.scaleFormatterParams=void 0,this.destroyFns=[],this.range=[0,1],this.visibleRange=[0,1],this.title=new Xi,this.gridLength=0,this.gridPadding=0,this.seriesAreaPadding=0,this.animatable=!0,this._scaleNiceDomainInputDomain=void 0,this._scaleNiceDomainRangeExtent=NaN,this.moduleMap=new Cd,this.range=this.scale.range.slice(),this.crossLines.forEach(s=>this.initCrossLine(s))}get type(){return this.constructor.type??""}get labelNodes(){return this.tickLabelGroupSelection.nodes()}set crossLines(e){const{CrossLineConstructor:i}=this.constructor;this._crossLines.forEach(s=>this.detachCrossLine(s)),this._crossLines=e.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}resetAnimation(e){}attachCrossLine(e){this.crossLineRangeGroup.appendChild(e.rangeGroup),this.crossLineLineGroup.appendChild(e.lineGroup),this.crossLineLabelGroup.appendChild(e.labelGroup)}detachCrossLine(e){this.crossLineRangeGroup.removeChild(e.rangeGroup),this.crossLineLineGroup.removeChild(e.lineGroup),this.crossLineLabelGroup.removeChild(e.labelGroup)}destroy(){this.moduleMap.destroy(),this.destroyFns.forEach(e=>e())}updateScale(){const{range:e,visibleRange:i,scale:s}=this,n=(e[1]-e[0])/(i[1]-i[0]),r=n*i[0],o=e[0]-r;s.range=[o,o+n],this.crossLines.forEach(a=>{a.clippedRange=[e[0],e[1]]})}setCrossLinesVisible(e){this.crossLineRangeGroup.visible=e,this.crossLineLineGroup.visible=e,this.crossLineLabelGroup.visible=e}attachAxis(e){e.gridNode.appendChild(this.gridGroup),e.axisNode.appendChild(this.axisGroup),e.labelNode.appendChild(this.labelGroup),e.crossLineRangeNode.appendChild(this.crossLineRangeGroup),e.crossLineLineNode.appendChild(this.crossLineLineGroup),e.crossLineLabelNode.appendChild(this.crossLineLabelGroup)}detachAxis(e){e.gridNode.removeChild(this.gridGroup),e.axisNode.removeChild(this.axisGroup),e.labelNode.removeChild(this.labelGroup),e.crossLineRangeNode.removeChild(this.crossLineRangeGroup),e.crossLineLineNode.removeChild(this.crossLineLineGroup),e.crossLineLabelNode.removeChild(this.crossLineLabelGroup)}attachLabel(e){this.labelGroup.append(e)}inRange(e,i=0){const[s,n]=ne(this.range);return e>=s-i&&e<=n+i}getRangeOverflow(e){const{range:i,visibleRange:s}=this,n=(i[1]-i[0])/(s[1]-s[0]),[r,o]=ne([i[0]-n*s[0],i[0]-n*s[0]+n]);return e<r?e-r:e>o?e-o:0}defaultDatumFormatter(e,i){return Rs(e,i+1)}defaultLabelFormatter(e,i){return Rs(e,i)}onGridLengthChange(e,i){i^e&&this.onGridVisibilityChange(),this.crossLines.forEach(s=>this.initCrossLine(s))}onGridVisibilityChange(){this.gridLineGroupSelection.clear()}createLabel(){return new be}update(){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.updateGridLines(),this.updateTickLines(),this.updateCrossLines()}getAxisLineCoordinates(){const[e,i]=ne(this.range);return{x:0,y1:e,y2:i}}getLabelStyles(e,i){const{label:s}=this,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.moduleCtx.callbackCache.call(this,s.itemStyler,{...e,...n}));const{color:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}=gt(r,i,n);return{fill:o,fontFamily:a,fontSize:l,fontStyle:c,fontWeight:h,spacing:u}}getTickSize(){return this.tick.enabled?this.tick.size:0}processData(){const{includeInvisibleDomains:e,boundSeries:i,direction:s}=this,r=(e?i:i.filter(o=>o.isEnabled())).map(o=>o.getDomain(s));this.setDomains(...r)}setDomains(...e){let i,s;e.length>0?{domain:i,animatable:s}=this.scale.normalizeDomains(...e):(i=[],s=!0),this.dataDomain=this.normaliseDataDomain(i),this.reverse&&this.dataDomain.domain.reverse(),this.animatable=s}calculateLayout(e){const{scale:i,label:s,visibleRange:n,nice:r}=this;this.updateScale();const o=Wr(this.range),a=this.dataDomain.domain;let l;n[0]===0&&n[1]===1?l=void 0:r?this._scaleNiceDomainInputDomain===a&&this._scaleNiceDomainRangeExtent===o?l=this.scale.domain:l=this.calculateTickLayout(a,0,[0,1]).niceDomain:l=a;let c;r?l==null?c=0:c=1:c=2;const{niceDomain:h,primaryTickCount:u,ticks:d,tickDomain:p,fractionDigits:f,bbox:y}=this.calculateTickLayout(l??a,c,n,e);this.scale.domain=h,this._scaleNiceDomainInputDomain=r?a:void 0,this._scaleNiceDomainRangeExtent=r?o:NaN;const x=s.format;this.labelFormatter=i.tickFormatter({domain:p,specifier:x,ticks:d,fractionDigits:f})??(C=>this.defaultLabelFormatter(C,f)),this.datumFormatter=i.datumFormatter({domain:p,specifier:x,ticks:d,fractionDigits:f})??(C=>this.defaultDatumFormatter(C,f)),this.scaleFormatterParams={domain:p,ticks:d,fractionDigits:f},this.layout.label={fractionDigits:f,spacing:this.label.spacing,format:this.label.format};const m=s.getSideFlag(),v=this.isAnySeriesActive(),{rotation:S,parallelFlipRotation:M,regularFlipRotation:D}=this.calculateRotations();return this.crossLines.forEach(C=>{var L;C.sideFlag=-m,C.direction=S===-Math.PI/2?"x":"y",C instanceof Qe&&((L=C.label).parallel??(L.parallel=s.parallel)),C.parallelFlipRotation=M,C.regularFlipRotation=D,C.calculateLayout?.(v,this.reverse)}),{primaryTickCount:u,bbox:y}}getTransformBox(e){const i=new Ui,{rotation:s,translationX:n,translationY:r}=this.getAxisTransform();return Ui.updateTransformMatrix(i,1,1,s,n,r),i.transformBBox(e)}calculateRotations(){const e=zt(this.rotation),i=Pt(e),s=Pt(e-Math.PI/2);return{rotation:e,parallelFlipRotation:i,regularFlipRotation:s}}updateCrossLines(){const e=this.isAnySeriesActive();this.crossLines.forEach(i=>{i.update(e)})}updateTickLines(){const{tick:e,label:i}=this,s=i.getSideFlag();this.tickLineGroupSelection.each((n,r)=>{n.strokeWidth=r.tickWidth??e.width,n.stroke=r.tickStroke??e.stroke,n.x1=s*(r.tickSize??this.getTickSize()),n.x2=0})}getAxisTransform(){return{rotation:zt(this.rotation),translationX:Math.floor(this.translation.x),translationY:Math.floor(this.translation.y)}}updatePosition(){const{crossLineRangeGroup:e,crossLineLineGroup:i,crossLineLabelGroup:s,gridGroup:n,translation:r}=this,{rotation:o}=this.calculateRotations(),a=Math.floor(r.x),l=Math.floor(r.y);e.setProperties({rotation:o,translationX:a,translationY:l}),i.setProperties({rotation:o,translationX:a,translationY:l}),s.setProperties({rotation:o,translationX:a,translationY:l}),n.setProperties({rotation:o,translationX:a,translationY:l})}updateGridLines(){const e=this.label.getSideFlag(),{gridLine:{style:i,width:s},gridPadding:n,gridLength:r}=this;r===0||i.length===0||this.gridLineGroupSelection.each((o,a,l)=>{const{stroke:c,lineDash:h}=i[l%i.length];o.setProperties({x1:n,x2:-e*r+n,stroke:c,strokeWidth:s,lineDash:h})})}formatTick(e,i,s,n,r){const{labelFormatter:o,label:{formatter:a},moduleCtx:{callbackCache:l}}=this;let c;if(a){const h=this.getFormatterBoundSeries();c=l.call(this,a,{value:e,index:i,domain:s,fractionDigits:n,boundSeries:h})}else r?c=r(e):o&&(c=o(e));return String(c??e)}formatDatum(e){const{label:{formatter:i},moduleCtx:{callbackCache:s},datumFormatter:n=this.labelFormatter}=this;let r;if(i){const{domain:o}=this.scale,a=this.getFormatterBoundSeries();r=s.call(this,i,{value:e,index:NaN,domain:o,boundSeries:a})}else n?r=s.call(this,n,e):(0,Sb.isArray)(e)&&(r=e.filter(Boolean).join(" - "));return String(r??e)}getScaleValueFormatter(e){const{scaleFormatterParams:i}=this;let s;try{e!=null&&i!=null&&(s=this.scale.tickFormatter({...i,specifier:e}))}catch{Sb.Logger.warnOnce(`the format string ${e} is invalid, ignoring.`)}return s??(s=n=>this.formatDatum(n)),s}getBBox(){return this.axisGroup.getBBox()}initCrossLine(e){e.scale=this.scale,e.gridLength=this.gridLength}isAnySeriesActive(){return this.boundSeries.some(e=>this.includeInvisibleDomains||e.isEnabled())}clipTickLines(e,i,s,n){this.tickLineGroup.setClipRect(new B(e,i,s,n))}clipGrid(e,i,s,n){this.gridGroup.setClipRect(new B(e,i,s,n))}getFormatterBoundSeries(){const{direction:e}=this,i=[];for(const s of this.boundSeries){const n=s.getKeys(e),r=s.getNames(e);for(let o=0;o<n.length;o++)i.push({key:n[o],name:r[o]})}return i}getTitleFormatterParams(e){const{direction:i}=this,s=this.getFormatterBoundSeries();return{domain:e,direction:i,boundSeries:s,defaultValue:this.title?.text}}normaliseDataDomain(e){return{domain:[...e],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:e}=this;return{axisId:this.id,scale:this.scale,direction:this.direction,continuous:Ct.is(e)||_s.is(e),getCanvasBounds:()=>Kt.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),scaleValueFormatter:i=>this.getScaleValueFormatter(i),scaleInvert:i=>e.invert(i,!0),scaleInvertNearest:i=>e.invert(i,!0),attachLabel:i=>this.attachLabel(i),inRange:(i,s)=>this.inRange(i,s),getRangeOverflow:i=>this.getRangeOverflow(i)}}isReversed(){return this.reverse}};Fs.defaultTickMinSpacing=50,Fs.CrossLineConstructor=Qe,g([b(H)],Fs.prototype,"nice",2),g([b(H)],Fs.prototype,"reverse",2),g([b(im)],Fs.prototype,"keys",2),g([b(F)],Fs.prototype,"interval",2),g([b(F)],Fs.prototype,"title",2),g([pn((t,e,i)=>t.onGridLengthChange(e,i))],Fs.prototype,"gridLength",2);var Rd=Fs,Gb=(w(),k(T));function QC(t,e,i){let[s,n]=ne(t);s=JC(Math.floor(s),n,e);const r=eN(s,n,e),o=e-1;n=s+o*r;const a=i?[n,s]:[s,n],l=tN(s,r,e);return{domain:a,ticks:l}}function JC(t,e,i){const s=Math.abs(e-t)/(i-1),n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return Math.floor(t/r)*r}function tN(t,e,i){const s=Math.floor(Math.log10(e)),n=e>0&&e<1?Math.abs(s):0,r=Math.pow(10,n),o=[];for(let a=0;a<i;a++){const l=t+e*a;o[a]=Math.round(l*r)/r}return o}function eN(t,e,i){const s=i-1,n=(e-t)/s;return iN(n)}function iN(t){const e=Math.floor(Math.log10(t)),i=Math.pow(10,e),s=t/i*10;return s>0&&s<=1?i/10:s>1&&s<=2?2*i/10:s>1&&s<=5?5*i/10:s>5&&s<=10?10*i/10:s>10&&s<=20?20*i/10:s>20&&s<=40?40*i/10:s>40&&s<=50?50*i/10:s>50&&s<=100?100*i/10:s}function Pd(){const t=new Map;return e=>{const i=t.get(e);return i?(t.set(e,i+1),`${e}_${i}`):(t.set(e,1),e)}}var Vb=class{constructor(t){this.axis=t}estimateTickCount(t,e,i){return Xy(Wr(this.axis.range),Wr(t),e,i,Ct.defaultTickCount,this.axis.defaultTickMinSpacing)}filterTicks(t,e){const{minSpacing:i,maxSpacing:s}=this.axis.interval,r=i!=null||s!=null?Math.ceil(t.length/e):2,o=t.length%r?-1:0;return t.filter((a,l)=>(l+o)%r===0)}generateTicks({domain:t,primaryTickCount:e,visibleRange:i,niceMode:s,parallelFlipRotation:n,regularFlipRotation:r,labelX:o,sideFlag:a}){const{scale:l,label:c,interval:{minSpacing:h,maxSpacing:u}}=this.axis,{parallel:d,rotation:p,fontFamily:f,fontSize:y,fontStyle:x,fontWeight:m}=c,v=e!==void 0,{defaultRotation:S,configuredRotation:M,parallelFlipFlag:D,regularFlipFlag:C}=bc({rotation:p,parallel:d,regularFlipRotation:r,parallelFlipRotation:n}),L=M+S,I=new Ui,{maxTickCount:N}=this.estimateTickCount(i,h,u),R=!(Ct.is(l)||_s.is(l))||isNaN(N)?10:N;let z=Db(d,M,0,a,C);const W=_C(d,M,a,D),yt=Bt.toFontString({fontFamily:f,fontSize:y,fontStyle:x,fontWeight:m}),$=Es.getMeasurer({font:yt}),q={fontFamily:f,fontSize:y,fontStyle:x,fontWeight:m,textBaseline:W,textAlign:z},tt=c.enabled&&c.avoidCollisions,ht=({ticks:bt},X)=>{if(!tt)return!1;const Z=M!==0||X!==0,_=L+X,K=PC(c.minSpacing,Z);Ui.updateTransformMatrix(I,1,1,_,0,0);const Q=jC(bt,o,I,$);return JL(Q,K)};let lt={tickDomain:[],ticks:[],rawTicks:[],fractionDigits:0,niceDomain:void 0},V=0,Y=0,et=!0,st=!1;for(;!st&&et&&V<=R;){Y=0;for(const bt of this.getTickStrategies({domain:t,niceMode:s,secondaryAxis:v,index:V}))({tickData:lt,index:V,autoRotation:Y,terminate:st}=bt({index:V,tickData:lt,textProps:q,terminate:st,primaryTickCount:e,visibleRange:i,get labelOverlap(){return ht(lt,Y)}}));et=ht(lt,Y)}z=Db(d,M,Y,a,C);const ut=S+M+Y;return!v&&lt.rawTicks.length>0&&(e=lt.rawTicks.length),{tickData:lt,primaryTickCount:e,combinedRotation:ut,textBaseline:W,textAlign:z}}getTickStrategies({domain:t,niceMode:e,index:i,secondaryAxis:s}){const{scale:n,label:r,interval:o}=this.axis,{minSpacing:a}=o,l=Ct.is(n)||_s.is(n),c=r.enabled&&r.avoidCollisions,h=!l&&i!==0&&c,u=r.autoRotate===!0&&r.rotation===void 0,d=[];let p;o.values?p=3:s?p=1:h?p=2:p=0;const f=({index:y,tickData:x,primaryTickCount:m,visibleRange:v,terminate:S})=>this.createTickData(t,e,v,m,p,y,x,S);if(d.push(f),!l&&a!=null){const y=({index:x,tickData:m,primaryTickCount:v,visibleRange:S,terminate:M})=>this.createTickData(t,e,S,v,2,x,m,M);d.push(y)}if(c&&u){const y=({index:x,tickData:m,labelOverlap:v,terminate:S})=>({index:x,tickData:m,autoRotation:v?Pt(zt(r.autoRotateAngle??0)):0,terminate:S});d.push(y)}return d}createTickData(t,e,i,s,n,r,o,a){const{scale:l,interval:c}=this.axis,{step:h,values:u,minSpacing:d,maxSpacing:p}=c,{maxTickCount:f,minTickCount:y,tickCount:x}=this.estimateTickCount(i,d,p),m=Ct.is(l)||_s.is(l),v=!m||isNaN(f)?10:f,S=D=>m?Math.max(x-D,y):f,M=h==null&&u==null&&S(r)>y&&(m||n===2);for(;r<=v;){const D=o.rawTicks;if(o=this.getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:n,previousTicks:D,minTickCount:y,maxTickCount:f,primaryTickCount:s,tickCount:S(r)}),r++,!M||!(0,Gb.arraysEqual)(o.rawTicks,D))break}return a||(a=h!=null||u!=null),{tickData:o,index:r,autoRotation:0,terminate:a}}getTicks({domain:t,niceMode:e,visibleRange:i,tickGenerationType:s,previousTicks:n,tickCount:r,minTickCount:o,maxTickCount:a,primaryTickCount:l}){const{axis:c}=this,{label:h,range:u,scale:d,interval:p}=c,f=Pd(),y={nice:e===0,interval:p.step,tickCount:r,minTickCount:o,maxTickCount:a},x={...y,nice:e===0||e===1};let m=e===0?d.niceDomain(y,t):t,v=m,S;switch(s){case 3:if(v=p.values,S=p.values,Ct.is(d)){const[E,R]=ne(m.map(Number));S=S.filter(z=>Number(z)>=E&&Number(z)<=R).sort((z,W)=>Number(z)-Number(W))}break;case 1:if(Ct.is(d)){const E=QC(t.map(Number),l??0,c.reverse);S=E.ticks,m=E.domain.map(R=>d.toDomain(R))}else S=d.ticks(x,m,i)??[];break;case 2:S=this.filterTicks(n,r);break;default:S=d.ticks(x,m,i)??[]}const M=S.reduce((E,R)=>Math.max(E,typeof R=="number"?(0,Gb.countFractionDigits)(R):0),0),D={domain:v,ticks:S,fractionDigits:M,specifier:h.format},C=d.tickFormatter(D),L=d.domain;d.domain=m;const I=(d.bandwidth??0)/2,N=[];for(let E=0;E<S.length;E++){const R=S[E],z=d.convert(R)+I;if(u.length>0&&!c.inRange(z,.001))continue;const W=h.enabled?c.formatTick(R,E,m,M,C):"";N.push({tick:R,tickId:f(W),tickLabel:W,translationY:Math.floor(z)})}return d.domain=L,{tickDomain:v,rawTicks:S,fractionDigits:M,ticks:N,niceDomain:m}}},_d=class extends be{constructor(){super(...arguments),this.autoRotateAngle=335}};g([b(H,{optional:!0})],_d.prototype,"autoRotate",2),g([b(ct)],_d.prototype,"autoRotateAngle",2);var jd=class Wv extends Rd{constructor(e,i){super(e,i),this.lineNode=this.axisGroup.appendChild(new Ac({name:`${this.id}-Axis-line`,zIndex:1})),this.tempText=new jr({debugDirty:!1}),this.tempCaption=new Gt,this.tickGenerator=new Vb(this),this.generatedTicks=void 0,this.animationManager=e.animationManager,this.animationState=new ga("empty",{empty:{update:{target:"ready",action:()=>this.resetSelectionNodes()},reset:"empty"},ready:{update:n=>this.animateReadyUpdate(n),resize:()=>this.resetSelectionNodes(),reset:"empty"}}),this.axisGroup.appendChild(this.title.caption.node);let s;this.destroyFns.push(e.layoutManager.addListener("layout:complete",n=>{const r=[n.chart.width,n.chart.height];s!=null&&!(0,bb.arraysEqual)(r,s)&&this.animationState.transition("resize"),s=r}),this.title.caption.registerInteraction(this.moduleCtx,"afterend"))}static is(e){return e instanceof Wv}resetAnimation(e){e==="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 _d}updateDirection(){switch(this.position){case"top":this.rotation=-90,this.label.mirrored=!0,this.label.parallel=!0;break;case"right":this.rotation=0,this.label.mirrored=!0,this.label.parallel=!1;break;case"bottom":this.rotation=-90,this.label.mirrored=!1,this.label.parallel=!0;break;case"left":this.rotation=0,this.label.mirrored=!1,this.label.parallel=!1;break}this.axisContext&&(this.axisContext.position=this.position,this.axisContext.direction=this.direction)}calculateLayout(e){return this.updateDirection(),super.calculateLayout(e)}calculateTickLayout(e,i,s,n){const r=this.label.getSideFlag(),{parallelFlipRotation:o,regularFlipRotation:a}=this.calculateRotations(),l=r*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding);if(i===2&&this.label.enabled===!1&&this.tick.enabled===!1&&this.gridLine.enabled===!1)return this.generatedTicks={ticks:[],labels:[]},{ticks:[],tickDomain:e,niceDomain:e,primaryTickCount:n,fractionDigits:0,bbox:this.tickBBox(e,[],[])};const c=this.tickGenerator.generateTicks({domain:e,niceMode:i,visibleRange:s,primaryTickCount:n,parallelFlipRotation:o,regularFlipRotation:a,labelX:l,sideFlag:r}),{tickData:h,primaryTickCount:u=n}=c,{ticks:d,tickDomain:p,rawTicks:f,fractionDigits:y,niceDomain:x=e}=h,m=d.map(S=>this.getTickLabelProps(S,c)),v=this.tickBBox(p,d,m);return this.generatedTicks={ticks:d,labels:m},{ticks:f,tickDomain:p,niceDomain:x,primaryTickCount:u,fractionDigits:y,bbox:v}}update(){this.updateDirection();const e=Array.from(this.tickLabelGroupSelection.nodes(),r=>r.datum.tickId);if(super.update(),this.animatable||this.moduleCtx.animationManager.skipCurrentBatch(),this.generatedTicks){const{ticks:r}=this.generatedTicks;if(this.animationManager.isSkipped())this.resetSelectionNodes();else{const o=r.map(l=>l.tickId),a=(0,bb.diffArrays)(e,o);this.animationState.transition("update",a)}}const{enabled:i,stroke:s,width:n}=this.line;this.lineNode.setProperties({stroke:s,strokeWidth:i?n:0}),this.updateTitle(this.scale.domain,!this.generatedTicks?.ticks.length)}updatePosition(){super.updatePosition(),this.axisGroup.datum=this.getAxisTransform()}tickBBox(e,i,s){const n=this.label.getSideFlag(),r=[],{x:o,y1:a,y2:l}=this.getAxisLineCoordinates(),c=new B(o+Math.min(n*this.seriesAreaPadding,0),a,this.seriesAreaPadding,l-a);if(r.push(c),this.tick.enabled)for(const d of i){const{x1:p,x2:f,y}=this.getTickLineCoordinates(d),x=new B(p,y,f-p,0);r.push(x)}const{tempText:h}=this;if(this.label.enabled)for(const d of s){if(!d.visible)continue;h.setProperties({...d,translationY:Math.round(d.translationY)});const p=h.getBBox();p&&r.push(p)}if(this.title?.enabled){const d=B.merge(r).width;this.setTitleProps(this.tempCaption,{domain:e,spacing:d});const p=this.tempCaption.node.getBBox();p&&r.push(p)}const u=B.merge(r);return this.getTransformBox(u)}setTitleProps(e,i){const{title:s}=this;if(!s.enabled){e.enabled=!1,e.node.visible=!1;return}e.enabled=!0,e.color=s.color,e.fontFamily=s.fontFamily,e.fontSize=s.fontSize,e.fontStyle=s.fontStyle,e.fontWeight=s.fontWeight,e.wrapping=s.wrapping;const n=e.node,r=(s.spacing??0)+i.spacing,o=this.label.getSideFlag(),a=Pt(this.rotation),l=o===-1&&a>Math.PI&&a<Math.PI*2?-1:1,c=l*o*Math.PI/2,h=l===1?"bottom":"top",{range:u}=this,d=Math.floor(l*o*(u[0]+u[1])/2),p=Math.floor(o===-1?l*-r:-r),{callbackCache:f}=this.moduleCtx,{formatter:y=m=>m.defaultValue}=s,x=f.call(this,y,this.getTitleFormatterParams(i.domain));e.text=x,n.setProperties({visible:!0,text:x,textBaseline:h,x:d,y:p,rotation:c})}getTickLabelProps(e,i){const{combinedRotation:s,textBaseline:n,textAlign:r}=i,{range:o}=this.scale,a=e.tickLabel,c=this.label.getSideFlag()*(this.getTickSize()+this.label.spacing+this.seriesAreaPadding),h=a!==""&&a!=null;return{...this.getLabelStyles({value:e.tickLabel}),tickId:e.tickId,rotation:s,rotationCenterX:c,translationY:e.translationY,text:a,textAlign:r,textBaseline:n,visible:h,x:c,y:0,range:o}}getTickLineCoordinates(e){const s=this.label.getSideFlag()*this.getTickSize(),n=Math.min(0,s),r=n+Math.abs(s),o=e.translationY;return{x1:n,x2:r,y:o}}updateSelections(){if(!this.generatedTicks)return;const e=this.getAxisLineCoordinates(),{ticks:i,labels:s}=this.generatedTicks,n=r=>r.tickId;this.lineNode.datum=e,this.gridLineGroupSelection.update(this.gridLength?i:[],void 0,n),this.tickLineGroupSelection.update(i,void 0,n),this.tickLabelGroupSelection.update(s,void 0,n)}updateTitle(e,i,s){const{title:n,tickLineGroup:r,tickLabelGroup:o,lineNode:a}=this;n.enabled&&!i&&s==null&&(s=it.computeChildrenBBox([r,o,a]).width+(o.visible?0:this.seriesAreaPadding)),s??(s=0),this.setTitleProps(n.caption,{domain:e,spacing:s})}updateLabels(){this.label.enabled&&this.tickLabelGroupSelection.each((e,i)=>{e.fill=i.fill,e.fontFamily=i.fontFamily,e.fontSize=i.fontSize,e.fontStyle=i.fontStyle,e.fontWeight=i.fontWeight,e.text=i.text,e.textBaseline=i.textBaseline,e.textAlign=i.textAlign??"center"})}animateReadyUpdate(e){const{animationManager:i}=this.moduleCtx,s=Ic(this),n=jb(s);Xt(this.id,"axis-group",i,[this.axisGroup],n.group),Xt(this.id,"line",i,[this.lineNode],n.line),Xt(this.id,"line-paths",i,[this.gridLineGroupSelection,this.tickLineGroupSelection],n.tick,(r,o)=>o.tickId,e),Xt(this.id,"tick-labels",i,[this.tickLabelGroupSelection],n.label,(r,o)=>o.tickId,e)}resetSelectionNodes(){const e=Ic(this);Ie([this.axisGroup],Fb()),Ie([this.gridLineGroupSelection,this.tickLineGroupSelection],Ed(e)),Ie([this.tickLabelGroupSelection],Od()),Ie([this.lineNode],zb())}};g([b(j,{optional:!0})],jd.prototype,"thickness",2),g([b(fu)],jd.prototype,"position",2);var fa=jd,Ub=["top","right","bottom","left"];function sN(t){return typeof t=="string"&&Ub.includes(t)}function nN(t){const e=[],i=[],s=[...Ub];for(const n of t)n instanceof fa&&(sN(n.position)?i.push(n.position):e.push(n));for(const n of e){let r;do r=s.pop();while(r&&i.includes(r));if(r==null)break;n.position=r}}var rN=["direction","xKey","yKey","sizeKey","angleKey","radiusKey","normalizedTo"];function oN(t,e,i){const s=(c,h,u)=>{const d=[c];for(const p of rN)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 t){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 e){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[f,y]=p.shift(),x=i?.[y]??{},m=ps(x,u??{}),{groupIndex:v,stackIndex:S}=m?.seriesGrouping??{};v!=null||S!=null?l.push({opts:u,series:f,diff:m,targetIdx:d,idx:y,status:"series-grouping"}):m?l.push({opts:u,series:f,diff:m,targetIdx:d,idx:y,status:"update"}):l.push({opts:u,series:f,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 zs(t){const{series:e}=t;return e?.[0]?.type??"line"}function Fd(t){const e=zs(t);return Yt.isCartesian(e)||mC(e)}function Yb(t){const e=zs(t);return Yt.isPolar(e)||yC(e)}function Wb(t){const e=zs(t);return Yt.isHierarchy(e)||bC(e)}function $b(t){const e=zs(t);return Yt.isTopology(e)||xC(e)}function Hb(t){const e=zs(t);return Yt.isFlowProportion(e)||vC(e)}function zd(t){const e=zs(t);return Yt.isStandalone(e)||MC(e)}function Bd(t){const e=zs(t);return Yt.isGauge(e)||SC(e)}function aN(t){const e=zs(t);return Yb(t)&&e!=="pie"&&e!=="donut"}var lN=class extends Cd{applyOptions(t){for(const e of this.moduleMap.values())e.module.optionsKey in t&&Ti(e.moduleInstance)&&e.moduleInstance.set(t[e.module.optionsKey])}*legends(){for(const{module:t,moduleInstance:e}of this.moduleMap.values())t.type==="legend"&&(yield{legendType:t.identifier,legend:e})}},Kb=(w(),k(T)),Gd="ag-charts-overlay",Zb="ag-charts-dark-overlay",Xn=class extends nt{constructor(t,e){super(),this.className=t,this.defaultMessageId=e,this.enabled=!0}getText(t){return t.t(this.text??this.defaultMessageId)}getElement(t,e,i){if(this.content?.remove(),this.focusBox=i,this.renderer){const s=this.renderer();if(s instanceof HTMLElement)this.content=s;else{const n=(0,Kb.createElement)("div");n.innerHTML=s,this.content=n.firstElementChild}}else{const s=(0,Kb.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)"});s.innerText=this.getText(e),this.content=s,t?.animate({from:0,to:1,id:"overlay",phase:"add",groupId:"opacity",onUpdate(n){s.style.opacity=String(n)},onStop(){s.style.opacity="1"}})}return this.content}removeElement(t=()=>this.content?.remove(),e){if(this.content){if(e){const{content:i}=this;e.animate({from:1,to:0,phase:"remove",id:"overlay",groupId:"opacity",onUpdate(s){i.style.opacity=String(s)},onStop(){t?.()}})}else t?.();this.content=void 0,this.focusBox=void 0}}};g([b(H)],Xn.prototype,"enabled",2),g([b(O,{optional:!0})],Xn.prototype,"text",2),g([b(Ze,{optional:!0})],Xn.prototype,"renderer",2);var eo=class extends nt{constructor(){super(...arguments),this.darkTheme=!1,this.loading=new Xn("ag-charts-loading-overlay","overlayLoadingData"),this.noData=new Xn("ag-charts-no-data-overlay","overlayNoData"),this.noVisibleSeries=new Xn("ag-charts-no-visible-series","overlayNoVisibleSeries"),this.unsupportedBrowser=new Xn("ag-charts-unsupported-browser","overlayUnsupportedBrowser")}getFocusInfo(t){for(const e of[this.loading,this.noData,this.noVisibleSeries,this.unsupportedBrowser])if(e.focusBox!==void 0)return{text:e.getText(t),rect:e.focusBox}}destroy(){this.loading.removeElement(),this.noData.removeElement(),this.noVisibleSeries.removeElement(),this.unsupportedBrowser.removeElement()}};g([b(H)],eo.prototype,"darkTheme",2),g([b(F)],eo.prototype,"loading",2),g([b(F)],eo.prototype,"noData",2),g([b(F)],eo.prototype,"noVisibleSeries",2),g([b(F)],eo.prototype,"unsupportedBrowser",2);var ma=(w(),k(T));function cN(t,e){const{animationDuration:i}=ia.add,s=i*e,n=(0,ma.createElement)("div",`${Gd}--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,ma.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,ma.createElement)("p",{marginTop:"1em"});o.innerText=t;const a=(0,ma.createElement)("div",`${Gd}__loading-background`,{position:"absolute",inset:"0",opacity:"0.5",zIndex:"-1"}),l=(0,ma.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 hN=(w(),k(T)),Xb=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.ANY_CONTENT=1]="ANY_CONTENT",t))(Xb||{}),qb=(t=>(t[t.FOREGROUND=0]="FOREGROUND",t[t.HIGHLIGHT=1]="HIGHLIGHT",t[t.LABEL=2]="LABEL",t))(qb||{});function qn(t,e,i){if(Vi(t))return{type:"gradient",gradient:t.gradient??e.gradient,colorStops:t.colorStops??e.colorStops,bounds:t.bounds??e.bounds,rotation:t.rotation??e.rotation,reverse:t.reverse??e.reverse};if(Bn(t)&&i){const s=t.pattern??i.pattern;let n=t.strokeWidth;s==="backward-slanted-lines"||s==="forward-slanted-lines"||s==="horizontal-lines"||s==="vertical-lines"?n??(n=i.strokeWidth):n??(n=0);const r=t.width??t.height??i.width,o=t.height??t.width??i.height;return{type:"pattern",pattern:s,width:r,height:o,padding:t.padding??i.padding,fill:t.fill??i.fill,fillOpacity:t.fillOpacity??i.fillOpacity,backgroundFill:t.backgroundFill??i.backgroundFill,backgroundFillOpacity:t.backgroundFillOpacity??i.backgroundFillOpacity,stroke:t.stroke??i.stroke,strokeOpacity:t.strokeOpacity??i.strokeOpacity,strokeWidth:n,rotation:t.rotation??i.rotation}}return t}function ms(t,e,i){return!Vi(t?.fill)&&!Bn(t?.fill)?t:{...t,fill:qn(t.fill,e,i)}}function Lc(t,e,i,s){i==null||!Vi(e)||e.bounds==null||e.bounds==="item"?t.fillBBox=void 0:t.fillBBox=i[e.bounds],t.fillParams=s}function Qn(t,e,i,s,n){const r=i?.fill??e.fill;t.fill=r,Lc(t,i?.fill??e.fill,s,n),t.fillOpacity=i?.fillOpacity??e.fillOpacity??1,t.stroke=i?.stroke??e.stroke,t.strokeOpacity=i?.strokeOpacity??e.strokeOpacity??1,t.strokeWidth=i?.strokeWidth??e.strokeWidth??0,t.lineDash=i?.lineDash??e.lineDash,t.lineDashOffset=i?.lineDashOffset??e.lineDashOffset??0}var Qb=(t=>(t[t.EXACT_SHAPE_MATCH=0]="EXACT_SHAPE_MATCH",t[t.NEAREST_NODE=1]="NEAREST_NODE",t[t.AXIS_ALIGNED=2]="AXIS_ALIGNED",t))(Qb||{}),uN=.25,dN=.125,ya=class{constructor(t,e,i,s){this.type=t,this.event=e,this.defaultPrevented=!1,this.datum=i.datum,this.seriesId=s.id}preventDefault(){this.defaultPrevented=!0}},Vd=class{constructor(t,e,i){this.series=t,this.seriesGrouping=e,this.oldGrouping=i,this.type="groupingChanged"}},Cc=class extends Nm{constructor(t){super(),this.destroyFns=[],this.usesPlacedLabels=!1,this.seriesGrouping=void 0,this.NodeEvent=ya,this.internalId=fi(this),this.contentGroup=new Xe({name:`${this.internalId}-content`,zIndex:1}),this.highlightGroup=new Xe({name:`${this.internalId}-highlight`,zIndex:1}),this.annotationGroup=new Xe({name:`${this.internalId}-annotation`}),this.labelGroup=new Xe({name:`${this.internalId}-series-labels`}),this.axes={x:void 0,y:void 0},this.directions=["x","y"],this.nodeDataRefresh=!0,this.moduleMap=new Cd,this.datumCallbackCache=new Map,this.connectsToYAxis=!1,this._declarationOrder=-1,this.seriesListeners=new Os,this._pickNodeCache=new ju;const{moduleCtx:e,pickModes:i,directionKeys:s={},directionNames:n={},canHaveAxes:r=!1,usesPlacedLabels:o=!1}=t;this.ctx=e,this.directionKeys=s,this.directionNames=n,this.canHaveAxes=r,this.usesPlacedLabels=o,this.highlightGroup=new Xe({name:`${this.internalId}-highlight`}),this.highlightNode=this.highlightGroup.appendChild(new it({name:"highlightNode",zIndex:0})),this.highlightLabel=this.highlightGroup.appendChild(new it({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(t){this.properties.visible=t,this.ctx.legendManager.toggleItem(t,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(t){this._data=t,this.onDataChange()}setChartData(t){this._chartData=t,this.data===t&&this.onDataChange()}onSeriesGroupingChange(t,e){const{internalId:i,type:s,visible:n}=this;t&&this.ctx.seriesStateManager.deregisterSeries(this),e&&this.ctx.seriesStateManager.registerSeries({internalId:i,type:s,visible:n,seriesGrouping:e}),this.fireEvent(new Vd(this,e,t))}getBandScalePadding(){return{inner:1,outer:0}}attachSeries(t,e,i){t.appendChild(this.contentGroup),e.appendChild(this.highlightGroup),e.appendChild(this.labelGroup),i?.appendChild(this.annotationGroup)}detachSeries(t,e,i){t?.removeChild(this.contentGroup),e.removeChild(this.highlightGroup),e.removeChild(this.labelGroup),i?.removeChild(this.annotationGroup)}setSeriesIndex(t){return t===this._declarationOrder?!1:(this._declarationOrder=t,this.contentGroup.zIndex=[1,t,0],this.highlightGroup.zIndex=[1,t,1],this.labelGroup.zIndex=[1,t,2],this.annotationGroup.zIndex=t,!0)}renderToOffscreenCanvas(){return!1}addEventListener(t,e){return super.addEventListener(t,e)}removeEventListener(t,e){return super.removeEventListener(t,e)}hasEventListener(t){return super.hasEventListener(t)}addListener(t,e){return this.seriesListeners.addListener(t,e)}dispatch(t,e){this.seriesListeners.dispatch(t,e)}addChartEventListeners(){}destroy(){this.destroyFns.forEach(t=>t()),this.destroyFns=[],this.resetDatumCallbackCache(),this.ctx.seriesStateManager.deregisterSeries(this)}getDirectionValues(t,e){const i=this.resolveKeyDirection(t),s=e?.[i],n=[];if(!s)return n;const r=(...o)=>{for(const a of o)Array.isArray(a)?r(...a):typeof a=="object"?r(...Object.values(a)):n.push(a)};return r(...s.map(o=>this.properties[o])),n}getKeys(t){return this.getDirectionValues(t,this.directionKeys)}getKeyProperties(t){return this.directionKeys[this.resolveKeyDirection(t)]??[]}getNames(t){return this.getDirectionValues(t,this.directionNames)}resolveKeyDirection(t){return t}getDomain(t){const e=this.getSeriesDomain(t),i=this.moduleMap.mapModules(s=>s.getDomain(t)).flat();return i.length!==0?e.concat(i):e}getRange(t,e){return this.getSeriesRange(t,e)}getVisibleItems(t,e,i){return 1/0}markNodeDataDirty(){this.nodeDataRefresh=!0,this._pickNodeCache.clear(),this.visibleMaybeChanged()}visibleMaybeChanged(){this.ctx.seriesStateManager.updateSeries(this)}getOpacity(){const{dimOpacity:e=1,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===1)return 1;switch(this.isItemIdHighlighted()){case 0:case 1:return 1;case 2:default:return e}}getStrokeWidth(t){const{strokeWidth:e,enabled:i=!0}=this.properties.highlightStyle.series;if(!i||e===void 0)return t;switch(this.isItemIdHighlighted()){case 1:return e;case 0:case 2:return t}}isItemIdHighlighted(){const t=this.ctx.highlightManager?.getActiveHighlight()?.series;return t==null?0:t!==this?2:1}getModuleTooltipParams(){return this.moduleMap.mapModules(t=>t.getTooltipParams()).reduce((t,e)=>Object.assign(t,e),{})}pickNodes(t,e,i=!1){const{pickModes:s,pickModeAxis:n,visible:r,contentGroup:o}=this;if(!r||!o.visible||e==="highlight"&&!this.properties.highlight.enabled||e==="highlight-tooltip"&&!this.properties.highlight.enabled)return;let a=1/0;if(e==="tooltip"||e==="highlight-tooltip"){const{tooltip:d}=this.properties;a=typeof d.range=="number"?d.range:1/0,i||(i=d.range==="exact")}else if(e==="event"||e==="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}=t,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 f=this.pickNodesExactShape(t);p=f.length===0?void 0:{datums:f,distance:0};break}case 1:{const f=this.pickNodeClosestDatum(t),y=f?.distance===0?this.pickNodesExactShape(t):void 0;y!=null&&y.length!==0?p={datums:y,distance:0}:f?p={datums:[f.datum],distance:f.distance}:p=void 0;break}case 2:{const f=n!=null?this.pickNodeMainAxisFirst(t,n==="main-category"):void 0;p=f!=null?{datums:[f.datum],distance:f.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(t){const e=[];for(const i of this.contentGroup.pickNodes(t.x,t.y)){const s=i.closestDatum();s!=null&&s.missing!==!0&&e.push(s)}return e}pickNodeClosestDatum(t){throw new Error("AG Charts - Series.pickNodeClosestDatum() not implemented")}pickNodeNearestDistantObject(t,e){const i=Nl(t.x,t.y,e),s=i.nearest?.closestDatum();if(s!=null&&s.missing!==!0)return{datum:s,distance:Math.sqrt(i.distanceSquared)}}pickNodeMainAxisFirst(t,e){throw new Error("AG Charts - Series.pickNodeMainAxisFirst() not implemented")}getLabelData(){return[]}updatePlacedLabelData(t){}fireNodeClickEvent(t,e){const i=new this.NodeEvent("seriesNodeClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}fireNodeDoubleClickEvent(t,e){const i=new this.NodeEvent("seriesNodeDoubleClick",t,e,this);return this.fireEvent(i),!i.defaultPrevented}createNodeContextMenuActionEvent(t,e){return new this.NodeEvent("nodeContextMenuAction",t,e,this)}onLegendInitialState(t,e){const{visible:i=!0,itemId:s,legendItemName:n}=e??{};this.toggleSeriesItem(i,t,s,n)}onLegendItemClick(t){const{enabled:e,itemId:i,series:s,legendType:n}=t,r="legendItemName"in this.properties?this.properties.legendItemName:void 0,o="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,a=r!=null&&r===t.legendItemName;(s.id===this.id||a||o!=null)&&this.toggleSeriesItem(e,n,i,r,t)}onLegendItemDoubleClick(t){const{enabled:e,itemId:i,series:s,numVisibleItems:n,legendType:r}=t,o="legendItemName"in this.properties?this.properties.legendItemName:void 0,a="legendItemKey"in this.properties?this.properties.legendItemKey:void 0,l=o!=null&&o===t.legendItemName;s.id===this.id||l||a!=null?this.toggleSeriesItem(!0,r,i,o,t):e&&n===1?this.toggleSeriesItem(!0,r,void 0,o):this.toggleSeriesItem(!1,r,void 0,o)}toggleSeriesItem(t,e,i,s,n){const r=this.id;(t||e!=="category")&&(this.visible=t),this.nodeDataRefresh=!0,this._pickNodeCache.clear();const o={type:"seriesVisibilityChange",seriesId:r,itemId:i,legendItemName:n?.legendItemName??s,visible:t};this.fireEvent(o),this.ctx.legendManager.toggleItem(t,r,i,s)}isEnabled(){return this.visible}getModuleMap(){return this.moduleMap}createModuleContext(){return{...this.ctx,series:this}}getLabelText(t,e,i=Rs){return t.formatter?this.ctx.callbackCache.call(this.properties,t.formatter,{seriesId:this.id,...e})??this.callWithContext(i,e.value):this.callWithContext(i,e.value)}getMarkerStyle(t,e,i,s=!1,n=t.size??0,r){const{itemStyler:o,fillGradientDefaults:a,fillPatternDefaults:l}=t;let h=ms(gt({size:n},r,t.getStyle()),a,l);if(o&&i){const u=this.ctx.callbackCache.call(this.properties,o,{seriesId:this.id,...h,...i,highlighted:s,datum:e});h=ms(gt(u,h),a,l)}return h}updateMarkerStyle(t,e,i,s,n,r,o,a,{applyTranslation:l=!0,selected:c=!0}={}){const h=this.getMarkerStyle(t,i,n,r,s?.size,o),{shape:u,size:d}=h,p=this.visible&&d>0&&s&&!isNaN(s.x)&&!isNaN(s.y);if(Qn(e,h,void 0,a),l?e.setProperties({visible:p,shape:u,size:d,x:s?.x,y:s?.y,scalingCenterX:s?.x,scalingCenterY:s?.y}):e.setProperties({visible:p,shape:u,size:d}),c||(e.fillOpacity*=uN,e.strokeOpacity*=dN),typeof t.shape=="function"&&!e.dirtyPath){e.path.clear(!0),e.updatePath(),e.checkPathDirty();const f=e.getBBox();if(s!==void 0&&f.isFinite()){const y=f.computeCenter(),[x,m]=["x","y"].map(v=>(h.strokeWidth??0)+Math.abs(y[v]-s[v]));s.focusSize=Math.max(f.width+x,f.height+m)}}}get nodeDataDependencies(){return this._nodeDataDependencies??{seriesRectWidth:NaN,seriesRectHeight:NaN}}checkResize(t){const{width:e,height:i}=t??{width:NaN,height:NaN},s=t?{seriesRectWidth:e,seriesRectHeight:i}:void 0,n=ps(this.nodeDataDependencies,s)!=null;return n&&(this._nodeDataDependencies=s,this.markNodeDataDirty()),n}pickFocus(t){}resetDatumCallbackCache(){this.datumCallbackCache.clear()}cachedDatumCallback(t,e){const{datumCallbackCache:i}=this,s=i.get(t);if(s!=null)return s;try{const n=e();return i.set(t,n),n}catch(n){hN.Logger.error(String(n))}}callWithContext(t,...e){return td(this.properties,t,e)}};g([ni({changeValue:function(t,e){this.onSeriesGroupingChange(e,t)}})],Cc.prototype,"seriesGrouping",2);var pN=(w(),k(T)),io=(w(),k(T)),gN=(w(),k(T));function ot(t){const{changeCb:e,convertor:i}=t??{};return G({type:"path",convertor:i,changeCb:e})}var Je=class extends ki{constructor(){super(...arguments),this.path=new Or,this._clipX=NaN,this._clipY=NaN,this.clip=!1,this._dirtyPath=!0,this.lastPixelRatio=NaN}set clipX(t){this._clipX=t,this.dirtyPath=!0}set clipY(t){this._clipY=t,this.dirtyPath=!0}set dirtyPath(t){this._dirtyPath!==t&&(this._dirtyPath=t,t&&this.markDirty("path"))}get dirtyPath(){return this._dirtyPath}checkPathDirty(){this._dirtyPath||(this.dirtyPath=this.path.isDirty()||(this.fillShadow?.isDirty()??!1)||(this._clipPath?.isDirty()??!1))}computeBBox(){return this.updatePathIfDirty(),this.path.computeBBox()}isPointInPath(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)}distanceSquared(t,e){return this.distanceSquaredTransformedPoint(t,e)}svgPathData(t){return this.updatePathIfDirty(),this.path.toSVG(t)}distanceSquaredTransformedPoint(t,e){return this.updatePathIfDirty(),this.path.closedPath&&this.path.isPointInPath(t,e)?0:this.path.distanceSquared(t,e)}isDirtyPath(){return!1}updatePath(){}updatePathIfDirty(){(this.dirtyPath||this.isDirtyPath())&&(this.updatePath(),this.dirtyPath=!1)}preRender(t){return t.devicePixelRatio!==this.lastPixelRatio&&(this.dirtyPath=!0),this.lastPixelRatio=t.devicePixelRatio,this.updatePathIfDirty(),super.preRender(t,this.path.commands.length)}render(t){const{ctx:e}=t;if(this.clip&&!isNaN(this._clipX)&&!isNaN(this._clipY)){e.save();const i=this.strokeWidth/2;this._clipPath??(this._clipPath=new Or),this._clipPath.clear(),this._clipPath.rect(-i,-i,this._clipX+i,this._clipY+i+i),e.clip(this._clipPath?.getPath2D()),this._clipX>0&&this._clipY>0&&this.drawPath(e),e.restore()}else this._clipPath=void 0,this.drawPath(e);this.fillShadow?.markClean(),super.render(t)}drawPath(t){this.fillStroke(t,this.path.getPath2D())}toSVG(){if(!this.visible)return;const t=(0,gN.createSvgElement)("path");t.setAttribute("d",this.svgPathData());const e=this.applySvgFillAttributes(t,[]);return this.applySvgStrokeAttributes(t),{elements:[t],defs:e}}};Je.className="Path",g([ot()],Je.prototype,"clip",2),g([ot()],Je.prototype,"clipX",1),g([ot()],Je.prototype,"clipY",1);var fN=class{constructor(t){this.swapChain=t,this.hasBeenActivated=!1,this.div=(0,io.createElement)("div"),this.svg=(0,io.createSvgElement)("svg"),this.outerPath=(0,io.createSvgElement)("path"),this.innerPath=(0,io.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,io.createElement)("div","ag-charts-focus-indicator"),this.element.ariaHidden="true",this.element.append(this.svg),this.swapChain.addListener("swap",e=>this.onSwap(e))}clear(){}update(t,e,i){if(e!=null)if(t instanceof Je){const s=(r,o)=>{let{x:a,y:l}=Kt.toCanvasPoint(t,r,o);return a-=e.x??0,l-=e.y??0,{x:a,y:l}},n=t.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(t.x-e.x,0),r=Math.max(t.y-e.y,0),o=Math.min(t.x+t.width-e.x,e.width),a=Math.min(t.y+t.height-e.y,e.height);s=new B(n,r,o-n,a-r)}else s=new B(t.x-e.x,t.y-e.y,t.width,t.height);Hl(this.div,s),this.show(this.div)}}onSwap(t){t!==this.element.parentElement&&(this.element.remove(),t.appendChild(this.element),this.overrideFocusVisible(this.focusVisible))}show(t){this.hasBeenActivated=!0,this.element.innerHTML="",this.element.append(t)}overrideFocusVisible(t){this.focusVisible=t;const e={true:"1",false:"0",undefined:""};this.element.parentElement?.style.setProperty("opacity",e[`${t}`])}isFocusVisible(t=!1){if(!t&&!this.hasBeenActivated)return!1;const e=this.element.parentElement;return e!=null&&(0,io.getWindow)().getComputedStyle(e).opacity==="1"}},mN=(w(),k(T)),yN=class{constructor(t,e,i,s){this.label1=t,this.label2=e,this.hasFocus=!1,this.skipDispatch=!1,this.listeners={blur:[],focus:[],swap:[]},this.onBlur=n=>($i(n.target,"pointer-events",void 0),!this.skipDispatch&&this.dispatch("blur",n)),this.onFocus=n=>($i(n.target,"pointer-events","auto"),!this.skipDispatch&&this.dispatch("focus",n)),wt(this.label1,"id",`${i}-label1`),wt(this.label2,"id",`${i}-label2`),$i(this.label1,"display","none"),$i(this.label2,"display","none"),this.activeAnnouncer=this.createAnnouncer(s),this.inactiveAnnouncer=this.createAnnouncer(s),wt(this.activeAnnouncer,"tabindex",0),this.label2.insertAdjacentElement("afterend",this.activeAnnouncer),this.label2.insertAdjacentElement("afterend",this.inactiveAnnouncer),this.swap("")}createAnnouncer(t){const e=(0,mN.createElement)("div");return e.role=t,e.className="ag-charts-swapchain",e.addEventListener("blur",this.onBlur),e.addEventListener("focus",this.onFocus),e}destroy(){for(const t of[this.activeAnnouncer,this.inactiveAnnouncer])t.removeEventListener("blur",this.onBlur),t.removeEventListener("focus",this.onFocus),t.remove()}focus(t){this.focusOptions=t,this.activeAnnouncer.focus(t),this.focusOptions=void 0}update(t){this.skipDispatch=!0,this.swap(t),this.hasFocus&&this.activeAnnouncer.focus(this.focusOptions),this.skipDispatch=!1}addListener(t,e){this.listeners[t].push(e),t==="swap"&&e(this.activeAnnouncer)}dispatch(t,e){t==="focus"?this.hasFocus=!0:t==="blur"&&(this.hasFocus=!1),this.listeners[t].forEach(i=>i(e))}swap(t){const e=this.activeAnnouncer.tabIndex;this.label2.textContent=t,[this.inactiveAnnouncer,this.activeAnnouncer]=[this.activeAnnouncer,this.inactiveAnnouncer],[this.label1,this.label2]=[this.label2,this.label1],Un(this.inactiveAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!0,tabindex:void 0}),Un(this.activeAnnouncer,{"aria-labelledby":this.label1.id,"aria-hidden":!1,tabindex:e}),this.dispatch("swap",this.activeAnnouncer)}},bN=(w(),k(T)),xN={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 vN(t,e){for(const i of e)if("code"in i){if(i.code===t.code)return!0}else if(i.key===t.key&&(i.shift===void 0||i.shift===t.shiftKey)&&(i.ctrlOrMeta===void 0||i.ctrlOrMeta===t.ctrlKey||i.ctrlOrMeta===t.metaKey))return!0;return!1}function MN(t){for(const[e,{activatesFocusIndicator:i=!0,bindings:s}]of(0,bN.entries)(xN))if(vN(t,s))return{name:e,activatesFocusIndicator:i}}function SN(t,e,i){const s=nd(t,i.datum,i.movedBounds);if(s!=null)return{x:s.canvasX,y:s.canvasY};const n=i.bounds;if(n!=null){if(n instanceof B){const{x:r,y:o}=n.computeCenter();return{x:e.x+r,y:e.y+o}}return Kt.toCanvas(n).computeCenter()}}function DN({bounds:t}){return t instanceof B?t:t!=null?Kt.toCanvas(t):B.NaN}function IN(t,e,i){const{x:s,y:n}=SN(t,e,i)??{};if(s!==void 0&&n!==void 0)return{type:"keyboard",canvasX:s,canvasY:n}}var Ud=(w(),k(T)),AN=(w(),k(T));function Yd(){return(t,e)=>{const i=[`Property [${t}] is deprecated.`,e].filter(Boolean).join(" ");AN.Logger.warnOnce(i)}}function Jb(t,e){const i=Yd(),s=e?.default;return Ls((n,r,o)=>(o!==s&&i(r.toString(),t),o))}function LN(t,e){const i=Yd();return Ls((s,n,r)=>(r!==s[t]&&(i(n.toString(),`Use [${t}] instead.`),au(s,t,e?e(r):r)),kl),(s,n)=>(i(n.toString(),`Use [${t}] instead.`),Cr(s,t)))}function t0(t,e,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=t,c=e):l=Math.ceil(t*c/e):c==null&&(c=Math.ceil(e*l/t)),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 e0=.1,i0=200,s0=12,CN=.5,NN=class extends Os{constructor(){super(...arguments),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(t,e){if(Number.isNaN(this.x)||Number.isNaN(this.y)){this.x=t,this.y=e,this.vx=0,this.vy=0,this.emitUpdate(),this.animationFrameHandle!=null&&(cancelAnimationFrame(this.animationFrameHandle),this.animationFrameHandle=void 0);return}this.x1=t,this.y1=e,this.t0=Date.now(),this.animationFrameHandle==null&&(this.animationFrameHandle=requestAnimationFrame(this.onFrame.bind(this)))}onFrame(){this.animationFrameHandle=void 0;const{x1:t,y1:e,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-t,p=l-e,f=-(i0*d+s0*c)/e0,y=-(i0*p+s0*h)/e0;c+=f*r,h+=y*r,a+=c*r,l+=h*r}Math.hypot(a-t,l-e)<CN?(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.dispatch("update",{type:"update",x:this.x,y:this.y})}},TN=(w(),k(T)),Nc=null;function ba(t){return t===""?"":(Nc??(Nc=(0,TN.createElement)("div")),Nc.textContent=String(t),Nc.innerHTML.replace(/\n/g,"<br>"))}function xa(t,e){const{path:i,size:s}=t,{x:n,y:r}=t;i.clear();let o=!1;for(const[a,l]of e){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 kN={circle({path:t,x:e,y:i,size:s}){const n=s/2;t.clear(),t.arc(e,i,n,0,Math.PI*2),t.closePath()},cross(t){xa(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]])},diamond(t){xa(t,[[.5,0],[1,.5],[.5,1],[0,.5]])},heart({path:t,x:e,y:i,size:s}){const n=s/4;i=i+n/2,t.clear(),t.arc(e-n,i-n,n,zt(130),zt(330)),t.arc(e+n,i-n,n,zt(220),zt(50)),t.lineTo(e,i+n),t.closePath()},pin({path:t,x:e,y:i,size:s}){t.moveTo(e+(.15625-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.15625-.5)*s,i+(.151491-.5)*s,e+(.307741-.5)*s,i+(0-.5)*s,e+(.5-.5)*s,i+(0-.5)*s),t.cubicCurveTo(e+(.692259-.5)*s,i+(0-.5)*s,e+(.84375-.5)*s,i+(.151491-.5)*s,e+(.84375-.5)*s,i+(.34375-.5)*s),t.cubicCurveTo(e+(.84375-.5)*s,i+(.493824-.5)*s,e+(.784625-.5)*s,i+(.600181-.5)*s,e+(.716461-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.699009-.5)*s,i+(.719769-.5)*s,e+(.681271-.5)*s,i+(.743104-.5)*s,e+(.663785-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.611893-.5)*s,i+(.834367-.5)*s,e+(.562228-.5)*s,i+(.899699-.5)*s,e+(.528896-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.524075-.5)*s,i+(.992358-.5)*s,e+(.512663-.5)*s,i+(1-.5)*s,e+(.5-.5)*s,i+(1-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.487337-.5)*s,i+(1-.5)*s,e+(.475925-.5)*s,i+(.992358-.5)*s,e+(.471104-.5)*s,i+(.980648-.5)*s),t.cubicCurveTo(e+(.437772-.5)*s,i+(.899699-.5)*s,e+(.388107-.5)*s,i+(.834367-.5)*s,e+(.336215-.5)*s,i+(.766105-.5)*s),t.cubicCurveTo(e+(.318729-.5)*s,i+(.743104-.5)*s,e+(.300991-.5)*s,i+(.719769-.5)*s,e+(.283539-.5)*s,i+(.695393-.5)*s),t.cubicCurveTo(e+(.215375-.5)*s,i+(.600181-.5)*s,e+(.15625-.5)*s,i+(.493824-.5)*s,e+(.15625-.5)*s,i+(.34375-.5)*s),t.closePath()},plus(t){xa(t,[[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:t,x:e,y:i,size:s,pixelRatio:n}){const r=s/2;t.clear(),t.moveTo(fe(n,e-r),fe(n,i-r)),t.lineTo(fe(n,e+r),fe(n,i-r)),t.lineTo(fe(n,e+r),fe(n,i+r)),t.lineTo(fe(n,e-r),fe(n,i+r)),t.closePath()},star({path:t,x:e,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=e+Math.cos(h)*c,d=i+Math.sin(h)*c;t.lineTo(u,d)}t.closePath()},triangle(t){xa(t,[[.5,0],[1,.87],[0,.87]])}},va=class extends Je{constructor(){super(...arguments),this.shape="square",this.x=0,this.y=0,this.size=12}updatePath(){const{path:t,shape:e,x:i,y:s,size:n}=this,r=this.layerManager?.canvas?.pixelRatio??1,o=xe.anchor(e),a={path:t,x:i-(o.x-.5)*n,y:s-(o.y-.5)*n,size:n,pixelRatio:r};t.clear(),typeof e=="string"?kN[e](a):typeof e=="function"&&e(a)}computeBBox(){const{x:t,y:e,size:i}=this,s=xe.anchor(this.shape);return new B(t-i*s.x,e-i*s.y,i,i)}executeFill(t,e){if(e)return super.executeFill(t,e)}executeStroke(t,e){if(e)return super.executeStroke(t,e)}};g([ot()],va.prototype,"shape",2),g([ot()],va.prototype,"x",2),g([ot()],va.prototype,"y",2),g([ot({convertor:Math.abs})],va.prototype,"size",2);var xe=class extends Pr(Du(Gn(va))){static anchor(t){return t==="pin"?{x:.5,y:1}:typeof t=="function"&&"anchor"in t?t.anchor:{x:.5,y:.5}}constructor(t){super(t),t?.shape!=null&&(this.shape=t.shape)}};function n0(t,e,i=e*(5/3)){const s=new it,n=Math.min(t.marker.strokeWidth??1,2),r=Math.min(t.line?.strokeWidth??0,2),o=Math.max(t.marker.enabled===!1?0:e,t.line==null?0:i),a=Math.max(t.marker.enabled===!1?0:e,r);if(t.line!=null){const{stroke:l,strokeOpacity:c,lineDash:h}=t.line,u=new vi;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(t.marker.enabled!==!1){const{shape:l,fill:c,fillOpacity:h,stroke:u,strokeOpacity:d,lineDash:p,lineDashOffset:f}=t.marker,y=new xe;y.shape=l??"square",y.size=e,y.fill=c,y.fillOpacity=h??1,y.stroke=u,y.strokeOpacity=d??1,y.strokeWidth=n,y.lineDash=p,y.lineDashOffset=f??0;const x=xe.anchor(l),m=o/2+(x.x-.5)*e,v=a/2+(x.y-.5)*e,S=e/(e+n);y.x=m,y.y=v,y.scalingCenterX=m,y.scalingCenterY=v,y.scalingX=S,y.scalingY=S,s.append(y)}return it.toSVG(s,o,a)}var Ae="ag-charts-tooltip",r0="ag-charts-tooltip--dark";function o0(t){const e=[],i=new Map;for(const s of t)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),e.push(o)):r.items.push(s)}else e.push(s);return e}function a0(t){const e=o0(t),i=[];return e.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 Wd(t,e,i){let s="";t==null?s+=`<span class="${Ae}-label">${ba(e)}</span>`:(s+=`<span class="${Ae}-label">${ba(t)}</span>`,s+=" ",s+=`<span class="${Ae}-value">${ba(e)}</span>`);const n=[`${Ae}-row`];return i&&n.push(`${Ae}-row--inline`),s=`<div class="${n.join(" ")}">${s}</div>`,s}function wN(t){let e="";const i=t.title==null&&t.data?.length===1,s=t.symbol==null?void 0:n0(t.symbol,12);return s!=null&&(t.title!=null||t.data?.length)&&(e+=`<span class="${Ae}-symbol">${s}</span>`),t.title!=null&&(e+=`<span class="${Ae}-title">${ba(t.title)}</span>`,e+=" "),t.data?.forEach(n=>{e+=Wd(n.label??n.fallbackLabel,n.value,i),e+=" "}),e}function l0(t,e){if(t==null||e.length===1)return;const i=t?.t("tooltipPaginationStatus",{index:e.index+1,count:e.length});return`<div class="${Ae}-footer">${i}</div>`}function c0(t,e,i,s){const n=e.items.length===1?e.items[0]:void 0;let r,o,a;switch(i){case"compact":r=!0,o=n?.title;break;case"single":r=n!=null&&(e.heading==null||n.title==null)&&n.data?.length===1&&n.data[0].label==null&&n.data[0].value!=null,a=e.heading??n?.title;break;case"shared":r=!1}let l="";if(r&&n!=null?(o!=null&&(l+=Wd(void 0,o,!1)),n.data?.forEach(h=>{l+=Wd(h.label??a,h.value,!1),l+=" "})):(e.heading!=null&&(l+=`<span class="${Ae}-heading">${ba(e.heading)}</span>`,l+=" "),e.items.forEach(h=>{l+=wN(h)})),l.length===0)return;const c=i!=="compact"&&s!=null?l0(t,s):void 0;return c+null&&(l+=c),l=`<div class="${Ae}-content">${l.trimEnd()}</div>`,l}function EN(t,e){const i=e==null?void 0:l0(t,e);return i==null?"":`<div class="${Ae}-content">${i}</div>`}function h0(t,e,i,s){const n=o0(e);if(n.length!==0){if(n.length===1&&n[0].type==="structured")return c0(t,n[0],i,s);{const r=n.map(o=>o.type==="structured"?c0(t,o,i):o.rawHtmlString);return s!=null&&r.push(EN(t,s)??""),r.join("")}}}var ON={left:-1,"top-left":-1,"bottom-left":-1,top:0,center:0,bottom:0,right:1,"top-right":1,"bottom-right":1},RN={"top-left":-1,top:-1,"top-right":-1,left:0,center:0,right:0,"bottom-left":1,bottom:1,"bottom-right":1},PN={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},u0={top:2,bottom:2,left:1,right:1,"top-right":3,"top-left":3,"bottom-right":3,"bottom-left":3,center:0},_N=At(["single","shared","compact"]),d0=At(["pointer","node","top","right","bottom","left","top-left","top-right","bottom-right","bottom-left"],"a position type"),jN=At(["pointer","node","chart"],"an anchorTo"),p0=At(["top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"],"a placement"),FN=we(p0,ge(p0)),Bs=class extends nt{constructor(){super(...arguments),this.xOffset=0,this.yOffset=0}get defaultAnchorTo(){const{type:t,_seriesOverrideType:e}=this,i=t??e??"pointer";return i==="node"||i==="pointer"?i:"chart"}get defaultPlacement(){const{type:t,_seriesOverrideType:e}=this,i=t??e??"pointer";return i==="node"||i==="pointer"?"top":i}};g([b(d0,{optional:!0}),Jb("Use `anchorTo` and/or `placement` options instead.")],Bs.prototype,"type",2),g([b(d0,{optional:!0})],Bs.prototype,"_seriesOverrideType",2),g([b(ct)],Bs.prototype,"xOffset",2),g([b(ct)],Bs.prototype,"yOffset",2),g([b(jN,{optional:!0})],Bs.prototype,"anchorTo",2),g([b(FN,{optional:!0})],Bs.prototype,"placement",2);var Ri=class extends nt{constructor(){super(),this.enabled=!0,this.mode="single",this.delay=0,this.range=void 0,this.wrapping="hyphenate",this.position=new Bs,this.pagination=!1,this.darkTheme=!1,this.bounds="extended",this.destroyFns=[],this.springAnimation=new NN,this.enableInteraction=!1,this.wrapTypes=["always","hyphenate","on-space","never"],this.sizeMonitor=new $m,this._elementSize=void 0,this._showTimeout=void 0,this.arrowPosition=void 0,this._visible=!1,this.positionParams=void 0,this.localeManager=void 0,this.destroyFns.push(this.springAnimation.addListener("update",this.updateTooltipPosition.bind(this)))}get interactive(){return this.enableInteraction}setup(t,e){return"togglePopover"in(0,Ud.getWindow)().HTMLElement.prototype&&(this.element=e.addChild("tooltip-container",Ae),this.element.setAttribute("popover","manual"),this.element.className=Ae,this.element.style.positionAnchor=e.anchorName,this.sizeMonitor.observe(this.element,i=>{this._elementSize=i,this.updateTooltipPosition()})),this.localeManager=t,()=>{e.removeChild("tooltip-container",Ae),this.destroyFns.forEach(i=>i()),this.element&&this.sizeMonitor.unobserve(this.element)}}isVisible(){return this._visible}contains(t){return this.element?.contains(t)??!1}updateTooltipPosition(){const{element:t,_elementSize:e,positionParams:i}=this;if(t==null||e==null||i==null)return;const{canvasRect:s,relativeRect:n,meta:r}=i,{x:o,y:a}=this.springAnimation;let l=r.position?.placement??this.position.placement??r.position?.defaultPlacement??this.position.defaultPlacement;Array.isArray(l)||(l=[l]);const c=r.position?.anchorTo??this.position.anchorTo??r.position?.defaultAnchorTo??this.position.defaultAnchorTo,h=r.position?.xOffset??0,u=r.position?.yOffset??0,d=n.x,p=n.y,f=n.width-e.width-1+d,y=n.height-e.height+p;let x=0,m,v,S=!1;do{m=l[x],x+=1;const I=this.getTooltipBounds({elementSize:e,placement:m,anchorTo:c,canvasX:o,canvasY:a,yOffset:u,xOffset:h,canvasRect:s});v=t0(e.width,e.height,n,I),S=!1,u0[m]&1&&(S||(S=v.x<d||v.x>f)),u0[m]&2&&(S||(S=v.y<p||v.y>y))}while(x<l.length&&S);const M=(0,Ud.clamp)(d,v.x,f),D=(0,Ud.clamp)(p,v.y,y);S||(S=M!==v.x||D!==v.y);const C=c!=="chart"&&!S&&!h&&!u,L=r.showArrow??this.showArrow??C;this.arrowPosition=L?PN[m]:void 0,this.updateClassModifiers(),t.style.translate=`${M}px ${D}px`}show(t,e,i,s,n,r=!1){const{element:o}=this;if(o!=null&&s!=null&&s.length!==0){const c=h0(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:t.x-e.x,y:t.y-e.y,width:t.width,height:t.height};switch(this.positionParams={canvasRect:e,relativeRect:a,meta:i},i.position?.anchorTo??this.position.anchorTo??i.position?.defaultAnchorTo??this.position.defaultAnchorTo){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",`${e.top}px`),o.style.setProperty("--left",`${e.left}px`),this.updateClassModifiers(),this.toggle(!0,r)}hide(){this.toggle(!1)}toggle(t,e=!1){const{delay:i}=this;t&&i>0&&!e?this._showTimeout??(this._showTimeout=setTimeout(()=>{this._showTimeout=void 0,this.toggleCallback(!0)},i)):(clearTimeout(this._showTimeout),this._showTimeout=void 0,this.toggleCallback(t))}toggleCallback(t){this.element?.isConnected&&this._visible!==t&&(this._visible=t,this.element.togglePopover(t),t?this.updateTooltipPosition():this.springAnimation.reset())}updateClassModifiers(){if(!this.element?.isConnected)return;const{classList:t}=this.element,e=(i,s)=>t.toggle(`${Ae}--${i}`,s);e("no-interaction",!this.enableInteraction),e("arrow-top",this.arrowPosition===1),e("arrow-right",this.arrowPosition===3),e("arrow-bottom",this.arrowPosition===2),e("arrow-left",this.arrowPosition===0),e("compact",this.mode==="compact"),t.toggle(r0,this.darkTheme);for(const i of this.wrapTypes)t.toggle(`${Ae}--wrap-${i}`,i===this.wrapping)}getTooltipBounds(t){const{elementSize:e,anchorTo:i,placement:s,canvasX:n,canvasY:r,yOffset:o,xOffset:a,canvasRect:l}=t,{width:c,height:h}=e,u={width:c,height:h};if(i==="node"||i==="pointer"){const d=ON[s],p=RN[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}};g([b(H)],Ri.prototype,"enabled",2),g([b(_N)],Ri.prototype,"mode",2),g([b(H,{optional:!0})],Ri.prototype,"showArrow",2),g([b(j)],Ri.prototype,"delay",2),g([b(Vl,{optional:!0})],Ri.prototype,"range",2),g([b(Gl)],Ri.prototype,"wrapping",2),g([b(F)],Ri.prototype,"position",2),g([b(H)],Ri.prototype,"pagination",2),g([b(H)],Ri.prototype,"darkTheme",2),g([b(At(["extended","canvas"]))],Ri.prototype,"bounds",2);function $d(t,e){return t.series===e.series&&cs(t.datumIndex,e.datumIndex)}var zN=class{constructor(){this.candidates=[]}get current(){return this.active}reset(){this.candidates.length=0,this.active=void 0}update(t,e){this.candidates=t;let i=e!=null?t.findIndex(s=>$d(s,e)):-1;return i===-1&&(i=0),this.active=t[i],{current:this.active,index:i,length:t.length}}next(){const{candidates:t,active:e}=this,i=e==null?-1:t.findIndex(n=>$d(n,e));if(i===-1)return;let s=i+1;return s>=t.length&&(s=0),this.active=t[s],{current:this.active,index:s,length:this.candidates.length}}},BN=class extends gn{constructor(t){super(),this.chart=t,this.id=fi(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.hoverScheduler=aI(()=>{if(!(!this.tooltip.lastHover&&!this.highlight.pendingHoverEvent)){if(this.chart.getUpdateType()<=4){this.hoverScheduler.schedule();return}this.highlight.pendingHoverEvent&&this.handleHoverHighlight(!1),this.tooltip.lastHover&&this.handleHoverTooltip(this.tooltip.lastHover,!1)}}),this.tooltipCandidates=new zN;const e=t.ctx.domManager.addChild("series-area","series-area-aria-label1"),i=t.ctx.domManager.addChild("series-area","series-area-aria-label2");this.swapChain=new yN(e,i,this.id,"img"),this.swapChain.addListener("blur",o=>this.onBlur(o)),this.swapChain.addListener("focus",()=>this.onFocus()),t.ctx.domManager.mode==="normal"&&(this.focusIndicator=new fN(this.swapChain),this.focusIndicator.overrideFocusVisible(t.mode==="integrated"?!1:void 0));const{seriesDragInterpreter:s,seriesWidget:n,containerWidget:r}=t.ctx.widgets;n.setTabIndex(-1),this.destroyFns.push(()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label1"),()=>t.ctx.domManager.removeChild("series-area","series-area-aria-label2"),n.addListener("focus",()=>this.swapChain.focus()),n.addListener("mousemove",o=>this.onHover(o)),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)),s.addListener("drag-move",o=>this.onDragMove(o)),s.addListener("click",o=>this.onClick(o,n)),s.addListener("dblclick",o=>this.onClick(o,n)),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)),t.ctx.animationManager.addListener("animation-start",()=>this.clearAll()),t.ctx.domManager.addListener("resize",()=>this.clearAll()),t.ctx.highlightManager.addListener("highlight-change",o=>this.changeHighlightDatum(o)),t.ctx.layoutManager.addListener("layout:complete",o=>this.layoutComplete(o)),t.ctx.updateService.addListener("pre-scene-render",()=>this.preSceneRender()),t.ctx.updateService.addListener("update-complete",()=>this.updateComplete()),t.ctx.zoomManager.addListener("zoom-change",()=>this.clearAll()),t.ctx.zoomManager.addListener("zoom-pan-start",()=>this.clearAll()))}isState(t){return this.chart.ctx.interactionManager.isState(t)}isIgnoredTouch(t){return!(t.device!=="touch"||t.type==="click"||this.chart.ctx.chartService.touch.dragAction==="hover"||this.chart.ctx.chartService.touch.dragAction==="drag"&&this.isState(9))}dataChanged(){var t;(t=this.highlight).stashedHoverEvent??(t.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(t,e){this.chart.ctx.updateService.update(t,e)}seriesChanged(t){this.focus.sortedSeries=[...t].sort((e,i)=>{let s=e.properties.focusPriority??1/0,n=i.properties.focusPriority??1/0;return s===n&&([s,n]=[e._declarationOrder,i._declarationOrder]),s<n?-1:s>n?1:0}),this.series=t}layoutComplete(t){this.seriesRect=t.series.rect,this.hoverRect=t.series.paddedRect,this.chart.ctx.widgets.seriesWidget.setBounds(t.series.paddedRect),this.chart.ctx.domManager.mode==="normal"&&this.chart.ctx.widgets.chartWidget.setBounds(t.chart)}onContextMenu(t,e){const{sourceEvent:i}=t;if(i.currentTarget!=e.getElement())return;if(i.target==this.chart.ctx.widgets.containerWidget.getElement()){if(this.isState(36)){const{currentX:l,currentY:c}=t;this.chart.ctx.contextMenuRegistry.dispatchContext("all",{sourceEvent:i,canvasX:l,canvasY:c},{})}return}let s,n;if(this.focusIndicator?.isFocusVisible())s=this.chart.ctx.highlightManager.getActiveHighlight(),s&&this.seriesRect&&s.midPoint&&(n=Kt.toCanvasPoint(s.series.contentGroup,s.midPoint.x,s.midPoint.y));else if(this.isState(36)){const l=this.pickNodes({x:t.currentX,y:t.currentY},"context-menu");l&&(this.chart.ctx.highlightManager.updateHighlight(this.id),s=l.matches[0].datum)}const r=s?.series;this.clearAll();const o=t.currentX+e.cssLeft(),a=t.currentY+e.cssTop();this.chart.ctx.contextMenuRegistry.dispatchContext("series-area",{sourceEvent:i,canvasX:o,canvasY:a},{pickedSeries:r,pickedNode:s},n)}onLeave(t){!this.isState(41)||t.sourceEvent.relatedTarget?.className==="ag-charts-text-input__textarea"||this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t.sourceEvent)||(this.chart.ctx.domManager.updateCursor(this.id),this.hoverDevice!=="keyboard"&&this.clearAll())}onWheel(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.previousInputDevice="pointer")}onDragMove(t){this.isState(41)&&(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t))}onHover(t){this.isState(41)&&this.onHoverLikeEvent(t)}onHoverLikeEvent(t){if(!this.isIgnoredTouch(t)&&((t.device==="touch"||GN(t,"drag-move"))&&(this.tooltip.lastHover=t),t.device==="touch"&&this.chart.ctx.chartService.touch.dragAction==="hover"&&t.sourceEvent.preventDefault(),this.hoverDevice="pointer",this.previousInputDevice="pointer",this.highlight.pendingHoverEvent=t,this.hoverScheduler.schedule(),this.isState(32))){const{currentX:e,currentY:i}=t,s=this.pickNodes({x:e,y:i},"event")?.matches,n=s?.[0];n?.series.hasEventListener("seriesNodeClick")||n?.series.hasEventListener("seriesNodeDoubleClick")||s!=null&&s.length>1&&this.chart.tooltip.pagination?this.chart.ctx.domManager.updateCursor(this.id,"pointer"):this.chart.ctx.domManager.updateCursor(this.id)}}onClick(t,e){if(t.device==="touch"&&e===this.chart.ctx.widgets.seriesWidget&&this.swapChain.focus({preventScroll:!0}),!this.isState(41))return;if(e===this.chart.ctx.widgets.seriesWidget){if(!e.getElement().contains(t.sourceEvent.target))return}else if(t.sourceEvent.target!=e.getElement())return;if(this.focusIndicator?.overrideFocusVisible(!1),this.onHoverLikeEvent(t),!this.isState(32))return;if(e==this.chart.ctx.widgets.seriesWidget&&this.checkSeriesNodeClick(t)){this.update(4),t.sourceEvent.preventDefault();return}const i={type:t.type==="click"?"click":"doubleClick",event:t.sourceEvent};this.chart.fireEvent(i)}onFocus(){this.isState(34)&&(this.hoverDevice=this.focusIndicator?.isFocusVisible(!0)?"keyboard":"pointer",this.handleFocus(0,0))}onBlur(t){this.isState(34)&&(this.hoverDevice="pointer",this.chart.ctx.tooltipManager.isEnteringInteractiveTooltip(t)||this.clearAll(),this.focusIndicator?.overrideFocusVisible(void 0))}onKeyDown(t){if(!this.isState(43))return;const e=MN(t.sourceEvent);switch(e?.activatesFocusIndicator===!1&&this.focusIndicator?.overrideFocusVisible(this.previousInputDevice==="keyboard"),e?.name){case"redo":return this.chart.ctx.chartEventManager.seriesEvent("series-redo");case"undo":return this.chart.ctx.chartEventManager.seriesEvent("series-undo");case"zoomin":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(1,t);case"zoomout":return this.chart.ctx.chartEventManager.seriesKeyNavZoom(-1,t);case"arrowup":return this.onArrow(-1,0,t);case"arrowdown":return this.onArrow(1,0,t);case"arrowleft":return this.onArrow(0,-1,t);case"arrowright":return this.onArrow(0,1,t);case"submit":return this.onSubmit(t)}}onArrow(t,e,i){this.isState(34)&&(this.hoverDevice="keyboard",this.previousInputDevice="keyboard",this.focusIndicator?.overrideFocusVisible(!0),this.focus.seriesIndex+=t,this.focus.datumIndex+=e,this.handleFocus(t,e),i.sourceEvent.preventDefault(),this.chart.ctx.chartEventManager.seriesEvent("series-focus-change"))}onSubmit(t){if(!this.isState(34))return;const{series:e,datum:i}=this.focus,s=t.sourceEvent;e!==void 0&&i!==void 0?e.fireNodeClickEvent(s,i):this.chart.fireEvent({type:"click",event:s}),s.preventDefault()}checkSeriesNodeClick(t){var e;const i=this.pickNodes({x:t.currentX,y:t.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(t.type==="click"){const l=n.fireNodeClickEvent(t.sourceEvent,r)&&this.chart.tooltip.pagination?this.tooltipCandidates.next():void 0;if(l!=null){t.sourceEvent.preventDefault();const{currentX:c,currentY:h}=t,u=c+(this.hoverRect?.x??0),d=h+(this.hoverRect?.y??0);(e=this.highlight).pendingHoverEvent??(e.pendingHoverEvent=this.highlight.appliedHoverEvent),this.handleHoverHighlight(!1),this.showTooltip(l.current,u,d,{index:l.index,length:l.length})}return!0}return t.type==="dblclick"?(t.preventZoomDblClick=o===0,n.fireNodeDoubleClickEvent(t.sourceEvent,r),!0):!1}handleFocus(t,e){const i=this.chart.overlays.getFocusInfo(this.chart.ctx.localeManager);i==null?this.handleSeriesFocus(t,e):this.focusIndicator?.update(i.rect,this.seriesRect,!1)}handleSeriesFocus(t,e,i=!1){if(this.chart.chartType==="hierarchy"||this.chart.chartType==="gauge"){this.handleSoloSeriesFocus(t,e,i);return}const{focus:s}=this,n=s.sortedSeries.filter(c=>c.visible&&c.focusable);if(n.length===0)return;const r=s.datumIndex-e,o=s.seriesIndex-t;s.seriesIndex=(0,pN.clamp)(0,s.seriesIndex,n.length-1),s.series=n[s.seriesIndex];const a=this.focus.datumIndex,l=this.focus.seriesIndex;this.updatePickedFocus(a,e,r,l,t,o,i)}handleSoloSeriesFocus(t,e,i){this.focus.series=this.focus.sortedSeries[0];const s=this.focus.datumIndex,n=this.focus.seriesIndex,r=this.focus.datumIndex-e,o=this.focus.seriesIndex-t;this.updatePickedFocus(s,e,r,n,t,o,i)}updatePickedFocus(t,e,i,s,n,r,o){const{focus:a,hoverRect:l,seriesRect:c}=this;if(a.series===void 0||l===void 0)return;const h=a?.series?.pickFocus({datumIndex:t,datumIndexDelta:e,otherIndex:s,otherIndexDelta:n,seriesRect:c});if(!h)return;const{datum:u}=h;if(h.otherIndex!==void 0&&(a.seriesIndex=h.otherIndex),a.datumIndex=h.datumIndex,a.datum=u,this.focusIndicator?.isFocusVisible()&&this.chart.ctx.animationManager.reset(),this.focusIndicator?.isFocusVisible()){const p=DN(h),{x:f,y}=p.computeCenter();if(!l.containsPoint(f,y)&&this.chart.ctx.zoomManager.panToBBox(this.id,l,p))return;const{x1:x,x2:m,y1:v,y2:S}=ua.from(p),M=l.containsPoint(x,v),D=l.containsPoint(m,v),C=l.containsPoint(x,S),L=l.containsPoint(m,S);if(!(M||D||C||L)){const I=ua.from(l);h.movedBounds=p.clone(),x<I.x1&&m<I.x1?(h.movedBounds.x=I.x1-2,h.movedBounds.width=4):x>I.x2&&m>I.x2&&(h.movedBounds.x=I.x2-2,h.movedBounds.width=4),v<I.y1&&S<I.y1?(h.movedBounds.y=I.y1-2,h.movedBounds.height=4):v>I.y2&&S>I.y2&&(h.movedBounds.y=I.y2-2,h.movedBounds.height=4)}}this.focusIndicator?.update(h.movedBounds??h.bounds,this.seriesRect,h.clipFocusBox);const d=IN(a.series,l,h);if(d!==void 0&&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.chart.getTooltipContent(a.series,u.datumIndex,u),f=uc.makeTooltipMeta(d,a.series,u,h.movedBounds);this.chart.ctx.highlightManager.updateHighlight(this.id,u),a.series.tooltipEnabled??this.chart.tooltip.enabled?this.chart.ctx.tooltipManager.updateTooltip(this.id,f,p):this.chart.ctx.tooltipManager.removeTooltip(this.id),o||(e===0&&n===0||i!==h.datumIndex||r!==(h.otherIndex??a.seriesIndex))&&this.swapChain.update(this.getDatumAriaText(u,p))}}getDatumAriaText(t,e){const i=e==null?"":a0(e);return this.chart.ctx.localeManager.t("ariaAnnounceHoverDatum",{datum:t.series.getDatumAriaText?.(t,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(t){this.highlight.appliedHoverEvent=this.highlight.pendingHoverEvent,this.highlight.pendingHoverEvent=void 0;const e=this.highlight.appliedHoverEvent;if(!e||!this.isState(41))return;const{currentX:i,currentY:s}=e,n=e.currentX+(this.hoverRect?.x??0),r=e.currentY+(this.hoverRect?.y??0);if(t?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=>$d(d,c)))?.datum??l.matches[0].datum;this.chart.ctx.highlightManager.updateHighlight(this.id,u),this.hoverDevice="pointer"}handleHoverTooltip(t,e){const{current:i}=this.tooltipCandidates;if(this.tooltipCandidates.reset(),!this.isState(41))return;const{currentX:s,currentY:n}=t,r=s+(this.hoverRect?.x??0),o=n+(this.hoverRect?.y??0),a=t.sourceEvent.target;if(e?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",Ae))return;const l=this.pickNodes({x:t.currentX,y:t.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:t,datum:e,datumIndex:i},s,n,r){const o=this.chart.getTooltipContent(t,i,e);if((t.tooltipEnabled??this.chart.tooltip.enabled)&&o!=null){const c=uc.makeTooltipMeta({type:"pointermove",canvasX:s,canvasY:n},t,e,void 0);this.chart.ctx.tooltipManager.updateTooltip(this.id,c,o,r)}else this.chart.ctx.tooltipManager.removeTooltip(this.id)}changeHighlightDatum(t){const e=new Set,{series:i=void 0,datum:s}=t.currentHighlight??{},{series:n=void 0,datum:r}=t.previousHighlight??{};n&&e.add(n),i&&e.add(i),n?.properties.cursor&&r&&this.chart.ctx.domManager.updateCursor(n.id),i?.properties.cursor&&i?.properties.cursor!=="default"&&s&&this.chart.ctx.domManager.updateCursor(i.id,i.properties.cursor),i==null||n==null?this.update(4):this.update(4,{seriesToUpdate:e})}pickNodes(t,e,i){const s=[...this.series].reverse();let n;for(const r of s){if(!r.visible||!r.contentGroup.visible)continue;const o=r.pickNodes(t,e,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}};function GN(t,e){return t.type!==e}var VN=(w(),k(T)),g0=30,UN=class{constructor(t){this.seriesRoot=t,this.groups=new Map,this.series=new Map,this.expectedSeriesCount=1,this.mode="normal"}setSeriesCount(t){this.expectedSeriesCount=t}requestGroup(t){const{internalId:e,type:i,contentGroup:s,seriesGrouping:n}=t,{groupIndex:r=e}=n??{},o=this.series.get(e);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>=g0?"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 it({name:`${t.contentGroup.name??i}-managed-layer`,zIndex:t.contentGroup.zIndex,renderToOffscreenCanvas:!1}))},a.set(l,c)),this.series.set(e,{layerState:c,seriesConfig:t}),c.seriesIds.push(e),c.group.appendChild(s),c.group}changeGroup(t){const{internalId:e,seriesGrouping:i,type:s,contentGroup:n,oldGrouping:r}=t,{groupIndex:o=e}=i??{};this.groups.get(s)?.get(o)?.seriesIds.includes(e)||(this.series.has(e)&&this.releaseGroup({internalId:e,seriesGrouping:r,type:s,contentGroup:n}),this.requestGroup(t))}releaseGroup(t){const{internalId:e,contentGroup:i,type:s}=t;if(!this.series.has(e))throw new Error(`AG Charts - series doesn't have an allocated layer: ${e}`);const n=this.series.get(e)?.layerState;n&&(n.seriesIds=n.seriesIds.filter(r=>r!==e),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(e)):n!=null&&n.seriesIds.length>0&&(n.group.zIndex=this.getLowestSeriesZIndex(n.seriesIds)),this.series.delete(e)}updateLayerCompositing(){this.groups.forEach(t=>{t.forEach(e=>{const{group:i,seriesIds:s}=e;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(t){return this.mode==="normal"?t:typeof t=="string"&&(t=Number(t.split("-").at(-1)),!t)?0:Math.floor((0,VN.clamp)(0,t/this.expectedSeriesCount,1)*g0)}destroy(){this.groups.forEach(t=>{t.forEach(e=>{this.seriesRoot.removeChild(e.group)})}),this.groups.clear(),this.series.clear()}getLowestSeriesZIndex(t){return t.reduce((i,s)=>{const r=this.series.get(s)?.seriesConfig.contentGroup.zIndex;return i==null||r==null?r:ym(i,r)<=0?i:r},void 0)??1}},f0=class extends nt{constructor(){super(...arguments),this.dragAction="drag"}};g([b(At(["none","drag","hover"]))],f0.prototype,"dragAction",2);var YN=class{constructor(t,e,i,s,n){this.chart=t,this.dataService=e,this.updateService=i,this.zoomManager=s,this.animationManager=n,this.dirtyZoom=!1,this.dirtyDataSource=!1,this.lastAxisZooms=new Map,this.destroyFns=[],this.destroyFns.push(this.dataService.addListener("data-source-change",()=>this.onDataSourceChange()),this.dataService.addListener("data-load",()=>this.onDataLoad()),this.dataService.addListener("data-error",()=>this.onDataError()),this.updateService.addListener("update-complete",()=>this.onUpdateComplete()),this.zoomManager.addListener("zoom-change",()=>this.onZoomChange()))}destroy(){this.destroyFns.forEach(t=>t())}onDataLoad(){this.animationManager.skip(),this.updateService.update(1)}onDataError(){this.updateService.update(3)}onDataSourceChange(){this.dirtyDataSource=!0}onUpdateComplete(){!this.dirtyZoom&&!this.dirtyDataSource||this.updateWindow()}onZoomChange(){this.dirtyZoom=!0}updateWindow(){if(!this.dataService.isLazy())return;const t=this.getValidAxis();let e,i=!0;if(t){const s=this.zoomManager.getAxisZoom(t.id);e=this.getAxisWindow(t,s),i=this.shouldRefresh(t,s)}this.dirtyZoom=!1,this.dirtyDataSource=!1,i&&this.dataService.load({windowStart:e?.min,windowEnd:e?.max})}getValidAxis(){return this.chart.axes.find(t=>t.type==="time")}shouldRefresh(t,e){if(this.dirtyDataSource)return!0;if(!this.dirtyZoom)return!1;const i=this.lastAxisZooms.get(t.id);return i&&e.min===i.min&&e.max===i.max?!1:(this.lastAxisZooms.set(t.id,e),!0)}getAxisWindow(t,e){const{domain:i}=t.scale;if(!e||i.length===0||isNaN(Number(i[0])))return;const s=Number(i[1])-Number(i[0]),n=new Date(Number(i[0])+s*e.min),r=new Date(Number(i[0])+s*e.max);return{min:n,max:r}}},Hd=(w(),k(T)),WN=/^((?!chrome|android).)*safari/i,$N=/Version\/(\d+(\.\d+)?)/,HN=/Chrome/,KN=/Chrome\/(\d+)/,ZN=/Edg/,XN=/OPR/;function qN(){const{userAgent:t}=(0,Hd.getWindow)("navigator");if(WN.test(t)){const e=$N.exec(t);if(e==null)return!1;const i=parseFloat(e[1]),s=Math.floor(i)>16;return s||Hd.Logger.warnOnce(`Unsupported Safari version: ${i}; ${t}`),!s}else if(HN.test(t)&&!ZN.test(t)&&!XN.test(t)){const e=KN.exec(t);if(e==null)return!1;const i=parseInt(e[1],10),s=i>126;return s||Hd.Logger.warnOnce(`Unsupported Chrome version: ${i}; ${t}`),!s}return!1}var QN=new Set(["map-shape-background","map-line-background"]),JN=class{constructor(t,e,i,s,n,r,o){this.chartLike=t,this.overlays=e,this.dataService=i,this.layoutManager=s,this.localeManager=n,this.animationManager=r,this.domManager=o,this.destroyFns=[],this.overlayElem=this.domManager.addChild("canvas-overlay","overlay"),this.overlayElem.role="status",this.overlayElem.ariaAtomic="false",this.overlayElem.ariaLive="polite",this.overlayElem.classList.toggle(Gd),this.destroyFns.push(this.layoutManager.addListener("layout:complete",a=>this.onLayoutComplete(a)))}destroy(){this.destroyFns.forEach(t=>t()),this.domManager.removeChild("canvas-overlay","overlay")}onLayoutComplete({series:{rect:t}}){const e=this.dataService.isLoading(),i=this.chartLike.series.some(c=>c.hasData),s=this.chartLike.series.some(c=>c.visible&&!QN.has(c.type));this.overlays.darkTheme?this.overlayElem.classList.add(Zb):this.overlayElem.classList.remove(Zb),this.overlayElem.style.left=`${t.x}px`,this.overlayElem.style.top=`${t.y}px`,this.overlayElem.style.width=`${t.width}px`,this.overlayElem.style.height=`${t.height}px`;const n=e,r=!e&&!i,o=i&&!s,a=this.overlays.unsupportedBrowser.enabled&&qN();n?this.showOverlay(this.overlays.loading,t):this.hideOverlay(this.overlays.loading),r?this.showOverlay(this.overlays.noData,t):this.hideOverlay(this.overlays.noData),o?this.showOverlay(this.overlays.noVisibleSeries,t):this.hideOverlay(this.overlays.noVisibleSeries),a?this.showOverlay(this.overlays.unsupportedBrowser,t):this.hideOverlay(this.overlays.unsupportedBrowser);const l=n||r||o||a;wt(this.overlayElem,"aria-hidden",!l)}showOverlay(t,e){if(!t.enabled)return;const i=t.getElement(this.animationManager,this.localeManager,e);this.overlayElem.appendChild(i)}hideOverlay(t){t.removeElement(()=>{this.overlayElem.innerText="\xA0"},this.animationManager)}},qi=vt.create(!0,"opts"),Kd=class extends nt{constructor(){super(...arguments),this.padding=new dn(0)}};g([b(H,{optional:!0})],Kd.prototype,"clip",2),g([b(F)],Kd.prototype,"padding",2);var oe=class $v extends Nm{constructor(e,i){var s;super(),this.id=fi(this),this.seriesRoot=new Xe({name:`${this.id}-series-root`,zIndex:5}),this.annotationRoot=new Xe({name:`${this.id}-annotation-root`,zIndex:9}),this.titleGroup=new it({name:"titles",zIndex:13}),this.debug=vt.create(),this.extraDebugStats={},this.data=[],this._firstAutoSize=!0,this._autoSizeNotify=new bm,this.padding=new dn(20),this.seriesArea=new Kd,this.keyboard=new Md,this.touch=new f0,this.mode="standalone",this.chartCaptions=new tc,this.suppressFieldDotNotation=!1,this.destroyed=!1,this._destroyFns=[],this.skipSync=!1,this.chartAnimationPhase="initial",this.modulesManager=new lN,this.processors=[],this.queuedUserOptions=[],this.queuedChartOptions=[],this.firstApply=!0,this._pendingFactoryUpdatesCount=0,this._performUpdateSkipAnimations=!1,this._performUpdateNotify=new bm,this.performUpdateType=7,this.runningUpdateType=7,this.updateShortcutCount=0,this.seriesToUpdate=new Set,this.updateMutex=new sI,this.updateRequestors={},this.performUpdateTrigger=lI(({count:h})=>{this.destroyed||this.updateMutex.acquire(async()=>{try{await this.performUpdate(h)}catch(u){gi.Logger.error("update error",u)}}).catch(u=>gi.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 Vd))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=e;const n=i?.scene,r=i?.container??e.processedOptions.container??void 0,o=i?.styleContainer??e.specialOverrides.styleContainer;n&&(this._firstAutoSize=!1,this._lastAutoSize=[n.width,n.height,n.pixelRatio]);const a=new it({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 Ri,this.seriesLayerManager=new UN(this.seriesRoot),this.mode=e.userOptions.mode??this.mode;const l=this.ctx=new nC(this,{chartType:this.getChartType(),scene:n,root:a,container:r,styleContainer:o,domMode:e.optionMetadata.domMode,syncManager:new kC(this),fireEvent:h=>this.fireEvent(h),updateCallback:(h,u)=>this.update(h,u),updateMutex:this.updateMutex});this._destroyFns.push(l.domManager.addListener("resize",()=>this.parentResize(l.domManager.containerSize))),this.overlays=new eo,(s=this.overlays.loading).renderer??(s.renderer=()=>cN(this.overlays.loading.getText(l.localeManager),l.animationManager.defaultDuration)),this.processors=[new YN(this,l.dataService,l.updateService,l.zoomManager,l.animationManager),new JN(this,this.overlays,l.dataService,l.layoutManager,l.localeManager,l.animationManager,l.domManager)],this.highlight=new lb,this.container=r;const c=this.getModuleContext();l.domManager.setDataBoolean("animating",!1),this.seriesAreaManager=new BN(this.initSeriesAreaDependencies()),this._destroyFns.push(l.layoutManager.registerElement(0,h=>{h.layoutBox.shrink(this.padding.toJson()),this.chartCaptions.positionCaptions(h)}),l.layoutManager.addListener("layout:complete",h=>this.chartCaptions.positionAbsoluteCaptions(h)),l.dataService.addListener("data-load",h=>{this.data=h.data}),this.title.registerInteraction(c,"beforebegin"),this.subtitle.registerInteraction(c,"beforebegin"),this.footnote.registerInteraction(c,"afterend"),gs.addWindowEvent("page-left",()=>this.destroy()),l.animationManager.addListener("animation-frame",()=>{this.update(6)}),l.animationManager.addListener("animation-start",()=>l.domManager.setDataBoolean("animating",!0)),l.animationManager.addListener("animation-stop",()=>l.domManager.setDataBoolean("animating",!1)),l.zoomManager.addListener("zoom-change",()=>{this.series.forEach(u=>u.animationState?.transition("updateData"));const h=this.chartAnimationPhase!=="initial";this.update(3,{forceNodeDataRefresh:!0,skipAnimations:h})})),this.parentResize(l.domManager.containerSize)}static getInstance(e){return $v.chartsInstances.get(e)}get canvasElement(){return this.ctx.scene.canvas.element}download(e,i){this.ctx.scene.download(e,i)}getCanvasDataURL(e){return this.ctx.scene.getDataURL(e)}toSVG(){return this.ctx.scene.toSVG()}getOptions(){return this.queuedUserOptions.at(-1)??this.chartOptions.userOptions}getChartOptions(){return this.queuedChartOptions.at(-1)??this.chartOptions}overrideFocusVisible(e){this.seriesAreaManager.focusIndicator?.overrideFocusVisible(e)}initSeriesAreaDependencies(){const{ctx:e,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:e,tooltip:i,highlight:s,overlays:n,seriesRoot:r,mode:o}}getModuleContext(){return this.ctx}getTooltipContent(e,i,s){const n=e.properties.tooltip.enabled!==!1?e.getTooltipContent(i,s):void 0,r=n==null?[]:[n];if(this.tooltip.mode!=="shared"||this.series.length===1)return r;const o=e.getCategoryValue(i);return o==null?r:this.series.flatMap(a=>{if(a===e)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(e=>e.enabled&&e.text).map(e=>e.text).join(". ")}getAriaLabel(){return this.ctx.localeManager.t("ariaAnnounceChart",{seriesCount:this.series.length})}resetAnimations(){this.chartAnimationPhase="initial";for(const e of this.series)e.resetAnimation(this.chartAnimationPhase);for(const e of this.axes)e.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.clear()}destroy(e){if(this.destroyed)return;const i=e?.keepTransferableResources;let s;return this.performUpdateType=7,this._destroyFns.forEach(n=>n()),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(e){this.destroyed||(this._pendingFactoryUpdatesCount++,this.updateMutex.acquire(async()=>{if(!this.destroyed)try{await e(this)}finally{this.destroyed||this._pendingFactoryUpdatesCount--}}).catch(i=>gi.Logger.errorOnce(i)))}clearCallbackCache(){this.ctx.callbackCache.invalidateCache();for(const e of this.series)e.resetDatumCallbackCache()}update(e=0,i){if(this.destroyed)return;const{forceNodeDataRefresh:s=!1,skipAnimations:n,seriesToUpdate:r=this.series,newAnimationBatch:o}=i??{};this.ctx.widgets.seriesWidget.setDragTouchEnabled(this.touch.dragAction!=="none"),s&&this.series.forEach(a=>a.markNodeDataDirty());for(const a of r)this.seriesToUpdate.add(a);if(n&&(this.ctx.animationManager.skipCurrentBatch(),this._performUpdateSkipAnimations=!0),o&&this.ctx.animationManager.isActive()&&(this._performUpdateSkipAnimations=!0),this.skipSync=i?.skipSync??!1,this.debug.check()){let a=new Error().stack??"<unknown>";a=a.replace(/\([^)]*/g,""),this.updateRequestors[a]=e}e<this.performUpdateType&&(this.performUpdateType=e,this.ctx.domManager.setDataBoolean("updatePending",!0),this.performUpdateTrigger.schedule(i?.backOffMs))}async performUpdate(e){const{performUpdateType:i,extraDebugStats:s,_performUpdateSplits:n,ctx:r}=this,o=[...this.seriesToUpdate];this.clearCallbackCache(),this.performUpdateType=7,this.seriesToUpdate.clear(),this.runningUpdateType=i,this.updateShortcutCount===0&&i<6&&(r.animationManager.startBatch(this._performUpdateSkipAnimations),r.animationManager.onBatchStop(()=>this.chartAnimationPhase="ready")),this.ctx.scene.updateDebugFlags(),this.debug("Chart.performUpdate() - start",da[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(await this.checkFirstAutoSize(),this.checkUpdateShortcut(3))break;await this.processLayout(),l("\u2316");case 4:{if(this.checkUpdateShortcut(4))break;await this.updateSeries(o),l("\u{1F914}"),this.updateAriaLabels(),this.seriesLayerManager.updateLayerCompositing()}case 5:if(this.checkUpdateShortcut(5))break;r.updateService.dispatchPreSceneRender(),l("\u2196");case 6:if(this.checkUpdateShortcut(6))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 7:this.updateShortcutCount=0,this.updateRequestors={},this._performUpdateSkipAnimations=!1,r.animationManager.endBatch()}this.destroyed||(r.updateService.dispatchUpdateComplete(),this.ctx.domManager.setDataBoolean("updatePending",!1),this.runningUpdateType=7),this._performUpdateNotify.notify();const c=performance.now();this.debug("Chart.performUpdate() - end",{chart:this,durationMs:Math.round((c-n.start)*100)/100,count:e,performUpdateType:da[i]})}updateThemeClassName(){const e="ag-charts-theme-",i=[`${e}default`,`${e}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-",e),n=r.includes("-dark")),i.includes(s)||(s=n?i[1]:i[0]),this.ctx.domManager.setThemeClass(s)}updateDOM(){this.updateThemeClassName();const{enabled:e,tabIndex:i}=this.keyboard;this.ctx.domManager.setTabGuardIndex(e?i??0:-1),this.ctx.domManager.setThemeParameters(this.chartOptions.themeParameters)}updateAriaLabels(){this.ctx.domManager.updateCanvasLabel(this.getAriaLabel())}checkUpdateShortcut(e){return this.destroyed?!0:this.updateShortcutCount>3?(gi.Logger.warn("exceeded the maximum number of simultaneous updates (4), discarding changes and rendering",this.updateRequestors),!1):this.performUpdateType<=e?(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(e,i){i==null&&e.length===0||this.ctx.axisManager.updateAxes(i??[],e)}onSeriesChange(e,i){const s=i?.filter(n=>!e.includes(n))??[];this.destroySeries(s),this.seriesLayerManager?.setSeriesCount(e.length);for(const n of e){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(e)}destroySeries(e){e?.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(e){this.hasEventListener("seriesNodeClick")&&e.addEventListener("seriesNodeClick",this.onSeriesNodeClick),this.hasEventListener("seriesNodeDoubleClick")&&e.addEventListener("seriesNodeDoubleClick",this.onSeriesNodeDoubleClick),this.hasEventListener("seriesVisibilityChange")&&e.addEventListener("seriesVisibilityChange",this.onSeriesVisibilityChange),e.addEventListener("groupingChanged",this.seriesGroupingChanged)}assignSeriesToAxes(){for(const e of this.axes)e.boundSeries=this.series.filter(i=>i.axes[e.direction]===e)}assignAxesToSeries(){const e=(0,gi.groupBy)(this.axes,i=>i.direction);for(const i of this.series)for(const s of i.directions){const n=e[s];if(!n){gi.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){gi.Logger.warnOnce(`no matching axis for direction [${s}] and keys [${r}]; check series and axes configuration.`);return}i.axes[s]=o}}parentResize(e){if(e==null||this.width!=null&&this.height!=null)return;let{width:i,height:s}=e;const{pixelRatio:n}=e;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(e,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 ${e}`,{width:h,height:u,pixelRatio:d,stack:new Error().stack}),!(h==null||u==null||!(0,gi.isFiniteNumber)(h)||!(0,gi.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(3,{forceNodeDataRefresh:!0,skipAnimations:p}),this._autoSizeNotify.notify()}}async updateData(){this.series.forEach(i=>i.setChartData(this.data));const e=this.modulesManager.mapModules(i=>i.updateData?.(this.data));await Promise.all(e)}async processData(){this.series.some(n=>n.canHaveAxes)&&(this.assignAxesToSeries(),this.assignSeriesToAxes());const e=new mb(this.mode,this.suppressFieldDotNotation),i=this.series.map(n=>n.processData(e)),s=this.modulesManager.mapModules(n=>n.processData?.(e));this._cachedData=e.execute(this._cachedData),await Promise.all([...i,...s]);for(const n of this.axes)n.processData();this.updateLegends()}updateLegends(e){for(const{legend:i,legendType:s}of this.modulesManager.legends())s==="category"?this.setCategoryLegendData(e):this.setLegendData(s,i)}setCategoryLegendData(e){var i;const{ctx:{legendManager:s,stateManager:n}}=this;e&&this.series.forEach(o=>{const a=e.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(e){n.setStateAndRestore(s,e);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&&gi.Logger.warnOnce(`legend item '${h.text}' has multiple fill colors, this may cause unexpected behaviour.`)}}s.update()}setLegendData(e,i){i.data=this.series.filter(s=>s.properties.showInLegend).flatMap(s=>s.getLegendData(e))}async processLayout(){const e=this.animationRect,{width:i,height:s}=this.ctx.scene,n=this.ctx.layoutManager.createContext(i,s);await this.performLayout(n),e&&!this.animationRect?.equals(e)&&this.ctx.animationManager.skipCurrentBatch(),this.debug("Chart.performUpdate() - seriesRect",this.seriesRect)}async updateSeries(e){const{seriesRect:i}=this;await Promise.all(e.map(s=>s.update({seriesRect:i}))),this.ctx.seriesLabelLayoutManager.updateLabels(this.series.filter(s=>s.visible&&s.usesPlacedLabels),this.padding,this.seriesRect)}async waitForUpdate(e=1e4,i=!1){const s=performance.now();for(;(this._pendingFactoryUpdatesCount>0||this.performUpdateType!==7||this.runningUpdateType!==7)&&!this.destroyed;){if(this._pendingFactoryUpdatesCount>0&&await this.updateMutex.waitForClearAcquireQueue(),(this.performUpdateType!==7||this.runningUpdateType!==7)&&await this._performUpdateNotify.await(),performance.now()-s>e){const n=`Chart.waitForUpdate() timeout of ${e} reached - first chart update taking too long.`;if(i)throw new Error(n);gi.Logger.warnOnce(n)}vm()&&await TD()}}filterMiniChartSeries(e){return e?.filter(i=>i.showInMiniChart!==!1)}applyOptions(e){const i=this.firstApply?e.processedOptions:e.diffOptions(this.chartOptions);if(i==null||Object.keys(i).length===0)return;const s=this.firstApply?{}:this.chartOptions.processedOptions,n=e.processedOptions;qi("Chart.applyOptions() - applying delta",i);const r=this.applyModules(n),o=["type","data","series","listeners","preset","theme","legend.listeners","navigator.miniChart.series","navigator.miniChart.label","locale.localeText","axes","topology","nodes","initialState","styleContainer"];i.listeners&&this.registerListeners(this,i.listeners),Qo(this,i,{skip:o});let a=!1,l="no-op";i.series!=null&&(l=this.applySeries(this,i.series,s?.series),a=!0),l==="replaced"&&this.resetAnimations(),this.applyAxes(this,n,s,l,[])&&(a=!0),i.data&&(this.data=i.data),i.legend?.listeners&&this.modulesManager.isEnabled("legend")&&Object.assign(this.legend.listeners,i.legend.listeners),i.locale?.localeText&&(this.modulesManager.getModule("locale").localeText=i.locale?.localeText),this.chartOptions=e;const c=this.modulesManager.getModule("navigator"),h=this.modulesManager.getModule("zoom");!c?.enabled&&!h?.enabled&&this.ctx.zoomManager.updateZoom("chart");const u=c?.miniChart,d=n.navigator?.miniChart?.series??n.series;u?.enabled===!0&&d!=null?this.applyMiniChartOptions(u,d,n,s):u?.enabled===!1&&(u.series=[],u.axes=[]),this.ctx.annotationManager.setAnnotationStyles(e.annotationThemes),a||(a=this.shouldForceNodeDataRefresh(i,l));const f=a||r?0:3;this.maybeResetAnimations(l),this.shouldClearLegendData(n,s,l)&&this.ctx.legendManager.clearData(),this.applyInitialState(n),qi("Chart.applyOptions() - update type",da[f],{seriesStatus:l,forceNodeDataRefresh:a}),this.update(f,{forceNodeDataRefresh:a,newAnimationBatch:!0}),this.firstApply=!1}applyInitialState(e){const{annotationManager:i,chartTypeOriginator:s,historyManager:n,stateManager:r,zoomManager:o}=this.ctx,{initialState:a}=e;if("annotations"in e&&e.annotations?.enabled&&a?.annotations!=null){const l=a.annotations.map(c=>{const h=i.getAnnotationTypeStyles(c.type);return gt(c,h)});r.setState(i,l)}a?.chartType!=null&&r.setState(s,a.chartType),(e.navigator?.enabled||e.zoom?.enabled)&&a?.zoom!=null&&r.setState(o,a.zoom),a?.legend!=null&&this.updateLegends(a.legend),a!=null&&n.clear()}maybeResetAnimations(e){if(this.mode==="standalone")switch(e){case"series-grouping-change":case"replaced":this.resetAnimations();break;default:}}shouldForceNodeDataRefresh(e,i){const s=!!e.data||i==="data-change"||i==="replaced",n=bd.getKeys(),r=Object.values(n).some(a=>e[a]!=null),o=e.title!=null&&e.subtitle!=null;return s||r||o}shouldClearLegendData(e,i,s){const n=s==="replaced"||s==="series-grouping-change"||s==="updated",r=i.legend!=null&&e.legend==null;return n||r}applyMiniChartOptions(e,i,s,n){const r=n?.navigator?.miniChart?.series??n?.series,o=this.applySeries(e,this.filterMiniChartSeries(i),this.filterMiniChartSeries(r));this.applyAxes(e,s,n,o,["axes[].tick","axes[].thickness","axes[].title","axes[].crosshair","axes[].gridLine","axes[].label"]);const a=e.series;for(const h of a)h.properties.id=void 0;const l=e.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(on(u,["interval","rotation","minSpacing","autoRotate","autoRotateAngle"])),c.tick.set(on(d,["enabled","width","size","color","interval","step"])),c.type==="grouped-category"){c.label.enabled=!1,c.label.rotation=0;const{depthOptions:f}=c;if(f.length===0)f.set([{label:{enabled:!0}}]);else for(let y=1;y<f.length;y++)f[y].label.enabled=!1}const p=d?.step;p!=null&&(c.interval.step=p)}}applyModules(e){const{type:i}=this.constructor;let s=!1;for(const n of ls.byType("root","legend")){const o=e[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(e){for(let i=0;i<e.length;i++)e[i].setSeriesIndex(i)}applySeries(e,i,s){if(!i)return"no-change";const n=oN(e.series,i,s);if(n.status==="no-overlap"){qi(`Chart.applySeries() - creating new series instances, status: ${n.status}`,n);const h=i.map(u=>this.createSeries(u));return this.initSeriesDeclarationOrder(h),e.series=h,"replaced"}qi("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),qi("Chart.applySeries() - created new series",u);break}case"remove":qi(`Chart.applySeries() - removing series at previous idx ${h.idx}`,h.series);break;case"no-op":r.push(h.series),qi(`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;qi(`Chart.applySeries() - applying series diff previous idx ${p}`,d,u),this.applySeriesValues(u,d),u.markNodeDataDirty(),r.push(u)}}return this.initSeriesDeclarationOrder(r),qi("Chart.applySeries() - final series instances",r),e.series=r,a?"series-grouping-change":o?"data-change":l?"updated":"no-op"}applyAxes(e,i,s,n,r=[]){if(!("axes"in i)||!i.axes)return!1;r=["axes[].type",...r];const{axes:o}=i;return!(n==="replaced")&&e.axes.length===o.length&&e.axes.every((c,h)=>c.type===o[h].type)&&Fd(s)?(e.axes.forEach((c,h)=>{const u=s.axes?.[h]??{},d=ps(u,o[h]);qi(`Chart.applyAxes() - applying axis diff idx ${h}`,d);const p=`axes[${h}]`;Qo(c,d,{path:p,skip:r})}),!0):(qi(`Chart.applyAxes() - creating new axes instances; seriesStatus: ${n}`),e.axes=this.createAxis(o,r),!0)}createSeries(e){const i=Ei.create(e.type,this.getModuleContext());return this.applySeriesOptionModules(i,e),this.applySeriesValues(i,e),i}applySeriesOptionModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const r of ls.byType("series-option"))r.optionsKey in i&&r.seriesTypes.includes(e.type)&&n.addModule(r,o=>o.moduleFactory(s))}applySeriesValues(e,i){const s=e.getModuleMap(),{type:n,data:r,listeners:o,seriesGrouping:a,showInMiniChart:l,...c}=i;for(const h of pa)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)}}e.properties.set(c),"data"in i&&e.setOptionsData(r),o&&this.registerListeners(e,o,{nodeClick:"seriesNodeClick",nodeDoubleClick:"seriesNodeDoubleClick"}),"seriesGrouping"in i&&(a==null?e.seriesGrouping=void 0:e.seriesGrouping={...e.seriesGrouping,...a})}createAxis(e,i){const s=[],n=this.getModuleContext();for(let r=0;r<e.length;r++){const o=e[r],a=Hn.create(o.type,n);this.applyAxisModules(a,o),Qo(a,o,{path:`axes[${r}]`,skip:i}),s.push(a)}return nN(s),s}applyAxisModules(e,i){const s=e.createModuleContext(),n=e.getModuleMap();for(const r of ls.byType("axis-option")){const o=i[r.optionsKey]!=null;o!==n.isEnabled(r)&&(o?(n.addModule(r,a=>a.moduleFactory(s)),e[r.optionsKey]=n.getModule(r)):(n.removeModule(r),delete e[r.optionsKey]))}}registerListeners(e,i,s){e.clearEventListeners();for(const[n,r]of(0,gi.entries)(i))if((0,gi.isFunction)(r)){const o=s?.[n];o==null?e.addEventListener(n,r):e.addEventListener(o,a=>{if(a?.type===o){const l=new Proxy(a,{get(c,h,u){return h==="type"?n:Reflect.get(c,h,u)}});r(l)}else r(a)})}}};oe.chartsInstances=new WeakMap,g([ni({newValue(t){this.destroyed||(this.ctx.domManager.setContainer(t),oe.chartsInstances.set(t,this))},oldValue(t){oe.chartsInstances.delete(t)}})],oe.prototype,"container",2),g([ni({newValue(t){this.resize("width option",{inWidth:t})}})],oe.prototype,"width",2),g([ni({newValue(t){this.resize("height option",{inHeight:t})}})],oe.prototype,"height",2),g([ni({newValue(t){this.resize("minWidth option",{inMinWidth:t})}})],oe.prototype,"minWidth",2),g([ni({newValue(t){this.resize("minHeight option",{inMinHeight:t})}})],oe.prototype,"minHeight",2),g([ni({newValue(t){this.resize("overrideDevicePixelRatio option",{inOverrideDevicePixelRatio:t})}})],oe.prototype,"overrideDevicePixelRatio",2),g([b(F)],oe.prototype,"padding",2),g([b(F)],oe.prototype,"seriesArea",2),g([b(F)],oe.prototype,"keyboard",2),g([b(F)],oe.prototype,"touch",2),g([b(At(["standalone","integrated"],"a chart mode"))],oe.prototype,"mode",2),g([kt("chartCaptions.title")],oe.prototype,"title",2),g([kt("chartCaptions.subtitle")],oe.prototype,"subtitle",2),g([kt("chartCaptions.footnote")],oe.prototype,"footnote",2),g([b(H)],oe.prototype,"suppressFieldDotNotation",2),g([ni({changeValue(t,e){this.onAxisChange(t,e)}})],oe.prototype,"axes",2),g([ni({changeValue(t,e){this.onSeriesChange(t,e)}})],oe.prototype,"series",2);var Tc=oe,m0=vt.create(!0,"opts"),Jn="AG Charts - Chart was destroyed, cannot perform request.",Ma=class{constructor(e,i,s){this.factoryApi=i,this.licenseManager=s,this.chart=e}async update(e){if(!this.chart)throw new Error(Jn);return m0.group("AgChartInstance.update()",async()=>{this.factoryApi.update(e,this),await this.chart?.waitForUpdate()})}async updateDelta(e){if(!this.chart)throw new Error(Jn);return m0.group("AgChartInstance.updateDelta()",async()=>{this.factoryApi.updateUserDelta(this,e),await this.chart?.waitForUpdate()})}getOptions(){if(!this.chart)throw new Error(Jn);const e=Ft(this.chart.getOptions());for(const i of Object.keys(e))i.startsWith("_")&&delete e[i];return e}waitForUpdate(){if(!this.chart)throw new Error(Jn);return this.chart.waitForUpdate()}async download(e){if(!this.chart)throw new Error(Jn);const i=await this.prepareResizedChart(this,this.chart,e);try{i.chart?.download(e?.fileName,e?.fileFormat)}finally{i.destroy()}}async __toSVG(e){if(!this.chart)throw new Error(Jn);const i=await this.prepareResizedChart(this,this.chart,{width:600,height:300,...e});try{return i?.chart?.toSVG()}finally{i?.destroy()}}async getImageDataURL(e){if(!this.chart)throw new Error(Jn);const i=await this.prepareResizedChart(this,this.chart,e);try{return i.chart.getCanvasDataURL(e?.fileFormat)}finally{i.destroy()}}getState(){return this.factoryApi.caretaker.save(...this.getEnabledOriginators())}async setState(e){const{chart:i}=this;if(!i)return;const s=this.getEnabledOriginators();if(!s.includes(i.ctx.legendManager)){await this.setStateOriginators(e,s);return}await this.setStateOriginators(e,s.filter(n=>n!==i.ctx.zoomManager)),await this.setStateOriginators(e,[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(e,i,s={}){const n=s.width??i.width??i.ctx.scene.canvas.width,r=s.height??i.height??i.ctx.scene.canvas.height,o=e.getState(),a=ls.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=this.factoryApi.create(c,l,h,u);await d.setState(o),d.chart?.ctx.zoomManager.updateZoom("chartProxy",i.ctx.zoomManager.getZoom()),d.chart?.ctx.legendManager.clearData(),d.chart?.ctx.legendManager.update(i.ctx.legendManager.getData()),i.series.forEach((f,y)=>{f.visible||(d.chart.series[y].visible=!1)});const p=[];for(const f of i.modulesManager.legends())p.push(f.legend.pagination?.currentPage??0);for(const f of d.chart.modulesManager.legends()){const y=p.shift()??0;f.legend.pagination&&f.legend.pagination.setPage(y)}return d.chart?.update(0,{forceNodeDataRefresh:!0}),await d.waitForUpdate(),d}getEnabledOriginators(){if(!this.chart)return[];const{chartOptions:{processedOptions:e,optionMetadata:i},ctx:{annotationManager:s,chartTypeOriginator:n,zoomManager:r,legendManager:o}}=this.chart,a=[];return"annotations"in e&&e.annotations?.enabled&&a.push(s),i.presetType==="price-volume"&&a.push(n),(e.navigator?.enabled||e.zoom?.enabled)&&a.push(r),"legend"in this.chart&&a.push(o),a}async setStateOriginators(e,i){this.factoryApi.caretaker.restore(e,...i),this.chart?.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),await this.chart?.waitForUpdate()}};Ma.chartInstances=new WeakMap,g([ni({oldValue(t){t.destroyed||(t.publicApi=void 0),Ma.chartInstances.delete(t)},newValue(t){t&&(t.publicApi=this,Ma.chartInstances.set(t,this))}})],Ma.prototype,"chart",2);var y0=Ma,Zd=class extends Il{constructor(t){super(),this.ctx=t,this.localeText=void 0}};g([pn(t=>{t.ctx.localeManager.setLocaleText(t.localeText)}),b(Qf,{optional:!0})],Zd.prototype,"localeText",2),g([pn(t=>{t.ctx.localeManager.setLocaleTextFormatter(t.getLocaleText)}),b(Ze,{optional:!0})],Zd.prototype,"getLocaleText",2);var tT={type:"root",optionsKey:"locale",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new Zd(t)},b0=(w(),k(T)),Sa=class extends aa{constructor(){super(...arguments),this.type="band",this.index=void 0,this._domain=[]}set domain(t){this._domain!==t&&(this.invalid=!0,this._domain=t,this.index=void 0)}get domain(){return this._domain}normalizeDomains(...t){let e;const i=new Set;let s=!0;for(const n of t)i.has(n)||(i.add(n),e==null?e=x0(n):(s&&(s=eT(n,e)),e=x0([...e,...n])));return e??(e=[]),{domain:e,animatable:s}}toDomain(t){}invert(t,e=!1){this.refresh();const i=e?this.bandwidth/2:0,s=this.invertNearestIndex(Math.max(0,t-i));return e||t===this.ordinalRange(s)?this.domain[s]:void 0}getIndex(t){let{index:e}=this;if(e==null){const{domain:i}=this;e=new Map;for(let s=0;s<i.length;s++)e.set(Ve(i[s]),s);this.index=e}return e.get(Ve(t))}};function x0(t){let e;const i=new Set;for(const s of t){const n=Ve(s),r=i.size;i.add(n),i.size!==r?e?.push(s):e??(e=t.slice(0,i.size))}return e??t}function eT(t,e){let i=-1;for(const s of t){const n=e.indexOf(s);if(n===-1)i=1/0;else{if(n<=i)return!1;i=n}}return!0}var so=class Hv extends fa{constructor(e,i=new Sa){super(e,i),this.groupPaddingInner=.1,this.includeInvisibleDomains=!0,this.nice=!1}static is(e){return e instanceof Hv}normaliseDataDomain(e){return{domain:e,clipped:!1}}updateScale(){super.updateScale();let{paddingInner:e,paddingOuter:i}=this;if(!(0,b0.isFiniteNumber)(e)||!(0,b0.isFiniteNumber)(i)){const s=this.reduceBandScalePadding();e??(e=s.inner),i??(i=s.outer)}this.scale.paddingInner=e??0,this.scale.paddingOuter=i??0}reduceBandScalePadding(){return this.boundSeries.reduce((e,i)=>{const s=i.getBandScalePadding?.();return s&&(e.inner>s.inner&&(e.inner=s.inner),e.outer<s.outer&&(e.outer=s.outer)),e},{inner:1/0,outer:-1/0})}};so.className="CategoryAxis",so.type="category",g([b(It)],so.prototype,"groupPaddingInner",2),g([b(It,{optional:!0})],so.prototype,"paddingInner",2),g([b(It,{optional:!0})],so.prototype,"paddingOuter",2);var tr=so,er=(w(),k(T)),v0=class extends Sa{normalizeDomains(...t){const{domain:e}=super.normalizeDomains(...t);return{domain:e,animatable:!1}}getIndex(t){return super.getIndex(t)??this.getMatchIndex(t)}getMatchIndex(t){const e=JSON.stringify(t),i=this._domain.find(s=>JSON.stringify(s)===e);if(i!=null)return super.getIndex(i)}};function Gs(t){if(t.length===0)return null;let e=1/0,i=-1/0;for(const n of t){const r=n instanceof Date?n.getTime():n;typeof r=="number"&&(r<e&&(e=r),r>i&&(i=r))}const s=[e,i];return s.every(isFinite)?s:null}function Xd(t,e,i){let s=!1;return t.length>2&&(t=Gs(t)??[NaN,NaN]),e!=null&&(s||(s=e>t[0]),t=[e,t[1]]),i!=null&&(s||(s=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{extent:t,clipped:s}}var ir=(w(),k(T)),Da=new WeakMap;function kc(t,e){const i=JSON.stringify(t,null,0);return Da.has(e)||Da.set(e,new Map),Da.get(e)?.has(i)||Da.get(e)?.set(i,e(t)),Da.get(e)?.get(i)}function ti(t,e){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?e?.("hit",t,o):(h=t(...o),l.set(c,h),e?.("miss",t,o)),h}}var M0=(w(),k(T));function wc(t,e=[0,0]){for(const i of t)typeof i=="number"&&(i<0&&(e[0]+=i),i>0&&(e[1]+=i));return e}function iT(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>wc(s)}}function S0(t,e){return{id:t,type:"aggregate",matchGroupIds:e?[e]:void 0,aggregateFunction:i=>wc(i),groupAggregateFunction:(i,s=[0,0])=>(s[0]+=i?.[0]??0,s[1]+=i?.[1]??0,s)}}function sT(t,e){return{id:t,matchGroupIds:[e],type:"aggregate",aggregateFunction:s=>yn.extendDomain(s)}}function qd(t){return{id:t,type:"aggregate",aggregateFunction:()=>[0,1],groupAggregateFunction:(e,i=[0,0])=>(i[0]+=e?.[0]??0,i[1]+=e?.[1]??0,i)}}function D0(t,e){return{id:t,matchGroupIds:e?[e]:void 0,type:"aggregate",aggregateFunction:s=>wc(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 Qd(t,e,i){const s={id:t,matchGroupIds:i?[i]:void 0,type:"aggregate",aggregateFunction:(n,r=[])=>{const o=r[1]-r[0];return e.aggregateFunction(n).map(a=>a/o)}};return e.groupAggregateFunction&&(s.groupAggregateFunction=e.groupAggregateFunction),s}function I0(t){return()=>{let e=0;return i=>(0,M0.isFiniteNumber)(i)?(e+=t?Math.max(0,i):i,e):i}}function A0(){return()=>{let t=0;return e=>{if(!(0,M0.isFiniteNumber)(e))return e;const i=t;return t+=e,i}}}function L0(t){return t!=null&&vc(t)}function nT(t){return t!=null}function C0(t){switch(t){case"number":case"log":case"ordinal-time":case"time":case"color":return L0;default:return nT}}function N0(t){switch(t){case"number":case"log":case"time":case"color":return"range";default:return"category"}}function Qi(t,e,i={}){return{property:t,type:"key",valueType:N0(e),validation:C0(e),...i}}function mt(t,e,i={}){return{property:t,type:"value",valueType:N0(e),validation:C0(e),...i}}function T0(t,e={}){return{property:t,type:"value",valueType:"range",missingValue:1,processor:()=>()=>1,...e}}var rT=function(t){return t};function k0(...t){const e=t.filter(i=>i!=null);return e.length===0?()=>rT:e.length===1?e[0]:()=>{const i=e.map(s=>s());return(s,n)=>i.reduce((r,o)=>o(r,n),s)}}function Jd(t,e={}){const{min:i=-1/0,max:s=1/0,processor:n,...r}=e;return{type:"value",property:t,valueType:"range",validation:L0,processor:k0(n,()=>o=>(0,ir.isFiniteNumber)(o)?(0,ir.clamp)(i,o,s):o),...r}}function Ia(t,e,i={}){const{onlyPositive:s,processor:n,...r}=i;return{...mt(t,e,r),processor:k0(n,I0(s))}}function oT(t,e,i={}){return{...mt(t,e,i),processor:A0()}}function bn(t,e,i,s,n){return[mt(t,n,s),_0(s.groupId,e,i,s.separateNegative),...s.rangeId!=null?[sT(s.rangeId,s.groupId)]:[]]}function w0(t,e,i){return[mt(t,e,i),j0(i.groupId)]}var E0={type:"reducer",property:"smallestKeyInterval",initialValue:1/0,reducer:()=>{let t=NaN;return(e=1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n<e?n:e}}},O0={type:"reducer",property:"largestKeyInterval",initialValue:-1/0,reducer:()=>{let t=NaN;return(e=-1/0,i)=>{const s=typeof i[0]=="number"?i[0]:Number(i[0]),n=Math.abs(s-t);return t=s,!isNaN(n)&&n>0&&n>e?n:e}}},R0={type:"processor",property:"sortedGroupDomain",calculate:({domain:{groups:t}})=>t?.slice().sort((e,i)=>{for(let s=0;s<e.length;s++){const n=e[s]-i[s];if(n!==0)return n}return 0})};function aT({normaliseTo:t}){const e=(i,s)=>{if(s===0)return null;const n=(i??0)*t/s;return n>=0?Math.min(t,n):Math.max(-t,n)};return()=>()=>(i,s,n)=>{const r=lT(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"?e(c,r):c.map(h=>e(h,r))}}}function lT(t,e,i){const s=[0,0];for(const n of e){const r=t[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 Ec(t,e){return{type:"group-value-processor",matchGroupIds:t,adjust:kc({normaliseTo:e},aT)}}function cT({normaliseTo:t,zeroDomain:e,rangeMin:i,rangeMax:s}){const n=t[1]-t[0],r=(o,a,l)=>{const c=t[0]+(o-a)/l*n;return l===0?e:c>=t[1]?t[1]:c<t[0]?t[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]=[t[0],t[1]];const u=o.columns[a];for(let d=0;d<u.length;d+=1)u[d]=r(u[d],l,h)}}function sr(t,e,i,s,n){return{type:"property-value-processor",property:t,adjust:kc({normaliseTo:e,rangeMin:s,rangeMax:n,zeroDomain:i},cT)}}var Aa=1,Oc=2,P0=(t,e,i,s)=>{let n=Aa|Oc;if(e.valueType==="category")return i.length!==t&&(n&=~Aa),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&=~Oc),Number.isFinite(a)&&r===a&&(n&=~Aa),r=a}return n};function no(t){return{type:"processor",property:"animationValidation",calculate(e){const{keys:i,values:s}=e.defs,{input:{count:n},domain:{keys:r,values:o},keys:a,columns:l}=e;let c=Aa|Oc;if(n!==0){for(let h=0;c!==0&&h<i.length;h++)for(const u of i[h].scopes)c&=P0(n,i[h],r[h],a[h].get(u));for(let h=0;c!==0&&h<s.length;h++){const u=s[h];t?.includes(u.id)&&(c&=P0(n,u,o[h],l[h]))}}return{uniqueKeys:(c&Aa)!==0,orderedKeys:(c&Oc)!==0}}}}function hT({mode:t,separateNegative:e}){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,ir.isNegative)(c)&&e?0:1;(0,ir.isFiniteNumber)(c)&&(t==="normal"&&(r[h]+=c),l[a]=r[h],t==="trailing"&&(r[h]+=c))}}}function uT({mode:t,sum:e}){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&&e==="current"?0:i[l];i[l]=u;const p=e==="current"?u:d;if(!(0,ir.isFiniteNumber)(u)||!(0,ir.isFiniteNumber)(d)){c[h]=a;continue}t==="normal"&&(a+=p),c[h]=a,t==="trailing"&&(a+=p)}}s=!1}}}function _0(t,e,i,s=!1){let n;if(e.startsWith("window")){const r=e.endsWith("-trailing")?"trailing":"normal";n=kc({mode:r,sum:i},uT)}else n=kc({mode:e,separateNegative:s},hT);return{type:"group-value-processor",matchGroupIds:[t],adjust:n}}function dT(){return()=>(t,e,i)=>{const s=new Float64Array(e.length);let n=0;for(const r of e){const o=t[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 j0(t){return{type:"group-value-processor",matchGroupIds:[t],adjust:dT}}function F0(t){return t.id??t.property}function pT(t,e,i){const s=new Map,n=e.defs.values;for(let a=0;a<n.length;a+=1){const l=n[a];if(l.scopes?.includes(t)===!1)continue;const c=F0(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(t)===!1)continue;const c=F0(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 tp(t,e,i,s,n){for(const{previousIndex:r,nextIndex:o}of i){const a=t[r],l=e[o],c=a[s],h=l[n];if(c!==h)return!1}return!0}function ro(t,e,i=!0){return{type:"processor",property:"diff",calculate(s,n){const r=new Map,o=new Map,a=new Map,l=new Map,c=e.keys,h=s.keys,u=e.columns,d=s.columns,p=pT(t,e,s);if(p==null)return n;const f=Math.max(e.input.count,s.input.count);for(let m=0;m<f;m++){const v=m<e.input.count,S=m<s.input.count,M=v?yc(c,t,m):void 0,D=M!=null?Le(M):"",C=S?yc(h,t,m):void 0,L=C!=null?Le(C):"";if(S&&v&&D===L){tp(u,d,p,m,m)||a.set(L,m);continue}const I=l.get(L);I!=null?((i||!tp(u,d,p,I,m))&&(a.set(L,m),r.set(L,m)),l.delete(L)):S&&o.set(L,m);const N=o.get(D);N!=null?((i||!tp(u,d,p,N,m))&&(a.set(D,m),r.set(D,m)),o.delete(D)):v&&(a.delete(D),l.set(D,m))}const x={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,[t]:x}}}}function Le(t,...e){let i;return(0,ir.isArray)(t)?i=t.map(n=>Nd(n)).join("___"):i=Nd(t),(typeof i=="string"||typeof i=="number"||typeof i=="boolean"||i instanceof Date)&&e.length>0&&(i+=`___${e.join("___")}`),i}var gT=class{constructor(){this.top=1/0,this.right=-1/0,this.bottom=-1/0,this.left=1/0}update(t,e){t>this.right&&(this.right=t),t<this.left&&(this.left=t),e>this.bottom&&(this.bottom=e),e<this.top&&(this.top=e)}},fT=class Kv{constructor(e="",i,s){this.label=e,this.parent=i,this.refId=s,this.x=0,this.y=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.screenX=0,this.depth=i?i.depth+1:0}insertTick(e,i){let s=this;for(let n=0;n<e.length;n++){const r=e[n],o=n!==e.length-1,{children:a}=s,l=a.find(c=>c.label===r);if(l&&o)s=l;else{const c=new Kv(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((e,i)=>i!==this.index)??[]}};function mT(t){const e=t.reduce((s,n)=>s<n.length?n.length:s,0),i=new fT;for(let s=0;s<t.length;s++){const n=t[s];for(;n.length<e;)n.push("");i.insertTick(n,s)}return i}function yT(t,e,i){const s=e.index-t.index,n=i/s;e.change-=n,e.shift+=i,t.change+=n,e.prelim+=i,e.mod+=i}function bT(t,e,i){return e.getSiblings().indexOf(t.ancestor)>=0?t.ancestor:i}function xT({children:t}){let e=0,i=0;for(let s=t.length-1;s>=0;s--){const n=t[s];n.prelim+=e,n.mod+=e,i+=n.change,e+=n.shift+i}}function vT(t,e){const i=t.getLeftSibling();if(i){let s=t,n=t,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=t;const u=r.prelim+c-(n.prelim+a)+1;u>0&&(yT(bT(r,t,e),t,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),e=t)}return e}function z0(t){const{children:e}=t;if(e.length){let[i]=e;for(const r of e)z0(r),i=vT(r,i);xT(t);const s=(e[0].prelim+e.at(-1).prelim)/2,n=t.getLeftSibling();n?(t.prelim=n.prelim+1,t.mod=t.prelim-s):t.prelim=s}else{const i=t.getLeftSibling();t.prelim=i?i.prelim+1:0}}function B0(t,e,i){t.x=t.prelim+e,t.y=t.depth,i.insertNode(t);for(const s of t.children)B0(s,e+t.mod,i)}function G0(t){const{children:e}=t;let i=0;for(const s of e)G0(s),s.children.length?i+=s.leafCount:i++;t.leafCount=i,e.length?(t.subtreeLeft=e[0].subtreeLeft,t.subtreeRight=e[e.length-1].subtreeRight,t.x=(t.subtreeLeft+t.subtreeRight)/2):(t.subtreeLeft=t.x,t.subtreeRight=t.x)}function MT(t){const e=new ST,i=mT(t);return z0(i),B0(i,-i.prelim,e),G0(i),e}var ST=class{constructor(){this.dimensions=new gT,this.nodes=[],this.depth=0}insertNode(t){this.depth<t.depth&&(this.depth=t.depth),this.dimensions.update(t.x,t.y),this.nodes.push(t)}scalingX(t,e){let i=1;if(t>0){const{left:s,right:n}=this.dimensions;i=t/(n-s)}return e&&(i*=-1),i}},Vs=class extends nt{constructor(){super(...arguments),this.enabled=!0}};g([b(H)],Vs.prototype,"enabled",2),g([b(H,{optional:!0})],Vs.prototype,"avoidCollisions",2),g([b(dt,{optional:!0})],Vs.prototype,"color",2),g([b(j,{optional:!0})],Vs.prototype,"spacing",2),g([b(Ns,{optional:!0})],Vs.prototype,"fontStyle",2),g([b(Ts,{optional:!0})],Vs.prototype,"fontWeight",2),g([b(ct.restrict({min:1}),{optional:!0})],Vs.prototype,"fontSize",2),g([b(O,{optional:!0})],Vs.prototype,"fontFamily",2);var Rc=class extends nt{constructor(){super(...arguments),this.enabled=!0}};g([b(H)],Rc.prototype,"enabled",2),g([b(j,{optional:!0})],Rc.prototype,"width",2),g([b(dt,{optional:!0})],Rc.prototype,"stroke",2);var ep=class extends nt{constructor(){super(...arguments),this.label=new Vs,this.tick=new Rc}};g([b(F)],ep.prototype,"label",2),g([b(F)],ep.prototype,"tick",2);var nr=class extends tr{constructor(t){super(t,new v0),this.tickScale=new v0,this.depthOptions=new Ho(ep),this.includeInvisibleDomains=!0,this.tickScale.paddingInner=1,this.tickScale.paddingOuter=0}resizeTickTree(){if(!this.tickTreeLayout)return;const{nodes:t}=this.tickTreeLayout,{range:e,step:i,inset:s,bandwidth:n}=this.scale,r=Math.abs(e[1]-e[0])-i,o=this.tickTreeLayout.scalingX(r,e[0]>e[1]),a=s+n/2;let l=0;for(const c of t){const h=c.x*o;l>h&&(l=h),c.screenX=h+a}for(const c of t)c.screenX-=l}getDepthOptionsMap(t){const e=[],{depthOptions:i,label:s}=this;for(let n=0;n<t;n++)e.push(i[n]?.label.enabled??s.enabled?{enabled:!0,spacing:i[n]?.label.spacing??s.spacing,lineHeight:Bt.getLineHeight(i[n]?.label.fontSize??s.fontSize??10),avoidCollisions:i[n]?.label.avoidCollisions??s.avoidCollisions}:{enabled:!1,spacing:0,lineHeight:0,avoidCollisions:!1});return e}updateCategoryLabels(){this.computedLayout&&this.tickLabelGroupSelection.update(this.computedLayout.tickLabelLayout).each((t,e)=>t.setProperties(e))}updateAxisLine(){this.computedLayout&&(this.lineNode.visible=this.line.enabled,this.lineNode.stroke=this.line.stroke,this.lineNode.strokeWidth=this.line.width)}computeLayout(){if(this.updateDirection(),this.updateScale(),this.resizeTickTree(),!this.tickTreeLayout?.depth)return{bbox:B.zero,separatorLayout:[],tickLabelLayout:[]};const{step:t}=this.scale,{title:e,label:i,range:s,depthOptions:n}=this,{depth:r,nodes:o}=this.tickTreeLayout,a=Math.ceil(i.fontSize/t),l=zt(this.rotation),c=this.position==="top"||this.position==="bottom",h=i.getSideFlag(),u=[],d=new Map,p=new jr,{defaultRotation:f,configuredRotation:y}=bc({rotation:i.rotation,parallel:i.parallel,regularFlipRotation:Pt(l-Math.PI/2),parallelFlipRotation:Pt(l)}),x=f+y,m=this.getDepthOptionsMap(r),v=($,q)=>{const tt=r-$.depth;if(!m[tt]?.enabled||q%a!==0||!(0,er.inRange)($.screenX,s))return!1;const ht=this.formatTick($.label,q-1,this.scale.domain),lt=this.getLabelStyles({value:ht,depth:tt},n[tt]?.label);return p.setProperties({...lt,text:ht,textAlign:"center",textBaseline:i.parallel?"hanging":"bottom",rotation:0,translationX:0,translationY:$.screenX}),!0};let S=0;const M={};o.forEach(($,q)=>{const tt=r-$.depth,ht=(0,er.countLines)($.label);if(M[tt]??(M[tt]=1),M[tt]<ht&&(M[tt]=ht),!(!v($,q)||!p.getBBox())&&(d.set(q,p.getBBox()),!$.leafCount)){p.rotation=x;const{width:V}=p.getBBox();S<V&&(S=V)}});const D=Pd(),C=h*m[0].spacing,L=new Map,I=$=>{let q=S;for(let tt=1;tt<=$;tt++)q+=m[tt].spacing,(i.mirrored||tt!==$)&&(q+=M[tt]*m[tt].lineHeight);return q};o.forEach(($,q)=>{if(q===0)return;const tt=v($,q),ht=!$.children.length,lt=r-$.depth;if($.parent){const Y=ht?$.x:$.x-($.leafCount-1)/2;if(!L.has(Y)){const et=this.depthOptions[lt]?.tick;let st=S;for(let ut=0;ut<=lt;ut++)st+=m[ut].spacing,ut!==0&&(st+=M[ut]*m[ut].lineHeight);L.set(Y,{tickSize:st,tickStroke:et?.stroke,tickWidth:et?.enabled!==!1?et?.width:0})}}if(!tt)return;if(p.x=C,p.y=0,ht){const{width:Y}=d.get(q),et=$f(x);p.rotation=x,p.textAlign="end",p.textBaseline="middle",p.rotationCenterX=C-Y/2,p.translationX=(m[lt].spacing-Y)/2*et*h,i.mirrored&&(p.translationX+=Y)}else p.rotation=c?f:-Math.PI/2,p.rotationCenterX=C,p.translationX=h*I(lt);if(m[lt].avoidCollisions){const Y=ht?t:$.leafCount*t;if(p.getBBox().height>Y){d.delete(q);return}}const{text:V=""}=p;u.push({text:V,visible:!0,range:this.scale.range,tickId:D(V),fill:p.fill,fontFamily:p.fontFamily,fontSize:p.fontSize,fontStyle:p.fontStyle,fontWeight:p.fontWeight,rotation:p.rotation,rotationCenterX:p.rotationCenterX,textAlign:p.textAlign,textBaseline:p.textBaseline,translationX:p.translationX,translationY:p.translationY,x:p.x,y:p.y}),d.set(q,Kt.toCanvas(p))});const{enabled:N,stroke:E,width:R}=this.line;this.lineNode.datum={x:0,y1:s[0],y2:s[1]},this.lineNode.setProperties({stroke:E,strokeWidth:N?R:0});const z=[...L.values()];z.push(z[0]);const W=[this.lineNode.getBBox(),new B(0,0,z[0].tickSize*h,0)];e.enabled&&(this.updateTitle(this.scale.domain,!1,z[0].tickSize),W.push(e.caption.node.getBBox()));const yt=B.merge((0,er.iterate)(d.values(),W));return{bbox:this.getTransformBox(yt),separatorLayout:z,tickLabelLayout:u}}update(){if(!this.computedLayout)return;this.moduleCtx.animationManager.skipCurrentBatch();const{tickScale:t,gridLine:e,gridLength:i}=this,{separatorLayout:s}=this.computedLayout,n=t.ticks({nice:!1,interval:void 0,tickCount:void 0,minTickCount:0,maxTickCount:1/0}).map((r,o)=>({...s[o],tick:r,tickId:Le(r,o),tickLabel:r.filter(Boolean).join(" - "),translationY:Math.round(t.convert(r))}));this.gridLineGroupSelection.update(e.enabled&&i?n:[]),this.tickLineGroupSelection.update(this.tick.enabled?n:[]),this.updatePosition(),this.updateCategoryLabels(),this.updateAxisLine(),this.updateGridLines(),this.updateTickLines(),this.updateTitle(this.scale.domain),this.resetSelectionNodes()}calculateLayout(){const{separatorLayout:t,tickLabelLayout:e,bbox:i}=this.computeLayout();return this.computedLayout={separatorLayout:t,tickLabelLayout:e},{bbox:i,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:t}=this,e=this.boundSeries.filter(n=>n.visible).flatMap(n=>n.getDomain(t));this.dataDomain={domain:Gs(e)??this.filterDuplicateArrays(e),clipped:!1},this.isReversed()&&this.dataDomain.domain.reverse();const i=this.dataDomain.domain.map(n=>(0,er.toArray)((0,er.isObject)(n)&&"value"in n?n.value:n));this.tickTreeLayout=MT(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,er.sortBasedOnArray)(this.dataDomain.domain,s),this.tickScale.domain=i.concat([[""]])}updateGridLines(){if(!this.gridLength)return;const{width:t,style:e}=this.gridLine,i=this.gridLength*-this.label.getSideFlag();this.gridLineGroupSelection.each((s,n,r)=>{const{stroke:o,lineDash:a}=e[r%e.length],l=n.translationY;s.visible=this.inRange(l),s.x1=0,s.x2=i,s.y=l,s.stroke=o,s.strokeWidth=t,s.lineDash=a})}filterDuplicateArrays(t){const e=new Set;return t.filter(i=>{const s=(0,er.isArray)(i)?JSON.stringify(i):i;return e.has(s)?!1:(e.add(s),!0)})}};nr.className="GroupedCategoryAxis",nr.type="grouped-category",g([b(gu)],nr.prototype,"depthOptions",2);var V0=(w(),k(T)),U0=(w(),k(T)),DT={2:(t,e)=>Math.log2(e),[Math.E]:(t,e)=>Math.log(e),10:(t,e)=>Math.log10(e)},IT=(t,e)=>Math.log(e)/Math.log(t);function ip(t,e,i){const s=Math.min(...e),n=DT[t]??IT;return s>=0?n(t,i):-n(t,-i)}var AT={[Math.E]:(t,e)=>Math.exp(e),10:(t,e)=>e>=0?10**e:1/10**-e},LT=(t,e)=>t**e;function sp(t,e,i){const s=Math.min(...e),n=AT[t]??LT;return s>=0?n(t,i):-n(t,-i)}var np=class extends Ct{constructor(t=[1,10],e=[0,1]){super(t,e),this.type="log",this.defaultClamp=!0,this.base=10,this.log=i=>ip(this.base,this.domain,i),this.pow=i=>sp(this.base,this.domain,i)}toDomain(t){return t}transform(t){const[e,i]=ne(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.log(t):-Math.log(-t)}transformInvert(t){const[e,i]=ne(this.domain);return e>=0!=i>=0?NaN:e>=0?Math.exp(t):-Math.exp(-t)}niceDomain(t,e=this.domain){if(e.length<2)return[];const{base:i}=this,[s,n]=e,r=s>n?Math.ceil:Math.floor,o=s>n?Math.floor:Math.ceil,a=sp(i,e,r(ip(i,e,s))),l=sp(i,e,o(ip(i,e,n)));return[a,l]}ticks({interval:t,tickCount:e=Ct.defaultTickCount},i=this.domain,s){if(!i||i.length<2||e<1)return[];const n=this.base,[r,o]=i,a=Math.min(r,o),l=Math.max(r,o);let c=this.log(a),h=this.log(l);if(t){const y=v=>v>=a&&v<=l,x=Math.min(Math.abs(t),Math.abs(h-c)),m=ha(c,h,x).map(this.pow).filter(y);if(!qr(m.length,this.getPixelRange()))return m}if(!(0,U0.isInteger)(n)||h-c>=e)return dd(c,h,Math.min(h-c,e)).map(this.pow);let u=[];const d=a>0;c=Math.floor(c)-1,h=Math.round(h)+1;const p=Wr(this.range)/e;let f=1/0;for(let y=c;y<=h;y++){const x=this.convert(this.pow(y+1));for(let m=1;m<n;m++){const v=d?m:n-m+1,S=this.pow(y)*v,M=this.convert(S),D=Math.abs(f-M),C=Math.abs(M-x),L=D>=p&&C>=p;S>=a&&S<=l&&(m===1||L||u.length===0)&&(u.push(S),f=M)}}return u=Yy(u,d,s),u}tickFormatter({specifier:t}){return t!=null?(0,U0.createNumberFormatter)(t):String}datumFormatter(t){return this.tickFormatter(t)}},Ji=class Zv extends Ct{constructor(){super([0,1],[0,1]),this.type="number"}static getTickStep(e,i,s){const{interval:n,tickCount:r=Ct.defaultTickCount,minTickCount:o,maxTickCount:a}=s;return n??ca(e,i,r,o,a)}toDomain(e){return e}ticks({interval:e,tickCount:i=Ct.defaultTickCount,minTickCount:s,maxTickCount:n},r=this.domain,o){if(!r||r.length<2||i<1||!r.every(isFinite))return[];const[a,l]=r;if(e){const c=Math.abs(e);if(!qr((l-a)/c,this.getPixelRange()))return ha(a,l,c)}return dd(a,l,i,s,n,o)}niceDomain(e,i=this.domain){if(i.length<2)return[];const{tickCount:s=Ct.defaultTickCount}=e;let[n,r]=i;if(s===1)[n,r]=TL(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=Zv.getTickStep(n,r,e),[p,f]=i;if(n=o(p/d)*d,r=a(f/d)*d,n===h&&r===u)break}}return[n,r]}tickFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?Zy(e,s):n=>Rs(n,i)}datumFormatter({ticks:e,fractionDigits:i,specifier:s}){return s!=null?Zy(e,s):n=>Rs(n,i+1)}},Us=class extends fa{constructor(t,e=new Ji){super(t,e)}normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=Xd(t,e,i);return{domain:s,clipped:n}}};Us.className="NumberAxis",Us.type="number",g([b(ln(jl,zl("max")),{optional:!0})],Us.prototype,"min",2),g([b(ln(jl,Bl("min")),{optional:!0})],Us.prototype,"max",2);var oo=class extends Us{normaliseDataDomain(t){const{min:e,max:i}=this,{extent:s,clipped:n}=Xd(t,e,i);return s[0]<0&&s[1]>0||t[0]<0&&t[1]>0?(V0.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||t[0]===0||t[1]===0?(V0.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(t){this.scale.base=t}get base(){return this.scale.base}constructor(t){super(t,new np)}defaultDatumFormatter(t,e){return String(t)}defaultLabelFormatter(t,e){return String(t)}};oo.className="LogAxis",oo.type="log";var xn=class extends fa{constructor(t){super(t,new qy),this.min=void 0,this.max=void 0}normaliseDataDomain(t){let{min:e,max:i}=this,s=!1;return typeof e=="number"&&(e=new Date(e)),typeof i=="number"&&(i=new Date(i)),t.length>2&&(t=Gs(t)?.map(n=>new Date(n))??[]),e instanceof Date&&(s||(s=e>t[0]),t=[e,t[1]]),i instanceof Date&&(s||(s=i<t[1]),t=[t[0],i]),t[0]>t[1]&&(t=[]),{domain:t,clipped:s}}};xn.className="TimeAxis",xn.type="time",g([b(ln(pu,zl("max")),{optional:!0})],xn.prototype,"min",2),g([b(ln(pu,Bl("min")),{optional:!0})],xn.prototype,"max",2);var La=(t,{x0:e,y0:i,x1:s,y1:n,cx:r,cy:o},a,l)=>{if(l&&t.moveTo(e,i),e!==s||i!==n){const c=Math.atan2(i-o,e-r),h=Math.atan2(n-o,s-r);t.arc(r,o,a,c,h)}else t.lineTo(e,i)},Y0=1e-6,Pc=(t,e,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>t?(r=!0,a=t,l=i-Math.sqrt(Math.max(n**2-(s-t)**2))):a<Y0&&(a=0),h>e?(o=!0,c=s-Math.sqrt(Math.max(n**2-(i-e)**2)),h=e):h<Y0&&(h=0),{leading0:a,leading1:l,trailing0:c,trailing1:h,leadingClipped:r,trailingClipped:o}},_c=(t,e,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?t.rect(e,i,s,n):t.rect(o.x,o.y,o.width,o.height);return}else if(o==null&&a===l&&a===c&&a===h){t.roundRect(e,i,s,n,a);return}if(s<0&&(e+=s,s=Math.abs(s)),n<0&&(i+=n,n=Math.abs(n)),s<=0||n<=0)return;if(o==null)o=new B(e,i,s,n);else{const L=Math.max(e,o.x),I=Math.min(e+s,o.x+o.width),N=Math.max(i,o.y),E=Math.min(i+n,o.y+o.height);o=new B(L,N,I-L,E-N)}const p=Math.max(u/n,d/s,1);p>1&&(a/=p,l/=p,c/=p,h/=p);let f=!0,y=!0,x=!0,m=!0,v,S,M,D;if(f){const L=Pc(o.height,o.width,Math.max(e+a-o.x,0),Math.max(i+a-o.y,0),a);L.leadingClipped&&(m=!1),L.trailingClipped&&(y=!1);const I=Math.max(o.x+L.leading1,o.x),N=Math.max(o.y+L.leading0,o.y),E=Math.max(o.x+L.trailing1,o.x),R=Math.max(o.y+L.trailing0,o.y),z=e+a,W=i+a;v={x0:I,y0:N,x1:E,y1:R,cx:z,cy:W}}if(y){const L=Pc(o.width,o.height,Math.max(i+l-o.y,0),Math.max(o.x+o.width-(e+s-l),0),l);L.leadingClipped&&(f=!1),L.trailingClipped&&(x=!1);const I=Math.min(o.x+o.width-L.leading0,o.x+o.width),N=Math.max(o.y+L.leading1,o.y),E=Math.min(o.x+o.width-L.trailing0,o.x+o.width),R=Math.max(o.y+L.trailing1,o.y),z=e+s-l,W=i+l;S={x0:I,y0:N,x1:E,y1:R,cx:z,cy:W}}if(x){const L=Pc(o.height,o.width,Math.max(o.x+o.width-(e+s-c),0),Math.max(o.y+o.height-(i+n-c),0),c);L.leadingClipped&&(y=!1),L.trailingClipped&&(m=!1);const I=Math.min(o.x+o.width-L.leading1,o.x+o.width),N=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),R=Math.min(o.y+o.height-L.trailing0,o.y+o.height),z=e+s-c,W=i+n-c;M={x0:I,y0:N,x1:E,y1:R,cx:z,cy:W}}if(m){const L=Pc(o.width,o.height,Math.max(o.y+o.height-(i+n-h),0),Math.max(e+h-o.x,0),h);L.leadingClipped&&(x=!1),L.trailingClipped&&(f=!1);const I=Math.max(o.x+L.leading0,o.x),N=Math.min(o.y+o.height-L.leading1,o.y+o.height),E=Math.max(o.x+L.trailing0,o.x),R=Math.min(o.y+o.height-L.trailing1,o.y+o.height),z=e+h,W=i+n-h;D={x0:I,y0:N,x1:E,y1:R,cx:z,cy:W}}let C=!1;f&&v!=null&&(La(t,v,a,!C),C||(C=!0)),y&&S!=null&&(La(t,S,l,!C),C||(C=!0)),x&&M!=null&&(La(t,M,c,!C),C||(C=!0)),m&&D!=null&&La(t,D,h,!C),t.closePath()},Ue=class extends Je{constructor(){super(...arguments),this.borderPath=new Or,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=ki.defaultStyles.strokeWidth,this.effectiveStrokeWidth=ki.defaultStyles.strokeWidth,this.hittester=super.isPointInPath.bind(this),this.distanceCalculator=super.distanceSquaredTransformedPoint.bind(this),this.microPixelEffectOpacity=1}set cornerRadius(t){this.topLeftCornerRadius=t,this.topRightCornerRadius=t,this.bottomRightCornerRadius=t,this.bottomLeftCornerRadius=t}isDirtyPath(){return this.lastUpdatePathStrokeWidth!==this.strokeWidth||!!(this.path.isDirty()||this.borderPath.isDirty())}updatePath(){const{path:t,borderPath:e,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 f=1/(this.layerManager?.canvas.pixelRatio??1);let y=1;if(t.clear(!0),e.clear(!0),i&&(c<=f&&(y*=c/f),h<=f&&(y*=h/f),c=this.align(a,c),h=this.align(l,h),a=this.align(a),l=this.align(l),d=d!=null?new B(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<f){const x=a+f/2;e.moveTo(x,l),e.lineTo(x,l+h),u=f,this.borderClipPath=void 0}else if(h<f){const x=l+f/2;e.moveTo(a,x),e.lineTo(a+c,x),u=f,this.borderClipPath=void 0}else if(u<c&&u<h){const x=u/2;a+=x,l+=x,c-=u,h-=u;const m=d?.clone().shrink(x),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)&&(_c(t,a,l,c,h,v,m),_c(e,a,l,c,h,v,m))}else this.borderClipPath=this.borderClipPath??new Or,this.borderClipPath.clear(!0),this.borderClipPath.rect(a,l,c,h),e.rect(a,l,c,h);else{const x={topLeft:s,topRight:n,bottomRight:r,bottomLeft:o};this.borderClipPath=void 0,_c(t,a,l,c,h,x,d)}if([s,n,r,o].every(x=>x===0)){const x=this.getBBox();this.hittester=x.containsPoint.bind(x),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:t,y:e,width:i,height:s,clipBBox:n}=this;return n?.clone()??new B(t,e,i,s)}isPointInPath(t,e){return this.hittester(t,e)}get midPoint(){return{x:this.x+this.width/2,y:this.y+this.height/2}}distanceSquared(t,e){return this.distanceCalculator(t,e)}applyFillAlpha(t){const{fillOpacity:e,microPixelEffectOpacity:i,opacity:s}=this;t.globalAlpha*=s*e*i}renderStroke(t){const{stroke:e,effectiveStrokeWidth:i}=this;if(e&&i){const{globalAlpha:s}=t,{strokeOpacity:n,lineDash:r,lineDashOffset:o,lineCap:a,lineJoin:l,borderPath:c,borderClipPath:h,opacity:u,microPixelEffectOpacity:d}=this;h&&t.clip(h.getPath2D()),this.applyStroke(t),t.globalAlpha*=u*n*d,t.lineWidth=i,r&&t.setLineDash(r),o&&(t.lineDashOffset=o),a&&(t.lineCap=a),l&&(t.lineJoin=l),t.stroke(c.getPath2D()),t.globalAlpha=s}}};Ue.className="Rect",g([ot()],Ue.prototype,"x",2),g([ot()],Ue.prototype,"y",2),g([ot()],Ue.prototype,"width",2),g([ot()],Ue.prototype,"height",2),g([ot()],Ue.prototype,"topLeftCornerRadius",2),g([ot()],Ue.prototype,"topRightCornerRadius",2),g([ot()],Ue.prototype,"bottomRightCornerRadius",2),g([ot()],Ue.prototype,"bottomLeftCornerRadius",2),g([ot()],Ue.prototype,"clipBBox",2),g([ot()],Ue.prototype,"crisp",2);var ao=class extends Il{constructor(t){super(),this.ctx=t,this.rectNode=new Ue,this.textNode=new me,this.fill="white",this.node=this.createNode(),this.node.append([this.rectNode,this.textNode]),this.visible=!0,this.destroyFns.push(t.scene.attachNode(this.node),t.layoutManager.addListener("layout:complete",e=>this.onLayoutComplete(e)))}createNode(){return new it({name:"background",zIndex:0})}onLayoutComplete(t){const{width:e,height:i}=t.chart;this.rectNode.width=e,this.rectNode.height=i}};g([b(H),De("node","visible")],ao.prototype,"visible",2),g([b(dt,{optional:!0}),De("rectNode","fill")],ao.prototype,"fill",2),g([b(F,{optional:!0})],ao.prototype,"image",2),g([b(O,{optional:!0}),De("textNode")],ao.prototype,"text",2);var W0={type:"root",optionsKey:"background",packageType:"community",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new ao(t)},$0=(w(),k(T));function CT({orientation:t,bboxes:e,maxHeight:i,maxWidth:s,itemPaddingY:n=0,itemPaddingX:r=0,forceResult:o=!1}){const a=t==="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<e.length;){const d=e.slice(h),p=NT(d,h,l,c,o);if(!p)return;h+=p.processedBBoxCount,u.push(p.pageIndices)}return kT(u,t,e,n,r)}function NT(t,e,i,s,n){let o=ET(t,i);if(o<1){if(!n)return;o=1}let a=o;for(;a>=1;){const l=TT(t,e,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 TT(t,e,i,s,n,r){const o=[];let a=0,l=0,c=[];const h=[];for(let u=0;u<t.length;u++){const d=(u+i)%i;d===0&&(a+=l,l=0,c.length>0&&o.push(c),c=[]);const p=s.fn(t[u])+s.padding;h[d]=Math.max(h[d]??0,p),l=Math.max(l,n.fn(t[u])+n.padding);const f=a+l,y=!r||o.length>0;if(f>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+e)}return c.length>0&&o.push(c),o.length>0?o:void 0}function kT(t,e,i,s,n){let r=0,o=0;return{pages:t.map(l=>{e==="horizontal"&&(l=wT(l));let c=0;const h=l.map(p=>{const f=p.map(m=>(c=Math.max(m,c),i[m]));let y=0,x=0;return f.forEach(m=>{y+=m.height+s,x=Math.max(x,m.width+n)}),{indices:p,bboxes:f,columnHeight:Math.ceil(y),columnWidth:Math.ceil(x)}});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 wT(t){const e=[];for(const i of t[0])e.push([]);return t.forEach((i,s)=>{i.forEach((n,r)=>{e[r][s]=n})}),e}function ET(t,e){const i=t.length;let s=0;for(let n=0;n<i;n++)if(s+=e.fn(t[n])+e.padding,s>e.max)return i/n<2?Math.ceil(i/2):n;return i}var OT=(w(),k(T)),lo=class extends nt{constructor(){super(...arguments),this.color="black",this.fontStyle=void 0,this.fontWeight=void 0,this.fontSize=12,this.fontFamily="Verdana, sans-serif"}};g([b(dt)],lo.prototype,"color",2),g([b(Ns,{optional:!0})],lo.prototype,"fontStyle",2),g([b(Ts,{optional:!0})],lo.prototype,"fontWeight",2),g([b(j)],lo.prototype,"fontSize",2),g([b(O)],lo.prototype,"fontFamily",2);var Ys=class extends nt{constructor(){super(...arguments),this.size=15,this.fill=void 0,this.fillOpacity=void 0,this.stroke=void 0,this.strokeWidth=1,this.strokeOpacity=1}};g([b(j)],Ys.prototype,"size",2),g([b(dt,{optional:!0})],Ys.prototype,"fill",2),g([b(It,{optional:!0})],Ys.prototype,"fillOpacity",2),g([b(dt,{optional:!0})],Ys.prototype,"stroke",2),g([b(j)],Ys.prototype,"strokeWidth",2),g([b(It)],Ys.prototype,"strokeOpacity",2);var jc=class extends nt{constructor(t){super(),this.parent=t,this.shape="triangle",this.size=15,this.padding=8}};g([ni({changeValue(){this.parent.marker===this&&this.parent.onMarkerShapeChange()}})],jc.prototype,"shape",2),g([b(j)],jc.prototype,"size",2),g([b(j)],jc.prototype,"padding",2);var rr=class extends nt{constructor(t,e){super(),this.chartUpdateCallback=t,this.pageUpdateCallback=e,this.id=fi(this),this.marker=new jc(this),this.activeStyle=new Ys,this.inactiveStyle=new Ys,this.highlightStyle=new Ys,this.label=new lo,this.group=new Xe({name:"pagination"}),this.labelNode=new me,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 xe,this.previousButton=new xe,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(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}set enabled(t){this._enabled=t,this.updateGroupVisibility()}get enabled(){return this._enabled}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible}set orientation(t){switch(this._orientation=t,t){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:t,padding:e}=this.marker;this.nextButton.size=t,this.previousButton.size=t,this.labelNode.x=t/2+e}updateNextButtonPosition(){const t=this.labelNode.getBBox();this.nextButton.translationX=t.width+(this.marker.size/2+this.marker.padding)*2}updateLabel(){const{currentPage:t,totalPages:e,labelNode:i,label:{color:s,fontStyle:n,fontWeight:r,fontSize:o,fontFamily:a}}=this;i.text=`${t+1} / ${e}`,i.fill=s,i.fontStyle=n,i.fontWeight=r,i.fontSize=o,i.fontFamily=a}updateMarkers(){const{nextButton:t,previousButton:e,nextButtonDisabled:i,previousButtonDisabled:s,activeStyle:n,inactiveStyle:r,highlightStyle:o,highlightActive:a}=this,l=(c,h)=>h?r:c===a?o:n;this.updateMarker(t,l("next",i)),this.updateMarker(e,l("previous",s))}updateMarker(t,e){const{shape:i,size:s}=this.marker;t.shape=i,t.size=s,t.fill=e.fill,t.fillOpacity=e.fillOpacity??1,t.stroke=e.stroke,t.strokeWidth=e.strokeWidth,t.strokeOpacity=e.strokeOpacity}enableOrDisableButtons(){const{currentPage:t,totalPages:e}=this,i=e===0,s=t===e-1,n=t===0;this.nextButtonDisabled=s||i,this.previousButtonDisabled=n||i}setPage(t){t=(0,OT.clamp)(0,t,Math.max(0,this.totalPages-1)),this.currentPage!==t&&(this.currentPage=t,this.onPaginationChanged())}getCursor(t){return{previous:this.previousButtonDisabled,next:this.nextButtonDisabled}[t]?void 0:"pointer"}onClick(t,e){t.preventDefault(),e==="next"&&!this.nextButtonDisabled?(this.incrementPage(),this.onPaginationChanged()):e==="previous"&&!this.previousButtonDisabled&&(this.decrementPage(),this.onPaginationChanged())}onMouseHover(t){this.highlightActive=t,this.updateMarkers(),this.chartUpdateCallback(6)}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(6)}attachPagination(t){t.append(this.group)}getBBox(){return this.group.getBBox()}computeCSSBounds(){const t=Kt.toCanvas(this.previousButton),e=Kt.toCanvas(this.nextButton);return{prev:t,next:e}}};rr.className="Pagination",g([b(F)],rr.prototype,"marker",2),g([b(F)],rr.prototype,"activeStyle",2),g([b(F)],rr.prototype,"inactiveStyle",2),g([b(F)],rr.prototype,"highlightStyle",2),g([b(F)],rr.prototype,"label",2);var rp=class extends nt{constructor(){super(...arguments),this._dirty=!0}markDirty(){this._dirty=!0}markClean(t){this._dirty=!1}isDirty(){return this._dirty}},RT=new Set(["circle","cross","diamond","heart","pin","plus","square","star","triangle"]);function PT(t){return typeof t=="string"&&RT.has(t)}var Ws=class extends nt{constructor(){super(...arguments),this.fill="rgba(255,255,255, 0.33)",this.stroke="rgba(0, 0, 0, 0.4)",this.strokeWidth=2}};g([b(dt,{optional:!0})],Ws.prototype,"fill",2),g([b(It,{optional:!0})],Ws.prototype,"fillOpacity",2),g([b(dt,{optional:!0})],Ws.prototype,"stroke",2),g([b(j,{optional:!0})],Ws.prototype,"strokeWidth",2),g([b(It,{optional:!0})],Ws.prototype,"strokeOpacity",2),g([b(ds,{optional:!0})],Ws.prototype,"lineDash",2),g([b(j,{optional:!0})],Ws.prototype,"lineDashOffset",2);var Fc=class extends nt{};g([b(j,{optional:!0})],Fc.prototype,"strokeWidth",2),g([b(It,{optional:!0})],Fc.prototype,"dimOpacity",2),g([b(H,{optional:!0})],Fc.prototype,"enabled",2);var H0=class extends nt{constructor(){super(...arguments),this.color="black"}};g([b(dt,{optional:!0})],H0.prototype,"color",2);var op=class extends nt{constructor(){super(...arguments),this.enabled=!0}};g([b(H,{optional:!0})],op.prototype,"enabled",2);var Pi=class extends nt{constructor(){super(...arguments),this.type="gradient",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,this.reverse=!1}};g([b(O)],Pi.prototype,"type",2),g([b(zn)],Pi.prototype,"colorStops",2),g([b(O)],Pi.prototype,"bounds",2),g([b(O)],Pi.prototype,"gradient",2),g([b(ct)],Pi.prototype,"rotation",2),g([b(H)],Pi.prototype,"reverse",2);var qt=class extends nt{constructor(){super(...arguments),this.type="pattern",this.colorStops=[],this.bounds="item",this.gradient="linear",this.rotation=0,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}};g([b(O)],qt.prototype,"type",2),g([b(zn)],qt.prototype,"colorStops",2),g([b(O)],qt.prototype,"bounds",2),g([b(O)],qt.prototype,"gradient",2),g([b(ct)],qt.prototype,"rotation",2),g([b(H)],qt.prototype,"reverse",2),g([b(O)],qt.prototype,"pattern",2),g([b(ct)],qt.prototype,"width",2),g([b(ct)],qt.prototype,"height",2),g([b(ct)],qt.prototype,"padding",2),g([b(O)],qt.prototype,"fill",2),g([b(ct)],qt.prototype,"fillOpacity",2),g([b(O)],qt.prototype,"backgroundFill",2),g([b(ct)],qt.prototype,"backgroundFillOpacity",2),g([b(O)],qt.prototype,"stroke",2),g([b(ct)],qt.prototype,"strokeOpacity",2),g([b(ct)],qt.prototype,"strokeWidth",2);var Ca=class extends nt{constructor(){super(...arguments),this.item=new Ws,this.series=new Fc,this.text=new H0}};g([b(F)],Ca.prototype,"item",2),g([b(F)],Ca.prototype,"series",2),g([b(F)],Ca.prototype,"text",2);var Mi=class extends nt{constructor(){super(...arguments),this.visible=!0,this.focusPriority=1/0,this.showInLegend=!0,this.cursor="default",this.nodeClickRange="exact",this.highlight=new op,this.highlightStyle=new Ca}handleUnknownProperties(t,e){"context"in e&&(this.context=e.context,t.delete("context"))}};g([b(O,{optional:!0})],Mi.prototype,"id",2),g([b(H)],Mi.prototype,"visible",2),g([b(Jf,{optional:!0})],Mi.prototype,"focusPriority",2),g([b(H)],Mi.prototype,"showInLegend",2),g([b(O)],Mi.prototype,"cursor",2),g([b(Vl)],Mi.prototype,"nodeClickRange",2),g([b(F)],Mi.prototype,"highlight",2),g([b(F)],Mi.prototype,"highlightStyle",2);var ap=Lt(t=>PT(t)||typeof t=="function","a marker shape keyword such as 'circle', 'diamond' or 'square' or an object extending the Marker class"),Ce=class extends rp{constructor(){super(...arguments),this.enabled=!0,this.shape="circle",this.size=6,this.fillGradientDefaults=new Pi,this.fillPatternDefaults=new qt,this.fillOpacity=1,this.strokeWidth=1,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0}getStyle(){const{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}=this;return{size:t,shape:e,fill:i,fillOpacity:s,stroke:n,strokeWidth:r,strokeOpacity:o,lineDash:a,lineDashOffset:l}}getDiameter(){return this.size+this.strokeWidth}};g([b(H),G()],Ce.prototype,"enabled",2),g([b(ap),G()],Ce.prototype,"shape",2),g([b(j),G()],Ce.prototype,"size",2),g([b(we(dt,us,hs),{optional:!0}),G()],Ce.prototype,"fill",2),g([b(F)],Ce.prototype,"fillGradientDefaults",2),g([b(F)],Ce.prototype,"fillPatternDefaults",2),g([b(It),G()],Ce.prototype,"fillOpacity",2),g([b(dt,{optional:!0}),G()],Ce.prototype,"stroke",2),g([b(j),G()],Ce.prototype,"strokeWidth",2),g([b(It),G()],Ce.prototype,"strokeOpacity",2),g([b(ds)],Ce.prototype,"lineDash",2),g([b(j)],Ce.prototype,"lineDashOffset",2),g([b(Ze,{optional:!0}),G()],Ce.prototype,"itemStyler",2);var _T=(w(),k(T)),jT=class{constructor(t,e){this.idPrefix=e,this.dirty=!0,this.destroyFns=new _m,this.itemList=t.proxyInteractionService.createProxyContainer({type:"list",domManagerId:`${e}-toolbar`,classList:["ag-charts-proxy-legend-toolbar"],ariaLabel:{id:"ariaLabelLegend"}}),this.paginationGroup=t.proxyInteractionService.createProxyContainer({type:"group",domManagerId:`${e}-pagination`,classList:["ag-charts-proxy-legend-pagination"],ariaLabel:{id:"ariaLabelLegendPagination"},ariaOrientation:"horizontal"}),this.itemDescription=(0,_T.createElement)("p"),this.itemDescription.style.display="none",this.itemDescription.id=`${e}-ariaDescription`,this.itemDescription.textContent=this.getItemAriaDescription(t.localeManager),this.itemList.getElement().append(this.itemDescription)}destroy(){this.destroyFns.destroy()}initLegendList(t){if(!this.dirty)return;const{ctx:e,itemSelection:i,datumReader:s,itemListener:n}=t,r=e.localeManager,o=i.length;i.each((a,l,c)=>{a.proxyButton?.destroy(),a.proxyButton=e.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.sourceEvent,a)),h.addListener("blur",()=>n.onLeave()),h.addListener("focus",u=>n.onHover(u.sourceEvent,a)),h.addListener("drag-start",()=>{})}),this.dirty=!1}update(t){t.visible&&(this.initLegendList(t),this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!0)),this.updateVisibility(t.visible)}updateVisibility(t){this.itemList.setHidden(!t),this.paginationGroup.setHidden(!t)}updateItemProxyButtons({itemSelection:t,group:e,pagination:i,interactive:s}){const n=Kt.toCanvas(e);this.itemList.setBounds(n);const r=Math.max(...t.nodes().map(o=>o.getBBox().height));t.each((o,a)=>{if(o.proxyButton){const l=o.pageIndex===i.currentPage,{x:c,y:h,height:u,width:d}=Kt.toCanvas(o),p=(r-u)/2,f={x:c-n.x,y:h-p-n.y,height:r,width:d};o.proxyButton.setCursor("pointer"),o.proxyButton.setEnabled(s&&l),o.proxyButton.setBounds(f)}})}updatePaginationProxyButtons(t,e){const{pagination:i}=t;if(this.paginationGroup.setHidden(!i.visible),e&&"ctx"in t){const{ctx:r,oldPages:o,newPages:a}=t,l=(o?.length??a.length)>1,c=a.length>1;l!==c&&(c?(this.prevButton=r.proxyInteractionService.createProxyElement({type:"button",id:`${this.idPrefix}-prev-page`,textContent:{id:"ariaLabelLegendPagePrevious"},tabIndex:0,parent:this.paginationGroup}),this.prevButton.addListener("click",h=>this.onPageButton(t,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",id:`${this.idPrefix}-next-page`,textContent:{id:"ariaLabelLegendPageNext"},tabIndex:0,parent:this.paginationGroup})),this.nextButton.addListener("click",h=>this.onPageButton(t,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(t,e,i){t.pagination.onClick(e.sourceEvent,i),this.updatePaginationProxyButtons(t,!1)}onDataUpdate(t,e){this.dirty=t.length!==e.length||t.some((i,s,n)=>{const[r,o]=[e[s],t[s]];return r.id!==o.id})}onLocaleChanged(t,e,i){const s=e.length;e.each(({proxyButton:n},r,o)=>{const a=n?.getElement();if(a!=null){const l=i.getItemLabel(r);a.textContent=this.getItemAriaText(t,l,o,s)}}),this.itemDescription.textContent=this.getItemAriaDescription(t)}onPageChange(t){this.updateItemProxyButtons(t),this.updatePaginationProxyButtons(t,!1)}getItemAriaText(t,e,i,s){return i>=0&&e?(i++,t.t("ariaLabelLegendItem",{label:e,index:i,count:s})):t.t("ariaLabelLegendItemUnknown")}getItemAriaDescription(t){return t.t("ariaDescriptionLegendItem")}};function K0(t,e,i,s){const n={defaultPrevented:!1,apiEvent:{type:t,itemId:e,seriesId:i,event:s,preventDefault:()=>n.defaultPrevented=!0}};return n}var _i=class extends Gn(it){constructor(){super({name:"markerLabelGroup"}),this.symbolsGroup=this.appendChild(new it({name:"legend-markerLabel-symbols"})),this.label=this.appendChild(new me),this.enabled=!0,this.pageIndex=NaN,this.spacing=0,this.length=0,this.isCustomMarker=!1,this.marker=this.symbolsGroup.appendChild(new xe({zIndex:1})),this.line=this.symbolsGroup.appendChild(new vi({zIndex:0}));const{label:t,line:e,symbolsGroup:i}=this;e.visible=!1,i.renderToOffscreenCanvas=!0,i.optimizeForInfrequentRedraws=!0,t.textBaseline="middle",t.fontSize=12,t.fontFamily="Verdana, sans-serif",t.fill="black",t.y=1}destroy(){super.destroy(),this.proxyButton?.destroy()}setEnabled(t){this.enabled=t,this.refreshVisibilities()}refreshVisibilities(){const t=this.enabled?1:.5;this.label.opacity=t,this.opacity=t}layout(){const{marker:t,line:e,length:i,isCustomMarker:s}=this;let n=0,r=0;if(t.visible){const{size:o}=t,a=xe.anchor(t.shape);n=(a.x-.5)*o+i/2,r=(a.y-.5)*o,s?(t.x=0,t.y=0,t.translationX=n,t.translationY=r):(t.x=n,t.y=r,t.translationX=0,t.translationY=0)}e.visible&&(e.x1=0,e.x2=i,e.y1=0,e.y2=0)}preRender(t){const e=super.preRender(t);return this.layout(),e}layoutLabel(){const{length:t,spacing:e}=this;this.label.x=t+e}computeBBox(){return this.layout(),super.computeBBox()}};_i.className="MarkerLabel",g([De("label")],_i.prototype,"text",2),g([De("label")],_i.prototype,"fontStyle",2),g([De("label")],_i.prototype,"fontWeight",2),g([De("label")],_i.prototype,"fontSize",2),g([De("label")],_i.prototype,"fontFamily",2),g([De("label","fill")],_i.prototype,"color",2),g([pn(t=>t.layoutLabel())],_i.prototype,"spacing",2),g([pn(t=>t.layoutLabel())],_i.prototype,"length",2),g([G()],_i.prototype,"isCustomMarker",2);var vn=class extends nt{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"}};g([b(j,{optional:!0})],vn.prototype,"maxLength",2),g([b(dt)],vn.prototype,"color",2),g([b(Ns,{optional:!0})],vn.prototype,"fontStyle",2),g([b(Ts,{optional:!0})],vn.prototype,"fontWeight",2),g([b(j)],vn.prototype,"fontSize",2),g([b(O)],vn.prototype,"fontFamily",2),g([b(Ze,{optional:!0})],vn.prototype,"formatter",2);var co=class extends nt{constructor(){super(...arguments),this.shape=void 0,this.size=15,this.padding=8}};g([b(ap,{optional:!0})],co.prototype,"shape",2),g([b(j)],co.prototype,"size",2),g([b(j)],co.prototype,"padding",2),g([b(j,{optional:!0})],co.prototype,"strokeWidth",2),g([b(H)],co.prototype,"enabled",2);var lp=class extends nt{};g([b(j,{optional:!0})],lp.prototype,"strokeWidth",2),g([b(j,{optional:!0})],lp.prototype,"length",2);var Mn=class extends nt{constructor(){super(...arguments),this.paddingX=16,this.paddingY=8,this.showSeriesStroke=!1,this.marker=new co,this.label=new vn,this.line=new lp}};g([b(j,{optional:!0})],Mn.prototype,"maxWidth",2),g([b(j)],Mn.prototype,"paddingX",2),g([b(j)],Mn.prototype,"paddingY",2),g([b(H)],Mn.prototype,"showSeriesStroke",2),g([b(F)],Mn.prototype,"marker",2),g([b(F)],Mn.prototype,"label",2),g([b(F)],Mn.prototype,"line",2);var cp=class extends nt{};g([b(Ze,{optional:!0})],cp.prototype,"legendItemClick",2),g([b(Ze,{optional:!0})],cp.prototype,"legendItemDoubleClick",2);var Na="legend-visibility",hp="legend-other-series",FT={type:"gradient",bounds:"item",gradient:"linear",colorStops:[{color:"black"}],rotation:0,reverse:!1},zT={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},oi=class extends nt{constructor(t){super(),this.ctx=t,this.id=fi(this),this.group=new Xe({name:"legend",zIndex:14}),this.itemSelection=re.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 Mn,this.listeners=new cp,this.enabled=!0,this.position="bottom",this.spacing=20,this.destroyFns=[],this.size=[0,0],this._visible=!0,this.pagination=new rr(e=>t.updateService.update(e),e=>this.updatePageNumber(e)),this.pagination.attachPagination(this.group),this.destroyFns.push(t.contextMenuRegistry.registerDefaultAction({id:Na,type:"legend",label:"contextMenuToggleSeriesVisibility",action:e=>this.contextToggleVisibility(e)}),t.contextMenuRegistry.registerDefaultAction({id:hp,type:"legend",label:"contextMenuToggleOtherSeries",action:e=>this.contextToggleOtherSeries(e)}),t.legendManager.addListener("legend-change",this.onLegendDataChange.bind(this))),this.destroyFns.push(t.layoutManager.registerElement(1,e=>this.positionLegend(e)),t.localeManager.addListener("locale-changed",()=>this.onLocaleChanged()),()=>this.group.remove()),this.domProxy=new jT(this.ctx,this.id),this.ctx.historyManager.addMementoOriginator(t.legendManager)}set data(t){cs(t,this._data)||(this.domProxy.onDataUpdate(this._data,t),this._data=t,this.updateGroupVisibility())}get data(){return this._data}onLegendDataChange({legendData:t=[]}){this.enabled&&(this.data=t.filter(e=>!e.hideInLegend))}destroy(){this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-toolbar`),this.ctx.domManager.removeChild("canvas-overlay",`${this.id}-pagination`),this.destroyFns.forEach(t=>t()),this.itemSelection.clear(),this.domProxy.destroy()}getOrientation(){return this.orientation??"horizontal"}set visible(t){this._visible=t,this.updateGroupVisibility()}get visible(){return this._visible}updateGroupVisibility(){this.group.visible=this.enabled&&this.visible&&this.data.length>0}attachLegend(t){t.appendChild(this.group)}getItemLabel(t){const{ctx:{callbackCache:e}}=this,{formatter:i}=this.item.label;if(i){const s=t.datum;return e.call(this,i,{itemId:t.itemId,value:t.label.text,seriesId:t.seriesId,...s&&{datum:s}})}return t.label.text}calcLayout(t,e){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=Bt.toFontString(n),y=r??t*.8,{markerWidth:x,anyLineEnabled:m}=this.calculateMarkerWidth();if(this.itemSelection.each((E,R)=>{E.fontStyle=a,E.fontWeight=l,E.fontSize=c,E.fontFamily=h;const z=this.updateMarkerLabel(E,R,x,m),W=R.itemId??R.id,$=(this.getItemLabel(R)??"<unknown>").replace(/\r?\n/g," ");E.text=this.truncate($,o,y,z,p,W),d.push(E.getBBox())}),t=Math.max(1,t),e=Math.max(1,e),!isFinite(t))return{};const v=this.size,S=this.oldSize;v[0]=t,v[1]=e,(v[0]!==S[0]||v[1]!==S[1])&&(S[0]=v[0],S[1]=v[1]);const{pages:M,maxPageHeight:D,maxPageWidth:C}=this.updatePagination(d,t,e),L=this.pages;this.pages=M,this.maxPageSize=[C-i,D-s];const I=this.pagination.currentPage,N=this.pages[I];return this.pages.length<1||!N?(this.visible=!1,{oldPages:L}):(this.visible=!0,this.updatePositions(I),this.update(),{oldPages:L})}isCustomMarker(t,e){return t&&e!==void 0&&typeof e!="string"}calcSymbolsEnabled(t){const{showSeriesStroke:e,marker:i}=this.item,s=!!i.enabled||!e||(t.marker.enabled??!0),n=!!(t.line&&e),r=this.isCustomMarker(s,t.marker.shape);return{markerEnabled:s,lineEnabled:n,isCustomMarker:r}}calcSymbolsLengths(t,e,i){const{marker:s,line:n}=this.item;let r;const{shape:o}=t.marker;if(this.isCustomMarker(e,o)){const c=new xe;c.shape=o,c.updatePath();const h=c.getBBox();r=Math.max(h.width,h.height)}const a=e?s.size:0,l=i?n.length??25:0;return{markerLength:a,lineLength:l,customMarkerSize:r}}calculateMarkerWidth(){let t=0,e=!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);t=Math.max(t,l,c,a),e||(e=r)}),{markerWidth:t,anyLineEnabled:e}}updateMarkerLabel(t,e,i,s){const{marker:n,paddingX:r}=this.item,{symbol:o}=e;let a=r;const{markerEnabled:l,isCustomMarker:c}=this.calcSymbolsEnabled(o),h=n.padding;(l||s)&&(a+=h+i);const{marker:u,line:d}=t;return u.visible=l,u.visible&&(u.shape=n.shape??o.marker.shape??"square",u.size=n.size,Qn(u,this.getMarkerStyles(o))),d.visible=s,d.visible&&Qn(d,this.getLineStyles(o)),t.length=i,t.spacing=h,t.isCustomMarker=c,a}truncate(t,e,i,s,n,r){let o=!1;t.length>e&&(t=t.substring(0,e),o=!0);const a=Es.getMeasurer({font:n}),l=zu.truncateLine(t,a,i-s,o);return l.endsWith(Bt.EllipsisChar)?this.truncatedItems.add(r):this.truncatedItems.delete(r),l}updatePagination(t,e,i){const s=this.getOrientation(),n=Math.min(this.paginationTrackingIndex,t.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(t,e,i),h=r.findIndex(S=>S.endIndex>=n);this.pagination.currentPage=(0,$0.clamp)(0,h,r.length-1);const{paddingX:u,paddingY:d}=this.item,p=8,f=a-u,y=o-d;let x=0,m=-l.y-this.item.marker.size/2;c?m+=y+p:(x+=-l.x+f+p,m+=(y-l.height)/2),this.pagination.translationX=x,this.pagination.translationY=m,this.pagination.update(),this.pagination.updateMarkers();let v=0;return this.itemSelection.each((S,M,D)=>{D>(r[v]?.endIndex??1/0)&&v++,S.pageIndex=v}),{maxPageHeight:o,maxPageWidth:a,pages:r}}calculatePagination(t,e,i){const{paddingX:s,paddingY:n}=this.item,r=this.getOrientation(),o=["left","right"].includes(this.position);let a=this.pagination.getBBox(),l=new B(0,0,0,0),c=[],h=0,u=0,d=0;const p=y=>y.width===a.width&&y.height===a.height,f=this.maxWidth!==void 0&&this.maxHeight!==void 0;do{if(d++>10){$0.Logger.warn("unable to find stable legend layout.");break}a=l;const y=e-(o?0:a.width),x=i-(o?a.height:0),m=CT({orientation:r,bboxes:t,maxHeight:x,maxWidth:y,itemPaddingY:n,itemPaddingX:s,forceResult:f});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(t=0){const{item:{paddingY:e},itemSelection:i,pages:s}=this;if(s.length<1||!s[t])return;const{columns:n,startIndex:r,endIndex:o}=s[t];let a=0,l=0;const c=n.length,h=n[0].indices.length,u=this.getOrientation()==="horizontal",d=n[0].bboxes[0].height+e,p=[];i.each((f,y,x)=>{if(x<r||x>o){f.visible=!1;return}const m=x-r;let v,S;u?(v=m%c,S=Math.floor(m/c)):(v=Math.floor(m/h),S=m%h),f.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,f.translationX=a,f.translationY=l)})}updatePageNumber(t){const{itemSelection:e,group:i,pagination:s,pages:n,toggleSeries:r}=this,{startIndex:o,endIndex:a}=n[t];o===0?this.paginationTrackingIndex=0:t===n.length-1?this.paginationTrackingIndex=a:this.paginationTrackingIndex=Math.floor((o+a)/2),this.pagination.update(),this.pagination.updateMarkers(),this.updatePositions(t),this.domProxy.onPageChange({itemSelection:e,group:i,pagination:s,interactive:r}),this.ctx.updateService.update(6)}update(){const{label:{color:t}}=this.item;this.itemSelection.each((e,i)=>{e.setEnabled(i.enabled),e.color=t}),this.updateContextMenu()}updateContextMenu(){const{toggleSeries:t,ctx:{contextMenuRegistry:e}}=this;t?(e.hideAction(Na),e.hideAction(hp)):(e.showAction(Na),e.showAction(hp))}getLineStyles(t){const{stroke:e,strokeOpacity:i=1,strokeWidth:s,lineDash:n}=t.line??{},r=Math.min(2,s??1);return{stroke:e,strokeOpacity:i,strokeWidth:this.item.line.strokeWidth??r,lineDash:n}}getMarkerStyles({marker:t}){const{fill:e,stroke:i,strokeOpacity:s=1,fillOpacity:n=1,strokeWidth:r,lineDash:o,lineDashOffset:a}=t,l=Math.min(2,r??1);return Bn(e)&&(e.width=8,e.height=8,e.padding=1,e.strokeWidth=Math.min(2,e.strokeWidth??2)),ms({fill:e,stroke:i,strokeOpacity:s,fillOpacity:n,strokeWidth:this.item.marker.strokeWidth??l,lineDash:o,lineDashOffset:a},FT,zT)}computePagedBBox(){const t=it.computeChildrenBBox(this.group.children());if(this.pages.length>1){const[e,i]=this.maxPageSize;t.height=Math.max(i,t.height),t.width=Math.max(e,t.width)}return t}findNode(t){const{datum:e,proxyButton:i}=this.itemSelection.select(s=>s.datum?.itemId===t.itemId)[0]??{};if(e===void 0||i===void 0)throw new Error(`AG Charts - Missing required properties { datum: ${e}, proxyButton: ${JSON.stringify(i)} }`);return{datum:e,proxyButton:i}}contextToggleVisibility(t){const{datum:e,proxyButton:i}=this.findNode(t);this.doClick(t.event,e,i)}contextToggleOtherSeries(t){this.doDoubleClick(t.event,this.findNode(t).datum)}onContextClick(t,e){const i=e.datum;this.preventHidingAll&&this.contextMenuDatum?.enabled&&this.getVisibleItemCount()<=1?this.ctx.contextMenuRegistry.disableAction(Na):this.ctx.contextMenuRegistry.enableAction(Na);const{offsetX:s,offsetY:n}=t,{x:r,y:o}=Kt.toCanvasPoint(e,s,n);this.ctx.contextMenuRegistry.dispatchContext("legend",{sourceEvent:t,canvasX:r,canvasY:o},{legendItem:i})}onClick(t,e,i){this.doClick(t,e,i)&&t.preventDefault()}getVisibleItemCount(){return this.ctx.chartService.series.flatMap(t=>t.getLegendData("category")).filter(t=>t.enabled).length}doClick(t,e,i){const{listeners:{legendItemClick:s},ctx:{chartService:n,highlightManager:r},preventHidingAll:o,toggleSeries:a}=this;if(!e)return!1;const{legendType:l,seriesId:c,itemId:h,enabled:u}=e,d=n.series.find(y=>y.id===c);if(!d)return!1;let p=u;const f=K0("click",h,d.id,t);return s?.(f.apiEvent),f.defaultPrevented||(a&&(p=!u,o&&!p&&this.getVisibleItemCount()<2&&(p=!0),i.setChecked(p),this.ctx.chartEventManager.legendItemClick(l,d,h,p,e.legendItemName)),p?r.updateHighlight(this.id,{series:d,itemId:h,datum:void 0,datumIndex:void 0}):r.updateHighlight(this.id),this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0,skipAnimations:e.skipAnimations??!1})),!0}onDoubleClick(t,e){this.doDoubleClick(t,e)&&t.preventDefault()}doDoubleClick(t,e){const{listeners:{legendItemDoubleClick:i},ctx:{chartService:s},toggleSeries:n}=this;if(s.mode==="integrated"||!e)return!1;const{legendType:r,id:o,itemId:a,seriesId:l}=e,c=s.series.find(u=>u.id===o);if(!c)return!1;const h=K0("dblclick",a,c.id,t);if(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 f=u.find(y=>y.itemId===a&&y.seriesId===l);this.ctx.chartEventManager.legendItemDoubleClick(r,c,a,f?.enabled??!1,d,f?.legendItemName)}return this.ctx.legendManager.update(),this.ctx.updateService.update(2,{forceNodeDataRefresh:!0}),!0}toTooltipMeta(t,e){let i;return t instanceof FocusEvent?i=Kt.toCanvas(e).computeCenter():(t.preventDefault(),i=Kt.toCanvasPoint(e,t.offsetX,t.offsetY)),{canvasX:i.x,canvasY:i.y,showArrow:!1}}onHover(t,e){if(!this.enabled)throw new Error("AG Charts - onHover handler called on disabled legend");this.pagination.setPage(e.pageIndex);const i=e.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(t,e);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}):this.updateHighlight()}onLeave(){this.ctx.tooltipManager.removeTooltip(this.id),this.updateHighlight()}updateHighlight(t){this.ctx.interactionManager.isState(32)?this.ctx.highlightManager.updateHighlight(this.id,t):this.ctx.interactionManager.isState(2)&&(this.pendingHighlightDatum=t,this.ctx.animationManager.onBatchStop(()=>{this.ctx.highlightManager.updateHighlight(this.id,this.pendingHighlightDatum)}))}onLocaleChanged(){this.domProxy.onLocaleChanged(this.ctx.localeManager,this.itemSelection,this)}positionLegend(t){const e=this.positionLegendScene(t);this.positionLegendDOM(e)}positionLegendScene(t){if(!this.enabled||!this.data.length)return;const{layoutBox:e}=t,{x:i,y:s,width:n,height:r}=e,[o,a]=this.calculateLegendDimensions(e),{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(),e.shrink(c.height+u,this.position);break;case"left":case"right":default:d=h(),p=(r-c.height)/2,e.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(t){const{ctx:e,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:e,itemSelection:i,group:o,pagination:s,oldPages:t,newPages:n,datumReader:this,itemListener:this})}calculateLegendDimensions(t){const{width:e,height:i}=t,s=e/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,e):e,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,e):Math.round(e*c),l=this.maxHeight?Math.min(this.maxHeight,i):i}}return[a,l]}};oi.className="Legend",g([b(H)],oi.prototype,"toggleSeries",2),g([b(F)],oi.prototype,"pagination",2),g([b(F)],oi.prototype,"item",2),g([b(F)],oi.prototype,"listeners",2),g([pn((t,e,i)=>{if(t.updateGroupVisibility(),e===i)return;const{ctx:{legendManager:s,stateManager:n}}=t;i===!1&&e===!0&&n.restoreState(s)}),b(H)],oi.prototype,"enabled",2),g([b(fu)],oi.prototype,"position",2),g([b(j,{optional:!0})],oi.prototype,"maxWidth",2),g([b(j,{optional:!0})],oi.prototype,"maxHeight",2),g([b(H,{optional:!0})],oi.prototype,"reverseOrder",2),g([b(At(["horizontal","vertical"],"an orientation"),{optional:!0})],oi.prototype,"orientation",2),g([b(H,{optional:!0})],oi.prototype,"preventHidingAll",2),g([b(j)],oi.prototype,"spacing",2);var BT={type:"legend",optionsKey:"legend",identifier:"category",chartTypes:["cartesian","polar","hierarchy","topology","flow-proportion","standalone","gauge"],moduleFactory:t=>new oi(t),packageType:"community",removable:"standalone-only"},Z0={};Ci(Z0,{CARTESIAN_AXIS_TYPE:()=>Q0,CARTESIAN_POSITION:()=>q0,FONT_SIZE:()=>X0,FONT_SIZE_RATIO:()=>up,POLAR_AXIS_SHAPE:()=>tx,POLAR_AXIS_TYPE:()=>J0});var X0=(t=>(t[t.SMALLEST=8]="SMALLEST",t[t.SMALLER=10]="SMALLER",t[t.SMALL=12]="SMALL",t[t.MEDIUM=13]="MEDIUM",t[t.LARGE=14]="LARGE",t[t.LARGEST=17]="LARGEST",t))(X0||{}),up=(t=>(t[t.SMALLEST=.6666666666666666]="SMALLEST",t[t.SMALLER=.8333333333333334]="SMALLER",t[t.SMALL=1]="SMALL",t[t.MEDIUM=1.0833333333333333]="MEDIUM",t[t.LARGE=1.1666666666666667]="LARGE",t[t.LARGEST=1.4166666666666667]="LARGEST",t))(up||{}),q0=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t))(q0||{}),Q0=(t=>(t.CATEGORY="category",t.GROUPED_CATEGORY="grouped-category",t.ORDINAL_TIME="ordinal-time",t.NUMBER="number",t.TIME="time",t.LOG="log",t))(Q0||{}),J0=(t=>(t.ANGLE_CATEGORY="angle-category",t.ANGLE_NUMBER="angle-number",t.RADIUS_CATEGORY="radius-category",t.RADIUS_NUMBER="radius-number",t))(J0||{}),tx=(t=>(t.CIRCLE="circle",t.POLYGON="polygon",t))(tx||{}),dp={};Ci(dp,{DEFAULT_ANNOTATION_HANDLE_FILL:()=>Ra,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>ja,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Fa,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>za,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Ba,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Pa,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>_a,DEFAULT_CAPTION_ALIGNMENT:()=>In,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Dn,DEFAULT_FIBONACCI_STROKES:()=>Ea,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>he,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Qt,DEFAULT_GRIDLINE_ENABLED:()=>ys,DEFAULT_POLAR_SERIES_STROKE:()=>Uc,DEFAULT_SEPARATION_LINES_COLOUR:()=>Ta,DEFAULT_SHADOW_COLOUR:()=>Sn,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Yc,DEFAULT_TEXTBOX_COLOR:()=>Ua,DEFAULT_TEXTBOX_FILL:()=>Ga,DEFAULT_TEXTBOX_STROKE:()=>Va,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Oa,DEFAULT_TOOLBAR_POSITION:()=>Ya,IS_COMMUNITY:()=>pp,IS_DARK_THEME:()=>ho,IS_ENTERPRISE:()=>gp,PALETTE_ALT_DOWN_FILL:()=>bp,PALETTE_ALT_DOWN_STROKE:()=>mp,PALETTE_ALT_NEUTRAL_FILL:()=>xp,PALETTE_ALT_NEUTRAL_STROKE:()=>Vc,PALETTE_ALT_UP_FILL:()=>yp,PALETTE_ALT_UP_STROKE:()=>fp,PALETTE_DOWN_FILL:()=>wa,PALETTE_DOWN_STROKE:()=>Bc,PALETTE_NEUTRAL_FILL:()=>Gc,PALETTE_NEUTRAL_STROKE:()=>uo,PALETTE_UP_FILL:()=>ka,PALETTE_UP_STROKE:()=>zc});var ho=Symbol("is-dark-theme"),pp=Symbol("is-community"),gp=Symbol("is-enterprise"),Ta=Symbol("default-separation-lines-colour"),Sn=Symbol("default-shadow-colour"),Dn=Symbol("default-caption-layout-style"),In=Symbol("default-caption-alignment"),zc=Symbol("palette-up-stroke"),Bc=Symbol("palette-down-stroke"),ka=Symbol("palette-up-fill"),wa=Symbol("palette-down-fill"),uo=Symbol("palette-neutral-stroke"),Gc=Symbol("palette-neutral-fill"),fp=Symbol("palette-alt-up-stroke"),mp=Symbol("palette-alt-down-stroke"),yp=Symbol("palette-alt-up-fill"),bp=Symbol("palette-alt-down-fill"),xp=Symbol("palette-gray-fill"),Vc=Symbol("palette-gray-stroke"),Uc=Symbol("default-polar-series-stroke"),Yc=Symbol("default-sparkline-crosshair-stroke"),Qt=Symbol("default-financial-charts-annotation-stroke"),Ea=Symbol("default-hierarchy-strokes"),Oa=Symbol("default-text-annotation-color"),he=Symbol("default-financial-charts-annotation-background-fill"),Ra=Symbol("default-annotation-handle-fill"),Pa=Symbol("default-annotation-statistics-fill"),_a=Symbol("default-annotation-statistics-stroke"),ja=Symbol("default-annotation-statistics-color"),Fa=Symbol("default-annotation-statistics-divider-stroke"),za=Symbol("default-annotation-statistics-fill"),Ba=Symbol("default-annotation-statistics-stroke"),Ga=Symbol("default-textbox-fill"),Va=Symbol("default-textbox-stroke"),Ua=Symbol("default-textbox-color"),Ya=Symbol("default-toolbar-position"),ys=Symbol("default-gridline-enabled"),ex=[{type:"number",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"bottom","left"]}},{type:"category",position:{$if:[{$eq:[{$path:["/direction",void 0]},"horizontal"]},"left","bottom"]}}],GT={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fillFallback"},{$palette:"fill"}]},vp={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},{$palette:"fillsFallback"},{$palette:"fills"}]},Wc={$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./stroke",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},VT={$if:[{$or:[{$isGradient:[{$palette:"fill"}]},{$isPattern:[{$palette:"fill"}]}]},[{$palette:"fillFallback"},{$palette:"fillFallback"}],{$palette:"range2"}]},An={type:"pattern",pattern:"forward-slanted-lines",width:10,height:10,padding:2,fill:{$if:[{$isGradient:[{$palette:"fill"}]},{$palette:"fillFallback"},{$if:[{$isPattern:[{$palette:"fill"}]},{$path:["./fill",{$palette:"fillFallback"},{$palette:"fill"}]},{$palette:"fill"}]}]},fillOpacity:1,stroke:Wc,strokeOpacity:1,strokeWidth:4,backgroundFill:"transparent",backgroundFillOpacity:1,rotation:0};function Si(t){return Wf(t,e=>{const i=Dt.fromString(e);return[Dt.darken(i,.15).toString(),e,Dt.lighten(i,.15).toString()]})}var Mp=(w(),k(T));function $c(t,e,i,s,n){const{addPhaseFn:r,updatePhaseFn:o,removePhaseFn:a}=n,l=(c,h,u)=>{i.animate({id:`${t}_${e}_${h.id}_${c}`,groupId:t,from:0,to:1,ease:ea,collapsable:!1,onUpdate(d,p){p&&c!=="removed"||(h.path.clear(!0),u(d,h),h.checkPathDirty())},onStop(){c==="added"&&(h.path.clear(!0),u(1,h),h.checkPathDirty())},phase:Ki[c]})};for(const c of s)i.isSkipped()||(l("removed",c,a),l("updated",c,o)),l("added",c,r)}function Mt({id:t},e,i,...s){js(t,e,i,s,{opacity:0},{opacity:1},{phase:"trailing"})}function Ln({id:t},e,i,...s){js(t,e,i,s,{opacity:1},{opacity:0},{phase:"remove"})}function $s(t){return{opacity:1}}var ts=class extends rp{constructor(){super(...arguments),this.enabled=!0,this.color="rgba(0, 0, 0, 0.5)",this.xOffset=0,this.yOffset=0,this.blur=5}};g([b(H),G()],ts.prototype,"enabled",2),g([b(dt),G()],ts.prototype,"color",2),g([b(ct),G()],ts.prototype,"xOffset",2),g([b(ct),G()],ts.prototype,"yOffset",2),g([b(j),G()],ts.prototype,"blur",2);var ix=class extends nt{constructor(){super(...arguments),this.enabled=!1}};g([b(H)],ix.prototype,"enabled",2);var Ye=class extends nt{constructor(){super(...arguments),this.interaction=new ix,this.position=new Bs,this.range=void 0,this.class=void 0}formatTooltip(t,e,i){const s=this.renderer==null?void 0:td(t,this.renderer,[i]);return typeof s=="string"?{type:"raw",rawHtmlString:s}:s!=null?{type:"structured",...e,...s}:{type:"structured",...e}}};g([b(H,{optional:!0})],Ye.prototype,"enabled",2),g([b(H,{optional:!0})],Ye.prototype,"showArrow",2),g([b(Ze,{optional:!0})],Ye.prototype,"renderer",2),g([b(F)],Ye.prototype,"interaction",2),g([b(F)],Ye.prototype,"position",2),g([b(Vl,{optional:!0})],Ye.prototype,"range",2),g([b(O,{optional:!0})],Ye.prototype,"class",2);var po=(w(),k(T)),UT=class{constructor(t,e,i){this.root=new $T(t,e,i)}clear(t){this.root.clear(t)}addValue(t,e){const i={hitTester:t,value:e,distanceSquared:(s,n)=>t.distanceSquared(s,n)};this.root.addElem(i)}find(t,e){const i={best:{nearest:void 0,distanceSquared:1/0}};return this.root.find(t,e,i),i.best}},YT=class{constructor(t,e,i,s){this.nw=t,this.ne=e,this.sw=i,this.se=s}addElem(t){this.nw.addElem(t),this.ne.addElem(t),this.sw.addElem(t),this.se.addElem(t)}find(t,e,i){this.nw.find(t,e,i),this.ne.find(t,e,i),this.sw.find(t,e,i),this.se.find(t,e,i)}},WT=class{constructor(t,e,i){this.capacity=t,this.maxdepth=e,this.boundary=i??B.NaN,this.elems=[],this.subdivisions=void 0}clear(t){this.elems.length=0,this.boundary=t,this.subdivisions=void 0}addElem(t){this.addCondition(t)&&(this.subdivisions===void 0?this.maxdepth===0||this.elems.length<this.capacity?this.elems.push(t):this.subdivide(t):this.subdivisions.addElem(t))}find(t,e,i){this.findCondition(t,e,i)&&(this.subdivisions===void 0?this.findAction(t,e,i):this.subdivisions.find(t,e,i))}subdivide(t){this.subdivisions=this.makeSubdivisions();for(const e of this.elems)this.subdivisions.addElem(e);this.subdivisions.addElem(t),this.elems.length=0}makeSubdivisions(){const{x:t,y:e,width:i,height:s}=this.boundary,{capacity:n}=this,r=this.maxdepth-1,o=i/2,a=s/2,l=new B(t,e,o,a),c=new B(t+o,e,o,a),h=new B(t,e+a,o,a),u=new B(t+o,e+a,o,a);return new YT(this.child(n,r,l),this.child(n,r,c),this.child(n,r,h),this.child(n,r,u))}},$T=class Xv extends WT{addCondition(e){const{x:i,y:s}=e.hitTester.midPoint;return this.boundary.containsPoint(i,s)}findCondition(e,i,s){const{best:n}=s;return n.distanceSquared!==0&&this.boundary.distanceSquared(e,i)<n.distanceSquared}findAction(e,i,s){const n=Nl(e,i,this.elems,s.best.distanceSquared);n.nearest!==void 0&&n.distanceSquared<s.best.distanceSquared&&(s.best=n)}child(e,i,s){return new Xv(e,i,s)}},HT=(w(),k(T)),Sp=class extends Cc{constructor({clipFocusBox:t,categoryKey:e,...i}){super(i),this.categoryKey=e,this.clipFocusBox=t??!0}getScaleInformation({xScale:t,yScale:e}){const i=Ct.is(t),s=Ct.is(e);return{isContinuousX:i,isContinuousY:s,xScaleType:t?.type,yScaleType:e?.type}}getModulePropertyDefinitions(){const t=this.axes.x?.scale,e=this.axes.y?.scale;return this.moduleMap.mapModules(i=>i.getPropertyDefinitions(this.getScaleInformation({xScale:t,yScale:e}))).flat()}async requestDataModel(t,e,i){i.props.push(...this.getModulePropertyDefinitions());const{dataModel:s,processedData:n}=await t.request(this.id,e??[],i);return this.dataModel=s,this.processedData=n,this.dispatch("data-processed",{dataModel:s,processedData:n}),{dataModel:s,processedData:n}}isProcessedDataAnimatable(){const t=this.processedData?.reduced?.animationValidation;if(!t)return!0;const{orderedKeys:e,uniqueKeys:i}=t;return e&&i}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}pickFocus(t){const e=this.getNodeData();if(e===void 0||e.length===0)return;const i=this.computeFocusDatumIndex(t,e);if(i===void 0)return;const{clipFocusBox:s}=this,n=e[i],r={...t,datumIndex:i},o=this.computeFocusBounds(r);if(o!==void 0)return{bounds:o,clipFocusBox:s,datum:n,datumIndex:i}}isDatumEnabled(t,e){const{missing:i=!1,enabled:s=!0,focusable:n=!0}=t[e];return!i&&s&&n}computeFocusDatumIndex(t,e){const i=(o,a)=>{for(;o>=0&&!this.isDatumEnabled(e,o);)o+=a;return o===-1?void 0:o},s=(o,a)=>{for(;o<e.length&&!this.isDatumEnabled(e,o);)o+=a;return o===e.length?void 0:o};let n;const r=(0,HT.clamp)(0,t.datumIndex,e.length-1);return t.datumIndexDelta<0?n=i(r,t.datumIndexDelta):t.datumIndexDelta>0?n=s(r,t.datumIndexDelta):n=s(r,1)??i(r,-1),n===void 0?t.datumIndexDelta===0?void 0:t.datumIndex-t.datumIndexDelta:n}keysOrValues(t){const e=this.dataModel.resolveProcessedDataIndexById(this,t);return this.processedData?.keys[e]?.get(this.id)??this.processedData?.columns[e]??[]}getCategoryKey(){return this.categoryKey}getCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();return!e||!i||!s||(e.invalidData?.get(this.id)?.[t]??!1)?void 0:this.keysOrValues(s)[t]}datumIndexForCategoryValue(t){const{processedData:e,dataModel:i}=this,s=this.getCategoryKey();if(!e||!i||!s)return;t=t.valueOf();const n=e.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(cs(t,a))return o}}},or={x:["xKey"],y:["yKey"]},ar={x:["xName"],y:["yName"]},Dp=class extends ya{constructor(t,e,i,s){super(t,e,i,s),this.xKey=s.properties.xKey,this.yKey=s.properties.yKey}},Hs=class extends Mi{constructor(){super(...arguments),this.pickOutsideVisibleMinorAxis=!1}};g([b(O,{optional:!0})],Hs.prototype,"legendItemName",2),g([b(H,{optional:!0})],Hs.prototype,"pickOutsideVisibleMinorAxis",2);var Hc=100,Cn=class extends Sp{constructor({pathsPerSeries:t=["path"],hasMarkers:e=!1,hasHighlightedLabels:i=!1,pathsZIndexSubOrderOffset:s=[],datumSelectionGarbageCollection:n=!0,markerSelectionGarbageCollection:r=!0,animationAlwaysUpdateSelections:o=!1,animationResetFns:a,directionKeys:l,directionNames:c,...h}){if(super({directionKeys:l,directionNames:c,canHaveAxes:!0,...h}),this.NodeEvent=Dp,this.dataNodeGroup=this.contentGroup.appendChild(new it({name:`${this.id}-series-dataNodes`,zIndex:0})),this.markerGroup=this.contentGroup.appendChild(new it({name:`${this.id}-series-markers`,zIndex:1})),this.labelGroup=this.contentGroup.appendChild(new Xe({name:`${this.id}-series-labels`})),this.labelSelection=re.select(this.labelGroup,me),this.highlightSelection=re.select(this.highlightNode,()=>this.opts.hasMarkers?new xe:this.nodeFactory()),this.highlightLabelSelection=re.select(this.highlightLabel,me),this.annotationSelections=new Set,this.debug=vt.create(),!l||!c)throw new Error(`Unable to initialise series type ${this.type}`);this.opts={pathsPerSeries:t,hasMarkers:e,hasHighlightedLabels:i,pathsZIndexSubOrderOffset:s,directionKeys:l,directionNames:c,animationResetFns:a,animationAlwaysUpdateSelections:o,datumSelectionGarbageCollection:n,markerSelectionGarbageCollection:r},this.paths=t.map(u=>new Je({name:`${this.id}-${u}`})),this.datumSelection=re.select(this.dataNodeGroup,()=>this.nodeFactory(),n),this.markerSelection=re.select(this.markerGroup,xe,r),this.animationState=new ga("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(t,e,i){super.attachSeries(t,e,i),this.attachPaths(this.paths,e,i)}detachSeries(t,e,i){super.detachSeries(t,e,i),this.detachPaths(this.paths,e,i)}attachPaths(t,e,i){for(const s of t)this.contentGroup.appendChild(s)}detachPaths(t,e,i){for(const s of t)this.contentGroup.removeChild(s)}renderToOffscreenCanvas(){const t=this.getNodeData();return t!=null&&t.length>Hc}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"?this.animationState.transition("skip"):t==="disabled"&&this.animationState.transition("disable")}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager.addListener("legend-item-click",t=>this.onLegendItemClick(t)),this.ctx.chartEventManager.addListener("legend-item-double-click",t=>this.onLegendItemDoubleClick(t)))}destroy(){super.destroy(),this._contextNodeData=void 0}update({seriesRect:t}){const{visible:e,_contextNodeData:i}=this,n=this.ctx.highlightManager?.getActiveHighlight()?.series===this,r=this.checkResize(t),o=this.updateHighlightSelection(n);this.updateSelections(e),this.updateNodes(o,n,e);const a=this.getAnimationData(t,i);a&&(r&&this.animationState.transition("resize",a),this.animationState.transition("update",a))}updateSelections(t){var e;const i=!this.opts.animationAlwaysUpdateSelections&&this.ctx.animationManager.isSkipped();if(!(!t&&i)&&!(!this.nodeDataRefresh&&!this.isPathOrSelectionDirty())){if(this.nodeDataRefresh){this.nodeDataRefresh=!1,this.debug("CartesianSeries.updateSelections() - calling createNodeData() for",this.id),this.markQuadtreeDirty(),this._contextNodeData=this.createNodeData();const s=this.isProcessedDataAnimatable();this._contextNodeData&&((e=this._contextNodeData).animationValid??(e.animationValid=s));const{dataModel:n,processedData:r}=this;n!==void 0&&r!==void 0&&this.dispatch("data-update",{dataModel:n,processedData:r})}this.updateSeriesSelections()}}updateSeriesSelections(t){const{datumSelection:e,labelSelection:i,markerSelection:s,paths:n}=this,r=this._contextNodeData;if(!r)return;const{nodeData:o,labelData:a,itemId:l}=r;this.updatePaths({seriesHighlighted:t,itemId:l,contextData:r,paths:n}),this.datumSelection=this.updateDatumSelection({nodeData:o,datumSelection:e}),this.labelSelection=this.updateLabelSelection({labelData:a,labelSelection:i})??i,this.opts.hasMarkers&&(this.markerSelection=this.updateMarkerSelection({nodeData:o,markerSelection:s}))}getShapeFillBBox(){const{axes:t}=this,e=t.x,i=t.y,[s,n]=ne(e?.range??[0,1]),[r,o]=ne(i?.range??[0,1]),a=this.getSeriesDomain("x"),l=[e?.scale.convert(a.at(0)),e?.scale.convert(a.at(-1))],c=this.getSeriesDomain("y"),h=[i?.scale.convert(c.at(0)),i?.scale.convert(c.at(-1))],[u,d]=ne(l),[p,f]=ne(h);return{axis:new B(s,r,n-s,o-r),series:new B(u,p,d-u,f-p)}}updateNodes(t,e,i){const{highlightSelection:s,highlightLabelSelection:n,opts:{hasMarkers:r,hasHighlightedLabels:o}}=this,a=!this.ctx.animationManager.isSkipped(),l=this.visible&&this._contextNodeData!=null&&i;this.contentGroup.visible=a||l,this.highlightGroup.visible=(a||l)&&e;const c=this.getOpacity();r?(this.updateMarkerNodes({markerSelection:s,isHighlight:!0}),this.animationState.transition("highlightMarkers",s)):(this.updateDatumNodes({datumSelection:s,isHighlight:!0}),this.animationState.transition("highlight",s)),o&&this.updateLabelNodes({labelSelection:n});const{dataNodeGroup:h,markerGroup:u,datumSelection:d,labelSelection:p,markerSelection:f,paths:y,labelGroup:x}=this,{itemId:m}=this.contextNodeData??{};h.opacity=c,h.visible=a||l,x.visible=l,r&&(u.opacity=c,u.visible=l),x&&(x.opacity=c),this.updatePathNodes({seriesHighlighted:e,itemId:m,paths:y,opacity:c,visible:l,animationEnabled:a}),h.visible&&(this.updateDatumNodes({datumSelection:d,highlightedItems:t,isHighlight:!1}),this.usesPlacedLabels||this.updateLabelNodes({labelSelection:p}),r&&this.updateMarkerNodes({markerSelection:f,isHighlight:!1}))}getHighlightLabelData(t,e){const i=t.filter(s=>s.datum===e.datum&&s.itemId===e.itemId);return i.length===0?void 0:i}getHighlightData(t,e){return e?[e]:void 0}updateHighlightSelection(t){const{highlightSelection:e,highlightLabelSelection:i,_contextNodeData:s}=this;if(!s)return;const n=this.ctx.highlightManager?.getActiveHighlight(),r=t&&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:e}),this.highlightLabelSelection=this.updateHighlightSelectionLabel({items:o,highlightLabelSelection:i}),a}markQuadtreeDirty(){this.quadtree=void 0}*datumNodesIter(){for(const{node:t}of this.datumSelection)t.datum.missing!==!0&&(yield t)}getQuadTree(){if(this.quadtree===void 0){const{width:t,height:e}=this.ctx.scene.canvas,i=new B(0,0,t,e);this.quadtree=new UT(100,10,i),this.initQuadTree(this.quadtree)}return this.quadtree}initQuadTree(t){}pickNodesExactShape(t){const e=super.pickNodesExactShape(t);if(e.length!==0)return e;const{x:i,y:s}=t,{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(t)??{};if(c!=null&&c?.missing!==!0)return[c]}return[]}pickNodeClosestDatum(t){const{x:e,y:i}=t,{axes:s,_contextNodeData:n}=this;if(!n)return;const r=s.x,o=s.y,a={x:e,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 f=Math.max((a.x-u)**2+(a.y-d)**2,0);f<l&&(l=f,c=h)}for(const h of this.moduleMap.modules()){const u=h.pickNodeNearest(t);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(t,e){const{x:i,y:s}=t,{axes:n,_contextNodeData:r}=this,{pickOutsideVisibleMinorAxis:o}=this.properties;if(!r)return;const a=n.x,l=n.y,c=[a,l].filter(tr.is).map(f=>f.direction);if(e&&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 f of r.nodeData){const{x:y=NaN,y:x=NaN}=f.point??f.midPoint??{};if(isNaN(y)||isNaN(x)||f.missing===!0)continue;const m=[a?.inRange(y),l?.inRange(x)];if(h!=="x"&&m.reverse(),!m[0]||!o&&!m[1])continue;const v=[y,x];h!=="x"&&v.reverse();let S=!0;for(let M=0;M<v.length;M++){const D=Math.abs(v[M]-u[M]);if(D>d[M]){S=!1;break}else D<d[M]&&(d[M]=D,d.fill(1/0,M+1,d.length))}S&&(p=f)}if(p){let f=Math.max(d[0]**2+d[1]**2-(p.point?.size??0),0);for(const y of this.moduleMap.modules()){const x=y.pickNodeMainAxisFirst(t);if(x!==void 0&&x.distanceSquared<f){p=x.datum,f=x.distanceSquared;break}}return{datum:p,distance:Math.sqrt(f)}}}isPathOrSelectionDirty(){return!1}shouldFlipXY(){return!1}visibleRange(t,e,i){const s=this.keysOrValues(t),n=0;return Ay(i?.length??s.length,e,r=>{const o=i?.[r]??r;return this.xCoordinateRange(s[o],n,o)})}domainForVisibleRange(t,e,i,s,n,r){const{processedData:o,dataModel:a}=this,[l,c]=s,h=this.keysOrValues(i);if(n){const f=this.visibleRange(i,s,r);return a.getDomainBetweenRange(this,e,f,o)}const u=e.map(f=>this.keysOrValues(f));let d=1/0,p=-1/0;return h.forEach((f,y)=>{const[x,m]=this.xCoordinateRange(f,0,y);if(!(m<l||x>c))for(let v=0;v<e.length;v++){const S=u[v][y];d=Math.min(d,S),p=Math.max(p,S)}}),d>p?[NaN,NaN]:[d,p]}domainForClippedRange(t,e,i,s){const{processedData:n,dataModel:r,axes:o}=this,l=KT(o[t==="x"?"y":"x"]);if(!l)return e.flatMap(f=>r.getDomain(this,f,"value",n));const c=this.keysOrValues(i);if(s){const f=ZT(c.length,l,y=>c[y]);return r.getDomainBetweenRange(this,e,f,n)}const h=e.map(f=>this.keysOrValues(f)),u=l[0].valueOf(),d=l[1].valueOf(),p=[];return c.forEach((f,y)=>{const x=f.valueOf();if(x<u||x>d)return;const m=h.map(v=>v[y]);x>=u&&p.push(...m),x<=d&&p.push(...m)}),p}countVisibleItems(t,e,i,s,n){const{dataModel:r,processedData:o}=this;if(!r||!o)return 1/0;const a=this.keysOrValues(t),l=e.map(D=>r.resolveColumnById(this,D,o)),c=this.axes.x,h=this.axes.y,u=this.shouldFlipXY(),d=c.range,p=h.range,f=(D,C,L)=>D[0]+(L-C[0])/(C[1]-C[0])*(D[1]-D[0]),y=f(d,c.visibleRange,i[0]),x=f(d,c.visibleRange,i[1]),m=f(p,h.visibleRange,u?s[0]:s[1]),v=f(p,h.visibleRange,u?s[1]:s[0]),S=Math.round((i[0]+(i[1]-i[0])/2)*a.length),M=0;return Ly(0,a.length-1,S,n,D=>{let[C,L]=this.xCoordinateRange(a[D],M,D),[I,N]=this.yCoordinateRange(l.map(E=>E[D]),M,D);return!(0,po.isFiniteNumber)(C)||!(0,po.isFiniteNumber)(L)||!(0,po.isFiniteNumber)(I)||!(0,po.isFiniteNumber)(N)?!1:(u&&([C,L,I,N]=[I,N,C,L]),C>=y&&L<=x&&I>=m&&N<=v)})}updateHighlightSelectionItem(t){const{opts:{hasMarkers:e}}=this,{items:i,highlightSelection:s}=t,n=i??[];if(e){const r=s;return this.updateMarkerSelection({nodeData:n,markerSelection:r})}else return this.updateDatumSelection({nodeData:n,datumSelection:s})}updateHighlightSelectionLabel(t){return this.updateLabelSelection({labelData:t.items??[],labelSelection:t.highlightLabelSelection})}updateDatumSelection(t){return t.datumSelection}updateDatumNodes(t){}updateMarkerSelection(t){return t.markerSelection}updateMarkerNodes(t){}updatePaths(t){t.paths.forEach(e=>e.visible=!1)}updatePathNodes(t){const{paths:e,opacity:i,visible:s}=t;for(const n of e)n.opacity=i,n.visible=s}resetPathAnimation(t){const{path:e}=this.opts?.animationResetFns??{};e&&t.paths.forEach(i=>{Ie([i],e)})}resetDatumAnimation(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Ie([t.datumSelection],e)}resetLabelAnimation(t){const{label:e}=this.opts?.animationResetFns??{};e&&Ie([t.labelSelection],e)}resetMarkerAnimation(t){const{marker:e}=this.opts?.animationResetFns??{};e&&this.opts.hasMarkers&&Ie([t.markerSelection],e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id),this.resetPathAnimation(t),this.resetDatumAnimation(t),this.resetLabelAnimation(t),this.resetMarkerAnimation(t),t.contextData?.animationValid===!1&&this.ctx.animationManager.skipCurrentBatch()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){const{datum:e}=this.opts?.animationResetFns??{};e&&Ie([t],e)}animateReadyHighlightMarkers(t){const{marker:e}=this.opts?.animationResetFns??{};e&&Ie([t],e)}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(t,e){const{_contextNodeData:i}=this;return i?{datumSelection:this.datumSelection,markerSelection:this.markerSelection,labelSelection:this.labelSelection,annotationSelections:[...this.annotationSelections],contextData:i,previousContextData:e,paths:this.paths,seriesRect:t}:void 0}updateLabelSelection(t){return t.labelSelection}getScaling(t){if(t instanceof np){const{range:e,domain:i}=t;return{type:"log",convert:s=>t.convert(s),domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof Ct){const{range:e,domain:i}=t;return{type:"continuous",domain:[i[0],i[1]],range:[e[0],e[1]]}}else if(t instanceof aa){const{domain:e}=t;return{type:"category",domain:e,inset:t.inset,step:t.step}}}calculateScaling(){const t={};for(const e of Object.values(Bu)){const i=this.axes[e];if(!i)continue;const s=this.getScaling(i.scale);s!=null&&(t[e]=s)}return t}};function KT(t){let e,i;if((t instanceof Us||t instanceof xn)&&({min:e,max:i}=t),!(e==null&&i==null))return e??(e=-1/0),i??(i=1/0),[e,i]}function ZT(t,e,i){const s=e[0].valueOf(),n=e[1].valueOf(),r=(0,po.findMinIndex)(0,t-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l>=s});let o=(0,po.findMaxIndex)(0,t-1,a=>{const l=i(a)?.valueOf();return!Number.isFinite(l)||l<=n});return r==null||o==null?[0,0]:(o=Math.min(o+1,t),[r,o])}var sx=At(["linear","smooth","step"],"a line style"),nx=At(["start","middle","end"]),go=class extends nt{constructor(){super(...arguments),this.type="linear",this.tension=1,this.position="end"}};g([b(sx)],go.prototype,"type",2),g([b(It)],go.prototype,"tension",2),g([b(nx)],go.prototype,"position",2);var ee=class extends Hs{constructor(){super(...arguments),this.xName=void 0,this.fill="#c16068",this.fillGradientDefaults=new Pi,this.fillPatternDefaults=new qt,this.fillOpacity=1,this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new go,this.shadow=new ts,this.marker=new Ce,this.label=new ye,this.tooltip=new Ye,this.connectMissingData=!1}};g([b(O)],ee.prototype,"xKey",2),g([b(O,{optional:!0})],ee.prototype,"xName",2),g([b(O)],ee.prototype,"yKey",2),g([b(O,{optional:!0})],ee.prototype,"yName",2),g([b(O,{optional:!0})],ee.prototype,"yFilterKey",2),g([b(j,{optional:!0})],ee.prototype,"normalizedTo",2),g([b(we(hs,us,dt))],ee.prototype,"fill",2),g([b(F)],ee.prototype,"fillGradientDefaults",2),g([b(F)],ee.prototype,"fillPatternDefaults",2),g([b(It)],ee.prototype,"fillOpacity",2),g([b(dt)],ee.prototype,"stroke",2),g([b(j)],ee.prototype,"strokeWidth",2),g([b(It)],ee.prototype,"strokeOpacity",2),g([b(ds)],ee.prototype,"lineDash",2),g([b(j)],ee.prototype,"lineDashOffset",2),g([b(F)],ee.prototype,"interpolation",2),g([b(F)],ee.prototype,"shadow",2),g([b(F)],ee.prototype,"marker",2),g([b(F)],ee.prototype,"label",2),g([b(F)],ee.prototype,"tooltip",2),g([b(H)],ee.prototype,"connectMissingData",2);function bs(t){switch(t.type){case"linear":case"step":return[{x:t.x0,y:t.y0},{x:t.x1,y:t.y1}];case"cubic":return[{x:t.cp0x,y:t.cp0y},{x:t.cp3x,y:t.cp3y}]}}function XT(t){const e=bs(t);return e[0].x>e[1].x&&e.reverse(),e}function qT(t,e){const{x:i,y:s}=e;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s};case"step":return{type:"step",moveTo:t.moveTo,x0:i,y0:s,x1:i,y1:s,stepX:i};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:i,cp0y:s,cp1x:i,cp1y:s,cp2x:i,cp2y:s,cp3x:i,cp3y:s}}}function Wa(t,e,i){const[s,n]=bs(t),r=n.x!==s.x?(i.x-e.x)/(n.x-s.x):0,o=n.y!==s.y?(i.y-e.y)/(n.y-s.y):0;switch(t.type){case"linear":return{type:"linear",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y};case"cubic":return{type:"cubic",moveTo:t.moveTo,cp0x:e.x,cp0y:e.y,cp1x:i.x-(t.cp2x-s.x)*r,cp1y:i.y-(t.cp2y-s.y)*o,cp2x:i.x-(t.cp1x-s.x)*r,cp2y:i.y-(t.cp1y-s.y)*o,cp3x:i.x,cp3y:i.y};case"step":return{type:"step",moveTo:t.moveTo,x0:e.x,y0:e.y,x1:i.x,y1:i.y,stepX:i.x-(t.stepX-s.x)*r}}}function rx(t,e,i){const{moveTo:s}=t,[n,r]=XT(t),{x:o,y:a}=n,{x:l,y:c}=r;if(i<o)return Wa(t,n,n);if(e>l)return Wa(t,r,r);switch(t.type){case"linear":{const h=a===c?void 0:(c-a)/(l-o),u=h==null?a:h*(e-o)+a,d=h==null?a:h*(i-o)+a;return{type:"linear",moveTo:s,x0:e,y0:u,x1:i,y1:d}}case"step":if(i<=t.stepX){const h=t.y0;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:i}}else if(e>=t.stepX){const h=t.y1;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:h,stepX:e}}else{const{y0:h,y1:u,stepX:d}=t;return{type:"step",moveTo:s,x0:e,y0:h,x1:i,y1:u,stepX:d}}case"cubic":{const h=Wl(t.cp0x,t.cp1x,t.cp2x,t.cp3x,e);let[u,d]=$l(t.cp0x,t.cp0y,t.cp1x,t.cp1y,t.cp2x,t.cp2y,t.cp3x,t.cp3y,h);const p=Wl(d[0].x,d[1].x,d[2].x,d[3].x,i);return[d,u]=$l(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 QT(t){const e=[];let i=0,s=NaN,n=NaN;for(const{x:r,y:o}of t){if(i>0){const a=i===1;e.push({type:"linear",moveTo:a,x0:s,y0:n,x1:r,y1:o})}i+=1,s=r,n=o}return e}var JT={start:0,middle:.5,end:1};function tk(t,e){const i=[];let s=0,n=NaN,r=NaN;const o=typeof e=="number"?e:JT[e];for(const{x:a,y:l}of t){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 Kc=.05;function ek(t,e){const i=Array.isArray(t)?t:Array.from(t);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<=Kc||1-u<=Kc||d<=Kc||1-d<=Kc)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*e/3,p=h*a*e/3,f=h*e/3,y=h*c*e/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)&&(f*=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-f,cp2y:l.y-y,cp3x:l.x,cp3y:l.y})}return n}function ue(t,e,i){return(e-t)*i+t}function ik(t,e){const{x0:i,y0:s,x1:n,y1:r}=t,a=(r-s)/(n-i)*(e-i)+s;return{leftCp1x:i,leftCp1y:s,leftCp2x:e,leftCp2y:a,stepX:e,stepY0:a,stepY1:a,rightCp1x:e,rightCp1y:a,rightCp2x:n,rightCp2y:r}}function sk(t,e){const{cp0x:i,cp0y:s,cp1x:n,cp1y:r,cp2x:o,cp2y:a,cp3x:l,cp3y:c}=t,h=Wl(i,n,o,l,e),[u,d]=$l(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:e,stepY0:p,stepY1:p,rightCp1x:d[1].x,rightCp1y:d[1].y,rightCp2x:d[2].x,rightCp2y:d[2].y}}function nk(t){const{x0:e,y0:i,x1:s,y1:n,stepX:r}=t;return{leftCp1x:(e+r)/2,leftCp1y:i,leftCp2x:(e+r)/2,leftCp2y:i,stepX:r,stepY0:i,stepY1:n,rightCp1x:(r+s)/2,rightCp1y:n,rightCp2x:(r+s)/2,rightCp2y:n}}function ox(t,e){return t.type==="linear"?ik(t,e):t.type==="cubic"?sk(t,e):nk(t)}function ax(t,e,i,s,n,r,o){switch(e){case 0:o?t.moveTo(n,r):t.moveTo(i,s);break;case 1:o?t.lineTo(n,r):t.lineTo(i,s);break}}function lx(t,e,i,s,n,r){r?t.lineTo(e,i):t.lineTo(s,n)}function cx(t,e,i,s,n,r,o,a,l,c){c?t.cubicCurveTo(r,o,s,n,e,i):t.cubicCurveTo(s,n,r,o,a,l)}function hx(t,e,i,s,n,r,o){o?(t.lineTo(r,n),t.lineTo(r,i),t.lineTo(e,i)):(t.lineTo(r,i),t.lineTo(r,n),t.lineTo(s,n))}function Ip(t,e,i,s){const[n,r]=bs(e);switch(ax(t,i,n.x,n.y,r.x,r.y,s),e.type){case"linear":lx(t,e.x0,e.y0,e.x1,e.y1,s);break;case"cubic":cx(t,e.cp0x,e.cp0y,e.cp1x,e.cp1y,e.cp2x,e.cp2y,e.cp3x,e.cp3y,s);break;case"step":hx(t,e.x0,e.y0,e.x1,e.y1,e.stepX,s);break}}function ux(t,e,i){const[s,n]=bs(t),[r,o]=bs(e),a=ue(s.x,r.x,i),l=ue(s.y,r.y,i),c=ue(n.x,o.x,i),h=ue(n.y,o.y,i);return[{x:a,y:l},{x:c,y:h}]}function Ap(t,e,i,s,n,r){const[{x:o,y:a},{x:l,y:c}]=ux(e,i,s);if(ax(t,n,o,a,l,c,r),e.type==="cubic"&&i.type==="cubic"){const h=ue(e.cp1x,i.cp1x,s),u=ue(e.cp1y,i.cp1y,s),d=ue(e.cp2x,i.cp2x,s),p=ue(e.cp2y,i.cp2y,s);cx(t,o,a,h,u,d,p,l,c,r)}else if(e.type==="step"&&i.type==="step"){const h=ue(e.stepX,i.stepX,s);hx(t,o,a,l,c,h,r)}else if(e.type==="linear"&&i.type==="linear")lx(t,o,a,l,c,r);else{let h;e.type==="step"?h=e.stepX:i.type==="step"?h=i.stepX:h=(o+l)/2;const u=ox(e,h),d=ox(i,h),p=ue(u.leftCp1x,d.leftCp1x,s),f=ue(u.leftCp1y,d.leftCp1y,s),y=ue(u.leftCp2x,d.leftCp2x,s),x=ue(u.leftCp2y,d.leftCp2y,s),m=ue(u.stepX,d.stepX,s),v=ue(u.stepY0,d.stepY0,s),S=ue(u.stepY1,d.stepY1,s),M=ue(u.rightCp1x,d.rightCp1x,s),D=ue(u.rightCp1y,d.rightCp1y,s),C=ue(u.rightCp2x,d.rightCp2x,s),L=ue(u.rightCp2y,d.rightCp2y,s);r?(t.cubicCurveTo(C,L,M,D,m,S),t.lineTo(m,v),t.cubicCurveTo(y,x,p,f,o,a)):(t.cubicCurveTo(p,f,y,x,m,v),t.lineTo(m,S),t.cubicCurveTo(M,D,C,L,l,c))}}var dx=(t=>(t[t.Zero=0]="Zero",t[t.Split=1]="Split",t))(dx||{});function rk(t,e){return t==null||e==null||typeof t!="object"||typeof e!="object"?!1:"id"in t&&"id"in e?t.id===e.id:t.toString()===e.toString()}function We(t,e){if(!e)return NaN;if(t instanceof Date&&(t=t.getTime()),e.type==="continuous"&&typeof t=="number")return(t-e.domain[0])/(e.domain[1]-e.domain[0])*(e.range[1]-e.range[0])+e.range[0];if(e.type==="log"&&typeof t=="number")return e.convert(t);if(e.type!=="category")return NaN;const i=e.domain.findIndex(n=>n===t);return i>=0||e.domain.findIndex(n=>rk(t,n))>=0?e.inset+e.step*i:NaN}function ji(t){return Nd(t).valueOf()}function px({data:t},e){return t.map((i,s)=>({xValue0Index:e.indexOf(ji(i.xValue0)),xValue1Index:e.indexOf(ji(i.xValue1)),datumIndex:s}))}function ok(t,e){const i=e.scales.x,s=t.scales.x;if(i?.type!=="category"||s?.type!=="category")return!0;let n=-1/0;for(const r of i.domain){const o=We(r,s);if(Number.isFinite(o)){if(o<n)return!1;n=o}}return!0}function ak(t,e){let i=-1/0;for(const s of t){const n=We(s.value,e.scales.x);if(Number.isFinite(n)){if(n<i)return!1;i=n}}return!0}function lk(t,e){const i=new Map;for(const{xValue0:h,xValue1:u}of t.data){const d=ji(h),p=ji(u);i.set(d,h).set(p,u)}const s=Array.from(i,([h,u])=>({axisValue:h,value:u}));s.sort((h,u)=>We(h.value,t.scales.x)-We(u.value,t.scales.x));const n=[];for(const{xValue0:h,xValue1:u}of e.data){const d=ji(h),p=ji(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)=>We(h.value,e.scales.x)-We(u.value,e.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=We(h.value,e.scales.x),p=We(r[u].value,e.scales.x);if(d>p){o=u+1;break}}r.splice(o,0,h),o+=1}if(!ak(r,e))return;const a=r.map(h=>h.axisValue),l=px(e,a),c=px(t,a);return{axisValues:a,oldDataAxisIndices:l,newDataAxisIndices:c}}function gx(t,e,i){if(i.xValue1Index===i.xValue0Index+1)return t;const s=bs(t),n=(s[1].x-s[0].x)/(i.xValue1Index-i.xValue0Index),r=s[0].x+(e-i.xValue0Index)*n,o=r+n;return rx(t,r,o)}function fx(t,e){const[i,s]=bs(t),n=We(0,e.scales.y);return Wa(t,{x:i.x,y:n},{x:s.x,y:n})}function mx(t){const[e,i]=bs(t);return qT(t,{x:(e.x+i.x)/2,y:(e.y+i.y)/2})}function yx(t,e,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(e){case 0:return fx(t,i);case 1:return mx(t)}const l=We(o,i.scales.x),c=We(a,i.scales.y),h={x:l,y:c};return Wa(t,h,h)}function Lp(t,e){if(e==null)return;const i=ji(t.xValue0),s=ji(t.xValue1);return e.find(n=>ji(n.xValue0)===i&&ji(n.xValue1)===s)?.span}function bx(t,e,i,s,n,r,o){const a=t.data[s.datumIndex],l=a.span,c=Lp(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=yx(l,e,t,i,s,r);o.added.push({from:h,to:l})}}function xx(t,e,i,s,n,r,o){const a=t.data[s.datumIndex],l=a.span,c=Lp(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=yx(l,e,t,i,s,r);o.removed.push({from:l,to:h})}}function vx(t,e,i,s,n){const r=e[n.xValue0Index],o=i.data.find(x=>ji(x.xValue0)===r),a=e[n.xValue1Index],l=i.data.find(x=>ji(x.xValue1)===a);if(o==null||l==null)return;const[{x:c},{x:h}]=bs(t),u=We(o.xValue0,i.scales.x),d=We(o.yValue0,i.scales.y),p=We(l.xValue1,i.scales.x),f=We(l.yValue1,i.scales.y);let y=s.data[n.datumIndex].span;return y=Wa(y,{x:u,y:d},{x:p,y:f}),y=rx(y,c,h),y}function ck(t,e,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=e.zeroData,p=t.zeroData;if(h==null&&u!=null){bx(t,i,r,u,d,a,l);return}else if(h!=null&&u==null){xx(e,i,o,h,p,a,l);return}else if(h==null||u==null)return;let f;h.xValue0Index===u.xValue0Index&&h.xValue1Index===u.xValue1Index?f=0:h.xValue0Index<=u.xValue0Index&&h.xValue1Index>=u.xValue1Index?f=-1:h.xValue0Index>=u.xValue0Index&&h.xValue1Index<=u.xValue1Index?f=1:f=0;const y=e.data[h.datumIndex],x=gx(y.span,n,h),m=t.data[u.datumIndex],v=gx(m.span,n,u);if(f===1){const S=vx(x,s,e,t,u);S!=null?(l.removed.push({from:x,to:S}),l.moved.push({from:S,to:v}),l.added.push({from:v,to:v})):xx(e,i,o,h,p,a,l)}else if(f===-1){const S=vx(v,s,t,e,h);S!=null?(l.removed.push({from:x,to:x}),l.moved.push({from:x,to:S}),l.added.push({from:S,to:v})):bx(t,i,r,u,d,a,l)}else l.removed.push({from:x,to:x}),l.moved.push({from:x,to:v}),l.added.push({from:v,to:v})}function hk(t,e,i,s){const n={removed:[],moved:[],added:[]},{axisValues:r,oldDataAxisIndices:o,newDataAxisIndices:a}=t,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)ck(e,i,s,r,c,a,o,l,n);return n}function Mx(t,e,i){const{span:s}=e;switch(i){case 0:return Lp(e,t.zeroData)??fx(s,t);case 1:return mx(s)}}function uk(t,e,i){const s=[],n=[];for(const r of e.data){const o=r.span,a=Mx(e,r,i);n.push({from:o,to:a})}for(const r of t.data){const o=r.span,a=Mx(t,r,i);s.push({from:a,to:o})}return{removed:n,moved:[],added:s}}function $a(t,e,i){if(!ok(t,e))return;const s=lk(t,e);return s==null?uk(t,e,i):hk(s,t,e,i)}var Cp=(w(),k(T));function Sx(t){return t.type==="continuous"||t.type==="log"}function Dx(t){return t.type==="category"}function fo(t,e){return t===void 0||e===void 0?t!==void 0||e!==void 0:Sx(t)&&Sx(e)?t.type===e.type&&(0,Cp.arraysEqual)(t.domain,e.domain)&&(0,Cp.arraysEqual)(t.range,e.range):Dx(t)&&Dx(e)?t.inset===e.inset&&t.step===e.step&&(0,Cp.arraysEqual)(t.domain,e.domain):!1}function Ha(t){return t==null?!1:t.type==="category"?t.domain.every(e=>e!=null):t.domain.every(e=>Number.isFinite(e)||e instanceof Date)&&t.range.every(e=>Number.isFinite(e))}function Zc(t,e){let i;const s=t.map(n=>n.point);switch(e.type){case"linear":i=QT(s);break;case"smooth":i=ek(s,e.tension);break;case"step":i=tk(s,e.position);break}return i.map((n,r)=>({span:n,xValue0:t[r].xDatum,yValue0:t[r].yDatum,xValue1:t[r+1].xDatum,yValue1:t[r+1].yDatum}))}function Ix(t,e,i=.001){return Math.abs(t.x-e.x)<i&&Math.abs(t.y-e.y)<i}function Np({path:t},e){let i;for(const{span:s}of e){const[n,r]=bs(s),o=i!=null&&Ix(i,n)?1:0;Ip(t,s,o,!1),i=r}}function Xc(t,e,i){let s;for(const n of i){const[r,o]=ux(n.from,n.to,t),a=s!=null&&Ix(s,r)?1:0;Ap(e.path,n.from,n.to,t,a,!1),s=o}}function Tp(t,e,i){const s=(a,l)=>Xc(a,l,e.removed),n=(a,l)=>Xc(a,l,e.moved),r=(a,l)=>Xc(a,l,e.added),o=kp(t,i);return{status:t,path:{addPhaseFn:r,updatePhaseFn:n,removePhaseFn:s},pathProperties:o}}function kp(t,e){const i=e==="none"?"updated":t,s={fromFn:n=>{let r;return t==="removed"?r={finish:{visible:!1}}:t==="added"?r={start:{visible:!0}}:r={},{phase:Ki[i],...r}},toFn:n=>({phase:Ki[i]})};return e==="fade"?{fromFn:n=>({opacity:t==="added"?0:n.opacity,...s.fromFn(n)}),toFn:n=>({opacity:t==="removed"?0:1,...s.toFn(n)})}:s}function Ax(t,e,i){const s=t.scales.x?.type==="category",n=e.scales.x?.type==="category";if(s!==n||!Ha(t.scales.x)||!Ha(e.scales.x)||t.strokeData==null||e.strokeData==null)return;let r="updated";e.visible&&!t.visible?r="removed":!e.visible&&t.visible&&(r="added");const o=$a({scales:t.scales,data:t.strokeData.spans},{scales:e.scales,data:e.strokeData.spans},1);if(o==null)return;const a=Tp(r,o,"fade"),l=(i?.changed??!0)||!fo(t.scales.x,e.scales.x)||!fo(t.scales.y,e.scales.y)||r!=="updated";return{status:r,stroke:a,hasMotion:l}}function Lx({path:t},{spans:e,phantomSpans:i}){for(let s=0;s<e.length;s+=1){const{span:n}=e[s],r=i[s].span;Ip(t,n,0,!1),Ip(t,r,1,!0),t.closePath()}}function qc(t,{path:e},i,s){for(let n=0;n<i.length;n+=1){const r=i[n],o=s[n];Ap(e,r.from,r.to,t,0,!1),Ap(e,o.from,o.to,t,1,!0),e.closePath()}}function Cx(t,e,i,s){const n=(l,c)=>qc(l,c,e.removed,i.removed),r=(l,c)=>qc(l,c,e.moved,i.moved),o=(l,c)=>qc(l,c,e.added,i.added),a=kp(t,s);return{status:t,path:{addPhaseFn:o,updatePhaseFn:r,removePhaseFn:n},pathProperties:a}}function Nx(t,e){const i=t.scales.x?.type==="category",s=e.scales.x?.type==="category";if(i!==s||!Ha(t.scales.x)||!Ha(e.scales.x))return;let n="updated";e.visible&&!t.visible?n="removed":!e.visible&&t.visible&&(n="added");const r=$a({scales:t.scales,data:t.fillData.spans},{scales:e.scales,data:e.fillData.spans},0);if(r==null)return;const o=$a({scales:t.scales,data:t.fillData.phantomSpans},{scales:e.scales,data:e.fillData.phantomSpans},0);if(o==null)return;const a=$a({scales:t.scales,data:t.strokeData.spans,zeroData:t.fillData.phantomSpans},{scales:e.scales,data:e.strokeData.spans,zeroData:e.fillData.phantomSpans},0);if(a==null)return;const l="none",c=Cx(n,r,o,l),h=Tp(n,a,l);return{status:n,fill:c,stroke:h}}var dk=(w(),k(T));function Ka({id:t},e,i,...s){const n={phase:i?Ki[i]:"trailing"};js(t,"markers",e,s,{opacity:0},{opacity:1},n),s.forEach(r=>r.cleanup())}function wp({id:t},e,...i){js(t,"markers",e,i,{scalingX:0,scalingY:0},{scalingX:1,scalingY:1},{phase:"initial"}),i.forEach(s=>s.cleanup())}function Ep({id:t,nodeDataDependencies:e},i,...s){const n=e.seriesRectWidth;Xt(t,"markers",i,s,{fromFn:(a,l)=>{const c=l.midPoint?.x??n;let h=(0,dk.clamp)(0,dy(c/n),1);return isNaN(h)&&(h=0),{scalingX:0,scalingY:0,delay:h,duration:cc,phase:"initial"}},toFn:()=>({scalingX:1,scalingY:1})})}function Za(t){return{opacity:1,scalingX:1,scalingY:1}}function Xa(t,e){return{x:e.point?.x??NaN,y:e.point?.y??NaN,scalingCenterX:e.point?.x??NaN,scalingCenterY:e.point?.y??NaN}}function qa(t,{datumIndex:e}){const i=t.getNodeData();if(i===void 0)return;const s=i[e],{point:n}=s??{};if(s==null||n==null)return;const r=4+(n.focusSize??t.getFormattedMarkerStyle(s).size),o=r/2,a=s.point.x-o,l=s.point.y-o;return Kt.toCanvas(t.contentGroup,new B(a,l,r,r))}function Op({id:t,visible:e,nodeDataDependencies:i},s,...n){const{seriesRectWidth:r,seriesRectHeight:o}=i;js(t,"path_properties",s,n,{clipX:0},{clipX:r},{phase:"initial",start:{clip:!0,clipY:o,visible:e},finish:{clip:!1,visible:e}})}function Qc({id:t},e,i,s="add",...n){js(t,e,i,n,{opacity:0},{opacity:1},{phase:s})}function Rp(t){return e=>({visible:t.getVisible(),opacity:t.getOpacity(),clipScalingX:1,clip:!1})}function Jc({nodeDataDependencies:t},e){const i=s=>isFinite(s)?s:0;e.clipX=i(t.seriesRectWidth),e.clipY=i(t.seriesRectHeight)}var pk=.125,gk=.25,th=class extends Cn{constructor(t){super({moduleCtx:t,directionKeys:or,directionNames:ar,categoryKey:"xValue",pathsPerSeries:["fill","stroke"],pathsZIndexSubOrderOffset:[0,1e3],hasMarkers:!0,markerSelectionGarbageCollection:!1,pickModes:[2,0],animationResetFns:{path:Rp({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:$s,marker:(e,i)=>({...Za(e),...Xa(e,i)})},clipFocusBox:!1}),this.properties=new ee,this.connectsToYAxis=!0,this.backgroundGroup=new it({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>Hc||this.contextNodeData.strokeData.spans.length>Hc)}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}attachPaths([t,e]){this.backgroundGroup.appendChild(t),this.contentGroup.appendChild(e),e.zIndex=-1}detachPaths([t,e]){this.backgroundGroup.removeChild(t),this.contentGroup.removeChild(e)}isStacked(){return(this.seriesGrouping?.stackCount??1)>1}setSeriesIndex(t){const e=this.isStacked();return!super.setSeriesIndex(t)&&this._isStacked===e?!1:(this._isStacked=e,e?(this.backgroundGroup.zIndex=[0,t],this.contentGroup.zIndex=[1,t,0]):(this.backgroundGroup.zIndex=[1,t,0,0],this.contentGroup.zIndex=[1,t,0,1]),!0)}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,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:f}=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`},x=[];(0,Mp.isDefined)(c)&&x.push(Ec(Object.values(y),c)),h&&x.push(no());const m={invalidValue:null};((0,Mp.isDefined)(c)||l)&&n>1&&(m.invalidValue=0),i||(m.forceValue=0),await this.requestDataModel(t,e,{props:[Qi(r,p,{id:"xValue"}),mt(o,f,{id:"yValueRaw",...m}),...a!=null?[mt(a,f,{id:"yFilterRaw"})]:[],...w0(o,f,{id:"yValueStack",...m,groupId:y.stack}),mt(o,f,{id:"yValue",...m,groupId:y.value}),...bn(o,"window","current",{id:"yValueEnd",...m,groupId:y.values},f),...bn(o,"normal","current",{id:"yValueCumulative",...m,groupId:y.marker},f),...x],groupByKeys:!0,groupByData:!1}),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{processedData:e,dataModel:i,axes:s}=this;if(!e||!i)return[];const n=s.y;if(t==="x"){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",e);return o?.def.type==="key"&&o.def.valueType==="category"?a:ri(Gs(a))}const r=this.domainForClippedRange("y",["yValueCumulative"],"xValue",!0);if(n instanceof oo||n instanceof xn)return ri(r);{const o=Number.isFinite(r[1]-r[0])?[r[0]>0?0:r[0],r[1]<0?0:r[1]]:[];return ri(o)}}getSeriesRange(t,e){const[i,s]=this.domainForVisibleRange("y",["yValueCumulative"],"xValue",e,!0);return[Math.min(i,0),Math.max(s,0)]}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValueCumulative"],t,e,i)}createNodeData(){const{axes:t,data:e,processedData:i,dataModel:s}=this,n=t.x,r=t.y;if(!n||!r||!e||!s||i?.type!=="grouped"||!this.properties.isValid())return;const{yKey:o,xKey:a,yFilterKey:l,marker:c,label:h,fill:u,stroke:d,connectMissingData:p,interpolation:f}=this.properties,{scale:y}=n,{scale:x}=r,{isContinuousY:m}=this.getScaleInformation({xScale:y,yScale:x}),v=(y.bandwidth??0)/2,S=s.resolveKeysById(this,"xValue",i),M=s.resolveColumnById(this,"yValueEnd",i),D=s.resolveColumnById(this,"yValueRaw",i),C=s.resolveColumnById(this,"yValueCumulative",i),L=l!=null?s.resolveColumnById(this,"yFilterRaw",i):void 0,I=s.resolveColumnById(this,"yValueStack",i),N=(X,Z,_)=>{let K;return((0,Mp.isDefined)(this.properties.normalizedTo)?m&&vc(_):!isNaN(_))&&(K=Z),{x:y.convert(X)+v,y:x.convert(K),size:c.size}},E=[],R=[],{visibleSameStackCount:z}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);let W=!1;const{dataSources:yt}=i,$=yt.get(this.id)??[];for(const{datumIndex:X}of s.forEachGroupDatum(this,i)){const Z=S[X];if(Z==null)return;const _=$[X],K=D[X],Q=C[X],Ot=M[X],Rt=Number.isFinite(K),Ut=N(Z,+Q,K),ae=L!=null?L[X]===K:void 0;if(ae===!1&&(W=!0),Rt&&c&&R.push({series:this,itemId:o,datum:_,datumIndex:X,midPoint:{x:Ut.x,y:Ut.y},cumulativeValue:Ot,yValue:K,xValue:Z,yKey:o,xKey:a,point:Ut,fill:c.fill??u,stroke:c.stroke??d,strokeWidth:c.strokeWidth??this.getStrokeWidth(this.properties.strokeWidth),selected:ae}),Rt&&h){const He=this.getLabelText(h,{value:K,datum:_,xKey:a,yKey:o,xName:this.properties.xName,yName:this.properties.yName});E.push({series:this,itemId:o,datum:_,datumIndex:X,x:Ut.x,y:Ut.y,labelText:He})}}const q=X=>X.flatMap(Z=>Array.isArray(Z)?Zc(Z,f):new Array(Z.skip).fill(null)),tt=(X,Z)=>({point:{x:y.convert(X)+v,y:x.convert(Z)},xDatum:X,yDatum:Z}),ht=X=>{const Z=[];for(const{datumIndexes:[_,K,Q]}of s.forEachGroupDatumTuple(this,i)){const Ot=S[K],Rt=I[K],Ut=Rt[X],ae=Number.isFinite(Ut);if(p&&!ae)continue;const He=_!=null?I[_]:void 0,Ke=Q!=null?I[Q]:void 0;let ii=0,Js=0;for(let le=0;le<=X;le+=1){const hi=Rt[le];if(Number.isFinite(hi)){const Ai=He==null||Number.isFinite(He[le]),Pg=Ke==null||Number.isFinite(Ke[le]);Ai&&(ii+=hi),Pg&&(Js+=hi)}}const si=Z[Z.length-1];if(!p&&(ii!==Js||!ae))if(!ae&&Array.isArray(si)&&si.length===1)Z[Z.length-1]={skip:1};else{const le=tt(Ot,ii),hi=tt(Ot,Js);Array.isArray(si)?si.push(le):si!=null&&(si.skip+=1),Z.push(ae?[hi]:{skip:0})}else{const le=p?Ut:Math.max(ii,Js),hi=tt(Ot,le);Array.isArray(si)?si.push(hi):si!=null?(si.skip+=1,Z.push([hi])):Z.push([hi])}}return q(Z)},lt=this.seriesGrouping?.stackIndex??0,V=()=>{const X=Array.from(s.forEachGroupDatum(this,i),({datumIndex:Z})=>{const _=S[Z],Q=I[Z][lt];if(!(p&&!Number.isFinite(Q)))return tt(_,0)}).filter(Z=>Z!=null);return Zc(X,f)},Y=ht(lt),et=Y.map(()=>null);for(let X=lt-1;X>=-1;X-=1){let Z;for(let _=0;_<et.length;_+=1)et[_]==null&&(Z??(Z=X!==-1?ht(X):V()),et[_]=Z[_])}const st=Y.map((X,Z)=>X??et[Z]),ut=Y.filter(X=>X!=null);return{itemId:o,fillData:{itemId:o,spans:st,phantomSpans:et},strokeData:{itemId:o,spans:ut},labelData:E,nodeData:R,scales:this.calculateScaling(),visible:this.visible,stackVisible:z>0,crossFiltering:W}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{opacity:e,visible:i,animationEnabled:s}=t,[n,r]=t.paths,o=this.contextNodeData?.crossFiltering===!0,a=this.getStrokeWidth(this.properties.strokeWidth);r.setProperties({fill:void 0,lineCap:"round",lineJoin:"round",pointerEvents:1,stroke:this.properties.stroke,strokeWidth:a,strokeOpacity:this.properties.strokeOpacity*(o?gk:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset,opacity:e,visible:i||s});const l=qn(this.properties.fill,this.properties.fillGradientDefaults,this.properties.fillPatternDefaults);Qn(n,{fill:l,stroke:void 0,fillOpacity:this.properties.fillOpacity*(o?pk:1)},void 0,this.getShapeFillBBox()),n.setProperties({lineJoin:"round",pointerEvents:1,fillShadow:this.properties.shadow,opacity:e,visible:i||s}),Jc(this,r),Jc(this,n)}updatePaths(t){this.updateAreaPaths(t.paths,t.contextData)}updateAreaPaths(t,e){for(const i of t)i.visible=e.visible;if(e.visible)this.updateFillPath(t,e),this.updateStrokePath(t,e);else for(const i of t)i.path.clear(),i.markDirty("AreaSeries")}updateFillPath(t,e){const[i]=t;i.path.clear(),Lx(i,e.fillData),i.markDirty("AreaSeries")}updateStrokePath(t,e){const{spans:i}=e.strokeData,[,s]=t;s.path.clear(),Np(s,i),s.markDirty("AreaSeries")}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t,s=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(s?e:[])}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,marker:r,fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h,highlightStyle:u}=this.properties,d=this.getSeriesDomain("x"),p=this.getSeriesDomain("y"),f=gt(i&&u.item,r.getStyle(),{fill:o,stroke:a,strokeWidth:l,fillOpacity:c,strokeOpacity:h}),y=this.getShapeFillBBox();e.each((x,m)=>{this.updateMarkerStyle(r,x,m.datum,m.point,fn(m,s,n,d,p),i,f,y,{selected:m.selected})}),i||this.properties.marker.markClean()}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e)}updateLabelNodes(t){const{labelSelection:e}=t,{enabled:i,fontStyle:s,fontWeight:n,fontSize:r,fontFamily:o,color:a}=this.properties.label;e.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.visible=!0):l.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h,marker:u}=r,d=n.x,p=n.y;if(!i||!s||!d||!p)return;const f=s.dataSources.get(this.id)?.[t],y=i.resolveKeysById(this,"xValue",s)[t],x=i.resolveColumnById(this,"yValueRaw",s)[t],{xDomain:m,yDomain:v}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")}));if(y==null)return;const S=u.getStyle(),M={datum:f,xValue:y,yValue:x},D=this.getMarkerStyle(u,f,fn(M,o,l,m,v),!1,void 0,S);return h.formatTooltip(this.properties,{heading:d.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:p.formatDatum(x)}]},{seriesId:e,datum:f,title:c,xKey:o,xName:a,yKey:l,yName:c,...D,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,fillOpacity:i,strokeOpacity:s,strokeWidth:n,lineDash:r,marker:o,fillGradientDefaults:a,fillPatternDefaults:l}=this.properties,c=!o.enabled||o.fill===void 0,h=c?qn(t,a,l):qn(o.fill,o.fillGradientDefaults,o.fillPatternDefaults);return{marker:{...this.getMarkerStyle(o,void 0,void 0,!1,void 0,{fill:h,fillOpacity:c?i:o.fillOpacity}),enabled:o.enabled||n<=0},line:{stroke:e,strokeOpacity:s,strokeWidth:n,lineDash:r}}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,legendItemName:o,showInLegend:a}=this.properties;return[{legendType:t,id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:o??r??n},symbol:this.legendItemSymbol(),legendItemName:o,hideInLegend:!a}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,contextData:s,paths:n}=t,{animationManager:r}=this.ctx;this.updateAreaPaths(n,s),Op(this,r,...n),Ie([e],Xa),Ep(this,r,e),Mt(this,"labels",r,i)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateAreaPaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,contextData:n,paths:r,previousContextData:o}=t,[a,l]=r;if(a==null&&l==null)return;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateAreaPaths(r,n)},h=()=>{e.skipCurrentBatch(),c()};if(n==null||o==null){c(),Ka(this,e,"added",i),Qc(this,"fill_path_properties",e,"add",a),Qc(this,"stroke_path_properties",e,"add",l),Mt(this,"labels",e,s);return}if(n.crossFiltering!==o.crossFiltering){h();return}const u=Nx(n,o);if(u===void 0){h();return}else if(u.status==="no-op")return;Ka(this,e,void 0,i),Xt(this.id,"fill_path_properties",e,[a],u.fill.pathProperties),$c(this.id,"fill_path_update",e,[a],u.fill.path),Xt(this.id,"stroke_path_properties",e,[l],u.stroke.pathProperties),$c(this.id,"stroke_path_update",e,[l],u.stroke.path),Mt(this,"labels",e,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 it}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=t,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,t.datum,fn(t,e,i,s,n),!0)}computeFocusBounds(t){return qa(this,t)}};th.className="AreaSeries",th.type="area";var $e=(w(),k(T)),A=(w(),k(T)),P=(w(),k(T)),eh=(0,P.attachDescription)(P.isValidNumberFormat,"a valid number format string"),Pp={enabled:P.boolean,text:P.string,padding:P.number,...P.fontOptionsDef},Tx=(0,P.attachDescription)({enabled:P.boolean,type:(0,P.required)((0,P.union)("line","range")),range:(0,P.and)((0,P.attachDescription)((t,{options:e})=>e.type==="range","crossLine type to be 'range'"),(0,P.arrayOf)(P.defined),(0,P.arrayLength)(2,2)),value:(0,P.and)((0,P.attachDescription)((t,{options:e})=>e.type==="line","crossLine type to be 'line'"),P.defined),label:Pp,fill:P.string,fillOpacity:P.ratio,...P.strokeOptionsDef,...P.lineDashOptionsDef},"cross-line options"),kx={...Tx,label:{...Pp,position:(0,P.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:P.number}},_p={enabled:P.boolean,rotation:P.number,avoidCollisions:P.boolean,minSpacing:P.positiveNumber,spacing:P.positiveNumber,formatter:P.callback,itemStyler:P.callback,...P.fontOptionsDef},mo={autoRotate:P.boolean,autoRotateAngle:P.number,..._p},ih={reverse:P.boolean,gridLine:{enabled:P.boolean,width:P.positiveNumber,style:(0,P.arrayOfDefs)({stroke:P.color,lineDash:(0,P.arrayOf)(P.positiveNumber)},"a grid-line style object array")},interval:{values:(0,P.arrayOf)(P.defined),minSpacing:P.positiveNumber},label:_p,line:{enabled:P.boolean,width:P.positiveNumber,stroke:P.color},tick:{enabled:P.boolean,width:P.positiveNumber,size:P.positiveNumber,stroke:P.color}};ih.context=P.defined,ih.layoutConstraints={stacked:(0,P.required)(P.boolean),align:(0,P.required)((0,P.union)("start","end")),unit:(0,P.required)((0,P.union)("percent","px")),width:(0,P.required)(P.positiveNumber)};var yo={...ih,keys:(0,P.arrayOf)(P.string),crossLines:(0,P.arrayOfDefs)(kx,"a cross-line options array"),position:(0,P.union)("top","right","bottom","left"),thickness:P.positiveNumber,title:{enabled:P.boolean,text:P.string,spacing:P.positiveNumber,formatter:P.callback,...P.fontOptionsDef}};function bo(t){const e={enabled:P.boolean,xOffset:P.number,yOffset:P.number,renderer:P.callback};return t&&(e.format=P.string),{enabled:P.boolean,snap:P.boolean,label:e,...P.strokeOptionsDef,...P.lineDashOptionsDef}}function sh(t,e){return{min:(0,P.and)(t,(0,P.lessThan)("max")),max:(0,P.and)(t,(0,P.greaterThan)("min")),nice:P.boolean,interval:{step:e?(0,P.or)(P.positiveNumberNonZero,(0,P.or)(P.positiveNumberNonZero,(0,P.instanceOf)(Yn))):P.positiveNumberNonZero,values:(0,P.arrayOf)(t),minSpacing:(0,P.and)(P.positiveNumber,(0,P.lessThan)("maxSpacing")),maxSpacing:(0,P.and)(P.positiveNumber,(0,P.greaterThan)("minSpacing"))}}}var jp=(0,A.or)((0,A.union)("circle","cross","diamond","heart","plus","pin","square","star","triangle"),A.callback),wx=(0,A.union)("never","always","hyphenate","on-space"),nh=(0,A.union)("top","right","bottom","left","top-right","bottom-right","bottom-left","top-left","center"),Fp=(0,A.union)("pointer","node","top","right","bottom","left","top-left","top-right","bottom-left","bottom-right"),zp=(0,A.or)(A.positiveNumber,(0,A.union)("exact","nearest")),Ex=(0,A.union)("pointer","start","middle","end"),Bp={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},rh={enabled:A.boolean,text:A.string,renderer:A.callback},oh=(0,A.arrayOfDefs)({label:A.string,action:A.callback},"a context menu actions array"),Gp={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")},ei={width:A.positiveNumber,height:A.positiveNumber,minWidth:A.positiveNumber,minHeight:A.positiveNumber,suppressFieldDotNotation:A.boolean,title:Bp,subtitle:Bp,footnote:Bp,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:jp,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:jp,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,format:eh,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},highlight:{range:(0,A.union)("tooltip","node")},overlays:{loading:rh,noData:rh,noVisibleSeries:rh,unsupportedBrowser:rh},tooltip:{enabled:A.boolean,showArrow:A.boolean,pagination:A.boolean,delay:A.positiveNumber,range:zp,wrapping:wx,mode:(0,A.union)("single","shared","compact"),position:{type:Fp,anchorTo:(0,A.union)("pointer","node","chart"),placement:(0,A.or)(nh,(0,A.arrayOf)(nh)),xOffset:A.number,yOffset:A.number}},animation:{enabled:A.boolean,duration:A.positiveNumber},contextMenu:{enabled:A.boolean,extraActions:oh,extraSeriesAreaActions:oh,extraNodeActions:oh,extraLegendItemActions:oh},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)({...Gp,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:A.callback},background:{visible:A.boolean,fill:A.color,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}},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:Ex,anchorPointY:Ex,axes:(0,A.union)("x","y","xy"),deceleration:(0,A.or)((0,A.union)("off","short","long"),A.ratio),minVisibleItems:A.positiveNumber,minVisibleItemsX:A.positiveNumber,minVisibleItemsY: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)({...Gp,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")}}};ei.dataSource.requestThrottle=A.positiveNumber,ei.dataSource.updateThrottle=A.positiveNumber,ei.dataSource.updateDuringInteraction=A.boolean,ei.zoom.enableIndependentAxes=A.boolean,ei.statusBar=A.defined,ei.foreground={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},ei.overrideDevicePixelRatio=A.number;var es={id:A.string,cursor:A.string,visible:A.boolean,data:(0,A.arrayOf)(A.object),showInLegend:A.boolean,nodeClickRange:zp,listeners:{nodeClick:A.callback,nodeDoubleClick:A.callback},highlightStyle:{item:{...A.fillOptionsDef,...A.strokeOptionsDef},series:{enabled:A.boolean,dimOpacity:A.ratio,strokeWidth:A.positiveNumber}}};es.context=A.defined,es.seriesGrouping=A.defined,es.highlight={enabled:A.boolean};var Qa={enabled:A.boolean,shape:jp,size:A.positiveNumber,itemStyler:A.callback,...A.fillOptionsDef,...A.strokeOptionsDef,...A.lineDashOptionsDef},Nn={enabled:A.boolean,formatter:A.callback,...A.fontOptionsDef},fk={...Nn,lineHeight:A.positiveNumber,minimumFontSize:A.positiveNumber,wrapping:wx,overflowStrategy:(0,A.union)("ellipsis","hide")},ah={visible:A.boolean,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:A.callback,cap:{visible:A.boolean,length:A.positiveNumber,lengthRatio:A.ratio,...A.strokeOptionsDef,...A.lineDashOptionsDef},...A.strokeOptionsDef,...A.lineDashOptionsDef},Ks={enabled:A.boolean,showArrow:A.boolean,range:zp,renderer:A.callback,position:{type:Fp,anchorTo:(0,A.union)("node","pointer","chart"),placement:(0,A.or)(nh,(0,A.arrayOf)(nh)),xOffset:A.number,yOffset:A.number},interaction:{enabled:A.boolean}};Ks.position._seriesOverrideType=Fp;var Ja={enabled:A.boolean,xOffset:A.number,yOffset:A.number,blur:A.positiveNumber,color:A.color},Vp=(0,A.typeUnion)({linear:{},smooth:{tension:A.ratio},step:{position:(0,A.union)("start","middle","end")}},"interpolation line options"),mk={type:(0,$e.required)((0,$e.constant)("area")),xKey:(0,$e.required)($e.string),yKey:(0,$e.required)($e.string),xName:$e.string,yName:$e.string,stacked:$e.boolean,stackGroup:$e.string,normalizedTo:$e.number,showInMiniChart:$e.boolean,connectMissingData:$e.boolean,interpolation:Vp,label:Nn,marker:Qa,tooltip:Ks,shadow:Ja,...es,...$e.fillOptionsDef,...$e.strokeOptionsDef,...$e.lineDashOptionsDef},yk={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"area",moduleFactory:t=>new th(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{nodeClickRange:"nearest",tooltip:{position:{_seriesOverrideType:"node"}},fill:{$palette:"fill"},fillGradientDefaults:{type:"gradient",gradient:"linear",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!1},fillPatternDefaults:An,stroke:{$palette:"stroke"},fillOpacity:.8,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,shadow:{enabled:!1,color:Sn,xOffset:3,yOffset:3,blur:5},interpolation:{type:"linear"},marker:{enabled:!1,shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:An},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},Ox={type:"series",name:"area",chartType:"cartesian",options:mk,create:t=>new th(t)},u1=(w(),k(T)),bk=(w(),k(T)),xk=(w(),k(T)),vk=(w(),k(T));function Up(t,e){for(const i of e){const s=i.datum;s===void 0?vk.Logger.error("undefined datum"):t.addValue(i,s)}}function Yp(t,e){const{x:i,y:s}=e,{nearest:n,distanceSquared:r}=t.getQuadTree().find(i,s);if(n!==void 0)return{datum:n.value,distance:Math.sqrt(r)}}var Wp=class extends Hs{constructor(){super(...arguments),this.direction="vertical"}};g([b(nm)],Wp.prototype,"direction",2);var Rx=class extends Cn{constructor(){super(...arguments),this.groupScale=new Sa,this.smallestDataInterval=void 0,this.largestDataInterval=void 0}padBandExtent(t,e){const i=typeof e=="boolean"?1:.5,s=(0,xk.isFiniteNumber)(this.smallestDataInterval)?this.smallestDataInterval*i:0,n=Gs(t)??[NaN,NaN];return typeof e=="boolean"?n[e?0:1]-=(e?1:-1)*s:(n[0]-=s,n[1]+=s),ri(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 t=this.getBarDirection();return this.axes[t]}getCategoryAxis(){const t=this.getCategoryDirection();return this.axes[t]}getBandwidth(t){return Ct.is(t.scale)?t.scale.calcBandwidth(this.smallestDataInterval):t.scale.bandwidth}xCoordinateRange(t){const e=this.axes[this.getCategoryDirection()],i=e.scale,s=this.getBandwidth(e)??0,n=Ct.is(i)?s*-.5:0,r=i.convert(t)+n;return[r,r+s]}yCoordinateRange(t){const i=this.axes[this.getBarDirection()].scale,s=t.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(t){const e=[],{groupScale:i}=this,s=this.getBandwidth(t),{index:n,visibleGroupCount:r}=this.ctx.seriesStateManager.getVisiblePeerGroupIndex(this);for(let a=0;a<r;a++)e.push(String(a));return i.domain=e,i.range=[0,s??0],t instanceof nr?i.paddingInner=t.groupPaddingInner:t instanceof tr?(i.paddingInner=t.groupPaddingInner,i.round=i.padding!==0):i.padding=0,{barWidth:i.bandwidth>=1?i.bandwidth:i.rawBandwidth,groupIndex:n}}resolveKeyDirection(t){return this.getBarDirection()==="x"?t==="x"?"y":"x":t}initQuadTree(t){Up(t,this.datumNodesIter())}pickNodeClosestDatum(t){return Yp(this,t)}},$p=class extends ye{constructor(){super(...arguments),this.placement="inside-center",this.padding=0}};g([b(At(["inside-center","inside-start","inside-end","outside-start","outside-end"],"a placement"))],$p.prototype,"placement",2),g([b(ct)],$p.prototype,"padding",2);var Vt=class extends Wp{constructor(){super(...arguments),this.fill="#c16068",this.fillGradientDefaults=new Pi,this.fillPatternDefaults=new qt,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 ts,this.label=new $p,this.tooltip=new Ye,this.sparklineMode=!1,this.fastDataProcessing=!1}};g([b(O)],Vt.prototype,"xKey",2),g([b(O,{optional:!0})],Vt.prototype,"xName",2),g([b(O)],Vt.prototype,"yKey",2),g([b(O,{optional:!0})],Vt.prototype,"yName",2),g([b(O,{optional:!0})],Vt.prototype,"yFilterKey",2),g([b(O,{optional:!0})],Vt.prototype,"stackGroup",2),g([b(ct,{optional:!0})],Vt.prototype,"normalizedTo",2),g([b(we(hs,us,dt))],Vt.prototype,"fill",2),g([b(F)],Vt.prototype,"fillGradientDefaults",2),g([b(F)],Vt.prototype,"fillPatternDefaults",2),g([b(It)],Vt.prototype,"fillOpacity",2),g([b(dt)],Vt.prototype,"stroke",2),g([b(j)],Vt.prototype,"strokeWidth",2),g([b(It)],Vt.prototype,"strokeOpacity",2),g([b(ds)],Vt.prototype,"lineDash",2),g([b(j)],Vt.prototype,"lineDashOffset",2),g([b(j)],Vt.prototype,"cornerRadius",2),g([b(H,{optional:!0})],Vt.prototype,"crisp",2),g([b(Ze,{optional:!0})],Vt.prototype,"itemStyler",2),g([b(F,{optional:!0})],Vt.prototype,"shadow",2),g([b(F)],Vt.prototype,"label",2),g([b(F)],Vt.prototype,"tooltip",2),g([b(H)],Vt.prototype,"sparklineMode",2),g([b(H)],Vt.prototype,"fastDataProcessing",2);var Mk=(w(),k(T));function Px(t,e,i,s){if(e!=null){const[n,r]=e;if(n!==0||r!==1)return!1}if(Ct.is(t)){const n=t.calcBandwidth(s)-t.calcBandwidth(i);if(n>0&&n<1)return!1}return!0}var Hp=t=>(0,Mk.isNegative)(t.yValue??0);function tl(t,e,i){const{startingX:s,startingY:n}=Dk(t,e);return{isVertical:t,calculate:(o,a)=>{let l=t?o.x:s,c=t?n:o.y,h=t?o.width:0,u=t?0:o.height;const{opacity:d=1}=o;a&&(isNaN(l)||isNaN(c))&&({x:l,y:c}=a,h=t?a.width:0,u=t?0:a.height,t&&!Hp(a)?c+=a.height:!t&&Hp(a)&&(l+=a.width));let p;return o.clipBBox==null?p=void 0:Hp(o)?p=t?new B(l,c-u,h,u):new B(l-h,c,h,u):p=new B(l,c,h,u),{x:l,y:c,width:h,height:u,clipBBox:p,opacity:d}},mode:i}}function Sk(t,e){return{isVertical:t,calculate:i=>({x:t?i.x:i.x+i.width/2,y:t?i.y+i.height/2:i.y,width:t?i.width:0,height:t?0:i.height,clipBBox:i.clipBBox,opacity:i.opacity??1}),mode:e}}function el(t){const e=r=>r==null||isNaN(r.x)||isNaN(r.y);return{toFn:(r,o,a)=>a==="removed"&&r.datum==null&&t.mode==="fade"?{...il(r,o),opacity:0}:a==="removed"||e(o)?t.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"&&e(o)?a="removed":a==="updated"&&e(r.previousDatum)&&(a="added");let l;a==="added"&&r.previousDatum==null&&t.mode==="fade"?l={...il(r,o),opacity:0}:a==="unknown"||a==="added"?l=t.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=Ki[a];return{...l,phase:c}},applyFn:(r,o,a)=>{r.setProperties(o),r.crisp=a==="end"&&(r.datum?.crisp??!1)}}}function Dk(t,e){const i=e[t?"y":"x"];let s=1/0,n=0;return i?(t?n=i.scale.convert(Ct.is(i.scale)?0:Math.max(...i.range)):s=i.scale.convert(Ct.is(i.scale)?0:Math.min(...i.range)),{startingX:s,startingY:n}):{startingX:s,startingY:n}}function il(t,{x:e,y:i,width:s,height:n,clipBBox:r,opacity:o=1}){return{x:e,y:i,width:s,height:n,clipBBox:r,opacity:o,crisp:t.datum?.crisp??!1}}function Kp(t,e){if(e===void 0)return;const{x:i,y:s,width:n,height:r}=e;return Kt.toCanvas(t.contentGroup,new B(i,s,n,r))}function _x(t,e,i){if(e.enabled&&i){const{x:s,y:n,text:r,textAlign:o,textBaseline:a}=i,{color:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d}=e;t.setProperties({visible:!0,x:s,y:n,text:r,fill:l,fontStyle:c,fontWeight:h,fontSize:u,fontFamily:d,textAlign:o,textBaseline:a})}else t.visible=!1}var Ik={"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 jx({isUpward:t,isVertical:e,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=(t?1:-1)*(e?-1:1),{direction:h,textAlignment:u}=Ik[i],d=(h+1)*.5;if(e){const p=t?n.y+n.height:n.y,f=n.height*c;o=p+f*d+s*u*c,l=u===c?"top":"bottom"}else{const p=t?n.x:n.x+n.width,f=n.width*c;r=p+f*d+s*u*c,a=u===c?"left":"right"}}return{x:r,y:o,textAlign:a,textBaseline:l}}var Ak=0,Lk=1,Ck=2,Nk=3,Tk=4,sl=class extends Rx{constructor(t){super({moduleCtx:t,directionKeys:or,directionNames:ar,categoryKey:"xValue",pickModes:[2,1,0],pathsPerSeries:[],hasHighlightedLabels:!0,datumSelectionGarbageCollection:!1,animationAlwaysUpdateSelections:!0,animationResetFns:{datum:il,label:$s}}),this.properties=new Vt,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(t){if(!this.properties.isValid()||!this.data)return;const{xKey:e,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,f=this.getValueAxis()?.scale,{isContinuousX:y,xScaleType:x,yScaleType:m}=this.getScaleInformation({xScale:p,yScale:f}),v=`bar-stack-${o}-yValues`,S=`${v}-trailing`,M=this.visible?{}:{forceValue:0},D=[Qi(e,x,{id:"xValue"}),mt(i,m,{id:"yValue-raw",invalidValue:null,...M})];this.crossFilteringEnabled()&&D.push(mt(s,m,{id:"yFilterValue",invalidValue:null,...M})),h&&D.push(...bn(i,"normal","current",{id:"yValue-end",rangeId:"yValue-range",invalidValue:null,missingValue:0,groupId:v,separateNegative:!0,...M},m),...bn(i,"trailing","current",{id:"yValue-start",invalidValue:null,missingValue:0,groupId:S,separateNegative:!0,...M},m)),y&&D.push(E0,O0),(0,bk.isFiniteNumber)(n)&&D.push(Ec([v,S],Math.abs(n))),d&&this.processedData&&D.push(ro(this.id,this.processedData)),(d||!u)&&D.push(no());const{dataModel:C,processedData:L}=await this.requestDataModel(t,a,{props:D,groupByKeys:u,groupByData:!u});this.dataAggregationFilters=this.aggregateData(C,L),this.smallestDataInterval=L.reduced?.smallestKeyInterval,this.largestDataInterval=L.reduced?.largestKeyInterval,this.animationState.transition("updateData")}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(i==null||e==null)return[];if(t===this.getCategoryDirection()){const o=i.resolveProcessedDataDefById(this,"xValue"),a=i.getDomain(this,"xValue","key",e);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("y",[s],"xValue",!0);const r=this.crossFilteringEnabled()?i.getDomain(this,"yFilterValue","value",e):void 0;if(r!=null&&(n=[Math.min(n[0],r[0]),Math.max(n[1],r[1])]),this.getValueAxis()instanceof oo)return ri(n);{const o=Number.isFinite(n[1]-n[0])?[Math.min(0,n[0]),Math.max(0,n[1])]:[];return ri(o)}}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw",[s,n]=this.domainForVisibleRange("y",[i],"xValue",e,!0);return[Math.min(s,0),Math.max(n,0)]}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValue-end")?"yValue-end":"yValue-raw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,groupScale:i,dataAggregationFilters:s}=this,n=this.getCategoryAxis(),r=this.getValueAxis();if(!t||!e||!n||!r||!this.properties.isValid())return;const o=e.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:f}=this.properties,y=r.isReversed(),{barWidth:x,groupIndex:m}=this.updateGroupScale(n),v=i.convert(String(m)),S=Ct.is(a)?x*-.5:0,M=t.resolveKeysById(this,"xValue",e),D=t.resolveColumnById(this,"yValue-raw",e),C=this.crossFilteringEnabled()?t.resolveColumnById(this,"yFilterValue",e):void 0,L=!this.ctx.animationManager.isSkipped(),I=V=>a.convert(M[V])+v+S,N=this.properties.crisp??Px(n?.scale,n?.visibleRange,this.smallestDataInterval,this.largestDataInterval),E=l.convert(0),R=({datum:V,datumIndex:Y,valueIndex:et,xValue:st,yValue:ut,cumulativeValue:bt,phantom:X,currY:Z,prevY:_,x:K,width:Q,isPositive:Ot,yRange:Rt,labelText:Ut,opacity:ae,crossScale:He=1})=>{const Ke=Ot!==y,ii=l.convert(Z),Js=l.convert(_),si=l.convert(Rt),le=this.getBarDirection()==="x",hi=Q*.5*(1-He),Ai={x:le?Math.min(ii,Js):K+hi,y:le?K+hi:Math.min(ii,Js),width:le?Math.abs(Js-ii):Q*He,height:le?Q*He:Math.abs(Js-ii)},Pg=new B(Ai.x,Ai.y,Ai.width,Ai.height),wh={x:le?Math.min(E,si):K+hi,y:le?K+hi:Math.min(E,si),width:le?Math.abs(E-si):Q*He,height:le?Q*He:Math.abs(E-si)},jv=this.shouldFlipXY()?Ai.height:Ai.width;return{series:this,itemId:X?Le(h,X):h,datum:V,datumIndex:Y,valueIndex:et,cumulativeValue:bt,phantom:X,xValue:st,yValue:ut,yKey:h,xKey:c,capDefaults:{lengthRatioMultiplier:jv,lengthMax:jv},x:wh.x,y:wh.y,width:wh.width,height:wh.height,midPoint:{x:Ai.x+Ai.width/2,y:Ai.y+Ai.height/2},opacity:ae,topLeftCornerRadius:le!==Ke,topRightCornerRadius:Ke,bottomRightCornerRadius:le===Ke,bottomLeftCornerRadius:!Ke,clipBBox:Pg,crisp:N,label:Ut!=null?{text:Ut,...jx({isUpward:Ke,isVertical:!le,placement:f.placement,padding:f.padding,rect:Ai})}:void 0,missing:ut==null,focusable:!X}},z=[],W=[],yt=[],$=(V,Y,et,st,ut,bt,X,Z)=>{const _=M[V];if(_==null)return;const K=D[V],Q=C!=null?Number(C[V]):void 0,Ot=K>=0&&!Object.is(K,-0);if(!Number.isFinite(bt)||Q!=null&&!Number.isFinite(Q))return;const Rt=K!=null?this.getLabelText(this.properties.label,{datum:o[V],value:Q??K,xKey:c,yKey:h,xName:u,yName:d,legendItemName:p}):void 0,Ut=Q!=null&&Q>K,ae=R({datum:o[V],datumIndex:V,valueIndex:Y,xValue:_,yValue:Q??K,cumulativeValue:Q??bt,phantom:!1,currY:Q!=null?ut+Q:bt,prevY:ut,x:et,width:st,isPositive:Ot,yRange:Math.max(ut+(Q??-1/0),X),labelText:Rt,opacity:Z,crossScale:Ut?.6:void 0});if(W.push(ae),yt.push(ae),Q!=null){const He=R({datum:o[V],datumIndex:V,valueIndex:Y,xValue:_,yValue:Q,cumulativeValue:Q,phantom:!0,currY:bt,prevY:ut,x:et,width:st,isPositive:Ot,yRange:X,labelText:void 0,opacity:Z,crossScale:void 0});z.push(He)}},[q,tt]=a.range,ht=tt-q,lt=s?.find(V=>V.maxRange>ht);if(e.type==="grouped"){const V=x,Y=t.hasColumnById(this,"yValue-start"),et=Y?t.resolveColumnById(this,"yValue-start",e):void 0,st=Y?t.resolveColumnById(this,"yValue-end",e):void 0,ut=Y?t.resolveProcessedDataIndexById(this,"yValue-range"):-1;for(const{datumIndex:bt,valueIndex:X,group:{aggregation:Z}}of t.forEachGroupDatum(this,e)){const _=I(bt),K=D[bt],Q=K>=0&&!Object.is(K,-0),Ot=Y?Number(et?.[bt]):0,Rt=Y?Number(st?.[bt]):K;let Ut=Rt;Y&&(Ut=Z[ut][Q?1:0]),$(bt,X,_,V,Ot,Rt,Ut,1)}}else if(lt==null){const V=x;let[Y,et]=this.visibleRange("xValue",n.range);e.input.count<1e3&&(Y=0,et=e.input.count);for(let st=Y;st<et;st+=1){const ut=I(st),bt=Number(D[st]);$(st,0,ut,V,0,bt,bt,1)}}else{const{indexData:V,indices:Y}=lt,[et,st]=this.visibleRange("xValue",n.range,Y);for(let ut=et;ut<st;ut+=1){const bt=ut*Tk,X=V[bt+Ak],Z=V[bt+Lk],_=V[bt+Ck],K=V[bt+Nk];if(X===-1)continue;const Q=I((X+Z)/2|0),Ot=Math.abs(I(Z)-I(X))+x,Rt=M[K]!=null?Number(D[K]):NaN,Ut=M[_]!=null?Number(D[_]):NaN;if(Rt>0){const ae=Ut>=0?Ut/Rt:1;$(K,0,Q,Ot,0,Rt,Rt,ae)}if(Ut<0){const ae=Rt<=0?Rt/Ut:1;$(_,1,Q,Ot,0,Ut,Ut,ae)}}}return{itemId:h,nodeData:z.length>0?[...z,...W]:W,labelData:yt,scales:this.calculateScaling(),visible:this.visible||L,groupScale:this.getScaling(this.groupScale)}}nodeFactory(){return new Ue}getHighlightData(t,e){const i=t.find(s=>s.datum===e.datum&&!s.phantom);return i!=null?[i]:void 0}updateDatumSelection(t){return t.datumSelection.update(t.nodeData,void 0,e=>this.getDatumId(e))}getItemBaseStyle(t){const{properties:e}=this,{cornerRadius:i,fillGradientDefaults:s,fillPatternDefaults:n}=e,r=t?e.highlightStyle.item:void 0;return ms({fill:r?.fill??e.fill,fillOpacity:r?.fillOpacity??e.fillOpacity,stroke:r?.stroke??e.stroke,strokeWidth:r?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:r?.strokeOpacity??e.strokeOpacity,lineDash:r?.lineDash??e.lineDash??[],lineDashOffset:r?.lineDashOffset??e.lineDashOffset,cornerRadius:i},s,n)}getItemStyleOverrides(t,e,i,s,n,r){const{id:o,properties:a}=this,{xKey:l,yKey:c,itemStyler:h,fillGradientDefaults:u,fillPatternDefaults:d}=a;if(h==null)return;const{xDomain:p,yDomain:f}=this.cachedDatumCallback("domain",()=>({xDomain:this.getSeriesDomain("x"),yDomain:this.getSeriesDomain("y")})),y=this.cachedDatumCallback(Le(t,r?"highlight":"node"),()=>this.callWithContext(h,{seriesId:o,...fn(e,l,c,p,f),datum:e,xValue:i,yValue:s,highlighted:r,...n}));return ms(y,u,d)}updateDatumNodes(t){if(!this.properties.isValid())return;const{shadow:e}=this.properties,i=this.getCategoryDirection()==="x",s=this.getItemBaseStyle(t.isHighlight),n=this.getShapeFillBBox();t.datumSelection.each((r,o)=>{const a=this.getItemStyleOverrides(String(o.datumIndex),o.datum,o.xValue,o.yValue,s,t.isHighlight);r.opacity=o.opacity??0,Qn(r,s,a,n);const l=a?.cornerRadius??s.cornerRadius;r.topLeftCornerRadius=o.topLeftCornerRadius?l:0,r.topRightCornerRadius=o.topRightCornerRadius?l:0,r.bottomRightCornerRadius=o.bottomRightCornerRadius?l:0,r.bottomLeftCornerRadius=o.bottomLeftCornerRadius?l:0,r.visible=i?(o.clipBBox?.width??o.width)>0:(o.clipBBox?.height??o.height)>0,r.crisp=o.crisp,r.fillShadow=e})}updateLabelSelection(t){const e=this.isLabelEnabled()?t.labelData:[];return t.labelSelection.update(e,i=>{i.pointerEvents=1})}updateLabelNodes(t){t.labelSelection.each((e,i)=>{_x(e,this.properties.label,i.label)})}getTooltipContent(t){const{id:e,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 f=s.dataSources.get(this.id)?.[t],y=i.resolveKeysById(this,"xValue",s)[t],x=i.resolveColumnById(this,"yValue-raw",s)[t];if(y==null)return;const m=this.getItemBaseStyle(!1);return Object.assign(m,this.getItemStyleOverrides(String(t),f,y,x,m,!1)),u.formatTooltip(this.properties,{heading:d.formatDatum(y),symbol:this.legendItemSymbol(),data:[{label:l,fallbackLabel:a,value:p.formatDatum(x)}]},{seriesId:e,datum:f,title:l,xKey:r,xName:o,yKey:a,yName:l,legendItemName:c,stackGroup:h,...m,...this.getModuleTooltipParams()})}legendItemSymbol(){const{fill:t,stroke:e,strokeWidth:i,fillOpacity:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l}=this.properties;return{marker:ms({fill:t??"rgba(0, 0, 0, 0)",stroke:e??"rgba(0, 0, 0, 0)",fillOpacity:s,strokeOpacity:n,strokeWidth:i,lineDash:r,lineDashOffset:o},a,l)}}getLegendData(t){const{showInLegend:e}=this.properties;if(t!=="category"||!this.properties.isValid())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:!e}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e,annotationSelections:i}){const s=el(tl(this.isVertical(),this.axes,"normal"));Xt(this.id,"nodes",this.ctx.animationManager,[t],s),Mt(this,"labels",this.ctx.animationManager,e),Mt(this,"annotations",this.ctx.animationManager,...i)}animateWaitingUpdateReady(t){const{datumSelection:e,labelSelection:i,annotationSelections:s,previousContextData:n}=t;this.ctx.animationManager.stopByAnimationGroupId(this.id);let r=this.processedData?.reduced?.diff?.[this.id];r==null&&this.processedData?.reduced?.diff!=null&&(r={changed:!0,added:new Set(Array.from(e,({datum:h})=>this.getDatumId(h))),updated:new Set,removed:new Set,moved:new Set});const o=n==null?"fade":"normal",a=el(tl(this.isVertical(),this.axes,o));Xt(this.id,"nodes",this.ctx.animationManager,[e],a,(h,u)=>this.getDatumId(u),r);const l=n!=null&&(!fo(t.contextData.scales.x,n.scales.x)||!fo(t.contextData.scales.y,n.scales.y)||!fo(t.contextData.groupScale,t.previousContextData.groupScale));((r?.changed??!1)||l)&&(Mt(this,"labels",this.ctx.animationManager,i),Mt(this,"annotations",this.ctx.animationManager,...s))}getDatumId(t){return Le(t.xValue,t.valueIndex,t.phantom)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){const e=this.contextNodeData?.nodeData[t].clipBBox;return Kp(this,e)}};sl.className="BarSeries",sl.type="bar";var _t=(w(),k(T)),nl={type:(0,_t.required)((0,_t.constant)("bar")),xKey:(0,_t.required)(_t.string),yKey:(0,_t.required)(_t.string),xName:_t.string,yName:_t.string,direction:(0,_t.union)("horizontal","vertical"),grouped:_t.boolean,stacked:_t.boolean,stackGroup:_t.string,normalizedTo:_t.number,legendItemName:_t.string,showInMiniChart:_t.boolean,cornerRadius:_t.positiveNumber,itemStyler:_t.callback,crisp:_t.boolean,label:{...Nn,placement:(0,_t.union)("inside-center","inside-start","inside-end","outside-start","outside-end"),padding:_t.positiveNumber},errorBar:ah,shadow:Ja,tooltip:Ks,...es,..._t.fillOptionsDef,..._t.strokeOptionsDef,..._t.lineDashOptionsDef};nl.pickOutsideVisibleMinorAxis=_t.boolean,nl.fastDataProcessing=_t.boolean,nl.focusPriority=_t.number,nl.sparklineMode=_t.boolean;var Fx={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bar",moduleFactory:t=>new sl(t),stackable:!0,groupable:!0,tooltipDefaults:{range:"exact"},defaultAxes:ex,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:An,fillOpacity:1,strokeWidth: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:"backgroundColor"}]},placement:"inside-center"},shadow:{enabled:!1,color:Sn,xOffset:3,yOffset:3,blur:5},errorBar:{cap:{lengthRatio:.3}}}}},zx={type:"series",name:"bar",chartType:"cartesian",options:nl,create:t=>new sl(t)},Zp=class extends Ce{constructor(){super(...arguments),this.maxSize=30}};g([b(j),G()],Zp.prototype,"maxSize",2),g([b(em,{optional:!0}),G()],Zp.prototype,"domain",2);var Bx=class extends ye{constructor(){super(...arguments),this.placement="top"}};g([b(mu)],Bx.prototype,"placement",2);var Et=class extends Hs{constructor(){super(...arguments),this.label=new Bx,this.tooltip=new Ye,this.marker=new Zp}};g([b(O)],Et.prototype,"xKey",2),g([b(O)],Et.prototype,"yKey",2),g([b(O)],Et.prototype,"sizeKey",2),g([b(O,{optional:!0})],Et.prototype,"labelKey",2),g([b(O,{optional:!0})],Et.prototype,"xFilterKey",2),g([b(O,{optional:!0})],Et.prototype,"yFilterKey",2),g([b(O,{optional:!0})],Et.prototype,"sizeFilterKey",2),g([b(O,{optional:!0})],Et.prototype,"xName",2),g([b(O,{optional:!0})],Et.prototype,"yName",2),g([b(O,{optional:!0})],Et.prototype,"sizeName",2),g([b(O,{optional:!0})],Et.prototype,"labelName",2),g([b(O,{optional:!0})],Et.prototype,"title",2),g([kt("marker.shape")],Et.prototype,"shape",2),g([kt("marker.size")],Et.prototype,"size",2),g([kt("marker.maxSize")],Et.prototype,"maxSize",2),g([kt("marker.domain",{optional:!0})],Et.prototype,"domain",2),g([kt("marker.fillGradientDefaults")],Et.prototype,"fillGradientDefaults",2),g([kt("marker.fillPatternDefaults")],Et.prototype,"fillPatternDefaults",2),g([kt("marker.fill",{optional:!0})],Et.prototype,"fill",2),g([kt("marker.fillOpacity")],Et.prototype,"fillOpacity",2),g([kt("marker.stroke",{optional:!0})],Et.prototype,"stroke",2),g([kt("marker.strokeWidth")],Et.prototype,"strokeWidth",2),g([kt("marker.strokeOpacity")],Et.prototype,"strokeOpacity",2),g([kt("marker.lineDash")],Et.prototype,"lineDash",2),g([kt("marker.lineDashOffset")],Et.prototype,"lineDashOffset",2),g([kt("marker.itemStyler",{optional:!0})],Et.prototype,"itemStyler",2),g([b(F)],Et.prototype,"label",2),g([b(F)],Et.prototype,"tooltip",2);var kk=class extends Dp{constructor(t,e,i,s){super(t,e,i,s),this.sizeKey=s.properties.sizeKey}},lh=class extends Cn{constructor(t){super({moduleCtx:t,directionKeys:or,directionNames:ar,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{label:$s,marker:Za},usesPlacedLabels:!0,clipFocusBox:!1}),this.NodeEvent=kk,this.properties=new Et,this.sizeScale=new Ji}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,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:f,processedData:y}=await this.requestDataModel(t,this.data,{props:[mt(o,s,{id:"xValue"}),mt(a,n,{id:"yValue"}),...c!=null?[mt(c,s,{id:"xFilterValue"})]:[],...h!=null?[mt(h,n,{id:"yFilterValue"})]:[],...u!=null?[mt(u,r,{id:"sizeFilterValue"})]:[],mt(l,r,{id:"sizeValue"}),...d?[mt(d,"band",{id:"labelValue"})]:[]]}),x=f.resolveProcessedDataIndexById(this,"sizeValue");this.sizeScale.domain=p.domain??y.domain.values[x]??[],this.animationState.transition("updateData")}xCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.x.scale.convert(t),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*e;return[a-h,a+h]}yCoordinateRange(t,e,i){const{properties:s,sizeScale:n}=this,{size:r,sizeKey:o}=s,a=this.axes.y.scale.convert(t[0]),l=o!=null?this.dataModel.resolveColumnById(this,"sizeValue",this.processedData):void 0,h=.5*(l!=null?n.convert(l[i]):r)*e;return[a-h,a+h]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],r=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return ri(Gs(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,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:f,labelName:y,label:x,marker:m}=this.properties,{placement:v}=x,S=xe.anchor(m.shape),M=t.x,D=t.y;if(!(e&&i&&n&&M&&D))return;const C=e.resolveColumnById(this,"xValue",i),L=e.resolveColumnById(this,"yValue",i),I=a!=null?e.resolveColumnById(this,"sizeValue",i):void 0,N=u!=null?e.resolveColumnById(this,"labelValue",i):void 0,E=l!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,R=c!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,z=h!=null?e.resolveColumnById(this,"sizeFilterValue",i):void 0,W=M.scale,yt=D.scale,$=(W.bandwidth??0)/2,q=(yt.bandwidth??0)/2,tt=[];s.range=[m.size,m.maxSize];const ht=x.getFont(),lt=Es.getMeasurer({font:ht});return i.dataSources.get(this.id)?.forEach((V,Y)=>{const et=C[Y],st=L[Y],ut=I?.[Y],bt=W.convert(et)+$,X=yt.convert(st)+q;let Z;E!=null&&R!=null&&(Z=E[Y]===et&&R[Y]===st,z!=null&&Z&&(Z=z[Y]===ut));const _=this.getLabelText(x,{value:N!=null?N[Y]:st,datum:V,xKey:r,yKey:o,sizeKey:a,labelKey:u,xName:d,yName:p,sizeName:f,labelName:y}),K=lt.measureText(String(_)),Q=ut!=null?s.convert(ut):m.size;tt.push({series:this,itemId:o,yKey:o,xKey:r,datum:V,datumIndex:Y,xValue:et,yValue:st,sizeValue:ut,point:{x:bt,y:X,size:Q},midPoint:{x:bt,y:X},label:{text:_,...K},anchor:S,placement:v,selected:Z})}),{itemId:o,nodeData:tt,labelData:tt,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;this.properties.marker.isDirty()&&(i.clear(),i.cleanup());const s=this.properties.marker.enabled?e:[];return i.update(s,void 0,n=>Le([n.xValue,n.yValue,n.sizeValue,n.label.text]))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,sizeKey:r,labelKey:o,marker:a}=this.properties,l=gt(i&&this.properties.highlightStyle.item,a.getStyle());this.sizeScale.range=[a.size,a.maxSize];const c=this.getShapeFillBBox();e.each((h,u)=>{this.updateMarkerStyle(a,h,u.datum,u.point,{xKey:s,yKey:n,sizeKey:r,labelKey:o},i,l,c,{selected:u.selected})}),i||this.properties.marker.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,title:f,tooltip:y,marker:x}=r,m=n.x,v=n.y;if(!i||!s||!m||!v)return;const S=s.dataSources.get(this.id)?.[t],M=i.resolveColumnById(this,"xValue",s)[t],D=i.resolveColumnById(this,"yValue",s)[t],C=this.contextNodeData?.nodeData[t];if(M==null||C==null)return;const L=[{label:a,fallbackLabel:o,value:m.formatDatum(M)},{label:c,fallbackLabel:l,value:v.formatDatum(D)}];if(h!=null){const E=i.resolveColumnById(this,"sizeValue",s)[t];L.push({label:u,fallbackLabel:h,value:String(E)})}const I=x.getStyle(),N=this.getMarkerStyle(x,S,{xKey:o,yKey:l,sizeKey:h,labelKey:d,highlighted:!0},!1,void 0,I);return y.formatTooltip(this.properties,{title:f,symbol:this.legendItemSymbol(),data:L},{seriesId:e,datum:S,title:l,xKey:o,xName:a,yKey:l,yName:c,sizeKey:h,sizeName:u,labelKey:d,labelName:p,...N,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(){if(!this.properties.isValid())return[];const{id:t,ctx:{legendManager:e},visible:i}=this,{yKey:s,yName:n,title:r}=this.properties;return[{legendType:"category",id:t,itemId:s,seriesId:t,enabled:i&&e.getItemEnabled({seriesId:t,itemId:s}),label:{text:r??n??s},symbol:this.legendItemSymbol()}]}animateEmptyUpdateReady({markerSelection:t,labelSelection:e}){wp(this,this.ctx.animationManager,t),Mt(this,"labels",this.ctx.animationManager,e)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new it}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,sizeKey:s,labelKey:n,marker:r}=this.properties;return this.getMarkerStyle(r,t,{xKey:e,yKey:i,sizeKey:s,labelKey:n},!1,t.point.size)}computeFocusBounds(t){return qa(this,t)}};lh.className="BubbleSeries",lh.type="bubble";var ve=(w(),k(T)),wk={type:(0,ve.required)((0,ve.constant)("bubble")),xKey:(0,ve.required)(ve.string),yKey:(0,ve.required)(ve.string),sizeKey:(0,ve.required)(ve.string),labelKey:ve.string,xName:ve.string,yName:ve.string,sizeName:ve.string,labelName:ve.string,title:ve.string,domain:(0,ve.arrayOf)(ve.number),maxSize:ve.positiveNumber,showInMiniChart:ve.boolean,label:{placement:(0,ve.union)("top","right","bottom","left"),...Nn},tooltip:Ks,...es,...on(Qa,["enabled"])},Ek={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"bubble",moduleFactory:t=>new lh(t),tooltipDefaults:{range:"nearest"},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:An,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}}}}},Gx={type:"series",name:"bubble",chartType:"cartesian",options:wk,create:t=>new lh(t)},Xp=(w(),k(T)),ie=class extends Hs{constructor(){super(...arguments),this.fillGradientDefaults=new Pi,this.fillPatternDefaults=new qt,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 ts,this.label=new ye,this.tooltip=new Ye}};g([b(O)],ie.prototype,"xKey",2),g([b(O,{optional:!0})],ie.prototype,"yKey",2),g([b(O,{optional:!0})],ie.prototype,"xName",2),g([b(O,{optional:!0})],ie.prototype,"yName",2),g([b(we(hs,us,dt))],ie.prototype,"fill",2),g([b(F)],ie.prototype,"fillGradientDefaults",2),g([b(F)],ie.prototype,"fillPatternDefaults",2),g([b(It)],ie.prototype,"fillOpacity",2),g([b(dt,{optional:!0})],ie.prototype,"stroke",2),g([b(j)],ie.prototype,"strokeWidth",2),g([b(It)],ie.prototype,"strokeOpacity",2),g([b(ds)],ie.prototype,"lineDash",2),g([b(j)],ie.prototype,"lineDashOffset",2),g([b(j)],ie.prototype,"cornerRadius",2),g([b(H)],ie.prototype,"areaPlot",2),g([b(zn,{optional:!0})],ie.prototype,"bins",2),g([b(At(["count","sum","mean"],"a histogram aggregation"))],ie.prototype,"aggregation",2),g([b(j,{optional:!0})],ie.prototype,"binCount",2),g([b(F)],ie.prototype,"shadow",2),g([b(F)],ie.prototype,"label",2),g([b(F)],ie.prototype,"tooltip",2);var Vx=10,ch=class extends Cn{constructor(t){super({moduleCtx:t,directionKeys:or,directionNames:ar,categoryKey:void 0,pickModes:[1,0],datumSelectionGarbageCollection:!1,animationResetFns:{datum:il,label:$s}}),this.properties=new ie,this.calculatedBins=[]}deriveBins(t){const e=dd(t[0],t[1],Vx),i=ca(t[0],t[1],Vx),[s]=e,n=r=>[r,r+i];return[[s-i,s],...e.map(n)]}calculateNiceBins(t,e){const i=Math.floor(t[0]),s=t[1],n=e||1,{start:r,binSize:o}=this.calculateNiceStart(i,s,n);return this.getBins(r,s,o,n)}getBins(t,e,i,s){const n=[],r=this.calculatePrecision(i);for(let o=0;o<s;o++){const a=Math.round((t+o*i)*r)/r;let l=Math.round((t+(o+1)*i)*r)/r;o===s-1&&(l=Math.max(l,e)),n[o]=[a,l]}return n}calculatePrecision(t){let e=10;if(isFinite(t)&&t>0)for(;t<1;)e*=10,t*=10;return e}calculateNiceStart(t,e,i){const s=Math.abs(e-t)/i,n=Math.floor(Math.log10(s)),r=Math.pow(10,n);return{start:Math.floor(t/r)*r,binSize:s}}async processData(t){this.visible||(this.processedData=void 0,this.animationState.transition("updateData"));const{xKey:e,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=[Qi(e,a),R0];if(i){let u=qd("groupAgg");n==="count"||(n==="sum"?u=S0("groupAgg"):n==="mean"&&(u=D0("groupAgg"))),s&&(u=Qd("groupAgg",u)),c.push(mt(i,l,{invalidValue:void 0}),u)}else{c.push(T0("count"));let u=qd("groupAgg");s&&(u=Qd("groupAgg",u)),c.push(u)}const h=u=>{const d=ri(u.domain.keys[0]);if(d.length===0)return u.domain.groups=[],()=>[];const p=(0,Xp.isNumber)(this.properties.binCount)?this.calculateNiceBins(d,this.properties.binCount):this.properties.bins??this.deriveBins(d),f=p.length;return this.calculatedBins=[...p],y=>{let x=y[0];if((0,Xp.isDate)(x)&&(x=x.getTime()),!(0,Xp.isNumber)(x))return[];for(let m=0;m<f;m++){const v=p[m];if(x>=v[0]&&x<v[1]||m===f-1&&x<=v[1])return v}return[]}};!this.ctx.animationManager.isSkipped()&&this.processedData&&c.push(ro(this.id,this.processedData,!1)),await this.requestDataModel(t,this.data,{props:c,groupByFn:h}),this.animationState.transition("updateData")}xCoordinateRange(){return[NaN,NaN]}yCoordinateRange(){return[NaN,NaN]}getSeriesDomain(t){const{processedData:e,dataModel:i}=this;if(!e||!i||!this.calculatedBins.length)return[];const s=i.getDomain(this,"groupAgg","aggregate",e),n=this.calculatedBins?.[0][0],r=this.calculatedBins?.[(this.calculatedBins?.length??0)-1][1];return ri(t==="x"?[n,r]:s)}getSeriesRange(t,[e,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,[f,y]=ne([r.convert(d),r.convert(p)]);if(y>=e&&f<=i){const x=h+u;a=Math.max(a,x)}}),o>a?[NaN,NaN]:[o,a]}createNodeData(){const{id:t,axes:e,processedData:i,dataModel:s}=this,n=e.x,r=e.y;if(!n||!r||!s)return;const{scale:o}=n,{scale:a}=r,{xKey:l,yKey:c,xName:h,yName:u}=this.properties,d=this.properties.label.formatter,p=[],f={itemId:this.properties.yKey??this.id,nodeData:p,labelData:p,scales:this.calculateScaling(),animationValid:!0,visible:this.visible};return!this.visible||i==null||i.type!=="grouped"||(i.groups.forEach((y,x)=>{const{keys:m,datumIndices:v,aggregation:S}=y,[[M,D]=[0,0]]=S,C=v.length,L=m,[I,N]=L,E=[...s.forEachDatum(this,i,y)],R=o.convert(I),z=o.convert(N),W=M+D,yt=a.convert(0),$=a.convert(W),q=Math.abs(z-R),tt=Math.abs($-yt),ht=Math.min(R,z),lt=Math.min(yt,$);let V;W!==0&&(V={x:ht+q/2,y:lt+tt/2,text:this.cachedDatumCallback(Le(x,"label"),()=>d?.({value:W,datum:E,seriesId:t,xKey:l,yKey:c,xName:h,yName:u}))??r.formatDatum(W)});const Y={x:ht+q/2,y:lt+tt/2},et=r.isReversed();p.push({series:this,datumIndex:x,datum:E,aggregatedValue:W,frequency:C,domain:L,yKey:c,xKey:l,x:ht,y:lt,xValue:R,yValue:$,width:q,height:tt,midPoint:Y,topLeftCornerRadius:!et,topRightCornerRadius:!et,bottomRightCornerRadius:et,bottomLeftCornerRadius:et,label:V,crisp:!0})}),p.sort((y,x)=>y.x-x.x)),f}nodeFactory(){return new Ue}updateDatumSelection(t){const{nodeData:e,datumSelection:i}=t;return i.update(e,void 0,s=>s.domain.join("_"))}getItemBaseStyle(t){const{properties:e}=this,i=t?e.highlightStyle.item:void 0;return ms({fill:i?.fill??e.fill,fillOpacity:i?.fillOpacity??e.fillOpacity,stroke:i?.stroke??e.stroke,strokeWidth:i?.strokeWidth??this.getStrokeWidth(e.strokeWidth),strokeOpacity:i?.strokeOpacity??e.strokeOpacity,lineDash:i?.lineDash??e.lineDash,lineDashOffset:i?.lineDashOffset??e.lineDashOffset,cornerRadius:e.cornerRadius},e.fillGradientDefaults,e.fillPatternDefaults)}updateDatumNodes(t){const{isHighlight:e}=t,{shadow:i}=this.properties,s=this.getItemBaseStyle(e),n=this.getShapeFillBBox();t.datumSelection.each((r,o)=>{const{cornerRadius:a}=s,{topLeftCornerRadius:l,topRightCornerRadius:c,bottomRightCornerRadius:h,bottomLeftCornerRadius:u}=o;Qn(r,s,void 0,n),r.topLeftCornerRadius=l?a:0,r.topRightCornerRadius=c?a:0,r.bottomRightCornerRadius=h?a:0,r.bottomLeftCornerRadius=u?a:0,r.crisp=o.crisp,r.fillShadow=i,r.visible=o.height>0})}updateLabelSelection(t){const{labelData:e,labelSelection:i}=t;return i.update(e,s=>{s.pointerEvents=1,s.textAlign="center",s.textBaseline="middle"})}updateLabelNodes(t){const{fontStyle:e,fontWeight:i,fontFamily:s,fontSize:n,color:r}=this.properties.label,o=this.isLabelEnabled();t.labelSelection.each((a,l)=>{o&&l?.label?(a.text=l.label.text,a.x=l.label.x,a.y=l.label.y,a.fontStyle=e,a.fontWeight=i,a.fontFamily=s,a.fontSize=n,a.fill=r,a.visible=!0):a.visible=!1})}initQuadTree(t){const{value:e}=this.contentGroup.children().next();e&&Up(t,e.children())}pickNodeClosestDatum(t){return Yp(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r,ctx:{localeManager:o}}=this,{xKey:a,xName:l,yKey:c,yName:h,tooltip:u}=r,d=n.x,p=n.y;if(!i||s?.type!=="grouped"||!d||!p)return;const f=s.groups[t],{aggregation:y,datumIndices:x,keys:m}=f,[[v,S]=[0,0]]=y,M=x.length,D=m,[C,L]=D,I=v+S,N={data:[...i.forEachDatum(this,s,f)],aggregatedValue:I,frequency:M,domain:D},E=[{label:l,fallbackLabel:a,value:`${d.formatDatum(C)} - ${d.formatDatum(L)}`},{label:o.t("seriesHistogramTooltipFrequency"),value:p.formatDatum(M)}];if(c!=null){let R;switch(r.aggregation){case"sum":R=o.t("seriesHistogramTooltipSum",{yName:h??c});break;case"mean":R=o.t("seriesHistogramTooltipMean",{yName:h??c});break;case"count":R=o.t("seriesHistogramTooltipCount",{yName:h??c});break}E.push({label:R,value:p.formatDatum(I)})}return u.formatTooltip(this.properties,{symbol:this.legendItemSymbol(),data:E},{seriesId:e,datum:N,title:h,xKey:a,xName:l,yKey:c,yName:h,xRange:[C,L],frequency:M,...this.getItemBaseStyle(!1)})}legendItemSymbol(){const{fill:t,fillOpacity:e,stroke:i,strokeWidth:s,strokeOpacity:n,lineDash:r,lineDashOffset:o,fillGradientDefaults:a,fillPatternDefaults:l}=this.properties;return{marker:ms({fill:t??"rgba(0, 0, 0, 0)",stroke:i??"rgba(0, 0, 0, 0)",fillOpacity:e,strokeOpacity:n,strokeWidth:s,lineDash:r,lineDashOffset:o},a,l)}}getLegendData(t){if(t!=="category")return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{xKey:n,yName:r,showInLegend:o}=this.properties;return[{legendType:"category",id:e,itemId:n,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:r??n??"Frequency"},symbol:this.legendItemSymbol(),hideInLegend:!o}]}animateEmptyUpdateReady({datumSelection:t,labelSelection:e}){const i=el(tl(!0,this.axes,"normal"));Xt(this.id,"datums",this.ctx.animationManager,[t],i),Mt(this,"labels",this.ctx.animationManager,e)}animateWaitingUpdateReady(t){const e=this.processedData?.reduced?.diff?.[this.id],i=el(tl(!0,this.axes,"normal"));Xt(this.id,"datums",this.ctx.animationManager,[t.datumSelection],i,(s,n)=>Le(n.domain),e),Mt(this,"labels",this.ctx.animationManager,t.labelSelection)}isLabelEnabled(){return this.properties.label.enabled}computeFocusBounds({datumIndex:t}){return Kp(this,this.contextNodeData?.nodeData[t])}};ch.className="HistogramSeries",ch.type="histogram";var Ne=(w(),k(T)),Ok={type:(0,Ne.required)((0,Ne.constant)("histogram")),xKey:(0,Ne.required)(Ne.string),yKey:Ne.string,xName:Ne.string,yName:Ne.string,areaPlot:Ne.boolean,aggregation:(0,Ne.union)("count","sum","mean"),bins:(0,Ne.arrayOf)((0,Ne.arrayOf)(Ne.number)),binCount:Ne.positiveNumber,showInMiniChart:Ne.boolean,cornerRadius:Ne.positiveNumber,label:Nn,tooltip:Ks,shadow:Ja,...es,...Ne.fillOptionsDef,...Ne.strokeOptionsDef,...Ne.lineDashOptionsDef},Rk={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"histogram",moduleFactory:t=>new ch(t),tooltipDefaults:{range:"exact"},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:An,strokeWidth:1,fillOpacity:1,strokeOpacity:1,lineDash:[0],lineDashOffset:0,label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"backgroundColor"}},shadow:{enabled:!1,color:Sn,xOffset:3,yOffset:3,blur:5}}}},Ux={type:"series",name:"histogram",chartType:"cartesian",enterprise:!0,options:Ok,create:t=>new ch(t)},Pk=(w(),k(T)),de=class extends Hs{constructor(){super(...arguments),this.stroke="#874349",this.strokeWidth=2,this.strokeOpacity=1,this.lineDash=[0],this.lineDashOffset=0,this.interpolation=new go,this.marker=new Ce,this.label=new ye,this.tooltip=new Ye,this.connectMissingData=!1,this.sparklineMode=!1}};g([b(O)],de.prototype,"xKey",2),g([b(O)],de.prototype,"yKey",2),g([b(O,{optional:!0})],de.prototype,"xName",2),g([b(O,{optional:!0})],de.prototype,"yName",2),g([b(O,{optional:!0})],de.prototype,"yFilterKey",2),g([b(O,{optional:!0})],de.prototype,"stackGroup",2),g([b(j,{optional:!0})],de.prototype,"normalizedTo",2),g([b(O,{optional:!0})],de.prototype,"title",2),g([b(dt)],de.prototype,"stroke",2),g([b(j)],de.prototype,"strokeWidth",2),g([b(It)],de.prototype,"strokeOpacity",2),g([b(ds)],de.prototype,"lineDash",2),g([b(j)],de.prototype,"lineDashOffset",2),g([b(F)],de.prototype,"interpolation",2),g([b(F)],de.prototype,"marker",2),g([b(F)],de.prototype,"label",2),g([b(F)],de.prototype,"tooltip",2),g([b(H)],de.prototype,"connectMissingData",2),g([b(H)],de.prototype,"sparklineMode",2);var _k=.25,rl=class extends Cn{constructor(t){super({moduleCtx:t,directionKeys:or,directionNames:ar,categoryKey:"xValue",hasMarkers:!0,pickModes:[2,1,0],markerSelectionGarbageCollection:!1,animationResetFns:{path:Rp({getVisible:()=>this.visible,getOpacity:()=>this.getOpacity()}),label:$s,marker:(e,i)=>({...Za(e),...Xa(e,i)})},clipFocusBox:!1}),this.properties=new de,this.dataAggregationFilters=void 0}get pickModeAxis(){return this.properties.sparklineMode?"main":"main-category"}async processData(t){if(this.data==null||!this.properties.isValid())return;const{data:e,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:f,yScaleType:y}=this.getScaleInformation({xScale:u,yScale:d}),x=n>=1||c!=null,m={invalidValue:null};l&&x&&(m.invalidValue=0),x&&!i&&(m.forceValue=0);const v=[];if((!p||x)&&v.push(Qi(r,f,{id:"xKey"})),v.push(mt(r,f,{id:"xValue"}),mt(o,y,{id:"yValueRaw",...m,invalidValue:void 0})),a!=null&&v.push(mt(a,y,{id:"yFilterRaw"})),x){const D=[`line-stack-${s}-yValues`,`line-stack-${s}-yValues-trailing`,`line-stack-${s}-yValues-marker`];v.push(...bn(o,"window","current",{id:"yValueEnd",...m,groupId:D[0]},y),...bn(o,"window-trailing","current",{id:"yValueStart",...m,groupId:D[1]},y),...bn(o,"normal","current",{id:"yValueCumulative",...m,groupId:D[2]},y)),(0,Pk.isDefined)(c)&&v.push(Ec([D[0],D[1],D[2]],c))}h&&(v.push(no(p?["xValue"]:void 0)),this.processedData&&v.push(ro(this.id,this.processedData)));const{dataModel:S,processedData:M}=await this.requestDataModel(t,e,{props:v,groupByKeys:x,groupByData:!x});this.dataAggregationFilters=this.aggregateData(S,M),this.animationState.transition("updateData")}xCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.x.scale.convert(t),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}yCoordinateRange(t,e){const{marker:i}=this.properties,s=this.axes.y.scale.convert(t[0]),n=i.enabled?.5*i.size*e:0;return[s-n,s+n]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!e||!i)return[];if(t==="x"){const r=e.resolveProcessedDataDefById(this,"xValue"),o=e.getDomain(this,"xValue","value",i);return r?.def.type==="value"&&r.def.valueType==="category"?o:ri(Gs(o))}const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw",n=this.domainForClippedRange("y",[s],"xValue",!0);return ri(n)}getSeriesRange(t,e){const i=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.domainForVisibleRange("y",[i],"xValue",e,!0)}getVisibleItems(t,e,i){const s=this.dataModel?.hasColumnById(this,"yValueEnd")?"yValueEnd":"yValueRaw";return this.countVisibleItems("xValue",[s],t,e,i)}aggregateData(t,e){}createNodeData(){const{dataModel:t,processedData:e,axes:i,dataAggregationFilters:s}=this,n=i.x,r=i.y;if(!t||!e||!n||!r)return;const{xKey:o,yKey:a,yFilterKey:l,xName:c,yName:h,marker:u,label:d,connectMissingData:p,interpolation:f,legendItemName:y}=this.properties,x=this.dataModel?.hasColumnById(this,"yValueEnd"),m=n.scale,v=r.scale,S=(m.bandwidth??0)/2,M=(v.bandwidth??0)/2,D=u.enabled?u.size:0,C=e.dataSources.get(this.id)??[],L=t.resolveColumnById(this,"xValue",e),I=t.resolveColumnById(this,"yValueRaw",e),N=x?t.resolveColumnById(this,"yValueEnd",e):void 0,E=x?t.resolveColumnById(this,"yValueCumulative",e):I,R=l!=null?t.resolveColumnById(this,"yFilterRaw",e):void 0,z=_=>m.convert(L[_])+S,W=_=>v.convert(E[_])+M,yt={lengthRatioMultiplier:this.properties.marker.getDiameter(),lengthMax:1/0},$=[];let q;const tt=_=>{const K=C[_],Q=L[_],Ot=I[_],Rt=N?.[_],Ut=R?.[_],ae=z(_),He=W(_);if(!Number.isFinite(ae))return;if(Ot!=null){const ii=d.enabled?this.getLabelText(d,{value:Ot,datum:K,xKey:o,yKey:a,xName:c,yName:h,legendItemName:y}):void 0;$.push({series:this,datum:K,datumIndex:_,yKey:a,xKey:o,point:{x:ae,y:He,size:D},midPoint:{x:ae,y:He},cumulativeValue:Rt,yValue:Ot,xValue:Q,capDefaults:yt,labelText:ii,selected:Ut})}if(q==null)return;const Ke=q[q.length-1];if(Ot!=null){const ii={point:{x:ae,y:He},xDatum:Q,yDatum:Ot};Array.isArray(Ke)?Ke.push(ii):Ke!=null?(Ke.skip+=1,q.push([ii])):q.push([ii])}else p||(Array.isArray(Ke)||Ke==null?q.push({skip:0}):Ke.skip+=1)},[ht,lt]=m.range,V=lt-ht,et=s?.find(_=>_.maxRange>V)?.indices;let[st,ut]=this.visibleRange("xValue",n.range,et);st=Math.max(st-1,0),ut=Math.min(ut+1,et?.length??L.length),e.input.count<1e3&&(st=0,ut=e.input.count),et==null&&(q=[]);for(let _=st;_<ut;_+=1)tt(et?.[_]??_);const bt=q?.flatMap(_=>Array.isArray(_)?Zc(_,f):[]),X=bt!=null?{itemId:a,spans:bt}:void 0,Z=R?.some((_,K)=>_===I[K])??!1;return{itemId:a,nodeData:$,labelData:$,strokeData:X,scales:this.calculateScaling(),visible:this.visible,crossFiltering:Z}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}updatePathNodes(t){const{paths:[e],opacity:i,visible:s,animationEnabled:n}=t,r=this.contextNodeData?.crossFiltering===!0;e.setProperties({fill:void 0,lineJoin:"round",pointerEvents:1,opacity:i,stroke:this.properties.stroke,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.properties.strokeOpacity*(r?_k:1),lineDash:this.properties.lineDash,lineDashOffset:this.properties.lineDashOffset}),n||(e.visible=s),Jc(this,e)}getMarkerItemBaseStyle(t){const{properties:e}=this,{marker:i}=e,s=t?e.highlightStyle.item:void 0;return ms({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},i.fillGradientDefaults,i.fillPatternDefaults)}getMarkerItemStyleOverrides(t,e,i,s){const{id:n,properties:r}=this,{xKey:o,yKey:a,marker:l}=r,{itemStyler:c}=l;if(c!=null)return this.cachedDatumCallback(Le(t,s?"highlight":"node"),()=>{const h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y");return this.callWithContext(c,{seriesId:n,...fn(e,o,a,h,u),datum:e,highlighted:s,...i})})}updateMarkerSelection(t){let{nodeData:e}=t;const{markerSelection:i}=t;return e=this.properties.marker.enabled||this.contextNodeData?.crossFiltering===!0?e:[],this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(e,void 0,n=>Le(n.xValue))}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,stroke:r,strokeWidth:o,strokeOpacity:a,marker:l,highlightStyle:c}=this.properties,h=this.getSeriesDomain("x"),u=this.getSeriesDomain("y"),d=gt(i&&c.item,l.getStyle(),{stroke:r,strokeWidth:o,strokeOpacity:a}),p=this.ctx.animationManager.isSkipped(),f=this.getShapeFillBBox();e.each((y,x)=>{this.updateMarkerStyle(l,y,x.datum,x.point,fn(x,s,n,h,u),i,d,f,{applyTranslation:p,selected:x.selected})}),i||l.markClean()}updateLabelSelection(t){return t.labelSelection.update(this.isLabelEnabled()?t.labelData:[])}updateLabelNodes(t){const{enabled:e,fontStyle:i,fontWeight:s,fontSize:n,fontFamily:r,color:o}=this.properties.label;t.labelSelection.each((a,l)=>{e&&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.visible=!1})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,tooltip:h}=r,u=n.x,d=n.y;if(!i||!s||!u||!d)return;const p=s.dataSources.get(this.id)?.[t],f=i.resolveColumnById(this,"xValue",s)[t],y=i.resolveColumnById(this,"yValueRaw",s)[t];if(f==null)return;const x=this.getMarkerItemBaseStyle(!1);return Object.assign(x,this.getMarkerItemStyleOverrides(String(t),p,x,!1)),h.formatTooltip(this.properties,{heading:u.formatDatum(f),symbol:this.legendItemSymbol(),data:[{label:c,fallbackLabel:l,value:d.formatDatum(y)}]},{seriesId:e,datum:p,title:c,xKey:o,xName:a,yKey:l,yName:c,...x,...this.getModuleTooltipParams()})}legendItemSymbol(){const t="rgba(0, 0, 0, 0)",{stroke:e,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??t,stroke:r.stroke??e??t}),enabled:r.enabled},line:{stroke:e??t,strokeOpacity:i,strokeWidth:s,lineDash:n}}}getLegendData(t){if(!(this.properties.isValid()&&t==="category"))return[];const{id:e,ctx:{legendManager:i},visible:s}=this,{yKey:n,yName:r,title:o,legendItemName:a,showInLegend:l}=this.properties;return[{legendType:"category",id:e,itemId:n,legendItemName:a,seriesId:e,enabled:s&&i.getItemEnabled({seriesId:e,itemId:n}),label:{text:a??o??r??n},symbol:this.legendItemSymbol(),hideInLegend:!l}]}updatePaths(t){this.updateLinePaths(t.paths,t.contextData)}plotNodeDataPoints(t,e){if(e.length===0)return;const i=e[0].point;t.moveTo(i.x,i.y);for(let s=1;s<e.length;s+=1){const{x:n,y:r}=e[s].point;t.lineTo(n,r)}}updateLinePaths(t,e){const i=e.strokeData?.spans,[s]=t;s.path.clear(),i!=null?Np(s,i):this.plotNodeDataPoints(s.path,e.nodeData),s.markDirty("LineSeries")}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s,contextData:n,paths:r}=t,{animationManager:o}=this.ctx;this.updateLinePaths(r,n),Op(this,o,...r),Ie([e],Xa),Ep(this,o,e),Mt(this,"labels",o,i),Mt(this,"annotations",o,...s)}animateReadyResize(t){const{contextData:e,paths:i}=t;this.updateLinePaths(i,e),super.animateReadyResize(t)}animateWaitingUpdateReady(t){const{animationManager:e}=this.ctx,{markerSelection:i,labelSelection:s,annotationSelections:n,contextData:r,paths:o,previousContextData:a}=t,[l]=o;this.resetMarkerAnimation(t),this.resetLabelAnimation(t);const c=()=>{this.resetPathAnimation(t),this.updateLinePaths(o,r)},h=()=>{e.skipCurrentBatch(),c()};if(r==null||a==null){c(),Ka(this,e,"added",i),Qc(this,"path_properties",e,"add",l),Mt(this,"labels",e,s),Mt(this,"annotations",e,...n);return}if(r.crossFiltering!==a.crossFiltering){h();return}const u=Ax(r,a,this.processedData?.reduced?.diff?.[this.id]);if(u===void 0){h();return}else if(u.status==="no-op")return;Xt(this.id,"path_properties",e,[l],u.stroke.pathProperties),u.status==="added"?this.updateLinePaths(o,r):u.status==="removed"?this.updateLinePaths(o,a):$c(this.id,"path_update",e,[l],u.stroke.path),u.hasMotion&&(Ka(this,e,void 0,i),Mt(this,"labels",e,s),Mt(this,"annotations",e,...n))}isLabelEnabled(){return this.properties.label.enabled}getBandScalePadding(){return{inner:1,outer:.1}}nodeFactory(){return new it}getFormattedMarkerStyle(t){const{xKey:e,yKey:i}=this.properties,s=this.getSeriesDomain("x"),n=this.getSeriesDomain("y");return this.getMarkerStyle(this.properties.marker,t.datum,fn(t,e,i,s,n),!0)}computeFocusBounds(t){return qa(this,t)}};rl.className="LineSeries",rl.type="line";var Me=(w(),k(T)),hh={type:(0,Me.constant)("line"),xKey:(0,Me.required)(Me.string),yKey:(0,Me.required)(Me.string),xName:Me.string,yName:Me.string,title:Me.string,stacked:Me.boolean,stackGroup:Me.string,normalizedTo:Me.number,legendItemName:Me.string,showInMiniChart:Me.boolean,connectMissingData:Me.boolean,interpolation:Vp,label:Nn,marker:Qa,tooltip:Ks,errorBar:ah,...es,...Me.strokeOptionsDef,...Me.lineDashOptionsDef};hh.pickOutsideVisibleMinorAxis=Me.boolean,hh.focusPriority=Me.number,hh.sparklineMode=Me.boolean;var Yx={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"line",moduleFactory:t=>new rl(t),stackable:!0,tooltipDefaults:{range:"nearest"},defaultAxes:[{type:"number",position:"left"},{type:"category",position:"bottom"}],themeTemplate:{series:{tooltip:{position:{_seriesOverrideType:"node"}},stroke:Wc,strokeWidth:2,strokeOpacity:1,lineDash:[0],lineDashOffset:0,interpolation:{type:"linear"},marker:{shape:"circle",size:7,strokeWidth:0,fill:{$palette:"fill"},stroke:{$palette:"stroke"},fillGradientDefaults:{type:"gradient",gradient:"radial",bounds:"item",colorStops:{$palette:"gradient"},rotation:0,reverse:!0},fillPatternDefaults:An},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Wx={type:"series",name:"line",chartType:"cartesian",options:hh,create:t=>new rl(t)},$x=class extends ye{constructor(){super(...arguments),this.placement="top"}};g([b(mu)],$x.prototype,"placement",2);var Wt=class extends Hs{constructor(){super(...arguments),this.label=new $x,this.tooltip=new Ye,this.marker=new Ce}};g([b(O)],Wt.prototype,"xKey",2),g([b(O)],Wt.prototype,"yKey",2),g([b(O,{optional:!0})],Wt.prototype,"labelKey",2),g([b(O,{optional:!0})],Wt.prototype,"xFilterKey",2),g([b(O,{optional:!0})],Wt.prototype,"yFilterKey",2),g([b(O,{optional:!0})],Wt.prototype,"xName",2),g([b(O,{optional:!0})],Wt.prototype,"yName",2),g([b(O,{optional:!0})],Wt.prototype,"labelName",2),g([b(O,{optional:!0})],Wt.prototype,"title",2),g([kt("marker.shape")],Wt.prototype,"shape",2),g([kt("marker.size")],Wt.prototype,"size",2),g([kt("marker.fill",{optional:!0})],Wt.prototype,"fill",2),g([kt("marker.fillGradientDefaults")],Wt.prototype,"fillGradientDefaults",2),g([kt("marker.fillPatternDefaults")],Wt.prototype,"fillPatternDefaults",2),g([kt("marker.fillOpacity")],Wt.prototype,"fillOpacity",2),g([kt("marker.stroke")],Wt.prototype,"stroke",2),g([kt("marker.strokeWidth")],Wt.prototype,"strokeWidth",2),g([kt("marker.strokeOpacity")],Wt.prototype,"strokeOpacity",2),g([kt("marker.lineDash")],Wt.prototype,"lineDash",2),g([kt("marker.lineDashOffset")],Wt.prototype,"lineDashOffset",2),g([kt("marker.itemStyler",{optional:!0})],Wt.prototype,"itemStyler",2),g([b(F)],Wt.prototype,"label",2),g([b(F)],Wt.prototype,"tooltip",2);var uh=class extends Cn{constructor(t){super({moduleCtx:t,directionKeys:or,directionNames:ar,categoryKey:void 0,pickModes:[2,1,0],pathsPerSeries:[],hasMarkers:!0,markerSelectionGarbageCollection:!1,animationResetFns:{marker:Za,label:$s},usesPlacedLabels:!0,clipFocusBox:!1}),this.properties=new Wt}get pickModeAxis(){return"main-category"}async processData(t){if(!this.properties.isValid()||this.data==null||!this.visible)return;const e=this.axes.x?.scale,i=this.axes.y?.scale,{xScaleType:s,yScaleType:n}=this.getScaleInformation({xScale:e,yScale:i}),{xKey:r,yKey:o,xFilterKey:a,yFilterKey:l,labelKey:c}=this.properties;await this.requestDataModel(t,this.data,{props:[mt(r,s,{id:"xValue"}),mt(o,n,{id:"yValue"}),...a!=null?[mt(a,s,{id:"xFilterValue"})]:[],...l!=null?[mt(l,n,{id:"yFilterValue"})]:[],...c?[mt(c,"band",{id:"labelValue"})]:[]]}),this.animationState.transition("updateData")}xCoordinateRange(t,e){const i=this.axes.x.scale.convert(t),s=.5*this.properties.size*e;return[i-s,i+s]}yCoordinateRange(t,e){const i=this.axes.y.scale.convert(t[0]),s=.5*this.properties.size*e;return[i-s,i+s]}getSeriesDomain(t){const{dataModel:e,processedData:i}=this;if(!i||!e)return[];const s={x:"xValue",y:"yValue"},n=s[t],r=e.resolveProcessedDataDefById(this,n),o=e.getDomain(this,n,"value",i);if(r?.def.type==="value"&&r?.def.valueType==="category")return o;const l=s[t==="x"?"y":"x"],c=this.domainForClippedRange(t,[n],l,!1);return ri(Gs(c))}getSeriesRange(t,e){return this.domainForVisibleRange("y",["yValue"],"xValue",e,!1)}getVisibleItems(t,e,i){return this.countVisibleItems("xValue",["yValue"],t,e,i)}createNodeData(){const{axes:t,dataModel:e,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:f}=p,y=xe.anchor(d.shape),x=t.x,m=t.y;if(!(e&&i&&s&&x&&m))return;const v=e.resolveColumnById(this,"xValue",i),S=e.resolveColumnById(this,"yValue",i),M=l!=null?e.resolveColumnById(this,"labelValue",i):void 0,D=o!=null?e.resolveColumnById(this,"xFilterValue",i):void 0,C=a!=null?e.resolveColumnById(this,"yFilterValue",i):void 0,L=x.scale,I=m.scale,N=(L.bandwidth??0)/2,E=(I.bandwidth??0)/2,R=[],z=p.getFont(),W=Es.getMeasurer({font:z});return(i.dataSources.get(this.id)??[]).forEach(($,q)=>{const tt=v[q],ht=S[q],lt=L.convert(tt)+N,V=I.convert(ht)+E,Y=D!=null&&C!=null?D[q]===tt&&C[q]===ht:void 0,et=this.getLabelText(p,{value:M!=null?M?.[q]:ht,datum:$,xKey:n,yKey:r,labelKey:l,xName:c,yName:h,labelName:u}),st=W.measureText(et);R.push({series:this,itemId:r,yKey:r,xKey:n,datum:$,datumIndex:q,xValue:tt,yValue:ht,capDefaults:{lengthRatioMultiplier:d.getDiameter(),lengthMax:1/0},point:{x:lt,y:V,size:d.size},midPoint:{x:lt,y:V},label:{text:et,...st},anchor:y,placement:f,selected:Y})}),{itemId:r,nodeData:R,labelData:R,scales:this.calculateScaling(),visible:this.visible}}isPathOrSelectionDirty(){return this.properties.marker.isDirty()}getLabelData(){return this.isLabelEnabled()?this.contextNodeData?.labelData??[]:[]}updateMarkerSelection(t){const{nodeData:e,markerSelection:i}=t;return this.properties.marker.isDirty()&&(i.clear(),i.cleanup()),i.update(this.properties.marker.enabled?e:[])}updateMarkerNodes(t){const{markerSelection:e,isHighlight:i}=t,{xKey:s,yKey:n,labelKey:r,marker:o,highlightStyle:a}=this.properties,l=gt(i&&a.item,o.getStyle()),c=this.getShapeFillBBox();e.each((h,u)=>{this.updateMarkerStyle(o,h,u.datum,u.point,{xKey:s,yKey:n,labelKey:r},i,l,c,{selected:u.selected})}),i||o.markClean()}updatePlacedLabelData(t){this.labelSelection.update(t.map(e=>({...e.datum,point:{x:e.x,y:e.y,size:e.datum.point.size}})),e=>{e.pointerEvents=1}),this.updateLabelNodes({labelSelection:this.labelSelection})}updateLabelNodes(t){const{label:e}=this.properties;t.labelSelection.each((i,s)=>{i.text=s.label.text,i.fill=e.color,i.x=s.point?.x??0,i.y=s.point?.y??0,i.fontStyle=e.fontStyle,i.fontWeight=e.fontWeight,i.fontSize=e.fontSize,i.fontFamily=e.fontFamily,i.textAlign="left",i.textBaseline="top"})}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,axes:n,properties:r}=this,{xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,title:d,tooltip:p,marker:f}=r,y=n.x,x=n.y;if(!i||!s||!y||!x)return;const m=s.dataSources.get(this.id)?.[t],v=i.resolveColumnById(this,"xValue",s)[t],S=i.resolveColumnById(this,"yValue",s)[t],M=this.contextNodeData?.nodeData[t];if(v==null||M==null)return;const D=this.getMarkerStyle(f,M.datum,{xKey:o,yKey:l,labelKey:h,highlighted:!0});return p.formatTooltip(this.properties,{symbol:this.legendItemSymbol(),title:d,data:[{label:a,fallbackLabel:o,value:y.formatDatum(v)},{label:c,fallbackLabel:l,value:x.formatDatum(S)}]},{seriesId:e,datum:m,title:c,xKey:o,xName:a,yKey:l,yName:c,labelKey:h,labelName:u,...D,...this.getModuleTooltipParams()})}legendItemSymbol(){return{marker:this.getMarkerStyle(this.properties.marker)}}getLegendData(t){if(!this.properties.isValid()||t!=="category")return[];const{yKey:e,yName:i,title:s,showInLegend:n}=this.properties,{id:r,ctx:{legendManager:o},visible:a}=this;return[{legendType:"category",id:r,itemId:e,seriesId:r,enabled:a&&o.getItemEnabled({seriesId:r,itemId:e}),label:{text:s??i??e},symbol:this.legendItemSymbol(),hideInLegend:!n}]}animateEmptyUpdateReady(t){const{markerSelection:e,labelSelection:i,annotationSelections:s}=t;wp(this,this.ctx.animationManager,e),Mt(this,"labels",this.ctx.animationManager,i),Mt(this,"annotations",this.ctx.animationManager,...s)}isLabelEnabled(){return this.properties.label.enabled}nodeFactory(){return new it}getFormattedMarkerStyle(t){const{xKey:e,yKey:i,labelKey:s}=this.properties;return this.getMarkerStyle(this.properties.marker,t.datum,{xKey:e,yKey:i,labelKey:s},!0)}computeFocusBounds(t){return qa(this,t)}};uh.className="ScatterSeries",uh.type="scatter";var Di=(w(),k(T)),jk={type:(0,Di.required)((0,Di.constant)("scatter")),xKey:(0,Di.required)(Di.string),yKey:(0,Di.required)(Di.string),labelKey:Di.string,xName:Di.string,yName:Di.string,labelName:Di.string,title:Di.string,showInMiniChart:Di.boolean,label:{placement:(0,Di.union)("top","right","bottom","left"),...Nn},tooltip:Ks,errorBar:ah,...es,...on(Qa,["enabled"])},Fk={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["cartesian"],identifier:"scatter",moduleFactory:t=>new uh(t),tooltipDefaults:{range:"nearest"},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:An,fillOpacity:.8,tooltip:{position:{_seriesOverrideType:"node"}},label:{enabled:!1,fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"}},errorBar:{cap:{lengthRatio:1}}}}},Hx={type:"series",name:"scatter",chartType:"cartesian",options:jk,create:t=>new uh(t)},d1=(w(),k(T)),Kx=(w(),k(T)),Zx=class Fg{constructor(e,i,s,n){this.startAngle=e,this.endAngle=i,this.innerRadius=s,this.outerRadius=n}clone(){const{startAngle:e,endAngle:i,innerRadius:s,outerRadius:n}=this;return new Fg(e,i,s,n)}equals(e){return this.startAngle===e.startAngle&&this.endAngle===e.endAngle&&this.innerRadius===e.innerRadius&&this.outerRadius===e.outerRadius}[Ll](e,i){return new Fg(this.startAngle*(1-i)+e.startAngle*i,this.endAngle*(1-i)+e.endAngle*i,this.innerRadius*(1-i)+e.innerRadius*i,this.outerRadius*(1-i)+e.outerRadius*i)}};function Xx({startAngle:t,endAngle:e,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(t),i*Math.sin(t)),l(i*Math.cos(e),i*Math.sin(e)),l(s*Math.cos(t),s*Math.sin(t)),l(s*Math.cos(e),s*Math.sin(e)),an(0,t,e)&&l(s,0),an(Math.PI*.5,t,e)&&l(0,s),an(Math.PI,t,e)&&l(-s,0),an(Math.PI*1.5,t,e)&&l(0,-s),new B(n,r,o-n,a-r)}function dh(t,e,i){const s=Math.sqrt(Math.pow(t,2)+Math.pow(e,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=$o(i.startAngle),a=$o(i.endAngle),l=Math.atan2(e,t);return o<a?l<=a&&l>=o:l<=a&&l>=-Math.PI||l>=o&&l<=Math.PI}function qx(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=e,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 Er(t.start.x,t.start.y,t.end.x,t.end.y,o.x,o.y,l.x,l.y)||Er(t.start.x,t.start.y,t.end.x,t.end.y,a.x,a.y,c.x,c.y)||hm(0,0,r,i,s,!0,t.start.x,t.start.y,t.end.x,t.end.y)}function Qx(t,e){const i={x:t.x,y:t.y},s={x:t.x+t.width,y:t.y},n={x:t.x,y:t.y+t.height},r={x:t.x+t.width,y:t.y+t.height};return qx({start:i,end:s},e)||qx({start:n,end:r},e)}function Jx(t,e,i,s){if(i===0&&s===0)return 0;if(Math.asin(Math.abs(1*i)/(t+1*i))+Math.asin(Math.abs(1*s)/(t+1*s))-e<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)/(t+l*i))+Math.asin(Math.abs(l*s)/(t+l*s))-e<0?r=l:o=l}return r}var zk=1e-6;function Tn(t,e){return El(t,e)<zk?e:Pt(t-e)+e}function ph(t,e,i=0){const n=Math.abs(e-t)>=2*Math.PI?2*Math.PI:Pt(e-t);return t=Tn(t,i),e=t+n,{startAngle:t,endAngle:e}}function gh(t,e,i,s,n,r){const o=Math.sin(r),a=Math.cos(r),l=t**2+e**2-i**2;let c,h,u,d;if(a>.5){const S=o/a,M=1+S**2,D=-2*(t+e*S),C=D**2-4*M*l;if(C<0)return;const L=(-D+Math.sqrt(C))/(2*M),I=(-D-Math.sqrt(C))/(2*M);c=L,h=L*S,u=I,d=I*S}else{const S=a/o,M=1+S**2,D=-2*(e+t*S),C=D**2-4*M*l;if(C<0)return;const L=(-D+Math.sqrt(C))/(2*M),I=(-D-Math.sqrt(C))/(2*M);c=L*S,h=L,u=I*S,d=I}const p=a,f=o,y=c*p+h*f,x=u*p+d*f,m=y>0?Tn(Math.atan2(h-e,c-t),s):NaN,v=x>0?Tn(Math.atan2(d-e,u-t),s):NaN;if(m>=s&&m<=n)return m;if(v>=s&&v<=n)return v}function fh(t,e,i,s,n,r){const o=Math.hypot(t,e),a=(o**2-i**2+r**2)/(2*o),l=o-a,c=Math.atan2(e,t),h=Math.acos(-l/i),u=Tn(c+h,s),d=Tn(c-h,s);if(u>=s&&u<=n)return u;if(d>=s&&d<=n)return d}var qp=class{constructor(t,e,i,s,n){this.cx=t,this.cy=e,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(t){return{x:this.cx+this.r*Math.cos(t),y:this.cy+this.r*Math.sin(t)}}clipStart(t){t==null||!this.isValid()||t<this.a0||(this.a0=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}clipEnd(t){t==null||!this.isValid()||t>this.a1||(this.a1=t,(Number.isNaN(t)||this.a0>=this.a1)&&(this.a0=NaN,this.a1=NaN))}},Te=class extends Je{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(t){this.concentricEdgeInset=t,this.radialEdgeInset=t}set cornerRadius(t){this.startOuterCornerRadius=t,this.endOuterCornerRadius=t,this.startInnerCornerRadius=t,this.endInnerCornerRadius=t}computeBBox(){return Xx(this).translate(this.centerX,this.centerY)}normalizedRadii(){const{concentricEdgeInset:t}=this;let{innerRadius:e,outerRadius:i}=this;return e=e>0?e+t:0,i=Math.max(i-t,0),{innerRadius:e,outerRadius:i}}normalizedClipSector(){const{clipSector:t}=this;if(t==null)return;const{startAngle:e,endAngle:i}=ph(this.startAngle,this.endAngle),{innerRadius:s,outerRadius:n}=this.normalizedRadii(),r=ph(t.startAngle,t.endAngle,e);return new Zx(Math.max(e,r.startAngle),Math.min(i,r.endAngle),Math.max(s,t.innerRadius),Math.min(n,t.outerRadius))}getAngleOffset(t){return t>0?this.radialEdgeInset/t:0}arc(t,e,i,s,n,r,o,a){if(t<=0)return;const{startAngle:l,endAngle:c}=ph(this.startAngle,this.endAngle),{innerRadius:h,outerRadius:u}=this.normalizedRadii(),d=this.normalizedClipSector();if(a&&h<=0)return;const p=a?this.getAngleOffset(h+t):this.getAngleOffset(u-t),f=o?l+p+e:c-p-e,y=a?h+t:u-t,x=y*Math.cos(f),m=y*Math.sin(f);if(d!=null&&(!o&&!(f>=l-1e-6&&f<=d.endAngle-1e-6)||o&&!(f>=d.startAngle+1e-6&&f<=c-1e-6)||a&&y<d.innerRadius-1e-6||!a&&y>d.outerRadius+1e-6))return;const v=new qp(x,m,t,i,s);if(d!=null){a?(v.clipStart(gh(x,m,t,i,s,d.endAngle)),v.clipEnd(gh(x,m,t,i,s,d.startAngle))):(v.clipStart(gh(x,m,t,i,s,d.startAngle)),v.clipEnd(gh(x,m,t,i,s,d.endAngle)));let L,I;if(o?(L=fh(x,m,t,i,s,d.innerRadius),I=fh(x,m,t,i,s,d.outerRadius)):(L=fh(x,m,t,i,s,d.outerRadius),I=fh(x,m,t,i,s,d.innerRadius)),v.clipStart(L),v.clipEnd(I),L!=null){const{x:N,y:E}=v.pointAt(L),R=Tn(Math.atan2(E,N),l);o?r?.clipStart(R):n.clipEnd(R)}if(I!=null){const{x:N,y:E}=v.pointAt(I),R=Tn(Math.atan2(E,N),l);o?n.clipStart(R):r?.clipEnd(R)}}if(d!=null){const{x:L,y:I}=v.pointAt((v.a0+v.a1)/2);if(!dh(L,I,d))return}const{x:S,y:M}=v.pointAt(o===a?v.a0:v.a1),D=Tn(Math.atan2(M,S),l),C=a?r:n;return o?C?.clipStart(D):C?.clipEnd(D),v}updatePath(){const{path:e,centerX:i,centerY:s,concentricEdgeInset:n,radialEdgeInset:r}=this;let{startOuterCornerRadius:o,endOuterCornerRadius:a,startInnerCornerRadius:l,endInnerCornerRadius:c}=this;const{startAngle:h,endAngle:u}=ph(this.startAngle,this.endAngle),{innerRadius:d,outerRadius:p}=this.normalizedRadii(),f=this.normalizedClipSector(),y=u-h,x=y>=2*Math.PI-1e-6;if(e.clear(),d===0&&p===0||d>p)return;if((f?.startAngle??h)===(f?.endAngle??u))return;if(x&&this.clipSector==null&&o===0&&a===0&&l===0&&c===0){e.moveTo(i+p*Math.cos(h),s+p*Math.sin(h)),e.arc(i,s,p,h,u),d>n&&(e.moveTo(i+d*Math.cos(u),s+d*Math.sin(u)),e.arc(i,s,d,u,h,!0)),e.closePath();return}else if(this.clipSector==null&&Math.abs(d-p)<1e-6){e.arc(i,s,p,h,u,!1),e.arc(i,s,p,u,h,!0),e.closePath();return}const m=this.getAngleOffset(d),v=this.getAngleOffset(p);if(y<2*v)return;const M=(f?.innerRadius??d)>n,D=d<n||y<2*m,C=p-d,L=Math.max(o,l,a,c),I=L>0?Math.min(C/L,1):1;o*=I,a*=I,l*=I,c*=I;const N=Jx(p,y-2*v,-o,-a);if(o*=N,a*=N,!D&&M){const _=Jx(d,y-2*m,l,c);l*=_,c*=_}else l=0,c=0;const E=Math.max(o+l,a+c),R=E>0?Math.min(C/E,1):1;o*=R,a*=R,l*=R,c*=R;let z=0,W=0;const yt=o/(p-o),$=a/(p-a);if(yt>=0&&yt<1-1e-6)z=Math.asin(yt);else{z=y/2;const _=p/(1/Math.sin(z)+1);o=Math.min(_,o)}if($>=0&&$<1-1e-6)W=Math.asin($);else{W=y/2;const _=p/(1/Math.sin(W)+1);a=Math.min(_,a)}const q=Math.asin(l/(d+l)),tt=Math.asin(c/(d+c)),ht=f?.outerRadius??p,lt=this.getAngleOffset(ht),V=new qp(0,0,ht,h+lt,u-lt),Y=f?.innerRadius??d,et=this.getAngleOffset(Y),st=M?new qp(0,0,Y,h+et,u-et):void 0;f!=null&&(V.clipStart(f.startAngle),V.clipEnd(f.endAngle),st?.clipStart(f.startAngle),st?.clipEnd(f.endAngle));const ut=this.arc(o,z,h-Math.PI*.5,h+z,V,st,!0,!1),bt=this.arc(a,W,u-W,u+Math.PI*.5,V,st,!1,!1),X=this.arc(c,tt,u+Math.PI*.5,u+Math.PI-tt,V,st,!1,!0),Z=this.arc(l,q,h+Math.PI+q,h+Math.PI*1.5,V,st,!0,!0);if(D){const _=y<Math.PI*.5?r*(1+Math.cos(y))/Math.sin(y):NaN;let K;_>0&&_<p?K=Math.max(Math.hypot(r,_),d):K=r,K=Math.max(K,d);const Q=h+y*.5;e.moveTo(i+K*Math.cos(Q),s+K*Math.sin(Q))}else if(!(Z?.isValid()===!0||st?.isValid()===!0)){const _=h+y/2,K=d*Math.cos(_),Q=d*Math.sin(_);e.moveTo(i+K,s+Q)}if(ut?.isValid()===!0){const{cx:_,cy:K,r:Q,a0:Ot,a1:Rt}=ut;e.arc(i+_,s+K,Q,Ot,Rt)}if(V.isValid()){const{r:_,a0:K,a1:Q}=V;e.arc(i,s,_,K,Q)}if(bt?.isValid()===!0){const{cx:_,cy:K,r:Q,a0:Ot,a1:Rt}=bt;e.arc(i+_,s+K,Q,Ot,Rt)}if(!D){if(X?.isValid()===!0){const{cx:_,cy:K,r:Q,a0:Ot,a1:Rt}=X;e.arc(i+_,s+K,Q,Ot,Rt)}if(st?.isValid()===!0){const{r:_,a0:K,a1:Q}=st;e.arc(i,s,_,Q,K,!0)}if(Z?.isValid()===!0){const{cx:_,cy:K,r:Q,a0:Ot,a1:Rt}=Z;e.arc(i+_,s+K,Q,Ot,Rt)}}e.closePath()}isPointInPath(t,e){const{startAngle:i,endAngle:s,innerRadius:n,outerRadius:r}=this.clipSector??this;return dh(t-this.centerX,e-this.centerY,{startAngle:i,endAngle:s,innerRadius:Math.min(n,r),outerRadius:Math.max(n,r)})}};Te.className="Sector",g([ot()],Te.prototype,"centerX",2),g([ot()],Te.prototype,"centerY",2),g([ot()],Te.prototype,"innerRadius",2),g([ot()],Te.prototype,"outerRadius",2),g([ot()],Te.prototype,"startAngle",2),g([ot()],Te.prototype,"endAngle",2),g([ot()],Te.prototype,"clipSector",2),g([ot()],Te.prototype,"concentricEdgeInset",2),g([ot()],Te.prototype,"radialEdgeInset",2),g([ot()],Te.prototype,"startOuterCornerRadius",2),g([ot()],Te.prototype,"endOuterCornerRadius",2),g([ot()],Te.prototype,"startInnerCornerRadius",2),g([ot()],Te.prototype,"endInnerCornerRadius",2);var se={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},xs={BLUE:"#2b5c95",ORANGE:"#cc6f10",GREEN:"#1e652e",CYAN:"#18859e",YELLOW:"#a69400",VIOLET:"#603c88",GRAY:"#575757",MAGENTA:"#7d2f6d",BROWN:"#4f3508",RED:"#a82529"},tv=class extends Gt{constructor(){super(...arguments),this.showInLegend=!1}};g([b(H)],tv.prototype,"showInLegend",2);var Qp=class extends ye{constructor(){super(...arguments),this.spacing=2}set(t,e){return super.set(t)}};g([b(O)],Qp.prototype,"text",2),g([b(ct)],Qp.prototype,"spacing",2);var Jp=class extends nt{constructor(){super(...arguments),this.fill="transparent",this.fillOpacity=1}};g([b(dt)],Jp.prototype,"fill",2),g([b(It)],Jp.prototype,"fillOpacity",2);var xo=class extends ye{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};g([b(j)],xo.prototype,"offset",2),g([b(ct.restrict({min:0,max:360}))],xo.prototype,"minAngle",2),g([b(j)],xo.prototype,"minSpacing",2),g([b(j)],xo.prototype,"maxCollisionOffset",2),g([b(H)],xo.prototype,"avoidCollisions",2);var tg=class extends ye{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};g([b(ct)],tg.prototype,"positionOffset",2),g([b(It)],tg.prototype,"positionRatio",2);var mh=class extends nt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};g([b(ge(we(hs,dt,us)),{optional:!0})],mh.prototype,"colors",2),g([b(j)],mh.prototype,"length",2),g([b(j)],mh.prototype,"strokeWidth",2);var pt=class extends Mi{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(se),this.strokes=Object.values(xs),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 Ho(Qp),this.title=new tv,this.innerCircle=new Jp,this.shadow=new ts,this.calloutLabel=new xo,this.sectorLabel=new tg,this.calloutLine=new mh,this.tooltip=new Ye}};g([b(O)],pt.prototype,"angleKey",2),g([b(O,{optional:!0})],pt.prototype,"angleName",2),g([b(O,{optional:!0})],pt.prototype,"angleFilterKey",2),g([b(O,{optional:!0})],pt.prototype,"radiusKey",2),g([b(O,{optional:!0})],pt.prototype,"radiusName",2),g([b(j,{optional:!0})],pt.prototype,"radiusMin",2),g([b(j,{optional:!0})],pt.prototype,"radiusMax",2),g([b(O,{optional:!0})],pt.prototype,"calloutLabelKey",2),g([b(O,{optional:!0})],pt.prototype,"calloutLabelName",2),g([b(O,{optional:!0})],pt.prototype,"sectorLabelKey",2),g([b(O,{optional:!0})],pt.prototype,"sectorLabelName",2),g([b(O,{optional:!0})],pt.prototype,"legendItemKey",2),g([b(ge(cn))],pt.prototype,"defaultColorRange",2),g([b(ge(dt))],pt.prototype,"defaultPatternFills",2),g([b(ge(we(hs,dt,us)))],pt.prototype,"fills",2),g([b(cn)],pt.prototype,"strokes",2),g([b(It)],pt.prototype,"fillOpacity",2),g([b(It)],pt.prototype,"strokeOpacity",2),g([b(ds)],pt.prototype,"lineDash",2),g([b(j)],pt.prototype,"lineDashOffset",2),g([b(j)],pt.prototype,"cornerRadius",2),g([b(Ze,{optional:!0})],pt.prototype,"itemStyler",2),g([b(ct)],pt.prototype,"rotation",2),g([b(ct)],pt.prototype,"outerRadiusOffset",2),g([b(It)],pt.prototype,"outerRadiusRatio",2),g([b(ct,{optional:!0})],pt.prototype,"innerRadiusOffset",2),g([b(It,{optional:!0})],pt.prototype,"innerRadiusRatio",2),g([b(j)],pt.prototype,"strokeWidth",2),g([b(ct)],pt.prototype,"sectorSpacing",2),g([b(H)],pt.prototype,"hideZeroValueSectorsInLegend",2),g([b(gu)],pt.prototype,"innerLabels",2),g([b(F)],pt.prototype,"title",2),g([b(F)],pt.prototype,"innerCircle",2),g([b(F)],pt.prototype,"shadow",2),g([b(F)],pt.prototype,"calloutLabel",2),g([b(F)],pt.prototype,"sectorLabel",2),g([b(F)],pt.prototype,"calloutLine",2),g([b(F)],pt.prototype,"tooltip",2);function lr(t,e,i,s){const n=[i.convert(0),i.convert(1)],r=[s.convert(0),s.convert(1)],o=Math.PI/-2+zt(e),a=t?"initial":"update",l=({radius:f})=>({innerRadius:n[0],outerRadius:n[0]+(n[1]-n[0])*f}),c=({radius:f})=>({innerRadius:r[0],outerRadius:r[0]+(r[1]-r[0])*f});return{nodes:{toFn:(f,y,x,{prevLive:m})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D}=y;const{stroke:C,fill:L}=y.sectorFormat;if(x==="removed"&&m?(v=m.datum?.endAngle,S=m.datum?.endAngle):x==="removed"&&!m&&(v=o,S=o),x==="removed"){const I=l(y);M=I.innerRadius,D=I.outerRadius}return{startAngle:v,endAngle:S,outerRadius:D,innerRadius:M,stroke:C,fill:L}},fromFn:(f,y,x,{prevFromProps:m})=>{let{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D}=f,{fill:C,stroke:L}=y.sectorFormat;if(x==="updated"&&f.previousDatum==null&&(x="added"),x==="unknown"||x==="added"&&!m?(v=o,S=o,M=y.innerRadius,D=y.outerRadius):x==="added"&&m&&(v=m.endAngle??o,S=m.endAngle??o,M=m.innerRadius??y.innerRadius,D=m.outerRadius??y.outerRadius),x==="added"&&!t){const I=c(y);M=I.innerRadius,D=I.outerRadius}return x==="updated"&&(C=f.fill??C,L=(typeof f.stroke=="string"?f.stroke:void 0)??L),{startAngle:v,endAngle:S,innerRadius:M,outerRadius:D,fill:C,stroke:L,phase:a}}},innerCircle:{fromFn:(f,y)=>({size:f.previousDatum?.radius??f.size??0,phase:a}),toFn:(f,y)=>({size:y.radius??0})}}}function eg(t,e){return{startAngle:e.startAngle,endAngle:e.endAngle,innerRadius:e.innerRadius,outerRadius:e.outerRadius,stroke:e.sectorFormat.stroke}}function ig(t,e){const i=e.y-t.centerY,s=e.x-t.centerX,n=Math.atan2(i,s),r=t.getItemNodes();for(const o of r)if(o.datum.missing!==!0&&an(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 ev=(t=>(t[t.BACKGROUND=0]="BACKGROUND",t[t.FOREGROUND=1]="FOREGROUND",t[t.HIGHLIGHT=2]="HIGHLIGHT",t[t.LABEL=3]="LABEL",t))(ev||{}),yh=class extends Sp{constructor({categoryKey:t,useLabelLayer:e=!1,pickModes:i=[1,0],canHaveAxes:s=!1,animationResetFns:n,...r}){super({...r,categoryKey:t,useLabelLayer:e,pickModes:i,directionKeys:{x:["angleKey"],y:["radiusKey"]},directionNames:{x:["angleName"],y:["radiusName"]},canHaveAxes:s}),this.itemGroup=this.contentGroup.appendChild(new it),this.nodeData=[],this.itemSelection=re.select(this.itemGroup,()=>this.nodeFactory(),!1),this.labelSelection=re.select(this.labelGroup,()=>this.labelFactory(),!1),this.highlightSelection=re.select(this.highlightGroup,()=>this.nodeFactory()),this.highlightLabelSelection=re.select(this.highlightLabel,()=>this.labelFactory()),this.centerX=0,this.centerY=0,this.radius=0,this.animationResetFns=n,this.animationState=new ga("empty",{empty:{update:{target:"ready",action:o=>this.animateEmptyUpdateReady(o)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:o=>this.animateReadyHighlight(o),highlightMarkers:o=>this.animateReadyHighlightMarkers(o),resize:o=>this.animateReadyResize(o),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:o=>this.animateWaitingUpdateReady(o)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:o=>this.animateClearingUpdateEmpty(o)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}getItemNodes(){return[...this.itemGroup.children()]}getNodeData(){return this.nodeData}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.contentGroup.zIndex=[t,1],this.highlightGroup.zIndex=[t,2],this.labelGroup.zIndex=[t,3],!0):!1}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}labelFactory(){const t=new me;return t.pointerEvents=1,t}addChartEventListeners(){this.destroyFns.push(this.ctx.chartEventManager?.addListener("legend-item-click",t=>this.onLegendItemClick(t)),this.ctx.chartEventManager?.addListener("legend-item-double-click",t=>this.onLegendItemDoubleClick(t)))}getInnerRadius(){return 0}computeLabelsBBox(t,e){return null}getShapeFillBBox(){const t=this.radius;return{series:new B(-t,-t,t*2,t*2),axis:new B(-t,-t,t*2,t*2)}}resetAllAnimation(){const{item:t,label:e}=this.animationResetFns??{};this.ctx.animationManager.stopByAnimationGroupId(this.id),t&&Ie([this.itemSelection,this.highlightSelection],t),e&&Ie([this.labelSelection,this.highlightLabelSelection],e),this.itemSelection.cleanup(),this.labelSelection.cleanup(),this.highlightSelection.cleanup(),this.highlightLabelSelection.cleanup()}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}animateReadyHighlight(t){const{item:e,label:i}=this.animationResetFns??{};e&&Ie([this.highlightSelection],e),i&&Ie([this.highlightLabelSelection],i)}animateReadyHighlightMarkers(t){}animateReadyResize(t){this.resetAllAnimation()}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation()}computeFocusBounds(t){const e=this.getNodeData()?.[t.datumIndex];if(e!==void 0)return this.itemSelection.select(i=>i instanceof Je&&i.datum===e)[0]}getSeriesRange(t,e){return[NaN,NaN]}},Bk=class extends ya{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},bh=class extends yh{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:eg,label:$s}}),this.properties=new pt,this.phantomNodeData=void 0,this.backgroundGroup=new Xe({name:`${this.id}-background`,zIndex:0}),this.noVisibleData=!1,this.previousRadiusScale=new Ji,this.radiusScale=new Ji,this.phantomGroup=this.backgroundGroup.appendChild(new it({name:"phantom"})),this.phantomSelection=re.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new it({name:"pieCalloutLabels"})),this.calloutLabelSelection=new re(this.calloutLabelGroup,it),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new it({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new xe({shape:"circle"})),this.zerosumInnerRing=this.zerosumRingsGroup.appendChild(new xe({shape:"circle"})),this.innerLabelsGroup=this.contentGroup.appendChild(new it({name:"innerLabels"})),this.innerCircleGroup=this.backgroundGroup.appendChild(new it({name:`${this.id}-innerCircle`})),this.innerLabelsSelection=re.select(this.innerLabelsGroup,me),this.innerCircleSelection=re.select(this.innerCircleGroup,()=>new xe({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=Bk,this.angleScale=new Ji,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t?.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){return new Te}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(x,m)=>e&&s.getItemEnabled({seriesId:i,itemId:m})?x:0,u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(Qi(c,"band",{id:"legendItemKey"})):a?d.push(Qi(a,"band",{id:"calloutLabelKey"})):l&&d.push(Qi(l,"band",{id:"sectorLabelKey"}));const f=this.radiusScale.type,y=this.angleScale.type;o&&p.push(Jd(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,processor:h}),mt(o,f,{id:"radiusRaw",processor:h}),sr("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(mt(a,"band",{id:"calloutLabelValue"})),l&&p.push(mt(l,"band",{id:"sectorLabelValue"})),c&&p.push(mt(c,"band",{id:"legendItemValue"})),r&&p.push(Ia(r,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),mt(r,y,{id:"angleFilterRaw"}),sr("angleFilterValue",[0,1],0,0)),u&&this.processedData&&d.length>0&&p.push(ro(this.id,this.processedData)),p.push(no()),await this.requestDataModel(t,this.data,{props:[...d,Ia(n,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),mt(n,y,{id:"angleRaw"}),sr("angleValue",[0,1],0,0),...p]});for(const x of this.processedData?.defs?.values??[]){const{id:m,missing:v,property:S}=x,M=md(this,v);m!=="angleRaw"&&M>0&&Kx.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:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,r=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o,innerRadiusRatio:a}=this.properties;if(!this.properties.isValid())return this.zerosumOuterRing.visible=!0,this.zerosumInnerRing.visible=!0,{itemId:t,nodeData:[],labelData:[]};if(!i||e?.type!=="ungrouped")return;const{angleValues:l,angleRawValues:c,angleFilterValues:h,angleFilterRawValues:u,radiusValues:d,radiusRawValues:p,calloutLabelValues:f,sectorLabelValues:y,legendItemValues:x}=this.getProcessedDataValues(i,e),m=u?.some((I,N)=>I>c[N])??!1;let v=0,S=0;const M=[],D=u!=null?[]:void 0,C=e.dataSources.get(this.id)??[],L=e.invalidData?.get(this.id);return C.forEach((I,N)=>{if(L?.[N]===!0)return;const E=m?h[N]:l[N],R=u!=null&&!m?Math.sqrt(u[N]/c[N]):1,z=s.convert(v)+zt(o);v=E,S+=E;const W=s.convert(v)+zt(o),yt=Math.abs(W-z),$=z+yt/2,q=c[N],ht=(d?.[N]??1)*R,lt=p?.[N],V=x?.[N],Y=this.getLabels(I,$,yt,!0,f?.[N],y?.[N],V),et=this.getSectorFormat(I,N,!1),st={itemId:N,series:this,datum:I,datumIndex:N,angleValue:q,midAngle:$,midCos:Math.cos($),midSin:Math.sin($),startAngle:z,endAngle:W,radius:ht,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(ht),0),sectorFormat:et,radiusValue:lt,legendItemValue:V,enabled:r&&n.getItemEnabled({seriesId:t,itemId:N}),focusable:!0,...Y};M.push(st),D?.push({...st,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0),focusable:!1})}),this.zerosumOuterRing.visible=S===0,this.zerosumInnerRing.visible=S===0&&a!=null&&a!==1&&a>0,{itemId:t,nodeData:M,labelData:M,phantomNodeData:D}}getLabels(t,e,i,s,n,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={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},p={};return h&&i>=zt(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(a,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=$o(t),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=(0,Kx.modulus)(r,e.length);return e[o]}getNodeFill(t,e,i){return qn(t,{type:"gradient",bounds:"series",colorStops:e.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"transparent",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0})}getFillParams(t,e,i){if(!(!Vi(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:u,itemStyler:d}=this.properties,p=c[e%c.length],{fill:f,fillOpacity:y,stroke:x,strokeWidth:m,strokeOpacity:v,lineDash:S,lineDashOffset:M,cornerRadius:D}=gt(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),C=h[e%h.length],L=u[e%u.length],I=f??"black";let N;return d&&(N=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>this.callWithContext(d,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(I,C,L),fillOpacity:y,stroke:x,strokeWidth:m,strokeOpacity:v,lineDash:S,lineDashOffset:M,cornerRadius:D,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(N?.fill??I,C,L),fillOpacity:N?.fillOpacity??y,stroke:N?.stroke??x,strokeWidth:N?.strokeWidth??m,strokeOpacity:N?.strokeOpacity??v,lineDash:N?.lineDash??S,lineDashOffset:N?.lineDashOffset??M,cornerRadius:N?.cornerRadius??D}}getInnerRadius(){const{radius:t}=this,{innerRadiusRatio:e=1,innerRadiusOffset:i=0}=this.properties,s=t*e+i;return s===t||s<0?0:s}getOuterRadius(){const{outerRadiusRatio:t,outerRadiusOffset:e}=this.properties;return Math.max(this.radius*t+e,0)}updateRadiusScale(t){const e=[this.getInnerRadius(),this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);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 t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=ps(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),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const r=e.node.getBBox();e.node.visible=e.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(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){this.updateGroupSelection(),this.updateInnerCircleSelection()}updateGroupSelection(){const{itemSelection:t,highlightSelection:e,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.datum,u.datumIndex)),this.ctx.animationManager.isSkipped()&&c.cleanup()};l(t,this.nodeData),l(e,a),l(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,c=>{const h=new vi;h.tag=0,h.pointerEvents=1,c.appendChild(h);const u=new me;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:t}=this.properties;let e=0;const i=this.getInnerRadius();if(i>0){const n=Math.min(i,this.getOuterRadius()),r=1;e=Math.ceil(n*2+r)}const s=t?[{radius:e}]:[];this.innerCircleSelection.update(s)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup.visible=i,this.contentGroup.opacity=this.getOpacity(),this.innerCircleSelection.each((l,{radius:c})=>{l.setProperties({fill:this.getNodeFill(this.properties.innerCircle?.fill,["black"],"black"),opacity:this.properties.innerCircle?.fillOpacity,size:c})});const s=this.radiusScale.range[0],n=this.radiusScale.range[1],r=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(l,c,h,u)=>{const d=this.getSectorFormat(c.datum,c.itemId,u);c.sectorFormat.fill=d.fill,c.sectorFormat.stroke=d.stroke,o&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(u||o)&&(l.fill=d.fill,l.stroke=d.stroke);const p=this.getFillParams(d.fill,s,n);Lc(l,d.fill,r,p),l.strokeWidth=d.strokeWidth,l.fillOpacity=d.fillOpacity,l.strokeOpacity=d.strokeOpacity,l.lineDash=d.lineDash,l.lineDashOffset=d.lineDashOffset,l.cornerRadius=d.cornerRadius,l.fillShadow=this.properties.shadow;const f=Math.max((this.properties.sectorSpacing+(d.stroke!=null?d.strokeWidth:0))/2,0);l.inset=f,l.lineJoin=this.properties.sectorSpacing>=0||f>0?"miter":"round"};this.itemSelection.each((l,c,h)=>a(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{a(l,c,h,!0),l.visible=c.itemId===e?.itemId}),this.phantomSelection.each((l,c,h)=>a(l,c,h,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateInnerLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:t,strokeWidth:e,colors:i},strokes:s}=this.properties,n=e,r=pm(i)?i??this.properties.strokes:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((a,l)=>{const c=a.closestDatum(),{calloutLabel:h,outerRadius:u}=c;if(h?.text&&!h.hidden&&u!==0){a.visible=!0,a.strokeWidth=n,a.stroke=r[l%r.length],a.fill=void 0;const d=c.midCos*u,p=c.midSin*u;let f=c.midCos*(u+t),y=c.midSin*(u+t);if((h.collisionTextAlign??h.collisionOffsetY!==0)&&h.box!=null){const m=h.box;let v=f,S=y;f<m.x?v=m.x:f>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-f,D=S-y,C=Math.sqrt(Math.pow(M,2)+Math.pow(D,2)),L=C-o;L>0&&(f=f+M*L/C,y=y+D*L/C)}a.x1=d,a.y1=p,a.x2=f,a.y2=y}else a.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;e.x+a<s?l=(e.x+e.width-s)/e.width:e.x+e.width-a>n&&(l=(n-e.x)/e.width);const c=e.y+a<r||e.y+e.height-a>o,h=l===1?t.length:Math.floor(t.length*l)-1,u=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,r=t.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 B.zero.clone();const S=m.outerRadius+i.length+s,M=m.midCos*S,D=m.midSin*S+v.collisionOffsetY,C=v.collisionTextAlign??v.textAlign,L=v.textBaseline;return me.computeBBox(v.text,M,D,{font:this.properties.calloutLabel,textAlign:C,textBaseline:L})},f=(m,v,S)=>{const M=p(m).grow(n/2),D=p(v).grow(n/2);M.x<D.x+D.width&&M.x+M.width>D.x&&(S==="to-top"?M.y<D.y+D.height:M.y+M.height>D.y)&&(v.calloutLabel.collisionOffsetY=S==="to-top"?M.y-D.y-D.height:M.y+M.height-D.y)},y=m=>{const v=m.slice().sort((M,D)=>Math.abs(M.midSin)-Math.abs(D.midSin))[0],S=m.indexOf(v);for(let M=S-1;M>=0;M--){const D=m[M+1],C=m[M];f(D,C,"to-top")}for(let M=S+1;M<m.length;M++){const D=m[M-1],C=m[M];f(D,C,"to-bottom")}},x=m=>{const v=l.some(I=>I.calloutLabel.collisionOffsetY!==0),S=m.map(I=>p(I)),M=S.map(I=>I.clone().grow(n/2));let D=!1;for(let I=0;I<M.length&&!D;I++){const N=M[I];for(let E=I+1;E<m.length;E++){const R=M[E];if(N.collidesBBox(R)){D=!0;break}}}const C=a.map(I=>{const{startAngle:N,endAngle:E,outerRadius:R}=I;return{startAngle:N,endAngle:E,innerRadius:r,outerRadius:R}}),L=S.some(I=>C.some(N=>Qx(I,N)));!D&&!v&&!L||m.filter(I=>I.calloutLabel.textAlign==="center").forEach(I=>{const N=I.calloutLabel;I.midCos<0?N.collisionTextAlign="right":I.midCos>0?N.collisionTextAlign="left":N.collisionTextAlign="center"})};y(c),y(h),x(u),x(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new me;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,u=e.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,f=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,x={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=f,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(x);const m=a.getBBox();let v=h.text,S=!0;if(i.avoidCollisions){const{textLength:M,hasVerticalOverflow:D}=this.getLabelOverflow(h.text,m,t);v=h.text.length===M?h.text:`${h.text.substring(0,M)}\u2026`,S=!D}l.text=v,l.x=f,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(x),l.fill=o,l.visible=S})}computeLabelsBBox(t,e){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 me;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(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const f=d.outerRadius+n+r,y=d.midCos*f,x=d.midSin*f+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=x,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const v=-this.centerY,S=new B(h.x-a,v,h.width+2*a,h.y+h.height+a-v);if(m.collidesBBox(S)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:v,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(p.text,m,e),D=p.text.length>2&&v<2;if(S||D||M){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:B.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.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 f=!1;if(d&&p!==0){const y=e*(1-a)+p*a+o;h.fill=l,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 x=h.getBBox(),m=[[x.x,x.y],[x.x+x.width,x.y],[x.x+x.width,x.y+x.height],[x.x,x.y+x.height]],{startAngle:v,endAngle:S}=u,M={startAngle:v,endAngle:S,innerRadius:e,outerRadius:p};m.every(([D,C])=>dh(D,C,M))&&(f=!0)}h.visible=f};this.labelSelection.each(c),this.highlightLabelSelection.each(c)}updateInnerLabelNodes(){const t=[],e=[];this.innerLabelsSelection.each((h,u)=>{const{fontStyle:d,fontWeight:p,fontSize:f,fontFamily:y,color:x}=u;h.fontStyle=d,h.fontWeight=p,h.fontSize=f,h.fontFamily=y,h.text=u.text,h.x=0,h.y=0,h.fill=x,h.textAlign="center",h.textBaseline="alphabetic",t.push(h.getBBox()),e.push(u.spacing)});const i=h=>h===0?0:e[h],s=h=>h===e.length-1?0:e[h],n=t.reduce((h,u,d)=>h+u.height+i(d)+s(d),0),r=Math.max(...t.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<t.length;h++){const p=t[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(t){return ig(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:f}=n,y=this.properties.title.text;if(!i||!s)return;const x=s.dataSources.get(this.id)?.[t],{angleRawValues:m,legendItemValues:v,calloutLabelValues:S,sectorLabelValues:M}=this.getProcessedDataValues(i,s),D=m[t],C=v?.[t]??(o===h?void 0:S?.[t])??(l===h?void 0:M?.[t])??u;return f.formatTooltip(this.properties,{title:y,symbol:this.legendItemSymbol(t),data:[{label:C,fallbackLabel:h,value:Rs(D,3)}]},{seriesId:e,datum:x,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(x,t,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return Vi(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(t){const{visible:e,processedData:i,dataModel:s,id:n,ctx:{legendManager:r}}=this;if(!s||!i||!this.properties.isValid()||t!=="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{angleRawValues:u,calloutLabelValues:d,sectorLabelValues:p,legendItemValues:f}=this.getProcessedDataValues(s,i),y=this.properties.title?.showInLegend&&this.properties.title.text,x=[],m=this.properties.hideZeroValueSectorsInLegend,v=i.dataSources.get(this.id),S=i.invalidData?.get(this.id);for(let M=0;M<i.input.count;M++){const D=v?.[M],C=u[M];if(S?.[M]===!0||m&&C===0)continue;const L=[];y&&L.push(y);const I=this.getLabels(D,2*Math.PI,2*Math.PI,!1,d?.[M],p?.[M],f?.[M]);c&&I.legendItem!==void 0?L.push(I.legendItem.text):a&&a!==o&&I.calloutLabel?.text!==void 0?L.push(I.calloutLabel?.text):l&&l!==o&&I.sectorLabel?.text!==void 0&&L.push(I.sectorLabel?.text),L.length!==0&&x.push({legendType:"category",id:n,datum:D,itemId:M,seriesId:n,enabled:e&&r.getItemEnabled({seriesId:n,itemId:M}),label:{text:L.join(" - ")},symbol:this.legendItemSymbol(M),legendItemName:c!=null?D[c]:void 0,hideInLegend:!h})}return x}setLegendState(t){const{id:e,ctx:{legendManager:i,updateService:s}}=this;t.forEach((n,r)=>i.toggleItem(n,e,r)),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=lr(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Xt(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),Xt(this.id,"innerCircle",e,[this.innerCircleSelection],i.innerCircle),Mt(this,"callout",e,this.calloutLabelSelection),Mt(this,"sector",e,this.labelSelection),Mt(this,"highlight",e,this.highlightLabelSelection),Mt(this,"inner",e,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,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=lr(!1,this.properties.rotation,n,r);Xt(this.id,"nodes",o,[t,e,i],d.nodes,(p,f)=>this.getDatumId(f.datum,f.datumIndex),a),Xt(this.id,"innerCircle",o,[this.innerCircleSelection],d.innerCircle),Mt(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Mt(this,"sector",this.ctx.animationManager,this.labelSelection),Mt(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.noVisibleData!==u&&(this.noVisibleData=u,Mt(this,"inner",this.ctx.animationManager,this.innerLabelsSelection)),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=lr(!1,this.properties.rotation,s,n);Xt(this.id,"nodes",r,[t,e,i],o.nodes,(a,l)=>this.getDatumId(l.datum,l.datumIndex)),Xt(this.id,"innerCircle",r,[this.innerCircleSelection],o.innerCircle),Ln(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ln(this,"sector",this.ctx.animationManager,this.labelSelection),Ln(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),Ln(this,"inner",this.ctx.animationManager,this.innerLabelsSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?Le(t[n]):i?Le(t[i]):s?Le(t[s]):`${e}`:`${e}`}};bh.className="DonutSeries",bh.type="donut";var is=(w(),k(T)),J=(w(),k(T)),xh={type:(0,J.required)((0,J.constant)("pie")),angleKey:(0,J.required)(J.string),radiusKey:J.string,calloutLabelKey:J.string,sectorLabelKey:J.string,legendItemKey:J.string,angleName:J.string,radiusName:J.string,calloutLabelName:J.string,sectorLabelName:J.string,radiusMin:J.positiveNumber,radiusMax:J.positiveNumber,rotation:J.number,outerRadiusOffset:J.number,outerRadiusRatio:J.ratio,hideZeroValueSectorsInLegend:J.boolean,sectorSpacing:J.positiveNumber,cornerRadius:J.positiveNumber,itemStyler:J.callback,title:{enabled:J.boolean,text:J.string,showInLegend:J.boolean,spacing:J.positiveNumber,...J.fontOptionsDef},calloutLabel:{enabled:J.boolean,offset:J.number,minAngle:J.positiveNumber,avoidCollisions:J.boolean,formatter:J.callback,...J.fontOptionsDef},sectorLabel:{enabled:J.boolean,positionOffset:J.number,positionRatio:J.ratio,formatter:J.callback,...J.fontOptionsDef},calloutLine:{colors:(0,J.arrayOf)(J.color),length:J.positiveNumber,strokeWidth:J.positiveNumber},fills:(0,J.arrayOf)(J.colorUnion),strokes:(0,J.arrayOf)(J.color),tooltip:Ks,shadow:Ja,...es,...J.lineDashOptionsDef,...on(J.fillOptionsDef,["fill"]),...on(J.strokeOptionsDef,["stroke"])};xh.defaultColorRange=(0,J.arrayOf)((0,J.arrayOf)(J.color)),xh.defaultPatternFills=(0,J.arrayOf)(J.color);var Gk={...xh,type:(0,is.required)((0,is.constant)("donut")),innerRadiusOffset:is.number,innerRadiusRatio:is.ratio,innerCircle:{fill:is.string,fillOpacity:is.ratio},innerLabels:(0,is.arrayOfDefs)({text:(0,is.required)(is.string),spacing:is.positiveNumber,...is.fontOptionsDef},"inner label options array")},Vk={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},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:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$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:vp,fillOpacity:1,strokeOpacity:1,strokeWidth: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:Sn,xOffset:3,yOffset:3,blur:5},innerLabels:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"textColor"},spacing:2}},legend:{enabled:!0}},Uk={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"donut",moduleFactory:t=>new bh(t),tooltipDefaults:{range:"exact"},themeTemplate:Vk},Yk={type:"series",name:"donut",chartType:"polar",options:Gk,create:t=>new bh(t)},iv=(w(),k(T)),sv=class extends Gt{constructor(){super(...arguments),this.showInLegend=!1}};g([b(H)],sv.prototype,"showInLegend",2);var vo=class extends ye{constructor(){super(...arguments),this.offset=3,this.minAngle=0,this.minSpacing=4,this.maxCollisionOffset=50,this.avoidCollisions=!0}};g([b(j)],vo.prototype,"offset",2),g([b(ct.restrict({min:0,max:360}))],vo.prototype,"minAngle",2),g([b(j)],vo.prototype,"minSpacing",2),g([b(j)],vo.prototype,"maxCollisionOffset",2),g([b(H)],vo.prototype,"avoidCollisions",2);var sg=class extends ye{constructor(){super(...arguments),this.positionOffset=0,this.positionRatio=.5}};g([b(ct)],sg.prototype,"positionOffset",2),g([b(It)],sg.prototype,"positionRatio",2);var vh=class extends nt{constructor(){super(...arguments),this.length=10,this.strokeWidth=1}};g([b(ge(we(hs,dt,us)),{optional:!0})],vh.prototype,"colors",2),g([b(j)],vh.prototype,"length",2),g([b(j)],vh.prototype,"strokeWidth",2);var xt=class extends Mi{constructor(){super(...arguments),this.defaultColorRange=[],this.defaultPatternFills=[],this.fills=Object.values(se),this.strokes=Object.values(xs),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 sv,this.shadow=new ts,this.calloutLabel=new vo,this.sectorLabel=new sg,this.calloutLine=new vh,this.tooltip=new Ye}};g([b(O)],xt.prototype,"angleKey",2),g([b(O,{optional:!0})],xt.prototype,"angleName",2),g([b(O,{optional:!0})],xt.prototype,"angleFilterKey",2),g([b(O,{optional:!0})],xt.prototype,"radiusKey",2),g([b(O,{optional:!0})],xt.prototype,"radiusName",2),g([b(j,{optional:!0})],xt.prototype,"radiusMin",2),g([b(j,{optional:!0})],xt.prototype,"radiusMax",2),g([b(O,{optional:!0})],xt.prototype,"calloutLabelKey",2),g([b(O,{optional:!0})],xt.prototype,"calloutLabelName",2),g([b(O,{optional:!0})],xt.prototype,"sectorLabelKey",2),g([b(O,{optional:!0})],xt.prototype,"sectorLabelName",2),g([b(O,{optional:!0})],xt.prototype,"legendItemKey",2),g([b(ge(cn))],xt.prototype,"defaultColorRange",2),g([b(ge(dt))],xt.prototype,"defaultPatternFills",2),g([b(ge(we(hs,dt,us)))],xt.prototype,"fills",2),g([b(cn)],xt.prototype,"strokes",2),g([b(It)],xt.prototype,"fillOpacity",2),g([b(It)],xt.prototype,"strokeOpacity",2),g([b(ds)],xt.prototype,"lineDash",2),g([b(j)],xt.prototype,"lineDashOffset",2),g([b(j)],xt.prototype,"cornerRadius",2),g([b(Ze,{optional:!0})],xt.prototype,"itemStyler",2),g([b(ct)],xt.prototype,"rotation",2),g([b(ct)],xt.prototype,"outerRadiusOffset",2),g([b(It)],xt.prototype,"outerRadiusRatio",2),g([b(j)],xt.prototype,"strokeWidth",2),g([b(ct)],xt.prototype,"sectorSpacing",2),g([b(H)],xt.prototype,"hideZeroValueSectorsInLegend",2),g([b(F)],xt.prototype,"title",2),g([b(F)],xt.prototype,"shadow",2),g([b(F)],xt.prototype,"calloutLabel",2),g([b(F)],xt.prototype,"sectorLabel",2),g([b(F)],xt.prototype,"calloutLine",2),g([b(F)],xt.prototype,"tooltip",2);var Wk=class extends ya{constructor(t,e,i,s){super(t,e,i,s),this.angleKey=s.properties.angleKey,this.radiusKey=s.properties.radiusKey,this.calloutLabelKey=s.properties.calloutLabelKey,this.sectorLabelKey=s.properties.sectorLabelKey}},Mh=class extends yh{constructor(t){super({moduleCtx:t,categoryKey:void 0,pickModes:[1,0],useLabelLayer:!0,animationResetFns:{item:eg,label:$s}}),this.properties=new xt,this.phantomNodeData=void 0,this.backgroundGroup=new Xe({name:`${this.id}-background`,zIndex:0}),this.previousRadiusScale=new Ji,this.radiusScale=new Ji,this.phantomGroup=this.backgroundGroup.appendChild(new it({name:"phantom"})),this.phantomSelection=re.select(this.phantomGroup,()=>this.nodeFactory(),!1),this.calloutLabelGroup=this.contentGroup.appendChild(new it({name:"pieCalloutLabels"})),this.calloutLabelSelection=new re(this.calloutLabelGroup,it),this.zerosumRingsGroup=this.backgroundGroup.appendChild(new it({name:`${this.id}-zerosumRings`})),this.zerosumOuterRing=this.zerosumRingsGroup.appendChild(new xe({shape:"circle"})),this.surroundingRadius=void 0,this.NodeEvent=Wk,this.angleScale=new Ji,this.angleScale.domain=[0,1],this.angleScale.range=[-Math.PI,Math.PI].map(e=>e+Math.PI/2),this.phantomGroup.opacity=.2}get calloutNodeData(){return this.phantomNodeData??this.nodeData}attachSeries(t,e,i){super.attachSeries(t,e,i),t.appendChild(this.backgroundGroup)}detachSeries(t,e,i){super.detachSeries(t,e,i),t?.removeChild(this.backgroundGroup)}setSeriesIndex(t){return super.setSeriesIndex(t)?(this.backgroundGroup.zIndex=[0,t],!0):!1}nodeFactory(){const t=new Te;return t.miterLimit=1e9,t}getSeriesDomain(t){return t==="x"?this.angleScale.domain:this.radiusScale.domain}async processData(t){if(this.data==null||!this.properties.isValid())return;const{visible:e,id:i,ctx:{legendManager:s}}=this,{angleKey:n,angleFilterKey:r,radiusKey:o,calloutLabelKey:a,sectorLabelKey:l,legendItemKey:c}=this.properties,h=()=>(x,m)=>e&&s.getItemEnabled({seriesId:i,itemId:m})?x:0,u=!this.ctx.animationManager.isSkipped(),d=[],p=[];c?d.push(Qi(c,"band",{id:"legendItemKey"})):a?d.push(Qi(a,"band",{id:"calloutLabelKey"})):l&&d.push(Qi(l,"band",{id:"sectorLabelKey"}));const f=this.radiusScale.type,y=this.angleScale.type;o&&p.push(Jd(o,{id:"radiusValue",min:this.properties.radiusMin??0,max:this.properties.radiusMax,processor:h}),mt(o,f,{id:"radiusRaw",processor:h}),sr("radiusValue",[0,1],1,this.properties.radiusMin??0,this.properties.radiusMax)),a&&p.push(mt(a,"band",{id:"calloutLabelValue"})),l&&p.push(mt(l,"band",{id:"sectorLabelValue"})),c&&p.push(mt(c,"band",{id:"legendItemValue"})),r&&p.push(Ia(r,y,{id:"angleFilterValue",onlyPositive:!0,invalidValue:0,processor:h}),mt(r,y,{id:"angleFilterRaw"}),sr("angleFilterValue",[0,1],0,0)),u&&this.processedData?.reduced?.animationValidation?.uniqueKeys&&d.length>0&&p.push(ro(this.id,this.processedData)),p.push(no()),await this.requestDataModel(t,this.data,{props:[...d,Ia(n,y,{id:"angleValue",onlyPositive:!0,invalidValue:0,processor:h}),mt(n,y,{id:"angleRaw"}),sr("angleValue",[0,1],0,0),...p]});for(const x of this.processedData?.defs?.values??[]){const{id:m,missing:v,property:S}=x,M=md(this,v);m!=="angleRaw"&&M>0&&iv.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:t=[],phantomNodeData:e}=this.createNodeData()??{};this.nodeData=t,this.phantomNodeData=e,this.nodeDataRefresh=!1}getProcessedDataValues(t,e){const i=t.resolveColumnById(this,"angleValue",e),s=t.resolveColumnById(this,"angleRaw",e),n=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterValue",e):void 0,r=this.properties.angleFilterKey!=null?t.resolveColumnById(this,"angleFilterRaw",e):void 0,o=this.properties.radiusKey?t.resolveColumnById(this,"radiusValue",e):void 0,a=this.properties.radiusKey?t.resolveColumnById(this,"radiusRaw",e):void 0,l=this.properties.calloutLabelKey?t.resolveColumnById(this,"calloutLabelValue",e):void 0,c=this.properties.sectorLabelKey?t.resolveColumnById(this,"sectorLabelValue",e):void 0,h=this.properties.legendItemKey?t.resolveColumnById(this,"legendItemValue",e):void 0;return{angleValues:i,angleRawValues:s,angleFilterValues:n,angleFilterRawValues:r,radiusValues:o,radiusRawValues:a,calloutLabelValues:l,sectorLabelValues:c,legendItemValues:h}}createNodeData(){const{id:t,processedData:e,dataModel:i,angleScale:s,ctx:{legendManager:n},visible:r}=this,{rotation:o}=this.properties;if(!i||e?.type!=="ungrouped")return;const{angleValues:a,angleRawValues:l,angleFilterValues:c,angleFilterRawValues:h,radiusValues:u,radiusRawValues:d,calloutLabelValues:p,sectorLabelValues:f,legendItemValues:y}=this.getProcessedDataValues(i,e),x=h?.some((L,I)=>L>l[I])??!1;let m=0,v=0;const S=[],M=h!=null?[]:void 0,D=e.dataSources.get(this.id)??[],C=e.invalidData?.get(this.id);return D.forEach((L,I)=>{if(C?.[I]===!0)return;const N=x?c[I]:a[I],E=h!=null&&!x?Math.sqrt(h[I]/l[I]):1,R=s.convert(m)+zt(o);m=N,v+=N;const z=s.convert(m)+zt(o),W=Math.abs(z-R),yt=R+W/2,$=l[I],tt=(u?.[I]??1)*E,ht=d?.[I],lt=y?.[I],V=this.getLabels(L,yt,W,!0,p?.[I],f?.[I],lt),Y=this.getSectorFormat(L,I,!1),et={itemId:I,series:this,datum:L,datumIndex:I,angleValue:$,midAngle:yt,midCos:Math.cos(yt),midSin:Math.sin(yt),startAngle:R,endAngle:z,radius:tt,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(tt),0),sectorFormat:Y,radiusValue:ht,legendItemValue:lt,enabled:r&&n.getItemEnabled({seriesId:t,itemId:I}),...V};S.push(et),M?.push({...et,radius:1,innerRadius:Math.max(this.radiusScale.convert(0),0),outerRadius:Math.max(this.radiusScale.convert(1),0)})}),this.zerosumOuterRing.visible=v===0,{itemId:t,nodeData:S,labelData:S,phantomNodeData:M}}getLabels(t,e,i,s,n,r,o){const{calloutLabel:a,sectorLabel:l,legendItemKey:c}=this.properties,h=!s||a.enabled?this.properties.calloutLabelKey:void 0,u=!s||l.enabled?this.properties.sectorLabelKey:void 0;if(!h&&!u&&!c)return{};const d={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},p={};return h&&i>=zt(a.minAngle)&&(p.calloutLabel={...this.getTextAlignment(e),text:this.getLabelText(a,{...d,value:n}),hidden:!1,collisionTextAlign:void 0,collisionOffsetY:0,box:void 0}),u&&(p.sectorLabel={text:this.getLabelText(l,{...d,value:r})}),c!=null&&o!=null&&(p.legendItem={key:c,text:o}),p}getTextAlignment(t){const e=[{textAlign:"center",textBaseline:"bottom"},{textAlign:"left",textBaseline:"middle"},{textAlign:"center",textBaseline:"hanging"},{textAlign:"right",textBaseline:"middle"}],i=$o(t),s=-.75*Math.PI,n=i-s,r=Math.floor(n/(Math.PI/2)),o=(0,iv.modulus)(r,e.length);return e[o]}getNodeFill(t,e,i){return qn(t,{type:"gradient",bounds:"series",colorStops:e.map(s=>({color:s})),gradient:"radial",rotation:0,reverse:!0},{type:"pattern",pattern:"forward-slanted-lines",fill:i,fillOpacity:1,backgroundFill:"transparent",backgroundFillOpacity:1,stroke:i,strokeOpacity:1,strokeWidth:4,rotation:0})}getFillParams(t,e,i){if(!(!Vi(t)||t.bounds==="item"))return{centerX:0,centerY:0,innerRadius:e,outerRadius:i}}getSectorFormat(t,e,i){const{angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fills:l,strokes:c,defaultColorRange:h,defaultPatternFills:u,itemStyler:d}=this.properties,p=c[e%c.length],{fill:f,fillOpacity:y,stroke:x,strokeWidth:m,strokeOpacity:v,lineDash:S,lineDashOffset:M,cornerRadius:D}=gt(i&&this.properties.highlightStyle.item,{fill:l.length>0?l[e%l.length]:void 0,stroke:p,strokeWidth:this.getStrokeWidth(this.properties.strokeWidth),strokeOpacity:this.getOpacity()},this.properties),C=h[e%h.length],L=u[e%u.length],I=f??"black";let N;return d&&(N=this.cachedDatumCallback(this.getDatumId(t,e)+(i?"-highlight":"-hide"),()=>this.callWithContext(d,{datum:t,angleKey:s,radiusKey:n,calloutLabelKey:r,sectorLabelKey:o,legendItemKey:a,fill:this.getNodeFill(I,C,L),strokeOpacity:v,stroke:x,strokeWidth:m,fillOpacity:y,lineDash:S,lineDashOffset:M,cornerRadius:D,highlighted:i,seriesId:this.id}))),{fill:this.getNodeFill(N?.fill??I,C,L),fillOpacity:N?.fillOpacity??y,stroke:N?.stroke??x,strokeWidth:N?.strokeWidth??m,strokeOpacity:N?.strokeOpacity??v,lineDash:N?.lineDash??S,lineDashOffset:N?.lineDashOffset??M,cornerRadius:N?.cornerRadius??D}}getOuterRadius(){return Math.max(this.radius*this.properties.outerRadiusRatio+this.properties.outerRadiusOffset,0)}updateRadiusScale(t){const e=[0,this.getOuterRadius()];this.radiusScale.range=e,t&&(this.previousRadiusScale.range=e);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 t=Math.max(0,this.radiusScale.range[1]);if(t===0)return NaN;const i=2+(this.properties.title?.spacing??0),s=Math.max(0,-t);return-t-i-s}update({seriesRect:t}){const{title:e}=this.properties,i={seriesRectWidth:t?.width,seriesRectHeight:t?.height},s=ps(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),e){const n=this.getTitleTranslationY();e.node.y=isFinite(n)?n:0;const r=e.node.getBBox();e.node.visible=e.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(t)}updateTitleNodes(){const{oldTitle:t}=this,{title:e}=this.properties;t!==e&&(t&&this.labelGroup?.removeChild(t.node),e&&(e.node.textBaseline="bottom",this.labelGroup?.appendChild(e.node)),this.oldTitle=e)}updateNodeMidPoint(){const t=e=>{const i=e.innerRadius+(e.outerRadius-e.innerRadius)/2;e.midPoint={x:e.midCos*Math.max(0,i),y:e.midSin*Math.max(0,i)}};this.nodeData.forEach(t),this.phantomNodeData?.forEach(t)}updateSelections(){const{itemSelection:t,highlightSelection:e,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.datum,h.datumIndex)),this.ctx.animationManager.isSkipped()&&l.cleanup()};a(t,this.nodeData),a(e,o),a(i,this.phantomNodeData??[]),n.update(this.calloutNodeData,l=>{const c=new vi;c.tag=0,c.pointerEvents=1,l.appendChild(c);const h=new me;h.tag=1,h.pointerEvents=1,l.appendChild(h)}),r.update(this.nodeData),s.update(o)}updateNodes(t){const e=this.ctx.highlightManager.getActiveHighlight(),{visible:i}=this;this.backgroundGroup.visible=i,this.contentGroup.visible=i,this.highlightGroup.visible=i&&e?.series===this,this.highlightLabel.visible=i&&e?.series===this,this.labelGroup&&(this.labelGroup.visible=i),this.contentGroup.opacity=this.getOpacity();const s=this.radiusScale.range[0],n=this.radiusScale.range[1],r=this.getShapeFillBBox(),o=this.ctx.animationManager.isSkipped(),a=(l,c,h,u)=>{const d=this.getSectorFormat(c.datum,c.itemId,u);c.sectorFormat.fill=d.fill,c.sectorFormat.stroke=d.stroke,o&&(l.startAngle=c.startAngle,l.endAngle=c.endAngle,l.innerRadius=c.innerRadius,l.outerRadius=c.outerRadius),(u||o)&&(l.fill=d.fill,l.stroke=d.stroke);const p=this.getFillParams(d.fill,s,n);Lc(l,d.fill,r,p),l.strokeWidth=d.strokeWidth,l.fillOpacity=d.fillOpacity,l.strokeOpacity=d.strokeOpacity,l.lineDash=d.lineDash,l.lineDashOffset=d.lineDashOffset,l.cornerRadius=d.cornerRadius,l.fillShadow=this.properties.shadow;const f=Math.max((this.properties.sectorSpacing+(d.stroke!=null?d.strokeWidth:0))/2,0);l.inset=f,l.lineJoin=this.properties.sectorSpacing>=0||f>0?"miter":"round"};this.itemSelection.each((l,c,h)=>a(l,c,h,!1)),this.highlightSelection.each((l,c,h)=>{a(l,c,h,!0),l.visible=c.itemId===e?.itemId}),this.phantomSelection.each((l,c,h)=>a(l,c,h,!1)),this.updateCalloutLineNodes(),this.updateCalloutLabelNodes(t),this.updateSectorLabelNodes(),this.updateZerosumRings(),this.animationState.transition("update")}updateCalloutLineNodes(){const{calloutLine:{length:t,strokeWidth:e,colors:i},strokes:s}=this.properties,n=e,r=pm(i)?i:s,{offset:o}=this.properties.calloutLabel;this.calloutLabelSelection.selectByTag(0).forEach((a,l)=>{const c=a.closestDatum(),{calloutLabel:h,outerRadius:u}=c;if(h?.text&&!h.hidden&&u!==0){a.visible=!0,a.strokeWidth=n,a.stroke=r[l%r.length],a.fill=void 0;const d=c.midCos*u,p=c.midSin*u;let f=c.midCos*(u+t),y=c.midSin*(u+t);if((h.collisionTextAlign??h.collisionOffsetY!==0)&&h.box!=null){const m=h.box;let v=f,S=y;f<m.x?v=m.x:f>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-f,D=S-y,C=Math.sqrt(Math.pow(M,2)+Math.pow(D,2)),L=C-o;L>0&&(f=f+M*L/C,y=y+D*L/C)}a.x1=d,a.y1=p,a.x2=f,a.y2=y}else a.visible=!1})}getLabelOverflow(t,e,i){const s=-this.centerX,n=s+i.width,r=-this.centerY,o=r+i.height,a=1;let l=1;e.x+a<s?l=(e.x+e.width-s)/e.width:e.x+e.width-a>n&&(l=(n-e.x)/e.width);const c=e.y+a<r||e.y+e.height-a>o,h=l===1?t.length:Math.floor(t.length*l)-1,u=this.bboxIntersectsSurroundingSeries(e);return{textLength:h,hasVerticalOverflow:c,hasSurroundingSeriesOverflow:u}}bboxIntersectsSurroundingSeries(t){const{surroundingRadius:e}=this;if(e==null)return!1;const i=[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y},{x:t.x+t.width,y:t.y+t.height},{x:t.x,y:t.y+t.height}],s=e**2;return i.some(n=>n.x**2+n.y**2>s)}computeCalloutLabelCollisionOffsets(){const{radiusScale:t}=this,{calloutLabel:e,calloutLine:i}=this.properties,{offset:s,minSpacing:n}=e,r=t.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 B.zero.clone();const S=m.outerRadius+i.length+s,M=m.midCos*S,D=m.midSin*S+v.collisionOffsetY,C=v.collisionTextAlign??v.textAlign,L=v.textBaseline;return me.computeBBox(v.text,M,D,{font:this.properties.calloutLabel,textAlign:C,textBaseline:L})},f=(m,v,S)=>{const M=p(m).grow(n/2),D=p(v).grow(n/2);M.x<D.x+D.width&&M.x+M.width>D.x&&(S==="to-top"?M.y<D.y+D.height:M.y+M.height>D.y)&&(v.calloutLabel.collisionOffsetY=S==="to-top"?M.y-D.y-D.height:M.y+M.height-D.y)},y=m=>{const v=m.slice().sort((M,D)=>Math.abs(M.midSin)-Math.abs(D.midSin))[0],S=m.indexOf(v);for(let M=S-1;M>=0;M--){const D=m[M+1],C=m[M];f(D,C,"to-top")}for(let M=S+1;M<m.length;M++){const D=m[M-1],C=m[M];f(D,C,"to-bottom")}},x=m=>{const v=l.some(I=>I.calloutLabel.collisionOffsetY!==0),S=m.map(I=>p(I)),M=S.map(I=>I.clone().grow(n/2));let D=!1;for(let I=0;I<M.length&&!D;I++){const N=M[I];for(let E=I+1;E<m.length;E++){const R=M[E];if(N.collidesBBox(R)){D=!0;break}}}const C=a.map(I=>{const{startAngle:N,endAngle:E,outerRadius:R}=I;return{startAngle:N,endAngle:E,innerRadius:r,outerRadius:R}}),L=S.some(I=>C.some(N=>Qx(I,N)));!D&&!v&&!L||m.filter(I=>I.calloutLabel.textAlign==="center").forEach(I=>{const N=I.calloutLabel;I.midCos<0?N.collisionTextAlign="right":I.midCos>0?N.collisionTextAlign="left":N.collisionTextAlign="center"})};y(c),y(h),x(u),x(d)}updateCalloutLabelNodes(t){const{radiusScale:e}=this,{calloutLabel:i,calloutLine:s}=this.properties,n=s.length,{offset:r,color:o}=i,a=new me;this.calloutLabelSelection.selectByTag(1).forEach(l=>{const c=l.closestDatum(),h=c.calloutLabel,u=e.convert(c.radius),d=Math.max(0,u);if(!h?.text||d===0||h.hidden){l.visible=!1;return}const p=d+n+r,f=c.midCos*p,y=c.midSin*p+h.collisionOffsetY,x={textAlign:h.collisionTextAlign??h.textAlign,textBaseline:h.textBaseline};a.text=h.text,a.x=f,a.y=y,a.setFont(this.properties.calloutLabel),a.setAlign(x);const m=a.getBBox();let v=h.text,S=!0;if(i.avoidCollisions){const{textLength:M,hasVerticalOverflow:D}=this.getLabelOverflow(h.text,m,t);v=h.text.length===M?h.text:`${h.text.substring(0,M)}\u2026`,S=!D}l.text=v,l.x=f,l.y=y,l.setFont(this.properties.calloutLabel),l.setAlign(x),l.fill=o,l.visible=S})}computeLabelsBBox(t,e){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 me;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(),l.push(h))}return this.calloutNodeData.forEach(d=>{const p=d.calloutLabel;if(!p||d.outerRadius===0)return null;const f=d.outerRadius+n+r,y=d.midCos*f,x=d.midSin*f+p.collisionOffsetY;c.text=p.text,c.x=y,c.y=x,c.setFont(this.properties.calloutLabel),c.setAlign({textAlign:p.collisionTextAlign??p.textAlign,textBaseline:p.textBaseline});const m=c.getBBox();if(p.box=m,Math.abs(p.collisionOffsetY)>o){p.hidden=!0;return}if(h){const v=-this.centerY,S=new B(h.x-a,v,h.width+2*a,h.y+h.height+a-v);if(m.collidesBBox(S)){p.hidden=!0;return}}if(t.hideWhenNecessary){const{textLength:v,hasVerticalOverflow:S,hasSurroundingSeriesOverflow:M}=this.getLabelOverflow(p.text,m,e),D=p.text.length>2&&v<2;if(S||D||M){p.hidden=!0;return}}p.hidden=!1,l.push(m)}),l.length===0?null:B.merge(l)}updateSectorLabelNodes(){const{radiusScale:t}=this,e=t.convert(0),{fontSize:i,fontStyle:s,fontWeight:n,fontFamily:r,positionOffset:o,positionRatio:a,color:l}=this.properties.sectorLabel,c=e>0,h=this.ctx.legendManager.getData(this.id)?.filter(d=>d.enabled).length===1,u=(d,p)=>{const{sectorLabel:f,outerRadius:y,startAngle:x,endAngle:m}=p;let v=!1;if(f&&y!==0){const S=e*(1-a)+y*a+o;d.fill=l,d.fontStyle=s,d.fontWeight=n,d.fontSize=i,d.fontFamily=r,d.text=f.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 D=d.getBBox(),C=[[D.x,D.y],[D.x+D.width,D.y],[D.x+D.width,D.y+D.height],[D.x,D.y+D.height]],L={startAngle:x,endAngle:m,innerRadius:e,outerRadius:y};C.every(([I,N])=>dh(I,N,L))&&(v=!0)}d.visible=v};this.labelSelection.each(u),this.highlightLabelSelection.each(u)}updateZerosumRings(){this.zerosumOuterRing.size=this.getOuterRadius()*2}pickNodeClosestDatum(t){return ig(this,t)}getTooltipContent(t){const{id:e,dataModel:i,processedData:s,properties:n}=this,{legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,tooltip:f}=n,y=this.properties.title.text;if(!i||!s)return;const x=s.dataSources.get(this.id)?.[t],{angleRawValues:m,legendItemValues:v,calloutLabelValues:S,sectorLabelValues:M}=this.getProcessedDataValues(i,s),D=m[t],C=v?.[t]??(o===h?void 0:S?.[t])??(l===h?void 0:M?.[t])??u;return f.formatTooltip(this.properties,{title:y,symbol:this.legendItemSymbol(t),data:[{label:C,fallbackLabel:h,value:Rs(D,3)}]},{seriesId:e,datum:x,title:u,legendItemKey:r,calloutLabelKey:o,calloutLabelName:a,sectorLabelKey:l,sectorLabelName:c,angleKey:h,angleName:u,radiusKey:d,radiusName:p,...this.getSectorFormat(x,t,!1)})}legendItemSymbol(t){const e=this.processedData?.dataSources.get(this.id)?.[t],i=this.getSectorFormat(e,t,!1),{fillOpacity:s,strokeOpacity:n,strokeWidth:r,lineDash:o,lineDashOffset:a}=this.properties;let{fill:l}=i;const{stroke:c}=i;return Vi(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(t){const{id:e,visible:i,processedData:s,dataModel:n,ctx:{legendManager:r}}=this;if(!n||!s||t!=="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{calloutLabelValues:u,sectorLabelValues:d,legendItemValues:p,angleRawValues:f}=this.getProcessedDataValues(n,s),y=this.properties.title?.showInLegend&&this.properties.title.text,x=[],m=this.properties.hideZeroValueSectorsInLegend,v=s.dataSources.get(this.id),S=s.invalidData?.get(this.id);for(let M=0;M<s.input.count;M++){const D=v?.[M],C=f[M];if(S?.[M]===!0||m&&C===0)continue;const L=[];y&&L.push(y);const I=this.getLabels(D,2*Math.PI,2*Math.PI,!1,u?.[M],d?.[M],p?.[M]);c&&I.legendItem!==void 0?L.push(I.legendItem.text):a&&a!==o&&I.calloutLabel?.text!==void 0?L.push(I.calloutLabel?.text):l&&l!==o&&I.sectorLabel?.text!==void 0&&L.push(I.sectorLabel?.text),L.length!==0&&x.push({legendType:"category",id:e,datum:D,itemId:M,seriesId:e,enabled:i&&r.getItemEnabled({seriesId:e,itemId:M}),label:{text:L.join(" - ")},symbol:this.legendItemSymbol(M),legendItemName:c!=null?D[c]:void 0,hideInLegend:!h})}return x}setLegendState(t){const{id:e,ctx:{legendManager:i,updateService:s}}=this;t.forEach((n,r)=>i.toggleItem(n,e,r)),i.update(),s.update(4)}animateEmptyUpdateReady(t){const{animationManager:e}=this.ctx,i=lr(!0,this.properties.rotation,this.radiusScale,this.previousRadiusScale);Xt(this.id,"nodes",e,[this.itemSelection,this.highlightSelection,this.phantomSelection],i.nodes,(s,n)=>this.getDatumId(n.datum,n.datumIndex)),Mt(this,"callout",e,this.calloutLabelSelection),Mt(this,"sector",e,this.labelSelection),Mt(this,"highlight",e,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateWaitingUpdateReady(){const{itemSelection:t,highlightSelection:e,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=lr(!1,this.properties.rotation,n,r);Xt(this.id,"nodes",o,[t,e,i],u.nodes,(d,p)=>this.getDatumId(p.datum,p.datumIndex),a),Mt(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Mt(this,"sector",this.ctx.animationManager,this.labelSelection),Mt(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}animateClearingUpdateEmpty(){const{itemSelection:t,highlightSelection:e,phantomSelection:i,radiusScale:s,previousRadiusScale:n}=this,{animationManager:r}=this.ctx,o=lr(!1,this.properties.rotation,s,n);Xt(this.id,"nodes",r,[t,e,i],o.nodes,(a,l)=>this.getDatumId(l.datum,l.datumIndex)),Ln(this,"callout",this.ctx.animationManager,this.calloutLabelSelection),Ln(this,"sector",this.ctx.animationManager,this.labelSelection),Ln(this,"highlight",this.ctx.animationManager,this.highlightLabelSelection),this.previousRadiusScale.range=this.radiusScale.range}getDatumId(t,e){const{calloutLabelKey:i,sectorLabelKey:s,legendItemKey:n}=this.properties;return this.processedData?.reduced?.animationValidation?.uniqueKeys?n?Le(t[n]):i?Le(t[i]):s?Le(t[s]):`${e}`:`${e}`}};Mh.className="PieSeries",Mh.type="pie";var $k={series:{title:{enabled:!0,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.1666666666666667]},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:"backgroundColor"},positionOffset:0,positionRatio:.5},calloutLine:{length:10,strokeWidth:2,colors:{$map:[{$if:[{$or:[{$isGradient:[{$value:"$1"}]},{$isPattern:[{$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:vp,fillOpacity:1,strokeOpacity:1,strokeWidth:0,lineDash:[0],lineDashOffset:0,rotation:0,sectorSpacing:1,shadow:{enabled:!1,color:Sn,xOffset:3,yOffset:3,blur:5}},legend:{enabled:!0}},Hk={type:"series",optionsKey:"series[]",packageType:"community",chartTypes:["polar"],identifier:"pie",moduleFactory:t=>new Mh(t),tooltipDefaults:{range:"exact"},themeTemplate:$k},Kk={type:"series",name:"pie",chartType:"polar",options:xh,create:t=>new Mh(t)};function ng(){ls.register(W0,BT,tT,yk,Fx,Ek,Yx,Fk,Uk,Hk,Rk);for(const t of[Us,tr,xn,nr,oo])Hn.register(t.type,{moduleFactory:e=>new t(e)})}var nv=(w(),k(T));function Zk(){for(const t of ls.modules){if(t.packageType==="enterprise"&&!IC(t)&&nv.Logger.errorOnce("Unexpected enterprise module registered: "+t.identifier),t.type==="root"&&t.themeTemplate)for(const e of t.chartTypes)xd.set(e,t.themeTemplate);if(t.type==="series"){if(t.chartTypes.length>1)throw new Error(`AG Charts - Module definition error: ${t.identifier}`);Ei.register(t.identifier,t)}if(t.type==="series-option"&&t.themeTemplate)for(const e of t.seriesTypes)Ei.setThemeTemplate(e,t.themeTemplate);if(t.type==="axis-option"&&t.themeTemplate)for(const e of t.axisTypes){const i=Hn.getThemeTemplate(e),s=gt(t.themeTemplate,i);Hn.setThemeTemplate(e,s)}t.type==="axis"&&Hn.register(t.identifier,t),t.type==="legend"&&bd.register(t.identifier,t)}if(ls.hasEnterpriseModules()){const t=AC();t.length>0&&nv.Logger.errorOnce("Enterprise modules expected but not registered: ",t)}}var Mo=(w(),k(T)),Xk=["top","right","bottom","left"],Sh=class qv extends Tc{constructor(e,i){super(e,i),this.paired=!0,this.lastUpdateClipRect=void 0,this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}onAxisChange(e,i){super.onAxisChange(e,i),this.ctx!=null&&this.ctx.zoomManager.updateAxes(e)}destroySeries(e){super.destroySeries(e),this.lastLayoutWidth=NaN,this.lastLayoutHeight=NaN}getChartType(){return"cartesian"}setRootClipRects(e){const{seriesRoot:i,annotationRoot:s}=this;i.setClipRect(e),s.setClipRect(e)}async processData(){await super.processData();for(const e of this.axes){const i=this.getSyncedDomain(e);i!=null&&e.setDomains(i)}this.ctx.updateService.dispatchProcessData({series:{shouldFlipXY:this.shouldFlipXY()}})}performLayout(e){const{seriesRoot:i,annotationRoot:s}=this,{clipSeries:n,seriesRect:r,visible:o}=this.updateAxes(e.layoutBox);this.seriesRoot.visible=o,this.seriesRect=r,this.animationRect=e.layoutBox;const{x:a,y:l}=r;if(e.width!==this.lastLayoutWidth||e.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;js(this.id,"seriesRect",this.ctx.animationManager,[i,s],{translationX:d,translationY:p},{translationX:Math.floor(a),translationY:Math.floor(l)},{phase:"update"})}this.lastLayoutWidth=e.width,this.lastLayoutHeight=e.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(e,{axes:this.axes.map(d=>d.getLayoutState()),series:{visible:o,rect:r,paddedRect:c},clipSeries:n})}updateAxes(e){const{clipSeries:i,seriesRect:s,overflows:n}=this.resolveAxesLayout(e);for(const r of this.axes)r.update(),r.setCrossLinesVisible(!n),this.clipAxis(r,s,e);return{clipSeries:i,seriesRect:s,visible:!n}}resolveAxesLayout(e){let i,s,n=0;const r=10;do if(s=i??this.getDefaultState(),i=this.updateAxesPass(new Map(s.axisAreaWidths),e.clone()),n++>r){Mo.Logger.warn("Max iterations reached. Unable to stabilize axes layout.");break}while(!this.isLayoutStable(i,s));return this.lastAreaWidths=i.axisAreaWidths,i}updateAxesPass(e,i){const s=new Map,n={};let r=!1,o=!1;for(const m of Xk){const v=this.seriesArea.padding[m],S=this.axes.findLast(M=>M.position===m);S?S.seriesAreaPadding=v:i.shrink(v,m)}const a=(e.get("left")??0)+(e.get("right")??0),l=(e.get("top")??0)+(e.get("bottom")??0),c=this.buildCrossLinePadding(e);i.width<=a+c.hPadding||i.height<=l+c.vPadding?r=!0:i.shrink(c);const h=i.clone().shrink(Object.fromEntries(e));for(const m of this.axes){const{position:v="left",direction:S}=m;this.sizeAxis(m,h,v);const M=S==="y",{primaryTickCount:D,bbox:C}=m.calculateLayout(m.nice?n[S]:void 0);n[S]??(n[S]=D),o||(o=m.dataDomain.clipped||m.visibleRange[0]>0||m.visibleRange[1]<1),s.set(m.id,Math.ceil(m.thickness??(M?C?.width:C?.height)??0))}const u=(0,Mo.groupBy)(this.axes,m=>m.position??"left"),{width:d,height:p,pixelRatio:f}=this.ctx.scene,y=new Map,x=new Map;for(const[m,v]of(0,Mo.entries)(u)){let M=m==="left"||m==="right"?p%f:d%f,D=0;for(const C of v??[]){x.set(C.id,M);const L=s.get(C.id)??0;D=Math.max(D,M+L),C.layoutConstraints.stacked&&(M+=L+qv.AxesPadding)}y.set(m,Math.ceil(D))}for(const[m,v]of(0,Mo.entries)(u))this.positionAxes({axes:v??[],position:m,axisWidths:s,axisOffsets:x,axisAreaWidths:y,axisBound:i,seriesRect:h});return{clipSeries:o,seriesRect:h,axisAreaWidths:y,overflows:r}}buildCrossLinePadding(e){const i={top:0,right:0,bottom:0,left:0,hPadding:0,vPadding:0};this.axes.forEach(s=>{s.crossLines?.forEach(n=>{n.calculatePadding?.(i)})});for(const[s,n=0]of(0,Mo.entries)(i))i[s]=Math.max(n-(e.get(s)??0),0);return i.hPadding=i.left+i.right,i.vPadding=i.top+i.bottom,i}clampToOutsideSeriesRect(e,i,s,n){const r=s==="x"?e.x:e.y,o=s==="x"?e.width:e.height;return n===1?Math.min(i,r+o):Math.max(i,r)}getSyncedDomain(e){const i=this.modulesManager.getModule("sync");if(!i?.enabled)return;const s=i.getSyncedDomain(e);if(s&&e.dataDomain.domain.length){let n;const{domain:r}=e.scale;if(Ct.is(e.scale)){const[o,a]=ne(s);n=o!==r[0]||a!==r[1]}else n=!(0,Mo.arraysEqual)(s,r);n&&!this.skipSync&&i.updateSiblings()}return s}sizeAxis(e,i,s){const n=e instanceof tr,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(e.id);const{width:p,unit:f,align:y}=e.layoutConstraints;f==="px"?h=c+p:h=h*p/100,y==="end"&&(c=l-(h-c),h=l),r&&(n?[u,d]=[1-d,1-u]:[c,h]=[h,c]),e.range=[c,h],e.visibleRange=[u,d],e.gridLength=r?o:a}positionAxes(e){const{axes:i,axisBound:s,axisWidths:n,axisOffsets:r,axisAreaWidths:o,seriesRect:a,position:l}=e,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 f of i){const y=o.get(u==="x"?"left":"top")??0,x=n.get(f.id)??0,m=r.get(f.id)??0;f.gridPadding=c-m-x,f.translation[u]=s[u]+y,f.translation[h]=this.clampToOutsideSeriesRect(a,p+d*(m+x),h,d)}}shouldFlipXY(){return this.series.every(e=>e instanceof Cn&&e.shouldFlipXY())}getDefaultState(){const e=new Map;if(this.lastAreaWidths)for(const{position:i="left"}of this.axes){const s=this.lastAreaWidths.get(i);s!=null&&e.set(i,s)}return{axisAreaWidths:e,clipSeries:!1,overflows:!1}}isLayoutStable(e,i){if(i.overflows!==e.overflows||i.clipSeries!==e.clipSeries)return!1;for(const s of e.axisAreaWidths.keys())if(!i.axisAreaWidths.has(s))return!1;for(const[s,n]of i.axisAreaWidths.entries()){const r=e.axisAreaWidths.get(s);if((n!=null||r!=null)&&n!==r)return!1}return!0}clipAxis(e,i,s){const n=Math.ceil(e.gridLine?.width??0),r=Math.ceil(e.line?.width??0);let{width:o,height:a}=i;switch(o+=e.direction==="x"?n:r,a+=e.direction==="y"?n:r,e.clipGrid(i.x,i.y,o,a),e.position){case"left":case"right":e.clipTickLines(s.x,i.y-n,s.width+n,i.height+n*2);break;case"top":case"bottom":e.clipTickLines(i.x-n,s.y,i.width+n*2,s.height+n);const{label:l,labelNodes:c,scale:h}=e;if(Ct.is(h)&&l.enabled&&l.avoidCollisions&&c.length>1){const u=c.toSorted((y,x)=>y.translationY-x.translationY),d=u.at(-1),p=d.getBBox(),f=i.x+p.y+p.height<=s.x+s.width+this.padding.right;if(d.visible=f,f||e.visibleRange[0]>0||e.visibleRange[1]<1)u[0].visible=!0;else{const y=u[0].getBBox();u[0].visible=y.y>=0}}break}}};Sh.className="CartesianChart",Sh.type="cartesian",Sh.AxesPadding=15;var qk=Sh,ke=(w(),k(T)),Qk=(0,ke.attachDescription)(t=>typeof HTMLElement>"u"||t instanceof HTMLElement,"an html element"),cr={mode:(0,ke.union)("integrated","standalone"),container:Qk,theme:ke.defined,series:ke.array,annotations:ke.defined,navigator:ke.defined,initialState:ke.defined},rv={...ei,...cr,axes:ke.defined,data:ke.array},ov={...ei,...cr,axes:ke.defined,data:ke.array},Jk={...ei,...cr,data:ke.array,topology:ke.object},tw={...ei,...cr,data:ke.array},ew={...ei,...cr,data:ke.array},iw={...ei,...cr,data:ke.array,nodes:ke.array},sw={...ei,...cr,data:ke.array},nw={type:"chart",name:"cartesian",options:rv,detect:Fd,create(t,e){return new qk(t,e)}},p1=(w(),k(T)),ol=()=>{throw new Error("Enterprise module placeholder cannot be initialised")},rw={type:"chart",name:"flow-proportion",placeholder:!0,options:{},detect:Hb,create:ol},ow={type:"chart",name:"gauge",placeholder:!0,options:{},detect:Bd,create:ol},aw={type:"chart",name:"hierarchy",placeholder:!0,options:{},detect:Wb,create:ol},lw={type:"chart",name:"standalone",placeholder:!0,options:{},detect:zd,create:ol},cw={type:"chart",name:"topology",placeholder:!0,options:{},detect:$b,create:ol},av=(w(),k(T)),So=class extends Rd{constructor(){super(...arguments),this.shape="polygon",this.innerRadiusRatio=0,this.defaultTickMinSpacing=20}updatePosition(){super.updatePosition();const t=Ic(this),e=Ed(t);this.axisGroup.setProperties(this.getAxisTransform()),this.gridLineGroupSelection.each(e),this.tickLineGroupSelection.each(e),this.tickLabelGroupSelection.each(Od())}computeLabelsBBox(t,e){return null}computeRange(){}getAxisLinePoints(){}};g([b(At(["polygon","circle"],"a polar axis shape"))],So.prototype,"shape",2),g([b(It)],So.prototype,"innerRadiusRatio",2);var rg=class extends Tc{constructor(t,e){super(t,e),this.padding=new dn(40),this.ctx.axisManager.axisGroup.zIndex=6}getChartType(){return"polar"}async performLayout(t){const{layoutBox:e}=t;e.shrink(this.seriesArea.padding.toJson());const i=e.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(t,{series:{visible:!0,rect:i,paddedRect:i}})}updateAxes(t,e,i,s){const n=this.axes.find(l=>l.direction==="x"),r=this.axes.find(l=>l.direction==="y");if(!(n instanceof So)||!(r instanceof So))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})?.map(l=>o.convert(l)),r.gridRange=n.range,r.range=[s,s*a],[n,r].forEach(l=>{l.translation.x=t.x+e,l.translation.y=t.y+i,l.calculateLayout()})}async computeCircle(t){const e=this.series.filter(hw),i=this.axes.filter(uw),s=(c,h,u)=>{this.updateAxes(t,c,h,u),e.forEach(p=>{p.centerX=c,p.centerY=h,p.radius=u});const d=e.filter(p=>p.type==="donut"||p.type==="pie");if(d.length>1){const p=d.map(f=>{const y=f.getInnerRadius();return{series:f,innerRadius:y}}).sort((f,y)=>f.innerRadius-y.innerRadius);p.at(-1).series.surroundingRadius=void 0;for(let f=0;f<p.length-1;f++)p[f].series.surroundingRadius=p[f+1].innerRadius}},n=t.width/2,r=t.height/2,o=Math.max(0,Math.min(t.width,t.height)/2);let a=o;s(n,r,a);const l=async({hideWhenNecessary:c=!1}={})=>{const h=[];for(const p of(0,av.iterate)(i,e)){const f=await p.computeLabelsBBox({hideWhenNecessary:c},t);f&&h.push(f)}if(h.length===0){s(n,r,o);return}const u=B.merge(h),d=this.refineCircle(u,a,t);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,av.iterate)(i,e))await c.computeLabelsBBox({hideWhenNecessary:!0},t);return{radius:a,centerX:n,centerY:r}}refineCircle(t,e,i){const n=-e,r=-e,o=e,a=e;let l=Math.max(0,n-t.x),c=Math.max(0,r-t.y),h=Math.max(0,t.x+t.width-o),u=Math.max(0,t.y+t.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 f=Math.min(d,p)/2;const y=.5*i.width/2,x=.5*i.height/2,m=Math.min(y,x);if(f<m){f=m;const M=l+h,D=c+u;if(2*f+D>i.height){const C=i.height-2*f;Math.min(c,u)*2>C?(c=C/2,u=C/2):c>u?c=C-u:u=C-c}if(2*f+M>i.width){const C=i.width-2*f;Math.min(l,h)*2>C?(l=C/2,h=C/2):l>h?l=C-h:h=C-l}}const v=l+2*f+h,S=c+2*f+u;return{centerX:(i.width-v)/2+l+f,centerY:(i.height-S)/2+c+f,radius:f}}};rg.className="PolarChart",rg.type="polar";function hw(t){return t instanceof yh}function uw(t){return t instanceof So}var dw={type:"chart",name:"polar",options:ov,detect:Yb,create(t,e){return new rg(t,e)}},Nt=(w(),k(T)),pw={...yo,...sh(Nt.number),type:(0,Nt.required)((0,Nt.constant)("number")),label:{format:eh,...mo},crosshair:bo(!0)},gw={...yo,...sh(Nt.number),type:(0,Nt.required)((0,Nt.constant)("log")),base:(0,Nt.and)(Nt.positiveNumberNonZero,(0,Nt.attachDescription)(t=>t!==1,"not equal to 1")),label:{format:eh,...mo},crosshair:bo(!0)},fw={...yo,...sh((0,Nt.or)(Nt.number,Nt.date),!0),type:(0,Nt.required)((0,Nt.constant)("time")),label:{...mo,format:Nt.string},crosshair:bo(!0)},mw={...yo,type:(0,Nt.required)((0,Nt.constant)("category")),label:mo,paddingInner:Nt.positiveNumber,paddingOuter:Nt.positiveNumber,groupPaddingInner:Nt.positiveNumber,crosshair:bo()},yw={...yo,type:(0,Nt.required)((0,Nt.constant)("grouped-category")),label:mo,crosshair:bo(),paddingInner:Nt.positiveNumber,groupPaddingInner:Nt.positiveNumber,depthOptions:(0,Nt.arrayOfDefs)({label:{enabled:Nt.boolean,avoidCollisions:Nt.boolean,...Nt.fontOptionsDef},tick:{enabled:Nt.boolean,stroke:Nt.color,width:Nt.positiveNumber}},"depth options objects array")},bw={type:"axis",name:"number",chartType:"cartesian",options:pw,create:t=>new Us(t)},xw={type:"axis",name:"log",chartType:"cartesian",options:gw,create:t=>new oo(t)},vw={type:"axis",name:"time",chartType:"cartesian",options:fw,create:t=>new xn(t)},Mw={type:"axis",name:"category",chartType:"cartesian",options:mw,create:t=>new tr(t)},Sw={type:"axis",name:"grouped-category",chartType:"cartesian",options:yw,create:t=>new nr(t)},g1=(w(),k(T)),Dw=[nw,bw,xw,vw,Mw,Sw,Ox,zx,Gx,Ux,Wx,Hx],Iw=[dw,Yk,Kk],Aw=[...Dw,...Iw,rw,ow,aw,lw,cw],Zs={isEnterprise:!1},rt=(w(),k(T)),Lw=["bar","line","scatter"],Cw=void 0,Nw=void 0;Nw=Cw;var Tw=void 0,kw=void 0;kw=Tw;var og=(t=>(t.POINTER="pointer",t.NODE="node",t.CHART="chart",t))(og||{}),ag=(t=>(t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t.TOP_LEFT="top-left",t.CENTER="center",t))(ag||{}),lg=(t=>(t.POINTER="pointer",t.NODE="node",t.TOP="top",t.RIGHT="right",t.BOTTOM="bottom",t.LEFT="left",t.TOP_LEFT="top-left",t.TOP_RIGHT="top-right",t.BOTTOM_RIGHT="bottom-right",t.BOTTOM_LEFT="bottom-left",t))(lg||{}),ww=void 0,Ew=void 0;Ew=ww;var Ow=void 0,Rw=void 0;Rw=Ow;var ai=Symbol("IGNORED_PROP");function Ii(t,e){const i={};for(const s of Object.keys(e)){const n=e[s];n!==ai&&Object.hasOwn(t,s)&&(i[s]=n)}return i}function Pw(t){return t.type==="radial-gauge"}function _w(t){return t.type==="linear-gauge"}function lv(t){const{enabled:e,mode:i,showArrow:s,range:n,position:r,pagination:o,delay:a,wrapping:l,interaction:c,renderer:h,...u}=t,d=Ii(t,{enabled:e,showArrow:s,range:n,position:r,interaction:c,renderer:h,...u});return{chartTooltipOptions:Ii(t,{enabled:ai,showArrow:ai,range:ai,position:ai,mode:i,pagination:o,delay:a,wrapping:l,...u}),seriesTooltipOptions:d}}function jw(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,width:x,type:m,cursor:v,nodeClickRange:S,tooltip:M={},value:D,scale:C={},startAngle:L,endAngle:I,highlightStyle:N,segmentation:E,bar:R,needle:z,targets:W,outerRadius:yt,innerRadius:$,outerRadiusRatio:q,innerRadiusRatio:tt,cornerRadius:ht,cornerMode:lt,label:V,secondaryLabel:Y,spacing:et,...st}=t,{chartTooltipOptions:ut,seriesTooltipOptions:bt}=lv(M),X=Ii(t,{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,tooltip:ut,width:x}),Z=Ii(t,{needle:z!=null?{enabled:!0,...z}:ai,startAngle:L,endAngle:I,scale:C,type:m,cursor:v,nodeClickRange:S,listeners:a,tooltip:bt,value:D,highlightStyle:N,segmentation:E,bar:R,targets:W,outerRadius:yt,innerRadius:$,outerRadiusRatio:q,innerRadiusRatio:tt,cornerRadius:ht,cornerMode:lt,label:V,secondaryLabel:Y,spacing:et,...st});return{...X,series:[Z]}}function Fw(t){const{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,width:x,type:m,cursor:v,nodeClickRange:S,tooltip:M={},value:D,scale:C={},direction:L="vertical",thickness:I,highlightStyle:N,segmentation:E,bar:R,targets:z,cornerRadius:W,cornerMode:yt,label:$,...q}=t,{chartTooltipOptions:tt,seriesTooltipOptions:ht}=lv(M),lt=Ii(t,{animation:e,background:i,container:s,contextMenu:n,footnote:r,height:o,listeners:a,locale:l,minHeight:c,minWidth:h,overrideDevicePixelRatio:u,padding:d,subtitle:p,theme:f,title:y,tooltip:tt,width:x}),V=Ii(t,{scale:C,type:m,cursor:v,nodeClickRange:S,listeners:a,tooltip:ht,value:D,direction:L,thickness:I,highlightStyle:N,segmentation:E,bar:R,targets:z,cornerRadius:W,cornerMode:yt,label:$,...q});return{...lt,series:[V]}}function cv(t,e){if(e==null)return t;const{targets:i,...s}=e;return t=gt(t,s),t.targets!=null&&i!=null&&(t.targets=wl(t.targets,i)),t}function zw(t,e){if(Pw(t)){const v=cv(t,e);return jw(v)}else if(_w(t)){const v=cv(t,e);return Fw(v)}const{animation:i,background:s,container:n,contextMenu:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,padding:d,subtitle:p,theme:f,title:y,tooltip:x,width:m}=t;return Ii(t,{animation:i,background:s,container:n,contextMenu:r,footnote:o,height:a,listeners:l,locale:c,minHeight:h,minWidth:u,padding:d,subtitle:p,theme:f,title:y,tooltip:x,width:m})}var Bw=(w(),k(T)),Fi={stroke:Qt},Pe={fill:Ra},hv={color:"white",fill:Qt},Xs={color:Qt},Dh={color:Oa,fontSize:{$rem:[1.1666666666666667]},fontFamily:{$ref:"fontFamily"}},Ih={...Dh,textAlign:"left"},cg={...Dh,fontSize:{$ref:"fontSize"},color:ja,fill:Pa,stroke:_a,strokeWidth:1,divider:{stroke:Fa,strokeWidth:1,strokeOpacity:.5}},hg={...Fi,background:{fill:he,fillOpacity:.2},handle:{...Pe},text:{...Xs},statistics:{...cg}},Gw={line:{...Fi,handle:{...Pe},text:{...Xs}},"horizontal-line":{...Fi,handle:{...Pe},axisLabel:{...hv},text:{...Xs}},"vertical-line":{...Fi,handle:{...Pe},axisLabel:{...hv},text:{...Xs}},"disjoint-channel":{...Fi,background:{fill:he,fillOpacity:.2},handle:{...Pe},text:{...Xs}},"parallel-channel":{...Fi,background:{fill:he,fillOpacity:.2},handle:{...Pe},text:{...Xs}},"fibonacci-retracement":{...Fi,strokes:Ea,rangeStroke:Qt,handle:{...Pe},text:{...Xs,position:"center"},label:{...Dh,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},"fibonacci-retracement-trend-based":{...Fi,strokes:Ea,rangeStroke:Qt,handle:{...Pe},text:{...Xs,position:"center"},label:{...Dh,color:void 0,fontSize:{$round:[{$mul:[{$ref:"fontSize"},10/12]}]}}},callout:{...Fi,...Ih,color:{$ref:"textColor"},handle:{...Pe},fill:he,fillOpacity:.2},comment:{...Ih,color:"white",fontWeight:700,handle:{...Pe},fill:Qt},note:{...Ih,color:Ua,fill:Qt,stroke:{$ref:"backgroundColor"},strokeWidth:1,strokeOpacity:1,handle:{...Pe},background:{fill:Ga,stroke:Va,strokeWidth:1}},text:{...Ih,handle:{...Pe}},arrow:{...Fi,handle:{...Pe},text:{...Xs}},"arrow-up":{fill:ka,handle:{...Pe,stroke:Qt}},"arrow-down":{fill:wa,handle:{...Pe,stroke:Qt}},"date-range":{...hg},"price-range":{...hg},"date-price-range":{...hg},"quick-date-price-range":{up:{...Fi,fill:he,fillOpacity:.2,handle:{...Pe},statistics:{...cg,color:"#fff",fill:he,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}},down:{...Fi,stroke:Ba,fill:za,fillOpacity:.2,handle:{...Pe,stroke:Ba},statistics:{...cg,color:"#fff",fill:za,strokeWidth:0,divider:{stroke:"#fff",strokeWidth:1,strokeOpacity:.5}}}},axesButtons:{enabled:!0}},Vw=["ohlc","line","step-line","hlc","high-low","candlestick","hollow-candlestick"],Uw=[{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 Yw(t,e,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:f=!0,zoom:y=!0,theme:x,data:m,...v}=t,S=$w(c,s,n,o,r,a),M=Ww(i,r,a,u,l),C={navigator:{enabled:h,...u?{miniChart:{enabled:h,series:[{type:"line",xKey:s,yKey:l,stroke:Wc,marker:{enabled:!1}}]},height:40,minHandle:{height:46},maxHandle:{height:46}}:null}},L={annotations:{enabled:f,optionsToolbar:{enabled:f},snap:!0,toolbar:{enabled:f,buttons:Uw,padding:0},data:m,xKey:s,volumeKey:u?l:void 0}},I=p?{statusBar:{enabled:!0,data:m,highKey:n,openKey:r,lowKey:o,closeKey:a,volumeKey:u?l:void 0}}:null,N={zoom:{enabled:y,autoScaling:{enabled:!0},enableIndependentAxes:!0}},E={ranges:{enabled:d}},R=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 x=="string"?x:"ag-financial",...gt(typeof x=="object"?x:null,{overrides:{common:{title:{padding:4},padding:{top:6,right:8,bottom:5},chartToolbar:{enabled:f},annotations:{...Gw},axes:{number:{interval:{maxSpacing:45},label:{format:".2f"}}}},bar:{series:{fillOpacity:.5}},line:{series:{marker:{enabled:!1},...pv(c,{hlc:{stroke:Vc,strokeWidth:2},line:{stroke:uo},"step-line":{stroke:uo,interpolation:{type:"step"}}})}},candlestick:{series:{...pv(c,{"hollow-candlestick":{item:{up:{fill:"transparent"}}}})}},"range-area":{series:{fillOpacity:.3,strokeWidth:2}}}})},animation:{enabled:!1},legend:{enabled:!1},series:[...M,...S],axes:[{type:"number",position:"right",keys:[r,a,n,o],crosshair:{enabled:!0,snap:!1},layoutConstraints:{stacked:!1,width:100,unit:"percent",align:"start"}},...R,{type:"ordinal-time",position:"bottom",line:{enabled:!1},label:{enabled:!0},crosshair:{enabled:!0}}],tooltip:{enabled:!1},data:m,...L,...C,...I,...N,...E,...v}}function Ww(t,e,i,s,n){return s?[{type:"bar",xKey:"date",yKey:n,tooltip:{enabled:!1},itemStyler({datum:r}){const{up:o,down:a}=t().palette;return{fill:r[e]<r[i]?o?.fill:a?.fill}},focusPriority:1,fastDataProcessing:!0,highlight:{enabled:!1}}]:[]}var uv="range-area";function $w(t,e,i,s,n,r){const o={xKey:e,openKey:n,closeKey:r,highKey:i,lowKey:s},a={xKey:e,yKey:r},l={pickOutsideVisibleMinorAxis:!0};switch(t??"candlestick"){case"ohlc":return Hw(l,o);case"line":case"step-line":return Kw(l,a);case"hlc":return Zw(l,a,o);case"high-low":return Xw(l,o);case"candlestick":case"hollow-candlestick":return dv(l,o);default:return Bw.Logger.warnOnce(`unknown chart type: ${t}; expected one of: ${Vw.join(", ")}`),dv(l,o)}}function Hw(t,e){return[{type:"ohlc",focusPriority:0,...t,...e}]}function Kw(t,e){return[{type:"line",focusPriority:0,...t,...e}]}function Zw(t,e,{xKey:i,highKey:s,closeKey:n,lowKey:r}){return[{type:uv,focusPriority:0,...t,xKey:i,yHighKey:s,yLowKey:n,fill:ka,stroke:zc},{type:uv,focusPriority:0,...t,xKey:i,yHighKey:n,yLowKey:r,fill:wa,stroke:Bc},{type:"line",...t,...e}]}function Xw(t,{xKey:e,highKey:i,lowKey:s}){return[{type:"range-bar",...t,xKey:e,yHighKey:i,yLowKey:s,fill:Gc,stroke:uo,tooltip:{range:"nearest"},focusPriority:0,fastDataProcessing:!0}]}function dv(t,e){return[{type:"candlestick",focusPriority:0,...t,...e}]}function pv(t,e){return e[t]??e.default}var gv={title:{enabled:!1},label:{enabled:!1},line:{enabled:!1},gridLine:{enabled:!1},crosshair:{enabled:!1,stroke:Yc,lineDash:[0],label:{enabled:!1}}},ug={...gv,nice:!1},Ah={mode:"compact",position:{anchorTo:"node",placement:["right","left"]},showArrow:!1},dg={style:[{stroke:{$ref:"gridLineColor"}}],width:2},qw={number:{gridLine:dg},time:{gridLine:dg},category:{gridLine:dg}},Qw={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:{...ug,interval:{values:[0]}},log:{...ug},time:{...ug},category:{...gv}}},bar:{series:{crisp:!1,label:{placement:"inside-end",padding:4},sparklineMode:!0},tooltip:{...Ah,position:{...Ah.position,anchorTo:"pointer"},range:"nearest"},axes:qw},line:{seriesArea:{padding:{top:2,right:2,bottom:2,left:2}},series:{sparklineMode:!0,strokeWidth:1,marker:{enabled:!1,size:3}},tooltip:Ah},area:{seriesArea:{padding:{top:1,right:0,bottom:1,left:0}},series:{strokeWidth:1,fillOpacity:.4},tooltip:Ah}}},fv=ti(Jw);function Jw(t,e){return typeof t=="string"?{...e,baseTheme:t}:t!=null?{...t,baseTheme:fv(t.baseTheme,e)}:e}function mv(t){if(Array.isArray(t)&&t.length!==0){const e=t[0];if(typeof e=="number")return{data:t.map((s,n)=>({x:n,y:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"y"};if(Array.isArray(e))return{data:t.map(s=>({x:s[0],y:s[1],datum:s})),series:[{xKey:"x",yKey:"y"}],datumKey:"datum"}}return{data:t}}function tE(t,e){switch(t?.type){case"number":{const{type:i,min:s,max:n,reverse:r}=t;return Ii(t,{type:i,reverse:r,min:s,max:n})}case"time":{const{type:i,min:s,max:n,reverse:r}=t;return Ii(t,{type:i,reverse:r,min:s,max:n})}case"category":{const{type:i,paddingInner:s,paddingOuter:n,reverse:r}=t;return Ii(t,{type:i,reverse:r,paddingInner:s,paddingOuter:n})}}return{type:e}}function eE(t,e,i){const s={};return t?.stroke!=null&&(s.style=[{stroke:t?.stroke}],s.enabled??(s.enabled=!0)),t?.strokeWidth!=null&&(s.width=t?.strokeWidth,s.enabled??(s.enabled=!0)),i.type==="bar"&&i.direction!=="horizontal"&&(s.enabled??(s.enabled=!0)),t?.visible!=null&&(s.enabled=t.visible),s.enabled??(s.enabled=e),s}var iE=ti((t,e,i)=>s=>{const n=s.datum[s.xKey],r=s.datum[s.yKey],o=i!=null?s.datum[i]:s.datum,a=e?.renderer?.({context:t,datum:o,xValue:n,yValue:r});return typeof a=="string"?a:{heading:void 0,title:void 0,data:[{label:a?.title,value:a?.content??r.toFixed(2)}]}});function sE(t){const{background:e,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:f,min:y,max:x,tooltip:m,context:v,...S}=t,M=Ii(t,{background:e,container:i,height:s,listeners:n,locale:r,minHeight:o,minWidth:a,overrideDevicePixelRatio:l,padding:c,width:h,tooltip:ai,context:ai,data:ai,crosshair:ai,axis:ai,min:ai,max:ai,theme:ai}),{data:D,series:[C]=[],datumKey:L}=mv(d),I=S;C!=null&&Object.assign(I,C),I.tooltip={...m,renderer:iE(v,m,L)},M.theme=fv(u,Qw),M.data=D,M.series=[I];const N=I.type!=="bar"||I.direction!=="horizontal",[E,R]=N?["bottom","left"]:["left","bottom"],z={...tE(f,"category"),position:E,...Ii(t,{crosshair:p})},W={type:"number",gridLine:eE(f,!1,t),position:R,...Ii(t,{min:y,max:x})};return M.axes=N?[W,z]:[z,W],M}var nE={"price-volume":Yw,gauge:zw,sparkline:sE},rE={sparkline:mv},al=(w(),k(T));function yv(t,e){let i=[];const s=Bd(t),n=zs(t),r=n?Yt.get(n):"unknown";for(const o of pa)if(!(r!=="unknown"&&!o.chartTypes.includes(r))){if(o.type==="root"||o.type==="legend"){const a=t[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 t[o.optionsKey])}else if(o.type==="axis"){if(!("axes"in t)||!(0,al.isArray)(t.axes)||!t.axes?.some(a=>a.type===o.identifier))continue;i.push(`axis[type=${o.identifier}]`),t.axes=t.axes.filter(a=>a.type!==o.identifier)}else if(o.type==="axis-option"){if(!("axes"in t)||!(0,al.isArray)(t.axes)||!t.axes?.some(a=>a[o.optionsKey]))continue;i.push(`axis.${o.optionsKey}`),t.axes.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}else if(o.type==="series"){if(o.community||!(0,al.isArray)(t.series)||!t.series?.some(a=>a.type===o.identifier))continue;i.push(`series[type=${o.identifier}]`),t.series=t.series.filter(a=>a.type!==o.identifier)}else if(o.type==="series-option"){if(!(0,al.isArray)(t.series)||!t.series?.some(a=>a[o.optionsKey]))continue;i.push(`series.${o.optionsKey}`),t.series.forEach(a=>{a[o.optionsKey]&&delete a[o.optionsKey]})}}if(i.length&&!e){s&&(i=["AgCharts.createGauge"]);let o="ag-charts-enterprise",a="https://www.ag-grid.com/charts/javascript/installation/";t.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/"),al.Logger.warnOnce([`unable to use these enterprise features as '${o}' has not been loaded:`,"",...i,"",`See: ${a}`].join(`
`))}}function oE(t){const e="mode"in t&&t.mode==="integrated";for(const i of ls.byType("root","legend")){const s=t[i.optionsKey],n=s!=null&&s.enabled===!1,r=!("removable"in i)||i.removable===!0||i.removable==="standalone-only"&&!e;n&&r&&delete t[i.optionsKey]}}var at=(w(),k(T)),bv=(w(),k(T));function xv(t){return t?.up||t?.down||t?.neutral?"user-full":t?.fills||t?.strokes?"user-indexed":"inbuilt"}var pg="white",gg={get cartesian(){return{seriesTypes:Yt.cartesianTypes,commonOptions:["zoom","navigator"]}},get polar(){return{seriesTypes:Yt.polarTypes,commonOptions:[]}},get hierarchy(){return{seriesTypes:Yt.hierarchyTypes,commonOptions:[]}},get topology(){return{seriesTypes:Yt.topologyTypes,commonOptions:[]}},get"flow-proportion"(){return{seriesTypes:Yt.flowProportionTypes,commonOptions:[]}},get standalone(){return{seriesTypes:Yt.standaloneTypes,commonOptions:[]}},get gauge(){return{seriesTypes:Yt.gaugeTypes,commonOptions:[]}}},aE={"radial-gauge":!0,"linear-gauge":!0};function vv(t){return aE[t]===!0}var lE=Object.values(gg).reduce((t,{commonOptions:e})=>t.concat(e),[]),zi=class dl{static getDefaultColors(){return{fills:se,fillsFallback:Object.values(se),strokes:xs,sequentialColors:Si(se),divergingColors:[se.ORANGE,se.YELLOW,se.GREEN],hierarchyColors:["#fff","#e0e5ea","#c1ccd5","#a3b4c1","#859cad"],secondSequentialColors:Dt.interpolate([Dt.fromHexString(se.BLUE),Dt.fromHexString("#cbdef5")],8).map(e=>e.toString()),secondDivergingColors:[se.GREEN,se.YELLOW,se.RED],secondHierarchyColors:["#fff","#c5cbd1","#a4b1bd","#8498a9","#648096"],up:{fill:se.GREEN,stroke:xs.GREEN},down:{fill:se.RED,stroke:xs.RED},neutral:{fill:se.GRAY,stroke:xs.GRAY},altUp:{fill:se.BLUE,stroke:xs.BLUE},altDown:{fill:se.ORANGE,stroke:xs.ORANGE},altNeutral:{fill:se.GRAY,stroke:xs.GRAY}}}static getDefaultPublicParameters(){return{accentColor:"#2196f3",axisColor:{$foregroundBackgroundMix:[.675]},backgroundColor:pg,borderColor:{$foregroundBackgroundMix:[.818]},foregroundColor:"#464646",fontFamily:"Verdana, sans-serif",fontSize:12,fontWeight:400,gridLineColor:{$foregroundBackgroundAccentMix:[.93,.085]},padding:20,subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.38]},textColor:{$ref:"foregroundColor"},chromeBackgroundColor:{$foregroundBackgroundMix:[.975]},chromeFontFamily:{$ref:"fontFamily"},chromeFontSize:{$ref:"fontSize"},chromeFontWeight:{$ref:"fontWeight"},chromeTextColor:"#181d1f",chromeSubtleTextColor:{$mix:[{$ref:"chromeTextColor"},{$ref:"backgroundColor"},.38]},inputBackgroundColor:{$ref:"backgroundColor"},inputTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$ref:"foregroundColor"},crosshairLabelTextColor:{$ref:"backgroundColor"}}}static getAxisDefaults(e,i=!0){return gt(e,i&&{title:{enabled:!1,text:"Axis Title",spacing:25,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"}}},{label:{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,width:1,stroke:{$ref:"axisColor"}},gridLine:{enabled:!0,style:[{stroke:{$ref:"gridLineColor"},lineDash:[]}]},crossLines:{enabled:!0,fill:{$ref:"foregroundColor"},stroke:{$ref:"foregroundColor"},fillOpacity:.1,strokeWidth:1,label:{fontSize:{$ref:"fontSize"},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},padding:5,color:{$ref:"textColor"}}}})}getChartDefaults(){return{minHeight:300,minWidth:300,background:{visible:!0,fill:{$ref:"backgroundColor"}},padding:{top:{$ref:"padding"},right:{$ref:"padding"},bottom:{$ref:"padding"},left:{$ref:"padding"}},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:[1.4166666666666667]},fontFamily:{$ref:"fontFamily"},color:{$ref:"textColor"},wrapping:"hyphenate",layoutStyle:Dn,textAlign:In},subtitle:{enabled:!1,text:"Subtitle",spacing:20,fontWeight:{$ref:"fontWeight"},fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Dn,textAlign:In},footnote:{enabled:!1,text:"Footnote",spacing:20,fontSize:{$rem:[1.0833333333333333]},fontFamily:{$ref:"fontFamily"},fontWeight:{$ref:"fontWeight"},color:{$ref:"subtleTextColor"},wrapping:"hyphenate",layoutStyle:Dn,textAlign:In},legend:{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:{$ref:"fontSize"},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:ho,delay:0,pagination:!1},overlays:{darkTheme:ho},listeners:{}}}constructor(e={}){const{overrides:i,palette:s}=Ft(e),n=this.createChartConfigPerChartType(this.getDefaults()),r={};i&&this.mergeOverrides(n,r,i);const{fills:o,strokes:a,sequentialColors:l,...c}=this.getDefaultColors();this.palette=jn(gt(s,{fills:Object.values(o),strokes:Object.values(a),sequentialColors:Object.values(l),...c})),this.paletteType=xv(s),this.config=jn(this.templateTheme(n)),this.presets=jn(r)}mergeOverrides(e,i,s){for(const{seriesTypes:n,commonOptions:r}of Object.values(gg)){const o={...s.common};for(const a of lE)r.includes(a)||delete o[a];if(o)for(const a of n){const l=a;vv(l)||(e[l]=gt(o,e[l]))}}Yt.seriesTypes.forEach(n=>{const r=n,o=s[r];vv(r)?i[r]=o:e[r]=gt(o,e[r])})}createChartConfigPerChartType(e){for(const[i,{seriesTypes:s}]of(0,bv.entries)(gg)){const n=xd.get(i);for(const r of s)e[r]??(e[r]=Ft(n))}return e}getDefaults(){const e=(i,s)=>{const n={},r={axes:{},...bd.getThemeTemplates(),...this.getChartDefaults(),...xd.get(i)};for(const o of s){n[o]=gt(Ei.getThemeTemplate(o),n[o]??Ft(r));const{axes:a}=n[o];for(const l of Hn.keys())a[l]=gt(a[l],Hn.getThemeTemplate(l),dl.axisDefault[l])}return n};return gt(e("cartesian",Yt.cartesianTypes),e("polar",Yt.polarTypes),e("hierarchy",Yt.hierarchyTypes),e("topology",Yt.topologyTypes),e("flow-proportion",Yt.flowProportionTypes),e("standalone",Yt.standaloneTypes),e("gauge",Yt.gaugeTypes))}static applyTemplateTheme(e,i,s){if((0,bv.isArray)(e))for(let n=0;n<e.length;n++){const r=e[n];typeof r=="symbol"&&s?.has(r)&&(e[n]=s.get(r))}else for(const n of Object.keys(e)){const r=e[n];typeof r=="symbol"&&s?.has(r)&&(e[n]=s.get(r))}}templateTheme(e,i=!0){const s=i?Ft(e):e,n=this.getTemplateParameters();return ks(s,dl.applyTemplateTheme,void 0,void 0,n),s}getDefaultColors(){return dl.getDefaultColors()}getPublicParameters(){return dl.getDefaultPublicParameters()}getTemplateParameters(){const{isEnterprise:e}=Zs,i=new Map;i.set(ho,!1),i.set(gp,e),i.set(pp,!e),i.set(Ta,"#d9d9d9"),i.set(Sn,"#00000080"),i.set(Yc,"#aaa"),i.set(Dn,"block"),i.set(In,"center"),i.set(Ea,["#797b86","#e24c4a","#f49d2d","#65ab58","#409682","#4db9d2","#5090dc","#3068f9","#e24c4a","#913aac","#d93e64"]),i.set(Uc,pg),i.set(Qt,se.BLUE),i.set(he,se.BLUE),i.set(Oa,se.BLUE),i.set(Ra,pg),i.set(Pa,"#fafafa"),i.set(_a,"#ddd"),i.set(ja,"#000"),i.set(Fa,"#181d1f"),i.set(za,"#e35c5c"),i.set(Ba,"#e35c5c"),i.set(Ga,"#fafafa"),i.set(Va,"#ddd"),i.set(Ua,"#000"),i.set(Ya,"top"),i.set(ys,!1);const s=this.getDefaultColors();return i.set(zc,this.palette.up?.stroke??s.up.stroke),i.set(ka,this.palette.up?.fill??s.up.fill),i.set(Bc,this.palette.down?.stroke??s.down.stroke),i.set(wa,this.palette.down?.fill??s.down.fill),i.set(uo,this.palette.neutral?.stroke??s.neutral.stroke),i.set(Gc,this.palette.neutral?.fill??s.neutral.fill),i.set(fp,this.palette.altUp?.stroke??s.up.stroke),i.set(yp,this.palette.altUp?.fill??s.up.fill),i.set(mp,this.palette.altDown?.stroke??s.down.stroke),i.set(bp,this.palette.altDown?.fill??s.down.fill),i.set(xp,this.palette.altNeutral?.fill??s.altNeutral.fill),i.set(Vc,this.palette.altNeutral?.stroke??s.altNeutral.stroke),i}};zi.axisDefault={number:zi.getAxisDefaults({keys:[],line:{enabled:!1},crosshair:{enabled:!0}}),log:zi.getAxisDefaults({keys:[],base:10,line:{enabled:!1},crosshair:{enabled:!0}}),category:zi.getAxisDefaults({keys:[],groupPaddingInner:.1,label:{autoRotate:!0},gridLine:{enabled:ys},crosshair:{enabled:!1}}),"grouped-category":zi.getAxisDefaults({keys:[],tick:{enabled:!0,stroke:Ta},label:{spacing:10,rotation:270},paddingInner:.4,groupPaddingInner:.2,crosshair:{enabled:!1}}),time:zi.getAxisDefaults({keys:[],gridLine:{enabled:ys},crosshair:{enabled:!0}}),"ordinal-time":zi.getAxisDefaults({keys:[],groupPaddingInner:0,label:{autoRotate:!1},gridLine:{enabled:ys},crosshair:{enabled:!0}}),"angle-category":zi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:ys},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}},!1),"angle-number":zi.getAxisDefaults({label:{spacing:5},gridLine:{enabled:ys}},!1),"radius-category":zi.getAxisDefaults({positionAngle:0,line:{enabled:!1}}),"radius-number":zi.getAxisDefaults({positionAngle:0,line:{enabled:!1},shape:{$path:["./shape",void 0,{$find:[{$not:[{$isOperation:"./shape"}]},{$path:".."}]}]}})};var ss=zi,fg="#192232",_e={BLUE:"#5090dc",ORANGE:"#ffa03a",GREEN:"#459d55",CYAN:"#34bfe1",YELLOW:"#e1cc00",VIOLET:"#9669cb",GRAY:"#b5b5b5",MAGENTA:"#bd5aa7",BROWN:"#8a6224",RED:"#ef5452"},hr={BLUE:"#74a8e6",ORANGE:"#ffbe70",GREEN:"#6cb176",CYAN:"#75d4ef",YELLOW:"#f6e559",VIOLET:"#aa86d8",GRAY:"#a1a1a1",MAGENTA:"#ce7ab9",BROWN:"#997b52",RED:"#ff7872"},Do=class extends ss{getDefaultColors(){return{fills:_e,fillsFallback:Object.values(_e),strokes:hr,sequentialColors:Si(_e),divergingColors:[_e.ORANGE,_e.YELLOW,_e.GREEN],hierarchyColors:["#192834","#253746","#324859","#3f596c","#4d6a80"],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[_e.GREEN,_e.YELLOW,_e.RED],secondHierarchyColors:["#192834","#3b5164","#496275","#577287","#668399"],up:{fill:_e.GREEN,stroke:hr.GREEN},down:{fill:_e.RED,stroke:hr.RED},neutral:{fill:_e.GRAY,stroke:hr.GRAY},altUp:{fill:_e.BLUE,stroke:hr.BLUE},altDown:{fill:_e.ORANGE,stroke:hr.ORANGE},altNeutral:{fill:_e.GRAY,stroke:hr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),axisColor:{$foregroundBackgroundMix:[.263]},backgroundColor:fg,borderColor:{$foregroundBackgroundMix:[.784]},chromeBackgroundColor:{$foregroundBackgroundMix:[.93]},foregroundColor:"#fff",gridLineColor:{$foregroundBackgroundAccentMix:[.743,.01]},subtleTextColor:{$mix:[{$ref:"textColor"},{$ref:"backgroundColor"},.57]},chromeTextColor:{$ref:"textColor"},crosshairLabelBackgroundColor:{$foregroundBackgroundAccentMix:[.35,.1]}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(ho,!0),t.set(Uc,fg),t.set(Ta,"#7f8389"),t.set(Qt,_e.BLUE),t.set(Oa,"#fff"),t.set(he,_e.BLUE),t.set(Ra,fg),t.set(Pa,"#28313e"),t.set(_a,"#4b525d"),t.set(ja,"#fff"),t.set(Fa,"#fff"),t.set(Ga,"#28313e"),t.set(Va,"#4b525d"),t.set(Ua,"#fff"),t}constructor(t){super(t)}},li={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},ur={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},cE=class extends Do{getDefaultColors(){return{...super.getDefaultColors(),fills:{...li},fillsFallback:Object.values({...li}),strokes:{...ur},sequentialColors:Si(li),divergingColors:[li.GREEN,li.BLUE,li.RED],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],up:{fill:li.GREEN,stroke:ur.GREEN},down:{fill:li.RED,stroke:ur.RED},neutral:{fill:li.BLUE,stroke:ur.BLUE},altUp:{fill:li.GREEN,stroke:ur.GREEN},altDown:{fill:li.RED,stroke:ur.RED},altNeutral:{fill:li.GRAY,stroke:ur.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.88,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,li.BLUE),t.set(he,li.BLUE),t.set(Dn,"overlay"),t.set(In,"left"),t.set(Ya,"bottom"),t.set(ys,!0),t}},ci={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#A9A9A9"},dr={GREEN:"#089981",RED:"#F23645",BLUE:"#5090dc",GRAY:"#909090"},hE=class extends ss{getDefaultColors(){return{...super.getDefaultColors(),fills:{...ci},fillsFallback:Object.values({...ci}),strokes:{...dr},sequentialColors:Si(ci),divergingColors:[ci.GREEN,ci.BLUE,ci.RED],up:{fill:ci.GREEN,stroke:dr.GREEN},down:{fill:ci.RED,stroke:dr.RED},neutral:{fill:ci.BLUE,stroke:dr.BLUE},altUp:{fill:ci.GREEN,stroke:dr.GREEN},altDown:{fill:ci.RED,stroke:dr.RED},altNeutral:{fill:ci.GRAY,stroke:dr.GRAY}}}getPublicParameters(){return{...super.getPublicParameters(),gridLineColor:{$foregroundBackgroundAccentMix:[.94,.01]},padding:0}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,ci.BLUE),t.set(he,ci.BLUE),t.set(Dn,"overlay"),t.set(In,"left"),t.set(Ya,"bottom"),t.set(ys,!0),t}},je={BLUE:"#2196F3",ORANGE:"#FF9800",GREEN:"#4CAF50",CYAN:"#00BCD4",YELLOW:"#FFEB3B",VIOLET:"#7E57C2",GRAY:"#9E9E9E",MAGENTA:"#F06292",BROWN:"#795548",RED:"#F44336"},pr={BLUE:"#90CAF9",ORANGE:"#FFCC80",GREEN:"#A5D6A7",CYAN:"#80DEEA",YELLOW:"#FFF9C4",VIOLET:"#B39DDB",GRAY:"#E0E0E0",MAGENTA:"#F48FB1",BROWN:"#A1887F",RED:"#EF9A9A"},uE=class extends Do{getDefaultColors(){return{...super.getDefaultColors(),fills:je,fillsFallback:Object.values(je),strokes:pr,sequentialColors:Si(je),divergingColors:[je.ORANGE,je.YELLOW,je.GREEN],secondSequentialColors:["#2196f3","#208FEC","#1E88E5","#1C7FDC","#1976d2","#176EC9","#1565c0"],secondDivergingColors:[je.GREEN,je.YELLOW,je.RED],up:{fill:je.GREEN,stroke:pr.GREEN},down:{fill:je.RED,stroke:pr.RED},neutral:{fill:je.GRAY,stroke:pr.GRAY},altUp:{fill:je.BLUE,stroke:pr.BLUE},altDown:{fill:je.RED,stroke:pr.RED},altNeutral:{fill:je.GRAY,stroke:pr.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,je.BLUE),t.set(he,je.BLUE),t}},Fe={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"},dE=class extends ss{getDefaultColors(){return{...super.getDefaultColors(),fills:Fe,fillsFallback:Object.values(Fe),strokes:gr,sequentialColors:Si(Fe),divergingColors:[Fe.ORANGE,Fe.YELLOW,Fe.GREEN],secondSequentialColors:["#2196f3","#329EF4","#42a5f5","#53ADF6","#64b5f6","#7AC0F8","#90caf9"],secondDivergingColors:[Fe.GREEN,Fe.YELLOW,Fe.RED],up:{fill:Fe.GREEN,stroke:gr.GREEN},down:{fill:Fe.RED,stroke:gr.RED},neutral:{fill:Fe.GRAY,stroke:gr.GRAY},altUp:{fill:Fe.BLUE,stroke:gr.BLUE},altDown:{fill:Fe.RED,stroke:gr.RED},altNeutral:{fill:Fe.GRAY,stroke:gr.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,Fe.BLUE),t.set(he,Fe.BLUE),t}},Jt={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},fr={BLUE:"#6698ff",PURPLE:"#c0a3ff",MAGENTA:"#fc8dfc",PINK:"#ff82b1",RED:"#ff9b70",ORANGE:"#ffcf4e",YELLOW:"#ffff58",GREEN:"#58dd70",CYAN:"#51e2c9",MODERATE_BLUE:"#4fd7ff",GRAY:"#eeeeee"},pE=class extends Do{getDefaultColors(){return{fills:Jt,fillsFallback:Object.values(Jt),strokes:fr,sequentialColors:Si(Jt),divergingColors:[Jt.BLUE,Jt.RED],hierarchyColors:[],secondSequentialColors:[Jt.BLUE,Jt.PURPLE,Jt.MAGENTA,Jt.PINK,Jt.RED,Jt.ORANGE,Jt.YELLOW,Jt.GREEN],secondDivergingColors:[Jt.BLUE,Jt.RED],secondHierarchyColors:[],up:{fill:Jt.GREEN,stroke:fr.GREEN},down:{fill:Jt.RED,stroke:fr.RED},neutral:{fill:Jt.GRAY,stroke:fr.GRAY},altUp:{fill:Jt.BLUE,stroke:fr.BLUE},altDown:{fill:Jt.RED,stroke:fr.RED},altNeutral:{fill:Jt.GRAY,stroke:fr.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,Jt.BLUE),t.set(he,Jt.BLUE),t}},te={BLUE:"#436ff4",PURPLE:"#9a7bff",MAGENTA:"#d165d2",PINK:"#f0598b",RED:"#f47348",ORANGE:"#f2a602",YELLOW:"#e9e201",GREEN:"#21b448",CYAN:"#00b9a2",MODERATE_BLUE:"#00aee4",GRAY:"#bbbbbb"},mr={BLUE:"#2346c9",PURPLE:"#7653d4",MAGENTA:"#a73da9",PINK:"#c32d66",RED:"#c84b1c",ORANGE:"#c87f00",YELLOW:"#c1b900",GREEN:"#008c1c",CYAN:"#00927c",MODERATE_BLUE:"#0087bb",GRAY:"#888888"},gE=class extends ss{getDefaultColors(){return{...super.getDefaultColors(),fills:te,fillsFallback:Object.values(te),strokes:mr,sequentialColors:Si(te),divergingColors:[te.BLUE,te.RED],hierarchyColors:[],secondSequentialColors:[te.BLUE,te.PURPLE,te.MAGENTA,te.PINK,te.RED,te.ORANGE,te.YELLOW,te.GREEN],secondDivergingColors:[te.BLUE,te.RED],secondHierarchyColors:[],up:{fill:te.GREEN,stroke:mr.GREEN},down:{fill:te.RED,stroke:mr.RED},neutral:{fill:te.GRAY,stroke:mr.GRAY},altUp:{fill:te.BLUE,stroke:mr.BLUE},altDown:{fill:te.RED,stroke:mr.RED},altNeutral:{fill:te.GRAY,stroke:mr.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,te.BLUE),t.set(he,te.BLUE),t}},pe={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"},fE=class extends Do{getDefaultColors(){return{...super.getDefaultColors(),fills:{...pe,RED:pe.ORANGE},fillsFallback:Object.values({...pe,RED:pe.ORANGE}),strokes:{...kn,RED:kn.ORANGE},sequentialColors:Si({...pe,RED:pe.ORANGE}),divergingColors:[pe.ORANGE,pe.YELLOW,pe.GREEN],secondSequentialColors:["#5090dc","#4882c6","#4073b0","#38659a","#305684","#28486e","#203a58","#182b42"],secondDivergingColors:[pe.GREEN,pe.YELLOW,pe.ORANGE],up:{fill:pe.GREEN,stroke:kn.GREEN},down:{fill:pe.ORANGE,stroke:kn.ORANGE},neutral:{fill:pe.GRAY,stroke:kn.GRAY},altUp:{fill:pe.BLUE,stroke:kn.BLUE},altDown:{fill:pe.ORANGE,stroke:kn.ORANGE},altNeutral:{fill:pe.GRAY,stroke:kn.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,pe.BLUE),t.set(he,pe.BLUE),t}},Se={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"},qs={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"},mE=class extends ss{getDefaultColors(){return{...super.getDefaultColors(),fills:{...Se,RED:Se.ORANGE},fillsFallback:Object.values({...Se,RED:Se.ORANGE}),strokes:{...qs,RED:qs.ORANGE},sequentialColors:Si({...Se,RED:Se.ORANGE}),divergingColors:[Se.ORANGE,Se.YELLOW,Se.GREEN],secondSequentialColors:["#5090dc","#629be0","#73a6e3","#85b1e7","#96bcea","#a8c8ee","#b9d3f1","#cbdef5"],secondDivergingColors:[Se.GREEN,Se.YELLOW,Se.ORANGE],secondHierarchyColors:[],up:{fill:Se.GREEN,stroke:qs.GREEN},down:{fill:Se.ORANGE,stroke:qs.ORANGE},neutral:{fill:qs.GRAY,stroke:qs.GRAY},altUp:{fill:Se.BLUE,stroke:qs.BLUE},altDown:{fill:Se.ORANGE,stroke:qs.ORANGE},altNeutral:{fill:Se.GRAY,stroke:qs.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,Se.BLUE),t.set(he,Se.BLUE),t}},ze={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},yr={BLUE:"#67b7ff",ORANGE:"#ffc24d",GREEN:"#5cc86f",CYAN:"#54ebff",VIOLET:"#fff653",YELLOW:"#c18aff",GRAY:"#aeaeae",MAGENTA:"#f078d4",BROWN:"#ba8438",RED:"#ff726e"},yE=class extends Do{getDefaultColors(){return{fills:ze,fillsFallback:Object.values(ze),strokes:yr,sequentialColors:Si(ze),divergingColors:[ze.ORANGE,ze.YELLOW,ze.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#0076e6","#0069cc","#005cb3","#004f99","#004280","#003466","#00274c"],secondDivergingColors:[ze.GREEN,ze.YELLOW,ze.RED],secondHierarchyColors:[],up:{fill:ze.GREEN,stroke:yr.GREEN},down:{fill:ze.RED,stroke:yr.RED},neutral:{fill:ze.GRAY,stroke:yr.GRAY},altUp:{fill:ze.BLUE,stroke:yr.BLUE},altDown:{fill:ze.ORANGE,stroke:yr.ORANGE},altNeutral:{fill:ze.GRAY,stroke:yr.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,ze.BLUE),t.set(he,ze.BLUE),t}},Be={BLUE:"#0083ff",ORANGE:"#ff6600",GREEN:"#00af00",CYAN:"#00ccff",YELLOW:"#f7c700",VIOLET:"#ac26ff",GRAY:"#a7a7b7",MAGENTA:"#e800c5",BROWN:"#b54300",RED:"#ff0000"},br={BLUE:"#0f68c0",ORANGE:"#d47100",GREEN:"#007922",CYAN:"#009ac2",VIOLET:"#bca400",YELLOW:"#753cac",GRAY:"#646464",MAGENTA:"#9b2685",BROWN:"#6c3b00",RED:"#cb0021"},bE=class extends ss{getDefaultColors(){return{...super.getDefaultColors(),fills:Be,fillsFallback:Object.values(Be),strokes:br,sequentialColors:Si(Be),divergingColors:[Be.ORANGE,Be.YELLOW,Be.GREEN],hierarchyColors:[],secondSequentialColors:["#0083ff","#1a8fff","#339cff","#4da8ff","#66b5ff","#80c1ff","#99cdff","#b3daff"],secondDivergingColors:[Be.GREEN,Be.YELLOW,Be.RED],secondHierarchyColors:[],up:{fill:Be.GREEN,stroke:br.GREEN},down:{fill:Be.RED,stroke:br.RED},neutral:{fill:Be.GRAY,stroke:br.GRAY},altUp:{fill:Be.BLUE,stroke:br.BLUE},altDown:{fill:Be.ORANGE,stroke:br.ORANGE},altNeutral:{fill:Be.GRAY,stroke:br.GRAY}}}getTemplateParameters(){const t=super.getTemplateParameters();return t.set(Qt,Be.BLUE),t.set(he,Be.BLUE),t}},Io=ti(()=>new ss),xE=ti(()=>new Do),vE=vt.create(!0,"perf"),ns=(t,e,i)=>{vE("[CACHE] ChartTheme",t,e.name,i)},mg={"ag-default-dark":xE,"ag-sheets-dark":ti(()=>new fE,ns),"ag-polychroma-dark":ti(()=>new pE,ns),"ag-vivid-dark":ti(()=>new yE,ns),"ag-material-dark":ti(()=>new uE,ns),"ag-financial-dark":ti(()=>new cE,ns),null:Io,undefined:Io,"ag-default":Io,"ag-sheets":ti(()=>new mE,ns),"ag-polychroma":ti(()=>new gE,ns),"ag-vivid":ti(()=>new bE,ns),"ag-material":ti(()=>new dE,ns),"ag-financial":ti(()=>new hE,ns)},Lh=ti(ME,ns);function ME(t){if(t instanceof ss)return t;if(t==null||typeof t=="string"){const i=mg[t];return i?i():(at.Logger.warnOnce(`the theme [${t}] is invalid, using [ag-default] instead.`),Io())}const{errors:e}=(0,at.validate)(t,Mv,"theme");if(!e.length){const i=SE(t),s=i.baseTheme?Lh(i.baseTheme):Io();return new s.constructor(i)}for(const{message:i}of e)at.Logger.warnOnce(i);return Io()}function SE(t){let e=t,i,s;const n=[];for(;typeof e=="object";)i??(i=e.palette),s??(s=e.params),e.overrides&&n.push(e.overrides),e=e.baseTheme;return{baseTheme:e,overrides:gt(...n),params:s,palette:i}}var Mv={baseTheme:(0,at.or)(at.string,at.object),overrides:at.object,params:{accentColor:at.color,axisColor:at.color,backgroundColor:at.color,borderColor:at.color,foregroundColor:at.color,fontFamily:at.string,fontSize:at.number,fontWeight:(0,at.or)(at.string,at.number),gridLineColor:at.color,padding:at.number,subtleTextColor:at.color,textColor:at.color,chromeBackgroundColor:at.color,chromeFontFamily:at.string,chromeFontSize:at.number,chromeFontWeight:(0,at.or)(at.string,at.number),chromeSubtleTextColor:at.color,chromeTextColor:at.color,inputBackgroundColor:at.color,inputTextColor:at.color,crosshairLabelBackgroundColor:at.color,crosshairLabelTextColor:at.color},palette:{fills:(0,at.arrayOf)(at.colorUnion),strokes:(0,at.arrayOf)(at.color),up:{fill:(0,at.or)(at.color,at.gradientStrict),stroke:at.color},down:{fill:(0,at.or)(at.color,at.gradientStrict),stroke:at.color},neutral:{fill:(0,at.or)(at.color,at.gradientStrict),stroke:at.color}}},Sv=t=>`'${t}'`,Ao=class ce{constructor(e,i,s,n,r,o,a=!1){this.themeParameters={},this.optionMetadata=r??{},this.processedOverrides=s??{};let l=null;e instanceof ce?(l=e,this.specialOverrides=l.specialOverrides,o===void 0&&(o=ps(l.userOptions,i,ce.JSON_DIFF_OPTS)),this.userOptions=Ft(Yo(o,l.userOptions),ce.OPTIONS_CLONE_OPTS)):(this.userOptions=Ft(e??i,ce.OPTIONS_CLONE_OPTS),this.specialOverrides=this.specialOverridesDefaults({...n})),a&&this.removeLeftoverSymbols(this.userOptions);let c,h,u,d,p,f;!a&&o!==void 0&&ce.isFastPathDelta(o)&&l!=null?({activeTheme:c,processedOptions:h,defaultAxes:u,fastDelta:d}=this.fastSetup(o,l),p=l.themeParameters,f=l.annotationThemes):(ce.perfDebug("ChartOptions.slowSetup()"),{activeTheme:c,processedOptions:h,defaultAxes:u,themeParameters:p,annotationThemes:f}=this.slowSetup(s,o,a)),this.activeTheme=c,this.processedOptions=h,this.defaultAxes=u,this.fastDelta=d??void 0,this.themeParameters=p,this.annotationThemes=f,vt.inDevelopmentMode(()=>jn(this))}static isFastPathDelta(e){for(const i of Object.keys(e??{}))if(!this.FAST_PATH_OPTIONS.has(i))return ce.perfDebug("ChartOptions.isFastPathDelta() - slow path required due to presence of: ",i),!1;return ce.perfDebug("ChartOptions.isFastPathDelta() - fast path possible."),!0}fastSetup(e,i){const{activeTheme:s,defaultAxes:n,processedOptions:r}=i,{presetType:o}=this.optionMetadata,a=o?rE[o]:void 0;if(o!=null&&e?.data!=null&&a!=null){const{series:c,data:h}=a(e.data);e=gt({series:c,data:h},e)}this.fastSeriesSetup(e,r);const l=gt(e,r);return ce.debug("ChartOptions.fastSetup() - processed options",l),{activeTheme:s,defaultAxes:n,processedOptions:l,fastDelta:e}}fastSeriesSetup(e,i){e?.series&&(e.series?.every((s,n)=>Mm(s,i.series?.[n]??{}))?delete e.series:e.series=e.series.map((s,n)=>Yo(s,i.series?.[n]??{})))}slowSetup(e,i,s=!1){let n=Ft(this.userOptions,ce.OPTIONS_CLONE_OPTS);i&&(n=gt(i,n),s&&this.removeLeftoverSymbols(n));const{presetType:r}=this.optionMetadata;if(r!=null){const v=nE[r],S=n,M=n.type,D=M!=null?Lh(n.theme).presets[M]:void 0;ce.debug(">>> AgCharts.createOrUpdate() - applying preset",S),n=v?.(S,D,()=>this.activeTheme)??n}this.soloSeriesIntegrity(n),Zs.isEnterprise||yv(n);const o=Lh(n.theme);if(r!=null&&o.templateTheme(n,!1),this.validateSeriesOptions(n),this.chartDef=rt.ModuleRegistry.detectChartDefinition(n),!this.chartDef.placeholder){const{valid:v,errors:S}=(0,rt.validate)(n,this.chartDef.options);S.forEach(M=>rt.Logger.warn(M)),n=v}this.validatePluginOptions(n),this.validateAxesOptions(n),this.removeDisabledOptions(n);const a=this.optionsType(n),{annotations:l={},axes:c={},series:h,...u}=this.getSeriesThemeConfig(a,o),[d,p]=this.splitAnnotationsOptions(l),f=Ft(p),y=this.getDefaultAxes(n,h);let x=gt(e,n,d,u,y);this.processAxesOptions(x,c),this.processSeriesOptions(x,o),x=Ft(x,ce.OPTIONS_CLONE_OPTS),(Fd(x)||zd(x)||aN(x))&&x.legend?.enabled==null&&(x.legend??(x.legend={}),x.legend.enabled=x.series.length>1),this.enableConfiguredOptions(x,n);const m=this.getThemeParameters(o,x);return m.__palette=Ft(o.palette),m.__palette.type=(0,rt.isObject)(n.theme)?xv(n.theme?.palette):"inbuilt",this.resolveThemeOperations(m,m),this.resolveThemeOperations(m,x),this.resolveThemeOperations(m,f),this.processMiniChartSeriesOptions(x),o.templateTheme(x,!1),oE(x),Zs.isEnterprise||yv(x,!0),this.validateSeriesOptions(x),this.validateAxesOptions(x),ce.debug(()=>["ChartOptions.slowSetup() - processed options",Ft(x)]),{activeTheme:o,processedOptions:x,defaultAxes:y,themeParameters:m,annotationThemes:f}}validatePluginOptions(e){for(const i of rt.ModuleRegistry.listModulesByType(rt.ModuleType.Plugin)){const s=i.name;if(s in e&&(!i.chartType||i.chartType===this.chartDef?.name)){const{valid:n,errors:r}=(0,rt.validate)(e[s],i.options,i.name);r.forEach(o=>rt.Logger.warn(o)),e[s]=n}}}validateSeriesOptions(e){const i=this.chartDef?.name,s=[],n=e.series?.length??0;let r;for(let o=0;o<n;o++){const a=`series[${o}]`,l=e.series[o],c=rt.ModuleRegistry.getSeriesModule(l.type??"line");if(c==null){r??(r=(0,rt.joinFormatted)(Array.from(rt.ModuleRegistry.listModulesByType(rt.ModuleType.Series)).filter(p=>!i||p.chartType===i).map(p=>p.name),"or",Sv)),rt.Logger.warn(`Unknown type \`${l.type}\` at \`${a}.type\`; expecting ${r}, ignoring.`);continue}else if(i&&c.chartType!==i){rt.Logger.warn(`Series type \`${c.name}\` at \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);continue}const{validate:h=rt.validate}=c,{valid:u,errors:d}=h(l,c.options,a);d.forEach(p=>rt.Logger.warn(p)),d.some(p=>p.required&&p.path===a)||s.push(u)}e.series=s}validateAxesOptions(e){if(!("axes"in e)||!e.axes)return;const i=this.chartDef?.name,s=[],n=e.axes.length??0;let r;for(let o=0;o<n;o++){const a=`axes[${o}]`,l=e.axes[o],c=rt.ModuleRegistry.getAxisModule(l.type);if(c==null){r??(r=(0,rt.joinFormatted)(Array.from(rt.ModuleRegistry.listModulesByType(rt.ModuleType.Axis)).filter(p=>p.chartType===i).map(p=>p.name),"or",Sv)),rt.Logger.warn(`Unknown type \`${l.type}\` at  \`${a}.type\`; expecting one of ${r}, ignoring all axes options.`),delete e.axes;break}else if(c.chartType!==i){rt.Logger.warn(`Axis type \`${c.name}\` at  \`${a}.type\` is not supported by chart type \`${i}\`, ignoring.`);break}const{validate:h=rt.validate}=c,{valid:u,errors:d}=h(l,c.options,a);d.forEach(p=>rt.Logger.warn(p)),d.some(p=>p.required&&p.path===a)||s.push(u)}e.axes=s}diffOptions(e){return this===e?{}:e==null?this.processedOptions:this.fastDelta??ps(e.processedOptions,this.processedOptions,ce.JSON_DIFF_OPTS)}getSeriesThemeConfig(e,i){return i?.config[e]??{}}getDefaultAxes(e,i){const s=this.optionsType(e),n=e.series?.find(o=>(o.type??"line")===s)??{},r=Ei.cloneDefaultAxes(s);return Zl(r,{},void 0,gt(n,i)),r}optionsType(e){return e.series?.[0]?.type??"line"}splitAnnotationsOptions(e){const{axesButtons:i=null,enabled:s=null,optionsToolbar:n=null,toolbar:r=null,...o}=e;return i==null&&s==null&&n==null&&r==null?[{},o]:[{annotations:{axesButtons:i,enabled:s,optionsToolbar:n,toolbar:r}},o]}processAxesOptions(e,i){"axes"in e&&(e.axes=e.axes?.map(s=>{const{crossLines:n,...r}=gt(i[s.type]?.[s.position],i[s.type]);s.crossLines&&(s.crossLines=wl(s.crossLines,n));const o=r.gridLine?.style;s.gridLine?.style&&o?.length&&(s.gridLine.style=s.gridLine.style.map((d,p)=>d.stroke!=null||d.lineDash!=null?gt(d,o.at(p%o.length)):d));const{top:a,right:l,bottom:c,left:h,...u}=gt(s,r);return u}))}processSeriesOptions(e,i){const s=this.getTooltipPositionDefaults(e),n=e.series?.map(r=>{r.type??(r.type="line");const{innerLabels:o,...a}=this.getSeriesThemeConfig(r.type,i).series??{},l=rt.ModuleRegistry.getSeriesModule(r.type),c=!!l?.options.tooltip,h=!!l?.options.visible,u=c&&this.getTooltipRangeDefaults(e,r.type),d=gt(this.getSeriesGroupingOptions(r),r,c&&s,u,a,h&&{visible:!0});return d.innerLabels&&(d.innerLabels=wl(d.innerLabels,o)),d});e.series=this.setSeriesGroupingOptions(n??[])}processMiniChartSeriesOptions(e){let i=e.navigator?.miniChart?.series;i!=null&&(i=i.map(s=>(s.type??(s.type="line"),s)),e.navigator.miniChart.series=this.setSeriesGroupingOptions(i))}getThemeParameters(e,i){const s=e.getPublicParameters();if(!(0,rt.isPlainObject)(i.theme)||!i.theme.params)return s;const{valid:n,errors:r}=(0,rt.validate)(i.theme.params,Mv.params);for(const{message:o}of r)rt.Logger.warnOnce(o);return gt(n,s)}resolveThemeOperations(e,i){const s=Zl(i,e,new Set(["palette","data","theme"]));ce.debug("ChartOptions.resolveTheme()",s)}getSeriesGroupingOptions(e){const i=Ei.isGroupable(e.type),s=Ei.isStackable(e.type),n=Ei.isStackedByDefault(e.type);e.grouped&&!i&&rt.Logger.warnOnce(`unsupported grouping of series type "${e.type}".`),(e.stacked||e.stackGroup)&&!s&&rt.Logger.warnOnce(`unsupported stacking of series type "${e.type}".`);let{grouped:r,stacked:o}=e;return o??(o=(n||e.stackGroup!=null)&&!(i&&r)),r??(r=!0),{stacked:s&&o,grouped:i&&r&&!(s&&o)}}setSeriesGroupingOptions(e){const i=this.getSeriesGrouping(e);ce.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(e){return[e.type,e.xKey,e.stacked?e.stackGroup??"stacked":"grouped"].filter(Boolean).join("-")}getSeriesGrouping(e){const i=new Map;return e.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},[])}getTooltipPositionDefaults(e){const i=e.tooltip?.position;if(!(0,rt.isPlainObject)(i))return;const{type:s,anchorTo:n,placement:r,xOffset:o,yOffset:a}=i,l={};return(0,rt.isString)(s)&&(0,rt.isEnumValue)(lg,s)&&(l.type=s),(0,rt.isString)(n)&&(0,rt.isEnumValue)(og,n)&&(l.anchorTo=n),(0,rt.isString)(r)&&(0,rt.isEnumValue)(ag,r)&&(l.placement=r),(0,rt.isFiniteNumber)(o)&&(l.xOffset=o),(0,rt.isFiniteNumber)(a)&&(l.yOffset=a),{tooltip:{position:l}}}getTooltipRangeDefaults(e,i){return{tooltip:{range:e.tooltip?.range??Ei.getTooltipDefauls(i)?.range}}}soloSeriesIntegrity(e){if(!(0,rt.isArray)(e.series))return;const i=e.series;if(i&&i.length>1&&i.some(s=>Ei.isSolo(s.type))){const s=this.optionsType(e);if(Ei.isSolo(s))rt.Logger.warn(`series[0] of type '${s}' is incompatible with other series types. Only processing series[0]`),e.series=i.slice(0,1);else{const{solo:n,nonSolo:r}=(0,rt.groupBy)(i,a=>Ei.isSolo(a.type)?"solo":"nonSolo"),o=(0,rt.unique)(n.map(a=>a.type)).join(", ");rt.Logger.warn(`Unable to mix these series types with the lead series type: ${o}`),e.series=r}}}static enableConfiguredJsonOptions(e,i){typeof i=="object"&&"enabled"in i&&!i._enabledFromTheme&&e.enabled==null&&(i.enabled=!0)}static cleanupEnabledFromThemeJsonOptions(e){e._enabledFromTheme!=null&&delete e._enabledFromTheme}enableConfiguredOptions(e,i){ks(i,ce.enableConfiguredJsonOptions,new Set(["data","theme"]),e),ks(e,ce.cleanupEnabledFromThemeJsonOptions,new Set(["data","theme"]))}static removeDisabledOptionJson(e){"enabled"in e&&e.enabled===!1&&Object.keys(e).forEach(i=>{i!=="enabled"&&delete e[i]})}removeDisabledOptions(e){ks(e,ce.removeDisabledOptionJson,new Set(["data","theme"]))}static removeLeftoverSymbolsJson(e){if(!(!e||!(0,rt.isObject)(e)))for(const i of Object.keys(e)){const s=e[i];(0,rt.isSymbol)(s)&&delete e[i]}}removeLeftoverSymbols(e){ks(e,ce.removeLeftoverSymbolsJson,new Set(["data"]))}specialOverridesDefaults(e){if(e.window==null?e.window=(0,rt.getWindow)():(0,rt.setWindow)(e.window),e.document==null?e.document=(0,rt.getDocument)():(0,rt.setDocument)(e.document),e.window==null)throw new Error("AG Charts - unable to resolve global window");if(e.document==null)throw new Error("AG Charts - unable to resolve global document");return e}};Ao.OPTIONS_CLONE_OPTS={shallow:new Set(["data","container"]),assign:new Set(["context","theme"])},Ao.JSON_DIFF_OPTS=new Set(["data"]),Ao.perfDebug=vt.create(!0,"perf"),Ao.FAST_PATH_OPTIONS=new Set(["data","width","height","container"]),Ao.debug=vt.create(!0,"opts");var yg=Ao,DE=1e3,bg=class En{constructor(e,i,s,n,r,o=DE){this.name=e,this.buildItem=i,this.releaseItem=s,this.destroyItem=n,this.maxPoolSize=r,this.cleanupTimeMs=o,this.freePool=[],this.busyPool=new Set}static getPool(e,i,s,n,r){return this.pools.has(e)||this.pools.set(e,new En(e,i,s,n,r)),this.pools.get(e)}isFull(){return this.freePool.length+this.busyPool.size>=this.maxPoolSize}hasFree(){return this.freePool.length>0}obtain(e){if(!this.hasFree()&&this.isFull())throw new Error("AG Charts - pool exhausted");let i=this.freePool.pop();return i==null?(i=this.buildItem(e),En.debug(()=>[`Pool[name=${this.name}]: Created instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,i])):En.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 e=this.freePool.pop();if(e==null)throw new Error("AG Charts - pool has no free instances");return En.debug(()=>[`Pool[name=${this.name}]: Re-used instance (${this.freePool.length} / ${this.busyPool.size+1} / ${this.maxPoolSize})`,e]),this.busyPool.add(e),{item:e,release:()=>this.release(e)}}release(e){if(!this.busyPool.has(e))throw new Error("AG Charts - cannot free item from pool which is not tracked as busy.");En.debug(()=>[`Pool[name=${this.name}]: Releasing instance (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]),this.releaseItem(e),this.busyPool.delete(e),this.freePool.push(e),En.debug(()=>[`Pool[name=${this.name}]: Returned instance to free pool (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`,e]);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 e=this.freePool.splice(0);for(const i of e)this.destroyItem(i);En.debug(()=>[`Pool[name=${this.name}]: Cleaned pool of ${e.length} items (${this.freePool.length} / ${this.busyPool.size} / ${this.maxPoolSize})`])}destroy(){this.cleanPool();for(const e of this.busyPool.values())this.destroyItem(e);this.busyPool.clear()}};bg.pools=new Map,bg.debug=vt.create(!0,"pool");var IE=bg;Dl.ModuleRegistry.registerMany(Aw);var Qs=vt.create(!0,"opts"),wn=class{static licenseCheck(t){this.licenseChecked||(this.licenseManager=Zs.licenseManager?.(t),this.licenseManager?.validateLicense(),this.licenseChecked=!0)}static getLicenseDetails(t){return Zs.licenseManager?.({}).getLicenseDetails(t)}static getInstance(t){return Dv.getInstance(t)}static create(t,e){return Qs.group("AgCharts.create()",()=>{t=vt.inDevelopmentMode(()=>jn(Ft(t)))??t,this.licenseCheck(t);const i=Dv.createOrUpdate({userOptions:t,licenseManager:this.licenseManager,optionsMetadata:e});return this.licenseManager?.isDisplayWatermark()&&this.licenseManager&&Zs.injectWatermark?.(i.chart.ctx.domManager,this.licenseManager.getWatermarkMessage()),i})}static createFinancialChart(t){return Qs.group("AgCharts.createFinancialChart()",()=>this.create(t,{presetType:"price-volume"}))}static createGauge(t){return Qs.group("AgCharts.createGauge()",()=>this.create(t,{presetType:"gauge"}))}static __createSparkline(t){return Qs.group("AgCharts.__createSparkline()",()=>{const{pool:e,...i}=t;return this.create(i,{presetType:"sparkline",pool:e??!0,domMode:"minimal"})})}};wn.licenseChecked=!1;var vs=class On{static getInstance(e){const i=Tc.getInstance(e);return i?y0.chartInstances.get(i):void 0}static initialiseModules(){On.initialised||(ng(),Zk(),On.initialised=!0)}static createOrUpdate(e){let{proxy:i}=e;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,stripSymbols:c=!1}=e,h=Zs.styles!=null?[["ag-charts-enterprise",Zs.styles]]:[],{presetType:u}=a;On.initialiseModules(),Qs(()=>[">>> AgCharts.createOrUpdate() user options",Ft(s)]);let d=s;wn.optionsMutationFn&&d&&(d=wn.optionsMutationFn(Ft(d),u),Qs(()=>[">>> AgCharts.createOrUpdate() MUTATED user options",Ft(d)]));const p=this.getPool(a);let f=!1,y,x=i?.chart;x==null&&p?.hasFree()&&(y=p.obtainFree(),x=y.item);const{document:m,window:v,styleContainer:S,...M}=d??{},D=x?.getChartOptions(),C=new yg(D,M,r,{...o,document:m,window:v,styleContainer:S},a,l,c);return(x==null||Dl.ModuleRegistry.detectChartDefinition(C.processedOptions)!==Dl.ModuleRegistry.detectChartDefinition(x.chartOptions.processedOptions))&&(y?.release(),y=this.getPool(C.optionMetadata)?.obtain(C),y?x=y.item:(f=!0,x=On.createChartInstance(C,x))),h.forEach(([L,I])=>{x.ctx.domManager.addStyles(L,I)}),i==null?(i=new y0(x,On.callbackApi,n),i.releaseChart=y?.release):(y||f)&&(i.releaseChart?.(),i.chart=x,i.releaseChart=y?.release),Qs.check()&&typeof window<"u"&&(window.agChartInstances??(window.agChartInstances={}),window.agChartInstances[x.id]=x),x.queuedUserOptions.push(C.userOptions),x.queuedChartOptions.push(C),x.requestFactoryUpdate(L=>{Qs.group(">>>> Chart.applyOptions()",()=>{L.applyOptions(C);const I=L.queuedUserOptions.indexOf(C.userOptions)+1;L.queuedUserOptions.splice(0,I),L.queuedChartOptions.splice(0,I)})}),i}static markRemovedProperties(e,i,s=!1){if(typeof e!="object")return s;for(const n of Object.keys(e))typeof e[n]>"u"&&(Object.assign(e,{[n]:Symbol("UNSET")}),s||(s=!0));return s}static updateUserDelta(e,i){i=Ft(i,yg.OPTIONS_CLONE_OPTS);const s=ks(i,On.markRemovedProperties,new Set(["data"]),void 0,void 0,!1);Qs(()=>[">>> AgCharts.updateUserDelta() user delta",Ft(i)]),On.createOrUpdate({proxy:e,deltaOptions:i,stripSymbols:s})}static createChartInstance(e,i){const s=i?.destroy({keepTransferableResources:!0});return Dl.ModuleRegistry.detectChartDefinition(e.processedOptions).create(e,s)}static getPool(e){if(e.pool===!0)return IE.getPool(e.presetType??"default",this.createChartInstance,this.detachAndClear,this.destroy,1/0)}};vs.caretaker=new Fm(Fr),vs.initialised=!1,vs.callbackApi={caretaker:vs.caretaker,create(t,e,i,s){return vs.createOrUpdate({userOptions:t,processedOverrides:e,specialOverrides:i,optionsMetadata:s})},update(t,e){return vs.createOrUpdate({userOptions:t,proxy:e})},updateUserDelta(t,e){return vs.updateUserDelta(t,e)}},vs.detachAndClear=t=>t.detachAndClear(),vs.destroy=t=>t.destroy();var Dv=vs,xg={};Ci(xg,{Arc:()=>Ms,BBox:()=>B,Caption:()=>Gt,CategoryScale:()=>Sa,Group:()=>it,Line:()=>vi,LinearScale:()=>Ji,Marker:()=>xe,Path:()=>Je,RadialColumnShape:()=>Bi,Rect:()=>Ue,Scene:()=>rc,Sector:()=>Te,Shape:()=>ki,TranslatableGroup:()=>Xe,getRadialColumnWidth:()=>Iv,toRadians:()=>zt});var AE=(w(),k(T)),Ms=class extends Je{constructor(){super(),this.centerX=0,this.centerY=0,this.radius=10,this.startAngle=0,this.endAngle=Math.PI*2,this.counterClockwise=!1,this.type=0,this.restoreOwnStyles()}get fullPie(){return(0,AE.isNumberEqual)(Pt(this.startAngle),Pt(this.endAngle))}updatePath(){const t=this.path;t.clear(),t.arc(this.centerX,this.centerY,this.radius,this.startAngle,this.endAngle,this.counterClockwise),this.type===1?t.closePath():this.type===2&&!this.fullPie&&(t.lineTo(this.centerX,this.centerY),t.closePath())}computeBBox(){return new B(this.centerX-this.radius,this.centerY-this.radius,this.radius*2,this.radius*2)}isPointInPath(t,e){const i=this.getBBox();return this.type!==0&&i.containsPoint(t,e)&&this.path.isPointInPath(t,e)}};Ms.className="Arc",g([ot()],Ms.prototype,"centerX",2),g([ot()],Ms.prototype,"centerY",2),g([ot()],Ms.prototype,"radius",2),g([ot()],Ms.prototype,"startAngle",2),g([ot()],Ms.prototype,"endAngle",2),g([ot()],Ms.prototype,"counterClockwise",2),g([ot()],Ms.prototype,"type",2);var vg=(w(),k(T));function Mg(t,e,i){const s=Math.sqrt(t**2+e**2),r=Math.atan2(e,t)+i;return{x:Math.cos(r)*s,y:Math.sin(r)*s}}var Bi=class extends Je{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(t){}computeBBox(){const{innerRadius:t,outerRadius:e,columnWidth:i}=this,s=this.getRotation(),n=-i/2,r=i/2,o=-e,a=-t;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:f}=Mg(d%2===0?n:r,d<2?o:a,s);l=Math.min(p,l),c=Math.min(f,c),h=Math.max(p,h),u=Math.max(f,u)}return new B(l,c,h-l,u-c)}getRotation(){const{startAngle:t,endAngle:e}=this,i=El(t,e);return Pt(t+i/2+Math.PI/2)}updatePath(){const{isBeveled:t}=this;t?this.updateBeveledPath():this.updateRectangularPath(),this.checkPathDirty()}updateRectangularPath(){const{columnWidth:t,innerRadius:e,outerRadius:i,path:s}=this,n=-t/2,r=t/2,o=-i,a=-e,l=this.getRotation(),c=[[n,a],[n,o],[r,o],[r,a]].map(([h,u])=>Mg(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:t,path:e,outerRadius:i,innerRadius:s,axisInnerRadius:n,axisOuterRadius:r,isRadiusAxisReversed:o}=this,a=(0,vg.isNumberEqual)(s,n),l=Math.asin(t/2/s),c=this.getRotation(),h=(I,N)=>Mg(I,N,c),u=(I,N)=>Math.sqrt(I**2+N**2),d=(I,N)=>N>I?0:Math.sqrt(I**2-N**2),p=(I,N,E)=>E?I<N:I>N,f=a&&!isNaN(l)&&l<Math.PI/6;let y=-t/2,x=t/2;const m=-i,v=-s*(f?Math.cos(l):1),S=p(r,u(s,t/2),!o);if(S){const I=d(r,s);y=-I,x=I}e.clear(!0);const M=h(y,v);e.moveTo(M.x,M.y);const D=(0,vg.isNumberEqual)(s,i),C=p(r,u(i,t/2),!o);if(D&&f)e.arc(0,0,s,Pt(-l-Math.PI/2)+c,Pt(l-Math.PI/2)+c,!1);else if(C){const I=-d(r,t/2),N=d(r,i);if(!S){const E=h(y,I);e.lineTo(E.x,E.y)}if(e.arc(0,0,r,Math.atan2(I,y)+c,Math.atan2(m,-N)+c,!1),!(0,vg.isNumberEqual)(N,0)){const E=h(N,m);e.lineTo(E.x,E.y)}e.arc(0,0,r,Math.atan2(m,N)+c,Math.atan2(I,x)+c,!1)}else{const I=h(y,m),N=h(x,m);e.lineTo(I.x,I.y),e.lineTo(N.x,N.y)}const L=h(x,v);if(e.lineTo(L.x,L.y),f)e.arc(0,0,s,Pt(l-Math.PI/2)+c,Pt(-l-Math.PI/2)+c,!0);else{const I=h(y,v);e.lineTo(I.x,I.y)}e.closePath()}};Bi.className="RadialColumnShape",g([ot()],Bi.prototype,"isBeveled",2),g([ot()],Bi.prototype,"columnWidth",2),g([ot()],Bi.prototype,"startAngle",2),g([ot()],Bi.prototype,"endAngle",2),g([ot()],Bi.prototype,"outerRadius",2),g([ot()],Bi.prototype,"innerRadius",2),g([ot()],Bi.prototype,"axisInnerRadius",2),g([ot()],Bi.prototype,"axisOuterRadius",2),g([ot()],Bi.prototype,"isRadiusAxisReversed",2);function Iv(t,e,i,s,n){const r=El(t,e),o=r*(1-s)/2;if(t+=o,e-=o,r<.001)return 2*i*n;if(r>=2*Math.PI){const p=t+r/2;t=p-Math.PI,e=p+Math.PI}const a=i*Math.cos(t),l=i*Math.sin(t),c=i*Math.cos(e),h=i*Math.sin(e),u=Math.floor(Math.sqrt((a-c)**2+(l-h)**2)),d=2*i*n;return Math.max(1,Math.min(d,u))}var Sg={};Ci(Sg,{ChartTheme:()=>ss,DEFAULT_ANNOTATION_HANDLE_FILL:()=>Ra,DEFAULT_ANNOTATION_STATISTICS_COLOR:()=>ja,DEFAULT_ANNOTATION_STATISTICS_DIVIDER_STROKE:()=>Fa,DEFAULT_ANNOTATION_STATISTICS_DOWN_FILL:()=>za,DEFAULT_ANNOTATION_STATISTICS_DOWN_STROKE:()=>Ba,DEFAULT_ANNOTATION_STATISTICS_FILL:()=>Pa,DEFAULT_ANNOTATION_STATISTICS_STROKE:()=>_a,DEFAULT_CAPTION_ALIGNMENT:()=>In,DEFAULT_CAPTION_LAYOUT_STYLE:()=>Dn,DEFAULT_FIBONACCI_STROKES:()=>Ea,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_BACKGROUND_FILL:()=>he,DEFAULT_FINANCIAL_CHARTS_ANNOTATION_COLOR:()=>Qt,DEFAULT_GRIDLINE_ENABLED:()=>ys,DEFAULT_POLAR_SERIES_STROKE:()=>Uc,DEFAULT_SEPARATION_LINES_COLOUR:()=>Ta,DEFAULT_SHADOW_COLOUR:()=>Sn,DEFAULT_SPARKLINE_CROSSHAIR_STROKE:()=>Yc,DEFAULT_TEXTBOX_COLOR:()=>Ua,DEFAULT_TEXTBOX_FILL:()=>Ga,DEFAULT_TEXTBOX_STROKE:()=>Va,DEFAULT_TEXT_ANNOTATION_COLOR:()=>Oa,DEFAULT_TOOLBAR_POSITION:()=>Ya,IS_COMMUNITY:()=>pp,IS_DARK_THEME:()=>ho,IS_ENTERPRISE:()=>gp,PALETTE_ALT_DOWN_FILL:()=>bp,PALETTE_ALT_DOWN_STROKE:()=>mp,PALETTE_ALT_NEUTRAL_FILL:()=>xp,PALETTE_ALT_NEUTRAL_STROKE:()=>Vc,PALETTE_ALT_UP_FILL:()=>yp,PALETTE_ALT_UP_STROKE:()=>fp,PALETTE_DOWN_FILL:()=>wa,PALETTE_DOWN_STROKE:()=>Bc,PALETTE_NEUTRAL_FILL:()=>Gc,PALETTE_NEUTRAL_STROKE:()=>uo,PALETTE_UP_FILL:()=>ka,PALETTE_UP_STROKE:()=>zc,getChartTheme:()=>Lh,resolveOperation:()=>CE,themeNames:()=>LE,themeSymbols:()=>dp,themes:()=>mg});var LE=Object.keys(mg);function CE(t){const e=ss.getDefaultPublicParameters();e.__palette=ss.getDefaultColors();const i={operation:t};return Zl(i,e),i.operation}var Dg={};Ci(Dg,{Color:()=>Dt,interpolateColor:()=>hy});var Av={};Ci(Av,{AND:()=>ln,ARRAY:()=>zn,ARRAY_OF:()=>ge,AbstractBarSeries:()=>Rx,AbstractBarSeriesProperties:()=>Wp,ActionOnSet:()=>ni,AnchoredPopover:()=>Ov,Animation:()=>gy,AnimationManager:()=>xy,Arc:()=>Ms,Axis:()=>Rd,AxisGroupZIndexMap:()=>Bb,AxisInterval:()=>Zn,AxisLabel:()=>be,AxisTick:()=>to,AxisTickGenerator:()=>Vb,AxisTicks:()=>qE,BBox:()=>B,BBoxValues:()=>Al,BOOLEAN:()=>H,BOOLEAN_ARRAY:()=>sD,Background:()=>ao,BackgroundModule:()=>W0,BandScale:()=>aa,BarSeries:()=>sl,BarSeriesModule:()=>Fx,BaseModuleInstance:()=>Il,BaseProperties:()=>nt,BaseToolbar:()=>Rg,ButtonWidget:()=>ta,COLOR_GRADIENT:()=>hs,COLOR_PATTERN:()=>us,COLOR_STRING:()=>dt,COLOR_STRING_ARRAY:()=>cn,CachedTextMeasurer:()=>Om,CachedTextMeasurerPool:()=>Es,Caption:()=>Gt,CartesianAxis:()=>fa,CartesianSeries:()=>Cn,CartesianSeriesNodeEvent:()=>Dp,CartesianSeriesProperties:()=>Hs,CategoryAxis:()=>tr,CategoryScale:()=>Sa,ChangeDetectableProperties:()=>rp,Chart:()=>Tc,ChartAxisDirection:()=>Bu,ChartEventManager:()=>vy,ChartOptions:()=>yg,ChartUpdateType:()=>da,CollapseMode:()=>dx,Color:()=>Dt,ColorScale:()=>Tr,ConicGradient:()=>Xf,ContextMenuRegistry:()=>My,ContinuousScale:()=>Ct,DATE:()=>du,DATE_ARRAY:()=>nD,DATE_OR_DATETIME_MS:()=>pu,DEFAULT_CARTESIAN_DIRECTION_KEYS:()=>or,DEFAULT_CARTESIAN_DIRECTION_NAMES:()=>ar,DEFAULT_TOOLTIP_CLASS:()=>Ae,DEFAULT_TOOLTIP_DARK_CLASS:()=>r0,DIRECTION:()=>nm,DIRECTION_SWAP_AXES:()=>ex,DOMManager:()=>Xm,DataController:()=>mb,DataModel:()=>gb,DataModelSeries:()=>Sp,DataService:()=>ac,Debug:()=>vt,Deprecated:()=>Jb,DeprecatedAndRenamedTo:()=>LN,DragInterpreter:()=>ky,DraggablePopover:()=>Rv,DropShadow:()=>ts,ExtendedPath2D:()=>Or,FILL_PATTERN_DEFAULTS:()=>An,FONT_SIZE_RATIO:()=>up,FONT_STYLE:()=>Ns,FONT_WEIGHT:()=>Ts,FUNCTION:()=>Ze,FillGradientDefaults:()=>Pi,FillPatternDefaults:()=>qt,FloatingToolbar:()=>r1,GREATER_THAN:()=>Bl,Gradient:()=>Pl,Group:()=>it,GroupedCategoryAxis:()=>nr,HdpiCanvas:()=>Qu,HierarchyNode:()=>$E,HierarchySeries:()=>HE,HierarchySeriesProperties:()=>Ss,HighlightManager:()=>Sy,HighlightProperties:()=>op,HighlightStyle:()=>Ca,INTERACTION_RANGE:()=>Vl,INTERPOLATION_STEP_POSITION:()=>nx,INTERPOLATION_TYPE:()=>sx,Image:()=>No,InteractionManager:()=>yy,InteractionState:()=>my,InterpolationProperties:()=>go,Invalidating:()=>Nr,LABEL_PLACEMENT:()=>mu,LARGEST_KEY_INTERVAL:()=>O0,LESS_THAN:()=>zl,LINE_CAP:()=>rD,LINE_DASH:()=>ds,LINE_JOIN:()=>oD,LINE_STYLE:()=>aD,Label:()=>ye,LayoutElement:()=>Gu,LayoutManager:()=>Pm,LegendMarkerLabel:()=>_i,Line:()=>vi,LineSeries:()=>rl,LineSeriesModule:()=>Yx,LinearGradient:()=>qf,LinearScale:()=>Ji,Listeners:()=>Os,LogScale:()=>np,LonLatBBox:()=>KE,MARKER_SHAPE:()=>ap,MATCHING_CROSSLINE_TYPE:()=>Td,MAX_SPACING:()=>om,MIN_SPACING:()=>rm,Marker:()=>xe,Menu:()=>i1,MercatorScale:()=>ZE,ModuleRegistry:()=>NE.ModuleRegistry,Motion:()=>id,NAN:()=>_l,NODE_UPDATE_STATE_TO_PHASE_MAPPING:()=>Ki,NUMBER:()=>ct,NUMBER_ARRAY:()=>em,NUMBER_OR_NAN:()=>jl,NativeWidget:()=>Vr,NewAreaSeriesModule:()=>Ox,NewBarSeriesModule:()=>zx,NewBubbleSeriesModule:()=>Gx,NewHistogramSeriesModule:()=>Ux,NewLineSeriesModule:()=>Wx,NewScatterSeriesModule:()=>Hx,NiceMode:()=>_b,Node:()=>As,NumberAxis:()=>Us,OBJECT:()=>F,OBJECT_ARRAY:()=>gu,OR:()=>we,OVERFLOW_STRATEGY:()=>cD,ObserveChanges:()=>pn,OrdinalTimeScale:()=>_s,PHASE_METADATA:()=>ia,PHASE_ORDER:()=>Yr,PLACEMENT:()=>hD,PLAIN_OBJECT:()=>Qf,POSITION:()=>fu,POSITION_TOP_COORDINATES:()=>Mc,POSITIVE_NUMBER:()=>j,PREV_NEXT_KEYS:()=>Br,Padding:()=>dn,ParallelStateMachine:()=>OC,Path:()=>Je,PointerEvents:()=>Vf,PolarAxis:()=>So,PolarSeries:()=>yh,PolarZIndexMap:()=>ev,Popover:()=>Og,PropertiesArray:()=>Ho,ProxyInteractionService:()=>sy,ProxyOnWrite:()=>rI,ProxyProperty:()=>kt,ProxyPropertyOnWrite:()=>De,QUICK_TRANSITION:()=>cc,RATIO:()=>It,REAL_NUMBER:()=>Jf,RENDER_TO_OFFSCREEN_CANVAS_THRESHOLD:()=>Hc,RadialColumnShape:()=>Bi,Range:()=>Zi,Rect:()=>Ue,RepeatType:()=>py,Rotatable:()=>Pr,RotatableGroup:()=>ND,RotatableText:()=>Rm,SAFE_FILLS_OPERATION:()=>vp,SAFE_FILL_OPERATION:()=>GT,SAFE_RANGE2_OPERATION:()=>VT,SAFE_STROKE_FILL_OPERATION:()=>Wc,SKIP_JS_BUILTINS:()=>ou,SMALLEST_KEY_INTERVAL:()=>E0,SORT_DOMAIN_GROUPS:()=>R0,STRING:()=>O,STRING_ARRAY:()=>im,Scalable:()=>Du,ScalableGroup:()=>CD,Scene:()=>rc,SceneChangeDetection:()=>G,ScenePathChangeDetection:()=>ot,Sector:()=>Te,SectorBox:()=>Zx,Selection:()=>re,Series:()=>Cc,SeriesContentZIndexMap:()=>qb,SeriesGroupingChangedEvent:()=>Vd,SeriesItemHighlightStyle:()=>Ws,SeriesMarker:()=>Ce,SeriesNodeEvent:()=>ya,SeriesNodePickMode:()=>Qb,SeriesProperties:()=>Mi,SeriesTooltip:()=>Ye,SeriesZIndexMap:()=>Xb,Shape:()=>ki,SimpleTextMeasurer:()=>Fu,SliderWidget:()=>Xu,StateMachine:()=>ga,StateMachineProperty:()=>EC,StopProperties:()=>yu,SvgPath:()=>wg,TEXT_ALIGN:()=>sm,TEXT_WRAP:()=>Gl,TICK_INTERVAL:()=>Pb,TempValidate:()=>b,Text:()=>me,TextUtils:()=>Bt,TextWrapper:()=>zu,ThemeConstants:()=>Z0,ThemeSymbols:()=>dp,TimeScale:()=>qy,Toolbar:()=>s1,ToolbarButtonProperties:()=>cl,ToolbarButtonWidget:()=>Pv,ToolbarWidget:()=>ic,Tooltip:()=>Ri,TooltipManager:()=>uc,TooltipPosition:()=>Bs,Transformable:()=>Kt,TransformableText:()=>jr,Translatable:()=>Gn,TranslatableGroup:()=>Xe,TranslatableLine:()=>Ac,UNION:()=>At,UpdateService:()=>ab,VERTICAL_ALIGN:()=>lD,Validate:()=>eD,Vec2:()=>Lo,Vec4:()=>ua,WIDGET_HTML_EVENTS:()=>Ou,Widget:()=>gs,WidgetEventUtil:()=>ws,ZIndexMap:()=>cy,ZoomManager:()=>nb,accumulateGroup:()=>_0,accumulateStack:()=>j0,accumulatedValue:()=>I0,accumulativeValueProperty:()=>Ia,addHitTestersToQuadtree:()=>Up,adjustLabelPlacement:()=>jx,angleBetween:()=>El,animationValidation:()=>no,applyShapeFillBBox:()=>Lc,applyShapeStyle:()=>Qn,areScalingEqual:()=>fo,area:()=>Qd,autoSizedLabelOptionsDefs:()=>fk,buildFormatter:()=>sa,buildResetPathFn:()=>Rp,calculateDefaultTimeTickFormat:()=>Vy,calculateDerivativeExtrema:()=>xu,calculateDerivativeExtremaXY:()=>um,calculateLabelChartPadding:()=>Lb,calculateLabelTranslation:()=>kd,calculatePlacement:()=>t0,cartesianAxisCrosshairOptions:()=>bo,cartesianAxisLabelOptionsDefs:()=>mo,cartesianAxisOptionsDefs:()=>yo,cartesianChartOptionsDefs:()=>rv,cartesianCrossLineOptionsDefs:()=>kx,checkCrisp:()=>Px,clampArray:()=>ad,clippedRoundRect:()=>_c,collapsedStartingBarPosition:()=>tl,commonAxisLabelOptionsDefs:()=>_p,commonAxisOptionsDefs:()=>ih,commonChartOptionsDefs:()=>ei,commonCrossLineLabelOptionsDefs:()=>Pp,commonCrossLineOptionsDefs:()=>Tx,commonSeriesOptionsDefs:()=>es,compareDates:()=>Ey,computeBarFocusBounds:()=>Kp,computeMarkerFocusBounds:()=>qa,continuousAxisOptions:()=>sh,countExpandingSearch:()=>Ly,createButton:()=>QE,createCheckbox:()=>JE,createDatumId:()=>Le,createDeprecationWarning:()=>Yd,createElementId:()=>ED,createIcon:()=>Tv,createId:()=>fi,createSelect:()=>t1,createTextArea:()=>e1,dateToNumber:()=>Ve,datesSortOrder:()=>cd,datumKeys:()=>yc,datumStylerProperties:()=>fn,deconstructSelectionsOrNodes:()=>hc,deepClone:()=>Ft,deepFreeze:()=>jn,defaultTimeTickFormat:()=>ud,diff:()=>ro,drawCorner:()=>La,drawMarkerUnitPolygon:()=>xa,easing:()=>id,enterpriseModule:()=>Zs,errorBarOptionsDefs:()=>ah,evaluateBezier:()=>Yl,extent:()=>Gs,extractDecoratedProperties:()=>Yf,findMinMax:()=>ne,findQuadtreeMatch:()=>Yp,findRangeExtent:()=>Wr,fixNumericExtent:()=>ri,flowProportionChartOptionsDefs:()=>iw,focusCursorAtEnd:()=>kD,formatNumber:()=>ey,formatPercent:()=>Jm,formatValue:()=>Rs,fromToMotion:()=>Xt,gaugeChartOptionsDefs:()=>sw,generateUUID:()=>su,getAngleRatioRadians:()=>$f,getColorStops:()=>lm,getCrossLineValue:()=>Ib,getDateTicksForInterval:()=>pd,getDatumRefPoint:()=>nd,getElementBBox:()=>xm,getIconClassNames:()=>Kl,getLastFocus:()=>Yu,getMissCount:()=>md,getPath:()=>Cr,getPathComponents:()=>pb,getRadialColumnWidth:()=>Iv,getSequentialColors:()=>Si,getShapeFill:()=>qn,getShapeStyle:()=>ms,groupAccumulativeValueProperty:()=>bn,groupAverage:()=>D0,groupCount:()=>qd,groupStackValueProperty:()=>w0,groupSum:()=>S0,hasNoModifiers:()=>ec,hierarchyChartOptionsDefs:()=>ew,initMenuKeyNav:()=>Ym,initRovingTabIndex:()=>Um,interpolatePoints:()=>Zc,interpolationValidator:()=>Vp,isAgFlowProportionChartOptions:()=>Hb,isAgGaugeChartOptions:()=>Bd,isAgHierarchyChartOptions:()=>Wb,isAgStandaloneChartOptions:()=>zd,isAgTopologyChartOptions:()=>$b,isBetweenAngles:()=>an,isButtonClickEvent:()=>Uu,isContinuous:()=>vc,isDecoratedObject:()=>Uo,isDenseInterval:()=>qr,isGradientFill:()=>Vi,isGradientOrPatternFill:()=>AD,isInputPending:()=>vm,isPatternFill:()=>Bn,isProperties:()=>Ti,isScaleValid:()=>Ha,jsonApply:()=>Qo,jsonDiff:()=>ps,jsonPropertyCompare:()=>Mm,jsonResolveOperations:()=>Zl,jsonWalk:()=>ks,keyProperty:()=>Qi,labelDirectionHandling:()=>Rb,legendSymbolSvg:()=>n0,lineDistanceSquared:()=>Zo,listDecoratedProperties:()=>rn,makeAccessibleClickListener:()=>VI,mapValues:()=>Wf,markerFadeInAnimation:()=>Ka,markerOptionsDefs:()=>Qa,markerScaleInAnimation:()=>wp,markerSwipeScaleInAnimation:()=>Ep,merge:()=>Yo,mergeArrayDefaults:()=>wl,mergeDefaults:()=>gt,midpointStartingBarPosition:()=>Sk,moduleRegistry:()=>ls,motion:()=>a1,nearestSquared:()=>Nl,nearestSquaredInContainer:()=>kS,normaliseGroupTo:()=>Ec,normalisePropertyTo:()=>sr,normalisedExtentWithMetadata:()=>Xd,normalizeAngle180:()=>$o,normalizeAngle360:()=>Pt,normalizeAngle360Inclusive:()=>HS,numberFormatValidator:()=>eh,objectsEqual:()=>cs,objectsEqualWith:()=>ru,pairUpSpans:()=>$a,partialAssign:()=>lu,pathFadeInAnimation:()=>Qc,pathMotion:()=>$c,pathSwipeInAnimation:()=>Op,pickByMatchingAngle:()=>ig,plotAreaPathFill:()=>Lx,plotInterpolatedAreaSeriesFillSpans:()=>qc,plotInterpolatedLinePathStroke:()=>Xc,plotLinePathStroke:()=>Np,polarChartOptionsDefs:()=>ov,predicateWithMessage:()=>Lt,prepareAreaFillAnimationFns:()=>Cx,prepareAreaPathAnimation:()=>Nx,prepareAxisAnimationContext:()=>Ic,prepareAxisAnimationFunctions:()=>jb,prepareBarAnimationFunctions:()=>el,prepareLinePathAnimation:()=>Ax,prepareLinePathPropertyAnimation:()=>kp,prepareLinePathStrokeAnimationFns:()=>Tp,preparePieSeriesAnimationFunctions:()=>lr,range:()=>ha,rangedValueProperty:()=>Jd,resetAxisGroupFn:()=>Fb,resetAxisLabelSelectionFn:()=>Od,resetAxisLineSelectionFn:()=>zb,resetAxisSelectionFn:()=>Ed,resetBarSelectionsFn:()=>il,resetIds:()=>RS,resetLabelFn:()=>$s,resetMarkerFn:()=>Za,resetMarkerPositionFn:()=>Xa,resetMotion:()=>Ie,resetPieSelectionsFn:()=>eg,rowCountProperty:()=>T0,scale:()=>We,sectorBox:()=>Xx,seriesLabelFadeInAnimation:()=>Mt,seriesLabelFadeOutAnimation:()=>Ln,seriesLabelOptionsDefs:()=>Nn,setAttribute:()=>wt,setAttributes:()=>Un,setElementBBox:()=>Hl,setElementStyle:()=>$i,setPath:()=>au,shadowOptionsDefs:()=>Ja,shallowClone:()=>Nu,solveBezier:()=>Wl,sortAndUniqueDates:()=>ld,splitBezier:()=>$l,standaloneChartOptionsDefs:()=>tw,staticFromToMotion:()=>js,stopPageScrolling:()=>Wm,sum:()=>iT,sumValues:()=>wc,toDegrees:()=>KS,toRadians:()=>zt,toolbarButtonOptionsDefs:()=>Gp,tooltipContentAriaLabel:()=>a0,tooltipHtml:()=>h0,tooltipOptionsDefs:()=>Ks,topologyChartOptionsDefs:()=>Jk,trailingAccumulatedValue:()=>A0,trailingAccumulatedValueProperty:()=>oT,updateClipPath:()=>Jc,updateLabelNode:()=>_x,validateCrossLineValue:()=>Ab,valueProperty:()=>mt,visibleRangeIndices:()=>Ay,without:()=>on});var NE=(w(),k(T)),Lv=(w(),k(T)),Lo={add:TE,angle:PE,apply:YE,equal:VE,distance:EE,distanceSquared:OE,from:UE,gradient:jE,intercept:FE,intersectAtX:BE,intersectAtY:zE,length:Ag,lengthSquared:wE,multiply:kE,normalized:RE,origin:Cv,required:WE,rotate:_E,round:GE,sub:Ig};function TE(t,e){return typeof e=="number"?{x:t.x+e,y:t.y+e}:{x:t.x+e.x,y:t.y+e.y}}function Ig(t,e){return typeof e=="number"?{x:t.x-e,y:t.y-e}:{x:t.x-e.x,y:t.y-e.y}}function kE(t,e){return typeof e=="number"?{x:t.x*e,y:t.y*e}:{x:t.x*e.x,y:t.y*e.y}}function Ag(t){return Math.sqrt(t.x*t.x+t.y*t.y)}function wE(t){return t.x*t.x+t.y*t.y}function EE(t,e){const i=Ig(t,e);return Math.sqrt(i.x*i.x+i.y*i.y)}function OE(t,e){const i=Ig(t,e);return i.x*i.x+i.y*i.y}function RE(t){const e=Ag(t);return{x:t.x/e,y:t.y/e}}function PE(t,e){return e==null?Math.atan2(t.y,t.x):Math.atan2(t.y,t.x)-Math.atan2(e.y,e.x)}function _E(t,e,i=Cv()){const s=Ag(t);return{x:i.x+s*Math.cos(e),y:i.y+s*Math.sin(e)}}function jE(t,e,i){const s=e.x-t.x;return(i==null?e.y-t.y:i-e.y-(i-t.y))/s}function FE(t,e,i){return(i==null?t.y:i-t.y)-e*t.x}function zE(t,e,i=0,s){return{x:t===1/0?1/0:(i-e)/t,y:s==null?i:s-i}}function BE(t,e,i=0,s){const n=t===1/0?1/0:t*i+e;return{x:i,y:s==null?n:s-n}}function GE(t,e=2){return{x:(0,Lv.roundTo)(t.x,e),y:(0,Lv.roundTo)(t.y,e)}}function VE(t,e){return t.x===e.x&&t.y===e.y}function UE(t,e){if(typeof t=="number")return{x:t,y:e};if("currentX"in t)return{x:t.currentX,y:t.currentY};if("offsetWidth"in t)return{x:t.offsetWidth,y:t.offsetHeight};if("width"in t)return[{x:t.x,y:t.y},{x:t.x+t.width,y:t.y+t.height}];if("x1"in t)return[{x:t.x1,y:t.y1},{x:t.x2,y:t.y2}];throw new Error(`Values can not be converted into a vector: [${JSON.stringify(t)}] [${e}]`)}function YE(t,e){return t.x=e.x,t.y=e.y,t}function WE(t){return{x:t?.x??0,y:t?.y??0}}function Cv(){return{x:0,y:0}}var Ch=(w(),k(T)),Nv=class Ph{constructor(e,i,s,n,r,o,a,l,c){this.series=e,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(e,i=Ph.Walk.PreOrder){i===Ph.Walk.PreOrder&&e(this),this.children.forEach(s=>{s.walk(e,i)}),i===Ph.Walk.PostOrder&&e(this)}*[Symbol.iterator](){yield this;for(const e of this.children)yield*e}};Nv.Walk={PreOrder:0,PostOrder:1};var $E=Nv,HE=class extends Cc{constructor(t){super({moduleCtx:t,pickModes:[1,0]}),this.colorDomain=[0,0],this.maxDepth=0,this.colorScale=new Tr,this.animationState=new ga("empty",{empty:{update:{target:"ready",action:e=>this.animateEmptyUpdateReady(e)},reset:"empty",skip:"ready"},ready:{updateData:"waiting",clear:"clearing",highlight:e=>this.animateReadyHighlight(e),resize:e=>this.animateReadyResize(e),reset:"empty",skip:"ready"},waiting:{update:{target:"ready",action:e=>this.animateWaitingUpdateReady(e)},reset:"empty",skip:"ready"},clearing:{update:{target:"empty",action:e=>this.animateClearingUpdateEmpty(e)},reset:"empty",skip:"ready"}},()=>this.checkProcessedDataAnimatable())}resetAnimation(t){t==="initial"?this.animationState.transition("reset"):t==="ready"&&this.animationState.transition("skip")}processData(){const{NodeClass:t}=this,{childrenKey:e,sizeKey:i,colorKey:s,colorRange:n}=this.properties;let r=0,o=1/0,a=-1/0;const l=(d,p,f)=>{const y=f.depth!=null?f.depth+1:0,x=e!=null?d[e]:void 0,m=x==null||x.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 t(this,p,d,v,M,S,y,f,[]),x)},c=(d,p)=>{const{datumIndex:f}=d;return p?.forEach((y,x)=>{const m=l(y,f.concat(x),d);d.children.push(m),d.sumSize+=m.sumSize}),d},h=c(new t(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:t}){this.updateSelections(),this.updateNodes();const e=this.getAnimationData();this.checkResize(t)&&this.animationState.transition("resize",e),this.animationState.transition("update",e)}resetAllAnimation(t){this.ctx.animationManager.stopByAnimationGroupId(this.id)}animateEmptyUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateWaitingUpdateReady(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}animateReadyHighlight(t){}animateReadyResize(t){this.resetAllAnimation(t)}animateClearingUpdateEmpty(t){this.ctx.animationManager.skipCurrentBatch(),this.resetAllAnimation(t)}getAnimationData(){return{}}isProcessedDataAnimatable(){return!0}checkProcessedDataAnimatable(){this.isProcessedDataAnimatable()||this.ctx.animationManager.skipCurrentBatch()}getSeriesDomain(){return[NaN,NaN]}getSeriesRange(t,e){return[NaN,NaN]}getLegendData(t){const{colorKey:e,colorName:i,colorRange:s}=this.properties,{id:n,ctx:{legendManager:r},visible:o}=this;return t==="gradient"&&e!=null&&s!=null?[{legendType:"gradient",enabled:o&&r.getItemEnabled({seriesId:n}),seriesId:n,colorName:i,colorRange:s,colorDomain:this.colorDomain}]:[]}getDatumIdFromData(t){return t.datumIndex.join(":")}getDatumId(t){return this.getDatumIdFromData(t)}removeMeIndexPathForIndex(t){return this.datumSelection.at(t+1)?.datum.datumIndex??[]}removeMeIndexForIndexPath(t){for(const{index:e,datum:i}of this.datumSelection)if((0,Ch.arraysEqual)(i.datumIndex,t))return e-1;return 0}pickFocus(t){if(!this.rootNode?.children.length)return;const e=(0,Ch.clamp)(0,t.datumIndex-t.datumIndexDelta,this.datumSelection.length-1),{datumIndexDelta:i,otherIndexDelta:s}=t;let n=this.removeMeIndexPathForIndex(e);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,Ch.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(e+1));if(a!=null)return{datum:o,datumIndex:this.removeMeIndexForIndexPath(n),otherIndex:o.depth,bounds:a,clipFocusBox:!0}}getDatumAriaText(t,e){if(!(t instanceof this.NodeClass)){Ch.Logger.error(`datum is not HierarchyNode: ${JSON.stringify(t)}`);return}return this.ctx.localeManager.t("ariaAnnounceHierarchyDatum",{level:(t.depth??-1)+1,count:t.children.length,description:e})}getCategoryValue(t){}datumIndexForCategoryValue(t){}},Ss=class extends Mi{constructor(){super(...arguments),this.childrenKey="children",this.fills=Object.values(se),this.fillGradientDefaults=new Pi,this.fillPatternDefaults=new qt,this.strokes=Object.values(xs)}};g([b(O)],Ss.prototype,"childrenKey",2),g([b(O,{optional:!0})],Ss.prototype,"sizeKey",2),g([b(O,{optional:!0})],Ss.prototype,"colorKey",2),g([b(O,{optional:!0})],Ss.prototype,"colorName",2),g([b(ge(we(hs,us,dt)))],Ss.prototype,"fills",2),g([b(F)],Ss.prototype,"fillGradientDefaults",2),g([b(F)],Ss.prototype,"fillPatternDefaults",2),g([b(cn)],Ss.prototype,"strokes",2),g([b(cn,{optional:!0})],Ss.prototype,"colorRange",2);var KE=class{constructor(t,e,i,s){this.lon0=t,this.lat0=e,this.lon1=i,this.lat1=s}merge(t){this.lon0=Math.min(this.lon0,t.lon0),this.lat0=Math.min(this.lat0,t.lat0),this.lon1=Math.max(this.lon1,t.lon1),this.lat1=Math.max(this.lat1,t.lat1)}},Nh=Math.PI/180,Lg=t=>t*Nh,Cg=t=>-Math.log(Math.tan(Math.PI*.25+t*Nh*.5)),Ng=t=>t/Nh,Tg=t=>(Math.atan(Math.exp(-t))-Math.PI*.25)/(Nh*.5),ZE=class zg extends Rl{constructor(e,i){super(),this.domain=e,this.range=i,this.type="mercator",this.bounds=zg.bounds(e)}static bounds(e){const[[i,s],[n,r]]=e,o=Lg(i),a=Cg(s),l=Lg(n),c=Cg(r);return new B(Math.min(o,l),Math.min(a,c),Math.abs(l-o),Math.abs(c-a))}static fixedScale(){return new zg([[Ng(0),Tg(0)],[Ng(1),Tg(1)]],[[0,0],[1,1]])}toDomain(){}normalizeDomains(...e){let i=-1/0,s=1/0,n=-1/0,r=1/0;for(const o of e)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([e,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[(Lg(e)-this.bounds.x)*a+s,(Cg(i)-this.bounds.y)*l+n]}invert([e,i]){const[[s,n],[r,o]]=this.range,a=(r-s)/this.bounds.width,l=(o-n)/this.bounds.height;return[Ng((e-s)/a+this.bounds.x),Tg((i-n)/l+this.bounds.y)]}},XE=(w(),k(T)),kg=class Bg{constructor(){this.id=fi(this),this.axisGroup=new Xe({name:`${this.id}-AxisTicks`,zIndex:2}),this.labelSelection=re.select(this.axisGroup,me),this.interval=new Zn,this.label=new be,this.scale=new Ji,this.position="bottom",this.translationX=0,this.translationY=0,this.padding=0}attachAxis(e){e.appendChild(this.axisGroup)}calculateLayout(){const e=[],i=this.generateTicks(),{translationX:s,translationY:n}=this;return this.labelSelection.update(i.ticks.map(r=>this.createLabelDatum(r)),void 0,r=>r.tickId),this.labelSelection.each((r,o)=>{r.setProperties(o),o.visible&&e.push(r.getBBox())}),this.axisGroup.setProperties({translationX:s,translationY:n}),e.length>0?B.merge(e):void 0}getLabelParams(e){const{padding:i}=this,{translate:s}=e;switch(this.position){case"top":case"bottom":return{x:s,y:i,textAlign:"center",textBaseline:"top"};case"left":case"right":return{x:i,y:s,textAlign:"start",textBaseline:"middle"}}}inRange(e,i=.001){const[s,n]=ne(this.scale.range);return e>=s-i&&e<=n+i}createLabelDatum(e){const{x:i,y:s,textBaseline:n,textAlign:r}=this.getLabelParams(e);return{visible:!!e.tickLabel,tickId:e.tickId,fill:this.label.color,fontFamily:this.label.fontFamily,fontSize:this.label.fontSize,fontStyle:this.label.fontStyle,fontWeight:this.label.fontWeight,rotation:0,rotationCenterX:0,text:e.tickLabel,textAlign:r,textBaseline:n,x:i,y:s}}generateTicks(){const{minSpacing:e,maxSpacing:i}=this.interval,{maxTickCount:s,minTickCount:n,tickCount:r}=Xy(Wr(this.scale.range),1,e,i,Bg.DefaultTickCount,Bg.DefaultMinSpacing),o=this.getTicksData({nice:!0,interval:this.interval.step,tickCount:r,minTickCount:n,maxTickCount:s});if(this.position==="bottom"||this.position==="top"){const a=Es.getMeasurer({font:this.label}),{domain:l}=this.scale,h=l[0]>l[1]?-1:1;let u=-1/0*h;o.ticks=o.ticks.filter(d=>Math.sign(d.translate-u)!==h?!1:(u=d.translate+a.textWidth(d.tickLabel,!0)*h,!0))}return o}getTicksData(e){const i=[],s=e.nice?this.scale.niceDomain(e):this.scale.domain,n=this.scale.ticks(e,s),r=n.reduce((c,h)=>Math.max(c,(0,XE.countFractionDigits)(h)),0),o=[],a=Pd(),l=this.label.format?this.scale.tickFormatter({domain:s,ticks:n,fractionDigits:r,specifier:this.label.format}):c=>Rs(c,r);for(let c=0;c<n.length;c++){const h=n[c],u=this.scale.convert(h);if(!this.inRange(u))continue;const d=this.label.formatter?.({value:h,index:c,domain:s,fractionDigits:r,boundSeries:o})??l(h),p=a(d);i.push({tick:h,tickId:p,tickLabel:d,translate:u})}return{rawTicks:n,fractionDigits:r,ticks:i}}};kg.DefaultTickCount=5,kg.DefaultMinSpacing=10;var qE=kg,Co=(w(),k(T));function QE(t,e){const i=(0,Co.createElement)("button",Th("ag-charts-input ag-charts-button",e));return t.label!==void 0?i.append(t.label):(i.append(Tv(t.icon)),i.ariaLabel=t.altText),i.addEventListener("click",t.onPress),Un(i,e),i}function JE(t,e){const i=(0,Co.createElement)("input",Th("ag-charts-input ag-charts-checkbox",e));return i.type="checkbox",i.checked=t.checked,i.addEventListener("change",s=>t.onChange(i.checked,s)),i.addEventListener("keydown",s=>{Uu(s)&&(s.preventDefault(),i.click())}),Un(i,e),i}function t1(t,e){const i=(0,Co.createElement)("select",Th("ag-charts-input ag-charts-select",e));return i.append(...t.options.map(s=>{const n=(0,Co.createElement)("option");return n.value=s.value,n.textContent=s.label,n})),wt(i,"data-preventdefault",!1),i.value=t.value,i.addEventListener("change",s=>t.onChange(i.value,s)),Un(i,e),i}function e1(t,e){const i=(0,Co.createElement)("textarea",Th("ag-charts-input ag-charts-textarea",e));return i.value=t.value,i.addEventListener("input",s=>t.onChange(i.value,s)),Un(i,e),wt(i,"data-preventdefault",!1),i}function Tv(t){const e=(0,Co.createElement)("span",`ag-charts-icon ag-charts-icon-${t}`);return wt(e,"aria-hidden",!0),e}function Th(t,e){return e==null?t:`${t} ${e.class}`}var wg=class extends Je{constructor(t=""){super(),this.x=0,this.y=0,this.commands=[],this._d="",this.d=t}get d(){return this._d}set d(t){if(t!==this._d){this._d=t,this.commands.length=0;for(const[e,i,s]of t.matchAll(/([A-Z])([0-9. ]*)/g)){const n=s.split(/\s+/g).map(Number);this.commands.push([i,n])}this.checkPathDirty()}}updatePath(){const{path:t,x:e,y:i}=this;t.clear();let s=e,n=i;for(const[r,o]of this.commands)switch(r){case"M":t.moveTo(e+o[0],i+o[1]),s=e+o[0];break;case"C":t.cubicCurveTo(e+o[0],i+o[1],e+o[2],i+o[3],e+o[4],i+o[5]),s=e+o[4],n=i+o[5];break;case"H":t.lineTo(e+o[0],n),s=i+o[0];break;case"L":t.lineTo(e+o[0],i+o[1]),s=e+o[0],n=i+o[1];break;case"V":t.lineTo(s,i+o[0]),n=i+o[0];break;case"Z":t.closePath();break;default:throw new Error(`Could not translate command '${r}' with '${o.join(" ")}'`)}t.closePath()}};g([ot()],wg.prototype,"x",2),g([ot()],wg.prototype,"y",2);var No=class extends As{constructor(t){super(),this.sourceImage=t,this.x=0,this.y=0,this.width=0,this.height=0,this.opacity=1}render(t){const{ctx:e}=t,i=this.sourceImage;i&&(e.globalAlpha=this.opacity,e.drawImage(i,0,0,i.width,i.height,this.x,this.y,this.width,this.height)),super.render(t)}};g([G()],No.prototype,"x",2),g([G()],No.prototype,"y",2),g([G()],No.prototype,"width",2),g([G()],No.prototype,"height",2),g([G()],No.prototype,"opacity",2);var kv={};Ci(kv,{ButtonWidget:()=>ta,NativeWidget:()=>Vr,SliderWidget:()=>Xu,ToolbarWidget:()=>ic,WIDGET_HTML_EVENTS:()=>Ou,Widget:()=>gs,WidgetEventUtil:()=>ws});var Eg=(w(),k(T)),ll=(w(),k(T)),wv=(w(),k(T)),Ev="canvas-overlay",Og=class extends Il{constructor(t,e,i){super(),this.ctx=t,this.hideFns=[],this.moduleId=`popover-${e}`,i?.detached?this.element=(0,wv.createElement)("div"):this.element=t.domManager.addChild(Ev,this.moduleId),this.element.setAttribute("role","presentation"),this.destroyFns.push(()=>t.domManager.removeChild(Ev,this.moduleId))}attachTo(t){this.element.parentElement||t.element.append(this.element)}hide(t){const{lastFocus:e=this.lastFocus}=t??{};this.element.children.length!==0&&(this.hideFns.forEach(i=>i()),e?.focus(),this.lastFocus=void 0)}removeChildren(){this.element.replaceChildren()}showWithChildren(t,e){if(!this.element.parentElement)throw new Error("Can not show popover that has not been attached to a parent.");const i=(0,wv.createElement)("div","ag-charts-popover");if(e.ariaLabel!=null&&i.setAttribute("aria-label",e.ariaLabel),e.class!=null&&i.classList.add(e.class),i.replaceChildren(...t),this.element.replaceChildren(i),this.hideFns.push(()=>this.removeChildren()),e.onHide&&this.hideFns.push(e.onHide),e.initialFocus&&e.sourceEvent){const s=Yu(e.sourceEvent);s!==void 0&&(this.lastFocus=s,this.initialFocus=e.initialFocus)}return i}getPopoverElement(){return this.element.firstElementChild}updatePosition(t){const e=this.getPopoverElement();e&&(e.style.setProperty("right","unset"),e.style.setProperty("bottom","unset"),t.x!=null&&e.style.setProperty("left",`${Math.floor(t.x)}px`),t.y!=null&&e.style.setProperty("top",`${Math.floor(t.y)}px`),this.initialFocus?.focus(),this.initialFocus=void 0)}},Ov=class extends Og{setAnchor(t,e){this.anchor=t,this.fallbackAnchor=e,this.updatePosition(t),this.repositionWithinBounds()}showWithChildren(t,e){const i=e.anchor??this.anchor,s=e.fallbackAnchor??this.fallbackAnchor,n=super.showWithChildren(t,e);return i&&this.setAnchor(i,s),(0,ll.getWindow)().requestAnimationFrame(()=>{this.repositionWithinBounds()}),n}repositionWithinBounds(){const{anchor:t,ctx:e,fallbackAnchor:i}=this,s=this.getPopoverElement();if(!t||!s)return;const n=e.domManager.getBoundingClientRect(),{offsetWidth:r,offsetHeight:o}=s;let a=(0,ll.clamp)(0,t.x,n.width-r),l=(0,ll.clamp)(0,t.y,n.height-o);a!==t.x&&i?.x!=null&&(a=(0,ll.clamp)(0,i.x-r,n.width-r)),l!==t.y&&i?.y!=null&&(l=(0,ll.clamp)(0,i.y-o,n.height-o)),this.updatePosition({x:a,y:l})}},i1=class extends Ov{show(t){const e=t.items.map(s=>this.createRow(t,s)),i=this.showWithChildren(e,t);i.classList.add("ag-charts-menu"),i.setAttribute("role","menu"),this.menuCloser=Ym({orientation:"vertical",menu:i,buttons:e,sourceEvent:t.sourceEvent,closeCallback:()=>this.hide()}),this.hideFns.push(()=>{this.menuCloser?.finishClosing(),this.menuCloser=void 0})}createRow(t,e){const{menuItemRole:i="menuitem"}=t,s=e.value===t.value,n=(0,Eg.createElement)("div","ag-charts-menu__row");if(n.setAttribute("role",i),i==="menuitemradio"&&n.setAttribute("aria-checked",(t.value===e.value).toString()),typeof e.value=="string"&&(n.dataset.popoverId=e.value),n.classList.toggle("ag-charts-menu__row--active",s),e.icon!=null){const l=(0,Eg.createElement)("span",`ag-charts-menu__icon ${Kl(e.icon)}`);n.appendChild(l)}const r=e.strokeWidth!=null;if(r&&(n.classList.toggle("ag-charts-menu__row--stroke-width-visible",r),n.style.setProperty("--strokeWidth",r?`${e.strokeWidth}px`:null)),e.label!=null){const l=(0,Eg.createElement)("span","ag-charts-menu__label");l.textContent=this.ctx.localeManager.t(e.label),n.appendChild(l)}"altText"in e&&(n.ariaLabel=this.ctx.localeManager.t(e.altText));const o=()=>{t.onPress?.(e)},a=l=>{Uu(l)&&(o(),l.preventDefault(),l.stopPropagation())};return n.addEventListener("keydown",a),n.addEventListener("click",a),n.addEventListener("mousemove",()=>{n.focus({preventScroll:!0})}),n}},Rv=class extends Og{constructor(){super(...arguments),this.dragged=!1}setDragHandle(t){t.addListener("drag-start",e=>{t.addClass(this.dragHandleDraggingClass),this.onDragStart(e)}),t.addListener("drag-move",this.onDragMove.bind(this)),t.addListener("drag-end",()=>{t.removeClass(this.dragHandleDraggingClass),this.onDragEnd.bind(this)})}onDragStart(t){const e=this.getPopoverElement();e&&(t.sourceEvent.preventDefault(),this.dragged=!0,this.dragStartState={client:Lo.from(t.clientX,t.clientY),position:Lo.from(Number(e.style.getPropertyValue("left").replace("px","")),Number(e.style.getPropertyValue("top").replace("px","")))})}onDragMove(t){const{dragStartState:e}=this,i=this.getPopoverElement();if(!e||!i)return;const s=Lo.sub(Lo.from(t.clientX,t.clientY),e.client),n=Lo.add(e.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}},cl=class extends nt{};g([b(O,{optional:!0})],cl.prototype,"icon",2),g([b(O,{optional:!0})],cl.prototype,"label",2),g([b(O,{optional:!0})],cl.prototype,"ariaLabel",2),g([b(O,{optional:!0})],cl.prototype,"tooltip",2);var Pv=class extends ta{constructor(t){super(),this.localeManager=t}update(t){const{localeManager:e}=this;t.tooltip&&(this.elem.title=e.t(t.tooltip));let i="";if(t.icon!=null&&(i=`<span class="${Kl(t.icon)} ag-charts-toolbar__icon"></span>`),t.label!=null){const s=e.t(t.label);i=`${i}<span class="ag-charts-toolbar__label">${s}</span>`}this.elem.innerHTML=i}setChecked(t){wt(this.elem,"aria-checked",t)}},_v="ag-charts-toolbar__button--active",Rg=class extends ic{constructor(t,e="horizontal"){super(e),this.localeManager=t,this.horizontalSpacing=10,this.verticalSpacing=10,this.events=new Os,this.hasPrefix=!1,this.buttonWidgets=[],this.addClass("ag-charts-toolbar"),this.toggleClass("ag-charts-toolbar--horizontal",e==="horizontal"),this.toggleClass("ag-charts-toolbar--vertical",e==="vertical")}addToolbarListener(t,e){return this.events.addListener(t,e)}clearButtons(){for(const t of this.buttonWidgets)t.destroy();this.buttonWidgets.splice(0)}updateButtons(t){const{buttonWidgets:e}=this;for(const[i,s]of t.entries())(this.buttonWidgets.at(i)??this.createButton(i,s)).update(s);for(let i=t.length;i<e.length;i++)this.buttonWidgets.at(i)?.destroy();this.buttonWidgets.splice(t.length),this.refreshButtonClasses()}updateButtonByIndex(t,e){this.buttonWidgets.at(t)?.update(e)}clearActiveButton(){for(const t of this.buttonWidgets)t.toggleClass(_v,!1)}toggleActiveButtonByIndex(t){if(t!==-1)for(const[e,i]of this.buttonWidgets.entries())i.toggleClass(_v,t!=null&&t===e)}toggleButtonEnabledByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setEnabled(e)}toggleSwitchCheckedByIndex(t,e){t!==-1&&this.buttonWidgets.at(t)?.setChecked(e)}getButtonBounds(){return this.buttonWidgets.map(t=>this.getButtonWidgetBounds(t))}setButtonHiddenByIndex(t,e){this.buttonWidgets.at(t)?.setHidden(e)}getButtonWidgetBounds(t){const e=this.getBounds(),i=t.getBounds();return new B(i.x+e.x,i.y+e.y,i.width,i.height)}refreshButtonClasses(){const{buttonWidgets:t,hasPrefix:e}=this;let i,s,n;for(const[r,o]of t.entries())i=!e&&r===0||n!=o.section,s=r===t.length-1||o.section!=t.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(t,e){const i=this.createButtonWidget();return i.addClass("ag-charts-toolbar__button"),i.addListener("click",s=>{const n={index:t,...e instanceof nt?e.toJson():e},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:t}})}),e.section&&(i.section=e.section),this.buttonWidgets.push(i),this.addChild(i),i}},s1=class extends Rg{createButtonWidget(){return new Pv(this.localeManager)}},kh=(w(),k(T)),n1=class extends Rv{constructor(t,e,i){super(t,e),this.onPopoverMoved=i,this.dragHandleDraggingClass="ag-charts-floating-toolbar__drag-handle--dragging"}show(t,e={}){this.showWithChildren(t,{...e,class:"ag-charts-floating-toolbar"})}hide(){this.dragged=!1,super.hide()}getBounds(){const t=this.getPopoverElement();return new B(t?.offsetLeft??0,t?.offsetTop??0,t?.offsetWidth??0,t?.offsetHeight??0)}hasBeenDragged(){return this.dragged}setAnchor(t,e,i){const s=this.getPopoverElement();if(!s)return;const n=t.position??"above",{offsetWidth:r,offsetHeight:o}=s;let a=t.y-o-i,l=t.x-r/2;n==="below"?a=t.y+i:n==="right"?(a=t.y-o/2,l=t.x+e):n==="above-left"&&(l=t.x),this.updatePosition({x:l,y:a})}ignorePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="none")}capturePointerEvents(){const t=this.getPopoverElement();t&&(t.style.pointerEvents="unset")}updatePosition(t){const e=this.getBounds(),i=this.ctx.domManager.getBoundingClientRect();t.x=Math.floor((0,kh.clamp)(0,t.x,i.width-e.width)),t.y=Math.floor((0,kh.clamp)(0,t.y,i.height-e.height)),super.updatePosition(t),this.onPopoverMoved()}},r1=class extends Rg{constructor(t,e){super(t.localeManager),this.hasPrefix=!0,this.popover=new n1(t,e,this.onPopoverMoved.bind(this)),this.dragHandle=new o1(t.localeManager.t("toolbarAnnotationsDragHandle")),this.popover.setDragHandle(this.dragHandle)}show(t={}){this.popover.show([this.dragHandle.getElement(),this.getElement()],t)}hide(){this.popover.hide()}setAnchor(t){this.popover.setAnchor(t,this.horizontalSpacing,this.verticalSpacing)}hasBeenDragged(){return this.popover.hasBeenDragged()}ignorePointerEvents(){this.popover.ignorePointerEvents()}capturePointerEvents(){this.popover.capturePointerEvents()}onPopoverMoved(){const t=this.popover.getBounds();if(this.popoverBounds?.equals(t))return;this.popoverBounds=t.clone();const e=this.getButtonBounds();this.events.dispatch("toolbar-moved",{popoverBounds:t,buttonBounds:e})}getButtonWidgetBounds(t){const e=this.popover.getBounds(),i=super.getButtonWidgetBounds(t),s=this.dragHandle.getBounds();return new B(i.x+e.x-s.width,i.y+e.y,i.width,i.height)}},o1=class extends Vr{constructor(t){super((0,kh.createElement)("div","ag-charts-floating-toolbar__drag-handle"));const e=new Vr((0,kh.createElement)("span",`${Kl("drag-handle")} ag-charts-toolbar__icon`));e.setAriaHidden(!0),this.addChild(e),this.elem.title=t}},a1={...xb,...vb},l1={VERSION:Fr,_Scene:xg,_Theme:Sg,_Util:Dg,create:wn.create.bind(wn),createSparkline:wn.__createSparkline.bind(wn),setup:ng,isEnterprise:!1};if(typeof rs.exports=="object"&&typeof ko=="object"){var c1=(t,e,i,s)=>{if(e&&typeof e=="object"||typeof e=="function")for(let n of Object.getOwnPropertyNames(e))!Object.prototype.hasOwnProperty.call(t,n)&&n!==i&&Object.defineProperty(t,n,{get:()=>e[n],enumerable:!(s=Object.getOwnPropertyDescriptor(e,n))||s.enumerable});return t};rs.exports=c1(rs.exports,ko)}return rs.exports});